Periodic image anomaly detection method and device, electronic equipment and storage medium

CN118247237BActive Publication Date: 2026-11-03HONG KONG UNIV OF SCI & TECH (GUANGZHOU)
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410330678.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-21
Publication Date
2026-11-03
Estimated Expiration
2044-03-21

AI Technical Summary

Technical Problem

Existing technologies suffer from problems such as long processing time and inaccurate detection of irregular textures when detecting anomalies in periodic texture images.

Method used

By acquiring periodic images, performing rotational sampling, constructing an image self-expression model, updating texture data, and performing image expansion and reconstruction, anomaly detection is finally performed.

Benefits of technology

It improves the speed and accuracy of anomaly detection in periodic texture images, reduces the amount of data processing, and enhances the ability to detect irregular textures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118247237B_ABST
    Figure CN118247237B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a periodic image anomaly detection method and device, electronic equipment and storage medium, belonging to the technical field of image anomaly detection. The method comprises: acquiring a periodic image; wherein the periodic image is an image with periodic texture; performing rotation sampling processing on the periodic image to obtain a sampled image; constructing an image self-expression model according to preset preliminary image texture data and the sampled image; wherein the image self-expression model is used to represent the periodic texture in the sampled image and filter noise and defects in the sampled image; updating the preliminary image texture data based on the image self-expression model to obtain target image texture data; performing image expansion reconstruction on the sampled image according to the target image texture data to obtain a target reference image; and performing anomaly detection on the periodic image according to the target reference image to obtain image anomaly information. The embodiments of the present application can accurately and quickly detect the anomaly of the periodic texture image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image anomaly detection technology, and in particular to a method and apparatus, electronic device and storage medium for periodic image anomaly detection. Background Technology

[0002] Periodic texture images are images composed of texture primitives arranged and repeating in a periodic manner. In anomaly detection of periodic texture images, one approach is learning-based, which involves constructing a training dataset for each specific texture and training a deep learning model for that texture using that dataset. However, this method requires a significant amount of time to prepare the training dataset and train the deep learning model. Another approach is based on structural analysis, but this type of method is suitable for highly regular textures and cannot accurately detect irregular textures. Therefore, how to accurately and quickly detect anomalies in periodic texture images has become a pressing problem. Summary of the Invention

[0003] The main objective of this application is to provide a method, apparatus, electronic device, and storage medium for detecting periodic image anomalies, aiming to provide accurate and rapid detection of anomalies in periodic texture images.

[0004] To achieve the above objectives, a first aspect of this application proposes a method for detecting periodic image anomalies, the method comprising:

[0005] Obtain a periodic image; wherein the periodic image is an image with periodic texture;

[0006] The periodic image is subjected to rotational sampling processing to obtain a sampled image;

[0007] An image self-expression model is constructed based on preset preliminary image texture data and the sampled image; wherein, the image self-expression model is used to characterize the periodic texture in the sampled image and filter noise and defects in the sampled image;

[0008] The initial image texture data is updated based on the image self-expression model to obtain the target image texture data;

[0009] The sampled image is expanded and reconstructed based on the target image texture data to obtain the target reference image;

[0010] Anomaly detection is performed on the periodic image based on the target reference image to obtain image anomaly information.

[0011] In some embodiments, the preliminary image texture data includes: preliminary defect indication data and preliminary periodic texture vectors; the image self-expression model includes: a periodic texture sub-model and a defect indication sub-model; updating the preliminary image texture data based on the image self-expression model to obtain the target image texture data includes:

[0012] Based on the periodic texture sub-model and the preliminary defect indication data, the preliminary periodic texture vector is iteratively optimized to obtain the target periodic texture vector.

[0013] Based on the defect indicator sub-model and the target periodic texture vector, the preliminary defect indicator data is iteratively optimized to obtain the target defect indicator data.

[0014] In some embodiments, the preliminary periodic texture vector includes: a preliminary column texture vector and a preliminary row texture vector; the periodic texture sub-model includes: a row texture sub-model and a column texture sub-model; the iterative optimization process based on the periodic texture sub-model and the preliminary defect indication data to obtain the target periodic texture vector includes:

[0015] The preliminary row texture vector is optimized based on the preliminary column texture vector, the preliminary defect indication data, and the row texture sub-model to obtain candidate row texture vectors;

[0016] Based on the preliminary defect indication data, the candidate row texture vector, and the column texture sub-model, the preliminary column texture vector is optimized to obtain the candidate column texture vector;

[0017] Based on the preliminary defect indication data, the candidate column texture vectors, and the row texture sub-model, the candidate row texture vectors are optimized to obtain the target row texture vectors;

[0018] Based on the preliminary defect indication data, the target row texture vector, and the column texture sub-model, the candidate column texture vector is optimized to obtain the target column texture vector.

[0019] In some embodiments, the step of performing anomaly detection on the periodic image based on the target reference image to obtain image anomaly information includes:

[0020] The periodic image is divided into blocks according to a preset block size to obtain multiple periodic block images;

[0021] The target reference image is divided into multiple reference block images according to the block size;

[0022] Based on each periodic block image, similar block images are extracted from multiple reference block images to obtain similar block images for each periodic block image;

[0023] Based on the similar segmented images, a regularized anomaly measurement is performed on each of the periodic segmented images to obtain the regularized anomaly measurement data of each of the periodic segmented images.

[0024] A regularized anomaly distance image is constructed based on the regularized anomaly metric data and the similarity block image;

[0025] The regularized anomaly distance image is convolved according to a preset convolution kernel to obtain anomaly scores;

[0026] The image anomaly information is determined based on the anomaly score and the preset anomaly threshold.

[0027] In some embodiments, performing rotational sampling on the periodic image to obtain a sampled image includes:

[0028] Perform periodic direction measurement on the periodic image to obtain rotation direction measurement data;

[0029] The image size of the periodic image is obtained, and a first sampling range is determined based on the rotation direction measurement data and the image size;

