This experimental study was to be conducted in multiple dental hospitals and clinics to assess the accuracy of supervised ML in predicting treatment duration compared to actual duration. This study also evaluated the impact of ML prediction on clinical workflow efficiency. All methods were carried out in accordance with relevant guidelines and regulations of the Ethics Committee of the Faculty of Dentistry, Sulaimani University. Sulaimani's Dental College and University Ethics Committee approved the research project on March 24, 2025 under code number (COD-EC-25-0077).
Inclusion criteria
It included patients receiving common dental treatments such as fillings, root canals, periodontal treatments, tooth preparation, implant visits, orthodontic treatments, extraction, orthodontic procedures, orthodontic procedures. Eligible participants are 18 years of age or older and must provide informed consent for the data used for research purposes. At the same time, some patients under the age of 18 were included and informed consent was obtained from parents.
Exclusion criteria
Patients with incomplete records, emergency cases requiring immediate attention, or treatments that include complex or rare procedures were excluded.
In this study, machine learning uses a total of 2500 patients and 250 cases to assess the accuracy of the model (Figure 1).

1 is a flow diagram showing patient selection and data analysis.
ML model description
This study presents a monitored, optimized hybrid system for predicting the duration of dental procedures. It combines machine learning models with real-time online data search and clinical domain knowledge. The system architecture consists of three interconnected modules designed for accuracy, efficiency and clinical practicality.
Machine Learning Core
The prediction engine employs a two-layer modeling approach, using the Sklearn library and linear regression functions from that library.
x_encoded = pd.get_dummies(x, columns = cat_cols, drop_first = true).
self.models[proc_name]= linearregression(). fit(x_encoded, y).
Features included
-
Numbers: Dentist experience (years), patient age.
-
Category: Patient Gender, Dentist Specialty (1 Hot Encoding).
Lookup Table Fallback: Procedures with sparse data (<5 records) (<5 records) avoid unreliable model fit and use pre-computed averages.
Optimizing efficiency:
-
1.
Column Alignment: Predictive input is dynamically resexed to match the training schema (Reindex(columns=model_columns,fill_value=0)) to eliminate reprocessing of the complete dataset.
-
2.
Memory Management: Minimal data frames are constructed during real-time prediction.
-
3.
Parallel Training: Models are built independently for each step, allowing scalable additions to the procedure catalog.
Online Data Search Module
The system integrates live dental guidelines searches via Serpapi.
params = {“q”:f '“ {procedure_name}”Dental procedure period”,
“Engine”: “Google”
“API_KEY”:API_KEY}
time_pattern = re.compile(r'(\d{1,3}(?:\s*to\s*| -)?\d{1,3})\s*(minute | hours)s',re.ignorecase)
Clinical Safety Mechanisms
Minimum Step Dictionary:
Forces biologically plausible times regardless of the model's output.
Professionally adjusted forecasts:
-
Endodontists receive a 40% time reduction in root canals.
-
A typical dentist will use baseline estimates.
-
Disparity specializations cause conservative multipliers.
User interface and workflow integration
(Figure 2)).

Prediction software graphical user interface.
Implement TKINTERGUI:
-
Dynamic Form Validation: Real-time check of input integrity.
-
Progressive Disclosure: Enable/disable interface elements based on system state.
-
Comparative Insights: View models and online quotes at the same time.
Computational Performance
Benchmarks are shown on the Intel I7-1185G7.
-
Model Training: 120-450 ms per step (study sample size was 2500 records, depending on sample size).
-
Predictive latency: <15ms for dedicated models and <2ms for lookup tables.
-
Memory Footprint: 45 MB < 45 MB with 10,000 step records.
Verification framework.
The system uses three-layer verification.
-
1.
Input Disinfection: Type check and range verification of numeric input.
-
2.
Model confidence check: Fallback to the average if the prediction difference exceeds the threshold.
-
3.
Clinical validity gate: Final predictions are constrained by:
final_time = max(self._get_safety_minimum(proc_name),prediction).
This architecture illustrates how hybrid AI systems balance computational efficiency with clinical reliability for healthcare applications. Modular design allows for seamless integration of additional data sources (such as EHR systems) and maintains subsecond response times critical to clinical workflows.
Data collection
Data is sourced from direct calculation inputs from public and private dental clinics, taking into account a variety of specialties. The following variables are collected:
-
Actual duration of treatment (observed and recorded by the clinician).
-
Types of dental procedures.
-
Operator specialization (specialists in the field of procedure, general practitioners, graduate students, undergraduate students).
-
Years of experience as a dentist.
-
Patient demographic information (age and gender).
Actual treatment duration is calculated. Dentist or clinic workers manually record the duration of treatment. All dentists are trained to record the duration of treatment, from history to patient firing. Patients with ongoing visits to designated clinics have been excluded from the history acquisition process. This data is a software training material. After collecting 2500 cases, the software was trained on these records. Another 250 cases are predicted by the software and measured by the clinician to obtain two different measurements. One read is the actual period and the software is the other read.
Manual data is preprocessed to unify treatment type and missing fields or misspelled fields, and missing fields are handled in two ways.
-
1.
Missing data in Row Discoverable is excluded as missing fields in row data.
-
2.
Minor gaps, misspelled words, and unification of different names in one step are dealt with computationally by finding and replacing words. For example, word stuffing and restoration are synonyms and are entered into the dataset.
Statistical analysis
Data is saved as an A.CSV file using Microsoft Excel and analyzed using IBM SPSS Statistics Package Version 29 and Datatab Team (2024). Datatab: Online statistics calculator. Datatab Eu Graz, Austria. The following statistical methods are employed:
-
Descriptive statistics to summarise predicted treatment durations and actual treatment durations.
-
Paired t-tests determine the importance of differences between predicted and actual durations regarding gender, patient age, practitioner experience, and practitioner specialization.
-
R² score: This metric shows how much the amount of predicted variance is explained by the regression model.
-
Mean Absolute Error (MAE): The average difference between the predicted and actual values.
-
A p-value of <0.05 was considered statistically significant.
