AxonDeepSeg: Automatic Myelin and Axon Segmentation Using Deep Learning

Presented During:

Poster No:


Submission Type:

Abstract Submission 


Mathieu Boudreau1,2, Stoyan Asenov2, Vasudev Sharma3,4, Aldo Zaimi2, Julien Cohen-Adad2,5


1Montreal Heart Institute, Montreal, Canada, 2NeuroPoly Lab, Institute of Biomedical Engineering, Polytechnique Montreal, Montreal, Canada, 3NeuroPoly Lab, Institute of Biomedical Engineering, Polytechnique Montreal, Montreal, Quebec, 4School of Computer Science and Engineering, VIT University, Vellore, India, 5Functional Neuroimaging Unit, CRIUGM, Université de Montréal, Montreal, Canada

First Author:

Mathieu Boudreau  
Montreal Heart Institute|NeuroPoly Lab, Institute of Biomedical Engineering, Polytechnique Montreal
Montreal, Canada|Montreal, Canada


Stoyan Asenov  
NeuroPoly Lab, Institute of Biomedical Engineering, Polytechnique Montreal
Montreal, Canada
Vasudev Sharma  
NeuroPoly Lab, Institute of Biomedical Engineering, Polytechnique Montreal|School of Computer Science and Engineering, VIT University
Montreal, Quebec|Vellore, India
Aldo Zaimi  
NeuroPoly Lab, Institute of Biomedical Engineering, Polytechnique Montreal
Montreal, Canada
Julien Cohen-Adad  
NeuroPoly Lab, Institute of Biomedical Engineering, Polytechnique Montreal|Functional Neuroimaging Unit, CRIUGM, Université de Montréal
Montreal, Canada|Montreal, Canada


Quantitative MRI techniques that can probe tissue microstructure, such as diffusion MRI (NODDI, AxCaliber) (Duval 2016), magnetization transfer (Sled 2018), and myelin water fraction imaging (Alonso-Ortiz 2015) are under constant scrutiny when it comes to biological specificity (e.g. axon diameter, myelin density, g-ratio). One way to properly validate those techniques is histology, whereby a piece of tissue is imaged at the nanometer scale in order to derive statistics about the morphometrics of the cells within an equivalent MRI-voxel (e.g., axon diameter distribution). However, manually segmenting histology images is a time consuming endeavour that is prone to inconsistent labelling by the person doing the job or between multiple labellers. Several axon/myelin segmentation tools have been proposed using conventional image processing techniques (Liu 2011), however they are not flexible to multiple modalities, are not fully automatic, and don't harness the entire information potential of the images. We propose a deep learning approach in order to overcome these limitations, and to offer the neuroscience community a free and open-source alternative for segmenting myelin and axons in their histology slides. We also offer a graphical user interface (GUI) allowing for additional manual corrections if needed.


A U-net deep learning architecture (Ronneberger 2015) was developed in Python with Keras. Data pre-processing steps involve resampling the images to a standard pixel size, and generating 512x512 patches. Data augmentations (e.g. rotations, shifting, scaling, etc.) were implemented using Albumentations (Buslaev 2018). Two models were trained using scanning electron and transmission microscope (SEM and TEM) datasets, which consisted of rat spinal cords (SEM) and mouse brains (TEM), acquisition parameters are detailed in (Zaimi 2018). Ground truth data was manually segmented to identify three classes: myelin, axon, and background. Model training was performed on high performance NVIDIA P100 GPUs. Models were evaluated on testing data using the Dice coefficient. The code and demo Jupyter Notebooks are available on GitHub (, whereas the datasets are hosted on (

Both a command line interface (CLI) and GUI were developed. Usage is described in our documentation website ( The CLI is useful for processing large batches of data, whereas the GUI is useful for careful processing and manual correction of small datasets. The GUI was developed as a plugin for FSLeyes (McCarthy 2019). Lastly, a post-processing step to generate axon-wise morphometric statistics is available through the GUI.


Figure 1 displays a comparison of a test rat spinal cord histology slice manually segmented (b) and automatically segmented using AxonDeepSeg (c). Automatic segmentation was completed in 28 seconds on a 2016 MacBook Pro. For axons, the pixelwise accuracy and dice coefficients were 0.942 and 0.904; for myelin, they were 0.858 and 0.810.

Figure 2 shows the GUI interface of the FSLeyes plugin (a) and an example spreadsheet of morphometric statistics generated with AxonDeepSeg. The GUI interface lets you import an image, run and save an automatic segmentation, manually correct the mask, and generate a spreadsheet of morphometric data (b). The morphometrics data exported includes axon-wise position, g-ratio, axon and myelin area, axon diameter, myelin thickness, solidity, eccentricity, and orientation.
Supporting Image: ADS_figure1.png
   ·Figure 1. Image segmentation comparison. (a) raw image (1541x1096 pixels) of an SEM slice of a rat spinal cord (b) ground truth (manual segmentations) (c) automatic segmentation using AxonDeepSeg.
Supporting Image: ADS_figure2.png
   ·Figure 2. (a) AxonDeepSeg plugin for FSLeyes (b) Sample spreadsheet of morphometric statistics generated by AxonDeepSeg.


AxonDeepSeg (Zaimi 2018) is a fast, accurate, and open-source tool to automatically segment myelin in histology images. In addition, the FSLeyes plugin provides a GUI that makes it easy to use lets you do manual corrections when necessary. Future work will focus on implementing active learning (di Scandalea 2019) to improve the efficiency and performance of deep learning models using scarce data, an important limitation when considering biomedical images.

Modeling and Analysis Methods:

Diffusion MRI Modeling and Analysis 2
Segmentation and Parcellation 1


White Matter
Other - histology, cellular, myelin, neuron

1|2Indicates the priority used for review

My abstract is being submitted as a Software Demonstration.


Please indicate below if your study was a "resting state" or "task-activation” study.


Healthy subjects only or patients (note that patient studies may also involve healthy subjects):

Healthy subjects

Was any human subjects research approved by the relevant Institutional Review Board or ethics panel? NOTE: Any human subjects studies without IRB approval will be automatically rejected.

Not applicable

Was any animal research approved by the relevant IACUC or other animal research panel? NOTE: Any animal studies without IACUC approval will be automatically rejected.

Not applicable

Please indicate which methods were used in your research:

Postmortem anatomy
Other, Please specify  -   SEM, TEM

Provide references using author date format

Alonso-Ortiz, E. (2015), 'MRI-based myelin water imaging: A technical review', Magnetic Resonance in Medicine, 73(1), 70–81.
Buslaev, A. (2018), 'Albumentations: fast and flexible image augmentations', Retrieved from
di Scandalea, M. L. (2019), 'Deep Active Learning for Axon-Myelin Segmentation on Histology Data', Retrieved from
Duval, T. (2016), 'Modeling white matter microstructure', Functional Neurology, 31(4), 217–228.
Liu, T. (2012), 'Watershed merge tree classification for electron microscopy image segmentation', Proceedings of the 21st International Conference on Pattern Recognition (ICPR2012), 133–137.
McCarthy, P. (2019), 'FSLeyes'
More, H. L. (2011), 'A semi-automated method for identifying and measuring myelinated nerve fibers in scanning electron microscope images', Journal of Neuroscience Methods, 201(1), 149–158.
Ronneberger, O. (2015), 'U-Net: Convolutional Networks for Biomedical Image Segmentation. Medical Image Computing and Computer-Assisted Intervention', MICCAI 2015, 234–241.
Sled, J. G. (2018), 'Modelling and interpretation of magnetization transfer imaging in the brain', NeuroImage, 182, 128–135.
Zaimi, A. (2018), 'AxonDeepSeg: automatic axon and myelin segmentation from microscopy data using convolutional neural networks', Scientific Reports, 8(1), 3816.