A tongue image detection method based on fusion of RGB image and hyperspectral image

By combining the fusion method of RGB images and hyperspectral images, the deep learning algorithm is used to extract the spatial and spectral characteristics of the tongue image, which solves the problem of insufficient accuracy in tongue image detection in the existing technology and achieves more accurate health status classification at a lower cost. Low, suitable for promotion and application.

CN118247278BActive Publication Date: 2024-08-23HEFEI INSTITUTE OF PHYSICAL SCIENCE CHINESE ACADEMY OF SCIENCES
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202410668227.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-28
Publication Date
2024-08-23
Estimated Expiration
2044-05-28

AI Technical Summary

Technical Problem

Existing tongue image detection methods rely on RGB images and cannot effectively perceive the internal information of the tongue, resulting in insufficient diagnostic accuracy.

Method used

A fusion method based on RGB images and hyperspectral images is used to extract the spatial and spectral features of the image through the space-graph sub-network and spectral sub-network, and the weighted module is used for fusion to generate the final fusion probability to improve the accuracy of tongue image detection. accuracy.

Benefits of technology

Through multi-modal image fusion, the amount of tongue information is increased, containing more biological information, achieving accurate classification of health status without adding additional costs, and is easy to promote and apply.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118247278B
    Figure CN118247278B
Patent Text Reader

Abstract

The present invention provides a tongue image detection method based on the fusion of RGB images and hyperspectral images, comprising the following steps: obtaining an RGB image and a hyperspectral image of a tongue to be tested; inputting the RGB image into a spatial-graph subnetwork to enhance the global and local features of the perceived image to obtain spatial features; inputting the hyperspectral image into a spectral subnetwork to capture the long-range correlation of spectral features to obtain spectral features; and using a weighted module to perform weighted summation of spatial features and spectral features to obtain a final fusion probability. The method fuses RGB images and hyperspectral images and combines a deep learning algorithm to achieve the acquisition of fusion probability, thereby processing the tongue image into category information. The fusion of multimodal images increases the amount of information of the tongue, contains more biological information, and is conducive to the accurate classification of health status. The steps do not increase additional costs, which is conducive to promotion and application.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to a tongue image detection method based on the fusion of RGB images and hyperspectral images. Background Art

[0002] Health has always been a concern for people. The development of science and technology and the improvement of industrialization have accelerated the pace of people's lives, changed their living habits and dietary structure, and led to a surge in the number of sub-healthy people. When the human body is in a sub-healthy state, if it is not prevented and treated in time, it may cause many chronic diseases. However, the early symptoms of some diseases are almost imperceptible, and they are often discovered only after they worsen to the point where the human body has obvious reactions and seeks medical treatment. Therefore, people hope to obtain a faster, more convenient and more accurate diagnostic method to understand their personal physical condition, and then realize personal disease warning and health management.

[0003] Tongue diagnosis is an important part of TCM's "visual" diagnosis, providing an important basis for TCM diagnosis, and has played an indispensable role in TCM for thousands of years. Clinical research in TCM shows that the tongue is closely connected to the internal organs through the meridians. Therefore, tongue diagnosis can be used to understand the deficiency and excess of the internal organs, qi, blood, and body fluids of the human body, as well as the nature, severity, and changes of pathogenic factors. Traditional tongue diagnosis mainly involves doctors observing the patient's tongue through the naked eye, evaluating the tongue information such as tongue color, coating color, thickness of tongue coating, and area of ​​tongue coating. The diagnostic results are highly subjective and are affected by factors such as the doctor's diagnosis and treatment level and the external environment.

[0004] Objective research on tongue diagnosis has become the mainstream trend. Currently, relevant technologies have been developed to automatically obtain external information such as the color and texture of the tongue coating and tongue quality by processing tongue images taken by cameras, replacing manual work. However, RGB digital images cannot perceive the internal information of the tongue, so the accuracy of recognition cannot be guaranteed. Summary of the invention

[0005] In view of the above defects of the prior art, the present invention provides a tongue image detection method based on the fusion of RGB image and hyperspectral image to solve the technical problem that tongue image detection is not accurate enough.

[0006] To achieve the above-mentioned purpose and other related purposes, the present invention provides a tongue image detection method based on the fusion of RGB images and hyperspectral images, comprising the following steps: obtaining an RGB image and a hyperspectral image of a tongue to be tested; inputting the RGB image into a space-graph subnetwork to enhance the global and local features of the perceived image to obtain spatial features; inputting the hyperspectral image into a spectral subnetwork to capture the long-range correlation of spectral features to obtain spectral features; and using a weighted module to perform weighted summation on the spatial features and the spectral features to obtain a final fusion probability.

[0007] In one embodiment of the present invention, the space-graph subnetwork includes: a space-graph attention dense block, the space-graph attention dense block includes a space self-attention module and a graph self-attention module, the space self-attention module is used to enhance the local features of the perceived image, and the graph self-attention module is used to enhance the global features of the perceived image; a 2-D transition layer, used to reduce the size of the feature map output by the space-graph attention dense block; and a global 2-D average pooling layer, used to downsample the features output by the space-graph attention dense block to a specified size.

