A lightweight cervical cancer image cell detection system based on causal attention
The modularly designed causal attention-based lightweight cervical cancer image cell detection system solves the problems of high deployment cost and slow inference speed of existing systems, and achieves efficient and accurate detection of abnormal cells in cervical cancer TCT images, improving detection efficiency and model generalization ability.
Patent Information
- Application Number
- CN202211558837.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-06
- Publication Date
- 2026-01-06
- Estimated Expiration
- 2042-12-06
AI Technical Summary
Existing cervical cancer image cell detection systems rely on heavyweight models, resulting in high deployment costs and slow inference speeds. This makes it difficult to meet the demand for rapid detection of large numbers of TCT images. Furthermore, doctors' judgment of large images is easily influenced by subjective factors, leading to misdiagnosis and missed diagnosis.
A lightweight cervical cancer image cell detection system based on causal attention is adopted. Through modular design, the YOLOv5 model is used as the basis, and deformable convolutional modules guided by causal attention mechanism and lightweight convolutional structures are added to build a model for detecting abnormal cell regions in cervical cancer images. Combined with sample data augmentation and model training, efficient detection of abnormal cell regions is achieved.
It improves the efficiency and accuracy of TCT image detection for cervical cancer, reduces model deployment costs, and enhances the learning ability and background generalization ability for complex cervical cell image regions, enabling rapid identification of abnormal cells.
Smart Images

Figure CN115761218B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a lightweight cervical cancer image cell detection system based on causal attention, belonging to the field of target detection and recognition technology. Background Technology
[0002] Cervical cancer ranks fourth in both incidence and mortality among female cancers worldwide, and second only to breast cancer among gynecological malignancies, with approximately 604,000 new cases and 342,000 deaths globally in 2020. Cytological screening based on the Pap smear method has significantly reduced the mortality rate of squamous cell cervical cancer (accounting for 80%-90%). Thin-layer liquid-based cytology (TCT) is a commonly used method for early cervical cancer screening. TCT extracts cytological images from an electron microscope. Its resolution often depends on the magnification during the scan; scanning a 1 square millimeter area at 40x magnification can generate an image size of up to 48MB, and the complete image size can reach 1-3GB, with a resolution of 70,000 x 70,000 pixels. For doctors, quickly and accurately interpreting such a large image is difficult and easily influenced by subjective factors, leading to misdiagnosis and missed diagnosis. Therefore, an efficient and accurate auxiliary diagnostic system is necessary to assist doctors in making judgments.
[0003] Computer systems cannot directly process such a large image. Therefore, the image needs to be divided into 1024*1024 grid images, which yields nearly 5000 images. These images are then recognized separately and stitched together to obtain the final result. Existing recognition methods are mainly complex networks further improved from heavyweight models such as Faster R-CNN. However, these methods are costly to deploy and have slow inference speeds, making it difficult to meet the need for rapidly detecting a large number of TCT images to form a complete detection result. Summary of the Invention
[0004] The technical problem to be solved by this invention is to provide a lightweight cervical cancer image cell detection system based on causal attention. Through modular design, it completes sample data establishment and model construction training and application, and achieves efficient abnormality detection for cervical cancer TCT images.
[0005] To solve the above-mentioned technical problems, the present invention adopts the following technical solution: The present invention designs a lightweight cervical cancer image cell detection system based on causal attention, which is used to obtain a cervical cancer image abnormal cell region detection model through a sample data acquisition module, a model construction module, and a model training and generation module.
[0006] The sample data acquisition module is used to acquire a preset number of cervical cancer TCT sample images, and each cervical cancer TCT sample image contains an abnormal cell region bounding box. The sample data is composed of the cervical cancer TCT sample images and the abnormal cell region bounding boxes contained therein, thereby obtaining each sample data.
[0007] The model building module is used to build a trainable model based on the YOLOv5 model by adding deformable convolutional modules guided by causal attention mechanisms and using lightweight convolutional structure design.
[0008] The model training and generation module, based on various sample data, is used to train the model to be trained by taking the TCT sample image of cervical cancer as input and the bounding boxes of each abnormal cell region contained therein as output, thereby obtaining a cervical cancer image abnormal cell region detection model.
[0009] As a preferred technical solution of the present invention, it also includes a detection application module, which is used to process the actual TCT image of cervical cancer using a cervical cancer image abnormal cell region detection model to obtain the bounding boxes of each abnormal cell region on the actual TCT image of cervical cancer.
[0010] As a preferred technical solution of the present invention, it further includes a sample data enhancement module, which performs two preprocessing operations on each sample data. First, it rotates each cervical cancer TCT sample image by corresponding preset rotation angles to obtain each rotated cervical cancer TCT sample image, and combines it with the corresponding abnormal cell region boxes to form each sample data, thereby expanding the sample data obtained by the sample data acquisition module. Second, it performs a clustering algorithm on the size of each abnormal cell region box involved in all sample data to obtain a preset number of initial abnormal cell region box sizes with prior knowledge.
[0011] The model training and generation module, based on each sample data and combined with the prior initial abnormal cell region bounding box sizes, is used to train the model to be trained using cervical cancer TCT sample images as input and the bounding boxes of each abnormal cell region contained therein as output, thereby obtaining a cervical cancer image abnormal cell region detection model.
[0012] As a preferred embodiment of the present invention, the loss function involved in the training process of the model training generation module during the training of the model to be trained is as follows:
[0013] Loss=ObjLoss+CIOULoss+CLSLoss
[0014] Where CIOULoss represents the localization loss as follows:
[0015]
[0016]
[0017] CIOULoss = 1 - CIOU.
[0018] Where α represents the weighting factor in the aspect ratio formula for the abnormal cell region bounding box, v is used to measure the consistency of the aspect ratio between the predicted abnormal cell region bounding box and the corresponding ground truth bounding box, and w gt h represents the width of the true bounding box of the abnormal cell region. gt b represents the height of the true bounding box of the abnormal cell region gt denoted by , w represents the width of the predicted bounding box of the abnormal cell region, h represents the height of the predicted bounding box of the abnormal cell region, b represents the center point coordinates of the predicted bounding box of the abnormal cell region, IOU represents the intersection-union ratio between the predicted bounding box of the abnormal cell region and the corresponding ground truth bounding box of the abnormal cell region, ρ represents the Euclidean distance between the center point coordinates of the predicted bounding box of the abnormal cell region and the center point coordinates of the corresponding ground truth bounding box of the abnormal cell region, and c represents the diagonal length of the minimum bounding rectangle of the predicted bounding box of the abnormal cell region and the corresponding ground truth bounding box of the abnormal cell region.
[0019] CLSLoss represents the classification loss as follows:
[0020]
[0021] Among them, BCEWithLogitsLoss(p o ,y o )=-(y o log(Sigmoid(p o ))+(1-y o )log(Sigmoid(1-p o )), obj represents the set of predicted boxes for abnormal cell regions, N obj This represents the number of abnormal cell region prediction boxes in the set obj, and o represents an abnormal cell region prediction box o in the set obj. p o y represents the score of the predicted bounding box o for the abnormal cell region during the training of the model to be trained. o Indicates whether the predicted box o for the abnormal cell region is a correct box or an incorrect box;
[0022] ObjLoss represents the confidence loss as follows: the positions where the mask matrix of the predicted bounding box of the abnormal cell region is True are assigned the CIOU value truncated by the ReLU function, ensuring that the value range is 0-1, and the positions where it is False are assigned the value 0. Finally, BCEWithLogitsLoss is calculated for each grid to obtain the confidence loss of the abnormal cell region.
[0023]
[0024] Where m represents the set of mesh masks corresponding to the feature maps of the cervical cancer TCT images obtained by the model to be trained, and point is a point in set m. point Indicates whether the point contains abnormal cell regions, c point This represents the CIOU value of the point.
[0025] As a preferred embodiment of the present invention, the model building module is based on the YOLOv5 model, and constructs the model to be trained as follows by adding a deformable convolution module guided by a causal attention mechanism and using a lightweight convolution structure design:
[0026] The model to be trained includes a backbone network, a neck network, and detection networks (Heads). The backbone network consists of a first CBS module, a second CBS module, a first C3 module, a third CBS module, a second C3 module, a fourth CBS module, a third C3 module, a CCAD C3 module, and an SPPF module, which are connected in series from input to output. The input of the first CBS module constitutes the input of the backbone network, and the output of the SPPF module constitutes the output of the backbone network.
[0027] The neck network, from its input to its output, comprises, in series, a first GSConv module, a first upsampling UpSample module, a first connection Concat module, a first SimGSC3 module, a second GSConv module, a second upsampling UpSample module, a second connection Concat module, a second SimGSC3 module, a third GSConv module, a third connection Concat module, a third SimGSC3 module, a fourth GSConv module, a fourth connection Concat module, and a fourth SimGSC3 module. The input of the first GSConv module constitutes the input of the neck network, and the output of the fourth SimGSC3 module constitutes the output of the neck network.
[0028] The detection network Heads include the Detect1 module, the Detect2 module, and the Detect3 module;
[0029] The input terminals of the backbone network constitute the input terminals of the model to be trained. The output terminal of the second C3 module in the backbone network is simultaneously connected to the input terminal of the second connection concat module in the neck network. The output terminal of the third C3 module in the backbone network is simultaneously connected to the input terminal of the first connection concat module in the neck network. The output terminal of the backbone network is connected to the input terminal of the neck network. The output terminal of the first GSConv module in the neck network is connected to the input terminal of the fourth connection concat module, and the output terminal of the second GSConv module in the neck network is connected to the input terminal of the third connection concat module. The output of the second Concat module in the Neck network is connected to the input of the second SimGSC3 module; the output of the second SimGSC3 module in the Neck network is connected to the input of the Detect1 module in the Heads of the detection network; the output of the third SimGSC3 module in the Neck network is connected to the input of the Detect2 module in the Heads of the detection network; and the output of the Neck network is connected to the input of the Detect3 module in the Heads of the detection network. The outputs of the Detect1, Detect2, and Detect3 modules in the Heads of the detection network constitute the outputs of the model to be trained.
[0030] As a preferred embodiment of the present invention: the CCADC3 module includes an intra-block first CBS module, an intra-block second CBS module, an intra-block third CBS module, an intra-block first connecting Concat module, N-2 DCNBottleNeck modules, and 2 CCADBottleNeck modules; wherein, N is the number of BottleNeck modules included in the C3 structure, the input terminal of the intra-block first CBS module is connected to the input terminal of the intra-block second CBS module, and the connection terminal constitutes the input terminal of the CCADC3 module, the N-2 DCNBottleNeck modules and the 2 CCADBottleNeck modules are connected in series from the input terminal to the output terminal, the output terminal of the intra-block first CBS module is connected to the input terminal of the series structure, the output terminal of the series structure and the output terminal of the intra-block second CBS module are respectively connected to the input terminal of the intra-block first connecting Concat module, the output terminal of the intra-block first connecting Concat module is connected to the input terminal of the intra-block third CBS module, and the output terminal of the intra-block third CBS module constitutes the output terminal of the CCADC3 module.
[0031] As a preferred embodiment of the present invention: the CCADBottleNeck module includes two DCNBottleNeck modules and two causal attention analysis modules, wherein the input of one of the DCNBottleNeck modules constitutes the CCAD... The input terminal of the BottleNeck module is connected to the input terminal of one of the causal attention analysis modules. The input terminal of the CCADBottleNeck module and the positive output terminal of the causal attention analysis module are connected to the input terminal of the first fusion module within the block. The input terminal of the CCADBottleNeck module and the negative output terminal of the causal attention analysis module are connected to the input terminal of the second fusion module within the block. The output terminals of the first and second fusion modules within the block are connected to the input terminal of another DCNBottleNeck module. The output terminal of the DCNBottleNeck module is connected to the input terminal of another causal attention analysis module. The output terminal of the first fusion module and the positive output terminal of the causal attention analysis module are connected to the input terminal of the third fusion module within the block. The output terminal of the second fusion module and the negative output terminal of the causal attention analysis module are connected to the input terminal of the fourth fusion module within the block. The output terminal of the third fusion module within the block constitutes the output terminal of the CCADBottleNeck module.
[0032] The two causal attention analysis modules have the same structure. Each causal attention analysis module includes a CA attention module and two fusion SiLu modules. In the structure of each causal attention analysis module, the input end of the CA attention module constitutes the input end of the causal attention analysis module. The output end of the CA attention module and its positive output end are connected to the input end of one of the fusion SiLu modules. The output end of the fusion SiLu module constitutes the positive output end of the causal attention analysis module. The output end of the CA attention module and its negative output end are connected to the input end of the other fusion SiLu module. The output end of the fusion SiLu module constitutes the negative output end of the causal attention analysis module.
[0033] As a preferred embodiment of the present invention: the DCNBottleNeck module includes an intra-block fourth CBS module, a DBS module, and an intra-block fifth fusion module. The input of the intra-block fourth CBS module constitutes the input of the DCNBottleNeck module, and the output of the fourth CBS module is connected to the input of the DBS module. The output of the DBS module is connected to the input of the intra-block fifth fusion module, and the output of the intra-block fifth fusion module constitutes the output of the DCNBottleNeck module. The DBS module, from its input to its output, sequentially includes a deformable convolutional DCN module, a BN module, and a SiLu module. The input of the deformable convolutional DCN module constitutes the input of the DBS module, and the output of the SiLu module constitutes the output of the DBS module.
[0034] As a preferred embodiment of the present invention: the first SimGSC3 module, the second SimGSC3 module, the third SimGSC3 module, and the fourth SimGSC3 module have the same structure. Each SimGSC3 module includes a fifth CBS module within the block, a second connecting Concat module within the block, a sixth CBS module within the block, and N GSBottleNeck modules. The input terminal of the fifth CBS module within the block constitutes the input terminal of the SimGSC3 module. The output terminal of the fifth CBS module within the block is connected in series with N GSBottleNeck modules. The output terminal of the fifth CBS module within the block is simultaneously connected to the input terminal of the second connecting Concat module within the block, and the output terminal of the second connecting Concat module within the block is connected to the input terminal of the sixth CBS module within the block. The output terminal of the sixth CBS module within the block constitutes the output terminal of the SimGSC3 module. Each GSBottleNeck module has the same structure. Each GSBottleNeck module includes two GSConv modules connected in series. The input and output terminals of the series structure constitute the input and output terminals of the GSBottleNeck module, respectively.
[0035] As a preferred embodiment of the present invention: the structures of each GSConv module are identical, and each GSConv module includes an intra-block first Conv module, a depthwise convolutional DWConv module, an intra-block third connection Concat module, and a Shuffle module. In the structure of each GSConv module, the input end of the intra-block first Conv module constitutes the input end of the GSConv module, the output end of the intra-block first Conv module is connected to the input end of the depthwise convolutional DWConv module and one of the input ends of the intra-block third connection Concat module, the output end of the depthwise convolutional DWConv module is connected to the other input end of the intra-block third connection Concat module, the output end of the intra-block third connection Concat module is connected to the input end of the Shuffle module, and the output end of the Shuffle module constitutes the output end of the GSConv module. The structures of each CBS module are identical, and each CBS module includes a Conv2D module, a BN module, and a SiLu module in sequence from its input end to its output end. The input end of the Conv2D module constitutes the input end of the CBS module, and the output end of the SiLu module constitutes the output end of the CBS module.
[0036] The lightweight cervical cancer image cell detection system based on causal attention described in this invention has the following technical advantages compared with existing technologies:
[0037] This invention presents a lightweight cervical cancer image cell detection system based on causal attention. Employing a modular design, each module constructs sample data. Based on the YOLOv5 model, a deformable convolutional module guided by causal attention and a lightweight convolutional structure are added to build the model to be trained. The system takes cervical cancer TCT sample images as input and the bounding boxes of abnormal cell regions contained within them as output, training the model to obtain a cervical cancer image abnormal cell region detection model. Furthermore, it identifies images of antigen detection kits. The design incorporates a deformable convolutional module guided by causal attention, improving the feature extraction structure of deep networks and enhancing the model's ability to learn complex and irregular morphological features of cervical cell image regions and its generalization ability to complex backgrounds. By using a lightweight convolutional structure to design a finer neck network, the number of model parameters and computational load can be reduced without compromising model accuracy, resulting in faster inference speed and lower deployment costs. This leads to efficient and accurate identification of abnormal cells in cervical cancer TCT images, improving the efficiency of cervical cancer TCT screening. Attached Figure Description
[0038] Figure 1A block diagram of a lightweight cervical cancer image cell detection system based on causal attention designed for this invention;
[0039] Figure 2 This is a schematic diagram of a specific deformable convolution application structure in the design of this invention;
[0040] Figure 3 This is a schematic diagram of a deformable convolutional structure specifically designed with causal attention guidance in this invention.
[0041] Figure 4 This is a schematic diagram of the specific GSConv structure in the design of this invention;
[0042] Figure 5 This is a schematic diagram of the structure of a specific lightweight network module in the design of this invention;
[0043] Figure 6 This is a schematic diagram of the overall model to be trained in the design of this invention;
[0044] Figure 7 This is a schematic diagram of the TCT image detection structure for cervical cancer in the design and application of this invention. Detailed Implementation
[0045] The specific embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.
[0046] This invention designs a lightweight cervical cancer image cell detection system based on causal attention. In practical applications, such as... Figure 1 As shown, a model for detecting abnormal cell regions in cervical cancer images is obtained through a sample data acquisition module, a sample data augmentation module, a model building module, and a model training and generation module.
[0047] The sample data acquisition module is used to acquire a preset number of cervical cancer TCT sample images, and each cervical cancer TCT sample image contains an abnormal cell region bounding box. The sample data is composed of the cervical cancer TCT sample images and the abnormal cell region bounding boxes contained therein, thereby obtaining each sample data.
[0048] In applications, such as acquiring cervical cancer TCT images of cervical cancer patients, the images are divided into abnormal cell regions based on a 1024*1024 grid. The abnormal cell regions are then divided into their corresponding categories under a preset classification to form sample data. This process yields various sample data. Here, the abnormal cell regions are labeled as (x, y, w, h, c), representing the x and y coordinates of the predicted bounding box in the image coordinate system, the width and height of the abnormal cell region, and the confidence level, respectively. The confidence level can be set to 1.
[0049] The sample data augmentation module performs two preprocessing operations on each sample data. First, it rotates each cervical cancer TCT sample image by a preset rotation angle to obtain rotated cervical cancer TCT sample images. These images are then combined with the corresponding abnormal cell region bounding boxes to form sample data, thus expanding the sample data obtained by the sample data acquisition module. Second, it performs a k-means clustering algorithm on the size of each abnormal cell region bounding box involved in all sample data to obtain a preset number of initial abnormal cell region bounding box sizes with prior knowledge.
[0050] The model building module is used to build the model to be trained based on the YOLOV5 (v6.0) model by adding a deformable convolution module guided by causal attention mechanism and using a lightweight convolution structure design.
[0051] like Figure 6 As shown, the model to be trained includes a backbone network, a neck network, and detection networks (Heads). The backbone network consists of a first CBS module, a second CBS module, a first C3 module, a third CBS module, a second C3 module, a fourth CBS module, a third C3 module, a CCADC3 module, and an SPPF module, which are connected in series from input to output. The input of the first CBS module constitutes the input of the backbone network, and the output of the SPPF module constitutes the output of the backbone network.
[0052] like Figure 6 As shown, the neck network, from its input to its output, comprises, in series, a first GSConv module, a first upsampling UpSample module, a first connection Concat module, a first SimGSC3 module, a second GSConv module, a second upsampling UpSample module, a second connection Concat module, a second SimGSC3 module, a third GSConv module, a third connection Concat module, a third SimGSC3 module, a fourth GSConv module, a fourth connection Concat module, and a fourth SimGSC3 module. The input of the first GSConv module constitutes the input of the neck network, and the output of the fourth SimGSC3 module constitutes the output of the neck network. The detection network heads include Detect1, Detect2, and Detect3 modules.
[0053] like Figure 6As shown, the input of the backbone network constitutes the input of the model to be trained. The output of the second C3 module in the backbone network is simultaneously connected to the input of the second concat module in the neck network. The output of the third C3 module in the backbone network is simultaneously connected to the input of the first concat module in the neck network. The output of the backbone network is connected to the input of the neck network. The output of the first GSConv module in the neck network is connected to the input of the fourth concat module. The output of the second GSConv module in the neck network is connected to the input of the third concat module. At the input end, the output of the second connection Concat module in the Neck network is connected to the input of the second SimGSC3 module; the output of the second SimGSC3 module in the Neck network is connected to the input of the Detect1 module in the Heads of the detection network; the output of the third SimGSC3 module in the Neck network is connected to the input of the Detect2 module in the Heads of the detection network; and the output of the Neck network is connected to the input of the Detect3 module in the Heads of the detection network. The outputs of the Detect1, Detect2, and Detect3 modules in the Heads of the detection network constitute the various outputs of the model to be trained.
[0054] Among them, such as Figure 3 As shown in (b), the CCADC3 module includes a first CBS module within the block, a second CBS module within the block, a third CBS module within the block, a first connecting Concat module within the block, N-2 DCNBottleNeck modules, and 2 CCADBottleNeck modules; where N is the number of BottleNeck modules included in the C3 structure. The input terminal of the first CBS module within the block is connected to the input terminal of the second CBS module within the block, and this connection terminal constitutes the input terminal of the CCADC3 module. The N-2 DCNBottleNeck modules and the 2 CCADBottleNeck modules are connected in series from the input terminal to the output terminal. The output terminal of the first CBS module within the block is connected to the input terminal of this series structure. The output terminal of this series structure and the output terminal of the second CBS module within the block are respectively connected to the input terminal of the first connecting Concat module within the block. The output terminal of the first connecting Concat module within the block is connected to the input terminal of the third CBS module within the block. The output terminal of the third CBS module within the block constitutes the output terminal of the CCADC3 module.
[0055] In applications, such as Figure 3As shown in (a), the CCADBottleNeck module includes two DCNBottleNeck modules and two causal attention analysis modules. The input of one DCNBottleNeck module constitutes the input of the CCADBottleNeck module. The output of the DCNBottleNeck module is connected to the input of one of the causal attention analysis modules. The input of the CCADBottleNeck module and the positive output of the causal attention analysis module are connected to the input of the first fusion module within the block. The input of the CCADBottleNeck module and the negative output of the causal attention analysis module are connected to the input of the causal attention analysis module. The output terminal is connected to the input terminal of the second fusion module within the block; the output terminals of the first fusion module within the block and the second fusion module within the block are connected to the input terminal of another DCNBottleNeck module, the output terminal of the DCNBottleNeck module is connected to the input terminal of another causal attention analysis module, the output terminal of the first fusion module within the block and the positive output terminal of the causal attention analysis module are connected to the input terminal of the third fusion module within the block, the output terminal of the second fusion module within the block and the negative output terminal of the causal attention analysis module are connected to the input terminal of the fourth fusion module within the block; the output terminal of the third fusion module within the block constitutes the output terminal of the CCADBottleNeck module.
[0056] The two causal attention analysis modules have the same structure. Each causal attention analysis module includes a CA attention module and two fusion SiLu modules. In the structure of each causal attention analysis module, the input end of the CA attention module constitutes the input end of the causal attention analysis module. The output end of the CA attention module and its positive output end are connected to the input end of one of the fusion SiLu modules. The output end of the fusion SiLu module constitutes the positive output end of the causal attention analysis module. The output end of the CA attention module and its negative output end are connected to the input end of the other fusion SiLu module. The output end of the fusion SiLu module constitutes the negative output end of the causal attention analysis module.
[0057] like Figure 2 As shown in (c) and (d), the DCNBottleNeck module is designed to include a fourth CBS module, a DBS module, and a fifth fusion module within the block. The input of the fourth CBS module constitutes the input of the DCNBottleNeck module; the output of the fourth CBS module is connected to the input of the DBS module; the output of the DBS module is connected to the input of the fifth fusion module within the block; and the output of the fifth fusion module constitutes the output of the DCNBottleNeck module. Figure 2As shown in (b), the DBS module includes a deformable convolution DCN module, a BN module, and a SiLu module in sequence from its input end to its output end. The input end of the deformable convolution DCN module constitutes the input end of the DBS module, and the output end of the SiLu module constitutes the output end of the DBS module.
[0058] The first, second, third, and fourth SimGSC3 modules have the same structure, such as... Figure 5 As shown in (b), each SimGSC3 module includes a fifth CBS module within the block, a second concatenation module within the block, a sixth CBS module within the block, and N GSBottleNeck modules. The input of the fifth CBS module within the block constitutes the input of the SimGSC3 module. The output of the fifth CBS module within the block is connected in series with the N GSBottleNeck modules. The output of the fifth CBS module within the block is simultaneously connected to the input of the second concatenation module within the block, and the output of the second concatenation module within the block is connected to the input of the sixth CBS module within the block. The output of the sixth CBS module within the block constitutes the output of the SimGSC3 module. Figure 5 As shown in (a), each GSBottleNeck module has the same structure. Each GSBottleNeck module includes two GSConv modules connected in series. The input and output terminals of this series structure constitute the input and output terminals of the GSBottleNeck module, respectively.
[0059] like Figure 4 As shown, the structures of each GSConv module are identical. Each GSConv module includes an intra-block first Conv module, a depthwise convolutional DWConv module, an intra-block third connection concat module, and a Shuffle module. In each GSConv module structure, the input of the intra-block first Conv module constitutes the input of the GSConv module. The output of the intra-block first Conv module is connected to one of the inputs of the depthwise convolutional DWConv module and the intra-block third connection concat module. The output of the depthwise convolutional DWConv module is connected to the other input of the intra-block third connection concat module. The output of the intra-block third connection concat module is connected to the input of the Shuffle module. The output of the Shuffle module constitutes the output of the GSConv module. Figure 2As shown in (b), each CBS module has the same structure. Each CBS module includes a Conv2D module, a BN module, and a SiLu module in sequence from its input end to its output end. The input end of the Conv2D module constitutes the input end of the CBS module, and the output end of the SiLu module constitutes the output end of the CBS module.
[0060] The model training and generation module, based on various sample data and combined with the prior initial abnormal cell region bounding box sizes, is used to train the model to be trained by taking the cervical cancer TCT sample image as input and the bounding boxes of the abnormal cell regions contained therein as output, thereby obtaining the abnormal cell region detection model for cervical cancer images.
[0061] The loss function involved in the training process of the model generation module during the training of the model to be trained is as follows:
[0062] Loss=ObjLoss+CIOULoss+CLSLoss
[0063] Where CIOULoss represents the localization loss as follows:
[0064]
[0065]
[0066] CIOULoss = 1 - CIOU.
[0067] Where α represents the weighting factor in the aspect ratio formula for the abnormal cell region bounding box, v is used to measure the consistency of the aspect ratio between the predicted abnormal cell region bounding box and the corresponding ground truth bounding box, and w gt h represents the width of the true bounding box of the abnormal cell region. gt b represents the height of the true bounding box of the abnormal cell region gt denoted by , w represents the width of the predicted bounding box of the abnormal cell region, h represents the height of the predicted bounding box of the abnormal cell region, b represents the center point coordinates of the predicted bounding box of the abnormal cell region, IOU represents the intersection-union ratio between the predicted bounding box of the abnormal cell region and the corresponding ground truth bounding box of the abnormal cell region, ρ represents the Euclidean distance between the center point coordinates of the predicted bounding box of the abnormal cell region and the center point coordinates of the corresponding ground truth bounding box of the abnormal cell region, and c represents the diagonal length of the minimum bounding rectangle of the predicted bounding box of the abnormal cell region and the corresponding ground truth bounding box of the abnormal cell region.
[0068] CLSLoss represents the classification loss as follows:
[0069]
[0070] Among them, BCEWithLogitsLoss(p o,y o )=-(y o log(Sigmoid(p o ))+(1-y o )log(Sigmoid(1-p o )), obj represents the set of predicted boxes for abnormal cell regions, N obj This represents the number of abnormal cell region prediction boxes in the set obj, and o represents an abnormal cell region prediction box o in the set obj. p o y represents the score of the predicted bounding box o for the abnormal cell region during the training of the model to be trained. o Indicates whether the predicted box o for the abnormal cell region is a correct box or an incorrect box;
[0071] ObjLoss represents the confidence loss as follows: the positions where the mask matrix of the predicted bounding box of the abnormal cell region is True are assigned the CIOU value truncated by the ReLU function, ensuring that the value range is 0-1, and the positions where it is False are assigned the value 0. Finally, BCEWithLogitsLoss is calculated for each grid to obtain the confidence loss of the abnormal cell region.
[0072]
[0073] Where m represents the set of mesh masks corresponding to the feature maps of the cervical cancer TCT images obtained by the model to be trained, and point is a point in set m. point Indicates whether the point contains abnormal cell regions, c point This represents the CIOU value of the point.
[0074] Based on the above-mentioned design module application, a cervical cancer image abnormal cell region detection model is obtained. Further design incorporates a detection application module to process actual cervical cancer TCT images (i.e., images from the antigen detection kit), using the cervical cancer image abnormal cell region detection model to obtain bounding boxes of various abnormal cell regions on the actual cervical cancer TCT image, such as... Figure 7 As shown.
[0075] The aforementioned technical solution designs a lightweight cervical cancer image cell detection system based on causal attention. It employs a modular design, with each module separately constructing sample data. Based on the YOLOv5 model, it adds a deformable convolutional module guided by causal attention and uses a lightweight convolutional structure design to construct the model to be trained. The system takes cervical cancer TCT sample images as input and the bounding boxes of abnormal cell regions contained within them as output, training the model to obtain a cervical cancer image abnormal cell region detection model. Furthermore, it identifies images of antigen detection kits. The design incorporates a deformable convolutional module guided by causal attention, improving the feature extraction structure of deep networks and enhancing the model's ability to learn complex and irregular morphological features of cervical cell image regions and its generalization ability to complex backgrounds. By using a lightweight convolutional structure to design a finer neck network, the number of model parameters and computational load can be reduced without compromising model accuracy, resulting in faster inference speed and lower deployment costs. This leads to efficient and accurate identification of abnormal cells in cervical cancer TCT images, improving the efficiency of cervical cancer TCT screening.
[0076] The embodiments of the present invention have been described in detail above with reference to the accompanying drawings. However, the present invention is not limited to the above embodiments. Within the scope of knowledge possessed by those skilled in the art, various changes can be made without departing from the spirit of the present invention.
Claims
1. A light-weight cervical cancer image cell detection system based on causal attention, characterized by: The sample data obtaining module, the model constructing module, and the model training generating module are used to obtain a cervical cancer image abnormal cell region detection model; the sample data obtaining module is used to obtain a preset number of cervical cancer TCT sample images, and each cervical cancer TCT sample image contains an abnormal cell region frame; the sample data is composed of the cervical cancer TCT sample image and the abnormal cell region frame contained thereon, and then each sample data is obtained; The model constructing module is used to construct a to-be-trained model based on a YOLOV5 model by adding a causal attention mechanism guided deformable convolution module and using a lightweight convolution structure design; The model training generating module is used to train the to-be-trained model based on each sample data, with the cervical cancer TCT sample image as input and the abnormal cell region frame contained thereon as output, to obtain the cervical cancer image abnormal cell region detection model; The to-be-trained model constructed by the model constructing module is constructed based on the YOLOV5 model by adding the causal attention mechanism guided deformable convolution module and using the lightweight convolution structure design as follows: The to-be-trained model includes a backbone network Backbone, a neck network Neck, and a detection network Heads; the backbone network Backbone includes a first CBS module, a second CBS module, a first C3 module, a third CBS module, a second C3 module, a fourth CBS module, a third C3 module, a CCAD C3 module, and an SPPF module connected in series from the input end to the output end; the input end of the first CBS module constitutes the input end of the backbone network Backbone, and the output end of the SPPF module constitutes the output end of the backbone network Backbone; The neck network Neck includes a first GSConv module, a first up-sampling UpSample module, a first connection Concat module, a first SimGSC3 module, a second GSConv module, a second up-sampling UpSample module, a second connection Concat module, a second SimGSC3 module, a third GSConv module, a third connection Concat module, a third SimGSC3 module, a fourth GSConv module, a fourth connection Concat module, and a fourth SimGSC3 module connected in series from the input end to the output end; the input end of the first GSConv module constitutes the input end of the neck network Neck, and the output end of the fourth SimGSC3 module constitutes the output end of the neck network Neck; The detection network Heads includes a Detect1 module, a Detect2 module, and a Detect3 module. The input end of the backbone network Backbone constitutes an input end of the to-be-trained model, the output end of the second C3 module in the backbone network Backbone is connected to the input end of the second connection Concat module in the neck network Neck, the output end of the third C3 module in the backbone network Backbone is connected to the input end of the first connection Concat module in the neck network Neck, and the output end of the backbone network Backbone is connected to the input end of the neck network Neck; the output end of the first GSConv module in the neck network Neck is connected to the input end of the fourth connection Concat module, the output end of the second GSConv module in the neck network Neck is connected to the input end of the third connection Concat module, the output end of the second connection Concat module in the neck network Neck is connected to the input end of the second SimGSC3 module; the output end of the second SimGSC3 module in the neck network Neck is connected to the input end of the Detect1 module in the detection network Heads, the output end of the third SimGSC3 module in the neck network Neck is connected to the input end of the Detect2 module in the detection network Heads, and the output end of the neck network Neck is connected to the input end of the Detect3 module in the detection network Heads; the output end of the Detect1 module, the output end of the Detect2 module and the output end of the Detect3 module in the detection network Heads constitute respective output ends of the to-be-trained model; The CCAD C3 module comprises an intra-block first CBS module, an intra-block second CBS module, an intra-block third CBS module, an intra-block first connection Concat module, N-2 DCN BottleNeck modules and two CCAD BottleNeck modules; wherein N is the number of BottleNeck modules contained in the C3 structure, the input end of the intra-block first CBS module is connected to the input end of the intra-block second CBS module, and the connected end constitutes the input end of the CCAD C3 module, the N-2 DCN BottleNeck modules and the two CCAD BottleNeck modules are connected in series from the input end to the output end, the output end of the intra-block first CBS module is connected to the input end of the series connection structure, the output end of the series connection structure is connected to the output end of the intra-block second CBS module, the input end of the intra-block first connection Concat module, the output end of the intra-block first connection Concat module is connected to the input end of the intra-block third CBS module, and the output end of the intra-block third CBS module constitutes the output end of the CCAD C3 module; The CCAD BottleNeck module includes two DCN BottleNeck modules and two causal attention analysis modules, an input end of one of the DCN BottleNeck modules constitutes an input end of the CCAD BottleNeck module, an output end of the DCN BottleNeck module is connected to an input end of one of the causal attention analysis modules, the input end of the CCAD BottleNeck module is connected to a forward output end of the causal attention analysis module, an input end of an intra-block first fusion module, the input end of the CCAD BottleNeck module is connected to a negative output end of the causal attention analysis module, an input end of an intra-block second fusion module, an output end of the intra-block first fusion module is connected to an output end of the intra-block second fusion module, and an input end of the other DCN BottleNeck module, an output end of the DCN BottleNeck module is connected to an input end of the other causal attention analysis module, the output end of the intra-block first fusion module is connected to a forward output end of the causal attention analysis module, an input end of an intra-block third fusion module, the output end of the intra-block second fusion module is connected to a negative output end of the causal attention analysis module, an input end of an intra-block fourth fusion module, and an output end of the intra-block third fusion module constitutes an output end of the CCAD BottleNeck module; The two causal attention analysis modules have the same structure, and each causal attention analysis module includes a CA attention module and two fusion SiLu modules, in the structure of each causal attention analysis module, an input end of the CA attention module constitutes an input end of the causal attention analysis module, an output end of the CA attention module is connected to an input end of one of the fusion SiLu modules via a result forward output end thereof, an output end of the fusion SiLu module constitutes a forward output end of the causal attention analysis module, the output end of the CA attention module is connected to an input end of the other fusion SiLu module via a result negative output end thereof, and an output end of the fusion SiLu module constitutes a negative output end of the causal attention analysis module; The DCN BottleNeck module includes an intra-block fourth CBS module, a DBS module, and an intra-block fifth fusion module, an input end of the intra-block fourth CBS module constitutes an input end of the DCN BottleNeck module, an output end of the fourth CBS module is connected to an input end of the DBS module, an output end of the DBS module is connected to an input end of the intra-block fifth fusion module via the input end of the DCN BottleNeck module, and an output end of the intra-block fifth fusion module constitutes an output end of the DCN BottleNeck module; the DBS module includes a deformable convolution DCN module, a BN module, and a SiLu module in sequence from an input end thereof to an output end thereof, the input end of the deformable convolution DCN module constitutes the input end of the DBS module, and an output end of the SiLu module constitutes the output end of the DBS module; The first SimGSC3 module, the second SimGSC3 module, the third SimGSC3 module and the fourth SimGSC3 module are the same in structure, and each SimGSC3 module comprises an in-block fifth CBS module, an in-block second connection Concat module, an in-block sixth CBS module and N GSBottleNeck modules, wherein the input end of the in-block fifth CBS module constitutes the input end of the SimGSC3 module, the output end of the in-block fifth CBS module is connected with N GSBottleNeck modules in series, the output end of the in-block fifth CBS module is connected with the output end of the series structure and the input end of the in-block second connection Concat module at the same time, the output end of the in-block second connection Concat module is connected with the input end of the in-block sixth CBS module, and the output end of the in-block sixth CBS module constitutes the output end of the SimGSC3 module; each GSBottleNeck module is the same in structure, and each GSBottleNeck module comprises two GSConv modules connected in series, and the input end and the output end of the series structure constitute the input end and the output end of the GSBottleNeck module.
2. The lightweight cervical cancer image cell detection system based on causal attention according to claim 1, wherein: The application further comprises a detection application module configured to apply the cervical cancer image abnormal cell region detection model to the cervical cancer TCT actual image to obtain each abnormal cell region frame on the cervical cancer TCT actual image.
3. The lightweight cervical cancer image cell detection system based on causal attention according to claim 1, wherein: The application further comprises a sample data enhancement module configured to perform two preprocessing operations on each sample data, one of which is to rotate each cervical cancer TCT sample image by a corresponding preset rotation angle to obtain each rotated cervical cancer TCT sample image, and combine the corresponding abnormal cell region frame to form each sample data, thereby expanding each sample data obtained by the sample data obtaining module; and the other of which is to perform a clustering algorithm on the size of each abnormal cell region frame involved in all sample data to obtain a preset number of initial abnormal cell region frame sizes with priori. The model training generation module is configured to train the to-be-trained model by taking the cervical cancer TCT sample image as input and each abnormal cell region frame contained thereon as output based on each sample data and the initial abnormal cell region frame sizes with priori, and obtain the cervical cancer image abnormal cell region detection model.
4. The lightweight cervical cancer image cell detection system based on causal attention according to any one of claims 1-3, characterized in that: The loss function involved in the training process of the to-be-trained model by the model training generation module is as follows: Loss = ObjLoss + CIOULoss + CLSLoss Wherein, CIOULoss represents a positioning loss as follows: CIOULoss = 1-CIOU. wherein, a represents a weight factor of the abnormal cell area bounding box length-width ratio formula, v is used to measure the uniformity of the length-width ratio between the abnormal cell area prediction bounding box and the corresponding abnormal cell area real bounding box, w gt represents the width of the abnormal cell area real bounding box, h gt represents the height of the abnormal cell area real bounding box, b gt represents the center point coordinate of the abnormal cell area real bounding box, w represents the width of the abnormal cell area prediction bounding box, h represents the height of the abnormal cell area prediction bounding box, b represents the center point coordinate of the abnormal cell area prediction bounding box, IOU represents the intersection over union between the abnormal cell area prediction bounding box and the corresponding abnormal cell area real bounding box, p represents the Euclidean distance between the center point coordinates of the abnormal cell area prediction bounding box and the corresponding abnormal cell area real bounding box, and c represents the diagonal length of the minimum circumscribed rectangle of the abnormal cell area prediction bounding box and the corresponding abnormal cell area real bounding box. CLSLoss represents a classification loss as follows: where BCEWithLogitsLoss(p o ,y o ) = -(y o log(Sigmoid(p o )) + (1 - y o ) log(Sigmoid(1 - p o )) , obj represents a set of abnormal cell area prediction boxes, N obj represents the number of abnormal cell area prediction boxes in the set obj, o represents an abnormal cell area prediction box o in the set obj, p o represents the score predicted by the to-be-trained model in training about the abnormal cell area prediction box o, and y o represents whether the abnormal cell area prediction box o is a correct box or an incorrect box. The ObjLoss represents a confidence loss as follows: a mask matrix of an abnormal cell area prediction frame is set to true at a position, a CI0U value is truncated by a ReLu function, a value range is ensured to be 0-1, a false position is set to 0, and finally, a BCEWithLogitsLoss is calculated for each grid to obtain a confidence loss of the abnormal cell area. wherein m represents a grid mask set of a feature map corresponding to a cervical cancer TCT image obtained via a model to be trained, point is a certain point in the set m, m point represents whether point has an abnormal cell region, c point represents the CIOU value of the point point.
5. The lightweight cervical cancer image cell detection system based on causal attention according to claim 1, wherein: The structures of the GSConv modules are the same as each other, each GSConv module includes an in-block first Conv module, a depth convolution DWConv module, an in-block third connection Concat module, and a Shuffle module, in the structure of each GSConv module, an input end of the in-block first Conv module constitutes an input end of the GSConv module, output ends of the in-block first Conv module are respectively connected to an input end of the depth convolution DWConv module and one input end of the in-block third connection Concat module, an output end of the depth convolution DWConv module is connected to the other input end of the in-block third connection Concat module, an output end of the in-block third connection Concat module is connected to an input end of the Shuffle module, and an output end of the Shuffle module constitutes an output end of the GSConv module; the structures of the CBS modules are the same, each CBS module includes a Conv2D module, a BN module, and a SiLu module in sequence from an input end of the CBS module to an output end of the CBS module, the input end of the CBS module is constituted by an input end of the Conv2D module, and the output end of the CBS module is constituted by an output end of the SiLu module.