Write and expand a great introduction section, 1.1 Problem Statement

1.2 Research Question

1.3 Research Gap
A thorough review of existing literature reveals three major research gaps that this study aims to bridge:

1.4 Contributions
This paper makes the following key contributions:
As a scientific paper 

For 

“Automated Dental Disease Classification with Improved YOLOv11 Architecture
Entesar Hamed I. Eliwa1*, Tarek Abd El-Hafeez2,3*

	Department of Mathematics and Statistics, College of Science, King Faisal University, P.O. Box: 400 Al-Ahsa, 31982, Saudi Arabia. <PRESIDIO_ANONYMIZED_EMAIL_ADDRESS>,
	Computer Science Unit, Deraya University, Minia 61765, Egypt; <PRESIDIO_ANONYMIZED_EMAIL_ADDRESS>
	Department of Computer Science, Faculty of Science, Minia University, Minia 61519, Egypt; <PRESIDIO_ANONYMIZED_EMAIL_ADDRESS>





*	Corresponding authors: Entesar Hamed I. Eliwa and Tarek Abd El-Hafeez

Abstract: 

Keywords: YOLOv11, Plant Disease Classification, Deep Learning, Crop Health Management, Automated Disease Detection, Multi-Class Classification, Agricultural Technology

	Introduction 

The remainder of this paper is organized as follows: Section 2 discusses the problem statement, research questions, and gaps in existing literature; Section 3 outlines the methodology, including dataset preparation, model architecture, and training procedures; Section 4 presents the results and analysis; Section 5 discusses the findings and future directions; and finally, Section 6 concludes the paper with a summary of key contributions and their implications for the dental sector.

1.1 Problem Statement

1.2 Research Question

1.3 Research Gap
A thorough review of existing literature reveals three major research gaps that this study aims to bridge:

1.4 Contributions
This paper makes the following key contributions:


	Related Work

Table 1. Applications of Deep Learning in Periodontal Diagnosis and Assessment
Study (Year)	Objective	Dataset	Model(s) Used	Performance Metrics	Key Findings
Yu et al. (2024) [1]
Tooth position recognition & segmentation	705 panoramic radiographs (80% train, 10% val, 10% test)	SegFormer	IoU: 0.89 (position), 0.85 (segmentation); F1: 0.93 (position), 0.91 (segmentation)	High correlation (>0.85) between AI and clinician RBL measurements.
Dai et al. (2024) [2]
Periodontitis staging	Periapical radiographs + clinical data	AlexNet, VGG16, ResNet18, RF, SVM	Accuracy: 0.87–0.97 (varies by stage)	Age/smoking correlated with periodontitis; heatmaps identified lesion regions.
Chen et al. (2023) [3]
Tooth/bone level detection	8,000 periapical radiographs (27,964 teeth)	YOLOv5, Mask R-CNN, VGG16, U-Net, Ensemble	Accuracy: 88.8% (tooth position), 97.0% (RBL)	AI outperformed dentists (90% vs. 76–78% accuracy).
Alotaibi et al. (2022) [4]
Tooth detection & numbering	1,724 intraoral periapical images (70% train, 20% val, 10% test)	VGG16 CNN	Precision/recall: 0.96 (panoramic), 0.87 (repository match)	High detection accuracy for restorations (89%) and missing teeth (94%).
Chang et al. (2022) [5]
Alveolar bone loss detection	236 patients (full-mouth radiographs)	VGG16 CNN	Accuracy: 73% (disease detection), 59% (severity classification)	Confusion matrix showed significant differences in model performance.
Jiang et al. (2022) [6]
RBL measurement	640 panoramic radiographs (80% train, 20% test)	U-Net + YOLO-v4	AUC: 0.89–0.90 (stages I–III); DSC >0.91	Reliable RBL staging; outperformed general practitioners.
Widyaningrum et al. (2022) [7]
CAL prediction	100 panoramic radiographs (+1,000 augmented)	GANs with partial convolutions	MAE: 1.04 mm (inpainted) vs. 1.50 mm (non-inpainted)	Inpainting significantly improved CAL prediction.
Krois et al. (2021) [8]
Periodontitis staging	1,300 panoramic radiographs (Charité/KGMU datasets)	U-Net + EfficientNet-B5	Accuracy: 88.2% (radiographs), 98.6% (clinical data)	Hybrid clinical/radiographic model improved staging accuracy.
Feres et al. (2018) [9]
Microbial profiling for periodontitis	435 patients (3,915 subgingival plaque samples)	SVM	Accuracy: 95%; F1-score: 86.6%	Multi-label U-Net outperformed Mask R-CNN in segmentation tasks.
Lee et al. (2018) [10]
Diagnosis of periodontal bone loss	1,740 periapical images (60% train, 20% val, 20% test)	Custom CNN (VGG19-based)	Accuracy: 81% (premolars), 77% (molars); AUC: 82.6% (premolars)	Comparable to periodontists; higher accuracy for severe cases.


	Methodology
	Preliminaries: 
The launch of YOLOv11 marks a pivotal moment in the progression of the YOLO algorithm, showcasing groundbreaking advancements in real-time object detection technologies. By leveraging the strengths of earlier versions, YOLOv11 enhances its functionality to encompass a broader array of computer vision tasks, such as pose estimation and instance segmentation, significantly expanding its utility across various domains [11] [12].
YOLOv11 exemplifies its adaptability by supporting a diverse set of computer vision tasks, as depicted in Figure 1. Its wide-ranging capabilities make it highly suitable for numerous real-world applications. Key tasks include:
	Object Detection: Identifying and pinpointing objects within images or video frames, delivering bounding boxes for each detected object. This feature is indispensable for applications like surveillance and autonomous driving.
	Instance Segmentation: Distinguishing and isolating individual objects at the pixel level. This level of detail is especially useful in areas such as medical imaging and manufacturing.
	Image Classification: Assigning entire images to predefined categories, making it perfect for tasks like product sorting and ecological research.
	Pose Estimation: Detecting key points in images or videos to evaluate movements or poses, which is advantageous in fitness tracking, sports analytics, and healthcare.
	Oriented Object Detection: Recognizing objects with specific orientation angles for enhanced localization, a capability vital for applications like aerial imagery and warehouse automation.
	Object Tracking: Following the movement of objects across sequences of images or video frames, is crucial for applications such as traffic monitoring and security.

