Optic disc positioning method and system based on improved YOLOv5 model
By improving the feature aggregation and detection head design of the YOLOv5 model, the problems of light spot interference and anchor frame complexity in optic disc positioning were solved, achieving more efficient optic disc positioning accuracy and precision.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGZHOU HUANGPU YINHAI APERTURE MEDICAL TECH CO LTD
- Filing Date
- 2023-06-29
- Publication Date
- 2026-04-21
AI Technical Summary
Existing methods for visual disc localization are subject to interference from light spots and bright spots, resulting in poor prediction accuracy and low efficiency. Furthermore, the YOLOv5 model suffers from unbalanced feature processing, complex anchor frame design, and the loss function neglecting angles in visual disc detection, leading to low localization accuracy.
The YOLOv5 model is improved by introducing a feature aggregation module and a decoupled detection head. The CSPDSCA and PAN modules are used to enhance feature representation. An anchor-free prediction head is used, and the loss function is improved to SIoU. The classification and regression tasks are separated, and the feature aggregation and detection head design is optimized.
It improves the accuracy and efficiency of visual disc localization, reduces computational complexity, enhances the learning of the predicted bounding box position information, and improves the model's accuracy.
Smart Images

Figure CN116862982B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and more specifically to a visual disc localization method and a visual disc localization system based on an improved YOLOv5 model. Background Technology
[0002] The optic disc is an important physiological structure in the retina and fundus. When performing fundus photography, doctors first need to determine the location of the optic disc and use it as the coordinate center for subsequent observations. Previous optic disc localization methods primarily analyzed and processed fundus images based on features such as the morphology, brightness, and the direction of blood vessels surrounding the optic disc. However, factors such as light spots caused by camera exposure and bright spots that may appear in fundus lesions can interfere with traditional optic disc localization methods, leading to low accuracy. Furthermore, manually designed features are heavily influenced by subjective factors, and feature extraction is time-consuming, resulting in low efficiency in optic disc localization. The YOLOv5 network, a classic single-stage object detection algorithm based on deep learning, boasts excellent inference speed and performs well in optic disc detection tasks. However, it still suffers from poor prediction accuracy and low prediction efficiency. Therefore, a new optic disc localization scheme is needed to address these issues. Summary of the Invention
[0003] The purpose of this invention is to provide a visual disc localization method and system based on an improved YOLOv5 model, so as to at least solve the problems of poor prediction accuracy and low prediction efficiency in existing visual disc localization schemes.
[0004] To achieve the above objectives, a first aspect of the present invention provides a visual disc localization method based on an improved YOLOv5 model. The method includes: acquiring eye image information of a user and preprocessing the eye image information to obtain preprocessed eye image information; training visual disc localization based on a pre-constructed visual disc localization model and the preprocessed eye image information to obtain training results; wherein the pre-constructed visual disc localization model includes an improved feature aggregation module and a decoupled detection head module; obtaining visual disc localization results based on the training results, and pushing the visual disc localization results to the user terminal.
[0005] Optionally, the preprocessing of the eye image information includes: performing image noise reduction and effect enhancement processing on the eye image information.
[0006] Optionally, the visual disc localization model further includes a backbone network; the backbone network is CSPDarkNet.
[0007] Optionally, the feature aggregation module includes: an FPN module, a PAN module, and a CSPDSCA module; the CSPDSCA module includes a short connection branch and a main branch; the main branch contains a standard convolution of size 3×3 and a depthwise separable convolution with a kernel size of 5×5; the features obtained by the short connection branch and the features obtained by the main branch are added together and then used as the output of the CSPDSCA module.
[0008] Optionally, the CSPDSCA module further includes a coordinate attention module for feature enhancement. The feature enhancement rules are as follows: the coordinate attention module performs global average pooling on the input feature map in both the height and width directions to obtain feature maps in the height and width directions respectively; the feature maps in the height and width directions are concatenated to obtain a global receptive field; the original features are reduced in dimensionality based on the global receptive field to obtain dimensionality-reduced features; the dimensionality-reduced features are adjusted to restore the original number of channels, and the attention weights in the height and width directions of the input feature map are obtained based on the Sigmoid activation function; the original feature map is multiplied by the attention weights in the height and width directions of the input feature map to obtain the enhanced features.
[0009] Optionally, the decoupled detection head module generates two feature branches from the original features, including a classification feature branch and a regression feature branch; the classification feature branch is used to perform the target feature classification task; the regression feature branch is used to perform the task of predicting the location information and confidence of the bounding box.
[0010] Optionally, before the original features enter the classification feature branch and the regression feature branch, the original features are further subjected to dimensionality reduction and model parameter reduction processing through a 1×1 convolutional layer.
[0011] Optionally, the prediction head of the decoupled detection head module is an anchor-free prediction head; the visual disc localization model further includes an improved loss function; the improved loss function includes a target localization loss function, a confidence loss function, and a classification loss function.
[0012] A second aspect of the present invention provides a visual disc localization system based on an improved YOLOv5 model. The system includes: a data acquisition unit for acquiring eye image information of a user and preprocessing the eye image information to obtain preprocessed eye image information; a training unit for training visual disc localization based on a pre-constructed visual disc localization model and the preprocessed eye image information to obtain training results; wherein the pre-constructed visual disc localization model includes an improved feature aggregation module and a decoupled detection head module; and a recognition unit for obtaining visual disc localization results based on the training results and pushing the visual disc localization results to the user terminal.
[0013] On the other hand, the present invention provides a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the aforementioned disc positioning method based on the improved YOLOv5 model.
[0014] Through the above technical solution, when performing optic disc localization, the present invention trains a pre-built optic disc localization model. This model includes an improved feature aggregation module to obtain a larger receptive field and enhance the learning of the predicted bounding box position information, thereby improving the accuracy of optic disc localization. Furthermore, the introduction of decoupled detection heads to separately handle the optic disc target classification task and the regression task of bounding box coordinate information and confidence level further improves the model's accuracy.
[0015] Other features and advantages of the embodiments of the present invention will be described in detail in the following detailed description section. Attached Figure Description
[0016] The accompanying drawings are provided to further illustrate embodiments of the present invention and form part of the specification. They are used together with the following detailed description to explain the embodiments of the present invention, but do not constitute a limitation thereof. In the drawings:
[0017] Figure 1 This is a flowchart of the steps of a visual disc localization method based on an improved YOLOv5 model provided in one embodiment of the present invention;
[0018] Figure 2 This is a system structure diagram of a visual disc positioning system based on an improved YOLOv5 model provided in one embodiment of the present invention. Detailed Implementation
[0019] The specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are for illustration and explanation only and are not intended to limit the present invention.
[0020] The optic disc is an important physiological structure in the retina and fundus. When performing fundus photography, doctors first need to determine the location of the optic disc and use it as the coordinate center for subsequent observations. Previous optic disc localization methods primarily analyzed and processed fundus images based on features such as the morphology, brightness, and the direction of blood vessels surrounding the optic disc. However, factors such as light spots caused by camera exposure and bright spots that may appear in fundus lesions can interfere with traditional optic disc localization methods, leading to low accuracy. Furthermore, manually designed features are heavily influenced by subjective factors, and feature extraction is time-consuming, resulting in low efficiency in optic disc localization. The YOLOv5 network, based on deep learning, is a classic single-stage object detection algorithm with excellent inference speed performance and shows good performance in optic disc detection tasks, but some problems still need to be addressed:
[0021] 1) In retinal fundus images, due to the complex imaging environment and physiological factors such as lesions, bright spots and hemorrhages similar to optic disc features will appear in the fundus images. However, the YOLOv5 model processes all extracted features in the same way and does not assign weights to important features.
[0022] 2) The YOLOv5 model retains the three scale detector heads from YOLOv3. Each detector head is responsible for both the classification subtask of discriminating target features and the regression task of calculating the coordinates and confidence probabilities of the predicted bounding boxes. However, the classification and regression subtasks focus on different objectives. The classification task emphasizes the mapping relationship between the features extracted by the network and the sample label space, while the localization task focuses on the similarity of the positional information between the predicted and labeled boxes. Therefore, using the same feature map for both classification and localization can lead to feature space misalignment, resulting in poor prediction performance.
[0023] 3) YOLOv5 uses an anchor-box-based detection head. This method achieves a high recall rate by pre-setting a large number of anchor boxes with a fixed ratio in the network. However, when facing a single target detection task such as optic disc localization in fundus images, it is easy to generate a large number of negative samples, which increases the computational load and complexity of the network.
[0024] 4) YOLOv5 updated CIoU as the bounding box loss function. Compared to the original loss function, which only calculated the overlap area and center distance between the predicted and labeled boxes, it further considered the aspect ratio. However, it ignored the angle between the labeled and predicted boxes, which can easily cause candidate boxes to be updated and moved in ambiguous directions during the training phase, affecting the model's convergence and final performance.
[0025] To address the issues of poor prediction accuracy and low prediction efficiency in existing visual disc localization models, this invention proposes a novel visual disc localization method based on an improved YOLOv5 model. During visual disc localization, this invention trains on a pre-built visual disc localization model, which includes an improved feature aggregation module to acquire a wider receptive field and enhance the learning of bounding box position information, thereby improving the accuracy of visual disc localization. Furthermore, a decoupled detection head is introduced to separately handle the visual disc target classification task and the regression task of bounding box coordinate information and confidence scores, further improving the model's accuracy.
[0026] Figure 1 This is a flowchart of a visual disc localization method based on an improved YOLOv5 model provided by one embodiment of the present invention. Figure 1 As shown, this invention provides a visual disc localization method based on an improved YOLOv5 model, the method comprising:
[0027] Step S10: Collect the user's eye image information and preprocess the eye image information to obtain preprocessed eye image information.
[0028] Specifically, the present invention performs optic disc localization based on the user's real-time eye image information, enabling real-time feedback to the user. To ensure the accuracy of optic disc localization, the present invention preprocesses the image information before model training, including noise reduction and enhancement processing, ensuring recognition accuracy from the original image and avoiding noise affecting the subsequent recognition process.
[0029] Step S20: Perform optic disc localization training based on the pre-built optic disc localization model and the pre-processed eye image information to obtain training results.
[0030] Specifically, based on the widely used YOLOv5 network, this invention designs a new network structure. The model mainly consists of the original backbone network CSPDarkNet, a feature aggregation module, and a decoupled detection head module. The main improvements made to the model network in this invention are as follows:
[0031] 1) In the feature aggregation module of the bottleneck layer of the model, a convolutional block combining depthwise separable convolution and coordinate attention (CSPDSCA) was designed to enhance the feature representation capability of the model.
[0032] 2) A decoupled detection head design is adopted in the detection head module to handle the classification and regression problems in model prediction separately. At the same time, the anchor box-based setting in the original YOLOv5 has been removed, and the method for distinguishing positive and negative samples has been updated.
[0033] 3) The loss function of the original bounding box was improved to accelerate the convergence speed of the candidate boxes.
[0034] Furthermore, the feature aggregation module includes: an FPN module, a PAN module, and a CSPDSCA module; the CSPDSCA module includes a short connection branch and a main branch; the main branch contains a standard convolution of size 3×3 and a depthwise separable convolution with a kernel size of 5×5; the features obtained by the short connection branch and the features obtained by the main branch are added together and then used as the output of the CSPDSCA module.
[0035] In this embodiment of the invention, to improve the detection performance of the YOLOv5 algorithm for optic disc localization in complex fundus images, the present invention designs an optimized multi-scale feature aggregation module (Path Aggregation and PymaridFeaturenetwork, PAFPN). This module further enhances feature representation capabilities after feature extraction. It includes an FPN (Pymarid Feature Network) module, which is the upper and lower layer feature network obtained by upsampling during the feature extraction stage. This network can recover lost feature information from higher layers by fusing lower-level features. It also includes a PAN (Path Aggregation network) module, which extracts multi-scale features from the upper and lower layer feature networks through a bottom-up downsampling operation. This structure facilitates the extraction of more bounding box coordinate information.
[0036] Furthermore, in the optimized feature aggregation module, the present invention designs a CSPDSCA module, which has two branches similar to a residual block structure. The input features are directly added to the features obtained from the main branch on the other side via a shortcut connection. The main branch contains a standard convolution of size 3×3 and a depthwise separable convolution with a kernel size of 5×5, in order to increase the receptive field while reducing the number of model parameters. The depthwise separable convolution involves two operations in the spatial dimension and the channel dimension, and it can be decomposed into two independent convolution kernels, namely depthwise convolution and pointwise convolution. The difference between depthwise convolution and standard convolution is that depthwise convolution performs independent convolution calculations on each channel of the feature channel, so it does not perform channel fusion of the input features like standard convolution. In addition, the number of convolution kernels used in the depthwise convolution operation is consistent with the number of channels of the input features, so the number of channels of the features cannot be changed before and after the operation. Pointwise convolution, using a 1×1 kernel, works by traversing every point on the feature map and fusing features along the channel dimension. Combining depthwise convolution and pointwise convolution in sequence yields the same effect as standard convolution. Compared to standard convolution, depthwise separable convolution significantly reduces the number of model parameters and computational complexity.
[0037] Preferably, the CSPDSCA module further includes: a coordinate attention module for feature enhancement; the feature enhancement rule is as follows: the coordinate attention module performs global average pooling on the input feature map in both the height and width directions to obtain feature maps in the height and width directions respectively; the feature maps in the height and width directions are concatenated to obtain a global receptive field; the original features are reduced in dimensionality based on the global receptive field to obtain dimensionality-reduced features; the dimensionality-reduced features are adjusted to restore the original number of channels, and the attention weights in the height and width directions of the input feature map are obtained based on the Sigmoid activation function; the original feature map is multiplied by the attention weights in the height and width directions of the input feature map to obtain the enhanced features.
[0038] Furthermore, considering the importance of target location information in the localization network, a Coordinate Attention (CA) module is integrated into the CSPDSCA module. This module aggregates the spatial coordinate information of the predicted bounding box into channel attention, thereby capturing a wider range of contextual features while preserving the original detailed coordinate information. The feature map, after passing through the CA module, yields attention-weighted features consistent with the original dimensions and scale, further enhancing the model's feature representation capabilities. First, to encode precise location information in spatial directions, the CA module performs global average pooling on the input feature map in both the height and width directions, obtaining feature maps in the height and width directions respectively, as shown in the following formula:
[0039]
[0040] Then, the feature maps in the height and width directions are concatenated to obtain the complete global receptive field. Next, the original features are dimensionality-reduced using a 1×1 convolutional module with shared weights, reducing the dimension to C / r. The dimensionality-reduced features are then processed through batch normalization layers and non-linear activation functions to obtain the final feature set, calculated as follows:
[0041]
[0042] Finally, the feature maps are processed using 1×1 convolutional kernels to adjust the number of channels, restoring them to the original number of channels C; and the attention weights of the input feature maps in the height direction are obtained through the Sigmoid activation function. Attention weights in the width direction The formula is as follows:
[0043]
[0044] Finally, the original feature map is multiplied sequentially by the attention weights in the corresponding height and width directions to obtain the enhanced features, as shown below:
[0045]
[0046] Furthermore, the decoupled detection head module generates two feature branches from the original features, including a classification feature branch and a regression feature branch; the classification feature branch is used to perform the target feature classification task; the regression feature branch is used to perform the task of predicting the location information and confidence of the bounding box.
[0047] Preferably, before the original features enter the classification feature branch and the regression feature branch, the method further includes: dimensionality reduction and model parameter reduction processing of the original features through a 1×1 convolutional layer.
[0048] In this embodiment of the invention, the YOLOv5 network uses three different scale detection heads from previous versions. Each prediction head simultaneously predicts the target category, bounding box coordinates, and confidence score based on a feature map. Therefore, the prediction task includes both a classification subtask to discriminate target features and a regression task to calculate the coordinates and confidence scores of the predicted bounding boxes. Analysis suggests that the classification and regression subtasks focus on different objectives: the classification task emphasizes the mapping relationship between the features extracted by the network and the sample label space, while the localization task focuses on the similarity of the predicted and labeled box positions. Therefore, using the same feature map for both classification and localization can lead to feature space misalignment, resulting in poor prediction performance. To further improve detection performance and accuracy, this invention introduces a decoupled detection head module. Comparing the original detection head with the decoupled detection head reveals that the original detection head simultaneously performs target feature classification and position and confidence score regression tasks, while the decoupled detection head generates two feature branches from the original feature map: one responsible for target feature classification, and the other responsible for predicting the bounding box position and confidence score regression. Before the feature map enters each branch, it goes through a 1×1 convolutional layer to reduce the channel dimension and reduce the number of model parameters.
[0049] In one possible implementation, the PAN module generates three feature maps, each configured with a decoupled detection head, for example, a structure where a 40×40×512 feature map is matched with one decoupled detection head. The feature map output by the PAN module first passes through a 1×1 convolutional kernel to reduce the number of channels, then through a Batch Normalization (BN) layer, followed by the SiLU (Sigmoid LinearUnit) activation function, and then enters two different branches in parallel. The SiLU activation function has the characteristic of smooth derivatives, making it highly efficient during network forward propagation and well-suited for gradient descent algorithms in neural networks. The feature network enters the classification detection head in the upper branch, with a feature map size of 40×40×nums, where nums is the number of target categories. The lower branch enters the regression detection head, used to output bounding box coordinates and confidence information, respectively. In this way, the classification and regression problems in the object detection task are processed separately, and finally, the parameters output by this feature map are 1600×(num+5).
[0050] Furthermore, the prediction head of the decoupled detection head module is an anchor-free prediction head.
[0051] Specifically, YOLOv5 references the anchor-based design used in two-stage detectors. However, while this improves the performance of object detection networks to some extent, it also introduces a series of problems. First, the anchor box size needs to be pre-fitted to achieve optimal detection performance. Therefore, a suitable set of anchor box scales needs to be designed using clustering methods before training the network. For example, YOLOv5 clusters the training dataset to obtain a set of anchor boxes of different sizes for different scales of detectors. The anchor box scales generated by clustering are usually limited to specific tasks and objectives, require strong prior knowledge, and have insufficient generalization ability. In addition, the anchor-based mechanism increases the complexity of the detector. Retinal fundus images typically contain only one optic disc target region, while using anchor boxes results in a large number of anchor boxes, generating a large number of easily separable negative samples, i.e., background boxes that do not contain the target region at all, thus increasing the number of predictions per image. In summary, anchor-box-based detection networks require setting the coordinates and size of the anchor boxes beforehand. When learning the coordinates of the target, the correlation loss between each predicted box and the anchor box needs to be calculated, which can easily consume a lot of memory.
[0052] Considering that there is only one target region in the visual disc localization task, using an anchor-based detection head would generate a large number of invalid detection boxes. This invention employs an anchor-free prediction head, meaning that the size of the anchor boxes does not need to be manually set. Instead, each point on the feature map obtained from the detection head represents the center point of a prediction box, similar to an anchor box. In actual prediction, the position of each point (anchor point) on the feature map is used as the origin, and then the four vertex information of the target is determined based on this origin. This makes the post-processing of the model simpler and more efficient. Furthermore, this invention uses the following three methods to perform positive sample discrimination for each feature point:
[0053] 1) Determine the relative position of the feature point and the bounding box. If the feature point is located inside the bounding box, then the feature point is a positive sample.
[0054] 2) Map the center point of the bounding box onto the feature map of the current layer, and determine whether the distance between the feature point and the center point of the mapped bounding box is within a range of size 5×5. If so, it is a positive sample.
[0055] 3) Perform another round of filtering on the positive samples from the first two steps. Assume there are currently 800 positive samples and 1 bounding box. First, calculate the classification loss, regression loss, and IoU loss between the current positive sample and the bounding box. This will yield an IoU loss matrix of dimensions (1, 800). Filter the top 10 candidate boxes based on the minimum IoU loss. Sum the IoU of these 10 candidate boxes to obtain the dynamic number of positive samples. Next, continue to select positive samples from these 10 candidate boxes. By utilizing the previously calculated classification and regression losses between the sample and the bounding box, select the predicted box with the smallest sum of losses as the positive sample for that bounding box.
[0056] Preferably, the visual disc localization model further includes an improved loss function; the improved loss function includes a target localization loss function, a confidence loss function, and a classification loss function.
[0057] Specifically, the target loss function used in the model of this invention includes target localization loss. Confidence loss and classification loss The target localization loss evaluates the difference in positional information between the predicted bounding box and the labeled bounding box. YOLOv5 updated CIoU as the bounding box loss function. Compared to the original loss function, which only calculates the overlap area and center distance between the predicted and labeled boxes, it further considers the aspect ratio. However, it ignores the angle between the labeled and predicted boxes, which can easily cause candidate boxes to be updated and moved in ambiguous directions during training, resulting in poor performance after model convergence. This invention proposes to replace the CIoU function in YOLOv5 with the SIoU loss function to further improve network accuracy.
[0058] Furthermore, CIoU incorporates the overlap area between the predicted bounding box and the labeled bounding box, the center distance, and the aspect ratio into the regression localization loss, defined as follows:
[0059]
[0060] Where A and B represent the predicted bounding box and the labeled bounding box, respectively. represents the straight-line distance between the center points of the labeled box and the predicted box, while c is the diagonal distance between the smallest bounding rectangles of these two boxes. and The definition is as follows:
[0061]
[0062] Wherein, IoU is the intersection-union ratio of the predicted bounding box A and the labeled bounding box B, which is defined as follows:
[0063]
[0064] CIoU incorporates their ratio as a penalty term, making the model easier to optimize and thus converge faster when the two boxes are far apart. On the other hand, variables are introduced. To measure the consistency of the aspect ratio of two bounding boxes, and It is its weight function. , represents the width and height of the bounding box, respectively, while w and h represent the width and height of the predicted box, respectively. The final CIoU loss is defined as follows:
[0065]
[0066] However, CIoULoss still doesn't consider the relative positions of the predicted and labeled boxes, i.e., the mismatched angles. In fundus retinal images, due to the shooting angle, differences between the left and right eyes, and data augmentation strategies, the optic disc may be located in any region of the image. Without considering the relative positions of the target and predicted boxes, the network may struggle to determine the direction of movement during the continuous updating of the predicted box position during training, leading to low convergence efficiency. To address this issue, the original loss function is improved to SIOU loss. SIOU loss consists of four parts: angle loss, distance loss, shape loss, and IoU loss. The SIoU function first considers the angle between the predicted and labeled boxes. The angle loss is defined as follows:
[0067]
[0068] in The distance between the center points of the predicted bounding box and the annotation box is calculated as follows:
[0069]
[0070] in The coordinates of the center of the annotation box Here are the center coordinates of the predicted bounding box. Ch is the height difference between the center points of the predicted bounding box and the label box, calculated as follows:
[0071]
[0072] Therefore, it can be concluded that:
[0073]
[0074] Taking into account the angular loss between the standard bounding box and the predicted bounding box, the new distance loss is defined as follows:
[0075]
[0076] in:
[0077]
[0078] The corresponding shape loss Ω is:
[0079]
[0080] in:
[0081]
[0082] The final SIOULoss definition is as follows:
[0083]
[0084] Furthermore, the confidence loss measures the probability of a target existing in the predicted bounding box; the classification loss is the difference between the target category and the labeled bounding box category. This invention uses the commonly used binary cross-entropy function, which reduces computational complexity and can output multiple labels for a single target. Ultimately, the overall network loss is a weighted sum of the three losses, as shown in the following formula. Typically, the confidence loss has the largest weight. The weight coefficients for each loss in this invention are set as follows: , so that:
[0085]
[0086] Step S30: Obtain the visual disc positioning result based on the training result, and push the visual disc positioning result to the user terminal.
[0087] Specifically, after performing video disc localization based on the improved video disc localization model, an accurate video disc localization result is obtained, and this result is pushed to the user terminal to provide feedback on the recognition result.
[0088] Figure 2 This is a system structure diagram of a visual disc positioning system based on an improved YOLOv5 model provided in one embodiment of the present invention. Figure 2 As shown, this invention provides a visual disc localization system based on an improved YOLOv5 model. The system includes: a data acquisition unit for acquiring eye image information of a user and preprocessing the eye image information to obtain preprocessed eye image information; a training unit for training visual disc localization based on a pre-built visual disc localization model and the preprocessed eye image information to obtain training results; wherein the pre-built visual disc localization model includes an improved feature aggregation module and a decoupled detection head module; and a recognition unit for obtaining visual disc localization results based on the training results and pushing the visual disc localization results to the user terminal.
[0089] The present invention also provides a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the aforementioned visual disc positioning method based on the improved YOLOv5 model.
[0090] Those skilled in the art will understand that all or part of the steps in the methods of the above embodiments can be implemented by a program instructing related hardware. This program is stored in a storage medium and includes several instructions to cause a microcontroller, chip, or processor to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0091] The optional embodiments of the present invention have been described in detail above with reference to the accompanying drawings. However, the embodiments of the present invention are not limited to the specific details described above. Within the scope of the technical concept of the embodiments of the present invention, various simple modifications can be made to the technical solutions of the embodiments of the present invention, and these simple modifications all fall within the protection scope of the embodiments of the present invention. It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. To avoid unnecessary repetition, the embodiments of the present invention will not further describe the various possible combinations.
[0092] Furthermore, various different embodiments of the present invention can be combined in any way, as long as they do not violate the spirit of the embodiments of the present invention, they should also be regarded as the content disclosed by the embodiments of the present invention.
Claims
1. A visual disc localization method based on an improved YOLOv5 model, characterized in that, The method includes: Collect the user's eye image information and preprocess the eye image information to obtain preprocessed eye image information; Optic disc localization training is performed based on a pre-built optic disc localization model and the pre-processed eye image information to obtain training results; wherein, the pre-built optic disc localization model includes an improved feature aggregation module and a decoupled detection head module; wherein, The feature aggregation module includes: an FPN module, a PAN module, and a CSPDSCA module; the CSPDSCA module includes a short connection branch and a main branch; the main branch contains a standard convolution of size 3×3 and a depthwise separable convolution with a kernel size of 5×5; the features obtained by the short connection branch and the features obtained by the main branch are added together and then used as the output of the CSPDSCA module. The CSPDSCA module further includes a coordinate attention module for feature enhancement. The feature enhancement rules are as follows: the coordinate attention module performs global average pooling on the input feature map in both the height and width directions to obtain feature maps in the height and width directions respectively; the feature maps in the height and width directions are concatenated to obtain the global receptive field; the original features are dimensionality-reduced based on the global receptive field to obtain dimensionality-reduced features; the dimensionality-reduced features are channel-adjusted to restore the original number of channels, and attention weights in the height and width directions of the input feature map are obtained based on the Sigmoid activation function; the original feature map is multiplied by the attention weights in the height and width directions of the input feature map to obtain the enhanced features. The prediction head of the decoupled detection head module is an anchor-free prediction head; the visual disc localization model also includes an improved loss function; the improved loss function includes a target localization loss function, a confidence loss function, and a classification loss function; Based on the training results, the visual disc positioning result is obtained and then pushed to the user terminal.
2. The method according to claim 1, characterized in that, The preprocessing of the eye image information includes: performing image noise reduction and effect enhancement processing on the eye image information.
3. The method according to claim 1, characterized in that, The visual disc localization model also includes a backbone network; the backbone network is CSPDarkNet.
4. The method according to claim 1, characterized in that, The decoupled detection head module generates two feature branches from the original features, including a classification feature branch and a regression feature branch; The classification feature branch is used to perform the target feature classification task; The regression feature branch is used to perform the task of predicting the location information and confidence of the bounding box.
5. The method according to claim 4, characterized in that, Before the original features enter the classification feature branch and the regression feature branch, the following are also included: The original features are processed by dimensionality reduction and model parameter reduction through a 1×1 convolutional layer.
6. A visual disc positioning system based on an improved YOLOv5 model, characterized in that, The system is used to execute the optic disc localization method based on the improved YOLOv5 model as described in any one of claims 1-5, and the system comprises: The acquisition unit is used to acquire the user's eye image information and preprocess the eye image information to obtain preprocessed eye image information; The training unit is used to train optic disc localization based on a pre-built optic disc localization model and the pre-processed eye image information to obtain training results; wherein, the pre-built optic disc localization model includes an improved feature aggregation module and a decoupled detection head module; The identification unit is used to obtain the video disc positioning result based on the training result and push the video disc positioning result to the user terminal.
7. A computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the disc positioning method based on the improved YOLOv5 model as described in any one of claims 1-5.
Citation Information
Patent Citations
Eye fundus image optic disc and macular positioning detection algorithm based on YOLO-V3
CN111028230A
Method and system for detecting rotating target of aerial image
CN115690627A