A method, device and storage medium for data augmentation

By performing gamma correction, occlusion processing and spatial transformation on the training data of the target tracking model, a rich and diverse sample set is generated, which solves the problem of insufficient training data in the field of target tracking and improves the recognition and tracking accuracy of the model.

CN115018875BActive Publication Date: 2024-09-13ZHEJIANG DAHUA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210710444.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-22
Publication Date
2024-09-13
Estimated Expiration
2042-06-22

AI Technical Summary

Technical Problem

In the existing technology, there is a problem of insufficient training data in the field of target tracking, resulting in low accuracy of deep learning models in identifying and tracking targets.

Method used

By obtaining the original sample set containing the tracking target, based on the motion preference of the tracking target and the impact of the external environment on the tracking target, gamma correction, occlusion processing and spatial transformation are performed on the original sample image to generate the first image corresponding to the impact of the external environment. This set and the second sample set corresponding to exercise preferences form a rich and diverse training sample set.

Benefits of technology

It effectively avoids the problem of insufficient training data, improves the recognition and tracking accuracy of the target tracking model, and enables the trained model to more accurately identify and track targets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115018875B
    Figure CN115018875B
Patent Text Reader

Abstract

The present invention discloses a data augmentation method, device and storage medium, which are used to solve the technical problem of insufficient training data of a tracking target existing in the prior art. The method comprises: obtaining an original sample set containing a tracking target; transforming original sample images in the original sample set according to the motion preference of the tracking target and the influence of the external environment on the tracking target to obtain a first sample set corresponding to the influence of the external environment and a second sample set corresponding to the motion preference; and using a set consisting of the original sample set, the first sample set and the second sample set as a training sample set of a target tracking model of the tracking target.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of target tracking, and in particular to a method, device and storage medium for data augmentation. Background Art

[0002] The field of target tracking includes two branches, one is single target tracking and the other is multi-target tracking.

[0003] Whether it is single target tracking or multi-target tracking, it is necessary to correctly identify the tracking target. In the prior art, a data training set formed by a large number of images containing the tracking target is usually used to train the deep learning model to obtain a trained deep learning model. Then, in the process of target tracking, the trained deep learning model is used to identify the tracking target appearing in each frame of the video, and the tracking process of the tracking target is completed.

[0004] In the prior art, in order to improve the accuracy of the trained deep learning model in identifying the tracking target, the existing sample images containing the tracking target are usually augmented by color conversion, noise addition, etc., so that the deep training model has more sample images.

[0005] However, due to the complexity of the target tracking task, the changes in image information related to the tracked target are not limited to a single color change, which means that the existing solutions for augmenting sample images of the tracked target still have the problem of insufficient training data.

[0006] In view of this, how to solve the problem of insufficient training data for tracking targets has become a technical problem that needs to be solved urgently. Summary of the invention

[0007] The present invention provides a data augmentation method, device and storage medium, which are used to solve the technical problem of insufficient training data for tracking targets in the prior art.

[0008] In the first aspect, in order to solve the above technical problems, a technical solution of a data augmentation method provided by an embodiment of the present invention is as follows:

[0009] Obtain the original sample set containing the tracking target;

[0010] According to the motion preference of the tracking target and the influence of the external environment on the tracking target, the original sample images in the original sample set are transformed to obtain a first sample set corresponding to the influence of the external environment and a second sample set corresponding to the motion preference;

[0011] The set consisting of the original sample set, the first sample set, and the second sample set is used as a training sample set of a target tracking model of the tracking target.

[0012] A possible implementation manner, according to the motion preference of the tracking target and the influence of the external environment on the tracking target, transforming the original sample images in the original sample set to obtain a first sample set corresponding to the influence of the external environment and a second sample set corresponding to the motion preference, includes:

[0013] According to the probability of the illumination of the external environment changing, randomly selecting original sample images of a first part of the original sample set corresponding to the probability of the illumination changing from the original sample set, performing gamma correction, and obtaining a corrected sample set;

[0014] According to the occlusion probability of the tracking target by the occlusion object in the external environment, randomly selecting original sample images of the second part of the original sample set corresponding to the occlusion probability from the original sample set, performing occlusion processing, and obtaining a sample set after occlusion;

[0015] Taking a set consisting of the corrected sample set and the occluded sample set as the first sample set;

[0016] According to the motion preference of the tracking target, the original sample images in the original sample set are spatially transformed to obtain the second sample set.

[0017] In a possible implementation manner, randomly selecting original sample images of a first part of the original sample set corresponding to the occlusion probability from the original sample set, performing occlusion processing, and obtaining the sample set after occlusion, includes:

