Chinese medicine disease classification system based on tongue appearance and text information fusion

By improving tongue image segmentation and feature extraction methods, and combining deep learning and text analysis, the problems of high-level semantic information extraction and multimodal fusion of tongue images were solved, enabling accurate diagnosis of TCM disease classification.

CN117975101BActive Publication Date: 2026-11-24HENAN UNIV OF SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311818401.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-27
Publication Date
2026-11-24
Estimated Expiration
2043-12-27

AI Technical Summary

Technical Problem

In existing technologies, deep neural networks cannot effectively extract high-level semantic information from tongue images, and traditional multimodal fusion strategies have redundancy and noise, resulting in poor accuracy in TCM tongue diagnosis.

Method used

An improved segmentation neural network was used for tongue image segmentation and pixel reconstruction. Low-level features were extracted by combining LBP and HOG algorithms, deep features were extracted by MobileNetV2 and Swin-Transformer, and text features were extracted by BERT model. Multimodal feature fusion was performed using LMF fusion strategy and hybrid fusion mechanism, and finally fed into classification network for disease type classification.

Benefits of technology

It achieves complete feature extraction and fusion of tongue image and text information, improves the accuracy of disease classification and the quality of multimodal feature fusion, and enhances the diagnostic accuracy of young TCM doctors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117975101B_ABST
    Figure CN117975101B_ABST
Patent Text Reader

Abstract

This invention discloses a TCM disease classification system based on the fusion of tongue image and text information. The system first preprocesses captured tongue images using an improved U-Net network, converting the four diagnostic methods (palliative, oral, and respiratory tract examination) information into text, which is then combined with the corresponding tongue image to construct a tongue image-text pair. Next, features are extracted from both the tongue image and the four diagnostic methods text information, constructing a multi-feature fusion neural network to extract and fuse low-level and deep features of the tongue image to obtain comprehensive tongue image features. Then, an LMF fusion module with a hybrid fusion mechanism is used to perform multimodal fusion of the various modalities. Finally, the multimodal fused features are fed into a classification network to obtain disease type classification results. This invention can obtain complete semantic information of the tongue image, improve the quality of multimodal feature fusion, and achieve disease classification based on tongue images and related tongue diagnostic data, providing auxiliary means for physicians' diagnosis and improving diagnostic accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the fields of medical and information technology, specifically relating to a multimodal disease classification system that integrates tongue image and text information. Background Technology

[0002] Tongue diagnosis is part of the four diagnostic methods in Traditional Chinese Medicine (TCM), specifically the inspection method. For various clinical diseases, doctors often use tongue observation to aid in diagnosis and treatment. It is an important basis for TCM's syndrome differentiation and treatment. The tongue's appearance can objectively reflect some of the body's functional states, providing valuable supplementary information. Because the five internal organs and six bowels are directly or indirectly connected to the tongue, physiologically, the essence and qi of the internal organs can nourish the tongue; pathologically, diseases of the internal organs can also be reflected on the tongue. Combining this with information from the other four diagnostic methods can help determine the type of disease. Modern clinical practice has proven that changes in the tongue's appearance can objectively reflect the state of disease in the body's internal organs, providing important reference for health assessment, disease diagnosis, and prognosis.

[0003] Based on the traditional Chinese medicine principle of "inferring internal conditions from external manifestations," TCM practitioners can make an accurate diagnosis of a patient's disease type by observing the tongue appearance in conjunction with other diagnostic methods ("four diagnostic methods"). However, traditional "four diagnostic methods" often rely on the daily accumulation of knowledge by TCM practitioners, lacking data support and objective reference standards. TCM tongue diagnosis suffers from shortcomings in objectivity, standardization, and quantification, limiting its development. Therefore, increasing emphasis is being placed on the objective study of tongue diagnosis. Utilizing artificial intelligence, automated analysis, and data platform construction technologies, and through research in image processing, deep learning, and engineering, to build an intelligent disease identification system and promote the intelligent development of TCM tongue diagnosis is crucial. With the development of multimodal domains and deep learning technologies, the analysis of tongue images and text information, through the extraction and fusion of features from different modalities to construct multimodal models, is gradually becoming an important research problem.