[0030] The periodic image is sampled according to the first sampling range to obtain a sampled image.

[0031] In some embodiments, the step of performing a regularized anomaly measurement on each periodic block image based on the similar block images to obtain regularized anomaly measurement data for each periodic block image includes:

[0032] The mean vector is obtained by performing mean processing on each periodic block image based on the similar block images;

[0033] Based on the similar segmented images, the standard deviation of each periodic segmented image is measured to obtain standard deviation measurement data;

[0034] The regularized anomaly measurement data is constructed based on the mean vector, the standard deviation measurement data, and the periodic block image.

[0035] In some embodiments, the step of performing image expansion and reconstruction on the sampled image based on the target image texture data to obtain a target reference image includes:

[0036] Based on the target image texture data, the sampled image is subjected to defect removal processing to obtain a sampled reference image;

[0037] The sampled reference image is subjected to image augmentation processing based on the target image texture data to obtain an augmented reference image;

[0038] The target reference image is obtained by backsampling the extended reference image based on the rotation direction measurement data and the image size.

[0039] To achieve the above objectives, a second aspect of this application provides a periodic image anomaly detection device, the device comprising:

[0040] An acquisition module is used to acquire a periodic image; wherein the periodic image is an image with a periodic texture;

[0041] A rotation sampling module is used to perform rotation sampling processing on the periodic image to obtain a sampled image;

[0042] A construction module is used to construct an image self-expression model based on preset preliminary image texture data and the sampled image; wherein, the image self-expression model is used to characterize the periodic texture in the sampled image and filter noise and defects in the sampled image;

[0043] The update module is used to update the preliminary image texture data based on the image self-expression model to obtain the target image texture data;

[0044] An extended reconstruction module is used to perform image extended reconstruction on the sampled image based on the target image texture data to obtain a target reference image;

[0045] The detection module is used to perform anomaly detection on the periodic image based on the target reference image to obtain image anomaly information.

[0046] To achieve the above objectives, a third aspect of this application provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the method described in the first aspect.

[0047] To achieve the above objectives, a fourth aspect of the present application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method described in the first aspect.

[0048] This application proposes a method, apparatus, electronic device, and storage medium for periodic image anomaly detection. It acquires a periodic image and performs rotational sampling processing on the periodic image to obtain a sampled image. This rotation corrects the image to the same direction, providing a data foundation for subsequent learning of image texture data in the same direction. Sampling the rotated image reduces the amount of image data that needs to be processed, improving the speed of periodic texture image anomaly detection. Furthermore, it constructs an image self-expression model based on the initial texture image data and the sampled image, and updates the initial texture image data based on the image self-expression model to obtain target image texture data. This directly constructs texture data from the image, improving the speed of detecting anomalies in periodic texture images. Further, it performs image expansion and reconstruction on the sampled image based on the target image texture data to obtain a target reference image. Anomaly detection is then performed on the periodic image based on the target reference image to obtain image anomaly information. By correcting irregular textures in the image using the target image texture data, the accuracy of anomaly detection in periodic texture images is improved. Attached Figure Description

[0049] Figure 1 This is a flowchart of the periodic image anomaly detection method provided in the embodiments of this application;

[0050] Figure 2 yes Figure 1 The flowchart of step S102 in the document;

[0051] Figure 3 yes Figure 1 The flowchart of step S104 in the process;

[0052] Figure 4 yes Figure 3 The flowchart of step S301 in the process;

[0053] Figure 5 yes Figure 1 The flowchart of step S105 in the process;

[0054] Figure 6 yes Figure 1 The flowchart of step S106 in the process;

[0055] Figure 7 yes Figure 6 The flowchart of step S604 in the document;

[0056] Figure 8 This is a schematic diagram of the structure of the periodic image anomaly detection device provided in the embodiments of this application;

[0057] Figure 9 This is a schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application;

[0058] Figure 10This is a schematic diagram of image sampling provided in an embodiment of this application;

[0059] Figure 11 This is an overall iterative optimization flowchart provided in the embodiments of this application;

[0060] Figure 12 This is an extended schematic diagram of an embodiment of the present application;

[0061] Figure 13 This is a schematic diagram of reverse sampling provided in an embodiment of this application;

[0062] Figure 14 This is a schematic diagram of anomaly detection provided in an embodiment of this application;

[0063] Figure 15 This is a schematic diagram of overall image anomaly detection provided in an embodiment of this application. Detailed Implementation

[0064] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0065] It should be noted that although functional modules are divided in the device schematic diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first," "second," etc., in the specification, claims, and the aforementioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.

[0066] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.

[0067] First, let's analyze some of the terms used in this application:

[0068] Periodic texture refers to a texture pattern or structure in an image or visual scene that exhibits periodicity and repetition. This texture pattern appears with a certain frequency or regularity in the image and repeats within a certain spatial range. Periodic textures can take various forms, including but not limited to periodic stripes, grids, meshes, and ripples. These texture patterns have important applications in image processing and computer vision. For example, in tasks such as texture analysis, image recognition, and object detection, the detection and analysis of periodic textures can help algorithms better understand the content and structure of images, thereby achieving more accurate image analysis and processing.

[0069] Noise, in image and signal processing, refers to random interference or unwanted components in an image or signal. This interference can be introduced by factors such as camera sensors, light sources, environment, and transmission channels, or it may be caused by equipment malfunction, signal corruption, or transmission errors. Noise can exist in various forms, including Gaussian noise, salt-and-pepper noise, and periodic noise. In image processing, noise degrades image quality, making images blurry, distorted, or difficult to recognize. Therefore, noise removal is an important task in image processing, typically achieved through techniques such as filters to suppress or reduce the impact of noise, thereby improving image quality and usability.

[0070] Block image processing is an image processing technique that divides an image into several independent blocks or regions. In block image processing, the image is divided into multiple rectangular blocks of the same or different sizes, and each block can be processed independently, such as through compression, enhancement, and feature extraction. This technique is commonly used in image compression, image retrieval, and object tracking. By processing local regions of the image, it can improve processing efficiency, reduce computational load, and facilitate more refined processing and analysis of specific areas.

