A deep learning-based pterygium diagnosis method and system

By using improved YOLOv5 and TransUNet models, accurate classification and segmentation of pterygium in the eye were achieved, solving the problems of low efficiency and poor accuracy in existing diagnostic methods, generating a visual diagnostic report, and improving diagnostic efficiency and accuracy.

CN121305656BActive Publication Date: 2026-03-27SOUTH CENTRAL UNIVERSITY FOR NATIONALITIES
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-11
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

Current methods for diagnosing pterygium rely on manual observation by doctors, which is inefficient and prone to missed diagnoses. AI recognition models handle classification and segmentation tasks in isolation, leading to inaccurate localization and inconsistent diagnostic results, thus reducing the accuracy of diagnosis.

Method used

By employing a deep learning-based approach, combined with an improved YOLOv5 classification model and a TransUNet segmentation model, we can achieve accurate classification, localization, and segmentation of pterygium lesions, and generate a visual diagnostic report through iterative optimization.

Benefits of technology

It improves diagnostic efficiency and accuracy, enabling precise classification, localization, and segmentation of pterygium lesions, generating comprehensive and intuitive diagnostic evidence, and providing efficient diagnostic support for clinicians.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121305656B_ABST
    Figure CN121305656B_ABST
Patent Text Reader

Abstract

The application provides a deep learning-based pterygium diagnosis method and system, which comprises the following steps: acquiring an eye image of a patient, and performing data preprocessing on the eye image to generate a first size image for a classification task; inputting the first size image into a pre-trained classification model, wherein the classification model is constructed based on an improved YOLOv5 network structure, and is used to output a classification result of the eye image and a predicted bounding box of a lesion area; acquiring the eye image with the classification result being to be observed or being recommended for surgery, and generating a second size image set for a segmentation task; inputting the second size image set into a pre-trained segmentation model, wherein the segmentation model is constructed based on an improved TransUNet network structure, and is used to output a preliminary pterygium segmentation mask; the accurate classification, positioning and segmentation of the pterygium lesion are realized, a visual diagnosis report is generated, comprehensive and intuitive diagnosis basis is provided for clinicians, and the diagnosis efficiency and accuracy are improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of eye diagnosis, in particular to an eye pterygium diagnosis method and system based on deep learning. BACKGROUND

[0002] Pterygium of the eyeball is a triangular fibrovascular membrane formed by abnormal proliferation of conjunctival tissue, which will affect the patient's vision and even cause blindness once it involves the corneal pupil area. According to investigations, the global prevalence of pterygium is about 12%, and the most affected are outdoor workers such as fishermen and farmers who are often exposed to ultraviolet light; the number of ophthalmologists is small, the gap is large, the training cycle is long, and the medical resources of the ophthalmology department in primary hospitals are severely insufficient, making it difficult for a large number of patients to obtain timely and effective diagnosis and treatment.

[0003] Current eye pterygium diagnosis mainly relies on manual observation of slit lamp images by doctors, which has strong subjectivity, low efficiency and is prone to missed diagnosis, and existing AI recognition models are also used for recognition and diagnosis, which can achieve preliminary assistance, but often isolate the classification and segmentation tasks, resulting in inaccurate positioning and inconsistent diagnosis results, reducing the accuracy of diagnosis. SUMMARY

[0004] Therefore, the present application provides an eye pterygium diagnosis method and system based on deep learning, which realizes accurate classification, positioning and segmentation of pterygium lesions, generates a visual diagnosis report, and provides comprehensive and intuitive diagnostic evidence for clinicians, improving the efficiency and accuracy of diagnosis.

[0005] The technical scheme of the present application is as follows: The present application provides an eye pterygium diagnosis method based on deep learning, comprising the following steps:

[0006] S1, obtaining an eye image of a patient and performing data preprocessing on the eye image to generate a first size image for classification task;

[0007] S2, inputting the first size image into a pre-trained classification model, wherein the classification model is constructed based on an improved YOLOv5 network structure and is used to output the classification result of the eye image and the predicted bounding box of the lesion area, and the classification result includes recommended surgery, observation and normal eye;

[0008] S3, obtaining the eye image with a classification result of observation or recommended surgery, and performing data preprocessing to generate a second size image set for segmentation task;

[0009] S4, inputting the second size image set into a pre-trained segmentation model, wherein the segmentation model is constructed based on an improved TransUNet network structure and is used to output a preliminary pterygium segmentation mask;

[0010] S5, two-dimensional hole optimization and edge smoothing processing are performed on the preliminary pterygium segmentation mask to obtain a final segmentation result;

[0011] S6, a target bounding box is generated based on the segmentation result, and the classification model parameters are iteratively fine-tuned to align the predicted bounding box of the lesion region with the target bounding box; after convergence, the optimized classification result, the predicted bounding box and the segmentation result are fused to generate a visual diagnostic report.

[0012] On the basis of the above technical scheme, preferably, in step S1, the patient's eye image is obtained, and the eye image is preprocessed to generate a first size image for the classification task, including the following sub-steps:

[0013] S11, an original color patient eye image is collected by a camera mounted on a medical slit lamp microscope;

[0014] S12, the original color patient eye image is uniformly converted into a three-channel RGB format, and color correction and white balance processing are performed to obtain a standard eye image;

[0015] S13, the resolution of the standard eye image is resampled to a fixed first size, and data enhancement operations are performed on the resampled image, including mirror flipping, random rotation and random adjustment of brightness and contrast, to obtain a first size image for the classification task.

[0016] On the basis of the above technical scheme, preferably, in step S2, the classification model is constructed based on an improved YOLOv5 network structure, and the network structure of the classification model includes a backbone network, a neck network and a detection head, wherein:

[0017] The backbone network includes a slice layer, a first convolutional layer, a plurality of feature extraction modules and a multi-scale pooling layer, the slice layer is used for slicing the input first size image, the input end of the first convolutional layer is connected with the output end of the slice layer, and the first convolutional layer is used for preliminary feature extraction and down-sampling of the sliced feature map; the plurality of feature extraction modules are connected in sequence, the feature extraction module adopts a parallel double-path structure, the features extracted by the Transformer module are fused with the input features to output a deep fusion feature map, the input end of the first-end feature extraction module is connected with the output end of the first convolutional layer, the output end of the last-end feature extraction module is connected with the input end of the multi-scale pooling layer, and the multi-scale pooling layer is used for multi-scale pooling and splicing of the deep fusion feature map to obtain a multi-scale feature map with fused context features;

[0018] The neck network adopts a path aggregation network (PANet) structure, receives the multi-scale feature map output by the backbone network, and performs feature fusion from top to bottom and from bottom to top through up-sampling and splicing operations;

[0019] The detection head is connected to the output end of the neck network, and the detection head includes three detection layers corresponding to different resolutions respectively, each detection layer converts the fused features into final prediction output through a convolution network, including a class probability of a lesion region, a prediction bounding box coordinate of the lesion region and a confidence of the prediction bounding box.

