Data augmentation method, device, equipment and storage medium

By sampling the background area and filling the occluded area of ​​financial bill images to generate data-enhanced images, the problems of low recognition accuracy and poor generalization performance of existing financial bill recognition models are solved, achieving higher recognition accuracy and generalization performance.

CN116740491BActive Publication Date: 2026-02-17PING AN TECH (SHENZHEN) CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202310634647.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-31
Publication Date
2026-02-17
Estimated Expiration
2043-05-31

AI Technical Summary

Technical Problem

Existing financial bill recognition models, after being trained with supplementary samples obtained through rotation and scaling, have low recognition accuracy and poor generalization performance.

Method used

By acquiring the original image set, copying and filtering the image set to be enhanced, randomly selecting a subset of images for background region sampling and occluded region filling, and generating data-enhanced images, the occluded regions are obtained through random selection.

Benefits of technology

The generated data-enhanced images have high randomness, which can effectively supplement the original image set. The trained financial bill recognition model has high recognition accuracy and strong generalization performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116740491B_ABST
    Figure CN116740491B_ABST
Patent Text Reader

Abstract

This application relates to the field of data augmentation, providing a data augmentation method, apparatus, device, and storage medium that can be used to generate financial instruments in the financial field. The generated financial instruments are then used to supplement the original financial instruments and to train a financial instrument recognition model with high recognition accuracy. The method includes: acquiring an original image set; copying the original image set to obtain a copied image set; selecting all images to be augmented from the copied image set to obtain a set of images to be augmented; randomly selecting multiple images to be augmented from the set of images to be augmented to form a first subset of images to be augmented; sampling the background region of each image to be augmented in the first subset of images to be augmented to obtain a sampled region; and filling the sampled region into an occlusion region corresponding to the background region to obtain a data-augmented image. Randomly selecting occlusion regions makes the generated data-augmented image more random, providing a more effective supplement to the original image set.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data enhancement, for example to a data enhancement method, device, equipment and storage medium. BACKGROUND

[0002] In the financial field, various financial bills need to be used. The financial bill belongs to a kind of proof material and is widely used in financial transactions. One of the main methods for identifying financial bills at present is to identify financial bills by using a financial bill identification model. The financial bill identification model is a trained neural network, and the financial bill identification model is obtained by training a to-be-trained neural network. The process of training the to-be-trained neural network needs to use a large number of financial bill samples. However, some financial bills are difficult to obtain, and the number of financial bill samples is small, which leads to low recognition accuracy of the financial bill identification model obtained by training. The existing data enhancement method mainly rotates and scales the financial bill samples used for training to obtain supplementary financial bill samples. The financial bill identification model obtained by training the supplementary financial bill samples generated by using the above method has low recognition accuracy and poor generalization performance. SUMMARY

[0003] The present application provides a data enhancement method, device, equipment and storage medium, aiming at solving the problem of low recognition accuracy and poor generalization performance of the financial bill identification model obtained by training the supplementary samples after rotation and scaling.

[0004] To solve the above problems, the present application adopts the following technical scheme:

[0005] The data enhancement method provided herein includes:

[0006] An original image set is obtained, and the original image set is copied to obtain a copied image set;

[0007] All to-be-enhanced images are screened from the copied image set to obtain a to-be-enhanced image set;

[0008] A plurality of to-be-enhanced images are randomly selected from the to-be-enhanced image set to form a to-be-enhanced image first subset;

[0009] The background area of each to-be-enhanced image in the to-be-enhanced image first subset is sampled to obtain a sampling area;

[0010] The sampling area is filled into an occlusion area corresponding to the background area to obtain a data enhanced image, and the occlusion area is obtained by random selection.

[0011] Preferably, after the plurality of to-be-enhanced images are randomly selected from the to-be-enhanced image set to form the to-be-enhanced image first subset, the method further includes:

[0012] removing the first subset of images to be enhanced from the set of images to be enhanced, to obtain a set of images to be enhanced after removal;

[0013] randomly selecting a plurality of images to be enhanced from the set of images to be enhanced after removal to form a second subset of images to be enhanced;

[0014] performing color filling on the occlusion region of each image to be enhanced in the second subset of images to be enhanced, to obtain the data enhanced image.