[0008] In one embodiment of the present invention, the spatial-graph subnetwork includes three spatial-graph attention dense blocks, the first spatial-graph attention dense block is connected to the second spatial-graph attention dense block through a 2-D transition layer, the second spatial-graph attention dense block is connected to the third spatial-graph attention dense block through a 2-D transition layer, and the third spatial-graph attention dense block is output through a global 2-D average pooling layer.

[0009] In one embodiment of the present invention, the spatial-graph attention dense block processes the input feature x1 through the following steps: processing the input feature x1 according to the following formula: y1={x1,f1(x1),f1[x1,f1(x1)]} to obtain feature y1; processing the input feature x1 according to the following formula: y2={x1,f2(x1),f2[x1,f2(x1)]} to obtain feature y2; concatenating the feature y1 and the feature y2 to obtain the output feature of the spatial-graph attention dense block; in the above formula, f1 and f2 are both composite function operations, and f1 includes , And the spatial self-attention module, the f2 includes , And the graph self-attention module.

[0010] In one embodiment of the present invention, the spatial self-attention module performs the following steps to input features: Figure X Processing: Input the features Figure X To two parallel Conv layer, respectively obtain feature map A and feature map B; calculate the similarity between the center vector of the feature map A and its neighbors to obtain a spatial attention map S; use the softmax function to normalize the spatial attention map S to obtain a feature map S'; calculate the element-by-element product of the feature map B and the feature map S' to obtain a feature map W spa ; The feature map W spa and the characteristics Figure XOutput after residual connection.

[0011] In one embodiment of the present invention, the spectral sub-network includes: a spectral attention dense block for capturing the long-range correlation of spectral features; a 1-D transition layer for reducing the size of the feature map output by the spectral attention dense block; and a global 1-D average pooling layer for downsampling the features output by the spectral attention dense block to a specified size.

[0012] In one embodiment of the present invention, the spectral attention dense block processes the input feature x2 by the following steps: the input feature x2 is processed according to the following formula: y3={x2,f3(x2),f3[x2,f3(x2)]}, and the feature y3 is used as the output feature of the spectral attention dense block, wherein f3 is a composite function operation, which includes , and a spectral self-attention module.

[0013] In one embodiment of the present invention, the spectral self-attention module processes the input feature map Y through the following steps: calculating the similarity between any two bands in the feature map Y to obtain a spectral attention probability map Q; normalizing each column of the spectral attention probability map Q using a softmax function to obtain a feature map Q'; calculating the element-by-element product of the feature map Y and the feature map Q' to obtain a feature map W spe ; The feature map W spe The residual connection is performed with the feature map Y and then output.

[0014] In one embodiment of the present invention, the step of using a weighted module to perform weighted summation on the spatial feature and the spectral feature to obtain a final fusion probability includes: inputting the spatial feature to a first fully connected layer to obtain a first probability F spa ; Input the spectral features to the second fully connected layer to obtain the second probability F spe ; The first probability F spa , the second probability F spe Substituting into the formula F=σ[λ×F spa +(1-λ)×F spe ] to obtain the final fusion probability F, where σ[ ] represents the softmax function and λ is the weight parameter.

[0015] In one embodiment of the present invention, the step of obtaining an RGB image and a hyperspectral image of the tongue to be tested includes: obtaining an original RGB image and an original hyperspectral image of the tongue to be tested; converting the original hyperspectral image through a color matching function to obtain a pseudo-color image; using an improved Unet network to perform tongue image segmentation on the original RGB image and the pseudo-color image respectively to obtain a first mask image and a second mask image, obtaining the RGB image of the tongue according to the first mask image and the original RGB image, and obtaining the first hyperspectral image of the tongue according to the second mask image and the original hyperspectral image; performing dimensionality reduction on the first hyperspectral image to obtain the hyperspectral image of the tongue after dimensionality reduction.

[0016] Beneficial effects of the present invention: The present invention proposes a tongue image detection method based on the fusion of RGB images and hyperspectral images. The method fuses RGB images and hyperspectral images and combines them with a deep learning algorithm to achieve the acquisition of fusion probability, thereby processing the tongue image into category information. Compared with single-modal RGB images, the fusion of multimodal images increases the amount of information on the tongue and contains more biological information, which is conducive to the accurate classification of health status. The steps do not increase additional costs, which is conducive to popularization and application. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0018] Figure 1 A flow chart of a tongue image detection method provided by an embodiment of the present invention;

[0019] Figure 2 A block diagram of a tongue image detection network provided by an embodiment of the present invention

[0020] Figure 3 A structural diagram of a tongue image detection network provided by an embodiment of the present invention;

[0021] Figure 4 A structural diagram of a spatial-graph attention dense block provided by an embodiment of the present invention;

