Skip to content

Add modules and pipeline for Auto3D #4743

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 of 6 tasks
mingxin-zheng opened this issue Jul 22, 2022 · 2 comments
Closed
1 of 6 tasks

Add modules and pipeline for Auto3D #4743

mingxin-zheng opened this issue Jul 22, 2022 · 2 comments

Comments

@mingxin-zheng
Copy link
Contributor

mingxin-zheng commented Jul 22, 2022

Is your feature request related to a problem? Please describe.
Motivation: Automating selection of deep neural network training pipelines with the following specific requirements:

  • Re-implement AutoML modules and pipeline under monai/apps/automl;
  • Implement module demo in tutorials;
  • Use monai.bundle to provide users with easy-to-read Python scripts and options to call the functions in bash and native python.

Describe the solution you'd like
Progress: #4765
Usage Proposal
https://github.com/mingxin-zheng/tutorials/blob/auto3d-1.0/auto3d/README.md

Tasks

  • Encapsulate data analysis module in a Python class. The module shall find data and label from user inputs and generate a summary (dictionary) of data stats. The summary includes
    • file names, list, number of files;
    • dataset summary (basic information, image dimensions, number of classes, etc.);
    • individual data information (spacing, image size, number and size of the regions, etc.).
  • Encapsulate the configuration module in a Python class. The module shall use the data stats dict/file to generate task related directory and Python code scripts (train.py/main.py/infer.py) for each specific algorithm
    • Implement an algorithm selection class to select algorithms for next step. The class is aimed to enable future smart algorithm selection;
    • It should use the monai.bundle to provide a native Python programming experience to the user
    • Note: for the current 1.0 release aim, only one network will be implemented
  • Encapsulate the multi-fold training processes in a class, or implement them in the pipeline class (see below)
  • Encapsulate the ensemble module in a class
  • Develop a new pipeline class to run all or selective modules sequentially, and provide results (segmentation predictions) to the user
    • Develop a pipeline for users to directly adopt trained/searched models for testing purpose (model infernece and ensemble) with their own datasets;
  • Python scripts in tutorials to demonstrate each of the modules and the pipeline class.
@wyli wyli added this to the Auto3D Seg framework [P0 v1.0] milestone Aug 1, 2022
@Nic-Ma Nic-Ma added this to MONAI v1.0 Aug 8, 2022
@dongyang0122 dongyang0122 changed the title Add modules and pipeline for AutoML Add modules and pipeline for Auto3D Aug 9, 2022
wyli pushed a commit that referenced this issue Aug 26, 2022
### Description
Implemented a DataAnalyzer class to encapsulate data analysis module. As the beginning part of the auto3d/automl pipeline, the module shall find data and label from user inputs and generate a summary (dictionary) of data stats. The summary includes
	- file names, list, number of files;
	- dataset summary (basic information, image dimensions, number of classes, etc.);
	- individual data information (spacing, image size, number and size of the regions, etc.).
The summary can be exported as a YAML file and a dictionary variable for use in Python

Example Usage:
```python
from monai.apps.auto3d.data_analyzer import DataAnalyzer

datalist = {
    "testing": [{"image": "image_003.nii.gz"}],
    "training": [
        {"fold": 0, "image": "image_001.nii.gz", "label": "label_001.nii.gz"},
        {"fold": 0, "image": "image_002.nii.gz", "label": "label_002.nii.gz"},
        {"fold": 1, "image": "image_001.nii.gz", "label": "label_001.nii.gz"},
        {"fold": 1, "image": "image_004.nii.gz", "label": "label_004.nii.gz"},
    ],
}

dataroot = '/datasets' # the directory where you have the image files (in this example we're using nii.gz)
analyser = DataAnalyzer(datalist, dataroot)
datastat = analyser.get_all_case_stats() # it will also generate a data_stats.yaml that saves the stats
```

### Status
Ready for Review 
Reference issue #4743.

### Types of changes
<!--- Put an `x` in all the boxes that apply, and remove the not applicable items -->
- [x] Non-breaking change (fix or new feature that would not break existing functionality).
- [x] New tests added to cover the changes.
- [x] Quick tests passed locally by running `./runtests.sh --quick --unittests  --disttests`.
- [x] In-line docstrings updated.
- [x] Documentation updated, tested `make html` command in the `docs/` folder.

Signed-off-by: Mingxin Zheng <[email protected]>
@mingxin-zheng mingxin-zheng moved this to In Progress in MONAI v1.0 Aug 29, 2022
@mingxin-zheng
Copy link
Contributor Author

Closing this issue because Auto3Dseg was successfully merged into the dev branch and released in MONAI 1.0 .

Repository owner moved this from In Progress to Done in MONAI v1.0 Sep 23, 2022
@mingxin-zheng
Copy link
Contributor Author

mingxin-zheng commented Sep 23, 2022

Design Diagram of Auto3DSeg
auto3d.pdf
auto3d drawio

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Done
Development

No branches or pull requests

4 participants