Improved medical image classification method based on deep learning Adam optimization algorithm

By introducing gradient norm constraints and cyclic exponential decay learning rates into the Adam optimization algorithm, the training process of the deep learning model is improved, the problems of stability and convergence speed in medical image analysis are solved, and the performance and accuracy of the model are significantly improved. , suitable for image classification and diagnosis tasks in the field of medical image analysis.

CN118736314APending Publication Date: 2024-10-01SHENYANG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410881139.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-03
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

Deep learning models have stability and convergence speed problems in medical image analysis. In particular, the stability and convergence speed of the Adam optimization algorithm combined with momentum and second-order moment estimation still need to be improved.

Method used

Combining gradient norm constraints and cyclic exponential decay learning rate methods, improve the Adam optimization algorithm for training the MobileNetV2 model, prevent gradient explosion or disappearance through gradient norm constraints, and dynamically adjust the learning rate through cyclic decay to improve the adaptability of the model. and generalization ability.

Benefits of technology

It significantly improves the training efficiency and stability of the model, improves the accuracy and generalization ability in medical image analysis, and can effectively process medical image data, especially in the diagnosis tasks of glaucoma and gastroenterology.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118736314A_ABST
    Figure CN118736314A_ABST
Patent Text Reader

Abstract

The invention introduces an improved medical image classification method, and utilizes a deep learning technology, especially for intestinal tract disease and glaucoma data set images. A large amount of image data related to intestinal tract diseases and glaucoma are collected. The data is divided into a training set, a test set and a verification set according to a fixed proportion, and the training set, the test set and the verification set are preprocessed to ensure the quality and accuracy of the data. And inputting the preprocessed image into a neural network MobileNetV2 model, so as to extract important features from the image. And carrying out image classification by adopting an improved Adam optimization algorithm. Performance evaluation is carried out on the images so as to ensure that the classification method can accurately and efficiently classify images related to intestinal tract diseases and glaucoma. The method is characterized in that medical image classification can be carried out without special equipment or professionals, and the recognition accuracy and classification efficiency of intestinal tract disease and glaucoma images can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to an image data processing technology, in particular to an optimization technology for deep learning methods. Deep learning has become an important tool for processing image data and has achieved great success in tasks such as image classification, object detection, semantic segmentation, etc. However, the training process of deep learning models often requires a large amount of computing resources and is easily affected by problems such as gradient vanishing or exploding. Therefore, the present invention aims to propose an improved optimization technology, which solves the stability and convergence speed problems existing in traditional optimization methods by combining a gradient norm constraint strategy and a method of cyclic exponential decay learning rate, so that image data can be processed more effectively. Background Art

[0002] The present invention relates to the field of medical image analysis, which is an increasingly prominent and important field in research and application. Medical image analysis can help doctors diagnose diseases, plan treatments, and evaluate treatment effects by conducting in-depth analysis of medical imaging data, which is of great significance for improving medical diagnosis and treatment effects.

[0003] Currently, the use of advanced computer technology and artificial intelligence methods to assist in glaucoma detection and gastrointestinal disease diagnosis has become a research field that has attracted much attention worldwide.

[0004] Glaucoma is a chronic eye disease and one of the leading causes of blindness worldwide. Early detection and effective management of glaucoma are critical to preventing vision loss.

[0005] Gastrointestinal disease, as another common health problem, has a serious impact on people's quality of life. Early diagnosis of gastrointestinal disease can greatly improve the treatment effect and the survival rate of patients. In recent years, the diagnosis research of gastrointestinal disease images has also attracted widespread attention, including endoscopic images and medical imaging. By analyzing and processing these image data, it can help doctors diagnose gastrointestinal diseases more accurately and provide patients with more timely treatment.

[0006] However, medical image analysis also faces a series of challenges, including but not limited to data quality, algorithm reliability, model universality, etc. In response to these challenges, researchers continue to propose innovative methods and technologies.

[0007] In the current field of medical image analysis, the Adam optimization algorithm combines the characteristics of momentum and second-order moment estimation, but its stability and convergence speed still need to be improved.

[0008] The idea of ​​cyclic exponential decay learning rate is to dynamically adjust the learning rate so that it changes periodically during training, thereby improving the adaptability and generalization ability of the model. The gradient norm constraint is to limit the size of the gradient to avoid the gradient explosion or vanishing problem, making the model training more stable and reliable.

[0009] Therefore, the present invention aims to propose an improved optimization technique by combining methods such as cyclic exponential decay learning rate and gradient norm constraint to meet the challenges in the field of medical image analysis and promote the development and progress of this field. Summary of the invention

