Ocular surface color photography image classification method, system, electronic device and storage medium
By using the ocular surface color photographic image classification model of the Conformer network and PFM module in ocular surface disease classification, and combining global and local features, the problems of low ocular surface disease classification efficiency and narrow detection range in the existing technology are solved, and high efficiency is achieved. Automatic classification of ocular surface diseases and accurate detection of multiple lesions.
Patent Information
- Application Number
- CN202311218500.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-21
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2043-09-21
AI Technical Summary
The existing technology suffers from misdiagnosis and missed diagnosis in the classification of ocular surface diseases, and the efficiency of manual classification is low, and the detection range of the artificial intelligence system is narrow and cannot effectively distinguish multiple ocular surface diseases and rare abnormalities.
An ocular surface color photographic image classification model based on the Conformer network and PFM module is used to combine global and local features through skip connections to extract rich feature representations, improve model performance and generalization capabilities, and achieve automatic classification of ocular surface diseases.
Automatic classification of ocular surface diseases is achieved under limited conditions, improving clinical classification efficiency, enhancing detection accuracy, and being able to effectively distinguish a variety of ocular surface diseases, including rare abnormalities.
Smart Images

Figure CN117372744B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure belong to the technical field of medical image processing, and specifically relate to a method, system, electronic device and storage medium for classifying ocular surface color photographic images. Background Art
[0002] The diversity and complexity of ocular surface diseases are important factors that cannot be ignored in the classification of ocular surface diseases. It takes at least 1 minute for an ophthalmologist to interpret an ocular surface image. In addition, manual classification may lead to misjudgment or omission of classification results due to subjective reasons and lack of experience of the doctor.
[0003] In recent years, artificial intelligence technology has developed rapidly, from the previous convolutional neural network (CNN) to the current mainstream Transformer network. At the same time, the demand for AI automatic classification has gradually expanded from distinguishing only a single lesion to being able to distinguish more types of lesions and rarer abnormalities. Due to the local limitations of CNN convolution operations, long-distance modeling is required to generate global attention, which also brings higher computational complexity. Therefore, it is necessary to develop an automatic classification method for ocular surface color photography images that can take into account both global and local features. Summary of the invention
[0004] The embodiments of the present disclosure aim to solve at least one of the technical problems existing in the prior art, and provide a method, system, electronic device and storage medium for classifying color photographic images of an ocular surface.
[0005] One aspect of the present disclosure provides a method for classifying an ocular surface color photographic image, comprising:
[0006] Acquire actual ocular surface color photographic images;
[0007] The actual ocular surface color photography image is input into a pre-trained ocular surface color photography image classification model to predict the ocular surface color photography image classification result; wherein,
[0008] The ocular surface color photography image classification model includes: a backbone network built based on a Conformer network, and a feature extraction branch network built based on a PFM module, and the feature extraction branch network is jump-connected to the backbone network.
[0009] Optionally, the backbone network includes a Stem Block, a Bottleneck Layer and an EncoderBlock, a first-level ConvTrans Block, a second-level ConvTransBlock, a third-level ConvTrans Block, a fourth-level ConvTrans Block and a Classifier Block connected in sequence;
[0010] The feature extraction branch network includes a first feature extraction branch network and a second feature extraction branch network; wherein,
[0011] The input end of the first feature extraction branch network is connected to the output end of the first-level ConvTrans Block, and the output end of the first feature extraction branch network is connected to the output end of the third-level ConvTrans Block;
[0012] The input end of the second feature extraction branch network is connected to the output end of the second-stage ConvTrans Block, and the output end of the second feature extraction branch network is connected to the output end of the fourth-stage ConvTrans Block.
[0013] Optionally, the Stem Block includes a 7×7 convolutional layer, a batch normalization layer and a ReLU activation function, and a 3×3 maximum pooling layer connected in sequence;
[0014] The Bottleneck Layer and the Encoder Block are in parallel; wherein the Encoder Block is also connected to a 4×4 convolutional layer before;
[0015] The first-level ConvTrans Block includes three ConvTrans Blocks connected in sequence; the second-level ConvTrans Block includes four ConvTrans Blocks connected in sequence; the third-level ConvTrans Block includes three ConvTransBlocks connected in sequence; and the fourth-level ConvTrans Block includes one ConvTransBlock.
[0016] Optionally, each of the ConvTrans Blocks includes a parallel CNN branch and a Transformer branch;
[0017] The input end of the first feature extraction branch network is connected to the output end of the 3×3 convolutional layer of the first Bottleneck Layer of the CNN branch of the last ConvTrans Block of the first-level ConvTrans Block;
[0018] The input end of the second feature extraction branch network is connected to the output end of the 3×3 convolutional layer of the first Bottleneck Layer of the CNN branch of the last ConvTrans Block of the second-level ConvTrans Block.
[0019] Optionally, the feature extraction branch network includes a Patch Merging layer, a 1×1 convolution layer, a batch normalization layer and a FReLU activation function connected in sequence.
[0020] Optionally, the ocular surface color photography image classification model is trained by the following steps:
[0021] Acquire training ocular surface color photographic images, and divide the training ocular surface color photographic images into a training set and a test set; wherein the training ocular surface color photographic images carry labels;
[0022] Using the training ocular surface color photography images in the training set to train the ocular surface color photography image classification model to obtain a trained ocular surface color photography image classification model;
[0023] The trained ocular surface color photography image classification model is tested using the training ocular surface color photography images in the test set.
[0024] Another aspect of the present disclosure provides an ocular surface color photography image classification system, comprising:
[0025] An acquisition module, used for acquiring an actual ocular surface color photographic image;
[0026] A classification module is used to input the actual ocular surface color photography image into a pre-trained ocular surface color photography image classification model to predict the ocular surface color photography image classification result; wherein,
[0027] The ocular surface color photography image classification model includes: a backbone network built based on a Conformer network, and a feature extraction branch network built based on a PFM module, and the feature extraction branch network is jump-connected to the backbone network.
[0028] Optionally, the system further comprises a training module; the training module is used for:
[0029] Acquire training ocular surface color photographic images, and divide the training ocular surface color photographic images into a training set and a test set; wherein the training ocular surface color photographic images carry labels;
[0030] Using the training ocular surface color photography images in the training set to train the ocular surface color photography image classification model to obtain a trained ocular surface color photography image classification model;
[0031] The trained ocular surface color photography image classification model is tested using the training ocular surface color photography images in the test set.
[0032] Another aspect of the present disclosure provides an electronic device, comprising:
[0033] at least one processor; and,
[0034] The memory communicatively connected to the at least one processor is used to store one or more programs, and when the one or more programs are executed by the at least one processor, the at least one processor can implement the above-mentioned method for classifying color photography images of the ocular surface.
[0035] Another aspect of the present disclosure provides a computer-readable storage medium having a computer program stored thereon; when the computer program is executed by a processor, the above-mentioned method for classifying ocular surface color photography images can be implemented.
[0036] The disclosed embodiment of an ocular surface color photographic image classification method uses artificial intelligence in the medical field to automatically classify diseases. It only needs to take a color image of the patient's ocular surface, and does not require a complex manual classification process. It can achieve automatic classification of ocular surface diseases under limited conditions, greatly improving clinical classification efficiency. For the purpose of combining global and local features and extracting pathological features embodied by multiple diseases, the disclosed method uses Conformer as the backbone network, and designs a PFM module for structural feature extraction that is jump-connected to the backbone network for spatial structural feature extraction, fusing the bottom-level features with the top-level features, providing a richer feature representation, improving the performance and generalization ability of the model, and achieving higher detection accuracy than using a single Conformer network. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 A schematic diagram of a flow chart of a method for classifying ocular surface color photographic images according to an embodiment of the present disclosure;
[0038] Figure 2 This is a schematic diagram of the network structure of an ocular surface color photography image classification model according to another embodiment of the present disclosure;
[0039] Figure 3 This is a flowchart of the process of building and training an ocular surface color photography image classification model according to another embodiment of the present disclosure;
[0040] Figure 4 It is a schematic diagram of the operation of the Patch Merging layer of another embodiment of the present disclosure;
[0041] Figure 5 A schematic diagram for describing an activation field according to another embodiment of the present disclosure;
[0042] Figure 6 A schematic diagram of the calculation process of the FReLU activation function according to another embodiment of the present disclosure;
[0043] Figure 7A schematic diagram of a network structure of a PFM module according to another embodiment of the present disclosure;
[0044] Figure 8 It is a structural schematic diagram of an ocular surface color photography image classification system according to another embodiment of the present disclosure;
[0045] Fig. 9 The figure is a schematic diagram of the structure of an electronic device according to another embodiment of the present disclosure. DETAILED DESCRIPTION
[0046] At present, the medical community's detection methods for ocular surface diseases are generally based on anatomical detection methods, including slit lamp microscopy and ocular surface photography. The slit lamp microscopy method requires adjusting the patient's sitting posture, then fixing the patient's chin on the bracket, and adjusting the angle and intensity of the slit lamp light. The patient's eyes are fixed on the light in front, and the doctor adjusts the position and angle of the microscope so that the palpebral fissure and the microscope height are consistent. Then, the doctor uses a microscope to magnify and focus the image of the anterior segment of the eye in order to observe and record the various structures of the anterior segment of the eye. Ocular surface photography uses an ocular surface camera to take pictures of the patient's ocular surface, usually from multiple angles and positions to take pictures of different structures. After the shooting is completed, the doctor uses specific software to measure and analyze the ocular surface photos and classify various diseases.
[0047] The anatomical method for detecting ocular surface diseases requires the accurate use of slit lamps and binocular microscopes, which requires the selection of experienced and skilled doctors to operate, otherwise the accuracy of the examination results may be affected. In actual applications, the slit lamp microscopy method takes a long time to detect, and is affected by the equipment. There are errors in the classification of different ocular surface diseases, and there may be misdiagnosis and missed diagnosis. The ocular surface photography method classifies ocular surface diseases by observing and identifying the lesion area on the ocular surface, which requires experienced clinical experts to spend a certain amount of time to complete, and the entire classification process is relatively inefficient.
[0048] In the field of medical research, many studies have used artificial intelligence for automatic classification, which has greatly improved the efficiency of clinical classification. However, the disease detection range of artificial intelligence systems is still very narrow. For example, they can only distinguish between a single lesion and a normal ocular surface, and cannot detect relatively rare abnormalities. Due to the local limitations of CNN convolution operations, long-distance modeling is required to generate global attention, which will bring higher computational complexity and make it difficult to use a large number of labeled samples for model training.
[0049] In this regard, the following embodiments of the present disclosure propose an ocular surface color photography image classification method, system, electronic device and storage medium to solve the above problems.
[0050] In order to enable those skilled in the art to better understand the technical solution of the present disclosure, the present disclosure is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0051] like Figure 1 As shown, an embodiment of the present disclosure provides a method for classifying an ocular surface color photographic image, comprising:
[0052] Step S11, obtaining a color photographic image of the actual ocular surface.
[0053] Specifically, an image acquisition device, such as a camera or a webcam, is used to capture and store color images of the patient's eyes.
[0054] Step S12, inputting the actual ocular surface color photography image into a pre-trained ocular surface color photography image classification model to predict the ocular surface color photography image classification result; wherein the ocular surface color photography image classification model includes: a backbone network built based on a Conformer network, and a feature extraction branch network built based on a PFM module, and the feature extraction branch network is jump-connected to the backbone network.
[0055] Specifically, the actual ocular surface color photographic image obtained in step S11 is input into the ocular surface color photographic image classification model pre-trained in the present disclosure, and the ocular surface color photographic image classification model outputs the predicted ocular surface disease classification results, such as ocular surface hemorrhage, pterygium or normal ocular surface, etc. Among them, the ocular surface color photographic image classification model is constructed based on the Conformer network and the PFM module, and the Conformer network is used as the backbone network, and the PFM module is jump-connected to the backbone network as a feature extraction branch network to form the ocular surface color photographic image classification model of the present disclosure.
[0056] The disclosed embodiment of an ocular surface color photographic image classification method uses artificial intelligence in the medical field to automatically classify diseases. It only needs to take a color image of the patient's ocular surface, and does not require a complex manual classification process. It can achieve automatic classification of ocular surface diseases under limited conditions, greatly improving clinical classification efficiency. For the purpose of combining global and local features and extracting pathological features embodied by multiple diseases, the disclosed method uses Conformer as the backbone network, and designs a PFM module for structural feature extraction that is jump-connected to the backbone network for spatial structural feature extraction, fusing the bottom-level features with the top-level features, providing a richer feature representation, improving the performance and generalization ability of the model, and achieving higher detection accuracy than using a single Conformer network.
[0057] For example, Figure 2As shown in the figure, the backbone network built based on the Conformer network includes StemBlock, Bottleneck Layer and Encoder Block, the first-level ConvTrans Block, the second-level ConvTransBlock, the third-level ConvTrans Block, the fourth-level ConvTrans Block and the Classifier Block connected in sequence.
[0058] Specifically, the Stem Block consists of a 7×7 convolutional layer followed by a batch normalization layer and a ReLU activation function, followed by a 3×3 maximum pooling layer. The Bottleneck Layer and Encoder Block are connected in parallel to the Stem Block.
[0059] Bottleneck Layer is a residual network structure. The first component of Bottleneck Layer is a 1x1 convolution layer, also called a compression layer, which is used to reduce the number of channels of the input feature map, thereby reducing the computational complexity. This step is usually used to reduce the number of parameters in the model. Next is a 3x3 convolution layer, which is used to extract higher-level features from the input feature map. The goal of this layer is to learn the representation of the input data and capture more complex patterns and structures. The last component of Bottleneck Layer is another 1x1 convolution layer, also called an expansion layer, which is used to increase the number of channels of the feature map and restore it to the dimension of the original input. This step is usually used to increase the expressive power of the model to better adapt to complex data distributions. Finally, the residual connection is realized through the jump connection, that is, the input is directly added to the output of the last 1x1 convolution layer. Among them, all convolution layers are followed by batch normalization layers and ReLU nonlinear activation functions.
[0060] Encoder Block is an important module in the Vision Transformer network. The first component of Encoder Block is a LayerNorm layer, also known as layer normalization, which normalizes each token. Next is a multi-head attention layer (Multi-Head Self-Attention). In multi-head self-attention, the input features are divided into multiple sub-features, and then each sub-feature interacts and associates through the self-attention mechanism, so that the global dependencies within the input features can be captured. After that, a Dropout layer will be connected to reduce overfitting. Finally, the residual connection is realized through the jump connection, that is, the input is directly added to the output of the last Dropout layer. The above is the first half of the Encoder Block. Next, the second half of the Encoder Block is constructed in the order of Layer Norm layer, MLP Block, and Dropout layer, and the residual connection is also realized through the jump connection. Among them, MLPBlock is composed of a fully connected layer, a GELU activation function, a Dropout layer, a fully connected layer, and a Dropout layer. The first fully connected layer expands the dimension, and the second fully connected layer reduces the dimension to be consistent with the input. In this embodiment, a 4×4 convolutional layer is connected in front of the Encoder Block to convert the feature map data into token data that can be used by the subsequent Trans branch.
[0061] The core module ConvTrans Block mainly consists of five parts: Bottleneck Layer, EncoderBlock, downsampling branch and upsampling branch.
[0062] The first component of the downsampling branch is a 1×1 convolution layer, which is used to increase the number of channels of the input feature layer; then it is connected to an average pooling layer to achieve downsampling and reduce the resolution of the feature map; and then a Layer Norm layer and a GELU activation function are connected.
[0063] The first component of the upsampling branch is also a 1×1 convolutional layer, which is used to reduce the number of channels of the input feature layer; then it is connected to a Batch Norm layer and a ReLU activation function, where Batch Norm is also called a batch normalization layer, which normalizes the same channel of each batch of data; finally, upsampling is performed through the nearest neighbor interpolation method to expand the feature map resolution.
[0064] The convolutional neural network branch (CNN branch) of ConvTrans Block consists of two BottleneckLayers on one side, and the Transformer branch (Trans branch) consists of an Encoder Block on the other side; the input of the downsampling branch is connected to the output of the 3×3 convolution layer of the first Bottleneck Layer of the CNN branch, and the output of the downsampling branch is connected to the input of the Encoder Block of the Trans branch; the input of the upsampling branch is connected to the output of the EncoderBlock of the Trans branch, and the output of the upsampling branch is connected to the input of the 3×3 convolution layer of the second Bottle Block of the CNN branch. In this way, an architecture that integrates global and local features is formed.
[0065] The first-level ConvTrans Block in the backbone network includes three ConvTransBlocks connected in sequence; the second-level ConvTrans Block includes four ConvTrans Blocks connected in sequence; the third-level ConvTransBlock includes three ConvTrans Blocks connected in sequence; and the fourth-level ConvTrans Block includes one ConvTrans Block.
[0066] The Classifier Block is used for classification output. The CNN branch side will output the classification result through a global average pooling layer and a fully connected layer, and the Trans branch side will output the classification result through a layer normalization layer and a fully connected layer.
[0067] Continue to refer Figure 2 , the feature extraction branch network includes a first feature extraction branch network and a second feature extraction branch network; wherein,
[0068] The input end of the first feature extraction branch network is connected to the output end of the first-level ConvTrans Block, and the output end of the first feature extraction branch network is connected to the output end of the third-level ConvTrans Block;
[0069] The input end of the second feature extraction branch network is connected to the output end of the second-stage ConvTrans Block, and the output end of the second feature extraction branch network is connected to the output end of the fourth-stage ConvTrans Block.
[0070] Specifically, the input end of the first feature extraction branch network is connected to the output end of the 3×3 convolutional layer of the first Bottleneck Layer of the CNN branch of the last ConvTrans Block of the first-level ConvTrans Block; the input end of the second feature extraction branch network is connected to the output end of the 3×3 convolutional layer of the first Bottleneck Layer of the CNN branch of the last ConvTrans Block of the second-level ConvTrans Block.
[0071] The feature extraction branch network, namely the PFM module, includes a Patch Merging layer, a 1×1 convolution layer, a batch normalization layer, and a FReLU activation function connected in sequence. The Patch Merging layer is used to split the input feature map into small non-overlapping blocks and recombine them into larger blocks. This can increase the receptive field and promote the global interaction of features. Next, the 1×1 convolution layer is used to reduce the number of channels to reduce the amount of calculation and the number of parameters. The batch normalization layer is used to normalize the distribution of features and improve the stability and convergence speed of the model. Finally, contextual semantic information is introduced through the FReLU activation function to enhance the expressiveness of the model. Through the combination of these components, the PFM module can effectively capture long-distance dependencies, and can rely on FReLU to extract structural features while maintaining computational efficiency, which is very suitable for the classification speed requirements of medical scenarios.
[0072] An ocular surface color photographic image classification method of an embodiment of the present invention is improved based on the Conformer classification network, a new feature extraction module PFM module is designed, PFM is applied to Conformer based on the open source deep learning platform PyTorch, and an ocular surface color photographic image classification model is built to make it suitable for the classification of ocular surface color photographic images and improve the detection accuracy.
[0073] like Figure 3 As shown, the following will describe the construction and training process of the ocular surface color photography image classification model through a specific case:
[0074] Step S31, obtaining training ocular surface color photographic images, and dividing the training ocular surface color photographic images into a training set and a test set; wherein the training ocular surface color photographic images carry labels.
[0075] Specifically, 2855 ocular surface color photographs with a resolution of 5184×3456 for which classification results have been determined were obtained, that is, labeled training ocular surface color photographs as experimental data, including 1312 normal ocular surface color photographs, 251 conjunctival hemorrhage ocular surface color photographs, 909 observation period pterygium images, and 383 pterygium images for which surgery is recommended. The data set was divided into a training set and a test set at a ratio of 9:1, generating a total of 2571 training set samples and 284 test set samples. The division process adopted stratified sampling to ensure the consistency of sample distribution of each category in each subset.
[0076] Step S32: pre-processing the training ocular surface color photographic image.
[0077] Specifically, the ocular surface disease image dataset obtained in step S31 above is subjected to image preprocessing. First, the image resolution is adjusted to be unified to 224×224 pixels; then, the graphics are data enhanced, and the enhancement steps include 1.25 times bilinear interpolation stretching of the image, random horizontal flipping, random 15-degree angle rotation, center area cropping, and image standardization, where all random probabilities are 50%. Image stretching and center area cropping can eliminate irrelevant semantic information in the image, and random flipping, random angle rotation, and image standardization can improve the robustness of the network.
[0078] Step S33: construct an ocular surface color photography image classification model.
[0079] Specifically, the ocular surface disease image classification network is built with the Conformer network as the backbone network, the PFM module is used to extract structural features, and the skip connection method is used to pass the features extracted from the bottom feature map to the top layer for fusion.
[0080] First, build the backbone network: The backbone network Conformer is mainly composed of the core module ConvTrans Block, the Stem Block in the feature map preprocessing stage, and the Classifier Block in the final output stage. StemBlock consists of a 7×7 convolution layer followed by a batch normalization layer and a ReLU activation function, followed by a 3×3 maximum pooling layer. The network structure can be expressed as C7_64_s2-MP_3_s2, where C7_64_s2 represents a 7×7 convolution layer with a convolution kernel of 64 and a stride of 2, and MP_3_s2 represents a 3×3 maximum pooling layer with a stride of 2. The CNN branch side of the network structure of the second stage is represented as C1_96-C3_96-C1_384, and the Trans branch side is represented as MHSA_9_576-L_2304-L_576, where MHSA_9_576 represents a multi-head attention layer in which the input features are divided into 9 sub-features and the total feature dimension is 576, and L_2304 represents a fully connected layer with an output dimension of 2304. The third stage is composed of 3 ConvTrans Blocks. The network structure of all CNN branches is C1_96-C3_96-C1_384, and the network structure of all Trans branches is MHSA_9_576-L_2304-L_576. The fourth stage is composed of 4 ConvTrans Blocks. Except for the network structure of the CNN branch of the first ConvTrans Block, which is C1_192-C3_192_s2-C1_768, the network structure of other CNN branches is C1_192-C3_192-C1_768, and the network structure of all Trans branches is MHSA_9_576-L_2304-L_576. The fifth stage is composed of 3 ConvTrans Blocks. Except for the second ConvTrans The network structure of the CNN branch of the ConvTrans Block is C1_384-C3_384-C1_1536, the network structure of other CNN branches is C1_384-C3_384_s2-C1_1536, and the network structure of all Trans branches is MHSA_9_576-L_2304-L_576; the sixth stage is composed of 1 ConvTrans Block, the network structure of the CNN branch is C1_384-C3_384-C1_1536, and the network structure of the Trans branch is C1_384-C3_384-C1_1536; the seventh stage is the Classifier Block, which is used for classification output. The CNN branch side will output the classification result through a global average pooling layer and a fully connected layer, and the Trans branch side will output the classification result through a layer normalization layer and a fully connected layer.
[0081] Subsequently, the network architecture of the two feature extraction branches composed of PFM modules is PM-C1_384-PM-C1_1536, where PM stands for Patch Merging; the input of one feature extraction branch is located at the output of the 3×3 convolutional layer of the first Bottleneck Layer of the CNN branch of the last ConvTrans Block in the third stage, and the output is located at the output of the fifth stage, and the input of the other feature extraction branch is located at the output of the 3×3 convolutional layer of the first Bottleneck Layer of the CNN branch of the last ConvTransBlock in the fourth stage, and the output is located at the output of the sixth stage.
[0082] The Patch Merging layer can reduce the feature map resolution and play a role of downsampling, but it will not bring additional computational complexity to the network and can retain more semantic information. Figure 4 As shown in the figure, in specific form, the Patch Merging layer samples the pixels of the feature map at intervals by rows and columns to form four sub-feature maps, which are then merged in the channel dimension.
[0083] FReLU is a context-conditional activation function that relies on the local information of the center pixel and can obtain pixel-level modeling capabilities. It operates on a certain local area through a convolution kernel with learnable parameters, compares it with the center pixel and takes the maximum value, providing each pixel with an option to view contextual information. Consider a network with n FReLU activation function layers {F1, F2, ... , Fn}, each FReLU has a k×k parameter window. Since the maximum selection range is between 1×1 and k×k, each pixel after F1 processing has an activation field set {1, 1+r} (r=k-1). After the Fn layer, the set becomes {1, 1+r, 1+2r, ... , 1+nr}, which gives each pixel more choices. If n is large enough, any layout can be approximated. Multiple activation fields of different sizes can be approximately drawn as follows Figure 5 The shapes of the oblique lines and arcs shown are conducive to the extraction of the spatial structure of the pathological area in the ocular surface color photography image. Figure 6 As shown in Figure 1, the calculation process of the FReLU activation function can be expressed as Y=MAX(X, T(X)), where X represents input, Y represents output, and T(•) represents convolution operation.
[0084] The specific network structure of the PFM module is as follows Figure 7 shown.
[0085] It is understandable that there is no necessary order relationship between the sample acquisition and processing process and the model building process. The building of the ocular surface color photography image classification model can precede the above-mentioned step S31 or S32 of this embodiment, or can be performed simultaneously.
[0086] Step S34: training the ocular surface color photography image classification model using the training ocular surface color photography images in the training set to obtain a trained ocular surface color photography image classification model.
[0087] Specifically, the hardware and software conditions in the training process of this embodiment are: CPU: Intel i7-7700 3.6GHz; GPU: NVIDARTX2080Ti 11GB; Operating system: Windows 10; Programming language version: Python 3.6, deep learning framework: Pytorch 1.7. During training, the initial learning rate is set to 0.0001, and the CosineAnnealingLR cosine annealing learning rate strategy is adopted, where T_max is set to 32 and the iteration round is 90. The optimizer uses the Adam optimizer for back propagation learning of the network. Two Cross EntropyLoss cross entropy loss functions are used to calculate the loss value for the classification results output by the two branches of the network, and each weight is 0.5. The 2571 training set samples obtained in step S31 are used to train the ocular surface color photography image classification model. The Model Accuracy model accuracy is used as the evaluation index during the training process, and the model parameters with the best training effect are saved in each iteration during training.
[0088] Step S35: testing the trained ocular surface color photography image classification model using the training ocular surface color photography images in the test set.
[0089] Specifically, the 284 test set samples obtained in step S31 are respectively input into the trained ocular surface color photography image classification model to obtain respective prediction classification results, and the prediction classification results are compared with the corresponding test set sample labels to obtain the accuracy of the prediction results. Whether the ocular surface color photography image classification model should be further optimized can be determined based on whether the accuracy meets expectations.
[0090] The training process of the ocular surface color photographic image classification model of the disclosed embodiment is improved based on the Conformer classification network, and a new feature extraction module PFM module is designed. The PFM is applied to the Conformer based on the open source deep learning platform PyTorch, and an ocular surface color photographic image classification model is built to make it suitable for the classification of ocular surface color photographic images. Therefore, in actual applications, only the patient's ocular surface color image needs to be captured, and no complicated classification process is required, so as to realize the automatic classification of ocular surface diseases under limited conditions.
[0091] like Figure 8 As shown, another embodiment of the present disclosure provides an ocular surface color photography image classification system, comprising:
[0092] An acquisition module 801 is used to acquire an actual ocular surface color photographic image;
[0093] The classification module 802 is used to input the actual ocular surface color photography image into the pre-trained ocular surface color photography image classification model to predict the ocular surface color photography image classification result; wherein,
[0094] The ocular surface color photography image classification model includes: a backbone network built based on a Conformer network, and a feature extraction branch network built based on a PFM module, and the feature extraction branch network is jump-connected to the backbone network.
[0095] Specifically, the acquisition module 801 includes an image acquisition device, such as a camera, a webcam, etc., which captures and stores color images of the patient's eyes. The actual ocular surface color photographic image is input into the ocular surface color photographic image classification model pre-trained in the present disclosure, and the ocular surface color photographic image classification model outputs the predicted ocular surface disease classification results, such as ocular surface hemorrhage, pterygium or normal ocular surface, etc. Among them, the ocular surface color photographic image classification model is constructed based on the Conformer network and the PFM module. The Conformer network is used as the backbone network, and the PFM module is jump-connected to the backbone network as a feature extraction branch network to form the ocular surface color photographic image classification model of the present disclosure. The specific construction process of the ocular surface color photographic image classification model has been described in detail in the previous embodiment, so it will not be repeated here.
[0096] For example, Figure 8 As shown, the ocular surface color photography image classification system further includes a training module 803; the training module 803 is used to:
[0097] Acquire training ocular surface color photographic images, and divide the training ocular surface color photographic images into a training set and a test set; wherein the training ocular surface color photographic images carry labels;
[0098] Using the training ocular surface color photography images in the training set to train the ocular surface color photography image classification model to obtain a trained ocular surface color photography image classification model;
[0099] The trained ocular surface color photography image classification model is tested using the training ocular surface color photography images in the test set.
[0100] Specifically, as a specific case, the training module 803 can execute the construction and training process of the ocular surface color photography image classification model in the previous embodiment, which will not be described in detail in this embodiment.
[0101] like Fig. 9 As shown, another embodiment of the present disclosure provides an electronic device, including at least one processor 901, and a memory 902 communicatively connected to the at least one processor 901, for storing one or more programs, which, when executed by the at least one processor 901, enables the at least one processor 901 to implement the ocular surface color photography image classification method as described above.
[0102] Among them, the memory and the processor are connected in a bus manner, and the bus may include any number of interconnected buses and bridges, and the bus connects various circuits of one or more processors and memories together. The bus can also connect various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface provides an interface between the bus and the transceiver. The transceiver can be one element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices on a transmission medium. The data processed by the processor is transmitted on a wireless medium via an antenna, and further, the antenna also receives data and transmits the data to the processor.
[0103] The processor is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions. Memory can be used to store data used by the processor when performing operations.
[0104] The last embodiment of the present disclosure provides a computer-readable storage medium, and when the computer program is executed by a processor, the above-mentioned method for classifying ocular surface color photography images can be implemented.
[0105] The computer-readable medium may be included in the apparatus, device, or system of the present disclosure, or may exist independently.
[0106] Among them, computer-readable storage media can be any tangible media that contains or stores a program, which can be an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment. More specific examples include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, an optical fiber, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0107] The computer-readable storage medium may also include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code, specific examples of which include but are not limited to electromagnetic signals, optical signals, or any suitable combination thereof.
[0108] It is to be understood that the above embodiments are merely exemplary embodiments used to illustrate the principles of the present disclosure, but the present disclosure is not limited thereto. For those of ordinary skill in the art, various modifications and improvements can be made without departing from the spirit and substance of the present disclosure, and these modifications and improvements are also considered to be within the scope of protection of the present disclosure.
Claims
1. A method for classifying ocular surface color photographic images, characterized in that: The method comprises: Acquire actual ocular surface color photographic images; The actual ocular surface color photography image is input into a pre-trained ocular surface color photography image classification model to predict the ocular surface color photography image classification result; wherein, The ocular surface color photography image classification model includes: a backbone network built based on a Conformer network, and a feature extraction branch network built based on a PFM module, wherein the feature extraction branch network is jump-connected to the backbone network; The backbone network includes a Stem Block, a Bottleneck Layer and an Encoder Block, a first-level ConvTrans Block, a second-level ConvTrans Block, a third-level ConvTrans Block, a fourth-level ConvTransBlock and a Classifier Block connected in sequence; the feature extraction branch network includes a Patch Merging layer, a 1×1 convolution layer, a batch normalization layer and a FReLU activation function connected in sequence; The feature extraction branch network includes a first feature extraction branch network and a second feature extraction branch network; wherein, The input end of the first feature extraction branch network is connected to the output end of the first-level ConvTrans Block, and the output end of the first feature extraction branch network is connected to the output end of the third-level ConvTrans Block; The input end of the second feature extraction branch network is connected to the output end of the second-stage ConvTrans Block, and the output end of the second feature extraction branch network is connected to the output end of the fourth-stage ConvTrans Block.
2. The ocular surface color photographic image classification method according to claim 1, characterized in that: The Stem Block includes a 7×7 convolutional layer, a batch normalization layer and a ReLU activation function, and a 3×3 maximum pooling layer connected in sequence; The Bottleneck Layer and the Encoder Block are in parallel; wherein the Encoder Block is also connected to a 4×4 convolutional layer before; The first-level ConvTrans Block includes three ConvTrans Blocks connected in sequence; the second-level ConvTrans Block includes four ConvTrans Blocks connected in sequence; the third-level ConvTrans Block includes three ConvTrans Blocks connected in sequence; and the fourth-level ConvTrans Block includes one ConvTransBlock.
3. The ocular surface color photographic image classification method according to claim 1 or 2, characterized in that: The ocular surface color photography image classification model is trained by the following steps: Acquire training ocular surface color photographic images, and divide the training ocular surface color photographic images into a training set and a test set; wherein the training ocular surface color photographic images carry labels; Using the training ocular surface color photography images in the training set to train the ocular surface color photography image classification model to obtain a trained ocular surface color photography image classification model; The trained ocular surface color photography image classification model is tested using the training ocular surface color photography images in the test set.
4. The ocular surface color photography image classification method according to claim 3, characterized in that: The step of training the ocular surface color photography image classification model using the training ocular surface color photography images in the training set comprises: The cross entropy loss function is used for the CNN branch and the Transformer branch in the model to be trained, the Adam optimizer is used, and the cosine annealing learning rate strategy is used to train the model to be trained, and the parameters of the model to be trained with the highest Model Accuracy are saved.
5. An ocular surface color photography image classification system, characterized in that: The system comprises: An acquisition module, used for acquiring an actual ocular surface color photographic image; A classification module is used to input the actual ocular surface color photography image into a pre-trained ocular surface color photography image classification model to predict the ocular surface color photography image classification result; wherein, The ocular surface color photography image classification model includes: a backbone network built based on a Conformer network, and a feature extraction branch network built based on a PFM module, wherein the feature extraction branch network is jump-connected to the backbone network; The backbone network includes a Stem Block, a Bottleneck Layer and an Encoder Block, a first-level ConvTrans Block, a second-level ConvTrans Block, a third-level ConvTrans Block, a fourth-level ConvTransBlock and a Classifier Block connected in sequence; the feature extraction branch network includes a Patch Merging layer, a 1×1 convolution layer, a batch normalization layer and a FReLU activation function connected in sequence; The feature extraction branch network includes a first feature extraction branch network and a second feature extraction branch network; wherein, The input end of the first feature extraction branch network is connected to the output end of the first-level ConvTrans Block, and the output end of the first feature extraction branch network is connected to the output end of the third-level ConvTrans Block; The input end of the second feature extraction branch network is connected to the output end of the second-stage ConvTrans Block, and the output end of the second feature extraction branch network is connected to the output end of the fourth-stage ConvTrans Block.
6. The ocular surface color photography image classification system according to claim 5, characterized in that: The system also includes a training module; the training module is used to: Acquire training ocular surface color photographic images, and divide the training ocular surface color photographic images into a training set and a test set; wherein the training ocular surface color photographic images carry labels; Using the training ocular surface color photography images in the training set to train the ocular surface color photography image classification model to obtain a trained ocular surface color photography image classification model; The trained ocular surface color photography image classification model is tested using the training ocular surface color photography images in the test set.
7. An electronic device, characterized in that: include: at least one processor; as well as, A memory communicatively connected to the at least one processor, for storing one or more programs, which, when executed by the at least one processor, enables the at least one processor to implement the method for classifying color photographic images of the ocular surface as described in any one of claims 1 to 4.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it can implement the ocular surface color photography image classification method according to any one of claims 1 to 4.