[0071] Regularization is a technique in machine learning used to control model complexity. When training a machine learning model, regularization adds a constraint term to the loss function to limit the size or complexity of the model parameters, thereby preventing the model from overfitting the training data. Overfitting occurs when a model performs well on the training data but poorly on unseen data. This is usually because the model overlearns noise or details in the training data, ignoring the overall patterns in the data.

[0072] Periodic textures are composed of texture primitives that are arranged and repeated in a periodic manner. Common examples of periodic textures include textile textures, carbon fiber material surface textures, and display panels.

[0073] In anomaly detection of periodic texture images, one approach is learning-based, which involves constructing a training dataset for each specific texture and training a deep learning model for that texture based on the training dataset. However, this method requires a significant investment of time in preparing the training dataset and training the deep learning model. Another approach is based on structural analysis, but this type of method is suitable for highly regular textures and cannot accurately detect irregular textures. Therefore, how to accurately and quickly detect anomalies in periodic texture images has become a pressing problem.

[0074] Based on this, embodiments of this application provide a method, apparatus, electronic device, and storage medium for detecting periodic image anomalies, aiming to accurately and quickly detect anomalies in periodic texture images.

[0075] This application provides a method, apparatus, electronic device, and storage medium for detecting periodic image anomalies, which will be described in detail through the following embodiments. First, the method for detecting periodic image anomalies in this application is described.

[0076] The embodiments of this application can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence (AI) refers to the theories, methods, technologies, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.

[0077] Foundational technologies for artificial intelligence generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies mainly encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.

[0078] The periodic image anomaly detection method provided in this application relates to the field of image anomaly detection technology. The image anomaly detection method provided in this application can be applied to a terminal, a server, or software running on either a terminal or a server. In some embodiments, the terminal can be a smartphone, tablet, laptop, desktop computer, etc.; the server can be configured as an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application implementing the periodic image anomaly detection method, but is not limited to the above forms.

[0079] This application can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices. This application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.

[0080] Figure 1 This is an optional flowchart of the periodic image anomaly detection method provided in the embodiments of this application. Figure 1 The method may include, but is not limited to, steps S101 to S106.

[0081] Step S101: Obtain a periodic image; wherein, the periodic image is an image with periodic texture;

[0082] Step S102: Perform rotational sampling processing on the periodic image to obtain a sampled image;

[0083] Step S103: Construct an image self-expression model based on the preset preliminary image texture data and sampled images; wherein, the image self-expression model is used to characterize the periodic texture in the sampled images and filter out noise and defects in the sampled images;

[0084] Step S104: Update the preliminary image texture data based on the image self-expression model to obtain the target image texture data;

[0085] Step S105: Perform image expansion and reconstruction on the sampled image based on the target image texture data to obtain the target reference image;

[0086] Step S106: Perform anomaly detection on the periodic image based on the target reference image to obtain image anomaly information.

[0087] Steps S101 to S106 of this embodiment involve acquiring a periodic image and performing rotational sampling on it to obtain a sampled image. This rotation corrects the image to the same direction, providing a data foundation for subsequent learning of image texture data in the same direction. Sampling the rotated image reduces the amount of image data that needs to be processed, thus improving the speed of anomaly detection in periodic texture images. Furthermore, an image self-expression model is constructed based on the initial texture image data and the sampled image, and the initial texture image data is updated based on the image self-expression model to obtain target image texture data. Texture data is directly constructed from the image, improving the speed of detecting anomalies in periodic texture images. Furthermore, the sampled image is expanded and reconstructed based on the target image texture data to obtain a target reference image. Anomaly detection is then performed on the periodic image based on the target reference image to obtain image anomaly information. By correcting irregular textures in the image using the target image texture data, the accuracy of anomaly detection in periodic texture images is improved.

[0088] In step S101 of some embodiments, periodic texture refers to a characteristic texture that has a distinct repeating pattern or periodic structure in an image or signal. A periodic image is an image that contains periodic texture, such as a sine wave image, a pulse signal image, a display panel, an image of textile clothing, and an image of a tiled wall.

[0089] Please see Figure 2 In some embodiments, step S102 may include, but is not limited to, steps S201 to S203:

[0090] Step S201: Perform periodic direction measurement on the periodic image to obtain rotation direction measurement data;

[0091] Step S202: Obtain the image size of the periodic image, and determine the first sampling range based on the rotation direction measurement data and the image size;

[0092] Step S203: The periodic image is sampled according to the first sampling range to obtain a sampled image.

[0093] Steps S201 to S203 as shown in the embodiments of this application determine the first sampling range by acquiring the rotation direction measurement data and image size of the periodic image, and sampling the periodic image according to the sampling range. This can correct the image rotation to the same direction, providing a data basis for subsequent learning of image texture data in the same direction. Sampling the rotated image reduces the amount of image data that needs to be processed.

[0094] In step S201 of some embodiments, the periodic direction refers to the repeating direction of periodic textures in a periodic image, along which the repeating features in the image are most prominent. The periodic direction metric is used to determine the vector of the periodic direction in the periodic image, i.e., rotation direction metric data.

[0095] Please see Figure 10 In step S202 of some embodiments, the dimensions of the image are obtained, including width and height, and a first sampling area is determined based on the rotation direction and the width and height, such as... Figure 10 The square frame in the image, with the direction of the top edge of the square frame being the rotation direction measurement data, determines the largest square frame that can be accommodated in the periodic image as the first sampling area based on the width and height of the periodic image.

[0096] Please see Figure 10 In step S203 of some embodiments, the periodic image is cropped according to the first sampling range, the cropped image is used as the sampled image, and the sampled image is rotated so that the top edge is in the same direction as the horizontal axis and the left and right sides are in the same direction as the vertical axis.