[0022] Figure 5 A structural diagram of a spatial self-attention module provided by an embodiment of the present invention;

[0023] Figure 6 A structural diagram of a spectral attention dense block provided by an embodiment of the present invention;

[0024] Figure 7 A structural diagram of a spectral self-attention module provided in one embodiment of the present invention;

[0025] Figure 8 A flow chart of an image preprocessing method provided by an embodiment of the present invention;

[0026] Fig. 9 A structural diagram of a tongue image segmentation network provided in one embodiment of the present invention;

[0027] Fig.10 A structural diagram of a multi-branch module provided by an embodiment of the present invention;

[0028] Fig.11 A structural diagram of a spatial-coordinated attention module provided by an embodiment of the present invention;

[0029] Fig.12 This is a structural diagram of a Multi up-sample module provided in one embodiment of the present invention. DETAILED DESCRIPTION

[0030] The following describes the embodiments of the present invention through specific specific embodiments, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. It should be noted that the following embodiments and the features in the embodiments can be combined with each other without conflict. In addition to the specific methods, equipment, and materials used in the embodiments, according to the technical personnel in this technical field's grasp of the prior art and the records of the present invention, any methods, equipment, and materials of the prior art that are similar or equivalent to the methods, equipment, and materials in the embodiments of the present invention can also be used to implement the present invention.

[0031] It should be understood that the terms used in the embodiments of the present invention are for describing specific embodiments rather than for limiting the scope of protection of the present invention. Unless otherwise defined, all technical and scientific terms used in the present invention have the same meaning as those generally understood by those skilled in the art.

[0032] In the following description, numerous details are discussed to provide a more thorough explanation of the embodiments of the present invention. However, it is obvious to those skilled in the art that the embodiments of the present invention can be implemented without these specific details. In some of the embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present invention difficult to understand.

[0033] The flowchart and block diagram in the accompanying drawings illustrate the system architecture, functions and operations that may be implemented according to the methods and computer program products of various embodiments disclosed in the present invention. In this regard, each box in the flowchart or block diagram can represent a module, a program segment, or a part of a code, and the module, the program segment, or a part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or the flowchart, and the combination of the boxes in the block diagram and / or the flowchart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0034] See also Figure 1 and Figure 2 An embodiment of the present invention provides a tongue image detection method based on the fusion of RGB image and hyperspectral image, comprising the following steps: S100, obtaining an RGB image and a hyperspectral (HSI) image of the tongue to be tested; the RGB image can be obtained by shooting with a high-definition camera, and the hyperspectral image can be obtained by collecting with an imaging spectrometer. It can be understood that the obtained original RGB image and the original hyperspectral image should be preprocessed, and the preprocessing can be, for example, region segmentation, size adjustment, noise removal, spectral dimension reduction, etc., to ensure the image quality and the suitability of the data so that it meets the input of the network model.

[0035] The tongue image detection method also includes the following steps: S200, inputting the RGB image into the space-graph subnetwork to enhance the global and local features of the perceived image to obtain the spatial features; S300, inputting the hyperspectral image into the spectral subnetwork to capture the long-range correlation of the spectral features to obtain the spectral features; through the processing of these two subnetworks, the spatial features and spectral features of the image can be extracted respectively. Considering that the obtained spatial and spectral features have different characteristics, the following steps are also included: S400, using a weighted module to perform weighted summation of the spatial features and the spectral features to obtain the final fusion probability.

[0036] The above steps fuse RGB images and hyperspectral images and obtain fusion probability through deep learning algorithms, thereby processing the tongue image into category information. Compared with single-modal RGB images, the fusion of multimodal images increases the amount of information about the tongue and contains more biological information, which is conducive to the accurate classification of health status. The steps do not increase additional costs, which is conducive to promotion and application.

[0037] See also Figure 2 , Figure 3 and Figure 4 In a specific embodiment of the present invention, the space-graph subnetwork includes: a space-graph attention dense block, i.e. Figure 3 The Spatial Attention Dense Block + Graph Attention DenseBlock in the above example is expanded as follows: Figure 4 As shown in Figure 1, the spatial-graph attention dense block includes a spatial self-attention module (also written as Spatial Self-Attention in the structure diagram) and a graph self-attention module (also written as Graph Self-Attention in the structure diagram). The spatial self-attention module is used to enhance the local features of the perceived image, and the graph self-attention module is used to enhance the global features of the perceived image; the 2-D transition layer, i.e. Figure 2 The part between the two spatial-graph attention dense blocks in is used to reduce the size of the feature map output by the spatial-graph attention dense block; and the global 2-D average pooling layer is used to downsample the features output by the spatial-graph attention dense block to a specified size.

[0038] In a specific embodiment of the present invention, the space-graph subnetwork includes three space-graph attention dense blocks, the first space-graph attention dense block is connected to the second space-graph attention dense block through a 2-D transition layer, the second space-graph attention dense block is connected to the third space-graph attention dense block through a 2-D transition layer, and the third space-graph attention dense block is output through a global 2-D average pooling layer. Since each space-graph attention dense block will increase the number of channels, using too many will overly complicate the model, and using too few will be detrimental to feature extraction. Therefore, three space-graph attention dense blocks are used in this embodiment.

