Using a probability map
The integration of AI ML and DL algorithms in arivis has hugely facilitated the segmentation of complex structures from noisy images while requiring little by way of image processing experience for the users. Because of this, and thanks to significant improvement in GPU computing, it is now possible to use AI models that can be significantly better and overall faster than traditional algorithms in all aspects of the image analysis workflow. Indeed the AI Assisted method mentioned above uses a custom spine detection model to facilitate this type of analysis. However, it is also possible to use AI models for both neurite enhancement and spine detection if the included algorithms do not provide adequate results.
This complete pipeline uses a custom DL model to enhance both the neurites and the spine heads as separate classes, then uses the resulting probability maps to trace the neurites and segment the spines:
Note that the model must have been created in advance of the pipeline execution. These models can be created using arivis Cloud, and model creation is included in the arivis AI Toolkit module, but arivis supports any DL model that can be saved as an ONNX file for this purpose as well.
The first step in this case is to use the Deep Learning Reconstruction operation to create the probability maps. In our example the model has 2 classes, but it is also possible to run 2 separate DL reconstruction operations, each with its own single class to enhance the spines and neurites separately, or use DL to enhance the spines alone if the arivis tracing algorithms suffice for trace detection.
These probability maps are stored as temporary new channels that are available to the pipeline but automatically deleted upon pipeline completion. Consult this article on configuring the Result Storage operation to learn about storing the probability map permanently if needed.
In our example, the Neurite Tracer uses a threshold based algorithm on the Neurites probability map to detect the neurite. The Spine Tracer then uses both probability maps for the spine detection. The Trace channel is used to enhance the neck detection while the Probability map channel is used to detect the spines.
As before we still have the max. spine length parameter, but we also have a Head threshold parameter to optimise the spine detection. Since probability maps aren't necessarily binary and the results will depend on the quality of the model, some experimentation by the user with this parameter may be required to obtain the best results.