A cervical cell detection method and system based on multi-scale joint attention

By adopting a detection model based on Swin Transformer and multi-scale joint attention in cervical cell detection, the problem of insufficient global information utilization and easy missed detection of small-sized abnormal cells is solved, and more efficient information fusion and detection performance are improved.

CN119338832BActive Publication Date: 2025-03-25JIANGXI YIZHICHU MEDICAL PATHOLOGICAL DIAGNOSIS MANAGEMENT CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411900592.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-23
Publication Date
2025-03-25
Estimated Expiration
2044-12-23

AI Technical Summary

Technical Problem

The prior art has problems in the detection of cervical cells that are insufficiently utilized, difficult to process large-scale data, and easy to miss detection of small-sized abnormal cells.

Method used

A cervical abnormal cell detection model based on Swin Transformer and multi-scale joint attention is adopted. Through the block splitting module and multiple processing stages, combined with Monte Carlo attention, channel attention and spatial attention module, the efficient fusion of global-local information is achieved.

Benefits of technology

The model's detection performance of abnormal cervical cells is significantly improved, especially when accurately locate and detect smaller targets, reducing information loss and enhancing the generalization performance of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119338832B_ABST
    Figure CN119338832B_ABST
Patent Text Reader

Abstract

The present invention discloses a cervical cell detection method and system based on multi-scale joint attention. The present invention constructs a cervical abnormal cell detection model based on Swin Transformer and multi-scale joint attention; uses a cervical cell image dataset to train and verify the cervical abnormal cell detection model, and uses the trained cervical abnormal cell detection model to detect the cervical pathological section to be tested to obtain the location and category of the cervical abnormal cells. The present invention can achieve efficient fusion of global-local information, is more sensitive to small abnormal cells and tiny features with complex backgrounds, and improves the accuracy of abnormal cervical cell detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of cell recognition, and specifically relates to a cervical cell detection method and system based on multi-scale joint attention. Background Art

[0002] With the rapid development of computer image processing technology, more and more computer-aided technologies have begun to be applied to clinical and experimental auxiliary research. In recent years, deep learning technology has developed rapidly, and deep learning-based methods have achieved good results in tasks such as image classification and target detection. Using deep learning technology, computer-assisted cervical cancer screening has become a reality. Liquid-based thin layer cytology is one of the commonly used methods for cervical cancer screening, and it has achieved remarkable results. This method requires pathologists to find abnormal cervical cells with the naked eye according to the cervical cell classification standards, and make a diagnosis based on their own experience. This inspection method has a large workload and requires pathologists to perform long-term operations, which is easy to cause visual fatigue, resulting in a decrease in diagnostic efficiency and an increase in misdiagnosis and missed diagnosis of cervical cells. Therefore, in cervical cancer screening based on liquid-based thin layer cytology, the use of abnormal cervical cell detection based on deep learning methods can quickly locate abnormal cells and give the type of lesions, helping doctors locate abnormal cells in a large number of cells, greatly speeding up doctors' diagnosis.

[0003] Recently, Transformer has performed well in the field of computer vision. Among them, Swin Transformer is a model proposed by Microsoft Research. It integrates the advantages of CNN and Transformer, introduces an efficient and flexible Transformer architecture, and shows great application prospects. On the one hand, due to the local attention mechanism, it has the advantage of CNN in processing large-size images. On the other hand, it has the advantage of Transformer and can establish long-distance dependencies through the shift window scheme. Although cervical cell detection based on deep convolutional neural networks has significantly improved in performance, they also have some limitations. For example, the interaction between the image and the convolution kernel is content-independent, and the convolution operator of CNN has the problem of limited local receptive field, and its ability to extract global features and long-distance dependent features in the image is insufficient. For cervical cells, the features of a single area are often insufficient for their classification. The pathology of cells is a continuous process. The similarity of cervical cells of different categories is large, the sizes of cells are also different, and the background is complex. Small-sized cells are especially difficult to detect. Summary of the invention

[0004] In order to overcome the above-mentioned shortcomings, the purpose of the present invention is to provide a cervical cell detection method and system based on multi-scale joint attention, so that abnormal cells can be better detected at different scales, even very small cervical abnormal cells with negative background can be detected.

[0005] In order to achieve the above object, the present invention adopts the following technical solution:

[0006] A cervical cell detection method based on multi-scale joint attention includes the following steps:

