CN113658280A - Data augmentation method, device, equipment and storage medium based on artificial intelligence - Google Patents

Data augmentation method, device, equipment and storage medium based on artificial intelligence Download PDF

Info

Publication number
CN113658280A
CN113658280A CN202110961660.6A CN202110961660A CN113658280A CN 113658280 A CN113658280 A CN 113658280A CN 202110961660 A CN202110961660 A CN 202110961660A CN 113658280 A CN113658280 A CN 113658280A
Authority
CN
China
Prior art keywords
color image
channel
rgb color
image
transformation
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.)
Granted
Application number
CN202110961660.6A
Other languages
Chinese (zh)
Other versions
CN113658280B (en
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 CN202110961660.6A priority Critical patent/CN113658280B/en
Publication of CN113658280A publication Critical patent/CN113658280A/en
Application granted granted Critical
Publication of CN113658280B publication Critical patent/CN113658280B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • 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
    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Physics & Mathematics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • General Engineering & Computer Science (AREA)
  • Evolutionary Computation (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Computational Linguistics (AREA)
  • Software Systems (AREA)
  • Mathematical Physics (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Image Processing (AREA)
  • Color Image Communication Systems (AREA)

Abstract

The invention provides a data augmentation method, a device, equipment and a storage medium based on artificial intelligence, which comprises the following steps: acquiring an RGB color image; carrying out color transformation on the RGB color image to obtain an HSV color image, and adjusting a channel value in the HSV color image; carrying out color transformation on the adjusted HSV color image to obtain a new RGB color image; carrying out perspective transformation on the new RGB color image to obtain a transformed RGB color image; adjusting the channel arrangement sequence in the transformed RGB color image to obtain an adjusted RGB color image; and adding noise to the adjusted RGB color image to obtain a target augmented image. According to the technical scheme of the embodiment of the invention, the method can make the difference between the obtained target augmented image and the original RGB color image larger by means of color conversion, channel value adjustment, perspective conversion, channel arrangement sequence adjustment and noise increase on the RGB color image, thereby obtaining richer image data.

Description

Data augmentation method, device, equipment and storage medium based on artificial intelligence
Technical Field
The embodiment of the invention relates to the technical field of artificial intelligence, in particular to a data augmentation method, a data augmentation device, computer equipment and a computer readable storage medium based on artificial intelligence.
Background
For the deep learning model, sufficient image data is required to be used as support for training so as to obtain a good model training effect. However, in practical situations, the number of effective image data that a developer can directly acquire is small, which is often insufficient for deep learning model training.
Therefore, it is often necessary to augment existing image data to obtain more and richer image data sets to satisfy the problem of insufficient image data during deep learning training. However, for the existing image data expansion methods such as translation, rotation, scaling, miscut, sharpening, etc., although these methods may increase the number of training image data sets, the expanded image data of these methods is not much different from the original image data due to the limitations of the methods themselves.
Disclosure of Invention
The following is a summary of the subject matter described in detail herein. This summary is not intended to limit the scope of the claims.
The embodiment of the invention provides a data augmentation method, a data augmentation device, computer equipment and a computer readable storage medium based on artificial intelligence, which can augment data and enable the difference between the augmented data and original data to be larger, so that richer data can be obtained.
In a first aspect, an embodiment of the present invention provides a data augmentation method based on artificial intelligence, including:
acquiring an RGB color image;
carrying out color transformation on the RGB color image to obtain an HSV color image, and adjusting a channel value in the HSV color image;
carrying out color transformation on the adjusted HSV color image to obtain a new RGB color image;
carrying out perspective transformation on the new RGB color image to obtain a transformed RGB color image;
adjusting the channel arrangement sequence in the transformed RGB color image to obtain an adjusted RGB color image;
and adding noise to the adjusted RGB color image to obtain a target augmentation image.
In some embodiments, the adjusting the channel values in the HSV color image comprises:
adjusting channel values of a hue channel, a saturation channel and a brightness channel in the HSV color image, and fusing the adjusted hue channel, the saturation channel and the brightness channel to obtain the adjusted HSV color image.
In some embodiments, the adjusting the channel values of the hue channel, the saturation channel, and the brightness channel in the HSV color image includes:
randomly adjusting channel values of a hue channel, a saturation channel and a brightness channel in the HSV color image;
acquiring channel numerical values of the randomly adjusted hue channel, the saturation channel and the brightness channel;
when the channel value after random adjustment is larger than 1, setting the channel value after random adjustment to 1;
and when the randomly adjusted channel value is less than 0, setting the randomly adjusted channel value to be 0.
In some embodiments, the randomly adjusting the channel values of the hue channel, the saturation channel, and the brightness channel in the HSV color image includes:
the adjustment method of the hue channel comprises the following steps: hn=Ho+ H, wherein, said HoFor the channel value of the hue channel before adjustment, the HnThe value range of h is-0.5 to 0.5 for the adjusted channel value of the hue channel;
the adjustment method of the saturation channel comprises the following steps: sn=So+ S, wherein said SoFor the channel value of the saturation channel before adjustment, SnFor the adjusted saturation channelChannel values, said s ranging from 0.5 to 1.5;
the method for adjusting the brightness channel comprises the following steps: vn=Vo+ V, wherein said VoFor the channel value of the brightness channel before adjustment, the VnThe value of v is in the range of 0.5 to 1.5 for the adjusted channel value of the luminance channel.
In some embodiments, the perspective transformation of the new RGB color image to obtain a transformed RGB color image includes:
acquiring an original coordinate point of the new RGB color image;
acquiring a target coordinate point of the new RGB color image;
calculating according to the original coordinate point and the target coordinate point to obtain a perspective transformation matrix;
and carrying out perspective transformation on the new RGB color image according to the perspective transformation matrix row to obtain a transformed RGB color image.
In some embodiments, said obtaining a target coordinate point of said new RGB color image comprises:
and calculating a width transformation size based on the width of the new RGB color image, wherein the calculation method of the width transformation size is as follows: l isxW is the width of the new RGB color image, LxThe value of r for the width transform dimension ranges from 0 to 0.5;
and calculating the height of the new RGB color image to obtain a height transformation size, wherein the calculation method of the height transformation size comprises the following steps: l isyH is the height of the new RGB color image, LyThe value of r for the height transform dimension ranges from 0 to 0.5;
and calculating to obtain a target coordinate point according to the original coordinate point, the width transformation size and the height transformation size.
In some embodiments, the noise is gaussian noise having a probability density function of:
Figure BDA0003222234920000021
wherein f (x) is a probability density function, x is a variable, μ is a mean, and σ is a standard deviation.
In a second aspect, an embodiment of the present invention further provides a data amplification apparatus, including:
an image acquisition unit for acquiring an RGB color image;
the first color transformation unit is used for carrying out color transformation on the RGB color image to obtain an HSV color image and adjusting a channel numerical value in the HSV color image;
the second color transformation unit is used for carrying out color transformation on the adjusted HSV color image to obtain a new RGB color image;
the perspective transformation unit is used for carrying out perspective transformation on the new RGB color image to obtain a transformed RGB color image;
a channel sequence adjusting unit, configured to adjust a channel arrangement sequence in the transformed RGB color image, to obtain an adjusted RGB color image;
and the noise adding unit is used for adding noise to the adjusted RGB color image to obtain a target augmented image.
In a third aspect, an embodiment of the present invention further provides a computer device, including: a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the data augmentation method as described in the first aspect above when executing the computer program.
In a fourth aspect, the present invention further provides a computer-readable storage medium storing computer-executable instructions for performing the data augmentation method according to the first aspect.
The embodiment of the invention comprises the following steps: firstly, acquiring an RGB color image; then, carrying out color transformation on the RGB color image to obtain an HSV color image, and adjusting a channel value in the HSV color image; then, carrying out color transformation on the adjusted HSV color image to obtain a new RGB color image; then, carrying out perspective transformation on the new RGB color image to obtain a transformed RGB color image; then, adjusting the channel arrangement sequence in the transformed RGB color image to obtain an adjusted RGB color image; and finally, adding noise to the adjusted RGB color image to obtain a target augmented image. According to the technical scheme of the embodiment of the invention, the method for performing color conversion, channel value adjustment, perspective conversion, channel arrangement sequence adjustment and noise increase on the RGB color image enables the difference between the obtained target augmented image and the original RGB color image to be larger, and richer image data can be obtained.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
The accompanying drawings are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the example serve to explain the principles of the invention and not to limit the invention.
FIG. 1 is a schematic diagram of a system architecture platform for performing an artificial intelligence based data augmentation method provided by one embodiment of the present invention;
FIG. 2 is a flow chart of a method for artificial intelligence based data augmentation provided by an embodiment of the present invention;
FIG. 3 is a flowchart of adjusting channel values in an HSV color image in a data augmentation method based on artificial intelligence according to an embodiment of the present invention;
FIG. 4 is a flowchart illustrating adjusting channel values of a hue channel, a saturation channel, and a brightness channel in an HSV color image according to an artificial intelligence-based data augmentation method of the present invention;
FIG. 5 is a flowchart of perspective transformation processing in an artificial intelligence based data augmentation method provided by an embodiment of the present invention;
FIG. 6 is a flowchart of calculating a target coordinate point in an artificial intelligence based data augmentation method according to an embodiment of the present invention;
FIG. 7 is a graphical illustration of image contrast before and after data augmentation provided by one embodiment of the present invention;
fig. 8 is a schematic diagram of a data amplification apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention 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 invention and are not intended to limit the invention.
It should be noted that although functional blocks are partitioned in a schematic diagram of an apparatus and a logical order is shown in a flowchart, in some cases, the steps shown or described may be performed in a different order than the partitioning of blocks in the apparatus or the order in the flowchart. The terms "first," "second," and the like in the description, in the claims, or in the drawings described above, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
In the related art, for a deep learning model, sufficient image data is required to be used as a support for training to obtain a good model training effect. However, in practical situations, the number of effective image data that a developer can directly acquire is small, which is often insufficient for deep learning model training.
Therefore, it is often necessary to augment existing image data to obtain more and richer image data sets to satisfy the problem of insufficient image data during deep learning training. However, for the existing image data expansion methods such as translation, rotation, scaling, miscut, sharpening, etc., although these methods may increase the number of training image data sets, the expanded image data of these methods is not much different from the original image data due to the limitations of the methods themselves.
Based on the above situation, the present invention provides a data augmentation method, a data augmentation apparatus, a computer device and a computer-readable storage medium based on artificial intelligence, wherein the data augmentation method includes, but is not limited to, the following steps: firstly, acquiring an RGB color image; then, carrying out color transformation on the RGB color image to obtain an HSV color image, and adjusting a channel value in the HSV color image; then, carrying out color transformation on the adjusted HSV color image to obtain a new RGB color image; then, carrying out perspective transformation on the new RGB color image to obtain a transformed RGB color image; then, adjusting the channel arrangement sequence in the transformed RGB color image to obtain an adjusted RGB color image; and finally, adding noise to the adjusted RGB color image to obtain a target augmented image. According to the technical scheme of the embodiment of the invention, the method for performing color conversion, channel value adjustment, perspective conversion, channel arrangement sequence adjustment and noise increase on the RGB color image enables the difference between the obtained target augmented image and the original RGB color image to be larger, and richer image data can be obtained.
The embodiments of the present invention will be further explained with reference to the drawings.
Fig. 1 is a schematic diagram of a system architecture platform for executing an artificial intelligence based data augmentation method according to an embodiment of the present invention.
In the example of fig. 1, the system architecture platform 100 includes a processor 110 and a memory 120, wherein the processor 110 and the memory 120 may be connected by a bus or other means, and fig. 1 illustrates the example of the connection by the bus.
The memory 120, which is a non-transitory computer readable storage medium, may be used to store non-transitory software programs as well as non-transitory computer executable programs. Further, the memory 120 may include high speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, memory 120 optionally includes memory located remotely from processor 110, which may be connected to the system architecture platform via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
It can be understood by those skilled in the art that the system architecture platform can be applied to a 3G communication network system, an LTE communication network system, a 5G communication network system, a mobile communication network system that is evolved later, and the like, and this embodiment is not limited in particular.
Those skilled in the art will appreciate that the system architecture platform illustrated in FIG. 1 does not constitute a limitation on embodiments of the invention, and may include more or fewer components than those illustrated, or some components may be combined, or a different arrangement of components.
In the system architecture platform shown in fig. 1, the processor 110 may call a data augmentation program stored in the memory 120 to perform an artificial intelligence based data augmentation method.
Based on the system architecture platform, the following provides various embodiments of the artificial intelligence based data augmentation method of the present invention.
As shown in fig. 2, fig. 2 is a flowchart of an artificial intelligence based data augmentation method according to an embodiment of the present invention, which includes, but is not limited to, step S100, step S200, step S300, step S400, step S500, and step S600.
S100, acquiring an RGB color image;
s200, carrying out color transformation on the RGB color image to obtain an HSV color image, and adjusting a channel value in the HSV color image;
step S300, carrying out color transformation on the adjusted HSV color image to obtain a new RGB color image;
step S400, carrying out perspective transformation on the new RGB color image to obtain a transformed RGB color image;
s500, adjusting the channel arrangement sequence in the transformed RGB color image to obtain an adjusted RGB color image;
and step S600, adding noise to the adjusted RGB color image to obtain a target augmented image.
Specifically, in the embodiment of the present invention, an input RGB color image is processed to convert the RGB color image from an RGB color space to an HSV color space to obtain an HSV color image, then a channel value in the HSV color image is adjusted to change each channel value of the HSV color image, and then the adjusted HSV color image is converted from the HSV color space back to the RGB color space.
And then, carrying out perspective transformation on the new RGB color image to obtain a transformed RGB color image. Since the perspective conversion process is performed, the size or the rotation angle of the RGB color image after conversion changes to some extent from the RGB color image before conversion.
And then, adjusting the channel arrangement sequence in the RGB color image after perspective conversion to obtain the adjusted RGB color image. Specifically, since the RGB color image is formed by sequentially superimposing three channels, namely, red (R), green (G), and blue (B), the embodiment of the present invention can change the arrangement order of the three channels in the RGB color image to obtain images displayed in different colors, so as to obtain a data set with richer image colors. Therefore, the color of the RGB color image after the sequential adjustment may change to some extent compared to the color of the RGB color image before the sequential adjustment.
And finally, adding noise to the adjusted RGB color image to obtain a target augmented image. Specifically, in order to make the training result of the model have good generalization capability, the embodiment of the present invention may add various noises to the adjusted RGB color image during the model training. Therefore, the parameters of the RGB color image after the addition of noise are changed to some extent from those before the addition of noise.
Therefore, according to the technical solution of the embodiment of the present invention, the embodiment of the present invention performs color conversion, channel value adjustment, perspective conversion, channel arrangement order adjustment, and noise increase on the RGB color image, so that the difference between the obtained target augmented image and the original RGB color image is large, and thus richer image data can be obtained.
The RGB color image is an image obtained by superimposing three channels of red (R), green (G), and blue (B); specifically, RGB is a color representing three channels of red, green and blue, and this standard includes almost all colors that can be perceived by human vision, which is one of the most widely used color systems.
In addition, the HSV color image is an image formed by superimposing three channels of hue (H), saturation (S) and brightness (V); specifically, the H parameter represents color information, i.e., the position of the spectral color, and is represented by an angular amount, and red, green, and blue are separated by 120 degrees, respectively; the purity S parameter is a proportional value, ranging from 0 to 1, expressed as the ratio between the purity of the selected color and the maximum purity of that color, with only a grey scale when S is 0; the V parameter represents the brightness level of the color, ranging from 0 to 1.
It is to be noted that, regarding the color transformation of the RGB color image to obtain the HSV color image in the above step S200, the conversion from the RGB color image to the HSV color image can be realized by the following algorithm:
max=max(R,G,B);
min=min(R,G,B);
V=max(R,G,B);
S=(max-min)/max;
if(R=max),H=(G-B)/(max-min)*60;
if(G=max),H=120+(B-R)/(max-min)*60;
if(B=max),H=240+(R-G)/(max-min)*60;
if(H<0),H=H+360。
in addition, it is noted that, regarding the color transformation of the adjusted HSV color image in the above step S300, the conversion from the HSV color image to the RGB color image can be realized by the following algorithm:
if(s=0)
R=G=B=V;
else
H/=60;
i=INTEGER(H);
f=H-i;
a=V*(1-s);
b=V*(1-s*f);
c=V*(1-s*(1-f));
switch(i)
case 0:R=V;G=c;B=a;
case 1:R=b;G=v;B=a;
case 2:R=a;G=v;B=c;
case 3:R=a;G=b;B=v;
case 4:R=c;G=a;B=v;
case 5:R=v;G=a;B=b。
the embodiment of the invention can acquire and process related images 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.
Based on the technical scheme of the embodiment of the invention, the embodiment of the invention can acquire and process the image, perform color transformation processing on the image, perform perspective transformation processing on the image, perform sequencing processing on image channels and perform noise adding processing on the image in an artificial intelligence mode.
In addition, as shown in fig. 3, fig. 3 is a flowchart of adjusting the channel values in the HSV color image in the artificial intelligence based data augmentation method according to an embodiment of the present invention; regarding the adjustment of the channel values in the HSV color image in the step S200, the steps include, but are not limited to, step S210 and step S220.
S210, adjusting channel values of a hue channel, a saturation channel and a brightness channel in the HSV color image;
and S220, fusing the adjusted hue channel, the adjusted saturation channel and the adjusted brightness channel to obtain the adjusted HSV color image.
Specifically, since the HSV color image includes a hue (H) channel, a saturation (S) channel, and a brightness (V) channel, the embodiments of the present invention may adjust channel values of the hue channel, the saturation channel, and the brightness channel to change values of the channels, and then fuse the adjusted hue channel, the saturation channel, and the brightness channel, thereby obtaining a new HSV color image.
In addition, as shown in fig. 4, fig. 4 is a flowchart of adjusting channel values of a hue channel, a saturation channel and a brightness channel in an HSV color image in the artificial intelligence based data augmentation method according to an embodiment of the present invention; the step S210 includes, but is not limited to, step S211, step S212, step S213, and step S214.
Step S211, randomly adjusting channel values of a hue channel, a saturation channel and a brightness channel in the HSV color image;
step S212, obtaining channel numerical values of the tone channel, the saturation channel and the brightness channel after random adjustment;
step S213, when the channel value after random adjustment is larger than 1, setting the channel value after random adjustment to 1;
step S214, when the randomly adjusted channel value is less than 0, the randomly adjusted channel value is set to 0.
Specifically, after the values of the three channels of the HSV color space are adjusted, the randomly adjusted channel values are judged and processed in the embodiment of the present invention. Specifically, a value greater than 1 is set to 1 for three channels, and a value less than 0 is set to 0 for three channels.
It should be noted that, regarding the adjusting method of each channel in the step S211, the following is specific:
the adjustment method of the hue channel is as follows: hn=Ho+ H wherein HoFor the channel value of the hue channel before adjustment, HnH is any number between-0.5 and 0.5 for the adjusted channel value of the hue channel;
the adjustment method of the saturation channel is as follows: sn=So+ S, wherein SoTo adjust the channel value of the saturation channel before, SnS is an arbitrary number between 0.5 and 1.5 for the channel value of the adjusted saturation channel;
the method for adjusting the brightness channel comprises the following steps: vn=Vo+ V, wherein VoFor the channel value of the luminance channel before adjustment, VnV is an arbitrary number between 0.5 and 1.5 for the adjusted channel value of the luminance channel.
In addition, as shown in fig. 5, fig. 5 is a flowchart of perspective transformation processing in the artificial intelligence based data augmentation method according to an embodiment of the present invention; the step S400 includes, but is not limited to, step S410, step S420, step S430, and step S440.
Step S410, acquiring an original coordinate point of a new RGB color image;
step S420, acquiring a target coordinate point of a new RGB color image;
step S430, calculating according to the original coordinate point and the target coordinate point to obtain a perspective transformation matrix;
and step S440, carrying out perspective transformation on the new RGB color image according to the perspective transformation matrix row to obtain the transformed RGB color image.
Specifically, in order to complete the perspective transformation process, the embodiment of the present invention needs to acquire an original coordinate point and a target coordinate point of a new RGB color image, then calculates a perspective transformation matrix according to the original coordinate point and the target coordinate point, and finally obtains the transformed RGB color image by using the perspective transformation matrix and the new RGB color image obtained in step S300.
It should be noted that, regarding the original coordinate points and the target coordinate points, the number thereof is four. In the embodiment of the present invention, four vertices of the new RGB color image may be used as the original coordinate points.
In addition, as shown in fig. 6, fig. 6 is a flowchart of calculating a target coordinate point in the artificial intelligence based data augmentation method according to an embodiment of the present invention; the step S420 includes, but is not limited to, the steps S421, S422, and S423.
Step S421, calculating the width of the new RGB color image to obtain the width transformation size; the calculation method of the width transformation size comprises the following steps: l isxW is the width of the new RGB color image, LxR has a value in the range of 0 to 0.5 for the width transform size;
step S422, calculating the height of the new RGB color image to obtain the height transformation size; the calculation method of the height transformation size comprises the following steps: l isyH is the height of the new RGB color image, LyR has a value ranging from 0 to 0.5 for the height transformation size;
and step 423, calculating to obtain a target coordinate point according to the original coordinate point, the width transformation size and the height transformation size.
Specifically, the target coordinate point in the embodiment of the present invention is calculated from the original coordinate point. Regarding the acquisition of the target coordinate point, two dimensions, i.e., a width transformation dimension and a height transformation dimension, can be calculated according to given factors, and the calculation formula is as follows:
Figure BDA0003222234920000081
wherein r is a given factor, and the numerical value range thereof is 0 to 0.5; w and H are the width and height of the new RGB color image, respectively, and then four coordinate points of the target point are calculated at four vertexes of the image according to the width transformation size and the height transformation size, respectively.
Illustratively, taking the x-axis of the image (0,0) point as an example: dimension L calculated from given factorsxRespectively extending L on the left and right sides of the image (0,0) coordinatexThen obtain the variation range (-L) of xx Lx) At (-L)x Lx) If any point in the range is taken as the x-axis coordinate of the target point and the y-axis coordinate thereof is obtained in the same manner, the target coordinate point (x ',') is obtained. The remaining three points were obtained in the same manner.
It is noted that, regarding the noise in the above step S600, the noise may be, but is not limited to, gaussian noise, and the probability density function of the gaussian noise is:
Figure BDA0003222234920000082
where f (x) is a probability density function, x is a variable, μ is a mean, and σ is a standard deviation.
In particular, in order to make the training result of the model have good generalization capability, various noises are often added to the training data set during model training. The noise selected by the embodiment of the invention is Gaussian noise, and the Gaussian noise is characterized in that the probability density function of the Gaussian noise follows positive-Tailored distribution, so that the Gaussian noise can add noise on each pixel point of an image, but the depth of the noise at different point positions is random.
Based on the artificial intelligence based data augmentation method in fig. 2 to fig. 6, the following provides an overall embodiment of the artificial intelligence based data augmentation method of the present invention, including but not limited to four steps:
the method comprises the following steps: the input image is converted from an RGB color space to an HSV color space by processing the input image. Then, three channels of the HSV color space image are respectively processed, and the processing method comprises the following steps: for hue (H) channel Hn=Ho+ h, wherein h is any number between-0.5 and 0.5; for saturation (S) channel Sn=So+ s, wherein s is any number between 0.5 and 1.5; for brightness (V) channel Vn=Vo+ v, wherein v is any number between 0.5 and 1.5. After adjusting the values of the three channels of the HSV color space, setting 1 for the value greater than 1 in the three channels, and setting 0 for the value less than 0 in the three channels. And after the processing is finished, fusing the three channels, and converting the fused HSV color space image back to the RGB color space to finally obtain a new image with changed brightness and color.
Step two: and performing perspective transformation on the image after the color transformation. Four pairs of coordinate points are needed to obtain the perspective transformation matrix, including four original coordinate points and four target coordinate points. Firstly, acquiring an original coordinate point, wherein four vertexes of an image are used as the original coordinate point in the embodiment of the invention; the target coordinate point is obtained by first calculating two dimensions according to given factors:
Figure BDA0003222234920000091
wherein r is a given factor and ranges from 0 to 0.5, W and H are the width and the height of the image respectively, then four coordinate points of a target point are calculated at four short points of the image respectively according to the two sizes, then a perspective transformation matrix is calculated according to the perspective transformation matrix by four pairs of coordinate points, and finally the transformed image can be obtained by the perspective transformation matrix and the image obtained in the first step.
Step three: and D, performing random channel transformation on the image obtained in the step two, wherein the RGB image is formed by sequentially overlapping the red channel, the green channel and the blue channel, and images displayed in different colors can be obtained by changing the arrangement sequence of the three channels in the RGB image, so that a data set with richer image colors can be obtained by changing the arrangement sequence of the three channels in the RGB image.
Step four: in order to make the training result of the model have good generalization capability, various noises are often required to be added to the training data set during model training. The noise selected by the embodiment of the invention is Gaussian noise, and the Gaussian noise is characterized in that the probability density function of the Gaussian noise follows positive-Tailored distribution, so that the Gaussian noise can add noise on each pixel point of an image, but the depth of the noise at different point positions is random. The probability density function of gaussian noise is:
Figure BDA0003222234920000092
where f (x) is a probability density function, x is a variable, μ is a mean, and σ is a standard deviation.
According to the technical scheme, the artificial intelligence-based data augmentation method provided by the embodiment of the invention can obtain the image with different brightness and color after color augmentation by operating the hue, saturation and brightness of the image in the HSV color space, then the image is subjected to perspective transformation, a new image with an image shape randomly transformed can be obtained due to the fact that a perspective transformation matrix is random, the image with richer colors can be obtained by random rearrangement of three channels of the image, and finally noise processing is added to the image. Greatly enriching the content of the picture. Compared with the conventional method, the artificial intelligence-based data augmentation method greatly enriches the colors of the images after data augmentation, provides rich data for model training of deep learning, and provides possibility for better generalization capability of the models.
Specifically, compared with the existing image data expansion method, the existing image data expansion method only adopts the conventional methods such as translation, rotation, scaling, shearing, sharpening, and the like, so that the difference between the target augmented image obtained by the existing image data expansion method and the original image is not large, and therefore, the target augmented image obtained by the existing image data expansion method is input into the deep learning model, and the generalization capability of the model is poor. The image data expansion method of the embodiment of the invention obtains a target augmented image with a larger difference from the original image through a series of means such as color transformation, channel value adjustment, perspective transformation, channel arrangement sequence adjustment, noise increase and the like, and particularly shows that the parameters of the target augmented image are greatly changed relative to the parameters of the original image, so that the target augmented image obtained by the image data expansion method of the embodiment of the invention is input into the deep learning model, and the generalization capability of the model is better. In addition, it should be noted that, because the target augmented image of the image data augmentation method according to the embodiment of the present invention is obtained based on the original image, and the nature of the target augmented image is still changed based on the original image, but the change is not too exaggerated to completely depart from the original image.
Specifically, after the above-described steps one to four, the image contrast before and after data augmentation can be seen in fig. 7, where the image on the left side in fig. 7 is the original image and the image on the right side is the augmented image.
Based on the above artificial intelligence based data augmentation method, the following respectively proposes various embodiments of the data augmentation apparatus, the computer device, and the computer-readable storage medium of the present invention.
As shown in fig. 8, fig. 8 is a schematic diagram of a data amplification apparatus according to an embodiment of the present invention. The data amplification apparatus 200 of the embodiment of the present invention includes, but is not limited to, an image acquisition unit 210, a first color conversion unit 220, a second color conversion unit 230, a perspective conversion unit 240, a channel order adjustment unit 250, and a noise addition unit 260.
Specifically, the image acquisition unit 210 is configured to acquire an RGB color image; the first color conversion unit 220 is configured to perform color conversion on the RGB color image to obtain an HSV color image, and adjust a channel value in the HSV color image; the second color transformation unit 230 is configured to perform color transformation on the adjusted HSV color image to obtain a new RGB color image; the perspective transformation unit 240 is configured to perform perspective transformation on the new RGB color image to obtain a transformed RGB color image; the channel sequence adjusting unit 250 is configured to adjust a channel arrangement sequence in the transformed RGB color image to obtain an adjusted RGB color image; the noise adding unit 260 is used for adding noise to the adjusted RGB color image to obtain a target augmented image.
It should be noted that, the specific implementation and the corresponding technical effects of the data augmentation apparatus according to the embodiment of the present invention may be referred to the specific implementation and the corresponding technical effects of the data augmentation method based on artificial intelligence.
In addition, an embodiment of the present invention also provides a computer apparatus including: a memory, a processor, and a computer program stored on the memory and executable on the processor.
The processor and memory may be connected by a bus or other means.
It should be noted that, the computer device in this embodiment may be applied to the system architecture platform in the embodiment shown in fig. 1, and the computer device in this embodiment can form a part of the system architecture platform in the embodiment shown in fig. 1, and both belong to the same inventive concept, so both have the same implementation principle and beneficial effect, and are not described in detail herein.
The non-transitory software programs and instructions required to implement the artificial intelligence based data augmentation method of the above embodiments are stored in a memory and, when executed by a processor, perform the artificial intelligence based data augmentation method of the above embodiments, e.g., perform the method steps of fig. 2-6 described above.
Furthermore, an embodiment of the present invention also provides a computer-readable storage medium storing computer-executable instructions for performing the artificial intelligence based data augmentation method described above. For example, when executed by a processor of the data augmentation apparatus, the processor may be caused to perform the artificial intelligence based data augmentation method in the above embodiments, for example, the method steps in fig. 2 to 6 described above.
One of ordinary skill in the art will appreciate that all or some of the steps, systems, and methods disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof. Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). The term computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data, as is well known to those of ordinary skill in the art. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, Digital Versatile Disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can accessed by a computer. In addition, communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media as known to those skilled in the art.
While the preferred embodiments of the present invention have been described in detail, it will be understood by those skilled in the art that the foregoing and various other changes, omissions and deviations in the form and detail thereof may be made without departing from the scope of this invention.