[0039] See also Figure 4 In a specific embodiment of the present invention, the spatial-graph attention dense block processes the input feature x1 through the following steps: Process the input feature x1 according to the following formula: y1={x1,f1(x1),f1[x1,f1(x1)]} to obtain feature y1; Process the input feature x1 according to the following formula: y2={x1,f2(x1),f2[x1,f2(x1)]} to obtain feature y2; Concatenate feature y1 and feature y2 to obtain the output feature of the spatial-graph attention dense block, which is expressed by the formula y1+y2; In the above formula, f1 and f2 are both composite function operations, and f1 includes , And the spatial self-attention module, f2 includes , And the graph self-attention module. In this embodiment, all output features of the module are passed to the subsequent units, which can not only alleviate the gradient disappearance, but also effectively enhance the feature representation. It can be understood that Figure 4 This is the structure diagram of the entire space-graph attention dense block, and the left part corresponds to Figure 3 The Spatial Attention Dense Block in the figure corresponds to the Figure 3 Graph AttentionDense Block in .

[0040] See also Figure 5 In a specific embodiment of the present invention, the spatial self-attention module assigns weights to different features by measuring the similarity between surrounding features and central features. Therefore, it can adaptively strengthen the remote features related to the central pixel and suppress unnecessary features to improve the spatial feature representation when predicting the central pixel. The spatial self-attention module performs the following steps on the input features: Figure X Processing: In order to facilitate the operation between spatial features, first input the feature Figure X To two parallel The Conv layer obtains feature maps A and B respectively, where the feature Figure X The size is , represents the size of the space, and c represents the number of channels.

[0041] Then calculate the similarity between the center vector of feature map A and its neighbors to obtain the spatial attention map S. The center vector of feature map A is denoted as A i , which is similar to its neighbor [A i,1 ,A i,2 ,…,A i,n The similarity between ] is:

[0042] ;

[0043] Among them, S i,t It represents the feature correlation between the center vector and the domain vector, ||A i ||、||A i,t || are vector A respectively i , A i,t The norm of , which is the length of the vector.

[0044] The spatial attention map S is then normalized using the softmax function to obtain the feature map S':

[0045] .

[0046] The generated spatial attention map can be interpreted as the relative importance of each position in space, which is then used to weight the features of different positions in the input feature map, where the weight matrix is ​​B. Calculate the element-by-element product of the feature map B and the feature map S' to obtain a refined output, namely the feature map W spa , which can be expressed as ; This output focuses on the more informative features related to the center pixel in the channel dimension, while suppressing features that are not related to the center pixel. Finally, the feature map W spa and Features Figure X The output after residual connection is V spa =W spa +X, performs a weighted sum of certain parts of the input in order to incorporate information from the original input into the module’s output.

[0047] In a specific embodiment of the present invention, since the space self-attention module pays more attention to local features, it lacks the grasp of global features. Therefore, a graph self-attention module is added to the space-graph subnetwork to obtain the global features of the image. The graph self-attention module in this embodiment adopts the GAT graph attention network, and GAT proposes to use the attention mechanism to perform weighted summation on the features of adjacent nodes. The weights of adjacent node features depend entirely on the node features and have nothing to do with the graph structure. It can dynamically adjust the weights between nodes in a global range, so it can capture global features well. The specific process and graph are not described here.

[0048] See also Figure 2 and Figure 3 In a specific embodiment of the present invention, the 2-D transition layer is composed of a BN layer, a ReLU activation function, Convolutional layers and The global 2-D average pooling layer consists of a BN layer, a ReLU activation function, and The global average pooling layer is composed of

[0049] See also Figure 2 , Figure 3 and Figure 6 In a specific embodiment of the present invention, the spectral sub-network includes: a spectral attention dense block, i.e. Figure 3 The Spectral Attention Dense Block in is used to capture the long-range correlation of spectral features; the 1-D transition layer is used to reduce the size of the feature map output by the spectral attention dense block; and the global 1-D average pooling layer is used to downsample the features output by the spectral attention dense block to a specified size.

[0050] See also Figure 6In a specific embodiment of the present invention, the spectral attention dense block processes the input feature x2 by the following steps: the input feature x2 is processed according to the following formula: y3={x2,f3(x2),f3[x2,f3(x2)]}, and the obtained feature y3 is used as the output feature of the spectral attention dense block, where f3 is a composite function operation, which includes , And the spectral self-attention module, which can also be written as Spectral Self-Attention in the structure diagram.