[0004] While traditional image recognition technology has certain advantages in tongue diagnosis, it essentially relies on low-level visual features and cannot truly express the high-level semantic information perceived by traditional Chinese medicine practitioners. Furthermore, without the other four diagnostic methods ("four examinations"), it is impossible to accurately determine the patient's disease type. Therefore, several key issues need to be addressed: 1. Currently popular deep neural networks cannot be directly used to extract high-level semantic information from tongue images, as the semantic information is incomplete; 2. How to ensure the effective combination of information from the four diagnostic methods and tongue diagnosis images? Although traditional early fusion strategies can effectively utilize multimodal information, they introduce redundancy and noise signals, and the effect of multimodal feature fusion needs to be improved. Therefore, a disease classification method that can improve the effect and accuracy of multimodal feature fusion is necessary. Summary of the Invention

[0005] In view of this, in order to overcome the shortcomings of the prior art, the purpose of this invention is to provide a TCM disease classification system based on the fusion of tongue image and text information, which can obtain complete semantic information of tongue image, improve the quality of multimodal feature fusion, and solve the problem of poor multimodal fusion effect of tongue image and text information.

[0006] To achieve the above objectives, the technical solution adopted by the present invention is as follows: This invention proposes a traditional Chinese medicine disease classification system based on the fusion of tongue image and text information. The method used in this system includes the following steps: S1: Obtain diagnostic tongue image data and four diagnostic methods data, preprocess them respectively to obtain complete tongue image and four diagnostic text information, and construct tongue image text pairs with the tongue image and the corresponding four diagnostic text information; S2: Construct a multi-feature fusion neural network to extract features from the tongue image and the four diagnostic text information respectively, so as to obtain comprehensive tongue image features and text features; Low-level and deep features of the tongue image are extracted separately. After preserving the interrelationships between features, they are weighted and fused to obtain comprehensive tongue image features that can express complete information about the tongue image. S3: The obtained tongue image comprehensive features and text features are fused in a multimodal manner to obtain complete features for classification; Tongue image features and text features are input into an LMF fusion module with a hybrid fusion mechanism to obtain multimodal fusion features; S4: Feed the multimodal fusion features into the classification network, transform them into the semantic space of the label, and obtain the disease type classification results.

[0007] Furthermore, the preprocessing in step S1 includes the following: An improved segmentation neural network is used to segment the captured tongue image. The segmented tongue image is then fed into a pixel restoration module to restore the original pixels and obtain a complete tongue image. This reduces the impact of non-tongue image areas on subsequent steps. The obtained diagnostic information is converted into raw text information (.txt format text information), which is then combined with the corresponding tongue image to construct a tongue image text pair, and JSON data is constructed. Furthermore, the improved segmentation neural network includes downsampling encoding, upsampling decoding, a MobileViTA attention module, and a skip connection module to achieve accurate segmentation of the tongue image region.

[0008] Furthermore, the segmented image obtained from the segmentation neural network and the original tongue image are fed into the pixel restoration module for pixel restoration. Pixel values ​​less than 70 in the segmented background area are filled with 0, while the rest retain their original pixel values, resulting in a restored tongue image.

[0009] In one embodiment of the present invention, when constructing a tongue image text pair, the corresponding four diagnostic information is organized into a text format, the tongue image data is labeled, and a unique ID number and corresponding tag are added to it. Together with the text information and tag information, JSON data is constructed.

[0010] Furthermore, the feature extraction in step S2 includes the following: The LBP algorithm is used to obtain the texture features of the tongue image, and the HOG algorithm is used to obtain the gradient orientation histogram features of the tongue image. These are fused to obtain the low-level features of the tongue image. MobileNetV2 and Swin-Transformer are used to extract the depth features of the tongue image. Different weights are assigned to the extracted low-level features and depth features to obtain the comprehensive tongue image features that can fully express the semantic information of the tongue image. .

[0011] Furthermore, during the deep feature extraction process of the tongue image, an attention mechanism is constructed. The two features obtained from MobileNetV2 and Swin-Transformer are weighted by attention weights, and then the features are concatenated to obtain the complete deep feature dimension.

[0012] Furthermore, the feature extraction process for the four diagnostic methods text information is as follows: By utilizing the information stored in the JSON data within the constructed image-text pairs, the text data is preprocessed to transform it into the input format required by the BERT model. This converted text is then fed into the pre-trained BERT model to extract text features. Make full use of the information from the four diagnostic methods to achieve accurate diagnosis of disease types.