[0097] In step S103 of some embodiments, the self-expressive model is used to express the periodic texture of the sampled image and filter noise and texture in the sampled image. For an ideal image including periodic texture, i.e. excluding noise and defects, the points in each phase of the texture data can be obtained by weighted averaging of points in the same phase, as shown in equation (1):

[0098]

[0099] Among them, y i ,y j Represented as points on periodic texture data in a periodic texture image, where T is the period, i,j are the one-dimensional coordinates of the points, and r i,j For y j With y i The weights between them, when When, it represents y j With y i They are points on the same phase and y j With y i The weight between points is greater than or equal to 0, and the weight between points on different phases is 0.

[0100] and use Construct the weight matrix as shown in equation (2):

[0101]

[0102]

[0103] Where R(T) is the weight matrix, and R(T)·Y is the self-expression of Y.

[0104] For one-dimensional periodic texture data, the interval |ij| between two discrete sampling points belongs to the set {0,1,2,…n-1}, and can be represented by an n-dimensional periodic vector. Construct the weight matrix Construct a symmetric matrix about the periodic vector λ As shown in equation (3):

[0105]

[0106] Here, S(λ) is a symmetric matrix about the periodic vector λ.

[0107] Construct a symmetric matrix from the periodic vector λ and a diagonal matrix As shown in equation (4):

[0108]

[0109] Where W(λ) is a diagonal matrix about the periodic vector λ.

[0110] An ideal self-expression model of a periodic texture image is constructed based on the diagonal and symmetric matrices. The constructed ideal self-expression model is shown in Equation (5):

[0111] Y=R(λ)·Y=W(λ)·S(λ)·Y (5),

[0112] In actual image data, noise is unavoidable, and some defective product surface images contain defects. Therefore, it is necessary to consider noise and defect factors in the image and construct the original self-expressive model as shown in Equation (6):

[0113] Y = Y * +A+E (6),

[0114] Where Y = Y * +A+E, where Y is the input sampled image, Y * For the ideal sampled image, A represents the defect and E represents the noise. The original self-expression model is used to replace the noise to obtain the preliminary self-expression model, as shown in Equation (7):

[0115] Y=W(λ)·S(λ)·(YA)+A+EW(λ)·S(λ)·E (7),

[0116] Among them, W(λ)·S(λ)·(YA)=W(λ)·S(λ)·(Y * +E)=Y *+W(λ)·S(λ)·E, according to equation (7), E=[I n -W(λ)·S(λ)] -1 ·[(YA)-W(λ)·S(λ)·(YA)] is noise.

[0117] Based on the preliminary self-expression model, a one-dimensional optimization model is constructed, as shown in equation (8):

[0118]

[0119] in, It is the target optimization value, I n It is an identity matrix, ||A||1 represents the Manhattan norm of defect A, and is the sum of the absolute values ​​of all elements in the matrix. ρ is the square of the Frobenius norm of the noise, which is the sum of the squares of all elements in matrix E, and ρ3 is the weight value of the Hammanton norm of defect A, used to constrain the sparsity of A.

[0120] In equation (8), E = [I n -W(λ)·S(λ)] -1 ·[(YA)-W(λ)·S(λ)·(YA)], used here To simplify the replacement Each of its components also conforms to a Gaussian noise distribution. Since λ is nonconvex, we can approximate it using S(λ)·(YA). Use constraint terms To make W(λ) approximately equal to the identity matrix I n This makes the final objective function convex with respect to λ. The components of the optimal solution with respect to λ are... l The inequality λ is non-zero only when l = kT, k = 0, 1, ..., n-1, therefore the optimal solution for λ is sparse. On some smooth surfaces, it is difficult to converge to a sparse optimal solution. Therefore, constraint terms are used. The approach tends to reduce the difference between each component, and uses the constraint term ρ2||λ||1 to select a sparse solution for λ, where ρ1 and ρ2 are preset weight values.

[0121] At the same time, to avoid λ converging into such trivial but meaningless solutions, such as the trivial solution [1 0…0], T To restrict λ, the first p parameters of λ are restricted to 0, as shown in equation (9):

[0122]

[0123] in, For the objective of the one-dimensional optimization model, specifically, p can be the top 10% or top 20% of n. It should be noted that the embodiments of this application do not impose specific numerical limitations on p.

[0124] And based on the one-dimensional optimization model of the target, the two-dimensional case is deduced, which will not be elaborated here, and the image self-expression model is obtained, as shown in Equation (10):

[0125]

[0126] Please see Figure 3 In some embodiments, step S104 may include, but is not limited to, steps S301 to S302:

[0127] Step S301: Based on the periodic texture sub-model and preliminary defect indication data, the preliminary periodic texture vector is iteratively optimized to obtain the target periodic texture vector;

[0128] Step S302: Based on the defect indicator sub-model and the target periodic texture vector, the preliminary defect indicator data is iteratively optimized to obtain the target defect indicator data.

[0129] Steps S301 to S304 as shown in the embodiments of this application optimize the initial periodic texture vector by using the periodic texture sub-model to obtain the target periodic texture vector, and iteratively optimize the initial defect indication data by using the defect indication sub-model to obtain the target defect indication data. This can improve the expressive power of the periodic texture vector and the target defect indication data for the sampled image, and improve the accuracy of subsequent anomaly detection of the target reference image and periodic image constructed based on the periodic texture vector and the target defect indication data.

[0130] Please see Figure 4 In some embodiments, step S301 may include, but is not limited to, steps S401 to S404:

[0131] Step S401: Optimize the preliminary row texture vector based on the preliminary column texture vector, preliminary defect indication data and row texture sub-model to obtain candidate row texture vectors;

[0132] Step S402: Optimize the preliminary column texture vector based on the preliminary defect indication data, candidate row texture vector, and column texture sub-model to obtain candidate column texture vector;

[0133] Step S403: Based on the preliminary defect indication data, candidate column texture vectors, and row texture sub-models, optimize the candidate row texture vectors to obtain the target row texture vectors;

[0134] Step S404: Based on the preliminary defect indication data, the target row texture vector, and the column texture sub-model, the candidate column texture vector is optimized to obtain the target column texture vector.

[0135] Steps S401 to S404, as shown in the embodiments of this application, improve the ability of the target row texture vector and the target column texture vector to express the periodic texture of the sampled image by iteratively optimizing the preliminary row texture vector and the preliminary column texture vector alternately.

[0136] In step S401 of some embodiments, the preliminary row texture vector is a preset row texture vector. By inputting the preliminary column texture vector and preliminary defect indication data into the row texture sub-model and using them as fixed parameters, the preliminary row texture vector is optimized to improve its self-expressive ability of the preliminary row texture vector for the sampled image in the horizontal direction, thus obtaining candidate row texture vectors. The row texture sub-model is shown in equation (11):

[0137]

[0138] Wherein, λ1 is the initial row texture vector, and the optimized λ1 of the row texture sub-model is used as the candidate row texture vector.

[0139] In step S402 of some embodiments, the preliminary column texture vector is a preset column texture vector. By inputting the preliminary row texture vector and preliminary defect indication data into the column texture sub-model and using them as fixed parameters, the preliminary column texture vector is optimized to improve the self-expressive ability of the candidate column texture vector for the sampled image in the vertical direction, thus obtaining the candidate column texture vector. The column texture sub-model is shown in Equation (12):

[0140]

[0141] In step S403 of some embodiments, the candidate row texture vectors are further optimized by inputting the candidate column texture vectors and preliminary defect indication data into the row texture sub-model as fixed parameters to obtain the target row texture vector. The row texture sub-model is shown in Equation (11), which will not be described again here. It should be noted that if the optimization iteration is repeated multiple times, the target of each iteration is the candidate row texture vector, and the candidate row texture vector of the last iteration is taken as the target row texture vector.

[0142] In step S404 of some embodiments, the candidate row texture vector and preliminary defect indication data are input into the column texture sub-model and used as fixed parameters to further optimize the candidate column texture vector to obtain the target column texture vector. The column texture sub-model is shown in Equation (12), which will not be described again here.

[0143] In step S302 of some embodiments, the preliminary defect indication data is preset indication data that indicates the defect situation in the sampled image. By inputting the target periodic texture vector into the defect indication sub-model, the preliminary defect indication data is optimized to improve its ability to express the defect situation in the sampled image. The defect indication sub-model is shown in equation (13):

[0144]

[0145] Please see Figure 11 The overall iterative optimization process of steps S301 to S304 shown in the embodiments of this application is as follows: Figure 11 As shown, the periodic texture vector is iteratively optimized a second preset number of times, the defect indication data is iteratively optimized a third preset number of times, and the periodic texture vector and defect indication data are iteratively optimized alternately a first preset number of times. During the iterative optimization of the periodic texture vector, the initial row texture vector and the initial column texture vector are iteratively optimized alternately a second preset number of times. It should be noted that this application does not specify the exact number of iterations; in other embodiments, the number of iterations can be other values.

[0146] Please see Figure 5 In some embodiments, step S105 includes, but is not limited to, steps S501 to S503:

[0147] Step S501: Perform defect removal processing on the sampled image based on the target image texture data to obtain a sampled reference image;

[0148] Step S502: Perform image augmentation processing on the sampled reference image based on the target image texture data to obtain an augmented reference image;

[0149] Step S503: Perform backsampling processing on the extended reference image based on the rotation direction measurement data and image size to obtain the target reference image.

[0150] Steps S501 to S503 as shown in the embodiments of this application involve removing defects from the texture data of the target image to obtain a sampled reference image, performing image expansion processing on the sampled reference image based on the texture data of the target image to obtain an expanded reference image, and finally performing reverse sampling processing on the expanded reference image based on the rotation direction measurement data and the image size to obtain the target reference image. This process can remove defects and noise in the periodic image, thereby improving the detection accuracy for subsequent anomaly detection based on the target reference image and the periodic image.

[0151] In step S501 of some embodiments, the reference image is constructed as shown in equation (14):

[0152] Y *=[W(λ2)·S(λ2)·[W(λ1)·S(λ1)·(YA)] T ] T (14),

[0153] Where Y is the sampled image, Y * For the sampling reference image, the target image texture data includes target defect indication data A, target periodic texture vectors λ1 and λ2.

[0154] It should be noted that in an image with a two-dimensional periodic texture, if the image exhibits periodicity in both the horizontal and vertical directions, then for the column vectors constituting each column of the pixel matrix, the self-expression equation described in equation (5) is satisfied, corresponding to the periodic texture vector λ1; for the row vectors constituting each column of the pixel matrix, the self-expression equation described in equation (5) is satisfied, corresponding to the periodic texture vector λ2. Therefore, for an image Y with a two-dimensional periodic texture, the self-expression equation described in equation (14) is satisfied. The same deduction can be made for three-dimensional or multi-dimensional periodic data according to equation (5), which will not be elaborated here.

[0155] In step S502 of some embodiments, the image is extended according to the target periodic texture vector in the target texture image, and the top edge extension method of the sampling reference image is as shown in equation (15):

[0156]

[0157] Where Y0 is the value of the newly added top row of pixels in the sampling reference image. λ1 represents the first m-1 rows of pixels in the pixel matrix of the sampling reference image, where m represents the size of the sampling reference image and λ1 is the target row texture vector.

[0158] The bottom edge expansion method of the sampled reference image is shown in Equation (16):

[0159]

[0160] Where Y1 is the value of the newly added bottom row of pixels in the sampled reference image. This refers to the last m-1 rows of pixels in the pixel matrix of the sampled reference image.

[0161] The leftward expansion method of the sampled reference image is shown in Equation (17):

[0162]

[0163] Where Y2 represents the value of the newly added left column pixels in the sampled reference image, m e Indicates the number of rows for the top and bottom expansion. λ1 represents the first m-1 columns of the sampled reference image pixel matrix after top and bottom expansion, and λ2 is the target column texture vector.

