Method and system for diagnosing deep caries and pulpitis based on diffuse visual information
By constructing a dual-branch network model and combining global feature extraction and noise optimization of the diffusion process of the ViT model, the problem of misdiagnosis and missed diagnosis of deep caries and pulpitis in low-quality oral X-ray images was solved, achieving efficient and accurate dental diagnosis.
Patent Information
- Application Number
- CN202610280177.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-09
- Publication Date
- 2026-06-16
AI Technical Summary
Existing technologies struggle to accurately identify deep caries and pulpitis in low-quality oral X-ray images, especially due to high rates of misdiagnosis and missed diagnosis caused by image noise interference and similarity of lesion features, and there is a lack of unified quantitative diagnostic standards.
A diagnostic method based on diffusion-based visual information is adopted, which integrates the global feature extraction capability of the ViT model with the noise optimization capability of the diffusion process to construct a dual-branch network model. Through the ViT feature extraction branch and the diffusion feature optimization branch, combined with the dynamic weight loss function, efficient and accurate diagnosis of deep caries and pulpitis can be achieved.
It significantly improves the accuracy and consistency of diagnosis of deep caries and pulpitis, reduces the risk of misdiagnosis and missed diagnosis, and enhances the efficiency and reliability of dental diagnosis.
Smart Images