[0010] The present invention provides an improved Adam algorithm for application in medical image analysis, aiming to solve the important challenges currently faced in the field of medical image analysis.

[0011] To achieve the above purpose, the present invention is based on the improved Adam algorithm and applied to medical images. The specific implementation steps are as follows:

[0012] Obtain medical image datasets from various sources, including a two-category dataset on fundus glaucoma and an eight-category dataset on upper gastrointestinal diseases. Ensure the quality of the dataset and the accuracy of the annotations.

[0013] The data is preprocessed, the image pixels are center cropped and regularized, and the training set, validation set, and test set are constructed for subsequent model training.

[0014] MobileNetV2 is selected as the basic model because it is lightweight and efficient and suitable for medical image analysis tasks.

[0015] The improved Adam optimization algorithm is integrated as the optimizer for training the MobileNetV2 model. This algorithm combines the characteristics of gradient norm constraint and cyclic decay exponential learning rate, which helps to improve the training efficiency and stability of the model.

[0016] The gradient norm constraint is a defined regularization technique that aims to constrain the gradient during operation to prevent the gradient from dispersing or exploding.

[0017] The cyclic decay exponential learning rate is a modification of the original cyclic learning rate algorithm. It can dynamically change the value of the learning rate, allowing the model to generalize better and improve the performance of the optimization algorithm.

[0018] Use the validation set to evaluate the trained model and evaluate the performance of the model through various indicators (such as accuracy, loss value, etc.). Pay special attention to whether the optimization algorithm effectively solves the stability and convergence speed problems existing in traditional optimization methods.

[0019] During the experiment, wandb was used to visualize the experiment, and Optuna was used to tune the model and optimization algorithm parameters to achieve the best results.

[0020] The trained MobileNetV2 model is applied to actual medical image analysis tasks, such as classifying whether glaucoma exists in the fundus and classifying the specific conditions of gastrointestinal diseases. Result analysis: Analyze the performance of the model on different tasks, evaluate its application potential in the field of medical image analysis, and propose improvement suggestions and future research directions. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments; Figure 1 is a flow chart of the present invention; Figure 2 The data set preprocessing process used in the present invention; Figure 3 The accuracy of the method used in the present invention on the gastrointestinal disease dataset; Figure 4 The accuracy of the method used in the present invention on the glaucoma dataset. DETAILED DESCRIPTION

[0022] In order to make the purpose, technical solution and effect of the present invention clearer, the present invention is further described in detail in conjunction with the accompanying drawings and specific implementation methods. It should be noted that these specific embodiments are only used to explain the principles of the present invention, rather than to limit the present invention.

[0023] This paper defines an improved Adam algorithm based on the gradient exponential decay learning rate and gradient norm constraint strategy. It is used in medical image classification. The specific implementation steps are as follows: S1. Obtain high-quality fundus glaucoma datasets and gastrointestinal disease upper digestive tract datasets to ensure the quality of the datasets and the accuracy of the annotations. To ensure the training effect of the model, these datasets need to be divided in a ratio of 7:1:2, used for training set, validation set and test set respectively. The training set is used for model training, the validation set is used to adjust the model parameters and prevent overfitting, and the test set is used to evaluate the final performance of the model. By scientifically and rationally dividing and using these datasets, the accuracy and robustness of the model can be ensured; The fundus glaucoma dataset mainly contains two types of images: glaucoma and non-glaucoma; The gastrointestinal disease dataset mainly consists of different grades of hemorrhoids, polyps and colitis, with a total of eight categories.

[0024] S2. Preprocessing and data enhancement of images are important steps to improve model performance, including center cropping, random rotation, and regularization. Center cropping can eliminate edge interference information and allow the model to focus on the main part of the image; random rotation increases the diversity of the data set through random angle rotation operations, improving the robustness and generalization ability of the model; regularization scales the image pixel values ​​to a smaller range (for example, between 0 and 1), speeding up the convergence of the model and reducing overfitting. Through these preprocessing and data enhancement operations, the training effect and prediction performance of the model can be significantly improved.

[0025] S3, select the MobileNetV2 neural network as the basic model, and select the improved algorithm as the optimization algorithm; Specifically, the MobileNetV2 neural network is known for its lightweight, high efficiency, and few parameters. Its design was inspired by the application requirements of deep neural networks in resource-constrained environments such as mobile devices. Through carefully designed structures such as the deep separable convolutional layer, it achieves a significant reduction in the number of parameters and computational complexity while maintaining model performance. MobileNetV2 performs well in tasks such as image classification, object detection, and semantic segmentation, making it one of the preferred models for deep learning applications on many mobile and embedded devices. Its lightweight and high efficiency enable it to be quickly deployed and run in resource-constrained environments, providing strong support for the realization of end-side intelligence, while also expanding new possibilities for the promotion and application of deep learning on mobile terminals; The improved algorithm adopts the gradient norm constraint strategy and the mechanism of cyclic exponential decay learning rate, and is improved on the basis of the Adam algorithm. This algorithm improvement method has shown significant performance improvement in experiments and provides an effective strategy for optimizing the training process of deep learning models; The main purpose of the gradient norm constraint strategy is to limit the size of the gradient to avoid gradient vanishing or gradient exploding during model training. The introduction of this constraint is crucial to maintaining the stability of the model, because gradient vanishing or exploding may lead to instability and failure to converge during the training process, thus affecting the performance and generalization ability of the model. By constraining the gradient, the update amplitude of the model parameters can be effectively controlled, making it more stable and reliable. In addition, the gradient norm constraint also helps to improve the efficiency of training, accelerate the convergence speed of the model, and improve the generalization performance of the model on test data; The cyclic decay exponential learning rate is an improvement on the traditional cyclic learning rate algorithm, which can dynamically adjust the value of the learning rate according to the dynamic situation of training. The advantage of this method is that it can better adapt to the characteristics of different data distributions and tasks, so that the model has more generalization ability and stability during training. By periodically adjusting the learning rate, the cyclic decay exponential learning rate can improve the performance and efficiency of the optimization algorithm.

[0026] S4. Use Optuna to optimize hyperparameters to improve the performance of the experiment. Optuna is an efficient hyperparameter optimization tool that can automatically adjust and select the optimal hyperparameter configuration to improve the training effect and prediction ability of the model; Specifically, Optuna can explore and evaluate different hyperparameter combinations by running experiments multiple times to find the best hyperparameter configuration that can minimize the target metric. Each time an experiment is run, Optuna selects a set of hyperparameters for experimentation, either randomly or through an optimization algorithm, based on a predefined hyperparameter search space. The results of each experiment are recorded and used to guide the next round of hyperparameter selection; Through this process of iteration and feedback, Optuna can gradually approach the optimal hyperparameter combination, so that the final configuration can significantly optimize the performance of the model and minimize the target indicator. This process not only improves the accuracy and stability of the model, but also improves the overall optimization efficiency and saves a lot of manual parameter adjustment time.

[0027] S5. Evaluating the performance of an algorithm based on classification accuracy is a common method. By measuring the accuracy of a model, the classification ability and generalization performance of the model can be effectively judged. Classification accuracy refers to the ratio of the number of samples correctly classified by the model to the total number of samples, so it can intuitively reflect the effectiveness of the model in processing classification tasks. By evaluating the classification accuracy, the predictive ability of the model can be quantified, and the performance differences of the model under different hyperparameter configurations can be identified, so as to select the best algorithm configuration to improve the overall performance of the model. The accuracy directly affects the reliability and effectiveness of the model in practical applications. Therefore, performance evaluation based on classification accuracy is an important step in optimizing and improving algorithms.

[0028] The following is a detailed description of two strategies for improving the algorithm in the present invention.

[0029] The cyclic exponential decay strategy calculates the current learning rate scheduling cycle. According to the current number of training steps and the set learning rate scheduling cycle size, the model training stage is determined for use in subsequent learning rate adjustments. The cycle calculation formula is: Where cycle represents the current cycle of the loop, state['step'] is the total number of parameter updates during the entire training process of the model, and step_size is the total number of steps contained in a complete learning rate scheduling cycle.

[0030] The learning rate scheduling progress in the current learning rate scheduling cycle is calculated. It calculates the progress of model training in this cycle based on the position of the current step relative to the scheduling cycle. The learning rate scheduling progress calculation formula is: x=|state['step'] / step_size-2·cycle+1| Where x is the relative position of the iteration number within the cycle where the current iteration number is located, cycle represents the current cycle of the cycle, and step_size is the total number of steps contained in a complete learning rate scheduling cycle.

[0031] The current learning rate is calculated based on the learning rate scheduling progress and the decay rules within the scheduling cycle. It dynamically adjusts the model's learning rate based on the pre-defined learning rate decay strategy, combined with the current training progress and number of steps, to promote the effect and speed of model training. Learning rate calculation formula: lr=lrbase+(lrmax-lrbase)·max(0,1-x) in is the current learning rate, lrbase is the minimum learning rate during the change, gamma is the decay coefficient, and lrmax is the maximum learning rate during the change.