[0018] Determine the size and color of the occlusion block, and the placement position of the occlusion block in the original sample image of the first part of the original sample set;

[0019] The occlusion block having the size and the color is superimposed on the placement position in the original sample image of the first part of the original sample set to obtain the occluded sample set.

[0020] In a possible implementation manner, determining the size and color of the occlusion block and the placement position of the occlusion block in the original sample image of the first part of the original sample set to obtain the occluded sample set includes:

[0021] Determining the area of ​​the occlusion block according to the area of ​​the original sample image and the area control factor of the occlusion block; wherein the area control factor is the ratio of the area of ​​the occlusion block to the area of ​​the original sample image;

[0022] Determine the length and width of the occlusion block according to the shape control factor of the occlusion block and the area of ​​the occlusion block; the shape control factor is a constant;

[0023] Determine the area of ​​the blocking block in the original sample image according to the length and width, and the placement position;

[0024] The data of each pixel in the region is replaced with data of a corresponding color to obtain a corresponding image in the masked sample set.

[0025] In a possible implementation, spatially transforming the original sample images in the original sample set according to the motion preference of the tracking target to obtain the second sample set includes:

[0026] The probability of occurrence of each movement direction of the tracking target is set to the proportion of the spatial transformation corresponding to each movement direction; wherein the probability of occurrence of each movement direction of the tracking target is used to characterize the movement preference;

[0027] For each of the motion directions, randomly selecting original sample images in a third part of the original sample set corresponding to the proportion from the original sample set, and performing corresponding spatial changes to obtain a sample set corresponding to each of the motion directions;

[0028] A set consisting of sample sets in all motion directions is taken as the first sample set.

[0029] In a possible implementation manner, the space transformation includes:

[0030] The image can be flipped horizontally, flipped vertically, or rotated at random angles.

[0031] In a possible implementation manner, when the spatial transformation is the random angle rotation of the image, randomly selecting original sample images in a part of the original sample set corresponding to the proportion from the original sample set and performing corresponding spatial changes to obtain a sample set corresponding to each motion direction includes:

[0032] Taking the center of the original sample image in the part of the original sample set as the rotation center, rotating the corresponding original sample image to obtain a rotated original sample image;

[0033] Pixel data in the rotated original sample image that exceeds the range of the corresponding original sample image is discarded, and pixels without data in the rotated original sample image are filled with specified data to obtain a sample set with a movement direction corresponding to the random angle rotation of the image.

[0034] In a second aspect, an embodiment of the present invention provides a data augmentation device, including:

[0035] An acquisition unit, used for acquiring an original sample set containing a tracking target;

[0036] an augmentation unit, which transforms the original sample images in the original sample set according to the motion preference of the tracking target and the influence of the external environment on the tracking target, to obtain a first sample set corresponding to the influence of the external environment and a second sample set corresponding to the motion preference;

[0037] The collection unit is used to use the collection consisting of the original sample set, the first sample set, and the second sample set as a training sample set of the target tracking model of the tracking target.

[0038] In a possible implementation manner, the augmentation unit is further configured to:

[0039] According to the probability of the illumination of the external environment changing, randomly selecting original sample images of a first part of the original sample set corresponding to the probability of the illumination changing from the original sample set, performing gamma correction, and obtaining a corrected sample set;

[0040] According to the occlusion probability of the tracking target by the occlusion object in the external environment, randomly selecting original sample images of the second part of the original sample set corresponding to the occlusion probability from the original sample set, performing occlusion processing, and obtaining a sample set after occlusion;

[0041] Taking a set consisting of the corrected sample set and the occluded sample set as the first sample set;

[0042] According to the motion preference of the tracking target, the original sample images in the original sample set are spatially transformed to obtain the second sample set.

[0043] In a possible implementation manner, the augmentation unit is further configured to:

[0044] Determine the size and color of the occlusion block, and the placement position of the occlusion block in the original sample image of the first part of the original sample set;

[0045] The occlusion block having the size and the color is superimposed on the placement position in the original sample image of the first part of the original sample set to obtain the occluded sample set.

[0046] In a possible implementation manner, the augmentation unit is further configured to:

[0047] Determining the area of ​​the occlusion block according to the area of ​​the original sample image and the area control factor of the occlusion block; wherein the area control factor is the ratio of the area of ​​the occlusion block to the area of ​​the original sample image;

[0048] Determine the length and width of the occlusion block according to the shape control factor of the occlusion block and the area of ​​the occlusion block; the shape control factor is a constant;

[0049] Determine the area of ​​the blocking block in the original sample image according to the length and width, and the placement position;