Figure 1: Key architectural modules in YOLO11 [13].

YOLOv11 stands out due to its improved adaptability, allowing it to tackle challenging scenarios with greater accuracy and efficiency. This version emphasizes a balance between performance and practical application, aiming to effectively address modern challenges across various sectors [11].
Table 2 offers a detailed summary of the evolution of the YOLO series, tracing its development from 2015 with YOLOv1 to the advanced capabilities of YOLOv11 in 2024. The table highlights key milestones, including the introduction of single-stage object detection in YOLOv1 and the expansion into tasks such as instance segmentation, pose estimation, and oriented object detection in the latest versions. It also emphasizes architectural advancements, such as multi-scale training, anchor-free detection mechanisms, and the incorporation of transformers and generative adversarial networks (GANs). Additionally, the transition from the Darknet framework to PyTorch underscores YOLO's adaptability to modern deep-learning ecosystems. Each iteration of YOLO has contributed to significant improvements in accuracy, efficiency, and versatility, reinforcing its status as a pioneering and leading framework in the field of computer vision. This progression reflects YOLO's commitment to pushing the boundaries of real-time object detection and its expanding role in addressing diverse computer vision challenges.
Table 2: Evolution of YOLO Versions: Release Years, Supported Tasks, Key Contributions, and Frameworks [14].
Release	Year	Tasks Supported	Key Contributions	Framework
YOLOv1	2015	Object Detection, Basic Classification	Single-stage object detection	Darknet
YOLOv2	2016	Object Detection, Improved Classification	Multi-scale training, dimension clustering	Darknet
YOLOv3	2018	Object Detection, Multi-scale Detection	SPP block, Darknet-53 backbone	Darknet
YOLOv4	2020	Object Detection, Basic Object Tracking	Mish activation, CSPDarknet-53 backbone	Darknet
YOLOv5	2020	Object Detection, Basic Instance Segmentation	Anchor-free detection, SWISH activation	PyTorch
YOLOv6	2022	Object Detection, Instance Segmentation	Self-attention, anchor-free detection	PyTorch
YOLOv7	2022	Object Detection, Object Tracking, Instance Segmentation	Transformers, E-ELAN reparameterization	PyTorch
YOLOv8	2023	Object Detection, Instance Segmentation	GANs, anchor-free detection	PyTorch
YOLOv9	2024	Object Detection, Instance Segmentation	Consistent dual assignments for NMS-free training	PyTorch
YOLOv10	2024	Object Detection	Darknet	PyTorch
YOLOv11	2024	Object Detection, Instance Segmentation, Pose Estimation, Oriented Object Detection	C3k2 block, C2PSA spatial attention, enhanced feature extraction, reduced parameter count	PyTorch
3.2.  YOLOv11 for Real-Time Disease Detection
To complement the classification model, we integrate YOLOv11 for real-time detection of infected pomegranates. This object detection framework ensures precise localization and identification of diseased regions within fruit images, enabling rapid assessment in agricultural settings [15].
Pomegranate images are first preprocessed and resized to match the input dimensions of  YOLOv11. The model then employs an enhanced backbone network with improved convolutional layers and self-attention mechanisms to effectively identify disease symptoms. Optimized anchor box configurations ensure accurate bounding box predictions, while multi-scale feature learning enables the detection of both small and large disease-affected regions [16]. Finally, confidence thresholding is applied to filter out low-confidence predictions, ensuring high-precision disease detection as shown in Figure 2.
 
Figure 2. The general Structure of the proposed YOLOv11 detection pipeline.
Detecting and classifying pomegranate fruit diseases, YOLOv11 serves as a powerful tool for automated agricultural monitoring. The model can efficiently process images of pomegranates to identify various disease symptoms, such as fungal infections, bacterial spots, and nutrient deficiencies. By leveraging its advanced object detection capabilities, YOLOv11 can distinguish between healthy and diseased fruits with high precision, facilitating early diagnosis and targeted interventions. This approach not only enhances yield quality but also minimizes economic losses by enabling timely disease management in orchards [17].
Figure 3 illustrates the architecture of the YOLOv11 model, a state-of-the-art deep learning framework designed for real-time object detection and classification. YOLOv11 builds on the advancements of its predecessors by integrating enhanced feature extraction mechanisms, improved backbone networks, and more efficient anchor-free detection strategies. These enhancements enable the model to achieve superior accuracy in identifying and localizing multiple objects within an image while maintaining high inference speed [18]. The figure also highlights the model’s key components, including its convolutional layers, attention mechanisms, and multi-scale feature fusion techniques, which collectively contribute to its robust performance in detecting fine-grained patterns.
 
Figure 3. The general block diagram of the proposed YOLOV11 detection model.
The process begins with pomegranate fruit images being fed into the backbone network, where initial convolutional layers and specialized C3K2 blocks extract critical visual features [19]. These blocks use efficient 3×3 kernels to identify disease patterns while minimizing computational overhead, making them particularly effective for spotting small lesions and early infection signs that are crucial for agricultural applications. The Conv (Convolutional) blocks form the foundation, using 3×3 kernels to extract basic visual features (edges and textures) [20]. These are followed by C3K2 blocks, an enhanced version of CSP networks that efficiently process features through split-and-merge operations while reducing computational costs - particularly valuable for detecting small disease spots.
The neck section demonstrates YOLOv11's advanced feature fusion capabilities through its Spatial Pyramid Pooling Fast (SPFF) module and upsampling layers. The SPFF module combines multi-scale features to detect diseases of varying sizes, from large infected areas to tiny spots, while the C2PSA attention mechanism helps the model focus specifically on diseased regions by filtering out irrelevant background details [21]. This combination ensures high detection accuracy while maintaining the speed needed for real-time processing in field conditions.
Finally, the detection head generates precise predictions by outputting bounding boxes and classification labels for identified diseases. The architecture's multi-scale approach allows it to recognize both prominent and subtle symptoms, making it well-suited for automated agricultural monitoring systems. By integrating these innovations, YOLOv11 offers farmers a powerful tool for early disease detection that balances speed, accuracy, and efficiency in real-world orchard environments.
The integrated system combines YOLOv11 for initial disease detection and localization with a deep learning classifier for precise disease categorization, creating a robust two-stage workflow. In the first stage, YOLOv11 identifies and isolates infected pomegranate regions within input images, which are then cropped for detailed analysis. These cropped regions subsequently undergo classification through an iterative refinement model that enhances prediction accuracy through continuous learning. This dual-model architecture achieves both high detection precision and real-time processing capabilities, making it particularly effective for agricultural monitoring applications where rapid and accurate disease identification is critical. The synergy between detection and classification components ensures comprehensive analysis while maintaining system efficiency suitable for field deployment [22].


	The proposed framework 
	Dataset Description