[0007] Step S1: Slice the cervical pathological section (WSI) to obtain cervical cell image blocks;

[0008] Step S2: labeling the obtained cervical cell image blocks to obtain a cervical cell image dataset;

[0009] Step S3: constructing a cervical abnormal cell detection model based on Swin Transformer and multi-scale joint attention; the cervical abnormal cell detection model includes a block splitting module and four processing stages connected in sequence;

[0010] The block splitting module divides the input cervical cell image blocks into image partition blocks of fixed size;

[0011] The first processing stage includes a linear embedding module and a multi-scale joint attention Swin Transformer block; the second, third and fourth processing stages are composed of a block merging module and multiple multi-scale joint attention Swin Transformer blocks;

[0012] The multi-scale joint attention Swin Transformer block includes two Swin Transformer blocks, wherein the second Swin Transformer block sets a multi-scale joint attention module in parallel on the basis of the Swin Transformer and adopts a residual connection;

[0013] The multi-scale joint attention module is composed of a Monte Carlo attention module (MCAttn), a channel attention module (SE) and a spatial attention module (SA) connected in sequence, wherein the Monte Carlo attention module is composed of a multi-scale pooling module and a random sampling module;

[0014] Step S4: Use the cervical cell image dataset to train and verify the abnormal cervical cell detection model, and use the trained abnormal cervical cell detection model to detect the cervical pathological sections to be tested to obtain the location and category of abnormal cervical cells.

[0015] Further preferably, in step S1, the full-field cervical pathological section (WSI) is first transcoded and converted into a JPG format, and then the cervical pathological section (WSI) is segmented in the form of a sliding window to obtain cervical cell image blocks.

[0016] Further preferably, in step S2, when constructing the cervical cell image dataset, the steps include: firstly labeling all the cervical cell image blocks obtained by segmentation using the LabelImg labeling tool, framing the abnormal cervical cells in the cervical cell image blocks and labeling their categories, obtaining labeled cervical cell image blocks and labeling files in xml format, and splitting the cervical cell image dataset into a training set, a validation set, and a test set; and then converting the labeling file format of the cervical cell image dataset into the COCO format, thereby obtaining JSON files of the training set, the validation set, and the test set.

[0017] Further preferably, the first Swin Transformer block of the multi-scale joint attention Swin Transformer block includes two residual modules based on the attention mechanism, the first residual module is composed of a layer normalization (LayerNorm, LN) module and a window multi-head attention mechanism (W-MSA) module connected in series, and the second residual module is composed of a layer normalization (LN) module and a multi-layer perceptron (MLP) connected in series, and the first residual module and the second residual module are cascaded, and the obtained output is input into the next Swin Transformer block.

[0018] Further preferably, the second Swin Transformer block includes three residual modules based on the attention mechanism, namely the third residual module, the fourth residual module and the fifth residual module, the third residual module is composed of a layer normalization (LN) module and a sliding window multi-head attention mechanism (SW-MSA) module connected in series; the fourth residual module is parallel to the third residual module, and is composed of a layer normalization (LN) module and a multi-scale joint attention module (MSCT) connected in series; the fifth residual module is composed of a layer normalization (LN) module and a multi-layer perceptron (MLP), and the fifth residual module is cascaded with the third residual module and the fourth residual module to obtain the output.

[0019] Further preferably, the multi-scale pooling module performs pooling operations on the input feature map using multiple different pooling scales, thereby generating feature maps of multiple scales.

[0020] Further preferably, during the training process, the random sampling module generates a random index r ranging from 1 to 3 at each forward propagation, corresponding to one of the three feature maps output by the multi-scale pooling module; and then uses the random index r to select a feature map. If r=3, a 3×3 pooled feature map is selected. ; If r=2, select the 2×2 pooled feature map ; If r=1, select the 1×1 pooled feature map ; The selected feature map will be used as the output feature map of the random sampling module.

[0021] The present invention also provides a cervical cell detection system based on multi-scale joint attention, which includes a memory, a processor, and a computer program stored in the memory. When the computer program is executed by the processor, the various steps of the above-mentioned cervical cell detection method based on multi-scale joint attention are implemented.

[0022] The present invention also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the various steps of the above-mentioned cervical cell detection method based on multi-scale joint attention.

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

[0024] 1) The present invention aims to solve the problems of insufficient global information utilization and difficulty in large-scale data processing in the cervical cell detection model based on CNN architecture in the prior art. Through the improved Swin Transformer model, the global information of abnormal cervical cells can be better captured to a certain extent, greatly reducing the loss of information.

