CN114549932A - Data enhancement processing method and device, computer equipment and storage medium - Google Patents

Data enhancement processing method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN114549932A
CN114549932A CN202210158191.9A CN202210158191A CN114549932A CN 114549932 A CN114549932 A CN 114549932A CN 202210158191 A CN202210158191 A CN 202210158191A CN 114549932 A CN114549932 A CN 114549932A
Authority
CN
China
Prior art keywords
data
target
data enhancement
data set
training
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210158191.9A
Other languages
Chinese (zh)
Inventor
郑喜民
翟尤
舒畅
陈又新
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN202210158191.9A priority Critical patent/CN114549932A/en
Priority to PCT/CN2022/090165 priority patent/WO2023155298A1/en
Publication of CN114549932A publication Critical patent/CN114549932A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/217Validation; Performance evaluation; Active pattern learning techniques
    • G06F18/2178Validation; Performance evaluation; Active pattern learning techniques based on feedback of a supervisor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Abstract

The application provides a data enhancement processing method, a device, computer equipment and a storage medium for the technical field of a neural network of an artificial intelligence technology, wherein the method comprises the following steps: dividing the data set into a plurality of subdata sets, selecting different data enhancement strategies for each subdata set, and respectively performing data enhancement processing on the corresponding subdata sets according to the first data enhancement strategy of each subdata set to obtain a target subdata set; respectively inputting each target subdata set into a preset neural network model for training, mutually comparing a plurality of training results, and screening out a target training result with the optimal training effect; and determining a target data enhancement strategy corresponding to the target training result, acquiring a total data set, calling the target data enhancement strategy to perform data enhancement processing on all data in the total data set to obtain the target data set, and selecting an optimal data enhancement strategy to perform data enhancement processing on the total data set, so that the overall effect of the data enhancement processing is improved.

Description

