Detection Transformers Fine-Tuning for Custom Object Detection
Firas Tlili
Published
Project Description
Detection Transformers Fine-Tuning for Custom Object Detection is an end-to-end deep learning project focused on building a high-precision bone fracture detection system using Transformer-based architectures.
The project leverages DETR (Detection Transformer) models, fine-tuned on a custom dataset of approximately 1,200 COCO-formatted X-ray images. The system is trained to detect and classify five distinct types of bone fractures, enabling accurate and automated analysis of medical imaging data.
Built with PyTorch Lightning and Hugging Face Transformers, the training pipeline is modular, scalable, and optimized for experimentation. It integrates data preprocessing, model training, validation, and evaluation into a streamlined workflow, ensuring reproducibility and efficient development cycles.
To enhance usability and interpretability, the system incorporates OpenCV and Supervision for visual validation. Predictions are displayed alongside ground truth annotations, allowing side-by-side comparison that supports clinical insight and model transparency.
The model achieves over 90% precision while maintaining fast inference speeds (under 50ms per image), making it suitable for real-time or near-real-time diagnostic support applications. Visualization tools, including Matplotlib, are used to monitor training performance and analyze results.
The dataset preparation and annotation process follows the COCO standard, ensuring compatibility with modern detection frameworks and tools such as Roboflow. Development and experimentation are conducted in environments like Google Colab and Jupyter Notebook, with version control managed through Git.
Overall, this project demonstrates the effectiveness of Transformer-based object detection models in the medical imaging domain, delivering a reliable and efficient solution for automated fracture detection with strong potential for real-world clinical applications.