A tumor classification method based on convolutional neural networks
By constructing a feature extraction module, a magnification adaptation module, and an adaptive attention module, the problem of inaccurate tumor image classification under different magnification levels in convolutional neural networks is solved, thereby improving the accuracy and adaptability of tumor image classification.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- AFFILIATED HOSPITAL OF JIANGSU UNIV
- Filing Date
- 2025-04-07
- Publication Date
- 2026-08-04
AI Technical Summary
Existing convolutional neural networks are inaccurate in tumor image classification due to different magnification levels, which affects diagnostic accuracy.
We construct a feature extraction module, a magnification adaptation module, and an adaptive attention module. Through multi-scale feature extraction and attention mechanisms, we enhance the adaptability to different magnifications and improve the accuracy of tumor image classification.
It improves the accuracy of tumor image classification, enhances adaptability to different magnifications, and improves classification results.
Smart Images

Figure CN120355986B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of tumor detection, and more specifically to a tumor classification method based on convolutional neural networks. Background Technology
[0002] In medical diagnosis, analyzing tumor-related images (such as pathological slide images and radiographic images) to determine whether a tumor is positive or negative is of vital importance for disease diagnosis and treatment.
[0003] With the rapid development of artificial intelligence technology, convolutional neural networks (CNNs) have been widely used in the field of medical image classification. However, currently, when using CNNs for tumor image classification, there is a problem of inaccurate classification due to varying image magnification. Tumor images acquired by different medical institutions, different imaging devices, and even the same device under different operating settings often have different magnifications. When the magnification is low, some subtle features in the image may not be clearly displayed, making it difficult for the CNN model to capture key information, thus affecting classification accuracy. Conversely, when the magnification is too high, the image may exhibit increased noise and blurred edges, similarly interfering with the accurate identification of tumor features by the CNN model. This technical problem limits the widespread application of CNNs in tumor image classification and further improvement of diagnostic accuracy.
[0004] Therefore, providing a tumor classification method based on convolutional neural networks to accurately classify tumor images at different magnifications has become an urgent technical problem to be solved. Summary of the Invention
[0005] In view of the above problems, this application is proposed to provide a tumor classification method based on convolutional neural networks to improve the classification accuracy of tumor images at different magnifications, specifically including steps S10 to S30:
[0006] Step S10: Construct a feature extraction module to extract features from the tumor image to be identified and generate a tumor feature map;
[0007] Step S30: Construct a magnification adaptive module to extract multi-layer detail features from the tumor feature map, where each layer of detail features includes multi-scale features to generate an output feature map and enhance the adaptability to different magnifications.
[0008] Step S50: Construct a classification module to identify tumors based on the output feature map and generate classification results for the tumor image to be identified.
[0009] Preferably, step S30 includes:
[0010] Step S31: Construct N first convolutional channels, perform multi-scale feature extraction on the tumor feature map, and generate N first adaptive feature maps. In each first convolutional channel, the convolutional kernel size is the same, but the convolutional weights and convolutional biases are different, and N is greater than or equal to 2.
[0011] Step S32: Construct M second convolution channels, extract detailed features from N first adaptive feature maps, and generate M second adaptive feature maps. In each second convolution channel, the convolution kernel size is the same, but the convolution weights and convolution biases are different, and M is greater than or equal to 2.
[0012] Step S33: Construct a pooling layer and a fully connected layer, and perform pooling and fully connected processing on N first adaptive feature maps and M second adaptive feature maps to generate output feature maps.
[0013] Preferably, after step S30 and before step S50, the method further includes:
[0014] Step S40: Construct an adaptive attention module by multiplying the output feature map by channel attention weights and spatial attention weights to generate an attention feature map.
[0015] Preferably, S40 includes:
[0016] Step S41: Construct a channel attention weight generation module, receive the output feature map, and generate channel attention weights;
[0017] Step S42: Construct the first multiplication module, multiply the output feature map and the channel attention weights element by element to obtain the intermediate feature map;
[0018] Step S43: Construct a spatial attention weight generation module, receive intermediate feature maps, and generate spatial attention weights;
[0019] Step S44: Construct the second multiplication module, multiply the intermediate feature map and the spatial attention weights element by element to obtain the attention feature map.
[0020] Preferably, step S41 includes:
[0021] Step S411: Perform average pooling and max pooling on the output feature map to generate average pooling feature map and max pooling feature map respectively.
[0022] Step S412: The average pooling feature map and the max pooling feature map are concatenated and fused to obtain a fused pooling feature map.
[0023] Step S413: Perform the first convolution, normalization, GeLU activation, and second convolution on the fused pooling feature map to generate a channel feature map.
[0024] Step S414: The channel feature map is processed using the Sigmoid activation function to generate channel attention weights.
[0025] Preferably, step S43 includes:
[0026] Step S431: Perform third convolution processing, normalization processing, GeLU activation processing, and fourth convolution processing on the intermediate feature map in sequence to generate the first spatial feature map, wherein the third convolution processing and the fourth convolution processing use 1×1 and 1×1 convolution kernels respectively.
[0027] Step S432: Perform fifth convolution processing, normalization processing, GeLU activation processing, and sixth convolution processing on the intermediate feature map in sequence to generate the second spatial feature map. The fifth and sixth convolution processing use 3×3 and 1×1 convolution kernels, respectively.
[0028] Step S433: Construct the third multiplication module, multiply the first spatial feature map and the second spatial feature map element by element to generate a fused spatial feature map;
[0029] Step S434: The fused spatial feature map is processed using the Sigmoid activation function to generate spatial attention weights.
[0030] Preferably, the method further includes:
[0031] Step S60: Construct an image enhancement module to perform feature enhancement processing on the tumor image to be identified, and obtain an enhanced tumor image;
[0032] Step S70: Construct an enhanced image feature extraction module, an enhanced image magnification factor adaptive module, an enhanced image adaptive attention module, and an enhanced image classification module respectively; perform feature extraction and multi-layer detail feature extraction on the enhanced tumor image; perform enhanced image tumor recognition; and generate enhanced classification results for the tumor image to be identified.
[0033] Step S80: Construct a fusion module to fuse the classification results of the tumor image to be identified based on the enhanced classification results of the tumor image to be identified, and obtain the final classification result of the tumor image to be identified.
[0034] Preferably, the enhanced image feature extraction module, the enhanced image magnification adaptive module, the enhanced image classification module, and the enhanced image adaptive attention module have the same structure and function as the feature extraction module, the magnification adaptive module, the classification module, and the adaptive attention module.
[0035] Preferably, the final classification result of the tumor image to be identified is:
[0036] score=δ1p1+δ2p2
[0037] in, i equals 1 or 2, δ1 is the weight corresponding to the classification result of the tumor image to be identified, δ2 is the weight corresponding to the enhanced classification result of the tumor image to be identified, p1 is the classification result of the tumor image to be identified, p2 is the enhanced classification result of the tumor image to be identified, w1 is the classification result during the pre-training stage, w2 is the enhanced classification result during the pre-training stage, w * These are the classification calibration values used during the pre-training phase.
[0038] The tumor classification method based on convolutional neural networks provided in this application utilizes a magnification adaptation module to collect important information from tumor images at multiple scales and in multiple layers of context, thereby better understanding the content of tumor images, enhancing the adaptability to different magnification levels, and improving the accuracy of tumor image classification.
[0039] In another aspect, this application also constructs a magnification adaptation module. First, by utilizing different convolution weights and convolution biases in the first convolution channel, multi-scale feature extraction is performed on the tumor feature map to adapt to the detailed features under different magnification levels. Simultaneously, by utilizing the second convolution channel, two layers of detailed feature extraction are constructed to further prevent the loss and distortion of detailed features under different magnification levels. Second, pooling processing is used to more easily collect detailed information across different spatial dimensions, and fully connected processing is used to integrate the extracted detailed features from each layer to combine features at different levels of abstraction. Ultimately, this improves the ability to distinguish tumor types under different magnification levels, enhances the adaptability to different magnification levels, and improves the accuracy of tumor image classification.
[0040] In another aspect, this application also constructs an adaptive attention module that selectively focuses on key features and ignores irrelevant features, thereby dynamically optimizing the output feature map and generating an attention feature map, further improving the accuracy of tumor image classification at different magnifications.
[0041] In another aspect, this application also constructs an image enhancement module to generate enhanced classification results of the tumor image to be identified, which are then fused with the classification results of the tumor image to be identified to further improve the accuracy of tumor image classification at different magnifications. Attached Figure Description
[0042] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0043] Figure 1 A flowchart illustrating the execution of a tumor classification method provided in an embodiment of this application;
[0044] Figure 2 A detailed schematic diagram of the magnification adaptive module provided in one embodiment of this application;
[0045] Figure 3 A flowchart illustrating the execution of a tumor classification method provided in an embodiment of this application;
[0046] Figure 4 The execution flowchart of the adaptive attention module provided in one embodiment of this application;
[0047] Figure 5 A detailed structural diagram of an adaptive attention module provided in an embodiment of this application;
[0048] Figure 6 This is a flowchart illustrating the execution of enhanced image classification fusion according to an embodiment of this application. Detailed Implementation
[0049] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0050] The terminology used in the embodiments of this application is for the purpose of describing particular embodiments only and is not intended to limit the application. The singular forms “a,” “said,” and “the” used in the embodiments of this application and the appended claims are also intended to include the plural forms, unless the context clearly indicates otherwise. “Multiple” generally includes at least two, but does not exclude the inclusion of at least one.
[0051] See Figure 1 In one embodiment, this application provides a tumor classification method based on a convolutional neural network, comprising:
[0052] Step S10: Construct a feature extraction module to extract features from the tumor image to be identified and generate a tumor feature map.
[0053] Specifically, this feature extraction module is used to extract features from the input tumor image. This module contains multiple convolutional layers, activation function layers, and pooling layers. Convolutional layers extract local features of the image, activation function layers introduce non-linearity to enhance the model's expressive power, and pooling layers reduce the dimensionality of the feature map, thus reducing computational cost.
[0054] Step S30: Construct a magnification adaptive module to extract multi-layer detail features from the tumor feature map. Each layer of detail features includes multi-scale features to generate an output feature map, thereby enhancing the adaptability to different magnifications.
[0055] The magnification adaptation module can extract complex multi-scale features from the input image, obtain detailed features at each layer, and adopt a hierarchical structure to better identify small details and textures in tumor images. This improves the ability to distinguish tumor types at different magnifications, enhances the adaptability to different magnifications, and improves the accuracy of tumor image classification.
[0056] Step S50: Construct a classification module to identify tumors based on the output feature map and generate classification results for the tumor image to be identified.
[0057] This application utilizes an adaptive magnification module to collect important information from tumor images at multiple scales and in multiple layers of context, thereby better understanding the content of tumor images, enhancing the adaptability to different magnifications, and improving the accuracy of tumor image classification.
[0058] Specifically, in one embodiment of this application, step S30 involves constructing a magnification adaptive module to extract multi-layer detail features from the tumor feature map, wherein each layer of detail features includes multi-scale features to generate an output feature map, such as... Figure 2 As shown, it includes:
[0059] Step S31: Construct N first convolutional channels to perform multi-scale feature extraction on the tumor feature map, generating N first adaptive feature maps. Each first convolutional channel has the same kernel size but different convolutional weights and biases. N is greater than or equal to 2.
[0060] Z i =f(XW i +b i )
[0061] Z i Let f be the first adaptive feature map of the i-th generation, f be the activation function for each first convolutional channel, X be the tumor feature map, and W be the activation function for each first convolutional channel. i The convolution weights for each first convolutional channel, b i The convolution bias for each first convolution channel.
[0062] Step S32: Construct M second convolutional channels, extract detailed features from N first adaptive feature maps, and generate M second adaptive feature maps. Each second convolutional channel has the same kernel size, but different convolutional weights and biases. M is greater than or equal to 2.
[0063] H j =δ(ZW j +b j )
[0064] H j Let Z be the j-th second adaptive feature map, δ be the activation function for each second convolutional channel, Z be the N first adaptive feature maps, and W be the W-th feature map. i The convolution weights for each first convolutional channel, b i The convolution bias for each first convolution channel.
[0065] Step S33: Construct pooling layers and fully connected layers to perform pooling and fully connected processing on N first adaptive feature maps and M second adaptive feature maps to generate output feature maps, where:
[0066] Y = FC(P(Z,H))
[0067] Y represents the output feature map, FC represents fully connected processing, P represents pooling processing, and H represents M second adaptive feature maps.
[0068] In this application, firstly, multi-scale feature extraction is performed on the tumor feature map using N first convolutional channels with different convolutional weights and biases to adapt to the detailed features under different magnification levels. Simultaneously, two layers of detailed feature extraction are constructed using M second convolutional channels to further prevent the loss and distortion of detailed features under different magnification levels. Secondly, pooling is used to more easily collect detailed information across different spatial dimensions, and fully connected processing is used to integrate the extracted detailed features from each layer to combine features at different levels of abstraction. Ultimately, this improves the ability to distinguish tumor types under different magnification levels, enhances the adaptability to different magnification levels, and improves the accuracy of tumor image classification.
[0069] Preferably, in another embodiment of this application, such as Figure 3 After step S30 and before step S50, the tumor classification method based on convolutional neural networks provided in this application further includes:
[0070] Step S40: Construct an adaptive attention module by multiplying the output feature map by channel attention weights and spatial attention weights to generate an attention feature map.
[0071] Further, in step S50, a classification module is constructed to perform tumor identification based on the output feature map, generating tumor image classification results, including:
[0072] A classification module is constructed to identify tumors using attention feature maps and generate tumor image classification results.
[0073] In this application, the adaptive attention module selectively focuses on key features and ignores irrelevant features, thereby dynamically optimizing the output feature map and generating an attention feature map. The classification module uses the attention feature map for tumor identification, generating tumor image classification results, further improving the accuracy of tumor image classification at different magnifications.
[0074] Specifically, such as Figure 4 As shown, step S40 involves constructing an adaptive attention module, multiplying the output feature map by channel attention weights and spatial attention weights to generate an attention feature map, including:
[0075] Step S41: Construct a channel attention weight generation module, receive the output feature map, and generate channel attention weights.
[0076] Step S42: Construct the first multiplication module, which multiplies the output feature map and the channel attention weights element by element to obtain the intermediate feature map.
[0077] Step S43: Construct a spatial attention weight generation module, receive intermediate feature maps, and generate spatial attention weights.
[0078] Step S44: Construct the second multiplication module, multiply the intermediate feature map and the spatial attention weights element by element to obtain the attention feature map.
[0079] In this application, the adaptive attention module consists of two stages: channel attention and spatial attention. The channel attention mechanism analyzes the relative importance of different feature types across various channels and adjusts their influence through channel attention weights, assigning higher weights to channels that capture key classification information. The spatial attention mechanism identifies the most useful spatial regions among the input features and generates a spatial attention weight to adjust the input features, highlighting influential regions and suppressing less relevant regions. Therefore, this adaptive attention module can further improve the accuracy of tumor image classification at different magnifications.
[0080] Furthermore, such as Figure 5 As shown, step S41 involves constructing a channel attention weight generation module, receiving the output feature map, and generating channel attention weights, including:
[0081] Step S411: Perform average pooling and max pooling on the output feature map to generate average pooling feature map and max pooling feature map respectively.
[0082] Step S412: The average pooling feature map and the max pooling feature map are spliced and fused to obtain the fused pooling feature map.
[0083] Step S413: Perform first convolution, normalization, GeLU activation, and second convolution on the fused pooling feature map to generate a channel feature map.
[0084] Step S414: The channel feature map is processed using the Sigmoid activation function to generate channel attention weights.
[0085] In the channel attention weight generation module, the first convolutional processing uses a 1×1 kernel to seamlessly fuse the average pooling feature map and the max pooling feature map, integrating the information from both. GeLU activation reduces the spatial resolution of the features and makes the output features more non-linear, thereby improving the feature representation. Finally, the second convolutional processing uses a 1×1 kernel to reduce dimensionality and simplify computation.
[0086] Further, in step S43, a spatial attention weight generation module is constructed to receive intermediate feature maps and generate spatial attention weights, including:
[0087] Step S431: Perform third convolution processing, normalization processing, GeLU activation processing, and fourth convolution processing on the intermediate feature map in sequence to generate the first spatial feature map. The third and fourth convolution processing use 1×1 and 1×1 convolution kernels, respectively.
[0088] Step S432: Perform fifth convolution, normalization, GeLU activation, and sixth convolution on the intermediate feature map in sequence to generate the second spatial feature map. The fifth and sixth convolution processes use 3×3 and 1×1 convolution kernels, respectively.
[0089] Step S433: Construct the third multiplication module, multiply the first spatial feature map and the second spatial feature map element by element to generate a fused spatial feature map.
[0090] Step S434: The fused spatial feature map is processed using the Sigmoid activation function to generate spatial attention weights.
[0091] In the spatial attention weight generation module, the combination of 1×1 and 3×3 convolutions enhances feature diversity, resulting in richer and more comprehensive representations. In this way, the spatial attention weight generation module becomes more sensitive to spatial structure and relationships, highlighting influential regions and suppressing less relevant ones, adjusting input features to emphasize important spatial locations and suppress less relevant areas.
[0092] Preferably, in another embodiment of this application, the tumor classification method based on convolutional neural networks provided in this application further includes:
[0093] Step S60: Construct an image enhancement module to perform feature enhancement processing on the tumor image to be identified, and obtain an enhanced tumor image;
[0094] By performing feature enhancement processing on tumor images to obtain enhanced tumor images, the tumor region can be highlighted, improving classification performance. Specifically, a sharpening filter is applied to the tumor image, and then the pixel values are adjusted to increase image contrast, making the tumor region more prominent and obtaining an enhanced tumor image.
[0095] In step S70, an enhanced image feature extraction module, an enhanced image magnification adaptive module, and an enhanced image classification module are constructed respectively to extract features and multi-layer detail features from the enhanced tumor image, and to perform enhanced image tumor recognition to generate enhanced classification results of the tumor image to be identified.
[0096] Furthermore, after constructing the image magnification adaptation module and before constructing the image classification module, an image adaptive attention module is also constructed to generate an image attention feature map.
[0097] Among them, the enhanced image feature extraction module, the enhanced image magnification adaptive module, the enhanced image classification module, and the enhanced image adaptive attention module have the same structure and function as the aforementioned feature extraction module, magnification adaptive module, classification module, and adaptive attention module.
[0098] Step S80: Construct a fusion module. Based on the enhanced classification results of the tumor image to be identified, fuse the aforementioned classification results of the tumor image to be identified to obtain the final classification result of the tumor image to be identified. Specifically, the final classification result of the tumor image to be identified is:
[0099] score=δ1p1+δ2p2
[0100] in, i equals 1 or 2, δ1 is the weight corresponding to the classification result of the tumor image to be identified, δ2 is the weight corresponding to the enhanced classification result of the tumor image to be identified, p1 is the classification result of the tumor image to be identified, p2 is the enhanced classification result of the tumor image to be identified, w1 is the classification result during the pre-training stage, w2 is the enhanced classification result during the pre-training stage, w * These are the classification calibration values used during the pre-training phase.
[0101] In this embodiment, during the pre-training stage, the classification results or enhanced classification results obtained during the pre-training stage are subtracted from the classification calibration values to obtain the loss values. The loss values are then normalized using the Softmax function to obtain the corresponding weights, capturing the complex nonlinear relationships in the data so that z1+z2=1. Then, during the recognition stage, the classification results of the tumor image to be recognized and the enhanced classification results of the tumor image to be recognized are fused using the weights obtained during pre-training to further improve the accuracy of tumor image classification at different magnifications.
[0102] Preferably, according to one embodiment, a program product, such as a machine-readable medium, is provided. The machine-readable medium may have instructions (i.e., the elements implemented in software as described above), which, when executed by a machine, cause the machine to perform the above-described combinations of the various embodiments of this specification. Figures 1-6 The various operations and functions described. Specifically, a system or apparatus equipped with a readable storage medium storing software program code that implements the functions of any of the embodiments described above, and enabling the computer or processor of the system or apparatus to read and execute the instructions stored in the readable storage medium.
[0103] In this case, the program code read from the readable medium itself can perform the functions of any of the above embodiments, and therefore the machine-readable code and the readable storage medium storing the machine-readable code constitute a part of this specification.
[0104] Examples of readable storage media include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD-RW), magnetic tapes, non-volatile memory cards, and ROMs. Alternatively, program code can be downloaded from a server computer or the cloud via a communication network.
[0105] Those skilled in the art will understand that the various embodiments disclosed above can be modified and varied without departing from the spirit of the invention. Therefore, the scope of protection of this specification should be defined by the appended claims.
[0106] It should be noted that not all steps and units in the above process and system structure diagrams are mandatory; some steps or units can be omitted according to actual needs. The execution order of each step is not fixed and can be determined as needed. The device structure described in the above embodiments can be a physical structure or a logical structure. That is, some units may be implemented by the same physical client, or some units may be implemented by multiple physical clients, or they may be jointly implemented by certain components in multiple independent devices.
[0107] In the above embodiments, the hardware units or modules can be implemented mechanically or electrically. For example, a hardware unit, module, or processor may include permanent dedicated circuitry or logic (such as a dedicated processor, FPGA, or ASIC) to perform the corresponding operation. The hardware unit or processor may also include programmable logic or circuitry (such as a general-purpose processor or other programmable processor), which can be temporarily configured by software to perform the corresponding operation. The specific implementation method (mechanical, dedicated permanent circuitry, or temporarily configured circuitry) can be determined based on cost and time considerations.
[0108] The specific embodiments described above with reference to the accompanying drawings are exemplary embodiments, but do not represent all embodiments that can be implemented or fall within the scope of the claims. The term "exemplary" as used throughout this specification means "serving as an example, instance, or illustration" and does not imply that it is "preferred" or "advantageous" compared to other embodiments. Specific details are included to provide an understanding of the described techniques. However, these techniques can be practiced without these specific details. In some instances, well-known structures and apparatuses are shown in block diagram form to avoid obscuring the concepts of the described embodiments.
[0109] The foregoing description of this disclosure is provided to enable any person skilled in the art to implement or use this disclosure. Various modifications to this disclosure will be apparent to those skilled in the art, and the general principles applicable herein can be applied to other variations without departing from the scope of this disclosure. Therefore, this disclosure is not limited to the examples and designs described herein, but is consistent with the widest scope of the principles and novel features disclosed herein.
Claims
1. A tumor classification method based on a convolutional neural network, characterized by, The method includes: Step S10: Construct a feature extraction module to extract features from the tumor image to be identified and generate a tumor feature map; Step S30: Construct a magnification adaptive module to extract multi-layer detail features from the tumor feature map, where each layer of detail features includes multi-scale features to generate an output feature map and enhance the adaptability to different magnifications. Step S50: Construct a classification module to identify tumors based on the output feature map and generate classification results for the tumor image to be identified; Step S30 includes: Step S31: Construct N first convolutional channels, perform multi-scale feature extraction on the tumor feature map, and generate N first adaptive feature maps. In each first convolutional channel, the convolutional kernel size is the same, but the convolutional weights and convolutional biases are different, and N is greater than or equal to 2. Step S32: Construct M second convolution channels, extract detailed features from N first adaptive feature maps, and generate M second adaptive feature maps. In each second convolution channel, the convolution kernel size is the same, but the convolution weights and convolution biases are different, and M is greater than or equal to 2. Step S33: Construct a pooling layer and a fully connected layer to perform pooling and fully connected processing on N first adaptive feature maps and M second adaptive feature maps to generate output feature maps; After step S30 and before step S50, the method further includes: Step S40: Construct an adaptive attention module by multiplying the output feature map by channel attention weights and spatial attention weights to generate an attention feature map; Step S40 includes: Step S41: Construct a channel attention weight generation module, receive the output feature map, and generate channel attention weights; Step S42: Construct the first multiplication module, multiply the output feature map and the channel attention weights element by element to obtain the intermediate feature map; Step S43: Construct a spatial attention weight generation module, receive intermediate feature maps, and generate spatial attention weights; Step S44: Construct the second multiplication module, multiply the intermediate feature map and the spatial attention weights element by element to obtain the attention feature map; Step S43 includes: Step S431: Perform third convolution processing, normalization processing, GeLU activation processing, and fourth convolution processing on the intermediate feature map in sequence to generate the first spatial feature map, wherein the third convolution processing and the fourth convolution processing use 1×1 and 1×1 convolution kernels respectively. Step S432: Perform fifth convolution processing, normalization processing, GeLU activation processing, and sixth convolution processing on the intermediate feature map in sequence to generate the second spatial feature map. The fifth and sixth convolution processing use 3×3 and 1×1 convolution kernels, respectively. Step S433: Construct the third multiplication module, multiply the first spatial feature map and the second spatial feature map element by element to generate a fused spatial feature map; Step S434: The fused spatial feature map is processed using the Sigmoid activation function to generate spatial attention weights.
2. The method according to claim 1, characterized in that, Step S41 includes: Step S411: Perform average pooling and max pooling on the output feature map to generate average pooling feature map and max pooling feature map respectively. Step S412: The average pooling feature map and the max pooling feature map are concatenated and fused to obtain a fused pooling feature map. Step S413: Perform the first convolution, normalization, GeLU activation, and second convolution on the fused pooling feature map to generate a channel feature map. Step S414: The channel feature map is processed using the Sigmoid activation function to generate channel attention weights.
3. The method according to claim 1 or 2, characterized in that, The method further includes: Step S60: Construct an image enhancement module to perform feature enhancement processing on the tumor image to be identified, and obtain an enhanced tumor image; Step S70: Construct an enhanced image feature extraction module, an enhanced image magnification factor adaptive module, an enhanced image adaptive attention module, and an enhanced image classification module respectively; perform feature extraction and multi-layer detail feature extraction on the enhanced tumor image; perform enhanced image tumor recognition; and generate enhanced classification results for the tumor image to be identified. Step S80: Construct a fusion module to fuse the classification results of the tumor image to be identified based on the enhanced classification results of the tumor image to be identified, and obtain the final classification result of the tumor image to be identified.
4. The method according to claim 3, characterized in that, The enhanced image feature extraction module, enhanced image magnification adaptive module, enhanced image classification module, and enhanced image adaptive attention module have the same structure and function as the feature extraction module, magnification adaptive module, classification module, and adaptive attention module.
5. The method according to claim 4, characterized in that, The final classification result of the tumor image to be identified is: in, i equals 1 or 2. The weights corresponding to the classification results of the tumor image to be identified are: The weights corresponding to the enhanced classification results of the tumor image to be identified are: The classification results for the tumor image to be identified. Enhanced classification results for the image of the tumor to be identified. The classification results are from the pre-training phase. To enhance classification results during the pre-training phase, These are the classification and calibration values used during the pre-training phase.