[0020] On the basis of the above technical scheme, preferably, the feature extraction module includes a second convolution layer, a Transformer module, a third convolution layer and a feature fusion layer, the output end of the second convolution layer is connected to the input end of the Transformer module, the output end of the Transformer module is connected to the input end of the third convolution layer, the output end of the third convolution layer is connected to the input end of the feature fusion layer, and the input end of the second convolution layer is connected to the input end of the feature fusion layer through a residual path.

[0021] The feature extraction module includes two parallel processing paths, the input end of the second convolution layer serves as the input of the main path, and the other path retains the feature map of the main path input as a residual connection.

[0022] The second convolution layer compresses the channel dimension through 1x1 convolution to output a compressed feature map; the compressed feature map is flattened into a sequence matrix in the spatial dimension and input into the Transformer module, and the global context dependency of the feature is obtained by adopting a multi-head self-attention mechanism and a feedforward network; the sequence output by the Transformer module is subjected to a transposed inverse operation to restore the feature map; the restored feature map is input into the third convolution layer, the third convolution layer adjusts the channel of the restored feature map through 1x1 convolution to obtain a feature map output by the main path; and the feature map output by the main path and the feature map input by the main path are spliced in the channel dimension to obtain a deep fusion feature map.

[0023] On the basis of the above technical scheme, preferably, the step S3 includes obtaining an eye image with a classification result of observation or surgery suggestion, and performing data preprocessing to generate a second size image set for a segmentation task, including the following sub-steps:

[0024] According to the classification result, an eye image determined to be observed or suggested for surgery is screened out, and a first size image corresponding to the eye image is resampled to a second size image for a segmentation task;

[0025] The second size image is subjected to mirror processing and labeling to obtain a second size image set after data expansion.

[0026] Based on the above technical scheme, preferably, the segmentation model in step S4 is based on an improved TransUNet network structure, comprising: integrating a multi-scale attention module at the jump connection between the encoder and the decoder, performing multi-scale feature fusion processing on the encoder feature map through the multi-scale attention module, and splicing with the decoder upsampling;

[0027] The multi-scale attention module comprises a normalized input layer, a convolution expansion layer, a scale splitting layer, an attention generation unit, an attention fusion layer, an initial splicing layer and a dimension reduction convolution layer, wherein;

[0028] The normalized input layer is used for standardizing the feature map input by the encoder in the channel dimension, the input end of the convolution expansion layer is connected with the output end of the normalized input layer, and the convolution expansion layer expands the channel number of the feature map input by the encoder to twice through 1*1 convolution operation;

[0029] The input end of the scale splitting layer is connected with the output end of the convolution expansion layer, and the scale splitting layer averages and splits the feature map with expanded channel number into an attention path and a feature path in the channel dimension, the channel numbers of the attention path and the feature path are the same;

[0030] The output end of the attention path is connected with the input end of the attention generation unit, and the attention generation unit comprises a plurality of branches, each branch comprises a gate convolution layer and a deep convolution layer, a hollow convolution layer and a fourth convolution layer connected in sequence, the output end of the attention path is connected with the input end of each gate convolution layer and deep convolution layer respectively, the kernel size of each gate convolution layer matches the convolution kernel size of the corresponding branch, and the spatial weight map is generated by inputting the feature map input by the branch into the gate convolution layer and through the activation function;

[0031] The output end of each gate convolution layer is connected with the output end of the corresponding fourth convolution layer in residual connection, for element-wise multiplication of the spatial weight feature map of each branch and the feature map output by the corresponding fourth convolution layer, to obtain a spatial weight feature map; and input into the attention fusion layer, the attention fusion layer splices the spatial weight feature maps output by the plurality of branches to obtain a multi-scale attention feature map;

[0032] The output end of the attention fusion layer is connected with the input end of the initial splicing layer, and the output end of the feature path is connected with the input end of the initial splicing layer in residual connection, the multi-scale attention feature map and the input feature map of the initial splicing layer are element-wise multiplied and fused to obtain an initial splicing feature map;

[0033] The input end of the dimension reduction convolution layer is connected with the output end of the initial splicing layer, and the dimension reduction convolution layer reduces the dimension of the initial splicing feature map through 1*1 convolution to generate a splicing modulation feature map;

[0034] The input end of the normalized input layer is connected in residual with the output end of the dimension reduction convolutional layer, used for multiplying the spliced modulation feature map with a learnable scaling parameter, and performing element-by-element addition with the feature map of the encoder input to generate a multi-scale fusion feature map, which is output to the decoder for upsampling and splicing.

[0035] On the basis of the above technical scheme, preferably, the two-dimensional hole optimization and edge smoothing processing on the preliminary pterygium segmentation mask in step S5 to obtain the final segmentation result, comprising:

[0036] The two-dimensional hole optimization on the preliminary pterygium segmentation mask comprises connected domain analysis, small area noise filtering and internal hole filling to obtain a preliminary optimized segmentation mask.

[0037] The preliminary optimized segmentation mask is subjected to morphological closing operation and edge filtering operation to smooth the profile to generate a refined segmentation mask to obtain the final segmentation result.

[0038] On the basis of the above technical scheme, preferably, step S6 comprises the following sub-steps:

[0039] The minimum circumscribed rectangle of the refined segmentation mask is calculated, and the coordinate values of the minimum circumscribed rectangle are defined as the target bounding box.

[0040] The CIoU loss function of the classification model is used to calculate the loss value between the predicted bounding box of the lesion area and the target bounding box, and the Adam optimizer is used to iteratively update the weight parameters of the classification model until the model converges, so that the predicted bounding box is aligned with the target bounding box.

[0041] According to the fine-tuned classification model, the predicted bounding box of the lesion area and the classification result of the eye image are output for the first size image, and are fused with the final segmentation result to generate a visual diagnostic report in the diagnostic platform page window.

[0042] In a second aspect, the application further provides an eye pterygium diagnosis system based on deep learning, which is realized by using the eye pterygium diagnosis method based on deep learning, and the system comprises:

[0043] The first image processing module is used for acquiring the eye image of a patient and performing data preprocessing on the eye image to generate a first size image for a classification task.

[0044] The classification module is used for inputting the first size image into a pre-trained classification model, wherein the classification model is constructed based on an improved YOLOv5 network structure and is used to output a classification result of the eye image and a predicted bounding box of a lesion area, and the classification result comprises a recommended surgery, an observation and a normal eye.

[0045] The second image processing module is configured to acquire an eye image with a classification result of observation or surgery recommendation, and perform data preprocessing to generate a second size image set for a segmentation task.

[0046] The segmentation module is configured to input the second size image set into a pre-trained segmentation model, which is constructed based on an improved TransUNet network structure, to output a preliminary pterygium segmentation mask.

[0047] The image optimization module is configured to perform two-dimensional hole optimization and edge smoothing processing on the preliminary pterygium segmentation mask to obtain a final segmentation result.

[0048] The model fine-tuning output module is configured to generate a target bounding box based on the segmentation result, and align the predicted bounding box of the lesion area with the target bounding box by iteratively fine-tuning the classification model parameters with the target as the goal; after convergence, the optimized classification result, the predicted bounding box and the segmentation result are fused to generate a visual diagnosis report.

