Method and device for generating interference image

By calculating the background value of each pixel and adjusting the weight function, the image pixel value is modified to generate an interference image with usable interference, which solves the problem of insufficient or excessive interference in the existing technology and realizes the effective use of interference in the image recognition model. image.

CN114140349BActive Publication Date: 2024-09-06ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111402709.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-24
Publication Date
2024-09-06
Estimated Expiration
2041-11-24

AI Technical Summary

Technical Problem

The interference image generated by the existing technology does not have usable interference and cannot be effectively used in the image recognition model. It neither achieves the encryption effect nor loses the characteristics of the original image.

Method used

By obtaining the original image, calculating the background value and adjusting weight function of each pixel, and modifying the pixel value according to these values ​​to generate an interference image, using the preset image window and training method to determine the background value and weight function to ensure that the interference image retains the characteristics Basically disruptive enough.

Benefits of technology

The generated interference image can be recognized by the image recognition model, and the original image information can be restored if necessary, avoiding useless processing caused by insufficient or excessive interference, and achieving usable interference.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114140349B
    Figure CN114140349B
Patent Text Reader

Abstract

The embodiments of this specification provide a method and device for generating an interference image. The method includes: obtaining an original image; for each of at least two first pixels in the original image, performing: obtaining a background value corresponding to the first pixel; obtaining an adjustment weight function corresponding to the first pixel; adding the background value to the original pixel value of the first pixel according to the adjustment weight function to obtain an interference pixel value; and modifying the pixel value of the first pixel to the interference pixel value; and obtaining an interference image using each first pixel having an interference pixel value. The embodiments of this specification make the interference image have usable interference and can be used, which can improve the security and availability of privacy data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] One or more embodiments of the present specification relate to electronic information technology, and more particularly, to a method and apparatus for generating an interference image. Background Art

[0002] Image recognition models have been widely used in various business scenarios. For example, in access control business, image recognition models use photographed facial images to perform face recognition to determine whether the corresponding person is allowed to pass through the access control. For another example, the image recognition model of a bank uses photographed facial images to perform face recognition to verify the identity of the corresponding person. For another example, the image recognition model recognizes remote sensing images taken by satellites and identifies the corresponding ground feature information.

[0003] In actual business, it is often necessary to deform the original image to generate an interference image, and use the interference image to process business. For example, in face recognition, the user's face image data belongs to the user's privacy and needs to be kept confidential. Therefore, it is necessary to deform the original face image captured, such as stretching or rotating, to generate an interference image, and use the interference image to train the image recognition model. However, the existing method of generating interference images often makes the interference image unusable and cannot be used. Summary of the invention

[0004] One or more embodiments of the present specification describe a method and apparatus for generating an interference image, so that the interference image has usable interference and can be used.

[0005] According to a first aspect, a method for generating an interference image is provided, comprising:

[0006] Get the original image;

[0007] For each of at least two first pixels in the original image, the following is performed:

[0008] Obtaining a background value corresponding to the first pixel;

[0009] Obtaining an adjustment weight function corresponding to the first pixel;

[0010] Adding the background value to the original pixel value of the first pixel according to the adjustment weight function to obtain an interference pixel value; and

[0011] Modifying the pixel value of the first pixel to the interference pixel value;

[0012] An interference image is obtained by using each first pixel having an interference pixel value.

[0013] Wherein, the at least two first pixels include:

[0014] All pixels in the original image; or,

[0015] At least two pixels in a partial area of ​​the original image.

[0016] Wherein, obtaining the background value corresponding to the first pixel includes:

[0017] Determine each pixel within a preset image window near the first pixel;

[0018] Obtain all channel values ​​of all pixels in the preset image window on all image channels;

[0019] The minimum value among all channel values ​​is taken as the background value corresponding to the first pixel.

[0020] The preset image window is: an N*N image window centered on the first pixel, where N is an odd number not less than 3.

[0021] The method further comprises: obtaining an adjustment weight function corresponding to each pixel position in the image by a pre-executed training method,

[0022] The obtaining of the adjustment weight function corresponding to the first pixel includes: obtaining the adjustment weight function corresponding to the first pixel according to the pixel position of the first pixel;

