Simulated abnormal image generation method based on Berlin noise

By using Berlin noise to construct mask images, simulated abnormal images are generated, and the problem of insufficient abnormal recognition ability in images with less texture information is solved, and high-precision abnormal positioning and recognition are achieved.

CN120543386APending Publication Date: 2025-08-26HUNAN FIRST NORMAL UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510592168.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-09
Publication Date
2025-08-26

AI Technical Summary

Technical Problem

In the prior art, in images with less texture information, the copy-pasteed abnormal areas are small and the normal images, resulting in insufficient abnormal recognition capabilities.

Method used

Mask images are constructed using Berlin noise, linear and clumped simulated exception masks are generated, abnormal areas are constructed in combination with texture images, and added to normal images to generate simulated exception images.

Benefits of technology

High-precision abnormal positioning and recognition are achieved, and the recognition ability of abnormal images is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120543386A_ABST
    Figure CN120543386A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of simulated abnormal images, and discloses a simulated abnormal image generation method based on Berlin noise, which comprises the following steps: S1, constructing a plurality of mask images based on the Berlin noise, and constructing a mask library; s2, selecting a plurality of texture images, and constructing a texture library; s3, randomly selecting an image from each of the mask library and the texture library as an abnormal mask image and an abnormal texture image, and performing AND operation on the abnormal mask image and the abnormal texture image to construct an abnormal region; and S4, selecting a normal sample image, and adding the abnormal region to the normal sample image to obtain a simulated abnormal image. According to the method, the simulated abnormal image is constructed by adding the Berlin noise, and the abnormal mask of the simulated abnormal image is directly output by the model, so that high-precision abnormal positioning is realized, and the recognition capability of the abnormal image is effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of simulated abnormal images, and in particular to a method for generating simulated abnormal images based on Perlin noise. Background Art

[0002] Anomaly detection, a machine learning technique, aims to identify abnormal samples that differ from normal samples. Traditional anomaly detection methods often rely on real anomaly samples for training, but these are often scarce and difficult to obtain. To alleviate this problem, researchers have recently explored methods for generating simulated anomaly images to improve anomaly detection performance.

[0003] Some researchers randomly copy parts of an image and paste them elsewhere in the image. The copied image blocks are either rectangular or long strips. This method first trains a neural network with normal images and generated abnormal images to classify them. This trained network is then used to perform image-level anomaly classification or pixel-level anomaly location. However, this method is more practical for images with rich texture information, but for images with little texture information, the copied and pasted areas differ little from the normal image, making it less capable of identifying abnormal images. Summary of the Invention

[0004] The present invention aims to provide a method for generating simulated abnormal images based on Perlin noise. The simulated abnormal image is constructed by adding Perlin noise, and the abnormal mask of the simulated abnormal image is directly output by the model, thereby achieving high-precision abnormality positioning and effectively improving the ability to recognize abnormal images.

[0005] In order to achieve the above object, the present invention provides the following technical solutions:

[0006] A method for generating a simulated abnormal image based on Perlin noise comprises the following steps:

[0007] S1. Construct several mask images based on Perlin noise and build a mask library;

[0008] S2. Select several texture images and build a texture library;

[0009] S3. Randomly select one image from the mask library and one from the texture library as the abnormal mask image and abnormal texture image, and perform an AND operation on the abnormal mask image and the abnormal texture image to construct the abnormal area;

[0010] S4. Select a normal sample image and add the abnormal area to the normal sample image to obtain a simulated abnormal image.

[0011] Furthermore, in S1 , the mask image includes a linear simulated abnormality mask image and a blob-shaped simulated abnormality mask image.

[0012] Furthermore, the method for constructing a linear anomaly mask image includes the following steps:

[0013] Step 1: Create a blank image;

[0014] The second step is to construct a one-dimensional Perlin noise curve, randomly select a point on the blank image, and draw the one-dimensional Perlin noise curve on the blank image to obtain a one-dimensional Perlin noise image;

[0015] The third step is to randomly rotate the one-dimensional Perlin noise image and perform a dilation operation to obtain a linear anomaly mask image.

[0016] Furthermore, the method for constructing a cluster-shaped simulated abnormal mask image includes the following steps:

[0017] The first step is to construct a two-dimensional Perlin noise image;

[0018] The second step is to binarize the two-dimensional Perlin noise image with a random threshold to obtain a binary image;

[0019] The third step is to perform an AND operation on the binary image to obtain a binary image containing the foreground area, and perform an open operation on the image to obtain a clustered simulated anomaly mask image.

[0020] The beneficial effects of the technical solution are:

[0021] The present invention uses Perlin noise to construct an image mask. Perlin noise has good smoothness and can better simulate real physical scenes. Perlin noise can be one-dimensional or high-dimensional, and can construct linear simulated abnormality masks and clustered simulated abnormality masks of various shapes and sizes. In addition, the image mask and texture image are combined to construct an abnormal area, and then the abnormal area is added to the normal image to generate a simulated abnormal image. The model directly outputs the abnormal mask of the simulated abnormal image. This simulated abnormal image can guide the model to tighten the decision boundary of the normal image distribution, achieve high-precision abnormality positioning, and effectively improve the recognition ability of abnormal images. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 A schematic diagram showing the construction principle of one-dimensional Perlin noise in a method for generating a simulated abnormal image based on Perlin noise according to the present invention;

[0023] Figure 2 A curve constructed using one-dimensional Perlin noise in a method for generating a simulated abnormal image based on Perlin noise according to the present invention;

[0024] Figure 3This is a flowchart for constructing a linear simulated mask image in a method for generating a simulated abnormal image based on Perlin noise according to the present invention. In the figure, (a) is a blank image, (b) is a one-dimensional Perlin noise image, (c) is a rotated one-dimensional Perlin noise image, and (d) is a linear simulated abnormal mask image.

[0025] Figure 4 A typical linear simulated abnormal mask image constructed by a simulated abnormal image generation method based on Perlin noise of the present invention;

[0026] Figure 5 A schematic diagram of a two-dimensional Perlin noise construction method for generating a simulated abnormal image based on Perlin noise according to the present invention;

[0027] Figure 6 An image constructed using two-dimensional Perlin noise in a method for generating a simulated abnormal image based on Perlin noise according to the present invention;

[0028] Figure 7 This is a flowchart for constructing a clumping simulated mask in a method for generating a simulated abnormal image based on Perlin noise according to the present invention. In the figure, (a) is a two-dimensional Perlin noise image, (b) is a binary image, (c) is a binary image including a foreground area, and (d) is a clumping simulated abnormal mask image.

[0029] Figure 8 A typical clustered simulated abnormal mask image constructed by a simulated abnormal image generation method based on Perlin noise in the present invention;

[0030] Figure 9 A typical texture image of a DTD data set for a method for generating a simulated abnormal image based on Perlin noise according to the present invention;

[0031] Figure 10 A flowchart of a simulated abnormal image generation method based on Perlin noise according to the present invention;

[0032] Figure 11 These are typical simulated abnormal images generated by a simulated abnormal image generation method based on Perlin noise according to the present invention; (a) is a cluster-shaped simulated abnormal image; (b) is a line-shaped simulated abnormal image. DETAILED DESCRIPTION

[0033] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments:

[0034] A method for generating a simulated abnormal image based on Perlin noise comprises the following steps:

[0035] S1. Construct 1000 mask images based on Perlin noise and use these masks to build a mask library; the mask images include linear simulated abnormal mask images and cluster simulated abnormal mask images;

[0036] The construction principle of one-dimensional Perlin noise is as follows Figure 1 As shown, there are six cells on the coordinate axis, evenly divided into two lattices. The lattice interface falls at points 0, 3, and 6. Random gradient values ​​v0, v3, and v6 are assigned to these three points. The gradient value of any other point can be obtained by interpolating these three values. Since the gradient values ​​of all intermediate points are continuous, the constructed curve is smooth. Figure 2 Shown is a curve constructed using one-dimensional Perlin noise;

[0037] The process of constructing a linear anomaly mask based on one-dimensional Perlin noise is as follows: Figure 3 As shown. The first step is to create Figure 3 (a) shows a blank image with a size of 224×224 and a grayscale value of 0. In the second step, a one-dimensional Perlin noise curve is constructed, and a point is randomly selected on the blank image. The curve is drawn on the blank image to obtain a one-dimensional Perlin noise image, as shown in FIG. Figure 3 (b) As shown; The third step is to randomly rotate the one-dimensional Perlin noise image to obtain Figure 3 (c), finally, the image is dilated with a random value as the kernel size, and the result is as follows Figure 3 (d) shows the linear simulated abnormal mask image. By this method, it is possible to construct Figure 4 Linear simulated anomaly masks of various lengths, positions, angles, and thicknesses are shown;

[0038] The construction principle of 2D Perlin noise is similar to that of 1D Perlin noise, except that 2D Perlin noise is obtained by constructing a lattice and interpolating it in 2 dimensions. Figure 5 As shown, the 6×6 cells in the image are evenly divided into a 2×2 lattice. Random gradients are taken at the intersections of the lattice. When calculating the gradient of any point p in the image, the gradient values ​​of points p1 and p2 are first calculated. Then, the gradient value of point p is calculated based on the gradient values ​​of p1 and p2. This method can calculate the gradient values ​​of all points in the two-dimensional data. Because the gradient values ​​of each point are continuous, the grayscale values ​​of the constructed two-dimensional image have a smooth transition. Figure 6 Shown is an image constructed using 2D Perlin noise;