[0015] Preferably, after the step of removing the first subset of images to be enhanced from the set of images to be enhanced, to obtain a set of images to be enhanced after removal, the method further comprises:

[0016] removing the second subset of images to be enhanced from the set of images to be enhanced after removal, to obtain a third subset of images to be enhanced;

[0017] deleting the image label of each image to be enhanced in the third subset of images to be enhanced, to obtain the data enhanced image.

[0018] Preferably, before the step of screening all images to be enhanced from the set of copy images to obtain a set of images to be enhanced, the method further comprises:

[0019] randomly assigning a random number to each copy image in the set of copy images.

[0020] Preferably, the step of screening all images to be enhanced from the set of copy images to obtain a set of images to be enhanced comprises:

[0021] taking the copy image with a random number greater than a random number threshold value in the set of copy images as the image to be enhanced;

[0022] taking all the images to be enhanced as the set of images to be enhanced.

[0023] Preferably, the step of sampling the background region of each image to be enhanced in the first subset of images to be enhanced to obtain a sampling region comprises:

[0024] using an interpolation method to up-sample the background region to obtain the sampling region.

[0025] Preferably, after the step of sampling the background region of each image to be enhanced in the first subset of images to be enhanced to obtain a sampling region, the method further comprises:

[0026] detecting whether the area size of the sampling region is consistent with the area size of the occlusion region, and if not, adjusting the area size of the sampling region to the area size of the occlusion region.

[0027] The application also provides a data enhancement device, comprising:

[0028] An original image set copying module is configured to obtain an original image set, copy the original image set, and obtain a copied image set;

[0029] A to-be-enhanced image screening module is configured to screen all to-be-enhanced images from the copied image set, and obtain a to-be-enhanced image set;

[0030] A to-be-enhanced image first subset forming module is configured to randomly select a plurality of to-be-enhanced images from the to-be-enhanced image set to form a to-be-enhanced image first subset;

[0031] A background region sampling module is configured to sample a background region of each to-be-enhanced image in the to-be-enhanced image first subset, and obtain a sampling region;

[0032] An occlusion region filling module is configured to fill the sampling region into an occlusion region corresponding to the background region, and obtain a data enhancement image.

[0033] The application also provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the data enhancement method of any one of the above.

[0034] The application also provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the steps of the data enhancement method of any one of the above.

[0035] The data enhancement method of the application comprises the following steps: obtaining an original image set, copying the original image set to obtain a copied image set, screening all to-be-enhanced images from the copied image set to obtain a to-be-enhanced image set, randomly selecting a plurality of to-be-enhanced images from the to-be-enhanced image set to form a to-be-enhanced image first subset, sampling a background region of each to-be-enhanced image in the to-be-enhanced image first subset to obtain a sampling region, and filling the sampling region into an occlusion region corresponding to the background region to obtain a data enhancement image, wherein the occlusion region is obtained by random selection. Only the occlusion region of the to-be-enhanced image is filled, and the characteristics of the to-be-enhanced image as a whole are not changed. Random selection of the occlusion region makes the randomness of the generated data enhancement image stronger, and the original image set can be more effectively supplemented. The financial bill recognition model trained using the data enhancement image has higher recognition accuracy and stronger generalization performance. BRIEF DESCRIPTION OF DRAWINGS

[0036] Figure 1 The figure is a flowchart of the data enhancement method of an embodiment;

[0037] Figure 2 A flowchart of a process of color filling a blocked area according to an embodiment;

[0038] Figure 3 A flowchart of a process of deleting image labels of images to be enhanced according to an embodiment;

[0039] Figure 4 A flowchart of a process of filtering all images to be enhanced from a set of copied images according to an embodiment;

[0040] Figure 5 A structural schematic block diagram of a data enhancement device according to an embodiment;

[0041] Figure 6 A structural schematic block diagram of a computer device according to an embodiment.

[0042] The purposes, functional features and advantages of the present application will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION

[0043] In order to make the purposes, technical solutions and advantages of the present application clearer, further detailed description will be made to the present application with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, and are not used to limit the present application.

