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

Switch to unified view

a b/README.md
1
# Automatic Segmentation for Lower Limb Bones & Muscles using Deep Learning
2
3
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
4
5
A robust deep learning-based pipeline for automatic segmentation of musculoskeletal structures from MRI scans, developed for the Tairawhiti paediatric imaging study. This tool enables efficient and accurate segmentation of the tibia, femur, fibula, and pelvis structures from MRI scans of children.
6
7
## Overview
8
9
The musculoskeletal structure of children remains a significantly underexplored domain in research, plagued by challenges in the analysis of medical imaging data. Within medical imaging workflows, segmentation plays a pivotal role by identifying and localizing anatomical structures, enabling the study of their morphological changes over time. Manual segmentation, especially in paediatric populations, is a laborious and time-intensive task that demands meticulous annotation by expert researchers.
10
11
This project addresses the challenge of automatic segmentation of lower limb musculoskeletal structures from MRI scans in paediatric populations. By leveraging transfer learning and advanced deep learning techniques, our solution outperforms state-of-the-art biomedical segmentation frameworks while maintaining high computational efficiency.
12
13
![image](https://github.com/asif-jc/Deep-Learning-Musculoskeletal-Automatic-Segmentation-/assets/126116359/469661d9-c3a0-45d1-8109-cb2372f06b6c)
14
15
## Features
16
17
- **Complete Segmentation Pipeline**: Data preprocessing, model training, inference, and post-processing
18
- **Transfer Learning Architecture**: ResNet34 U-Net model pre-trained on ImageNet
19
- **Multi-class Segmentation**: Simultaneously segments tibia, femur, fibula, and pelvis structures
20
- **User-friendly GUI**: Simple interface for preprocessing, segmentation, and visualization
21
- **Post-processing Algorithms**: Denoising and artifact removal for optimized segmentation results
22
- **High Performance**: Achieves 89% mean Dice Similarity Coefficient (DSC) across all bone groups
23
- **Model Transferability**: Demonstrates strong generalizability across different paediatric populations
24
25
## Repository Structure
26
27
```
28
├── AutoSegmentationGUI.py            # Main GUI application
29
├── Preprocessing Medical Data Pipeline/  # Data preprocessing components
30
│   ├── MSKMulticlass.py              # Multi-class segmentation mask creation
31
│   ├── preprocessing.py              # Core preprocessing functions
32
│   ├── data_augmentation.py          # Data augmentation utilities
33
│   ├── image_preprocessing.py        # Image processing functions
34
│   └── ...                           # Other preprocessing utilities
35
├── Deep Learning Segmentation Models/   # Model implementations
36
│   ├── 2D U-Net.ipynb                # Baseline 2D U-Net implementation
37
│   ├── ResNet34 U-Net.ipynb          # Transfer learning ResNet34 U-Net
38
│   └── nnUNet.ipynb                  # nnU-Net implementation and comparison
39
└── README.md                         # Project documentation
40
```
41
42
## Results
43
44
Our ResNet34 U-Net model demonstrates superior performance compared to baseline models and the state-of-the-art nnU-Net framework:
45
46
| Model | Mean DSC | Mean Volume Error (cm³) |
47
|-------|----------|-------------------------|
48
| ResNet34 U-Net | 0.89 | 8.4 |
49
| 2D U-Net (nnU-Net) | 0.85 | 13.7 |
50
| 3D U-Net (nnU-Net) | 0.82 | 14.8 |
51
| 2D U-Net | 0.73 | 23.9 |
52
53
Detailed performance across individual bone groups:
54
55
| Bone Structure | ResNet34 U-Net (DSC) |
56
|----------------|----------------------|
57
| Tibia | 0.93 ± 0.02 |
58
| Femur | 0.95 ± 0.01 |
59
| Fibula | 0.78 ± 0.04 |
60
| Pelvis | 0.88 ± 0.03 |
61
62
![image](https://github.com/asif-jc/Deep-Learning-Musculoskeletal-Automatic-Segmentation-/assets/126116359/516f6b75-d079-47ed-bac0-a4cdf73369bb)
63
64
## Installation
65
66
```bash
67
# Clone the repository
68
git clone https://github.com/username/Deep-Learning-Musculoskeletal-Automatic-Segmentation.git
69
cd Deep-Learning-Musculoskeletal-Automatic-Segmentation
70
71
# Set up a virtual environment
72
python -m venv venv
73
source venv/bin/activate  # On Windows: venv\Scripts\activate
74
75
# Install dependencies
76
pip install -r requirements.txt
77
```
78
79
### Dependencies
80
81
- Python 3.9+
82
- PyTorch 1.11+
83
- Keras 2.13+
84
- TensorFlow 2.13+
85
- SimpleITK 2.2+
86
- Nibabel 4.0+
87
- NumPy 1.22+
88
- PyDicom 2.4+
89
- PIL 9.3+
90
- scikit-learn 1.2+
91
92
## Usage
93
94
### Using the GUI
95
96
The easiest way to use the segmentation pipeline is through the provided GUI:
97
98
```bash
99
python AutoSegmentationGUI.py
100
```
101
102
The GUI allows you to:
103
1. Preprocess training data (DICOM MRI scans + NIFTI binary segmentation masks)
104
2. Preprocess inference/test data (raw DICOM MRI scans)
105
3. Run the automatic segmentation model
106
4. Visualize 2D slices of scans and masks
107
108
![image](https://github.com/asif-jc/Deep-Learning-Musculoskeletal-Automatic-Segmentation-/assets/126116359/878f69b6-6914-468a-8d0a-1f30ead7aa86)
109
110
### Preprocessing Pipeline
111
112
The preprocessing pipeline handles:
113
- DICOM to NIFTI conversion
114
- Image normalization
115
- Multi-class mask creation
116
- Data augmentation
117
- Dataset-specific preprocessing
118
119
![image](https://github.com/asif-jc/Deep-Learning-Musculoskeletal-Automatic-Segmentation-/assets/126116359/c4557e3a-0a0f-49c3-993b-7be684fdb241)
120
121
### Segmentation Model
122
123
Our ResNet34 U-Net model uses the following hyperparameters:
124
- Learning rate: Dynamic schedule starting at 1e-4 with 1e-6 decay per epoch
125
- Loss function: Combination of Dice Loss and Categorical Focal Loss
126
- Optimizer: Adam
127
- Batch size: 16
128
- Activation function: Softmax
129
130
![image](https://github.com/asif-jc/Deep-Learning-Musculoskeletal-Automatic-Segmentation-/assets/126116359/62c0de86-46cf-4a32-8128-1d35a37c2c5c)
131
132
## Model Training
133
134
The transfer learning approach uses:
135
1. ResNet34 backbone pre-trained on ImageNet
136
2. Customized U-Net decoder path
137
3. Skip connections to preserve spatial information
138
4. Early stopping based on validation loss convergence
139
140
## Citation
141
142
If you use this code in your research, please cite our work:
143
144
```bibtex
145
@article{cheena2023automatic,
146
  title={Automatic Segmentation for Lower Limb Bones \& Muscles using Deep Learning},
147
  author={Cheena, Asif Juzar and Rao, Pranav and Choisne, Julie},
148
  year={2023},
149
  publisher={University of Auckland}
150
}
151
```
152
153
## Acknowledgements
154
155
This research was conducted as part of the ENGSCI700: Part IV Project at the University of Auckland, supervised by Dr. Julie Choisne. The work contributes to the ongoing Tairawhiti paediatric imaging and computer modeling initiative in New Zealand.
156
157
## License
158
159
This project is licensed under the MIT License - see the LICENSE file for details.
160
161
## Contact
162
163
For questions or collaborations, please contact:
164
- Asif Juzar Cheena: ache234@aucklanduni.ac.nz
165
- Pranav Rao: prao582@aucklanduni.ac.nz