Data enhancement processing method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of neural network technology of artificial intelligence technology, and in particular, to a data enhancement processing method and apparatus, a computer device, and a storage medium.
Background
Data enhancement refers to adjusting data by using methods such as cutting, reversing, segmenting, rotating, zooming, shifting and the like before training of a neural network, and increasing the number of data to increase a training set so as to obtain a better training result.
In the field of neural network technology, almost all tasks are subjected to data enhancement by using some methods before starting, and a large number of experimental results prove that the data enhancement method indeed improves the final training result. However, in the existing data enhancement processing method, the adopted data enhancement strategies are various, and the data enhancement processing effects are uneven, so that the overall effect of data enhancement processing is poor.
Disclosure of Invention
The present application mainly aims to provide a data enhancement processing method, device, computer equipment and storage medium, so as to improve the overall effect of data enhancement processing.
In order to achieve the above object, the present application provides a data enhancement processing method, including:
acquiring a data set, and dividing the data set into at least two subdata sets;
selecting different data enhancement strategies for each subdata set to obtain a first data enhancement strategy of each subdata set;
respectively carrying out data enhancement processing on the corresponding sub data sets according to the first data enhancement strategy of each sub data set to obtain a target sub data set after enhancement processing of each sub data set;
inputting each target subdata set into a preset neural network model for training to obtain a plurality of training results;
comparing the training results with each other, and screening out the training result with the optimal training effect from the training results to obtain a target training result;
determining a first data enhancement strategy corresponding to the target training result to obtain a target data enhancement strategy;
and acquiring a total data set, and calling the target data enhancement strategy to perform data enhancement processing on all data in the total data set to obtain a target data set.
Preferably, the selecting a different data enhancement policy for each of the sub data sets includes:
when the subdata set is determined to comprise a sample picture, and the size proportion of a target object in the sample picture is determined to be larger than a preset size proportion, selecting a first data enhancement strategy for the data set of the sample picture;
the first data enhancement strategy is any one of reducing the sample picture according to a scaling ratio smaller than a preset scaling ratio, randomly turning horizontally, randomly turning vertically, randomly adjusting the brightness and contrast of the picture, rotating according to an angle smaller than a preset angle, or randomly adjusting the color of the target object.
Preferably, the determining the size ratio of the target object in the sample picture includes:
counting the number of all pixel points of the target object in the sample picture to obtain the number of first pixel points;
counting the number of all pixel points of the sample picture to obtain the total number of the pixel points;
and dividing the number of the first pixel points by the number of the total pixel points to obtain the size proportion of the target object.
Preferably, the rotating at an angle smaller than a preset angle includes:
determining an original image frame of the sample image;
rotating the sample picture in the original image frame according to the angle to obtain a first sample picture;
and filling black pixel values in the blank area in the first sample picture to obtain a rotated target sample picture.
Preferably, the randomly adjusting the brightness and the contrast of the picture includes:
calculating the average value of all pixel points in the sample picture to obtain a pixel average value;
respectively subtracting the pixel mean value from the pixel value of each pixel point in the sample picture to obtain a pixel difference value of each pixel point;
multiplying the pixel difference value of each pixel point by a preset contrast coefficient, and respectively adding the pixel difference value and the pixel mean value to obtain a first pixel value of each pixel point;
and multiplying the first pixel value of each pixel point by a preset brightness coefficient to obtain a target pixel value of each pixel point, and taking a sample picture formed by the target pixel values as a target sample picture after the brightness and the contrast of the picture are randomly adjusted.
In an embodiment, the reducing the sample picture according to a scaling smaller than a preset scaling includes:
and based on a bilinear interpolation algorithm, reducing the sample picture according to a scaling smaller than a preset scaling to obtain a reduced target sample picture.
Preferably, the comparing the plurality of training results with each other, and screening out the training result with the optimal training effect from the plurality of training results to obtain the target training result includes:
based on a preset loss function, correspondingly calculating a loss value of the neural network model after each target subdata set is trained according to each training result to obtain a loss value of each training result;
and screening out the training result with the minimum loss value from the loss values of all the training results to obtain a target training result.
The present application also provides a data enhancement processing apparatus, which includes:
the acquisition module is used for acquiring a data set and dividing the data set into at least two subdata sets;
a selecting module, configured to select a different data enhancement policy for each sub data set, to obtain a first data enhancement policy for each sub data set;
the data enhancement processing module is used for respectively carrying out data enhancement processing on the corresponding sub data sets according to the first data enhancement strategy of each sub data set to obtain a target sub data set enhanced by each sub data set;
the training module is used for inputting each target subdata set into a preset neural network model for training to obtain a plurality of training results;
the screening module is used for comparing the training results with each other, screening out the training result with the optimal training effect from the training results, and obtaining a target training result;
the determining module is used for determining a first data enhancement strategy corresponding to the target training result to obtain a target data enhancement strategy;
and the calling module is used for acquiring a total data set, calling the target data enhancement strategy to perform data enhancement processing on all data in the total data set, and obtaining a target data set.
The present application further provides a computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the steps of any of the above methods when executing the computer program.
The present application also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of any of the methods described above.
The data enhancement processing method, the data enhancement processing device, the computer equipment and the storage medium obtain a data set, divide the data set into at least two sub data sets, and select different data enhancement strategies for each sub data set to obtain a first data enhancement strategy of each sub data set; respectively carrying out data enhancement processing on the corresponding subdata sets according to the first data enhancement strategy of each subdata set to obtain a target subdata set subjected to enhancement processing on each subdata set; respectively inputting each target subdata set into a preset neural network model for training to obtain a plurality of training results, mutually comparing the plurality of training results, and screening out a training result with the optimal training effect from the plurality of training results to obtain a target training result; determining a first data enhancement strategy corresponding to a target training result to obtain a target data enhancement strategy, acquiring a total data set, calling the target data enhancement strategy to perform data enhancement processing on all data in the total data set to obtain the target data set, so that the data set is divided into a plurality of sub-data sets, a targeted data enhancement strategy is selected according to the characteristics of the data set, the data enhancement strategies of the sub-data sets are compared, an optimal data enhancement strategy is selected to perform data enhancement processing on the total data set, the calculated amount is reduced, and the overall effect of the data enhancement processing is improved.
Drawings
Fig. 1 is a schematic flow chart of a data enhancement processing method according to an embodiment of the present application;
FIG. 2 is a block diagram illustrating an exemplary data enhancement apparatus according to an embodiment of the present disclosure;
fig. 3 is a block diagram illustrating a structure of a computer device according to an embodiment of the present application.
The implementation, functional features and advantages of the objectives of the present application will be further explained with reference to the accompanying drawings.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The application provides a data enhancement processing method, and related data can be acquired and processed based on an artificial intelligence technology. Among them, Artificial Intelligence (AI) is a theory, method, technique and application system that simulates, extends and expands human Intelligence using a digital computer or a machine controlled by a digital computer, senses the environment, acquires knowledge and uses the knowledge to obtain the best result.
The artificial intelligence infrastructure generally includes technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation/interaction systems, mechatronics, and the like. The artificial intelligence software technology mainly comprises a computer vision technology, a robot technology, a biological recognition technology, a voice processing technology, a natural language processing technology, machine learning/deep learning and the like.
The data enhancement processing method provided by the application takes a server as an execution main body, wherein the server can be an independent server, and can also be a cloud server for providing basic cloud computing services such as cloud service, a cloud database, cloud computing, a cloud function, cloud storage, Network service, cloud communication, middleware service, domain name service, safety service, Content Delivery Network (CDN), big data and an artificial intelligence platform.
The data enhancement processing method is used for solving the technical problems that the overall effect of data enhancement processing is poor due to various data enhancement strategies and different data enhancement processing effects adopted in the prior art. Referring to fig. 1, in one embodiment, the data enhancement processing method includes:
s11, acquiring a data set, and dividing the data set into at least two sub data sets;
s12, selecting different data enhancement strategies for each subdata set to obtain a first data enhancement strategy of each subdata set;
s13, respectively performing data enhancement processing on the corresponding sub data sets according to the first data enhancement strategy of each sub data set to obtain a target sub data set after enhancement processing of each sub data set;
s14, inputting each target subdata set into a preset neural network model for training to obtain a plurality of training results;
s15, comparing the training results with each other, and screening out the training result with the optimal training effect from the training results to obtain a target training result;
s16, determining a first data enhancement strategy corresponding to the target training result to obtain a target data enhancement strategy;
and S17, acquiring a total data set, and calling the target data enhancement strategy to perform data enhancement processing on all data in the total data set to obtain a target data set.
As described in step S11, in the present embodiment, the data sets are obtained, the number of the data sets may be small, in order to obtain the optimal data enhancement strategy through screening, and the type of the data sets may be a data set composed of all sample pictures, a data set composed of all texts, a data set composed of all audios, or a data set composed of all videos, so that it is necessary to ensure that the types of the data in the data sets are consistent. Preferably, the data set of the present embodiment is composed of sample pictures, which may be pedestrian images, for identification of pedestrians.
After the data set is obtained, the data volume of the data set is counted, and the data set is averagely divided into at least two sub data sets according to the data volume, where the data volume of each sub data set is substantially the same. For example, when 1000 sample pictures are included in the data set, and the size of each sample picture is consistent, the data set may be divided into two sub data sets, and the number of sample pictures in each sub data set is 500, so as to ensure that the data volume of each sub data set is substantially consistent.
As described in step S12, for data enhancement of the sample picture, the data enhancement strategy may refer to, before training the neural network, adjusting the sample picture by using methods such as cropping, inverting, segmenting, rotating, scaling, and shifting, and increasing the number of sample pictures to increase the training set, so as to obtain a better training result. For data enhancement of a text, the data enhancement strategy may refer to adjusting the text by copying and pasting the text, deleting the text, or inserting a new text before training the neural network, so as to increase the number of the text. Similarly, other types of data enhancement strategies such as video, audio and the like can be set according to the characteristics of the data enhancement strategies, and the aim is to increase the training set so as to obtain a better training result.
In this embodiment, different data enhancement policies are selected for each sub data set, so as to obtain a first data enhancement policy for each sub data set. For example, assuming that the data set is a data set of a sample picture and the data set is divided into three sub-data sets a, b, and c, a data enhancement strategy for randomly rotating the image is performed in the sub-data set a to rotate the original sample picture to a certain angle; a data enhancement strategy for randomly adjusting the brightness in the data set b; a data enhancement strategy of adding simulated illumination is performed in the data set c, such that for each subdata set, one data enhancement strategy is used, each data enhancement strategy being different.
In an embodiment, a corresponding data enhancement policy may also be selected according to characteristics of data in each sub-data set. For example, when the data in the sub-data set is characterized by a face image and the definition of the face image is low, a data enhancement strategy for improving the definition of the face image can be selected; for another example, when the data in the sub-data set is characterized by an incomplete face image, a data enhancement strategy for automatically supplementing the face image may be selected, which is not specifically limited herein.
As described in step S13, in this embodiment, the data enhancement processing is performed on the corresponding sub data sets according to the first data enhancement policy of each sub data set, so as to obtain the target sub data set after enhancement processing of each sub data set. For example, randomly rotating the sub data set a to obtain a target sub data set a rotated to a certain angle; randomly adjusting the brightness of the data set B to obtain a target subdata set B with preset brightness; and (4) increasing simulated illumination on the data set C to obtain a target subdata set C so as to obtain a target subdata set after enhancement processing of each subdata set.
As described in the above steps S14-S16, the present embodiment selects a corresponding neural network model according to the type of data in the data set, for example, when the type of data in the data set is a picture, the neural network model is a picture processing model; when the type of data in the dataset is text, then the neural network model is a text recognition model, and so on.
In this embodiment, the target sub data set after data enhancement processing is input into a preset neural network model for training, a training result obtained after each target sub data set is trained on the corresponding neural network model is obtained, so as to obtain a plurality of training results, then the plurality of training results are compared in pairs, a training result with the optimal training effect is screened out from the plurality of training results, a target training result is obtained, a first data enhancement strategy corresponding to the target training result is determined, and a target data enhancement strategy is obtained. The evaluation mode of the training result may be evaluation of the processing speed and quality of the neural network model, for example, screening out a training result with a higher processing speed and a higher quality as a target training result.
In the embodiment, an artificial intelligence mode is adopted, the training result with the optimal training result is automatically selected as the target training result, and then the optimal data enhancement strategy is determined, so that the technical problem of low efficiency caused by manual direct design of the data enhancement strategy is avoided.
It should be noted that the neural network model input for each target sub data set is different, so as to avoid the interaction between the training results.
As described in step S17 above, the present embodiment acquires a total data set, which is a data set requiring centralized data enhancement processing, and thus the data amount of the total data set is generally large. And then calling the target data enhancement strategy to perform data enhancement processing on all data in the total data set to obtain a target data set. For example, when the target data enhancement strategy is to rotate the sample picture by a certain angle and then reduce the sample picture, and then perform data enhancement processing on the total data set, the target data enhancement strategy that rotates the sample picture of the total data set by a certain angle and then reduces the sample picture of the total data set is also adopted, so that the overall effect of the data enhancement processing of the total data set is improved, and the uneven data enhancement processing effect is avoided.
The data enhancement processing method includes the steps that a data set is obtained, the data set is divided into at least two sub data sets, different data enhancement strategies are selected for each sub data set, and a first data enhancement strategy of each sub data set is obtained; respectively carrying out data enhancement processing on the corresponding subdata sets according to the first data enhancement strategy of each subdata set to obtain a target subdata set subjected to enhancement processing on each subdata set; respectively inputting each target subdata set into a preset neural network model for training to obtain a plurality of training results, mutually comparing the plurality of training results, and screening out a training result with the optimal training effect from the plurality of training results to obtain a target training result; determining a first data enhancement strategy corresponding to a target training result to obtain a target data enhancement strategy, acquiring a total data set, calling the target data enhancement strategy to perform data enhancement processing on all data in the total data set to obtain the target data set, so that the data set is divided into a plurality of sub-data sets, a targeted data enhancement strategy is selected according to the characteristics of the data set, the data enhancement strategies of the sub-data sets are compared, an optimal data enhancement strategy is selected to perform data enhancement processing on the total data set, the calculated amount is reduced, and the overall effect of the data enhancement processing is improved.
In an embodiment, the selecting a different data enhancement policy for each sub data set may specifically include:
when the subdata set is determined to comprise a sample picture, and the size proportion of a target object in the sample picture is determined to be larger than a preset size proportion, selecting a first data enhancement strategy for the data set of the sample picture;
the first data enhancement strategy is any one of reducing the sample picture according to a scaling ratio smaller than a preset scaling ratio, randomly turning horizontally, randomly turning vertically, randomly adjusting the brightness and contrast of the picture, rotating according to an angle smaller than a preset angle, or randomly adjusting the color of the target object.
In the embodiment, in the general pedestrian re-identification database, the pedestrian body of the sample picture occupies a large part of the picture, even completely occupies the picture. For such sample pictures, the data enhancement processing method that uses large-scale alteration of picture spatial information such as picture cropping and picture inversion may cause the sample pictures to lose identity information directly, that is, the sample pictures cannot be identified directly, and training using a data set including such sample pictures may reduce the work efficiency of the neural network model on the contrary.
Therefore, unlike the requirement of common data enhancement processing, the pedestrian re-identification database does not directly use a method containing large deformation, such as data enhancement strategies like clipping and displacement, during data enhancement processing, carefully uses a method containing local deformation and sets smaller parameters, such as data enhancement strategies like scaling and rotation, and the method for performing data enhancement processing through color change is not limited.
Specifically, when it is determined that the sub data set includes the sample picture and it is determined that the size ratio of the target object in the sample picture is greater than the preset size ratio, a first data enhancement policy is selected for the data set of the sample picture, and the target object may be a pedestrian, a human face, or the like. The first data enhancement policy is a data enhancement policy that does not perform large-scale adjustment on the sample picture, and generally performs fine adjustment on the sample picture, for example, at least one of reduction, random horizontal flipping, random vertical flipping, random adjustment of picture brightness and contrast, rotation at an angle smaller than a preset angle, or random adjustment of a color of the target object is performed on the sample picture according to a scaling ratio smaller than a preset scaling ratio.
Scaling the sample picture in a small proportion, randomly turning the sample picture horizontally and vertically, rotating the sample picture by a small angle, randomly changing the brightness, the contrast and the color of the sample picture, adding simulated illumination to the sample picture and the like. The random level of the sample picture is the operation of carrying out left and right mirror image on the sample picture, and the sample picture can be inverted by vertical overturning to enhance the diversity of the sample picture. The simulated illumination is to simulate an illumination scene in the sample picture and calculate each pixel point in the sample picture.
In an embodiment, the determining the size ratio of the target object in the sample picture may specifically include:
counting the number of all pixel points of the target object in the sample picture to obtain the number of first pixel points;
counting the number of all pixel points of the sample picture to obtain the total number of the pixel points;
and dividing the number of the first pixel points by the number of the total pixel points to obtain the size proportion of the target object.
In this embodiment, all the pixel points of the target object are traversed, the number of all the pixel points of the target object in the sample picture is counted to obtain the number of the first pixel points, the number of all the pixel points of the sample picture is counted to obtain the number of the total pixel points, the ratio of the number of the first pixel points to the number of the total pixel points is calculated, and the ratio is used as the size proportion of the target object.
And then judging whether the size proportion of the target object in the sample picture is larger than a preset size proportion or not, and selecting a first data enhancement strategy for the data set of the sample picture when the size proportion of the target object in the sample picture is determined to be larger than the preset size proportion. The preset size ratio can be set by a user, and is not particularly limited herein, for example, the preset size ratio is set to 80%.
In an embodiment, the rotating according to an angle smaller than the preset angle may specifically include:
determining an original image frame of the sample image;
rotating the sample picture in the original image frame according to the angle to obtain a first sample picture;
and filling black pixel values in the blank area in the first sample picture to obtain a rotated target sample picture.
In this embodiment, an original image frame of a sample image is determined, the sample image is rotated in the original image frame according to an angle to obtain a first sample image, and a blank area is left in the sample image after the rotation, so that the blank area in the first sample image is filled with black pixel values to obtain a rotated target sample image. The black pixel value is 255.
In an embodiment, the randomly adjusting the brightness and the contrast of the picture may specifically include:
calculating the average value of all pixel points in the sample picture to obtain the pixel average value;
respectively subtracting the pixel mean value from the pixel value of each pixel point in the sample picture to obtain a pixel difference value of each pixel point;
multiplying the pixel difference value of each pixel point by a preset contrast coefficient, and respectively adding the pixel difference value and the pixel mean value to obtain a first pixel value of each pixel point;
and multiplying the first pixel value of each pixel point by a preset brightness coefficient to obtain a target pixel value of each pixel point, and taking a sample picture formed by the target pixel values as a target sample picture after the brightness and the contrast of the picture are randomly adjusted.
In this embodiment, first, all pixel points in a sample picture are traversed to obtain pixel values of all pixel points, an average value of all pixel points in the sample picture is calculated according to the pixel values of all pixel points to obtain a pixel mean value, a pixel difference value of each pixel point is obtained after the pixel value of each pixel point in the sample picture is subtracted from the pixel mean value, then the pixel difference value of each pixel point is multiplied by a preset contrast coefficient and added to the pixel mean value to obtain a first pixel value of each pixel point, a target pixel value of each pixel point is obtained after the first pixel value of each pixel point is multiplied by a preset brightness coefficient, and the sample picture formed by the target pixel values is used as a target sample picture after the brightness and the contrast of the picture are randomly adjusted. The preset contrast coefficient and the preset brightness coefficient can be set by self-definition, and are not limited specifically herein.
The embodiment specifically includes the following formula:
C=x–x_mean;
Q=(C*α+C)*β;
wherein x represents the pixel value of any pixel point in the sample picture, x _ mean represents the pixel mean value of all pixel points in the sample picture, alpha is a preset contrast coefficient and has a value range of 0-4, beta is a preset brightness coefficient and has a value range of 0-2.
In an embodiment, the reducing the sample picture according to a scaling smaller than a preset scaling may specifically include:
and based on a bilinear interpolation algorithm, reducing the sample picture according to a scaling smaller than a preset scaling to obtain a reduced target sample picture.
In this embodiment, scaling the sample picture in a smaller proportion may adopt a bilinear interpolation mode, and evaluation of one pixel point depends on values of four adjacent pixel points. The calculation formula of the bilinear interpolation is as follows:
Figure BDA0003513577360000111
Figure BDA0003513577360000112
Figure BDA0003513577360000113
wherein, Q12 and Q22 are x-adjacent upper left and upper right pixel points, the coordinates are (x1, y2), (x2, y2), Q11 and Q21 are x-adjacent lower left and lower right pixel points, the coordinates are (x1, y1), (x2, y 1). f (P) is the final interpolated value.
In an embodiment, the comparing the plurality of training results with each other, and screening out a training result with an optimal training effect from the plurality of training results to obtain a target training result may specifically include:
based on a preset loss function, correspondingly calculating a loss value of the neural network model after each target subdata set is trained according to each training result to obtain a loss value of each training result;
and screening out the training result with the minimum loss value from the loss values of all the training results to obtain a target training result.
In this embodiment, the loss value of each target sub data set after training needs to be smaller than a preset loss value, after each training of the neural network model, the loss value of the neural network model after each training is calculated by using a preset loss function, and when the loss value meets a preset threshold or is smaller than the preset loss value, that is, meets the requirement, it indicates that the neural network model meets the training requirement, and the training of the neural network model is completed. The loss function is used for evaluating the degree of the neural network model with different predicted values and actual values, and the better the loss function is, the better the performance of the neural network model is generally.
When the loss value of any one neural network model is not less than the preset loss value, forward transmission can be performed in the neural network structure of the neural network model according to the loss value, relevant parameters of the neural network model are adjusted, the adjusted neural network model is retrained based on the reset relevant parameters until the loss value of the neural network model is less than the preset loss value, so that training of all the neural network models is finished, the loss value after training of each target sub data set is less than the preset loss value, the loss value with the minimum loss value is screened out as the target loss value, and the training result corresponding to the target loss value is used as the target training result.
Referring to fig. 2, an embodiment of the present application further provides a data enhancement processing apparatus, including:
an obtaining module 11, configured to obtain a data set, and divide the data set into at least two sub data sets;
a selecting module 12, configured to select a different data enhancement policy for each sub data set, to obtain a first data enhancement policy for each sub data set;
a data enhancement processing module 13, configured to perform data enhancement processing on the corresponding sub data sets according to the first data enhancement policy of each sub data set, to obtain a target sub data set after enhancement processing of each sub data set;
the training module 14 is configured to input each target sub-data set into a preset neural network model for training, so as to obtain a plurality of training results;
the screening module 15 is configured to compare the plurality of training results with each other, and screen out a training result with an optimal training effect from the plurality of training results to obtain a target training result;
the determining module 16 is configured to determine a first data enhancement strategy corresponding to the target training result, so as to obtain a target data enhancement strategy;
and the calling module 17 is configured to acquire a total data set, and call the target data enhancement policy to perform data enhancement processing on all data in the total data set to obtain a target data set.
The present embodiment obtains data sets, the number of which may be small, in order to obtain an optimal data enhancement policy through screening, and the type of the data set may be a data set composed entirely of sample pictures, a data set composed entirely of texts, a data set composed entirely of audio, or a data set composed entirely of videos, so that it is necessary to ensure that the types of data in the data sets are consistent. Preferably, the data set of the present embodiment is composed of sample pictures, which may be pedestrian images, for identification of pedestrians.
After the data set is obtained, the data volume of the data set is counted, and the data set is averagely divided into at least two sub data sets according to the data volume, where the data volume of each sub data set is substantially the same. For example, when 1000 sample pictures are included in the data set, and the size of each sample picture is consistent, the data set may be divided into two sub data sets, and the number of sample pictures in each sub data set is 500, so as to ensure that the data volume of each sub data set is substantially consistent.
In this embodiment, for data enhancement of the sample picture, the data enhancement strategy may refer to adjusting the sample picture by using methods such as clipping, inverting, segmenting, rotating, scaling, and shifting before training the neural network, and increasing the number of the sample pictures to increase the training set, so as to obtain a better training result. For data enhancement of a text, the data enhancement strategy may refer to adjusting the text by copying and pasting the text, deleting the text, or inserting a new text before training the neural network, so as to increase the number of the text. Similarly, other types of data enhancement strategies such as video, audio and the like can be set according to the characteristics of the data enhancement strategies, and the aim is to increase the training set so as to obtain a better training result.
In this embodiment, different data enhancement policies are selected for each sub data set, so as to obtain a first data enhancement policy for each sub data set. For example, assuming that the data set is a data set of a sample picture and the data set is divided into three sub-data sets a, b, and c, a data enhancement strategy for randomly rotating the image is performed in the sub-data set a to rotate the original sample picture to a certain angle; a data enhancement strategy for randomly adjusting the brightness in the data set b; a data enhancement strategy of adding simulated illumination is performed in the data set c, such that for each subdata set, one data enhancement strategy is used, each data enhancement strategy being different.
In an embodiment, a corresponding data enhancement policy may also be selected according to characteristics of data in each sub-data set. For example, when the data in the sub-data set is characterized by a face image and the definition of the face image is low, a data enhancement strategy for improving the definition of the face image can be selected; for another example, when the data in the sub-data set is characterized by an incomplete face image, a data enhancement strategy for automatically supplementing the face image may be selected, which is not specifically limited herein.
In this embodiment, data enhancement processing is performed on the corresponding sub data sets according to the first data enhancement policy of each sub data set, so as to obtain a target sub data set after enhancement processing of each sub data set. For example, randomly rotating the sub data set a to obtain a target sub data set a rotated to a certain angle; randomly adjusting the brightness of the data set B to obtain a target subdata set B with preset brightness; and (5) adding simulated illumination to the data set C to obtain a target subdata set C so as to obtain a target subdata set after enhancement processing of each subdata set.
In this embodiment, a corresponding neural network model is selected according to the type of data in the data set, for example, when the type of data in the data set is a picture, the neural network model is a picture processing model; when the type of data in the dataset is text, then the neural network model is a text recognition model, and so on.
In this embodiment, the target sub-data sets after data enhancement processing are input into a preset neural network model for training, a training result obtained after each target sub-data set is trained on the corresponding neural network model is obtained, so as to obtain a plurality of training results, then, the plurality of training results are compared pairwise, a training result with the optimal training effect is screened out from the plurality of training results, a target training result is obtained, a first data enhancement strategy corresponding to the target training result is determined, and a target data enhancement strategy is obtained. The evaluation mode of the training result may be evaluation of the processing speed and quality of the neural network model, for example, screening out a training result with a higher processing speed and a higher quality as a target training result.
In the embodiment, an artificial intelligence mode is adopted, the training result with the optimal training result is automatically selected as the target training result, and then the optimal data enhancement strategy is determined, so that the technical problem of low efficiency caused by manual direct design of the data enhancement strategy is avoided.
It should be noted that the neural network model input for each target sub data set is different, so as to avoid the interaction between the training results.
The present embodiment obtains a total data set, which is a data set requiring centralized data enhancement processing, and thus the data amount of the total data set is generally large. And then calling the target data enhancement strategy to perform data enhancement processing on all data in the total data set to obtain a target data set. For example, when the target data enhancement strategy is to rotate the sample picture by a certain angle and then reduce the sample picture, and then perform data enhancement processing on the total data set, the target data enhancement strategy that rotates the sample picture of the total data set by a certain angle and then reduces the sample picture of the total data set is also adopted, so that the overall effect of the data enhancement processing of the total data set is improved, and the uneven data enhancement processing effect is avoided.
As described above, it can be understood that each component of the data enhancement processing apparatus provided in the present application may implement the function of any one of the data enhancement processing methods described above, and a detailed structure is not described again.
Referring to fig. 3, an embodiment of the present application further provides a computer device, and an internal structure of the computer device may be as shown in fig. 3. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the computer designed processor is used to provide computational and control capabilities. The memory of the computer device comprises 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 computer programs in the storage medium. The database of the computer device is used for storing the related data of the data enhancement processing method. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a data enhancement processing method.
The processor executes the data enhancement processing method, and the method comprises the following steps:
acquiring a data set, and dividing the data set into at least two subdata sets;
selecting different data enhancement strategies for each subdata set to obtain a first data enhancement strategy of each subdata set;
respectively carrying out data enhancement processing on the corresponding sub data sets according to the first data enhancement strategy of each sub data set to obtain a target sub data set after enhancement processing of each sub data set;
inputting each target subdata set into a preset neural network model for training to obtain a plurality of training results;
comparing the training results with each other, and screening out the training result with the optimal training effect from the training results to obtain a target training result;
determining a first data enhancement strategy corresponding to the target training result to obtain a target data enhancement strategy;
and acquiring a total data set, and calling the target data enhancement strategy to perform data enhancement processing on all data in the total data set to obtain a target data set.
An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements a data enhancement processing method, including the steps of:
acquiring a data set, and dividing the data set into at least two subdata sets;
selecting different data enhancement strategies for each subdata set to obtain a first data enhancement strategy of each subdata set;
respectively carrying out data enhancement processing on the corresponding sub data sets according to the first data enhancement strategy of each sub data set to obtain a target sub data set after enhancement processing of each sub data set;
inputting each target subdata set into a preset neural network model for training to obtain a plurality of training results;
comparing the training results with each other, and screening out the training result with the optimal training effect from the training results to obtain a target training result;
determining a first data enhancement strategy corresponding to the target training result to obtain a target data enhancement strategy;
and acquiring a total data set, and calling the target data enhancement strategy to perform data enhancement processing on all data in the total data set to obtain a target data set.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and can include the processes of the embodiments of the methods described above when the computer program is executed. Any reference to memory, storage, database, or other medium provided herein and used in the examples may 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. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), double-rate SDRAM (SSRSDRAM), Enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and bus dynamic RAM (RDRAM).
To sum up, the most beneficial effect of this application lies in:
the data enhancement processing method, the data enhancement processing device, the computer equipment and the storage medium obtain a data set, divide the data set into at least two sub data sets, and select different data enhancement strategies for each sub data set to obtain a first data enhancement strategy of each sub data set; respectively carrying out data enhancement processing on the corresponding subdata sets according to the first data enhancement strategy of each subdata set to obtain a target subdata set subjected to enhancement processing on each subdata set; respectively inputting each target subdata set into a preset neural network model for training to obtain a plurality of training results, mutually comparing the plurality of training results, and screening out a training result with the optimal training effect from the plurality of training results to obtain a target training result; determining a first data enhancement strategy corresponding to a target training result to obtain a target data enhancement strategy, acquiring a total data set, calling the target data enhancement strategy to perform data enhancement processing on all data in the total data set to obtain the target data set, so that the data set is divided into a plurality of sub-data sets, a targeted data enhancement strategy is selected according to the characteristics of the data set, the data enhancement strategies of the sub-data sets are compared, an optimal data enhancement strategy is selected to perform data enhancement processing on the total data set, the calculated amount is reduced, and the overall effect of the data enhancement processing is improved.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, apparatus, article, or method. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, apparatus, article, or method that includes the element.
The above description is only a preferred embodiment of the present application, and not intended to limit the scope of the present application, and all modifications of equivalent structures and equivalent processes, which are made by the contents of the specification and the drawings of the present application, or which are directly or indirectly applied to other related technical fields, are also included in the scope of the present application.