[0044] Those skilled in the art can understand that the singular forms "a", "an" and "the" used herein include plural forms unless specifically stated otherwise. It should be further understood that the use of the term "include" in the specification of the present application means that a feature, integer, step, operation, element, unit, unit and / or assembly exists, but does not exclude the existence or addition of one or more other features, integers, steps, operations, elements, units, units, assemblies and / or combinations thereof. It should be understood that when we say that an element is "connected" or "coupled" to another element, it can be directly connected or coupled to the other element, or there can be intermediate elements. In addition, the "connection" or "coupling" used herein can include wireless connection or wireless coupling. The phrase "and / or" used herein includes all or any unit and all combinations of the associated listed items.

[0045] Those skilled in the art can understand that unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as that generally understood by those skilled in the art to which the present application belongs. It should also be understood that terms such as those defined in a general dictionary should be understood to have meanings consistent with those in the context of the prior art, and unless specifically defined as such, should not be interpreted in an idealized or overly formal sense.

[0046] Financial instruments are a type of evidentiary material widely used in financial transactions. They reflect a company's operational status, such as its asset and liability situation and cash flow. Therefore, it is necessary to identify various types of financial instruments. However, financial instruments are highly confidential, and the number of instruments available for training may be limited, or insufficient access may prevent the acquisition of all existing financial instruments. This application provides a data augmentation method, apparatus, device, and storage medium capable of generating financial instruments in the financial field. The generated financial instruments can supplement the original financial instruments, possessing strong randomness and providing a more effective complement to the original instruments. By increasing the total number of financial instruments, the financial instrument recognition model trained using the generated and original financial instruments can accurately identify various types of financial instruments.

[0047] Reference Figure 1 This is a flowchart illustrating the data augmentation method proposed in this application, including:

[0048] S1: Obtain the original image set, and copy the original image set to obtain a copied image set.

[0049] The original image set includes a large number of images of financial instruments, which can be captured by a camera or downloaded from the internet. Multiple encrypted images of financial instruments can be captured by a camera and then decrypted to obtain other financial instrument images; alternatively, multiple encrypted images of financial instruments can be stored on a server and decrypted to obtain other financial instrument images.

[0050] Financial instrument images include patterns and text; recognizing financial instrument images means recognizing the patterns and / or text within them.

[0051] Financial instruments include bills of exchange, promissory notes, checks, and letters of credit.

[0052] The number and order of images in the duplicated image set are consistent with those in the original image set.

[0053] The original image set can be copied once to obtain a copy image set, or the original image set can be copied multiple times to obtain multiple copy image sets. This application embodiment takes a copy image set as an example.

[0054] S2: Select all images to be enhanced from the copied image set to obtain the image set to be enhanced.

[0055] The copied images in the set of copied images whose random numbers are greater than a random number threshold are taken as the images to be enhanced.

[0056] All the images to be enhanced are taken as the set of images to be enhanced.

[0057] Selecting a portion of the copied images from the copied image set as the images to be enhanced can increase the randomness of the image set. The data-enhanced images obtained from the image set can be applied to the detection of various financial instruments.

[0058] S3: Randomly select multiple images to be enhanced from the set of images to be enhanced to form the first subset of images to be enhanced.

[0059] Preferably, the total number of images to be enhanced in the image set is N, where N≥2. M unique serial numbers are randomly generated within the range of 1 to N, where 1≤M<N. The M images to be enhanced corresponding to the M serial numbers are then combined to form the first subset of the images to be enhanced.

[0060] Each image in the first subset of images to be enhanced is an image of a financial instrument, and the image label of each image to be enhanced is a financial instrument.

[0061] S4: Sample the background region of each of the images to be enhanced in the first subset of the images to be enhanced to obtain the sampled region.

[0062] The background region is upsampled using interpolation to obtain the sampling region.

[0063] Specifically, the sampling area can be either the digital area or the non-digital area of ​​the financial instrument.

[0064] The interpolation method can be one of bilinear interpolation, nearest neighbor interpolation, or bicubic interpolation. The resolution of the sampled region obtained by upsampling the background region is higher than that of the background region.

[0065] S5: Fill the sampling area into the occlusion area corresponding to the background area to obtain a data-enhanced image, wherein the occlusion area is obtained by random selection.

[0066] The background region, sampling region, and occluded region are all located in the same image to be enhanced. By filling the occluded region with the sampling region, the data-enhanced image and the image to be enhanced have local differences. The data-enhanced image can effectively supplement the original image in the original image set.