Figure CN122222932A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of medical image diagnosis and medical assistance, and relates to a method and system for diagnosing deep caries and pulpitis based on diffuse visual information. It can be applied in clinical dentistry for rapid and accurate diagnosis of deep caries and early pulpitis, providing dentists with reliable auxiliary diagnostic information and improving diagnostic efficiency and accuracy. Background Technology
[0002] Deep caries, a critical stage in the development of dental caries, can easily lead to pulp infection and early pulpitis if not diagnosed and intervened in a timely manner, potentially resulting in tooth loss. The World Health Organization has listed dental caries, along with cancer and cardiovascular disease, as one of the three major non-communicable diseases requiring global prevention and control. According to relevant oral health epidemiological survey data, the prevalence of dental caries in permanent teeth remains high across different age groups in my country, with the prevalence exceeding 85% in the adult population. However, the clinical diagnostic accuracy of deep caries and early pulpitis falls short of actual needs, mainly due to the following problems:
[0003] First, oral X-ray images, which are relied upon for clinical diagnosis, have significant quality limitations. X-ray imaging projects three-dimensional oral anatomy into two-dimensional images, which are prone to interference such as overlapping tooth roots and artifacts from restorations. At the same time, factors such as slight head movements during the patient's imaging process, differences in equipment performance, and insufficient operator experience can further increase image noise, making the boundaries between deep caries (low-density shadows deep in dentin) and pulpitis (fine inflammatory shadows around the pulp chamber) unclear, seriously affecting visual-based lesion identification.
[0004] Secondly, deep caries and pulpitis share subtle and similar lesion characteristics. The lesion areas of both occupy a very small portion of the X-ray image, averaging only 1‰-2‰ of the total image area, making them typical "small targets." Traditional neural networks' depth receptive fields struggle to effectively capture such minute lesion information. Furthermore, both lesions exhibit progressive boundary morphology in the images, with highly similar visual features, making it easy for even dentists with years of clinical experience to misjudge the situation.
[0005] Furthermore, current diagnostic methods rely excessively on doctors' subjective experience. Currently, clinical diagnosis lacks unified, quantifiable standards, primarily depending on doctors' subjective interpretation of X-ray images and patients' symptom descriptions (e.g., the difference between intermittent dull pain in deep caries and persistent sharp pain in pulpitis is subtle, and patient descriptions are prone to deviation). This leads to potential discrepancies in diagnostic results for the same case among different doctors, resulting in persistently high rates of missed diagnoses and misdiagnoses.
[0006] With the application of deep learning technology in the field of medical imaging, diagnostic methods based on deep convolutional neural networks (CNNs) (such as the ResNet series) and standalone ViT models have been increasingly used in the diagnosis of oral diseases. However, CNN models are limited by their local receptive fields and cannot fully capture the long-range dependencies of the overall anatomical structure of teeth; standalone ViT models, while capable of extracting global features, are extremely sensitive to noise in low-quality images and have poor anti-interference capabilities; and while diffusion models perform well in image generation and enhancement, they have not yet been combined with ViT models for the classification and diagnosis of deep caries and pulpitis, making it difficult to simultaneously meet the dual requirements of "global feature extraction" and "noise suppression." Therefore, there is an urgent need for a diagnostic method that can overcome the above-mentioned technical bottlenecks to improve the diagnostic effectiveness of deep caries and pulpitis. Summary of the Invention
[0007] The purpose of this invention is to provide a method and system for diagnosing deep caries and pulpitis based on diffusion-based visual information. This invention integrates the global feature extraction capability of the ViT model with the noise optimization capability of the diffusion process to construct an integrated diagnostic architecture, addressing the shortcomings of existing diagnostic methods in low-quality image processing, subtle lesion identification, and diagnostic consistency, thereby achieving efficient and accurate diagnosis of deep caries and pulpitis.
[0008] The technical solution adopted by this invention to solve its technical problem is as follows:
[0009] 1. A method for diagnosing deep caries and pulpitis based on diffusion-based visual information, characterized by constructing an integrated diagnostic architecture by fusing the global feature extraction capability of the ViT model with the noise optimization capability of the diffusion process, specifically including the following steps:
[0010] Step 1. Construct a panoramic X-ray dataset specifically for deep caries and pulpitis, including N labeled single-tooth images;
[0011] Step 2. Data preprocessing: The single-tooth image is subjected to image standardization, contrast enhancement, and noise suppression in sequence, and then data enhancement is achieved through random rotation, horizontal flipping, and random scaling and cropping.
[0012] Step 3. Construct a dual-branch network model, which includes a ViT feature extraction branch and a diffusion feature optimization branch. Use the preprocessed single-tooth images in the training set as input to the ViT feature extraction branch, divide the slice into image patches, and after linear embedding and positional embedding, extract global anatomical features through a Transformer encoder to output initial features. The initial features enter the diffusion feature optimization branch, are subjected to forward noise addition, and then reconstructed in reverse through a denoising network to output optimized features. Finally, input the initial features and optimized features into the classification head to complete the binary classification and differentiation between deep caries and pulpitis.
[0013] Step 4. Construct the loss function. The total loss of the dual-branch network model includes the classification loss of the ViT feature extraction branch and the feature optimization branch.
[0014] Step 5. Training and testing the network model.
[0015] 2. The method for diagnosing deep caries and pulpitis based on diffusion-based visual information processing technology according to claim 1, characterized in that, in the dataset described in step 1, firstly, N1 panoramic images are manually labeled to create binary segmentation masks; then, masks are automatically generated for the remaining N2 images using the UNet model, where UNet captures global and local features through a combination of downsampling and upsampling paths and skip connections; subsequently, morphological operations are used to refine the masks, and the bounding box of each tooth is determined through connection region analysis, and individual tooth regions are cropped; after screening, double-blind labeling, and ethical compliance processing, N labeled single-tooth images are obtained.
[0016] 3. The method for diagnosing deep caries and pulpitis based on diffusion-based visual information processing technology according to claim 1, characterized in that the data processing in step 2 is specifically implemented as follows:
[0017] The training data is normalized using the min-max method, which linearly maps the gray values of image pixels to the [0,1] interval;
[0018] Histogram equalization adjusts the distribution of gray values in an image. First, the image gray histogram is calculated to obtain the pixel frequency of each gray value. Then, the original gray values are mapped to a new gray range according to the cumulative distribution function.
[0019] Gaussian filtering is used to remove high-frequency noise from the image while preserving the edge information of the lesion area;
[0020] During the training phase, random augmentation is performed on the preprocessed images.
[0021] The ViT feature extraction branch described in step 3 is implemented as follows: The single-tooth image processed in step 2 is divided into multiple non-overlapping image blocks. Linear embedding processing is performed on each image block to transform the two-dimensional image block into a one-dimensional feature vector. A learnable position embedding vector is added to the one-dimensional feature vector. Feature dependencies at different scales are captured using 12 parallel attention heads. An encoder is composed of 12 layers of multi-head self-attention modules and a feedforward network, with the feedforward network performing non-linear transformations on the features output by the multi-head self-attention modules, ultimately outputting the initial features. .
[0022] The diffusion feature optimization branch described in step 3 is specifically implemented as follows: The initial features output by the ViT feature extraction branch are... Iterative noise addition is performed to ultimately obtain fully noise-enhanced noise features. A 3-layer MLP with residual connections is used as a denoising network, with input noise features. Predict optimized features using time-step embedding vectors. .
[0023] The specific implementation of the ViT feature extraction and diffusion feature optimization branches is as follows:
[0024] The training image processed in step 2 is input into the ViT feature extraction branch. The 224×224 pixel slice is divided into 14×14 non-overlapping 16×16 pixel image blocks. Each image block is flattened and then projected using a linear projection matrix. With bias term Transform into a 768-dimensional embedding vector To preserve the spatial location information of image patches (such as the orientation of the lesion relative to the pulp chamber), each embedding vector is... Superimposed learnable position embeddings This yields feature vectors containing spatial information. This ensures that the subsequent self-attention mechanism can capture the long-range dependencies of tooth anatomy. The specific implementation is as follows:
[0025] A sequence of 196 (14×14) feature vectors containing location information is input into a 12-layer Transformer encoder. Each encoder layer first uses a 12-head multi-head self-attention (MHSA) mechanism to calculate the association weights between different image patches and integrate global anatomical features. Then, a feedforward network is used to perform a nonlinear transformation on the attention features, finally outputting the initial global features extracted by ViT. This feature includes both overall tooth morphology information and local details of the lesion area. To optimize the binary classification task of deep caries and pulpitis, a binary cross-entropy loss method is adopted. .
[0026] Initial features of ViT output Perform the diffusion step, iteratively adding Gaussian noise, gradually reducing... The noise features are transformed into near-randomly distributed noise features to simulate varying degrees of noise interference in clinical images. A denoising network with residual connections is used, taking noise features (training phase) or initial features (inference phase) and time-step embedding vectors as input, predicting and removing added noise, and reconstructing the optimized features. At this point, the loss is due to diffusion. The difference between the optimized noise and the original features is measured; this step can enhance subtle features of lesions (such as the peri-pulp inflammatory shadow in pulpitis), suppress artifacts and noise interference, and improve the discriminative power of features.
[0027] Initial features extracted by ViT Features optimized with diffusion process Element-level addition and fusion are performed to form a comprehensive feature that combines global anatomical information and noise robustness. The fused feature is input into the classification head, and the original output of the fully connected layer is mapped to the [0,1] interval. A probability greater than 0.5 is used to determine pulpitis, and a probability less than 0.5 is used to determine deep caries. At the same time, the prediction confidence is adjusted by temperature scaling parameters to improve the reliability of identifying fuzzy cases.
[0028] The loss function in step 4 is implemented as follows:
[0029] Classification loss The binary cross-entropy loss function is used, and the formula is:
[0030]
[0031] Where S is the batch sample size. The values represent the true labels for the samples, with 0 indicating deep caries and 1 indicating pulpitis. To predict probabilities for the model, The fully connected layer of the classification head maps the fused features to the [0,1] interval;
[0032] Diffusion loss The mean squared error loss function is used, and the formula is:
[0033]
[0034] in, Let be the initial features of the i-th sample. The optimized features of the i-th sample after passing through the denoising network are: The square of the L2 norm;
[0035] Total loss Introducing dynamic weights The formula for adjusting the balance between classification loss and diffusion loss based on the cosine annealing strategy is as follows:
[0036]
[0037] in, Based on the weights, For the current training cycle, This is the maximum training cycle.
[0038] Furthermore, this invention also defines the AdamW optimizer, with an initial learning rate set to... During model training, the momentum and weight decay coefficients are set to... and The learning rate decreases with increasing training cycles, employing an exponential decay strategy, as shown in the formula: , ( =0.977), thus effectively suppressing oscillations. The batch size was set to 32; additionally, the maximum value was used in the experiment. The number of samples is 200, and five-fold cross-validation is used (each fold has 80% of the training set and 20% of the validation set). The model weights with the highest AUC (area under the ROC curve) in each fold of the validation set are saved.
[0039] Furthermore, in the network training and testing of this invention, network training is performed according to the method in step 3, with a batch of samples input for each iteration, and the total loss is calculated. The model parameters are updated via backpropagation. During the testing phase, the slices are input into the trained optimal model to obtain the class prediction probability for each slice. The prediction results for all slices of the same original image are then fused using the mean. Evaluation metrics include accuracy, AUC, sensitivity, specificity, and precision. Accuracy refers to the overall correctness of the model's discrimination; AUC measures the model's discrimination performance at different thresholds; sensitivity measures the model's ability to detect pulpitis; specificity measures the model's ability to correctly identify deep caries; and precision measures the proportion of samples predicted as pulpitis that actually have pulpitis.
[0040] Furthermore, the present invention also provides a system for diagnosing deep caries and pulpitis based on diffusion-based visual information, the system comprising:
[0041] Data acquisition module: Acquires a dataset of panoramic X-ray images specifically for deep caries and pulpitis, including N labeled single-tooth images;
[0042] Data preprocessing module: The single-tooth image is subjected to image standardization, contrast enhancement, and noise suppression in sequence, and then data enhancement is achieved through random rotation, horizontal flipping, and random scaling and cropping;
[0043] Dual-branch network model: This model includes a ViT feature extraction branch and a diffusion feature optimization branch. The preprocessed single-tooth images in the training set are used as input to the ViT feature extraction branch. The slices are divided into image patches, and after linear embedding and positional embedding, global anatomical features are extracted by the Transformer encoder to output the initial features. The initial features are then fed into the diffusion feature optimization branch for forward noise addition, and then reconstructed in reverse by a denoising network to output optimized features. Finally, the initial features and optimized features are input into the classification head to complete the binary classification and differentiation between deep caries and pulpitis.
[0044] The loss function module includes the classification loss of the ViT feature extraction branch and the diffusion feature optimization branch.
[0045] Model training and testing module: Train the model to obtain the optimal model, and then test it.
[0046] The beneficial effects of this invention are as follows:
[0047] This invention achieves accurate differentiation between deep caries and pulpitis based on a diffusion ViT architecture. This method leverages the global self-attention mechanism of ViT to capture long-range dependencies of tooth anatomy and the diffusion process's ability to progressively optimize noise features. Through the collaborative design of ViT and the diffusion process, global anatomical features are extracted from X-ray images and optimized for noise robustness. Simultaneously, multi-timestep forward noise addition simulates image noise interference, and a reverse denoising network reconstructs clear lesion features. A dynamic weight loss function is combined to balance classification performance and feature optimization effects. The diffusion process preserves key lesion details through iterative noise addition and denoising, while ViT focuses on the spatial relationship between the lesion and the pulp cavity. Based on the complementary functions of these two approaches, this method upgrades feature learning from "single global extraction" to a dual-driven approach of "global capture-noise optimization." That is, it simultaneously utilizes ViT's long-range dependency capture capability and the diffusion process's noise suppression capability to enhance the differentiation of subtle differences in lesions. This effectively distinguishes between deep caries and pulpitis lesions with similar features in oral X-ray images, improves the model's ability to identify subtle lesions near the pulp cavity, significantly enhances the differentiation accuracy under different image qualities, and reduces the risk of clinical misdiagnosis and missed diagnosis. Attached Figure Description
[0048] Figure 1 This is a flowchart of an embodiment of the present invention;
[0049] Figure 2 This is a schematic diagram of the diffusion-ViT network framework of the present invention;
[0050] Figures 3(a)-3(f) are comparison curves of the performance of the present invention and the comparative experiment;
[0051] Figure 4 This is a visualization heatmap of the present invention on a medical record. Detailed Implementation
[0052] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0053] This invention first selects images from clinical data to construct a dataset. After expert annotation, image preprocessing, and enhancement, the training / test sets are divided using five-fold cross-validation. Then, a dual-branch architecture is built, using ViT to extract global initial features from the images. During training, the features are denoised and optimized through a denoising network, and the model is optimized by combining classification loss and diffusion loss. During inference, the denoising network optimizes the features extracted by ViT, and after fusion, the probabilities are output through a classification head. The lesion type is determined according to a threshold, achieving accurate identification with performance superior to traditional models and clinical experts. This improves the model's ability to identify deep caries and pulpitis, thereby enhancing its medical assistance role.
[0054] like Figure 1 The flowchart shown below, based on the diffusion ViT method, includes the following steps:
[0055] The dataset described in Step 1 contains 1487 panoramic images of the oral cavity taken by the Finnish Planmeca series X-ray machine at the Dental Department of Zhejiang Provincial People's Hospital, which are already in clinical use. The panoramic image pixel size is 2943*1435. First, approximately 500 panoramic images were manually annotated to create binary segmentation masks, a task performed by an endodontic specialist with over 10 years of experience. Then, masks were automatically generated for the remaining images using the UNet model. UNet captures global and local features through a combination of downsampling and upsampling paths and skip connections. Subsequently, morphological operations (opening operations to remove noise and closing operations to fill holes) were used to refine the masks. Boundary boxes for each tooth were determined through connectivity region analysis, and individual tooth regions were cropped out. After removing severely blurred samples (standard deviation of grayscale value < 20) and samples with missing lesion information (Kappa < 0.6 for expert annotation consistency), 1364 single-tooth images were retained. After double-blind annotation and ethical compliance processing by three experts with more than 10 years of clinical experience in endodontics, the 1364 annotated single-tooth images included 682 images of deep caries and 682 images of pulpitis.
[0056] Step 2. Data Processing: First, the single tooth image is normalized using min-max, and the gray values of each image are mapped to the [0,1] interval. Then, the image gray-level histogram is calculated, and the cumulative distribution function is calculated to increase the gray-level difference between the lesion area and normal tissue, thereby enhancing the visibility of the lesion. Gaussian filtering is used, and convolution is performed on the image to reduce artifact interference. Next, the preprocessed image is randomly enhanced: during random rotation, random angles are generated around the image center within the range of -15° to 15° (step size 1°), horizontal flipping is performed with a 50% probability, and random scaling is performed using a random scaling factor of 0.9-1.0 (step size 0.01). The image is then cropped into 224×224 pixel slices. After enhancement, the training sample size is effectively increased by 3 times to avoid model overfitting. The specific implementation is as follows:
[0057] The training data is normalized using the min-max method, linearly mapping the image pixel grayscale values to the [0,1] interval. The calculation formula is as follows:
[0058] in, Represents the original image at the pixel level grayscale value at that location and These are the minimum and maximum grayscale values of the original image, respectively. This operation can avoid the gradient explosion problem caused by excessive differences in pixel values during training.
[0059] Histogram equalization adjusts the grayscale distribution of an image, enhancing the contrast between lesion areas and normal tissue. First, the image grayscale histogram is calculated to obtain the pixel frequency of each grayscale value. Then, the original grayscale values are mapped to a new grayscale range using the cumulative distribution function (CDF), as shown in the formula:
[0060]
[0061] in, grayscale value The corresponding pixel frequency, This represents the total number of pixels in the image. This is the rounding operation.
[0062] Gaussian filtering was used to remove high-frequency noise from the image while preserving the edge information of the lesion area. A 3×3 Gaussian filter kernel was selected, and the filtering formula was:
[0063]
[0064] in, It is a Gaussian function. (The optimal parameters, verified through experiments, can balance the noise removal effect with the degree of edge preservation.)
[0065] During the training phase, the preprocessed images are randomly augmented: random rotation is performed around the image center within a range of -15° to 15° (step size 1°), horizontal flipping is performed with a 50% probability, and random scaling is performed with a random scaling factor of 0.9-1.0 (step size 0.01), and then cropped into 224×224 pixel slices; after augmentation, the training sample size is effectively expanded by 3 times to avoid model overfitting.
[0066] Step 3. (As shown) Figure 2The diagram shows the network framework for the ViT feature extraction and diffusion feature optimization branches. The specific implementation is as follows: The network is divided into a ViT feature extraction branch and a diffusion feature optimization branch. The ViT feature extraction branch is responsible for extracting global anatomical features of teeth and lesions from the image, while the diffusion branch optimizes the initial features extracted by ViT to address noise interference in low-quality images. Finally, the output features of the two branches are fused for classification and diagnosis.
[0067] In the ViT feature extraction branch, the 224×224 pixel single-tooth image processed in step 2 is divided into 14×14 non-overlapping 16×16 pixel image blocks. Linear embedding is performed on each image block to transform the two-dimensional image block into a one-dimensional feature vector, as shown in the formula:
[0068]
[0069] in For image blocks The flattening operation (converts a 16×16 pixel block into a 256-dimensional vector). The linear embedding weight matrix maps a 256-dimensional vector to a 768-dimensional feature space. This is a bias term.
[0070] To preserve the spatial location information of image patches, learnable location embedding vectors are added. (196 is the total number of image patches), the formula is:
[0071]
[0072] in, This is the location embedding vector corresponding to the i-th image patch, which is optimized along with other parameters during model training.
[0073] Feature dependencies at different scales are captured using 12 parallel attention heads, and the calculation formula is as follows:
[0074]
[0075] in, To add location-embedded image patch feature sequences, ( (the feature dimension of each attention head). , , ( , , (Attention head weight matrix) Output projection matrix for multi-head attention.
[0076] The encoder consists of alternating layers of 12 multi-head self-attention modules and a feedforward network (FFN). The feedforward network contains 2048-dimensional hidden layers and a ReLU activation function, which is used to perform non-linear transformations on the features output by the attention modules, ultimately outputting the initial global features. .
[0077] For the diffusion feature optimization branch, the initial features output by the ViT feature extraction branch are... Perform iterative noise addition, setting a total of For each time step t, Gaussian noise is added according to the following formula:
[0078]
[0079] in, The noise variance is linearly increased from 1e-4 to 0.02, simulating the process of image noise increasing from weak to strong, ultimately yielding fully noise-enhanced noise features. . Indicates time step The characteristics of the output after adding Gaussian noise.
[0080] A 3-layer MLP with residual connections is used as the denoising network, with input noise features. Given the time-step embedding vectors (generated using a sine function to distinguish noise features at different time steps), predict the optimized features using the following formula:
[0081]
[0082] in, This is the embedding vector corresponding to time step t. These are the optimized features obtained after denoising.
[0083] Step 4. Loss Function: Based on Step 3, the loss function of this method is divided into:
[0084] Classification loss ( The binary cross-entropy (BCE) loss function is used to optimize the binary classification task of deep caries and pulpitis. The formula is as follows:
[0085]
[0086] Where S is the batch sample size. (0 represents deep caries, 1 represents pulpitis) is the true label for the sample. To predict probabilities for the model, The fully connected layer of the classification head maps the fused features to the [0,1] interval.
[0087] Diffusion loss ( The mean squared error (MSE) loss function is used to optimize the feature reconstruction accuracy of the denoising network. The formula is as follows:
[0088]
[0089] in, Let be the initial features of the i-th sample. These are the features of the sample after optimization by a denoising network. It is the square of the L2 norm.
[0090] Total loss ( Introducing dynamic weights The formula for adjusting the balance between classification loss and diffusion loss based on the cosine annealing strategy is as follows:
[0091]
[0092] in, ( Based on the weights, For the current training cycle, (For the maximum training period), this weight setting allows for prioritizing the optimization of diffusion loss to improve feature quality in the early stages of training (the first 50 periods), and focusing on classification loss to improve diagnostic accuracy in the later stages (51-200 periods).
[0093] Step 5. Define the AdamW optimizer, setting the initial learning rate to... During model training, the momentum and weight decay coefficients are set to... and The learning rate decreases with increasing training cycles, employing an exponential decay strategy, as shown in the formula: , ( =0.977), thus effectively suppressing oscillations. The batch size was set to 32; additionally, the maximum value was used in the experiment. The number of samples is 200, and five-fold cross-validation is used (each fold has 80% of the training set and 20% of the validation set). The model weights with the highest AUC (area under the ROC curve) in each fold of the validation set are saved.
[0094] Step 6. Network Training and Testing: Train the network as described in Step 3, inputting a batch of samples for each iteration and calculating the total loss. The model parameters are updated through backpropagation. During the testing phase, this method inputs the slices into the trained optimal model to obtain the class prediction probability for each slice. The prediction results for all slices of the same original image are then fused using the mean fusion formula: (K is the number of slices, (where the predicted probability is for the k-th slice) The diagnosis is pulpitis; otherwise, it is deep caries. The assessment metrics used are accuracy, AUC, sensitivity, and precision. Accuracy: TP = True positive, TN = True negative, FP = False positive, FN = False negative; AUC: By plotting ROC curves at different thresholds, with the vertical axis representing sensitivity and the horizontal axis representing 1-specificity, the area under the curve is calculated to comprehensively evaluate the discrimination performance; Sensitivity: Reflects the ability to detect early pulpitis and reduces the rate of missed diagnoses; Specificity: The accuracy of the model is measured to correctly identify deep caries and reduce the risk of overtreatment; This reflects the accuracy of the prediction results and reduces the misdiagnosis rate.
[0095] This method employs five-fold cross-validation to randomly divide the dataset into five mutually exclusive subsets, each containing 273 images (136-137 images of deep caries and 136-137 images of pulpitis), ensuring a balanced proportion of the two classes within each fold. Each experiment uses four subsets (1091 images) as the training set and one subset (273 images) as the test set. After five iterations, the mean of all metrics is taken as the final result. (See Figures 3(a)-3(f) for the results of each metric.)
[0096] Table 1. Comparison of the performance of different diagnostic methods in differentiating between deep caries and early pulpitis.
[0097]
[0098] As shown in Table 1 and Figures 3(a)-3(f), this method significantly outperforms other assessment subjects in all evaluation indicators. The accuracy reached 90.4%, an improvement of 4.2 percentage points compared to ViT alone, 9.1 percentage points compared to ResNet18, and 11.4 percentage points compared to the clinical expert group. The AUC was 0.939, an improvement of 0.024 compared to ViT alone and 0.055 compared to ResNet18, indicating that this method has a stable ability to differentiate between subtle lesions in deep caries and pulpitis, and can adapt to different clinical decision threshold requirements.
[0099] In terms of sensitivity, this method achieves 88.9%, an improvement of 6.4 percentage points compared to ViT alone. It can effectively identify subtle lesions of pulpitis (such as inflammatory shadows with a diameter <1mm around the pulp chamber), significantly reducing the risk of missing early pulpitis and preventing the condition from worsening to pulp necrosis due to missed diagnosis. In terms of specificity, diffusion ViT reaches 91.8%, an improvement of 2.1 percentage points compared to ViT alone and 10.4 percentage points compared to ResNet18, and can reliably distinguish between deep caries and pulpitis. For example, in clinical cases of deep caries close to the pulp chamber but not involving the pulp tissue, ViT alone is easily misdiagnosed as pulpitis due to artifacts from the restoration. However, this method suppresses artifact noise by using diffusion branches and combines ViT branches to capture the key feature of "lesion not infiltrating the pulp chamber wall," correctly identifying it as deep caries, avoiding unnecessary root canal treatment and other overtreatment procedures, and reducing patient pain and treatment costs.
[0100] This method achieves an accuracy of 92.0%, which is 3.3 percentage points higher than ViT alone, 11.8 percentage points higher than ResNet18, and 11.0 percentage points higher than the clinical expert group, ensuring high reliability of the predicted pulpitis result. The diagnosis time is only 0.5 seconds per case, which is only 1 / 60th of that of the clinical expert group (30 seconds per case). It can quickly output the identification results and meet the needs of real-time auxiliary diagnosis in dental clinics and large-scale screening in oral examination centers, significantly improving the efficiency of the diagnosis and treatment process.
[0101] Depend on Figure 4 As shown, this is a visualization of the Grad-CAM heatmap during the model diagnostic process, which can intuitively verify the functional effectiveness of the dual-branch network architecture of this invention: Figure 4 (a) shows the original X-ray image of a case of deep caries. Figure 4 (b) shows the Grad-CAM heatmap of the corresponding case. It can be seen that the heatmap focuses on the low-density shadow area extending into the pulp cavity. This area highly overlaps with the deep caries lesion area marked by the clinical expert, proving that the ViT feature extraction branch can accurately capture the global anatomical correlation features of deep caries lesions. Figure 4 (c) shows the original X-ray image of a pulpitis case. Figure 4The image in (d) shows the Grad-CAM heatmap for the corresponding case. The heatmap focuses on the subtle inflammatory shadows around the pulp chamber, perfectly matching the pulpitis lesion area marked by experts. This demonstrates the role of the diffusion feature optimization branch in suppressing noise interference and enhancing subtle lesion features. The Grad-CAM heatmap clearly shows that the lesion areas prioritized by the model during decision-making are consistent with the key areas for clinical diagnosis. This indicates that the features extracted collaboratively by the dual-branch network have clear clinical significance. It not only achieves accurate classification of deep caries and pulpitis but also transforms the model's decision-making logic from a "black box" to "interpretable" through visualization technology, providing important evidence for clinicians to trust and adopt model-assisted diagnostic results.
Claims
1. A method for diagnosing deep caries and pulpitis based on diffuse visual information, characterized in that, By integrating the global feature extraction capability of the ViT model with the noise optimization capability of the diffusion process, an integrated diagnostic architecture is constructed, which includes the following steps: Step 1. Construct a panoramic X-ray dataset specifically for deep caries and pulpitis, including N labeled single-tooth images; Step 2. Data preprocessing: The single-tooth image is subjected to image standardization, contrast enhancement, and noise suppression in sequence, and then data enhancement is achieved through random rotation, horizontal flipping, and random scaling and cropping. Step 3. Construct a dual-branch network model, which includes a ViT feature extraction branch and a diffusion feature optimization branch; The preprocessed single-tooth images in the training set are used as input to the ViT feature extraction branch. The slices are divided into image patches, and after linear embedding and positional embedding, global anatomical features are extracted by the Transformer encoder to output the initial features. The initial features are fed into the diffusion feature optimization branch for forward noise addition, and then reconstructed in reverse through a denoising network to output optimized features. Finally, the initial features and optimized features are input into the classification head to complete the binary classification and differentiation between deep caries and pulpitis. Step 4. Construct the loss function. The total loss of the dual-branch network model includes the classification loss of the ViT feature extraction branch and the feature optimization branch. Step 5. Training and testing the network model.
2. The method for diagnosing deep caries and pulpitis based on diffusion-based visual information processing technology according to claim 1, characterized in that, The dataset described in step 1 is first processed by manually annotating N1 panoramic images to create binary segmentation masks; then, masks are automatically generated for the remaining N2 images using the UNet model. UNet captures global and local features by combining downsampling and upsampling paths with skip connections; subsequently, morphological operations are used to refine the masks, and the bounding box of each tooth is determined by connected region analysis, and individual tooth regions are cropped out; after screening, double-blind annotation, and ethical compliance processing, N annotated single-tooth images are obtained.
3. The method for diagnosing deep caries and pulpitis based on diffusion-based visual information processing technology according to claim 1, characterized in that, The data processing described in step 2 is specifically implemented as follows: The training data is normalized using the min-max method, which linearly maps the gray values of image pixels to the [0,1] interval; Histogram equalization adjusts the distribution of gray values in an image. First, the image gray histogram is calculated to obtain the pixel frequency of each gray value. Then, the original gray values are mapped to a new gray range according to the cumulative distribution function. Gaussian filtering is used to remove high-frequency noise from the image while preserving the edge information of the lesion area; During the training phase, random augmentation is performed on the preprocessed images.
4. The method for diagnosing deep caries and pulpitis based on diffusion-based visual information processing technology according to claim 1, characterized in that, The ViT feature extraction branch described in step 3 is implemented as follows: The single-tooth image processed in step 2 is divided into multiple non-overlapping image blocks. Linear embedding is performed on each image block to transform the two-dimensional image block into a one-dimensional feature vector. Add a learnable positional embedding vector to the one-dimensional feature vector; Capture feature dependencies at different scales using 12 parallel attention heads; The encoder consists of 12 layers of multi-head self-attention modules alternating with a feedforward network. The feedforward network is used to perform nonlinear transformations on the features output by the multi-head self-attention modules, ultimately outputting the initial features. .
5. The method for diagnosing deep caries and pulpitis based on diffusion-based visual information processing technology according to claim 4, characterized in that, The diffusion feature optimization branch described in step 3 is specifically implemented as follows: The initial features output by the ViT feature extraction branch Iterative noise addition is performed to ultimately obtain fully noise-enhanced noise features. ; A 3-layer MLP with residual connections is used as a denoising network, with input noise features. Predict optimized features using time-step embedding vectors. .
6. The method for diagnosing deep caries and pulpitis based on diffusion-based visual information processing technology according to claim 5, characterized in that, The loss function in step 4 is implemented as follows: Classification loss The binary cross-entropy loss function is used, and the formula is: Where S is the batch sample size. The true labels for the samples are 0 for deep caries and 1 for pulpitis. To predict probabilities for the model, The fully connected layer of the classification head maps the fused features to the [0,1] interval; Diffusion loss The mean squared error loss function is used, and the formula is: in, Let be the initial features of the i-th sample. The optimized features of the i-th sample after passing through the denoising network are: The square of the L2 norm; Total loss Introducing dynamic weights The formula for adjusting the balance between classification loss and diffusion loss based on the cosine annealing strategy is as follows: in, Based on the weights, For the current training cycle, This is the maximum training cycle.
7. A system for diagnosing deep caries and pulpitis based on diffuse visual information, characterized in that, The system is used to implement the method as claimed in any one of claims 1-6, the system comprising: Data acquisition module: Acquires a dataset of panoramic X-ray images specifically for deep caries and pulpitis, including N labeled single-tooth images; Data preprocessing module: The single-tooth image is subjected to image standardization, contrast enhancement, and noise suppression in sequence, and then data enhancement is achieved through random rotation, horizontal flipping, and random scaling and cropping; Dual-branch network model: This model includes a ViT feature extraction branch and a diffusion feature optimization branch. The preprocessed single-tooth images in the training set are used as input to the ViT feature extraction branch. The slices are divided into image patches, and after linear embedding and positional embedding, global anatomical features are extracted by the Transformer encoder to output the initial features. The initial features are then fed into the diffusion feature optimization branch for forward noise addition, and then reconstructed in reverse by a denoising network to output optimized features. Finally, the initial features and optimized features are input into the classification head to complete the binary classification and differentiation between deep caries and pulpitis. The loss function module includes the classification loss of the ViT feature extraction branch and the diffusion feature optimization branch. Model training and testing module: Train the model to obtain the optimal model, and then test it.