[0050] The data of each pixel in the region is replaced with data of a corresponding color to obtain a corresponding image in the masked sample set.

[0051] In a possible implementation manner, the augmentation unit is further configured to:

[0052] The probability of occurrence of each movement direction of the tracking target is set to the proportion of the spatial transformation corresponding to each movement direction; wherein the probability of occurrence of each movement direction of the tracking target is used to characterize the movement preference;

[0053] For each of the motion directions, randomly selecting original sample images in a third part of the original sample set corresponding to the proportion from the original sample set, and performing corresponding spatial changes to obtain a sample set corresponding to each of the motion directions;

[0054] A set consisting of sample sets in all motion directions is taken as the first sample set.

[0055] In a possible implementation manner, the space transformation includes:

[0056] The image can be flipped horizontally, flipped vertically, or rotated at random angles.

[0057] In a possible implementation manner, the augmentation unit is further configured to:

[0058] When the spatial transformation is a random angle rotation of the image, the corresponding original sample image is rotated with the center of the original sample image in the partial original sample set as the rotation center to obtain a rotated original sample image;

[0059] Pixel data in the rotated original sample image that exceeds the range of the corresponding original sample image is discarded, and pixels without data in the rotated original sample image are filled with specified data to obtain a sample set with a movement direction corresponding to the random angle rotation of the image.

[0060] In a third aspect, an embodiment of the present invention further provides a data augmentation device, including:

[0061] at least one processor, and

[0062] a memory coupled to the at least one processor;

[0063] The memory stores instructions that can be executed by the at least one processor, and the at least one processor executes the method as described in the first aspect above by executing the instructions stored in the memory.

[0064] In a fourth aspect, an embodiment of the present invention further provides a readable storage medium, including:

[0065] Memory,

[0066] The memory is used to store instructions. When the instructions are executed by the processor, the device including the readable storage medium performs the method described in the first aspect above.

[0067] Through the technical solutions in one or more of the above embodiments of the embodiments of the present invention, the embodiments of the present invention have at least the following technical effects:

[0068] In the embodiment provided by the present invention, by transforming the original sample images in the original sample set according to the motion preference of the tracking target and the influence of the external environment on the tracking target, a first sample set corresponding to the influence of the external environment and a second sample set corresponding to the motion preference are obtained, so that the sample images of the tracking target can be made richer and more diverse, and more in line with the motion characteristics and the environment of the tracking target. In this way, the set consisting of the original sample set, the first sample set, and the second sample set is used as a training sample set of the target tracking model of the tracking target, which can not only avoid the problem of insufficient training data, but also enable the trained target tracking model obtained by training with the above training sample set to more accurately identify and track the tracking target. BRIEF DESCRIPTION OF THE DRAWINGS

[0069] Figure 1 A flowchart of a data augmentation method provided by an embodiment of the present invention;

[0070] Figure 2 A schematic diagram of an original sample set provided by an embodiment of the present invention;

[0071] Figure 3 A schematic diagram of occlusion of a tracking target provided by an embodiment of the present invention;

[0072] Figure 4 A schematic diagram of horizontal flipping of an image provided by an embodiment of the present invention;

[0073] Figure 5 A schematic diagram of vertically flipping an image provided by an embodiment of the present invention;

[0074] Figure 6 A schematic diagram of random angle rotation of an image provided by an embodiment of the present invention;

[0075] Figure 7A schematic diagram of another random angle rotation of an image provided by an embodiment of the present invention;

[0076] Figure 8 A schematic diagram of the structure of a data augmentation device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0077] The embodiments of the present invention provide a method, device and storage medium for data augmentation, which are used to solve the technical problem of insufficient training data for tracking targets in the prior art.

[0078] In order to better understand the above technical scheme, the technical scheme of the present invention is described in detail below through the accompanying drawings and specific embodiments. It should be understood that the embodiments of the present invention and the specific features in the embodiments are detailed descriptions of the technical scheme of the present invention, rather than limitations on the technical scheme of the present invention. In the absence of conflict, the embodiments of the present invention and the technical features in the embodiments can be combined with each other.

[0079] Please refer to Figure 1 , an embodiment of the present invention provides a method for data augmentation, and the processing process of the method is as follows.

[0080] Step 101: obtaining an original sample set containing a tracking target;

[0081] See also Figure 2 A schematic diagram of an original sample set provided by an embodiment of the present invention, Figure 2 The original sample set containing the tracking target as a bird is shown. Figure 2 The original sample set of the small bird includes 4 original sample images (recorded as a, b, c, d in sequence). The flight postures of the small bird in these 4 original sample images are different. In order to improve the accuracy of the target tracking model training for the small bird, it is necessary to increase the sample size, which can be specifically achieved using steps 102 and 103.