[0039] The process of constructing a clumping mask based on two-dimensional Perlin noise is as follows: Figure 7 As shown, the first step is to build Figure 7 (a) shows three two-dimensional Perlin noise images; in the second step, the three images are binarized with random thresholds to obtain the following Figure 7 (b) shows three binary images; the third step is to perform AND operation on these three binary images to obtain Figure 7(c) shows a binary image containing only a small amount of foreground area. Finally, the image is opened and the image is obtained as follows Figure 7 (d) shows the final cluster-like simulated abnormal mask image. By this method, we can construct Figure 8 The various shapes and sizes of cluster-shaped simulated anomaly masks shown;

[0040] S2. Randomly select 1000 texture images from the DTD dataset and build a texture library with these texture images; the Describable Textures Dataset (DTD) is a general texture dataset that contains 47 types of textures, and each texture has at least 120 images. Figure 9 The following are typical texture images in the DTD dataset, with texture types including dot, stripe, feather, scale, grid, crack, vortex, and honeycomb. Therefore, the images in this dataset are used as texture images to generate simulated abnormal images.

[0041] S3. Randomly select an image from the mask library as the abnormal mask image, randomly select an image from the texture library as the abnormal texture image, and perform an AND operation on the abnormal mask image and the abnormal texture image to construct the abnormal area;

[0042] S4, such as Figure 10 As shown, select the normal sample image I i , add the abnormal area to the normal sample image I i On the above, we get the simulated abnormal image I i ′. Typical simulated abnormal images are as follows Figure 11 shown.

[0043] In summary, the present invention uses Perlin noise to construct an image mask. Perlin noise has good smoothness and can better simulate real physical scenes. Perlin noise can be one-dimensional or high-dimensional, and can construct linear simulated abnormality masks and clustered simulated abnormality masks of various shapes and sizes. In combination with the image mask and the texture image, an abnormal area is constructed, and then the abnormal area is added to the normal image to generate a simulated abnormal image. The model directly outputs the abnormal mask of the simulated abnormal image. This simulated abnormal image can guide the model to tighten the decision boundary of the normal image distribution, achieve high-precision abnormality positioning, and effectively improve the recognition ability of abnormal images.

[0044] The above is only an embodiment of the present invention, and common knowledge such as the specific technical solutions or characteristics in the solution is not described in detail here. It should be pointed out that for those skilled in the art, without departing from the technical solution of the present invention, several variations and improvements can be made, which should also be regarded as the scope of protection of the present invention, and these will not affect the effect of the implementation of the present invention and the practicality of the patent. The scope of protection required by this application shall be based on the content of its claims, and the specific implementation methods and other records in the description can be used to interpret the content of the claims.

Claims

1. A method for generating a simulated abnormal image based on Perlin noise, characterized in that: The following steps are involved: S1. Construct several mask images based on Perlin noise and build a mask library; S2. Select several texture images and build a texture library; S3. Randomly select one image from the mask library and one from the texture library as the abnormal mask image and abnormal texture image, and perform an AND operation on the abnormal mask image and the abnormal texture image to construct the abnormal area; S4. Select a normal sample image and add the abnormal area to the normal sample image to obtain a simulated abnormal image.

2. The method for generating a simulated abnormal image based on Perlin noise according to claim 1, wherein: In S1 , the mask image includes a linear simulated abnormality mask image and a blob simulated abnormality mask image.

3. The method for generating a simulated abnormal image based on Perlin noise according to claim 2, characterized in that: The method for constructing a linear anomaly mask image includes the following steps: Step 1: Create a blank image; The second step is to construct a one-dimensional Perlin noise curve, randomly select a point on the blank image, and draw the one-dimensional Perlin noise curve on the blank image to obtain a one-dimensional Perlin noise image; The third step is to randomly rotate the one-dimensional Perlin noise image and perform a dilation operation to obtain a linear anomaly mask image.

4. The method for generating a simulated abnormal image based on Perlin noise according to claim 2, wherein: The method for constructing a cluster-shaped simulated anomaly mask image includes the following steps: The first step is to construct a two-dimensional Perlin noise image; The second step is to binarize the two-dimensional Perlin noise image with a random threshold to obtain a binary image; The third step is to perform an AND operation on the binary image to obtain a binary image containing the foreground area, and perform an open operation on the image to obtain a clustered simulated anomaly mask image.