Claims (10)

1. A data enhancement processing method is characterized by comprising the following steps:
acquiring a data set, and dividing the data set into at least two subdata sets;
selecting different data enhancement strategies for each subdata set to obtain a first data enhancement strategy of each subdata set;
respectively carrying out data enhancement processing on the corresponding sub data sets according to the first data enhancement strategy of each sub data set to obtain a target sub data set after enhancement processing of each sub data set;
inputting each target subdata set into a preset neural network model for training to obtain a plurality of training results;
comparing the training results with each other, and screening out the training result with the optimal training effect from the training results to obtain a target training result;
determining a first data enhancement strategy corresponding to the target training result to obtain a target data enhancement strategy;
and acquiring a total data set, and calling the target data enhancement strategy to perform data enhancement processing on all data in the total data set to obtain a target data set.
2. The method of claim 1, wherein selecting a different data enhancement policy for each of the sub data sets comprises:
when the subdata set comprises a sample picture and the size proportion of a target object in the sample picture is larger than a preset size proportion, selecting a first data enhancement strategy for the data set of the sample picture;
the first data enhancement strategy is any one of reducing the sample picture according to a scaling ratio smaller than a preset scaling ratio, randomly turning horizontally, randomly turning vertically, randomly adjusting the brightness and contrast of the picture, rotating according to an angle smaller than a preset angle, or randomly adjusting the color of the target object.
3. The method of claim 2, wherein the determining the size ratio of the object in the sample picture comprises:
counting the number of all pixel points of the target object in the sample picture to obtain the number of first pixel points;
counting the number of all pixel points of the sample picture to obtain the total number of the pixel points;
and dividing the number of the first pixel points by the number of the total pixel points to obtain the size proportion of the target object.
4. The method of claim 2, wherein said rotating by an angle less than a preset angle comprises:
determining an original image frame of the sample image;
rotating the sample picture in the original image frame according to the angle to obtain a first sample picture;
and filling black pixel values in the blank area in the first sample picture to obtain a rotated target sample picture.
5. The method of claim 2, wherein the randomly adjusting the picture brightness and contrast comprises:
calculating the average value of all pixel points in the sample picture to obtain the pixel average value;
respectively subtracting the pixel mean value from the pixel value of each pixel point in the sample picture to obtain a pixel difference value of each pixel point;
multiplying the pixel difference value of each pixel point by a preset contrast coefficient, and respectively adding the pixel difference value and the pixel mean value to obtain a first pixel value of each pixel point;
and multiplying the first pixel value of each pixel point by a preset brightness coefficient to obtain a target pixel value of each pixel point, and taking a sample picture formed by the target pixel values as a target sample picture with the randomly adjusted picture brightness and contrast.
6. The method of claim 2, wherein the reducing the sample picture at a scale smaller than a preset scale comprises:
and based on a bilinear interpolation algorithm, reducing the sample picture according to a scaling smaller than a preset scaling to obtain a reduced target sample picture.
7. The method according to claim 1, wherein comparing the training results with each other, and selecting a training result with an optimal training effect from the training results to obtain a target training result comprises:
based on a preset loss function, correspondingly calculating a loss value of the neural network model after each target subdata set is trained according to each training result to obtain a loss value of each training result;
and screening out the training result with the minimum loss value from the loss values of all the training results to obtain a target training result.
8. A data enhancement processing apparatus, comprising:
the acquisition module is used for acquiring a data set and dividing the data set into at least two subdata sets;
a selecting module, configured to select a different data enhancement policy for each sub data set, to obtain a first data enhancement policy for each sub data set;
the data enhancement processing module is used for respectively carrying out data enhancement processing on the corresponding sub data sets according to the first data enhancement strategy of each sub data set to obtain a target sub data set enhanced by each sub data set;
the training module is used for inputting each target subdata set into a preset neural network model for training to obtain a plurality of training results;
the screening module is used for comparing the training results with each other, screening out the training result with the optimal training effect from the training results, and obtaining a target training result;
the determining module is used for determining a first data enhancement strategy corresponding to the target training result to obtain a target data enhancement strategy;
and the calling module is used for acquiring a total data set, calling the target data enhancement strategy to perform data enhancement processing on all data in the total data set, and obtaining a target data set.
9. A computer device, comprising:
a processor;
a memory;
wherein the memory stores a computer program which, when executed by the processor, implements the data enhancement processing method of any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon a computer program which, when executed by a processor, implements the data enhancement processing method of any one of claims 1 to 7.
CN202210158191.9A 2022-02-21 2022-02-21 Data enhancement processing method and device, computer equipment and storage medium Pending CN114549932A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202210158191.9A CN114549932A (en) 2022-02-21 2022-02-21 Data enhancement processing method and device, computer equipment and storage medium
PCT/CN2022/090165 WO2023155298A1 (en) 2022-02-21 2022-04-29 Data augmentation processing method and apparatus, computer device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210158191.9A CN114549932A (en) 2022-02-21 2022-02-21 Data enhancement processing method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114549932A true CN114549932A (en) 2022-05-27

