A tongue image segmentation method based on edge gating mechanism
By employing an edge-gated tongue image segmentation method, combined with tongue localization and feature fusion techniques, the limitations of traditional tongue diagnosis methods (lack of repeatability) and deep learning models are overcome, achieving accurate segmentation and standardization of tongue edges.
Patent Information
- Application Number
- CN202411548521.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-01
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2044-11-01
AI Technical Summary
Traditional tongue diagnosis methods rely on the doctor's subjective judgment, and the images collected contain redundant information, resulting in non-repeatability and ambiguity. Existing deep learning models have difficulty effectively segmenting the edges of the tongue.
An edge-gated tongue image segmentation method is adopted, combined with YOLOv5-Lite for tongue localization and color correction. The ResNeXt model with embedded SE attention mechanism is used to extract features, and accurate segmentation is performed through edge prediction module and decoder. A weighted fusion loss function is designed to train the model.
It improves the accuracy of tongue edge segmentation and the accuracy of segmentation mask prediction, enhances feature capture capability, solves the problem of blurred tongue edges, and achieves standardization of tongue segmentation.
Smart Images

Figure CN119359751B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a semantic segmentation method for the main body of the tongue in the field of automated diagnosis of tongue appearance in traditional Chinese medicine diagnostics, specifically a tongue image segmentation method based on edge gating mechanism. Background Technology
[0002] Traditional Chinese medicine (TCM) tongue diagnosis methods rely heavily on the doctor's personal judgment and clinical experience, and are easily affected by external environmental factors such as lighting and weather, resulting in non-repeatability and ambiguity. Furthermore, the difficulty in quantifying tongue diagnosis features and the lack of standardized diagnostic results hinder the further development and promotion of the TCM system. Therefore, advancing the objectification of TCM tongue diagnosis methods has become a hot research direction in automated TCM diagnostic systems. A necessary prerequisite for objectifying tongue diagnosis is separating the tongue from the face and lips, i.e., achieving tongue segmentation. During tongue image acquisition, due to hardware limitations, the acquired images often contain additional facial information beyond the tongue. Although optimizing hardware and shooting angles can maximize the capture of the tongue area, it is impossible to completely eliminate redundant information beyond the tongue, posing a challenge to subsequent tongue image classification. Therefore, tongue segmentation must be performed before classifying tongue features.
[0003] Tongue segmentation can be considered a type of image segmentation task. Traditional image segmentation methods include threshold-based methods, watershed methods, edge detection-based methods, graph-cut methods, and the Snakes active contour model. However, traditional image processing methods are often limited when applied to tongue segmentation. For example, graph-cut methods require manually defining the bounding box as the target segmentation location, while the Snakes active contour model uses the HSV color space to obtain the initial tongue contour and converges it to the vicinity of the tongue edge by minimizing the energy function. However, designing a suitable energy function is crucial, resulting in relatively coarse segmentation results that fail to meet the intended goals. In recent years, with the development of deep learning, many high-performing models have emerged for image and semantic segmentation tasks, such as the U-Net series, Deeplab series, and R-CNN series. These models have also been applied to the field of tongue segmentation. However, tongue image data suffers from various issues, such as different shooting angles, different tongue shapes and sizes, and tongue pathological characteristics affecting tongue color and texture. Furthermore, the similarity in lip and tongue colors can easily lead to blurred edges. These factors make it difficult to fully adapt classic deep learning models to tongue segmentation tasks, especially to directly solve the problem of tongue edge segmentation. Summary of the Invention
[0004] Tongue image data analysis faces multiple challenges, including differences in shooting angles, variations in tongue size and shape among patients, and the influence of pathological features on tongue color and texture. Furthermore, the similarity in lip and tongue color often leads to blurred tongue edges. These complex factors make it difficult to directly apply classic deep learning models to tongue segmentation tasks, particularly exhibiting significant limitations in accurately segmenting tongue edges. To overcome these limitations, this invention provides a tongue image segmentation method based on an edge-gating mechanism to address the problem of blurred tongue edge segmentation.
[0005] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0006] I. A Tongue Image Segmentation Method Based on Edge Gating Mechanism
[0007] Step 1: Acquire images of the patient's tongue protrusion;
[0008] Step 2: After preprocessing the acquired tongue protrusion images, a processed standard tongue image is obtained;
[0009] Step 3: Input the processed standard tongue image into the trained tongue segmentation model based on edge gating mechanism, and the model outputs the corresponding tongue segmentation result.
[0010] Step 2 specifically involves:
[0011] After performing tongue localization and color correction on the acquired tongue protrusion images, a processed standard tongue image is obtained.
[0012] Step 2 specifically involves:
[0013] Step 21: Use the YOLOv5-Lite-based target detection model to locate the tongue body in the acquired tongue protrusion image to obtain the tongue body image;
[0014] Step 22: After performing color distortion verification on the tongue body image, a processed standard tongue image is obtained.
[0015] Step 22 specifically involves:
[0016] First, the color deviation of each tongue image is calculated using the equivalent circle detection method. If the color deviation of each tongue image is greater than a preset threshold, the tongue image is checked for color deviation to obtain a processed standard tongue image; otherwise, no processing is performed.
[0017] The tongue segmentation model based on edge gating mechanism includes a ResNeXt model with embedded SE attention mechanism, an ASPP module, a decoder, and an edge prediction module. The ResNeXt model with embedded SE attention mechanism serves as the encoder for feature extraction. The processed standard tongue image is used as the input to the ResNeXt model with embedded SE attention mechanism. The ResNeXt model with embedded SE attention mechanism extracts six feature vectors X0, X1, X2, X3, X4, and X5 at different depths. The first feature vector X0, the third feature vector X2, the fourth feature vector X3, and the sixth feature vector X5 are all input to the edge prediction module. The sixth feature vector X5 is concatenated with the output of the edge prediction module and then input to the ASPP module. The output of the ASPP module serves as the input to the decoder.
[0018] The edge prediction module includes a Canny operator edge extraction module, a fusion layer, a convolutional layer, a residual module, and a gated attention layer. The first feature vector X0 passes through the first convolutional layer and the first residual module in sequence, and then is connected to the first gated attention layer. The third feature vector X2 passes through the second convolutional layer and then is connected to the first gated attention layer. The first gated attention layer passes through the second residual module and then is connected to the second gated attention layer. The fourth feature vector X3 passes through the third convolutional layer and then is connected to the second gated attention layer. The second gated attention layer passes through the third residual module and then is connected to the third gated attention layer. The sixth feature vector X5 passes through the fourth convolutional layer and then is connected to the third gated attention layer. The output of the third gated attention layer is recorded as the edge output. The processed standard tongue image is also used as the input of the Canny operator edge extraction module. The output of the third gated attention layer and the output of the Canny operator edge extraction module are added together and then input into the fusion layer. The output of the fusion layer is used as the output of the edge prediction module.
[0019] The gated attention layer includes a batch normalization layer, a convolutional layer, a ReLU activation layer, and a Sigmoid activation layer. In each gated attention layer, the output of the corresponding residual module is recorded as the first input feature, and the other input is recorded as the second input feature. These features are added element-wise and then fed into the batch normalization layer. The batch normalization layer passes through the fifth convolutional layer, the first ReLU activation layer, the sixth convolutional layer, and the second ReLU activation layer in sequence before being connected to the Sigmoid activation layer. The result of multiplying the second input feature by α times the output of the Sigmoid activation layer is recorded as the intermediate feature. The intermediate feature is added to the second input feature and then fed into the seventh convolutional layer. The output of the seventh convolutional layer is used as the output of the current gated attention layer.
[0020] The decoder includes a double convolutional block and an upsampling layer. The output of the ASPP module is concatenated with the fourth feature vector X3 and then input into the first double convolutional block. The first double convolutional block is connected to the first upsampling layer. The output of the first upsampling layer is concatenated with the third feature vector X2 and then input into the second double convolutional block. The second double convolutional block is connected to the second upsampling layer. The output of the second upsampling layer is concatenated with the first feature vector X0 and the result is used as the output of the decoder.
[0021] During the training process of the tongue segmentation model based on the edge gating mechanism, the loss function used is a weighted fusion loss of the prediction segmentation mask loss and the edge loss.
[0022] The edge loss is a binary cross-entropy loss function (BCE) calculated based on the edge output of the edge prediction module.
[0023] II. A computer device
[0024] The computer device includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps of the tongue image segmentation method based on an edge gating mechanism.
[0025] III. A computer-readable storage medium
[0026] The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the tongue image segmentation method based on an edge gating mechanism.
[0027] IV. A computer program product
[0028] The computer program product includes a computer program / instruction that, when executed by a processor, implements the steps of the tongue image segmentation method based on an edge gating mechanism.
[0029] The beneficial effects of this invention are as follows:
[0030] (1) The method of the present invention uses color correction and tongue positioning preprocessing operations to establish a standard tongue image dataset for the original tongue image data collected by mobile devices.
[0031] (2) In view of the problem of rough tongue edge extraction in the tongue segmentation task, the present invention designs a tongue segmentation method based on edge gating mechanism. An edge branch is added to the Deeplabv3+ model as an improvement, and a loss function of weighted fusion of segmentation loss and edge loss is designed to train the improved model, thereby improving the prediction accuracy of the model segmentation mask.
[0032] (3) The method of the present invention uses a skip connection method in the decoder to fuse the feature vector obtained by the encoder with the feature vector of the decoder, and uses a double convolution and upsampling mechanism to restore the image to its original size, thereby enhancing the feature capture capability and improving the performance of the decoder and the segmentation accuracy. Attached Figure Description
[0033] Figure 1 This is a flowchart of the method of the present invention.
[0034] Figure 2 This is a schematic diagram of the tongue segmentation model based on the edge gating mechanism.
[0035] Figure 3 This is a flowchart of preprocessing operations for tongue-protruding images.
[0036] Figure 4 This is a schematic diagram of the gated attention layer in the edge prediction module. Detailed Implementation
[0037] The present invention will be further described below with reference to the accompanying drawings and specific embodiments, but the scope of protection of the present invention is not limited thereto.
[0038] like Figure 1 and Figure 3 As shown, the tongue image segmentation method based on edge gating mechanism proposed in this invention includes the following steps:
[0039] Step 1: Under natural lighting conditions, use a mobile device such as a mobile phone or camera to capture images of the patient's tongue protrusion. The images should include some facial information and tongue information of the patient.
[0040] Step 2: After preprocessing the acquired tongue protrusion images, a processed standard tongue image is obtained; the preprocessing specifically includes tongue positioning and color correction.
[0041] Step 2 is as follows:
[0042] Step 21: Use a YOLOv5-Lite-based object detection model to locate the tongue in the acquired tongue protrusion images. This is used to filter out facial information, select the central region of the tongue, and obtain the tongue body image. The tongue parts in the original image information are labeled, including the marker category and the maximum and minimum X and Y pixel coordinates of the 2D bounding box, thus obtaining the tongue protrusion image dataset. The YOLOv5-Lite-based object detection model used for prediction and segmentation is pre-trained using the tongue protrusion image dataset. The YOLOv5-Lite-based object detection model uses rectangular boxes to select the tongue parts.
[0043] Step 22: After performing color distortion verification on the tongue body image, a processed standard tongue image is obtained.
[0044] Step 22 is as follows:
[0045] First, the color cast of each tongue body image is calculated using the equivalent circle detection method. If the color cast of each tongue body image is greater than a preset threshold, the color cast of the tongue body image is checked using the gray world method based on standard deviation weighting to obtain a processed standard tongue image; otherwise, no processing is performed.
[0046] The tongue color deviation detection method based on the equivalent circle detection method is as follows:
[0047] First, the standard tongue image processed in RGB color space is converted to Lab color space via XYZ space. The conversion formula is:
[0048]
[0049] The three components X, Y, and Z of the resulting XYZ space are normalized using the white point value of a D65 standard light source, as shown in the following formula:
[0050]
[0051] For the normalized X, Y, and Z components, apply the nonlinear transformation f(t) and calculate the Lab component respectively:
[0052]
[0053] t = x, y, z
[0054] L * =116·f(y)-16,
[0055] a * =500·(f(x)-f(y))
[0056] b * =200·(f(y)-f(z))
[0057] Where X, Y, and Z are the values of the three basis vectors representing the luminance component, relative luminance value, and relative blue component value in the XYZ color space; R, G, and B are the values of the three basis vectors representing the red intensity, green intensity, and blue intensity in the RGB color space, respectively; L... * a * b * , , and z are the values of the three basis vectors representing the luminance component, the color range from green to magenta, and the color range from blue to yellow in the Lab color space, respectively. x, y, and z are the normalized basis vector values, respectively.
[0058] After the transformation, calculate the distance D from the center of the equivalent circle to the origin of the ab chromaticity plane, and the radius of the equivalent circle is M′.
[0059] The calculation method is as follows:
[0060]
[0061]
[0062] Where M and N are the width and height of the image, and the center coordinates of the equivalent circle are (d... a ,d b The equivalent circle center is located at the origin of the neutral axis of the ab chromaticity plane (a = 0, b = 0). M a and M b These are the first radius parameter and the second radius parameter, respectively. The tongue image color deviation error K is calculated based on the distance D and the equivalent circle radius M′, satisfying K = D / M′. A preset threshold is then used to determine whether the tongue image has a color deviation.
[0063] The gray-world method based on standard deviation weighting works as follows: The image is divided into n 16×16 blocks, and the standard deviation of pixels in each block is calculated. Weights are then assigned to each image block based on the magnitude of the standard deviation. The calculation formula is as follows:
[0064]
[0065] Among them, R ave (k), G ave (k) and B ave (k) represents the mean of the color components of the k-th image patch in the RGB color space, R std (i), G std (i) and B std (i) represent the standard deviations of the color components of the i-th image patch, Y SDW-R Y SDW-G and Y SDW-B These are the weighted averages of the calculated R, G, and B color components, respectively.
[0066] After obtaining the weighted average of the color components, establish the relationship equation between the weighted average of the color components and the average RGB value in different RGB channels, obtain the channel quadratic transformation coefficients u and v, and calculate the final correction result.
[0067]
[0068]
[0069] Among them, R max G max B maxThese represent the maximum values of the R, G, and B color channels of the original image in the RGB color space, respectively. ave G ave B ave These are the average values of the R, G, and B color channels, respectively. R u G u B v R v G and v B These are the two quadratic transform coefficients corresponding to the R, G, and B channels that need to be obtained.
[0070] Step 3: Input the processed standard tongue image into the trained tongue segmentation model based on edge gating mechanism, and the model outputs the corresponding tongue segmentation result.
[0071] Among them, the tongue segmentation model based on the edge gating mechanism mainly uses the Deeplabv3+ model structure, employs the ResNeXt model with embedded SE attention mechanism as the encoder for feature extraction, and takes the encoded vector of the input tongue image after encoder encoding as the input of the edge branch. It uses a gating attention layer to learn weights and fuses the image edge information extracted by the Canny operator. For example... Figure 2 As shown, the tongue segmentation model based on the edge gating mechanism includes a ResNeXt model with embedded SE attention mechanism, an ASPP module, a decoder, and an edge prediction module. The ResNeXt model with embedded SE attention mechanism serves as the encoder for feature extraction. The processed standard tongue image is used as the input to the ResNeXt model with embedded SE attention mechanism. The ResNeXt model with embedded SE attention mechanism extracts six feature vectors X0, X1, X2, X3, X4, and X5 at different depths. The first feature vector X0, the third feature vector X2, the fourth feature vector X3, and the sixth feature vector X5 are all input into the edge prediction module. The sixth feature vector X5 is concatenated with the output of the edge prediction module and then input into the ASPP module. The output of the ASPP module serves as the input to the decoder.
[0072] In the ResNeXt model with embedded SE attention mechanism, when the processed standard tongue image is input, a 3×3 convolutional layer is first used to increase the number of channels from 3 to 64. Then, a 7×7 convolutional layer Layer0 and four BottleNeck layers Layer1, Layer2, Layer3, and Layer4 are used to obtain feature vectors X0, X1, X2, X3, X4, and X5 at different depths.
[0073] The edge prediction module includes a Canny operator edge extraction module, a fusion layer, a convolutional layer, a residual module, and a gated attention layer. The first feature vector X0 passes through the first convolutional layer and the first residual module before being connected to the first gated attention layer. The third feature vector X2 passes through the second convolutional layer before being connected to the first gated attention layer. The first gated attention layer passes through the second residual module before being connected to the second gated attention layer. The fourth feature vector X3 passes through the third convolutional layer before being connected to the second gated attention layer. The second gated attention layer passes through the third residual module before being connected to the third gated attention layer. The layers are connected, and the sixth feature vector X5 is connected to the third gated attention layer after passing through the fourth convolutional layer. The output of the third gated attention layer is denoted as the edge output. The processed standard tongue image is also used as the input of the Canny operator edge extraction module. The output of the third gated attention layer and the output of the Canny operator edge extraction module are added together and then input into the fusion layer. The output of the fusion layer is used as the output of the edge prediction module, that is, the edge prediction result is combined with the low-dimensional edge information extracted by the Canny operator, and together they are used as the final output vector edge_cat of the edge branch.
[0074] like Figure 4 As shown, the gated attention layer includes a batch normalization layer, a convolutional layer, a ReLU activation layer, and a Sigmoid activation layer. For each gated attention layer, the output of the corresponding residual module is designated as the first input feature, and the other input is designated as the second input feature. These features are added element-wise before being fed into the batch normalization layer. The batch normalization layer then passes through the fifth convolutional layer, the first ReLU activation layer, the sixth convolutional layer, and the second ReLU activation layer before being connected to the Sigmoid activation layer. The result of multiplying the second input feature by α times the output of the Sigmoid activation layer is designated as the intermediate feature. This intermediate feature is added to the second input feature before being fed into the seventh convolutional layer. The output of the seventh convolutional layer serves as the output of the current gated attention layer. The details are as follows:
[0075] After X0 and X2 are concatenated after being processed by a 1×1 convolutional layer, convolution and normalization operations are performed to generate gating attention weights α1 that focus on edge information. These weights are then weighted and connected to the input X0 using a residual concatenation operation to generate... The formula is as follows:
[0076] α1=σ(C 1×1 (X0)||C 1×1 (X2))
[0077]
[0078] Where || denotes concatenation of two vectors, ⊙ denotes element-wise multiplication of two vectors, (i,j) represents the position of each pixel in the image, and w1 represents the convolution kernel function. This represents the output feature at each pixel location after attention score weighting. As the input to the next gated attention layer, it is concatenated with X3 after being processed by a 1×1 convolutional layer to calculate the gated attention weight α2, and then obtained by weighting the attention score and connecting it with the residual. Output After concatenating with X5, which has been processed by a 1×1 convolutional layer, the result obtained by repeating the previous step is used as the edge prediction result Edge_out.
[0079] The decoder consists of a double convolutional block and an upsampling layer. The output of the ASPP module is concatenated with the fourth feature vector X3 and then input into the first double convolutional block. The first double convolutional block is connected to the first upsampling layer. The output of the first upsampling layer is concatenated with the third feature vector X2 and then input into the second double convolutional block. The second double convolutional block is connected to the second upsampling layer. The output of the second upsampling layer is concatenated with the first feature vector X0 and the result is used as the output of the decoder.
[0080] During the training of the tongue segmentation model based on edge gating, the loss function used is a weighted fusion loss of the prediction segmentation mask loss and the edge loss. The prediction segmentation mask loss is a multi-class cross-entropy loss function CE calculated based on the decoder output (i.e., the segmentation mask output mask_out). The edge loss is a binary cross-entropy loss function BCE calculated based on the edge output of the edge prediction module. The formula is as follows:
[0081]
[0082] in, This indicates the actual edge information of the tongue. Let represent the actual segmentation mask of the tongue, e represent the edge information predicted by the model, and m represent the segmentation mask predicted by the model. This represents the cross-entropy loss value for binary classification. This represents the cross-entropy loss value for multi-class classification, where λ1 and λ2 are the weights used in the loss calculation.
[0083] The evaluation parameters of the model are the mean intersection-union ratio (MioU) of the tongue prediction mask and the true mask, and the Dice coefficient, which can be expressed as:
[0084]
[0085] The model was trained for 300 iterations. The learning rate was warmed up during the first 5 training iterations, and then decayed using a multinomial decay-based learning rate strategy. The formula for decaying the learning rate (lr) is:
[0086]
[0087] Among them, lr init The initial learning rate is set to 0.01, iter is the current iteration number, maxiter is the maximum number of iterations (i.e., batch_size × training times), and power is a hyperparameter that controls the learning rate decay rate, set to 0.9.
[0088] In this embodiment, a total of 1063 images of patients' tongue protrusion were collected, of which 850 images were selected as the training set and 213 images as the validation set. The dataset was preprocessed and tongue image masking was predicted, and a comparative experiment was conducted using the classic segmentation network U-Net and DeeplabV3+. The evaluation parameters calculated from the final tongue prediction mask and the actual mask are shown in Table 1.
[0089] Table 1 shows the evaluation parameters calculated from the tongue prediction mask and the actual mask.
[0090]
[0091]
[0092] This invention proposes a tongue image analysis method combining preprocessing, improved segmentation, and feature fusion for raw tongue image data collected from mobile devices. First, the raw tongue image data is preprocessed through color correction and tongue localization to establish a standardized tongue image dataset. Addressing the issue of inaccurate tongue edge extraction in tongue segmentation tasks, this invention introduces an edge gating mechanism based on the Deeplabv3+ model, adding edge branches and designing a weighted loss function that fuses segmentation and edge losses, thereby improving the model's segmentation mask prediction accuracy. Furthermore, this invention uses skip connection technology to fuse the feature vectors obtained from the encoder and decoder, enhancing the model's feature capture capability and improving segmentation accuracy.
[0093] Finally, it should be noted that the above embodiments and descriptions are only used to illustrate the technical solutions of the present invention and not to limit it. Those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the disclosure of the technical solutions of the present invention, and all such modifications and substitutions should be covered within the protection scope of the claims of the present invention.
Claims
1. A tongue image segmentation method based on edge gating mechanism, characterized in that, Includes the following steps: Step 1: Acquire images of the patient's tongue protrusion; Step 2: After preprocessing the acquired tongue protrusion images, a processed standard tongue image is obtained; Step 3: Input the processed standard tongue image into the trained tongue segmentation model based on edge gating mechanism, and the model outputs the corresponding tongue segmentation result; The tongue segmentation model based on the edge gating mechanism includes a ResNeXt model with embedded SE attention mechanism, an ASPP module, a decoder, and an edge prediction module. The ResNeXt model with embedded SE attention mechanism serves as the encoder for feature extraction. The processed standard tongue image is used as the input to the ResNeXt model with embedded SE attention mechanism. The ResNeXt model with embedded SE attention mechanism extracts six feature vectors X0, X1, X2, X3, X4, and X5 at different depths. The first feature vector X0, the third feature vector X2, the fourth feature vector X3, and the sixth feature vector X5 are all input to the edge prediction module. The sixth feature vector X5 is concatenated with the output of the edge prediction module and then input to the ASPP module. The output of the ASPP module serves as the input to the decoder. The edge prediction module includes a Canny operator edge extraction module, a fusion layer, a convolutional layer, a residual module, and a gated attention layer. The first feature vector X0 is sequentially passed through the first convolutional layer and the first residual module before being connected to the first gated attention layer. The third feature vector X2 is passed through the second convolutional layer before being connected to the first gated attention layer. The first gated attention layer is then passed through the second residual module before being connected to the second gated attention layer. The fourth feature vector X3 is passed through the third convolutional layer before being connected to the second gated attention layer. The second gated attention layer is then passed through the third residual module before being connected to the third gated attention layer. The sixth feature vector X5 is passed through the fourth convolutional layer before being connected to the third gated attention layer. The output of the third gated attention layer is recorded as the edge output. The processed standard tongue image is also used as the input of the Canny operator edge extraction module. The output of the third gated attention layer and the output of the Canny operator edge extraction module are added together and then input into the fusion layer. The output of the fusion layer is used as the output of the edge prediction module. The gated attention layer includes a batch normalization layer, a convolutional layer, a ReLU activation layer, and a Sigmoid activation layer. In each gated attention layer, the output of the corresponding residual module is recorded as the first input feature, and the other input is recorded as the second input feature. These features are added element-wise and then input into the batch normalization layer. The batch normalization layer passes through the fifth convolutional layer, the first ReLU activation layer, the sixth convolutional layer, and the second ReLU activation layer in sequence before being connected to the Sigmoid activation layer. The result of multiplying the second input feature by α times the output of the Sigmoid activation layer is recorded as the intermediate feature. The intermediate feature is added to the second input feature and then input into the seventh convolutional layer. The output of the seventh convolutional layer is used as the output of the current gated attention layer. The decoder includes a double convolutional block and an upsampling layer. The output of the ASPP module is concatenated with the fourth feature vector X3 and then input into the first double convolutional block. The first double convolutional block is connected to the first upsampling layer. The output of the first upsampling layer is concatenated with the third feature vector X2 and then input into the second double convolutional block. The second double convolutional block is connected to the second upsampling layer. The output of the second upsampling layer is concatenated with the first feature vector X0 and the result is used as the output of the decoder.
2. The tongue image segmentation method based on edge gating mechanism according to claim 1, characterized in that, Step 2 specifically involves: After performing tongue localization and color correction on the acquired tongue protrusion images, a processed standard tongue image is obtained.
3. The tongue image segmentation method based on edge gating mechanism according to claim 1, characterized in that, Step 2 specifically involves: Step 21: Use the YOLOv5-Lite-based target detection model to locate the tongue body in the acquired tongue protrusion image and obtain the tongue body image. Step 22: After color distortion verification of the tongue body image, a processed standard tongue image is obtained.
4. The tongue image segmentation method based on edge gating mechanism according to claim 3, characterized in that, Step 22 specifically involves: First, the color deviation of each tongue image is calculated using the equivalent circle detection method. If the color deviation of each tongue image is greater than a preset threshold, the tongue image is checked for color deviation to obtain a processed standard tongue image; otherwise, no processing is performed.
5. The tongue image segmentation method based on edge gating mechanism according to claim 1, characterized in that, During the training process of the tongue segmentation model based on the edge gating mechanism, the loss function used is a weighted fusion loss of prediction segmentation mask loss and edge loss.
6. The tongue image segmentation method based on edge gating mechanism according to claim 5, characterized in that, The edge loss is a binary cross-entropy loss function (BCE) calculated based on the edge output of the edge prediction module.
Citation Information
Patent Citations
Blood vessel image segmentation method and device based on CRDNet
CN113205538A
A boundary-aware double-attention-guided liver segment segmentation method
CN113344951A