Skip To Content

Use the model

You can use the HF Pixel Classification model in the Classify Pixels Using Deep Learning tool available in the Image Analyst toolbox in ArcGIS Pro. Follow the steps below to use the model for classifying pixels in images.

Classify pixels

Use the following steps to classify pixels from the imagery:

  1. Download the HF Pixel Classification model and add the imagery layer in ArcGIS Pro.
  2. Zoom to an area of interest.
    High-resolution imagery
  3. Browse to Tools on the Analysis tab.
    Tools on the Analysis tab
  4. Click the Toolboxes tab in the Geoprocessing pane, select Image Analyst Tools, and browse to the Classify Pixels Using Deep Learning tool under Deep Learning.
    Classify Pixels Using Deep Learning tool
  5. Set the variables on the Parameters tab as follows:
    1. Input Raster—Select the imagery.
    2. Output Raster Dataset—Set the output classified raster name that will contain the classification results.
    3. Model Definition—Select the model .dlpk file.
    4. Arguments —Change the values of the arguments if required.
      • huggingface_id—The model id of a pretrained Image Segmentation model hosted on huggingface.co

        Image Segmentation models can be filtered by choosing the Image Segmentation tag in the Tasks list on the Hugging Face model hub, as shown below:

        Pixel Classification on the model hub

        The model id consists of the {username}/{repository} as displayed at the top of the model page, as shown below:

        Model ID

        Only those models that have config.json and preprocessor_config.json are supported. The presence of these files can be verified on the Files and versions tab of the model page, as shown below:

        config.json and preprocessor_config.json on the Files and versions tab
      • padding—The number of pixels at the border of image tiles from which predictions are blended for adjacent tiles. Increase its value to smooth the output while reducing edge artifacts. The maximum value of the padding can be half of the tile size value.
      • batch_size—The number of image tiles processed in each step of the model inference. This depends on the memory of your graphics card.
      • test_time_augmentation—Performs test time augmentation while predicting. This is a technique used to improve the robustness and accuracy of model predictions. It involves applying data augmentation techniques during inferencing, which means generating multiple slightly modified versions of the test data and aggregating the predictions. If True, predictions of flipped and rotated orientations of the input image will be merged into the final output and their confidence values are averaged. This may cause the confidence to fall below the threshold for objects that are only detected in a few orientations of the image.
      • merge_policy—The policy for merging augmented predictions. Available options are mean, max, and min. This is only applicable when test time augmentation is used.
      • predict_background—If set to True, background class is also classified.
      Classify Pixels Using Deep Learning tool Parameters tab
      Note:

      To access the model directly from ArcGIS Pro (supported in ArcGIS Pro 3.4 and later), click the browse button and search for the model.

      Model definition search
  6. Set the variables on the Environments tab as follows:
    1. Processing Extent—Select Current Display Extent or any other option from the drop-down menu.
    2. Cell Size (required)—Set the value to 0.5.

    3. Processor Type—Select CPU or GPU.

      It is recommended that you select GPU, if available, and set GPU ID to specify the GPU to be used.

      Classify Pixels Using Deep Learning tool Environments tab
  7. Click Run.

    The output layer is added to the map.

    Classified results from the model

In this topic
  1. Classify pixels