Dataset Description
The DentalDisease dataset (v3) [1] represents a curated collection of dental images designed for automated oral health assessment. This publicly available benchmark dataset contains 8,058 clinically relevant images spanning 15 distinct pathological and non-pathological classes. Table 1 summarizes the dataset characteristics and class distribution:
Table 1. Dataset composition and class distribution
Characteristic	Specification	Count/Percentage
Total images	-	8,058
Training set	70% of total	5,647 images
Validation set	20% of total	1,617 images
Test set	10% of total	794 images
Image resolution	≤224×224 (maintained aspect ratio)	-

The dataset exhibits a hierarchical organization with specialized sub-classes for caries (including caries with tooth discoloration and caries with ulcer) and tooth discoloration (with original dataset references).

Table 2. Detailed class specifications and clinical relevance
Class Name	Clinical Significance	Example Cases	Potential Diagnostic Challenges
Calculus	Mineralized dental plaque	Supragingival/tartar deposits	Distinguishing from other discolorations
Gingivitis	Gum inflammation	Red, swollen gingival tissue	Early-stage detection
Caries (multiple variants)	Tooth decay processes	Enamel demineralization	Occlusal surface detection
Hypodontia	Congenitally missing teeth	Dental arch gaps	Differentiation from extractions
Ulcer	Oral mucosal lesions	Aphthous ulcers	Size variation detection
Tooth discoloration	Extrinsic/intrinsic staining	Fluorosis, tetracycline staining	Shade differentiation

3. Preprocessing Pipeline
All images underwent standardized preprocessing:
	Orientation normalization: EXIF metadata stripping and auto-rotation
	Dimensional standardization: Proportional resizing to fit within 224×224 pixels
	Quality control: Manual verification of class assignments (per dataset notes)
Notably, the dataset maintains:
	Original aspect ratios (no artificial stretching)
	Color fidelity (no artificial color augmentation)
	Clinical relevance (no synthetic cases)

5. Access and Usage
The dataset is available on Roboflow Universe link: https://universe.roboflow.com/rakshitha-m-s-nefdj/dentaldisease-pbral/dataset/3 and follows a standard directory-based classification structure, with images organized into class-labeled folders. 

 
Class Name	Description	Sample Images
Calculus	Mineralized dental plaque, often appearing as supragingival or tartar deposits. Challenges include distinguishing from other discolorations.	 
Gingivitis	Inflammation of the gums, characterized by red, swollen gingival tissue. Early-stage detection is crucial.	 
preview	Various forms of tooth decay, involving enamel demineralization. Detection on occlusal surfaces can be challenging.	 
Hypodontia	Congenitally missing teeth, leading to gaps in the dental arch. Differentiation from extractions is important.	 
Ulcer	Oral mucosal lesions, including aphthous ulcers. Variations in size can complicate diagnosis.	 
Tooth discoloration	Extrinsic or intrinsic staining, such as fluorosis or tetracycline staining. Shade differentiation can be challenging.	 
Figure 4: Sample Images of Dental Diseases. 
	The Proposed Model Steps
	FastDentalModel – ResNet 18
The methodology began with data preparation and preprocessing, where a dental disease dataset was obtained through the Roboflow API and organized into training, validation, and test sets. The code automatically checked for predefined splits of 80% for training, 10% for validation, and 10% for testing, creating these partitions if they did not already exist. Image preprocessing included resizing to 256×256 pixels, center cropping to 224×224, normalization using ImageNet mean and standard deviation values, and conversion to tensors. Data augmentation was intentionally excluded to prevent potential bias during model evaluation.
A custom convolutional neural network called FastDentalModel was developed using PyTorch, built upon a ResNet-18 backbone pretrained on ImageNet. The model architecture was modified to include a 512-unit dense layer with batch normalization, ReLU activation, and a dropout rate of 0.3, followed by an output layer sized according to the number of target classes. This design balanced computational efficiency with effective feature extraction, making it suitable for dental image classification tasks. The core classification model builds upon a pretrained ResNet-18 architecture, modified with additional fully connected layers featuring batch normalization and dropout regularization. The training process employs an AdamW optimizer with OneCycle learning rate scheduling, cross-entropy loss, and runs for 50 epochs with a batch size of 128. During training, the model periodically saves checkpoints and retains the best-performing version based on validation accuracy.
Key training parameters included a batch size of 128, 50 epochs, and mixed-precision training enabled through PyTorch's float32 matrix multiplication precision setting. To optimize GPU memory usage, gradient accumulation and CUDA performance enhancements such as benchmark mode were implemented. Model checkpoints were saved every five epochs to allow for training resumption in case of interruptions.
For evaluation, the algorithm computes multiple metrics including classification accuracy, per-class ROC-AUC scores, and generates a confusion matrix. Visualization components produce several diagnostic outputs: a 5×5 grid comparing true versus predicted labels with color-coded results, individual and combined ROC curves, and a heatmap-style confusion matrix. All results and visualizations are systematically organized into a compressed archive for download.
The implementation incorporates several optimizations including mixed-precision training, pinned memory for faster data loading, and persistent workers to reduce computational overhead. Error handling ensures robustness against dataset acquisition failures or visualization generation issues. The complete pipeline automatically manages the full workflow from data acquisition to model evaluation while maintaining reproducibility through implicit random seeding and explicit dependency management.
Algorithm 1 (FastDentalModel):
	Setup and Configuration:
	Import necessary libraries: torch, torchvision, sklearn, numpy, matplotlib.pyplot, seaborn, PIL, tqdm, and IPython.display.
	Clear outputs, release CUDA cache, set device, configure image size limit, backend configurations, and install Roboflow.
	Download and Setup Dataset:
	Define setup_dataset() to download the dataset using Roboflow.
	Handle errors and fallback to manual path if download fails.
	Define Model Architecture (FastDentalModel):
	Use ResNet18 as backbone, modify the final fully connected layer to match the number of classes.
	Data Loading (get_data_loaders):
	Prepare data transforms.
	Check and handle different dataset structures (standard split or random split).
	Create DataLoaders for train, validation, and test datasets.
	Plot Function (plot_true_vs_predicted):
	Define a function to plot true vs predicted labels for a number of images.
	Train Model (train_model):
	Define a function to train the model, including progress tracking, validation, and saving model checkpoints periodically.
	ROC Curves Plotting (plot_roc_curves):
	Generate and save ROC curves for each class and combined.
	Model Evaluation (evaluate_model):
	Evaluate model performance, generate metrics, plot confusion matrix, and visualize results.
	Main Function (main):
	Setup results directory.
	Get data loaders.
	Initialize and train the model.
	Evaluate model, plot results, zip, and download results.
	Execute Main Function

	Ablation Study for Enhanced YOLOv11 architecture 