[0025] 2) In order to achieve efficient fusion of global and local information, improve the model's ability to capture global context information while modeling the detailed information of local areas more finely, make the model more sensitive to small abnormal cells and tiny features of complex backgrounds, and further enhance the generalization performance of the model, the present invention aims to address the problems of complex cervical cell background, high noise, subtle features, difficulty in extraction, and easy missed detection of small-sized abnormal cells. A multi-scale joint attention mechanism that can efficiently focus on the channel information and spatial information of the feature layer is designed and introduced into the backbone network and detection end of the model in order to achieve efficient fusion of global and local information, improve the model's ability to capture global context information, and at the same time, model the detailed information of local areas more finely, make the model more sensitive to small abnormal cells and tiny features of complex backgrounds, and further enhance the generalization performance of the model. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 A flow chart of the cervical cell detection method based on multi-scale joint attention provided by the present invention;

[0027] Figure 2 This is a schematic diagram of the structure of the abnormal cervical cell detection model constructed by the present invention;

[0028] Figure 3 This is a schematic diagram of the multi-scale joint attention-Swin Transformer block structure of the present invention;

[0029] Figure 4This is a structural diagram of the multi-scale joint attention module of the present invention. DETAILED DESCRIPTION

[0030] The present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments.

[0031] like Figure 1 and Figure 2 As shown, a cervical cell detection method based on multi-scale joint attention provided by the present invention comprises the following steps:

[0032] Step S1: Slice the cervical pathological section (WSI) to obtain cervical cell image blocks;

[0033] Step S2: labeling the obtained cervical cell image blocks to obtain a cervical cell image dataset;

[0034] Step S3: Construct a cervical abnormal cell detection model based on Swin Transformer and multi-scale joint attention;

[0035] Step S4: Use the cervical cell image dataset to train and verify the abnormal cervical cell detection model, and use the trained abnormal cervical cell detection model to detect the cervical pathological sections to be tested to obtain the location and category of abnormal cervical cells.

[0036] In the above step S1, the full-field cervical pathological section (WSI) is first transcoded and converted into a JPG format, and then the cervical pathological section (WSI) is segmented in the form of a sliding window to obtain cervical cell image blocks.

[0037] In the above step S2, when constructing the cervical cell image dataset, it includes: firstly, all the cervical cell image blocks obtained by segmentation are labeled using the LabelImg labeling tool, the abnormal cervical cells in the cervical cell image blocks are framed and labeled with categories, and the labeled cervical cell image blocks and the labeling files in the xml format are obtained, and the cervical cell image dataset is split into a training set, a validation set and a test set according to 7:2:1; and then the cervical cell image dataset labeling file format is converted into the COCO format by writing a Python script, so as to obtain the JSON files of the training set, the validation set and the test set.

[0038] The abnormal cervical cell detection model constructed in step S3 includes a block splitting module (PatchPartition) and four processing stages (Stage 1 to Stage 4) connected in sequence, and each processing stage is used to gradually extract and aggregate feature information in the image.

[0039] Patch Partition: First, the input cervical cell image blocks are divided into fixed-size image partition blocks (Patch), which are used as input features for subsequent Transformer processing. This step is similar to the image partition block in the convolutional network, and its purpose is to decompose large-size input into basic units suitable for calculation.

[0040] The first processing stage (Stage 1): This stage includes a linear embedding module (LinearEmbedding) and a multi-scale joint attention Swin Transformer block. First, the linear embedding module performs feature mapping on the image partition block to obtain the image partition block feature vector with feature dimension C, and outputs it to the multi-scale joint attention Swin Transformer block. Then, the multi-scale joint attention Swin Transformer block effectively models the local features of the image through the multi-head self-attention mechanism within the local window and the sliding operation between windows.

[0041] The second processing stage (Stage 2), the third processing stage (Stage 3) and the fourth processing stage (Stage 4) are all composed of a patch merging module (Patch Merging) and multiple multi-scale joint attention Swin Transformer blocks. The second processing stage (Stage 2) contains 1 multi-scale joint attention Swin Transformer block, the third processing stage (Stage 3) contains 3 consecutive multi-scale joint attention Swin Transformer blocks, and the fourth processing stage (Stage 4) contains 1 multi-scale joint attention Swin Transformer block. Through this modular design, different processing stages have different numbers of multi-scale joint attention Swin Transformer blocks, which effectively fuse feature information from different scales through a multi-scale self-attention mechanism to enhance the model's global-local information perception ability.

