Image enhancement processing method, device, computer equipment and storage medium
By screening and training the image recognition model of handwritten digits, quality-enhanced training images are generated, which solves the problem of insufficient generalization ability of handwritten digit recognition models in the existing technology, improves image quality and classification accuracy, and realizes automated data enhancement processing. .
Patent Information
- Application Number
- CN202210156905.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-21
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2042-02-21
AI Technical Summary
Existing data enhancement methods are difficult to effectively handle different individual writing styles and noise issues when dealing with handwritten digit recognition, resulting in insufficient model generalization capabilities and overfitting.
By obtaining a data set of handwritten digits, using a preset data enhancement algorithm to generate target images, and using a pre-trained digit recognition model to screen correct and incorrect images, obtain weight vectors and feature vectors, train the image recognition model, and generate quality-enhanced training images, suppressing noise and adjusting error images.
It improves the image quality and model classification accuracy, reduces classification errors caused by different writing habits and styles, realizes automated image quality enhancement, and improves the efficiency of data enhancement processing.
Smart Images

Figure CN114549928B
Abstract
Description
Technical Field
[0001] The present application relates to the field of neural network technology of artificial intelligence technology. Specifically, the present application relates to an image enhancement processing method, device, computer equipment and storage medium. Background Art
[0002] Currently, machine learning methods can be maturely applied to various high-performance model architectures, but their generalization ability is still problematic. As for the problem of handwritten digit recognition, the data obtained in practical applications are often accompanied by problems such as irregular handwriting, differences in handwriting between different individuals, and varying degrees of noise.
[0003] The use of data augmentation methods can improve the generalization ability of the model and reduce overfitting. However, most of the existing data augmentation methods change the spatial position and size of the target through simple rotation and translation. The images after data augmentation may still have problems such as conjoined objects and background noise, and the quality is low. Summary of the invention
[0004] The main purpose of this application is to provide an image enhancement processing method, device, computer equipment and storage medium to improve the quality of images after data enhancement.
[0005] In order to achieve the above-mentioned object of the invention, the present application provides an image enhancement processing method, which comprises:
[0006] Acquire a data set; wherein the data set includes multiple images of handwritten numbers;
[0007] Amplifying the images of the data set using a preset data enhancement algorithm to obtain a preset number of target images;
[0008] Using a pre-trained digital recognition model to classify the target image, obtain the category of the target image, and screen out a first target image that is correctly classified and a second target image that is incorrectly classified from the target image;
[0009] Obtaining a first weight vector and a feature vector of the first target image of each category, and training a pre-built image recognition model using the first target image according to the first weight vector and the feature vector to obtain a trained image recognition model;
[0010] Using the trained image recognition model to predict the second target image to obtain a prediction result;
[0011] A second weight vector is generated according to the prediction result, and the second weight vector is multiplied by the second target image to obtain a quality-enhanced training image.
[0012] Preferably, the obtaining of the first weight vector and the feature vector of the first target image of each category includes:
[0013] According to the category of the first target image, a corresponding weight vector is searched from a pre-constructed comparison table to obtain a first weight vector; wherein the comparison table records the weight vector corresponding to each category of the image;
[0014] Acquire feature information of the first target image, convert the feature information into a vector form, and obtain a feature vector of the first target image.
[0015] Preferably, the acquiring feature information of the first target image, converting the feature information into a vector form, and obtaining a feature vector of the first target image includes:
[0016] When it is determined that there are multiple first target images, obtaining all feature information of each of the first target images;
[0017] Calculating the frequency of occurrence of each of the feature information in the plurality of the first target images;
[0018] Filter out the feature information with the highest frequency from all the feature information to obtain target feature information;
[0019] The target feature information is converted into a vector form to obtain feature vectors of a plurality of the first target images.
[0020] Preferably, generating a second weight vector according to the prediction result comprises:
[0021] Determine error information of classification error of the second target image according to the prediction result, and obtain reference error information of the second target image;
[0022] calibrating the second target image according to the reference error information to obtain calibration information;
[0023] The calibration information is converted into a word vector form to obtain the second weight vector.
[0024] Preferably, the using the first target image to train a pre-built image recognition model to obtain a trained image recognition model includes:
[0025] Using the first target image to train a pre-built image recognition model to obtain a training result;
[0026] According to the training results, a cross entropy loss function is used to calculate the loss value of the image recognition model after training;
[0027] Determining whether the loss value is lower than a preset loss value;
[0028] When it is determined that the loss value is lower than the preset loss value, a trained image recognition model is obtained.
[0029] Furthermore, after determining whether the loss value is lower than a preset loss value, the method further includes:
[0030] When it is determined that the loss value is not lower than a preset loss value, adjusting the parameters of the image recognition model according to the loss value;
[0031] The image recognition model after adjusting the parameters is trained again using the first target image, and the training is stopped when the loss value is lower than the preset loss value, so as to obtain a trained image recognition model.
[0032] Preferably, the amplifying the images of the data set by using a preset data enhancement algorithm to obtain a preset number of target images includes:
[0033] The images of the data set are subjected to at least one data enhancement processing method of rotation, translation, scaling or flipping to obtain a preset number of target images.
[0034] The present application also provides an image enhancement processing device, which includes:
[0035] An acquisition module, used to acquire a data set; wherein the data set includes multiple images of handwritten numbers;
[0036] An amplification module, used to amplify the images of the data set using a preset data enhancement algorithm to obtain a preset number of target images;
[0037] A classification module is used to classify the target image using a pre-trained digital recognition model to obtain the category of the target image, and to filter out a first target image that is correctly classified and a second target image that is incorrectly classified from the target image;
[0038] A training module, used for obtaining a first weight vector and a feature vector of the first target image of each category, and training a pre-built image recognition model using the first target image according to the first weight vector and the feature vector to obtain a trained image recognition model;
[0039] A prediction module, used to predict the second target image using the trained image recognition model to obtain a prediction result;
[0040] A generating module is used to generate a second weight vector according to the prediction result, and obtain a quality-enhanced training image by multiplying the second weight vector by the second target image.
[0041] The present application also provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any one of the above methods when executing the computer program.
[0042] The present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above methods are implemented.
[0043] The present application provides an image enhancement processing method, device, computer equipment and storage medium, which obtain a data set, amplify the images of the data set using a preset data enhancement algorithm, and obtain a preset number of target images; classify the target images using a pre-trained digital recognition model to obtain the categories of the target images, and screen out the first target images that are correctly classified and the second target images that are incorrectly classified from the target images; obtain the first weight vector and feature vector of the first target image of each category, train a pre-constructed image recognition model using the first target image according to the first weight vector and feature vector, and obtain a trained image recognition model; predict the second target image using the trained image recognition model to obtain a prediction result, and generate a second target image according to the prediction result. A weight vector is formed, and a quality-enhanced training image is obtained after multiplying the second weight vector by the second target image, thereby obtaining a trained image recognition model based on the correctly classified first target image, and the trained image recognition model is used to predict the incorrectly classified second target image, and the incorrectly classified second target image is adjusted based on the prediction result to improve the classification quality of the second target image; in addition, by multiplying the second weight vector by the second target image, the inherent noise in the second target image can be suppressed, and the component that has a negative contribution to the classification can be eliminated, thereby reducing the classification error caused by different writing habits and styles, and obtaining a quality-enhanced training image; at the same time, the present application automatically enhances the image quality through artificial intelligence to improve the efficiency of image enhancement processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 A schematic diagram of a flow chart of an image enhancement processing method according to an embodiment of the present application;
[0045] Figure 2 This is a schematic block diagram of the structure of an image enhancement processing device according to an embodiment of the present application;
[0046] Figure 3 A schematic block diagram of the structure of a computer device according to an embodiment of the present application.
[0047] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0048] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0049] This application proposes an image enhancement processing method, and the embodiments of this application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0050] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0051] An image enhancement processing method proposed in this application uses a server as the execution body. The server can be an independent server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), as well as big data and artificial intelligence platforms.
[0052] This image enhancement processing method is used to improve the quality of the image after data enhancement. Figure 1 In one embodiment, the image enhancement processing method includes:
[0053] S11, obtaining a data set; wherein the data set includes multiple images of handwritten numbers;
[0054] S12, amplifying the images of the data set using a preset data enhancement algorithm to obtain a preset number of target images;
[0055] S13, classifying the target image using a pre-trained digital recognition model to obtain the category of the target image, and screening out a first target image that is correctly classified and a second target image that is incorrectly classified from the target image;
[0056] S14, obtaining a first weight vector and a feature vector of the first target image of each category, and training a pre-built image recognition model using the first target image according to the first weight vector and the feature vector to obtain a trained image recognition model;
[0057] S15, predicting the second target image using the trained image recognition model to obtain a prediction result;
[0058] S16. Generate a second weight vector according to the prediction result, and multiply the second weight vector by the second target image to obtain a quality-enhanced training image.
[0059] In this embodiment, the generalization ability of the model can be improved and overfitting can be reduced by using data enhancement, but most of the existing data enhancement methods adjust the spatial position and size of the target by simple rotation and translation. However, in the data set we obtained, people from different regions have different writing styles, and there are also situations such as conjoined words and background noise, which increases the difficulty of model recognition. Therefore, this application can improve the quality of the image by fine-tuning and modifying the data through certain technical methods to improve the classification accuracy of the model.
[0060] Specifically, as described in step S11 above, the data set includes multiple images of handwritten numbers, such as handwritten Roman numerals. Although there are only 10 types of handwritten Roman numerals, the recognition accuracy is still quite high in most application scenarios because it is often used in finance and other aspects.
[0061] As described in step S12 above, in the dataset of handwritten Roman numerals, the total number of images in each dataset is about 200, so it will be time-consuming and laborious to evaluate and modify the data quality by manual methods, and it is also impossible to implement automated online applications. Therefore, this embodiment requires a preset data enhancement algorithm to amplify the images of the dataset to obtain a preset number of target images.
[0062] Data enhancement methods may include rotation, translation, mirroring, scaling, etc. You can use one of these data enhancement methods or combine multiple data enhancement methods to expand the data set to 2,000 images to provide enough training samples to avoid overfitting of the network during training.
[0063] As described in the above step S13, this embodiment uses a pre-trained digital recognition model to classify the target image after data enhancement processing, and can find out the first target image that is correctly classified and the second target image that is incorrectly classified in the target image by manual screening or machine screening.
[0064] For example, although there are 10 types of handwritten Roman numerals, a pre-trained digital recognition model can be used to classify the target image according to these 10 types, and the first target image that is correctly classified and the second target image that is incorrectly classified can be found out through manual screening or machine screening.
[0065] As described in step S14 above, the first target image of each category corresponds to a unique first weight vector, such as the first weight vector with the number 1 corresponds to a1, the first weight vector with the number 2 corresponds to a2, and so on; the feature vector of the first target image is generated based on its feature information. In this embodiment, the first weight vector and feature vector of the first target image of each category can be obtained. According to the first weight vector and feature vector, the pre-constructed image recognition model is trained using the first target image to obtain a trained image recognition model. After the image recognition model is trained, the cross entropy loss function can be used to calculate the loss value of the trained image recognition model. When the loss value meets the requirements, the trained image recognition model is obtained.
[0066] Among them, cross entropy is used to measure the difference between two probability distributions, and the cross entropy loss function is used to measure the error between the final performance prediction probability and the actual performance. The smaller the cross entropy loss function of the image recognition model, the smaller the fitness, and the better the prediction effect of the performance prediction method.
[0067] For the correctly classified data, we believe that they have good distribution consistency, so we first use this part of the data to train the image recognition model and obtain the weight vector of each category to find the features that have a decisive influence on the classification results. Among them, the image recognition model is the convolutional dynamic alignment network (Dynamic Alignment Network, DAU). Since the convolutional dynamic alignment network will align the weights with the input feature vector during training, we can get the input feature vector by visualizing the network weights.
[0068] As described in the above steps S15-S16, this embodiment can use the trained image recognition model to predict the misclassified second target image to obtain a prediction result, which includes information such as the misclassified image location and the cause of the misclassification. A second weight vector is generated based on the prediction result, and the second weight vector is multiplied by the second target image to obtain a quality-enhanced training image, thereby suppressing the inherent noise in the second target image and obtaining a quality-enhanced second target image.
[0069] For the first target image that is correctly classified, it is directly amplified using methods such as mirroring, scaling, and rotation, so that the total amount of amplified data is twice the original amount, and the amplified first target image is added to the training image to obtain a higher quality training image.
[0070] The present application provides an image enhancement processing method, which obtains a data set, amplifies the images of the data set using a preset data enhancement algorithm, and obtains a preset number of target images; classifies the target images using a pre-trained digital recognition model to obtain the categories of the target images, and screens out the first target images that are correctly classified and the second target images that are incorrectly classified from the target images; obtains a first weight vector and a feature vector of the first target image of each category, and trains a pre-constructed image recognition model using the first target image according to the first weight vector and the feature vector to obtain a trained image recognition model; predicts the second target image using the trained image recognition model to obtain a prediction result, generates a second weight vector according to the prediction result, and converts the first target image into a second target image; After multiplying the two weight vectors with the second target image, a quality-enhanced training image is obtained, so that a trained image recognition model is obtained based on the correctly classified first target image, and the trained image recognition model is used to predict the incorrectly classified second target image, and the incorrectly classified second target image is adjusted based on the prediction result to improve the classification quality of the second target image; in addition, by multiplying the second weight vector with the second target image, the inherent noise in the second target image can be suppressed, and the components that have a negative contribution to the classification can be eliminated, thereby reducing the classification errors caused by different writing habits and styles, and obtaining a quality-enhanced training image; at the same time, the present application automatically enhances image quality through artificial intelligence to improve the efficiency of image enhancement processing.
[0071] In one embodiment, obtaining the first weight vector and the feature vector of the first target image of each category may specifically include:
[0072] According to the category of the first target image, a corresponding weight vector is searched from a pre-constructed comparison table to obtain a first weight vector; wherein the comparison table records the weight vector corresponding to each category of the image;
[0073] Acquire feature information of the first target image, convert the feature information into a vector form, and obtain a feature vector of the first target image.
[0074] In this embodiment, a comparison table may be pre-constructed to record the weight vector corresponding to each category of images, such as a1 corresponding to the weight vector with the number 1, a2 corresponding to the first weight vector with the number 2, and so on. Then, according to the category of the first target image, the corresponding weight vector is queried from the pre-constructed comparison table to obtain the first weight vector.
[0075] In addition, this embodiment can obtain feature information of the first target image, the feature information includes the appearance of handwritten numbers, differences from standard numbers, etc., and convert the feature information into a vector form to obtain a feature vector of the first target image. For example, a certain numerical value is assigned to each type of feature information as a feature value according to a preset rule, and the feature values of multiple feature information are combined to obtain the feature vector of the first target image.
[0076] In one embodiment, acquiring feature information of the first target image, converting the feature information into a vector form, and obtaining a feature vector of the first target image may specifically include:
[0077] When it is determined that there are multiple first target images, obtaining all feature information of each of the first target images;
[0078] Calculating the frequency of occurrence of each of the feature information in the plurality of the first target images;
[0079] Filter out the feature information with the highest frequency from all the feature information to obtain target feature information;
[0080] The target feature information is converted into a vector form to obtain feature vectors of a plurality of the first target images.
[0081] This embodiment explains the results by finding the most frequent eigenvectors in multiple first target images. Specifically, although handwritten numbers may differ due to different personal writing habits, the form of the numbers has standardized standards, that is, people will not mistake the number Ⅱ for Ⅴ. Therefore, this embodiment will further explore the potential consistency between different categories of data, that is, it is hoped to find the most frequent eigenvectors in multiple first target images and use them as the basis for classification. To this end, this embodiment can use a convolutional dynamic alignment network (Dynamic Alignment Network, DAU) to achieve feature matching of different categories. The basic unit of the network consists of a linear operation and a nonlinear norm scaling module. It is hoped that the output of the network is maximized in the corresponding category, similar to the low-order matrix approximation problem. The process of maximizing the network output is equivalent to finding the input eigenvector.
[0082] Therefore, multiple first target images can be input into a convolutional dynamic registration network. In the convolutional dynamic registration network, all feature information of each first target image can be obtained, the frequency of occurrence of each feature information in the multiple first target images can be calculated, the feature information with the highest frequency can be screened out from all the feature information to obtain the target feature information, and the target feature information can be converted into a vector form to obtain the feature vectors of the multiple first target images.
[0083] In one embodiment, generating a second weight vector according to the prediction result may specifically include:
[0084] Determine error information of classification error of the second target image according to the prediction result, and obtain reference error information of the second target image;
[0085] calibrating the second target image according to the reference error information to obtain calibration information;
[0086] The calibration information is converted into a word vector form to obtain the second weight vector.
[0087] This embodiment determines error information of the second target image classification error based on the prediction result, and obtains reference error information of the second target image. For example, if the number 1 is classified as the number 2, the information of the second target image that is similar to the number 2 is used as the reference error information, and the second target image is calibrated according to the reference error information to obtain calibration information. The calibration information is converted into a word vector form to obtain a second weight vector. For example, if the information of the second target image that is similar to the number 2 is adjusted to make it close to the number 1, the calibration information is obtained, and the calibration information is used to adjust the second target image to improve the quality of the second target image.
[0088] In one embodiment, the using the first target image to train a pre-built image recognition model to obtain a trained image recognition model may specifically include:
[0089] Using the first target image to train a pre-built image recognition model to obtain a training result;
[0090] According to the training results, a cross entropy loss function is used to calculate the loss value of the image recognition model after training;
[0091] Determining whether the loss value is lower than a preset loss value;
[0092] When it is determined that the loss value is lower than the preset loss value, a trained image recognition model is obtained.
[0093] In this embodiment, after each training of the image recognition model, a preset loss function can be used to calculate the loss value of the image recognition model after each training is completed, and when the loss value meets the preset threshold or is less than the preset loss value, that is, the requirement is met, it indicates that the image recognition model meets the training requirements, and the training of the image recognition model is completed to improve the recognition effect of the image recognition model. Among them, the loss function is used to evaluate the degree of difference between the predicted value and the true value of the image recognition model. The better the loss function, the better the performance of the image recognition model.
[0094] In one embodiment, after determining whether the loss value is lower than a preset loss value, the following steps may also be performed:
[0095] When it is determined that the loss value is not lower than a preset loss value, adjusting the parameters of the image recognition model according to the loss value;
[0096] The image recognition model after adjusting the parameters is trained again using the first target image, and the training is stopped when the loss value is lower than the preset loss value, so as to obtain a trained image recognition model.
[0097] In this embodiment, when the loss value of the image recognition model is not less than the preset loss value, forward propagation can be performed in the neural network structure of the image recognition model according to the loss value, and relevant parameters of the image recognition model can be adjusted. The adjusted image recognition model is retrained based on the reset relevant parameters until the loss value of the image recognition model is less than the preset loss value. At this point, the image recognition model training is completed, and an image recognition model whose training results meet the requirements is obtained, thereby obtaining a trained image recognition model.
[0098] In one embodiment, the amplifying the images of the data set by using a preset data enhancement algorithm to obtain a preset number of target images may specifically include:
[0099] The images of the data set are subjected to at least one data enhancement processing method of rotation, translation, scaling or flipping to obtain a preset number of target images.
[0100] In this embodiment, the data enhancement processing method can be one of rotating, translating, scaling or flipping the image of the data set, or it can be a combination of multiple data enhancement processing methods to perform data amplification on the image of the data set to obtain a preset number of target images. For example, the image can be first rotated according to a preset angle, and then the rotated target can be flipped to obtain a target image.
[0101] In one embodiment, when the size ratio of the target object in the image is greater than the preset size ratio, the data enhancement processing mode at this time is generally an operation mode that does not make large-scale adjustments to the image, and generally only fine-tunes the image, such as reducing the image by a scaling ratio less than the preset scaling ratio, randomly flipping horizontally, randomly flipping vertically, randomly adjusting the brightness and contrast of the image, rotating at an angle less than a preset angle, or randomly adjusting the color of the target object. The target object may be a pedestrian, a face, etc.
[0102] Reference Figure 2 In an embodiment of the present application, an image enhancement processing device is also provided, comprising:
[0103] An acquisition module 11 is used to acquire a data set; wherein the data set includes multiple images of handwritten numbers;
[0104] An amplification module 12 is used to amplify the images of the data set using a preset data enhancement algorithm to obtain a preset number of target images;
[0105] The classification module 13 is used to classify the target image using a pre-trained digital recognition model to obtain the category of the target image, and to filter out the first target image that is correctly classified and the second target image that is incorrectly classified from the target image;
[0106] A training module 14 is used to obtain a first weight vector and a feature vector of the first target image of each category, and train a pre-built image recognition model using the first target image according to the first weight vector and the feature vector to obtain a trained image recognition model;
[0107] A prediction module 15, configured to predict the second target image using the trained image recognition model to obtain a prediction result;
[0108] The generating module 16 is used to generate a second weight vector according to the prediction result, and obtain a quality-enhanced training image by multiplying the second weight vector by the second target image.
[0109] In this embodiment, the generalization ability of the model can be improved and overfitting can be reduced by using data enhancement, but most of the existing data enhancement methods adjust the spatial position and size of the target by simple rotation and translation. However, in the data set we obtained, people from different regions have different writing styles, and there are also situations such as conjoined words and background noise, which increases the difficulty of model recognition. Therefore, this application can improve the quality of the image by fine-tuning and modifying the data through certain technical methods to improve the classification accuracy of the model.
[0110] Specifically, the dataset includes multiple images of handwritten numbers, such as handwritten Roman numerals. Although there are only 10 types of handwritten Roman numerals, the recognition accuracy is still quite high in most application scenarios because it is often used in finance and other aspects.
[0111] In the dataset of handwritten Roman numerals, the total number of images in each dataset is about 200, so it would be time-consuming and laborious to evaluate and modify the data quality by manual methods, and it is also impossible to implement automated online applications. Therefore, this embodiment requires a preset data enhancement algorithm to amplify the images in the dataset to obtain a preset number of target images.
[0112] Data enhancement methods may include rotation, translation, mirroring, scaling, etc. You can use one of these data enhancement methods or combine multiple data enhancement methods to expand the data set to 2,000 images to provide enough training samples to avoid overfitting of the network during training.
[0113] This embodiment uses a pre-trained digital recognition model to classify the target image after data enhancement processing, and can find out the first target image that is correctly classified and the second target image that is incorrectly classified in the target image through manual screening or machine screening.
[0114] For example, although there are 10 types of handwritten Roman numerals, a pre-trained digital recognition model can be used to classify the target image according to these 10 types, and the first target image that is correctly classified and the second target image that is incorrectly classified can be found out through manual screening or machine screening.
[0115] The first target image of each category corresponds to a unique first weight vector, such as the first weight vector with the number 1 corresponds to a1, the first weight vector with the number 2 corresponds to a2, and so on; the feature vector of the first target image is generated based on its feature information. In this embodiment, the first weight vector and feature vector of the first target image of each category can be obtained. According to the first weight vector and feature vector, the pre-constructed image recognition model is trained using the first target image to obtain a trained image recognition model. After the image recognition model is trained, the cross entropy loss function can be used to calculate the loss value of the trained image recognition model. When the loss value meets the requirements, the trained image recognition model is obtained.
[0116] Among them, cross entropy is used to measure the difference between two probability distributions, and the cross entropy loss function is used to measure the error between the final performance prediction probability and the actual performance. The smaller the cross entropy loss function of the image recognition model, the smaller the fitness, and the better the prediction effect of the performance prediction method.
[0117] For the correctly classified data, we believe that they have good distribution consistency, so we first use this part of the data to train the image recognition model and obtain the weight vector of each category to find the features that have a decisive influence on the classification results. Among them, the image recognition model is the convolutional dynamic alignment network (Dynamic Alignment Network, DAU). Since the convolutional dynamic alignment network will align the weights with the input feature vector during training, we can get the input feature vector by visualizing the network weights.
[0118] In this embodiment, a trained image recognition model can be used to predict the misclassified second target image to obtain a prediction result, which includes information such as the misclassified image location and the cause of the misclassification. A second weight vector is generated according to the prediction result, and the second weight vector is multiplied by the second target image to obtain a quality-enhanced training image, thereby suppressing inherent noise in the second target image and obtaining a quality-enhanced second target image.
[0119] For the first target image that is correctly classified, it is directly amplified using methods such as mirroring, scaling, and rotation, so that the total amount of amplified data is twice the original amount, and the amplified first target image is added to the training image to obtain a higher quality training image.
[0120] As described above, it can be understood that the various components of the image enhancement processing device proposed in the present application can realize the functions of any one of the image enhancement processing methods described above, and the specific structure will not be repeated.
[0121] Reference Figure 3 In the embodiment of the present application, a computer device is also provided, whose internal structure can be as follows Figure 3 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor designed by the computer is used to provide computing and control capabilities. The memory of the computer device includes a storage medium and an internal memory. The storage medium stores an operating system, a computer program and a database. The memory provides an environment for the operation of the operating system and the computer program in the storage medium. The database of the computer device is used to store relevant data of the image enhancement processing method. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, an image enhancement processing method is implemented.
[0122] The processor executes the image enhancement processing method, including:
[0123] Acquire a data set; wherein the data set includes multiple images of handwritten numbers;
[0124] Amplifying the images of the data set using a preset data enhancement algorithm to obtain a preset number of target images;
[0125] Using a pre-trained digital recognition model to classify the target image, obtain the category of the target image, and screen out a first target image that is correctly classified and a second target image that is incorrectly classified from the target image;
[0126] Obtaining a first weight vector and a feature vector of the first target image of each category, and training a pre-built image recognition model using the first target image according to the first weight vector and the feature vector to obtain a trained image recognition model;
[0127] Using the trained image recognition model to predict the second target image to obtain a prediction result;
[0128] A second weight vector is generated according to the prediction result, and the second weight vector is multiplied by the second target image to obtain a quality-enhanced training image.
[0129] An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, an image enhancement processing method is implemented, including the steps of:
[0130] Acquire a data set; wherein the data set includes multiple images of handwritten numbers;
[0131] Amplifying the images of the data set using a preset data enhancement algorithm to obtain a preset number of target images;
[0132] Using a pre-trained digital recognition model to classify the target image, obtain the category of the target image, and screen out a first target image that is correctly classified and a second target image that is incorrectly classified from the target image;
[0133] Obtaining a first weight vector and a feature vector of the first target image of each category, and training a pre-built image recognition model using the first target image according to the first weight vector and the feature vector to obtain a trained image recognition model;
[0134] Using the trained image recognition model to predict the second target image to obtain a prediction result;
[0135] A second weight vector is generated according to the prediction result, and the second weight vector is multiplied by the second target image to obtain a quality-enhanced training image.
[0136] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media provided in the present application and used in the embodiments can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double-speed data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0137] In summary, the greatest beneficial effects of this application are:
[0138] The present application provides an image enhancement processing method, device, computer equipment and storage medium, which obtain a data set, amplify the images of the data set using a preset data enhancement algorithm, and obtain a preset number of target images; classify the target images using a pre-trained digital recognition model to obtain the categories of the target images, and screen out the first target images that are correctly classified and the second target images that are incorrectly classified from the target images; obtain the first weight vector and feature vector of the first target image of each category, train a pre-constructed image recognition model using the first target image according to the first weight vector and feature vector, and obtain a trained image recognition model; predict the second target image using the trained image recognition model to obtain a prediction result, and generate a second target image according to the prediction result. A weight vector is formed, and a quality-enhanced training image is obtained after multiplying the second weight vector by the second target image, thereby obtaining a trained image recognition model based on the correctly classified first target image, and the trained image recognition model is used to predict the incorrectly classified second target image, and the incorrectly classified second target image is adjusted based on the prediction result to improve the classification quality of the second target image; in addition, by multiplying the second weight vector by the second target image, the inherent noise in the second target image can be suppressed, and the component that has a negative contribution to the classification can be eliminated, thereby reducing the classification error caused by different writing habits and styles, and obtaining a quality-enhanced training image; at the same time, the present application automatically enhances the image quality through artificial intelligence to improve the efficiency of image enhancement processing.
[0139] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, device, article or method including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, device, article or method. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, device, article or method including the element.
[0140] The above description is only a preferred embodiment of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. An image enhancement processing method, characterized in that: include: Acquire a data set; wherein the data set includes multiple images of handwritten numbers; Amplifying the images of the data set using a preset data enhancement algorithm to obtain a preset number of target images; Using a pre-trained digital recognition model to classify the target image, obtain the category of the target image, and screen out a first target image that is correctly classified and a second target image that is incorrectly classified from the target image; Obtaining a first weight vector and a feature vector of the first target image of each category, and training a pre-built image recognition model using the first target image according to the first weight vector and the feature vector to obtain a trained image recognition model; Using the trained image recognition model to predict the second target image to obtain a prediction result; generating a second weight vector according to the prediction result, and multiplying the second weight vector by the second target image to obtain a quality-enhanced training image; The obtaining of the first weight vector and the feature vector of the first target image of each category includes: According to the category of the first target image, a corresponding weight vector is searched from a pre-constructed comparison table to obtain a first weight vector; wherein the comparison table records the weight vector corresponding to each category of the image; Acquire feature information of the first target image, convert the feature information into a vector form, and obtain a feature vector of the first target image; The step of acquiring feature information of the first target image and converting the feature information into a vector form to obtain a feature vector of the first target image includes: When it is determined that there are multiple first target images, obtaining all feature information of each of the first target images; Calculating the frequency of occurrence of each of the feature information in the plurality of the first target images; Filter out the feature information with the highest frequency from all the feature information to obtain target feature information; Converting the target feature information into a vector form to obtain feature vectors of a plurality of the first target images; The generating a second weight vector according to the prediction result comprises: Determine error information of classification error of the second target image according to the prediction result, and obtain reference error information of the second target image; calibrating the second target image according to the reference error information to obtain calibration information; The calibration information is converted into a word vector form to obtain the second weight vector.
2. The method according to claim 1, characterized in that The step of training a pre-built image recognition model using the first target image to obtain a trained image recognition model includes: Using the first target image to train a pre-built image recognition model to obtain a training result; According to the training results, a cross entropy loss function is used to calculate the loss value of the image recognition model after training; Determining whether the loss value is lower than a preset loss value; When it is determined that the loss value is lower than the preset loss value, a trained image recognition model is obtained.
3. The method according to claim 2, characterized in that After determining whether the loss value is lower than the preset loss value, the method further includes: When it is determined that the loss value is not lower than a preset loss value, adjusting the parameters of the image recognition model according to the loss value; The image recognition model after adjusting the parameters is trained again using the first target image, and the training is stopped when the loss value is lower than the preset loss value, so as to obtain a trained image recognition model.
4. The method according to claim 1, characterized in that: The method of amplifying the images of the data set by using a preset data enhancement algorithm to obtain a preset number of target images includes: The images of the data set are subjected to at least one data enhancement processing method of rotation, translation, scaling or flipping to obtain a preset number of target images.
5. An image enhancement processing device, used to implement the method according to any one of claims 1 to 4, characterized in that: include: An acquisition module, used to acquire a data set; wherein the data set includes multiple images of handwritten numbers; An amplification module, used to amplify the images of the data set using a preset data enhancement algorithm to obtain a preset number of target images; A classification module is used to classify the target image using a pre-trained digital recognition model to obtain the category of the target image, and to filter out a first target image that is correctly classified and a second target image that is incorrectly classified from the target image; A training module, used for obtaining a first weight vector and a feature vector of the first target image of each category, and training a pre-built image recognition model using the first target image according to the first weight vector and the feature vector to obtain a trained image recognition model; A prediction module, used to predict the second target image using the trained image recognition model to obtain a prediction result; A generating module is used to generate a second weight vector according to the prediction result, and obtain a quality-enhanced training image by multiplying the second weight vector by the second target image.
6. A computer device, characterized in that: include: processor; Memory; The memory stores a computer program, and the processor implements the image enhancement processing method according to any one of claims 1 to 4 when executing the computer program.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the image enhancement processing method according to any one of claims 1 to 4.