[0049] In a third aspect, the present application further provides a computer-readable storage medium, wherein the storage medium stores a deep learning-based eye pterygium diagnosis method program, and the deep learning-based eye pterygium diagnosis method program is executed to implement the deep learning-based eye pterygium diagnosis method.

[0050] The deep learning-based eye pterygium diagnosis method and system of the present application have the following beneficial effects compared with the prior art:

[0051] (1) Through the cooperative work of the improved YOLOv5 classification model and the TransUNet segmentation model, accurate classification, positioning and segmentation of pterygium lesions are realized; and the segmentation result is used to guide the iterative optimization of the classification model, thereby improving the positioning accuracy of the bounding box and the consistency of the diagnosis, and finally generating a visual diagnosis report set that integrates multiple analysis results, thereby providing comprehensive and intuitive diagnostic basis for clinicians and greatly improving the diagnostic efficiency and accuracy;

[0052] (2) Through the improved YOLOv5 classification model, the accuracy of eye pterygium diagnosis is effectively improved, the model integrates the Transformer module in the original C3 module, so that it has strong global context perception ability while retaining the high positioning advantage of the YOLO algorithm, can more accurately identify small edge blurred lesions, and realizes high-precision automatic classification and lesion positioning;

[0053] (3) The improved TransUNet segmentation model integrated with a multi-scale attention module improves the segmentation accuracy and robustness of pterygium lesions. The module can capture spatial context information of different scales in parallel and adaptively fuse and calibrate multi-scale features through a gating mechanism, achieving accurate segmentation of the pterygium area and enhancing the model's ability to identify small lesions and complex shapes. BRIEF DESCRIPTION OF DRAWINGS

[0054] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed in the embodiments or prior art description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0055] Figure 1 Flowchart of the deep learning-based eye pterygium diagnosis method of the present application;

[0056] Figure 2 YOLOv5 network structure diagram of the deep learning-based eye pterygium diagnosis method of the present application;

[0057] Figure 3 Improved network structure diagram of the feature extraction module of the deep learning-based eye pterygium diagnosis method of the present application;

[0058] Figure 4 Segmentation model network structure diagram of the deep learning-based eye pterygium diagnosis method of the present application;

[0059] Figure 5 Multi-scale attention module network structure diagram of the deep learning-based eye pterygium diagnosis method of the present application;

[0060] Figure 6 Data preprocessing schematic diagram of the deep learning-based eye pterygium diagnosis method of the present application;

[0061] Figure 7 Classification result schematic diagram of the deep learning-based eye pterygium diagnosis method of the present application;

[0062] Figure 8 Diagnosis platform architecture schematic diagram of the deep learning-based eye pterygium diagnosis method of the present application. DETAILED DESCRIPTION

[0063] The technical solutions of the present invention will be clearly and completely described below with reference to the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.

[0064] like Figures 1-8 As shown, in a first aspect, the present invention provides a deep learning-based diagnostic method for pterygium, comprising the steps of:

[0065] S1. Acquire images of the patient's eyes and perform data preprocessing on the eye images to generate a first-size image for the classification task.

[0066] Step S1 includes the following sub-steps:

[0067] S11 uses a camera mounted on a medical slit-lamp microscope to acquire raw color images of the patient's eyes;

[0068] It should be noted that the original color images of the patient's ocular surface are acquired using a high-resolution digital camera mounted on a professional medical slit-lamp microscope. During the acquisition process, it is necessary to ensure uniform illumination, that the patient's eyes are kept moderately open and that the gaze direction is fixed, in order to obtain high-quality images of the lesion area that are clear and free from motion blur. The original image resolution is preferably 5184×3456 pixels, and it is stored in a lossless compression format to retain the most image detail information.

[0069] S12 converts the original color patient eye images into a unified three-channel RGB format, and performs color correction and white balance processing to obtain a standard eye image;

[0070] It should be noted that, in order to eliminate color deviations and lighting differences caused by different acquisition devices, the original images were standardized. First, the images were uniformly converted into a three-channel RGB color space to ensure the consistency of color information. Then, an automatic white balance algorithm based on white point estimation was used for color correction to restore the true colors of the image. At the same time, histogram equalization or adaptive contrast limiting algorithms were applied to enhance the color, thereby improving the overall contrast and detail visibility of the image, and finally obtaining a standard eye image with accurate colors and outstanding details.

[0071] S13, resample the standard eye image to a fixed first size at its resolution, and perform data augmentation operations on the resampled image, including mirror flipping, random rotation, and random adjustment of brightness and contrast, to obtain a first-size image for the classification task.

[0072] It should be noted that, in order to meet the requirements of the subsequent classification model on the input size, the resolution of the standardized image is resampled to a fixed first size, which is preferably 640x448 pixels; the resampling algorithm can use bilinear interpolation or Lanczos resampling to complete the size transformation while maintaining image clarity;

[0073] In order to further improve the generalization ability and robustness of the model and avoid overfitting, data augmentation is performed on the resampled image, and the enhancement strategy includes: with a probability of 50%, mirror flip in the horizontal or vertical direction; random rotation within an angle range of -15° to +15°, and reflection padding method is used to fill the edge area generated by rotation; randomly adjust the image brightness within a coefficient range of 0.8 to 1.2; randomly adjust the image contrast within a coefficient range of 0.8 to 1.5.

[0074] In the embodiment, through the above processing, a first size image suitable for the classification task is finally generated, which not only meets the model input requirements, but also contains enhanced sample features, providing data support for the accurate classification of the subsequent model.

[0075] S2, input the first size image into the pre-trained classification model, the classification model is constructed based on the improved YOLOv5 network structure, and is used to output the classification result of the eye image and the prediction bounding box of the lesion area, the classification result includes recommended surgery, observation and normal eye.

[0076] It should be noted that, in the embodiment, the deep learning model based on the improved YOLOv5 architecture recognizes the preprocessed eye image, and the model can simultaneously classify and judge the eye health status and accurately position the existing pterygium lesion.

[0077] The classification model in step S2 is constructed based on the improved YOLOv5 network structure, and the network structure of the classification model includes a backbone network, a neck network and a detection head, wherein;

[0078] The backbone network comprises a slice layer, a first convolutional layer, a plurality of feature extraction modules and a multi-scale pooling layer, the slice layer is configured to perform a slicing operation on an input first-size image, an input end of the first convolutional layer is connected with an output end of the slice layer, and the first convolutional layer is configured to perform preliminary feature extraction and down-sampling on a sliced feature map; the plurality of feature extraction modules are sequentially connected in a head-to-tail manner, the feature extraction module adopts a parallel double-path structure, the feature extraction module fuses features extracted by a Transformer module with input features, and outputs a deep fusion feature map, an input end of a feature extraction module at the head is connected with an output end of the first convolutional layer, and an output end of a feature extraction module at the tail is connected with an input end of the multi-scale pooling layer, and the multi-scale pooling layer is configured to perform multi-scale pooling and splicing on the deep fusion feature map to obtain a multi-scale feature map with fused context features;