[0013] Furthermore, the feature fusion in step S3 includes the following: S31: Based on a hybrid fusion mechanism, the comprehensive characteristics of tongue image and text features Use their respective weight matrices , The features are mapped to positions with a single neuron. Using learnable model parameters, the two (1,1)-dimensional features obtained from the mapping are then combined with their respective tongue image features. Text features By stitching the images together, we obtain the feature representations of the image modalities after adding the fusion mechanism. Feature representation of text modality ; S32: Using the LMF fusion strategy, the multimodal fusion feature H is obtained, which specifically includes the following: A: Construct low-rank factors for two modalities, and obtain the weight matrix for the image modality (i.e., tongue image comprehensive features). For text modalities (text features), the weight matrix is ​​obtained. ; B: Perform matrix multiplication on the weight matrix and feature representation of each modality and then fuse them to obtain a 1024-dimensional feature for each modality; Specifically, this refers to the feature representation of image modalities. With weight matrix Matrix multiplication and feature representation of text modalities With weight matrix Matrix multiplication is performed, and each mode yields a 1024-dimensional feature.

[0014] C: Perform pixel-level multiplication on the 1024-dimensional features of different modalities to obtain the multimodal fusion feature H.

[0015] The disease diagnosis system designed by the above scheme can realize the fusion and classification of multimodal diagnostic data features, and use machine learning and deep learning to extract and fuse features of different modalities, thereby realizing the diagnosis of disease types. This helps to make full use of clinical diagnostic data and information mining, and improves the accuracy of diagnosis for young TCM doctors with little experience.

[0016] This invention also proposes a traditional Chinese medicine disease classification system based on the fusion of tongue image and text information, which includes at least: The acquisition module is configured to acquire tongue images and input diagnostic information. The preprocessing module is configured to preprocess the acquired tongue images and collected diagnostic information, obtain complete tongue images and diagnostic text information, and form tongue image text pairs. The feature extraction module is configured to extract data features from tongue images and diagnostic text information to obtain comprehensive tongue features and text features. The feature fusion module is configured to fuse tongue image comprehensive features and text features to obtain multimodal fusion features; The feature classification module is configured to input multimodal fusion features into the classification network to obtain diagnostic classification results.

[0017] A third aspect of the present invention provides a computer-readable storage medium for classifying diseases in traditional Chinese medicine based on the fusion of tongue image and text information, wherein one or more computer programs are stored thereon, and the one or more computer programs implement the above-described method when executed by a computer processor.

[0018] The beneficial effects of this invention are: 1. This invention uses an improved U-Net network to accurately segment the tongue region in the captured tongue image, converts the obtained four diagnostic information into text, and constructs a tongue image text pair together with the corresponding tongue image image, combining the tongue image information and the four diagnostic information to improve the accuracy of the diagnosis. 2. Construct a multi-feature fusion neural network, use LBP and HOG to extract the low-level features of the tongue image, use MobileNetV2 and Swin-Transformer to extract the deep features of the tongue image to express the abstract features and high-level semantic information of the tongue image, and assign different weights to the extracted features to obtain comprehensive features that can fully express the semantic information of the tongue image, and retain the interrelationship between features to achieve complete extraction of tongue image features. 3. This invention utilizes the LMF fusion strategy and improves upon it by using a hybrid fusion mechanism. By leveraging learnable model parameters, it optimizes feature values ​​during the fusion process, further enhancing the quality of multimodal feature fusion and improving classification accuracy and performance. Attached Figure Description

[0019] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 This is a flowchart of the disease classification method of the present invention; Figure 2 This is a flowchart of the preprocessing in Embodiment 2 of the present invention; Figure 3 This is a flowchart of feature extraction in Embodiment 2 of the present invention; Figure 4 This is a flowchart of feature fusion in Embodiment 2 of the present invention; Figure 5 This is the output image of the tongue image after processing by the improved U-Net network in the preprocessing of Embodiment 2 of the present invention; Figure 6 This is the tongue image restored by the pixel restoration module in Embodiment 2 of the present invention; Figure 7 This is the output image after the tongue image feature fusion is completed in Embodiment 2 of the present invention; Figure 8 This is the prediction result of the final type classification of the tongue image in Embodiment 2 of the present invention. Detailed Implementation