Claims (10)

1. A data augmentation method based on artificial intelligence is characterized by comprising the following steps:
acquiring an RGB color image;
carrying out color transformation on the RGB color image to obtain an HSV color image, and adjusting a channel value in the HSV color image;
carrying out color transformation on the adjusted HSV color image to obtain a new RGB color image;
carrying out perspective transformation on the new RGB color image to obtain a transformed RGB color image;
adjusting the channel arrangement sequence in the transformed RGB color image to obtain an adjusted RGB color image;
and adding noise to the adjusted RGB color image to obtain a target augmentation image.
2. The data augmentation method of claim 1, wherein said adjusting channel values in the HSV color image comprises:
adjusting channel values of a hue channel, a saturation channel and a brightness channel in the HSV color image, and fusing the adjusted hue channel, the saturation channel and the brightness channel to obtain the adjusted HSV color image.
3. The data augmentation method of claim 2, wherein the adjusting the channel values of the hue channel, the saturation channel, and the brightness channel in the HSV color image comprises:
randomly adjusting channel values of a hue channel, a saturation channel and a brightness channel in the HSV color image;
acquiring channel numerical values of the randomly adjusted hue channel, the saturation channel and the brightness channel;
when the channel value after random adjustment is larger than 1, setting the channel value after random adjustment to 1;
and when the randomly adjusted channel value is less than 0, setting the randomly adjusted channel value to be 0.
4. The data augmentation method of claim 3, wherein the randomly adjusting the channel values of the hue channel, the saturation channel, and the brightness channel in the HSV color image comprises:
tone of the tone channelThe whole method comprises the following steps: hn=Ho+ H, wherein, said HoFor the channel value of the hue channel before adjustment, the HnThe value range of h is-0.5 to 0.5 for the adjusted channel value of the hue channel;
the adjustment method of the saturation channel comprises the following steps: sn=So+ S, wherein said SoFor the channel value of the saturation channel before adjustment, SnThe channel value of the saturation channel after adjustment is in a range of 0.5 to 1.5;
the method for adjusting the brightness channel comprises the following steps: vn=Vo+ V, wherein said VoFor the channel value of the brightness channel before adjustment, the VnThe value of v is in the range of 0.5 to 1.5 for the adjusted channel value of the luminance channel.
5. The data augmentation method of claim 1, wherein the perspective transformation of the new RGB color image to obtain a transformed RGB color image comprises:
acquiring an original coordinate point of the new RGB color image;
acquiring a target coordinate point of the new RGB color image;
calculating according to the original coordinate point and the target coordinate point to obtain a perspective transformation matrix;
and carrying out perspective transformation on the new RGB color image according to the perspective transformation matrix row to obtain a transformed RGB color image.
6. The data augmentation method of claim 5, wherein the obtaining of the target coordinate point of the new RGB color image comprises:
and calculating a width transformation size based on the width of the new RGB color image, wherein the calculation method of the width transformation size is as follows: l isxW is the width of the new RGB color image, LxThe dimensions are changed for the said width or widths,the value of r ranges from 0 to 0.5;
and calculating the height of the new RGB color image to obtain a height transformation size, wherein the calculation method of the height transformation size comprises the following steps: l isyH is the height of the new RGB color image, LyThe value of r for the height transform dimension ranges from 0 to 0.5;
and calculating to obtain a target coordinate point according to the original coordinate point, the width transformation size and the height transformation size.
7. The data augmentation method of claim 1, wherein the noise is gaussian noise having a probability density function of:
Figure FDA0003222234910000021
wherein f (x) is a probability density function, x is a variable, μ is a mean, and σ is a standard deviation.
8. A data augmentation apparatus, comprising:
an image acquisition unit for acquiring an RGB color image;
the first color transformation unit is used for carrying out color transformation on the RGB color image to obtain an HSV color image and adjusting a channel numerical value in the HSV color image;
the second color transformation unit is used for carrying out color transformation on the adjusted HSV color image to obtain a new RGB color image;
the perspective transformation unit is used for carrying out perspective transformation on the new RGB color image to obtain a transformed RGB color image;
a channel sequence adjusting unit, configured to adjust a channel arrangement sequence in the transformed RGB color image, to obtain an adjusted RGB color image;
and the noise adding unit is used for adding noise to the adjusted RGB color image to obtain a target augmented image.
9. A computer device, comprising: memory, processor and computer program stored on the memory and executable on the processor, which when executed by the processor implements a data augmentation method as claimed in any one of claims 1 to 7.
10. A computer-readable storage medium having stored thereon computer-executable instructions for performing the data augmentation method of any one of claims 1 to 7.
CN202110961660.6A 2021-08-20 2021-08-20 Data augmentation method, device, equipment and storage medium based on artificial intelligence Active CN113658280B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110961660.6A CN113658280B (en) 2021-08-20 2021-08-20 Data augmentation method, device, equipment and storage medium based on artificial intelligence

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110961660.6A CN113658280B (en) 2021-08-20 2021-08-20 Data augmentation method, device, equipment and storage medium based on artificial intelligence

