Computer Vision-Based Intelligent Caries Recognition Method and System
By combining U-Net and ConvNeXt segmentation models, multi-label recall loss function and capsule graph network, the deep autoencoder hyperparameters are optimized, and the problems of details loss and low accuracy in caries image segmentation are solved, and efficient identification and accurate diagnosis of caries lesions are achieved.
Patent Information
- Application Number
- CN202510194242.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-21
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2045-02-21
AI Technical Summary
The existing medical image segmentation tasks have problems such as loss of detailed information, low accuracy and inaccurate segmentation, especially in the early stage of tooth caries, the small lesions are difficult to identify, the feature extraction of traditional convolutional neural networks is insufficient, and the efficiency of hyperparameter optimization is low, resulting in missed detection or misdiagnosis.
Using a segmentation model combined with U-Net and ConvNeXt, a multi-label recall loss function and capsule graph network are used as the bottleneck layer, and the hyperparameter configuration of the deep autoencoder is optimized to improve feature extraction accuracy and robustness.
It improves the identification accuracy and robustness of caries lesion areas, can effectively capture complex spatial relationships and subtle lesions, ensure low reconstruction errors, and improves the accuracy and prediction ability of caries diagnosis.
Smart Images

Figure CN119672349B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer vision, and specifically refers to a method and system for intelligent recognition of dental caries based on computer vision. Background Art
[0002] With the rapid development of artificial intelligence technology, computer vision has become an important method for medical image segmentation. However, existing medical image segmentation tasks have problems such as loss of detailed information, low accuracy, and inaccurate segmentation, and cannot effectively retain the detailed information of images, resulting in missed detection or incorrect segmentation of lesion areas, especially the tiny lesions in the initial stage of dental caries. Traditional convolutional neural networks may not be able to fully extract features from complex images, especially in the tooth-to-tooth contact area or difficult-to-identify areas, leading to unreliable diagnostic results. Traditional loss functions have problems of inaccurate classification and low recall rate. In multi-label problems, using only single-label loss functions cannot accurately optimize the model. Ordinary feature extraction methods have problems of insufficient recognition of complex lesion areas, and many times cannot capture the complex spatial relationships and subtle lesions in dental caries images, resulting in missed diagnosis or misdiagnosis. General hyperparameter optimization algorithms have problems of low optimization efficiency, resulting in hyperparameter optimization being stuck at local optimal solutions and affecting model performance. Summary of the Invention
[0003] In view of the above situation, to overcome the defects of the existing technology, the present invention provides an intelligent caries recognition method and system based on computer vision. Aiming at the problems of missing detailed information, low accuracy and inaccurate segmentation in the existing medical image segmentation tasks, when performing image segmentation, two basic architectures, U-Net and ConvNeXt, are selected. The present invention combines the decoder part of U-Net with the encoder part of ConvNeXt as a segmentation model, which can effectively process features of different scales, especially when dealing with edge-blurred or smaller lesion areas. In addition, efficient convolutional calculations and improved feature representation capabilities make the segmentation task more accurate and improve the recognition ability for complex lesions. Aiming at the problems of inaccurate classification and low recall rate, the present invention uses a multi-label recall loss function in the segmentation model to ensure effective recognition of caries lesions of different severities. Aiming at the inability to capture complex spatial relationships and subtle lesions in caries images, the present invention introduces a capsule graph network as a bottleneck layer, which can capture potential spatial relationships and high-level dependencies of local features in the data through a dynamic routing mechanism, and has good performance for tiny and complex lesions in caries images. Aiming at the problem of low optimization efficiency in general hyperparameter optimization algorithms, the present invention uses the MFO-SFR-HWACO (Moth-Flame Optimization with Sub-Firefly Replacement and Hybrid Weighted Ant Colony Optimization) algorithm to optimize the hyperparameter configuration of the deep autoencoder, improve the accuracy of the deep autoencoder in the feature extraction process, especially when dealing with complex lesions, and ensure a low reconstruction error, thereby improving the accuracy and robustness of recognition.
[0004] The technical solutions adopted by the present invention are as follows: The intelligent caries recognition method based on computer vision provided by the present invention includes the following steps:
[0005] Step S1: Image acquisition, acquiring a tooth image and performing image quality enhancement, constructing a capsule graph network, and performing data augmentation on the tooth image through the capsule graph network;
[0006] Step S2: Image segmentation, constructing a segmentation model based on a convolutional neural network, generating a segmentation mask of the tooth image and classifying each potential lesion area, and according to the segmentation mask, cropping out each potential lesion area and adjusting it to a sample of a fixed size;
[0007] Step S3: Bottleneck feature extraction, using a deep autoencoder to extract the bottleneck features of the sample, introducing the capsule graph network into the deep autoencoder to generate feature embeddings;
[0008] Step S4: Reconstruction error optimization. Reconstruct the bottleneck features of the samples through a deep autoencoder to obtain the reconstruction error.
[0009] Step S5: Generate a diagnosis result. Based on the reconstruction error, determine whether the sample belongs to the caries lesion area.
[0010] Step S6: Feedback of the diagnosis result. The diagnosis result includes the lesion area, location, historical diagnosis records, and the patient's metadata.
[0011] Step S7: Prediction of caries development. Build a prediction model and predict the development trend of caries lesions based on the diagnosis result.
[0012] Step S8: Generate an intelligent caries report according to the development trend of caries lesions.
[0013] Furthermore, Step S2 specifically includes the following steps:
[0014] Step S21: Training data collection. Collect historical caries lesion image data from clinical images and label each potential lesion area, labeling caries lesion tags, including mild caries, moderate caries, and severe caries.
[0015] Step S22: Build a segmentation model. The architecture of the segmentation model includes an encoder part and a decoder part. The decoder part adopts the structure of the U-Net model, the encoder part introduces the ConvNeXt model, and the decoder part uses skip connections to directly access the encoder.
[0016] Step S23: Set the loss function. Design a multi-label recall loss function, and the formula used is as follows:
[0017] L=- 1 N ∑ i - 1 N ∑ E - 1 E [ w c · y ic · log y ic ^ + 1- y ic · log 1- y ic ^ ] ;
[0018] where is the value of the multi-label recall loss function, is the number of samples, is the sample index, is the number of caries lesion tags, is the weight coefficient of the caries lesion tag, is the th sample's true label in the th category, taking values of 1 or 0, where 1 represents the presence of a lesion and 0 represents the absence of a lesion, is the class probability of the segmentation model for the th sample, ranging from [0,1];
[0019] Step S24: Model training. Use the labeled historical dental caries lesion image data to train the segmentation model in combination with the multi-label recall loss function and the cross-entropy loss function;
[0020] Step S25: Generation of segmentation mask. Input the tooth images after data augmentation in Step S1 into the trained segmentation model to generate a segmentation mask;
[0021] Step S26: Cropping of the lesion area. Use the connected component analysis technique to extract the boundary coordinates of the lesion area from the segmentation mask, and crop each potential lesion area from the tooth images after data augmentation in Step S1 according to the boundary coordinates.
[0022] Further, Step S3 specifically includes the following steps:
[0023] Step S31: Construction of a deep autoencoder. Construct a deep autoencoder architecture including a deep encoder, a deep decoder, and a bottleneck layer, and introduce a capsule graph network into the bottleneck layer;
[0024] Step S32: Generation of pseudo-abnormal data. Perform feature embedding on the samples through the capsule graph network to obtain the bottleneck features of the normal samples, generate pseudo-abnormal features through random perturbation, and use the dynamic fusion strategy to combine the bottleneck features of the normal samples with the pseudo-abnormal features to obtain pseudo-abnormal data;
[0025] Step S33: Design of the loss function. Design a weighted reconstruction error loss function, and the formula used is as follows:
[0026] ;
[0027] where, is the value of the weighted reconstruction error loss function, is the th sample, is the th sample's output data after reconstruction, is the th sample's bottleneck feature, is the th sample's bottleneck feature after reconstruction, is the bottleneck coefficient;
[0028] Step S34: Use the MFO-SFR-HWACO algorithm to optimize the hyperparameters in the deep autoencoder to obtain an optimized deep autoencoder;
[0029] Step S35: Generation of feature embedding. Use the optimized deep autoencoder to directly extract the bottleneck features of the samples as the final feature embedding.
[0030] Further, step S34 specifically includes the following steps:
[0031] Step S341: Initialize the moth population, where each moth individual represents a set of candidate hyperparameter configurations, and set the maximum number of iterations.
[0032] Step S342: Initialize the ant population, and define a path selection rule and pheromone concentration for each ant individual.
[0033] Step S343: Define the search space. The hyperparameter configuration includes the bottleneck layer dimension, the number of neurons, the learning rate, and the batch size. Set the value ranges for all hyperparameters in the hyperparameter configuration.
[0034] Step S344: Global search. Update the moth population according to the moth flame update rule to find potential high-quality hyperparameter configurations in the search space.
[0035] Step S345: Local optimization. Update the ant population using the potential high-quality hyperparameter configurations. The ant individuals select paths according to the weighted reconstruction error loss function, and obtain the optimal hyperparameter configuration by gradually updating the pheromone concentration.
[0036] Step S346: Iterative optimization. Iterate steps S344 to S345 until the maximum number of iterations is reached, and output the optimal hyperparameter configuration.
[0037] The computer vision-based intelligent dental caries recognition system provided by the present invention includes a data acquisition module, an image segmentation module, a bottleneck feature extraction module, a reconstruction error optimization module, a diagnosis result generation module, a dental caries development prediction module, and an intelligent report generation module, and specifically includes the following:
[0038] The data acquisition module acquires dental images and performs image quality enhancement and data augmentation.
[0039] The image segmentation module constructs a segmentation model based on a convolutional neural network, generates a segmentation mask, and transmits the processed samples to the bottleneck feature extraction module.
[0040] The bottleneck feature extraction module uses a deep autoencoder to extract the bottleneck features of the samples, and introduces a capsule graph network to generate feature embeddings.
[0041] The reconstruction error optimization module reconstructs the bottleneck features of the samples through a deep autoencoder, and transmits the reconstruction error to the diagnosis result generation module.
[0042] The diagnosis result generation module determines whether the sample belongs to the dental caries lesion area according to the reconstruction error and generates a diagnosis result.
[0043] The dental caries development prediction module constructs a prediction model to predict the development trend of dental caries lesions based on the diagnosis results;
[0044] The intelligent report generation module generates an intelligent dental caries report, including the diagnosis results and the predicted development trend of dental caries lesions.
[0045] The beneficial effects of the present invention using the above solution are as follows:
[0046] (1) Aiming at the problems of missing detailed information, low accuracy, and inaccurate segmentation in existing medical image segmentation tasks, when performing image segmentation, two basic architectures, U-Net and ConvNeXt, are selected. The present invention combines the decoder part of U-Net with the encoder part of ConvNeXt as a segmentation model, which effectively processes features of different scales. Especially when dealing with edge-blurred or smaller lesion areas, in addition, efficient convolutional calculations and improved feature representation capabilities make the segmentation task more accurate and improve the recognition ability of complex lesions;
[0047] (2) Aiming at the problems of inaccurate classification and low recall rate, the present invention uses a multi-label recall loss function in the segmentation model to ensure effective recognition of dental caries lesions of different severities;
[0048] (3) Aiming at the inability to capture complex spatial relationships and subtle lesions in dental caries images, the present invention introduces a capsule graph network as a bottleneck layer. Through the dynamic routing mechanism, it can capture the potential spatial relationships and high-level dependencies of local features in the data, and has good performance for tiny and complex lesions in dental caries images;
[0049] (4) Aiming at the problem of low optimization efficiency in general hyperparameter optimization algorithms, the present invention uses the MFO-SFR-HWACO algorithm to optimize the hyperparameter configuration of the deep autoencoder, improving the accuracy of the deep autoencoder in the feature extraction process. Especially when dealing with complex lesions, it can ensure a low reconstruction error, thereby improving the recognition accuracy and robustness. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 It is a schematic flowchart of the dental caries intelligent recognition method based on computer vision provided by the present invention;
[0051] Figure 2 It is a schematic flowchart of image segmentation;
[0052] Figure 3 It is a schematic flowchart of the MFO-SFR-HWACO algorithm.
[0053] The drawings are used to provide a further understanding of the present invention, and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention, and do not constitute a limitation to the present invention. Detailed implementation mode
[0054] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments; based on the embodiments in the present invention, all other embodiments obtained by those of ordinary skill in the art without creative work belong to the scope of protection of the present invention.
[0055] In the description of the present invention, it should be understood that the terms "upper", "lower", "front", "rear", "left", "right", "top", "bottom", "inner", "outer", etc. indicating the orientation or positional relationship are based on the orientation or positional relationship shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the present invention.
[0056] Example 1, refer to Figure 1 , the intelligent caries recognition method based on computer vision provided by the present invention, the method includes the following steps:
[0057] Step S1: Image acquisition, acquire a dental image and perform image quality enhancement, construct a capsule graph network, and perform data augmentation on the dental image through the capsule graph network;
[0058] Step S2: Image segmentation, construct a segmentation model based on a convolutional neural network, generate a segmentation mask of the dental image and classify each potential lesion area, and according to the segmentation mask, crop out each potential lesion area and adjust it to a sample of a fixed size;
[0059] Step S3: Bottleneck feature extraction, use a deep autoencoder to extract the bottleneck features of the sample, introduce the capsule graph network into the deep autoencoder to generate feature embeddings;
[0060] Step S4: Reconstruction error optimization, reconstruct the bottleneck features of the sample through the deep autoencoder to obtain a reconstruction error;
[0061] Step S5: Generate a diagnosis result, and judge whether the sample belongs to a caries lesion area according to the reconstruction error;
[0062] Step S6: Diagnosis result feedback, the diagnosis result includes the lesion area, location, historical diagnosis record and the patient's metadata;
[0063] Step S7: Prediction of caries development, construct a prediction model, and predict the development trend of caries lesions according to the diagnosis result;
[0064] Step S8: Generate an intelligent dental caries report based on the development trend of dental caries lesions.
[0065] Example 2, refer to Figure 2 , based on the above example, step S2 specifically includes the following steps:
[0066] Step S21: Training data collection, collect historical dental caries lesion image data from clinical images and label each potential lesion area, label dental caries lesion tags, including mild dental caries, moderate dental caries, and severe dental caries;
[0067] Step S22: Build a segmentation model. The architecture of the segmentation model includes an encoder part and a decoder part. The decoder part adopts the structure of the U-Net model, the encoder part introduces the ConvNeXt model, and the decoder part uses skip connections to directly access the encoder;
[0068] Step S23: Set the loss function, design a multi-label recall loss function, and the formula used is as follows:
[0069] L=- 1 N ∑ i - 1 N ∑ E - 1 E [ w c · y ic · log y ic ^ + 1- y ic · log 1- y ic ^ ] ;
[0070] Where, is the multi-label recall loss function value, is the number of samples, is the sample index, is the number of dental caries lesion tags, is the weight coefficient of the dental caries lesion tag, is the th sample at the th category, the true label takes the value of 1 or 0, 1 represents the existence of a lesion, and 0 represents the absence of a lesion, is the class probability of the segmentation model for the th sample, and the range is [0,1];
[0071] Step S24: Model training, use the labeled historical dental caries lesion image data, and combine the multi-label recall loss function and the cross-entropy loss function to train the segmentation model;
[0072] Step S25: Generate a segmentation mask, input the tooth image after data augmentation in step S1 into the trained segmentation model to generate a segmentation mask;
[0073] Step S26: Crop the lesion area, use the connected component analysis technique to extract the boundary coordinates of the lesion area from the segmentation mask, and crop each potential lesion area from the tooth image after data augmentation in step S1 according to the boundary coordinates.
[0074] In this embodiment, the architecture of the segmentation model is divided into an encoder part, a decoder part, and skip connections;
[0075] Encoder part: The ConvNeXt model is used as the encoder. The input size of ConvNeXt is set to 224x224, and standard convolutional layers and residual blocks (ResBlock) are configured. The convolutional kernel size is 3x3, the stride is 1, and the pooling layer uses 2x2 max pooling;
[0076] Decoder part: The decoder part of the U-Net architecture is used. The decoder of the U-Net restores the spatial resolution of the image through upsampling operations. The decoder part of the U-Net contains multiple upsampling layers, and each upsampling layer is followed by a convolutional layer to gradually restore the details of the image;
[0077] Skip connections: The decoder part directly accesses the feature maps output by the encoder through skip connections, thereby ensuring that high-resolution features are retained during the decoding process;
[0078] The output channel numbers of the ConvNeXt encoder part are set to 64, 128, 256, and 512, gradually increasing;
[0079] The upsampling step of the U-Net decoder part is set to 2, and the spatial size of the feature map is gradually restored through convolutional operations.
[0080] In this embodiment, in step S23, the number of samples is set to 1000, the number of lesion categories is set to 3 (corresponding to mild dental caries, moderate dental caries, and severe dental caries respectively), and for different categories, the class weight coefficients are set to 1, 2, and 1.5 (corresponding to mild dental caries, moderate dental caries, and severe dental caries respectively);
[0081] In this embodiment, in step S24, during model training, the labeled historical dental caries lesion image data is input into the model for training. The dataset is divided into a training set, a validation set, and a test set, with a ratio of 80%, 10%, and 10%. The Adam optimizer is used, and the learning rate is set to 0.001;
[0082] In this embodiment, in step S25, the augmented tooth images are input into the trained segmentation model to obtain a predicted segmentation mask with a size of 224x224. The value of each pixel indicates whether that position belongs to the lesion area, and the class of each pixel is determined by the class probability.
[0083] In this embodiment, the code for constructing the segmentation model is as follows:
[0084] import tensorflow as tf
[0085] from tensorflow.keras import layers, models
[0086] from tensorflow.keras.applications import ConvNeXt
[0087] # Build the segmentation model
[0088] def build_segmentation_model(input_shape=(224, 224, 3)):
[0089] # Encoder part: ConvNeXt model
[0090] base_model = ConvNeXt(input_shape=input_shape, include_top=False)
[0091] encoder_output = base_model.output
[0092] # Decoder part: U-Net structure
[0093] x = layers.UpSampling2D(size=(2, 2))(encoder_output)
[0094] x = layers.Conv2D(512, (3, 3), activation='relu', padding='same')(x)
[0095] x = layers.UpSampling2D(size=(2, 2))(x)
[0096] x = layers.Conv2D(256, (3, 3), activation='relu', padding='same')(x)
[0097] x = layers.UpSampling2D(size=(2, 2))(x)
[0098] x = layers.Conv2D(128, (3, 3), activation='relu', padding='same')(x)
[0099] x = layers.UpSampling2D(size=(2, 2))(x)
[0100] x = layers.Conv2D(64, (3, 3), activation='relu', padding='same')(x)
[0101] # Output layer: The segmentation classes are 3 (mild, moderate, severe)
[0102] output = layers.Conv2D(3, (1, 1), activation='softmax')(x)
[0103] # Create the model
[0104] model = models.Model(inputs=base_model.input, outputs=output)
[0105] return model
[0106] # Create the model
[0107] model = build_segmentation_model()
[0108] model.summary().
[0109] Example 3. This example is based on the above example. Step S3 specifically includes the following steps:
[0110] Step S31: Construct a deep autoencoder, construct a deep autoencoder architecture including a deep encoder, a deep decoder, and a bottleneck layer, and introduce a capsule graph network into the bottleneck layer;
[0111] Step S32: Generate pseudo-anomaly data. Embed the features of the samples through the capsule graph network to obtain the bottleneck features of the normal samples. Generate pseudo-anomaly features through random perturbation, and use a dynamic fusion strategy to combine the bottleneck features of the normal samples with the pseudo-anomaly features to obtain pseudo-anomaly data;
[0112] Step S33: Design a loss function. Design a weighted reconstruction error loss function, and the formula used is as follows:
[0113] ;
[0114] Where, is the value of the weighted reconstruction error loss function, is the th sample, is the data output after the th sample is reconstructed, is the bottleneck feature of the th sample, is the bottleneck feature after the th sample is reconstructed, is the bottleneck coefficient;
[0115] Step S34: Use the MFO-SFR-HWACO algorithm to optimize the hyperparameters in the deep autoencoder to obtain an optimized deep autoencoder;
[0116] Step S35: Feature embedding generation, use the optimized deep autoencoder to directly extract the bottleneck features of the samples as the final feature embedding.
[0117] In this embodiment, the code used is as follows:
[0118] import numpy as np
[0119] import tensorflow as tf
[0120] from tensorflow.keras import layers, models
[0121] from tensorflow.keras.optimizers import Adam
[0122] # Step S31: Build a deep autoencoder
[0123] # Define the deep autoencoder architecture
[0124] def build_autoencoder(input_dim, bottleneck_dim):
[0125] # Encoder
[0126] encoder_input = layers.Input(shape=(input_dim,))
[0127] x = layers.Dense(128, activation='relu')(encoder_input)
[0128] x = layers.Dense(64, activation='relu')(x)
[0129] bottleneck = layers.Dense(bottleneck_dim, activation='linear',name="bottleneck_layer")(x)
[0130] # Decoder
[0131] x = layers.Dense(64, activation='relu')(bottleneck)
[0132] x = layers.Dense(128, activation='relu')(x)
[0133] decoder_output = layers.Dense(input_dim, activation='sigmoid')(x)
[0134] autoencoder = models.Model(encoder_input, decoder_output)
[0135] encoder = models.Model(encoder_input, bottleneck)
[0136] return autoencoder, encoder
[0137] # Build the deep autoencoder
[0138] input_dim = 20 # Input feature dimension
[0139] bottleneck_dim = 10 # Bottleneck layer feature dimension
[0140] autoencoder, encoder = build_autoencoder(input_dim, bottleneck_dim)
[0141] # Introduce the capsule graph network as part of the bottleneck features (schematic implementation here)
[0142] # In the example, a simple embedding is used. The complete capsule network implementation needs to be further extended
[0143] class CapsuleLayer(layers.Layer):
[0144] def __init__(self, num_capsules, dim_capsule, **kwargs):
[0145] super(CapsuleLayer, self).__init__(**kwargs)
[0146] self.num_capsules = num_capsules
[0147] self.dim_capsule = dim_capsule
[0148] def build(self, input_shape):
[0149] self.W = self.add_weight(shape=(input_shape[-1], self.num_capsules * self.dim_capsule),
[0150] initializer='glorot_uniform', name='W')
[0151] def call(self, inputs):
[0152] u_hat = tf.matmul(inputs, self.W)
[0153] u_hat = tf.reshape(u_hat, (-1, self.num_capsules, self.dim_capsule))
[0154] return tf.nn.sigmoid(u_hat)
[0155] # Add the capsule layer to the bottleneck features
[0156] capsule_layer = CapsuleLayer(num_capsules=5, dim_capsule=2)
[0157] # Step S32: Pseudo-anomaly data generation
[0158] def generate_pseudo_anomalies(normal_features, noise_factor=0.1):
[0159] """Generate pseudo - anomaly features"""
[0160] noise = np.random.normal(0, noise_factor, normal_features.shape)
[0161] pseudo_anomalies = normal_features + noise
[0162] return pseudo_anomalies
[0163] # Generate normal and pseudo - anomaly data using samples
[0164] normal_features = np.random.rand(100, bottleneck_dim) # Assume there are 100 normal samples
[0165] pseudo_anomalies = generate_pseudo_anomalies(normal_features)
[0166] # Dynamic fusion strategy
[0167] fused_features = 0.7 * normal_features + 0.3 * pseudo_anomalies
[0168] # Step S33: Design the loss function
[0169] # Weighted reconstruction error loss function
[0170] bottleneck_weight = 0.5
[0171] def reconstruction_loss(y_true, y_pred, bottleneck_features,bottleneck_recon):
[0172] reconstruction_loss = tf.reduce_mean(tf.square(y_true - y_pred))
[0173] bottleneck_loss = tf.reduce_mean(tf.square(bottleneck_features - bottleneck_recon))
[0174] return reconstruction_loss + bottleneck_weight * bottleneck_loss
[0175] # Compile the autoencoder
[0176] autoencoder.compile(optimizer=Adam(learning_rate=0.001),
[0177] loss=lambda y_true, y_pred: reconstruction_loss(
[0178] y_true, y_pred, encoder(y_true), encoder(y_pred)))
[0179] # Step S34: Optimize the deep autoencoder
[0180] # Use the pseudo-code of the MFO-SFR-HWACO algorithm to optimize hyperparameters
[0181] def optimize_hyperparameters():
[0182] """Placeholder implementation for optimizing hyperparameters"""
[0183] best_lr = 0.001
[0184] best_batch_size = 32
[0185] return best_lr, best_batch_size
[0186] # Get the optimized hyperparameters
[0187] best_lr, best_batch_size = optimize_hyperparameters()
[0188] # Update the learning rate and recompile the model
[0189] autoencoder.compile(optimizer=Adam(learning_rate=best_lr),
[0190] loss=lambda y_true, y_pred: reconstruction_loss(
[0191] y_true, y_pred, encoder(y_true), encoder(y_pred)))
[0192] # Train the model
[0193] x_train = np.random.rand(1000, input_dim) # Example training data
[0194] y_train = x_train # The target output of the autoencoder is equal to the input
[0195] autoencoder.fit(x_train, y_train, epochs=50, batch_size=best_batch_size)
[0196] # Step S35: Feature embedding generation
[0197] final_features = encoder.predict(x_train).
[0198] Example 4, refer to Figure 3 , this example is based on the above example, step S34, specifically including the following steps;
[0199] Step S341: Initialize the moth population, where each moth individual represents a set of candidate hyperparameter configurations, and set the maximum number of iterations;
[0200] Step S342: Initialize the ant population, and define the path selection rule and pheromone concentration for each ant individual;
[0201] Step S343: Define the search space, the hyperparameter configuration includes the bottleneck layer dimension, the number of neurons, the learning rate, and the batch size, and set the value range for all hyperparameters in the hyperparameter configuration;
[0202] Step S344: Global search, update the moth population according to the flame update rule of the moths, and find potential high-quality hyperparameter configurations in the search space;
[0203] Step S345: Local optimization. Update the moth population using potentially high-quality hyperparameter configurations. Each moth individual selects a path according to the weighted reconstruction error loss function, and the optimal hyperparameter configuration is obtained by gradually updating the pheromone concentration.
[0204] Step S346: Iterative optimization. Iterate from Step S344 to Step S345 until the maximum number of iterations is reached, and output the optimal hyperparameter configuration.
[0205] In this embodiment, initialize the moth population, and the hyperparameter setting range is:
[0206] Bottleneck layer dimension: 8 - 64;
[0207] Number of neurons: 64 - 256;
[0208] Learning rate: 0.0001 - 0.01;
[0209] Batch size: 16 - 64;
[0210] The population size is 10 moth individuals, and each moth initializes its parameters randomly selected as follows:
[0211] The first moth individual: 32, 128, 0.001, 32;
[0212] The second moth individual: 16, 64, 0.005, 16;
[0213] The maximum number of iterations is 50 times;
[0214] Define the ant population size as 10 and initialize the ant population:
[0215] The first ant individual: 24, 96, 0.003, 32;
[0216] The second ant individual: 40, 128, 0.002, 48;
[0217] The initial pheromone concentration is 1.0;
[0218] Define the search space: the bottleneck layer dimension range is 8 - 4, the number of neurons range is 64 - 56, the learning rate range is 0.0001 - 0.01, and the batch size range is 16 - 64;
[0219] The moth population update rule is ;
[0220] Where is the position of the th moth at the th iteration, is the optimal moth in the current population, is a random perturbation factor, with a range of [-0.1, 0.1];
[0221] Through 30 global search iterations, the optimal moth individual is found, and its hyperparameter configuration is: 24, 96, 0.003, 32;
[0222] The pheromone update rule is as follows:
[0223] ;
[0224] where is the pheromone concentration from path to path , and is the weighted reconstruction error loss value for the corresponding configuration;
[0225] Alternate global search and local optimization, and perform 50 iterations in total. Output the final optimal hyperparameter configuration: 28, 112, 0.0025, 32.
[0226] Example 5. The computer vision-based intelligent dental caries recognition system provided by the present invention includes a data acquisition module, an image segmentation module, a bottleneck feature extraction module, a reconstruction error optimization module, a diagnosis result generation module, a dental caries development prediction module, and an intelligent report generation module, and specifically includes the following:
[0227] The data acquisition module acquires dental images and performs image quality enhancement and data augmentation;
[0228] The image segmentation module constructs a segmentation model based on a convolutional neural network, generates a segmentation mask, and transmits the processed samples to the bottleneck feature extraction module;
[0229] The bottleneck feature extraction module uses a deep autoencoder to extract the bottleneck features of the samples and introduces a capsule graph network to generate feature embeddings;
[0230] The reconstruction error optimization module reconstructs the bottleneck features of the samples through a deep autoencoder and transmits the reconstruction error to the diagnosis result generation module;
[0231] The diagnosis result generation module determines whether the sample belongs to the dental caries lesion area based on the reconstruction error and generates a diagnosis result;
[0232] The dental caries development prediction module constructs a prediction model and predicts the development trend of dental caries lesions based on the diagnosis result;
[0233] The intelligent report generation module generates an intelligent dental caries report, including the diagnosis result and the predicted development trend of dental caries lesions.
[0234] It should be noted that, in this text, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or elements inherent to such process, method, article or device.
[0235] Although the embodiments of the present invention have been shown and described, it will be understood by those of ordinary skill in the art that various changes, modifications, substitutions and variations can be made to these embodiments without departing from the principles and spirit of the present invention, and the scope of the present invention is defined by the appended claims and their equivalents.
[0236] The above description of the present invention and its embodiments is not restrictive. What is shown in the drawings is only one of the embodiments of the present invention, and the actual structure is not limited thereto. In general, if those of ordinary skill in the art are inspired by it and design, without creative efforts, structural modes and embodiments similar to the technical solution without departing from the purpose of the present invention, they shall fall within the protection scope of the present invention.
Claims
1. A computer vision-based intelligent caries recognition method, characterized in that: The method includes the following steps: Step S1: Image acquisition. Acquire dental images and enhance the image quality. Construct a capsule graph network, and perform data augmentation on the dental images through the capsule graph network; Step S2: Image segmentation. Construct a segmentation model based on a convolutional neural network, generate a segmentation mask for the dental image and classify each potential lesion area. According to the segmentation mask, crop out each potential lesion area and adjust it to a sample of a fixed size; Step S3: Bottleneck feature extraction. Use a deep autoencoder to extract the bottleneck features of the sample, introduce the capsule graph network into the deep autoencoder to generate feature embeddings; Step S4: Reconstruction error optimization. Reconstruct the bottleneck features of the sample through the deep autoencoder to obtain the reconstruction error; Step S5: Generate a diagnostic result. According to the reconstruction error, determine whether the sample belongs to a carious lesion area; Step S6: Diagnostic result feedback. The diagnostic result includes the lesion area, location, historical diagnostic records, and patient metadata; Step S7: Carious lesion development prediction. Construct a prediction model and predict the development trend of carious lesions according to the diagnostic result; Step S8: Generate an intelligent carious lesion report according to the development trend of carious lesions.
2. The computer vision-based intelligent caries recognition method according to claim 1, wherein: Step S2 specifically includes the following steps: Step S21: Training data acquisition. Acquire historical carious lesion image data from clinical images and label each potential lesion area, label carious lesion tags, including mild caries, moderate caries, and severe caries; Step S22: Construct a segmentation model. The architecture of the segmentation model includes an encoder part and a decoder part. The decoder part adopts the structure of the U-Net model, the encoder part introduces the ConvNeXt model, and the decoder part uses skip connections to directly access the encoder; Step S23: Set the loss function. Design a multi-label recall loss function, and the formula used is as follows: ; Among them, is the multi-label recall loss function value, is the number of samples, is the sample index, is the number of dental caries lesion labels, is the weight coefficient of the dental caries lesion label, is the th sample at the th category's true label, taking values of 1 or 0, where 1 represents the presence of a lesion and 0 represents the absence of a lesion, is the class probability of the segmentation model for the th sample, ranging from [0, 1]; Step S24: Model training. Use the labeled historical carious lesion image data to train the segmentation model in combination with the multi-label recall loss function and the cross-entropy loss function; Step S25: Generate a segmentation mask. Input the data-augmented dental image in Step S1 into the trained segmentation model to generate a segmentation mask; Step S26: Crop the lesion area. Use the connected component analysis technique to extract the boundary coordinates of the lesion area from the segmentation mask. According to the boundary coordinates, crop out each potential lesion area from the data-augmented dental image in Step S1.
3. The computer vision-based intelligent caries recognition method according to claim 1, characterized in that: Step S3 specifically includes the following steps: Step S31: Construct a deep autoencoder. Construct a deep autoencoder architecture including a deep encoder, a deep decoder, and a bottleneck layer, and introduce a capsule graph network into the bottleneck layer; Step S32: Generate pseudo-abnormal data. Perform feature embedding on the sample through the capsule graph network to obtain the bottleneck features of normal samples, generate pseudo-abnormal features through random perturbation, and use a dynamic fusion strategy to combine the bottleneck features of normal samples with the pseudo-abnormal features to obtain pseudo-abnormal data; Step S33: Design the loss function. Design a weighted reconstruction error loss function, and the formula used is as follows: ; Among them, is the weighted reconstruction error loss function value, is the th sample, is the th data output after reconstruction of the th sample, is the bottleneck feature of the th sample, is the bottleneck feature after reconstruction of the th sample; Step S34: Optimize the hyperparameters in the deep autoencoder using the MFO-SFR-HWACO algorithm to obtain an optimized deep autoencoder; Step S34. The MFO-SFR-HWACO algorithm is Moth-Flame Optimization with Sub-Firefly Replacement and Hybrid Weighted Ant Colony Optimization, and specifically includes the following steps: Step S341: Initialize the moth population, where each moth individual represents a set of candidate hyperparameter configurations, and set the maximum number of iterations; Step S342: Initialize the ant population and define the path selection rule and pheromone concentration for each ant individual; Step S343: Define the search space. The hyperparameter configuration includes the bottleneck layer dimension, the number of neurons, the learning rate, and the batch size, and set the value ranges for all hyperparameters in the hyperparameter configuration; Step S344: Global search. Update the moth population according to the flame update rule of the moths to find potential high-quality hyperparameter configurations in the search space; Step S345: Local optimization. Update the ant population using the potential high-quality hyperparameter configurations. The ant individuals select paths according to the weighted reconstruction error loss function, and obtain the optimal hyperparameter configuration by gradually updating the pheromone concentration; Step S346: Iterative optimization. Iterate steps S344 to S345 until the maximum number of iterations is reached, and output the optimal hyperparameter configuration; Step S35: Feature embedding generation. Use the optimized deep autoencoder to directly extract the bottleneck features of the samples as the final feature embedding.
4. A computer vision-based intelligent dental caries recognition system for implementing the computer vision-based intelligent dental caries recognition method according to any one of claims 1-3, characterized in that: It includes a data acquisition module, an image segmentation module, a bottleneck feature extraction module, a reconstruction error optimization module, a diagnosis result generation module, a caries development prediction module, and an intelligent report generation module, and specifically includes the following: The data acquisition module acquires dental images and performs image quality enhancement and data augmentation; The image segmentation module constructs a segmentation model based on a convolutional neural network, generates a segmentation mask, and transmits the processed samples to the bottleneck feature extraction module; The bottleneck feature extraction module uses a deep autoencoder to extract the bottleneck features of the samples and introduces a capsule graph network to generate feature embeddings; The reconstruction error optimization module reconstructs the bottleneck features of the samples through a deep autoencoder and transmits the reconstruction error to the diagnosis result generation module; The diagnosis result generation module determines whether the sample belongs to the caries lesion area according to the reconstruction error and generates a diagnosis result; The caries development prediction module constructs a prediction model and predicts the development trend of caries lesions according to the diagnosis result; The intelligent report generation module generates an intelligent caries report, including the diagnosis result and the predicted development trend of caries lesions.
Citation Information
Patent Citations
Dental caries PS-OCT lesion region segmentation and extraction method based on improved convolutional neural network
CN118015014A
PET-CT lung cancer image enhancement and restoration method based on deep learning
CN118229530A