[0021] Specific embodiments are given below to further clarify, completely, and in detail the technical solution of the present invention. These embodiments are the preferred embodiments based on the technical solution of the present invention, but the scope of protection of the present invention is not limited to the following embodiments.

[0022] Example 1

[0023] To address the problem that inexperienced young TCM practitioners often fail to accurately diagnose patients' diseases through observation, auscultation, inquiry, and palpation, as well as by examining the patient's tongue, leading to delays in diagnosis, this invention proposes a TCM disease classification method based on the fusion of tongue image and text information. It utilizes machine learning and deep learning to extract and fuse features from different modalities, enabling disease type diagnosis. The method includes the following steps: First, a segmentation neural network is used to segment the captured tongue image to obtain the complete tongue image region, reducing the impact of non-tongue image regions on subsequent steps. Second, machine learning techniques are used to extract LBP and HOG features from the tongue image as low-level features. A neural network is then used to extract deep features of the tongue image, and the two types of features are fused to obtain the final features that express the complete information of the tongue image, improving the accuracy of subsequent disease diagnosis. Next, features are extracted from the text information corresponding to the tongue image, making full use of the four diagnostic methods (palpation, palpation, and olfaction) to achieve accurate diagnosis of disease types. Finally, the extracted tongue image features and text features are fused in a multimodal manner and fed into a classification network. The multimodal features are then transformed into the semantic space of the label to achieve intelligent diagnosis of disease types.

[0024] Furthermore, the preprocessing in step S1 includes the following: An improved segmentation neural network is used to segment the captured tongue image, and then the segmented tongue image is sent to the pixel restoration module to restore the original pixels and obtain a complete tongue image. The obtained information from the four diagnostic methods is converted into text, which is then combined with the corresponding tongue image to construct a tongue image text pair and JSON data; this reduces the impact of non-tongue image areas on subsequent steps.

[0025] Furthermore, the improved segmentation neural network includes downsampling encoding, upsampling decoding, a MobileViTA attention module, and a skip connection module to achieve accurate segmentation of the tongue image region; The segmentation neural network produces segmented images, which are then fed together with the original tongue image into a pixel reconstruction module for pixel reconstruction. Pixels with values ​​less than 70 in the segmented background area are filled with 0, while the rest retain their original pixel values, resulting in a tongue image with reconstructed pixel values.

[0026] In this embodiment, when constructing the tongue image text pair, the corresponding four diagnostic information is organized into a text format, the tongue image data is labeled, and a unique ID number and corresponding tag are added to it. Together with the text information and tag information, JSON data is constructed.

[0027] Furthermore, the feature extraction in step S2 includes the following: The LBP algorithm is used to obtain the texture features of the tongue image, and the HOG algorithm is used to obtain the gradient direction histogram features of the tongue image. The low-level features of the tongue image are obtained by fusing them. MobileNetV2 and Swin-Transformer are used to extract the depth features of the tongue image. Different weights are assigned to the extracted low-level features and depth features to obtain comprehensive features that can fully express the semantic information of the tongue image.

[0028] Furthermore, in the process of extracting deep features from the tongue image, an attention mechanism is constructed. The two features obtained from MobileNetV2 and Swin-Transformer are weighted by attention weights, and then the features are concatenated to obtain the complete deep feature dimension.

[0029] In this embodiment, the feature extraction process for the four diagnostic methods text information is as follows: By utilizing the information stored in the JSON data within the constructed image-text pairs, the text data is preprocessed to transform it into the input format required by the BERT model. This input is then fed into the pre-trained BERT model for text feature extraction. This approach fully leverages the information from the four diagnostic methods (palliative medicine, diagnostic medicine, and infirmary) to achieve accurate diagnosis of disease types.

