Classify Objects Using Deep Learning (Raster Analysis)

Summary

Runs a trained deep learning model on an input raster and an optional feature class to produce a feature class or table in which each input object or feature has an assigned class or category label.

Illustration

Classify Objects Using Deep Learning tool illustration

Usage

  • The raster analysis server Python environment must be configured with the proper deep learning framework Python API such as Tensorflow, CNTK, or something similar.

  • With this tool running, your raster analysis server calls a third-party deep learning Python API (such as TensorFlow or CNTK) and uses the specified Python raster function to process each raster tile.

  • The input model of this tool will only take a deep learning package (.dlpk file) item from the portal.

  • After the input model is selected or specified, the tool will obtain the model arguments information from the raster analysis server. The tool may fail to obtain such information if your input model is invalid or your raster analysis server isn’t properly configured with the deep learning framework.

Parameters

LabelExplanationData Type
Input Raster

The input image to classify. The image can be an image service URL, a raster layer, an image service, a map server layer, or an internet tiled layer.

Raster Layer; Image Service; Map Server; Map Server Layer; Internet Tiled Layer; String
Input Model

The deep learning model that will be used to classify objects in the input image. The input is the URL of a deep learning package (.dlpk) item that contains the path to the deep learning binary model file, the path to the Python raster function to be used, and other parameters such as preferred tile size or padding.

File
Output Name

The name of the feature service containing the classified objects.

String
Input Features
(Optional)

The feature service that identifies the location of each object or feature to be classified and labeled. Each row in the input feature service represents a single object or feature.

If no input feature service is specified, each input image will be classified as a single object. If the input image or images use a spatial reference, the output from the tool is a feature class in which the extent of each image is used as the bounding geometry for each labeled feature class. If the input image or images are not spatially referenced, the output from the tool is a table containing the image ID values and the class labels for each image.

Feature Layer; Map Server Layer; String
Model Arguments
(Optional)

The function model arguments to use for the classification. These are defined in the Python raster function class referenced by the input model. This is where you list additional deep learning parameters and arguments for experiments and refinement, such as a confidence threshold for adjusting the sensitivity. The names of the arguments are populated by the tool from the Python module on the Raster Analytics server.

Value Table
Class Label Field
(Optional)

The name of the field that will contain the class or category label in the output feature class.

If a field name is not specified, a new field named ClassLabel will be generated in the output feature class.

String
Processing Mode
(Optional)

Specifies how all raster items in a mosaic dataset or an image service will be processed. This parameter is applied when the input raster is a mosaic dataset or an image service.

  • Process as mosaicked imageAll raster items in the mosaic dataset or image service will be mosaicked together and processed. This is the default.
  • Process all raster items separatelyAll raster items in the mosaic dataset or image service will be processed as separate images.
String

Derived Output

LabelExplanationData Type
Output Objects

The output feature set.

Feature Set

arcpy.ra.ClassifyObjectsUsingDeepLearning(inputRaster, inputModel, outputName, {inputFeatures}, {modelArguments}, {classLabelField}, {processingMode})
NameExplanationData Type
inputRaster

The input image to classify. The image can be an image service URL, a raster layer, an image service, a map server layer, or an internet tiled layer.

Raster Layer; Image Service; Map Server; Map Server Layer; Internet Tiled Layer; String
inputModel

The deep learning model that will be used to classify objects in the input image. The input is the URL of a deep learning package (.dlpk) item that contains the path to the deep learning binary model file, the path to the Python raster function to be used, and other parameters such as preferred tile size or padding.

File
outputName

The name of the feature service containing the classified objects.

String
inputFeatures
(Optional)

The feature service that identifies the location of each object or feature to be classified and labeled. Each row in the input feature service represents a single object or feature.

If no input feature service is specified, each input image will be classified as a single object. If the input image or images use a spatial reference, the output from the tool is a feature class in which the extent of each image is used as the bounding geometry for each labeled feature class. If the input image or images are not spatially referenced, the output from the tool is a table containing the image ID values and the class labels for each image.

Feature Layer; Map Server Layer; String
modelArguments
[modelArguments,...]
(Optional)

The function model arguments to use for the classification. These are defined in the Python raster function class referenced by the input model. This is where you list additional deep learning parameters and arguments for experiments and refinement, such as a confidence threshold for adjusting the sensitivity. The names of the arguments are populated by the tool from the Python module on the Raster Analytics server.

Value Table
classLabelField
(Optional)

The name of the field that will contain the class or category label in the output feature class.

If a field name is not specified, a new field named ClassLabel will be generated in the output feature class.

String
processingMode
(Optional)

Specifies how all raster items in a mosaic dataset or an image service will be processed. This parameter is applied when the input raster is a mosaic dataset or an image service.

  • PROCESS_AS_MOSAICKED_IMAGEAll raster items in the mosaic dataset or image service will be mosaicked together and processed. This is the default.
  • PROCESS_ITEMS_SEPARATELYAll raster items in the mosaic dataset or image service will be processed as separate images.
String

Derived Output

NameExplanationData Type
outObjects

The output feature set.

Feature Set

Code sample

ClassifyObjectsUsingDeepLearning example 1 (Python window)

This example classifies features in a raster based on a classification model using deep learning in a raster analysis deployment and publishes the raster as a hosted imagery layer in your portal.

import arcpy

arcpy.ra.ClassifyObjectsUsingDeepLearning(
	"https://myserver/rest/services/Buildings/ImageServer", 
	"https://myserver/rest/services/Hosted/BuildingFootprints/FeatureServer/0",
	"https://myportal/sharing/rest/content/items/itemId", "BuildingDamage",
	"batch_size 4", "ClassLabel","PROCESS_AS_MOSAICKED_IMAGE")
ClassifyObjectsUsingDeepLearning example 2 (stand-alone script)

This example classifies features in a raster based on a classification model using deep learning in a raster analysis deployment and publishes the raster as a hosted imagery layer in your portal.

#---------------------------------------------------------------------------
# Name: ClassifyObjectsUsingDeepLearning_example02.py
# Requirements: ArcGIS Image Server
# Import system modules
import arcpy

# Set local variables
inputRaster = "https://myserver/rest/services/Buildings/ImageServer"
inputFeatures = "https://myserver/rest/services/Hosted/BuildingFootprints/FeatureServer/0"
inputModel = "https://myportal/sharing/rest/content/items/itemId"
outputName = "BuildingDamage"
modelArguments = "batch_size 4"
classLabelField = "ClassLabel"
processingMode = "PROCESS_AS_MOSAICKED_IMAGE"

# Execute Classify Objects Using Deep Learning 
arcpy.ra.ClassifyObjectsUsingDeepLearning(inputRaster, inputFeatures, 
	inputModel, outputName, modelArguments, classLabelField , processingMode)

Licensing information

  • Basic: Requires ArcGIS Image Server
  • Standard: Requires ArcGIS Image Server
  • Advanced: Requires ArcGIS Image Server