[0023] Among them, the pre-executed training methods include:

[0024] For the same sample original image, at least two sample interference images that have been marked are obtained; wherein, at the same pixel position in the at least two sample interference images, at least two sample pixel values ​​are generated using at least two different to-be-selected adjustment weight functions;

[0025] The at least two sample interference images are input into the image recognition model to be trained; the loss function of the image recognition model satisfies: the higher the recognition accuracy of the image recognition model, the smaller the value of the loss function, and the greater the difference between the sample interference image and the corresponding original image, the smaller the value of the loss function;

[0026] For each pixel position in the sample interference image, the selected adjustment weight function used by the sample pixel value that minimizes the value of the loss function is used as the adjustment weight function corresponding to the pixel position.

[0027] The step of adding the background value to the original pixel value of the first pixel according to the adjustment weight function to obtain the interference pixel value includes:

[0028] Use the following calculation formula to calculate:

[0029] G(x)=I(x)*K(x)+N*B(x)*[1-K(x)];

[0030] Among them, G(x) represents the interference pixel value of the first pixel, I(x) represents the original pixel value of the first pixel, K(x) is the adjustment weight function corresponding to the first pixel; B(x) represents the background value corresponding to the first pixel, and N represents the background superposition multiple, which is a positive integer not less than 1.

[0031] Wherein, after obtaining the interference image, the method further includes:

[0032] The interference image is stretched and / or rotated.

[0033] According to a second aspect, a device for generating an interference image is provided, comprising:

[0034] An acquisition module configured to acquire an original image;

[0035] A background value calculation module, configured to obtain a background value corresponding to each of at least two first pixels in the original image;

[0036] A weight function determination module, configured to obtain, for each of at least two first pixels in the original image, an adjustment weight function corresponding to the first pixel;

[0037] The interference image generation module is configured to add the background value of the first pixel to the original pixel value of the first pixel according to the adjustment weight function of the first pixel to obtain an interference pixel value; modify the pixel value of the first pixel to the interference pixel value; and use each first pixel with the interference pixel value to obtain an interference image.

[0038] Wherein, the weight function determination module is configured to execute:

[0039] Obtaining a pre-trained adjustment weight function corresponding to the pixel position of the first pixel;

[0040] Among them, during pre-training:

[0041] Acquire at least two sample interference images that have been marked; wherein, at a pixel position of a first pixel in the at least two sample interference images, a pixel value is generated using at least two different adjustment weight functions to be selected;

[0042] The at least two sample interference images are input into the image recognition model to be trained; the loss function of the image recognition model satisfies: the higher the recognition accuracy of the image recognition model, the smaller the value of the loss function, and the greater the difference between the sample interference image and the corresponding original image, the smaller the value of the loss function;

[0043] The candidate adjustment weight function that minimizes the value of the loss function is used as the adjustment weight function corresponding to the first pixel.

[0044] According to a third aspect, a computing device is provided, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method described in any embodiment of the present specification is implemented.

[0045] The method and device for generating an interference image provided in the embodiments of the present specification, for each first pixel to be interfered with, will add the background value of the first pixel to the original pixel value of the first pixel according to the adjustment weight function corresponding to the first pixel, which is equivalent to adding the background map of the original image on the basis of the original image. Because the background map is relatively useless information in image recognition, therefore, adding the background map on the basis of the original image will interfere with the original image, thereby generating an interference map; at the same time, when adding the background map, the adding method will also be determined according to a predetermined adjustment weight function, so that the useful information and useless background information included in the interference image are adjusted by the adjustment weight function, thereby avoiding the problems caused by insufficient interference or excessive interference in the prior art, so that the interference image has usable interference and can be used. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0047] Figure 1 It is a flowchart of a method for generating an interference image in one embodiment of the present specification.

[0048] Figure 2 It is a schematic diagram of an image window in one embodiment of this specification.

[0049] Figure 3 It is a schematic diagram of another image window in an embodiment of this specification.

[0050] Figure 4 It is a flowchart of a training method for training an adjustment weight function in one embodiment of the present specification.

[0051] Figure 5 It is a schematic diagram of training the adjustment weight function in one embodiment of this specification.