[0030] Furthermore, the feature fusion in step S3 includes the following: S31: Based on a hybrid fusion mechanism, the comprehensive characteristics of tongue image and text features Use their respective weight matrices , The features are mapped to positions with a single neuron. Using learnable model parameters, the two (1,1)-dimensional features obtained during feature extraction are then combined with their respective tongue image features. Text features Concatenate at positions where dimension equals 1 ( The tongue image feature representation after adding the fusion mechanism is obtained. and text feature representation ; S32: Using the LMF fusion strategy, obtain the multimodal fusion feature H, which specifically includes the following sub-steps: A: Construct low-rank factors for the two modalities, using r=4, with the desired fusion dimension h=1024. For the image modality, this yields a weight matrix with four dimensions (78469, 1024). For the text modality, a weight matrix with four dimensions (769, 1024) is obtained. ; B: Perform matrix multiplication on the weight matrix and feature representation of each modality and then fuse them to obtain a 1024-dimensional feature for each modality; C: Perform pixel-level multiplication on the 1024-dimensional features of different modalities to obtain the multimodal fusion feature H, calculated as follows: .

[0031] On the other hand, this invention also proposes a traditional Chinese medicine disease classification system based on the fusion of tongue image and text information, including: The acquisition module is configured to acquire tongue images and input diagnostic information from the four diagnostic methods. The preprocessing module is configured to preprocess the acquired tongue images and collected diagnostic information, obtain complete tongue images and diagnostic text information, and form tongue image text pairs. The feature extraction module is configured to extract data features from tongue images and diagnostic text information to obtain comprehensive tongue features and text features. The feature fusion module is configured to fuse tongue image comprehensive features and text features to obtain multimodal fusion features; The feature classification module is configured to input multimodal fusion features into the classification network to obtain diagnostic classification results.

[0032] Example 2

[0033] This invention discloses a TCM disease classification method based on the fusion of tongue image and text information, comprising four parts. The first part employs an improved U-Net network to accurately segment the tongue region in captured tongue images, converting the obtained diagnostic information into text, and constructing tongue image-text pairs together with the corresponding tongue image. The second part constructs a multi-feature fusion neural network, utilizing LBP and HOG to extract low-level tongue image features, and MobileNetV2 and Swin-Transformer to extract deep tongue image features, assigning different weights to the extracted features to obtain comprehensive features that fully express the semantic information of the tongue image. Simultaneously, a pre-trained BERT model is used to obtain features that express complete text information. The third part performs multimodal fusion of the obtained tongue image features and text features to obtain complete features for classification. Finally, the multimodal features are transformed into the semantic space of the label to achieve disease type diagnosis.

[0034] The main process of the classification method is shown in the attached figure. Figure 1 As shown, it includes the following steps: S1: Obtain the diagnostic tongue image data and the four diagnostic methods text data, and preprocess them respectively to obtain complete tongue image and four diagnostic methods text information.

[0035] The collected tongue images are subject to interference from equipment and shooting angles, resulting in various interference areas that significantly impact subsequent feature extraction and final disease diagnosis. Therefore, this invention addresses these issues by using an improved U-Net network fused with the MobileViTAttention module to achieve accurate segmentation of the tongue image region. The segmented tongue image is then restored to its original pixels to obtain a complete tongue image for subsequent feature extraction. Similarly, the collected diagnostic information is converted into text and paired with the corresponding tongue image to form a tongue image text pair, which is then used to construct JSON data.

[0036] Furthermore, in this embodiment, the specific image processing method is as shown in the appendix. Figure 2 As shown: 1) Improved U-Net network: mainly includes downsampling encoding, upsampling decoding, MobileViTA attention module and skip connection module.

[0037] In this embodiment, the downsampling encoding part is the backbone feature extraction network. In the first downsampling layer, a MobileViTAttention module with a patch size of 8 is added to the convolutional layer with 64 input channels. This effectively encodes local and global information, reducing the loss of features extracted during convolution. Simultaneously, padding is added to the convolutional layers in the U-Net network so that the image size after convolution remains unchanged; it is only halved after downsampling. This avoids feature loss caused by data discarding due to center cropping of the feature map obtained during downsampling in subsequent feature fusion. The upsampling decoding part enhances the feature extraction network. In the last upsampling layer, a MobileViTAttention module with a patch size of 8 is added to the convolutional layer with 64 input channels. Finally, a feature map with the same size as the original is obtained, facilitating subsequent pixel reconstruction and feature extraction.

