Skip To Content

Classify Pixels Using Deep Learning

Summary

In a raster analysis deployment, this tool runs a trained deep learning model on an input image to produce a classified raster published as a hosted imagery layer in your portal.

Usage

  • The raster analysis (RA) 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 RA 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) item from the portal.

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

Syntax

ClassifyPixelsUsingDeepLearning_ra (inputRaster, inputModel, outputName, {modelArguments})
ParameterExplanationData Type
inputRaster

The input image to classify. It 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; MapServer; Map Server Layer; Internet Tiled Layer; String
inputModel

The input is a URL of a deep learning package (.dlpk) item. It 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 image service of the classified pixels.

String
modelArguments
[modelArguments,...]
(Optional)

The function arguments 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 reading the Python module on the RA server.

Value Table

Derived Output

NameExplanationData Type
outRaster

The output raster dataset.

Raster Layer

Code sample

ClassifyPixelsUsingDeepLearning example 1 (Python window)

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

import arcpy

arcpy.ClassifyPixelsUsingDeepLearning_ra(
        "https://myserver/rest/services/landclassification/ImageServer",
        "https://myportal/sharing/rest/content/items/itemId",
"classifiedLand", "padding 0")
ClassifyPixelsUsingDeepLearning example 2 (stand-alone script)

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

#---------------------------------------------------------------------------
# Name: ClassifyPixelsUsingDeepLearning_example02.py
# Requirements: ArcGIS Image Server
# Import system modules
import arcpy
# Set local variables
inImage = "https://myserver/rest/services/ landclassification/ImageServer"
inModel = "https://myportal/sharing/rest/content/items/itemId"
outName = "classifiedLand"
modelArgs = "padding 0"
# Execute Classified Pixels Using raster analysis tool
arcpy.ClassifyPixelsUsingDeepLearning_ra(inImage, inModel, outName, modelArgs)

Licensing information

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

Related topics