[0067] Specifically, when there are few original financial instruments, the data-enhanced images obtained from the original financial instruments can serve as a supplement to the original financial instruments. The financial instrument recognition model trained using the original financial instruments and the data-enhanced images has high recognition accuracy and strong generalization performance.

[0068] The data augmentation method of this application includes acquiring an original image set, copying the original image set to obtain a copied image set; selecting all images to be augmented from the copied image set to obtain an image set to be augmented; randomly selecting multiple images to be augmented from the image set to form a first subset of images to be augmented; sampling the background region of each image to be augmented in the first subset of images to be augmented to obtain a sampled region; and filling the sampled region into an occlusion region corresponding to the background region to obtain a data-augmented image. The occlusion region is obtained through random selection. Only the occlusion region of the image to be augmented is filled, without changing the overall features of the image to be augmented. Randomly selecting the occlusion region makes the generated data-augmented image more random, providing a more effective supplement to the original image set. The financial bill recognition model trained using the data-augmented image has high recognition accuracy and strong generalization performance.

[0069] In one embodiment, refer to Figure 2 After step S3, which involves randomly selecting multiple images from the set of images to be enhanced to form a first subset of images to be enhanced, the method further includes the following steps S41'-S43':

[0070] S41': Remove the first subset of the images to be enhanced from the set of images to be enhanced to obtain the set of images to be enhanced after removal.

[0071] For example, there are 100 images in the image set to be enhanced, and the first subset of images to be enhanced contains 40 images. All images in the image set that belong to the first subset of images to be enhanced are removed.

[0072] S42': Randomly select multiple images to be enhanced from the set of images to be enhanced after removal to form a second subset of images to be enhanced.

[0073] For example, there are 60 images to be enhanced in the set of images to be enhanced after removal. 30 images to be enhanced are randomly selected from the 60 images to be enhanced to form the second subset of images to be enhanced.

[0074] S43': Color fill the occluded region of each of the images to be enhanced in the second subset of the images to be enhanced to obtain the data-enhanced image.

[0075] The color fill can be either a solid color fill or a gradient fill.

[0076] Filling the occluded areas of each image to be enhanced in the second subset with color has high computational efficiency.

[0077] As described above, after randomly selecting multiple images from the set of images to be enhanced to form a first subset, the process further includes removing the first subset to obtain a set of images to be enhanced after removal. Multiple images are then randomly selected from the set of images to be enhanced after removal to form a second subset. The occluded regions of each image in the second subset are then filled with color to obtain the data-enhanced image. Filling the occluded regions of each image in the second subset with color has high computational efficiency.

[0078] In one embodiment, refer to Figure 3 After step S41' of removing the first subset of images to be enhanced from the set of images to be enhanced to obtain the set of images to be enhanced after removal, the method further includes the following steps S42”-S43”:

[0079] S42”: Remove the second subset of the images to be enhanced from the set of images to be enhanced after removal, to obtain the third subset of the images to be enhanced.

[0080] For example, the set of images to be enhanced after removal contains 60 images, the second subset of images to be enhanced includes 30 images to be enhanced, and the third subset of images to be enhanced after removing the second subset of images to be enhanced includes 30 images to be enhanced.

[0081] The number of images to be enhanced in the third subset of images to be enhanced for deleting image tags should not be too large. Preferably, the ratio of the number of images to be enhanced in the third subset of images to the total number of images to be enhanced in the image set should be set between 0 and 0.3.

[0082] S43”: Delete the image label of each image to be enhanced in the third subset of the images to be enhanced, and obtain the data-enhanced image.

[0083] Removing the image label from each image in the third subset of the images to be enhanced turns the image into a noisy image. The financial bill recognition model trained using the noisy image has stronger robustness.

[0084] As described above, after removing the first subset of images to be enhanced from the set of images to be enhanced, resulting in the set of images to be enhanced after removal, the process further includes removing the second subset of images to be enhanced from the set of images to be enhanced, resulting in the third subset of images to be enhanced. The image labels of each image to be enhanced in the third subset are then deleted to obtain the data-enhanced image. Deleting the image labels from each image to be enhanced in the third subset transforms the images to be enhanced into noisy images, thus making the financial document recognition model trained using these noisy images more robust.

[0085] In one embodiment, before step S2, which involves filtering all images to be enhanced from the copied image set to obtain the image set to be enhanced, the following step S11' is further included:

[0086] S11': Randomly assign a random number to each copied image in the copied image set.

[0087] Preferably, the range of random numbers is set to 1-100, and a random number is randomly assigned to each copied image. The random numbers corresponding to different copied images may be the same.

[0088] By randomly assigning a random number to each copied image, it is possible to randomly select a portion of the copied images as the images to be enhanced.

[0089] As described above, before selecting all images to be enhanced from the copied image set and obtaining the image set to be enhanced, a random number is randomly assigned to each copied image in the copied image set. By randomly assigning a random number to each copied image, a portion of the copied images can be randomly selected as images to be enhanced.

[0090] In one embodiment, refer to Figure 4 The step S2, which involves filtering all images to be enhanced from the copied image set to obtain the image set to be enhanced, includes the following steps S21-S22:

[0091] S21: Select the copied images in the copied image set whose random number is greater than the random number threshold as the images to be enhanced.

[0092] The higher the random number threshold is set, the fewer images to be enhanced will be selected from the copied image set; the lower the random number threshold is set, the more images to be enhanced will be selected from the copied image set.

[0093] Preferably, when the range of random numbers is 1-100, the random number threshold is set to 50.

[0094] S22: Collect all the images to be enhanced into the set of images to be enhanced.

[0095] For example, the image set contains 200 copied images. 100 copied images in the image set whose random number is greater than the random number threshold are selected as images to be enhanced, and these 100 images are selected as the image set to be enhanced.

[0096] Images in the image set to be augmented are used for data augmentation.

[0097] As described above, all images to be augmented are selected from the copied image set to obtain the image set to be augmented. This includes selecting copied images from the copied image set whose random numbers are greater than a random number threshold as images to be augmented, and including all images to be augmented as the image set to be augmented. The images to be augmented in the image set to be augmented are used for data augmentation.

[0098] In one embodiment, step S4, which samples the background region of each of the images to be enhanced in the first subset of the images to be enhanced to obtain the sampled region, includes the following step S41:

[0099] S41: Upsample the background region using interpolation to obtain the sampling region.

[0100] The interpolation method can be one of bilinear interpolation, nearest neighbor interpolation, or bicubic interpolation. The resolution of the sampled region obtained by upsampling the background region is higher than that of the background region.

[0101] The sampled region obtained by upsampling is filled into the occluded region. The resulting data-enhanced image has different image content in the occluded region than the corresponding original image. Therefore, the data-enhanced image can be used as a supplement to the corresponding original image.

[0102] Optionally, when the background region is at the edge of the image to be enhanced, the background region is downsampled to obtain the sampling region.

[0103] As described above, the background region of each image to be enhanced in the first subset of images to be enhanced is sampled to obtain a sampled region, including upsampling the background region using interpolation. The upsampled region is then used to fill the occluded region. The resulting data-enhanced image differs from the corresponding original image in the occluded region, thus the data-enhanced image can serve as a supplement to the corresponding original image.

[0104] In one embodiment, after step S4 of sampling the background region of each of the first subset of the images to be enhanced to obtain the sampled region, the method further includes step S5':

[0105] S5': Detect whether the area size of the sampling area is consistent with the area size of the occluded area. If not, adjust the area size of the sampling area to the area size of the occluded area.

[0106] For example, if the size of the occluded area is 50×50, and the size of the sampling area is 60×60, then the content of rows 1 to 5 in the sampling area will be deleted, the content of rows 55 to 60 in the sampling area will be deleted, the content of columns 1 to 5 in the sampling area will be deleted, and the content of columns 55 to 60 in the sampling area will be deleted.

[0107] When the size of the sampling area is different from the size of the occluded area, the size of the sampling area is adjusted to match the size of the occluded area, so that the sampling area can fill the occluded area and obtain a data-enhanced image.

[0108] As described above, after sampling the background region of each image in the first subset of images to be enhanced to obtain the sampled region, the process further includes detecting whether the region size of the sampled region is consistent with the region size of the occluded region. If not, the region size of the sampled region is adjusted to match the region size of the occluded region. When the region size of the sampled region is different from the region size of the occluded region, the region size of the sampled region is adjusted to match the region size of the occluded region, so that the sampled region can fill the occluded region, thus obtaining the data-enhanced image.

