Table of Contents
Fetching ...

Artefact-Aware Fungal Detection in Dermatophytosis: A Real-Time Transformer-Based Approach for KOH Microscopy

Rana Gursoy, Abdurrahim Yilmaz, Baris Kizilyaprak, Esmahan Caglar, Burak Temelkuran, Huseyin Uvet, Ayse Esra Koku Aksu, Gulsum Gencoglan

TL;DR

A transformer-based detection framework using the RT-DETR model architecture to achieve precise, query-driven localization of fungal structures in high-resolution KOH images, demonstrating the robust localization of low-contrast hyphae even in artefact-rich fields.

Abstract

Dermatophytosis is commonly assessed using potassium hydroxide (KOH) microscopy, yet accurate recognition of fungal hyphae is hindered by artefacts, heterogeneous keratin clearance, and notable inter-observer variability. This study presents a transformer-based detection framework using the RT-DETR model architecture to achieve precise, query-driven localization of fungal structures in high-resolution KOH images. A dataset of 2,540 routinely acquired microscopy images was manually annotated using a multi-class strategy to explicitly distinguish fungal elements from confounding artefacts. The model was trained with morphology-preserving augmentations to maintain the structural integrity of thin hyphae. Evaluation on an independent test set demonstrated robust object-level performance, with a recall of 0.9737, precision of 0.8043, and an AP@0.50 of 93.56%. When aggregated for image-level diagnosis, the model achieved 100% sensitivity and 98.8% accuracy, correctly identifying all positive cases without missing a single diagnosis. Qualitative outputs confirmed the robust localization of low-contrast hyphae even in artefact-rich fields. These results highlight that an artificial intelligence (AI) system can serve as a highly reliable, automated screening tool, effectively bridging the gap between image-level analysis and clinical decision-making in dermatomycology.

Artefact-Aware Fungal Detection in Dermatophytosis: A Real-Time Transformer-Based Approach for KOH Microscopy

TL;DR

A transformer-based detection framework using the RT-DETR model architecture to achieve precise, query-driven localization of fungal structures in high-resolution KOH images, demonstrating the robust localization of low-contrast hyphae even in artefact-rich fields.

Abstract

Dermatophytosis is commonly assessed using potassium hydroxide (KOH) microscopy, yet accurate recognition of fungal hyphae is hindered by artefacts, heterogeneous keratin clearance, and notable inter-observer variability. This study presents a transformer-based detection framework using the RT-DETR model architecture to achieve precise, query-driven localization of fungal structures in high-resolution KOH images. A dataset of 2,540 routinely acquired microscopy images was manually annotated using a multi-class strategy to explicitly distinguish fungal elements from confounding artefacts. The model was trained with morphology-preserving augmentations to maintain the structural integrity of thin hyphae. Evaluation on an independent test set demonstrated robust object-level performance, with a recall of 0.9737, precision of 0.8043, and an AP@0.50 of 93.56%. When aggregated for image-level diagnosis, the model achieved 100% sensitivity and 98.8% accuracy, correctly identifying all positive cases without missing a single diagnosis. Qualitative outputs confirmed the robust localization of low-contrast hyphae even in artefact-rich fields. These results highlight that an artificial intelligence (AI) system can serve as a highly reliable, automated screening tool, effectively bridging the gap between image-level analysis and clinical decision-making in dermatomycology.
Paper Structure (7 sections, 5 figures, 2 tables)

This paper contains 7 sections, 5 figures, 2 tables.

Figures (5)

  • Figure 1: Schematic overview of the study workflow: clinical sample collection, KOH preparation, microscopic imaging, expert annotation, and artificial intelligence modelling steps.
  • Figure 2: (a,b) Representative KOH microscopy image illustrating the multi-class annotation strategy used in the dataset. Clear fungal hyphae are marked with green bounding boxes, while confounding artefactual structures (e.g., fibers, refractive edges) are highlighted with purple boxes. Insets provide magnified views of the annotated regions of interest.
  • Figure 3: Overview of the model fungal detection pipeline. KOH microscopy images are preprocessed via letterbox resizing and normalization, then passed through the model architecture, which combines a CNN backbone, hybrid encoder, attention-based query selection, and a transformer decoder to produce bounding box predictions for both fungal elements and confounding artefacts. The model is trained using AdamW with cosine learning-rate scheduling, and inference is performed in real time with a confidence threshold of 0.25.
  • Figure 4: Image-level confusion matrix evaluating diagnostic performance across 254 test samples (89 positive, 165 negative). The model correctly identified all infected images with zero false negatives, yielding 98.8% overall accuracy.
  • Figure 5: Comprehensive qualitative evaluation and failure analysis of the proposed model. (a--c) Expert-defined Ground Truth (GT) annotations illustrating the primary training categories: fungal elements (fungi; green bounding boxes) and artefacts (purple bounding boxes). (d--f) Model inference results showing predicted fungal elements with corresponding confidence scores; panel (e) highlights successful discrimination between true fungal structures and visually similar artefactual mimics. (g--i) Comparative overlays of GT annotations and model predictions, including fungal detections (blue bounding boxes) and artefact predictions (orange bounding boxes), enabling direct visual assessment of class-wise localization performance. The high spatial overlap and correct class assignment across heterogeneous backgrounds demonstrate the model's robustness against common KOH microscopy artefacts.