Gastrointestinal metaplasia image classification system based on multi-feature fusion and weakly supervised localization

Through multi-feature fusion and weakly supervised positioning technology, combined with attention mechanism and adaptive weighting module, details and semantic features of gastrointestinal metaplasia images are extracted, which solves the problems of insufficient interpretability and inaccurate positioning in the existing technology. Improved accuracy and reliability of gastrointestinal metaplasia image classification.

CN118334456BActive Publication Date: 2024-09-10GUANGZHOU BOCHANG BIOTECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410772479.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-17
Publication Date
2024-09-10
Estimated Expiration
2044-06-17

AI Technical Summary

Technical Problem

Existing deep learning methods are difficult to effectively utilize the color and texture information of HSV images and LBP images in medical image processing, and weakly supervised positioning technology is not accurate enough in positioning the lesion area, affecting the classification performance of gastrointestinal metaplasia images.

Method used

A multi-feature fusion module is used to perform weighted fusion of the features of RGB, HSV and LBP images. Combined with the attention mechanism, the lesion adaptive weighting module is used to reduce the impact of inaccurate lesion activation maps, and detailed features and semantic features are extracted through the residual network, and The multi-head self-attention mechanism and channel attention mechanism are used for final feature weighting.

Benefits of technology

It improves the accuracy and interpretability of gastrointestinal metaplasia image classification, reduces the burden on endoscopists, and reduces the missed diagnosis rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118334456B
    Figure CN118334456B
Patent Text Reader

Abstract

The present invention belongs to the field of medical image processing, and provides a gastrointestinal metaplasia image classification system based on multi-feature fusion and weakly supervised positioning. The system extracts features by converting RGB images into HSV images and local binary pattern images, and designs a multi-feature fusion module based on multi-head self-attention mechanism and channel attention mechanism, thereby realizing effective use of color and texture information in GIM images and improving the classification performance of the model. At the same time, the lesion area in the GIM image is located by weakly supervised positioning technology, and the lesion activation map is weighted by using the prediction confidence of the pre-trained network, thereby reducing the impact of inaccurate lesion activation maps; after the RGB image is fused with the weighted lesion activation map, feature extraction is performed, thereby solving the problem that the traditional model cannot focus on the lesion area when only image-level annotation is used, and further improving the accuracy of grading the severity of gastrointestinal metaplasia.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of medical image processing, and in particular relates to a gastrointestinal metaplasia image classification system based on multi-feature fusion and weakly supervised positioning. Background Art

