Micro cervical cell image classification system based on YOLOv8-CP
By introducing the context anchor attention mechanism and a strong loss function in the YOLOv8-CP network model, the problems of low detection accuracy of cervical cell images and difficulty in capturing small cell features are solved, and higher detection accuracy and recall rate are achieved.
Patent Information
- Application Number
- CN202411560517.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-04
- Publication Date
- 2025-03-11
AI Technical Summary
The prior art has low detection accuracy when processing cervical cell images, cannot effectively capture small cell characteristics, and the contribution loss of imbalanced samples is large.
Using a micro-cervical cell image classification system based on YOLOv8-CP, the focus capability of medium-quality anchor frames is enhanced by introducing a context anchor attention mechanism into the backbone network of the improved YOLOv8-CP network model and adding it to the front of the SPPF structure.
The model's ability to express cell features in the image is improved, ensuring accurate capture of small cells, reducing the contribution loss of imbalanced samples, and improving detection accuracy.
Smart Images

Figure CN119600329A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of microcervical cell image classification, and in particular to a microcervical cell image classification system based on YOLOv8-CP. Background Art
[0002] The statements in this section merely provide background information related to the present disclosure and do not necessarily constitute prior art.
[0003] Cervical cancer is caused by the malignant transformation of normal cells in the upper layer of the cervix. However, cervical cancer can be effectively prevented through early screening programs, especially the detection of abnormal cell changes in the precancerous stage. In current clinical practice, the Pap smear test is a mainstream cervical cancer screening method, which can identify precancerous and cancerous cell changes in the cervix. However, due to the complexity of pathological images, manual identification becomes time-consuming and laborious.
[0004] In order to solve these problems, computer-aided diagnosis systems have begun to be applied to cervical cell image classification and detection. Deep learning methods such as convolutional neural networks are applied to medical images. This technology uses a CNN-based target detection framework to obtain the classification and location of cells. According to whether a region candidate box is generated, it can be divided into two mainstream methods: a single-stage method and a two-stage method. The two-stage detection method first generates potential target regions (called region proposals or candidate boxes), and then performs further classification and precise positioning. This type of method can perform detailed feature processing on each candidate region in a more detailed manner, resulting in better detection results. However, due to its slow speed and high computing resource consumption, it also limits its application in scenarios such as real-time detection. Compared with the two-stage method, the single-stage method can directly perform rapid classification and positioning without presetting the region. This single-stage method achieves a near-real-time detection speed while ensuring a certain degree of accuracy.
[0005] Although the single-stage method can quickly and effectively extract target features in images, it does not perform well when dealing with tiny morphological targets. The detection accuracy is low when processing cervical cell images, and the ability to express cell features in the image is not strong. It cannot guarantee the accurate capture of small cells and the contribution loss of unbalanced samples. Summary of the invention
[0006] In order to solve the above problems, the present invention proposes a micro cervical cell image classification system based on YOLOv8-CP, and proposes a micro cervical cell image classification model based on YOLOv8-CP, which can effectively overcome the problem of low detection accuracy of YOLOv8 when processing cervical cell images, improve the model's ability to express cell features in the image, ensure the accurate capture of small cells, and reduce the contribution loss of unbalanced samples.
[0007] According to some embodiments, the present disclosure adopts the following technical solutions:
[0008] The micro-cervical cell image classification system based on YOLOv8-CP includes:
[0009] An image acquisition module is configured to acquire cervical cell pathology images and perform preprocessing;
[0010] A classification module is configured to input the preprocessed cervical cell pathology image into the improved YOLOv8-CP network model for identification and classification, and obtain the classified cervical cell type;
[0011] Among them, the preprocessed cervical cell pathology image is input into the improved YOLOv8-CP network model. In the improved YOLOv8-CP network model, the context anchor attention mechanism is introduced in the backbone network of the improved YOLOv8-CP network model, and it is added to the front of the SPPF structure. The context anchor attention mechanism is used to extract local area features, and the interdependence between remote pixels is enhanced. A strong loss function is introduced to enhance the focusing ability of medium-quality anchor frames, so as to realize the classification of cervical cell pathology images.
[0012] According to some embodiments, the present disclosure adopts the following technical solutions:
[0013] A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the following method steps are implemented:
[0014] Acquire cervical cell pathology images and perform preprocessing;
[0015] The preprocessed cervical cell pathology images are input into the improved YOLOv8-CP network model for identification and classification to obtain the classified cervical cell types;
[0016] Among them, the preprocessed cervical cell pathology image is input into the improved YOLOv8-CP network model. In the improved YOLOv8-CP network model, the context anchor attention mechanism is introduced in the backbone network of the improved YOLOv8-CP network model, and it is added to the front of the SPPF structure. The context anchor attention mechanism is used to extract local area features, and the interdependence between remote pixels is enhanced. A strong loss function is introduced to enhance the focusing ability of medium-quality anchor frames, so as to realize the classification of cervical cell pathology images.
[0017] According to some embodiments, the present disclosure adopts the following technical solutions:
[0018] A non-transitory computer-readable storage medium, the non-transitory computer-readable storage medium is used to store computer instructions, and when the computer instructions are executed by a processor, the following method steps are implemented:
[0019] Acquire cervical cell pathology images and perform preprocessing;
[0020] The preprocessed cervical cell pathology images are input into the improved YOLOv8-CP network model for identification and classification to obtain the classified cervical cell types;
[0021] Among them, the preprocessed cervical cell pathology image is input into the improved YOLOv8-CP network model. In the improved YOLOv8-CP network model, the context anchor attention mechanism is introduced in the backbone network of the improved YOLOv8-CP network model, and it is added to the front of the SPPF structure. The context anchor attention mechanism is used to extract local area features, and the interdependence between remote pixels is enhanced. A strong loss function is introduced to enhance the focusing ability of medium-quality anchor frames, so as to realize the classification of cervical cell pathology images.
[0022] According to some embodiments, the present disclosure adopts the following technical solutions:
[0023] An electronic device comprises: a processor, a memory and a computer program; wherein the processor is connected to the memory, the computer program is stored in the memory, and when the electronic device is running, the processor executes the computer program stored in the memory, so that the electronic device performs the following method steps:
[0024] Acquire cervical cell pathology images and perform preprocessing;
[0025] The preprocessed cervical cell pathology images are input into the improved YOLOv8-CP network model for identification and classification to obtain the classified cervical cell types;
[0026] Among them, the preprocessed cervical cell pathology image is input into the improved YOLOv8-CP network model. In the improved YOLOv8-CP network model, the context anchor attention mechanism is introduced in the backbone network of the improved YOLOv8-CP network model, and it is added to the front of the SPPF structure. The context anchor attention mechanism is used to extract local area features, and the interdependence between remote pixels is enhanced. A strong loss function is introduced to enhance the focusing ability of medium-quality anchor frames, so as to realize the classification of cervical cell pathology images.
[0027] Compared with the prior art, the present invention has the following beneficial effects:
[0028] The disclosed micro-cervical cell image classification system based on YOLOv8-CP proposes a micro-cervical cell detection model based on YOLOv8-CP, which is an improved YOLOv8-CP network model, and can effectively overcome the problem of low detection accuracy of YOLOv8 when processing cervical cell images, improve the model's ability to express cell features in images, ensure the accurate capture of small cells, and reduce the contribution loss of unbalanced samples.
[0029] The disclosed YOLOv8-CP-based microcervical cell image classification system introduces a contextual anchor attention mechanism (CAA) in the backbone network of the improved YOLOv8-CP network model to effectively retain information across channels and reduce the computational load, so that the network pays more attention to the position, channel and dimensional information of smaller objects, and adopts a powerful loss function (Powerful-IoUV2) that combines a target size adaptive penalty factor and a gradient adjustment function based on the anchor box quality to reduce the impact of low-quality samples on model training and improve the detection recall rate. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] The accompanying drawings constituting a part of the present disclosure are used to provide a further understanding of the present disclosure. The illustrative embodiments of the present disclosure and their descriptions are used to explain the present disclosure and do not constitute an improper limitation on the present disclosure.
[0031] Figure 1 A schematic diagram of the training process of an embodiment of the present disclosure;
[0032] Figure 2 This is a network structure diagram of the improved YOLOv8-CP network model of the embodiment of the present disclosure. DETAILED DESCRIPTION
[0033] The present disclosure is further described below in conjunction with the accompanying drawings and embodiments.
[0034] It should be noted that the following detailed descriptions are all illustrative and are intended to provide further explanation of the present disclosure. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present disclosure belongs.
[0035] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present disclosure. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprising" and / or "including" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.
[0036] Example 1
[0037] In one embodiment of the present disclosure, a micro-cervical cell image classification system based on YOLOv8-CP is provided, comprising:
[0038] An image acquisition module is configured to acquire cervical cell pathology images and perform preprocessing;
[0039] A classification module is configured to input the preprocessed cervical cell pathology image into the improved YOLOv8-CP network model for identification and classification, and obtain the classified cervical cell type;
[0040] Among them, the preprocessed cervical cell pathology image is input into the improved YOLOv8-CP network model. In the improved YOLOv8-CP network model, the context anchor attention mechanism is introduced in the backbone network of the improved YOLOv8-CP network model, and it is added to the front of the SPPF structure. The context anchor attention mechanism is used to extract local area features, and the interdependence between remote pixels is enhanced. A strong loss function is introduced to enhance the focusing ability of medium-quality anchor frames, so as to realize the classification of cervical cell pathology images.
[0041] As an embodiment, the present invention discloses a micro-cervical cell image classification system based on YOLOv8-CP, and proposes an improved YOLOv8-CP network model. Specifically, the structure of the improved YOLOv8-CP network model is as follows: Figure 2 As shown in the figure, the YOLOv8-CP network model includes three parts, namely Backbone, Neck and Head, each of which is responsible for different feature extraction, fusion and detection tasks. Among them:
[0042] The backbone network is responsible for extracting the underlying features of the input image. Through the backbone network, the model extracts the features of the image layer by layer and generates a higher feature representation at output for subsequent processing.
[0043] The neck network part improves the detection accuracy of the model through feature fusion. Through the neck network, the feature pyramid structure fuses multi-scale features layer by layer, so that the model can effectively identify objects of different sizes.
[0044] The head network is responsible for mapping feature maps into detection outputs, including target locations and classification results.
[0045] The model includes Conv and SPPF modules. Conv consists of Conv2d, BatchNorm2d and SiLU activation functions. This module is mainly used for local feature extraction. After BatchNorm and SiLU activation, nonlinearity is added. SPPF contains multiple MaxPool2d and Concat operations to achieve effective aggregation of spatial information. SPPF provides feature expression with a larger field of view.
[0046] As an embodiment, the overall image data processing flow is as follows:
[0047] Image data processing flow
[0048] When an image is input into the model, the data processing flow is as follows:
[0049] 1) Image preprocessing: The input image is resized to a fixed size and normalized to match the model.
[0050] 2) Feature extraction (Backbone): The image passes through the Backbone layer by layer to extract features at different depths.
[0051] 3) Feature fusion (Neck): Feature maps from different scales are fused through upsampling, splicing, convolution and other operations to improve the recognition ability of multi-scale targets.
[0052] 4) Detection output (Head): The final output contains the bounding box coordinates and classification label of the target.
[0053] 5) Loss calculation and optimization: The loss function calculates the error and optimizes the model to improve detection accuracy.
[0054] Furthermore, the training process of the improved YOLOv8-CP network model includes the following steps:
[0055] Step 1: Collect cervical cell pathology images to build a dataset
[0056] 1.1) Collect cervical cell pathology images and pre-process them to delete duplicate images and images that do not meet format requirements.
[0057] 1.2) The cervical cell pathology images were divided into training set, test set, and validation set, accounting for 70%, 20%, and 10% respectively. The dataset was manually annotated by experts to ensure the accuracy and reliability of the diagnosis. The dataset covers six cervical cell types, including low-grade squamous intraepithelial lesions (LSIL), atypical squamous cells-undetermined significance (ASC-US), high-grade squamous intraepithelial lesions (HSIL), bacterial hyperplasia (Cluecell), atypical glandular cells (AGC-NOS), and Candida infection (CAN).
[0058] 1.3) Create a folder named Images, and create three folders named train, test, and val in the Images folder. Put the cervical cell pathology image training set, test set, and validation set into the train, test, and val folders in the Images folder, respectively; Create a folder named Labels, and create three folders named train, test, and val in the Labels folder. According to the ratio in 1.2), put the corresponding annotation files into the train, test, and val folders in the Labels folder, respectively.
[0059] Step 2: Build an improved YOLOv8-CP network model (YOLOv8-CP model);
[0060] 2.1) In the backbone network, the contextual anchor attention mechanism (CAA) is introduced and added to the front of the SPPF structure to effectively retain the information on each channel and reduce the computational load, so that the network pays more attention to the position, channel and dimension information of smaller objects.
[0061] In order to capture long-range context information, CAA is introduced to grasp the interdependence between distant pixels and enhance the central features. First, the local area features are obtained by using average pooling followed by 1×1 convolution:
[0062]
[0063] in, Represents the output of the nth feature map after the pooling operation in layer l-1. Conv 1×1 Refers to a 1x1 convolution operation, which is usually used to reduce the number of channels or feature dimensions. avg Represents average pooling, which is used to calculate the average value of the feature map and is usually used to reduce the spatial dimension of the feature map; Indicates the input of the nth feature map in layer l-1, usually the activation value from the previous layer; n = 0, ..., N l -1 indicates the index range of the feature map, where N l is the number of feature maps in layer l.
[0064] Where P avg represents the average pooling operation. When n = 0,
[0065]
[0066] Then, considering that strip convolution is lightweight, compared with traditional 2D depthwise convolution, using several 1D depthwise convolution kernels to achieve similar effects reduces the number of parameters to k b / 2. Secondly, for objects with slender shapes, such as cervical cells, strip convolution can easily identify and extract features. In order to increase the receptive field of the CAA module when it belongs to the PKI block, we set k b =11+2×l, the kernel size k b It is calculated as a function of the PKI block depth n. This design enhances PKINet's ability to establish relationships between remote pixels and does not significantly increase the computational cost due to the strip depth design. Two depth-wise strip convolutions are applied as an approximation of the standard large-kernel depth-wise convolution. Finally, the CAA module outputs the attention weights.
[0067]
[0068] in, Represents the output of the nth feature map after wide convolution in layer l-1. Indicates the use of 1×k b Depthwise separable convolution operations are used to extract features and reduce computational complexity. It represents the output of the nth feature map after high convolution in layer l-1.
[0069] 2.2) A powerful loss function (Powerful-IoUV2) that combines an adaptive penalty factor for target size and a gradient adjustment function based on anchor box quality is used to reduce the impact of low-quality samples on model training and improve the detection recall rate. The original loss function is replaced and a powerful loss function (Powerful-IoUV2) is introduced. The Powerful-IoUV2 loss function enhances the ability to focus on medium-quality anchor boxes and guides the anchor boxes to regress along effective paths, thereby converging faster than the existing IoU-based loss function. The original loss function is:
[0070] L PIoU =IoU-f(P)
[0071]
[0072] Among them, P is the penalty factor, dw1, dw2, dh1, dh2 are the absolute values of the distances between the corresponding edges of the prediction box and the target box, and w gt ,h gt The width and height of the target box.
[0073] The Powerful-IoUV2 loss function disclosed in this paper is obtained by adding the attention function to the original loss function Powerful-IoU loss function, which enhances the ability to focus on high-quality anchor boxes and improves the performance of the object detector. The attention function and Powerful-IoUV2 loss are defined as:
[0074] q=e -p ,q∈(0,1]
[0075]
[0076] Where u(q) represents the attention function, and q is used instead of the penalty factor, which measures the quality of the anchor box. The range of q is (0,1). When q = 1, it means <0.05>, the anchor box is completely aligned with the target box. As the predicted value increases, q gradually decreases, indicating that the anchor box quality is low. λ is a hyperparameter that controls the behavior of the attention function.
[0077] Step 3: Training cervical cell pathology image dataset;
[0078] 3.1) Set specific parameters for the improved YOLOv8-CP network model, including input image size, training batch size, training epoch, optimizer, maximum learning rate (Init_lr), minimum learning rate (Min_lr), etc. Load the set parameters into the configured computer environment and use the annotated images in the train folder for training.
[0079] 3.2) After several generations of training, the Loss value basically converges to a stable value and then remains basically unchanged. Gradually. As the number of iterations of network model training increases, the Loss gap between the training set and the validation set gradually decreases, and the difference between the Loss of the training set and the validation set is not much different. The Loss basically converges to a stable value, indicating that the network model has achieved the expected training effect. The weight file with the smallest train Loss value is selected as the detection weight file for improving the YOLOv8 network structure and stored in the run folder.
[0080] Step 4: Use the improved YOLOv8-CP network model to verify the cervical cell pathology images;
[0081] 4.1) Use the trained YOLOv8-CP model to detect cervical cells in the validation set. If the accuracy does not reach the expected value, continue training.
[0082] The steps to verify the YOLOv8-CP model are as follows:
[0083] 1) Prepare the cervical cell images to be tested and store them in the img folder.
[0084] 2) Set specific parameters in the Python environment and enter training commands through the command line.
[0085] 3) Analyze the verification results, including loss, accuracy, recall and other indicators. Determine whether the model is overfitting, and retrain if it is overfitting.
[0086] 4) Adjust model parameters and training strategies based on the verification results.
[0087] 5) Record the verification results, extract the images in the img folder and the weight files in the run folder, obtain the detection results of the corresponding targets and perform comparative analysis.
[0088] Step 5: Use the improved YOLOv8-CP network model to test cervical cell pathology images;
[0089] 5.1) Test the trained model, including:
[0090] 1) Use the trained YOLOv8-CP model to detect and identify the cervical cell data of the test set. The test set used is 1,500 cell images containing different types of cervical cells.
[0091] 2) Load the YOLOv8-CP model verified in step 4.
[0092] 3) Enter the test command in the command line to detect and identify the images in the test set.
[0093] 4) Evaluate the performance of the model on the test set, compare the model's prediction results with the actual annotations, and verify the accuracy of the model.
[0094] 5) Based on the test results, generate a detailed test report, deploy the model to actual applications, and make adjustments as needed.
[0095] Example 2
[0096] In one embodiment of the present disclosure, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the following method steps are implemented:
[0097] Acquire cervical cell pathology images and perform preprocessing;
[0098] The preprocessed cervical cell pathology images are input into the improved YOLOv8-CP network model for identification and classification to obtain the classified cervical cell types;
[0099] Among them, the preprocessed cervical cell pathology image is input into the improved YOLOv8-CP network model. In the improved YOLOv8-CP network model, the context anchor attention mechanism is introduced in the backbone network of the improved YOLOv8-CP network model, and it is added to the front of the SPPF structure. The context anchor attention mechanism is used to extract local area features, and the interdependence between remote pixels is enhanced. A strong loss function is introduced to enhance the focusing ability of medium-quality anchor frames, so as to realize the classification of cervical cell pathology images.
[0100] Example 3
[0101] In one embodiment of the present disclosure, a non-transitory computer-readable storage medium is provided, wherein the non-transitory computer-readable storage medium is used to store computer instructions. When the computer instructions are executed by a processor, the following method steps are implemented:
[0102] Acquire cervical cell pathology images and perform preprocessing;
[0103] The preprocessed cervical cell pathology images are input into the improved YOLOv8-CP network model for identification and classification to obtain the classified cervical cell types;
[0104] Among them, the preprocessed cervical cell pathology image is input into the improved YOLOv8-CP network model. In the improved YOLOv8-CP network model, the context anchor attention mechanism is introduced in the backbone network of the improved YOLOv8-CP network model, and it is added to the front of the SPPF structure. The context anchor attention mechanism is used to extract local area features, and the interdependence between remote pixels is enhanced. A strong loss function is introduced to enhance the focusing ability of medium-quality anchor frames, so as to realize the classification of cervical cell pathology images.
[0105] Example 4
[0106] In one embodiment of the present disclosure, an electronic device is provided, including: a processor, a memory, and a computer program; wherein the processor is connected to the memory, the computer program is stored in the memory, and when the electronic device is running, the processor executes the computer program stored in the memory, so that the electronic device performs the following method steps:
[0107] Acquire cervical cell pathology images and perform preprocessing;
[0108] The preprocessed cervical cell pathology images are input into the improved YOLOv8-CP network model for identification and classification to obtain the classified cervical cell types;
[0109] Among them, the preprocessed cervical cell pathology image is input into the improved YOLOv8-CP network model. In the improved YOLOv8-CP network model, the context anchor attention mechanism is introduced in the backbone network of the improved YOLOv8-CP network model, and it is added to the front of the SPPF structure. The context anchor attention mechanism is used to extract local area features, and the interdependence between remote pixels is enhanced. A strong loss function is introduced to enhance the focusing ability of medium-quality anchor frames, so as to realize the classification of cervical cell pathology images.
[0110] The present disclosure is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present disclosure. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0111] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0112] Although the above describes the specific implementation methods of the present disclosure in conjunction with the accompanying drawings, it is not intended to limit the scope of protection of the present disclosure. Technical personnel in the relevant field should understand that on the basis of the technical solution of the present disclosure, various modifications or variations that can be made by those skilled in the art without creative work are still within the scope of protection of the present disclosure.
Claims
1. A micro-cervical cell image classification system based on YOLOv8-CP, characterized in that: include: An image acquisition module is configured to acquire cervical cell pathology images and perform preprocessing; A classification module is configured to input the preprocessed cervical cell pathology image into the improved YOLOv8-CP network model for identification and classification, and obtain the classified cervical cell type; Among them, the preprocessed cervical cell pathology image is input into the improved YOLOv8-CP network model. In the improved YOLOv8-CP network model, the context anchor attention mechanism is introduced in the backbone network of the improved YOLOv8-CP network model, and it is added to the front of the SPPF structure. The context anchor attention mechanism is used to extract local area features, and the interdependence between remote pixels is enhanced. A strong loss function is introduced to enhance the focusing ability of medium-quality anchor frames, so as to realize the classification of cervical cell pathology images.
2. The micro-cervical cell image classification system based on YOLOv8-CP according to claim 1, characterized in that: The cervical cell pathology images are used for training the improved YOLOv8-CP network model. First, the cervical cell pathology images are obtained for preliminary preprocessing, and duplicate cervical cell pathology images and cervical cell pathology images that do not meet format requirements are deleted. Then, the preprocessed cervical cell pathology images are divided into a training set, a test set, and a validation set.
3. The micro-cervical cell image classification system based on YOLOv8-CP as claimed in claim 2, characterized in that: Create a folder named Images, and create three folders named train, test, and val in the Images folder. Put the training set, test set, and validation set of cervical cell pathology images into the train, test, and val folders under the Images folder, respectively; create a folder named Labels, and create three folders named train, test, and val in the Labels folder. Put the corresponding annotation files into the train, test, and val folders under the Labels folder, respectively.
4. The micro-cervical cell image classification system based on YOLOv8-CP according to claim 1, characterized in that: After the preprocessed cervical cell pathology image is input into the improved YOLOv8-CP network model, the local area features are first obtained by average pooling followed by convolution, the receptive field of the contextual anchor attention mechanism is increased when it belongs to the PKI block, the kernel size is calculated as a function of the PKI block depth, the ability of PKINet to establish the relationship between remote pixels is enhanced, two deep strip convolutions are applied as an approximation of the standard large kernel deep convolution, and finally the contextual anchor attention mechanism outputs the attention weights.
5. The micro-cervical cell image classification system based on YOLOv8-CP according to claim 1, characterized in that: In the improved YOLOv8-CP network model, the original loss function is replaced and a strong loss function is introduced to enhance the focusing ability on medium-quality anchor frames and guide the anchor frames to regress along the effective path. Specifically: L PIoU =IoU-f(P) Among them, P is the penalty factor, dw1, dw2, dh1, dh2 are the absolute values of the distances between the corresponding edges of the prediction box and the target box, and w gt ,h gt The width and height of the target box.
6. The micro-cervical cell image classification system based on YOLOv8-CP according to claim 5, characterized in that: The strong loss function is obtained by adding the attention function to the original loss function to enhance the focusing ability on the high-quality anchor box. The attention function is defined as: q=e -p ,q∈(0,1] Among them, u(q) represents the attention function, and q is used instead of the penalty factor, which measures the quality of the anchor box. The range of q is (0,1); when q = 1, it means <0.05>, the anchor box is completely aligned with the target box; as the predicted value increases, q gradually decreases, indicating that the quality of the anchor box is low; λ is a hyperparameter that controls the behavior of the attention function.
7. The micro-cervical cell image classification system based on YOLOv8-CP according to claim 1, characterized in that: Set specific parameters for the improved YOLOv8-CP network model, including input image size, training batch size, training epochs, optimizer, maximum learning rate, and minimum learning rate. Load the set parameters into the configured computer environment and use the annotated images in the train folder for training.
8. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the following method steps are implemented: Acquire cervical cell pathology images and perform preprocessing; The preprocessed cervical cell pathology images are input into the improved YOLOv8-CP network model for identification and classification to obtain the classified cervical cell types; Among them, the preprocessed cervical cell pathology image is input into the improved YOLOv8-CP network model. In the improved YOLOv8-CP network model, the context anchor attention mechanism is introduced in the backbone network of the improved YOLOv8-CP network model, and it is added to the front of the SPPF structure. The context anchor attention mechanism is used to extract local area features, and the interdependence between remote pixels is enhanced. A strong loss function is introduced to enhance the focusing ability of medium-quality anchor frames, so as to realize the classification of cervical cell pathology images.
9. A non-transitory computer-readable storage medium, characterized in that: The non-transitory computer-readable storage medium is used to store computer instructions, and when the computer instructions are executed by the processor, the following method steps are implemented: Acquire cervical cell pathology images and perform preprocessing; The preprocessed cervical cell pathology images are input into the improved YOLOv8-CP network model for identification and classification to obtain the classified cervical cell types; Among them, the preprocessed cervical cell pathology image is input into the improved YOLOv8-CP network model. In the improved YOLOv8-CP network model, the context anchor attention mechanism is introduced in the backbone network of the improved YOLOv8-CP network model, and it is added to the front of the SPPF structure. The context anchor attention mechanism is used to extract local area features, and the interdependence between remote pixels is enhanced. A strong loss function is introduced to enhance the focusing ability of medium-quality anchor frames, so as to realize the classification of cervical cell pathology images.
10. An electronic device, characterized in that: include: A processor, a memory, and a computer program; wherein the processor is connected to the memory, the computer program is stored in the memory, and when the electronic device is running, the processor executes the computer program stored in the memory to enable the electronic device to perform the following method steps: Acquire cervical cell pathology images and perform preprocessing; The preprocessed cervical cell pathology images are input into the improved YOLOv8-CP network model for identification and classification to obtain the classified cervical cell types; Among them, the preprocessed cervical cell pathology image is input into the improved YOLOv8-CP network model. In the improved YOLOv8-CP network model, the context anchor attention mechanism is introduced in the backbone network of the improved YOLOv8-CP network model, and it is added to the front of the SPPF structure. The context anchor attention mechanism is used to extract local area features, and the interdependence between remote pixels is enhanced. A strong loss function is introduced to enhance the focusing ability of medium-quality anchor frames, so as to realize the classification of cervical cell pathology images.