Publications (2)

Publication Number Publication Date
CN113658280A true CN113658280A (en) 2021-11-16
CN113658280B CN113658280B (en) 2023-07-04

Family

ID=78480576

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110961660.6A Active CN113658280B (en) 2021-08-20 2021-08-20 Data augmentation method, device, equipment and storage medium based on artificial intelligence

Country Status (1)

Country Link
CN (1) CN113658280B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114742697A (en) * 2022-03-31 2022-07-12 杭州缦图摄影有限公司 Face skin color single-value stylization method

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101742339A (en) * 2010-01-14 2010-06-16 中山大学 Method for enhancing color image
CN104935902A (en) * 2015-06-02 2015-09-23 三星电子(中国)研发中心 Image color enhancement method and device, and electronic equipment
CN106530250A (en) * 2016-11-07 2017-03-22 湖南源信光电科技有限公司 Low illumination color image enhancement method based on improved Retinex
US20170177971A1 (en) * 2015-12-17 2017-06-22 Research & Business Foundation Sungkyunkwan University Method of detecting color object by using noise and system for detecting light emitting apparatus by using noise
US9818047B1 (en) * 2015-02-09 2017-11-14 Marvell International Ltd. System and method for color enhancement
CN109685742A (en) * 2018-12-29 2019-04-26 哈尔滨理工大学 A kind of image enchancing method under half-light environment
CN111784588A (en) * 2019-04-04 2020-10-16 长沙智能驾驶研究院有限公司 Image data enhancement method and device, computer equipment and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101742339A (en) * 2010-01-14 2010-06-16 中山大学 Method for enhancing color image
US9818047B1 (en) * 2015-02-09 2017-11-14 Marvell International Ltd. System and method for color enhancement
CN104935902A (en) * 2015-06-02 2015-09-23 三星电子(中国)研发中心 Image color enhancement method and device, and electronic equipment
US20170177971A1 (en) * 2015-12-17 2017-06-22 Research & Business Foundation Sungkyunkwan University Method of detecting color object by using noise and system for detecting light emitting apparatus by using noise
CN106530250A (en) * 2016-11-07 2017-03-22 湖南源信光电科技有限公司 Low illumination color image enhancement method based on improved Retinex
CN109685742A (en) * 2018-12-29 2019-04-26 哈尔滨理工大学 A kind of image enchancing method under half-light environment
CN111784588A (en) * 2019-04-04 2020-10-16 长沙智能驾驶研究院有限公司 Image data enhancement method and device, computer equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114742697A (en) * 2022-03-31 2022-07-12 杭州缦图摄影有限公司 Face skin color single-value stylization method
CN114742697B (en) * 2022-03-31 2024-05-03 杭州海马体摄影有限公司 Face skin color single-value stylization method

