Optimized Pixel Classification Using a Grid Model Tutorial

Use the TensorFlow Grid Classification tool to classify a raster using a trained grid model. The output is a classification vector.

You can also write a script to classify a raster using the TensorFlowGridClassification task.

Follow these steps:

  1. Open the TensorFlow Grid Classification dialog using one of the following options:
    • In the Deep Learning Guide Map, click the following button sequence: Grid > Grid Classification. The TensorFlow Grid Classification dialog appears. An advantage of this option is that if you accessed the Deep Learning Labeling Tool through the Guide Map and used it to create label rasters and train a model, the Guide Map knows about the trained model and automatically populates the Input Model field (Step 3 below) with that model file.
    • In the ENVI Toolbox, select Deep Learning > Grid > TensorFlow Grid Classification.
  2. In the Input Raster field of the TensorFlow Grid Classification tool, select a raster to classify. It must contain at least as many bands as the raster that was used to train the model.
  3. In the Input Trained Model field, select a trained TensorFlow grid model file in HDF5 format (.h5).
  4. In the Confidence Threshold field, enter a confidence score of 0.0 to 1.0. Grid cells with a score less than this value will be discarded. The default is 0.2.
  5. In the Output Classification Vector field, select a path and filename for the output classification vector (.shp).
  6. Enable the Display result check box to display the output in the view when processing is complete.

  7. To reuse these task settings in future ENVI sessions, save them to a file. Click the down arrow next to the OK button and select Save Parameter Values, then specify the location and filename to save to. Note that some parameter types, such as rasters, vectors, and ROIs, will not be saved with the file. To apply the saved task settings, click the down arrow and select Restore Parameter Values, then select the file where you previously stored your settings.

  8. To run the process in the background, click the down arrow and select Run Task in the Background. If an ENVI Server has been set up on the network, the Run Task on remote ENVI Server name is also available. The ENVI Server Job Console will show the progress of the job and will provide a link to display the result when processing is complete. See the ENVI Servers topic in ENVI Help for more information.

  9. Click OK.

Evaluate the Results


The output classification vector displays on top of the raster used for classification. Green boxes appear around areas containing features of interest. The following image shows an example of a grid vector overlayed on the raster used during classification. Areas that do not contain a grid cell (the green boxes) represent areas where no features were detected for the specified confidence threshold. This example uses the ENVI Deep Learning Grid Tutorial data with a confidence threshold of 0.90, searching for small boats.

Follow these steps to overlay the output classification vector on the Input Raster:

  1. Display the Input Raster in the current view.

  2. In the Layer Manager, click and drag the Input Raster below the vector classification output.

You can also view confidence values for each area of interest identified by the green boxes. This may help in determining whether your confidence threshold was set too high or too low, and help assess the accuracy of your model.

  1. In the Layer Manager right click the classification vector and select Filter Records by Attribute.

  2. In the Filter by Attributes dialog, select the Class_ID drop-down list, then select Confidence.

  3. Move the slider bar to the far right for a 0.999 confidence search. You can move the slider back and forth to see what a target area's confidence values are. Green squares will turn black to show the areas with the selected confidence value.

    Below is an example of areas identified with a 0.999% confidence that they contain a boat feature.

See Also


Train TensorFlow Grid Models, TensorFlow Optimized Object Classification, TensorFlow Optimized Pixel Classification