[0052] Figure 6It is a structural schematic diagram of a device for generating an interference image in one embodiment of this specification. DETAILED DESCRIPTION

[0053] First, let's explain the term "available interference". Available interference means that when faced with an interference image obtained by interfering with the original image, the human eye cannot restore the information represented in the original image, but at the same time, the interference image can be recognized by the computer's image recognition model, achieving the effect of removing interference and restoring the information represented in the original image.

[0054] In business applications, in order to meet encryption and other requirements, it is necessary to interfere with the original image to generate an interference image. In the prior art, interference images are generated by means such as image stretching or rotation. However, the prior art approach is likely to result in insufficient interference (such as a simple image rotation of 90 degrees, or a simple stretching of one time), in which case the interference image cannot achieve the encryption effect. At the same time, the prior art approach is also likely to result in excessive interference (such as arbitrarily changing the position and pixel value of pixels in the image, and encrypting using a complex encryption algorithm), in which case the interference image loses the characteristics of the original image, and even the image recognition model cannot recognize it, that is, the interference image cannot be used by the business, loses its use value, and makes the interference processing useless. It can be seen that the prior art method for generating interference images often makes the interference image unusable and cannot be used.

[0055] The solution provided in this specification is described below in conjunction with the accompanying drawings.

[0056] Figure 1 : is a flow chart of a method for generating an interference image in one embodiment of this specification. The execution subject of the method is a device for generating an interference image. It can be understood that the method can also be executed by any device, equipment, platform, or device cluster with computing and processing capabilities. Figure 1 , the method comprising:

[0057] Step 101: Obtaining an original image;

[0058] Steps 103 to 109 are performed for each of at least two first pixels in the original image:

[0059] Step 103: obtaining a background value corresponding to the first pixel;

[0060] Step 105: obtaining an adjustment weight function corresponding to the first pixel;

[0061] Step 107: adding the background value to the original pixel value of the first pixel according to the adjustment weight function to obtain an interference pixel value; and

[0062] Step 109: modifying the pixel value of the first pixel to the interference pixel value;

[0063] Step 111: Obtain an interference image using each first pixel having an interference pixel value.

[0064] According to the above Figure 1 It can be seen from the process shown that in the method for generating an interference image proposed in the embodiment of the present specification, for each first pixel to be interfered with, the background value of the first pixel is added to the original pixel value of the first pixel according to the adjustment weight function corresponding to the first pixel, which is equivalent to adding the background map of the original image to the original image. Because the background map is relatively useless information for the image recognition model, therefore, adding the background map to the original image will interfere with the original image, thereby generating an interference map; at the same time, when adding the background map, the adding method, such as the proportion, is determined according to a predetermined adjustment weight function, so that the useful information and useless background information included in the interference image are adjusted by the adjustment weight function, thereby avoiding the problems caused by insufficient interference or excessive interference in the prior art, so that the interference image has usable interference and can be used.

[0065] In the above Figure 1 In the process shown, the first pixel is the pixel to be disturbed, and the number of pixels to be disturbed can be determined according to the requirement for the degree of interference. For example, if a greater degree of interference is required, the above-mentioned interference can be performed on more first pixels. Figure 1 In the related processing in the process shown in the figure, if a smaller interference degree is required, the above-mentioned processing can be performed on a smaller number of first pixels. Figure 1 For example, in one embodiment, all pixels in the original image are pixels to be disturbed, that is, all pixels in the original image are respectively used as the first pixels mentioned above, and all pixels in the original image are respectively disturbed. Figure 1 The relevant pixel value modification process can achieve the effect of encrypting the original image.

[0066] The following is an explanation of the specific embodiments Figure 1 Each step in the process shown.

[0067] First, in step 101, an original image is acquired.

[0068] Here, the original image is an image that has not been interfered with, such as a face image taken by a camera. The original image is considered to be a clear image, such as a human eye can see the original image and know which person's face image it is.

[0069] Next, in step 103 , a background value corresponding to each of the at least two first pixels in the original image is obtained.

[0070] In this embodiment of the specification, the at least two first pixels to be disturbed may include:

[0071] All pixels in the original image; or,

