STELLA is a modular pipeline for medical-image segmentation and weak/interactive labelling built around SAM2 and a light classification stage. It supports preprocessing, mask generation, manual/assisted labelling ("Dobby" tool), data augmentation, and classifier training — all configurable from a single
configuration.ini. This repository is the official code for the paper "Toward Paediatric Digital Twins: STELLA-Segmentation Tool for Enhanced Localisation and Labelling of diagnostic Areas" by Roberta De Fazio, Maria Stella de Biase, Pierluigi Marzuillo, Paola Tirelli, Fiammetta Marulli, Stefano Marrone, Laura Verde.
- End-to-end pipeline: preprocess → segment (SAM2) → label (Dobby) → augment → classify → report.
- Config-first: reproducible runs controlled from
configuration.ini. - Batteries included: sensible defaults, ready-to-use folder bootstrap.
- Research-friendly: deterministic seeds, experiment dumps, and clean artifacts layout.
Requirements: Python 3.9+ and a CUDA-enabled GPU (optional but recommended).
# 1) Clone the repo
git clone https://github.com/Ste-lla02/stella.git
cd stella
# 2) (Recommended) Create a virtual environment
python3 -m venv .venv && source .venv/bin/activate # on Windows: .venv\\Scripts\\activate
# 3) Install dependencies
pip install -r requirements.txttorchvision==0.21.0
matplotlib==3.9.4
pandas==2.2.3
numpy==1.26.4
opencv-python==4.11.0.86
ipython==8.15.0
scikit-learn==1.6.1
Pillow==11.1.0
tensorflow==2.19.0
keras==3.9.2
seaborn==0.13.2
#optional: pytorch-cuda==11.8 (per platform)
git clone https://github.com/facebookresearch/segment-anything.git
wget -O models/sam_vit_h_4b8939.pth \
https://dl.fbaipublicfiles.com/segment_anything/sam_vit_h_4b8939.pthstella/
├── src/
│ └── ... # pipeline modules
├── Figures/ # figures & doc assets (add banner here)
├── experiments/
│ └── img/
│ ├── dumps/
│ ├── test/
│ ├── preprocessed/
│ └── masks/
├── models/ # SAM weights
├── experiments/output/
│ ├── models/
│ └─
9823
─ report_labels/
├── configuration.ini # main config file
├── main.py
└── README.md
Bootstrap folders (first run will also create them):
mkdir -p experiments/img/dumps \
experiments/img/test \
experiments/img/preprocessed \
experiments/img/masks \
experiments/input \
experiments/output/models \
experiments/output/report_labels \
experiments/modelsKey sections you may want to edit:
| Section | Key | Description |
|---|---|---|
[paths] |
input_dir, output_dir |
Where images and results live. |
[sam] |
weights_path, checkpoint, prompt_mode |
SAM2 model + prompting options. |
[preprocessing] |
resize, normalize, denoise |
Image prep before segmentation. |
[labelling] |
tool, save_masks |
Enable Dobby assisted labelling and mask export. |
[classification] |
preprocessing, augment, model |
Controls augmentation and the classifier stage. |
See the inline comments in
configuration.inifor all available options.
python3 main.py configuration.ini buildThis will run preprocessing and segmentation according to your config and save masks into experiments/img/masks/.
python3 main.py configuration.ini processUse the interactive tool to refine masks and export labels.
Ensure augmentation is enabled under [classification] → preprocessing.
python3 main.py configuration.ini classificationGenerates augmented data, trains the classifier, and writes reports to experiments/output/.
python3 main.py configuration.ini predictionClassifies masked images to predict unhealthy patients, writes reports to experiments/output/.
This repository accompanies the paper:
Toward Paediatric Digital Twins: STELLA – Segmentation Tool for Enhanced Localisation and Labelling of diagnostic Areas Roberta De Fazio, Maria Stella de Biase, Pierluigi Marzuillo, Paola Tirelli, Fiammetta Marulli, Stefano Marrone, Laura Verde. Procedia Computer Science, 2025. DOI: TBA.
@article{DeFazio2025,
title = {Toward Paediatric Digital Twins: STELLA—Segmentation Tool for Enhanced Localisation and Labelling of diagnostic Areas},
author = {De Fazio, Roberta and de Biase, Maria Stella and Marzuillo, Pierluigi and Tirelli, Paola and Marulli, Fiammetta and Marrone, Stefano and Verde, Laura},
journal = {Procedia Computer Science},
year = {2025},
doi = {TBA}
}Contributions are welcome! Please:
- Open an issue to discuss your idea.
- Fork and create a feature branch.
- Add tests (if applicable) and update docs.
- Open a PR with a clear description and screenshots where helpful.
Made with ❤️ by the STELLA authors — if this helps your research, consider ⭐ starring the repo.
