An ophthalmic disease image classification system based on a big data model
By constructing an ophthalmic disease image classification system based on a big data model, the shortcomings of smartphone photos in ophthalmic disease classification have been addressed. This system achieves high accuracy in ophthalmic disease classification, improves the reliability and convenience of disease classification, and reduces the burden on patients seeking medical treatment.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- EYE & ENT HOSPITAL SHANGHAI MEDICAL SCHOOL FUDAN UNIV
- Filing Date
- 2025-03-14
- Publication Date
- 2026-06-09
Abstract
Description
Technical Field
[0001] This invention relates to the field of ophthalmic disease image classification technology, and specifically to an ophthalmic disease image classification system. More specifically, it relates to an ophthalmic disease image classification method based on a big data model. Background Technology
[0002] Image classification of ophthalmic diseases has become a research hotspot in recent years. Previously used images were mainly ophthalmic examination photographs acquired by professional examination equipment, including fundus photography and OCT scans. Photos acquired by non-professional examination equipment (such as smartphones) were primarily used to assess disease severity, but research on ophthalmic disease classification is lacking. Image classification relies on training datasets. Since there is currently no suitable training dataset (eye photographs of various ophthalmic diseases taken by smartphones with accurate classification labels) for classifying ophthalmic diseases from smartphone photos, smartphone photos have only been used to assess disease severity and not for ophthalmic disease classification. Therefore, this invention provides an ophthalmic disease image classification method based on a big data model to address the above problems. Summary of the Invention
[0003] To achieve the above objectives, the present invention provides the following technical solution: an ophthalmic disease image classification system based on a big data model, comprising:
[0004] Dataset building module: used to collect eye images taken by smartphones of patients with different eye diseases in ophthalmology clinics, and to perform image labeling to build training and testing datasets;
[0005] Image segmentation module: YOLOv7 is used to segment images captured by smartphones to obtain eye images that only include the area below the eyebrows and above the cheekbone.
[0006] Model training module: The model is trained on images using the five-fold cross-validation method. Data augmentation, white balance adjustment and transfer learning algorithms are applied to transfer the model parameters pre-trained on large-scale general image datasets to the ophthalmic disease classification model. The model is initialized and fine-tuned according to the characteristics of the ophthalmic image dataset.
[0007] Clinical Validation Module: This module is used to perform two phases of clinical validation, including collecting cases, inputting images into the model, and performing data analysis using clinical classification as the gold standard.
[0008] Preferably, the data augmentation techniques in the model training module include random horizontal flipping with a probability of 0.2, random rotation between -5 and 5 degrees, and automatic contrast adjustment with a probability of 0.2.
[0009] Preferably, the clinical validation module collects a fixed number of cases of various ophthalmic diseases in the first phase.
[0010] Preferably, in the second phase, the clinical validation module conducts data collection by researchers and patient self-collection at different centers according to a set time range.
[0011] An image classification method for ophthalmic diseases based on a big data model includes the following steps:
[0012] Construct training and testing datasets: Collect eye images taken by smartphones of patients with different eye diseases in ophthalmology clinics. Four experts independently label the images into four categories. When three or more experts agree on the same category, the category is determined as the label of the image. If at least two experts cannot agree, the image is excluded. For patients with two or more diseases at the same time, add two or more labels to the photos accordingly.
[0013] Image segmentation: The YOLOv7 object detection algorithm is used to train image segmentation on images taken by smartphones, automatically segmenting the area below the eyebrows and above the cheekbone to focus on the eye area;
[0014] Model Training: The image model was trained using a five-fold cross-validation method. The dataset was randomly divided into five parts, each accounting for 20%. In each iteration, four parts were used for training, and the remaining part was used for testing. The model with the highest test accuracy was selected as the final model. During the training phase, each image was initially adjusted to 224x224 pixels. Data augmentation techniques such as random horizontal flipping, random rotation, and automatic contrast adjustment were applied, and white balance was adjusted. Based on this, a transfer learning algorithm was used to transfer the model parameters pre-trained on a large-scale general image dataset to the ophthalmic disease classification model. The model was initialized and fine-tuned according to the characteristics of the ophthalmic image dataset. During the testing phase, the images were also adjusted to 224x224 pixels and white balance was adjusted.
[0015] Clinical validation consisted of two phases. In the first phase, 25 cases each of cataracts, keratitis, and pterygium, along with 25 cases of other diseases, were planned and collected. Facial photos of the patients taken with smartphones were input into the model, and data analysis was performed using clinical classification as the gold standard. In the second phase, cross-sectional case collection was conducted at three centers, including our own center as internal validation and two other centers as external validation. Each center used two image acquisition methods: researchers collected data and patients collected data themselves. In the patient self-collection phase, researchers guided users to complete the photo acquisition and obtain high-quality ocular photos. Regardless of the data collection method, clinical classification was used as the gold standard for data analysis.
[0016] Preferably, in the data augmentation technology, the probability of random horizontal flipping is 0.2, the random rotation angle is between -5 and 5 degrees, and the probability of automatic contrast adjustment is 0.2.
[0017] Preferably, in the first phase of clinical validation, a total of 100 cases are collected, and the number of cases in each category is fixed.
[0018] Preferably, in the second phase of clinical validation, researchers collect data from July 21, 2023 to August 20, 2023 at the internal center and from August 21, 2023 to October 31, 2023 at the external center; patients collect data themselves from November 10, 2023 to January 10, 2024 at the internal center and from January 20, 2024 to March 10, 2024 at the external center.
[0019] Preferably, the specific steps for using the transfer learning algorithm in the model training are as follows:
[0020] Select the ResNet50 model and load its parameters into the ophthalmology disease classification model to initialize the ophthalmology disease classification model;
[0021] The model was fine-tuned based on the characteristics of the ophthalmic image dataset;
[0022] The specific process of the fine-tuning is as follows:
[0023] Adjusting the network structure: Based on the characteristics of ophthalmic images and classification requirements, the network structure of the pre-trained model is appropriately adjusted. When it is found that the last few fully connected layers of the pre-trained model are not suitable for the classification task of ophthalmic diseases, the number and structure of nodes in these layers are modified to adapt to the limited categories of ophthalmic diseases.
[0024] Redefining the loss function: Based on the accuracy requirements of ophthalmic disease classification, a loss function specifically applicable to ophthalmic image classification tasks is defined. The cross-entropy loss function is used to measure the difference between the model's prediction results and the true labels. By minimizing this loss function, the model parameters are optimized, making the model perform better and better in ophthalmic image classification.
[0025] Adjusting training parameters: Based on the size and complexity of the ophthalmic image dataset, adjust the learning rate and number of iterations during training. Since the pre-trained model already has a certain foundation, the initial learning rate can be set relatively small to avoid excessive perturbation of the learned general features during fine-tuning. Simultaneously, gradually adjust the learning rate based on the model's performance on the validation set, such as by employing a learning rate decay strategy. The number of iterations will also be adjusted based on the model's convergence on the training and validation sets to ensure that the model fully learns the features and classification patterns in the ophthalmic images without overfitting.
[0026] Data Augmentation Adaptation: When applying data augmentation techniques, the unique characteristics of ophthalmic images should be considered. For example, in the selection of random rotation angles, due to the relative symmetry and directionality of the eye structure, the range of rotation angles may be set more cautiously to avoid distortion or loss of key eye features due to excessive rotation. This ensures that the augmented data can still effectively reflect the characteristic information of ophthalmic diseases, thereby better assisting model learning.
[0027] This invention provides an image classification system for ophthalmic diseases based on a big data model. It has the following beneficial effects:
[0028] This ophthalmic disease image classification system based on a big data model demonstrated high classification accuracy for diseases such as cataracts, keratitis, and pterygium in the development phase test set and various clinical evaluation stages. Using YOLOv7 for image segmentation training, it can automatically and accurately segment the eye region below the eyebrow and above the zygomatic arch, removing a large amount of interference information from non-eye areas. This allows the model training and classification process to focus more on eye features, contributing to improved classification accuracy and reliability. Clinical validation was conducted in two phases across multiple centers, including internal validation at this center and external validation at other centers. It employed both data collection by researchers and image acquisition by patients themselves, comprehensively simulating different application scenarios. The model's accuracy and stability under different conditions were fully verified, which is conducive to its widespread promotion and application. The five-fold cross-validation method was used during the model training phase to effectively prevent overfitting and ensure the independence of the dataset and the model's generalization ability. Various data augmentation techniques were applied to diversify the training data, further improving the model's ability to recognize eye images under different conditions. This allows the model to better adapt to various image changes in real-world applications. The model is based on images taken with a smartphone, which makes it convenient for patients to collect eye images at home. Combined with the high classification accuracy, it improves the accessibility and convenience of ophthalmological medical services, reduces the burden on patients to go to the hospital, and also helps in the early detection and intervention of diseases. Detailed Implementation
[0029] 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 some embodiments of the present invention, and not all 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.
[0030] This invention provides a technical solution: an image classification method for ophthalmic diseases based on a big data model, characterized by comprising the following steps:
[0031] Construct training and testing datasets: Collect eye images taken by smartphones of patients with different eye diseases in ophthalmology clinics. Four experts independently label the images into four categories. When three or more experts agree on the same category, the category is determined as the label of the image. If at least two experts cannot agree, the image is excluded. For patients with two or more diseases at the same time, add two or more labels to the photos accordingly.
[0032] Image segmentation: The YOLOv7 object detection algorithm is used to train image segmentation on images taken by smartphones, automatically segmenting the area below the eyebrows and above the cheekbone to focus on the eye area;
[0033] Model Training: The image model was trained using a five-fold cross-validation method. The dataset was randomly divided into five parts, each accounting for 20%. In each iteration, four parts were used for training, and the remaining part was used for testing. The model with the highest test accuracy was selected as the final model. During the training phase, each image was initially adjusted to 224x224 pixels. Data augmentation techniques such as random horizontal flipping, random rotation, and automatic contrast adjustment were applied. The probability of random horizontal flipping was 0.2, the random rotation angle was between -5 and 5 degrees, and the probability of automatic contrast adjustment was 0.2. White balance adjustment was also performed. Based on this, a transfer learning algorithm was used to transfer the model parameters pre-trained on a large-scale general image dataset to the ophthalmic disease classification model. The model was initialized and fine-tuned according to the characteristics of the ophthalmic image dataset. During the testing phase, the images were also adjusted to 224x224 pixels and white balance was adjusted.
[0034] Select the ResNet50 model and load its parameters into the ophthalmology disease classification model to initialize the ophthalmology disease classification model;
[0035] The model was fine-tuned based on the characteristics of the ophthalmic image dataset;
[0036] The specific process of the fine-tuning is as follows:
[0037] Adjusting the network structure: Based on the characteristics of ophthalmic images and classification requirements, the network structure of the pre-trained model is appropriately adjusted. When it is found that the last few fully connected layers of the pre-trained model are not suitable for the classification task of ophthalmic diseases, the number and structure of nodes in these layers are modified to adapt to the limited categories of ophthalmic diseases.
[0038] Redefining the loss function: Based on the accuracy requirements of ophthalmic disease classification, a loss function specifically applicable to ophthalmic image classification tasks is defined. The cross-entropy loss function is used to measure the difference between the model's prediction results and the true labels. The true labels are determined by annotations from four experts. The model parameters are optimized by minimizing this loss function, so that the model performs better and better in ophthalmic image classification.
[0039] Adjusting training parameters: Based on the size and complexity of the ophthalmic image dataset, adjust the learning rate and number of iterations during training. Since the pre-trained model already has a certain foundation, the initial learning rate can be set relatively small to avoid excessive perturbation of the learned general features during fine-tuning. Simultaneously, gradually adjust the learning rate based on the model's performance on the validation set, such as by employing a learning rate decay strategy. The number of iterations will also be adjusted based on the model's convergence on the training and validation sets to ensure that the model fully learns the features and classification patterns in the ophthalmic images without overfitting.
[0040] Data Augmentation Adaptation: When applying data augmentation techniques, the unique characteristics of ophthalmic images should be considered. For example, in the selection of random rotation angles, due to the relative symmetry and directionality of the eye structure, the range of rotation angles may be set more cautiously to avoid distortion or loss of key eye features due to excessive rotation. This ensures that the augmented data can still effectively reflect the characteristic information of ophthalmic diseases, thereby better assisting model learning.
[0041] Clinical validation consisted of two phases. Phase one involved the planned collection of 25 cases each of cataracts, keratitis, and pterygium, along with 25 cases of other diseases. Facial photographs taken by smartphones were input into the model, and data analysis was performed using clinical classification as the gold standard. Phase two involved cross-sectional case collection at three centers: our own center for internal validation and two other centers for external validation. Each center employed both researcher-collected and patient-self-collected image acquisition methods. During the patient-self-collected data phase, researchers guided users through the photo acquisition process. The study collected high-quality ocular photographs, and regardless of the data collection method, clinical classification was used as the gold standard for data analysis. In the second phase of clinical validation, researchers collected data from July 21, 2023 to August 20, 2023 at the internal center and from August 21, 2023 to October 31, 2023 at the external center; patients collected data themselves from November 10, 2023 to January 10, 2024 at the internal center and from January 20, 2024 to March 10, 2024 at the external center.
[0042] Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. All other embodiments obtained by those skilled in the art and related fields based on the embodiments of the present invention without inventive effort should fall within the scope of protection of the present invention. Structures, devices, and operating methods not specifically described and explained in the present invention, unless otherwise specified or limited, shall be implemented according to conventional means in the art.
Claims
1. A method for classifying ophthalmic disease images based on a big data model, characterized in that, Includes the following steps: Construct training and testing datasets: Collect eye images taken by smartphones of patients with different eye diseases in ophthalmology clinics. Four experts independently label the images into four categories. When three or more experts agree on the same category, the category is determined as the label of the image. If at least two experts cannot agree, the image is excluded. For patients with two or more diseases at the same time, add two or more labels to the photos accordingly. Image segmentation: The YOLOv7 object detection algorithm is used to train image segmentation on images taken by smartphones, automatically segmenting the area below the eyebrows and above the cheekbone to focus on the eye area; Model training: The image model is trained using the five-fold cross-validation method. The transfer learning algorithm is used to transfer the model parameters pre-trained on a large-scale general image dataset to the ophthalmic disease classification model. The model is initialized and fine-tuned according to the characteristics of the ophthalmic image dataset. Clinical validation: This includes two phases. In the first phase, 25 cases each of cataracts, keratitis, and pterygium, as well as 25 cases of other diseases, were planned and collected. Facial photos of the patients taken by smartphones were input into the model, and data analysis was performed using clinical classification as the gold standard. In the second phase, cross-sectional case collection was conducted at three centers.
2. The ophthalmic disease image classification method based on a big data model according to claim 1, characterized in that: In the data augmentation technology, the probability of random horizontal flipping is 0.2, the random rotation angle is between -5 and 5 degrees, and the probability of automatic contrast adjustment is 0.
2.
3. The ophthalmic disease image classification method based on a big data model according to claim 1, characterized in that: In the first phase of clinical validation, a total of 100 cases were collected, with a fixed number of cases in each category.
4. The ophthalmic disease image classification method based on a big data model according to claim 1, characterized in that: In the second phase of clinical validation, researchers collected data from July 21, 2023 to August 20, 2023 at the internal center and from August 21, 2023 to October 31, 2023 at the external center. Patients collected data themselves from November 10, 2023 to January 10, 2024 at the internal center and from January 20, 2024 to March 10, 2024 at the external center.
5. The ophthalmic disease image classification method based on a big data model according to claim 1, characterized in that: The specific steps of using the transfer learning algorithm in the model training are as follows: Select the ResNet50 model and load its parameters into the ophthalmology disease classification model to initialize the ophthalmology disease classification model; The model was fine-tuned based on the characteristics of the ophthalmic image dataset; The specific process of the fine-tuning is as follows: Adjusting the network structure: Based on the characteristics of ophthalmic images and classification requirements, the network structure of the pre-trained model is appropriately adjusted; Redefining the loss function: Based on the accuracy requirements of ophthalmic disease classification, a loss function specifically suitable for ophthalmic image classification tasks is defined; Adjust training parameters: Adjust the learning rate and number of iterations during training based on the size and complexity of the ophthalmic image dataset; Data augmentation adaptation: When applying data augmentation techniques, the special characteristics of ophthalmic images should be considered.
6. An ophthalmic disease image classification system based on a big data model, characterized in that, include: Dataset building module: used to collect eye images taken by smartphones of patients with different eye diseases in ophthalmology clinics, and to perform image labeling to build training and testing datasets; Image segmentation module: YOLOv7 is used to segment images captured by smartphones to obtain eye images that only include the area below the eyebrows and above the cheekbone. Model training module: The model is trained on images using the five-fold cross-validation method. Data augmentation, white balance adjustment and transfer learning algorithms are applied to transfer the model parameters pre-trained on large-scale general image datasets to the ophthalmic disease classification model. The model is initialized and fine-tuned according to the characteristics of the ophthalmic image dataset. Clinical Validation Module: This module is used to perform two phases of clinical validation, including collecting cases, inputting images into the model, and performing data analysis using clinical classification as the gold standard.
7. The ophthalmic disease image classification system based on a big data model according to claim 6, characterized in that: The data augmentation techniques in the model training module include random horizontal flipping with a probability of 0.2, random rotation between -5 and 5 degrees, and automatic contrast adjustment with a probability of 0.
2.
8. The ophthalmic disease image classification system based on a big data model according to claim 6, characterized in that: The clinical validation module collects a fixed number of cases of various ophthalmic diseases in the first phase.
9. The ophthalmic disease image classification system based on a big data model according to claim 6, characterized in that: In the second phase, the clinical validation module allows researchers to collect data and patients to collect data themselves at different centers within a set timeframe.