Family

ID=81676425

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210158191.9A Pending CN114549932A (en) 2022-02-21 2022-02-21 Data enhancement processing method and device, computer equipment and storage medium

Country Status (2)

Country Link
CN (1) CN114549932A (en)
WO (1) WO2023155298A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113642667A (en) * 2021-08-30 2021-11-12 重庆紫光华山智安科技有限公司 Enhancement strategy determination method and device, electronic equipment and storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102300903B1 (en) * 2019-09-18 2021-09-09 주식회사 카카오브레인 Data augmentation method and apparatus, and computer program
US11205099B2 (en) * 2019-10-01 2021-12-21 Google Llc Training neural networks using data augmentation policies
CN111275129A (en) * 2020-02-17 2020-06-12 平安科技(深圳)有限公司 Method and system for selecting image data augmentation strategy
CN113642667B (en) * 2021-08-30 2024-02-02 重庆紫光华山智安科技有限公司 Picture enhancement strategy determination method and device, electronic equipment and storage medium
CN113971644A (en) * 2021-10-29 2022-01-25 际络科技(上海)有限公司 Image identification method and device based on data enhancement strategy selection

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113642667A (en) * 2021-08-30 2021-11-12 重庆紫光华山智安科技有限公司 Enhancement strategy determination method and device, electronic equipment and storage medium
CN113642667B (en) * 2021-08-30 2024-02-02 重庆紫光华山智安科技有限公司 Picture enhancement strategy determination method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
WO2023155298A1 (en) 2023-08-24

Similar Documents

Publication Publication Date Title
Lv et al. Attention guided low-light image enhancement with a large scale low-light simulation dataset
CN109859190B (en) Target area detection method based on deep learning
CN109325532A (en) The image processing method of EDS extended data set under a kind of small sample
CN111611947B (en) License plate detection method, device, equipment and medium
CN110717878B (en) Image fusion method and device, computer equipment and storage medium
CN112184585B (en) Image completion method and system based on semantic edge fusion
CN110135446B (en) Text detection method and computer storage medium
CN110136052B (en) Image processing method and device and electronic equipment
CN110807757A (en) Image quality evaluation method and device based on artificial intelligence and computer equipment
JP2021531571A (en) Certificate image extraction method and terminal equipment
CN111488945A (en) Image processing method, image processing device, computer equipment and computer readable storage medium
CN113012188A (en) Image fusion method and device, computer equipment and storage medium
CN114170227A (en) Product surface defect detection method, device, equipment and storage medium
CN114549932A (en) Data enhancement processing method and device, computer equipment and storage medium
CN116091823A (en) Single-feature anchor-frame-free target detection method based on fast grouping residual error module
CN116630464A (en) Image style migration method and device based on stable diffusion
CN111340025A (en) Character recognition method, character recognition device, computer equipment and computer-readable storage medium
CN115860067B (en) Method, device, computer equipment and storage medium for generating countermeasure network training
JP2023508641A (en) Data augmentation-based matter analysis model learning device and method
CN112465709A (en) Image enhancement method, device, storage medium and equipment
CN111666949A (en) Image semantic segmentation method based on iterative segmentation
CN111275642A (en) Low-illumination image enhancement method based on significant foreground content
CN113014928B (en) Compensation frame generation method and device
JP7362924B2 (en) Data augmentation-based spatial analysis model learning device and method
CN110992371B (en) Portrait segmentation method and device based on priori information and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination