Reliability of a convolutional neural network in segmenting multiple sclerosis lesions from MRI: Impact of data augmentation, image modality and tolerance with U-Net architecture.
Paper
Loaded from Europe PMC by your browser, not stored by OSCR: doi.org · Europe PMC
The paper is loaded when this pane is shown.
The authors' code
Python · 34 lines · 1.2 KB · CC-BY-4.0
- import nibabel as nib
- import numpy as np
- import os
- from scipy.ndimage import binary_closing, binary_dilation, binary_erosion, label, find_objects
- direc = 'Training_Labels/'
- numberoffiles = len(os.listdir(direc))
- print(numberoffiles)
- data_dir = 'NewDatasets/Training_Labels/Q1'
- # Load the binary NIfTI file
- for filename in os.listdir(direc):
- img = os.path.join(direc, filename)
- img = nib.load(img)
- data = img.get_fdata()
- # Threshold the image
- data_thresh = data < 1 # Holes are represented by 0s
- # Use connected component labeling to identify the holes
- labels, num_labels = label(data_thresh)
- # Calculate the volume of each hole
- for i in range(1, num_labels + 1):
- mask = labels == i
- volume = np.sum(mask)
- if volume > 13.5:
- # Fill the hole using a binary closing operation
- struct = np.ones((5, 5, 5)) # Use a 5x5x5 structuring element
- mask_closed = binary_closing(mask, structure=struct)
- data[mask_closed] = 1
- # Save the filled image as a new binary NIfTI file
- img_filled = nib.Nifti1Image(data.astype(np.uint8), img.affine, img.header)
- nib.save(img_filled, os.path.join(data_dir, filename))
FillholesnewUpload.py, under CC-BY-4.0 · at the source
Overview
- School of Engineering, University of Birmingham, Edgbaston, Birmingham, United Kingdom
- School of Computer Science, University of Birmingham, Edgbaston, Birmingham, United Kingdom
- Institute of Inflammation and Ageing, University of Birmingham, Edgbaston, Birmingham, United Kingdom
- University Hospitals Birmingham NHS Foundation Trust, Edgbaston, Birmingham, United Kingdom
- Royal North Shore Hospital, St Leonards, Sydney, New South Wales, Australia
- School of Neurology, Dudley Group NHS Foundation Trust, Russells Hall Hospital, Birmingham, United Kingdom
- School of Life and Health Sciences, Aston University, Birmingham, United Kingdom
Abstract
Multiple Sclerosis (MS) is an inflammatory demyelinating disease of the central nervous system, typically exhibiting radiologically identifiable lesions within the brain and spinal cord, features key to both diagnosis and clinical disease monitoring. Manually identifying and segmenting lesions is both difficult and time consuming, thus optimising approaches to reliably automate segmentation is highly beneficial. The aim of this study was to assess the impact of data augmentation and manipulation on the accuracy of automated lesion segmentation using MRI scans from MS patients. Factors examined include MRI modalities in both isolation and combination, image augmentation, lesion size and size of testing set relative to training. The MICCAI 2016 MS dataset was used in this study, with U-Net chosen as the algorithmic method for segmentation. Each factor was optimised and then combined to maximise segmentation accuracy; the Dice metric was used as the focal metric to assess the efficacy of any given permutation of the setup. Statistical significance was assessed using the Mann–Whitney U-test, with each permutation repeated five to ten times to ensure robustness. The best Dice score achieved using the testing and training dataset as outlined in the MICCAI 2016 challenge rubric was 0.59, approximately a 2% improvement against controls. To achieve this result whilst adhering to the training and testing distribution as defined in the dataset publication, the optimal imaging sequence was determined to be proton density. The augmentation conditions used included implementing an additional rotation of the dataset (doubling it in size) and excluding lesions < 36.43 mm3 in volume. The impact of data manipulation and augmentation was found to be statistically significant against controls using a Mann-Whitney U-test for lesion segmentation. An ancillary finding of this study was that there was no statistically significant difference between using one MRI modality for training and another for testing.
Reproduced under the paper's license (CC BY), from the paper cited above.
Repositories
Its files are read in the Code ↔ Paper reader above.
Zenodo 16211828
Availability: 1 check, the latest on 28 September 2026: the link answers (HTTP 200)
- 28 September 2026: the link answers (HTTP 200)
9 files
- MSLesionSegmentation/
FillholesnewUpload.py , Python, 34 lines - MSLesionSegmentation/
HolesAndVolumesUpload.py , Python, 59 lines - MSLesionSegmentation/
Losses.py , Python, 984 lines - MSLesionSegmentation/
MW.py , Python, 46 lines - MSLesionSegmentation/
RotateImagesDataset.py , Python, 180 lines - MSLesionSegmentation/
Train.py , Python, 34 lines - MSLesionSegmentation/
View.py , Python, 137 lines - MSLesionSegmentation/
utilities.py , Python, 488 lines - README.md, Text, 69 lines
adamhillingerszekely/unetbrainms
dcd9e39a693ce18df4059617e189cc95c1fbb63e, 5 May 2026Availability: 1 check, the latest on 28 September 2026: the link answers
- 28 September 2026: the link answers
9 files
- MSLesionSegmentation/
FillholesnewUpload.py , Python, 34 lines - MSLesionSegmentation/
HolesAndVolumesUpload.py , Python, 59 lines - MSLesionSegmentation/
Losses.py , Python, 984 lines - MSLesionSegmentation/
MW.py , Python, 46 lines - MSLesionSegmentation/
RotateImagesDataset.py , Python, 180 lines - MSLesionSegmentation/
Train.py , Python, 34 lines - MSLesionSegmentation/
View.py , Python, 137 lines - MSLesionSegmentation/
utilities.py , Python, 488 lines - README.md, Text, 72 lines
The paper's code and data availability statement is in the Data section.
Tracing map
Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.
What the map holds:
- 2 repositories of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
- 16 scripts, each with its path and the digest of its content;
- no match between paragraphs and code yet;
- neither the text of the paper nor the code itself.
Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.
Data
No dataset and no data link were found in the paper.
Data Availability
Data used can be found in publicly accessible data repositories: (Shanoir), https://
Reproduced under the paper's license (CC BY), from the paper cited above.
Versions
The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.
Version 1, 28 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 7 authors, 1 funder, 37 references.
Cite
This paper
Szekely-Kohn, A. C., Castellani, M., Baronti, L., Ahmed, Z., Manifold, W. G. K., Douglas, M., & Espino, D. M. (2026). Reliability of a convolutional neural network in segmenting multiple sclerosis lesions from MRI: Impact of data augmentation, image modality and tolerance with U-Net architecture. PLOS digital health, 5(4), e0001316. https://
BibTeX
@article{szekelykohn2026
author = {Szekely-Kohn, Adam C and Castellani, Marco and Baronti, Luca and Ahmed, Zubair and Manifold, William G K and Douglas, Michael and Espino, Daniel M},
title = {{Reliability of a convolutional neural network in segmenting multiple sclerosis lesions from MRI: Impact of data augmentation, image modality and tolerance with U-Net architecture}},
journal = {PLOS digital health},
year = {2026},
month = apr,
volume = {5},
number = {4},
pages = {e0001316},
publisher = {PLOS},
issn = {2767-3170},
doi = {10.1371/
url = {https://
pmid = {41920815},
pmcid = {PMC13042652}
}
RIS
TY - JOUR
AU - Szekely-Kohn, Adam C
AU - Castellani, Marco
AU - Baronti, Luca
AU - Ahmed, Zubair
AU - Manifold, William G K
AU - Douglas, Michael
AU - Espino, Daniel M
TI - Reliability of a convolutional neural network in segmenting multiple sclerosis lesions from MRI: Impact of data augmentation, image modality and tolerance with U-Net architecture
T2 - PLOS digital health
J2 - PLOS Digit Health
PY - 2026
DA - 2026/
VL - 5
IS - 4
SP - e0001316
SN - 2767-3170
PB - PLOS
DO - 10.1371/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1371/
"type": "article-journal",
"title": "Reliability of a convolutional neural network in segmenting multiple sclerosis lesions from MRI: Impact of data augmentation, image modality and tolerance with U-Net architecture",
"container-title": "PLOS digital health",
"author": [
{
"family": "Szekely-Kohn",
"given": "Adam C"
},
{
"family": "Castellani",
"given": "Marco"
},
{
"family": "Baronti",
"given": "Luca"
},
{
"family": "Ahmed",
"given": "Zubair"
},
{
"family": "Manifold",
"given": "William G K"
},
{
"family": "Douglas",
"given": "Michael"
},
{
"family": "Espino",
"given": "Daniel M"
}
],
"container-title-short":
"volume": "5",
"issue": "4",
"page": "e0001316",
"DOI": "10.1371/
"PMID": "41920815",
"PMCID": "PMC13042652",
"ISSN": "2767-3170",
"publisher": "PLOS",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
4,
1
]
]
}
}
The tracing map gets a citation of its own once an author has validated it and it has a DOI.
Similar papers
The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.
- [1] doi:10.1038/s41597-026-07184-5 [code]
- A Multiple Sclerosis MRI Dataset with Tri-Mask Annotations for Lesion Segmentation.Journal: Scientific dataIn common: scikit-image, NiBabel, scikit-learn, 3 other tools, multiple sclerosis, methods / tools, structural MRI / diffusion, 6 references
- [2] doi:10.1186/s12880-026-02481-2 [code]
- Deep learning-based neuroanatomical profiling reveals population-specific brain changes in multiple sclerosis: a large-scale Middle Eastern study.Journal: BMC medical imagingIn common: scikit-image, NiBabel, scikit-learn, 3 other tools, multiple sclerosis, structural MRI / diffusion, 6 references
- [3] doi:10.3389/fmed.2026.1875760 [code]
- Adaptive multi-stage domain unlearning for white-matter lesion segmentation.Journal: Frontiers in medicineIn common: scikit-image, NiBabel, PyTorch, 4 other tools, methods / tools, structural MRI / diffusion, 5 references
- [4] doi:10.3389/fnins.2026.1870124 [code]
- An end-to-end pipeline for automated fetal brain segmentation and biometry from 3D SSFP MRI.Journal: Frontiers in neuroscienceIn common: MONAI, scikit-image, NiBabel, 5 other tools, structural MRI / diffusion, 2 references
- [5] doi:10.1016/j.crmeth.2026.101473 [code]
- AmygdalaGo-BOLT for boundary-aware segmentation of the human amygdala.Journal: Cell reports methodsIn common: MONAI, scikit-image, NiBabel, 4 other tools, methods / tools, structural MRI / diffusion, 1 reference
- [6] doi:10.3389/frai.2026.1771088 [code]
- Few-shot deployment of pretrained MRI transformers in brain imaging tasks.Journal: Frontiers in artificial intelligenceIn common: MONAI, scikit-image, NiBabel, 5 other tools, methods / tools, structural MRI / diffusion
- [7] doi:10.64898/2026.07.15.26357954 [code]
- Portable Ultra-Low Field MRI Deep-Learning Algorithms for White Matter Lesion Segmentation Improve Accuracy and Reflect Clinical Disability in Multiple SclerosisJournal: medRxiv (preprint)In common: scikit-image, NiBabel, PyTorch, 4 other tools, multiple sclerosis, structural MRI / diffusion, 1 reference
- [8] doi:10.1136/jnnp-2025-335884 [code]
- Diffusivity anisotropy signature of slowly expanding lesions predicts progression independent of relapse activity in multiple sclerosis.Journal: Journal of neurology, neurosurgery, and psychiatryIn common: scikit-image, NiBabel, PyTorch, 4 other tools, multiple sclerosis, structural MRI / diffusion, 1 reference
- [9] doi:10.1038/s41598-026-54446-8 [code]
- Deep learning-based Desikan-Killiany parcellation of the brain using diffusion MRI.Journal: Scientific reportsIn common: MONAI, scikit-image, NiBabel, 3 other tools, methods / tools, structural MRI / diffusion, 1 reference
- [10] doi:10.1371/journal.pcbi.1014555 [code]
- Body surface potential driven personalisation of electrophysiological digital twins in hypertrophic cardiomyopathy.Journal: PLoS computational biologyIn common: MONAI, scikit-image, NiBabel, 5 other tools, structural MRI / diffusion
Contribute
The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.
Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 2 repositories of the authors' code, each at its verified commit and with its license, 16 scripts, and 0 matches between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:2a3753642d8cdb51…
Add the badge to its README
The badge links the code to this page. Copy one of these into the README of the paper's code: only you decide where it goes, and nothing is changed for you.
Markdown
[, paste the snippet at the top, then “Commit changes…” and, to review it first, “Create a new branch and start a pull request”. You open the pull request; OSCR asks for no permission.
Request its removal
To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).
Discussion, reproductions, activity
Discussion: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.
Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