[0079] The feature extraction module comprises a second convolutional layer, a Transformer module, a third convolutional layer and a feature fusion layer, an output end of the second convolutional layer is connected with an input end of the Transformer module, an output end of the Transformer module is connected with an input end of the third convolutional layer, and an output end of the third convolutional layer is connected with an input end of the feature fusion layer, and an input end of the second convolutional layer is connected with the input end of the feature fusion layer through a residual path;

[0080] The feature extraction module comprises two parallel processing paths, the input end of the second convolutional layer serves as an input of a main path, and another path retains a feature map of the input of the main path as a residual connection;

[0081] The second convolutional layer compresses a channel dimension through 1*1 convolution to output a compressed feature map, the compressed feature map is flattened into a sequence matrix in a spatial dimension and input into the Transformer module, a multi-head self-attention mechanism and a feedforward network are adopted to obtain a global context dependency relationship of the feature, the sequence output by the Transformer module is subjected to a transposition inverse operation to restore the feature map, the restored feature map is input into the third convolutional layer, the third convolutional layer adjusts a channel of the restored feature map through 1*1 convolution to obtain a feature map output by the main path, and the feature map output by the main path is spliced with the feature map input by the main path in a channel dimension to obtain a deep fusion feature map.

[0082] It should be noted that the backbone network is responsible for gradually extracting and condensing multi-level feature information from the input image, wherein the slice layer is the starting part of the network, the slice layer performs slicing operation on the input high-resolution image, recombines the spatial dimension information into the channel dimension, realizes effective downsampling without losing information, and greatly reduces the subsequent calculation amount; the first convolutional layer is immediately followed by the slice layer, which is composed of standard convolution, batch normalization layer and SiLU activation function, used for preliminary feature extraction of the sliced features, and further compresses the width and height of the feature map by setting the convolution operation step greater than 1, and expands the receptive field; a plurality of feature extraction modules are connected in turn, for deep feature extraction; the internal module adopts a parallel double-path structure, one is the main path, and the other is the residual path.

[0083] In the main path: the input feature first undergoes 1*1 second convolutional layer for channel compression, then the feature map is flattened and converted into sequence data in the spatial dimension, and input into the Transformer module; the Transformer uses its built-in multi-head self-attention mechanism and feedforward network to model all element relationships in the sequence, thereby capturing the global contextual dependency relationship of the feature; the output sequence of the Transformer is subjected to transposition and reshaping operation to restore the feature map structure, and finally subjected to 1*1 third convolutional layer for channel adjustment; in the residual path: this path retains the input feature map of the main path without any transformation; the feature map output by the main path is spliced with the feature map of the residual path in the channel dimension, and is fused and dimensionally reduced through subsequent bottleneck structure operation, finally outputting a deep fusion feature map, effectively fusing local detailed features and global context information.

[0084] The multi-scale pooling layer pools the feature map by using multiple different scale maximum pooling kernels in parallel, and splices all the pooling results with the original input, thereby fusing features of different size receptive fields, greatly enhancing the robustness of the model to lesions of different scales. The final output of the backbone network is a multi-scale feature map containing rich context information.

[0085] The neck network adopts the path aggregation network PANet structure, receives the multi-scale feature map output by the backbone network, and performs feature fusion from top to bottom and from bottom to top through upsampling and splicing operations;

[0086] It should be noted that the neck network transmits high-dimensional semantic features from the deep layer to the shallow layer through the top-down upsampling path, and at the same time, transmits high-resolution detailed features from the shallow layer to the deep layer through the bottom-up downsampling path, at each step, the features of the same scale are fused through splicing operation, thereby constructing a powerful bidirectional feature pyramid, so that each scale of feature map is rich in high-resolution details and high-dimensional semantic information.

[0087] The detection head is connected to the output end of the neck network, and the detection head includes three detection layers corresponding to different resolutions respectively, and each detection layer converts the fused features into a final prediction output through a convolution network, including a class probability of a lesion region, a prediction bounding box coordinate of the lesion region and a confidence of the prediction bounding box.

[0088] It should be noted that the detection head is connected to the output end of the neck network, and the detection head includes three detection layers corresponding to different resolutions respectively, and each detection layer converts the fused features into a final prediction tensor through a convolution operation; the prediction tensor includes three types of key information: a class probability of a lesion region, a prediction bounding box coordinate of the lesion region and a confidence of the prediction bounding box; the class with the highest confidence and the lesion bounding box coordinate accurately positioned in the image are obtained.

[0089] The classification model improved based on YOLOv5 in the embodiment effectively improves the accuracy of the diagnosis of pterygium of the eye, the model fuses a Transformer module in the original C3 module, so that it has strong global context perception ability while retaining the high-efficiency positioning advantage of the YOLO algorithm, can more accurately identify a small and fuzzy lesion, and realizes high-precision automatic classification and lesion positioning.

[0090] S3, obtaining an eye image with a classification result of observation or surgery suggestion, and performing data preprocessing to generate a second-size image set for a segmentation task.

[0091] Step S3 includes the following sub-steps:

[0092] According to the classification result, the eye image determined to be observed or suggested to be operated is screened out, and the corresponding first-size image is resampled to a second-size image for a segmentation task;

[0093] It should be noted that, since the classification model and the segmentation model have different input requirements, the positive image screened out needs to be converted in size, and the first-size image screened out is resampled to a second-size image required for the segmentation task, and the size is preferably 512*512 pixels, and the resampling algorithm is preferably a bilinear interpolation method, so as to retain the detail information of the image as much as possible while adjusting the size, and to ensure that the segmentation model can obtain standardized and lossless input data.

[0094] The second-size image is mirror-processed and labeled to obtain a second-size image set after data expansion.

[0095] It should be noted that, in order to enhance the generalization ability and robustness of the segmentation model and prevent the model from overfitting, the image data set after resampling is subjected to data augmentation, mainly mirror processing, with a probability of 50% for horizontal or vertical flipping; when any image transformation operation is performed, the corresponding segmentation label mask must be subjected to the same synchronous transformation, so as to ensure that the image and the label are always strictly aligned in space; after the above processing, an expanded second size image set with accurate image and label correspondence is finally obtained, laying a data foundation for training a high-performance segmentation model.

[0096] S4, inputting the second size image set into a pre-trained segmentation model, the segmentation model being constructed based on an improved TransUNet network structure, and being used to output a preliminary pterygium segmentation mask.

[0097] It should be noted that the improved TransUNet architecture segmentation model performs pixel-level fine segmentation on the positive eye images screened out in step S3, extracts the outline of the pterygium lesion, and generates a preliminary segmentation mask, thereby providing a basis for subsequent post-processing optimization.

[0098] The segmentation model in step S4 is based on an improved TransUNet network structure, which includes: integrating a multi-scale attention module at each jump connection between the encoder and the decoder, performing multi-scale feature fusion processing on the encoder feature map through the multi-scale attention module, and splicing with the decoder upsampling;

