This project presents a pipeline for dental pathology detection using the YOLO12n model by Ultralytics. The core of this work involved adapting the public DENTEX dataset from its original Detectron2 format to the YOLO format, suitable for training with the latest YOLO models. The goal is to leverage a state-of-the-art, real-time object detector for the accurate and efficient identification of various dental conditions in panoramic X-ray images.
- Dataset Conversion: Development of a custom pipeline to convert the DENTEX dataset annotations from Detectron2's JSON format to the YOLO plain text format.
- Model Training: Training and validation of the YOLO12n model on a converted subset of the DENTEX dataset (approx. 700 images).
The detection model is based on YOLO12n, a recent, highly efficient real-time object detection model from Ultralytics. This choice was motivated by its balance of high accuracy and low inference latency, making it suitable for practical applications.
This work utilizes the DENTEX (Dental Enumeration and Diagnosis Benchmark for Panoramic X-rays) dataset. All credits for the data collection, annotation, and original publication belong to its creators.
- Original Repository: https://github.com/ibrahimethemhamamci/DENTEX
- Format Used: A subset of the original dataset was converted to YOLO format for this project.
- Python 3.9+
- PyTorch
- Ultralytics YOLO library
- Clone the repository:
git clone [https://github.com/](https://github.com/)[Your-Username]/[Your-Repository-Name].git
- Navigate to the project directory:
cd [Your-Repository-Name] - Install the required dependencies:
pip install -r requirements.txt
To run inference on a new image using the trained model, use the following example script:
!pip install ultralytics
from ultralytics import YOLO
# Load the custom-trained YOLO12n model
model = YOLO("yolo12n.pt")
# Train
results = model.train(
data="/content/dentex_yolo12n/data.yaml",
epochs=80,
imgsz=640,
batch=16,
name='dentex_train'
)
# The results object contains detections, masks, etc.
# To visualize the results with bounding boxes:
results = model.predict(
source="/content/dentex_yolo12n/images/val/train_655.png",
conf=0.25,
iou=0.7,
save=True,
save_crop=True,
save_txt=True
)
import matplotlib.pyplot as plt
plt.imshow(results[0].plot())
plt.axis('off')
plt.show()If you use DENTEX in your research, the original authors request references to the following papers:
@article{hamamci2023dentex,
title={DENTEX: An Abnormal Tooth Detection with Dental Enumeration and Diagnosis Benchmark for Panoramic X-rays},
author={Hamamci, Ibrahim Ethem and Er, Sezgin and Simsar, Enis and Yuksel, Atif Emre and Gultekin, Sadullah and Ozdemir, Serife Damla and Yang, Kaiyuan and Li, Hongwei Bran and Pati, Sarthak and Stadlinger, Bernd and others},
journal={arXiv preprint arXiv:2305.19112},
year={2023}
}
@inproceedings{hamamci2023diffusion,
title={Diffusion-based hierarchical multi-label object detection to analyze panoramic dental x-rays},
author={Hamamci, Ibrahim Ethem and Er, Sezgin and Simsar, Enis and Sekuboyina, Anjany and Gundogar, Mustafa and Stadlinger, Bernd and Mehl, Albert and Menze, Bjoern},
booktitle={International Conference on Medical Image Computing and Computer-Assisted Intervention},
pages={389--399},
year={2023},
organization={Springer}
}- The original DENTEX dataset is provided under the CC BY-SA 4.0 License.
- All custom code in this repository, including the conversion scripts and training pipeline, is provided under the MIT License.
Este projeto apresenta um pipeline para detecção de patologias dentárias utilizando o modelo YOLO12n da Ultralytics. O foco deste trabalho foi a adaptação do dataset público DENTEX, convertendo-o de seu formato original (Detectron2) para o formato YOLO, compatível com o treinamento dos modelos YOLO mais recentes. O objetivo é aplicar um detector de objetos de última geração e em tempo real para a identificação precisa e eficiente de diversas condições dentárias em imagens de raios-X panorâmicos.
- Conversão do Dataset: Desenvolvimento de um pipeline customizado para converter as anotações do dataset DENTEX do formato JSON (Detectron2) para o formato de texto plano (YOLO).
- Treinamento do Modelo: Treinamento e validação do modelo YOLO12n em um subconjunto convertido do dataset DENTEX (aprox. 700 imagens).
O modelo de detecção é baseado no YOLO12n, um recente e altamente eficiente modelo de detecção de objetos em tempo real da Ultralytics. Esta escolha foi motivada pelo seu equilíbrio entre alta acurácia e baixa latência de inferência, tornando-o adequado para aplicações práticas.
Este trabalho utiliza o dataset DENTEX (Dental Enumeration and Diagnosis Benchmark for Panoramic X-rays). Todos os créditos pela coleta, anotação e publicação original dos dados pertencem aos seus criadores.
- Repositório Original: https://github.com/ibrahimethemhamamci/DENTEX
- Formato Utilizado: Um subconjunto do dataset original foi convertido para o formato YOLO para este projeto.
- Python 3.9+
- PyTorch
- Biblioteca Ultralytics YOLO
- Clone o repositório:
git clone [https://github.com/](https://github.com/)[Seu-Usuario]/[Nome-Do-Repositorio].git
- Navegue até o diretório do projeto:
cd [Nome-Do-Repositorio] - Instale as dependências necessárias:
pip install -r requirements.txt
Para executar uma inferência em uma nova imagem utilizando o modelo treinado, use o seguinte script como exemplo:
!pip install ultralytics
from ultralytics import YOLO
# Carrega o modelo YOLO12n treinado
model = YOLO("yolo12n.pt")
# Realiza o treino do modelo
results = model.train(
data="/content/dentex_yolo12n/data.yaml",
epochs=80,
imgsz=640,
batch=16,
name='dentex_train'
)
# O objeto 'results' contém as detecções, máscaras, etc.
# Para visualizar os resultados com as caixas delimitadoras (bounding boxes):
results = model.predict(
source="/content/dentex_yolo12n/images/val/train_655.png",
conf=0.25,
iou=0.7,
save=True,
save_crop=True,
save_txt=True
)
import matplotlib.pyplot as plt
plt.imshow(results[0].plot())
plt.axis('off')
plt.show()Se você utilizar o DENTEX em sua pesquisa, os autores originais solicitam referências aos seguintes artigos:
@article{hamamci2023dentex,
title={DENTEX: An Abnormal Tooth Detection with Dental Enumeration and Diagnosis Benchmark for Panoramic X-rays},
author={Hamamci, Ibrahim Ethem and Er, Sezgin and Simsar, Enis and Yuksel, Atif Emre and Gultekin, Sadullah and Ozdemir, Serife Damla and Yang, Kaiyuan and Li, Hongwei Bran and Pati, Sarthak and Stadlinger, Bernd and others},
journal={arXiv preprint arXiv:2305.19112},
year={2023}
}
@inproceedings{hamamci2023diffusion,
title={Diffusion-based hierarchical multi-label object detection to analyze panoramic dental x-rays},
author={Hamamci, Ibrahim Ethem and Er, Sezgin and Simsar, Enis and Sekuboyina, Anjany and Gundogar, Mustafa and Stadlinger, Bernd and Mehl, Albert and Menze, Bjoern},
booktitle={International Conference on Medical Image Computing and Computer-Assisted Intervention},
pages={389--399},
year={2023},
organization={Springer}
}- O dataset original DENTEX é fornecido sob a licença CC BY-SA 4.0.
- Todo o código customizado neste repositório, incluindo os scripts de conversão e o pipeline de treinamento, é fornecido sob a Licença MIT.