Skip to content

XinghaiLuo/BACL-Tooth-Segmentation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BACL: Boundary-Aware Curriculum Learning for Semi-Supervised Tooth Segmentation

This repository is the official implementation of the paper: "Semi-Supervised Tooth Segmentation in Panoramic Radiographs using Boundary-Aware Curriculum Learning".

BACL is a novel semi-supervised learning framework designed to address the challenges of boundary ambiguity and label scarcity in dental panoramic radiographs (PAN). By integrating uncertainty-driven boundary supervision with a confidence-aware curriculum learning strategy, our method progressively learns from easy-to-hard samples, achieving state-of-the-art performance with limited annotations.


🚀 News

  • [2025-11]: Code released. Includes the complete CurriculumBatchSampler and dual-decoder implementation.

🌟 Key Features

  • 📈 Progressive Curriculum Learning:
    • Staged Training: Transitions smoothly from a fully supervised phase (Stage 1) to a semi-supervised regime (Stage 2) based on validation performance.
    • Adaptive Sampling: Features a CurriculumBatchSampler that dynamically selects unlabeled samples based on difficulty scores derived from tooth count and standard deviation.
  • 🎯 Boundary-Aware Architecture:
    • Dual-Decoder Design: A shared encoder with two specialized decoders—one for semantic segmentation and one for boundary detection.
    • Uncertainty-Guided Supervision: Generates pseudo-boundary labels from the teacher model's uncertainty maps to refine edge fidelity.
  • 🔗 Topological Consistency:
    • Incorporates a connectivity loss to penalize disconnected components and internal holes, ensuring anatomically plausible segmentation.

🛠️ Architecture

alt text

The BACL framework consists of a Teacher-Student architecture utilizing a UNet backbone with a dual-decoder head.

  1. Supervised Phase: The model learns foundational features using labeled data with pixel-wise Cross-Entropy and Dice losses, plus explicit boundary supervision.
  2. Semi-Supervised Curriculum Phase: The model leverages unlabeled data via consistency regularization. A curriculum scheduler introduces harder samples (e.g., pediatric mixed dentition) only when the model is sufficiently confident.

💾 Installation

Requirements

  • Linux or Windows
  • Python 3.8+
  • PyTorch 1.10+
  • CUDA 11.0+

Steps

  1. Clone the repository:
    git clone https://github.com/XinghaiLuo/BACL-Tooth-Segmentation.git
    cd BACL-Tooth-Segmentation
  2. Install dependencies:
    pip install -r requirements.txt

📂 Data Preparation

Please organize your dataset as follows. The project includes a preprocessing script to convert images and LabelMe JSON annotations into the required .npy format.

data/
└── preprocess/
    ├── label_image/     # Labeled images (.npy)
    ├── label_mask/      # Labeled masks (.npy, 53 channels: Background + 52 FDI teeth)
    └── unlabel_image/   # Unlabeled images (.npy)

Preprocessing: To convert your raw data, run:

python utils/data_preprocess.py

This script resizes images to [700, 360] and generates multi-channel masks.


🏃‍♂️ Usage

Training

To train the model using the curriculum strategy:

python trainer/curriculum_self_train.py

Key Configuration (config/curriculum_self_train.json):

  • "use_curriculum": Set to true to enable the progressive learning strategy.
  • "stage1_performance_threshold": 0.35 (Dice score required to trigger the semi-supervised stage).
  • "boundary_weight": 0.1 (Weight for the boundary supervision loss).
  • "consistency_weight": 0.1 (Weight for the semi-supervised consistency loss).

Visualization

Training logs and visualizations (segmentation masks, uncertainty maps, curriculum progress) are saved to the log/ directory. View them using TensorBoard:

tensorboard --logdir log/curriculum_self_train

📊 Model Zoo & Results

We achieved state-of-the-art performance on clinical dental datasets, significantly outperforming existing semi-supervised methods.

Method Image DSC Instance DSC
UNet (Baseline) xx% xx%
Mean Teacher xx% xx%
CPS xx% xx%
BCP xx% xx%
BACL (Ours) xx% xx%

📜 Code Structure

BACL-Project/
├── config/             # Training configurations (JSON)
├── dataloader/
│   ├── tooth_loader_2d.py  # Dataset loader & CurriculumBatchSampler 
│   └── ...
├── model/
│   └── unet.py         # UNetWithBoundary & GaussianSmoothing layers 
├── trainer/
│   └── curriculum_self_train.py # Main training loop (Stage 1 -> Stage 2) 
├── utils/
│   ├── losses.py       # Dice, Connectivity, & Consistency losses 
│   └── utils.py        # Difficulty analysis & Metric calculations 
└── full_project_code.txt

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages