A method and device for deep learning data enhancement of special clothing
Through the GAN-based special clothing deep learning data enhancement method, a large number of special clothing generation images are generated, which solves the problems of low data set collection efficiency and insufficient sample number in the prior art, and improves the accuracy of model training and the diversity of data sets.
Patent Information
- Application Number
- CN202310133216.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-17
- Publication Date
- 2025-06-06
- Estimated Expiration
- 2043-02-17
AI Technical Summary
The existing special clothing detection algorithm requires a large number of manual data sets to be collected during training, which affects the training efficiency and accuracy, especially due to the small number of special clothing samples, the data set distribution scenarios are not wide enough.
A special clothing deep learning data augmentation method based on Generative Adversarial Network (GAN) is adopted to obtain random noise signals and input the special clothing image generation model, generate a large number of special clothing generation images, and build an extended data training set.
It improves the acquisition efficiency and model training accuracy of deep learning data in special clothing, reduces the dependence on manually collecting sample images, and expands the scale and distribution scenarios of the data set.
Smart Images

Figure CN116310631B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a method and device for deep learning data enhancement of special clothing. Background Art
[0002] Algorithms for target detection through deep learning have been widely used in various fields. Target detection algorithms based on deep learning require a large amount of data sets during the training process to improve the recognition accuracy.
[0003] As a target detection algorithm based on supervised learning, the existing special clothing detection algorithm requires large-scale data sets for training, so as to improve the accuracy of the special clothing detection algorithm, so that the final trained model can identify whether the target person is wearing special clothing. Since special clothing is a kind of clothing used in special occasions, there is a problem of small number of samples. When training the existing special clothing detection model, it is necessary to manually collect a large number of data sets by manual means, and it is necessary to ensure that the distribution scenarios of the data sets are as wide as possible, which affects the efficiency and accuracy of model training.
[0004] Therefore, there is an urgent need for a special clothing deep learning data enhancement method and device to solve the above problems. Summary of the invention
[0005] In view of the problems existing in the prior art, the present invention provides a method and device for deep learning data enhancement of special clothing.
[0006] The present invention provides a special clothing deep learning data enhancement method, comprising:
[0007] Get a random noise signal;
[0008] Inputting the random noise signal into a special clothing image generation model to obtain a plurality of special clothing generated images output by the special clothing image generation model, wherein the special clothing image generation model is obtained by training a generative adversarial network using sample special clothing images, wherein the sample special clothing images include a target person wearing special clothing;
[0009] A special clothing deep learning data training set is constructed based on the multiple special clothing generated images and the special clothing sample images.
[0010] According to a special clothing deep learning data enhancement method provided by the present invention, the special clothing image generation model is trained by the following steps:
[0011] Obtaining a preset number of sample special clothing images, and marking each of the sample special clothing images with a real image label, to construct a first sample set;
[0012] Input the randomly generated Gaussian noise into the generator network to obtain the sample special clothing prediction image;
[0013] Training the discriminator network through the sample special clothing prediction image and the first sample set to obtain a discriminator feedback result and a discriminator network with updated parameters;
[0014] According to the feedback result of the discriminator, the parameters of the generator network are updated to obtain a generator network with updated parameters;
[0015] If the training result meets the preset conditions, the special clothing image generation model is obtained; if not, the generator network after the parameter update and the discriminator network after the parameter update are trained until the training result meets the preset conditions.
[0016] According to a special clothing deep learning data enhancement method provided by the present invention, after obtaining a preset number of sample special clothing images, the method further includes:
[0017] Perform image preprocessing and image enhancement processing on each of the sample special clothing images, and construct the first sample set through the processed sample special clothing images.
[0018] According to a special clothing deep learning data enhancement method provided by the present invention, the generator network includes a first fully connected layer, a normalization layer, a second fully connected layer, a first convolutional layer, and a second convolutional layer, wherein the output end of the first fully connected layer is connected to the input end of the normalization layer, the output end of the normalization layer is connected to the input end of the second fully connected layer, the output end of the second fully connected layer is connected to the input end of the first convolutional layer, and the output end of the first convolutional layer is connected to the input end of the second convolutional layer;
[0019] The discriminator network includes a third convolutional layer, a pooling layer, a fourth convolutional layer, a third fully connected layer and a fourth fully connected layer, wherein the output end of the third convolutional layer is connected to the input end of the pooling layer, the output end of the pooling layer is connected to the input end of the fourth convolutional layer, the output end of the fourth convolutional layer is connected to the input end of the third fully connected layer, and the output end of the third fully connected layer is connected to the input end of the fourth fully connected layer.
[0020] According to a special clothing deep learning data enhancement method provided by the present invention, the loss function of the generator network is:
[0021]
[0022] The loss function of the discriminator network is:
[0023]
[0024] Wherein, G represents the generator network, D represents the discriminator network, z represents the input random noise; D(G(z)) represents the judgment probability of the discriminator network on false data, and the false data is the sample special clothing prediction image generated by the generator network according to the input random noise z; x represents the real data; D(x) represents the judgment probability of the discriminator network on the real data, and the real data is the sample special clothing image, and a, b and c are fixed parameters.
[0025] According to a special clothing deep learning data enhancement method provided by the present invention, the special clothing deep learning data training set is constructed according to the plurality of special clothing generated images and the special clothing sample images, comprising:
[0026] Based on a preset generated image ratio, determining a corresponding number of target special clothing generated images from the plurality of special clothing generated images;
[0027] The target special clothing generated image is added to the first sample set to obtain a special clothing deep learning data training set.
[0028] According to a special clothing deep learning data enhancement method provided by the present invention, after constructing a special clothing deep learning data training set according to the plurality of special clothing generated images and the special clothing sample images, the method further includes:
[0029] The target detection model is trained through the special clothing deep learning data training set to obtain the special clothing wearing detection model;
[0030] The image to be identified is input into the special clothing wearing detection model to obtain the special clothing wearing detection result of the target person in the image to be identified.
[0031] The present invention also provides a special clothing deep learning data enhancement device, comprising:
[0032] A signal trigger module, used to obtain a random noise signal;
[0033] An image generation module is used to input the random noise signal into a special clothing image generation model to obtain a plurality of special clothing generated images output by the special clothing image generation model, wherein the special clothing image generation model is obtained by training a generative adversarial network using sample special clothing images, wherein the sample special clothing images include a target person wearing special clothing;
[0034] The data enhancement module is used to construct a special clothing deep learning data training set based on the multiple special clothing generated images and the special clothing sample images.
[0035] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method for deep learning data enhancement of special clothing as described above is implemented.
[0036] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the special clothing deep learning data enhancement methods described above.
[0037] The present invention provides a special clothing deep learning data enhancement method and device, which trains the generator and discriminator in a generative adversarial network, improves the quality of images generated by the generator network, and improves the ability of the discriminator network to judge the authenticity of the generated images, so that the special clothing image generation model finally trained generates a large number of special clothing generated images, thereby achieving the effect of expanding the special clothing deep learning data set, thereby replacing the existing method of manually collecting sample images, and improving the collection efficiency of special clothing deep learning data and the accuracy of model training. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0039] Figure 1 A schematic diagram of the process of the special clothing deep learning data enhancement method provided by the present invention;
[0040] Figure 2 A schematic diagram of the structure of the deep learning data enhancement device for special clothing provided by the present invention;
[0041] Figure 3 This is a schematic structural diagram of an electronic device provided by the present invention. DETAILED DESCRIPTION
[0042] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0043] Special clothing is a kind of clothing with special functions or special purposes, rather than daily wear, such as anti-static clothing, fireproof clothing, welding protective clothing and flame retardant clothing. In some special work scenes, it is necessary to detect the clothing of the target person entering and leaving to ensure that the target person is wearing the corresponding special clothing correctly in the scene. In the existing special clothing detection, deep learning is usually used for target detection. However, in the training process, the collection of data sets is a tedious task. It is necessary to collect video, photos and other image information of relevant targets in the use scenario of the algorithm, and these collection tasks are often collected manually. For example, the existing anti-static clothing detection algorithm is mainly implemented by deep learning models, so a large number of anti-static clothing data sets are required as training samples, and the collected data sets need to cover as many distribution situations as possible, such as the background scene, and the characters wearing anti-static clothing should be as varied as possible, in order to produce a data set that meets the requirements of deep learning training. It cannot be achieved by simply copying the existing data set, and this data set collection step often requires manual shooting of a large number of images, and only limited information data can be obtained.
[0044] The present invention provides a special clothing deep learning data enhancement method based on Generative Adversarial Networks (GAN). In the training process of the existing special clothing detection algorithm, a large number of different target people wearing special clothing images need to be collected. High-quality sample data is generated by the generative adversarial network, which greatly improves the richness of the data. Therefore, a small number (such as hundreds of images) of people wearing special clothing can be used to generate a large number of images of people wearing special clothing synthesized by the generative adversarial network, so as to achieve the effect of expanding the data set, reduce the generalization error, and further improve the training accuracy of the special clothing detection model. It should be noted that the present invention is explained with the anti-static clothing detection algorithm. For the detection algorithms of other types of special clothing, the deep learning data enhancement method provided by the present invention is also applicable.
[0045] Figure 1 A flow chart of the special clothing deep learning data enhancement method provided by the present invention is as follows: Figure 1 As shown, the present invention provides a special clothing deep learning data enhancement method, comprising:
[0046] Step 101: Acquire a random noise signal.
[0047] In the present invention, a random noise signal is first generated. After the random noise signal is input into the special clothing image generation model, the model is used to generate a special clothing generation image.
[0048] Step 102: input the random noise signal into a special clothing image generation model to obtain a plurality of special clothing generated images output by the special clothing image generation model, wherein the special clothing image generation model is obtained by training a generative adversarial network using sample special clothing images, wherein the sample special clothing images include a target person wearing special clothing.
[0049] In the present invention, an anti-static clothing image generation model is used for illustration. After receiving a random noise signal, the model can generate a large number of anti-static clothing images, thereby expanding the existing anti-static clothing data set. Specifically, in the present invention, the anti-static clothing deep learning data enhancement method based on the generative adversarial network is composed of two networks, namely the generator network G and the discriminator network D. During the training process of the anti-static clothing image generation model, the generator network G learns the data distribution of the real anti-static clothing image data, and sends the generated fake anti-static clothing samples to the discriminator network D, thereby misleading the discriminator network D to regard the fake anti-static clothing samples as real data. The discriminator network D is a classifier used to distinguish whether a given input comes from a real anti-static clothing data set.
[0050] Furthermore, through the training process between the generator network G and the discriminator network D, the two networks are continuously optimized to improve their respective capabilities. The discriminator network D has an increasingly strong ability to discriminate the authenticity of the anti-static clothing dataset, while the fake samples of the anti-static clothing dataset generated by the generator network G are becoming more and more realistic. After meeting the preset training conditions, a special clothing image generation model is obtained, and finally a sufficiently realistic anti-static clothing sample is synthesized by the special clothing image generation model.
[0051] Step 103: construct a special clothing deep learning data training set based on the multiple special clothing generated images and the special clothing sample images.
[0052] In the present invention, the anti-static clothing samples synthesized by the special clothing image generation model are added to the data set used to train the anti-static clothing detection algorithm, achieving the effect of expanding the data set, thereby enhancing the deep learning data of special clothing, and then training the target detection model through the data set after data enhancement. While improving the data collection efficiency, it also improves the detection accuracy of the target detection model.
[0053] The special clothing deep learning data enhancement method provided by the present invention trains the generator and the discriminator in the generative adversarial network, improves the quality of the images generated by the generator network, and improves the ability of the discriminator network to judge the authenticity of the generated images, so that the special clothing image generation model finally trained generates a large number of special clothing generated images, thereby achieving the effect of expanding the special clothing deep learning data set, thereby replacing the existing method of manually collecting sample images, and improving the collection efficiency of special clothing deep learning data and the accuracy of model training.
[0054] Based on the above embodiment, the special clothing image generation model is trained by the following steps:
[0055] Obtaining a preset number of sample special clothing images, and marking each of the sample special clothing images with a real image label, to construct a first sample set;
[0056] Input the randomly generated Gaussian noise into the generator network to obtain the sample special clothing prediction image;
[0057] Training the discriminator network through the sample special clothing prediction image and the first sample set to obtain a discriminator feedback result and a discriminator network with updated parameters;
[0058] According to the feedback result of the discriminator, the parameters of the generator network are updated to obtain a generator network with updated parameters;
[0059] If the training result meets the preset conditions, the special clothing image generation model is obtained; if not, the generator network after the parameter update and the discriminator network after the parameter update are trained until the training result meets the preset conditions.
[0060] In the present invention, firstly, a small number of sample images of people wearing anti-static clothing (i.e., sample special clothing images) are collected. The sample images can be obtained by taking photos with a camera or taking screenshots of a video, or by downloading from the Internet. For example, 100 images of people wearing anti-static clothing are collected through the Internet to reduce the time spent on real data collection. Then, these collected real anti-static clothing sample images are marked with real image labels, thereby constructing a first sample set.
[0061] Further, a special clothing image generation model for generating anti-static clothing images is constructed, and the present invention realizes the generation of anti-static clothing data sets based on a generative adversarial network. Specifically, the generator network is responsible for generating anti-static clothing images, and generates anti-static clothing images through receiving a random noise, and the generated anti-static clothing sample images (i.e., sample special clothing prediction images) are recorded as G(z). The present invention inputs Gaussian distributed noise into the generator network, and then inputs the false images generated by the generator network into the discriminator network, so that when calculating the loss function loss of the generator network, the discriminator network's judgment of the false images generated by the generator network is close to true (recorded as 1), and then the feedback result returned by the discriminator network is obtained, so as to update the parameters of the generator network. In the process of training the generator network, only the parameters of the generator network are updated at this time, and the parameters of the discriminator network are not updated.
[0062] Furthermore, the discriminator network is responsible for judging whether the anti-static clothing sample images generated by the generator network are "real". During the training process, the real anti-static clothing sample images in the first sample set and the anti-static clothing sample images (i.e., fake images) generated by the generator network are batched and sent to the discriminator network to train the discriminator network. When calculating the loss of the discriminator network, the discriminator network's judgment on real data is close to true (1), and the judgment on fake images generated by the generator network is close to false (recorded as 0). That is, after the anti-static clothing sample image is input into the discriminator network, the discriminator network outputs the probability D(x) that the anti-static clothing sample image is a real image. If D(x) is 1, it means that the probability of being a real image is 100%, and the output D(x) is 0, which means that the image cannot be a real image (wherein, the real anti-static clothing image comes from the first sample set, and the forged anti-static clothing sample image comes from the generator network). During the training of the discriminator network, only the parameters of the discriminator network are updated, and the parameters of the generator network are not updated.
[0063] The discriminator network and the generator network are repeatedly trained alternately until the training results meet the preset conditions. In the present invention, the fake picture generated by the generator network can obtain an output close to 0.5 confidence level on the discriminator network. It can be considered that the fake picture generated by the generator network is already very close to the real picture. At this time, the anti-static clothing sample picture generated by the generator network can make it difficult for the discriminator network to determine whether this image comes from a real anti-static clothing picture.
[0064] On the basis of the above embodiment, after obtaining a preset number of sample special clothing images, the method further includes:
[0065] Perform image preprocessing and image enhancement processing on each of the sample special clothing images, and construct the first sample set through the processed sample special clothing images.
[0066] In the present invention, the sample special clothing images are subjected to image preprocessing, for example, image translation, rotation or scaling, so as to reduce the random errors existing in the image acquisition process; at the same time, the image is enhanced to make the originally unclear image clear, to expand the difference between the features of different objects in the image, and to suppress the features of no interest, thereby improving the quality of the sample special clothing images, increasing the amount of information in the images, and strengthening the image interpretation and recognition effects.
[0067] On the basis of the above embodiment, the generator network includes a first fully connected layer, a normalization layer, a second fully connected layer, a first convolutional layer, and a second convolutional layer, wherein the output end of the first fully connected layer is connected to the input end of the normalization layer, the output end of the normalization layer is connected to the input end of the second fully connected layer, the output end of the second fully connected layer is connected to the input end of the first convolutional layer, and the output end of the first convolutional layer is connected to the input end of the second convolutional layer;
[0068] The discriminator network includes a third convolutional layer, a pooling layer, a fourth convolutional layer, a third fully connected layer and a fourth fully connected layer, wherein the output end of the third convolutional layer is connected to the input end of the pooling layer, the output end of the pooling layer is connected to the input end of the fourth convolutional layer, the output end of the fourth convolutional layer is connected to the input end of the third fully connected layer, and the output end of the third fully connected layer is connected to the input end of the fourth fully connected layer.
[0069] In the present invention, the overall structure of the generator network is composed of two groups of fully connected layers, a normalization layer (Batch Normalization, referred to as BN) and two groups of convolutional layers. Specifically, a group of 100*1 one-dimensional random noise signals are input into the generator network, and firstly, after passing through the first fully connected layer and the BN layer, they are expanded to 1024*1; then, after passing through the second fully connected layer, the output is 124*7*7; then, after upsampling, the feature map is expanded, and a feature map of 128*14*14 is output, and convolution calculation is performed through the first convolutional layer to retain the effective features, and a feature map of 64*14*14 is output; finally, after the next round of upsampling, the feature map is further expanded to 64*28*28, and the second convolutional layer is performed to output a 28*28 generated data.
[0070] The discriminator network is essentially a binary classification network. Its input is an anti-static clothing picture (i.e., sample special clothing image and sample special clothing prediction image), and it outputs the authenticity of this picture. Specifically, the overall structure of the discriminator network is two sets of convolution and pooling layers, and two sets of fully connected layers. A 28*28 anti-static clothing image is input to the discriminator network. After the third convolution layer extracts features, a 64*26*26 feature map is output, and the pooling layer performs a pooling operation to reduce the image dimension, and outputs a 64*13*13 feature map; then, after the fourth convolution layer and a pooling layer, a 128*5*5 feature map is output; finally, after two fully connected layers (i.e., the third fully connected layer and the fourth fully connected layer), the authenticity of the image is output.
[0071] Based on the above embodiment, the loss function of the generator network is:
[0072]
[0073] The loss function of the discriminator network is:
[0074]
[0075] Wherein, G represents the generator network, D represents the discriminator network, and z represents the input random noise; D(G(z)) represents the judgment probability of the discriminator network on false data, and the false data is a sample special clothing prediction image generated by the generator network according to the input random noise z, wherein 1 represents that the data is absolutely true, and 0 represents that the data is absolutely false; x represents the real data; D(x) represents the judgment probability of the discriminator network on the real data, and the real data is a sample special clothing image; a, b and c are fixed parameters, wherein a=c=1, b=0.
[0076] In the present invention, during the training of the existing generator network and the discriminator network, the training objectives of the two networks are to reduce the value of the loss function as much as possible, but in practical applications, the output results of the two existing loss functions are mutually exclusive. If the discriminator network is well trained, its loss function value is reduced, which means that the discriminator network can accurately distinguish between the generated image and the real image, but this means that the generation result of the generator network is not ideal, and the generated false image is not enough to deceive the discriminator network; on the other hand, if the loss function of the generator network is effectively reduced during training, the training effect of the discriminator network may not be able to accurately judge the authenticity of the image. Therefore, the present invention improves the loss function of the generator network and the discriminator network, adds the least squares method to make the distribution of the generated image as close to the decision boundary as possible, so that the loss function can take the ultimate purpose of the model (that is, to enable the model to output a fake image) as the training goal, and increase the evaluation of the model's own capabilities. In addition, the present invention sets the parameter b added to the discriminant part of the discriminant network's loss function for real data to zero so that it does not affect the training of the discriminator network, which will eventually prompt the model to generate an image that can make the discriminator network output a confidence level close to 0.5.
[0077] On the basis of the above embodiment, the step of constructing a special clothing deep learning data training set according to the plurality of special clothing generated images and the special clothing sample images includes:
[0078] Based on a preset generated image ratio, determining a corresponding number of target special clothing generated images from the plurality of special clothing generated images;
[0079] The target special clothing generated image is added to the first sample set to obtain a special clothing deep learning data training set.
[0080] In the present invention, after a large number of anti-static clothing generated images are generated by the special clothing image generation model, the anti-static clothing generated images are obtained according to a preset generated image ratio (for example, anti-static clothing generated images are selected at a ratio of 50%) and added to the anti-static clothing data set of real data. While achieving the effect of expanding the data set, the training efficiency of the subsequent target detection model is also guaranteed, thereby improving the training accuracy of the target detection model.
[0081] On the basis of the above embodiment, after constructing a special clothing deep learning data training set according to the plurality of special clothing generated images and the special clothing sample images, the method further includes:
[0082] The target detection model is trained through the special clothing deep learning data training set to obtain the special clothing wearing detection model;
[0083] The image to be identified is input into the special clothing wearing detection model to obtain the special clothing wearing detection result of the target person in the image to be identified.
[0084] In the present invention, high-quality anti-static clothing sample images are generated by generative adversarial networks, which greatly improves the richness of data, effectively reduces the number of anti-static data sets collected, and solves the time-consuming and laborious problem of pre-collecting anti-static clothing data sets when using deep learning to identify anti-static clothing. Furthermore, based on the generated anti-static clothing sample images and real anti-static clothing sample images (including positive sample images of people wearing anti-static clothing and negative sample images of people not wearing anti-static clothing), they are input into the target detection model, and a special clothing wearing detection model is obtained through training, and then the special clothing wearing condition of the target person can be detected according to the detection model to obtain more accurate detection results.
[0085] The special clothing deep learning data enhancement device provided by the present invention is described below. The special clothing deep learning data enhancement device described below and the special clothing deep learning data enhancement method described above can be referenced to each other.
[0086] Figure 2 The schematic diagram of the structure of the deep learning data enhancement device for special clothing provided by the present invention is as follows: Figure 2 As shown, the present invention provides a special clothing deep learning data enhancement device, including a signal trigger module 201, an image generation module 202 and a data enhancement module 203, wherein the signal trigger module 201 is used to obtain a random noise signal; the image generation module 202 is used to input the random noise signal into a special clothing image generation model to obtain a plurality of special clothing generated images output by the special clothing image generation model, wherein the special clothing image generation model is obtained by training a generative adversarial network through sample special clothing images, wherein the sample special clothing images include a target person wearing special clothing; the data enhancement module 203 is used to construct a special clothing deep learning data training set according to the plurality of special clothing generated images and the special clothing sample images.
[0087] In the present invention, the signal trigger module 201 first generates a random noise signal, and the random noise signal is used to input into the image generation module 202, so that the special clothing image generation model in the image generation module 202 generates a special clothing generation image (explained with the special clothing as anti-static clothing). In the present invention, the special clothing generation image in the image generation module 202 can generate a large number of anti-static clothing pictures after receiving the random noise signal, thereby expanding the existing anti-static clothing data set. Finally, the anti-static clothing sample synthesized by the special clothing image generation model is added to the data set for training the anti-static clothing detection algorithm by using the data enhancement module 203, achieving the effect of expanding the data set, thereby enhancing the special clothing deep learning data, and then training the target detection model through the data set after data enhancement, while improving the data acquisition efficiency, it also improves the detection accuracy of the target detection model.
[0088] The special clothing deep learning data enhancement device provided by the present invention trains the generator and the discriminator in the generative adversarial network, thereby improving the quality of the images generated by the generator network and the ability of the discriminator network to judge the authenticity of the generated images, so that the special clothing image generation model finally trained generates a large number of special clothing generated images, thereby achieving the effect of expanding the special clothing deep learning data set, thereby replacing the existing method of manually collecting sample images, and improving the collection efficiency of special clothing deep learning data and the accuracy of model training.
[0089] On the basis of the above embodiment, the device also includes a real data acquisition module, a first processing module, a second processing module and a third processing module, wherein the real data acquisition module is used to obtain a preset number of sample special clothing images, and mark each of the sample special clothing images with a real image label to construct a first sample set; the first processing module is used to input randomly generated Gaussian noise into the generator network to obtain a sample special clothing prediction image; the second processing module is used to train the discriminator network through the sample special clothing prediction image and the first sample set to obtain a discriminator feedback result and a discriminator network with updated parameters; the third processing module is used to update the parameters of the generator network according to the discriminator feedback result to obtain a generator network with updated parameters; the fourth processing module is used to obtain the special clothing image generation model if the training result meets the preset conditions; if not, the generator network with updated parameters and the discriminator network with updated parameters are trained until the training result meets the preset conditions.
[0090] On the basis of the above embodiment, the device further comprises a sample image processing module for performing image preprocessing and image enhancement processing on each of the sample special clothing images, and constructing the first sample set through the processed sample special clothing images.
[0091] Based on the above embodiment, the data enhancement module includes a sample image screening unit and a data enhancement unit, wherein the sample image screening unit is used to determine a corresponding number of target special clothing generated images from the multiple special clothing generated images based on a preset generated image ratio; the data enhancement unit is used to add the target special clothing generated images to the first sample set to obtain a special clothing deep learning data training set.
[0092] On the basis of the above embodiment, the device also includes a target detection model training module and a special clothing detection module, wherein the target detection model training module is used to train the target detection model through the special clothing deep learning data training set to obtain a special clothing wearing detection model; the special clothing detection module is used to input the image to be identified into the special clothing wearing detection model to obtain the special clothing wearing detection result of the target person in the image to be identified.
[0093] The device provided by the present invention is used to execute the above-mentioned method embodiments. Please refer to the above-mentioned embodiments for the specific processes and detailed contents, which will not be repeated here.
[0094] Figure 3 A schematic diagram of the structure of an electronic device provided by the present invention, such as Figure 3 As shown, the electronic device may include: a processor (Processor) 301, a communication interface (Communications Interface) 302, a memory (Memory) 303 and a communication bus 304, wherein the processor 301, the communication interface 302, and the memory 303 complete mutual communication through the communication bus 304. The processor 301 can call the logic instructions in the memory 303 to execute the special clothing deep learning data enhancement method, which includes: obtaining a random noise signal; inputting the random noise signal into the special clothing image generation model to obtain a plurality of special clothing generated images output by the special clothing image generation model, wherein the special clothing image generation model is obtained by training the generative adversarial network through sample special clothing images, wherein the sample special clothing images include a target person wearing special clothing; and constructing a special clothing deep learning data training set according to the plurality of special clothing generated images and the special clothing sample images.
[0095] In addition, the logic instructions in the above-mentioned memory 303 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0096] On the other hand, the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the special clothing deep learning data enhancement method provided by the above-mentioned methods, and the method includes: obtaining a random noise signal; inputting the random noise signal into a special clothing image generation model to obtain a plurality of special clothing generated images output by the special clothing image generation model, and the special clothing image generation model is obtained by training a generative adversarial network through sample special clothing images, wherein the sample special clothing images include a target person wearing special clothing; constructing a special clothing deep learning data training set based on the plurality of special clothing generated images and the special clothing sample images.
[0097] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the special clothing deep learning data enhancement method provided in the above-mentioned embodiments, the method comprising: obtaining a random noise signal; inputting the random noise signal into a special clothing image generation model to obtain a plurality of special clothing generated images output by the special clothing image generation model, wherein the special clothing image generation model is obtained by training a generative adversarial network using sample special clothing images, wherein the sample special clothing images include a target person wearing special clothing; constructing a special clothing deep learning data training set based on the plurality of special clothing generated images and the special clothing sample images.
[0098] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0099] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0100] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A deep learning data enhancement method for special clothing, It is characterized in that include: Get a random noise signal; Inputting the random noise signal into a special clothing image generation model to obtain a plurality of special clothing generated images output by the special clothing image generation model, wherein the special clothing image generation model is obtained by training a generative adversarial network using sample special clothing images, wherein the sample special clothing images include a target person wearing special clothing; Constructing a special clothing deep learning data training set according to the plurality of special clothing generated images and the special clothing sample images; The special clothing image generation model is trained by the following steps: Obtaining a preset number of sample special clothing images, and marking each of the sample special clothing images with a real image label, to construct a first sample set; Input the randomly generated Gaussian noise into the generator network to obtain the sample special clothing prediction image; Training the discriminator network through the sample special clothing prediction image and the first sample set to obtain a discriminator feedback result and a discriminator network with updated parameters; According to the feedback result of the discriminator, the parameters of the generator network are updated to obtain a generator network with updated parameters; If the training result meets the preset conditions, the special clothing image generation model is obtained; if not, the generator network after the parameter update and the discriminator network after the parameter update are trained until the training result meets the preset conditions; The loss function of the generator network is: The loss function of the discriminator network is: Wherein, G represents the generator network, D represents the discriminator network, z represents the input random noise; D(G(z)) represents the judgment probability of the discriminator network on false data, and the false data is the sample special clothing prediction image generated by the generator network according to the input random noise z; x represents the real data; D(x) represents the judgment probability of the discriminator network on the real data, and the real data is the sample special clothing image, and a, b and c are fixed parameters.
2. The special clothing deep learning data enhancement method according to claim 1, It is characterized in that After obtaining a preset number of sample special clothing images, the method further includes: Perform image preprocessing and image enhancement processing on each of the sample special clothing images, and construct the first sample set through the processed sample special clothing images.
3. The special clothing deep learning data enhancement method according to claim 1, It is characterized in that The generator network includes a first fully connected layer, a normalization layer, a second fully connected layer, a first convolutional layer, and a second convolutional layer, wherein the output end of the first fully connected layer is connected to the input end of the normalization layer, the output end of the normalization layer is connected to the input end of the second fully connected layer, the output end of the second fully connected layer is connected to the input end of the first convolutional layer, and the output end of the first convolutional layer is connected to the input end of the second convolutional layer; The discriminator network includes a third convolutional layer, a pooling layer, a fourth convolutional layer, a third fully connected layer and a fourth fully connected layer, wherein the output end of the third convolutional layer is connected to the input end of the pooling layer, the output end of the pooling layer is connected to the input end of the fourth convolutional layer, the output end of the fourth convolutional layer is connected to the input end of the third fully connected layer, and the output end of the third fully connected layer is connected to the input end of the fourth fully connected layer.
4. The special clothing deep learning data enhancement method according to claim 1, It is characterized in that The step of constructing a special clothing deep learning data training set based on the plurality of special clothing generated images and the special clothing sample images includes: Based on a preset generated image ratio, determining a corresponding number of target special clothing generated images from the plurality of special clothing generated images; The target special clothing generated image is added to the first sample set to obtain a special clothing deep learning data training set.
5. The special clothing deep learning data enhancement method according to claim 4, It is characterized in that After constructing a special clothing deep learning data training set according to the plurality of special clothing generated images and the special clothing sample images, the method further includes: The target detection model is trained through the special clothing deep learning data training set to obtain the special clothing wearing detection model; The image to be identified is input into the special clothing wearing detection model to obtain the special clothing wearing detection result of the target person in the image to be identified.
6. A deep learning data enhancement device for special clothing, It is characterized in that include: A signal trigger module, used to obtain a random noise signal; An image generation module is used to input the random noise signal into a special clothing image generation model to obtain a plurality of special clothing generated images output by the special clothing image generation model, wherein the special clothing image generation model is obtained by training a generative adversarial network using sample special clothing images, wherein the sample special clothing images include a target person wearing special clothing; A data enhancement module, used to construct a special clothing deep learning data training set based on the plurality of special clothing generated images and the special clothing sample images; The special clothing image generation model is trained by the following steps: Obtaining a preset number of sample special clothing images, and marking each of the sample special clothing images with a real image label, to construct a first sample set; Input the randomly generated Gaussian noise into the generator network to obtain the sample special clothing prediction image; Training the discriminator network through the sample special clothing prediction image and the first sample set to obtain a discriminator feedback result and a discriminator network with updated parameters; According to the feedback result of the discriminator, the parameters of the generator network are updated to obtain a generator network with updated parameters; If the training result meets the preset conditions, the special clothing image generation model is obtained; if not, the generator network after the parameter update and the discriminator network after the parameter update are trained until the training result meets the preset conditions; The loss function of the generator network is: The loss function of the discriminator network is: Wherein, G represents the generator network, D represents the discriminator network, z represents the input random noise; D(G(z)) represents the judgment probability of the discriminator network on false data, and the false data is the sample special clothing prediction image generated by the generator network according to the input random noise z; x represents the real data; D(x) represents the judgment probability of the discriminator network on the real data, and the real data is the sample special clothing image, and a, b and c are fixed parameters.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the special clothing deep learning data enhancement method as described in any one of claims 1 to 5 is implemented.
8. A non-transitory computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the method for deep learning data enhancement of special clothing as described in any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Semi-supervised image classification method based on generative adversarial network
CN110097103A
Clothing image generation system and method based on de-entanglement network
CN113052230A