[0051] See also Figure 7 In a specific embodiment of the present invention, the convolution kernel in the one-dimensional convolutional neural network can only represent local cross-channel interactions and cannot explore long-range channel correlations. The spectral self-attention module is designed to capture the long-range spectral correlation of 1-D CNN on local spectral features. It uses cosine similarity to explore the interdependence between channels, thereby improving the representation ability of spectral features. The spectral self-attention module is similar to the spatial self-attention module. It processes the input feature map Y through the following steps: calculate the similarity between any two bands in the feature map Y to obtain the spectral attention probability map Q, the formula is as follows:

[0052] ;

[0053] In the formula, Q u,v Indicates the u-th channel Y u and the vth channel Y v The correlation between them. Y is the input spectral feature vector with dimension l×f, where l is the length of the feature vector and f is the number of channels in the feature vector, which is also equal to the number of filters in the convolutional layer. ||Y u ||、||Y v || respectively vector Y u , Y v The norm of , which is the length of the vector.

[0054] Then each column of the spectral attention probability map Q is normalized using the softmax function to obtain the feature map Q':

[0055] ;

[0056] Calculate the element-wise product of feature map Y and feature map Q' to get feature map W spe , which can be expressed as This graph shows the distribution of attention weights between different channels of the input, that is, which channels are more concerned in a specific context. During the training or inference process of the model, this probability map can be used to adjust the contribution of different channels to enhance the model's attention to specific channels, thereby better capturing the relationship of spectral information. Finally, the feature map W spe The output is V after residual connection with feature map Y. spe =W spe +Y. By using the spectral self-attention module, the model is able to capture the long-range correlations between different channels in the spectral data, which helps to improve the discriminability of spectral features.

[0057] In a specific embodiment of the present invention, the 1-D transition layer is composed of a BN layer, a ReLU activation function, Convolutional layers and The global 1-D average pooling layer consists of a BN layer, a ReLU activation function, and The global average pooling layer is composed of

[0058] See also Figure 3 In a specific embodiment of the present invention, the step of using a weighted module to perform weighted summation on the spatial features and the spectral features to obtain the final fusion probability includes: inputting the spatial features to the first fully connected layer to obtain a first probability F spa ; Input the spectral features to the second fully connected layer to obtain the second probability F spe ; The first probability F spa , the second probability F spe Substituting into the formula F=σ[λ×F spa +(1-λ)×F spe ] to obtain the final fusion probability F, where σ[ ] represents the softmax function, λ is the weight parameter, and the initial value of λ can be set to 0.5, which is automatically adjusted during network optimization. The output features of each sub-network are input into a fully connected (FC) layer, where the number of neurons in the FC layer can be 4, for example. The value of each neuron is regarded as the response of a specific category, and then the fusion probability of different categories is calculated to obtain the first probability F spa and the second probability F spe , and then the final fusion probability F can be calculated through the formula.

[0059] It can be understood that the fusion probability F is one-dimensional, and its length is the number of corresponding tongue image detection results. For example, if the detection result can be healthy, the length of the fusion probability F is 1, and this 1 element corresponds to the probability of health. Or if the detection results are divided into multiple health levels, such as healthy, sub-healthy, and unhealthy, the length of the fusion probability F is 3, and the 3 elements correspond to the probabilities of the three levels respectively.

[0060] Understandably, Figure 3 The network model shown needs to be trained before the RGB image and hyperspectral image to be detected can be detected and the detection results can be obtained. For example, the network can use L2 regularization to weight the model parameters and perform end-to-end training. During the training process, the Adam optimizer is used to update the network parameters through the gradient of the cross-entropy cost function in the back propagation.

[0061] See also Figure 8 In a specific embodiment of the present invention, step S100 includes: S101, obtaining the original RGB image and the original hyperspectral image of the tongue to be tested; S102, converting the original hyperspectral image through a color matching function to obtain a pseudo-color image; S103, using an improved Unet network to perform tongue image segmentation on the original RGB image and the pseudo-color image, respectively, to obtain a first mask image and a second mask image, and a fully connected conditional random field module can also be added for accurate segmentation, and the RGB image of the tongue is obtained according to the first mask image and the original RGB image, and the first hyperspectral image of the tongue is obtained according to the second mask image and the original hyperspectral image. The mask image can be understood as a binary image, and the two colors represent the tongue area and the non-tongue area respectively; S104, reducing the dimension of the first hyperspectral image to obtain the hyperspectral image of the tongue after the dimension reduction. These steps correspond to the image preprocessing process mentioned above.

[0062] In step S103, the improved Unet network and the fully connected conditional random field module together constitute a tongue image segmentation network, whose structure is as follows: Fig. 9 As shown. The convolutional block in the improved Unet network includes a multi-branch module (i.e. Fig. 9 DBB-Net in ), and uses the spatial-coordinated attention module in the encoder part (i.e. Fig. 9 SPCA in the image) to enhance the extraction of spatial information and use the hole convolution module (i.e. Fig. 9The Dilated Conv in the image is used for down-sampling, and the Multi up-sample module is used for up-sampling. The Unet network is a neural network structure commonly used in image segmentation tasks. The structure of Unet looks like the letter "U" and consists of a contraction path (left side) and an expansion path (right side). The contraction path is used to capture the contextual information of the image, while the expansion path is used to accurately locate the object. The Unet network structure mainly includes the encoder part and the decoder part, as well as the skip connection. The fully connected conditional random field (CRF) is a technology used for post-processing of image segmentation. It can improve classification accuracy and boundary quality. It is an important concept in the field of image processing, especially in the task of image semantic segmentation.

[0063] It can be understood that after the multi up-sampling operation in the decoding process, the coarse segmentation image obtained by segmentation will have blurred boundaries due to the loss of feature information. Therefore, a fully connected conditional random field module is used for further processing to optimize the uncertain or blurred marks in the coarse segmentation image and improve the accuracy of the segmentation result.

[0064] By improving the Unet network model and using a multi-branch module to replace the convolution block in the traditional Unet network, the network can retain more detailed information of the feature area in the image. The spatial-coordinated attention module can retain the initial spatial position to a great extent and the channel information to a maximum extent, thereby achieving accurate segmentation of the tongue, face, teeth and other areas, and making the subsequent feature extraction of the tongue more detailed and accurate.

[0065] See also Fig. 9 In a specific embodiment of the present invention, each convolution block is composed of two multi-branch modules to enrich the diversity of the feature space and enhance the learning and expression capabilities of the convolutional network. In the encoder part, the size of the feature layer of the first multi-branch module remains unchanged, and the number of channels in the feature layer increases. The second multi-branch module is used for feature integration, and the size and number of channels of the feature layer remain unchanged. In the decoder part, the size of the feature layer of the first multi-branch module remains unchanged, and the number of channels in the feature layer decreases. The second multi-branch module is also used for feature integration.

[0066] See also Fig.10 In a specific embodiment of the present invention, the multi-branch module processes the input feature Input1 (i.e. Fig.10 The following operation is performed on the input of the output feature Output1 (i.e. Fig.10 Output1 = BN(ReLU(Conv 1×1(Input1)))+BN(ReLU(Conv k×k (BN(ReLU(Conv 1×1 (Input1))))))+BN(ReLU(Conv 1×1 (Input1))). The Diverse Branch Block (DBB) is created by removing the The convolution and average pooling sequence convolution replaces the convolution block in the traditional Unet network with a multi-branch module to strengthen the backbone network, allowing the network to retain more detailed information of the feature area in the image and improve the network's ability to extract multi-scale features. convolution, convolution, and The multi-branch topological structure of the sequence convolution is composed, and the calculation results of the three branches are fused as the output. In addition, a BN (BatchNormalization) layer is added after each convolution, and a ReLU activation function is added to the convolution operation of the structural block, so that the multi-branch has nonlinear mapping learning ability and avoids network generalization.

[0067] See also Fig. 9 In a specific embodiment of the present invention, in the encoder part, the spatial-coordinated attention module is used to extract the spatial position features of the output features of the second multi-branch module in each layer; in the decoder part, the features output by the spatial-coordinated attention module are spliced ​​with the upsampling results of the corresponding layer. In the traditional Unet network structure, the features output by the encoder part are directly connected to the upsampling results of the decoder. This connection method helps to retain the spatial information of the image and provide accurate positioning information during the upsampling process. In this embodiment, we have improved the existing coordinated attention module (CA) and designed a spatial-coordinated attention module (SPCA) to process the features output by the decoder part and then connect them, which can enhance the extraction of spatial information.

[0068] See also Fig.11 In a specific embodiment of the present invention, the spatial-coordinated attention module performs the input feature Input2 (i.e. Fig.11 The following operation is performed on the input in to obtain the output feature Output2 (i.e. Fig.11Output in): Perform maximum pooling and average pooling operations on the input feature Input2 respectively to obtain feature weight layers of two channels, which respectively contain the maximum value and average value information of the tongue image spatial level context information; After the two feature weight layers are connected in series, the convolution with a channel number of 1 is used to adjust the connected feature layer to one channel, so as to fuse the captured effective information; Use the activation function to activate the adjusted feature layer to obtain the spatial context information weight feature Output2 of the input feature layer. This process helps to more comprehensively capture the spatial characteristics of the human facial structure. In a specific embodiment of the present invention, the processing process of the spatial-coordinated attention module is as follows Fig.11 As shown in the figure, X and Y represent the horizontal and vertical directions of the feature map respectively, AvgPool represents average pooling, MaxPool represents maximum pooling, Concat represents concatenation, Conv 2d represents ordinary convolution, BatchNorm represents batch normalization, Non-linear represents nonlinear activation function, Split represents segmentation, Sigmoid represents Sigmoid activation function, C, H and W represent the number of channels, height and width of the feature map respectively.

[0069] In a specific embodiment of the present invention, the traditional Unet network usually uses convolutional layers and pooling layers to increase the receptive field. During the downsampling process, the original image will be reduced and then restored by upsampling. This process will cause the loss of information in the image. Therefore, in this embodiment, a hole convolution layer is used to replace the pooling layer. The hole convolution does not change the size of the image and can also increase the receptive field. That is, the downsampling operation is performed through the hole convolution module. The hole convolution module is also called dilated convolution, which is a special convolution operation. This convolution operation increases the size of the receptive field by inserting holes (i.e., increasing the step size) in the standard convolution kernel while keeping the size of the feature map unchanged. The advantage of this is that more contextual information in the image can be captured without using pooling layers and upsampling, which is particularly important for tasks such as image segmentation.

[0070] See also Fig.12 In a specific embodiment of the present invention, the Multi up-sample module performs the input feature Input3 (i.e. Fig.12 Lower middle ) Perform the following operations to obtain the output feature Output3 (i.e. Fig.12 Above ): Use sub-pixel convolution operation (also written as Pixel shuffle in the structure diagram) to upsample the input feature Input3; Use bilinear interpolation operation (also written as Bilinear in the structure diagram) to upsample the input feature Input3; Fusion the above two upsampling results to obtain the output feature Output3. After downsampling, the Unet network also needs to restore the image size through upsampling. Traditional methods such as deconvolution upsampling and de-maximum pooling upsampling will cause chessboard effects or destroy features. Therefore, in this embodiment, the Multi up-sample module is used to replace the original upsampling method of Unet, that is, the sub-pixel convolution and bilinear interpolation upsampling are fused and the ReLU activation function is added to improve the feature extraction capability and image edge clarity during upsampling. The module includes two convolution layers, a ReLU layer, a sub-pixel convolution layer, a bilinear interpolation layer, and an upsampling structure composed of two channels.

[0071] In a specific embodiment of the present invention, the number of downsampling and upsampling of the improved Unet network are both 4 times. Different data sets may require different levels of feature extraction, so the number of downsampling will be determined according to the complexity of the data set and the resolution of the image, and the number of upsampling is the same as the number of upsampling. At present, in some common applications, the Unet encoder usually performs 4 downsampling, so that the decoder part performs 4 upsampling accordingly to restore the high-level semantic feature map to the resolution of the original image. This design allows the network to capture features of different scales and fuse low-level features through jump connections, thereby performing multi-scale prediction and fine edge recovery. It can be understood that the number of downsampling of the Unet network should be determined according to the specific application scenario and experimental results, and there is no fixed standard. In practical applications, different downsampling times can be tried, and the best network structure can be selected based on the performance on the validation set.

[0072] In a specific embodiment of the present invention, before the step of inputting the image into the improved Unet network to obtain the coarse segmentation image, the step further includes: performing a 3×3 convolution operation on the image; after the step of inputting the image into the improved Unet network to obtain the coarse segmentation image, the step further includes: performing a 1×1 convolution operation on the image.

[0073] In a specific embodiment of the present invention, after the tongue image area is extracted, the RGB image and hyperspectral image of the tongue are obtained. Since the spectrometer generally contains more channels, the hyperspectral image data is not only large in size, but also has information redundancy, which affects the accuracy and speed of subsequent detection. Therefore, it is necessary to perform dimensionality reduction processing on the hyperspectral image to extract the characteristic band spectrum, reduce data redundancy, speed up processing and reduce storage requirements. For example, it can be combined with the continuous projection algorithm (i.e. Figure 2 and Figure 3 SPA in ) and competitive adaptive weighting algorithm (i.e. Figure 2 and Figure 3 In the CARS, we first obtain the reduced-dimensional reflectance spectrum according to SPA, and then input it into CARS to obtain the final characteristic band spectrum.

[0074] SPA is a forward variable selection method for feature selection. It projects the wavelength (or other features) onto other wavelengths and compares the size of the projection vector to select the wavelength with the largest projection vector as the candidate wavelength. Then, the final characteristic wavelength is selected based on the correction model. In this way, SPA can select the variable combination with the least redundant information and the least collinearity. The main advantage of SPA is that it can extract several characteristic wavelengths of the full band, thereby eliminating redundant information in the original spectral matrix. This is particularly important for spectral data analysis because it can help improve the predictive ability and interpretability of the model.

[0075] CARS is an algorithm for feature selection and dimensionality reduction. It selects important features and removes unimportant features by adaptively adjusting feature weights. It can help researchers select the most critical features for model prediction from a large number of features, thereby improving the performance and interpretability of the model.

[0076] The above embodiments are merely illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Anyone familiar with the art may modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by a person of ordinary skill in the art without departing from the spirit and technical concept disclosed by the present invention shall still be covered by the claims of the present invention.

Claims

1. A tongue image detection method based on fusion of RGB image and hyperspectral image, characterized in that: The steps include: Acquire an RGB image and a hyperspectral image of the tongue to be tested; Inputting the RGB image into the space-graph subnetwork to enhance the global and local features of the perceived image to obtain spatial features; Inputting the hyperspectral image into the spectral subnetwork to capture the long-range correlation of spectral features to obtain spectral features; Using a weighting module to perform weighted summation on the spatial features and the spectral features to obtain a final fusion probability; The space-graph subnetwork includes: A space-graph attention dense block, wherein the space-graph attention dense block includes a space self-attention module and a graph self-attention module, wherein the space self-attention module is used to enhance the local features of the perceived image, and the graph self-attention module is used to enhance the global features of the perceived image; A 2-D transition layer for reducing the size of the feature map output by the spatial-graph attention dense block; and A global 2-D average pooling layer is used to downsample the features output by the spatial-graph attention dense block to a specified size; The space-graph subnetwork includes three space-graph attention dense blocks, the first space-graph attention dense block is connected to the second space-graph attention dense block through a 2-D transition layer, the second space-graph attention dense block is connected to the third space-graph attention dense block through a 2-D transition layer, and the third space-graph attention dense block is output through a global 2-D average pooling layer; The spatial-graph attention dense block processes the input feature x1 by the following steps: The input feature x1 is processed according to the following formula: y1={x1+f1(x1)+f1[x1+f1(x1)]} to obtain feature y1; The input feature x1 is processed according to the following formula: y2={x1+f2(x1)+f2[x1+f2(x1)]} to obtain feature y2; Concatenate the feature y1 and the feature y2 to obtain the output feature of the spatial-graph attention dense block; In the above formula, f1 and f2 are both composite function operations, f1 includes , And the spatial self-attention module, f2 includes , And the graph self-attention module; The step of using a weighted module to perform weighted summation on the spatial features and the spectral features to obtain a final fusion probability includes: Input the spatial features to the first fully connected layer to obtain the first probability F spa ; Input the spectral features to the second fully connected layer to obtain the second probability F spe ; The first probability F spa The second probability F spe Substituting into the formula F = σ [λ × F spa +(1-λ)×F spe ] to obtain the final fusion probability F, where σ[ ] represents the softmax function and λ is the weight parameter.

2. The tongue image detection method based on RGB image and hyperspectral image fusion according to claim 1, characterized in that: The spatial self-attention module processes the input feature map X through the following steps: Input the feature map X to two parallel Conv layer, obtain feature map A and feature map B respectively; Calculate the similarity between the center vector of the feature map A and its neighbors to obtain a spatial attention map S; The spatial attention map S is normalized using a softmax function to obtain a feature map S'; Calculate the element-by-element product of the feature map B and the feature map S' to obtain the feature map W spa ; The feature map W spa The residual connection is performed with the feature map X and then output.

3. The tongue image detection method based on RGB image and hyperspectral image fusion according to claim 1, characterized in that: The spectral sub-network includes: Spectral attention dense block to capture the long-range correlation of spectral features; A 1-D transition layer for reducing the size of the feature map output by the spectral attention dense block; and A global 1-D average pooling layer is used to downsample the features output by the spectral attention dense block to a specified size.

4. The tongue image detection method based on RGB image and hyperspectral image fusion according to claim 3, characterized in that: The spectral attention dense block processes the input feature x2 by the following steps: The input feature x2 is processed according to the following formula: y3={x2+f3(x2)+f3[x2+f3(x2)]}, and the feature y3 is used as the output feature of the spectral attention dense block, where f3 is a composite function operation, which includes , and a spectral self-attention module.

5. The tongue image detection method based on RGB image and hyperspectral image fusion according to claim 4, characterized in that: The spectral self-attention module processes the input feature map Y through the following steps: Calculate the similarity between any two bands in the feature map Y to obtain a spectral attention probability map Q; Each column of the spectral attention probability map Q is normalized using a softmax function to obtain a feature map Q'; Calculate the element-by-element product of the feature map Y and the feature map Q' to obtain the feature map W spe ; The feature map W spe The residual connection is performed with the feature map Y and then output.

6. The tongue image detection method based on RGB image and hyperspectral image fusion according to claim 1, characterized in that: The step of obtaining the RGB image and the hyperspectral image of the tongue to be tested comprises: Obtaining an original RGB image and an original hyperspectral image of the tongue to be tested; Converting the original hyperspectral image to a pseudo-color image using a color matching function; Using an improved Unet network to perform tongue image segmentation on the original RGB image and the pseudo-color image respectively, to obtain a first mask image and a second mask image, to obtain the RGB image of the tongue according to the first mask image and the original RGB image, and to obtain a first hyperspectral image of the tongue according to the second mask image and the original hyperspectral image; The first hyperspectral image is subjected to dimension reduction to obtain the hyperspectral image of the tongue after dimension reduction.

Citation Information

Patent Citations

  • Hyperspectral image feature processing method, classification method, device and system and storage medium

    CN113989679A

  • Remote sensing image change detection method based on spatial-spectral feature fusion network

    CN114359723A

  • Hyperspectral image classification method based on multi-scale spatial-spectral feature joint learning

    CN114842264A

  • Remote sensing image fusion method and device, equipment and storage medium

    CN116843589A

  • Multispectral tongue picture image acquisition and analysis system

    CN116849612A