title | colorFrom | colorTo | sdk | app_port | emoji | pinned | license | app_file |
---|---|---|---|---|---|---|---|---|
LyNoS: automatic lymph node segmentation using deep learning |
indigo |
indigo |
docker |
7860 |
π« |
false |
mit |
demo/app.py |
LyNoS was developed by SINTEF Medical Image Analysis to accelerate medical AI research.
This repository contains the LyNoS dataset described in "Mediastinal lymph nodes segmentation using 3D convolutional neural network ensembles and anatomical priors guiding". The dataset has now also been uploaded to Zenodo and the Hugging Face Hub enabling users to more easily access the data through Python API.
We have also developed a web demo to enable others to easily test the pretrained model presented in the paper. The application was developed using Gradio for the frontend and the segmentation is performed using the Raidionics backend.
The dataset contains 15 CTs with corresponding lymph nodes, azygos, esophagus, and subclavian carotid arteries manual annotations. The folder structure is described below.
The easiest way to access the data is through Python with Hugging Face's datasets package:
from datasets import load_dataset
# downloads data from Zenodo through the Hugging Face hub
# - might take several minutes (~5 minutes in CoLab)
dataset = load_dataset("andreped/LyNoS")
print(dataset)
# list paths of all available patients and corresponding features (ct/lymphnodes/azygos/brachiocephalicveins/esophagus/subclaviancarotidarteries)
for d in dataset["test"]:
print(d)
A detailed interactive demo on how to load and work with the data can be seen on CoLab. Click the CoLab badge to see the notebook or alternatively click here to see it on GitHub.
βββ LyNoS.zip
βββ stations_sto.csv
βββ LyNoS/
βββ Pat1/
β βββ pat1_data.nii.gz
β βββ pat1_labels_Azygos.nii.gz
β βββ pat1_labels_Esophagus.nii.gz
β βββ pat1_labels_LymphNodes.nii.gz
β βββ pat1_labels_SubCarArt.nii.gz
βββ [...]
βββ Pat15/
βββ pat15_data.nii.gz
βββ pat15_labels_Azygos.nii.gz
βββ pat15_labels_Esophagus.nii.gz
βββ pat15_labels_LymphNodes.nii.gz
βββ pat15_labels_SubCarArt.nii.gz
For each labelled lymph node in the dataset, the primary, secondary, and up to the tertiary station have been manually assigned according to the IASLC Lung Cancer Staging guidelines, and more specifically following the 2009 map. The stations considered can be organized as follows:
βββ Supraclavicular nodes (stations 1R and 1L)
βββ Superior mediastinal nodes (stations 2-4)
β βββ Upper paratracheal (stations 2R and 2L)
β βββ Pre-vascular (stations 3aR and 3aL)
β βββ Pre-vertebral (station 3P)
β βββ Lower paratracheal (stations 4R and 4L)
βββ Aortic nodes (stations 5-6)
β βββ Subaortic (station 5)
β βββ Para-aortic (station 6)
βββ Inferior mediastinal nodes (stations 7-9)
β βββ Subcarinal (stations 7R and 7L)
β βββ Paraesophageal (stations 8R and 8L)
β βββ Pulmonary ligament (station 9)
βββ Hilar, lobar, and (sub)segmental nodes (stations 10-14)
βββ Hilar (stations 10R and 10L)
βββ Interlobar middle-lower (stations 11R and 11L)
βββ Lobar (stations 12R and 12L)
βββ Segmental (stations 13R and 13L)
βββ Subsegmental (stations 14R and 14L)
A larger dataset made of 90 patients featuring enlarged lymph nodes has also been made available by the National Institutes of Health, and is available for download on the official web-page. As a supplement to this dataset, lymph nodes segmentation masks have been refined for all patients and stations have been manually assigned to each, available here.
To access the live demo, click on the Hugging Face
badge above. Below is a snapshot of the current state of the demo app.
![Screenshot 2023-11-09 at 20 53 29](https://private-user-images.githubusercontent.com/29090665/281852035-ce661da0-d172-4481-b9b5-8b3e29a9fc1f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM2NzI3NTUsIm5iZiI6MTcyMzY3MjQ1NSwicGF0aCI6Ii8yOTA5MDY2NS8yODE4NTIwMzUtY2U2NjFkYTAtZDE3Mi00NDgxLWI5YjUtOGIzZTI5YTlmYzFmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE0VDIxNTQxNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTUyNTQ3MDMwODFjYjYzOGU0Njg1NjdlMjVmOTlkMGFmNzcxNTkzYjUwOGMxMGZjZTAxNzM5ZDMxYTRlMWU2N2UmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.CUh2wyK0myHECSBytiZ84docA5foVlnsuJ4M421TYBI)
Build Type | Status |
---|---|
HF Deploy | |
File size check | |
Formatting check |
Alternatively, you can deploy the software locally. Note that this is only relevant for development purposes. Simply dockerize the app and run it:
docker build -t lynos .
docker run -it -p 7860:7860 lynos
Then open http://127.0.0.1:7860
in your favourite internet browser to view the demo.
It is also possible to run the app locally without Docker. Just setup a virtual environment and run the app.
Note that the current working directory would need to be adjusted based on where LyNoS
is located on disk.
git clone https://github.com/raidionics/LyNoS.git
cd LyNoS/
virtualenv -python3 venv --clear
source venv/bin/activate
pip install -r ./demo/requirements.txt
python demo/app.py --cwd ./
If you found the dataset and/or web application relevant in your research, please cite the following reference:
@article{bouget2021mediastinal,
author = {David Bouget and AndrΓ© Pedersen and Johanna Vanel and Haakon O. Leira and Thomas LangΓΈ},
title = {Mediastinal lymph nodes segmentation using 3D convolutional neural network ensembles and anatomical priors guiding},
journal = {Computer Methods in Biomechanics and Biomedical Engineering: Imaging \& Visualization},
volume = {0},
number = {0},
pages = {1-15},
year = {2022},
publisher = {Taylor & Francis},
doi = {10.1080/21681163.2022.2043778},
URL = {https://doi.org/10.1080/21681163.2022.2043778},
eprint = {https://doi.org/10.1080/21681163.2022.2043778}
}
The code in this repository is released under MIT license.