[0082] Step 102: According to the motion preference of the tracking target and the influence of the external environment on the tracking target, the original sample images in the original sample set are transformed to obtain a first sample set corresponding to the influence of the external environment and a second sample set corresponding to the motion preference.

[0083] The tracking target has its own preferences when moving. For example, if the tracking target is a bird, it often flies in a specific direction (such as Figure 2 For example, if the bird is flying to the right as shown in a and d in the figure, it can be considered that the bird's movement preference is to fly to the right, and when the original sample image is transformed, more sample images flying to the right are generated; for another example, the bird flies at different times and is affected by the external environment differently, so the original sample image can also be transformed according to the impact of the external environment on the bird to generate a sample image.

[0084] In a possible implementation, according to the motion preference of the tracking target and the influence of the external environment on the tracking target, the original sample images in the original sample set are transformed to obtain a first sample set corresponding to the influence of the external environment and a second sample set corresponding to the motion preference, which can be implemented in the following manner:

[0085] According to the probability of the illumination of the external environment changing, original sample images of the first part of the original sample set corresponding to the probability of the illumination changing are randomly selected from the original sample set, and gamma correction is performed to obtain a corrected sample set.

[0086] For example, the tracking target is a bird, which usually flies in the air. At this time, the light of the external environment is affected by the weather. For example, in a certain place, it is mostly sunny and the sky is generally blue, but it may be cloudy (the color of the sky is light gray), or at dawn, the sky is full of red clouds. Then, when transforming the original sample image, the corresponding color channel can be set according to the color of the sky, such as blue sky (corresponding to blue channel), cloudy sky (corresponding to red channel, blue is the same, different proportions of blue channel), and red sky (corresponding to red channel); at the same time, the probability of blue sky, cloudy sky, and red sky can be statistically determined. The first part of the original sample set containing different numbers of original sample images is selected from the original sample set for image transformation of corresponding color and brightness. For example, the probability of blue sky appearing is 80%, the probability of cloudy sky appearing is 5%, and the probability of red sky appearing is 15%. There are 100 original sample images in total. 80 original sample images can be randomly selected for gamma correction of the blue channel, 5 original sample images can be randomly selected for gamma correction of the channels containing the three primary colors, and 15 original sample images can be randomly selected for gamma correction of the red channel. In this way, a corrected sample set consisting of the original sample images after gamma correction can be obtained.

[0087] The formula used for gamma correction is as follows:

[0088]

[0089] Among them, A is the transformation coefficient, which takes the value of 1; p i,j is the pixel value at position (i, j) in the original sample image. This pixel value can be a normalized value. The value range of γ is (0, 2]. When γ < 1, the grayscale of the original sample image after gamma correction becomes larger (i.e., the brightness becomes brighter). When γ > 1, the grayscale of the original sample image after gamma correction becomes smaller (i.e., the brightness becomes darker). f(p i,j ) is the pixel p in the original sample image i,j Corrected pixel value.

[0090] The above formula (1) can be used to complete the brightness transformation of the original sample image, and all images obtained by transforming the original sample image based on the light of the above external environment constitute a corrected sample set.

[0091] For example, if the probability that the light in the external environment of a certain tracking target makes the brightness of the environment usually a certain value (corresponding to r being 0.8) is 30%, then 30% of the original sample images can be selected from the original sample set containing the tracking target for gamma correction to obtain a corrected sample set.

[0092] In addition, according to the occlusion probability of the tracking target by the occlusion object in the external environment, the original sample images of the second part of the original sample set corresponding to the occlusion probability can be randomly selected from the original sample set, and occlusion processing can be performed to obtain the sample set after occlusion.

[0093] Not only the light in the external environment can affect the tracking target, but also the occlusions. For example, if a sheep is in a fence, the fence is an occlusion (shown as an occlusion block in the image). A bird flying through the woods may be blocked by leaves, and the leaves become occlusions. The original sample image can be transformed according to these occlusions that may affect the tracking target to obtain the original sample image after occlusion, forming a sample set after occlusion.

[0094] For example, if the tracking target is a sheep and the probability of being blocked by a fence is 50%, 50% of the original sample images can be selected from the original sample set of the sheep for occlusion processing to obtain a sample set after occlusion.

[0095] In a possible implementation, the original sample images of the second part of the original sample set corresponding to the occlusion probability are randomly selected from the original sample set, and occlusion processing is performed to obtain the sample set after occlusion, which can be achieved in the following manner:

[0096] Determine the size and color of the occlusion block, and the placement position in the original sample image of the first part of the original sample set; superimpose the occlusion block with the size and color to the placement position in the original sample image of the first part of the original sample set to obtain the occluded sample set.

[0097] The above-mentioned blocking block may be a block filled with mosaic color.

[0098] See also Figure 3 A schematic diagram of occlusion of a tracking target provided by an embodiment of the present invention. Figure 3The tracking target in the image is a sheep, and the occluder is a fence. The fence is rectangular, usually sized w×h in the image, and its color is black. Within 2 / 3 of the height of the original sample image, according to the above information, an occluding block sized w×h and colored black can be randomly placed within 2 / 3 of the height of the original sample image, thereby forming the original sample image after occlusion. Assuming the probability of the above occlusion occurring is 60%, then 60% of the original sample images in the original sample set are subjected to the occlusion process described above to form the occluded sample set.

[0099] A possible implementation method is to determine the size and color of the occluding block, as well as its placement position in the original sample images of the first part of the original sample set, and obtain the occluded sample set, which can be achieved through the following methods:

[0100] Determine the area of the occluding block according to the area of the original sample image and the area control factor of the occluding block; where the area control factor is the ratio of the area of the occluding block to the area of the original sample image; determine the length and width of the occluding block according to the shape control factor of the occluding block and the area of the occluding block; the shape control factor is a constant; determine the area of the occluding block in the original sample image according to the length, width, and placement position; replace the data of each pixel in the area with the data of the corresponding color to obtain the corresponding image in the occluded sample set.

[0101] For example, the area of the original sample image is S 1 , and the area control factor is r 1 , then the area S 2 of the occluding block = S 1 × r 1 , and the value range of r 1 is (0.03, 0.3).

[0102] If the shape factor of this occluding block is r2, and its value can be set to 0.4, then the width w and height h of the occluding block can be calculated using the following formula:

[0103]

[0104]

[0105] Assuming the position of the upper left corner of the above occluding block placed in the original sample image is (x, y), then placing the occluding block in the original sample image also needs to satisfy the constraint conditions: x + w < m and y + h < n, where m is the width of the original sample image and n is the height of the original sample image.

[0106] Through the above method, an occluding block can be quickly formed in the original sample image through a program, obtaining the original sample image after occlusion, and further forming the occluded sample set.

[0107] The set consisting of the corrected sample set and the occluded sample set is taken as the first sample set.

[0108] In addition, the original sample images in the original sample set may be spatially transformed according to the motion preference of the tracking target to obtain a second sample set.

[0109] In the embodiment provided by the present invention, the spatial transformation includes horizontal flipping of the image, vertical flipping of the image, and random angle rotation of the image.

[0110] According to the motion preference of the tracking target, spatial transformation is performed on the original sample images in the original sample set to obtain the second sample set, which can be achieved in the following manner:

[0111] The probability of each motion direction of the tracked target appearing is set to the proportion of the spatial transformation corresponding to each motion direction; wherein the probability of each motion direction of the tracked target appearing is used to characterize the motion preference; for each motion direction, the original sample images in the third part of the original sample set corresponding to the proportion are randomly selected from the original sample set to perform corresponding spatial changes to obtain the sample set corresponding to each motion direction; and the set consisting of the sample sets of all motion directions is taken as the first sample set.

[0112] For example, the probability of the tracked target moving in the horizontal direction (corresponding to horizontal image flipping) is 50%, the probability of moving in the vertical direction (corresponding to vertical image flipping) is 20%, and the probability of moving in directions other than the horizontal and vertical directions (corresponding to random angle rotation of the image) is 10%. 50% of the original sample images can be randomly selected from the original sample set for horizontal image flipping, such as Figure 4 FIG. 2 is a schematic diagram of horizontal flipping of an image provided by an embodiment of the present invention; 20% of the original sample images are randomly selected from the original sample set to perform vertical flipping of the images, such as Figure 5 FIG. 1 is a schematic diagram of vertical flipping of an image provided by an embodiment of the present invention; 10% of the original sample images are randomly selected from the original sample set to perform random angle rotation of the images (ie, the rotation angle is random), as shown in FIG. Figure 6 Shown is a schematic diagram of random angle rotation of an image provided by an embodiment of the present invention.

[0113] When the spatial transformation is a random angle rotation of the image, the original sample images in the original sample set corresponding to the proportion are randomly selected from the original sample set to perform corresponding spatial changes to obtain the sample set corresponding to each motion direction. This can be achieved by the following method:

[0114] Taking the center of the original sample image in part of the original sample set as the rotation center, the corresponding original sample image is rotated to obtain the rotated original sample image; the pixel data in the rotated original sample image that exceeds the range of the corresponding original sample image is discarded, and the pixels without data in the range of the original sample image are filled with specified data to obtain a sample set with a movement direction corresponding to the random angle rotation of the image.

[0115] See also Figure 7 A schematic diagram of another random angle rotation of an image provided by an embodiment of the present invention.

[0116] Figure 7 The center of the original sample image is selected as the center, and it is randomly rotated to the left by a certain angle to obtain the rotated original sample image, and the pixel data that exceeds the range of the original sample image (that is, the part outside the range of the original sample image) is discarded, and the pixels without data in the range of the original sample image are filled with white data (that is, the specified data) (that is, the filling part), so that Figure 6 The rotated original sample image shown in , the same processing method can be used to perform random angle rotation on the remaining selected original sample images, and then a sample set with a movement direction corresponding to the random angle rotation of the image can be obtained.

[0117] The set consisting of the sample set obtained after horizontal flipping of the image, the sample set obtained after vertical flipping of the image, and the sample set obtained after random angle rotation of the image is used as the second sample set.

[0118] After obtaining the first sample set and the second sample set, step 103 is executed.

[0119] Step 103: The set consisting of the original sample set, the first sample set, and the second sample set is used as a training sample set of a target tracking model for tracking the target.

[0120] The training samples obtained in the above manner can be used to train the target tracking model of the tracking target until the recognition rate of the tracking target reaches a set threshold, and the training is stopped to obtain a trained tracking target model. The above tracking target model can be a deep learning model.

[0121] In the embodiment provided by the present invention, by transforming the original sample images in the original sample set according to the motion preference of the tracking target and the influence of the external environment on the tracking target, a first sample set corresponding to the influence of the external environment and a second sample set corresponding to the motion preference are obtained, so that the sample images of the tracking target can be made richer and more diverse, and more in line with the motion characteristics and the environment of the tracking target. In this way, the set consisting of the original sample set, the first sample set, and the second sample set is used as a training sample set of the target tracking model of the tracking target, which can not only avoid the problem of insufficient training data, but also enable the trained target tracking model obtained by training with the above training sample set to more accurately identify and track the tracking target.

[0122] In the process of forming the first sample set and the second sample set, probability is used to control the number of corresponding image transformations under different lighting and different motion preferences, so that the obtained training sample set has a specific motion preference and simulates a specific environment, so that the trained target tracking model can be well used to track the changes in the scene and the motion characteristics of the target.

[0123] Based on the same inventive concept, an embodiment of the present invention provides a data augmentation device. The specific implementation of the data augmentation method of the device can be found in the description of the method embodiment part. The repeated parts will not be repeated. Please refer to Figure 8 , the device comprises:

[0124] An acquisition unit 801 is used to acquire an original sample set containing a tracking target;

[0125] The augmentation unit 802 transforms the original sample images in the original sample set according to the motion preference of the tracking target and the influence of the external environment on the tracking target to obtain a first sample set corresponding to the influence of the external environment and a second sample set corresponding to the motion preference;

[0126] The collection unit 803 is used to use the set consisting of the original sample set, the first sample set, and the second sample set as a training sample set of the target tracking model of the tracking target.

[0127] In a possible implementation manner, the augmentation unit 802 is further configured to:

[0128] According to the probability of the illumination of the external environment changing, randomly selecting original sample images of a first part of the original sample set corresponding to the probability of the illumination changing from the original sample set, performing gamma correction, and obtaining a corrected sample set;

[0129] According to the occlusion probability of the tracking target by the occlusion object in the external environment, randomly selecting original sample images of the second part of the original sample set corresponding to the occlusion probability from the original sample set, performing occlusion processing, and obtaining a sample set after occlusion;

[0130] Taking a set consisting of the corrected sample set and the occluded sample set as the first sample set;

[0131] According to the motion preference of the tracking target, the original sample images in the original sample set are spatially transformed to obtain the second sample set.

[0132] In a possible implementation manner, the augmentation unit 802 is further configured to:

[0133] Determine the size and color of the occlusion block, and the placement position of the occlusion block in the original sample image of the first part of the original sample set;

[0134] The occlusion block having the size and the color is superimposed on the placement position in the original sample image of the first part of the original sample set to obtain the occluded sample set.

[0135] In a possible implementation manner, the augmentation unit 802 is further configured to:

[0136] Determining the area of ​​the occlusion block according to the area of ​​the original sample image and the area control factor of the occlusion block; wherein the area control factor is the ratio of the area of ​​the occlusion block to the area of ​​the original sample image;

[0137] Determine the length and width of the occlusion block according to the shape control factor of the occlusion block and the area of ​​the occlusion block; the shape control factor is a constant;

[0138] Determine the area of ​​the blocking block in the original sample image according to the length and width, and the placement position;

[0139] The data of each pixel in the region is replaced with data of a corresponding color to obtain a corresponding image in the masked sample set.

[0140] In a possible implementation manner, the augmentation unit 802 is further configured to:

[0141] The probability of occurrence of each movement direction of the tracking target is set to the proportion of the spatial transformation corresponding to each movement direction; wherein the probability of occurrence of each movement direction of the tracking target is used to characterize the movement preference;

[0142] For each of the motion directions, randomly selecting original sample images in a third part of the original sample set corresponding to the proportion from the original sample set, and performing corresponding spatial changes to obtain a sample set corresponding to each of the motion directions;

[0143] A set consisting of sample sets in all motion directions is taken as the first sample set.

[0144] In a possible implementation manner, the space transformation includes:

[0145] The image can be flipped horizontally, flipped vertically, or rotated at random angles.

[0146] In a possible implementation manner, the augmentation unit 802 is further configured to:

[0147] When the spatial transformation is a random angle rotation of the image, the corresponding original sample image is rotated with the center of the original sample image in the partial original sample set as the rotation center to obtain a rotated original sample image;

[0148] Pixel data in the rotated original sample image that exceeds the range of the corresponding original sample image is discarded, and pixels without data in the rotated original sample image are filled with specified data to obtain a sample set with a movement direction corresponding to the random angle rotation of the image.

[0149] It should be noted that the division of units in the embodiments of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation. In addition, each functional unit in each embodiment of the present application may be integrated into a processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0150] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a processor-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program codes.