[0032] By adjusting the learning rate periodically, the model can be explored and exploited at different learning rate levels during training, which helps avoid getting stuck in local optima.

[0033] On top of this, a gradient norm constraint strategy is added. The gradient norm constraint constrains the model's learning process by limiting the gradient norm when the model parameters are updated. Specifically, the gradient norm constraint normalizes or scales the gradient after each parameter update to ensure that the overall size of the gradient does not exceed the set threshold or range. The gradient norm constraint strategy calculates: Where grad represents the original gradient vector, ||grad|| represents the norm of the gradient vector, and grad_norm_constraint represents the threshold of the gradient norm.

[0034] Gradient norm constraints also help improve the generalization ability of the model. Too large a gradient may cause the model to overfit on the training data, while the gradient norm constraint can limit the amplitude of the model parameter update, making the model smoother and reducing overfitting on the training data, thereby improving the generalization ability of the model on unrecognized data.

[0035] The specific improved algorithm process is shown in Algorithm 1: Improved algorithm process:

[0036] By using the above improved algorithm to conduct experiments on the gastrointestinal disease dataset and the glaucoma dataset, the programming language used for the experiment was Python and the Pytorch lightning framework.

[0037] The experiments cover five optimization algorithms, namely SGD, Adagrad, Adam, NAdam and Improvement algorithm, aiming to compare the performance differences between them.

[0038] The batch size used in each experiment is 128 to ensure the consistency and fairness of the experiments.

[0039] In order to accurately evaluate the performance of each optimizer, all experiments were trained for 100 epochs to ensure that the model training was sufficient and accurate.

[0040] The experimental results of the improved algorithm on the gastrointestinal disease dataset are shown in Table 1.

[0041] The experimental results of the improved algorithm on the fundus glaucoma dataset are shown in Table 2.

[0042] The results of the study show that the improved algorithm can not only improve the performance of the model on the standard test set, but can also be applied to fields such as medical image processing. Significant improvements have been made in glaucoma detection and gastrointestinal disease diagnosis. It can effectively distinguish fundus images with and without glaucoma, as well as identify and classify hemorrhoids, polyps, and ulcerative colitis in gastrointestinal diseases.

[0043] The above preferred embodiments are intended to illustrate the present invention, not to describe all the details in detail, nor to limit the present invention to the specific embodiments described. According to the content of this specification, various modifications and changes can be made. The selection and specific description of these embodiments are intended to better explain the principles and practical applications of the present invention so that those skilled in the art can fully understand and apply the present invention. The present invention is only limited by the claims and their full scope and equivalents.

Claims

1. A medical image classification method based on the improved deep learning Adam optimization algorithm, characterized in that: include: S1. Obtain images of gastrointestinal disease and glaucoma datasets, and divide the datasets into training set, test set, and validation set according to the ratio of 7:1:2; S2. Perform preprocessing and data enhancement operations on the obtained images; S3. Input the preprocessed image into the neural network model for feature extraction, and classify the image using an improved algorithm based on the Adam algorithm; S4. Using the Optuna method to select the optimal parameters during training can more comprehensively search the hyperparameter space to find the optimal parameter combination, thereby improving the performance of the model on the training data and enhancing the model's generalization ability on unseen data; S5. Perform performance evaluation on the classification results.

2. According to claim 1, a medical image classification method improved based on deep learning Adam optimization algorithm is characterized in that after obtaining the gastrointestinal disease and glaucoma data set images, it also includes detailed processing of the data set, which includes dividing the data set into a training set, a test set and a validation set, and performing a series of preprocessing operations on the medical image, such as random rotation of 15°, center cropping and enlarging 1.25 times, and standard regularization of the RGB three channels to ensure the quality and accuracy of the data.

3. According to claim 1, a medical image classification method improved based on deep learning Adam optimization algorithm is characterized in that in step S3, a MobileNetV2 lightweight neural network model is used for feature extraction. At the same time, the method combines an improved algorithm based on the Adam algorithm, and adopts a cyclic exponential decay strategy and a gradient norm constraint strategy to improve the generalization ability and training stability of the model.

4. According to the improved medical image classification method based on deep learning Adam optimization algorithm described in claim 1, it is characterized in that Optuna is used to select the optimal hyperparameters in step S4, thereby further improving the performance and stability of the model.

5. According to claim 1, a medical image classification method improved based on deep learning Adam optimization algorithm is characterized in that the accuracy of the classification result is evaluated in step S5. The purpose of this step is to help clinicians make more accurate diagnoses to improve the practicality and credibility of medical image classification.