Assessing the spatial relationship between mandibular third molars and the inferior alveolar canal using a deep learning-based approach: a proof-of-concept study
Procena prostornog odnosa između donjih umnjaka i donjeg alveolarnog kanala primenom pristupa zasnovanog na dubokom učenju: studija dokaza koncepta
Lyu W, Lou S, Huang J, Huang Z, Zheng H, Liao H, Qiao Y, OuYang K.
2025 · BMC oral health · CC BY-NC-ND
Prevod na srpski je mašinski (Claude) i prikazan je radi čitljivosti; original je merodavan.
Abstract Background The distance between the mandibular third molar (M3) and the mandibular canal (MC) is a key factor in assessing the risk of injury to the inferior alveolar nerve (IAN). However, existing deep learning systems have not yet been able to accurately quantify the M3-MC distance in 3D space. The aim of this study was to develop and validate a deep learning-based system for accurate measurement of M3-MC spatial relationships in cone-beam computed tomography (CBCT) images and to evaluate its accuracy against conventional methods. Materials and methods We propose an innovative approach for low-resource environments, using DeeplabV3 + for semantic segmentation of CBCT-extracted 2D images, followed by multi-category 3D reconstruction and visualization. Based on the reconstruction model, we applied the KD-Tree algorithm to measure the spatial minimum distance between M3 and MC. Through internal validation with randomly selected CBCT images, we compared the differences between the AI system, conventional measurement methods on the CBCT, and the gold standard measured by senior experts. Statistical analysis was performed using one-way ANOVA with Tukey HSD post-hoc tests ( p < 0.05), employing multiple error metrics for comprehensive evaluation. Results One-way ANOVA revealed significant differences among measurement methods. Subsequent Tukey HSD post-hoc tests showed significant differences between the AI reconstruction model and conventional methods. The measurement accuracy of the AI system compared to the gold standard was 0.19 for mean error (ME), 0.18 for mean absolute error (MAE), 0.69 for mean square error (MSE), 0.83 for root mean square error (RMSE), and 0.96 for coefficient of determination (R 2 ) ( p < 0.01). Conclusions These results indicate that the proposed AI system is highly accurate and reliable in M3-MC distance measurement and provides a powerful tool for preoperative risk assessment of M3 extraction. Supplementary Information The online version contains supplementary material available at 10.1186/s12903-025-06539-5. Keywords: Cone beam computed tomography, Deep learning, Inferior alveolar canal, Mandibular canal, Mandibular third molar
Introduction Injury to the inferior alveolar nerve (IAN) is one of the most serious complications of mandibular third molar (M3) extraction [ 1 ]. Patients often experience sensory disturbances such as numbness, swelling, and tingling in the corresponding innervated area, as well as dysfunction such as drooling, lip biting, and speech difficulties caused by loss of sensation [ 2 ]. Clinical studies have demonstrated that the type of M3 impaction [ 3 ], the positional relationship of the mandibular canal (MC) to the M3 [ 4 ], the operator's experience [ 5 ], and intraoperative vascular nerve exposure [ 6 ] are risk factors for IAN injury. Among them, the distance between the M3 root and the MC is a key risk factor for IAN injury [ 7 ]. Clinically, dentists use imaging tools to assess the relationship between MC and M3 to reduce or avoid inferior alveolar nerve injury. CBCT is able to provide three-dimensional images of dentoalveolar region, which enables the identification and judgment of the relative positional relationship and spatial distance between the M3 root and MC before tooth extraction [ 8 , 9 ]. However, in practice, when the M3 root is in close proximity to the MC, anatomical structures are difficult to distinguish. CBCT's inherent problems of poor density accuracy and high noise present a challenge to clearly present the actual contact relationship between the two [ 10 , 11 ]. In addition, manual assessment requires more experience in interpreting maxillofacial CBCT scans, higher time costs, and increased communication and collaboration costs. Artificial intelligence (AI), especially convolutional neural networks (CNNs), a deep learning method designed for image analysis, provides a reliable solution to achieve a more accurate and efficient assessment of the spatial positional relationship between M3 and MC. CNNs have shown promising results in predicting IAN injury risk post-M3 extraction. The accuracy of these AI systems relies on precise semantic segmentation of the mandibular canal, which is crucial for assessing its spatial relationship with the third molar [ 10 , 12 – 19 ]. Although these findings are encouraging, quantitative assessment of the spatial relationship between M3 and MC remains difficult in routine clinical practice. This challenge often leads to subjective risk assessment, inter-observer variability, and potentially suboptimal surgical planning. The null hypothesis of this study was that there would be no significant difference in measurement accuracy between our proposed deep learning-based system and conventional measurement methods when compared to expert manual reconstruction measurements as the gold standard. To address the aforementioned challenges in clinical practice and test our null hypothesis, this study utilized CBCT imaging data to develop and evaluate a deep learning-based system for assessing the spatial positional relationship between M3 and MC. Our research makes several significant contributions: (1) We proposed a solution for multi-category 3D reconstruction in low-resource scenarios by using semantic segmentation results of 2D images, and used the DeeplabV3 + algorithm to complete the semantic segmentation model construction. (2) The spatial shortest distance between two objects was calculated using the nearest point pair search algorithm based on a KD tree. (3) The computational output of the spatial shortest distance between M3 and MC was achieved by applying CBCT imaging data. (4) To the best of our knowledge, this is the first study in which an AI system implements quantification of the spatial distance of M3-MC. Materials and methods CBCT image data set preparation and image data preprocessing The study was conducted in accordance with the Declaration of Helsinki of the World Medical Association and was approved by the Hospital Ethics Committee (approval number: LL-KT-2024023). Participants meeting the following criteria were included: (1) aged ≥ 18 years; (2) presence of at least one high-risk mandibular third molar requiring surgical extraction, characterized by partial/non-eruption (e.g., mesioangular, vertical, or horizontal impaction) with associated pathologies such as recurrent pericoronitis, caries affecting the third or adjacent second molar, follicular cyst formation, root resorption of adjacent teeth, or orthodontic indications; Exclusion criteria comprised: (1) acute pericoronitis with purulent discharge; (2) systemic conditions contraindicating surgery (e.g., uncontrolled diabetes, immunocompromised status); (3) presence of radiographic signs suggestive of dentigerous cysts, odontogenic tumors, or other jaw pathologies; (4) pregnancy or lactation. Patients whose CBCT images were blurred due to artifacts or did not contain a mandibular third molar were excluded. To create the image dataset, data were collected from the Department of Stomatology, Guangming District People's Hospital, Shenzhen, China, between March 2023 and August 2024, totaling 94 CBCT images. CBCT images were acquired using a NewTom device (Verona, Italy) with the following image acquisition parameters: 90 kVp, 12.92 mA, axial slice spacing of 0.400 mm, and isotropic in-plane voxel size of 0.1 mm 2 , and field of view sizes ranging from 8 × 8 cm 2 to 6 × 6 cm 2 . For patient privacy protection, all personal identifying information was removed through anonymization. Data pre-processing consisted of two main steps. In the first step, the CBCT image were axially sliced and cropped. We imported the CBCT image into NewTom NNT software (version 9.0.0; NewTom, Verona, Italy) and reconstructed the images according to the arch curves, with the reconstruction thickness set to 0.3 mm to obtain cross-sectional images parallel to the long axis of the M3. The cross-sectional image containing the M3 region was used as the region of interest (ROI). A total of 3,590 ROI images were extracted from 94 CBCT images. In the second step, two radiologists with more than 6 years of clinical experience annotated the ROIs using Labelme open-source annotation software (version 5.0.1; Computer Science and Artificial Intelligence Laboratory, MIT, Cambridge, MA, USA), employing a three-classification approach: designating M3 and MC as foreground and all other regions as background. To quantitatively assess annotation consistency, 20 samples were randomly selected from the total sample to be repeatedly annotated by two standardizers, with a 4-week annotation interval to minimize memory effects. Intra- and inter-annotator consistency was assessed using the Dice coefficient: 1.1 Dice = 2 | X ∩ Y | / ( | X | + | Y | ) M3-MC spatial location relationship AI evaluation system The overall research flow of the AI evaluation system we designed and developed is shown in Fig. 1 . The whole AI system is mainly divided into three parts, including the multi-classification semantic segmentation module, the 3D reconstruction module, and the M3-MC shortest distance calculation algorithm module. The final result achieves overall visualization output to guide clinicians in surgical design. Fig. 1 Study flow. a CBCT pre-processing; b Multi-categorical semantic segmentation module and 3D reconstruction module; c Comparison between M3-MC shortest distance calculation algorithm module and traditional CBCT measurement methods Multi-classification semantic segmentation module To achieve high-precision reconstruction of M3 and MC 3D models, DeepLabV3 + is used in this study for multi-classification semantic segmentation of M3 and MC. We constructed the M3-MC dataset by extracting and annotating 3,590 ROIs of M3 and MC categories through a preprocessing procedure. This dataset is randomly divided into training and testing sets in a ratio of 9:1 to provide a basis for subsequent semantic segmentation tasks. This module takes the preprocessed ROI images as input and, after DeepLabV3 +, outputs the corresponding multi-category semantic segmentation masks to maintain the spatial location relationship between M3 and MC. DeepLabV3 + network architecture The multi-categorical semantic segmentation module adopts DeepLabV3 + as the core algorithm for multi-categorical semantic segmentation [ 20 ]. DeepLabV3 + is a semantic segmentation architecture based on convolutional neural networks, which consists of two parts: encoder and decoder. In the Encoder part, the model first extracts image features through a modified Xception network. The output of the backbone consists of two types of feature maps: a high-level feature map from the last layer of convolution, and a low-level feature map from the output of the middle layer. The high-level feature maps are then fed into the ASPP (Atrous Spatial Pyramid Pooling) module, while the low-level feature maps are passed directly to the Decoder part for subsequent detail recovery. The ASPP module receives the high-level feature maps output by the backbone as input. The module contains five parallel branches: four atrous convolution blocks using different dilation rates and a global average pooling block. Each atrous convolution block contains convolution, batch normalization, and activation layers, while the global average pooling block consists of pooling, convolution, batch normalization, and activation layers. The outputs of these five branches are concatenated and then processed through a 1 × 1 convolution block that contains convolution, batch normalization, activation, and dropout layers. The Decoder part is designed to combine the high-level semantic information extracted by the Encoder with low-level detailed features to generate fine-grained segmentation results. It first performs channel dimensionality reduction on the low-level feature maps from the backbone using 1 × 1 convolution to reduce the number of channels from 256 to 48. The purpose of this step is to balance the importance of the low-level features with the high-level features, and experiments have shown that 48 is the optimal number of channels. Next, the Decoder interpolates the output of the ASPP module to upsample it so that its size matches the low-level feature map. The two feature maps are then concatenated and further processed by a set of 3 × 3 convolutional blocks, which helps to fuse information at different scales. Finally, the processed feature maps are again upsampled by linear interpolation to generate a prediction map with the same resolution as the original input image. Model training In the training phase of the model, we adopt a diversified loss function strategy to optimize the performance of DeepLabV3 +. The main loss function is the cross-entropy loss, while we introduced the focal loss, where the gamma parameter is set to 0.94. In addition, we also used dice loss in combination. For optimizer selection, we used the Adam optimizer for end-to-end training. For the data augmentation session, we used an ImageNet-style random data augmentation strategy. Cross Entropy Loss: L CE = - ∑ i = 1 C y i log y ^ i Among them, C is the number of categories, y i is the real label, y ^ i is the prediction probability. Focal Loss: L FL = - ∑ i = 1 C 1 - y ^ i γ y i log y ^ i Among them, γ is the focus parameter, which is set to 0.94 in this case. Dice Loss: L Dice = 1 - 2 ∑ i = 1 C y i y ^ i ∑ i = 1 C y i 2 + ∑ i = 1 C y ^ i 2 Model evaluation indicators To evaluate the segmentation performance of the system, four commonly used metrics are used in this study: Pixel accuracy (PA), Intersection over Union (IoU), Precision, and Recall. The calculation formula of each metric are listed in detail below: Pixel accuracy: PA = True Positive + True Negative Total Pixels Intersection over Union: IoU = | A ∩ B | | A ∪ B | Precision: Precision = TP TP + FP Recall: Recall = TP TP + FN 3D reconstruction module The 3D reconstruction module is a key component in transforming 2D multi-category semantic segmentation masks into 3D STL models. The process begins with the M3 and MC masking of the output from the multi-category semantic segmentation module and culminates in the generation of an accurate 3D model. This multi-step reconstruction approach, starting from the segmentation masks of the DeepLabV3 + model and proceeding through data organization, region extraction, smoothing, and finally surface reconstruction, achieves the conversion from 2D images to high-quality 3D models. In the first step of the reconstruction process, we use the trained DeepLabV3 + model to predict each ROI image after preprocessing. The model extracts image features through its encoder, and the decoder subsequently restores these features to their original spatial resolution, ultimately outputting segmentation maps with the same dimensions as the input image. These segmentation maps precisely identify the region to which each pixel belongs, including M3, MC, and the background. Next, we stack these segmented 2D images in their order in the original CBCT sequence to form a 3D array. This process effectively reorganizes the discrete 2D information into a continuous 3D spatial representation. To optimize the reconstruction results, we apply Gaussian filtering to the extracted M3 and MC regions. This step effectively smooths the data, reducing noise and possible jagged edges, and prepares for the generation of a more natural and continuous 3D models. Finally, we use the Marching Cubes algorithm to reconstruct the surface of the filtered M3 and MC region data. This classical algorithm determines the intersections of the equivalent surfaces with the voxel boundaries by analyzing the voxel values in the 3D array, and subsequently generates a triangular mesh model representing the surface. M3-MC shortest distance calculation algorithm module The main task of this module is to identify the point with the minimum distance from the M3-MC spatial location and to calculate the distance between the two. This distance is considered as the shortest distance of M3-MC. KD-Tree is a data structure used to split k-dimensional data space. The KD-Tree has the advantage of less computation and shorter search time in performing the task of finding the nearest-neighbor events [ 21 ]. This is achieved by a nearest-pair search algorithm based on the KD-Tree, the algorithmic code of which is shown in Algorithm 1. The purpose of this algorithm is to find the closest pair of points in two point sets `verts1` and `verts2`. The workflow of the algorithm is as follows: Algorithm 1 FindMinimumDistance(M3, MC) AI system compared with dcotor To assess the accuracy of the system's risk prediction for M3 extraction injury to the IAN, this study compares the AI system with measurements of M3-MC distances made by junior physicians. We used the minimum distance measurements of M3-MC spatial location extracted by 3 radiologists with more than 6 years of clinical experience using Mimics software as the gold standard for the study. We also compared the minimum distance of the M3-MC spatial location automatically assessed by the AI system, the minimum distance of the M3-MC spatial location measured by young doctors in the CBCT Reconstructed Panoramic (CRP) view, and the minimum distance of the M3-MC spatial location measured by young doctors in the CBCT Mandibular Cross-Section(MCS). These measurements were compared for error against the gold standard M3-MC distance. To reduce selection bias and increase the reliability of the findings, we randomly selected 40 CBCT images from an existing database as an internal validation set. We chose three junior physicians to perform independent blinded analysis of the measurements. These testers were not directly related to the principal investigator of this study. Inter-rater reliability among the three physicians was assessed via intraclass correlation coefficients (ICC), showing excellent agreement (ICC = 0.89, 95% CI: 0.83–0.93). CRP measurements were obtained by reconstructing panoramic slices with a mandibular arch curve on CS 3D Imaging Software (version 3.4.3, Carestream Dental LLC, Atlanta, GA, USA) and then manually measuring the shortest distance between M3 and MC cortex. MCS measurements were obtained by reconstructing with a mandibular arch curve on CS 3D Imaging Software, selecting a mandibular cross section parallel to the long axis of the M3 section, and then measuring the shortest distance between M3 and MC cortex. We took the average of the measurements of three doctors in each group as the final measurement for that group. Statistical analysis included one-way ANOVA with Tukey HSD post-hoc tests ( p < 0.05) using SPSS 26.0 (IBM Corp., Armonk, NY) to assess significant differences between measurement methods. To comprehensively evaluate the accuracy and reliability of each measurement method, multiple error metrics were employed in this analysis. Mean Error (ME) was utilized to evaluate the direction and magnitude of measurement bias. Additionally, Mean Absolute Error (MAE) was calculated to assess the absolute magnitude of the error independent of its direction. Furthermore, Mean Square Error (MSE) was implemented to assign greater weight to larger errors, thereby facilitating the identification of outliers and extreme errors. Moreover, Root Mean Square Error (RMSE) was computed to provide error measurements in the original data units, offering intuitive interpretability of the results. Cohen's d was also incorporated to quantify the standardized effect size between measurement methods, calculated as the difference in means divided by the pooled standard deviation, thereby providing insight into the practical significance of observed differences. In addition, the coefficient of determination is used in this study to assess the fit of the predicted values to the true values. Results Demographic information A total of 94 patients were included in this study, of which 40 (42.55%) were male (age: 36 ± 4.3 years) and 54 (57.45%) were female (age: 34 ± 5.5 years). According to Winter's classification, there were 19 (20.21%) cases of vertical impaction, 29 (30.85%) cases of horizontal impaction, 34 (36.17%) cases of distal-medium impaction, and 12 (12.77%) cases of proximal-medium impaction. Dice's coefficient was used to assess observer agreement (Supplementary Table 1). The intra-observer agreement coefficients for the two observers were 0.904 ± 0.034 and 0.930 ± 0.021, respectively, and the inter-observer agreement coefficient was 0.864 ± 0.057, indicating a high degree of reliability and consistency in data labeling. The performance of M3/MC multi-classification semantic segmentation model In this study, the MobilenetV2-DeeplabV3 + network model was used for multi-categorical semantic segmentation of CBCT images of M3 and MC. Figure 2 presents the visualization results of the model segmentation, demonstrating the DeepLab V3 + model's excellent performance in this task. Fig. 2 Segmentation results of the model. a Original image. b Segmentation results, M3 (yellow), MC (green) Figure 3 illustrates the pixel confusion matrix in the test set, reflecting the model's classification performance between categories in detail. The overall performance scores of the model are mPA (99.69%), mPrecision (91.45%), and mRecall (94.61%). These metrics collectively reflect the model's excellent performance in the multi-category segmentation task, with mIoU reaching 87.47%, indicating good segmentation accuracy. Fig. 3 Normalized confusion matrix (%) in the test set Further analyzing the segmentation performance for each category, Table 1 demonstrates the detailed evaluation metrics of the model for M3 and MC segmentation. For M3 segmentation, the model performs particularly well, with metrics of PA (99.64%), IoU (99.82%), Precision (92.87%), and Recall (95.45%). Although the segmentation performance for MC is slightly lower, it still remains at a high level with metrics of PA (99.88%), IoU (73.96%), Precision (81.66%), and Recall (88.69%). Table 1 Model performance in the test set (%) PA IoU Precision Recall Background 99.54 73.96 99.82 99.69 MC 99.88 88.93 81.66 88.69 M3 99.64 99.82 92.87 95.45 Mean 99.69 87.47 91.45 94.61 The results of 3D reconstruction and algorithm for measuring the shortest distance in space We implemented high-quality 3D reconstruction based on ROI images using the NumPy and Mayavi libraries in the Python ecosystem. To efficiently calculate the shortest distance between M3 and MC, we implemented a nearest point pair search algorithm based on KD trees. This algorithm greatly reduces computational complexity through spatial segmentation and fast neighborhood search, enabling the system to rapidly locate the nearest point pair in massive 3D point cloud data. After 3D reconstruction and visualization, the green structure represents M3, the red structure represents MC, and the black line segment connecting the two represents the spatial shortest distance calculated by the algorithm. This visualization not only provides clinicians with a clear reference of spatial relationships but also provides strong support for surgical planning and risk assessment (Fig. 4 ). Fig. 4 Reconstruction results of AI system. M3 (green), MC (red), and black lines are the shortest distances of spatial locations. The shortest distance in space: ( A ) 2.09mm ( B ) 1.38mm ( C ) 2.05mm ( D ) 0.17mm ( E - F ) 0mm Comparison of diagnostic efficacy between junior physicians and AI system In the comparative analyses of different measurement modes, the AI system shows excellent performance, and its measurement results have high consistency and good goodness-of-fit with the gold standard. By analyzing the rain cloud map (Fig. 5 ), we observe that the measurement results of the AI system show the highest similarity with the gold standard in terms of peak location and interquartile spacing, and the median difference is small, indicating that the AI system accurately captures the overall data distribution characteristics. Fig. 5 Distance rain cloud plots of M3-MC measured by different methods. Vertical coordinates are the various measurement methods, horizontal coordinates are the measured distances of M3-MC, cloudy graphs show the distribution of the measurements, box-and-line plots show the distributional characteristics of the data, and jitter scatter plots show the values and locations of the individual measurements. Manual reconstruction measurements (light blue), AI reconstruction measurements (green), MCS measurements (red), CRP measurements (dark blue) In contrast, the MCS measurements showed a more dispersed data distribution with less pronounced peaks and larger interquartile spacing. It is worth noting that the MCS data peak near 2 mm is to the right of the gold standard and the median is larger, implying that there may be a tendency for the MCS measurements to be overestimated. The CRP measurements show the opposite trend, with a peak to the left of the gold standard, a higher density of data close to 0 mm, a significantly narrower quartile spacing, and a smaller median, suggesting that the CRP measurements may tend to underestimate the actual distances. Statistical analysis using one-way ANOVA revealed significant differences among the measurement methods (F = 67.599, p < 0.001). Subsequent Tukey HSD post-hoc tests demonstrated significant differences between all measurement method pairs (Table 2 ). The error metrics data in Table 3 show that the AI system not only exhibits the smallest systematic bias and random error but also demonstrates the highest correlation with the gold standard. In contrast, conventional MCS and CRP measurements, while also showing a degree of reliability, are slightly inferior to the AI system in terms of precision and consistency. Table 2 Error Comparison Analysis Between Different Measurement Methods Measurement Method Error Difference (mm) SE p -value 95% CI AI reconstruction model vs. Mandibular Cross-Section −0.451* 0.113 <.001 [−0.719, −0.182] AI reconstruction model vs. CBCT reformatted panorama 0.843* 0.112 <.001 [0.576, 1.109] Mandibular Cross-Section vs. CBCT reformatted panorama 1.293* 0.113 <.001 [1.025, 1.562] * p < 0.001, statistically significant Table 3 Accuracy evaluation index of different M3-MC distance measurement methods Measurement Methods ME (Mean ± SD) 95% CI MAE (Mean ± SD) RMSE (Mean ± SD) R2 Cohen's d (95% CI) AI reconstruction model 0.19 ± 0.25 0.06–0.44 0.18 ± 0.14 0.69 ± 0.45 0.96 0.75 (0.31–1.19) Mandibular Cross-Section −0.43 ± 0.25 −0.68–−0.18 0.86 ± 0.22 2.46 ± 0.31 0.93 1.85 (1.32–2.38) CBCT reformatted panorama 0.86 ± 0.19 0.67–1.05 0.52 ± 0.17 1.50 ± 0.24 0.73 1.31 (0.95–1.67) Discussion Multifactorial analyses have shown that MC stenosis, as well as direct contact of the M3 root with the IAN, are the most important risk factors for the development of nerve injury after M3 extraction [ 22 ]. Therefore, accurate quantification of the M3-MC relationship is critical for preoperative assessment and risk management of M3 extraction. Notably, DL-based accurate segmentation of MC and M3 is crucial for spatial relationship analysis, where high-precision anatomical delineation provides reliable data for assessing their three-dimensional positional relationship [ 18 , 19 , 23 ]. Previous studies have investigated diverse research data types, primarily focusing on two diagnostic imaging modalities widely used in clinical practice: panoramic radiographs and CBCT. In the context of M3-MC evaluation, current deep learning methodologies predominantly focus on two core technical objectives: anatomical segmentation of M3 and MC structures through pixel-level identification, and classification analysis based on imaging features to assess pathological status or risk stratification. These complementary approaches provide distinct technical pathways for establishing quantitative predictive models in preoperative planning (Tables 4 and 5 ). Table 4 Semantic Segmentation Studies of MC Data Type Research Focus Data Source Main Methodology Year Index CBCT MC segmentation Four centers 2D U-Net, 3D U-Net 2024 [ 24 ] CBCT MC segmentation Single center Two-stage 3D U-Net 2023 [ 10 ] CBCT MC and anterior loop segmentation Database 3D U-Net 2023 [ 12 ] CBCT MC segmentation Single center 2D SegNet, 2D & 3D U-Nets 2020 [ 13 ] CBCT MC segmentation Database 3D U-Net CNN 2022 [ 14 ] CBCT MC segmentation Two centers Dual-stage 3D CNN 2022 [ 15 ] CBCT MC segmentation Single center Canal-Net 2022 [ 25 ] CBCT MC segmentation Single center 3D Fully CNN 2020 [ 16 ] PAN M3-MC segmentation Single center U-Net 2019 [ 17 ] Table 5 Positional Relationship Studies of M3 and MC Data Type Research Focus Data Source Main Methodology Year Index PAN Segmentation and contact classification of M3-MC Single center YOLOv8, SS-TransUnet, DL-based classification methods, CD-IAN injury class algorithm 2024 [ 26 ] CBCT Buccolingual orientation classification of M3-MC Single center Dense121 U-Net, 3D distance-aware network, SDM 2023 [ 27 ] PAN M3-MC contact classification Two centers YOLOv3 2023 [ 28 ] PAN M3-MC contact classification Two centers ResNet-152, VGG-19 2023 [ 29 ] PAN M3-MC contact classification Four centers RetinaNet, YOLOv3, EfficientDet-D4 2023 [ 30 ] PAN M3-MC contact & buccolingual classification Single center ResNet-50 2022 [ 31 ] PAN M3-MC contact classification Single center YOLOv4 2021 [ 32 ] CBCT M3-MC segmentation & contact classification Single center U-Nets, ResNet-34 2021 [ 33 ] Papasratorn et al. achieved an AUC of 0.996 for classifying M3M-IAC contact relationships on panoramic radiographs using VGG-16 network with tenfold data augmentation, though such extensive augmentation might compromise generalization to unseen datasets [ 34 ]. Utilizing a different approach, Soltani et al. implemented a two-stage framework combining Faster R-CNN for M3 and MC region detection with ResNeXt architecture for anatomical relationship classification, achieving an accuracy of 0.85 [ 35 ]. For CBCT image analysis, Liu and colleagues developed an integrated framework incorporating U-Net for M3 and MC segmentation and ResNet-34 for relationship classification, demonstrating an average accuracy of 93.3%, comparable to oral and maxillofacial radiology residents'performance [ 33 ]. Advancing this field further, Chun et al. proposed an innovative 3D distance-aware classification network that leverages both original CBCT volumes and segmentation-derived Symbolic Distance Maps (SDMs) as input, enhancing the capture of three-dimensional anatomical and geometric features [ 27 ]. In this study, we designed and developed an AI model based on the DeepLab V3 + network model, NumPy and Mayavi library reconstruction methods, and a nearest point pair search algorithm based on the KD tree. This study achieves the shortest distance quantification between M3 and MC in 3D space for the first time, bridging the gap in previous studies. AI-assisted CBCT multi-class segmentation reconstruction and distance quantification provide reliable anatomical information of the operative area with lower manpower input and very low time cost, accelerating the clinical decision-making process to guide clinicians in surgical design. Currently, models based on the CNN framework are the most commonly used algorithm architecture for studying the spatial relationships of M3 and MC [ 26 – 28 , 30 , 31 , 33 ]. There are two main approaches for M3-MC location relation classification: one is to perform the target detection task, and the other is to perform the image classification task. In the target detection task, several studies have adopted advanced DL models such as YOLOv4 and RetinaNet to achieve high-precision detection of M3-MC contact relations on PAN images. For example, Zhu et al. developed a YOLOv4-based DL network to detect M3-MC contact relationships on PAN [ 32 ]. Jeon et al. developed three DL models, RetinaNet, YOLOv3, and EfficientDet-D4, using original panoramic radiograph datasets from six devices at four centers, of which EfficientDet-D4 showed the highest accuracy of 78.65% [ 30 ]. For image classification tasks, researchers have explored various deep learning architectures such as ResNet, VGG, and DenseNet for evaluating the contact relationship and relative position of M3-MCs. Lo et al. evaluated ResNet-152 and VGG-19's diagnostic ability of whether M3-MCs are in contact or not in PAN data and compared it with that of trainee dental students, finding a significant difference in diagnostic performance between the two CNNs and the trainee students [ 29 ]. Choi et al. developed a CNN model based on ResNet-50 for classifying the contact relationship and buccolingual localization of M3-MCs on the PAN for assessment [ 26 ]. Although 2D semantic segmentation facilitates the identification of relevant image features in classification networks, the conversion of rich volumetric data into structured diagnostic indicators undermines the fundamental advantage of CBCT in providing detailed three-dimensional spatial information. In our proposed approach, 3D reconstruction is achieved by stacking semantic segmentation results from sequential 2D ROI images derived from CBCT tomography, enabling effective deep learning with limited samples. This methodology offers distinct advantages over direct 3D convolution approaches. From a data perspective, our stacking method demonstrates flexibility regarding CBCT image resolution and slice thickness, performing well even with varying slice thicknesses and voxel anisotropy. The approach requires fewer training samples, making it particularly suitable for resource-constrained environments while reducing data collection burden. Algorithmically, our method leverages well-established 2D segmentation architectures such as U-Net and DeepLab, which are more manageable for training and optimization. By decomposing complex 3D reconstruction into a series of 2D problems, we reduce model complexity compared to specialized 3D convolutional networks that demand extensive computational resources and large-scale 3D labeled datasets. Additionally, by focusing reconstruction solely on relevant categories of interest rather than the entire volume, our approach significantly reduces computational and storage requirements. This efficiency is particularly crucial for deploying 3D reconstruction models on medical devices or mobile platforms, as it avoids the redundant processing of background regions that typically occupy substantial volume in CBCT images but offer limited diagnostic value. Moreover, our scheme can better cope with the anisotropy problem of CBCT images. CBCT imaging systems inherently exhibit anisotropic spatial resolution, with lower resolution in the slice (axial) direction compared to the in-plane (transverse) directions. Consequently, direct 3D convolution may inadequately capture features along the axial axis due to this resolution discrepancy, whereas our 2D slice-based segmentation better preserves structural details within high-resolution transverse planes. However, the 3D reconstruction method based on stacking 2D slice semantic segmentation results also has limitations. The 3D reconstruction results obtained by stacking 2D segmentation results lack contextual relevance. The segmentation of each slice is carried out independently, ignoring the spatial information between the slices, which may lead to reconstruction results being inferior to direct 3D convolution in terms of 3D spatial continuity and smoothness. To address this, we apply Gaussian filtering between layers in the reconstruction process to make the 3D reconstruction result smoother. Additionally, for tissue structures with complex 3D morphological changes, especially those with large changes in the slice direction, it may be difficult to accurately reconstruct them based on the 2D slice method. Then, we obtained the shortest distance in three-dimensional space through a nearest point pair search algorithm based on KD-trees, achieving explainability for the diagnostic decisions output by the AI system. The output results based on DL models have a black-box nature. On one hand, clinical doctors find it difficult to trust AI decisions, and on the other hand, such results are also challenging to apply in doctor-patient communication. Therefore, in the distance quantification module of our AI model, we introduced a nearest point pair search algorithm based on KD-trees and provided the computational code and process explanation. The final output result is a concrete three-dimensional model with corresponding shortest distances, realizing the explainability of AI decisions. In this study, we initially adopted a brute-force search algorithm to find the nearest point pair and shortest distance between two point sets. This algorithm iterates through each point in the first point set, and for each point, calculates its distance to all points in the second point set, updating the minimum distance and nearest point pair. The time complexity of this method is O(n*m), where n and m are the number of points in the two point sets, respectively. Although this algorithm is simple, intuitive, and easy to implement, it has low computational efficiency and high memory consumption when processing large-scale point cloud data. Moreover, this algorithm does not utilize the spatial distribution information of the point cloud and cannot quickly narrow down the search range. To improve the computational efficiency and scalability of the algorithm, we further improved the nearest point pair search algorithm by introducing the KD-tree spatial indexing structure. Specifically, we used the cKDTree class from the scipy library to construct a KD-tree for the second point set. cKDTree is a KD-tree implemented in C language, which is more efficient compared to pure Python implementations. After constructing the KD-tree, for each point in the first point set, we perform a nearest neighbor search in the KD-tree to find the closest point and update the minimum distance and nearest point pair. By leveraging the spatial partitioning characteristics of KD-trees, we reduced the search complexity to O(n*log m), significantly improving the computational efficiency of the algorithm on large-scale point cloud data. Finally, comparing AI reconstruction measurements, MCS measurements, and CRP measurements with the gold standard verified the accuracy of our AI system in measuring M3-MC three-dimensional spatial distances, showing reliable clinical application potential. Comparative analysis of doctors'measurements under MCS and CRP simulated the vast majority of real clinical environments. The study found that although ME was negative in MCS, indicating that this method's measurements were on average smaller than the gold standard, this might be due to doctors interpreting measurements close to 0 mm as 0 on MCS, which is also a kind of over-interpretation. For MSE and RMSE, through squared errors, MSE gives higher weight to larger errors, thus making it more sensitive to large deviations in model predictions. When errors are less than 1, squared errors can still reflect the degree of deviation between predicted and actual values. However, it's worth noting that since the error values are less than 1, squaring them makes these error values even smaller, which may result in relatively small MSE values. The existing results indicate that there are cases where errors exceed 1 in CRP and MCS measurements. Literature suggests that errors within 1 are acceptable, which means CRP and MCS have unacceptable errors or errors that could affect clinical judgment [ 36 ]. The R 2 coefficient of determination showed the fit of different measurement methods to the gold standard, with values closer to 1 being better. The relationship between CRP and reconstruction has a greater impact, so the linear relationship is not strong. Both MCS and AI are very close to 1, showing a linear relationship. The error in MCS might be due to systematic errors caused by the measurement method. Despite the promising performance and interpretability of our AI system in multi-classification segmentation, several limitations should be acknowledged. First, our study utilized data from a single center, which may limit the evaluation of the model's robustness and generalization capabilities across different clinical settings. This suggests that in practical application scenarios, the model's accuracy may be influenced by differences in patient characteristics and imaging equipment across clinical centers. Additionally, the relatively small sample size of participating physicians in the experimental validation phase might have introduced potential bias in the assessment of the system's clinical utility. Finally, our current study only included samples without pathological conditions such as deep caries, periapical infection, or periodontitis, which could affect the radiographic characteristics of the impacted teeth and their surrounding alveolar bone, potentially interfering with the model's segmentation performance and the final spatial distance calculation results. These limitations may affect the overall external validity of our findings and the applicability of the AI system in broader clinical practice. Future work will focus on addressing these limitations through multi-center data collection to enhance the model's generalization ability and robustness. In practical applications, good generalization performance means that the model can maintain high accuracy and robustness across different clinical environments or patient populations. Having data from multiple clinical settings that cover diverse patient demographics and imaging protocols would help provide a more comprehensive evaluation of the model's robustness. Additionally, variations in CBCT imaging quality, operator expertise, and institutional practices among centers could impact the AI system's ability to generalize to new datasets. Future research will involve collecting data from multiple centers to assess the model's performance in a more varied clinical environment. Expanding the diversity of training and testing data will also aid in evaluating the model's capacity to handle different anatomical variations and various pathological conditions. At the model development level, we also aim to conduct comprehensive algorithm comparisons and explore architectural improvements to optimize the AI framework configuration. Furthermore, expanding the cohort of participating clinicians in experimental validation will strengthen the reliability and clinical validity of our findings. Conclusions In this study, we proposed a solution for multi-category 3D reconstruction using semantic segmentation results of 2D images in low-resource scenarios, and utilized the DeeplabV3 + algorithm to construct semantic segmentation models. The DeeplabV3 + neural network applied in this paper demonstrated high accuracy in segmenting M3 and MC. We implemented a nearest point pair search algorithm based on KD trees to achieve efficient quantitative computation of the spatial shortest distance between M3 and MC. Finally, we used NumPy and Mayavi libraries to achieve 3D reconstruction and visualization output of the results, verifying high accuracy performance comparable to radiologist measurements. In summary, we designed an AI system with high measurement accuracy and interpretability, which represents the first study on the quantification of spatial distances between M3 and MC. The results can be utilized as a preoperative risk assessment index, valuable information for patient-doctor communication, and a basis for surgical plan design. This innovative approach bridges a gap in existing research and offers significant potential for improving clinical practice in mandibular third molar extraction procedures. Supplementary Information Supplementary Material 1 Acknowledgements Not applicable. Abbreviations CBCT Cone-beam computed tomography CRP CBCT Reconstructed Panoramic IAN Inferior alveolar nerve ICC Intraclass correlation coefficients IoU Intersection over Union M3 Third molar MAE Mean absolute error MC Mandibular canal MCS CBCT Mandibular Cross-Section ME Mean error MSE Mean square error PA Pixel accuracy PAN Panoramic radiograph R 2 Coefficient of determination ROI Region of interest RMSE Root mean square error Authors’ contributions Wenjie Lyu and Shang Lou wrote the manuscript text. Yu Qiao and Kexiong OuYang reviewed and revised the manuscript. Wenjie Lyu and Huanggan Liao collected the data. Jieying Huang analyzed the data and prepared all the figures. Zelun Huang and haoran Zheng have written an artificial intelligence program. All Authors gave final approval for publication. Funding The authors declare no funding for this study. Data availability The datasets analyzed during the current study are available from the corresponding author on reasonable request. Declarations Ethics approval and consent to participate The study protocol was approved by the Ethics Committee of Shenzhen Guangming District People's Hospital (approval number: LL-KT-2024023) and complied with the guidelines of the Declaration of Helsinki. Written informed consent was obtained from all study participants. Consent for publication Not applicable. Competing interests The authors declare no competing interests. Footnotes Publisher’s Note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations. Wenjie Lyu and Shang Lou co-first authors. Contributor Information Yu Qiao, Email: qiaoyu95@mail.sysu.edu.cn. Kexiong OuYang, Email: ouyangkexiong@163.com. References 1. Kuang S, Liu Y, Zhuang W, Li K, Yang W, Tian Y. The effect of root orientation on inferior alveolar nerve injury after extraction of impacted mandibular third molars based on propensity score-matched analysis: a retrospective cohort study. BMC Oral Health. 2023;23(1):929. 2. Ramadorai A, Tay ABG, Vasanthakumar G, Lye WK. Nerve Injury After Surgical Excision of Mandibular Third Molars Under Local Anesthesia: An Audit. Journal of maxillofacial and oral surgery. 2019;18(2):307–13. 3. Cheung LK, Leung YY, Chow LK, Wong MC, Chan EK, Fok YH. Incidence of neurosensory deficits and recovery after lower third molar surgery: a prospective clinical study of 4338 cases. Int J Oral Maxillofac Surg. 2010;39(4):320–6. 4. Li Y, Ling Z, Zhang H, Xie H, Zhang P, Jiang H, Fu Y. Association of the Inferior Alveolar Nerve Position and Nerve Injury: A Systematic Review and Meta-Analysis. Healthcare (Basel, Switzerland). 2022;10(9). 5. Sisk AL, Hammer WB, Shelton DW, Joy ED Jr. Complications following removal of impacted third molars: the role of the experience of the surgeon. Journal of oral and maxillofacial surgery : official journal of the American Association of Oral and Maxillofacial Surgeons. 1986;44(11):855–9. 6. Hasegawa T, Ri S, Umeda M, Komori T. Multivariate relationships among risk factors and hypoesthesia of the lower lip after extraction of the mandibular third molar. Oral Surg Oral Med Oral Pathol Oral Radiol Endod. 2011;111(6):e1-7. 7. Kang F, Sah MK, Fei G. Determining the risk relationship associated with inferior alveolar nerve injury following removal of mandibular third molar teeth: A systematic review. Journal of stomatology, oral and maxillofacial surgery. 2020;121(1):63–9. 8. Adibi S, Paknahad M. Comparison of cone-beam computed tomography and osteometric examination in preoperative assessment of the proximity of the mandibular canal to the apices of the teeth. Br J Oral Maxillofac Surg. 2017;55(3):246–50. 9. Luo Q, Diao W, Luo L, Zhang Y. Comparisons of the Computed Tomographic Scan and Panoramic Radiography Before Mandibular Third Molar Extraction Surgery. Medical science monitor : international medical journal of experimental and clinical research. 2018;24:3340–7. 10. Lin X, Xin W, Huang J, Jing Y, Liu P, Han J, Ji J. Accurate mandibular canal segmentation of dental CBCT using a two-stage 3D-UNet based segmentation framework. BMC Oral Health. 2023;23(1):551. 11. Pauwels R, Jacobs R, Singer SR, Mupparapu M. CBCT-based bone quality assessment: are Hounsfield units applicable? Dentomaxillofac Radiol. 2015;44(1):20140238. 12. Oliveira-Santos N, Jacobs R, Picoli FF, Lahoud P, Niclaes L, Groppo FC. Automated segmentation of the mandibular canal and its anterior loop by deep learning. Sci Rep. 2023;13(1):10819. 13. Kwak GH, Kwak EJ, Song JM, Park HR, Jung YH, Cho BH, Hui P, Hwang JJ. Automatic mandibular canal detection using a deep convolutional neural network. Sci Rep. 2020;10(1):5711. 14. Lahoud P, Diels S, Niclaes L, Van Aelst S, Willems H, Van Gerven A, Quirynen M, Jacobs R. Development and validation of a novel artificial intelligence driven tool for accurate mandibular canal segmentation on CBCT. J Dent. 2022;116:103891. 15. Usman M, Rehman A, Saleem AM, Jawaid R, Byon SS, Kim SH, Lee BD, Heo MS, Shin YG: Dual-Stage Deeply Supervised Attention-Based Convolutional Neural Networks for Mandibular Canal Segmentation in CBCT Scans. Sensors (Basel, Switzerland) 2022;22(24). 16. Jaskari J, Sahlsten J, Järnstedt J, Mehtonen H, Karhu K, Sundqvist O, Hietanen A, Varjonen V, Mattila V, Kaski K. Deep Learning Method for Mandibular Canal Segmentation in Dental Cone Beam Computed Tomography Volumes. Sci Rep. 2020;10(1):5842. 17. Vinayahalingam S, Xi T, Bergé S, Maal T, de Jong G. Automated detection of third molars and mandibular nerve by deep learning. Sci Rep. 2019;9(1):9007. 18. Naufal MF, Fatichah C, Astuti ER, Putra RH. Deep Learning for Mandibular Canal Segmentation in Digital Dental Radiographs: A Systematic Literature Review. IEEE Access. 2024;12:76794–815. 19. Issa J, Olszewski R, Dyszkiewicz-Konwińska M. The Effectiveness of Semi-Automated and Fully Automatic Segmentation for Inferior Alveolar Canal Localization on CBCT Scans: A Systematic Review. 2022;19(1):560. 20. Huang Z, Zheng H, Huang J, Yang Y, Wu Y, Ge L, Wang L: The Construction and Evaluation of a Multi-Task Convolutional Neural Network for a Cone-Beam Computed-Tomography-Based Assessment of Implant Stability. Diagnostics (Basel, Switzerland) 2022;12(11). 21. Li X, Tao L, Levin CS, Furenlid LR. Fast gamma-ray interaction-position estimation using k-d tree search. Phys Med Biol. 2019;64(15):155018. 22. Eyrich G, Seifert B, Matthews F, Matthiessen U, Heusser CK, Kruse AL, Obwegeser JA, Lübbers HT. 3-Dimensional imaging for lower third molars: is there an implication for surgical removal? Journal of oral and maxillofacial surgery : official journal of the American Association of Oral and Maxillofacial Surgeons. 2011;69(7):1867–72. 23. Julien Issa TK. Michał Rychlik, Agata Czajka-Jakubowska, Raphael Olszewski, Marta Dyszkiewicz-Konwińska: Artificial intelligence versus semi-automatic segmentation of the inferior alveolar canal on cone-beam computed tomography scans: A pilot study. Dental and Medical Problems. 2026;2024(2061):2893–9. 24. Ni FD, Xu ZN, Liu MQ, Zhang MJ, Li S, Bai HL, Ding P, Fu KY. Towards clinically applicable automated mandibular canal segmentation on CBCT. J Dent. 2024;144:104931. 25. Jeoun BS, Yang S, Lee SJ, Kim TI, Kim JM, Kim JE, Huh KH, Lee SS, Heo MS, Yi WJ. Canal-Net for automatic and robust 3D segmentation of mandibular canals in CBCT images using a continuity-aware contextual network. Sci Rep. 2022;12(1):13460. 26. Gong Z, Feng W, Su X, Choi C. System for automatically assessing the likelihood of inferior alveolar nerve injury. Comput Biol Med. 2024;169:107923. 27. Chun SY, Kang YH, Yang S, Kang SR, Lee SJ, Kim JM, Kim JE, Huh KH, Lee SS, Heo MS, et al. Automatic classification of 3D positional relationship between mandibular third molar and inferior alveolar canal using a distance-aware network. BMC Oral Health. 2023;23(1):794. 28. Takebe K, Imai T, Kubota S, Nishimoto A, Amekawa S, Uzawa N. Deep learning model for the automated evaluation of contact between the lower third molar and inferior alveolar nerve on panoramic radiography. Journal of dental sciences. 2023;18(3):991–6. 29. Lo Casto A, Spartivento G, Benfante V, Di Raimondo R, Ali M, Di Raimondo D, Tuttolomondo A, Stefano A, Yezzi A, Comelli A: Artificial Intelligence for Classifying the Relationship between Impacted Third Molar and Mandibular Canal on Panoramic Radiographs. Life (Basel, Switzerland) 2023;13(7). 30. Jeon KJ, Choi H, Lee C, Han SS. Automatic diagnosis of true proximity between the mandibular canal and the third molar on panoramic radiographs using deep learning. Sci Rep. 2023;13(1):22022. 31. Choi E, Lee S, Jeong E, Shin S, Park H, Youm S, Son Y, Pang K. Artificial intelligence in positioning between mandibular third molar and inferior alveolar nerve on panoramic radiography. Sci Rep. 2022;12(1):2456. 32. Zhu T, Chen D, Wu F, Zhu F, Zhu H: Artificial Intelligence Model to Detect Real Contact Relationship between Mandibular Third Molars and Inferior Alveolar Nerve Based on Panoramic Radiographs. Diagnostics (Basel, Switzerland) 2021;11(9). 33. Liu MQ, Xu ZN, Mao WY, Li Y, Zhang XH, Bai HL, Ding P, Fu KY. Deep learning-based evaluation of the relationship between mandibular third molar and mandibular canal on CBCT. Clin Oral Invest. 2022;26(1):981–91. 34. Papasratorn D, Pornprasertsuk-Damrongsri S, Yuma S, Weerawanich W. Investigation of the best effective fold of data augmentation for training deep learning models for recognition of contiguity between mandibular third molar and inferior alveolar canal on panoramic radiographs. Clin Oral Invest. 2023;27(7):3759–69. 35. Soltani P, Sohrabniya F, Mohammad-Rahimi H, Mehdizadeh M, Mohammadreza Mousavi S, Moaddabi A, Mohammadmahdi Mousavi S, Spagnuolo G, Yavari A, Schwendicke F. A two-stage deep-learning model for determination of the contact of mandibular third molars with the mandibular canal on panoramic radiographs. BMC Oral Health. 2024;24(1):1373. 36. Almeida VSM, Bomfim RT, Sobreira ACR, Barbosa IDS, Leite-Ribeiro PM, Rubira-Bullen IR, Sarmento VA. Linear measurement accuracy of CBCT panoramic reconstructions: experimental study with dry human mandibles. Oral Radiol. 2021;37(3):421–6. Associated Data Supplementary Materials Supplementary Material 1 Data Availability Statement The datasets analyzed during the current study are available from the corresponding author on reasonable request.