[0072] At least two pixels in a partial area of ​​the original image.

[0073] In one embodiment, in step 103 , all pixels in the original image may be respectively used as first pixels, and background values ​​corresponding to all pixels may be calculated respectively.

[0074] The requirements that image interference needs to meet as much as possible are: turning a clear original image into an unclear interference image that cannot be recognized by the human eye, but at the same time allowing the interference image to be recognized and processed by the computer's image recognition model, so as to achieve the purpose of removing interference and restoring the original image. Then, the irregular interference methods in the prior art, such as random encryption or arbitrary deformation, will result in the inability to meet the above image interference requirements.

[0075] A statistical law is that there is a dark object in every part of the image. Therefore, in the embodiment of the present specification, in step 103, the statistical law can be used to calculate the background value of each first pixel. At this time, in step 103, the following process from step 1031 to step 1035 can be performed for each first pixel:

[0076] Step 1031: Determine each pixel in a preset image window near the first pixel.

[0077] The preset image window can be an image window of any shape. In one embodiment of the present specification, the preset image window is: an N*N image window centered on the first pixel, where N is an odd number not less than 3. For example, N is 3 or 5. For example, see Figure 2 , taking the image window near pixel E as an example, the image window is: a 3*3 image window centered on pixel E, including 9 pixels including pixel E, such as Figure 2 The 9 pixels represented by the oblique lines. Figure 3 , when pixel F is at the edge of the image, the 2*2 image window including pixel F can be used as the image window corresponding to pixel F, such as Figure 3 The slashes represent 4 pixels.

[0078] Because there is a dark object in every part of the image, by determining an image window near the first pixel to be disturbed, the dark object can be found within the range of the image window of the first pixel.

[0079] Step 1033: Obtain all channel values ​​of all pixels in the preset image window on all image channels.

[0080] For example, see Figure 2 , the 3*3 image window centered on pixel E includes 9 pixels including pixel E. Each pixel has three channels of R, G, and B, so there are a total of 27 channel values. In this step 1033, the smallest channel value is selected from the 27 channel values.

[0081] Step 1035: Take the minimum value of all channel values ​​as the background value corresponding to the first pixel.

[0082] Because the minimum channel value represents a dark object, the minimum channel value can be used as the background value of the first pixel to be disturbed.

[0083] If interference processing, that is, fogging processing, is performed on all pixels in the original image, then steps 1031 to 1035 may be performed on each pixel, thereby obtaining respective background values ​​corresponding to all pixels.

[0084] Next, in step 105, an adjustment weight function corresponding to the first pixel is obtained.

[0085] As mentioned above, the weight adjustment function is used to adjust the ratio of "useful information" (pixel values ​​in the original image) and "useless background information" (background values ​​that need to be added later) included in the image, thereby avoiding the problems caused by insufficient or excessive interference in the prior art.

[0086] In one embodiment of the present specification, the adjustment weight function corresponding to each pixel position in the image can be obtained by a pre-executed training method. Then, in this step 105, the pre-trained adjustment weight function corresponding to the first pixel can be obtained according to the pixel position of the first pixel.

[0087] As mentioned above, the requirement that image interference needs to meet as much as possible is: to turn the clear original image into an unclear interference image so that the human eye cannot recognize it, but at the same time, the interference image must be interfered with by the computer's image recognition model to restore the original image. In order to meet this requirement, the training of the adjustment weight function can be carried out together with the training of the image recognition model, and the two can be trained jointly. In other words, in the process of training the image recognition model, the adjustment weight function corresponding to each pixel position in the image is also trained.

[0088] In one embodiment of this specification, in the joint training, see Figure 4 , the training method for adjusting the weight function corresponding to each pixel position includes:

[0089] Step 401: for the same sample original image, obtaining at least two labeled sample interference images; wherein, at the same pixel position in the at least two sample interference images, at least two sample pixel values ​​are generated using at least two different to-be-selected adjustment weight functions;

[0090] In step 401, each sample pixel value is calculated using the following formula:

[0091] g(x)=i(x)*k(x)+n*b(x)*[1-k(x)];

