Header: FILDL.h
Namespace: fil
Module: DeepLearning

Executes a Detect Anomalies 1 model on a single input image.


void fil::DL_DetectAnomalies1
	const fil::Image& inImage,
	const fil::DetectAnomalies1ModelId& inModelId,
	const bool inReconstruct,
	fil::Heatmap& outHeatmap,
	bool& outIsValid,
	float& outScore,
	bool& outIsConfident,
	ftl::Optional<fil::Image&> outReconstructedImage = ftl::NIL


Name Type Default Description
Input value
inImage const Image& Input image
Input value
inModelId const DetectAnomalies1ModelId& Identifier of a Detect Anomalies 1 model
Input value
inReconstruct const bool True Enables computing a reconstructed image, which may extend execution time
Output value
outHeatmap Heatmap& Returns a heatmap indicating found anomalies
Output value
outIsValid bool& Returns true if no anomalies were found
Output value
outScore float& Returns score of the image
Output value
outIsConfident bool& Returns false if the score is between T1 and T2
Output value
outReconstructedImage Optional<Image&> NIL Returns the reconstructed image


For input inImage only pixel formats are supported: 1⨯uint8, 3⨯uint8.

Read more about pixel formats in Image documentation.

Optional Outputs

The computation of following outputs can be switched off by passing value ftl::NIL to these parameters: outReconstructedImage.

Read more about Optional Outputs.


  • It is recommended that the deep learning model is deployed with DL_DetectAnomalies1_Deploy first and connected through the inModelId input.
  • If one decides not to use DL_DetectAnomalies1_Deploy, then the model will be loaded in the first iteration. It will take up to several seconds.


This filter should not be executed along with running Deep Learning Service as it may result in degraded performance or even out-of-memory errors.


List of possible exceptions:

Error type Description
DomainError Not supported inImage pixel format in DL_DetectAnomalies1. Supported formats: 1xUInt8, 3xUInt8.

See Also

  • Models for Deep Learning may be created using FabImage Deep Learning Editor or using Training Api.