[0099] It should be noted that in the present embodiment, a multi-scale attention module is integrated at each jump connection between the encoder and the decoder, which is responsible for intelligent processing of the feature map transmitted by the encoder, and then splicing with the features after the decoder upsampling, thereby greatly enhancing the model's feature fusion and segmentation ability for multi-scale and morphologically variable lesions.

[0100] The multi-scale attention module includes a normalized input layer, a convolution expansion layer, a scale splitting layer, an attention generation unit, an attention fusion layer, an initial splicing layer and a dimension reduction convolution layer, wherein;

[0101] The normalized input layer is used for standardizing the feature map input by the encoder in the channel dimension, the input end of the convolution expansion layer is connected with the output end of the normalized input layer, and the convolution expansion layer expands the channel number of the feature map input by the encoder to twice through 1x1 convolution operation;

[0102] It should be noted that the feature map output by the encoder is first input to the multi-scale attention module, is standardized by a layer normalization layer to stabilize training and accelerate convergence, and is then expanded to twice the original number of channels by a 1x1 convolution layer to improve the expression capacity of the model and provide more rich feature bases for subsequent multi-branch processing, and the expression is:

[0103] X ^ =Conv 1×1 (LayerNorm(X))∈R 2C×H×W

[0104] In the formula, X ^ is the feature map output by the channel expansion layer, Conv 1×1 () is a 1x1 convolution operation, X is the feature map output by the encoder, and LayerNorm(X) is the normalization processing of the feature map output by the encoder.

[0105] The input end of the scale splitting layer is connected to the output end of the convolution expansion layer, and the scale splitting layer averages the channel-expanded feature map in the channel dimension into an attention path and a feature path, and the channel numbers of the attention path and the feature path are the same;

[0106] It should be noted that the attention path is used to generate multi-scale spatial attention weights, and the feature path is used to retain the original feature information as an identity mapping for subsequent residual connection, wherein the feature map output by the attention path is V ∈R C ×H×W ; and the feature map output by the feature path is x ∈R C×H×W .

[0107] The output end of the attention path is connected to the input end of the attention generation unit, and the attention generation unit includes multiple branches, each branch including a gated convolution layer and a deep convolution layer, a dilated convolution layer and a fourth convolution layer connected in turn, the output end of the attention path is connected to the input end of each gated convolution layer and deep convolution layer, the kernel size of the multiple gated convolution layers matches the convolution kernel size of the corresponding branch, and the feature map input by the branch is input into the gated convolution layer to generate a spatial weight map through an activation function;

[0108] It should be noted that the features of the attention path are further divided and input into three parallel branches, and correspond to different kernel scales, kernel scale 3, kernel scale 5 and kernel scale 7, the input feature maps of the three branches are V 1、 V 2 and V 3 are all ∈R C / 3×H×W .

[0109] The input features of each branch are processed sequentially through a deep convolutional layer, a dilated convolutional layer, and a fourth convolutional layer. This simulates the receptive field of a very large convolutional kernel with minimal parameter cost, capturing long-range spatial dependencies. The expression is as follows:

[0110] LKA( V i )= f PW ( f DWD ( f DW ( V i )))

[0111] In the formula, f PW () represents a 1×1 convolution operation. f DWD () represents the dilated convolution operation; f DW () represents a depthwise convolution operation. V i For the first i Input feature maps for each branch.

[0112] The output of each gated convolutional layer is residually connected to the output of the corresponding fourth convolutional layer. This residual is used to perform element-wise multiplication of the spatial weight map of each branch with the feature map output by the corresponding fourth convolutional layer, resulting in a spatially weighted feature map. This map is then input into the attention fusion layer, which concatenates the spatially weighted feature maps from multiple branches to obtain a multi-scale attention feature map, expressed as:

[0113] MLKA i ( V i )=G i ( V i )⊗LKA i ( V i );

[0114] In the formula, G i ( V i ) is the first i A spatial gated graph generated by a branch, where ⊗ represents element-wise multiplication.

[0115] The output of the attention fusion layer is connected to the input of the initial splicing layer, and the output of the feature path is connected to the residual of the input of the initial splicing layer. The multi-scale attention feature map is then multiplied and fused with the input feature map of the initial splicing layer element by element to obtain the initial splicing feature map.

[0116] The input end of the dimension reduction convolutional layer is connected with the output end of the initial splicing layer, the dimension reduction convolutional layer reduces the dimension of the initial splicing feature map through 1*1 convolution, and generates a splicing modulation feature map, and the expression is as follows:

[0117] Y =Conv 1×1 ( x ⊗Concat(MLKA1( V 1),MLKA2( V 2),...,MLKA i ( V i )));

[0118] In the formula, Y is the splicing modulation feature map, Conv 1×1 () is the dimension reduction convolutional layer operation, and Concat() is the splicing operation.

[0119] The input end of the normalization input layer is connected with the output end of the dimension reduction convolutional layer in residual connection, which is used for multiplying the splicing modulation feature map with a learnable scaling parameter, and adding it with the feature map input by the encoder element by element to generate a multi-scale fusion feature map, which is output to the decoder for upsampling and splicing, and the expression is as follows:

[0120] Output=γ· Y+X

[0121] In the formula, Output is the multi-scale fusion feature map, and γ is the learnable scaling parameter.

[0122] It should be noted that in the inference stage, the preprocessed 512*512 second size image is input into the pre-trained segmentation model, and the encoder extracts the features step by step; at the jump connection, the multi-scale attention module performs multi-scale enhancement on the encoder features; the decoder restores the spatial resolution step by step through upsampling and splicing operation, and the model finally outputs a preliminary binary segmentation mask with the same size as the input image.

[0123] In this embodiment, by introducing the improved TransUNet segmentation model integrated with the multi-scale attention module, the segmentation accuracy and robustness of pterygium lesions are improved, the module can capture spatial context information of different scales in parallel, and adaptively fuse and calibrate multi-scale features through a gating mechanism, thereby effectively overcoming the segmentation difficulties such as variable lesion morphology and fuzzy boundary; the accurate segmentation of the pterygium region is realized, and the recognition ability of the model to small lesions and complex morphology is enhanced.

[0124] S5, the preliminary pterygium segmentation mask is subjected to two-dimensional hole optimization and edge smoothing processing to obtain the final segmentation result.

[0125] Step S5 includes:

[0126] A two-dimensional hole optimization is performed on the preliminary pterygium segmentation mask, including connected component analysis, small area noise filtering and internal hole filling, to obtain a preliminary optimized segmentation mask;

[0127] It should be noted that the connected component analysis is performed on the binary preliminary segmentation mask to identify and label all independent red pixel regions in the image. Each connected region is regarded as a potential candidate lesion target. The pixel area of each connected region is calculated. According to the area threshold determined in advance through experiments, the system automatically identifies and removes those small discrete areas. These areas are usually false positive points caused by image noise or model misjudgment, and are not real pterygium lesions. Filtering can effectively purify the segmentation result and significantly improve the specificity of the result. For the remaining connected regions with qualified area, it is further detected whether there is a closed hole composed of black pixels inside. These holes are false negative regions caused by model prediction missing, and a filling algorithm is performed to fill all pixel values inside. After this operation, all pterygium regions are filled as solid, ensuring the integrity of the segmentation mask. The preliminary optimized segmentation mask obtained is purified and filled.