[0092] Among them, g(x) represents the sample pixel value at pixel position x, i(x) represents the original pixel value of the sample original image at pixel position x, k(x) is a candidate adjustment weight function corresponding to the pixel position x; b(x) represents the background value corresponding to the pixel at pixel position x of the sample original image, and n represents the background superposition multiple, which is a positive integer not less than 1.

[0093] Here, b(x) may be obtained by using the method for calculating the background value in the above description of step 103 .

[0094] Step 403: inputting the at least two sample interference images into the image recognition model to be trained; the loss function of the image recognition model satisfies: the higher the recognition accuracy of the image recognition model, the smaller the value of the loss function, and the greater the difference between the sample interference image and its corresponding original image, the smaller the value of the loss function;

[0095] Step 405: For each pixel position in the sample interference image, the selected adjustment weight function used by the sample pixel value that minimizes the value of the loss function is used as the adjustment weight function corresponding to the pixel position.

[0096] Let's illustrate the above with an example Figure 4 See Figure 4 and Figure 5For example, there is a sample original image, such as a clear face image, and two sample interference images corresponding to the same clear face image are obtained by using different preset adjustment weight functions. The specific process may include: when generating sample interference image 1, for example, sample pixel value 1 at pixel position A is generated by using the preset adjustment weight function 1, and when generating sample interference image 2, sample pixel value 2 at the same pixel position A is generated by using the preset adjustment weight function 2, and for example, sample pixel value 3 at pixel position B is generated by using the preset adjustment weight function 3, and when generating sample interference image 2, sample pixel value 4 at the same pixel position B is generated by using the preset adjustment weight function 4 , and so on. After obtaining sample interference image 1 and sample interference image 2 for the same sample face image, they are input into the face image recognition model to be trained; for pixel position A, sample pixel value 1 (instead of sample pixel value 2) minimizes the value of the loss function of the face image recognition model. Since sample pixel value 1 is generated using adjustment weight function 1, the adjustment weight function corresponding to pixel position A is adjustment weight function 1. For pixel position B, sample pixel value 4 (instead of sample pixel value 3) minimizes the value of the loss function of the face image recognition model. Since sample pixel value 4 is generated using adjustment weight function 4, the adjustment weight function corresponding to pixel position B is adjustment weight function 4.

[0097] Next, in step 107, the background value is added to the original pixel value of the first pixel according to the adjustment weight function to obtain an interference pixel value.

[0098] Because the original image is the image to be interfered with, that is, the "clear image", the original pixel value of the first pixel can be considered as useful information in the image. On the basis of this useful information, the background value corresponding to the first pixel (that is, the relatively useless information obtained in the above steps) is added, which generates interference.

[0099] In one embodiment of the present specification, an implementation process of step 107 includes: performing calculation using the following calculation formula:

[0100] G(x)=I(x)*K(x)+N*B(x)*[1-K(x)];

[0101] Among them, G(x) represents the interference pixel value of the first pixel, I(x) represents the original pixel value of the first pixel, K(x) is the adjustment weight function corresponding to the first pixel; B(x) represents the background value corresponding to the first pixel, and N represents the background superposition multiple, which is a positive integer not less than 1.

[0102] In one embodiment, the value of N is 1. Of course, the value of N can also be set according to the need for the interference level. For example, if stronger interference is required, the value of N can be larger.

[0103] The above calculation formula is only one way to add the background value to the original pixel value. It is understood that in other embodiments of this specification, there are many other ways to implement the addition of background values ​​to the original pixel values. For example, the above calculation formula is deformed, such as G(x) = I(x)*K(x)+{B(x)*[1-K(x)]} n ; Where n is a positive number not less than 1, etc.

[0104] Next, in step 109 , the pixel value of the first pixel is modified to the interference pixel value.

[0105] Next, in step 111, an interference image is obtained by using each first pixel having an interference pixel value.

[0106] After the above steps 103 to 109 are respectively executed for each first pixel to be interfered in the original image (such as all pixels in the original image), the pixel values ​​of the pixels in the original image are modified, and thus the original image becomes an interfered image.

[0107] In one embodiment of the present specification, in order to further increase the interference effect, the interference image obtained in step 111 may be further processed such as stretching and / or rotating.