1. Experimental Design
The study employed a comprehensive methodology for dental disease classification using an enhanced YOLOv11 architecture. We conducted a rigorous ablation study to evaluate the contribution of each novel component in our proposed Attention-Guided Multi-Scale Feature Fusion (AGMS-FF) module. The experimental design included a comparison of four model variants: baseline YOLOv11, multi-scale only, attention only, and full AGMS-FF implementation. This allowed us to isolate the impact of each enhancement on the model's performance. All experiments were conducted with identical training protocols and evaluation metrics to ensure a fair comparison.
2. Dataset Preparation
The dental disease dataset was acquired through the Roboflow API, containing standardized dental images across multiple disease categories. The dataset was partitioned into training (80%), validation (10%), and test (10%) sets, maintaining class distribution balance. Images were preprocessed with:
	Resizing to 256×256 pixels, followed by center cropping to 224×224. This ensured a consistent input size for the model.
	Normalization using ImageNet mean and standard deviation values. This step is crucial for improving the convergence and performance of the deep learning model by scaling the pixel values to a range that is more suitable for the network.
	Augmentation, including horizontal flips (p=0.5), slight HSV adjustments, and translations. Data augmentation was used to increase the diversity of the training data and improve the model's generalization ability. The specific augmentations were chosen to reflect realistic variations in dental images. The augmentation parameters were carefully selected based on preliminary experiments to avoid introducing artifacts or distorting the images in a way that would negatively impact training.