[0042] like Figure 3As shown, the multi-scale joint attention Swin Transformer block includes two Swin Transformer blocks. The first Swin Transformer block contains two residual modules based on the attention mechanism. The first residual module is composed of a layer normalization (LayerNorm, LN) module and a window multi-head attention mechanism (W-MSA) module in series. The second residual module is composed of a layer normalization (LN) module and a multi-layer perceptron (MLP) in series. The first residual module and the second residual module are cascaded, and the obtained output is input to the next Swin Transformer block. The window multi-head attention mechanism (W-MSA) module first divides the input features into windows and performs multi-head self-attention calculation on each divided window; the window multi-head attention mechanism (W-MSA) module maps the input features to different subspaces, and then performs dot multiplication operations on all subspaces to calculate the attention vector. Finally, the attention vectors calculated in all subspaces are spliced ​​together and mapped to the original input space to obtain the final attention vector as the output.

[0043] ;

[0044] Among them, Q is the query, K is the key, and V is the value, corresponding to the extracted feature information; K T is the transpose of key K, Represents the sequence length of key K.

[0045] The second Swin Transformer block contains three residual modules based on the attention mechanism, namely the third residual module, the fourth residual module and the fifth residual module. The third residual module is composed of a layer normalization (LN) module and a sliding window multi-head attention mechanism (SW-MSA) module in series; the fourth residual module is parallel to the third residual module and is composed of a layer normalization (LN) module and a multi-scale joint attention module (MSCT) in series; the fifth residual module is composed of a layer normalization (LN) module and a multi-layer perceptron (MLP), and the fifth residual module is cascaded with the third residual module and the fourth residual module to obtain the output. The sliding window multi-head attention mechanism (SW-MSA) module performs a pixel shift operation on the feature with a size of half the window size, and then performs the window multi-head attention mechanism (W-MSA) module operation. That is, the image feature information contained in the window at the same position divided by the window multi-head attention mechanism (W-MSA) module is different, which solves the problem of information interaction between different windows. The multi-scale joint attention module (MSCT) combines the input features with information of different scales, and then performs random sampling operations to enhance the model's ability to perceive image details, so that the model can capture global context information while also finely modeling the details of local areas. It also combines channel attention and spatial attention to dynamically focus on abnormal cell areas at different scales and levels, thereby effectively reducing the interference of background noise on the detection results and making the detection of abnormal cervical cells more accurate.

[0046] The calculation formula is:

[0047] ;

[0048] ;

[0049] ;

[0050] ;

[0051] + ;

[0052] In the above formula, Represents the input features of the first Swin Transformer block; represents the output of the first residual module; Represents the output features of the first Swin Transformer block and is also the input feature of the second Swin Transformer block; represents the output of the third residual module, represents the output of the fourth residual module; Represents the output features of the second Swin Transformer block; MLP represents a multi-layer perceptron operation, LN represents a layer normalization operation, W-MSA represents a window multi-head attention mechanism module operation; SW-MSA represents a sliding window multi-head attention mechanism (SW-MSA) module operation, and MSCT represents a multi-scale joint attention module operation.

[0053] Due to the complex background and high noise of cervical cells, as well as the different cell sizes and uneven cell distribution, some detailed information is easily lost during model training and testing. The present invention fuses the multi-scale joint attention module with the SwinTransformer block to obtain a multi-scale joint attention Swin Transformer block, so that the model can capture global context information while also finely modeling the detailed information of the local area. Dynamically focus on abnormal cell areas between different scales and different levels, thereby effectively reducing the interference of background noise on the detection results.

[0054] The multi-scale joint attention module (MSCT) in the present invention is as follows: Figure 4 As shown in the figure, it is composed of a Monte Carlo attention module (MCAttn), a channel attention module (SE) and a spatial attention module (SA) connected in sequence, wherein the Monte Carlo attention module is composed of a multi-scale pooling module (Multi-scale Pooling) and a random sampling module (Monte CarloSampling).

[0055] The multi-scale pooling module uses multiple different pooling scales to perform pooling operations on the input feature map (such as 3×3, 2×2, 1×1, etc.), thereby generating feature maps of multiple scales. Different pooling scales correspond to different receptive fields, thereby obtaining contextual information from larger or smaller areas, and containing rich hierarchical characteristics in the feature expression. Enhance the adaptability to targets of different scales. Among them, 3×3 pooling can capture a larger spatial range, which helps to obtain global contextual information. 2×2 pooling can capture medium-scale local features. 1×1 pooling is used for global pooling, which compresses the feature map as a whole into a single value to provide global overview information. Through multi-scale pooling of the input features, the model can pay attention to global and local features at the same time, thereby performing multi-level representation of the input features and enhancing the adaptability to targets of different scales.

[0056] The random sampling module is used to break the model's over-reliance on certain fixed features. During the training process, the random sampling module generates a random index r ranging from 1 to 3 at each forward propagation, corresponding to one of the three feature maps in the multi-scale pooling module. Then use the random index r to select a feature map. If r=3, the 3×3 pooled feature map is selected. ; If r=2, select the 2×2 pooled feature map ; If r=1, select the 1×1 pooled feature map ; The selected feature map will be used as the output feature map of the random sampling module and output to the next module. In this way, features of different scales will be used for training in each forward propagation, so that the model can be exposed to a wider range of feature representations during training, thereby improving the robustness of the model in the face of various input situations. The model can avoid overfitting to a specific input feature distribution during training.

[0057] The channel attention module is used to weight each feature channel through compression and excitation operations on the features after the random sampling module, ensuring that the features of important channels are highlighted and unimportant features are suppressed. First, the compression operation performs global average pooling on each channel of the input feature map to capture the global context information of the channel. The compression operation can effectively aggregate the information of the spatial dimension into a single global description, providing input for the subsequent attention weighting step. The formula is as follows:

[0058] ;

[0059] in, is the global eigenvalue of the Cth channel obtained after the compression operation, is a compression function that compresses each channel of the input feature map through a global average pooling operation. H and W represent the height and width of the input feature map, respectively. Represents the feature value of the Cth channel at position (i, j) in the input feature map.

[0060] Next, the excitation mechanism further processes the compressed features. The excitation module in this embodiment includes two 1x1 convolutional layers, which are equivalent to two fully connected layers. The activation function of the first fully connected layer is ReLU, and the activation function of the second fully connected layer is Sigmoid. After the feature map after the above compression channel is excited (excitation) back to the original number of channels, and then the weight output by the excitation mechanism is normalized by the Sigmoid function, the attention weight s of each channel is generated, and the weight is assigned. The formula is as follows:

[0061] ;

[0062] in, Represents channel weight, which is a vector in which each element corresponds to the weight of a channel and ranges between (0,1). Represents the excitation function, which is based on the input features and weight parameters Processing is performed to generate the attention weights s of each channel. is the set of weight parameters of the fully connected layer in the excitation operation, which contains two matrices and ,w={ , }, , There are two fully connected layers for input features. The weight matrix obtained by processing. represents the Sigmoid function, Represents the input features and weight parameters Perform linear transformation and calculate the importance weight of each channel. is the global description vector obtained in the compression operation. Represents the activation function ReLU function.

[0063] Finally, the scaling operation dynamically adjusts the importance of each channel by weighting each channel. Through this operation, the model can determine the importance of each channel based on the global information of the input features, ensuring that channels with more critical information are amplified and unimportant channels are suppressed. The formula is as follows:

[0064] ;

[0065] in, Indicates The feature map after the channels are scaled is finally obtained. is the scale function, is the Cth channel of the input feature map, which contains the features of all pixels in the Cth channel. It is the channel weight calculated in the excitation operation.

[0066] The spatial attention module generates attention weights for different positions of features passing through the channel attention module, highlights significant spatial areas, and suppresses irrelevant or redundant background information. In the present invention, a 7×7 convolution is used to perform a convolution operation on the spatial dimension of the feature map after channel attention compression and excitation, so as to capture the dependency between different spatial positions. Then, through the Sigmoid activation function, the convolution output is mapped to [0,1] to obtain a spatial attention weight map. Through the generated spatial attention weight map, the features of the significant area are amplified, while the features of the irrelevant area are suppressed, that is, the target area is highlighted and the background area is suppressed, so that the model is more sensitive to the key areas in the input image, which can reduce the interference of background noise on feature extraction and improve the sensitivity to abnormal areas.

[0067] In the present invention, residual connections are also used to further improve the performance and stability of the model. Residual connections are an effective technique that can help alleviate the gradient vanishing problem in deep networks and promote the effective propagation of features. Specifically, residual connections add input features directly to features processed by channel attention and spatial attention. This connection method allows the model to not only learn new features, but also retain the information of the original features, thereby enhancing the expressive power of the network. Residual connections ensure that these enhanced features work together with the original features to form a richer feature representation.

[0068] The loss function of the present invention uses cross entropy loss and L1 loss, which are used to ensure that all pixels of the predicted result image and the real image maintain a high degree of similarity. Specifically, L1 loss is used for constraint to try to keep the predicted image and the real image consistent, thereby reducing the prediction error. At the same time, the use of cross entropy loss solves the imbalance problem in processing classification tasks. By quantifying the difference between the predicted distribution and the real distribution, the performance of the model in each category is more balanced and accurate. Combining these two loss functions not only enhances the robustness of the model, but also improves its adaptability in different scenarios, so that the final detection result is more accurate and reliable. L1 loss ( ), cross entropy loss( ), total loss The calculation formulas are:

[0069] ;

[0070] ;

[0071] ;

[0072] Where N represents the total number of samples. is the true value, is the predicted value, is the number of categories, Represents the true label of the i-th category, which is a one-hot vector; is the predicted probability of the ith class. and They are the weight parameters of L1 loss and cross entropy loss, respectively, which are used to adjust the relative importance of the two losses in the total loss.

[0073] In the above step S4, the labeled abnormal cervical cell image dataset is added to the improved SwinTransformer model for training and verification, and the test set is used for testing to obtain the output result after model detection, thereby obtaining the optimal weight.

[0074] The effect of the present invention can be verified by the following experiments:

[0075] The ablation experiment of the multi-scale joint attention module (MSCT) was conducted to verify its improvement in the detection of abnormal cervical cell targets. The model was evaluated by AP50, AP75, mAP and recall rate (Recall) on the abnormal cervical cell dataset. AP (Average Precision): represents the average of the precision (Precision) under different recall rates. AP50 refers to the average precision calculated when the IOU (Intersection over Union) value is 50%. IOU is the overlap between the predicted box and the true box. AP75 refers to the average precision calculated when the IOU value is 75%. mAP (Mean Average Precision) represents the average of all categories of AP, which measures the overall performance of the model in multi-category detection tasks. The higher the mAP, the better the detection effect of the model on all categories. Recall rate (Recall) measures the proportion of the model correctly detected in the actual target. That is:

[0076] ;

[0077] ;

[0078] TP represents the number of samples that the model predicts to be positive and are actually positive, while FN refers to the number of samples that the model mistakenly predicts to be negative. The improvement of recall rate means that the model has better detection ability for targets and can capture the actual targets more comprehensively. represents the AP value of the i-th category, and K represents the total number of detected categories.

[0079] Table 1 shows the ablation experiment results of the improved Swin Transformer model, that is, the Swin Transformer model with the addition of the multi-scale joint attention module (MSCT). After the introduction of the multi-scale joint attention, the model performance has been improved. The ablation experiment removes or adds the multi-scale joint attention module (MSCT) to the model, and observes the changes in the model's AP50, AP75, mAP and recall rate (Recall) to evaluate the actual impact of MSCT on the model performance. Without the multi-scale joint attention module (MSCT), the model may experience a decrease in mAP and recall rate, indicating that the model's feature extraction ability at different scales is limited. After adding the multi-scale joint attention module (MSCT), the ability to extract fine-grained and global information is enhanced through the multi-scale attention mechanism, which can usually significantly improve AP50, AP75, mAP and recall rate, which shows that the multi-scale joint attention module (MSCT) improves the model's detection performance for abnormal cervical cells, especially in accurately locating and detecting smaller targets.

[0080] Table 1 Ablation experimental results of improved Swin Transformer network

[0081]

[0082] Another embodiment of the present invention provides a cervical cell detection system based on multi-scale joint attention, which includes a memory, a processor, and a computer program stored in the memory. When the computer program is executed by the processor, it implements the various steps of the cervical cell detection method based on multi-scale joint attention as described in the above embodiment.

[0083] Another embodiment of the present invention provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the various steps of the cervical cell detection method based on multi-scale joint attention as described in the above embodiment.