[0108] In one embodiment of the present specification, a device for generating an interference image is provided. Figure 4 , the device 600 comprises:

[0109] An acquisition module 601 is configured to acquire an original image;

[0110] The background value calculation module 602 is configured to obtain a background value corresponding to each of at least two first pixels in the original image;

[0111] The weight function determination module 603 is configured to obtain, for each of the at least two first pixels in the original image, an adjustment weight function corresponding to the first pixel;

[0112] The interference image generation module 604 is configured to add the background value of the first pixel to the original pixel value of the first pixel according to the adjustment weight function of the first pixel to obtain an interference pixel value; modify the pixel value of the first pixel to the interference pixel value; and use each first pixel with the interference pixel value to obtain an interference image.

[0113] In one embodiment of the device of this specification, the at least two first pixels include:

[0114] All pixels in the original image; or,

[0115] At least two pixels in a partial area of ​​the original image.

[0116] In one embodiment of the apparatus of this specification, the background value calculation module 602 is configured to execute:

[0117] Determine each pixel within a preset image window near the first pixel;

[0118] Obtain all channel values ​​of all pixels in the preset image window on all image channels;

[0119] The minimum value among all channel values ​​is taken as the background value corresponding to the first pixel.

[0120] In one embodiment of the device of the present specification, the preset image window used by the background value calculation module 602 is: an N*N image window centered on the first pixel, where N is an odd number not less than 3.

[0121] In one embodiment of the apparatus of the present specification, the weight function determination module 603 is configured to perform: obtaining an adjustment weight function corresponding to each pixel position in the image by a pre-executed training method, and obtaining an adjustment weight function corresponding to the first pixel according to the pixel position of the first pixel;

[0122] Among them, the pre-executed training methods include:

[0123] For the same sample original image, at least two sample interference images that have been marked are obtained; wherein, at the same pixel position in the at least two sample interference images, at least two sample pixel values ​​are generated using at least two different to-be-selected adjustment weight functions;

[0124] The at least two sample interference images are input into the image recognition model to be trained; the loss function of the image recognition model satisfies: the higher the recognition accuracy of the image recognition model, the smaller the value of the loss function, and the greater the difference between the sample interference image and the corresponding original image, the smaller the value of the loss function;

[0125] For each pixel position in the sample interference image, the selected adjustment weight function used by the sample pixel value that minimizes the value of the loss function is used as the adjustment weight function corresponding to the pixel position.

[0126] In one embodiment of the apparatus of this specification, the interference image generation module 604 is configured to execute:

[0127] Use the following calculation formula to calculate:

[0128] G(x)=I(x)*K(x)+N*B(x)*[1-K(x)];

[0129] Among them, G(x) represents the interference pixel value of the first pixel, I(x) represents the original pixel value of the first pixel, K(x) is the adjustment weight function corresponding to the first pixel; B(x) represents the background value corresponding to the first pixel, and N represents the background superposition multiple, which is a positive integer not less than 1.

[0130] In one embodiment of the apparatus of the present specification, the interference image generation module 604 is further configured to execute: stretching and / or rotating the interference image.

[0131] One embodiment of the present specification provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed in a computer, the computer is caused to execute a method in any one of the embodiments of the present specification.

[0132] An embodiment of the present specification provides a computing device, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method in any embodiment of the specification is implemented.

[0133] It is to be understood that the structures illustrated in the embodiments of this specification do not constitute specific limitations on the devices of the embodiments of this specification. In other embodiments of the specification, the above-mentioned device may include more or fewer components than those shown in the figure, or combine certain components, or split certain components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0134] Since the information interaction, execution process, etc. between the modules in the above-mentioned devices and systems are based on the same concept as the method embodiments of this specification, the specific contents can be found in the description of the method embodiments of this specification and will not be repeated here.

[0135] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0136] Those skilled in the art should be aware that in one or more of the above examples, the functions described in the present invention can be implemented by hardware, software, widgets, or any combination thereof. When implemented by software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium.

[0137] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solution of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for generating an interference image, wherein: include: Get the original image; For each of at least two first pixels in the original image, the following is performed: Obtaining a background value corresponding to the first pixel; Obtaining an adjustment weight function corresponding to the first pixel; Adding the background value to the original pixel value of the first pixel according to the adjustment weight function to obtain an interference pixel value; as well as Modifying the pixel value of the first pixel to the interference pixel value; Obtaining an interference image using each first pixel having each interference pixel value; Wherein, obtaining the background value corresponding to the first pixel includes: Determine each pixel within a preset image window near the first pixel; Obtain all channel values ​​of all pixels in the preset image window on all image channels; The minimum value among all channel values ​​is taken as the background value corresponding to the first pixel.

2. The method according to claim 1, wherein: The at least two first pixels include: All pixels in the original image; or, At least two pixels in a partial area of ​​the original image.

3. The method according to claim 1, wherein: The preset image window is: an N*N image window centered on the first pixel, where N is an odd number not less than 3.

4. The method according to claim 1, wherein: Further including: The adjustment weight function corresponding to each pixel position in the image is obtained through the pre-executed training method. The obtaining of the adjustment weight function corresponding to the first pixel includes: obtaining the adjustment weight function corresponding to the first pixel according to the pixel position of the first pixel; Among them, the pre-executed training methods include: For the same sample original image, at least two sample interference images that have been marked are obtained; wherein at the same pixel position in the at least two sample interference images, at least two sample pixel values ​​are generated using at least two different adjustment weight functions to be selected; The at least two sample interference images are input into the image recognition model to be trained; the loss function of the image recognition model satisfies: the higher the recognition accuracy of the image recognition model, the smaller the value of the loss function, and the greater the difference between the sample interference image and the corresponding sample original image, the smaller the value of the loss function; For each pixel position in the sample interference image, the selected adjustment weight function used by the sample pixel value that minimizes the value of the loss function is used as the adjustment weight function corresponding to the pixel position.

5. The method according to claim 1, wherein: The step of adding the background value to the original pixel value of the first pixel according to the adjustment weight function to obtain the interference pixel value includes: Use the following calculation formula to calculate: G(x)=I(x)*K(x)+N*B(x)*[1-K(x)]; Among them, G(x) represents the interference pixel value of the first pixel, I(x) represents the original pixel value of the first pixel, K(x) is the adjustment weight function corresponding to the first pixel; B(x) represents the background value corresponding to the first pixel, and N represents the background superposition multiple, which is a positive integer not less than 1.

6. The method according to any one of claims 1 to 5, wherein: After obtaining the interference image, the method further includes: The interference image is stretched and / or rotated.

7. A device for generating an interference image, wherein: include: An acquisition module configured to acquire an original image; A background value calculation module, configured to obtain a background value corresponding to each of at least two first pixels in the original image; A weight function determination module, configured to obtain, for each of at least two first pixels in the original image, an adjustment weight function corresponding to the first pixel; The interference image generation module is configured to add the background value of the first pixel to the original pixel value of the first pixel according to the adjustment weight function of the first pixel to obtain an interference pixel value; modify the pixel value of the first pixel to the interference pixel value; and obtain an interference image using each first pixel having each interference pixel value; Wherein, the background value calculation module is configured to execute: Determine each pixel within a preset image window near the first pixel; Obtain all channel values ​​of all pixels in the preset image window on all image channels; The minimum value among all channel values ​​is taken as the background value corresponding to the first pixel.

8. The device according to claim 7, wherein: The weight function determination module is configured to perform: Obtaining a pre-trained adjustment weight function corresponding to the pixel position of the first pixel; Among them, during pre-training: Acquire at least two sample interference images that have been marked; wherein, at a pixel position of a first pixel in the at least two sample interference images, a pixel value is generated using at least two different adjustment weight functions to be selected; The at least two sample interference images are input into the image recognition model to be trained; the loss function of the image recognition model satisfies: the higher the recognition accuracy of the image recognition model, the smaller the value of the loss function, and the greater the difference between the sample interference image and the corresponding original image, the smaller the value of the loss function; The candidate adjustment weight function that minimizes the value of the loss function is used as the adjustment weight function corresponding to the first pixel.

9. A computing device, comprising a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method according to any one of claims 1 to 6 is implemented.