[0128] The preliminary optimized segmentation mask is smoothed by morphological closing operation and edge filtering operation to generate a refined segmentation mask, and a final segmentation result is obtained.

[0129] It should be noted that the morphological closing operation is performed on the preliminary optimized segmentation mask. The operation is in the order of inflation and then corrosion, filling the small cracks and depressions existing on the profile. The slight jagged irregularities of the edge are eliminated. The adjacent regions that are very close are connected without significantly changing the area of the original region. The square is used for closing operation, and the kernel size can be configured according to the image resolution. To further improve the smoothness of the edge, Gaussian filtering or median filtering can be optionally used for slight smoothing of the mask after closing operation. The filtering can effectively suppress the residual edge burrs and isolated noise points, while maintaining the stability of the overall profile. Finally, a smooth and accurate lesion boundary is generated, and a high-quality refined segmentation mask, i.e., the final segmentation result, is output.

[0130] S6, based on the segmentation result, a target bounding box is generated. Based on the target, the classification model parameters are iteratively fine-tuned to align the predicted bounding box of the lesion region with the target bounding box. After convergence, the optimized classification result, the predicted bounding box and the segmentation result are fused to generate a visual diagnostic report.

[0131] Step S6 includes the following sub-steps:

[0132] The minimum circumscribed rectangle of the refined segmentation mask is calculated, and the coordinate values of the minimum circumscribed rectangle are defined as the target bounding box;

[0133] It should be noted that the minimum bounding rectangle is calculated based on the refined segmentation mask, which is the most compact axial rectangle that can completely enclose all foreground pixels in the segmentation mask, and the coordinates of its top-left corner and bottom-right corner are extracted to define the target bounding box of this optimization process.

[0134] The CIoU loss function of the classification model is used to calculate the loss value between the predicted bounding box of the lesion region and the target bounding box, and the Adam optimizer is used to iteratively update the weight parameters of the classification model in reverse, until the model converges, so that the predicted bounding box aligns with the target bounding box.

[0135] It should be noted that the original first size image is input into the classification model again for forward propagation to obtain its current predicted bounding box. The CIoU loss function of the original model is used to calculate the loss value between the predicted bounding box of the lesion region and the target bounding box, where the CIoU loss function considers the overlap area, center point distance and aspect ratio, and can comprehensively and effectively measure the similarity between two bounding boxes.

[0136] The CIoU loss with respect to the model weight is calculated using the Adam optimizer, and the weight parameters of the detection head of the model are updated slightly through the backpropagation algorithm, adjusting the direction to reduce the loss function, i.e. driving the predicted bounding box to approach the target bounding box. The forward propagation, loss calculation and parameter update process are repeated to form an iterative loop. The system will monitor the change of the loss value in real time. When the loss value is lower than the preset convergence threshold or reaches the maximum number of iterations, it is determined that the model has converged, and the iteration is stopped. At this time, the predicted box output by the model for the image has reached the current optimal state, and is highly aligned with the target box indicated by the segmentation result.

[0137] According to the fine-tuned classification model, the predicted bounding box of the lesion region and the classification result of the eye image are output for the first size image, and are fused with the final segmentation result to generate a visual diagnostic report in the diagnostic platform page window.

[0138] It should be noted that the embodiment realizes the deep fusion and collaborative optimization of the classification and segmentation models, generates an accurate target box using the fine segmentation result, and iteratively fine-tunes the classification detection model based on the target box, effectively solving the single model positioning deviation problem and improving the positioning accuracy of the lesion bounding box; ensures the high consistency and reliability of the diagnostic result; the system automatically generates a visual diagnostic report integrating the optimized classification result, accurate positioning box and fine segmentation mask, providing intuitive, comprehensive and quantitative diagnostic basis for clinicians, greatly improving the diagnostic efficiency and accuracy.

[0139] The platform adopts a front-end and back-end separation architecture design, combines a PyTorch deep learning framework, a Flask lightweight web framework and a Vue3 progressive framework, and constructs a complete pterygium intelligent detection platform. In terms of implementation, the platform designs a clear technical architecture and an interaction process, and integrates a classification model and a segmentation model into a complete application platform.

[0140] The front end realizes user interaction interfaces based on the Vue3 framework, and constructs three core modules of image uploading, result visualization and data analysis through componentized development; a user can complete image uploading operations through an intuitive interface, the platform instantly displays classification results and generates segmentation superimposed images of lesion areas, and simultaneously provides multi-dimensional analysis charts of historical data.

[0141] The back end adopts a Flask lightweight framework to develop RESTful API services, and realizes efficient data interaction with the front end. The Flask framework is selected as the core of the back end due to its simplicity and flexibility, and it is seamlessly integrated with the PyTorch model through Python native support, while providing powerful routing management and request processing capabilities; the platform designs complete model scheduling logic, when a user uploads an eye image, the platform automatically calls a classification model for preliminary screening, and further starts a segmentation model for fine analysis for positive results. The detection results are returned to the front end through a standardized data structure, including key indicators such as classification confidence, to provide complete data support for front-end visualization.

[0142] In terms of deployment architecture, load balancing and static resource services are realized through Nginx, to ensure the high availability and scalability of the platform. The entire platform design fully considers the particularity of medical image processing, optimizes the efficiency of large file transmission, realizes the full automation of the detection process and the visualization of the analysis results, and provides an intelligent support tool for the clinical diagnosis and research of pterygium.

[0143] A user can quickly complete the diagnosis of eye pterygium and the segmentation of lesion areas through uploading pictures. Meanwhile, some daily life suggestions are generated by accessing AI large models such as DeepSeek and KIMI.

[0144] In a second aspect, the application further provides an eye pterygium diagnosis system based on deep learning, which is realized by using an eye pterygium diagnosis method based on deep learning, and the system comprises:

[0145] A first image processing module is configured to acquire an eye image of a patient and perform data preprocessing on the eye image to generate a first size image for a classification task;

[0146] The classification module is configured to input the first size image into a pre-trained classification model, the classification model is constructed based on an improved YOLOv5 network structure, and is configured to output a classification result of the eye image and a predicted bounding box of the lesion area, the classification result including recommended surgery, observation and normal eye;

[0147] The second image processing module is configured to acquire the eye image with the classification result of observation or recommended surgery, and perform data preprocessing to generate a second size image set for a segmentation task.

[0148] The segmentation module is configured to input the second size image set into a pre-trained segmentation model, the segmentation model is constructed based on an improved TransUNet network structure, and is configured to output a preliminary pterygium segmentation mask.

[0149] The image optimization module is configured to perform two-dimensional hole optimization and edge smoothing processing on the preliminary pterygium segmentation mask to obtain a final segmentation result.

[0150] The model fine-tuning output module is configured to generate a target bounding box based on the segmentation result, and align the predicted bounding box of the lesion area with the target bounding box by iteratively fine-tuning the classification model parameters with the target as the goal. After convergence, the optimized classification result, the predicted bounding box and the segmentation result are fused to generate a visual diagnosis report.

