Data enhancement methods can be divided into affine transformation 、 Color change 、 Mixed enhancement . Affine transformation refers to scaling the image 、 rotate 、 Translation and mirroring ; Color change refers to adjusting the lightness of the image 、 Brightness and saturation ( In addition, various filters can be used to blur the image 、 Enhancement and other operations ); Hybrid enhancement refers to the enhancement means of multi graph fusion , Such as mixup、cutmix etc. ( Besides, there are cutup( also called random erasing)).
These enhancement methods can also be divided into homogeneous enhancement and hybrid enhancement , Homogeneous enhancement is achieved by changing an image , So as to achieve the purpose of enhancement ; Hybrid enhancement refers to the fusion of multiple images , The returned tag unique heat code is also fused according to the corresponding proportion . This blog post , This paper mainly introduces mixup and cutmix Implementation of two hybrid methods , Achieve... In two ways , Support static graph and dynamic graph respectively , And ai Frame independent ,pytorch、tensorflow、paddle、keras You can use .
This blog only realizes mixup And cutmix Two data hybrid enhancement methods ,Cutout For the implementation of this method, please refer to python Tool method 21 Applied to semantic segmentation 、 Image classification 、 The image of the automatic coder is random mask Method (Cutout Method 、Random Erasing Method )_ A flash of hope to my blog -CSDN Blog
Such as : cat 、 Dog 、 rabbit 、 rat 、 In the five cattle classification data , There are two data :
Im1: cat ,label1:[1,0,0,0,0]
Im2: rat ,label2:[0,0,0,1,0]
Im1 and Im2