Python library designed to analyze and detect the sclerosis from MRI brain scans using advanced deep learning algorithms
Project description
Bachelor’s Thesis – University of Málaga (Sept 2024 – Jun 2025) Author: Emilio Rodrigo Carreira Villalta (emiliorodrigo.ecr@gmail.com)
Segmenting sclerosis lesions on 3‑D MRI volumes is a critical yet time‑consuming step in clinical workflows. This repository contains the open‑source code, experiments and analysis accompanying my bachelor’s thesis, which investigates the synergy between YOLOv11 object detection and nnUNet semantic segmentation, enhanced by a novel 3‑D consensus‑ensemble strategy.
Key features
- Dual‑model pipeline – combines fast YOLOv11 localisation with nnUNet high‑resolution segmentation.
- Rotation‑and‑cut consensus – aggregates predictions across multiple axial rotations and random 3‑D crops to mitigate viewpoint bias.
- Statistical benchmarking – leverages the SAES library to run non‑parametric tests and automatically generate LaTeX reports.
- HPC‑ready – training scripts tested on Málaga’s Picasso Supercomputer (SLURM job templates provided).
- Reproducible experiments –
configs/YAML files capture every run; hashes are logged with Weights & Biases.
Getting started
1. Clone & install
git clone https://github.com/rorro6787/neurodegenerative-disease-detector.git
cd neurodegenerative-disease-detector
python3 -m venv venv
source venv/bin/activate
2. Launch experiments
cd models
# Train the different YOLO and nnUNet models
python models_pipeline.py
3. Ensemble inference
An example Jupyter notebook that visualises the different nnUNet model inferences is available at notebooks/predict/visualize_segmentation.ipynb.
4. Statistical analysis
You can observe the statistical analysis results at notebooks/results/experimental_results.ipynb.
Repository structure
├── .github/ # Github Actions
├── information/ # Relevant Documents
├── neuro_disease_detector/ # Main Library
├── notebooks/ # Exploratory notebooks
├── picasso/ # Picasso files used for Experiments
├── tests/ # Test for the package
├── .gitignore
├── LICENSE.md
├── pyproject.toml
└── README.md
Results
See information/ThesisTFG.pdf for the full ablation study.
Citing
If you use this code, please cite:
@article{carreira2025sclerosis,
author = {Emilio Rodrigo Carreira Villalta},
title = {Deep Learning–Based MRI Segmentation for Sclerosis Using YOLOv11 and nnUNet},
journal = {To appear},
year = {2025}
}
License
This project is licensed under the MIT License – see LICENSE.md for details.
Acknowledgements
- University of Málaga & SCENIC research group for guidance.
- Málaga Supercomputing Center (Picasso) for GPU resources.
- The open‑source communities behind YOLO, nnUNet and PyTorch.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nnd-0.2.0.tar.gz.
File metadata
- Download URL: nnd-0.2.0.tar.gz
- Upload date:
- Size: 63.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cb4dcc9af44ffe4de2e1586b248719aecd31b36a16534823277316cb9a8b306c
|
|
| MD5 |
ca50cb328f285a0b98156c2d33f4adf3
|
|
| BLAKE2b-256 |
36d77516d2eccd377f0ea1b1a44c340826138359524068d16121f74e4fcc6937
|
Provenance
The following attestation bundles were made for nnd-0.2.0.tar.gz:
Publisher:
publish_pypi.yml on rorro6787/neurodegenerative-disease-detector
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nnd-0.2.0.tar.gz -
Subject digest:
cb4dcc9af44ffe4de2e1586b248719aecd31b36a16534823277316cb9a8b306c - Sigstore transparency entry: 227602355
- Sigstore integration time:
-
Permalink:
rorro6787/neurodegenerative-disease-detector@ef289e48e6937a20a2affd20d0a05fc3bb087f3b -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/rorro6787
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_pypi.yml@ef289e48e6937a20a2affd20d0a05fc3bb087f3b -
Trigger Event:
release
-
Statement type:
File details
Details for the file nnd-0.2.0-py3-none-any.whl.
File metadata
- Download URL: nnd-0.2.0-py3-none-any.whl
- Upload date:
- Size: 19.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f6e65c3a769081b0cde399598c1b28c1f1053d5b9a056f4c94aefc296b82da7f
|
|
| MD5 |
657f9bec1372c59041769c903f138271
|
|
| BLAKE2b-256 |
ec7b1ea2fbe2c01a65d81188732aef0daac54e3a8ae1fc12cf5fc63531abf3a1
|
Provenance
The following attestation bundles were made for nnd-0.2.0-py3-none-any.whl:
Publisher:
publish_pypi.yml on rorro6787/neurodegenerative-disease-detector
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nnd-0.2.0-py3-none-any.whl -
Subject digest:
f6e65c3a769081b0cde399598c1b28c1f1053d5b9a056f4c94aefc296b82da7f - Sigstore transparency entry: 227602364
- Sigstore integration time:
-
Permalink:
rorro6787/neurodegenerative-disease-detector@ef289e48e6937a20a2affd20d0a05fc3bb087f3b -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/rorro6787
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_pypi.yml@ef289e48e6937a20a2affd20d0a05fc3bb087f3b -
Trigger Event:
release
-
Statement type: