Methods, apparatus, media, and terminals for small sample image augmentation based on channel slice blending and noise stitching
By using channel slicing and noise splicing, image samples are cropped, sliced, channel-blended, and noise-stitched to generate augmented image samples. This solves the problems of long learning time, high cost, and ineffective augmentation in the field of image recognition, and improves the recognition accuracy of the model.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-16
- Publication Date
- 2026-03-13
AI Technical Summary
Existing technologies in the field of image recognition suffer from problems such as insufficient samples, long processing time, high cost, and ineffective amplification in few-sample learning.
The original image samples are cropped, sliced, multi-channel separated, channel mixed and noise stitched using the method of channel slicing and mixing to generate augmented image samples, and random labels are set for the augmented image samples.
It achieves rapid and low-cost image data augmentation, generates rich sample features, significantly improves model performance, increases test accuracy, and solves the problem of insufficient training in small-sample learning.
Smart Images

Figure CN116681963B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of deep learning image recognition technology, and in particular to a method, apparatus, medium and terminal for small sample image augmentation based on channel slice mixing and noise stitching. Background Technology
[0002] Deep learning extracts information from sample data by learning its inherent patterns and hierarchical representations. However, a common challenge in deep learning is that current models can typically train on a scale of millions of parameters. In practical applications, the small sample size of the image data being studied, or difficulties in obtaining training data due to privacy, security, or ethical concerns, further hinders the application and widespread adoption of deep learning in image recognition. Few-shot learning addresses this issue by addressing the lack of sufficient sample data for each category, making it possible to derive a good model from rare samples. Few-shot learning often employs data augmentation techniques to improve the generalization ability of the trained model in the future.
[0003] Currently, there are two main methods for data augmentation: one is manual data labeling, but this method is time-consuming and costly. The other common method is to perform simple changes on the original data without altering the category, such as cropping, translating, horizontal and vertical flipping, or rotating at different angles to expand the training sample size. However, the problem with this method is that the augmented images do not undergo fundamental changes, and the model cannot learn deeper or more complex knowledge, resulting in very limited improvement in the model's performance. Summary of the Invention
[0004] In view of the shortcomings of the prior art described above, the purpose of this application is to provide a method, apparatus, medium and terminal for small sample image amplification based on channel slice mixing and noise splicing, so as to solve the technical problems of insufficient small sample learning samples in the field of image recognition, while also causing long time consumption, high cost and ineffective amplification.
[0005] To achieve the above and other related objectives, a first aspect of this application provides a method for small-sample image augmentation based on channel slicing, mixing, and noise stitching. The method includes: cropping a labeled original image sample set in a preset format to obtain a cropped image sample set; selecting a preset number of image samples from the cropped image sample set as an input image sample set; slicing the input image sample set to obtain a sliced image sample set; performing channel mixing and noise stitching on the sliced image sample set to obtain an augmented image sample set; and assigning a label to each image in the augmented image sample set to obtain a labeled augmented image sample set. The label assigned to each image in the augmented image sample set is randomly selected from all labels corresponding to the input image sample set.
[0006] In some embodiments of the first aspect of this application, the process of obtaining sliced image samples by slicing the input image samples includes: performing a segmentation operation on each image in the input image sample set according to a symmetrical segmentation method to obtain a number of sub-images accordingly; and performing a multi-channel separation operation on each sub-image obtained by the segmentation operation to obtain multiple single-channel images of each sub-image.
[0007] In some embodiments of the first aspect of this application, the process of mixing the sliced image sample set includes: performing channel mixing on the images in the input image sample set to obtain a channel-mixed image sample set; and arranging and combining all single-channel images corresponding to each image in the channel-mixed image sample set.
[0008] In some embodiments of the first aspect of this application, the process of performing noise splicing on the sliced image sample set includes: replacing the single column pixel values near the dividing line in the single-channel image obtained by permutation and combination with noise pixels, and re-sponsoring according to the image structure before segmentation to form the amplified image sample set.
[0009] To achieve the above and other related objectives, a second aspect of this application provides a small-sample image augmentation apparatus based on channel slicing, mixing, and noise stitching. The apparatus includes: a cropping module for cropping a labeled original image sample set in a preset format to obtain a cropped image sample set, and selecting a preset number of image samples from the cropped image sample set as an input image sample set; a slicing module for slicing the input image sample set to obtain a sliced image sample set; a channel mixing and stitching module for performing channel mixing and noise stitching operations on the sliced image sample set to obtain an augmented image sample set; and an image augmentation module for assigning a label to each image in the augmented image sample set to obtain a labeled augmented image sample set. The label assigned to each image in the augmented image sample set is randomly selected from all labels corresponding to the input image sample set.
[0010] The functions of each module in the small sample image amplification device for slice mixing and noise stitching are the same as those in the implementation method in the first aspect above, and will not be repeated here.
[0011] To achieve the above and other related objectives, a third aspect of this application provides a computer-readable storage medium for a small sample image augmentation method based on channel slice mixing and noise stitching, wherein a computer program is stored thereon, which, when executed by a processor, implements the method.
[0012] To achieve the above and other related objectives, a fourth aspect of this application provides an electronic terminal for a small-sample image amplification method based on channel slice mixing and noise stitching, comprising: a processor and a memory; the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory to enable the terminal to perform the method.
[0013] As described above, this application provides a method, apparatus, medium, and terminal for small-sample image augmentation based on channel slice mixing and noise stitching. The invention solves the problems of high cost, long time consumption, slow annotation speed, and lack of new features in the new samples generated after image transformation, resulting in insignificant model improvement. It has the following beneficial effects: fast augmentation speed, no need for manual annotation, rich and diverse features of the augmented image, significant improvement in model performance, and contributes to solving the problem of insufficient training samples for small-sample learning in the field of image recognition. Attached Figure Description
[0014] Figure 1 The diagram shows a flowchart of small sample image augmentation based on channel slice mixing and noise stitching in one embodiment of this application.
[0015] Figure 2 The diagram shows a flowchart of the slicing operation in small sample image augmentation based on slice mixing and noise stitching in one embodiment of this application.
[0016] Figure 3 The diagram shows a flowchart of a small sample image channel blending process based on channel slice blending and noise stitching in one embodiment of this application.
[0017] Figure 4 The diagram shows a flowchart of small sample image augmentation based on channel slice mixing and noise stitching in one embodiment of this application.
[0018] Figure 5 The diagram illustrates, in one embodiment of this application, the cropping and segmentation operations of images X, Y, and Z, as well as the channel mixing slicing and noise stitching of the channel-mixed image X'.
[0019] Figure 6 The diagram shown is a schematic representation of a small sample image augmentation device based on channel slice mixing and noise stitching in one embodiment of this application.
[0020] Figure 7 The diagram shown is a structural schematic of an electronic terminal according to an embodiment of this application. Detailed Implementation
[0021] The following specific examples illustrate the implementation of this application. Those skilled in the art can easily understand other advantages and effects of this application from the content disclosed in this specification. This application can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this application. It should be noted that, unless otherwise specified, the following embodiments and features in the embodiments can be combined with each other.
[0022] It should be noted that in the following description, reference is made to the accompanying drawings, which illustrate several embodiments of this application. It should be understood that other embodiments may also be used, and changes in mechanical composition, structure, electrical system, and operation may be made without departing from the spirit and scope of this application. The following detailed description should not be considered limiting, and the scope of the embodiments of this application is defined only by the claims of the published patent. The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the application. Spatially related terms, such as “upper,” “lower,” “left,” “right,” “below,” “below,” “lower part,” “above,” “upper part,” etc., may be used herein to illustrate the relationship between one element or feature shown in the figures and another element or feature.
[0023] In this application, unless otherwise expressly specified and limited, the terms "installation," "connection," "linking," "fixing," and "holding" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection between two components. Those skilled in the art can understand the specific meaning of the above terms in this application according to the specific circumstances.
[0024] Furthermore, as used herein, the singular forms “a,” “an,” and “the” are intended to include the plural forms as well, unless the context indicates otherwise. It should be further understood that the terms “comprising,” “including,” indicate the presence of the stated feature, operation, element, component, item, kind, and / or group, but do not preclude the presence, occurrence, or addition of one or more other features, operations, elements, components, items, kinds, and / or groups. The terms “or” and “and / or” as used herein are interpreted as inclusive, or mean any one or any combination thereof. Thus, “A, B, or C” or “A, B, and / or C” means “any one of: A; B; C; A and B; A and C; B and C; A, B, and C.” Exceptions to this definition arise only when combinations of elements, functions, or operations are inherently mutually exclusive in some manner.
[0025] To address the problems mentioned above, this invention provides a method, apparatus, medium, and terminal for small-sample image augmentation based on channel slice mixing and noise stitching. The aim is to solve the technical problems of existing technologies, which, while addressing the insufficient small-sample learning samples in image recognition, also suffer from time-consuming, costly, and ineffective augmentation.
[0026] Meanwhile, to make the objectives, technical solutions, and advantages of the present invention clearer, the technical solutions in the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are only for explaining the present invention and are not intended to limit the invention.
[0027] Before providing a further detailed description of the present invention, the nouns and terms used in the embodiments of the present invention are explained, and the nouns and terms used in the embodiments of the present invention are subject to the following interpretations:
[0028] <1> Deep learning: Deep learning is a branch of machine learning, representing a class of pattern analysis methods. Deep learning learns the inherent patterns and hierarchical representations of sample data, enabling machines to have analytical and learning capabilities like humans, and to recognize data such as text, images, and sound.
[0029] <2> Few-shot learning: Few-shot learning refers to a learning method that efficiently learns and generalizes the cognitive abilities of a model from only a small portion of labeled data for each class. Application scenarios include image classification, sentiment analysis, and pattern recognition.
[0030] <3> Image Channels: In image processing, a channel refers to the dimension of an image's pixel values. For grayscale images, the depth is 1 because each pixel has only one grayscale value representing its brightness; while for color images, the depth is 3 (RGB) because each pixel consists of pixel values from three channels (red, green, and blue), each representing the intensity of the color.
[0031] <4> Gaussian noise: Gaussian noise refers to noise whose probability density function follows a Gaussian distribution (i.e., a normal distribution). For the detailed diagram, Gaussian noise processing involves adding each input pixel to a random number that conforms to a Gaussian distribution, and then limiting or scaling the resulting noise-introduced pixel value to obtain the final output pixel.
[0032] <5> Convolution operation: The convolution operation extracts features from the input image. The convolution operation is the process of sliding the convolution kernel across the original image to obtain feature data.
[0033] <6> Overfitting: Overfitting refers to making the hypothesis overly strict in order to obtain a consistent hypothesis. Avoiding overfitting is a core task in classifier design. Common methods for evaluating classifier performance include increasing the amount of data and the test sample set.
[0034] <7> RGB: The RGB color mode is the industry standard for color. It obtains a variety of colors by changing the three color channels of red (R), green (G), and blue (B) and superimposing them. RGB represents the colors of the three channels of red, green, and blue. This standard includes almost all colors that human vision can perceive and is one of the most widely used color systems.
[0035] <8> BGR: BGR (Blue Green Red) format images are suitable for image segmentation and channel separation operations in the OpenCV open-source library. The BGR format was initially used in the camera and software fields.
[0036] <9> RGBA: RGBA is a color space representing Red, Green, Blue, and Alpha. The alpha channel is generally used as an opacity parameter. If a pixel's alpha channel value is 0%, the pixel is completely transparent, while a pixel with a value of 100% is completely opaque.
[0037] This invention provides a few-sample image augmentation method based on channel slice blending and noise stitching, a system for implementing the few-sample image augmentation method based on channel slice blending and noise stitching, and a storage medium storing an executable program for implementing the few-sample image augmentation method based on channel slice blending and noise stitching. Regarding the implementation of the few-sample image augmentation method based on channel slice blending and noise stitching, this invention will describe exemplary implementation scenarios of the method.
[0038] like Figure 1 The diagram illustrates a flowchart of small-sample image augmentation based on channel slice blending and noise stitching in an embodiment of the present invention. The method for small-sample image augmentation based on channel slice blending and noise stitching in this embodiment mainly includes the following steps:
[0039] Step S1: Crop the original image sample set with labels in a preset format to obtain a cropped image sample set, and select a preset number of image samples from the cropped image sample set as the input image sample set.
[0040] In some examples, the original image sample set with labels is cropped according to a preset format, such as 256*256*3. The reason for cropping is that excessively large images can lead to an overly large model during subsequent training, resulting in fewer convolutional layers and ultimately excessively large parameters in the output layer. Appropriately sized input images effectively avoid excessive model complexity and reduce the risk of overfitting.
[0041] In some examples, the original set of labeled image samples is cropped according to a preset format, and the cropping operation is based on an image cropping algorithm. This image cropping algorithm includes, but is not limited to, methods implemented using traditional Python open-source libraries such as NumPy, OpenCV, and PIL, as well as algorithms that implement random cropping using the machine learning framework Tensorflow.
[0042] For example, the original image sample set with labels can be cropped according to a preset format of 256*256 pixels. After obtaining the cropped image sample set, three image samples are selected from the cropped image sample set as the input image sample set. It should be noted that the image sample set containing three image samples in the above example is only one embodiment of the present invention. In fact, the present invention does not impose any limitation on the number of images in the image sample set.
[0043] A predetermined number of image samples are selected from the cropped image sample set as the input image sample set. It is worth noting that the predetermined number selected here depends on the scale of the sample data to be augmented. If the augmentation model requires a large amount of data, then a large number of image samples with richer label sets need to be selected as the input image sample set for augmentation, in order to maximize the amplification of a large number of augmented image samples with richer image features.
[0044] Step S2: Perform a slicing operation on the input image sample set to obtain a sliced image sample set.
[0045] In this embodiment of the invention, the process of obtaining sliced image samples by slicing the input image samples is specifically as follows: Figure 2 As shown, it includes the following steps:
[0046] Step S21: Segment each image in the input image sample set according to a symmetrical segmentation method to obtain several sub-images.
[0047] In some examples, the symmetrical segmentation method includes, but is not limited to, longitudinal axisymmetric segmentation and transverse axisymmetric segmentation.
[0048] The following explanation uses a vertical axisymmetric approach as an example to illustrate how image segmentation is performed according to a symmetrical segmentation method in this embodiment of the invention: For each image in each input image sample set, a symmetrical segmentation operation is performed, wherein the symmetrical segmentation method is to segment along the midline in the vertical direction, so that the two images obtained after segmentation have the same format, for further operations in subsequent steps. However, this embodiment of the invention does not limit the preset format of the cropping operation, the preset number of input image sample sets, or the specific content of the symmetrical segmentation method.
[0049] Step S22: Perform multi-channel separation operation on each sub-image obtained from the segmentation operation to obtain multiple single-channel images of each sub-image.
[0050] In this embodiment of the invention, the multi-channel separation operation of the sub-images obtained by the segmentation operation includes: performing a separation operation on each sub-image according to a multi-channel method composed of multiple primary color channels. Further, the multi-channel method composed of multiple primary color channels includes, but is not limited to, RGB three-channel, BGR three-channel, RGBA four-channel, and other multi-channel methods.
[0051] In some examples, the sub-images obtained from the segmentation operation are subjected to multi-channel separation. This multi-channel separation operation is based on an algorithm, including using the cv2.split function in the OpenCV library to separate a BGR color image into B, G, and R single-channel images. However, the specific content of the algorithm and tools for multi-channel separation of sub-images in this embodiment of the invention is not limited.
[0052] In some embodiments, the original image sample set with labels can be a multi-channel image format formed by the primary color channels, such as RGB, BGR, BGRP, RGBP, YUV, etc. However, the embodiments of the present invention do not limit the specific content of the multi-channel image format.
[0053] Step S3: Perform channel mixing and noise splicing operations on the sliced image sample set to obtain an amplified image sample set.
[0054] In this embodiment of the invention, the process of performing channel mixing and noise splicing operations on the sliced image sample set is as follows: Figure 3 As shown, it includes the following steps:
[0055] Step S31: Perform channel mixing on the images in the input image sample set to obtain a channel-mixed image sample set.
[0056] Step S32: Arrange and combine all the single-channel images corresponding to each image in the image sample set after channel mixing.
[0057] It is worth noting that the preset number of image samples must correspond to the number of channels contained in the input image. However, this embodiment of the invention does not limit the specific content of the preset number of image samples and the number of channels contained in the input image. The following uses a three-channel image as an example to explain how channel mixing and the arrangement and combination of single-channel images are specifically performed in this embodiment of the invention.
[0058] Step S33: Noise splicing is performed on the single-channel images obtained by permutation and combination.
[0059] Specifically, the process of noise stitching of single-channel images obtained by permutation and combination includes the following steps: replacing the single-column pixel values near the segmentation line in the single-channel images obtained by permutation and combination with noise pixels, and re-stitching them according to the image structure before segmentation to form an amplified image sample set.
[0060] More preferably, the noise pixels in the embodiments of the present invention include, but are not limited to, Gaussian noise. A single column of pixel values near the dividing line in the single-channel image, obtained through permutation and combination, is replaced with Gaussian noise, and the single-channel image is stitched together along the replaced midline. Gaussian noise is introduced.
[0061] Step S4: Set a label for each image in the amplified image sample set to obtain a labeled amplified image sample set; wherein, the label set for each image in the amplified image sample set is randomly selected from all the labels corresponding to the input image sample set.
[0062] To facilitate understanding by those skilled in the art, the following text is combined with Figure 4 and Figure 5 This explanation is provided to further detail the implementation process of the embodiments of the present invention.
[0063] exist Figure 4 and Figure 5 The specific implementation process shown includes the following steps:
[0064] Step S401: Crop the sample images with different formats to a uniform 256*256*3 format and select 3 images (X, Y, and Z) as amplification sample images, resulting in the following... Figure 5 The cropped sample image shown.
[0065] Step S402: For each amplified sample image, cut along the midline to obtain 6 images with a format of 256*128*3, namely (A-A', B-B', C-C'), as shown below. Figure 5 The image shown.
[0066] Step S403: Perform three-channel separation on each amplified sample image to obtain 18 images in 256*128*1 format, as shown below. Figure 5 The following are listed: A1, A'1, A2, A'2, A3, A'3; B1, B'1, B2, B'2, B3, B'3; C1, C'1, C2, C'2, C3, C'3.
[0067] Step S404: Perform channel blending on the channel-separated images to obtain a channel-blended image sample set, as shown below. Figure 5 The following are given: X'(A1-A`1, B2-B`2, C3-C`3); Y'(B1-B`1, C2-C`2, A3-A`3); Z'(C1-C`1, A2-A`2, B3-B`3).
[0068] Step S405: For each amplified sample image, the six single-channel images are permuted and combined to obtain 2160 images in a 256*256*3 format. Specifically, taking image X' as an example, ... Figure 5 As shown, the six images A1, A'1, B2, B'2, C3, and C'3 obtained in step S204 (format 256*128*1) are arranged and combined. It is worth noting that... Figure 7The text only lists 3 possible permutations and combinations, but in reality, for each image, a total of 6 factorial images can be generated, which is 720 images. Therefore, for 3 images, a total of 2160 images can be generated.
[0069] Step S406: As Figure 5 As shown, for each channel of each amplified sample image, the single-column pixel values on both sides of the midline connection are replaced with Gaussian noise.
[0070] Step S407: Randomly select a label from the sample labels as the training label for the new sample.
[0071] It is worth noting that in this embodiment of the invention, the label selection is deliberately set to random mode. This is because the purpose of this invention is to construct an image augmentation method and device with strong universality, which can be applied to various different scenarios (such as industrial production, smart healthcare, education, etc.). Since these different application fields have different preferences for image labels, in order to adapt to various different application fields, the label selection is deliberately set to random mode, thereby greatly improving the generalization ability of the model and expanding the application scenario range of the model.
[0072] It should be understood that the above examples are provided for illustrative purposes and should not be construed as limiting. Similarly, the method may additionally or alternatively include other features or fewer features without departing from the scope of this application.
[0073] like Figure 6 The diagram shown illustrates the structure of a small sample image amplification device based on channel slice mixing and noise stitching in one embodiment of the present invention.
[0074] exist Figure 6 The small-sample image augmentation device based on channel slice mixing and noise stitching includes the following modules:
[0075] The cropping module 61 is used to crop the original image sample set with labels in a preset format to obtain the cropped image sample set, and to select a preset number of image samples from the cropped image sample set as the input image sample set.
[0076] The slicing module 62 is used to slice the input image sample set to obtain a sliced image sample set.
[0077] The channel mixing and stitching module 63 is used to perform channel mixing and noise stitching operations on the sliced image sample set to obtain an amplified image sample set.
[0078] The image augmentation module 64 is used to set a label for each image in the augmented image sample set to obtain an augmented image sample set with labels; wherein the label set for each image in the augmented image sample set is randomly selected from all the labels corresponding to the input image sample set.
[0079] It should be noted that the small sample image augmentation device based on channel slice mixing and noise stitching provided by the above system is only an example of the division of the above program modules. In practical applications, the above processing can be assigned to different program modules as needed, that is, the internal structure of the device can be divided into different program modules to complete all or part of the processing described above. In addition, the small sample image augmentation device based on channel slice mixing and noise stitching mentioned here belongs to the same concept as the embodiment of the small sample image augmentation method based on channel slice mixing and noise stitching mentioned above. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0080] The few-sample image augmentation method based on channel slice mixing and noise stitching provided in this invention can be implemented on the terminal side or the server side. For the hardware structure of a few-sample image augmentation terminal based on channel slice mixing and noise stitching, please refer to [link to relevant documentation]. Figure 7 This is a schematic diagram of an optional hardware structure for a small sample image augmentation terminal 700 based on channel slice mixing and noise stitching, provided by an embodiment of the present invention. The terminal 700 can be a mobile phone, computer device, tablet device, personal digital processing device, factory back-end processing device, etc. The small sample image augmentation terminal 700 based on channel slice mixing and noise stitching includes: at least one processor 701, a memory 702, at least one network interface 704, and a user interface 706. The various components in the device are coupled together through a bus system 705. It is understood that the bus system 705 is used to realize the connection and communication between these components. In addition to a data bus, the bus system 705 also includes a power bus, a control bus, and a status signal bus. However, for clarity, ... Figure 7 The general will label all buses as bus systems.
[0081] The user interface 706 may include a monitor, keyboard, mouse, trackball, clicker, button, touchpad, or touch screen.
[0082] It is understood that memory 702 can be volatile memory or non-volatile memory, or both. Non-volatile memory can be read-only memory (ROM) or programmable read-only memory (PROM), used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM) and synchronous static random access memory (SSRAM). The memories described in the embodiments of this invention are intended to include, but are not limited to, these and any other suitable categories of memory.
[0083] In this embodiment of the invention, the memory 702 is used to store various types of data to support the operation of a few-sample image augmentation terminal 700 based on channel slice mixing and noise stitching. Examples of this data include: any executable program for operating on the few-sample image augmentation terminal 700 based on channel slice mixing and noise stitching, such as operating system 7021 and application program 7022; operating system 7021 includes various system programs, such as framework layer, core library layer, driver layer, etc., for implementing various basic services and handling hardware-based tasks. Application program 7022 may include various applications, such as media player, browser, etc., for implementing various application services. The implementation of the few-sample image augmentation method based on channel slice mixing and noise stitching provided in this embodiment of the invention can be included in application program 7022.
[0084] The methods disclosed in the above embodiments of the present invention can be applied to or implemented by processor 701. Processor 701 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit of the hardware in processor 701 or by instructions in software form. The processor 701 may be a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Processor 701 can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present invention. General-purpose processor 701 may be a microprocessor or any conventional processor, etc. The steps of the accessory optimization method provided in the embodiments of the present invention can be directly reflected as being executed by a hardware decoding processor, or being executed by a combination of hardware and software modules in the decoding processor. The software module may be located in a storage medium, which is located in memory. The processor reads the information in the memory and combines it with its hardware to complete the steps of the aforementioned method.
[0085] In an exemplary embodiment, a few-sample image augmentation terminal 900 based on channel slice mixing and noise stitching can be used by one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), or complex programmable logic devices (CPLDs) to perform the aforementioned method.
[0086] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented using computer program-related hardware. The aforementioned computer program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0087] In the embodiments provided in this application, the computer-readable and writable storage medium may include read-only memory, random access memory, EEPROM, CD-ROM or other optical disc storage devices, disk storage devices or other magnetic storage devices, flash memory, USB flash drive, portable hard drive, or any other medium capable of storing desired program code in the form of instructions or data structures and accessible by a computer. Additionally, any connection may be appropriately referred to as a computer-readable medium. For example, if instructions are transmitted from a website, server, or other remote source using coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared, radio, and microwave, then the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of the medium. However, it should be understood that computer-readable and writable storage media and data storage media do not include connections, carrier waves, signals, or other transient media, but are intended for non-transient, tangible storage media. The disks and optical discs used in the application include compact discs (CDs), laser discs, optical discs, digital multifunction discs (DVDs), floppy disks, and Blu-ray discs, where disks typically copy data magnetically, while optical discs use lasers to copy data optically.
[0088] In summary, this application provides a method, apparatus, terminal, and medium for small-sample image augmentation based on channel slice mixing and noise splicing. The technical problem solved by this invention is the lack of training samples for small-sample learning in the field of image recognition. Traditional image data augmentation methods suffer from high cost, long processing time, slow annotation speed, and the fact that the new samples generated after image transformation do not add new features, resulting in insignificant model improvement. This invention provides a small-sample image data augmentation method that requires no manual annotation, is low-cost, highly efficient, fast, and produces samples with rich features after augmentation. After incorporating this method into image review projects, the accuracy of the image classification model on the test set increased from 95.6% to 97.8% after retraining on the augmented dataset, significantly improving the model's inference performance. In conclusion, this application effectively overcomes the various shortcomings of existing technologies and has high industrial application value.
[0089] The above embodiments are merely illustrative of the principles and effects of this application and are not intended to limit this application. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of this application. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in this application should still be covered by the claims of this application.
Claims
1. A method for small-sample image augmentation based on channel slice mixing and noise stitching, characterized in that, The method includes: The original image sample set with labels is cropped in a preset format to obtain a cropped image sample set, and a preset number of image samples are selected from the cropped image sample set as the input image sample set. The input image sample set is sliced to obtain a sliced image sample set; wherein, the process of obtaining sliced image samples by slicing the input image samples includes: dividing each image in the input image sample set into several sub-images according to a symmetrical segmentation method; and performing multi-channel separation operation on each sub-image obtained by the segmentation operation to obtain multiple single-channel images of each sub-image. The sliced image sample set is subjected to channel mixing and noise splicing operations to obtain an amplified image sample set; A label is assigned to each image in the amplified image sample set to obtain a labeled amplified image sample set; wherein the label assigned to each image in the amplified image sample set is randomly selected from all the labels corresponding to the input image sample set.
2. The small sample image augmentation method based on channel slice mixing and noise stitching according to claim 1, characterized in that, The process of mixing the sliced image sample set includes: The images in the input image sample set are channel-mixed to obtain a channel-mixed image sample set; Arrange and combine all the single-channel images corresponding to each image in the image sample set after channel mixing.
3. The small sample image augmentation method based on channel slice mixing and noise stitching according to claim 2, characterized in that, The process of performing noise stitching on the sliced image sample set includes: replacing the single column pixel values near the dividing line in the single-channel image obtained by permutation and combination with noise pixels, and re-stitching according to the image structure before segmentation to form the amplified image sample set.
4. A small-sample image augmentation device based on channel slice mixing and noise stitching, characterized in that, It includes: The cropping module is used to crop the original image sample set with labels in a preset format to obtain the cropped image sample set, and select a preset number of image samples from the cropped image sample set as the input image sample set. The slicing module is used to slice the input image sample set to obtain a sliced image sample set; The process by which the slicing module obtains sliced image samples by slicing the input image samples includes: dividing each image in the input image sample set into several sub-images according to a symmetrical segmentation method; and performing multi-channel separation on each sub-image obtained by the segmentation operation to obtain multiple single-channel images of each sub-image. The channel mixing and stitching module is used to perform channel slicing mixing and noise stitching operations on the sliced image sample set to obtain an amplified image sample set; The image augmentation module is used to set a label for each image in the augmented image sample set to obtain a labeled augmented image sample set; wherein the label set for each image in the augmented image sample set is randomly selected from all the labels corresponding to the input image sample set.
5. The small sample image augmentation device based on channel slice mixing and noise stitching according to claim 4, characterized in that, The process by which the channel fusion and stitching module performs channel slicing fusion on the sliced image sample set includes: The images in the input image sample set are channel-mixed to obtain a channel-mixed image sample set; Arrange and combine all the single-channel images corresponding to each image in the image sample set after channel mixing.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 3.
7. An electronic terminal, characterized in that, include: Processor and memory; The memory is used to store computer programs; The processor is used to execute the computer program stored in the memory to cause the terminal to perform the small sample image augmentation method based on channel slice mixing and noise stitching as described in any one of claims 1 to 3.
Citation Information
Patent Citations
SAR target recognition method and apparatus, computer device, and storage medium
WO2020037960A1