[0038] Specifically, the tongue image segmented using the improved U-Net network is as follows: Figure 5 As shown; 2) Pixel reconstruction process: The improved U-Net model is trained to obtain complete pre-trained weights. The original image is fed into the trained and improved U-Net network to obtain the segmented image. Then, the segmented image and the original tongue image are fed into the pixel reconstruction module. First, construct an array L(255, 255, 3) with the same shape as the original segmented image and fill it with 0 values. Next, iterate through the pixels of each channel; if a pixel's value is less than 70, set the corresponding pixel in the original image to 0. Finally, assign all pixel values ​​from the original image to array L, and use the `fromarray` method of the `Image` class to convert the array type to an image type. The final result is the segmented and pixel-reconstructed tongue image, which is the original tongue image. Specifically, the reconstructed tongue image is as follows: Figure 6 As shown.

[0039] 3) Constructing Tongue Image Text Pairs: The collected diagnostic information and corresponding tongue image data are processed differently. After processing in steps 1 and 2 above, the final tongue image data is obtained. The corresponding diagnostic information is organized into text format to obtain the original text information. The tongue image data is labeled and a unique ID number is added to it. Together with the text information and label information, JSON data is constructed.

[0040] S2: Construct a multi-feature fusion neural network, using LBP and HOG to extract low-level features of the tongue image, and the neural network to extract deep features of the tongue image. Different weights are assigned to the extracted features, preserving the interrelationships between features, to obtain comprehensive tongue image features that can express complete information about the tongue image. This improves the accuracy of subsequent disease diagnosis; at the same time, by utilizing a pre-trained BERT model, text features that can express complete textual information are obtained. .

[0041] Furthermore, in this embodiment, the specific image feature extraction method is as follows: Figure 3 As shown: 1) Extraction of low-level features: First, convert the input tongue image to a grayscale image. Define the range radius in the LBP algorithm as... The number of neighboring pixels is Calculate the specific LBP value for each pixel in the image: Indicates the center point that needs to be calculated. Indicates and Adjacent pixels (from) Starting from the top left corner of the point, rotate clockwise (numbering starts from 0). express The pixel value at the location of the point. Represents the pixel value at the center point. The formula for the LBP value of the center pixel is as follows: (1) (2) After obtaining the LBP value of each pixel in the image, the pixel values ​​are normalized and finally converted into a feature vector of size 1*50176.

[0042] For HOG feature extraction, the image is first processed into a grayscale image, followed by image normalization. The HOG algorithm defines the dimension of the angle histogram as 9, the pixel box size as 8*8, and the pixel block size as 2*2. Each pixel block contains one pixel box. The total gradient and gradient direction of each point in the 8*8 cells are calculated: where 'a' represents the specific location within the 8*8 pixel box where the total gradient and gradient direction need to be calculated. This represents the pixel value to the right of point a. The pixel value to the left of point a is used to calculate the horizontal gradient of point a. as follows: (3) This represents the pixel value below point a. The vertical gradient at point a is calculated, representing the pixel value above point a. as follows: (4) Given the horizontal and vertical gradients at point a, calculate the total gradient at point a. as follows: (5) Calculate the gradient direction at point a as follows: (6) Construct a 9-dimensional histogram starting from 0°, with intervals of 20° up to 180°. , , Indicates distance The values ​​corresponding to the angles of the two most recent histograms. The obtained total gradient... and satisfaction The gradient direction, according to the gradient direction The size-weighted value , Place it in the corresponding dimension , In the middle, as follows: (7) (8) Calculate each value in the pixel box as described above to obtain a 9-dimensional vector. The size of each pixel block contains four 9-dimensional features. Therefore, for a 224*224 image, sliding an 8-pixel block from left to right and from top to bottom can be done 27 times, resulting in a total of 26244 HOG features.

[0043] Furthermore, the LBP and HOG features of each image are concatenated to obtain a feature vector that can represent the underlying features of the tongue image.

[0044] 2) Deep Feature Extraction: The obtained image is first preprocessed, randomly cropped to 256*256 pixels, then centered to 224*224 pixels. It is then fed into the MobileNetV2 network structure, using transfer learning with a pre-trained MobileNetV2 model as the initial weights. The final classification layer of the MobileNetV2 model is removed, resulting in a feature size of (1, 1280, 7, 7). After adding a global average pooling layer, the feature size becomes (1, 1280, 1, 1). Finally, after flattening, the feature dimension is (1, 1280). While the MobileNetV2 model is a lightweight network, reducing computational cost, it has limitations in feature extraction from tongue images, failing to extract abstract features that fully express the semantic information of the tongue. Therefore, a Swin-Transformer network structure is combined to achieve complete extraction and representation of tongue features.

