This repository implements a Convolutional Neural Network (CNN) for predicting lumbar spine coordinates (x, y) from medical imaging data. It includes data preprocessing, model design, training pipelines, and evaluation scripts for regression tasks. Key techniques such as data augmentation, dropout, and batch normalization are employed to enhance model accuracy and robustness.
The dataset contains medical images of the lumbar spine along with their corresponding (x, y) coordinate labels. These labels indicate specific anatomical points on the spine.
- Images: Medical scans of lumbar spine regions (e.g., sagittal, coronal, axial views).
- Coordinates: Corresponding (x, y) points for key spinal locations.
The dataset is split into:
- Training Set
- Validation Set
- Test Set
Data Augmentation and Normalization are applied to improve model performance.
The CNN processes grayscale images (256x256 resolution) to predict two continuous values: x and y coordinates. Key components include:
- Convolutional Layers: Extract spatial patterns from images.
- MaxPooling Layers: Downsample feature maps to reduce computational cost.
- Batch Normalization: Stabilize and accelerate learning by normalizing activations.
- Dropout Layers: Mitigate overfitting by randomly deactivating neurons during training.
- Fully Connected Layers: Map extracted features to coordinate predictions.
- Input: 256x256 grayscale images
- Output: Predicted (x, y) coordinates
- Loss Function: Mean Squared Error (MSE)
- Optimizer: Adam
To set up the project locally:
-
Clone the repository:
git clone <repository_url> cd <repository_directory>
-
Install dependencies:
pip install -r requirements.txt
Ensure the dataset is correctly structured, and file paths are set in the code.
To train the model:
python train.py
- Default Training Parameters:
- Epochs: 50
- Batch Size: 32
- Learning Rate: 0.001
The script saves model checkpoints during training for later evaluation or fine-tuning.
To evaluate the model on the test dataset:
python evaluate.py
This computes performance metrics such as Mean Absolute Error (MAE) and Loss on the test set.
- Validation MAE: ~0.49
- Test Performance: Results may vary based on hyperparameter tuning and data augmentation.
Visualization scripts are included to plot:
- Predicted vs. True coordinates
- Loss curves during training
- Model Fine-Tuning: Experiment with deeper CNN architectures or alternative activation functions.
- Enhanced Augmentation: Explore advanced augmentation techniques to improve model generalization.
- Transfer Learning: Leverage pre-trained models for enhanced feature extraction.
- 3D Imaging Support: Extend the model to process 3D scans for comprehensive spinal analysis.
Lumbar_Coordinate_Dataset/
├── data/ # Dataset and related files
├── models/ # Saved models and checkpoints
├── scripts/ # Training, evaluation, and utility scripts
├── results/ # Evaluation results and visualizations
├── requirements.txt # Python dependencies
├── README.md # Project documentation
└── LICENSE # License information
Contributions are welcome! If you want to enhance the project:
- Fork the repository.
- Create a new branch (
git checkout -b feature-name
). - Commit your changes (
git commit -m "Add feature-name"
). - Push to the branch (
git push origin feature-name
). - Open a pull request for review.
This project is licensed under the MIT License. See the LICENSE file for details.