Method for constructing image augmentation model for small sample sets
Through the small-scale sample set image augmentation model construction method, using technologies such as geometric transformation, random background filling, and multi-directional image blur algorithms, the problem of small number and low quality of the initial sample set is solved, and the adaptability and robustness of target detection are improved. Excellent performance, reducing the missed detection rate.
Patent Information
- Application Number
- CN202410071434.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-18
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2044-01-18
AI Technical Summary
In actual target tracking scenarios based on motion platforms, the initial sample set is small in number and of low quality. It is impossible to effectively use the augmentation algorithm of the existing general detection model to achieve high-quality image augmentation, resulting in the neural network training on a small number of samples. Insufficient generalization ability.
A small-scale sample set image augmentation model construction method is adopted, including image augmentation based on geometric transformation, random background filling, multi-directional image blur augmentation algorithm and traditional image augmentation method, through similarity transformation, affine transformation, projection transformation, Technologies such as random background filling, multi-directional superposition blur algorithm and random Gaussian noise injection are used to generate an image augmentation model with adjustable random parameters.
It improves the adaptability and robustness of target detection, reduces the missed detection rate due to rotation and jitter, provides a better basis for target tracking, and solves the problem of insufficient generalization ability.
Smart Images

Figure CN118115387B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to a method for constructing an image augmentation model for a small-scale sample set. Background Art
[0002] Image augmentation technology generates similar but different training samples by making a series of random changes to the training images, thereby expanding the size of the training data set. Image augmentation is an important part of the current artificial intelligence model training. By augmenting the sample images in various ways, the final product accuracy can be significantly improved and its generalization ability in different business scenarios can be effectively improved.
[0003] The current mainstream image augmentation methods rely on a large number of initial sample sets. However, in actual target tracking scenarios based on motion platforms, the initial sample sets have many problems such as small number and low quality, and often contain complex target random rotation and imaging jitter noise. In actual use, it is impossible to directly use the augmentation algorithm that comes with the existing general detection model to achieve high-quality image augmentation, nor is it possible to learn from automatic data enhancement, which is an automatic image augmentation strategy that requires a large number of initial samples. As a result, the generalization ability of the neural network is insufficient when training a small number of samples in the target tracking context. Summary of the invention
[0004] The purpose of the present invention is to provide a method for constructing an image augmentation model for a small-scale sample set to solve the problems raised in the above-mentioned background technology.
[0005] To achieve the above object, the present invention provides the following technical solution: a method for constructing an image augmentation model for a small-scale sample set, comprising the following steps:
[0006] S1. Perform image augmentation based on geometric transformation on a finite sample set;
[0007] S2, performing random background filling on the geometrically transformed image;
[0008] S3, through the multi-directional image blur augmentation algorithm, help the model learn and deal with imaging blur problems;
[0009] S4. Combining traditional image augmentation methods, we obtain an image augmentation model with adjustable random parameters.
[0010] Preferably, in step S1, the image augmentation based on geometric transformation includes performing similarity transformation on a finite sample set, the similarity transformation includes rigid transformation, and the translational movement and rotational movement of the image are described by the rigid transformation. When performing the rigid transformation, the shape of the image is not distorted, and the size is not changed. A size scaling factor is added to the rigid transformation, so that when the image is subjected to similarity transformation, the image can be translated, rotated, and isotropically scaled, so that the original shape of the object in the image is not distorted while the size of the object can be changed. The rigid transformation of the image is described by a rigid transformation matrix, and the similarity transformation of the image is described by a similarity transformation matrix.
[0011] The rigid transformation matrix M1 is as follows:
[0012]
[0013] Where θ represents the rotation angle of the image, m1 and m2 are the translation amounts of the image origin in the x and y directions respectively. These three parameters are independent of each other and represent the degrees of freedom in three directions.
[0014] Similarity transformation matrix M2
[0015]
[0016] Where θ represents the rotation angle of the image, m1 and m2 are the translation amounts of the image origin in the x and y directions, respectively, and s is the scale factor.
[0017] Preferably, in step S1, the image augmentation based on geometric transformation includes performing an affine transformation on a finite sample. When performing the affine transformation, the original image needs to be read first, and then the coordinate points of the upper left corner and the lower right corner of the original image are obtained. After the discrete difference values of the upper left corner and the lower right corner are calculated respectively, all the coordinate points of the image are obtained according to the discrete values, and then the required width value and height value of the new image are calculated. The maximum value of the horizontal difference value is selected according to the width value, and the maximum value of the vertical difference value is selected according to the height value. Then, the coordinate points of the four corners of the new image are constructed, and the affine transformation matrix is obtained and applied through the coordinate points of the four corners of the new image, and the transformed new image is obtained through the affine transformation.
[0018] The affine transformation matrix is as follows:
[0019]
[0020] In the formula, s x and y Control the image scaling and flipping, a x and a y Control rotation and tilt, t x and t y Controls translation.
[0021] Preferably, in step S1, the image augmentation based on geometric transformation includes performing a projection transformation on a finite sample, establishing a three-dimensional model of the sample before the projection transformation, and then defining a projection plane according to the line of sight direction, so that the projection plane is perpendicular to the plane in the line of sight direction, and then performing a projection transformation according to the camera direction and the line of sight direction, simulating the way the human eye sees things through perspective projection transformation, following the principle of near is big and far is small, projecting the image onto the projection plane, compressing the image space through a transformation matrix so that it corresponds to the coordinates of a true perspective projection, and then re-orthogonally projecting the compressed space into a standard small cube, performing a projection transformation through a perspective projection transformation matrix, and finally restoring the image proportions through a viewport transformation.
[0022] Preferably, in step S2, random background filling is performed on the image after affine transformation and projection transformation to cope with the problem of missing edge information of the image after geometric transformation, and the edge information missing area is filled by randomly cropping the non-target area, and then the quality of the sample image area is improved to prevent the imbalance of the feature information amount of the sample, and random background filling is performed by a filling formula to improve the target detection performance;
[0023] The filling formula is as follows:
[0024]
[0025] Where I(x,y) is the image after filling, g(x,y) is the background image, and t(x,y) is the image after affine transformation or projection transformation.
[0026] Preferably, in step S3, a multi-directional graphic fuzzy augmentation algorithm is used to help the model learn and process the problem of imaging blur caused by platform jitter and rapid target movement when the camera is tracking a moving platform. The multi-directional graphic augmentation algorithm includes a multi-directional superposition blur algorithm, which simulates the actual imaging effect by recombining, rotating, displacing and superimposing the original image samples, and after the original samples are transparently processed, superposition operations are performed in the vertical, horizontal and four 45-degree oblique directions;
[0027] The multi-directional superposition fuzzy algorithm is as follows:
[0028]
[0029]
[0030]
[0031] In the formula, taking RGB image as an example, n is the number of superpositions each time, α bi The transparency of each sample when superimposed, and α bi The value range is from 0 to 1.bi When α is 1, it is completely transparent. bi When it is 0, it is opaque. A Represents the pixel value of the sample corresponding to the position after the image is augmented, and the p of each channel A It is composed of the displacement and superposition of sample pixels after increasing transparency, T i is the displacement matrix corresponding to the superimposed sub-image;
[0032] The displacement matrix is as follows:
[0033]
[0034] Among them, t ui and t vi is the displacement of the image in the coordinate system, through the stacking direction and stacking step length t b It is determined jointly with the superposition number n.
[0035] Preferably, in step S4, traditional image augmentation includes flipping or cropping the image, and image brightness change. In image flipping, horizontal or vertical operations are performed along an axis of the image. Image flipping enables the image augmentation model to learn the feature expression of the sample symmetry direction. In random image cropping, the image is intercepted on a two-dimensional scale. After obtaining a local image of the image, the intercepted image is enlarged. The original feature information in the image is retained by cropping the image, and further enlarging it enriches the features of the graphic. In image brightness change, the image brightness coefficient is adjusted to make the image augmentation model suitable for more complex lighting environments.
[0036] Preferably, in step S4, the traditional image augmentation includes random Gaussian noise injection and color space dithering. In the random Gaussian noise injection, by simulating various noises and interferences that may be generated during visual imaging, a method of randomly superimposing additional interference information on pixels in the original image is used to generate a new graphic sample with uncertain noise interference superposition. In the color space dithering, the image is converted from RGB color space to CMY color space through the transformation of color space.
[0037] Preferably, in step S4, after traditional image augmentation is performed, a probability factor is obtained according to the characteristics of the actual use environment. When the augmented object is a target with obvious rotation, the probability factor of geometric augmentation is increased. When the augmented object is a target with occlusion, the probability factor of cropping augmentation is increased. When outdoor tracking is performed for a long time, due to the unstable brightness of the illumination, the probability factor of brightness augmentation is increased. When the augmented object is a platform jitter and a high-speed target, the probability factor of fuzzy augmentation is increased. With more probability factors, by changing the size of the probability factors, an image augmentation model with adjustable random parameters is obtained, so that various types of interference in image acquisition can be simulated to better train the sample set.
[0038] Compared with the prior art, the present invention has the following beneficial effects:
[0039] The present invention designs an image augmentation model construction method for a small-scale sample set, which has good adaptability to the detection of targets with rotation, especially targets with planar characteristics. At the same time, the augmentation method can greatly reduce missed detections caused by rotation and jitter, and provides a more robust target inspection basis for target tracking problems. The model mainly targets detection failures caused by various problems in target tracking problems such as a small number of samples, jitter of the tracking platform, and relative rotation between the camera and the target, that is, it solves the problem of insufficient generalization ability of a neural network when training a small number of samples in the target tracking background. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 A schematic diagram of steps is provided for an embodiment of the present invention. DETAILED DESCRIPTION
[0041] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only 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.
[0042] See also Figure 1 The present invention provides a technical solution: a method for constructing a small-scale sample set image augmentation model, comprising the following steps:
[0043] S1. Perform image augmentation based on geometric transformation on a finite sample set;
[0044] S2, performing random background filling on the geometrically transformed image;
[0045] S3, through the multi-directional image blur augmentation algorithm, help the model learn and deal with imaging blur problems;
[0046] S4. Combining traditional image augmentation methods, we obtain an image augmentation model with adjustable random parameters.
[0047] In step S1, the image augmentation based on geometric transformation includes performing similarity transformation on a finite sample set, wherein the similarity transformation includes a rigid transformation, and the translation and rotation of the image are described by the rigid transformation. When performing the rigid transformation, the shape of the image is not distorted, and the size is not changed. A size scaling factor is added to the basis of the rigid transformation, so that when the image is subjected to the similarity transformation, the image can be translated, rotated, and isotropically scaled, so that the original shape of the object in the image is not distorted and the size of the object can be changed. The rigid transformation of the image is described by a rigid transformation matrix, and the similarity transformation of the image is described by a similarity transformation matrix;
[0048] The rigid transformation matrix M1 is as follows:
[0049]
[0050] Where θ represents the rotation angle of the image, m1 and m2 are the translation amounts of the image origin in the x and y directions respectively. These three parameters are independent of each other and represent the degrees of freedom in three directions.
[0051] Similarity transformation matrix M2
[0052]
[0053] Where θ represents the rotation angle of the image, m1 and m2 are the translation amounts of the image origin in the x and y directions respectively, and s is the scale factor; the image is scaled by similarity transformation;
[0054] In step S1, the image augmentation based on geometric transformation includes performing an affine transformation on a finite sample. When performing the affine transformation, the original image needs to be read first, and then the coordinate points of the upper left corner and the lower right corner of the original image are obtained. After the discrete difference values of the upper left corner and the lower right corner are calculated respectively, all the coordinate points of the image are obtained according to the discrete values, and then the required width value and height value of the new image are calculated. The maximum value of the horizontal difference value is selected according to the width value, and the maximum value of the vertical difference value is selected according to the height value. Then, the coordinate points of the four corners of the new image are constructed, and the affine transformation matrix is obtained and applied through the coordinate points of the four corners of the new image, and the transformed new image is obtained through the affine transformation.
[0055] The affine transformation matrix is as follows:
[0056]
[0057] In the formula, s x and y Control the image scaling and flipping, a x and a y Control rotation and tilt, t x and t yControl translation; in scenarios where moving platform target detection and tracking is performed using affine transformations, the rotation of the target outside the image plane can be augmented;
[0058] In step S1, the image augmentation based on geometric transformation includes performing a projection transformation on a finite sample, establishing a three-dimensional model of the sample before the projection transformation, and then defining a projection plane according to the sight direction, so that the projection plane is perpendicular to the plane of the sight direction, and then performing a projection transformation according to the camera direction and the sight direction, simulating the way the human eye sees things through a perspective projection transformation, following the principle that near objects are large and far objects are small, projecting the image onto the projection plane, compressing the image space through a transformation matrix so that it corresponds to the coordinates of a true perspective projection, and then re-orthogonally projecting the compressed space into a standard small cube, performing a projection transformation through a perspective projection transformation matrix, and finally restoring the image ratio through a viewport transformation; through the projection transformation, augmenting the camera perspective change or target rotation, so that the small sample set image augmentation model can be effectively applied to the scene of three-dimensional target tracking;
[0059] In step S2, random background filling is performed on the image after affine transformation and projection transformation to cope with the problem of missing edge information of the image after geometric transformation, and the edge information missing area is filled by randomly cropping the non-target area, and then the quality of the sample image area is improved to prevent the imbalance of the feature information of the sample, and random background filling is performed through the filling formula to improve the target detection performance;
[0060] The filling formula is as follows:
[0061]
[0062] Where I(x,y) is the filled image, g(x,y) is the background image, and t(x,y) is the image after affine transformation or projection transformation. By cropping the non-target area and filling the missing parts caused by the geometric transformation as the augmented area, the similarity of the background area is ensured and the training efficiency of the model is improved.
[0063] In step S3, a multi-directional graphic fuzzy augmentation algorithm is used to help the model learn and process the problem of imaging blur caused by platform jitter and rapid target movement when the camera is tracking a moving platform. The multi-directional graphic augmentation algorithm includes a multi-directional superposition blur algorithm, which simulates the actual imaging effect by recombining, rotating, displacing and superimposing the original image samples. After the original samples are transparentized, superposition operations are performed in the vertical, horizontal and four 45-degree oblique directions;
[0064] The multi-directional superposition fuzzy algorithm is as follows:
[0065]
[0066]
[0067]
[0068] In the formula, taking RGB image as an example, n is the number of superpositions each time, α bi The transparency of each sample when superimposed, and α bi The value range is from 0 to 1. bi When α is 1, it is completely transparent. bi When it is 0, it is opaque. A Represents the pixel value of the sample corresponding to the position after the image is augmented, and the p of each channel A It is composed of the displacement and superposition of sample pixels after increasing transparency, T i is the displacement matrix corresponding to the superimposed sub-image;
[0069] The displacement matrix is as follows:
[0070]
[0071] Among them, t ui and t vi is the displacement of the image in the coordinate system, through the stacking direction and stacking step length t b The blur caused by camera shake and rapid target motion is processed by multi-directional image augmentation algorithm.
[0072] In step S4, the traditional image augmentation includes flipping or cropping the image and changing the image brightness. In the image flipping, the image is operated horizontally or vertically along an axis of the image. The image flipping enables the image augmentation model to learn the feature expression of the sample symmetry direction. In the random cropping of the image, the image is intercepted on a two-dimensional scale. After obtaining the local image of the image, the intercepted image is enlarged. The original feature information in the image is retained by cropping the image, and the features of the graphic are enriched by enlarging it. In the image brightness change, the image brightness coefficient is adjusted to make the image augmentation model suitable for more complex lighting environments; the image flipping enables the image augmentation model to learn the feature expression of the sample symmetry direction;
[0073] In step S4, the traditional image augmentation includes random Gaussian noise injection and color space jittering. In the random Gaussian noise injection, various noises and interferences that may be generated during visual imaging are simulated, and a new graphic sample with uncertain noise interference superposition is generated by randomly superimposing additional interference information on pixels in the original image. In the color space jittering, the image is converted from the RGB color space to the CMY color space through the transformation of the color space. Through the Gaussian noise injection, the image augmentation model can simulate the noise that may be generated in practical applications through noise injection;
[0074] In step S4, after traditional image augmentation, a probability factor is obtained according to the characteristics of the actual use environment. When the augmented object is a target with obvious rotation, the probability factor of geometric augmentation is increased. When the augmented object is a target with occlusion, the probability factor of cropping augmentation is increased. When outdoor tracking is performed for a long time, due to the unstable brightness of the light, the probability factor of brightness augmentation is increased. When the augmented object is a platform jitter and a high-speed target, the probability factor of fuzzy augmentation is increased. With more probability factors, by changing the size of the probability factor, an image augmentation model with adjustable random parameters is obtained, so that various types of interference in image acquisition can be simulated to better train the sample set; by changing the size of the probability factor, the image augmentation model is adjusted to perform efficient sample augmentation in different application scenarios and for different targets.
[0075] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.
[0076] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A method for constructing a small-scale sample set image augmentation model, characterized in that The following steps are involved: S1. Perform image augmentation based on geometric transformation on a finite sample set; In the step S1, the image augmentation based on geometric transformation includes performing similarity transformation on a finite sample set, the similarity transformation includes rigid transformation, and the translation and rotation of the image are described by the rigid transformation. When the rigid transformation is performed, the shape of the image is not distorted, and the size is not changed. A size scaling factor is added to the basis of the rigid transformation, so that when the image is subjected to similarity transformation, the image can be translated, rotated, and isotropically scaled, so that the original shape of the object in the image is not distorted and the size of the object can be changed. The rigid transformation of the image is described by a rigid transformation matrix, and the similarity transformation of the image is described by a similarity transformation matrix; In the step S1, the image augmentation based on geometric transformation includes performing an affine transformation on a finite sample. When performing the affine transformation, the original image needs to be read first, and then the coordinate points of the upper left corner and the lower right corner of the original image are obtained. After the discrete difference values of the upper left corner and the lower right corner are calculated respectively, all the coordinate points of the image are obtained according to the discrete values, and then the required width value and height value of the new image are calculated. The maximum value of the horizontal difference value is selected according to the width value, and the maximum value of the vertical difference value is selected according to the height value. Then, the coordinate points of the four corners of the new image are constructed, and the affine transformation matrix is obtained and applied through the coordinate points of the four corners of the new image, and the transformed new image is obtained through the affine transformation. In the step S1, the image augmentation based on geometric transformation includes performing a projection transformation on a finite sample, establishing a three-dimensional model of the sample before the projection transformation, and then defining a projection plane according to the sight line direction, so that the projection plane is perpendicular to the plane of the sight line direction, and then performing a projection transformation according to the camera direction and the sight line direction, simulating the way the human eye sees things through perspective projection transformation, following the principle that near objects are large and far objects are small, projecting the image onto the projection plane, compressing the image space through a transformation matrix so that it corresponds to the coordinates of a true perspective projection, and then re-orthogonally projecting the compressed space into a standard small cube, performing a projection transformation through a perspective projection transformation matrix, and finally restoring the image ratio through a viewport transformation; S2, performing random background filling on the geometrically transformed image; In the step S2, random background filling is performed on the image after affine transformation and projection transformation to cope with the problem of missing edge information of the image after geometric transformation, and the edge information missing area is filled by randomly cropping the non-target area, and then the quality of the sample image area is improved to prevent the imbalance of the feature information of the sample, and random background filling is performed by the filling formula to improve the target detection performance; S3, through the multi-directional image blur augmentation algorithm, help the model learn and deal with imaging blur problems; S4. Combining the traditional image augmentation method, an image augmentation model with adjustable random parameters is obtained; In step S4, the conventional image augmentation includes random Gaussian noise injection and color space dithering. In the random Gaussian noise injection, various noises and interferences that may be generated during visual imaging are simulated, and a new graphic sample with uncertain noise interference superposition is generated by randomly superimposing additional interference information on pixels in the original image. In the color space dithering, the image is converted from the RGB color space to the CMY color space through the transformation of the color space. In the step S4, the traditional image augmentation includes flipping or cropping the image and changing the image brightness. In the image flipping, the image is operated horizontally or vertically along an axis of the image. The image flipping enables the image augmentation model to learn the feature expression of the sample symmetry direction. In the random cropping of the image, the image is intercepted on a two-dimensional scale. After obtaining the local image of the image, the intercepted image is enlarged. The original feature information in the image is retained by cropping the image, and the features of the graphic are enriched by enlarging it. In the image brightness change, the brightness coefficient of the image is adjusted to make the image augmentation model suitable for more complex lighting environments.
2. The method for constructing a small-scale sample set image augmentation model according to claim 1, characterized in that: In step S3, a multi-directional graphic fuzzy augmentation algorithm is used to help the model learn and process the problem of imaging blur caused by platform jitter and rapid target movement when the camera tracks the moving platform. The multi-directional graphic augmentation algorithm includes a multi-directional superposition blur algorithm, which simulates the actual imaging effect by recombining, rotating, displacing and superimposing the original image samples. After the original samples are made transparent, superposition operations are performed in the vertical, horizontal and four forty-five degree oblique directions.
3. The method for constructing a small-scale sample set image augmentation model according to claim 1, characterized in that: In the step S4, after traditional image augmentation, a probability factor is obtained according to the characteristics of the actual use environment. When the augmented object is a target with obvious rotation, the probability factor of geometric augmentation is increased. When the augmented object is a target with occlusion, the probability factor of cropping augmentation is increased. When outdoor tracking is performed for a long time, due to the unstable brightness of the illumination, the probability factor of brightness augmentation is increased. When the augmented object is a platform jitter and a high-speed target, the probability factor of fuzzy augmentation is increased. With more probability factors, by changing the size of the probability factor, an image augmentation model with adjustable random parameters is obtained, so that various types of interference in image acquisition can be simulated to better train the sample set.