[0151] It should be noted here that the above-mentioned device provided in the embodiment of the present invention can implement all the method steps implemented in the above-mentioned method embodiment, and can achieve the same technical effect. The parts and beneficial effects that are the same as the method embodiment in this embodiment will not be described in detail here.

[0152] Based on the same inventive concept, an embodiment of the present invention provides a data augmentation device, comprising: at least one processor, and

[0153] a memory coupled to the at least one processor;

[0154] The memory stores instructions that can be executed by the at least one processor, and the at least one processor executes the data augmentation method as described above by executing the instructions stored in the memory.

[0155] Based on the same inventive concept, an embodiment of the present invention further provides a readable storage medium, including:

[0156] Memory,

[0157] The memory is used to store instructions. When the instructions are executed by the processor, the device including the readable storage medium performs the data augmentation method as described above.

[0158] The readable storage medium may be any available medium or data storage device that the processor can access, including volatile memory or non-volatile memory, or may include both volatile memory and non-volatile memory. As an example and not limitation, non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory, solid state disk (SSD), magnetic storage (e.g., floppy disk, hard disk, magnetic tape, magneto-optical disc (MO), etc.), optical storage (e.g., CD, DVD, BD, HVD, etc.). Volatile memory may include random access memory (RAM), which may act as an external cache memory. By way of example and not limitation, RAM is available in a variety of forms, such as dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced synchronous DRAM (ESDRAM), and synchronous link DRAM (SLDRAM). The memory devices of the disclosed aspects are intended to include, but are not limited to, these and other suitable types of memory.

[0159] Those skilled in the art will appreciate that the embodiments of the present invention may be provided as methods, systems, or program products. Therefore, the embodiments of the present invention may be in the form of complete hardware embodiments, complete software embodiments, or embodiments combining software and hardware. Moreover, the embodiments of the present invention may be in the form of machine program products implemented on one or more readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer / processor available program codes.

[0160] The embodiments of the present invention are described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0161] These program instructions may also be stored in a readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0162] These program instructions may also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer / processor-implemented process, thereby providing instructions executed on the computer / processor or other programmable device for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0163] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A method for data augmentation, characterized in that: include: Obtain the original sample set containing the tracking target; According to the motion preference of the tracking target and the influence of the external environment on the tracking target, the original sample images in the original sample set are transformed to obtain a first sample set corresponding to the influence of the external environment and a second sample set corresponding to the motion preference; Using the original sample set, the first sample set, and the second sample set as a set of training sample sets for a target tracking model of the tracking target; According to the motion preference of the tracking target and the influence of the external environment on the tracking target, the original sample images in the original sample set are transformed to obtain a first sample set corresponding to the influence of the external environment and a second sample set corresponding to the motion preference, including: According to the probability of the illumination of the external environment changing, randomly selecting original sample images of a first part of the original sample set corresponding to the probability of the illumination changing from the original sample set, performing gamma correction, and obtaining a corrected sample set; According to the occlusion probability of the tracking target by the occlusion object in the external environment, randomly selecting original sample images of the second part of the original sample set corresponding to the occlusion probability from the original sample set, performing occlusion processing, and obtaining a sample set after occlusion; Taking a set consisting of the corrected sample set and the occluded sample set as the first sample set; According to the motion preference of the tracking target, the original sample images in the original sample set are spatially transformed to obtain the second sample set.

2. The method according to claim 1, characterized in that Randomly selecting original sample images of a first part of the original sample set corresponding to the occlusion probability from the original sample set, performing occlusion processing, and obtaining a sample set after occlusion, including: Determine the size and color of the occlusion block, and the placement position of the occlusion block in the original sample image of the first part of the original sample set; The occlusion block having the size and the color is superimposed on the placement position in the original sample image of the first part of the original sample set to obtain the occluded sample set.

3. The method according to claim 2, characterized in that Determining the size and color of the occlusion block and the placement position of the occlusion block in the original sample image of the first part of the original sample set to obtain the occluded sample set includes: Determining the area of ​​the occlusion block according to the area of ​​the original sample image and the area control factor of the occlusion block; wherein the area control factor is the ratio of the area of ​​the occlusion block to the area of ​​the original sample image; Determine the length and width of the occlusion block according to the shape control factor of the occlusion block and the area of ​​the occlusion block; the shape control factor is a constant; Determine the area of ​​the blocking block in the original sample image according to the length and width, and the placement position; The data of each pixel in the region is replaced with data of a corresponding color to obtain a corresponding image in the masked sample set.

4. The method according to claim 1, characterized in that According to the motion preference of the tracking target, spatially transforming the original sample images in the original sample set to obtain the second sample set includes: The probability of occurrence of each movement direction of the tracking target is set to the proportion of the spatial transformation corresponding to each movement direction; wherein the probability of occurrence of each movement direction of the tracking target is used to characterize the movement preference; For each of the motion directions, randomly selecting original sample images in a third part of the original sample set corresponding to the proportion from the original sample set, and performing corresponding spatial changes to obtain a sample set corresponding to each of the motion directions; A set consisting of sample sets in all motion directions is taken as the first sample set.