3. Model Architecture
The core architecture builds upon YOLOv11-nano with several key enhancements:
Attention Mechanisms:
	Channel Attention Module: Dynamic channel-wise feature recalibration with a learnable reduction ratio. This module allows the model to adaptively weight the importance of different feature channels, focusing on the most informative ones. The reduction ratio is dynamically calculated as max(1, in_channels // 16) to adapt to varying input sizes.
	Spatial Attention Module: Focus on diagnostically relevant regions using 7×7 convolutional filters. This module enables the model to learn where the most important spatial information is located in the image. A larger kernel size (7x7) was chosen to capture more contextual information.
Multi-Scale Feature Fusion:
	Parallel 1×1, 3×3, and 5×5 convolutional branches. This allows the model to capture features at different scales, improving its ability to recognize both fine-grained details and coarser structures.
	Feature concatenation with residual connections. The features from the different branches are concatenated and combined with the original input using a residual connection, which helps to alleviate the vanishing gradient problem and improve training.
	Dynamic channel adjustment based on input dimensions. The number of output channels in each branch is dynamically adjusted to ensure efficient feature fusion.
Optimized Classification Head:
	Replaced the standard YOLO head with AGMS-FF enhanced layers. The original YOLO classification head was replaced with our AGMS-FF module to improve its ability to extract and fuse relevant features.
	Adaptive average pooling before final classification. Adaptive average pooling was used to ensure that the feature maps are pooled to a fixed size, regardless of the input image size.
	Batch normalization and ReLU activation throughout. Batch normalization helps to stabilize training and improve convergence, while ReLU activation introduces non-linearity.
4. Training Protocol
The training process employed several advanced techniques:
	AdamW optimizer (lr=0.001) with cosine learning rate scheduling. AdamW was chosen for its effectiveness in training deep neural networks, and cosine learning rate scheduling was used to gradually reduce the learning rate over the course of training, which can help to improve convergence.
	20-epoch training with early stopping (patience=15, δ=0.001). Early stopping was used to prevent overfitting and save computational resources. The patience parameter was set to 15 epochs, and the delta parameter was set to 0.001.
	Large batch size (128) enabled by gradient accumulation. A large batch size was used to improve training stability and utilize the available GPU memory effectively. Gradient accumulation was employed to simulate a larger batch size when the available memory was limited.
	Mixed-precision training with NVIDIA Apex AMP. Mixed-precision training was used to accelerate training and reduce memory consumption by performing some operations in lower precision (FP16).
	Exponential Moving Average (EMA) of weights (decay=0.9999). EMA was used to smooth the model weights and improve generalization.
	Label smoothing (ε=0.1) for improved regularization. Label smoothing was used to reduce the model's confidence in its predictions and improve generalization.
5. Evaluation Metrics
Comprehensive evaluation included both quantitative and qualitative measures:
Primary Metrics:
	Classification accuracy
	Per-class and macro-average precision, recall, and F1-score
	ROC-AUC and Precision-Recall AUC
Diagnostic Visualizations:
	Confusion matrices (normalized and absolute)
	ROC and Precision-Recall curves
	Sample prediction grids highlighting errors
	Class activation maps for model interpretability (GradCAM or similar)
6. Ablation Study Design
The rigorous ablation study protocol included:
	Baseline YOLOv11 performance measurement
	Isolated evaluation of multi-scale components
	Independent assessment of attention mechanisms
	Full AGMS-FF implementation analysis
7. Implementation Details
The system was implemented in PyTorch with several optimizations:
	CUDA-accelerated training on NVIDIA GPUs
	Pinned memory for fast data loading
	Persistent workers to reduce overhead
	Automatic mixed precision training
	Comprehensive logging of all experiments
All experiments were conducted with fixed random seeds (42) to ensure reproducibility. The complete implementation, including visualization utilities and model definitions, required approximately 800 lines of Python code.
8. Statistical Analysis
Performance metrics were computed using scikit-learn with 95% confidence intervals. The ablation study results were analyzed using:
	One-way ANOVA for comparing model variants
	Tukey's HSD test for post-hoc analysis
	Effect size calculation using Cohen's d
This methodology provides a robust framework for dental disease classification while systematically evaluating the contribution of each architectural innovation through controlled experimentation.

The Dental Disease Classification with Enhanced YOLOv11 algorithm, covering its architecture, novel techniques, ablation study, and evaluation methodology:
________________________________________
1. Core Architecture: Enhanced YOLOv11 with AGMS-FF
The model builds upon YOLOv11-Nano (a lightweight variant) but introduces Attention-Guided Multi-Scale Feature Fusion (AGMS-FF) to improve classification accuracy.
Key Components:
(A) Channel Attention Module
	Purpose: Focuses on "what" features are important by weighting channels dynamically.
	Structure:
	Uses global average pooling (GAP) and global max pooling (GMP) to capture channel-wise statistics.
	Applies MLP with dynamic reduction ratio (adaptive to input channels).
	Combines GAP and GMP outputs for robust attention weights.
	Final output: Sigmoid-activated channel-wise scaling factors.
(B) Spatial Attention Module
	Purpose: Focuses on "where" important features are located in the image.
	Structure:
	Concatenates average-pooled and max-pooled spatial features.
	Processes them through a convolutional layer (kernel size configurable).
	Outputs a spatial attention mask (sigmoid-activated).
(C) Multi-Scale Feature Fusion
	Purpose: Captures features at different scales (1×1, 3×3, 5×5 kernels).
	Structure:
	Three parallel convolutional branches:
	1×1 conv (captures local features)
	3×3 conv (mid-range features)
	5×5 conv (broader contextual features)
	Features are concatenated and weighted by Channel + Spatial Attention.
	Residual connection ensures stable training.
(D) Enhanced YOLO Classifier Head
	Replaces the standard YOLO classification head with:
	Multiple AGMS-FF blocks (configurable count).
	Global Average Pooling (GAP) → Flatten → Final Dense Layer.
	Maintains compatibility with YOLO’s backbone and detection pipeline.
________________________________________
2. Ablation Study Methodology
The algorithm rigorously tests different components to validate their contributions:
Tested Variants:
Variant	Multi-Scale Convs	Attention Modules	Description
Baseline YOLOv11	❌	❌	Original YOLOv11 classifier
Multi-Scale Only	✅	❌	Only uses 1×1, 3×3, 5×5 convs
Attention Only	❌	✅	Only uses Channel+Spatial Attention
Full AGMS-FF	✅	✅	Complete proposed model
Evaluation Metrics:
	Accuracy (primary metric)
	Precision, Recall, F1-Score (per-class and macro-averaged)
	ROC-AUC (for class discrimination)
	PR-AUC (for imbalanced data)
	Confusion Matrix (error analysis)
________________________________________
3. Training & Optimization Strategies
The model uses several advanced techniques to improve convergence and generalization:
(A) Learning Rate Scheduling
	Cosine Annealing LR: Smoothly decreases LR for fine-tuning.
	Warmup (3 epochs): Gradually increases LR initially to stabilize training.
(B) Regularization Techniques
	Label Smoothing (ε=0.1): Reduces overconfidence in predictions.
	Weight Decay (L2=1e-4): Prevents overfitting.
	EMA (Exponential Moving Avg, β=0.9999): Smoothens model weights.
(C) Augmentation Strategies
	HSV Adjustments (Hue, Saturation, Value)
	Random Horizontal Flips (50% probability)
	Small Translations & Scaling (10-20% variation)
	No Mosaic/Mixup (disabled for classification tasks)
(D) Optimizer: AdamW
	Combines adaptive momentum (Adam) with proper weight decay.
	More stable than SGD for this task.
________________________________________
4. Evaluation & Visualization
The system generates comprehensive reports and interpretability tools:
(A) Confusion Matrix
	Raw counts + Normalized (% per class).
	Highlights most confused classes.
(B) ROC & PR Curves
	Per-class curves + Macro/Micro averages.
	Helps assess class-wise discriminative power.
(C) Sample Predictions
	Displays 10% misclassified images (prioritizing hard cases).
	Uses green/red borders for correct/incorrect predictions.
(D) Ablation Results Comparison
	Bar plots comparing all variants.
	CSV/JSON logs for reproducibility.
________________________________________
5. Key Advantages Over Standard YOLO
Feature	Standard YOLO	Enhanced YOLOv11 (AGMS-FF)
Multi-Scale Features	❌	✅ (1×1, 3×3, 5×5 convs)
Attention Mechanism	❌	✅ (Channel + Spatial)
Dynamic Feature Fusion	❌	✅ (Residual + Attention)
Ablation Study	❌	✅ (Proves effectiveness)
Medical Image Suitability	Moderate	✅ Optimized for dental disease
________________________________________
6. Potential Improvements
	Deployability: Convert to TensorRT for real-time inference.
	Explainability: Add Grad-CAM for attention visualization.
	Data Efficiency: Test with semi-supervised learning.
________________________________________
Conclusion
This algorithm enhances YOLOv11 for dental disease classification by:
	Introducing AGMS-FF for better feature fusion.
	Validating design choices via ablation study.
	Using advanced training tricks (LR scheduling, EMA, etc.).
	Providing detailed diagnostics (ROC, PR, confusion matrices).
It is particularly suited for medical imaging tasks where small lesions (e.g., cavities, gum disease) require multi-scale + attention-based detection. 🚀



 
Figure 5. The framework of the proposed classification model.
	Performance Metrics

The performance of each model is evaluated using several standard metrics:

1. Confusion Matrix: 
   - A table that summarizes the performance of a classification algorithm, showing the counts of True Positives (TP), False Positives (FP), True Negatives (TN), and False Negatives (FN) [23].

2. Accuracy: 
   - The overall proportion of correct predictions, calculated as [24]:
                               Accuracy=(TP + TN)/(TP + FP + TN + FN)     		  		                         (1)
3. Precision:
   - The proportion of correct positive predictions, calculated as [25]:
     Precision=(TP )/(TP + FP )  		       			                      (2)

4. Recall (Sensitivity or True Positive Rate):
   - The proportion of actual positive cases (malignant) that are correctly identified by the model, calculated as [26]:
                            Recall=(TP )/(TP +  FN)       						           (3)

5. Specificity (True Negative Rate):
   - The proportion of actual negative cases (benign) that are correctly identified by the model, calculated as [27]:
                            Specificity =(TN )/(TN +  FP)       						           (4)

6. F-measure (F1 Score):
   - The harmonic mean of Precision and Recall, providing a balanced measure of the model’s performance, calculated as [28]:
                     F1 - score =2*  ((Precision × Recall))/((Precision + Recall) )      			                        (5)
The pseudocode outlines the steps required to build, evaluate, and report on a classification model for plant disease can be summarized in Figure 6.

Algorithm for Dental Disease Classification Using YOLOv11 with AGMS-FF
	Setup Environment
	Install Libraries:
	Use pip to install necessary Python packages such as ultralytics, roboflow, scikit-learn, matplotlib, seaborn, and torch.
	Check GPU availability using torch.cuda.is_available().
	Clear Output: If using a Jupyter notebook or similar environment, clear previous outputs for a cleaner workspace.
	Define Configuration Parameters
	Initialize Configuration Dictionary:
	Specify output directories (results_dir), model file names (model_name), training configurations (number of epochs, batch_size, img_size), and learning rate settings.
	Set data augmentation parameters, optimizer choice (e.g., AdamW), regularization techniques (e.g., weight decay and label smoothing), and parameters for early stopping.
	Directory Creation
	Create Results Directory:
	Check and create subdirectories for storing results, including folders for ROC curves, confusion matrices, sample images, classification reports, ablation study results, and precision-recall curves.
	Define Attention Mechanisms
	Implement Channel Attention:
	Create a class that computes attention weights for feature channels using average and max pooling, followed by fully connected layers and a sigmoid activation function.
	Implement Spatial Attention:
	Create a class using convolutional layers to compute attention weights based on spatial information by concatenating mean and max pooled representations.
	Implement AGMS-FF Enhancer:
	Create a class that combines multi-scale convolutional layers with attention mechanisms.
	Features are extracted using different filter sizes (1x1, 3x3, and 5x5) and concatenated, followed by channel and spatial attention application.
	Create Enhanced YOLO Classifier
	Load YOLOv11 Model:
	Initialize the YOLO model with a specified file.
	Modify Classification Head:
	Replace the existing classification head of YOLO with the new AGMS-FF head to integrate the attention mechanism into the model.
	Load Dataset
	Use Roboflow API:
	Download the dental disease dataset, ensuring proper folder structure containing training, validation, and test data.
	Validate Dataset Structure:
	Confirm the presence of required folders (train, valid, test) and handle errors if any are missing.
	Training Procedure
	Train the Enhanced YOLO Classifier:
	Call the training method with specified parameters while ensuring augmentation is disabled for classification tasks.
	Monitor Training:
	Use callbacks for logging performance and implement early stopping to avoid overfitting based on validation loss.
	Model Evaluation
	Iterate Over Test Classes:
	For each class, load images, make predictions, and compute true labels.
	Collect Prediction Metrics:
	Store true labels, predicted labels, and prediction probabilities for each image tested.
	Handle Errors:
	Implement error handling for image loading and prediction processes.
	Run Ablation Study
	Define Variants:
	Prepare different model configurations: baseline YOLOv11, multi-scale only, attention only, and full AGMS-FF.
	Train and Evaluate Each Variant:
	Train each model variant on the same training data and evaluate performance.
	Capture and store metrics such as accuracy, precision, recall, F1-score, and AUC values for each variant.
	Visualization
	Confusion Matrix:
	Generate and save confusion matrices to visualize model predictions against true labels (both normalized and unnormalized).
	ROC Curves:
	Plot ROC curves for each class and save the figure, calculating both individual and macro-average AUC values.
	Precision-Recall Curves:
	Plot precision-recall curves for each class, saving them as visual outputs.
	Sample Predictions:
	Display images of predictions with true and predicted labels, marking incorrect predictions for analysis.
	Generate Reports
	Comprehensive Report Generation:
	Summarize all evaluation metrics and comparisons in a report format.
	Include detailed classification reports, confusion matrices, and AUC scores.
	Save reports in text or CSV format for further review.
End of Algorithm
Figure 6: The pseudocode steps of the proposed classification model.

Table 3 provides a detailed summary of the hyperparameters and their corresponding values used in the model training process. These hyperparameters are essential for controlling the learning dynamics and overall performance of the model. Key configurations include the number of epochs, batch size, initial and decayed learning rates, early stopping patience, and the use of data augmentation. Additionally, the confidence threshold for predictions is specified to balance precision and recall. This carefully selected set of hyperparameters ensures efficient training, mitigates overfitting, and enhances the model's ability to generalize well on unseen data. The table serves as a reference for understanding the training setup and its impact on the model's outcomes.
		Table 3: Hyperparameters and Training Configuration Details
Hyperparameter	Description	Value
Epochs	Number of training epochs	100
Batch Size	Number of samples per training batch	16
Learning Rate (initial)	Initial learning rate	0.0001
Final Learning Rate Decay	Final learning rate decay	0.00001
Patience	Number of epochs with no improvement before early stopping	30
Data Augmentation	Enable or disable data augmentation	True
Confidence Threshold	Minimum confidence threshold for predictions	0.10
		
	Results and Analysis
In this part, we report on tests we ran to assess our machine learning framework's efficacy. A machine running 64-bit Windows 10 with a 3 GHz i5 processor, 8GB of main RAM, and Windows was used for the testing. For our experiments, we utilized the Python programming language.
	Resnet 18 results
	Table 3: Model Performance Summary
	Classification Report:
	precision	recall	f1-score	support
Calculus	1.00	0.72	0.83	88
Gingivitis	0.93	0.98	0.96	319
Hypodontia	0.98	0.97	0.97	249
Preview	0.93	0.97	0.95	878
Tooth discoloration original dataset	0.59	0.44	0.51	36
Ulcer original dataset	0.39	0.20	0.26	45
				
accuracy			0.93	1615
macro avg	0.80	0.71	0.75	1615
weighted avg	0.92	0.93	0.92	1615
The model's performance was further validated by comparing actual images with their predicted outcomes. Details are provided in Figures 7 and 8, which display sample images alongside their corresponding predictions.
 
Figure 7: Samples of Results of ResNet 18.

Figure 9 illustrates the model's learning behavior by plotting the training and validation loss curves. These curves are analyzed to assess potential overfitting or underfitting. The top-1 and Confusion matrix metrics further support this analysis by showing the model's classification accuracy on both training and validation sets.
 

Figure 9: The model's learning behavior for the training and validation loss curves
 

 

	Ablation Study results
Table 1: Final Model Performance
Class	Precision	Recall	F1-Score	Support
Calculus	1.0000	0.9250	0.9610	40
Gingivitis	0.9563	1.0000	0.9776	153
Hypodontia	1.0000	0.9837	0.9918	123
Preview	0.9819	0.9774	0.9796	443
Tooth Discoloration (Original)	0.5556	0.5000	0.5263	10
Ulcer (Original)	0.7600	0.7917	0.7755	24
				
Overall Accuracy			0.9685	793
Macro Average	0.8756	0.8630	0.8687	793
Weighted Average	0.9686	0.9685	0.9683	793
________________________________________
Table 2: Ablation Study Summary
Model	Accuracy	Macro F1	Macro AUC	Macro PR AUC
Baseline YOLOv11	0.9735	0.8960	0.9979	0.9327
Multi-Scale Only	0.9697	0.8790	0.9982	0.9165
Attention Only	0.9697	0.8790	0.9982	0.9165
Full AGMS-FF	0.9697	0.8790	0.9982	0.9165

 


 

 

 

 

Table 3: Hyperparameters Configuration
Parameter	Value
results_dir	/content/results
model_name	yolo11n-cls.pt
epochs	20
batch_size	128
img_size	224
lr	0.001
lr_schedule	cosine
momentum	0.9
weight_decay	0.0001
augment	True
augment_config	{'hsv_h': 0.015, 'hsv_s': 0.7, 'hsv_v': 0.4, 'translate': 0.1, 'scale': 0.2, 'flipud': 0.0, 'fliplr': 0.5, 'mosaic': 0.0, 'mixup': 0.0}
seed	42
num_samples	25
font_sizes	{'small': 12, 'medium': 14, 'large': 16, 'title': 18}
dpi	300
device	cuda
num_workers	2
early_stopping	{'patience': 15, 'delta': 0.001}
optimizer	AdamW
label_smoothing	0.1
cutmix_prob	0.0
ema	True
ema_decay	0.9999
grad_clip	1.0
warmup_epochs	3
save_best	True
eval_interval	1

	Discussion and Future Directions
 

	Conclusions

Authors' Contributions
This work was carried out in collaboration among all authors. All Authors designed the study, performed the statistical analysis, and wrote the protocol. All authors managed the analyses of the study, managed the literature searches, and wrote the first draft of the manuscript. All authors read and approved the final manuscript.

Declarations
Acknowledgments: This work was supported by the Deanship of Scientific Research, Vice President for Graduate Studies and Scientific Research, King Faisal University, Saudi Arabia [Project No.: ………].

Disclosure of potential Conflict of Interest: The authors declare that they have no conflict of interest.
Ethical Statement: "All procedures performed in studies involving human participants were by the ethical standards of the institutional and/or national research committee and with the 1964 Helsinki Declaration and its later amendments or comparable ethical standards."

Consent Statement: “Informed consent was obtained from all individual participants included in the study.”
Data availability statement.  The datasets used in this study are public and all test data are available at this portal (https://universe.roboflow.com/sih-tiekq/plant-disease-2-of8kx).  

Consent for Publication: Not applicable.
References 
[1]	H. Yu, X. Ye, W. Hong, R. Shi, Y. Ding, and C. Liu, “A cascading learning method with SegFormer for radiographic measurement of periodontal bone loss,” BMC Oral Health, vol. 24, no. 1, p. 325, Mar. 2024, doi: 10.1186/s12903-024-04079-y.
[2]	F. Dai et al., “Convolutional neural networks combined with classification algorithms for the diagnosis of periodontitis,” Oral Radiol., vol. 40, no. 3, pp. 357–366, Jul. 2024, doi: 10.1007/s11282-024-00739-5.
[3]	C.-C. Chen et al., “Automatic recognition of teeth and periodontal bone loss measurement in digital radiographs using deep-learning artificial intelligence,” J. Dent. Sci., vol. 18, no. 3, pp. 1301–1309, Jul. 2023, doi: 10.1016/j.jds.2023.03.020.
[4]	A. G, A. M, F. Ff, A. M, A. Rm, and A. M, “Artificial intelligence (AI) diagnostic tools: utilizing a convolutional neural network (CNN) to assess periodontal bone level radiographically-a retrospective study,” BMC Oral Health, vol. 22, no. 1, Sep. 2022, doi: 10.1186/s12903-022-02436-3.
[5]	J. Chang et al., “Application of deep machine learning for the radiographic diagnosis of periodontitis,” Clin. Oral Investig., vol. 26, no. 11, pp. 6629–6637, Nov. 2022, doi: 10.1007/s00784-022-04617-4.
[6]	L. Jiang, D. Chen, Z. Cao, F. Wu, H. Zhu, and F. Zhu, “A two-stage deep learning architecture for radiographic staging of periodontal bone loss,” BMC Oral Health, vol. 22, no. 1, p. 106, Apr. 2022, doi: 10.1186/s12903-022-02119-z.
[7]	R. Widyaningrum, I. Candradewi, N. R. A. S. Aji, and R. Aulianisa, “Comparison of Multi-Label U-Net and Mask R-CNN for panoramic radiograph segmentation to detect periodontitis,” Imaging Sci. Dent., vol. 52, no. 4, pp. 383–391, Dec. 2022, doi: 10.5624/isd.20220105.
[8]	K. J et al., “Generalizability of deep learning models for dental image analysis,” Sci. Rep., vol. 11, no. 1, Mar. 2021, doi: 10.1038/s41598-021-85454-5.
[9]	M. Feres, Y. Louzoun, S. Haber, M. Faveri, L. C. Figueiredo, and L. Levin, “Support vector machine-based differentiation between aggressive and chronic periodontitis using microbial profiles,” Int. Dent. J., vol. 68, no. 1, pp. 39–46, Feb. 2018, doi: 10.1111/idj.12326.
[10]	J.-H. Lee, D.-H. Kim, S.-N. Jeong, and S.-H. Choi, “Diagnosis and prediction of periodontally compromised teeth using a deep learning-based convolutional neural network algorithm,” J. Periodontal Implant Sci., vol. 48, no. 2, pp. 114–123, Apr. 2018, doi: 10.5051/jpis.2018.48.2.114.
[11]	E. H. Alkhammash, “Multi-Classification Using YOLOv11 and Hybrid YOLO11n-MobileNet Models: A Fire Classes Case Study,” Fire, vol. 8, no. 1, Art. no. 1, Jan. 2025, doi: 10.3390/fire8010017.
[12]	Y. Li, H. Yan, D. Li, and H. Wang, “Robust Miner Detection in Challenging Underground Environments: An Improved YOLOv11 Approach,” Appl. Sci., vol. 14, no. 24, Art. no. 24, Jan. 2024, doi: 10.3390/app142411700.
[13]	R. Khanam and M. Hussain, “YOLOV11: AN OVERVIEW OF THE KEY ARCHITECTURAL ENHANCEMENTS,” ArXiv Prepr. ArXiv241017725, 2024, Accessed: Jan. 23, 2025. [Online]. Available: https://islab.ulsan.ac.kr/files/announcement/883/Yolov11.pdf
[14]	“What is YOLOv11? An Introduction,” Roboflow Blog. Accessed: Jan. 23, 2025. [Online]. Available: https://blog.roboflow.com/what-is-yolo11/
[15]	R. Khanam and M. Hussain, “YOLOv11: An Overview of the Key Architectural Enhancements,” Oct. 23, 2024, arXiv: arXiv:2410.17725. doi: 10.48550/arXiv.2410.17725.
[16]	D. Wang et al., “SDS-YOLO: An improved vibratory position detection algorithm based on YOLOv11,” Measurement, vol. 244, p. 116518, Feb. 2025, doi: 10.1016/j.measurement.2024.116518.
[17]	M. Y. Shams, A. Hussien, A. Atiya, L. Medhat, and R. Bhatnagar, “Food Item Recognition and Calories Estimation Using YOLOv5,” in Proceedings of Fifth International Conference on Computer and Communication Technologies, vol. 897, B. R. Devi, K. Kumar, M. Raju, K. S. Raju, and M. Sellathurai, Eds., in Lecture Notes in Networks and Systems, vol. 897. , Singapore: Springer Nature Singapore, 2024, pp. 241–252. doi: 10.1007/978-981-99-9704-6_21.
[18]	P. Hidayatullah, N. Syakrani, M. R. Sholahuddin, T. Gelar, and R. Tubagus, “YOLOv8 to YOLO11: A Comprehensive Architecture In-depth Comparative Review,” Jan. 23, 2025, arXiv: arXiv:2501.13400. doi: 10.48550/arXiv.2501.13400.
[19]	S. Rao, “YOLOv11 Architecture Explained: Next-Level Object Detection with Enhanced Speed and Accuracy,” Medium Oct, vol. 22, 2024.
[20]	E. H. Alkhammash, Fire, vol. 8, no. 1, p. 17, Jan. 2025, doi: 10.3390/fire8010017.
[21]	W. Wei et al., “YOLOv11-based multi-task learning for enhanced bone fracture detection and classification in X-ray images,” J. Radiat. Res. Appl. Sci., vol. 18, no. 1, p. 101309, Mar. 2025, doi: 10.1016/j.jrras.2025.101309.
[22]	L. Zhang, Z. Sun, H. Tao, M. Wang, and W. Yi, “Research on Mine-Personnel Helmet Detection Based on Multi-Strategy-Improved YOLOv11,” Sensors, vol. 25, no. 1, p. 170, Dec. 2024, doi: 10.3390/s25010170.
[23]	T. R. Mahesh, V. Vinoth Kumar, V. Vivek, K. M. Karthick Raghunath, and G. Sindhu Madhuri, “Early predictive model for breast cancer classification using blended ensemble learning,” Int. J. Syst. Assur. Eng. Manag., vol. 15, no. 1, pp. 188–197, Jan. 2024, doi: 10.1007/s13198-022-01696-0.
[24]	D. A. Abdel Hady and T. Abd El-Hafeez, “Utilizing machine learning to analyze trunk movement patterns in women with postpartum low back pain,” Sci. Rep., vol. 14, no. 1, p. 18726, Aug. 2024, doi: 10.1038/s41598-024-68798-6.
[25]	T. Abd El-Hafeez, M. Y. Shams, Y. A. M. M. Elshaier, H. M. Farghaly, and A. E. Hassanien, “Harnessing machine learning to find synergistic combinations for FDA-approved cancer drugs,” Sci. Rep., vol. 14, no. 1, Art. no. 1, Jan. 2024, doi: 10.1038/s41598-024-52814-w.
[26]	M. Y. Shams, T. Abd El-Hafeez, and E. Hassan, “Acoustic data detection in large-scale emergency vehicle sirens and road noise dataset,” Expert Syst. Appl., vol. 249, p. 123608, Sep. 2024, doi: 10.1016/j.eswa.2024.123608.
[27]	G. Mostafa, H. Mahmoud, T. Abd El-Hafeez, and M. E. ElAraby, “Feature reduction for hepatocellular carcinoma prediction using machine learning algorithms,” Journal of Big Data, vol. 11, no. 1. p. 88, 2024. doi: 10.1186/s40537-024-00944-3.
[28]	W. M. Elmessery et al., “Semantic segmentation of microbial alterations based on SegFormer,” Front. Plant Sci., vol. 15, p. 1352935, 2024.