[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.

[0003] Gastric cancer is the fifth most common malignant tumor in the world and the third most common in terms of mortality. Gastrointestinal metaplasia is a common precancerous state that is closely related to the occurrence of gastric cancer. In the gastric cancer cascade from chronic gastritis, atrophic gastritis, intestinal metaplasia, dysplasia to adenocarcinoma, gastrointestinal metaplasia (GIM) is an important step. According to statistics, the risk of gastric cancer in GIM patients increases by 10 times. Therefore, the identification and monitoring of GIM patients is particularly important.

[0004] The Operative Link on Gastric Intestinal Metaplasia Assessment (OLGIM) is a currently recognized method for assessing the risk of intestinal metaplasia progressing to gastric cancer and is the gold standard for quantifying gastric cancer risk. However, it is not widely used in clinical practice because it requires at least four biopsies in the stomach, is time-consuming and labor-intensive, and may cause harm to patients. In recent years, an endoscopic grading system for gastric mucosal intestinal metaplasia (EGGIM) has been proposed, which predicts gastric cancer risk by evaluating the extent of intestinal metaplasia in the greater and lesser curvatures of the gastric antrum, the gastric angle, and the greater and lesser curvatures of the gastric body. This system can achieve gastric cancer risk prediction accuracy close to that of OLGIM and has been widely recommended by European guidelines. EGGIM eliminates the biopsy process, allowing endoscopists to make real-time diagnostic assessments and minimizes harm to patients.

[0005] In medical practice, villous structures and bright blue ridges have been widely regarded as typical manifestations of endoscopic GIM, but clinical practice shows that GIM has certain similarities with other gastric lesions (such as the microscopic manifestations of inflammation), which brings great challenges to the severity grading of GIM. The severity grading of GIM based on EGGIM depends largely on the expertise and proficiency of endoscopists. However, it is a difficult task to organize well-trained endoscopists to quickly conduct large-scale GIM severity screening, and human-led diagnosis may be affected by a variety of subjective factors. Using computer-aided diagnosis (CAD) systems to assist endoscopists in assessing the severity of GIM can help reduce the impact of these factors and reduce the burden on endoscopists.

[0006] In recent years, deep learning-based methods have been widely used in medical image analysis and have achieved remarkable results. However, general deep learning methods often only focus on the information of RGB images and cannot focus on the lesion area in the image with only image-level annotations. Studies have shown that images in the hue, saturation, and brightness color space (HSV) can enable the model to understand and manipulate colors in classification tasks and reduce the impact of brightness changes during endoscopic surgery; images in the local binary pattern (LBP) can utilize pixel information in a small neighborhood and capture the ridge texture with slight changes in GIM images. At the same time, the gradient-weighted class activation mapping plus plus (Grad-CAM++) in the weakly supervised localization technology can locate the lesion area of ​​the GIM image with only image-level annotations, and can be used in combination with any convolutional neural network.

[0007] However, there are the following technical problems in the prior art:

[0008] On the one hand, most of the current deep learning methods are based on convolution kernels and pooling operations to automatically extract image features, without the need for manual feature engineering, and have good robustness and generalization capabilities. However, medical images often have complex and diverse features, and the RGB image features, HSV image features, and LBP image features extracted by convolution kernels and pooling operations are not interpretable and are not easy to understand. Therefore, it is impossible to effectively use the color and texture information provided by HSV images and LBP images to improve the classification performance of the model.

[0009] On the other hand, Grad-CAM++ is a commonly used weakly supervised localization technique that can use the gradient of the target category and the final convolutional layer in the convolutional neural network to generate a localization map that highlights the important areas in the image for prediction, which are the lesion areas in the GIM image. However, due to its own limitations, this technology will locate the lesion area in our images without GIM lesions, and the localization in images with low prediction confidence is often not accurate enough. Therefore, it is impossible to directly use the localization map generated by weakly supervised localization to guide the model to focus on the lesion area. Summary of the invention

[0010] In order to solve the above problems, the present invention proposes a gastrointestinal metaplasia image classification system based on multi-feature fusion and weakly supervised positioning. The present invention uses the proposed multi-feature fusion module to weightedly fuse the different features of RGB images, HSV images and LBP images according to the weights assigned by the attention mechanism, effectively utilizing the color and texture information in the GIM image. At the same time, the proposed lesion adaptive weighting module adaptively weights the lesion activation map generated by the weakly supervised positioning technology according to the prediction confidence of the pre-trained model, thereby reducing the impact of inaccurate lesion activation maps.

[0011] According to some embodiments, the present invention provides a gastrointestinal metaplasia image classification system based on multi-feature fusion and weakly supervised positioning, which adopts the following technical solutions:

[0012] Gastrointestinal metaplasia image classification system based on multi-feature fusion and weakly supervised localization, including:

[0013] An image preprocessing module is configured to obtain an original gastrointestinal endoscopic image and perform preprocessing to obtain a gastrointestinal endoscopic image;

[0014] The lesion activation map generation module is configured to convert the RGB image of the gastrointestinal endoscope image into an HSV image and an LBP image, input the RGB image into a pre-trained classification network, convert it again into an HSV image and an LBP image, extract features respectively and then fuse them to obtain fusion features, perform classification according to the fusion features to obtain a predicted classification result; generate a lesion activation map of the RGB image according to the feature map extracted from the RGB image in the pre-trained classification network and the predicted classification result;

[0015] An adaptive weighting module is configured to adaptively weight the lesion activation map according to the predicted classification probability of the pre-trained classification network, and fuse the weighted lesion activation map with the corresponding RGB image pixel by pixel to obtain a weighted fused image;

[0016] A weighted feature extraction module is configured to extract low-level detail features of the HSV image and the LBP image through a residual network, and to extract high-level semantic features of the weighted fusion image through a residual network;

[0017] The image classification module is configured to use the multi-head self-attention mechanism and the channel attention mechanism to perform weighted fusion on the extracted underlying detail features of the HSV image, the underlying detail features of the LBP image, and the high-level semantic features of the weighted fusion image to obtain the final fusion features, and use the final fusion features to complete the classification of gastrointestinal metaplasia images.

[0018] Furthermore, the original gastrointestinal endoscopic image is obtained and preprocessed to obtain the gastrointestinal endoscopic image, specifically:

[0019] Count the brightness and saturation of dark and reflective areas of all original gastrointestinal endoscopy images in the HSV color space;

[0020] The pixels in the dark area and the reflection area are set to zero according to the threshold value to complete the image filtering;

[0021] All filtered images were uniformly scaled to a resolution of 224 × 224, and random horizontal flipping and random rotation were used for data augmentation to obtain gastrointestinal endoscopic images.

[0022] Furthermore, the lesion activation map of the RGB image is generated according to the feature map extracted from the RGB image in the pre-trained classification network and the predicted classification result, specifically:

[0023] Calculate the gradient of the prediction result with respect to the output of the last convolutional layer of the pre-trained network, and determine the activation weight based on the gradient and the prediction result;

[0024] Multiply the activation weights by the channel feature map output by the last convolutional layer to obtain the fused feature map;

[0025] Perform ReLU operation on the fused feature map to obtain the initial lesion activation map;

[0026] The initial lesion activation map is restored to the size of the RGB image through upsampling to obtain the lesion activation map.

[0027] Furthermore, the calculation prediction result is about the gradient of the output of the last convolutional layer of the pre-trained network, and the activation weight is determined according to the gradient and the prediction result, specifically:

[0028] ;

[0029] ;

[0030] in, is the target category, that is, the lesion level, is the predicted class score; Represents the feature map channels, represents partial derivatives, and are the element positions on the feature map of this layer, Represents the output feature map of the last convolutional layer Channel feature map of the position, Represents the output feature map of the last convolutional layer Channel feature map of the position, is the additional weight, is the activation weight.

[0031] Furthermore, the lesion activation map is adaptively weighted according to the predicted classification probability of the pre-trained classification network, and the weighted lesion activation map is fused pixel by pixel with the corresponding RGB image to obtain a weighted fused image, specifically:

[0032] Normalize the predicted classification probability of the pre-trained classification network to [0,1];

[0033] For the lesion activation map predicted by the pre-trained classification network as level 0, each element of the lesion activation map is multiplied by 1 minus the predicted classification probability. For the lesion activation map predicted by the pre-trained classification network as level 1 and level 2, each element of the lesion activation map is multiplied by the corresponding predicted probability to complete the weighting of the lesion activation map.

[0034] The weighted lesion activation map is multiplied element-wise with the RGB image of the gastrointestinal endoscopy image to obtain a weighted fusion image.

[0035] Furthermore, the underlying detail features of the HSV image and the LBP image are extracted through the residual network, specifically:

[0036] Using the residual network ResNet50, the HSV image passes through the convolution layer, the maximum pooling layer, and finally the three residual blocks in the first stage. Each residual block consists of three convolution layers to obtain an HSV image feature map with a shape of [64, 256, 56, 56];

[0037] Using the residual network ResNet50, the LBP image passes through the convolution layer, the maximum pooling layer, and finally the three residual blocks in the first stage. Each residual block consists of three convolution layers to obtain an LBP image feature map with a shape of [64, 256, 56, 56].

[0038] Furthermore, the high-level semantic features of the weighted fusion image are extracted through the residual network, specifically:

[0039] Using the residual network ResNet50, the weighted fused image passes through the convolution layer, the maximum pooling layer, and then through the three residual blocks in the first stage. Each residual block consists of three convolution layers, and the shape becomes [64, 256, 56, 56]. After the four residual blocks in the second stage, the shape becomes [64, 512, 28, 28]. After the six residual blocks in the third stage, the shape becomes [64, 1024, 14, 14]. Finally, after the three residual blocks in the fourth stage, a weighted fused image feature map with a shape of [64, 2048, 7, 7] is obtained.

[0040] Furthermore, the multi-head self-attention mechanism and the channel attention mechanism are used to perform weighted fusion on the extracted HSV image underlying detail features, LBP image underlying detail features and high-level semantic features of the weighted fusion image, specifically:

[0041] The multi-head self-attention mechanism is used to perform weighted summation on the extracted HSV image underlying detail features and LBP image underlying detail features to obtain the output of the multi-head self-attention mechanism;

[0042] The output of the multi-head self-attention mechanism and the high-level semantic features of the weighted fusion image are both subjected to a global average pooling operation and spliced ​​in the channel dimension. The spliced ​​features are channel-weighted by the channel attention mechanism to obtain the final fusion features.

[0043] Furthermore, the concatenated features are channel-weighted by the channel attention mechanism to obtain the final fusion features, specifically:

[0044] The concatenated features are reduced in dimension by the first fully connected layer, and then Function activation;

[0045] The activated features are restored to the size of the concatenated features through the second fully connected layer, and then the channel attention weight is obtained through the Sigmoid activation function;

[0046] Multiply the learned channel attention weight by the concatenated features to obtain the final fused features.

[0047] Furthermore, the final fusion features are used to complete the classification of gastrointestinal metaplasia images, specifically:

[0048] The final fusion feature is flattened and its shape becomes [64,2560];

[0049] Use random dropout to make some weights zero to prevent model overfitting;

[0050] The flattened features finally pass through a fully connected layer with an output channel of 3 to output the predicted probabilities of the three categories.

[0051] Compared with the prior art, the present invention has the following beneficial effects:

[0052] The present invention realizes effective utilization of color and texture information in GIM images by converting the original endoscopic images in RGB color space into images in HSV color space and images in local binary mode for feature extraction and using attention mechanism to fuse the features of the three images, thereby overcoming the problem of single feature extraction in traditional methods and improving the classification effectiveness of features. Weakly supervised positioning and pre-trained classification networks can generate lesion activation maps of GIM images, and the prediction confidence of the pre-trained network is used to weight the lesion activation maps, thereby achieving accurate weighting of lesion locations. These two aspects work together to improve the accuracy of grading the severity of gastrointestinal metaplasia. In clinical applications, it not only reduces the burden on endoscopists, but also reduces their missed diagnosis rate. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.

[0054] Figure 1 It is a network structure diagram of a gastrointestinal metaplasia image classification network model based on multi-feature fusion and weakly supervised positioning in an embodiment of the present invention;

[0055] Figure 2 is a structural diagram of a pre-training network and a lesion activation map generation module in an embodiment of the present invention;

[0056] Figure 3 It is a structural diagram of feature fusion in the image classification module in an embodiment of the present invention. DETAILED DESCRIPTION

[0057] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.

[0058] It should be noted that the following detailed descriptions are all illustrative and intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.

[0059] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprising" and / or "including" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.

[0060] In the absence of conflict, the embodiments of the present invention and the features of the embodiments may be combined with each other.

[0061] Embodiment 1

[0062] like Figure 1 As shown, this embodiment provides a gastrointestinal metaplasia image classification system based on multi-feature fusion and weakly supervised positioning, including:

[0063] An image preprocessing module is configured to obtain an original gastrointestinal endoscopic image and perform preprocessing to obtain a gastrointestinal endoscopic image;

[0064] The lesion activation map generation module is configured to convert the RGB image of the gastrointestinal endoscope image into an HSV image and an LBP image, input the RGB image into a pre-trained classification network, convert it again into an HSV image and an LBP image, extract features respectively and then fuse them to obtain fusion features, perform classification according to the fusion features to obtain a predicted classification result; generate a lesion activation map of the RGB image according to the feature map extracted from the RGB image in the pre-trained classification network and the predicted classification result;

[0065] An adaptive weighting module is configured to adaptively weight the lesion activation map according to the predicted classification probability of the pre-trained classification network, and fuse the weighted lesion activation map with the corresponding RGB image pixel by pixel to obtain a weighted fused image;

[0066] A weighted feature extraction module is configured to extract low-level detail features of the HSV image and the LBP image through a residual network, and to extract high-level semantic features of the weighted fusion image through a residual network;

[0067] The image classification module is configured to use the multi-head self-attention mechanism and the channel attention mechanism to perform weighted fusion on the extracted underlying detail features of the HSV image, the underlying detail features of the LBP image, and the high-level semantic features of the weighted fusion image to obtain the final fusion features, and use the final fusion features to complete the classification of gastrointestinal metaplasia images.

[0068] The pre-trained network, including the image pre-processing module in the system, the HSV image and LBP image conversion operations in the lesion activation map generation module, the weighted feature extraction module and the image classification module, is pre-trained with a certain amount of data to predict the category of the input image. It should be noted that the weighted feature extraction module in the pre-trained network is configured to extract the underlying detail features of the HSV image and the LBP image through the residual network, and to extract the high-level semantic features of the RGB image through the residual network.

[0069] It should be noted here that the above-mentioned image preprocessing module corresponds to step S101 in the following system working method, the lesion activation map generation module corresponds to step S102 in the following system working method, the HSV image and LBP image conversion operations correspond to steps S1021 and S1022 in the following system working method, respectively, the lesion adaptive weighting module corresponds to step S103 in the following system working method, the weighted feature extraction module corresponds to step S104 in the following system working method, the operation of extracting high-level semantic features of RGB images in the pre-trained network is the same as step S1043 in the following system working method, and the image classification module corresponds to step S105 in the following system working method. The examples and application scenarios implemented by the above-mentioned modules and corresponding steps are the same, but are not limited to the contents disclosed in the following system working method. It should be noted that the above-mentioned modules as part of the system can be executed in a computer system such as a set of computer executable instructions.

[0070] The working method of the gastrointestinal metaplasia image classification system based on multi-feature fusion and weakly supervised positioning is as follows:

[0071] Step S101: pre-processing the acquired endoscopic image, including eliminating dark areas and mirror reflection areas in the endoscopic image, scaling the image size to 224×224, and data amplification.

[0072] Specifically, the brightness and saturation of the dark area and the reflection area of ​​all images in the HSV color space are counted respectively, and the brightness threshold is set to 60 and the saturation threshold is set to 50 according to the statistical results. The pixels in the dark area and the reflection area are set to zero according to the threshold to complete the image filtering. Among them, the dark area is caused by the low brightness of the auxiliary light source and the inaccurate illumination position when the camera is working. The display of this area in the image is relatively dark and cannot provide accurate identification information; the reflection area is the specular reflection produced by the residual liquid in the digestive tract. This area is very bright and can easily interfere with the doctor's accurate judgment. After that, all images are uniformly scaled to 224×224 resolution, and random horizontal flipping and random rotation are used for data amplification.

[0073] Step S102: Convert the preprocessed RGB image into an HSV image and an LBP image, and input the RGB image into a pretrained classification network. According to the feature map of the last convolutional layer in the pretrained network and the predicted classification result, generate a lesion activation map of the RGB image through Grad-CAM++.

[0074] Specifically, the following detailed steps are included:

[0075] S1021: Convert the preprocessed endoscopic image from the RGB color space to the HSV color space, where HSV represents hue (H), saturation (S), and value (V). The conversion formula is as follows:

[0076] (1);

[0077] (2);

[0078] (3);

[0079] Among them, R, G, B are the color values ​​of red (R), green (G), and blue (B) respectively; Max is the maximum value of R, G, and B, and min is the minimum value; H is between [0,360], S is between [0,100], and V is between [0,max].

[0080] S1022: First, convert the RGB image into a grayscale image, and then in a 3×3 window, take the central pixel of the window as the threshold, and compare the grayscale values ​​of the adjacent 8 pixels with it. If the surrounding pixel value is greater than the central pixel value, the position of the pixel is marked as 1, otherwise it is 0. This can generate an 8-bit binary number, which is converted into a decimal number to obtain the LBP code, and its conversion formula is as follows:

[0081] (4);

[0082] in, is the coordinate of the center pixel of the neighborhood window, and the pixel value is , is the pixel value of the 3 × 3 neighborhood window, and p is the Pixels, is a symbolic function:

[0083] (5).

[0084] S1023: Figure 2 As shown in the figure, the preprocessed RGB image of size 224×224 is input into the pre-trained network, and the predicted category score is obtained after HSV image conversion, LBP image conversion, feature extraction and image classification. . Feature extraction corresponds to step S104 in the following system working method, and image classification corresponds to step S105 in the following system working method. Then, the gradient of the prediction result with respect to the output of the last convolutional layer of the pre-trained network is calculated, and an additional weight is added The elements on the gradient are weighted as follows:

[0085] (6);

[0086] (7);

[0087] in, is the target category, that is, the lesion level, Represents the feature map channels, represents partial derivatives, and are the element positions on the feature map of this layer, Represents the output feature map of the last convolutional layer Channel feature map of the position, right The gradient is ; Represents the output feature map of the last convolutional layer The channel feature map of the position. Then the weighted weights are activated And the corresponding channel feature map Multiply to achieve the weighting of the channel feature map to obtain the weighted feature map, and sum the weighted feature maps of all channels to obtain the fused feature map, and perform the ReLU operation on the fused feature map to obtain the value of each position in the initial lesion activation map , as shown below:

[0088] (8);

[0089] Finally, the initial lesion activation map After upsampling and restoring to the size of the RGB image, the lesion activation map LAM is obtained.

[0090] Step S103: Adaptively weight the lesion activation map using the prediction probability of the pre-trained network, and fuse the weighted lesion activation map with the corresponding RGB image pixel by pixel.

[0091] Specifically, Figure 1 As shown in the figure, the prediction probability of each category of the generated network is first normalized to the range of [0,1] using the softmax function.

[0092] (9);

[0093] Among them, x represents the input image and Net(.) represents the LAM generation network.

[0094] Then, the Lesion Activation Map (LAM) is weighted according to the predicted category and the normalized predicted probability as follows:

[0095] (10);

[0096] Among them, P[c] represents the normalized probability of category c, c=0,1,2; * represents the multiplication of each value in LAM with the probability, Represents the weighted lesion activation map.

[0097] The weighted LAM is multiplied element-wise with the preprocessed RGB image to obtain the LAM-fused RGB image.

[0098] Step S104: extracting low-level detail features of the HSV image and the LBP image through the bottom feature extraction layer in the ResNet50 network, and extracting high-level semantic features of the RGB image fused with the weighted lesion activation map through all feature extraction layers in the ResNet50 network;

[0099] Specifically, Figure 2 As shown in the figure, the images converted to the HSV color space are batched through the convolution layer, pooling layer, and the residual block of the first stage in the ResNet50 network to obtain a feature vector with a shape of [64, 256, 56, 56] , where 64 is the batch size, 256 is the number of channels, and 56 56 is the feature size. The images converted to local binary patterns are batched and sequentially passed through the convolutional layer, pooling layer, and the residual block of the first stage in the ResNet50 network to obtain a feature vector l with a shape of [64, 256, 56, 56], where 64 is the batch size, 256 is the number of channels, and 56 is the number of channels. 56 is the feature size. The RGB image fused with LAM is passed through the convolution layer, pooling layer and residual block in the ResNet50 network in batches to obtain a feature vector w with a shape of [64, 2048, 7, 7], where 64 is the batch size, 2048 is the number of channels, and 7 is the number of channels. 7 is the characteristic size. The detailed steps include:

[0100] S1041: Input is HSV image , where B represents the number of batches, D represents the number of channels, W represents the width, H represents the height, and the initial shape of h is [64,3,224,224]. h first passes through a convolution kernel of size 7 7, the convolution layer with a stride of 2 and an output channel number of 64, the shape becomes [64, 64, 112, 112], and then passes through the maximum pooling layer with a kernel size of 3 and a stride of 2, the shape becomes [64, 64, 56, 56], and finally passes through the three residual blocks of the first stage, each of which consists of three convolutional layers, to obtain the feature h with a shape of [64, 256, 56, 56].

[0101] S1042: Input is LBP image , the initial shape is [64,3,224,224]. lFirst, the convolution kernel size is 7 7, the convolution layer with a stride of 2 and an output channel number of 64, the shape becomes [64, 64, 112, 112], and then passes through the maximum pooling layer with a kernel size of 3 and a stride of 2, the shape becomes [64, 64, 56, 56], and finally passes through the three residual blocks of the first stage, each of which consists of three convolutional layers, to obtain the feature l with a shape of [64, 256, 56, 56].

[0102] S1043: Input is RGB image fused with LAM , the initial shape is [64,3,224,224]. w first passes through the convolution kernel size of 7 7, the convolution layer with a stride of 2 and an output channel number of 64, the shape becomes [64, 64, 112, 112], and then passes through a maximum pooling layer with a kernel size of 3 and a stride of 2, the shape becomes [64, 64, 56, 56], and then passes through the three residual blocks in the first stage, each residual block consists of three convolutional layers, the shape becomes [64, 256, 56, 56], after the four residual blocks in the second stage, the shape becomes [64, 512, 28, 28], after the six residual blocks in the third stage, the shape becomes [64, 1024, 14, 14], and finally after the three residual blocks in the fourth stage, the feature w with a shape of [64, 2048, 7, 7] is obtained.

[0103] Step S105: Use the multi-head self-attention mechanism and the channel attention mechanism to perform weighted fusion on the extracted HSV image features, LBP image features and fused image features, and use the fused features to complete the classification.

[0104] Specifically, Figure 3 As shown in the figure, the HSV image feature h and the local binary pattern image feature l are respectively input into two multi-head self-attention mechanisms for weighting, and then they are all subjected to the global average pooling operation with the RGB image feature w of the fusion LAM and spliced ​​in the channel dimension. The spliced ​​features are channel-weighted by the channel attention mechanism. Finally, the fused features are flattened, randomly discarded, and fully connected to obtain the final classification result. The detailed steps include:

[0105] S1051: Input features h and l To the multi-head self-attention mechanism, represents batchsize, Indicates the number of channels, represents the sequence length, Indicates the feature size. The channels are divided into Head, that is Through three linear transformation layers, Map each head into a query (Q), key (K), and value (V) vector, and then use Q and K to calculate the attention score:

[0106] (11);

[0107] in, represents matrix multiplication, Represents transposition. Through the softmax function, we can get the attention weight, and use the attention weight to Perform weighted summation to obtain the output of the multi-head self-attention mechanism, and finally recombine the output to obtain the output feature tensor .

[0108] The RGB image features w fused with LAM are simultaneously input into three global average pooling layers, and the feature sizes are scaled to , and concatenate them in the channel dimension to obtain the feature vector c. The feature vector c first passes through the first fully connected layer for dimensionality reduction, and then passes through The function is activated, and then restored to the size before passing through the first fully connected layer through the second fully connected layer. Finally, it is limited to between 0 and 1 through the Sigmoid activation function to obtain the weight , indicating the importance of the corresponding channel. The formula is as follows:

[0109] (12);

[0110] in, and Represent two fully connected layers, represents the activation function, represents the Sigmoid activation function, Represents the learned weight. Finally, the learned weight is multiplied by the input feature , and get the output c'.

[0111] S1052: The fused feature c' with a shape of [64,2560,1,1] is flattened to [64,2560]. Then the random dropout method is used to make some weights zero to prevent the model from overfitting. The flattened feature is finally passed through a fully connected layer with an output channel of 3 to output the predicted probabilities of the three categories.

[0112] In order to speed up the convergence of the network, the weights and biases of each layer of the above network are randomized to a normal distribution with a mean of 0 and a variance of ,in is the number of upper layer features. The loss function is defined using the cross entropy function. The Adam optimizer is used to adjust the connection weights and biases. The maximum number of iterations of the pre-trained network is set to 30, the maximum number of iterations of the final classification network is set to 50, and the loss threshold is set to 0.0001.

[0113] Although the above describes the specific implementation mode of the present invention in conjunction with the accompanying drawings, it is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art on the basis of the technical solution of the present invention without creative work are still within the scope of protection of the present invention.

Claims

1. A gastrointestinal metaplasia image classification system based on multi-feature fusion and weakly supervised positioning, characterized by: include: An image preprocessing module is configured to obtain an original gastrointestinal endoscopic image and perform preprocessing to obtain a gastrointestinal endoscopic image; The lesion activation map generation module is configured to convert the RGB image of the gastrointestinal endoscopy image into an HSV image and an LBP image, input the RGB image into a pre-trained classification network, convert it again into an HSV image and an LBP image, extract features respectively and then fuse them to obtain fusion features, and classify according to the fusion features to obtain a predicted classification result; Generate a lesion activation map of the RGB image based on the feature map extracted from the RGB image in the pre-trained classification network and the predicted classification result; the lesion activation map of the RGB image is generated based on the feature map extracted from the RGB image in the pre-trained classification network and the predicted classification result, specifically: Calculate the gradient of the prediction result with respect to the output of the last convolutional layer of the pre-trained network, and determine the activation weight according to the gradient and the prediction result. The calculation of the prediction result with respect to the gradient of the output of the last convolutional layer of the pre-trained network, and determining the activation weight according to the gradient and the prediction result, is specifically: ; ; in, is the target category, that is, the lesion level, is the predicted class score; Represents the feature map channels, represents partial derivatives, and are the element positions on the output feature map of the last convolutional layer. Represents the output feature map of the last convolutional layer Channel feature map of the position, Represents the output feature map of the last convolutional layer Channel feature map of the position, is the additional weight, is the activation weight; Multiply the activation weights by the channel feature map output by the last convolutional layer to obtain the fused feature map; Perform ReLU operation on the fused feature map to obtain the initial lesion activation map; The initial lesion activation map is restored to the size of the RGB image through upsampling to obtain the lesion activation map; The adaptive weighting module is configured to adaptively weight the lesion activation map according to the predicted classification probability of the pre-trained classification network, and fuse the weighted lesion activation map with the corresponding RGB image pixel by pixel to obtain a weighted fused image. The adaptive weighting of the lesion activation map according to the predicted classification probability of the pre-trained classification network, and the pixel-by-pixel fusion of the weighted lesion activation map with the corresponding RGB image to obtain a weighted fused image is specifically: Normalize the predicted classification probability of the pre-trained classification network to [0,1]; For the lesion activation map predicted by the pre-trained classification network as level 0, each element of the lesion activation map is multiplied by 1 minus the predicted classification probability. For the lesion activation map predicted by the pre-trained classification network as level 1 and level 2, each element of the lesion activation map is multiplied by the corresponding predicted probability to complete the weighting of the lesion activation map. The specific formula is: ; Among them, P[c] represents the normalized probability of category c, c=0,1,2; * represents the multiplication of each value in LAM with the probability, represents the weighted lesion activation map, LAM represents the lesion activation map; The weighted lesion activation map is multiplied element-by-element with the RGB image of the gastrointestinal endoscopy image to obtain a weighted fusion image; A weighted feature extraction module is configured to extract low-level detail features of the HSV image and the LBP image through a residual network, and to extract high-level semantic features of the weighted fusion image through a residual network; wherein the low-level detail features of the HSV image and the LBP image are extracted through the low-level feature extraction layer in the ResNet50 network, and the high-level semantic features of the RGB image fused with the weighted lesion activation map are extracted through all feature extraction layers in the ResNet50 network; The image classification module is configured to use a multi-head self-attention mechanism and a channel attention mechanism to weightedly fuse the extracted HSV image bottom-level detail features, the LBP image bottom-level detail features and the high-level semantic features of the weighted fusion image to obtain a final fusion image, and use the final fusion image to complete the gastrointestinal metaplasia image classification; the multi-head self-attention mechanism and the channel attention mechanism are used to weightedly fuse the extracted HSV image bottom-level detail features, the LBP image bottom-level detail features and the high-level semantic features of the weighted fusion image, specifically: The multi-head self-attention mechanism is used to perform weighted summation on the extracted HSV image underlying detail features and LBP image underlying detail features to obtain the output of the multi-head self-attention mechanism; The output of the multi-head self-attention mechanism and the high-level semantic features of the weighted fusion image are both subjected to a global average pooling operation and spliced ​​in the channel dimension. The spliced ​​features are channel-weighted by the channel attention mechanism to obtain the final fusion features.

2. The gastrointestinal metaplasia image classification system based on multi-feature fusion and weakly supervised positioning according to claim 1, characterized in that: The original gastrointestinal endoscopic image is obtained and preprocessed to obtain the gastrointestinal endoscopic image, specifically: Count the brightness and saturation of dark and reflective areas of all original gastrointestinal endoscopy images in the HSV color space; The pixels in the dark area and the reflection area are set to zero according to the threshold value to complete the image filtering; All filtered images were uniformly scaled to a resolution of 224 × 224, and random horizontal flipping and random rotation were used for data augmentation to obtain gastrointestinal endoscopic images.

3. The gastrointestinal metaplasia image classification system based on multi-feature fusion and weakly supervised positioning according to claim 1, characterized in that: The underlying detail features of the HSV image and the LBP image are extracted through the residual network, specifically: Using the residual network ResNet50, the HSV image passes through the convolution layer, the maximum pooling layer, and finally the three residual blocks in the first stage. Each residual block consists of three convolution layers to obtain an HSV image feature map with a shape of [64, 256, 56, 56]; Using the residual network ResNet50, the LBP image passes through the convolution layer, the maximum pooling layer, and finally the three residual blocks in the first stage. Each residual block consists of three convolution layers to obtain an LBP image feature map with a shape of [64, 256, 56, 56].

4. The gastrointestinal metaplasia image classification system based on multi-feature fusion and weakly supervised positioning according to claim 1, characterized in that: The high-level semantic features of the weighted fusion image are extracted through the residual network, specifically: Using the residual network ResNet50, the weighted fused image passes through the convolution layer, the maximum pooling layer, and then through the three residual blocks in the first stage. Each residual block consists of three convolution layers, and the shape becomes [64, 256, 56, 56]. After the four residual blocks in the second stage, the shape becomes [64, 512, 28, 28]. After the six residual blocks in the third stage, the shape becomes [64, 1024, 14, 14]. Finally, after the three residual blocks in the fourth stage, a weighted fused image feature map with a shape of [64, 2048, 7, 7] is obtained.

5. The gastrointestinal metaplasia image classification system based on multi-feature fusion and weakly supervised positioning according to claim 1, characterized in that: The concatenated features are weighted by the channel attention mechanism to obtain the final fusion features, which are: The concatenated features are reduced in dimension by the first fully connected layer, and then Function activation; The activated features are restored to the size of the concatenated features through the second fully connected layer, and then the channel attention weight is obtained through the Sigmoid activation function; Multiply the learned channel attention weight by the concatenated features to obtain the final fused features.

6. The gastrointestinal metaplasia image classification system based on multi-feature fusion and weakly supervised positioning according to claim 1, characterized in that: The final fusion features are used to complete the classification of gastrointestinal metaplasia images, specifically: The final fusion feature is flattened and its shape becomes [64,2560]; Use random dropout to make some weights zero to prevent model overfitting; The flattened features finally pass through a fully connected layer with an output channel of 3 to output the predicted probabilities of the three categories.