CHULA: Custom Heuristic Uncertainty-guided Loss
for Accurate Land Title Deed Segmentation πŸ“

Teerapong Panboonyuen

Supported by the Second Century Fund (C2F) Postdoctoral Fellowship, Chulalongkorn University

MIT License

πŸ”¬ Try CHULA in Google Colab

Experience the power of CHULA Loss with YOLOv8, v11, v12, or newer on real-world datasets.

πŸ’Š Medical Pills Detection Demo

🐘 African Wildlife Detection Demo (Multi-class)

πŸ’‘ CHULA supports both binary and multi-class detection, and is plug-and-play with YOLOv8+, including the latest versions (v11, v12+).

πŸ“œ Due to data access restrictions on Thai Land Title Deeds, public datasets like medical pills and African wildlife are used to demonstrate CHULA’s domain-agnostic capabilities.

CHULA is a novel Custom Heuristic Uncertainty-guided Loss designed for highly accurate segmentation and detection of Thai land title deeds. It uniquely combines:

  • Class-balanced cross-entropy loss
  • Aleatoric uncertainty modeling
  • Domain-specific heuristic priors

This loss can be seamlessly integrated with any segmentation or detection model (e.g., YOLOv12, DeepLabv3+) to improve performance on noisy, ambiguous, and structure-rich document images.

πŸš€ Achieved 61.3% mAP (AP50:95) on a real-world Thai land deed benchmark β€” significantly outperforming standard baselines.

🎯 Key Contributions

  • βœ… Unified loss combining uncertainty, class balance, and document heuristics
  • βœ… Support for low-resource, underrepresented classes (e.g., PIN, STAMP)
  • βœ… Full training & plug-and-play code for YOLO, DeepLab, and more
  • βœ… Multi-task learning support (segmentation + detection)

πŸ–ΌοΈ Accuracy vs Efficiency Trade-off

Accuracy Efficiency Trade-off

⏱️ Inference Latency Comparison

Inference Latency Comparison for YOLO

πŸ›°οΈ Dataset Sample

Sample Dataset

βœ… Sample Output with CHULA

CHULA Segmentation Result

πŸ“ˆ Overall CHULA Performance

CHULA Efficiency and Accuracy Comparison

πŸ” Convergence & FLOP Efficiency

Convergence and Component Effects with FLOP Result

βš™οΈ Integrate CHULA into Your Own Model

from chula.loss import CHULALoss
from chula.utils import compute_class_weights

# Auto-detect binary vs multi-class & compute weights
class_weights = compute_class_weights("datasets/medical-pills", num_classes=1).cuda()

loss_fn = CHULALoss(class_weights=class_weights, lambda_ce=1.0, lambda_unc=0.3, lambda_heu=0.5)
loss = loss_fn(pred_logits, targets, uncertainty_map)
    

🧠 Citation

If you use this work, please cite:

@article{panboonyuen2025chula,
  title={CHULA: Custom Heuristic Uncertainty-guided Loss for Accurate Land Title Deed Segmentation},
  author={Panboonyuen, Teerapong},
  year={2025}
}

πŸ› οΈ How to Use

git clone https://github.com/kaopanboonyuen/CHULA.git
cd CHULA
pip install -r requirements.txt

python train.py --config config.yaml
    

Directory format example:

data/
β”œβ”€β”€ train/
β”‚   β”œβ”€β”€ images/
β”‚   └── masks/
β”œβ”€β”€ val/
β”‚   β”œβ”€β”€ images/
β”‚   └── masks/
    

πŸ› οΈ Development & Research Lead

Teerapong Panboonyuen
πŸ“§ teerapong.pa@chula.ac.th
πŸ“ Chulalongkorn University, Bangkok, Thailand