Chromosome recognition and segmentation method based on attention mechanism and small target detection
By introducing an asymptotic feature pyramid network and a network of extrusion encouraging attention mechanisms in chromosome recognition and segmentation tasks, the problem of insufficient stability and robustness of small object detection in chromosome images with many targets and strong correlation is solved, and a more efficient and accurate small object detection effect is achieved.
Patent Information
- Application Number
- CN202411408379.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-10
- Publication Date
- 2025-02-25
AI Technical Summary
In the prior art, in chromosome recognition and segmentation tasks, especially in mesophase phase images with many targets and strong correlation, small target detection has poor stability and robustness and low computational efficiency.
Using an attention mechanism and small object detection method, the accuracy and robustness of small object detection are improved by introducing asymptotic feature pyramid network (AFPN) and the extrusion encouragement attention mechanism network (SENet).
It improves the accuracy and robustness of small-object detection in chromosome recognition and segmentation tasks, reduces the amount of calculation, and improves training speed and model performance.
Smart Images

Figure CN119516245A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of chromosome recognition and segmentation, and in particular to a chromosome recognition and segmentation method based on attention mechanism and small target detection. Background Art
[0002] Chromosome recognition and segmentation are important steps in karyotype analysis in cytogenetics research, and they play a key role in genetic disease screening, prenatal diagnosis, and other fields. There are a large number of chromosome detection and segmentation targets in metaphase images, and the chromosomes have different morphologies. Existing chromosome recognition and segmentation methods mainly include traditional image processing technology and deep learning-based methods.
[0003] Traditional chromosome segmentation methods usually rely on steps such as image preprocessing, threshold segmentation, binarization, and region identification. These methods often require manual adjustment and correction by experienced experts to adapt to different chromosome image characteristics. However, these traditional methods have some shortcomings:
[0004] a. Low degree of automation: It requires a lot of manual intervention and is difficult to adapt to large-scale chromosome image analysis.
[0005] b. Poor robustness: Due to the variability of chromosome morphology, such as chromosome overlap and crossing, traditional methods are difficult to segment accurately and are prone to miss detection, especially for shorter chromosomes.
[0006] c. Low computational efficiency: When processing large-scale data sets, the computational efficiency of traditional methods is usually low.
[0007] With the development of technology, deep learning technology has made significant progress in the field of image segmentation and has also been applied to chromosome segmentation tasks. The current mainstream chromosome segmentation methods based on deep learning are: semantic segmentation network, strength segmentation network, etc. Although the above deep learning-based methods have achieved results that surpass traditional chromosome image segmentation algorithms in chromosome segmentation tasks, due to the particularity of chromosome image recognition and segmentation tasks, these methods are difficult to directly apply to recognition tasks with many targets in a single chromosome image (the number of detection targets in a single chromosome image is about 46). This task is correlated in terms of chromosome category, chromosome number and chromosome morphology, so there is still a lot of room for improvement in accuracy, robustness and generalization ability.
[0008] d. In the task of chromosome recognition and segmentation, the chromosomes in the image usually have significant scale differences. The traditional feature pyramid network (FPN) and path aggregation network (PAFPN) have problems of information loss and semantic gap when dealing with objects of different scales.
[0009] Therefore, the patent with application number CN202310115681.5 mentions a small target detection method based on attention adaptive fusion features, but it still has defects and is not suitable for chromosome recognition and segmentation tasks, mainly because:
[0010] First, a pre-trained model for small target detection is additionally used, and then the features of the feature maps output by adjacent network layers are fused in combination with the attention mechanism. The pre-trained small target detection model is used for preliminary detection, which requires extracting multiple layers of feature maps and performing feature fusion. The fusion coefficient of this process has a great influence on the effect of small target detection, which means that it is very dependent on the effect of the attention mechanism module. Therefore, the stability and robustness of this method are poor.
[0011] Second, the attention mechanism is used to dynamically adjust the ratio of feature fusion, but the ratio coefficient still needs to be calculated through convolution operation on the image, which involves a lot of calculations.
[0012] Therefore, the above is not applicable to the chromosome recognition and segmentation task. The present invention develops a chromosome recognition and segmentation method based on attention mechanism and small target detection to solve the problems existing in the prior art. Summary of the invention
[0013] The purpose of the present invention is to provide a chromosome recognition and segmentation method based on attention mechanism and small target detection, so as to solve the problems of poor stability and robustness of small target detection in chromosome images with many recognition targets and high correlation in the prior art.
[0014] The technical solution of the present invention is: a chromosome recognition and segmentation method based on attention mechanism and small target detection, comprising:
[0015] S1. Collect images containing metaphases of chromosomes. The target number of chromosomes in a single image is 46, and the chromosomes are correlated. Perform preprocessing of the collected images by unifying the size and grayscale conversion. After preprocessing, perform segmentation mask annotation and category annotation on the chromosomes to generate labels, which constitute the chromosome dataset.
[0016] S2. Based on the YOLOv8-seg network structure, the Neck part of the network introduces an asymptotic feature pyramid network to gradually fuse feature maps of different levels; first fuse adjacent low-level feature maps, and then gradually add higher-level feature maps;
[0017] S3. Based on the output layer of the asymptotic feature pyramid network, a small target detection layer is introduced. The input image is processed through four layers, and the size is 1 / 32, 1 / 16, 1 / 8, and 1 / 4 of the original image. The feature maps of the four output layers are output to the Neck and Head parts of the model, and then the detection results of small targets are output through convolution operations, activation and feature fusion;
[0018] S4, taking the YOLOv8-seg framework as the baseline, after the last convolutional layer of its neural network, a squeeze-encouraged attention mechanism network is introduced. After the squeeze-encouraged attention mechanism network and batch normalization, the output is the feature map of the neural network structure with the added attention mechanism;
[0019] S5, obtain the training set and test set in the chromosome data set in S1; and obtain the chromosome image instance segmentation model by training the neural network in S2, S3, and S4.
[0020] Preferably, in YOLOv8-seg, the detection process of the small target detection layer is mainly as follows:
[0021] a. Downsample the input image feature map through pooling operation to generate chromosome feature maps of different scales;
[0022] b. Through the convolution operation, the input chromosome feature map is processed to extract the local pattern in the chromosome feature map, including chromosome texture and edge, and generate a new chromosome feature map for small target detection; the convolution operation adopts the following formula:
[0023] F out =Conv(F in ,W,b);
[0024] Among them, F in is the input feature map, W is the convolution kernel weight, b is the bias, F out is the output feature map;
[0025] c. Apply activation functions to the results of the convolution operation to increase the nonlinear capabilities of the network;
[0026] d. Through multi-layer feature fusion technology, chromosome feature maps of different scales are fused to capture the details of small targets in chromosome images while retaining global context information; feature fusion is expressed by the following formula:
[0027]
[0028] Among them, α i is the fusion weight, F i are chromosome feature maps of different scales, N is the number of chromosome feature maps, F fusedThis is the characteristic diagram of the chromosome after fusion;
[0029] e. The chromosome feature map after feature fusion is used for the final chromosome target detection and segmentation, including classification of detected targets, regression bounding box and segmentation mask.
[0030] Preferably, a ReLU activation function is applied to the result of the convolution operation to increase the nonlinear expression ability of the network. ReLU sets all negative values to zero while keeping the positive values unchanged.
[0031] Preferably, the forward propagation process of the squeeze-excitation attention mechanism network is:
[0032] a. Calculate the shape of the input chromosome feature map, extract the chromosome image size H×W, image batch size b and chromosome image channel number c;
[0033] b. Use the global average pooling layer to process the input chromosome image, then reshape it into a two-dimensional tensor (b, c) and input it into the fully connected layer;
[0034] c. After the fully connected layer and activation function, the weight coefficient vector of each channel is finally generated so that it can be multiplied element by element with the original chromosome feature map;
[0035] d. Multiply the generated weight coefficient by the original chromosome feature map element by element to obtain the adjusted chromosome feature map.
[0036] Preferably, during the forward propagation process, the global average pooling layer in step b compresses the input chromosome feature map of any size into a size of 1×1 to obtain the global average feature of each channel.
[0037] Preferably, in the forward propagation process, step c includes two fully connected layers and activation functions, the first fully connected layer reduces the number of channels and uses the ReLU activation function to increase nonlinearity; the second fully connected layer restores the number of channels to the original number and uses the Sigmoid activation function to limit its output between 0 and 1 as the channel weight.
[0038] Preferably, for the convolutional layer, the weights are initialized using Kaiming normal distribution and the bias is initialized to 0;
[0039] For the batch normalization layer, the weights are initialized to 1 and the biases are initialized to 0;
[0040] For the fully connected layers, the weights are initialized using a normal distribution with a standard deviation of 0.001 and the bias is initialized to 0.
[0041] Preferably, in step S4, the training of the chromosome image instance segmentation model comprises the following specific steps:
[0042] Using the chromosome dataset obtained in S1, 85% of it was selected as the training set and 15% as the test set; using the YOLOv8-seg neural network structure set in S2, the chromosome image instance segmentation model was trained, and the training parameters were set as follows: the network uniformly used the Adam optimizer to optimize the target loss function, the batch size was set to 8, the learning rate was set to 0.001 and adaptively reduced, and the maximum number of training rounds was set to 500.
[0043] Compared with the prior art, the advantages of the present invention are:
[0044] (1) In the recognition process of metaphase chromosome images with multiple targets and strong correlation, the asymptotic feature pyramid network (AFPN) is introduced to optimize feature fusion. AFPN asymptotically fuses high-level semantic information and low-level detail information layer by layer, avoiding the semantic gap caused by the fusion between non-adjacent layers in traditional networks and improving the accuracy of chromosome detection for small targets.
[0045] (2) An independent small target detection layer and an attention mechanism network are introduced. The small target detection layer is pre-set in the training neural network and output after passing through the asymptotic feature pyramid network. The attention mechanism network is added after the last convolutional layer of the neural network to increase the attention weight and improve the detection weight of the chromosome region. Under the dual effects of small target detection, the chromosome detection performance is improved at the same time.
[0046] (3) A small target detection layer is introduced into the YOLOv8-seg neural network. The number of convolutions is reduced, so the size of the feature map of the image is larger, which is more conducive to small target recognition and can improve the feature extraction and detection effects of small targets. The method is simpler, and the stability and robustness will be better. At the same time, it can also reduce unnecessary weight parameters, greatly reduce the amount of calculation, and improve the training speed.
[0047] (4) An attention mechanism network is introduced after the last convolutional layer of the neural network. The feature weights are learned through the loss value output by the network to implement the attention mechanism. At the same time, it does not involve a large amount of calculations and also improves the model performance.
[0048] (5) The squeeze-encouraged attention mechanism network models the interdependence between channels through global average pooling, feature recalibration and channel weighting, and adaptively re-corrects the feature correspondence strength between channels through the global loss function of the network, thereby realizing channel attention modulation of the input feature map, which helps to improve the feature utilization and recognition performance of the network. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] The present invention will be further described below in conjunction with the accompanying drawings and embodiments:
[0050] Figure 1 The structure of the asymptotic feature pyramid network described in the present invention;
[0051] Figure 2 A YOLOv8-seg neural network structure that introduces a small target detection layer into the chromosome recognition and segmentation method based on attention mechanism and small target detection described in the present invention;
[0052] Figure 3 This is a network structure diagram of the squeeze-encouraged attention mechanism in the chromosome recognition and segmentation method based on attention mechanism and small target detection described in the present invention. DETAILED DESCRIPTION
[0053] The present invention is further described in detail below in conjunction with specific embodiments:
[0054] For ease of understanding, the application scenario of this application is first explained. Since there are a large number of chromosome detection and segmentation targets in the metaphase image of chromosomes, and the chromosomes have different morphologies, it is easy to miss detection, especially for shorter chromosomes; at the same time, there is a correlation between chromosome category, chromosome number and chromosome morphology. The detection objects in the prior art have a single identification target and the target information is not highly correlated, so small target recognition cannot be applied to chromosome recognition.
[0055] Therefore, the present application provides a chromosome recognition and segmentation method based on attention mechanism and small target detection, comprising the following steps:
[0056] Step 1: Preparation of chromosome dataset;
[0057] A large number of images containing metaphases of chromosomes are collected by microscope. The detection targets of each image are about 46 chromosomes, and the number of chromosomes in each category is generally 2, and generally no more than 4. There is a clear correlation between the targets to be identified;
[0058] The image is preprocessed by unifying the size (960×960×3) and grayscale conversion, and the chromosomes in the image are manually segmented, masked and labeled to generate chromosome mask labels and chromosome category labels, which constitute the chromosome dataset D.
[0059] Step 2: The Neck part in YOLOv8-seg introduces the asymptotic feature pyramid network (AFPN);
[0060] like Figure 1As shown in the figure, feature maps of different levels are gradually fused through the asymptotic feature pyramid network (AFPN). AFPN first fuses adjacent low-level feature maps, such as C2 and C3 layers, and then gradually adds higher-level feature maps C4 and C5. This asymptotic fusion avoids the semantic differences when directly fusing feature maps of non-adjacent levels, ensuring that the detailed information of low-level features can be fully utilized by high-level semantic features, and finally outputs more discernible feature maps, effectively improving the detection accuracy of chromosomes.
[0061] Step 3: Introduce small target detection layer;
[0062] The outputs of P2, P3, P4, and P5 are generated through the asymptotic feature pyramid network (AFPN), where the P2 layer is the introduced small object detection layer.
[0063] The output layers of the normal yolov8-seg detection segmentation model after the asymptotic feature pyramid network are P3, P4, and P5. In order to improve the detection ability of small targets, the small target detection layer P2 is introduced on the basis of the YOLOv8-seg framework to improve the detection ability of small target chromosomes, such as tiny individuals and features in chromosome images. Among them, P3-P5 is the network structure of the original YOLOv8-seg neural network. After the input image is processed by these three layers, the size of the feature map is 1 / 32, 1 / 16, and 1 / 8 of the original image, respectively, while the size of the feature map obtained by the P2 layer is only 1 / 4 of the original image. The number of convolutions is small, and the size (resolution) of the feature map is larger, which is more conducive to small target recognition. After the input image is processed by four layers, the size is 1 / 32, 1 / 16, 1 / 8, and 1 / 4 of the original image, and the feature maps of the four output layers are output to the Neck and Head parts of the model, and then through convolution operations, activation and feature fusion, the detection results of small targets are output. The specific detection process is as follows:
[0064] a. Input feature map scaling: The feature map of the input image is extracted from the early layers of the network, which usually retains rich spatial information and details;
[0065] Downsampling operation: The resolution of the image is reduced by the average pooling operation to obtain chromosome feature maps of different scales; the input chromosome feature map is downsampled to 1 / 4, 1 / 8, 1 / 16 and 1 / 32 of the original size. This multi-scale chromosome feature map can help the network detect chromosome targets at different resolutions; assuming that the size of the input image is H×W and the size of the feature map is H i ×W i , then the downsampling ratio of the feature map can be expressed as
[0066] b. Convolution operation: In the P2 small target detection layer, the input chromosome feature map is processed through the convolution operation to generate a new chromosome feature map for small target detection and segmentation of chromosome images; the purpose of the convolution operation is to extract local patterns in the input chromosome feature map, such as edges, textures, etc., so as to generate a more discriminative chromosome feature map, which helps the network to detect small target chromosomes more accurately in subsequent steps. The convolution operation uses the following formula:
[0067] F out =Conv(F in ,W,b);
[0068] Among them, F in is the input feature map, W is the convolution kernel weight, b is the bias, F out is the output feature map.
[0069] c. The adaptive spatial fusion strategy in the asymptotic feature pyramid network (AFPN) effectively reduces possible feature conflicts during the fusion process by dynamically allocating weights to feature maps of different scales. The specific formula is as follows:
[0070]
[0071] in, is the adaptive spatial fusion weight, and is affected by The constraints ensure that the contribution of each level feature can be adaptively adjusted according to its actual role, thereby improving the detection effect of small target chromosomes.
[0072] d. Activation function: Applying an activation function to the result of the convolution operation increases the nonlinear ability of the network. The application of the activation function enables the network to learn and represent more complex patterns. In this embodiment, the ReLU activation function is applied to the result of the convolution operation, which is expressed by the following formula:
[0073] F activated =ReLU(F out );
[0074] Among them, F activated The output feature map in step b is the output feature map after being processed by the activation function;
[0075] ReLU sets all negative values to zero while keeping positive values unchanged. This operation not only increases the nonlinearity of the network, but also effectively avoids the gradient vanishing problem in practice, thereby accelerating model training and improving performance.
[0076] e. Feature fusion: Through multi-layer feature fusion technology, chromosome feature maps of different scales are fused. This fusion can enhance the expressiveness of the model, capture the details of small targets in chromosome images, and retain global context information, thereby improving the robustness and accuracy of the chromosome detection and segmentation model, making it better handle the detection and segmentation of small chromosome targets; feature fusion is expressed by the following formula:
[0077]
[0078] Among them, α i F is the fusion weight, which is usually obtained through learning to ensure that the contribution of features at each scale to the final result is optimal; i are chromosome feature maps of different scales, N is the number of feature maps, F fused is the fused feature map.
[0079] f. The chromosome feature map after feature fusion is used for the final chromosome target detection and segmentation. This includes classifying the detected target (determining which category the target belongs to), regressing the bounding box (determining the location of the target) and segmenting the mask (segmenting the area of the target).
[0080] Step 4: Neural network setup for chromosome image instance segmentation model;
[0081] Based on the correlation between targets in metaphase images of chromosomes, the YOLOv8-seg framework is used as the baseline. After the last convolutional layer of its neural network, a squeeze-encouraged attention mechanism network (SENet network) is introduced. In the convolutional neural network, the attention mechanism is used to automatically focus on important features, especially when dealing with small target chromosomes that are subtle and easily overlooked in chromosome images. At the same time, the attention mechanism improves the representation ability of the network by explicitly modeling the interdependence between convolutional feature channels. Through this mechanism, we can learn to use global information to selectively emphasize informative features and suppress less useful features, so we can better extract these relevant features and information through a large number of chromosome image training sets. For example Figure 3 As shown; after squeezing the encouraging attention mechanism network and batch normalization, the output is the feature map output by the neural network structure with the added attention mechanism.
[0082] Among them, the global average pooling layer compresses the input chromosome feature map of any size to a size of 1×1. The purpose of this step is to obtain the global average features of each channel, reduce the spatial dimension, and retain important global information, which is critical for subsequent feature weighting and attention mechanisms.
[0083] Two fully connected layers and activation functions. The first fully connected layer reduces the number of channels and uses the ReLU activation function to increase nonlinearity. The second fully connected layer restores the number of channels to the original number and uses the Sigmoid activation function to limit its output between 0 and 1 as the channel weight.
[0084] Initialize the weights to ensure good convergence during training; for the convolutional layer, use Kaiming normal distribution to initialize the weights, which is designed for asymmetric activation functions such as ReLU and helps to stabilize the network training. The bias is initialized to 0; for the batch normalization layer, the weight is initialized to 1 and the bias is initialized to 0 to ensure that the performance of the network is not affected in the early stage of training; for the fully connected layer, the weight is initialized using a normal distribution with a standard deviation of 0.001, which can prevent the network from overfitting due to excessive initial weights. The bias is initialized to 0.
[0085] Through a reasonable initialization strategy and attention mechanism, the network can converge faster during training and perform well in handling chromosome small object detection and segmentation tasks.
[0086] Specifically, the forward propagation process of the squeeze-excitation attention mechanism network is as follows, where forward propagation is a key step in the neural network, which involves starting from the input layer, calculating and transmitting data layer by layer through each layer of the neural network, and finally obtaining the output result of the model:
[0087] a. Calculate the shape of the input chromosome feature map, extract the chromosome image size H×W, image batch size b and chromosome image channel number C, where C, H and W are the number of channels of the feature map, the width and height of the feature respectively;
[0088] b. Use the global average pooling layer to process the input chromosome image. At this time, the size is (b, c, 1, 1), reshaped into a two-dimensional tensor (b, c), and input into the fully connected layer. This step aggregates all spatial information of each channel into an average value, thereby obtaining a global representation of each channel.
[0089] Among them, the formula for average pooling is:
[0090]
[0091] zc is a single value for compressing the feature map of each channel;
[0092] c. After a fully connected layer, the number of channels is reduced to c / r; where r is the channel reduction ratio, usually 16, and the output size is (b, c / r);
[0093] d. Increase nonlinearity through ReLU activation function;
[0094] e. After another fully connected layer, the number of channels is restored to c, and the output size is (b, c);
[0095] f. Through the Sigmoid activation function, the output is limited to between 0 and 1, and the weight coefficient vector (b, c) of each channel is generated; the Sigmoid activation function is:
[0096]
[0097] g. Multiply the generated weight coefficient vector (b, c) by the original feature map (b, c, h, w) element by element by channel through a broadcast operation, and perform weighted adjustment on the features of each channel to obtain the adjusted feature map (b, c', h', w'). Through the above operations, channel attention adjustment is achieved.
[0098] The SENet network (Squeeze-Excited Attention Mechanism Network) models the interdependence between channels through global average pooling, feature recalibration, and channel weighting. It adaptively re-corrects the feature correspondence strength between channels through the global loss function of the network, realizes channel attention modulation of the input feature map, and helps to improve the feature utilization and recognition performance of the network.
[0099] Step 5: Training of chromosome image instance segmentation model;
[0100] Using the chromosome dataset D obtained in step 1, 85% of it is selected as the training set and 15% as the test set to evaluate the generalization ability and performance of the model, and the mean average accuracy mAP is used as the performance evaluation index to evaluate the instance segmentation performance of the model; using the neural network structure set in step 2, the chromosome image instance segmentation model is trained, and the training parameters are set as follows: the network uniformly uses the Adam optimizer to optimize the target loss function, the batchsize is set to 8, the learning rate is set to 0.001 and adaptively reduced, and the maximum number of training rounds is set to 500. The performance of the trained chromosome image instance segmentation model on multiple test sets is significantly better than the existing technology.
[0101] The present invention also discloses a chromosome recognition and segmentation system based on attention mechanism and small target detection, which is used to execute the above-mentioned chromosome recognition and segmentation method based on attention mechanism and small target detection.
[0102] In this application, by introducing the P2 small target detection layer and the SENet network, the chromosome image instance segmentation model obtained by training can achieve many tasks such as chromosome image detection, segmentation and classification in one step. The introduction of the P2 small target detection layer enables the YOLOv8-seg neural network to detect small target objects more effectively. Small targets usually occupy fewer pixels in the image and are therefore more easily ignored or misjudged. Through the specially introduced P2 layer, YOLOv8-seg can detect and locate small targets more keenly, improving the accuracy of small target detection. The introduction of the SENet network provides more global context information in the chromosome image, significantly enhancing the model's detection and segmentation capabilities for complex chromosome images such as intersections and overlaps.
[0103] During the application process, compared with the existing U-Net model with an added attention mechanism, the model performance of the present invention is improved by 5.9%, compared with the existing Mask R-CNN model with an added attention mechanism, the model performance of the present invention is improved by 4.1%, compared with the baseline YOLOv8-seg model, the model performance is improved by 3.8% after adding the SENet network and the P2 small target detection layer, compared with the performance of traditional feature fusion networks such as feature pyramid network (FPN) and path aggregation network (PAFPN), the asymptotic feature pyramid network (AFPN) performs well in small target chromosome detection, especially when dealing with complex backgrounds and multi-scale targets, the performance is improved by 3.2% compared with traditional methods.
[0104] The above embodiments are only for illustrating the technical concept and features of the present invention, and their purpose is to enable people familiar with this technology to understand the content of the present invention and implement it accordingly, and they cannot be used to limit the scope of protection of the present invention. For those skilled in the art, it is obvious that the present invention is not limited to the details of the above exemplary embodiments, and the present invention can be implemented in other specific forms without departing from the spirit or basic features of the present invention. Therefore, no matter from which point of view, the embodiments should be regarded as exemplary and non-restrictive. The scope of the present invention is limited by the attached claims rather than the above description, and it is intended to include all changes within the meaning and scope of the equivalent elements of the claims in the present invention.
Claims
1. A chromosome recognition and segmentation method based on attention mechanism and small target detection, characterized in that: include: S1. Collect images containing metaphases of chromosomes. The target number of chromosomes contained in a single image is 46, and there is correlation between chromosomes. The collected images are preprocessed by unifying the size and converting the grayscale. After the preprocessing, the chromosomes are segmented and labeled with masks and categories to generate labels. S2. Based on the YOLOv8-seg network structure, the Neck part of the network introduces an asymptotic feature pyramid network to gradually fuse feature maps of different levels; first fuse adjacent low-level feature maps, and then gradually add higher-level feature maps; S3. Based on the output layer of the asymptotic feature pyramid network, a small target detection layer is introduced. The input image is processed through four layers, and the size is 1 / 32, 1 / 16, 1 / 8, and 1 / 4 of the original image. The feature maps of the four output layers are output to the Neck and Head parts of the model, and then the detection results of small targets are output through convolution operations, activation and feature fusion. S4, taking the YOLOv8-seg framework as the baseline, after the last convolutional layer of its neural network, a squeeze-encouraged attention mechanism network is introduced. After the squeeze-encouraged attention mechanism network and batch normalization, the output is the feature map of the neural network structure with the added attention mechanism; S5, obtain the training set and test set in the chromosome data set in S1; and obtain the chromosome image instance segmentation model by training the neural network in S2, S3, and S4.
2. The chromosome recognition and segmentation method based on attention mechanism and small target detection according to claim 1, characterized in that: In YOLOv8-seg, the detection process of the small target detection layer is as follows: a. Downsample the input image feature map through pooling operation to generate chromosome feature maps of different scales; b. Through the convolution operation, the input chromosome feature map is processed to extract the local pattern in the chromosome feature map, including chromosome texture and edge, and generate a new chromosome feature map for small target detection; the convolution operation adopts the following formula: F out =Conv(F in ,W,b); Among them, F in is the input feature map, W is the convolution kernel weight, b is the bias, F out is the output feature map; c. Apply activation functions to the results of the convolution operation to increase the nonlinear capabilities of the network; d. Through multi-layer feature fusion technology, chromosome feature maps of different scales are fused to capture the details of small targets in chromosome images while retaining global context information; feature fusion is expressed by the following formula: Among them, α i is the fusion weight, F i are chromosome feature maps of different scales, N is the number of chromosome feature maps, F fused This is the characteristic diagram of the chromosome after fusion; e. The chromosome feature map after feature fusion is used for the final chromosome target detection and segmentation, including classification of detected targets, regression bounding box and segmentation mask.
3. The chromosome recognition and segmentation method based on attention mechanism and small target detection according to claim 2, characterized in that: Apply the ReLU activation function to the result of the convolution operation to increase the nonlinear expression ability of the network. ReLU sets all negative values to zero while keeping the positive values unchanged.
4. The chromosome recognition and segmentation method based on attention mechanism and small target detection according to claim 1, characterized in that: The forward propagation process of the squeeze-excitation attention mechanism network is: a. Calculate the shape of the input chromosome feature map, extract the chromosome image size H×W, image batch size b and chromosome image channel number c; b. Use the global average pooling layer to process the input chromosome image, then reshape it into a two-dimensional tensor (b, c) and input it into the fully connected layer; c. After the fully connected layer and activation function, the weight coefficient vector of each channel is finally generated so that it can be multiplied element by element with the original chromosome feature map; d. Multiply the generated weight coefficient by the original chromosome feature map element by element to obtain the adjusted chromosome feature map.
5. The chromosome recognition and segmentation method based on attention mechanism and small target detection according to claim 4, characterized in that: During the forward propagation process, the global average pooling layer in step b compresses the input chromosome feature map of any size into a 1×1 size to obtain the global average feature of each channel.
6. The chromosome recognition and segmentation method based on attention mechanism and small target detection according to claim 5, characterized in that: In the forward propagation process, step c includes two fully connected layers and activation functions. The first fully connected layer reduces the number of channels and uses the ReLU activation function to increase nonlinearity. The second fully connected layer restores the number of channels to the original number and uses the Sigma ID activation function to limit its output between 0 and 1 as the channel weight.
7. The chromosome recognition and segmentation method based on attention mechanism and small target detection according to claim 6, characterized in that: For the convolutional layer, the weights are initialized using Kaiming normal distribution and the bias is initialized to 0; For the batch normalization layer, the weights are initialized to 1 and the biases are initialized to 0; For the fully connected layers, the weights are initialized using a normal distribution with a standard deviation of 0.001 and the bias is initialized to 0.
8. The chromosome recognition and segmentation method based on attention mechanism and small target detection according to claim 1, characterized in that: In step S4, the training of the chromosome image instance segmentation model includes the following specific steps: Using the chromosome dataset obtained in S1, 85% of it was selected as the training set and 15% as the test set; using the neural network structure set in S2, the chromosome image instance segmentation model was trained, and the training parameters were set as follows: the network uniformly used the Adam optimizer to optimize the target loss function, the batch size was set to 8, the learning rate was set to 0.001 and adaptively reduced, and the maximum number of training rounds was set to 500.
Citation Information
Patent Citations
Small target detection method and small target detection system
CN116188929A