[0164] The rightward expansion of the sampled reference image is shown in equation (18):

[0165]

[0166] Where Y3 represents the value of the newly added right column pixel in the sampled reference image. This represents the last m-1 columns of the sampled reference image pixel matrix after top and bottom expansion.

[0167] Please refer to Figure 12 First, the edges of the top portion of the sampled reference image are extended, such as... Figure 12 The top box in the sampled reference image is an expanded row of pixels. Further, the bottom edge of the sampled reference image is expanded, as shown in the bottom box, which is also an expanded row of pixels. Further, the left side of the expanded sampled image is expanded, as shown in the left box, which is also an expanded column of pixels. Finally, the right side of the expanded sampled image is expanded, as shown in the right box, which is also an expanded column of pixels. It should be noted that the expansion order of the sampled reference image in this embodiment is top, bottom, left, and right. Other expansion orders can be used in other embodiments, and this application does not impose specific limitations.

[0168] Please refer to Figure 13 In step S503 of some embodiments, during the sampling process, the periodic image is rotated horizontally or vertically along the periodic direction, so that the periodic texture direction of the image is consistent with the horizontal or vertical direction. During backsampling, a bounding box is first constructed based on the image size of the periodic image, and then rotated in the opposite direction of the rotation direction, such as... Figure 13 θ is the rotation angle. The box is rotated in the opposite direction by θ along the rotation angle to obtain the rotated box as shown in the figure. Then, the pixels in the rotated box are sampled to obtain the target reference image.

[0169] Please see Figure 6 In some embodiments, step S106 includes, but is not limited to, steps S601 to S607:

[0170] Step S601: Divide the periodic image into blocks according to the preset block size to obtain multiple periodic block images;

[0171] Step S602: Divide the target reference image into blocks according to the block size to obtain multiple reference block images;

[0172] Step S603: Extract similar block images from multiple reference block images based on each period block image to obtain similar block images for each period block image.

[0173] Step S604: Perform regularized anomaly measurement on each periodic block image based on similar block images to obtain regularized anomaly measurement data for each periodic block image.

[0174] Step S605: Construct a regularized anomaly distance image based on the regularized anomaly measurement data and similar block images;

[0175] Step S606: Perform convolution processing on the regularized anomaly distance image according to the preset convolution kernel to obtain anomaly scores;

[0176] Step S607: Determine image anomaly information based on the anomaly score and the preset anomaly threshold.

[0177] Steps S601 to S607, as illustrated in this embodiment, involve dividing a periodic image into blocks based on block size to obtain periodic block images. A target reference image is then divided into blocks according to the block size to obtain reference block images. Similar block images within the reference block images are determined based on the periodic block images. Regularized anomaly measurement is performed on each periodic block image based on the similar block images to obtain regularized anomaly measurement data. A regularized anomaly distance image is constructed based on the regularized anomaly data and the similar block images. This regularized anomaly distance image is convolved and compared with an anomaly threshold to determine image anomaly information. The variance between the periodic block images and the reference image is convolved to obtain an anomaly score. The anomaly score is then compared with the anomaly threshold, improving the distinguishability between the periodic image and the target reference image and increasing the accuracy of anomaly detection for periodic texture images.

[0178] In step S601 of some embodiments, the block size is a numerical value used to segment the image to be segmented. The size of the segmented block image is consistent with the block size, and the block size is smaller than the size of the image to be segmented. For example, if the periodic image pixel matrix is ​​a 6*6 pixel matrix and the block size is 3*3, the periodic pixel matrix is ​​divided according to a 3*3 ratio to obtain four periodic block images.

[0179] In step S602 of some embodiments, the reference block image is obtained by dividing the target reference image into blocks according to the block size, and the size of the reference block image is consistent with the block size.

[0180] In step S603 of some embodiments, similar block extraction involves clustering the reference block image based on the periodic block image, and obtaining multiple highly similar block images from the clustering results as similar block images of the periodic block image. For example, KNN clustering is used to cluster the periodic block image and the reference block image to obtain clustering results, and multiple highly similar reference block images are obtained based on the clustering results as similar block images. For example, cosine similarity is used to measure the similarity between the periodic block image and the reference block image to obtain cosine similarity measurement data, and multiple reference block images are selected as similar block images based on the cosine similarity measurement data. It should be noted that the embodiments of this application do not limit the number of blocks of the selected reference block images.

[0181] Please see Figure 7 In some embodiments, step S604 may include, but is not limited to, steps S701 to S703:

[0182] Step S701: Perform mean processing on each periodic block image based on similar block images to obtain the mean vector;

[0183] Step S702: Measure the standard deviation of each periodic block image based on similar block images to obtain standard deviation measurement data;

[0184] Step S703: Construct regularized anomaly measurement data based on the mean vector, standard deviation measurement data, and periodic block image.

[0185] Steps S701 to S703 as shown in the embodiments of this application involve processing the mean of each periodic block image based on similar block images to obtain a mean vector, and then measuring the standard deviation to obtain standard deviation measurement data. Finally, regularized anomaly measurement data is constructed for the periodic block images based on the mean vector and the standard deviation measurement data, which improves the distinguishability between periodic block images and similar blocks and provides a data foundation for subsequent anomaly detection based on regularized anomaly distance.

[0186] In step S701 of some embodiments, each periodic block image corresponds to multiple similar block images, and the average value of the multiple similar block images corresponding to each periodic block image is obtained as the mean vector.

[0187] In step S702 of some embodiments, each periodic block image corresponds to multiple similar block images, and the standard deviation of the multiple similar block images corresponding to each periodic block image is obtained as standard deviation measurement data.

[0188] In step S703 of some embodiments, the regularized anomaly metric data is a pixel matrix, representing the regularized anomaly distance between each pixel of the periodic image and the corresponding pixel of the target reference image. The regularized anomaly metric data is constructed based on the standardized metric data and the mean vector, as shown in equation (19):