[0045] The image after center cropping is fed into the Swin-Transformer network structure, pre-trained weights are loaded, and the size obtained after Patch Partition is (1, 56, 56, 48). After passing through 4 Swin-Transformer stages, the size is (1, 7, 7, 768). Then, after global average pooling and flattening operations, the feature dimension is (1, 768).

[0046] Furthermore, since directly concatenating deep features would be of little significance for the classification task, an attention mechanism is constructed. This mechanism weights the two features using attention weights, and then concatenates the features to obtain a complete deep feature dimension of (1, 2048). For the low-level features obtained in step 1, a weighted fusion is performed with the deep features, assigning smaller weights to the low-level features and larger weights to the deep features, resulting in a complete tongue image feature dimension of (1, 78468). Specifically, this yields the complete features of the tongue image. Class activation graph reference Figure 7 As shown.

[0047] 3) Text Feature Extraction: By utilizing the information stored in the JSON data of the constructed image-text pairs, the text information corresponding to the images is found. The text data is preprocessed to convert it into the input format required by the BERT model. The text is then input into the BERT model, and the pre-trained BERT model is used to extract text features. A vector represented by the special label [CLS] can represent the information of the entire sentence. This vector is used as a feature of the text, and its feature dimension is (1, 768).

[0048] To address the issues of traditional neural networks neglecting the correlation between features and failing to extract features completely during tongue image feature extraction, a method based on fusing low-level features and deep features is adopted. Low-level features are used to obtain complete semantic information of the tongue image while preserving the interrelationships between features, while deep features are used to express the abstract features of the tongue image and high-level semantic information, thus obtaining features that can fully express the semantic information of the tongue image.

[0049] S3: The obtained tongue image comprehensive features and text features are fused in a multimodal manner to obtain complete features for classification; Comprehensive features of tongue and text features Input an LMF fusion module with a hybrid fusion mechanism to obtain multimodal fusion features.

[0050] Furthermore, in this embodiment, the specific image feature fusion method is as shown in the appendix. Figure 4 As shown: 1) Hybrid Fusion Mechanism Module: Comprehensive Features of Tongue Image and text features Use their respective weight matrices , The features are mapped to positions with a single neuron. Using learnable weight parameters, the weights are continuously optimized during training. The resulting two (1,1)-dimensional features are then combined with their respective original tongue image features. and text features Concatenate at positions where dimension equals 1 ( The tongue image feature representations after the addition of the fusion mechanism were obtained respectively. The text features are represented by dimensions (1,78469). The dimension is (1,769), and the calculation formula is as follows: (9) 2) LMF fusion module: Obtains tongue image feature representations with added fusion mechanism modules. and text feature representation Next, low-rank factors for the two modalities are constructed separately, using r=4, with the expected fusion dimension h=1024. For the image modality, a weight matrix with four dimensions (78469, 1024) is obtained. For the text modality, a weight matrix with four dimensions (769, 1024) is obtained. The parameter information contained therein consists of learnable model parameters, which can be optimized during the model training process.

[0051] Furthermore, matrix multiplication is performed on the weight matrix and feature representation of each modality, and then the results are fused. Each modality yields a 1024-dimensional feature. Pixel-level multiplication is then performed on the 1024-dimensional features of different modalities to obtain the multimodal fusion feature H, calculated as follows: (10) This invention utilizes the LMF fusion strategy and improves upon it by employing a hybrid fusion mechanism. By leveraging learnable model parameters, it optimizes feature values ​​during the fusion process, thereby further enhancing the quality of multimodal feature fusion and improving classification performance.

[0052] S4: Feed the multimodal fusion features into the classification network and transform them into the semantic space of the label to obtain the disease type classification result. Specifically, see the example of obtaining the disease type result after feeding the multimodal fusion features into the classification network. Figure 8 As shown.

[0053] In summary, this invention proposes a TCM disease classification method based on the fusion of tongue image and text information. It utilizes machine learning and deep learning to extract and fuse features from different modalities, enabling the diagnosis of disease types and obtaining complete semantic information from the tongue image, thereby improving the quality of multimodal feature fusion.

