A super-resolution method for pathological slice images based on diffusion model
Through the super-resolution method of pathological slice image based on diffusion model, combined with the global attention mechanism and diffusion converter network, the problem of high requirements for training data in the prior art is solved, and high-quality super-resolution image generation of pathological slice image is achieved, which improves the accuracy of diagnosis.
Patent Information
- Application Number
- CN202411449088.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-17
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2044-10-17
AI Technical Summary
The existing super-resolution method based on deep learning has high requirements for training data of pathological slice images, making it difficult to obtain sufficient training samples, resulting in insufficient resolution of pathological slice images and cannot meet the requirements of refined diagnosis.
The pathological slice image super-resolution method based on diffusion model is adopted, and high-quality pathological slice super-resolution images are generated by mixing feature extraction module, diffusion transformer network and feature fusion module, combining the global attention mechanism, local convolution, diffusion model and ViT network.
By enhancing the characteristics of pathological slice images through the noise addition and denoising process, high-resolution images can be effectively generated, the accuracy of clinical pathological diagnosis can be improved, and high-quality images can still be effectively learned and generated when training data is insufficient.
Smart Images

Figure CN118967449B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of image super-resolution, and in particular relates to a pathological slice image super-resolution method based on a diffusion model. Background Art
[0002] Pathological section images are an important basis for clinical pathological diagnosis, and contain rich information on tissue structure and cell morphology. However, due to the limitations of pathological section acquisition and scanning equipment, distortion problems in the image processing process often lead to insufficient resolution of the acquired pathological section images, which cannot meet the requirements of refined diagnosis. Therefore, obtaining super-resolution pathological section images is of great significance for improving the accuracy of pathological diagnosis.
[0003] In recent years, with the development of deep learning technology, super-resolution methods based on deep neural networks have made significant progress. These methods can generate clearer super-resolution images by learning the mapping relationship between low-resolution images and high-resolution images; however, existing super-resolution methods based on deep learning often need to rely on large-scale training data sets to train complex neural network models. For special types of images such as pathological slice images, it is very difficult to obtain sufficient training samples.
[0004] As a new type of generative model, the diffusion model has shown great potential in image generation and restoration tasks. The diffusion model generates high-resolution images by gradually adding noise and denoising the images. During the training process, it can be effectively learned with a small amount of training data. The present invention proposes a pathological slice image super-resolution method based on the diffusion model. The method uses the diffusion model to generate high-quality pathological slice super-resolution images, thereby improving the accuracy of clinical pathological diagnosis. Summary of the invention
[0005] The present invention provides a pathological slice image super-resolution method based on a diffusion model, aiming to propose a pathological slice image super-resolution model, wherein a hybrid feature extraction module uses a method combining a global attention mechanism and a local convolution to extract global and local features of the pathological slice image, a diffusion transformer network uses a method combining a diffusion model and a ViT network to enhance the features of the pathological slice image through a denoising and denoising process, and a feature fusion module uses a method combining a multi-scale convolution kernel and a convolution attention mechanism to generate a pathological slice super-resolution image.
[0006] The present invention aims to propose a pathological slice image super-resolution model based on a diffusion model, and provides a pathological slice image super-resolution method based on a diffusion model, comprising the following steps.
[0007] S1. Acquire a pathological slice image, perform a preprocessing operation on the pathological slice image, and divide the pathological slice image into image blocks of equal size and overlap to obtain pathological slice image blocks.
[0008] S2. Construct a hybrid feature extraction module, which consists of a global branch and a local branch, and respectively extracts global features and local features of the pathological slice image.
[0009] S3. Construct a diffusion transformer network, which is based on the ViT network, replaces the multi-head attention mechanism in the ViT network with a diffusion attention mechanism, replaces the feedforward neural network in the ViT network with a diffusion feedforward network, and embeds the parameters of the time step after the normalization layer.
[0010] S4. Construct a feature fusion module, which combines convolution and attention operations to generate a super-resolution image of a pathological section.
[0011] S5. Construct a pathological slice image super-resolution model, wherein the pathological slice image super-resolution model includes a hybrid feature extraction module, a diffusion transformer network and a feature fusion module.
[0012] S6. Obtain a super-resolution image of a pathological slice, input the pathological slice image block into the pathological slice image super-resolution model, input the pathological slice image block into a hybrid feature extraction module, and output a feature map; input the feature map into a diffusion transformer network, and output an enhanced feature map; input the enhanced feature map into a feature fusion module, and output a super-resolution image block; and splice all reconstructed super-resolution image blocks into a complete super-resolution image.
[0013] Preferably,
[0014] S2 specifically includes: S21, in step S2, for a hybrid feature extraction module, the hybrid feature extraction module is composed of a global branch and a local branch, and the pathological slice image block is Input to both the global branch and the local branch at the same time, , , and are the height, width and number of channels of the pathological slice image block respectively; for the global branch, After layer normalization, it is input into the windowed multi-head attention mechanism. In the initial layer, Split into multiple non-overlapping windows, each of which is , after division is rearranged into the shape The window block, is the number of windows, is the number of pixels in each window, and the feature of each window is , , calculate the multi-head self-attention of each window, the next layer The windows in the layer are shifted relative to the window position of the previous layer so that the windows cover different areas. On the shifted windows, the multi-head self-attention is continued to be calculated to obtain the cross-window dependency information. After the windowed multi-head self-attention calculation is completed, these windows are reassembled back to the original feature map shape. , get the feature map ; The feature map Input to SE module, first Perform a global pooling operation to obtain the global features of each channel, and then adjust the weight of each channel through a two-layer fully connected network , and is the weight of the fully connected layer, and the generated weight Multiply the input features , and get the adjusted output , the output of the windowed multi-head attention mechanism and the output of the SE module Add pixel by pixel to get the output of the global branch ;
[0015] S2 specifically includes: S22, for the local branch, inputting the pathological slice image block To two convolution layers with a convolution kernel of 3×3, local features are obtained ,Will Input to the feature attention module, first Through average pooling and global pooling operations, two feature vectors are obtained and ,Will and Input to the multi-layer perceptron, , get the attention map , the local features With attention map Multiply pixel by pixel to get the output of the local branch ; The output of the global branch With the output of the local branch Add pixel by pixel to get the output of the hybrid feature extraction module .
[0016] Preferably, in step S2, for the hybrid feature extraction module, the global branch divides the pathological slice image into multiple non-overlapping windows by using a windowed multi-head attention mechanism and performs multi-head attention on each window, so as to capture the global context information of the pathological slice image. In the SE module, the weight of each channel is adjusted by using global pooling and fully connected operations to enhance the feature representation capability. The local branch captures the local features of the pathological slice image by using convolution operations, and helps the pathological slice image super-resolution model to focus on more important features by using a feature attention module. The outputs of the global branch and the local branch are added element by element, so as to combine global and local features and provide a more comprehensive pathological slice image representation.
[0017] Preferably,
[0018] S3 specifically includes: S31, in step S3, for the diffusion transformer network, the diffusion transformer network is divided into a noise adding part and a noise removing part, for the noise adding part, first, the output of the hybrid feature extraction module Through the maximum pooling operation, the features after spatial dimension compression are obtained, and the features after spatial dimension compression are subjected to a 1×1 convolution operation to obtain the compressed features. , , , and are the height, width and number of channels of the feature after feature compression, and then, Gradually add noise to get characteristics close to pure noise , is the time step, let the time step be , ,from arrive Every step Compute variance scheduling , ,Towards Add Gaussian noise to , is the feature after adding noise, is the noise sampled from a standard normal distribution, The fully noisy feature is obtained when ;
[0019] S3 specifically includes, S32, for the denoising part, the network of the denoising part is composed of multiple denoising modules, and the denoising module converts the feature Input to the diffusion attention mechanism, the multi-layer perceptron converts the time step Encoded as channel scale parameter and offset parameters , using the parameters and For the characteristics After the linear transformation, the transformed features are obtained through the processing of 1×1 convolution layer and depth-separable convolution layer, and the transformed features are compared with Perform residual connection to obtain the output features of the diffusion attention mechanism; input the features output by the diffusion attention mechanism into the diffusion feedforward network, using the time step parameter and After adjusting the feature representation, the obtained features are residually connected with the features before transformation through 1×1 convolution layer, depthwise separable convolution layer and Gaussian error function to obtain the output features of the diffusion feedforward network, which is the final output of the denoising part. The denoising process is as follows: arrive , at each time step , the diffuse transformer network learns the Gaussian noise To estimate the features of the denoised image, , is the time step The standard deviation of the noise when is the noise sampled from a standard normal distribution, The fully denoised feature is obtained when .
[0020] Preferably, in step S3, for the diffusion transformer network, the denoising part compresses features by using convolution and pooling operations to reduce the amount of calculation, and simulates the diffusion process from a clear image to a pure noise image by gradually adding noise to the features, which helps the pathological slice image super-resolution model learn the ability to recover image details from noise; the denoising part gradually reduces noise through multiple denoising modules, simulates the process of recovering from a noisy image to a clear image, and helps to improve the resolution of the pathological slice image.
[0021] Preferably, in step S4, for the feature fusion module, the output feature of the diffusion transformer network is Input to the feature fusion module, use convolution kernels of 1×1, 3×3 and 5×5 to fusion the features Perform convolution operation, , , , get the features , and , a convolutional attention mechanism is assigned to the output of each convolution kernel. First, the global information of the feature is obtained through the global average pooling operation. ,Then, a two-layer fully connected network is used to generate attention weights, , and is the weight matrix learned by the fully connected network. Finally, the generated weights are used The output of each convolution kernel is weighted to obtain the output of the convolution attention mechanism of each convolution kernel, and the output of the convolution attention mechanism is combined with the original feature Perform residual connection to obtain the output of the feature fusion module .
[0022] Preferably, in step S4, for the feature fusion module, a multi-scale convolution kernel method is used so that the model can process features of different scales simultaneously, effectively capture the details and global information in the pathological slice image, and use the convolution attention mechanism. The feature fusion module can adaptively adjust the weight of each scale feature to ensure that important features are amplified and irrelevant or redundant features are suppressed. The features processed by convolution and attention are added to the original features using residual connections to maintain the continuity of feature transfer, prevent the loss of features during the fusion process, and alleviate the possible gradient vanishing problem.
[0023] Compared with the prior art, the present invention has the following technical effects:
[0024] The technical solution provided by the present invention proposes a super-resolution model for pathological slice images, wherein a hybrid feature extraction module uses a method combining a global attention mechanism and a local convolution to extract global and local features of the pathological slice image, a diffusion transformer network uses a method combining a diffusion model and a ViT network to enhance the features of the pathological slice image through a denoising and denoising process, and a feature fusion module uses a multi-scale convolution kernel and a convolution attention mechanism to generate a pathological slice super-resolution image. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 The present invention provides a flow chart for realizing super-resolution of pathological slice images.
[0026] Figure 2 It is a structural diagram of the hybrid feature extraction module provided by the present invention.
[0027] Figure 3 This is a network structure diagram of the diffusion converter provided by the present invention.
[0028] Figure 4 It is a structural diagram of the feature fusion module provided by the present invention.
[0029] Figure 5 This is a low-resolution pathological slice image provided by the present invention.
[0030] Figure 6 This is the super-resolution pathological slice image provided by the present invention. DETAILED DESCRIPTION
[0031] The present invention provides a pathological slice image super-resolution method based on a diffusion model, aiming to propose a pathological slice image super-resolution model, wherein a hybrid feature extraction module uses a method combining a global attention mechanism and a local convolution to extract global and local features of the pathological slice image, a diffusion transformer network uses a method combining a diffusion model and a ViT network to enhance the features of the pathological slice image through a denoising and denoising process, and a feature fusion module uses a method combining a multi-scale convolution kernel and a convolution attention mechanism to generate a pathological slice super-resolution image.
[0032] See also Figure 1 As shown, a pathological slice image super-resolution method based on a diffusion model in an embodiment of the present application.
[0033] S1. Acquire a pathological slice image, perform a preprocessing operation on the pathological slice image, and divide the pathological slice image into image blocks of equal size and overlap to obtain pathological slice image blocks.
[0034] Further, in step S1, for obtaining the pathological slice image, a high-resolution scanner is used to obtain the pathological slice image; for preprocessing the pathological slice image, a color ruler is used to adjust the color channel of the pathological slice image so that the color of the pathological slice image is consistent with the standard, and a normalization operation is used to adjust the brightness and contrast of the pathological slice image; for segmenting the pathological slice image, the pathological slice image block size is set to 256×256, the overlap ratio is 0.5, the entire pathological slice image is traversed, and the image block is extracted according to the set pathological slice image block size and step size, where the step size is ,Before segmentation, the pathological slice image is filled with the zero filling method to ,increase the pixels at the boundary part of the image to avoid the ,problem of exceeding the boundary during segmentation.
[0035] S2. Construct a hybrid feature extraction module, which consists of a global branch and a local branch, and respectively extracts global features and local features of the pathological slice image.
[0036] further,
[0037] S2 specifically includes: S21. In step S2, for the hybrid feature extraction module, its structure is as follows: Figure 2 As shown, the hybrid feature extraction module consists of a global branch and a local branch. Input to both the global branch and the local branch at the same time, , 256, 256 and 3 are the height, width and number of channels of the pathological slice image block respectively; for the global branch, for the pathological slice image block After layer normalization, it is input into the windowed multi-head attention mechanism. In the initial layer, Split into multiple non-overlapping windows, each of which is , after division is rearranged into the shape Window blocks, 256 is the number of windows, 256 is the number of pixels in each window, and the characteristics of each window are , , calculate the multi-head self-attention of each window, the next layer The windows in the layer are shifted relative to the window position of the previous layer so that the windows cover different areas. On the shifted windows, the multi-head self-attention is continued to be calculated to obtain the cross-window dependency information. After the windowed multi-head self-attention calculation is completed, these windows are reassembled back to the original feature map shape. , get the feature map ; The feature map Input to SE module, first Perform a global pooling operation to obtain the global features of each channel, and then adjust the weight of each channel through a two-layer fully connected network , and is the weight of the fully connected layer, the number of nodes in the fully connected layer is 128, and the generated weight Multiply the input features , and get the adjusted output , the output of the windowed multi-head attention mechanism and the output of the SE module Add pixel by pixel to get the output of the global branch ;
[0038] S2 specifically includes: S22, for the local branch, inputting the pathological slice image block To two convolutional layers with a convolution kernel of 3×3, the stride of the convolutional layer is 1 and the padding is 1, the local features are obtained ,Will Input to the feature attention module, first Through average pooling and global pooling operations, two feature vectors are obtained and ,Will and Input to the multi-layer perceptron, , get the attention map , the local features With attention map Multiply pixel by pixel to get the output of the local branch ; The output of the global branch With the output of the local branch Add pixel by pixel to get the output of the hybrid feature extraction module .
[0039] S3. Construct a diffusion transformer network, which is based on the ViT network, replaces the multi-head attention mechanism in the ViT network with a diffusion attention mechanism, replaces the feedforward neural network in the ViT network with a diffusion feedforward network, and embeds the parameters of the time step after the normalization layer.
[0040] further,
[0041] S3 specifically includes: S31. In step S3, for the diffusion transformer network, its structure is as follows: Figure 3 As shown, the diffusion transformer network is divided into a noise adding part and a denoising part. For the noise adding part, first, the output of the hybrid feature extraction module is Through the maximum pooling operation, the features after spatial dimension compression are obtained, and the features after spatial dimension compression are subjected to a 1×1 convolution operation to obtain the compressed features. , , 128, 128 and 3 are the height, width and number of channels of the feature after feature compression, and then, Gradually add noise to get characteristics close to pure noise , is the time step, let the time step be , ,from arrive Every step Compute variance scheduling , ,Towards Add Gaussian noise to , is the feature after adding noise, is the noise sampled from a standard normal distribution, The fully noisy feature is obtained when ;
[0042] S3 specifically includes, S32, for the denoising part, the network of the denoising part is composed of multiple denoising modules, and the denoising module converts the feature Input to the diffusion attention mechanism, the multi-layer perceptron converts the time step Encoded as channel scale parameter and offset parameters , using the parameters and For the characteristics After the linear transformation, the transformed features are obtained through the processing of 1×1 convolution layer and depth-separable convolution layer, and the transformed features are compared with Perform residual connection to obtain the output features of the diffusion attention mechanism; input the features output by the diffusion attention mechanism into the diffusion feedforward network, using the time step parameter and After adjusting the feature representation, the obtained features are residually connected with the features before transformation through 1×1 convolution layer, depthwise separable convolution layer and Gaussian error function to obtain the output features of the diffusion feedforward network, which is the final output of the denoising part. The denoising process is as follows: arrive , at each time step , the diffuse transformer network learns the Gaussian noise To estimate the features of the denoised image, , is the time step The standard deviation of the noise when is the noise sampled from a standard normal distribution, The fully denoised feature is obtained when .
[0043] S4. Construct a feature fusion module, which combines convolution and attention operations to generate a super-resolution image of a pathological section.
[0044] Furthermore, in step S4, for the feature fusion module, its structure is as follows Figure 4 As shown, the output characteristics of the diffusion transformer network Input to the feature fusion module, use convolution kernels of 1×1, 3×3 and 5×5 to fusion the features Convolution operation is performed, the stride of 1×1 convolution layer is 1, the padding is 0, the stride of 3×3 convolution layer is 1, the padding is 1, the stride of 5×5 convolution layer is 1, the padding is 2, , , , get the features , and , a convolutional attention mechanism is assigned to the output of each convolution kernel. First, the global information of the feature is obtained through the global average pooling operation. ,Then, a two-layer fully connected network is used to generate attention weights, , and is the weight matrix learned by the fully connected network. Finally, the generated weights are used The output of each convolution kernel is weighted to obtain the output of the convolution attention mechanism of each convolution kernel, and the output of the convolution attention mechanism is combined with the original feature Perform residual connection to obtain the output of the feature fusion module .
[0045] S5. Construct a pathological slice image super-resolution model, wherein the pathological slice image super-resolution model includes a hybrid feature extraction module, a diffusion transformer network and a feature fusion module.
[0046] Furthermore, in step S5, for the pathological section image super-resolution model, the model consists of a hybrid feature extraction module, a diffusion transformer network and a feature fusion module. The hybrid feature extraction module is used to extract multi-level feature information from the low-resolution image, the diffusion transformer network is used to process and enhance features, and the feature fusion module is used to fuse features of different scales to generate a super-resolution image. The pathological section image super-resolution model uses the mean square error function as the loss function and Adam as the optimizer, and the default learning rate is 0.001.
[0047] S6. Obtain a super-resolution image of a pathological slice, input the pathological slice image block into the pathological slice image super-resolution model, input the pathological slice image block into a hybrid feature extraction module, and output a feature map; input the feature map into a diffusion transformer network, and output an enhanced feature map; input the enhanced feature map into a feature fusion module, and output a super-resolution image block; and splice all reconstructed super-resolution image blocks into a complete super-resolution image.
[0048] Further, in step S6, a pathological slice image is obtained, and a preprocessing operation is performed on the pathological slice image, and the pathological slice image is cut into image blocks of equal size and overlapping, and each cut low-resolution image block is input into the pathological slice image super-resolution model one by one. The low-resolution image block first passes through a hybrid feature extraction module, which uses a global attention mechanism and a local convolution operation to output a feature map, and the extracted feature map is input into a diffusion transformer network to generate a more expressive enhanced feature map. The enhanced feature map and the feature map from the hybrid feature extraction module are input into a feature fusion module to output a final super-resolution image block; according to the order of cutting, all super-resolution image blocks are traversed one by one, and each image block is placed in a corresponding position in the blank canvas according to the cutting position of the image block. When splicing, the pixel values of the overlapping areas are weighted averaged to avoid artifacts caused by repeated pixels, and the pathological slice super-resolution image is output after traversing all pathological slice super-resolution image blocks.
[0049] Furthermore, in step S6, if Figure 5 As shown, Figure 5 Low-resolution pathology slide images are shown; e.g. Figure 6 As shown, Figure 6 The pathological section super-resolution images obtained by processing the pathological section image super-resolution model are shown.
[0050] The above are only preferred embodiments of the present invention. It should be pointed out that a person skilled in the art can make several modifications and improvements without departing from the inventive concept of the present invention, and these all fall within the protection scope of the present invention.
Claims
1. A pathological slice image super-resolution method based on a diffusion model, characterized in that: The following steps are involved: S1, obtaining a pathological slice image, performing a preprocessing operation on the pathological slice image, cutting the pathological slice image into image blocks of equal size and overlap, and obtaining pathological slice image blocks; S2, construct a hybrid feature extraction module, the hybrid feature extraction module is composed of a global branch and a local branch, respectively extracting the global features and local features of the pathological slice image, for the hybrid feature extraction module, the hybrid feature extraction module is composed of a global branch and a local branch, and the pathological slice image block I in Input to the global branch and the local branch at the same time, I in ∈R H×W×C , H, W and C are the height, width and number of channels of the pathological slice image block respectively. For the global branch, for the pathological slice image block I in After layer normalization, the input is fed into the windowed multi-head attention mechanism. In the initial layer, I in Split into multiple non-overlapping windows, each window size is M×M, and the I in is rearranged into the shape The window block, is the number of windows, M 2 is the number of pixels in each window, and the feature of each window is F i , Calculate the multi-head self-attention of each window, the next layer I in The windows in the layer are shifted relative to the window positions of the previous layer so that the windows cover different areas. On the shifted windows, the multi-head self-attention is continued to be calculated to obtain the cross-window dependency information. After the windowed multi-head self-attention calculation is completed, these windows are reassembled back to the original feature map shape H×W×C to obtain the feature map I w , the feature map I w Input to SE module, first I w Perform a global pooling operation to obtain the global features of each channel, and then adjust the weight of each channel through a two-layer fully connected network s = Sigmoid (W2 · ReLU (W1 · GlobalAvgPool (I w ))), W1 and W2 are the weights of the fully connected layer, and the generated weight s is multiplied by the input feature I w , and get the adjusted output I s , the output of the windowed multi-head attention mechanism I w and the output of the SE module I s Add pixel by pixel to get the output I′ of the global branch out For the local branch, the pathological slice image block I is input in To two convolution layers with a convolution kernel of 3×3, the local feature I is obtained p , will I p Input to the feature attention module, first I p Through average pooling and global pooling operations, two feature vectors X1 and X2 are obtained, and X1 and X2 are input into the multi-layer perceptron, X = Sigmoid (MLP (X1) + MLP (X2)), and the attention map X is obtained. p Multiply pixel by pixel with the attention map X to get the output I″ of the local branch out , the output I′ of the global branch out The output I″ of the local branch out Add pixel by pixel to get the output I of the hybrid feature extraction module out ; S3. Construct a diffusion transformer network, which is based on the ViT network, replaces the multi-head attention mechanism in the ViT network with a diffusion attention mechanism, replaces the feedforward neural network in the ViT network with a diffusion feedforward network, and embeds the parameters of the time step after the normalization layer; S4, constructing a feature fusion module, wherein the feature fusion module combines convolution and attention operations to generate a super-resolution image of a pathological section; S5, constructing a pathological slice image super-resolution model, wherein the pathological slice image super-resolution model includes a hybrid feature extraction module, a diffusion transformer network and a feature fusion module; S6. Obtain a super-resolution image of a pathological slice, input the pathological slice image block into the pathological slice image super-resolution model, input the pathological slice image block into a hybrid feature extraction module, and output a feature map; input the feature map into a diffusion transformer network, and output an enhanced feature map; input the enhanced feature map into a feature fusion module, and output a super-resolution image block; and splice all reconstructed super-resolution image blocks into a complete super-resolution image.
2. The method for super-resolution of pathological slice images based on a diffusion model according to claim 1, characterized in that: S3 specifically includes: S31, in step S3, for the diffusion transformer network, the diffusion transformer network is divided into a noise adding part and a noise removing part, for the noise adding part, first, the output I of the hybrid feature extraction module is out Through the maximum pooling operation, the features after spatial dimension compression are obtained, and the features after spatial dimension compression are subjected to a 1×1 convolution operation to obtain the compressed features f0, f0∈R H′×W′×C′ , H′, W′ and C′ are the height, width and number of channels of the feature after feature compression, and then noise is gradually added to the feature f0 to obtain a feature f close to pure noise. T , T is the time step, let the time step be t, t∈[0,T], and calculate the variance schedule α at each step t from t=0 to t=T-1 t , Towards t Add Gaussian noise to f t+1 is the feature after adding noise, ε is the noise sampled from the standard normal distribution, and the fully noisy feature f is obtained when t = T T S3 specifically includes, S32, for the denoising part, the network of the denoising part is composed of multiple denoising modules, the denoising module, the feature f T Input to the diffusion attention mechanism, the multi-layer perceptron encodes the time step t as the channel scale parameter α t and the offset parameter β t , using the parameter α t and β t For the feature f T After the linear transformation, the transformed features are obtained through the processing of 1×1 convolution layer and depth-separable convolution layer, and the transformed features are compared with f T Perform residual connection to obtain the output features of the diffusion attention mechanism; input the features output by the diffusion attention mechanism into the diffusion feedforward network, using the time step parameter α t and β t After adjusting the feature representation, the obtained features are residually connected with the features before transformation through 1×1 convolution layer, depthwise separable convolution layer and Gaussian error function to obtain the output features of the diffusion feedforward network, which is the final output of the denoising part; the denoising process is that from t = T to t = 1, at each time step t, the diffusion transformer network passes the learned Gaussian noise ε t To estimate the features of the denoised image, σ t is the standard deviation of the noise at time step t, z is the noise sampled from the standard normal distribution, and the completely denoised feature f0 is obtained at t = 0.
3. The pathological slice image super-resolution method based on diffusion model according to claim 1, characterized in that: In step S4, for the feature fusion module, the output feature f0 of the diffusion transformer network is input into the feature fusion module, and the feature f0 is convolved using convolution kernels of 1×1, 3×3 and 5×5, F1=Conv1(f0), F2=Conv3(f0), F3=Conv5(f0), to obtain features F1, F2 and F3, and a convolution attention mechanism is assigned to the output of each convolution kernel. First, a global average pooling operation is performed to obtain the global information g of the feature, and then a two-layer fully connected network is used to generate the attention weight. W′ and W″ are the weight matrices learned by the fully connected network. Finally, the generated weights The output of each convolution kernel is weighted to obtain the output of the convolution attention mechanism of each convolution kernel, and the output of the convolution attention mechanism is residually connected with the original feature f0 to obtain the output F of the feature fusion module.
Citation Information
Patent Citations
Image super-resolution reconstruction method based on fused attention mechanism residual network
CN111192200A
Gastroscope picture multi-label classification system based on VIT network
CN113096131A