[0189] d i =(P i -μ i )·diag(σ i ) -1 (19),

[0190] Where, d i For regularized outlier measurement data, P i For each periodic block image, μ represents the i-th similar block image. i Let σ be the mean vector. i This is the standard deviation vector.

[0191] In step S605 of some embodiments, the pixel value of each pixel of the regularized anomaly measurement data is placed at the corresponding pixel position on the target reference image to obtain a regularized anomaly distance image.

[0192] In step S606 of some embodiments, the regularized anomaly distance image is convolved using a convolution kernel to obtain the convolution value of each pixel. The convolution value of each pixel is then placed at the corresponding pixel position on the regularized anomaly distance image to obtain the anomaly score of each pixel.

[0193] In step S607 of some embodiments, the abnormal threshold and each abnormal score are compared. If the abnormal score is greater than the abnormal threshold, the pixel is considered to be abnormal information, and all abnormal information is used as image abnormal information.

[0194] Please see Figure 14 ,like Figure 14 (a) Divide the periodic image into blocks to obtain multiple periodic block images, and divide the reference image into blocks to obtain multiple reference block images. For example... Figure 14 As shown in (b), KNN classification is performed on multiple reference block images based on each periodic block image. Figure 14 As shown in (c), multiple reference block images are obtained for each block image based on the classification results. Figure 14 As shown in (d), a regularized anomaly distance image is constructed based on multiple reference block images corresponding to each periodic block image. Figure 14 As shown in (e), the regularized anomaly distance image is convolved to obtain anomaly scores. Anomaly information in the image is then determined based on the anomaly scores and anomaly thresholds. Figure 14As shown in (f), the real labels are artificially set artificial image anomaly information, and the artificial image anomaly information is consistent with the image anomaly information detection results.

[0195] Please see Figure 15 ,like Figure 15 As shown in (a), a periodic image is an image with a periodic texture. Figure 15 As shown in (b), a periodic image is rotated and sampled to obtain a sampled image with defects. An image self-expression model is constructed based on the sampled image and a preset preliminary texture image. The preliminary texture image data is then updated based on the self-expression model to obtain the target texture data. Figure 15 (c) Finally, based on the target texture data, the sampled image undergoes defect removal processing to obtain a sampled reference image. For example... Figure 15 As shown in (d), image augmentation processing is performed on the sampled reference image to obtain the augmented reference image. Figure 15 As shown in (e), a target reference image is obtained by performing rotational sampling based on the extended reference image. Finally, anomaly detection is performed on the periodic image based on the target reference image to obtain image anomaly information.

[0196] Please see Figure 8 This application also provides a periodic image anomaly detection device, which can implement the above-described periodic image anomaly detection method. The device includes:

[0197] The acquisition module 801 is used to acquire a periodic image; wherein, the periodic image is an image with a periodic texture;

[0198] The rotation sampling module 802 is used to perform rotation sampling processing on the periodic image to obtain a sampled image;

[0199] The construction module 803 is used to construct an image self-expression model based on preset preliminary image texture data and sampled images; wherein, the image self-expression model is used to characterize the periodic texture in the sampled images and filter noise and defects in the sampled images;

[0200] Update module 804 is used to update the initial image texture data based on the image self-expression model to obtain the target image texture data;

[0201] The extended reconstruction module 805 is used to perform image extended reconstruction on the sampled image based on the target image texture data to obtain the target reference image;

[0202] The detection module 806 is used to perform anomaly detection on the periodic image based on the target reference image to obtain image anomaly information.

[0203] The specific implementation of this periodic image anomaly detection device is basically the same as the specific implementation of the periodic image anomaly detection method described above, and will not be repeated here.

[0204] This application also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the above-described periodic image anomaly detection method. This electronic device can be any smart terminal, including tablet computers, in-vehicle computers, etc.

[0205] Please see Figure 9 , Figure 9 The hardware structure of an electronic device according to another embodiment is illustrated. The electronic device includes:

[0206] The processor 901 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application.

[0207] The memory 902 can be implemented as a read-only memory (ROM), static storage device, dynamic storage device, or random access memory (RAM). The memory 902 can store the operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 902 and called and executed by the processor 901 using the periodic image anomaly detection method of the embodiments of this application.

[0208] The 903 input / output interface is used to implement information input and output.

[0209] The communication interface 904 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).

[0210] Bus 905 transmits information between various components of the device (e.g., processor 901, memory 902, input / output interface 903, and communication interface 904);

[0211] The processor 901, memory 902, input / output interface 903, and communication interface 904 are connected to each other within the device via bus 905.

[0212] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described periodic image anomaly detection method.

[0213] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0214] The periodic image anomaly detection method, device, electronic device, and storage medium provided in this application acquire periodic images and perform rotational sampling processing on the periodic images to obtain sampled images. This process corrects the rotation of the images to the same direction, providing a data foundation for subsequent learning of image texture data in the same direction. Sampling the rotated images reduces the amount of image data that needs to be processed, thus improving the speed of periodic texture image anomaly detection. Furthermore, an image self-expression model is constructed based on the preliminary texture image data and the sampled images, and the preliminary texture image data is updated based on the image self-expression model to obtain target image texture data. Texture data is directly constructed from the images, improving the speed of detecting anomalies in periodic texture images. Furthermore, the sampled images are expanded and reconstructed based on the target image texture data to obtain a target reference image. Anomaly detection is then performed on the periodic images based on the target reference image to obtain image anomaly information. By correcting irregular textures in the images using the target image texture data, the accuracy of anomaly detection in periodic texture images is improved.

[0215] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.

[0216] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.

[0217] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0218] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.

[0219] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0220] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0221] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0222] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0223] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0224] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0225] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.

Claims