[0054] The foregoing has shown and described the main features, basic principles, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of the invention. Various changes and modifications can be made to the invention based on actual circumstances without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed. The scope of protection of this invention is defined by the appended claims and their equivalents.

Claims

1. A traditional Chinese medicine disease classification system based on tongue appearance and text information fusion, characterized in that, The method comprises the following steps: S1: obtaining diagnosis tongue image data and four diagnostic text data, respectively, for preprocessing to obtain complete tongue image and four diagnostic text information, and constructing tongue text pair corresponding to tongue image and corresponding four diagnostic text information; S2: constructing a multi-feature fusion neural network, respectively extracting features from tongue image and four diagnostic text information to obtain tongue comprehensive feature and text feature; including the following: obtaining tongue texture feature by using LBP algorithm, obtaining tongue gradient direction histogram feature by using HOG algorithm, obtaining tongue bottom feature by fusing, extracting tongue deep feature by using MobileNetV2 and Swin-Transformer, reserving the mutual correlation between features, and then assigning different weights to the extracted bottom feature and deep feature, and fusing according to weight distribution to obtain tongue comprehensive feature which can express complete tongue information; S3: multi-modal fusion of tongue comprehensive feature and text feature to obtain complete feature for classification; The tongue comprehensive feature and the text feature are input into the LMF fusion module added with the hybrid fusion mechanism to obtain the multi-modal fusion feature; the feature fusion includes the following contents: S32: obtaining multi-modal fusion feature H by using LMF fusion strategy; S4: sending the multi-modal fusion feature into the classification network, converting to the semantic space of label, and obtaining disease type classification result. The preprocessing process in step S1 includes the following contents: The improved segmentation neural network is used to segment the photographed tongue image, and then the segmented tongue image is input into the pixel point restoration module for original pixel point restoration to obtain the complete tongue image; The obtained four diagnostic information is converted into original text information, and the corresponding tongue image is used to construct tongue text pair and construct json data. The improved segmentation neural network includes down-sampling encoding, up-sampling decoding, MobileViTAttention module and jump connection module, and realizes accurate segmentation of tongue area. S31: mapping the tongue image comprehensive feature and the text feature to a location with one neuron respectively using a respective weight matrix and a text feature , , , , , and a text feature ; the calculation formula is: ; The segmented image obtained by the segmentation neural network and the original tongue image are jointly input into the pixel point restoration module for pixel point restoration, the pixel value of the segmented background area less than 70 is filled as 0, and the remaining pixel points are kept original, to obtain the tongue image after pixel point restoration. ​ 2.The TCM disease classification system based on tongue image and text information fusion according to claim 1, characterized in that, ​ ​ ​ 3.The TCM disease classification system based on tongue image and text information fusion according to claim 2, characterized in that, ​ 4. The TCM disease classification system based on tongue image and text information fusion according to claim 2, characterized in that, ​ 5. The TCM disease classification system based on tongue image and text information fusion according to claim 1, characterized in that, When constructing the tongue image text pair, the corresponding four diagnostic information is organized into text format, the tongue image data is labeled, and a unique ID number and corresponding tag are added to it. Together with the text information and tag information, JSON data is constructed.

6. The TCM disease classification system based on tongue image and text information fusion according to claim 1, characterized in that, In the process of extracting deep features of tongue image, an attention mechanism is constructed. The two features obtained by MobileNetV2 and Swin-Transformer are weighted by attention weights, and then the features are concatenated to obtain the complete deep feature dimension.

7. The TCM disease classification system based on tongue image and text information fusion according to claim 1, characterized in that, Step S32 specifically includes the following sub-steps: A: Construct two modalities of low-rank factors, get the weight matrix of the picture modality , the weight matrix of the text modality , wherein ; B: Perform matrix multiplication on the weight matrix and feature representation of each modality and then fuse them to obtain a 1024-dimensional feature for each modality; C: Perform pixel-level multiplication on the 1024-dimensional features of different modalities to obtain the multimodal fusion feature H.

Citation Information

Patent Citations

  • Traditional Chinese medicine human body constitution classification method based on face image and tongue image bimodal feature extraction

    CN110532907A

  • Small target semantic segmentation method and system based on low-rank mixed attention mechanism

    CN113657392A