5. The method according to claim 4, characterized in that The space transformation comprises: The image can be flipped horizontally, flipped vertically, or rotated at random angles.

6. The method according to claim 5, characterized in that When the spatial transformation is a random angle rotation of the image, randomly selecting original sample images in a portion of the original sample set corresponding to the proportion from the original sample set and performing corresponding spatial changes to obtain a sample set corresponding to each motion direction, including: Taking the center of the original sample image in the part of the original sample set as the rotation center, rotating the corresponding original sample image to obtain a rotated original sample image; Pixel data in the rotated original sample image that exceeds the range of the corresponding original sample image is discarded, and pixels without data in the rotated original sample image are filled with specified data to obtain a sample set with a movement direction corresponding to the random angle rotation of the image.

7. A data augmentation device, characterized in that: include: An acquisition unit, used for acquiring an original sample set containing a tracking target; an augmentation unit, which transforms the original sample images in the original sample set according to the motion preference of the tracking target and the influence of the external environment on the tracking target, to obtain a first sample set corresponding to the influence of the external environment and a second sample set corresponding to the motion preference; A collection unit, used to use the set consisting of the original sample set, the first sample set, and the second sample set as a training sample set of a target tracking model of the tracking target; Among them, according to the motion preference of the tracking target and the influence of the external environment on the tracking target, the original sample images in the original sample set are transformed to obtain a first sample set corresponding to the influence of the external environment and a second sample set corresponding to the motion preference, including: according to the probability of the illumination of the external environment changing, randomly selecting the original sample images of the first part of the original sample set corresponding to the probability of the illumination changing from the original sample set, performing gamma correction, and obtaining a corrected sample set; according to the probability of the occlusion of the tracking target by the occlusion in the external environment, randomly selecting the original sample images of the second part of the original sample set corresponding to the occlusion probability from the original sample set, performing occlusion processing, and obtaining an occluded sample set; taking the set consisting of the corrected sample set and the occluded sample set as the first sample set; according to the motion preference of the tracking target, spatially transforming the original sample images in the original sample set to obtain the second sample set.

8. A data augmentation device, characterized in that: include: at least one processor, and a memory coupled to the at least one processor; The memory stores instructions that can be executed by the at least one processor, and the at least one processor executes the method according to any one of claims 1 to 6 by executing the instructions stored in the memory.

9. A readable storage medium, characterized in that: Including memory, The memory is used to store instructions. When the instructions are executed by the processor, the device including the readable storage medium performs the method as described in any one of claims 1 to 6.