[0084] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A cervical cell detection method based on multi-scale joint attention, characterized in that: The following steps are involved: Step S1: Slice the cervical pathological sections to obtain cervical cell image blocks; Step S2: labeling the obtained cervical cell image blocks to obtain a cervical cell image dataset; Step S3: constructing a cervical abnormal cell detection model based on Swin Transformer and multi-scale joint attention; the cervical abnormal cell detection model includes a block splitting module and four processing stages connected in sequence; The block splitting module divides the input cervical cell image blocks into image partition blocks of fixed size; The first processing stage includes a linear embedding module and a multi-scale joint attention Swin Transformer block; the second, third and fourth processing stages all consist of a block merging module and multiple multi-scale joint attention Swin Transformer blocks; The multi-scale joint attention Swin Transformer block includes two Swin Transformer blocks, wherein the second Swin Transformer block sets a multi-scale joint attention module in parallel on the basis of the Swin Transformer and adopts a residual connection; The multi-scale joint attention module is formed by sequentially connecting a Monte Carlo attention module, a channel attention module, and a spatial attention module, wherein the Monte Carlo attention module is composed of a multi-scale pooling module and a random sampling module; Step S4: Use the cervical cell image dataset to train and verify the abnormal cervical cell detection model, and use the trained abnormal cervical cell detection model to detect the cervical pathological sections to be tested to obtain the location and category of abnormal cervical cells.

2. The cervical cell detection method based on multi-scale joint attention according to claim 1, characterized in that: In step S1, the full-view cervical pathological sections are first transcoded and converted into JPG format, and then the cervical pathological sections are segmented in the form of a sliding window to obtain cervical cell image blocks.

3. The cervical cell detection method based on multi-scale joint attention according to claim 1, characterized in that: In step S2, when constructing the cervical cell image dataset, it includes: firstly, all the cervical cell image blocks obtained by segmentation are labeled using the LabelImg labeling tool, the abnormal cervical cells in the cervical cell image blocks are framed and labeled with categories, and the labeled cervical cell image blocks and the labeling files in the xml format are obtained, and the cervical cell image dataset is split into a training set, a validation set and a test set; and then the labeling file format of the cervical cell image dataset is converted into the COCO format, so as to obtain the JSON files of the training set, the validation set and the test set.

4. The cervical cell detection method based on multi-scale joint attention according to claim 1, characterized in that: The first Swin Transformer block of the multi-scale joint attention Swin Transformer block contains two residual modules based on the attention mechanism. The first residual module is composed of a layer normalization module and a window multi-head attention mechanism module in series, and the second residual module is composed of a layer normalization module and a multi-layer perceptron in series. The first residual module and the second residual module are cascaded, and the output obtained is input into the next Swin Transformer block.

5. The cervical cell detection method based on multi-scale joint attention according to claim 4, characterized in that: The second Swin Transformer block contains three residual modules based on the attention mechanism, namely the third residual module, the fourth residual module and the fifth residual module. The third residual module is composed of a layer normalization module and a sliding window multi-head attention mechanism module in series; the fourth residual module is parallel to the third residual module, and is composed of a layer normalization module and a multi-scale joint attention module in series; the fifth residual module is composed of a layer normalization module and a multi-layer perceptron, and the fifth residual module is cascaded with the third residual module and the fourth residual module to obtain the output.

6. The cervical cell detection method based on multi-scale joint attention according to claim 1, characterized in that: The multi-scale pooling module performs pooling operations on the input feature map using multiple pooling scales, thereby generating feature maps of multiple scales.

7. The cervical cell detection method based on multi-scale joint attention according to claim 1, characterized in that: During the training process, the random sampling module generates a random index r ranging from 1 to 3 at each forward propagation, corresponding to one of the three feature maps output by the multi-scale pooling module; then uses the random index r to select a feature map. If r=3, the 3×3 pooled feature map is selected. ; If r=2, select the 2×2 pooled feature map ; If r=1, select the 1×1 pooled feature map ; The selected feature map will be used as the output feature map of the random sampling module.

8. A cervical cell detection system based on multi-scale joint attention, characterized in that: It comprises a memory, a processor and a computer program stored in the memory, and when the computer program is executed by the processor, each step of the cervical cell detection method based on multi-scale joint attention described in any one of claims 1 to 7 is implemented.

9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the various steps of the cervical cell detection method based on multi-scale joint attention described in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Abnormal cell detection method based on improved YOLOv7 and Swinin-Unet

    CN115965602A

  • Multi-scale double-flow cervical abnormal cell detection method fusing pathological knowledge

    CN116188456A