Image classification method, device, equipment and medium based on residual network
By constructing an image classification model based on residual network, using convolutional neural network and perceptual label distribution boundary loss function, efficient classification of diabetic retinopathy and macular edema images is achieved, and the diagnosis is difficult and costly in the existing technology is solved. Problem, reducing the burden on doctors and reducing screening costs.
Patent Information
- Application Number
- CN202111244501.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-26
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2041-10-26
AI Technical Summary
The existing image classification process based on residual networks cannot be effectively classified and classified, resulting in the diagnosis of medical fields such as diabetic retinopathy and diabetic macular edema, which is difficult, long and costly.
Build an image classification model based on residual network, extract image features through convolutional neural network, and adopt a cross-validation method and perceived label distribution boundary loss function, combined with cross-entropy loss function, realize the output of six classification results of images and the fusion of classification results.
It realizes efficient classification of images with specific features, reduces the diagnostic burden of ophthalmologists, shortens the examination time, reduces the time and labor cost of screening images at different levels of disease, and overcomes the problem of imbalance in image data categories.
Smart Images

Figure CN113887662B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of image processing technology, and in particular relates to an image classification method, device, equipment and medium based on a residual network. Background Art
[0002] Image classification has been widely used in many fields, and deep learning algorithms are currently the most commonly used automatic image processing methods. Convolutional neural networks (CNNs) are a method of extracting features in an end-to-end manner in deep learning algorithms. They have been widely used not only in object detection and semantic segmentation, but also in the medical field. Residual networks can effectively solve the problem of gradient vanishing as the network depth increases.
[0003] Taking the medical field as an example, diabetic retinopathy (DR) is a common complication caused by long-term diabetes and is the most common cause of blindness and visual impairment in the world's working-age population. Increased blood sugar levels affect retinal blood vessels, and the manifestations of vascular changes include: microaneurysms, intraretinal punctate or patchy hemorrhages, hard exudates, nerve fiber obstruction (cotton wool spots), local capillary non-perfusion, and even neovascularization in severe cases.
[0004] Diabetic macular edema (DME) is a disease closely related to diabetic retinopathy and may occur at any stage of diabetic retinopathy. The main symptoms of DME are: retinal thickening, which can be focal or diffuse; hard exudates with or without hard exudates in the vicinity of the macula, and cystic edema.
[0005] As can be seen from the above, both diseases can show different characteristics in the images. In clinical diagnosis, DR and DME screening mainly relies on ophthalmologists to examine color fundus images. However, the shortage of professional ophthalmologists and the poor medical environment in remote areas have seriously restricted the progress of screening and diagnosis, and manual real-time analysis is even more difficult. Therefore, it is necessary to introduce computer-assisted treatment to reduce the burden on ophthalmologists, shorten the examination time, and reduce the time and labor cost of image screening corresponding to different levels of the disease. Summary of the invention
[0006] The purpose of the present invention is to overcome the defects of the prior art and provide an image classification method, device, equipment and medium based on a residual network, aiming to solve the technical problem that images cannot be graded and classified as required in the current image classification process based on a residual network.
[0007] The object of the present invention is achieved through the following technical solutions:
[0008] To achieve the above object, the present invention provides an image classification method based on a residual network, the method comprising the following steps:
[0009] Obtain a data set classified according to data features, and write a data interface required by a convolutional neural network based on the data features;
[0010] Create dataset labels. Each dataset with different data features corresponds to a dataset label.
[0011] Construct training sets and test sets, and divide the dataset into several equal parts;
[0012] Constructing a deep residual unit, building a convolutional neural network, and establishing an image classification model; the output end of the convolutional neural network is connected to at least two classifiers;
[0013] Set training parameters and loss function strategies for the image classification model to determine the classification results output by the classifier;
[0014] Perform network training and network testing on image classification models;
[0015] Input the image to be classified into the image classification model to obtain the classification result.
[0016] Furthermore, the image classification model uses a leave-one-out cross-validation method for network training and network testing.
[0017] Furthermore, there are two classifiers, and the classification results output by the classifiers are a binary classification result and a ternary classification result. The strategy for setting the training parameters and the loss function specifically includes:
[0018] Select a network optimizer and initialize the learning rate;
[0019] Set a decaying learning rate strategy and set the training epochs and batch size;
[0020] Set the binary classification result loss function to the cross entropy loss function L 1 , the loss function of the three-classification result is the cross entropy loss function L 2 ;
[0021] Set the activation function and matrix multiplication for the binary and ternary classification results so that the image classification model outputs six classification results.
[0022] Furthermore, the decay learning rate strategy adopts a cosine annealing function.
[0023] Furthermore, it also includes setting a loss function strategy for the six-category results, and using the perceptual label distribution boundary loss function L for the six-category results. LDAM ,
[0024]
[0025] Among them, x is the input, y is the category corresponding to x, f is the network model, z j=f(x) j is the output of the jth class, and the boundary C is the imbalance ratio, i.e., the ratio between the sample sizes of the most frequent and the least frequent classes;
[0026] The total loss function of the image classification model is L = L 1 +L 2 +L LDAM .
[0027] Furthermore, the deep residual unit includes three convolutional layers and two activation function layers, each convolutional layer also includes a batch normalization layer, and the convolutional layers are connected through activation function layers; the deep residual unit also adds the input to the output through a short-circuit connection. When the input and output dimensions of the short-circuit connection are inconsistent, the input is dimensionally upgraded through a convolutional layer.
[0028] Furthermore, the convolutional neural network includes a front-end convolutional neural network and a back-end convolutional neural network;
[0029] The front-end convolutional neural network includes a convolutional layer, which includes a batch normalization layer. The convolutional layer is connected to the maximum pooling layer through an activation function layer. The maximum pooling layer is connected to the deep residual layer, and the deep residual layer is connected to the average pooling layer.
[0030] The back-end convolutional neural network reduces the dimension of the front-end network output, including the fully connected layer as a classifier.
[0031] On the other hand, the present invention also provides an image classification device based on a residual network, the device comprising:
[0032] An interface writing module, used to obtain a data set classified according to data features, and write a data interface required by a convolutional neural network according to the data features;
[0033] The label making module is used to make dataset labels. Each dataset with different data features corresponds to a dataset label.
[0034] The training set construction module is used to construct the training set and the test set and divide the data set into several equal parts;
[0035] Model building module, used to build deep residual units, build convolutional neural networks, and build image classification models;
[0036] Model training module, used for network training and network testing of image classification models;
[0037] The classification result output module is used to input the image to be classified into the image classification model to obtain the classification result.
[0038] Optionally, the model training module uses a leave-one-out cross-validation method to perform network training and network testing.
[0039] Optional, model training module, used to perform network training and network testing on the image classification model, specifically: select the network optimizer and initialize the learning rate;
[0040] Set a decaying learning rate strategy and set the training epochs and batch size;
[0041] Set the binary classification result loss function to the cross entropy loss function L 1 , the loss function of the three-classification result is the cross entropy loss function L 2 ;
[0042] Set the activation function and matrix multiplication for the binary and ternary classification results so that the image classification model outputs six classification results.
[0043] Optionally, the decay learning rate strategy set by the model training module adopts a cosine annealing function.
[0044] Optionally, the model training module also sets a loss function strategy for the six-category results, using the perceptual label distribution boundary loss function L for the six-category results. LDAM ,
[0045]
[0046] Among them, x is the input, y is the category corresponding to x, f is the network model, z j =f(x) j is the output of the jth class, and the boundary C is the imbalance ratio, i.e., the ratio between the sample sizes of the most frequent and the least frequent classes;
[0047] The total loss function of the image classification model is L = L 1 +L 2 +L LDAM .
[0048] Optionally, the deep residual unit constructed by the model building module includes three convolutional layers and two activation function layers, each convolutional layer also includes a batch normalization layer, and the convolutional layers are connected through activation function layers; the deep residual unit also adds the input to the output through a short-circuit connection. When the input and output dimensions of the short-circuit connection are inconsistent, the input is dimensionally upgraded through a convolutional layer.
[0049] Optionally, the convolutional neural network constructed by the model building module includes a front-end convolutional neural network and a back-end convolutional neural network;
[0050] The front-end convolutional neural network includes a convolutional layer, which includes a batch normalization layer. The convolutional layer is connected to the maximum pooling layer through an activation function layer. The maximum pooling layer is connected to the deep residual layer, and the deep residual layer is connected to the average pooling layer.
[0051] The back-end convolutional neural network reduces the dimension of the front-end network output, including the fully connected layer as a classifier.
[0052] On the other hand, the present application provides a computer device, comprising a processor and a memory, wherein the memory stores a computer program, and the computer program is loaded and executed by the processor to implement any of the above-mentioned residual network-based image classification methods.
[0053] On the other hand, the present application provides a computer-readable storage medium, in which a computer program is stored. The computer program is loaded and executed by a processor to implement any of the above-mentioned residual network-based image classification methods.
[0054] The beneficial effects of the present invention are:
[0055] (1) The present invention constructs an image classification model to classify images with certain specific features, assist doctors in diagnosis, reduce the burden on ophthalmologists, shorten the examination time, and reduce the time and labor cost of image screening corresponding to different levels of diseases.
[0056] (2) Due to the problem of imbalanced categories in image data, the performance is generally poor in categories with a small number, namely the tail category. However, these categories are sometimes a part that cannot be ignored. After extracting image features, the present invention merges the output of different classification results into a total prediction result. And the total classification result uses the perceptual label distribution boundary loss function instead of the cross entropy loss function to overcome the problem of imbalanced image data categories. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 1 is a flowchart of an image classification method based on a residual network provided in Embodiment 1 of the present invention;
[0058] Figure 2 It is a schematic diagram of the structure of an image classification model constructed in an image classification method based on a residual network provided in the first embodiment of the present invention;
[0059] Figure 3 It is a structural schematic diagram of a convolution block 2 in an image classification model of an image classification method based on a residual network provided in Embodiment 1 of the present invention;
[0060] Figure 4 It is a structural block diagram of an image classification device based on a residual network provided in Embodiment 2 of the present invention. DETAILED DESCRIPTION
[0061] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.
[0062] Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in the field without making any creative work shall fall within the scope of protection of the present invention.
[0063] Example 1
[0064] Currently, the clinical diagnosis of diabetic retinopathy (DR) and diabetic macular edema (DME) mainly relies on ophthalmologists to examine color fundus images. However, the shortage of professional ophthalmologists and the poor medical environment in remote areas have seriously restricted the progress of screening and diagnosis, and manual real-time analysis is even more difficult. Therefore, it is necessary to introduce computer-assisted treatment to reduce the burden on ophthalmologists, shorten the examination time, and reduce the time and labor cost of image screening corresponding to different levels of the disease.
[0065] In order to solve this problem, various embodiments of the image classification method based on residual network of the present invention are proposed. The image classification method based on residual network provided by the present invention constructs an image classification model to perform image classification, assists doctors in diagnosis, reduces the burden on ophthalmologists, shortens the examination time, and reduces the time and labor cost of image screening corresponding to different levels of diseases.
[0066] This embodiment provides an image classification method based on a residual network. Figure 1 , as attached Figure 1 Shown is a flow chart of a first embodiment of an image classification method based on a residual network provided by the present invention.
[0067] In this embodiment, a residual network-based image classification method includes the following steps:
[0068] Step S100, obtaining a data set classified according to data features, and writing a data interface required by a convolutional neural network according to the data features.
[0069] Specifically, in this embodiment, the data interface required by the convolutional neural network is written according to the disease classification standards and image resolution and other data features of the public data sets Messidor and IDRiD. Among them, the Messidor data set was established by the TECHNO-VISION research project funded by the French Ministry of Defense Research in 2004, covering 1,200 color fundus images from three ophthalmological institutions. This data set divides the degree of diabetic retinopathy into 4 levels (0-3); according to the occurrence of hard exudates near the central area of the macula, the risk level of diabetic macular edema is divided into 3 levels (0-2). The IDRiD (Indian Diabetic Retinopathy Image Dataset) data set is part of the "Diabetic Retinopathy: Segmentation and Grading Challenge" competition jointly organized by the 2018 IEEE International Symposium on Biomedical Imaging, with a total of 561 color fundus images with image-level annotation information. This data set divides the degree of diabetic retinopathy into 5 levels (0-4) according to the International Clinical Diabetic Retinopathy Scale; the risk level of diabetic macular edema is divided into 3 levels (0-2).
[0070] Step S200: Create a data set label, where each type of data set with different data features corresponds to a data set label.
[0071] Furthermore, the deep residual network used in this embodiment is fully supervised learning, so the two disease severity levels need to be merged into a unified label in the collaborative grading part. The images corresponding to different levels of diabetic retinopathy in the Messidor dataset are divided into two categories, and the 0-1 level of diabetic retinopathy is recoded as 0, and the 2-3 level is recoded as 1. The grading standard of diabetic macular edema remains unchanged at 0-2.
[0072] Construct a six-category label that can simultaneously represent the images corresponding to different levels of the two diseases: 0 represents the image of diabetic retinopathy grade 0 and diabetic macular edema grade 0; 1 represents the image of diabetic retinopathy grade 0 and diabetic macular edema grade 1; 2 represents the image of diabetic retinopathy grade 0 and diabetic macular edema grade 2; 3 represents the image of diabetic retinopathy grade 1 and diabetic macular edema grade 0; 4 represents the image of diabetic retinopathy grade 1 and diabetic macular edema grade 1; 5 represents the image of diabetic retinopathy grade 1 and diabetic macular edema grade 2.
[0073] Step S300, constructing a training set and a test set, dividing the data set into several equal parts, so as to implement network training and network testing using a leave-one-out cross-validation method in the subsequent training process. Optionally, this embodiment divides the data set into ten equal parts.
[0074] Step S400: construct a deep residual unit, build a convolutional neural network, and establish an image classification model. Figure 2 , as attached Figure 2 The figure is a schematic diagram of the structure of an image classification model constructed in an image classification method based on a residual network provided in this embodiment.
[0075] Specifically, we first construct a deep residual unit, which includes three convolutional layers, three batch normalization layers, and two activation function layers. The input is added to the output through a short-circuit connection, and then passes through an activation function layer. The convolution kernel sizes of the three convolutional layers are 1*1, 3*3, and 1*1 respectively. Each convolutional layer contains a batch normalization layer, which is not shown in the figure. When the input and output dimensions of the short-circuit connection are inconsistent, a 1*1 convolutional layer is used to increase the dimension of the input to keep the input and output dimensions consistent.
[0076] Build a front-end convolutional neural network. The input size of the network is 224*224*3, followed by a convolution layer, a batch normalization layer, an activation function layer and a maximum pooling layer; followed by four deep residual layers, namely convolution block 2, convolution block 3, convolution block 4 and convolution block 5. The number of residual units in each residual layer is 3, 4, 6, and 3 respectively; the last is an average pooling layer. See Figure 3 , as attached Figure 3 The figure is a schematic diagram of the structure of the convolution block 2 in the image classification model of the image classification method based on the residual network provided in this embodiment.
[0077] Among them, the convolution layer, maximum pooling layer, and average pooling layer use the parameters of the ImageNet pre-training model. The convolution kernel size of the convolution layer is 7*7, the number of filters is 64, the step size is 2, and the zero padding is 3; the convolution kernel size of the maximum pooling layer is 3*3, the step size is 2, and the zero padding is 1; the input size of the first deep residual layer is 56*56*64, and the output is 56*56*256; the output of the second deep residual layer is 28*28*512; the output of the third deep residual layer is 14*14*1024; the output of the fourth deep residual layer is 7*7*2048; the convolution kernel size of the average pooling layer is 7*7.
[0078] Build a back-end convolutional neural network to reduce the dimension of the front-end network output; then input it into two classifiers respectively, corresponding to the two diseases. Both classifiers are composed of a fully connected layer, and a two-classification result and a three-classification result are obtained respectively.
[0079] Step S500, setting training parameters and loss function strategy for the image classification model, and determining the classification result output by the classifier.
[0080] Specifically, the training parameters and loss function strategy were set. The network optimizer selected the Adam optimizer, the initial learning rate was 0.0003, the cosine annealing function was used to decay the learning rate, the training period was set to 1000, and the batch size was set to 40. The loss function used for the binary and ternary classification results was the cross entropy loss function, and the loss function for the binary classification results was set to the cross entropy loss function L 1 , the loss function of the three-classification result is the cross entropy loss function L 2 The binary and ternary classification results are subjected to the Softmax activation function to obtain matrices corresponding to the binary and ternary classification results, and then matrix multiplication is performed to obtain the six-classification results corresponding to the six-classification labels. A loss function strategy is set for the six-classification results. This embodiment uses the perceptual label distribution boundary loss function L for the six-classification results. LDAM , perceptual label distribution boundary loss function L LDAM The specific expression is as follows:
[0081]
[0082] Among them, x is the input, y is the category corresponding to x, f is the network model, z j =f(x) j is the output of the jth class, and the boundary C is the imbalance ratio, i.e., the ratio between the sample sizes of the most frequent and the least frequent classes;
[0083] The total loss function of the image classification model is L = L 1 +L 2 +L LDAM .
[0084] Using the LDAM loss function instead of the cross entropy loss function is intended to solve the class imbalance problem in data distribution.
[0085] It should be noted that the above settings are the best choices for network training. Although other settings can also complete the image classification model construction, it will cause network performance to deteriorate.
[0086] Step S600, using the leave-one-out cross-validation method to perform network training and network testing on the image classification model. Using the test set constructed in step S200 to perform network testing, the binary and ternary classification results of the two classifiers are the hierarchical classification results of the corresponding images of different degrees of diabetic retinopathy and diabetic macular edema. Using the leave-one-out cross-validation method can enhance the robustness of the image classification model.
[0087] Step S700, input the image to be classified, and obtain the result of image classification, which is used to assist the ophthalmologist's diagnosis, reduce the burden on the ophthalmologist, shorten the examination time, and reduce the time and labor cost of image screening corresponding to different levels of the disease.
[0088] In this embodiment, an image classification model is constructed based on a residual network, and the constructed image classification model is used to classify images with certain specific features. At the same time, the image classification method based on a residual network provided in this embodiment fuses the output different classification results into a total prediction result after extracting image features. The total classification result uses the perceptual label distribution boundary loss function instead of the cross entropy loss function to overcome the problem of image data category imbalance.
[0089] Example 2
[0090] See also Figure 4 , as attached Figure 4 The figure shows a structural block diagram of an image classification device based on a residual network provided in this embodiment.
[0091] The device specifically comprises:
[0092] An interface writing module 10 is used to obtain a data set classified according to data features, and write a data interface required by a convolutional neural network according to the data features;
[0093] A label making module 20 is used to make a data set label, where each data set with different data features corresponds to a data set label;
[0094] A training set construction module 30 is used to construct a training set and a test set, and divide the data set into several equal parts;
[0095] The model building module 40 is used to construct a deep residual unit, build a convolutional neural network, and establish an image classification model;
[0096] A model training module 50 is used to perform network training and network testing on the image classification model;
[0097] The classification result output module 60 is used to input the image to be classified into the image classification model to obtain the classification result.
[0098] As an implementation mode, the model training module 50 uses a leave-one-out cross-validation method to perform network training and network testing.
[0099] As an implementation method, the model training module 50 is used to perform network training and network testing on the image classification model, specifically: selecting a network optimizer and initializing a learning rate;
[0100] Set a decaying learning rate strategy and set the training epochs and batch size;
[0101] Set the binary classification result loss function to the cross entropy loss function L 1 , the loss function of the three-classification result is the cross entropy loss function L 2 ;
[0102] Set the activation function and matrix multiplication for the binary and ternary classification results so that the image classification model outputs six classification results.
[0103] As an implementation mode, the decay learning rate strategy set by the model training module 50 adopts a cosine annealing function.
[0104] As an implementation method, the model training module 50 also sets a loss function strategy for the six classification results, using the perceptual label distribution boundary loss function L LDAM ,
[0105]
[0106] Among them, x is the input, y is the category corresponding to x, f is the network model, z j =f(x) j is the output of the jth class, and the boundary C is the imbalance ratio, i.e., the ratio between the sample sizes of the most frequent and the least frequent classes;
[0107] The total loss function of the image classification model is L = L 1 +L 2 +L LDAM .
[0108] As an implementation method, the deep residual unit constructed by the model building module 40 includes three convolutional layers and two activation function layers, each convolutional layer also includes a batch normalization layer, and the convolutional layers are connected through activation function layers; the deep residual unit also adds the input to the output through a short-circuit connection. When the input and output dimensions of the short-circuit connection are inconsistent, the input is dimensionally upgraded through a convolutional layer.
[0109] As an implementation method, the convolutional neural network constructed by the model building module 40 includes a front-end convolutional neural network and a back-end convolutional neural network;
[0110] The front-end convolutional neural network includes a convolutional layer, which includes a batch normalization layer. The convolutional layer is connected to the maximum pooling layer through an activation function layer. The maximum pooling layer is connected to the deep residual layer, and the deep residual layer is connected to the average pooling layer.
[0111] The back-end convolutional neural network reduces the dimension of the front-end network output, including the fully connected layer as a classifier.
[0112] The present embodiment provides an image classification device based on a residual network, which constructs an image classification model based on a residual network, and implements the classification of images with certain specific features through the constructed image classification model. At the same time, the image classification method based on a residual network provided in the present embodiment, after extracting image features, fuses the output of different classification results into a total prediction result. And the total classification result uses the perceptual label distribution boundary loss function instead of the cross entropy loss function to overcome the problem of imbalanced image data categories.
[0113] Example 3
[0114] This preferred embodiment provides a computer device, which can implement the steps in any embodiment of the residual network-based image classification method provided in the embodiments of the present application. Therefore, the beneficial effects of the residual network-based image classification method provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
[0115] Example 4
[0116] Those skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructions, or by controlling related hardware through instructions, and the instructions can be stored in a computer-readable storage medium and loaded and executed by a processor. To this end, an embodiment of the present invention provides a storage medium, which stores a plurality of instructions, and the instructions can be loaded by a processor to execute the steps of any embodiment of the image classification method based on a residual network provided in an embodiment of the present invention.
[0117] The storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0118] Since the instructions stored in the storage medium can execute the steps in any embodiment of the image classification method based on the residual network provided in the embodiments of the present invention, the beneficial effects that can be achieved by any image classification method based on the residual network provided in the embodiments of the present invention can be achieved. For details, please refer to the previous embodiments and will not be repeated here.
[0119] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. An image classification method based on residual network, characterized in that: include: Obtain a data set classified according to data features, and write a data interface required by a convolutional neural network based on the data features; Create dataset labels. Each dataset with different data features corresponds to a dataset label. Construct training sets and test sets, and divide the dataset into several equal parts; Construct a deep residual unit, build a convolutional neural network, and establish an image classification model; the output end of the convolutional neural network is connected to two classifiers, and the classification results output by the classifier are a two-classification result and a three-classification result. The setting of training parameters and loss function strategies specifically include: Select a network optimizer and initialize the learning rate; Set a decaying learning rate strategy and set the training epochs and batch size; Set the loss function for the binary classification result to the cross entropy loss function L1, and the loss function for the ternary classification result to the cross entropy loss function L2; Set the activation function and matrix multiplication of the binary and ternary classification results so that the image classification model outputs six classification results; Set the loss function strategy for the six-category results and use the perceptual label distribution boundary loss function L for the six-category results LDAM , Among them, x is the input, y is the category corresponding to x, f is the network model, z j =f(x) j is the output of the jth class, and the boundary C is the imbalance ratio, i.e., the ratio between the sample sizes of the most frequent and the least frequent classes; The total loss function of the image classification model is L = L1 + L2 + L LDAM ; Set training parameters and loss function strategies for the image classification model to determine the classification results output by the classifier; Perform network training and network testing on image classification models; Input the image to be classified into the image classification model to obtain the classification result.
2. The image classification method based on residual network according to claim 1, characterized in that: The image classification model uses a leave-one-out cross-validation method for network training and network testing.
3. The image classification method based on residual network according to claim 1, characterized in that: The decay learning rate strategy adopts a cosine annealing function.
4. The image classification method based on residual network according to claim 1, characterized in that: The deep residual unit includes three convolutional layers and two activation function layers, each convolutional layer also includes a batch normalization layer, and the convolutional layers are connected through the activation function layer; the deep residual unit also adds the input to the output through a short-circuit connection. When the input and output dimensions of the short-circuit connection are inconsistent, the input is dimensionally upgraded through a convolutional layer.
5. The image classification method based on residual network according to claim 1, characterized in that: The convolutional neural network includes a front-end convolutional neural network and a back-end convolutional neural network; The front-end convolutional neural network includes a convolutional layer, which includes a batch normalization layer. The convolutional layer is connected to the maximum pooling layer through an activation function layer. The maximum pooling layer is connected to the deep residual layer, and the deep residual layer is connected to the average pooling layer. The back-end convolutional neural network reduces the dimension of the front-end network output, including the fully connected layer as a classifier.
6. An image classification device based on a residual network, characterized in that: include: An interface writing module, used to obtain a data set classified according to data features, and write a data interface required by a convolutional neural network according to the data features; The label making module is used to make dataset labels. Each dataset with different data features corresponds to a dataset label. The training set construction module is used to construct the training set and the test set and divide the data set into several equal parts; The model building module is used to construct a deep residual unit, build a convolutional neural network, and establish an image classification model; the output end of the convolutional neural network is connected to two classifiers, and the classification results output by the classifier are a two-classification result and a three-classification result. The setting of training parameters and loss function strategies specifically include: Select a network optimizer and initialize the learning rate; Set a decaying learning rate strategy and set the training epochs and batch size; Set the loss function for the binary classification result to the cross entropy loss function L1, and the loss function for the ternary classification result to the cross entropy loss function L2; Set the activation function and matrix multiplication of the binary and ternary classification results so that the image classification model outputs six classification results; Set the loss function strategy for the six-category results and use the perceptual label distribution boundary loss function L for the six-category results LDAM , Among them, x is the input, y is the category corresponding to x, f is the network model, z j =f(x) j is the output of the jth class, and the boundary C is the imbalance ratio, i.e., the ratio between the sample sizes of the most frequent and the least frequent classes; The total loss function of the image classification model is L = L1 + L2 + L LDAM ; Model training module, used for network training and network testing of image classification models; The classification result output module is used to input the image to be classified into the image classification model to obtain the classification result.
7. A computer device, characterized in that: The computer device includes a processor and a memory, wherein a computer program is stored in the memory, and the computer program is loaded and executed by the processor to implement the image classification method based on the residual network as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, which is loaded and executed by a processor to implement the image classification method based on a residual network as described in any one of claims 1 to 5.
Citation Information
Cited By
Image classification method and device based on improved residual network, and storage medium
CN114782737A