[0151] It should be noted that the system is the same as the above-mentioned deep learning-based eye pterygium diagnosis system, and all the implementation manners in the above-mentioned method embodiments are applicable to the embodiments of the system and can achieve the same technical effects.

[0152] Those skilled in the art can realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be realized by electronic hardware or a combination of computer software and electronic hardware. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0153] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system and the module described above can refer to the corresponding process in the foregoing method embodiments, which will not be described here.

[0154] In the embodiments of the present application, it should be understood that the disclosed system and method can be implemented in other manners. For example, the embodiments of the apparatus described above are merely schematic, and the division of the units is merely logical function division, and there can be another division manner in actual implementation. For example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections can be indirect couplings or communication connections through some interfaces, devices or units, and can be in electrical, mechanical or other forms.

[0155] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, i.e., can be located in one place, or can be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purposes of the embodiments.

[0156] In addition, each functional unit in the various embodiments of the present application can be integrated into a processing unit, or each unit can be a physically independent unit, or two or more units can be integrated into a unit.

[0157] If the functions are implemented in the form of software function units and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application or the parts of the technical solutions that make essential contributions to the prior art can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a plurality of instructions for making a computer device (which can be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in the various embodiments of the present application. The foregoing storage medium includes: U disk, mobile hard disk, ROM, RAM, magnetic disk or optical disk, and various media that can store program codes.

[0158] Moreover, it is pointed out that, in the system and method of the present application, obviously, the components or steps can be decomposed and / or recombined. These decompositions and / or recombination should be considered as equivalents of the present application. Also, the steps of performing the above series of processes can naturally be executed in time sequence according to the order of description, but do not need to be necessarily executed in time sequence. Some steps can be executed in parallel or independently of each other. It can be understood by those skilled in the art that all or any steps or components of the method and device of the present application can be implemented in hardware, firmware, software or a combination thereof in any computing device (including processors, storage media, etc.) or network of computing devices, using the basic programming skills of those skilled in the art upon reading the description of the present application.

[0159] Therefore, the object of the present application can also be achieved by running a program or a set of programs on any computing system. The computing system can be a commonly known general-purpose system. Therefore, the object of the present application can also be achieved only by providing a program product containing program code for implementing the method or device. That is, such a program product also constitutes the present application, and a storage medium storing such a program product also constitutes the present application. Obviously, the storage medium can be any commonly known storage medium or any storage medium developed in the future. It is also pointed out that, in the device and method of the present application, obviously, the components or steps can be decomposed and / or recombined. These decompositions and / or recombination should be considered as equivalents of the present application. Also, the steps of performing the above series of processes can naturally be executed in time sequence according to the order of description, but do not need to be necessarily executed in time sequence. Some steps can be executed in parallel or independently of each other.

[0160] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims

1. A deep learning-based pterygium diagnosis method, characterized by, The method comprises the steps of: S1, acquiring an eye image of a patient and performing data preprocessing on the eye image to generate a first size image for a classification task; S2, inputting the first size image into a pre-trained classification model, the classification model being constructed based on an improved YOLOv5 network structure and being used to output a classification result of the eye image and a predicted bounding box of a lesion area, the classification result including recommended surgery, observation and normal eye, and the improved YOLOv5 network structure being a structure in which a Transformer module is fused in an original C3 module of YOLOv5; S3, acquiring an eye image with a classification result of observation or recommended surgery and performing data preprocessing to generate a second size image set for a segmentation task; S4, inputting the second size image set into a pre-trained segmentation model, the segmentation model being constructed based on an improved TransUNet network structure and being used to output a preliminary pterygium segmentation mask, and the improved TransUNet network structure being a structure in which a multi-scale attention module is integrated at a skip connection between an encoder and a decoder; S5, performing two-dimensional hole optimization and edge smoothing processing on the preliminary pterygium segmentation mask to obtain a final segmentation result; S6, generating a target bounding box based on the segmentation result, and aligning the predicted bounding box of the lesion area with the target bounding box by iteratively fine-tuning the parameters of the classification model based on the target; After convergence, the optimized classification result, the predicted bounding box and the segmentation result are fused to generate a visual diagnosis report. 2.The deep learning-based pterygium diagnosis method of claim 1, wherein, The step S1 of acquiring an eye image of a patient and performing data preprocessing on the eye image to generate a first size image for a classification task comprises the following sub-steps: S11, acquiring an original color eye image of a patient through a camera of a medical slit lamp microscope; S12, uniformly converting the original color eye image of the patient into a three-channel RGB format and performing color correction and white balance processing to obtain a standard eye image; S13, resampling the resolution of the standard eye image to a fixed first size, and performing data enhancement operations on the resampled image, including mirror flipping, random rotation and random adjustment of brightness and contrast, to obtain a first size image for a classification task. 3.The deep learning-based pterygium diagnosis method of claim 1, wherein, The classification model in the step S2 is constructed based on an improved YOLOv5 network structure, and the network structure of the classification model comprises a backbone network, a neck network and a detection head, wherein The backbone network comprises a slice layer, a first convolutional layer, a plurality of feature extraction modules and a multi-scale pooling layer, the slice layer is configured to perform a slicing operation on an input first-size image, an input end of the first convolutional layer is connected with an output end of the slice layer, and the first convolutional layer is configured to perform preliminary feature extraction and down-sampling on a sliced feature map; the plurality of feature extraction modules are sequentially connected in a head-to-tail manner, the feature extraction module adopts a parallel double-path structure, the features extracted by a Transformer module are fused with input features to output a deep fusion feature map, an input end of a feature extraction module at the head is connected with an output end of the first convolutional layer, and an output end of a feature extraction module at the tail is connected with an input end of the multi-scale pooling layer, and the multi-scale pooling layer is configured to perform multi-scale pooling and splicing on the deep fusion feature map to obtain a multi-scale feature map with fused context features; The neck network adopts a path aggregation network (PANet) structure, receives the multi-scale feature map output by the backbone network, and performs feature fusion from top to bottom and from bottom to top through up-sampling and splicing operations; The detection head is connected with an output end of the neck network, and the detection head comprises three detection layers corresponding to different resolutions, respectively, each detection layer converts the fused features into final prediction outputs through a convolutional network, including a class probability of a lesion region, a prediction bounding box coordinate of the lesion region and a confidence of the prediction bounding box. 4.The deep learning-based pterygium diagnosis method of claim 3, wherein, The feature extraction module comprises a second convolutional layer, a Transformer module, a third convolutional layer and a feature fusion layer, an output end of the second convolutional layer is connected with an input end of the Transformer module, an output end of the Transformer module is connected with an input end of the third convolutional layer, and an output end of the third convolutional layer is connected with an input end of the feature fusion layer, and an input end of the second convolutional layer is connected with the input end of the feature fusion layer through a residual path; The feature extraction module comprises two parallel processing paths, the input end of the second convolutional layer serves as an input of a main path, and the other path retains the feature map of the main path input as a residual connection; The second convolutional layer compresses the channel dimension through 1*1 convolution to output a compressed feature map; the compressed feature map is flattened into a sequence matrix in the spatial dimension and input into the Transformer module, the global context dependency relationship of the features is obtained by adopting a multi-head self-attention mechanism and a feedforward network, the sequence output by the Transformer module is subjected to a transposed inverse operation, and a restored feature map is obtained; The restored feature map is input into the third convolutional layer, the third convolutional layer adjusts the channel of the restored feature map through 1*1 convolution to obtain a feature map output by the main path; the feature map output by the main path is spliced with the feature map input by the main path in the channel dimension to obtain a deep fusion feature map. 5.The deep learning-based pterygium diagnosis method of claim 1, wherein Step S3 comprises obtaining an eye image with a classification result of observation or surgery suggestion, performing data preprocessing, and generating a second-size image set for a segmentation task, comprising the following sub-steps: According to the classification result, the eye image determined to be observed or suggested for surgery is screened out, and the corresponding first-size image is resampled to a second-size image for a segmentation task; The second size image is mirrored and labeled to obtain a second size image set after data expansion. 6.The deep learning-based pterygium diagnosis method of claim 1, wherein, The segmentation model in step S4 is based on an improved TransUNet network structure, including: integrating a multi-scale attention module at the jump connection between the encoder and the decoder, performing multi-scale feature fusion processing on the encoder feature map through the multi-scale attention module, and splicing with the decoder upsampling; The multi-scale attention module includes a normalized input layer, a convolution expansion layer, a scale splitting layer, an attention generation unit, an attention fusion layer, an initial splicing layer, and a dimension reduction convolution layer, wherein The normalized input layer is used for standardizing the feature map input by the encoder in the channel dimension, the input end of the convolution expansion layer is connected with the output end of the normalized input layer, and the convolution expansion layer expands the channel number of the feature map input by the encoder to twice through 1*1 convolution operation; The input end of the scale splitting layer is connected with the output end of the convolution expansion layer, and the scale splitting layer averages and splits the feature map with expanded channel number into an attention path and a feature path in the channel dimension, and the channel numbers of the attention path and the feature path are the same; The output end of the attention path is connected with the input end of the attention generation unit, and the attention generation unit includes a plurality of branches, each branch includes a gate convolution layer and a deep convolution layer, a hollow convolution layer and a fourth convolution layer connected in sequence, the output end of the attention path is connected with the input end of each gate convolution layer and deep convolution layer respectively, the kernel size of each gate convolution layer matches the convolution kernel size of the corresponding branch, and the spatial weight map is generated by inputting the feature map input by the branch into the gate convolution layer through an activation function; The output end of each gate convolution layer is connected with the output end of the corresponding fourth convolution layer in residual connection, for element-wise multiplication of the spatial weight map of each branch and the feature map output by the corresponding fourth convolution layer to obtain a spatial weighted feature map; and input into the attention fusion layer, the attention fusion layer splices the spatial weighted feature maps output by the plurality of branches to obtain a multi-scale attention feature map; The output end of the attention fusion layer is connected with the input end of the initial splicing layer, and the output end of the feature path is connected with the input end of the initial splicing layer in residual connection, for element-wise multiplication and fusion of the multi-scale attention feature map and the input feature map of the initial splicing layer to obtain an initial splicing feature map; The input end of the dimension reduction convolution layer is connected with the output end of the initial splicing layer, and the dimension reduction convolution layer reduces the dimension of the initial splicing feature map through 1*1 convolution to generate a splicing modulation feature map; The input end of the normalized input layer is connected with the output end of the dimension reduction convolution layer in residual connection, for multiplication of the splicing modulation feature map and the learnable scaling parameter, and element-wise addition with the feature map input by the encoder to generate a multi-scale fusion feature map, which is output to the decoder upsampling for splicing. 7.The deep learning-based pterygium diagnosis method of claim 1, wherein, In step S5, the preliminary pterygium segmentation mask is subjected to two-dimensional hole optimization and edge smoothing processing to obtain a final segmentation result, including: The preliminary pterygium segmentation mask is subjected to two-dimensional hole optimization, including connected component analysis, small area noise filtering and internal hole filling to obtain a preliminary optimized segmentation mask; The morphological closing operation and edge filtering operation are adopted to smooth the outline of the preliminary optimized segmentation mask to generate a refined segmentation mask, and a final segmentation result is obtained. 8.The deep learning-based pterygium diagnosis method of claim 1, wherein, The step S6 includes the following sub-steps: The minimum circumscribed rectangle of the refined segmentation mask is calculated, and the coordinate values of the minimum circumscribed rectangle are defined as a target bounding box; The CIoU loss function of the classification model is used to calculate the loss value between the predicted bounding box of the lesion region and the target bounding box, and the Adam optimizer is used to iteratively update the weight parameters of the classification model in reverse until the model converges, so that the predicted bounding box is aligned with the target bounding box; According to the fine-tuned classification model, the predicted bounding box of the lesion region and the classification result of the eye image are output for the first size image, and are fused with the final segmentation result, and a visual diagnostic report is generated in the diagnostic platform page window.

9. A deep learning-based pterygium diagnosis system for eyes, implemented by using the deep learning-based pterygium diagnosis method for eyes according to any one of claims 1-8. The system comprises: The first image processing module is configured to acquire an eye image of a patient and perform data preprocessing on the eye image to generate a first size image for a classification task; The classification module is configured to input the first size image into a pre-trained classification model, wherein the classification model is constructed based on an improved YOLOv5 network structure and is configured to output a classification result of the eye image and a predicted bounding box of a lesion region, and the classification result includes a recommended surgery, an observation, and a normal eye, and the improved YOLOv5 network structure is a structure in which a Transformer module is fused in an original C3 module of YOLOv5; The second image processing module is configured to acquire an eye image with a classification result of observation or recommended surgery, perform data preprocessing on the eye image, and generate a second size image set for a segmentation task; The segmentation module is configured to input the second size image set into a pre-trained segmentation model, wherein the segmentation model is constructed based on an improved TransUNet network structure and is configured to output a preliminary pterygium segmentation mask, and the improved TransUNet network structure is a structure in which a multi-scale attention module is integrated at a skip connection between an encoder and a decoder; The image optimization module is configured to perform two-dimensional hole optimization and edge smoothing on the preliminary pterygium segmentation mask to obtain a final segmentation result; The model fine-tuning output module is configured to generate a target bounding box based on the segmentation result, and to align the predicted bounding box of the lesion region with the target bounding box by iteratively fine-tuning the parameters of the classification model. After convergence, the optimized classification result, the predicted bounding box, and the segmentation result are fused to generate a visual diagnostic report.

10. A computer-readable storage medium, characterized in that, The storage medium stores a deep learning-based eye pterygium diagnosis method program, and the deep learning-based eye pterygium diagnosis method program is executed to implement the deep learning-based eye pterygium diagnosis method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Method for segmenting pterygium focus area based on Vision Transform

    CN116310335A

  • Colorectal cancer focus segmentation method based on improved TransUNet

    CN120543847A