Also Published As

Publication number Publication date
CN113658280B (en) 2023-07-04

Similar Documents

Publication Publication Date Title
WO2018082185A1 (en) Image processing method and device
US11461903B2 (en) Video processing device, video processing method, and video processing program
US11908241B2 (en) Method for correction of the eyes image using machine learning and method for machine learning
JP2006121695A (en) Device and method for color correction of input image
EP3110129A1 (en) Color gamut mapping based on the mapping of cusp colors obtained through simplified cusp lines
CN111489322B (en) Method and device for adding sky filter to static picture
EP2890107A1 (en) Method of mapping source colors of images of a video content into the target color gamut of a target color device
EP3624433A1 (en) Color gamut mapping based on the mapping of cusp colors defined in a linear device-based color space
CN115082328A (en) Method and apparatus for image correction
JP5719123B2 (en) Image processing apparatus, image processing method, and program
CN113658280B (en) Data augmentation method, device, equipment and storage medium based on artificial intelligence
JPH10208034A (en) Processor and method for image processing
US8509529B2 (en) Color-image representative color decision apparatus and method of controlling operation thereof
US10284750B2 (en) Lightness mapping in two steps
CN112734630A (en) Ortho image processing method, device, equipment and storage medium
CN111127618A (en) Texture toning method and device during real-time rendering
US20170244972A1 (en) Methods and apparatus for mapping input image
JP4375580B2 (en) Image processing apparatus, image processing method, and image processing program
US20240127507A1 (en) Image processing method and image processing apparatus
CN113870099B (en) Picture color conversion method, device, equipment and readable storage medium
KR102619830B1 (en) Method and apparatus for correcting image
US20130100157A1 (en) Method and system to modify a color lookup table
JP2022156631A (en) Image correction model generation method, image correction model generation program, and image correction model generation device
KR20210020476A (en) A computing apparatus and a method of converting image
CN112929628B (en) Virtual viewpoint synthesis method, device, electronic equipment and storage medium

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
GR01 Patent grant
GR01 Patent grant