1. A method for detecting anomalies in periodic images, characterized in that, The method includes: Obtain a periodic image; wherein the periodic image is an image with periodic texture; The periodic image is subjected to rotational sampling processing to obtain a sampled image; An image self-expression model is constructed based on preset preliminary image texture data and the sampled image; wherein, the image self-expression model is used to characterize the periodic texture in the sampled image and filter noise and defects in the sampled image; The initial image texture data is updated based on the image self-expression model to obtain the target image texture data; The sampled image is expanded and reconstructed based on the target image texture data to obtain the target reference image; Anomaly detection is performed on the periodic image based on the target reference image to obtain image anomaly information; The preliminary image texture data includes: preliminary defect indication data and preliminary periodic texture vectors; the image self-expression model includes: a periodic texture sub-model and a defect indication sub-model; updating the preliminary image texture data based on the image self-expression model to obtain the target image texture data includes: Based on the periodic texture sub-model and the preliminary defect indication data, the preliminary periodic texture vector is iteratively optimized to obtain the target periodic texture vector. Based on the defect indicator sub-model and the target periodic texture vector, the preliminary defect indicator data is iteratively optimized to obtain the target defect indicator data. The step of performing image expansion and reconstruction on the sampled image based on the target image texture data to obtain the target reference image includes: Based on the target image texture data, the sampled image is subjected to defect removal processing to obtain a sampled reference image; The sampled reference image is subjected to image augmentation processing based on the target image texture data to obtain an augmented reference image; The target reference image is obtained by backsampling the extended reference image based on the rotation direction measurement data and the image size of the periodic image; wherein the rotation direction measurement data is obtained by performing periodic direction measurement on the periodic image.

2. The method according to claim 1, characterized in that, The preliminary periodic texture vector includes: a preliminary column texture vector and a preliminary row texture vector; the periodic texture sub-model includes: a row texture sub-model and a column texture sub-model; the iterative optimization process based on the periodic texture sub-model and the preliminary defect indication data to obtain the target periodic texture vector includes: The preliminary row texture vector is optimized based on the preliminary column texture vector, the preliminary defect indication data, and the row texture sub-model to obtain candidate row texture vectors; Based on the preliminary defect indication data, the candidate row texture vector, and the column texture sub-model, the preliminary column texture vector is optimized to obtain the candidate column texture vector; Based on the preliminary defect indication data, the candidate column texture vectors, and the row texture sub-model, the candidate row texture vectors are optimized to obtain the target row texture vectors; Based on the preliminary defect indication data, the target row texture vector, and the column texture sub-model, the candidate column texture vector is optimized to obtain the target column texture vector.

3. The method according to claim 1, characterized in that, The step of performing anomaly detection on the periodic image based on the target reference image to obtain image anomaly information includes: The periodic image is divided into blocks according to a preset block size to obtain multiple periodic block images; The target reference image is divided into multiple reference block images according to the block size; Based on each periodic block image, similar block images are extracted from multiple reference block images to obtain similar block images for each periodic block image; Based on the similar segmented images, a regularized anomaly measurement is performed on each of the periodic segmented images to obtain the regularized anomaly measurement data of each of the periodic segmented images. A regularized anomaly distance image is constructed based on the regularized anomaly metric data and the similarity block image; The regularized anomaly distance image is convolved according to a preset convolution kernel to obtain anomaly scores; The image anomaly information is determined based on the anomaly score and the preset anomaly threshold.

4. The method according to claim 1, characterized in that, The step of performing rotational sampling processing on the periodic image to obtain a sampled image includes: Perform periodic direction measurement on the periodic image to obtain rotation direction measurement data; The image size of the periodic image is obtained, and a first sampling range is determined based on the rotation direction measurement data and the image size; The periodic image is sampled according to the first sampling range to obtain a sampled image.

5. The method according to claim 3, characterized in that, The step of performing a regularized anomaly measurement on each periodic block image based on the similar block images to obtain regularized anomaly measurement data for each periodic block image includes: The mean vector is obtained by performing mean processing on each periodic block image based on the similar block images; Based on the similar segmented images, the standard deviation of each periodic segmented image is measured to obtain standard deviation measurement data; The regularized anomaly measurement data is constructed based on the mean vector, the standard deviation measurement data, and the periodic block image.

6. A periodic image anomaly detection device, characterized in that, The device includes: An acquisition module is used to acquire a periodic image; wherein the periodic image is an image with a periodic texture; A rotation sampling module is used to perform rotation sampling processing on the periodic image to obtain a sampled image; A construction module is used to construct an image self-expression model based on preset preliminary image texture data and the sampled image; wherein, the image self-expression model is used to characterize the periodic texture in the sampled image and filter noise and defects in the sampled image; The update module is used to update the preliminary image texture data based on the image self-expression model to obtain the target image texture data; An extended reconstruction module is used to perform image extended reconstruction on the sampled image based on the target image texture data to obtain a target reference image; The detection module is used to perform anomaly detection on the periodic image based on the target reference image to obtain image anomaly information; The preliminary image texture data includes: preliminary defect indication data and preliminary periodic texture vectors; the image self-expression model includes: a periodic texture sub-model and a defect indication sub-model; updating the preliminary image texture data based on the image self-expression model to obtain the target image texture data includes: Based on the periodic texture sub-model and the preliminary defect indication data, the preliminary periodic texture vector is iteratively optimized to obtain the target periodic texture vector. Based on the defect indicator sub-model and the target periodic texture vector, the preliminary defect indicator data is iteratively optimized to obtain the target defect indicator data. The step of performing image expansion and reconstruction on the sampled image based on the target image texture data to obtain the target reference image includes: Based on the target image texture data, the sampled image is subjected to defect removal processing to obtain a sampled reference image; The sampled reference image is subjected to image augmentation processing based on the target image texture data to obtain an augmented reference image; The target reference image is obtained by backsampling the extended reference image based on the rotation direction measurement data and the image size of the periodic image; wherein the rotation direction measurement data is obtained by performing periodic direction measurement on the periodic image.

7. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the periodic image anomaly detection method according to any one of claims 1 to 5.

8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the periodic image anomaly detection method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Quality evaluation

    US20190080443A1

  • Object defect detection

    US20210012474A1