[0109] Reference Figure 5 This is a schematic block diagram of a data augmentation device according to this application. The device includes:

[0110] The original image set copying module 10 is used to acquire the original image set and copy the original image set to obtain a copied image set;

[0111] The image filtering module 20 is used to filter all images to be enhanced from the copied image set to obtain the image set to be enhanced.

[0112] The first subset composition module 30 of the images to be enhanced is used to randomly select multiple images to be enhanced from the set of images to be enhanced to form the first subset of the images to be enhanced;

[0113] Background region sampling module 40 is used to sample the background region of each of the images to be enhanced in the first subset of the images to be enhanced, so as to obtain the sampling region;

[0114] The occlusion area filling module 50 is used to fill the sampling area into the occlusion area corresponding to the background area to obtain a data-enhanced image.

[0115] The aforementioned data augmentation device can implement data augmentation methods.

[0116] In one embodiment, the data enhancement device further includes:

[0117] The first subset removal module of the image to be enhanced is used to remove the first subset of the image to be enhanced from the set of images to be enhanced, so as to obtain the set of images to be enhanced after removal;

[0118] The module for composing the second subset of images to be enhanced is used to randomly select multiple images to be enhanced from the set of images to be enhanced after removal to form the second subset of images to be enhanced.

[0119] The occlusion area color filling module is used to fill the occlusion area of ​​each of the images to be enhanced in the second subset of the images to be enhanced with color, so as to obtain the data-enhanced image.

[0120] In one embodiment, the data enhancement device further includes:

[0121] The module for removing the second subset of the image to be enhanced is used to remove the second subset of the image to be enhanced from the set of images to be enhanced after removal, so as to obtain the third subset of the image to be enhanced.

[0122] The image tag deletion module is used to delete the image tags of each image in the third subset of the images to be enhanced, thereby obtaining the data-enhanced image.

[0123] In one embodiment, the data enhancement device further includes:

[0124] The random number allocation module is used to randomly assign a random number to each copied image in the copied image set.

[0125] In one embodiment, the image-to-be-enhanced filtering module 20 further includes:

[0126] The image to be enhanced definition unit is used to define the copied images in the copied image set whose random number is greater than a random number threshold as the image to be enhanced.

[0127] The image set definition unit is used to define all the images to be enhanced as the image set to be enhanced.

[0128] In one embodiment, the background region sampling module 40 further includes:

[0129] The background region sampling unit is used to upsample the background region using interpolation to obtain the sampling region.

[0130] In one embodiment, the data enhancement device further includes:

[0131] The region size adjustment module is used to detect whether the region size of the sampling region is consistent with the region size of the occluded region. If not, the region size of the sampling region is adjusted to the region size of the occluded region.

[0132] Reference Figure 6 This application also provides a computer device, which may be a server, and its internal structure may be as follows: Figure 6 As shown. The computer device includes a processor, memory, network interface, and database connected via a system bus. The processor is designed to provide computing and control capabilities. The memory of the computer device includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device is used to store a first subset of images to be enhanced, etc. The network interface of the computer device is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements the data enhancement method.

[0133] The processor described above executes the data augmentation method described above, including:

[0134] Obtain the original image set, and copy the original image set to obtain a copied image set;

[0135] All images to be enhanced are selected from the copied image set to obtain the image set to be enhanced;

[0136] Multiple images to be enhanced are randomly selected from the set of images to be enhanced to form a first subset of images to be enhanced;

[0137] The background region of each image in the first subset of the images to be enhanced is sampled to obtain the sampling region;

[0138] The sampling area is filled into the occlusion area corresponding to the background area to obtain a data-enhanced image, wherein the occlusion area is obtained by random selection.

[0139] In one embodiment, after randomly selecting multiple images to be enhanced from the set of images to be enhanced to form a first subset of images to be enhanced, the method further includes:

[0140] Remove the first subset of images to be enhanced from the set of images to be enhanced to obtain the set of images to be enhanced after removal;

[0141] Randomly select multiple images to be enhanced from the set of images to be enhanced after removal to form a second subset of images to be enhanced;

[0142] The occluded region of each image in the second subset of the images to be enhanced is filled with color to obtain the data-enhanced image.

[0143] In one embodiment, after removing the first subset of images to be enhanced from the set of images to be enhanced to obtain the set of images to be enhanced after removal, the method further includes:

[0144] The second subset of images to be enhanced is removed from the set of images to be enhanced after removal, resulting in a third subset of images to be enhanced.

[0145] The image label of each image to be enhanced in the third subset of the images to be enhanced is deleted to obtain the data-enhanced image.

[0146] In one embodiment, before filtering all images to be enhanced from the copied image set to obtain the image set to be enhanced, the method further includes:

[0147] A random number is randomly assigned to each copied image in the set of copied images.

[0148] In one embodiment, the step of filtering all images to be enhanced from the copied image set to obtain the image set to be enhanced includes:

[0149] The copied images in the set of copied images whose random numbers are greater than a random number threshold are taken as the images to be enhanced.

[0150] All the images to be enhanced are taken as the set of images to be enhanced.

[0151] In one embodiment, sampling the background region of each image in the first subset of the images to be enhanced to obtain a sampling region includes:

[0152] The background region is upsampled using interpolation to obtain the sampling region.

[0153] In one embodiment, after sampling the background region of each of the images to be enhanced in the first subset of the images to be enhanced to obtain the sampled region, the method further includes:

[0154] If the size of the sampling area is not the same as the size of the occluded area, then the size of the sampling area is adjusted to match the size of the occluded area.

[0155] Those skilled in the art will understand that Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer equipment on which the present application is applied.

[0156] One embodiment of this application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements a data augmentation method. It is understood that the computer-readable storage medium in this embodiment can be a volatile readable storage medium or a non-volatile readable storage medium.

[0157] The above data augmentation methods include:

[0158] Obtain the original image set, and copy the original image set to obtain a copied image set;

[0159] All images to be enhanced are selected from the copied image set to obtain the image set to be enhanced;

[0160] Multiple images to be enhanced are randomly selected from the set of images to be enhanced to form a first subset of images to be enhanced;

[0161] The background region of each image in the first subset of the images to be enhanced is sampled to obtain the sampling region;

[0162] The sampling area is filled into the occlusion area corresponding to the background area to obtain a data-enhanced image, wherein the occlusion area is obtained by random selection.

[0163] In one embodiment, after randomly selecting multiple images to be enhanced from the set of images to be enhanced to form a first subset of images to be enhanced, the method further includes:

[0164] Remove the first subset of images to be enhanced from the set of images to be enhanced to obtain the set of images to be enhanced after removal;

[0165] Randomly select multiple images to be enhanced from the set of images to be enhanced after removal to form a second subset of images to be enhanced;

[0166] The occluded region of each image in the second subset of the images to be enhanced is filled with color to obtain the data-enhanced image.

[0167] In one embodiment, after removing the first subset of images to be enhanced from the set of images to be enhanced to obtain the set of images to be enhanced after removal, the method further includes:

[0168] The second subset of images to be enhanced is removed from the set of images to be enhanced after removal, resulting in a third subset of images to be enhanced.

[0169] The image label of each image to be enhanced in the third subset of the images to be enhanced is deleted to obtain the data-enhanced image.

[0170] In one embodiment, before filtering all images to be enhanced from the copied image set to obtain the image set to be enhanced, the method further includes:

[0171] A random number is randomly assigned to each copied image in the set of copied images.

[0172] In one embodiment, the step of filtering all images to be enhanced from the copied image set to obtain the image set to be enhanced includes:

[0173] The copied images in the set of copied images whose random numbers are greater than a random number threshold are taken as the images to be enhanced.

[0174] All the images to be enhanced are taken as the set of images to be enhanced.

[0175] In one embodiment, sampling the background region of each image in the first subset of the images to be enhanced to obtain a sampling region includes:

[0176] The background region is upsampled using interpolation to obtain the sampling region.

[0177] In one embodiment, after sampling the background region of each of the images to be enhanced in the first subset of the images to be enhanced to obtain the sampled region, the method further includes:

[0178] If the size of the sampling area is not the same as the size of the occluded area, then the size of the sampling area is adjusted to match the size of the occluded area.

[0179] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the methods described above. Any references to memory, storage, databases, or other media provided in this application and in the embodiments may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual-speed SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0180] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, apparatus, article, or method. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, apparatus, article, or method that includes that element.

[0181] The above description is only a preferred embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural changes made based on the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.

Claims

1. A data augmentation method, characterized in that, include: Obtain the original image set, and copy the original image set to obtain a copied image set, wherein the original image set includes images of financial instruments; All images to be enhanced are selected from the copied image set to obtain the image set to be enhanced; Multiple images to be enhanced are randomly selected from the set of images to be enhanced to form a first subset of images to be enhanced. Each image to be enhanced in the first subset of images to be enhanced is an image of a financial instrument, and the image label of each image to be enhanced is a financial instrument. The background region of each image in the first subset of the images to be enhanced is sampled to obtain the sampling region; The sampling area is filled into the occluded area corresponding to the background area to obtain a data-enhanced image. Only the occluded area of ​​the image to be enhanced is filled, without changing the overall features of the image to be enhanced. The occluded area is obtained by random selection, and the image content of the data-enhanced image in the occluded area is different from that of the corresponding original image. The data-enhanced image is used as a supplement to the corresponding original financial document image.

2. The data augmentation method according to claim 1, characterized in that, After randomly selecting multiple images from the set of images to be enhanced to form the first subset of images to be enhanced, the method further includes: Remove the first subset of images to be enhanced from the set of images to be enhanced to obtain the set of images to be enhanced after removal; Randomly select multiple images to be enhanced from the set of images to be enhanced after removal to form a second subset of images to be enhanced; The occluded region of each image in the second subset of the images to be enhanced is filled with color to obtain the data-enhanced image.

3. The data augmentation method according to claim 2, characterized in that, After removing the first subset of images to be enhanced from the set of images to be enhanced to obtain the set of images to be enhanced after removal, the method further includes: The second subset of images to be enhanced is removed from the set of images to be enhanced after removal, resulting in a third subset of images to be enhanced. The image label of each image to be enhanced in the third subset of the images to be enhanced is deleted to obtain the data-enhanced image.

4. The data augmentation method according to claim 1, characterized in that, Before filtering all images to be enhanced from the copied image set to obtain the image set to be enhanced, the process also includes: A random number is randomly assigned to each copied image in the set of copied images.

5. The data augmentation method according to claim 4, characterized in that, The step of filtering all images to be enhanced from the copied image set to obtain the image set to be enhanced includes: The copied images in the set of copied images whose random numbers are greater than a random number threshold are taken as the images to be enhanced. All the images to be enhanced are taken as the set of images to be enhanced.

6. The data augmentation method according to claim 1, characterized in that, The sampling of the background region of each image in the first subset of the images to be enhanced to obtain the sampling region includes: The background region is upsampled using interpolation to obtain the sampling region.

7. The data augmentation method according to claim 1, characterized in that, After sampling the background region of each image in the first subset of the images to be enhanced to obtain the sampled region, the method further includes: If the size of the sampling area is not the same as the size of the occluded area, then the size of the sampling area is adjusted to match the size of the occluded area.

8. A data augmentation apparatus for performing the data augmentation method as described in any one of claims 1-7, characterized in that, include: The original image set copying module is used to acquire the original image set and copy the original image set to obtain a copied image set; The image filtering module is used to filter all images to be enhanced from the copied image set to obtain the image set to be enhanced. The first subset composition module of the images to be enhanced is used to randomly select multiple images to be enhanced from the set of images to be enhanced to form the first subset of the images to be enhanced; The background region sampling module is used to sample the background region of each of the images to be enhanced in the first subset of the images to be enhanced, so as to obtain the sampling region; The occlusion area filling module is used to fill the sampling area into the occlusion area corresponding to the background area to obtain a data-enhanced image.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the data augmentation method according to any one of claims 1 to 7.

10. 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 steps of the data augmentation method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Bill area identification method and device, electronic equipment and readable storage medium

    CN112464892A

  • Category imbalance hyperspectral image classification method based on enhanced oversampling

    CN112733736A

  • Image training set generation method and device based on data enhancement

    CN114120004A

  • ViT-based deep learning neural network data enhancement method

    CN114548405A