Diff of /README.md [000000] .. [a22922]

Switch to unified view

a b/README.md
1
# IMPORTANT NOTICE: 
2
# A new improved version is available here: [MEDPSeg](https://github.com/MICLab-Unicamp/medpseg). 
3
# This repository is an old version referring to the papers listed below.
4
5
# Modified EfficientDet Segmentation (MEDSeg)
6
Official repository for reproducing lung, COVID-19, airway and pulmonary artery automated segmentation using our MEDSeg model.
7
8
The publication original publication for this method, **Multitasking segmentation of lung and COVID-19 findings in CT scans using modified EfficientDet, UNet and MobileNetV3 models**, has been published at the 17th International Symposium on Medical Information Processing and Analysis (SIPAIM 2021), and won the "SIPAIM Society Award".
9
http://dx.doi.org/10.1117/12.2606118
10
11
The presentation can be watched in YouTube:
12
https://www.youtube.com/watch?v=PlhNUD0Y4hg
13
14
We have also applied this model in the ATM22 Challenge (https://atm22.grand-challenge.org/). Airway segmentation is included, with a CLI argument (--atm_mode) to only segment the airway, using less memory. A short paper about this is published in arXiv **Open-source tool for Airway Segmentation in
15
Computed Tomography using 2.5D Modified EfficientDet: Contribution to the ATM22 Challenge**: https://arxiv.org/pdf/2209.15094.pdf
16
17
We have also trained this model to the PARSE Challenge (https://parse2022.grand-challenge.org/), (Pulmonary Artery segmentation). Pulmonary artery labels will be included in the outputs. The model achieved around 0.7 Dice in testing. An paper detailing this application will be published in the future. 
18
19
## Citation
20
* **COVID-19 segmentation and method in general**: Carmo, Diedre, et al. "Multitasking segmentation of lung and COVID-19 findings in CT scans using modified EfficientDet, UNet and MobileNetV3 models." 17th International Symposium on Medical Information Processing and Analysis. Vol. 12088. SPIE, 2021.
21
22
    * @inproceedings{carmo2021multitasking,\
23
  title={Multitasking segmentation of lung and COVID-19 findings in CT scans using modified EfficientDet, UNet and MobileNetV3 models},\
24
  author={Carmo, Diedre and Campiotti, Israel and Fantini, Irene and Rodrigues, L{\'\i}via and Rittner, Let{\'\i}cia and Lotufo, Roberto},\
25
  booktitle={17th International Symposium on Medical Information Processing and Analysis},\
26
  volume={12088},\
27
  pages={65--74},\
28
  year={2021},\
29
  organization={SPIE}\
30
}
31
32
* **Airway segmentation**: Carmo, Diedre, Leticia Rittner, and Roberto Lotufo. "Open-source tool for Airway Segmentation in Computed Tomography using 2.5 D Modified EfficientDet: Contribution to the ATM22 Challenge." arXiv preprint arXiv:2209.15094 (2022).
33
34
    * @article{carmo2022open,
35
  title={Open-source tool for Airway Segmentation in Computed Tomography using 2.5 D Modified EfficientDet: Contribution to the ATM22 Challenge},
36
  author={Carmo, Diedre and Rittner, Leticia and Lotufo, Roberto},
37
  journal={arXiv preprint arXiv:2209.15094},
38
  year={2022}
39
}
40
41
42
## Requirements
43
44
This tool was tested on Ubuntu 20.04 and Windows 10. The following instructions refer to quickly running the tool installing it with Miniconda and pip. Depending on the size of your input CT, you might need 32 GB of memory to run. I intend to reduce this memory requirement with future optimizations.
45
46
### ITKSnap
47
48
We use itksnap for visualization. 
49
50
You can easily install itksnap in Ubuntu with.
51
52
    sudo apt install itksnap
53
54
For windows, install using the self-install package in: http://www.itksnap.org/pmwiki/pmwiki.php?n=Downloads.SNAP3. In this case we assume the itksnap executable will be in "C:\\Program Files\\ITK-SNAP 3.8\\bin\\ITK-SNAP.exe". If this is different for you, change the "win_itk_path" argument when running.
55
56
### Miniconda
57
58
We recommend using a Miniconda environment for installation. To install Miniconda for Windows or Linux follow the instructions in: https://docs.conda.io/en/latest/miniconda.html. If you are on windows. All following commands should be executed in Anaconda Prompt (bundled with miniconda).
59
60
### GPU Usage: PyTorch
61
62
Now, install torch with CUDA GPU support. It can be easily installed with a single command depending on your environment. 
63
Follow the instructions for your OS on http://www.pytorch.org/. 
64
65
If you don't want to use a GPU, you can skip this part and trust the automatic installation of dependencies.
66
67
## Installation
68
69
All additional required libraries and the tool itself will be installed with the following steps. First, clone the repository. Then, due to the large size of network weights, you need to go into the Release in this repository, download the [data.zip](https://github.com/MICLab-Unicamp/medseg/releases/download/v2.5/data.zip) file and extract the .ckpt files inside the medseg/medseg folder. The .ckpt files should be in the same directory level as the run.py file. Finally, go into the top level folder (with the setup.py file) and install the tool with "pip install . ". The following command lines should do all those steps:
70
71
    git clone https://github.com/MICLab-Unicamp/medseg
72
    cd medseg/medseg
73
    wget https://github.com/MICLab-Unicamp/medseg/releases/download/v2.5/data.zip
74
    unzip data.zip
75
    cd ..
76
    pip install .
77
    
78
The above commands require git, unzip and wget which can be installed in Ubuntu with 
79
80
    sudo apt install git wget unzip
81
82
If you don't have them on your system.
83
84
## Running 
85
86
To run, just call it in a terminal.
87
88
    medseg
89
90
If you don't want to use a GPU, run this command:
91
92
    medseg_cpu
93
94
If you don't want to use the GUI, give --input_folder and --output_folder arguments to run in a folder of exams. If your ITKSNap installation is not on the assumed default locations, you can change where the tool will look for it. Check the --help command for more details and help in general.
95
96
## How to train?
97
98
This code is only intended to allow reproduction of the segmentation capabilities of our work. 
99
However, we provide the complete Lightning Module code (in seg_2d_module.py) which can be used under your workflow and data for training if you use PyTorch Lightning.
100
101
## Issues?
102
103
If you have any problems, make sure your pip is the same from your miniconda installation,
104
by checking if pip --version points to the miniconda directory.
105
106
If you have any issues, feel free to create an issue on this repository.
107
108
### Known Issue
109
110
"Long prediction" mode is not working due to recent changes in the architecutre. However not using it should be enough for most cases, Long Prediction uses more models in the final ensemble.