This project implements a deep learning medical image segmentation pipeline using the U-Net architecture in PyTorch.
The model is trained to segment maxillary sinus regions from grayscale Cone Beam CT (CBCT) slices, serving as a preliminary step to validate the segmentation pipeline before extending the approach to the segmentation of sinus pathologies such as sinusitis and mucosal wall thickening.
project/
│
├── train.py # Training script
├── test.py # Inference script
├── visualise_prediction.py # Prediction visualisation script
├── viz/ # Visualisation between image, groundtruth and prediction
├── unet/ # U-Net architecture implementation (milesial/Pytorch-UNet)
│
└── data/
├── train_img/ # Training images (PNG)
├── train_lab/ # Training masks (PNG)
├── test_img/ # Test images (PNG)
└── test_lab/ # Test masks (PNG)
Create conda environment from provided file:
conda env create -f environment.yml
conda activate maxsinusAlternatively, install via pip:
pip install -r requirements.txtpython train.pyThe trained model checkpoint will be saved as:
unet_model.pth
Training configuration:
- Loss: Binary Cross Entropy
- Optimizer: Adam
- Validation loss monitoring
- Batch training on 512×512 grayscale images
python test.pyPredicted segmentation masks will be saved to:
predictions/
python visualise_prediction.pyComparison images will be saved to:
viz/
Each visualisation contains:
- Original CBCT slice
- Ground truth mask
- Predicted segmentation mask
Dataset
Chen JY. rawdataACEM CBCT Dataset. Zenodo, 2024.
Available at: https://doi.org/10.5281/zenodo.14441638
This study utilises CBCT images from the dataset. Although the dataset contains axial, sagittal, and coronal planes, only axial slices were used for model training and evaluation in this project.
Related Research
Chen JY. (2025).
Convolutional neural network for maxillary sinus segmentation based on the U-Net architecture at different planes in the Chinese population: A semantic segmentation study.
https://doi.org/10.1186/s12903-025-06408-1
