Artificial intelligence visual inspection method, system, and storage medium
By constructing a spatiotemporal field for visual perception and topological weaving technology, stable features of objects and environmental interference features are identified and separated, solving the problem of mixed feature representation in existing technologies and achieving high-precision visual detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HEBEI BINGJI MAOLI TECHNOLOGY CO LTD
- Filing Date
- 2026-02-10
- Publication Date
- 2026-05-26
AI Technical Summary
Existing technologies struggle to distinguish change patterns from the physical properties of objects themselves and external environmental disturbances in complex dynamic scenes, resulting in mixed feature representations, insufficient generalization ability and stability. Generative models lack explicit modeling of the structural rules of objects, affecting discrimination accuracy.
We construct a spatiotemporal field for visual perception, identify pixel clusters and perform multi-level feature decoupling by analyzing the dynamic behavior trajectory and correlation matrix of pixels, peel off the stable feature layer and transient feature layer, and construct an enhanced feature expression layer using topology weaving and generative networks to generate visual detection images for judging the surface state of objects.
It improves the purity and anti-interference ability of feature representation, and the generated enhanced features strictly follow the object structure logic, ensuring high-precision discrimination.
Smart Images

Figure CN122089879A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence visual inspection technology, specifically to artificial intelligence visual inspection methods, systems, and storage media. Background Technology
[0002] In visual inspection tasks in fields such as industrial quality inspection and security monitoring, the core challenge lies in the stable and accurate extraction of the essential attributes of the object being measured from complex dynamic scenes. Existing technologies mainly rely on static feature extraction from single frames or sequences of images. For dynamic information, common methods such as optical flow can estimate pixel motion, but they are usually independent of the feature extraction process and are mainly used for moving target segmentation or tracking, rather than for in-depth analysis of the dynamic evolution patterns of the attributes themselves. Faced with interference such as changes in illumination and environmental jitter, existing solutions often employ preprocessing filtering or enhance the network's robustness through a large amount of data during model training. This is a passive noise suppression method with an unclear mechanism.
[0003] Existing technical solutions have significant drawbacks. Methods based on static or shallow dynamic features struggle to fundamentally distinguish between change patterns arising from an object's own physical properties and transient disturbances introduced by the external environment. This leads to mixed feature representations and insufficient generalization ability and stability under complex conditions. On the other hand, generative models for feature enhancement or reconstruction are a current research direction, but their optimization objectives generally rely on distribution similarity constraints obtained from a large number of samples. This data-driven constraint lacks explicit modeling of the inherent structural rules of objects. The generated enhanced features may be statistically reasonable, but they may not conform to the topological logic consistency of objects in the physical world, potentially leading to distortion of details or structural errors, affecting the final discrimination accuracy. Summary of the Invention
[0004] The purpose of this invention is to provide an artificial intelligence visual inspection method, system, and storage medium to solve the problems mentioned in the background art.
[0005] To achieve the above objectives, the present invention provides an artificial intelligence visual inspection method, the method comprising: Establish a spatiotemporal field for visual perception, which consists of a sequence of image frames acquired by an image sensing device; The dynamic behavior trajectory of pixels is constructed in the spatiotemporal field. The evolution characteristics of the dynamic behavior trajectory are formed by analyzing the fluctuation pattern of pixel intensity in the time dimension and the propagation pattern in the spatial neighborhood. The correlation matrix of pixels is calculated based on evolutionary features. Pixel clusters with aggregation are identified from the correlation matrix. Multi-level feature decoupling is performed on the pixel clusters. Stable feature layers representing the inherent properties of the object to be detected and transient feature layers representing environmental interference and noise are extracted from the pixel clusters. Topological weaving is performed on the stable feature layers. The dispersed stable feature layers are woven into a connected feature topology network by simulating the attraction and linking process in the physical field. The structural invariants in the feature topology network are extracted, and the structural invariants are used to guide the generative network to construct an enhanced feature expression layer. The optimization objective of the generative network is constrained by the topological rules defined by the structural invariants. The enhanced feature representation layer is fused and projected with the original sequence image frames after removing the transient feature layer to generate a visual detection image for judging the surface state of an object.
[0006] Preferably, constructing the dynamic behavior trajectory of a pixel within the spatiotemporal field includes: Each pixel in a sequence of image frames contains intensity data and spectral channel data; Obtain the intensity change curve of each pixel on the time axis in the sequence of image frames; Define the spatial neighborhood range of each pixel as the center, and calculate the statistical correlation of the intensity change curves of all pixels within the spatial neighborhood. The intensity change curve of each pixel is fused with the statistical correlation of the intensity change curves of pixels in its spatial neighborhood to form a composite feature curve describing the dynamics of the pixel itself and its dynamics in conjunction with its neighborhood, which serves as the dynamic behavior trajectory of the pixel.
[0007] Preferably, the step of calculating the correlation matrix of pixels based on evolutionary features includes: The correlation matrix reflects the synchronous change pattern and coupling strength of the dynamic behavior trajectory of pixels in the spatiotemporal field; Calculate the similarity measure between the dynamic behavior trajectories of every two pixels; Based on the similarity metric, a two-dimensional matrix is constructed. The rows and columns of the two-dimensional matrix correspond to all pixels in the spatiotemporal field. Each element value in the matrix represents the similarity metric value between the dynamic behavioral trajectories of two corresponding pixels. This two-dimensional matrix is the correlation matrix.
[0008] Preferably, identifying clustered pixel communities from the correlation matrix includes: Pixel communities consist of contiguous pixel regions with similar evolutionary characteristics and high coupling strength in the correlation matrix; The correlation matrix is transformed into a graph structure, treating each pixel as a node in the graph structure, and connecting the two pixels corresponding to the elements in the correlation matrix that are greater than the preset correlation threshold with an edge. The community detection algorithm is performed on the graph structure to find the set of nodes that are tightly connected internally and sparsely connected externally. Each such set of nodes is mapped back to the original image space, and the resulting continuous pixel region is a pixel community.
[0009] Preferably, the multi-level feature decoupling of the pixel community includes: Modal decomposition is performed on the dynamic behavior trajectory of all pixels in the pixel cluster to separate low-frequency components with a change frequency below a preset threshold and high-frequency components with a change frequency above a preset threshold. The set of low-frequency components is defined as the stable feature layer, which is used to reflect the slow deformation or inherent texture of the surface of the object to be detected. The set of high-frequency components is defined as the transient feature layer, which is used to reflect rapid changes in ambient light fluctuations and sensor noise.
[0010] Preferably, the topology weaving of the stable feature layer includes: Each low-frequency component in the stable feature layer is regarded as a feature node, and the distance between every two feature nodes in the spatiotemporal coordinate system and the phase difference of their change patterns are calculated. Virtual links are established between feature nodes. The strength of the virtual links is inversely proportional to the distance and directly proportional to the cosine of the phase difference. Through an iterative optimization process, virtual links with strength greater than the link strength threshold are retained, while virtual links with strength less than the link strength threshold are removed. Finally, a mesh structure is formed by the feature nodes and the retained virtual links, which is the feature topology mesh.
[0011] Preferably, the extraction of structural invariants from the feature topology includes: Structural invariants are the connection relationships and path properties of a characteristic topology that remain unchanged under geometric deformation and intensity scaling transformations. Define a path on the feature topology network. The path consists of a series of feature nodes connected sequentially by virtual links. Calculate the length and tortuosity of all possible paths, and define the path properties that maintain a constant proportional relationship between length and tortuosity when the characteristic topology undergoes an affine transformation as path invariants; Loops in a feature topology network are identified, and the number of feature nodes constituting the loop and the strength distribution pattern of virtual links on the loop are defined as loop invariants. The structural invariants are composed of the path invariants and the loop invariants.
[0012] Preferably, the construction of the enhanced feature representation layer using a structure invariant-guided generative network includes: Configure the encoder of the generative network, which is used to map feature nodes in the feature topology network to latent space vectors; In the loss function of the decoder of the generative network, a constraint term is added, which forces the network structure reconstructed by the decoder to minimize the difference between its path invariants and loop invariants and the structural invariants of the original feature topology. Through training, the generative network is able to output a new network structure that retains the original feature topology invariants while being enhanced in the node feature dimension. This new network structure is then decoded back into the image feature space to obtain the enhanced feature representation layer.
[0013] Preferably, the artificial intelligence visual inspection method for implementing any of the above includes: The spatiotemporal field construction module establishes a spatiotemporal field for visual perception, which consists of a sequence of image frames acquired by an image sensing device. The dynamic trajectory evolution module constructs the dynamic behavior trajectory of pixels in the spatiotemporal field. It forms the evolution characteristics of the dynamic behavior trajectory by analyzing the fluctuation pattern of pixel intensity in the time dimension and the propagation pattern in the spatial neighborhood. The feature decoupling and recognition module calculates the correlation matrix of pixels based on evolutionary features, identifies clustered pixel groups from the correlation matrix, performs multi-level feature decoupling on the pixel groups, and extracts stable feature layers representing the inherent properties of the object to be detected, as well as transient feature layers representing environmental interference and noise from the pixel groups. The topology enhancement generation module performs topology weaving on the stable feature layers. It weaves the dispersed stable feature layers into a connected feature topology network by simulating the attraction and linking process in the physical field. It extracts the structural invariants in the feature topology network and uses the structural invariants to guide the generative network to construct an enhanced feature expression layer. The optimization objective of the generative network is constrained by the topology rules defined by the structural invariants. The fusion projection detection module fuses and projects the enhanced feature representation layer with the original sequence image frames after removing the transient feature layer to generate a visual detection image for judging the surface state of an object.
[0014] Preferably, the computer-readable storage medium stores a computer program that, when executed by a processor, causes the processor to implement the artificial intelligence visual inspection method as described in any one of the above descriptions.
[0015] Compared with the prior art, the beneficial effects of the present invention are: By constructing the dynamic behavioral trajectories of pixels and analyzing their temporal fluctuations and spatial propagation patterns, evolutionary features are formed, and then the correlation matrix between pixels is calculated. This allows for the identification of intrinsically related pixel clusters based on the synergy of dynamic behavior. Furthermore, the features of pixel clusters are decoupled at multiple levels, actively stripping away the transient feature layer representing environmental interference and noise, while retaining and purifying the stable feature layer representing the inherent properties of objects. By separating mixed signals from the data source according to their physical generation mechanisms, subsequent processing focuses on the essential properties of objects, improving the purity and anti-interference ability of feature representation, and exhibiting stronger robustness against non-steady-state noise.
[0016] The decoupled, dispersed, stable feature layers are topologically woven, simulating physical field interactions to connect them into a coherent feature topology network. Structural invariants, independent of viewpoint, occlusion, or noise, are extracted from this network. These topological rules, derived from the essential properties of objects, serve as optimization objectives and constraints for the generative network, guiding it to construct enhanced feature representation layers. This ensures the feature enhancement process is driven by explicit structural consistency rules, rather than merely pursuing data distribution matching. The resulting enhanced features not only supplement information but also strictly adhere to the inherent structural logic of objects, ensuring the physical rationality and global consistency of the enhancement results. This provides a structurally highly reliable feature foundation for high-precision discrimination. Attached Figure Description
[0017] Figure 1 This is a schematic diagram illustrating the working principle of the artificial intelligence visual inspection method described in this invention. Figure 2 A flowchart for constructing the dynamic behavior trajectory of pixels; Figure 3 A flowchart for calculating the correlation matrix of pixels; Figure 4 A biaxial bar chart for loop feature analysis of feature topology networks in artificial intelligence visual inspection; Figure 5 A heatmap of image response values for artificial intelligence visual detection. Detailed Implementation
[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0019] Please see Figure 1This invention provides an artificial intelligence visual detection method, comprising: establishing a spatiotemporal field for visual perception, which is composed of a sequence of image frames continuously acquired by an image sensing device. Within this spatiotemporal field, a dynamic behavioral trajectory is constructed for each pixel. This construction process is accomplished by comprehensively analyzing the fluctuation pattern of each pixel's intensity in the time dimension and the propagation pattern of this fluctuation within its spatial neighboring pixels, thereby forming features characterizing the dynamic evolution of the pixels. Based on these evolutionary features, a correlation degree matrix reflecting the dynamic correlation between pixels is calculated, and pixel clusters with high internal correlation are identified from this matrix. Subsequently, a multi-level feature decoupling operation is performed on the identified pixel clusters, separating a stable feature layer that characterizes the inherent properties of the object to be detected and changes slowly, and a transient feature layer that characterizes environmental interference and noise and changes rapidly, from the composite features of the pixel clusters. Then, topological weaving is performed on the stable feature layer, which simulates the attraction and linking mechanisms in a physical field, weaving discrete stable feature nodes into a feature topology network with connectivity, and extracting structural invariants that remain unchanged under geometric transformations from this network. These structural invariants are used to constrain and guide the training and generation process of a generative network, enabling it to construct a feature representation layer that enhances features while preserving the original topological relationships. Finally, the enhanced feature representation layer is fused and projected with the original sequence of image frames after removing transient feature layer interference to generate a high signal-to-noise ratio, feature-rich visual detection image, which is used to ultimately determine the state of an object's surface, such as defects or deformations.
[0020] In one embodiment of the present invention, see [reference] Figure 2 Each pixel in a sequence of image frames contains intensity data and spectral channel data. The intensity change curve of each pixel on the time axis is obtained, describing the continuous change of pixel intensity over time. A spatial neighborhood with a specific radius or the size of a neighborhood window is defined centered on each pixel. The statistical correlation between the intensity change curves of all other pixels within this spatial neighborhood and the intensity change curve of the central pixel is calculated, using metrics such as Pearson correlation coefficient or mutual information. The intensity change curve of each pixel itself is fused with the statistical correlation measure of the intensity change curves of pixels within its spatial neighborhood, for example, through weighted stitching or an attention mechanism, to form a composite feature curve that simultaneously describes the dynamic characteristics of the pixel itself and its cooperative change pattern with surrounding pixels. This composite feature curve is used as the dynamic behavior trajectory of the pixel.
[0021] In practical implementation, taking the visual inspection of surface defects of metal parts on an industrial production line as an example, the image sensing device acquires a sequence of image frames at a rate of 100 frames per second. Each image frame has a resolution of 1024 pixels by 768 pixels, and each pixel in the sequence of image frames contains intensity data obtained from the red, green, and blue spectral channels. From the continuously acquired sequence of one thousand image frames, the intensity change curve of each pixel on the time axis is obtained. For a pixel with coordinates (x, y), its intensity change curve is a time series containing one thousand intensity data points, reflecting the dynamics of the reflected light intensity at that location as the component moves or the illumination changes.
[0022] In some embodiments, a spatial neighborhood is defined centered on each pixel in the sequence of image frames. This spatial neighborhood is a square window with a side length of five pixels, centered on that pixel. The statistical correlation between the intensity change curves of all pixels within the spatial neighborhood and the intensity change curve of the central pixel is calculated using the Pearson correlation coefficient. For the central pixel p and a pixel q within its spatial neighborhood, the Pearson correlation coefficient between their intensity change curves is obtained using a specific formula. The formula is as follows: in: The Pearson correlation coefficient represents the relationship between the intensity variation curves of pixel p and pixel q. This represents the total number of frames in the image sequence. This represents the intensity value of pixel p in frame t. This represents the average intensity value of pixel p across all T frames. This represents the intensity value of pixel q in frame t. This represents the average intensity value of pixel q across all T frames.
[0023] In specific implementation, for the central pixel p, all twenty-four pixels within its spatial neighborhood (excluding itself) are traversed, and twenty-four Pearson correlation coefficient values are calculated. These Pearson correlation coefficient values are statistically processed, for example, by calculating the average value, to obtain a scalar value. This scalar value serves as a comprehensive measure describing the statistical correlation between the intensity change curve of the central pixel p and the intensity change curves of the pixels in its spatial neighborhood. In some embodiments, the comprehensive measure of the statistical correlation between the intensity change curve of each pixel and the intensity change curves of the pixels in its spatial neighborhood is fused. The fusion process uses concatenation and weighted summation. The intensity change curve of pixel p itself is a one-dimensional vector of length T. The scalar value representing the comprehensive measure of statistical correlation is concatenated with the intensity change curve vector as an additional feature to form an extended feature vector of length T+1. After normalization of this extended feature vector, a learnable linear transformation layer is used to map the extended feature vector of length T+1 into a composite feature curve of length L. The composite feature curve serves as the dynamic behavior trajectory of pixel p.
[0024] In one embodiment of the present invention, see [reference] Figure 3 The purpose of the correlation matrix is to reflect the synchronous change pattern and coupling strength of the dynamic behavior trajectory of pixels in the spatiotemporal field. A similarity metric is calculated between the dynamic behavior trajectories of every two pixels, which can be dynamic time-warped distance, cosine similarity, or correlation-based distance. Based on the calculated similarity metric between each pair of pixels, a two-dimensional matrix is constructed. The rows and columns of this two-dimensional matrix correspond to the indices of all pixels in the spatiotemporal field, respectively. The element value in the i-th row and j-th column of the matrix is the similarity metric value between the dynamic behavior trajectories of the i-th and j-th pixels. The resulting two-dimensional matrix is the correlation matrix. To identify clustered pixel groups from the correlation matrix, a graph transformation is needed. Each pixel is considered a node in the graph structure. Each pair of pixel indices with an element value greater than a preset correlation threshold is connected by an edge, and the weight of the edge is related to that element value. Community detection algorithms, such as the Louvain algorithm or spectral clustering algorithm, are executed on the constructed graph structure to find the set of nodes in the graph structure that are tightly connected by edges between internal nodes and relatively sparsely connected to other community nodes. Each set of nodes identified by the algorithm is mapped back to the original image space coordinates according to the pixel index it contains. The resulting spatially continuous or neighboring pixel regions are defined as a pixel community.
[0025] In practice, the construction of the correlation matrix aims to characterize the regularity and intensity of the coordinated changes in the dynamic behavior trajectories of pixels in the spatiotemporal field. For the dynamic behavior trajectories of all pixels in the obtained image, the similarity metric between every two pixel dynamic behavior trajectories is calculated. The similarity metric is calculated using cosine similarity, and the dynamic behavior trajectory is regarded as a feature vector in a high-dimensional space. For pixel m and pixel n, the cosine similarity between their dynamic behavior trajectories is calculated using the following formula: in: The cosine similarity value represents the dynamic behavior trajectory between pixel m and pixel n. This represents the length of the feature vector representing the dynamic behavior trajectory. The value of the feature vector representing the dynamic behavior trajectory of pixel m in the l-th dimension. The value of the feature vector representing the dynamic behavior trajectory of pixel n in the l-th dimension. Cosine similarity value. The value ranges from -1 to 1. The closer the value is to 1, the more similar the two dynamic behavior trajectories are.
[0026] In some embodiments, a two-dimensional matrix is constructed based on the calculated similarity metric between each pair of pixels. The row and column indices of this two-dimensional matrix correspond to the unique identifiers of all pixels in the image. For an image containing M x N pixels, the size of the two-dimensional matrix is (MN) x (MN). The element value located in the i-th row and j-th column of the two-dimensional matrix is the cosine similarity value between the dynamic behavior trajectories of pixel i and pixel j. The two-dimensional matrix constructed in this way is defined as the correlation matrix. The correlation matrix is a symmetric matrix, and the elements on its main diagonal are the similarity between each pixel and itself, which is always 1.
[0027] In practical implementation, to identify clustered pixel groups from the correlation matrix, a graph transformation is performed on the correlation matrix. The graph transformation treats each pixel in the correlation matrix as a node in a graph structure. A preset correlation threshold of 0.85 is set. The upper or lower triangular portion of the correlation matrix is traversed, and for each pair of pixel indices whose element value is greater than the preset correlation threshold of 0.85, an edge is created between the corresponding two nodes in the graph structure. The weight of the edge can be set to the corresponding cosine similarity value. This results in a weighted undirected graph, where the set of nodes represents all pixels and the set of edges represents the high similarity between the dynamic behavior trajectories of the pixels.
[0028] In some embodiments, a community detection algorithm is performed on a weighted undirected graph obtained through graph structure transformation. The community detection algorithm employs spectral clustering. First, spectral clustering constructs a Laplacian matrix based on the graph's adjacency matrix. Then, it calculates the eigenvectors corresponding to the k smallest eigenvalues of the Laplacian matrix and arranges these eigenvectors column-wise to form a feature matrix. Finally, k-means clustering is performed on the row vectors of the feature matrix. Each cluster identified by the spectral clustering algorithm is a set of nodes with tightly connected internal nodes and relatively sparse external nodes. Optionally, the preset association threshold is not fixed at 0.85 and can be adaptively adjusted according to the noise level of the dynamic behavior trajectory. It is understood that the community detection algorithm is not limited to spectral clustering; Louvain's algorithm or label propagation algorithm can also be used. Each node set identified by the spectral clustering algorithm is mapped back to the original two-dimensional coordinate space of the image based on the pixel numbers corresponding to the nodes within the set. In the two-dimensional coordinate space of the image, pixels belonging to the same node set are often spatially continuous or adjacent; these spatially continuous or adjacent pixel regions are defined as a pixel community.
[0029] In one embodiment of the present invention, multi-level feature decoupling is performed on the pixel cluster. First, modal decomposition is performed on the dynamic behavior trajectory of all pixels within the pixel cluster, for example, using empirical mode decomposition or variational mode decomposition methods, to decompose each dynamic behavior trajectory into a series of intrinsic mode functions. Among these decomposed components, low-frequency components with a change frequency below a preset threshold are separated, and high-frequency components with a change frequency above the same preset threshold are also separated. The set of low-frequency components corresponding to the dynamic behavior trajectories of all pixels is defined as a stable feature layer, which is used to reflect persistent properties such as slow deformation or inherent texture of the surface of the object to be detected. Correspondingly, the set of high-frequency components corresponding to the dynamic behavior trajectories of all pixels is defined as a transient feature layer, which is used to reflect rapidly changing interferences such as ambient light fluctuations and sensor noise.
[0030] In the specific implementation, multi-level feature decoupling is performed on the pixel clusters identified through the aforementioned steps. The implementation scenario is the visual detection of fine scratches on the surface of an LCD panel. Each pixel cluster contains approximately two thousand spatially continuous pixels, and each pixel has a dynamic behavior trajectory of length 500. Modal decomposition is performed on the dynamic behavior trajectories of all pixels within the pixel cluster. The variational mode decomposition method is used to decompose each dynamic behavior trajectory into a series of intrinsic mode functions. The variational mode decomposition process presets the number of modes to be decomposed to be K=5, and seeks to minimize the sum of the estimated bandwidths of all modes under the constraint that the sum of all modes equals the original signal. For the dynamic behavior trajectory X(t) of any pixel in the pixel cluster, five intrinsic mode function components are obtained after variational mode decomposition. Where k = 1, 2, ..., 5. Each intrinsic mode function component Having a center frequency The formula for calculating the center frequency is: in: This represents the center frequency of the k-th eigenmode function component. Representative to The frequency domain representation obtained after performing a Fourier transform. This represents the angular frequency, and the integration operation is performed in the frequency domain.
[0031] In some embodiments, a frequency threshold is set to separate components with different changing frequencies; the frequency threshold is set to 5 Hz. Among the five intrinsic mode function (IMF) components obtained from variational mode decomposition, IMF components with a center frequency below 5 Hz are separated, while IMF components with a center frequency above 5 Hz are also separated. For a specific pixel, after decomposition of its dynamic behavior trajectory X(t), the first mode component... With the second mode component The center frequencies are 1.2 Hz and 3.8 Hz, respectively, and these two components are determined to be low-frequency components; the third, fourth, and fifth mode components The center frequencies are 8.5 Hz, 15.1 Hz and 32.7 Hz, respectively, and these three components are identified as high-frequency components.
[0032] In practical implementation, the low-frequency components corresponding to the dynamic behavior trajectories of all pixels within a pixel cluster are grouped together, and this group is defined as the stable feature layer. The signal components in the stable feature layer change slowly and are used to reflect the inherent texture and contours of defects such as minor scratches and foreign objects on the surface of the LCD panel. The high-frequency components corresponding to the dynamic behavior trajectories of all pixels within a pixel cluster are grouped together, and this group is defined as the transient feature layer. The signal components in the transient feature layer change rapidly and are used to reflect interference introduced by ambient light source flicker and minor vibrations of the detection platform.
[0033] Optionally, the preset number of modes K in variational mode decomposition is not fixed at 5, and can be adjusted to 7 or other values according to the complexity of the dynamic behavior trajectory. It is understood that the mode decomposition method is not limited to variational mode decomposition; empirical mode decomposition can be used in another implementation. The setting of the frequency threshold of 5 Hz is based on the analysis of the spectrum of actual interference signals. For different detection environments, the frequency threshold can be set to 3 Hz or other values. The separation of the stable feature layer and the transient feature layer is based on frequency characteristics; low-frequency components correspond to the stable properties of the object, while high-frequency components correspond to the transient noise of the environment and system.
[0034] In one embodiment of the invention, a topology weaving is performed on the stable feature layer, treating each low-frequency component in the stable feature layer as a feature node. The Euclidean or Mahalanobis distance between any two feature nodes in the spatiotemporal coordinate system is calculated, along with the phase difference between the low-frequency variation patterns represented by these two feature nodes. A virtual link is established between each pair of feature nodes, with the strength of the virtual link set to be inversely proportional to the distance between the two feature nodes and directly proportional to the cosine of the phase difference between the variation patterns of the two feature nodes. Through an iterative optimization process, for example, setting a link strength threshold, the strength of all virtual links is evaluated in each iteration. Virtual links with strengths greater than the threshold are retained, while those with strengths less than the threshold are removed. After multiple iterations until the network structure stabilizes, a mesh structure is formed by all the feature nodes and the retained virtual links; this mesh structure is the feature topology network. To extract structural invariants from the feature topology network, paths are defined on the feature topology network, each path consisting of a series of feature nodes connected sequentially by virtual links. Calculate the length and tortuosity of all paths, and define the path properties that maintain a constant proportional relationship between length and tortuosity when the characteristic topology undergoes an affine transformation as path invariants. Identify loops in the characteristic topology, i.e., closed paths with the same characteristic node as their starting and ending points, and define the number of characteristic nodes constituting the loop and the strength distribution pattern of each virtual link in the loop as loop invariants. Path invariants and loop invariants together constitute the structural invariants of the characteristic topology.
[0035] In the specific implementation, a topological weaving is performed on the stable feature layer obtained from the LCD panel inspection scenario. This stable feature layer contains 120 feature nodes composed of low-frequency components. Each feature node is associated with a specific location in the image space and its slowly changing modal features. Each feature node is treated as an independent entity, and the distance between any two feature nodes in the spatiotemporal coordinate system and the phase difference of their change patterns are calculated. Specifically, the spatiotemporal coordinate system is composed of two-dimensional image pixel coordinates and a one-dimensional time coordinate. For feature node A and feature node B, the distance between them is calculated using Mahalanobis distance to account for scale differences across different dimensions. The phase difference between the change patterns of feature node A and feature node B is obtained by comparing the Hilbert transform phase angles of their corresponding low-frequency component signals.
[0036] In some embodiments, a virtual link is established between each pair of feature nodes, and the strength of the virtual link is determined by both distance and phase difference. The formula for calculating the strength of the virtual link is: in: This represents the strength of the virtual link between feature node A and feature node B. This represents the Mahalanobis distance between feature node A and feature node B. This represents the phase difference between the change patterns of feature node A and feature node B.
[0037] In practice, virtual links are filtered through an iterative optimization process to form a feature topology network, with a link strength threshold set at 0.6. In each iteration, the strength of the virtual links between all pairs of feature nodes is calculated. Virtual links with a strength greater than 0.6 are retained, while those with a strength less than or equal to 0.6 are removed. This iterative process continues until the set of retained virtual links from two consecutive iterations no longer changes. At this point, a stable mesh structure is formed by all 120 feature nodes and the retained virtual links; this mesh structure is called the feature topology mesh. The feature topology mesh reflects the spatial proximity and dynamic synchronization relationships between components within the stable feature layer (see Table 1).
[0038] Table 1: Distance, Phase Difference, and Link Strength Between Feature Nodes Feature node pairs Mahalanobis distance Phase difference (radian) Link strength Node 1 - Node 2 2.15 0.12 0.21 Node 1-Node 3 1.08 0.05 0.86 Node 2-Node 3 3.40 0.80 -0.07 Node 1-Node 4 0.75 0.01 0.99 The link strength threshold of 0.6 is understandable as an adjustable parameter used to control the sparsity and connectivity of the feature topology. Optionally, Euclidean distance can be used instead of Mahalanobis distance for distance calculation. Structural invariants are extracted from the feature topology; these are the connection relationships and path attributes that remain unchanged despite geometric deformation and strength scaling transformations. Paths are defined on the feature topology, consisting of a series of feature nodes connected sequentially by virtual links, for example, node 1 -> node 4 -> node 5 constitutes a path. The length and tortuosity of all paths are calculated. Path length is defined as the sum of the physical distances of the virtual links along the path, and tortuosity is defined as the degree of curvature of the path, quantified by the ratio of the length of the line connecting the endpoints to the path length.
[0039] In some embodiments, loops in the characteristic topology are identified. A loop is a closed path whose starting and ending points are the same characteristic node, such as node 1->node 4->node 5->node 1 forming a loop. The number of characteristic nodes constituting the loop is extracted as one component of the loop invariant, and the strength distribution pattern of each virtual link segment on the loop is recorded as another component of the loop invariant. The strength distribution pattern can be described, for example, as a descending order of link strength values. The path invariant and the loop invariant together constitute the structural invariant used to describe the essential connection structure of the characteristic topology. Optionally, the tortuosity can be calculated in a way that is not limited to the ratio method described above; the ratio of the chord length to the arc length of the path can also be used.
[0040] See Figure 4This is a biaxial bar chart analyzing loop features in a feature topology network used in AI visual inspection. Its core function is to show the relationship between the number of nodes in different loops and their average link strength. This chart serves to analyze the structural stability of the feature topology network. Loops with high average link strength (such as loops 1 and 3) are the "core stable structures" of the topology network, with more reliable connections. Loops with high link strength correspond to more stable feature regions in the image and can serve as key reference features for visual inspection. Loops with low link strength may be redundant structures in the topology network, which can help optimize the simplification of the feature layer.
[0041] In one embodiment of the invention, a generative network is constructed using structural invariants to guide the creation of an enhanced feature representation layer. The encoder of the generative network, typically composed of multiple fully connected layers or graph convolutional layers, is configured to map each feature node and its connections in the feature topology network to a low-dimensional latent space vector. An additional constraint term is added to the loss function of the generative network's decoder. This constraint term forces the decoder to minimize the differences between the calculated path invariants and loop invariants and the structural invariants of the original feature topology network. The difference can be measured using mean squared error. By training the generative network in a supervised or unsupervised manner, the network learns the essential structural constraints of the feature topology network and outputs a new network structure. This structure retains the key structural invariants of the original feature topology network while enhancing or completing its node features. The node features of this new network structure are decoded back into the image feature space to obtain the enhanced feature representation layer.
[0042] In practical implementation, structural invariants extracted from the feature topology network guide the generative network to construct an enhanced feature representation layer. The implementation scenario is visual inspection of solder joint quality on high-density integrated circuit boards. The feature topology network contains ninety feature nodes and two hundred virtual links. The generative network is configured as a graph-based autoencoder. The encoder of the generative network consists of three graph convolutional layers. The encoder is used to map each feature node and its connection relationship in the feature topology network into a sixty-four-dimensional latent space vector. The initial feature vector of the feature node is formed by concatenating the amplitude, frequency and spatial coordinates of its corresponding low-frequency components.
[0043] In some embodiments, a constraint term is added to the decoder loss function of the generative network. The decoder consists of fully connected layers and graph reconstruction layers, used to reconstruct a new network structure from latent space vectors. The constraint term forces the network structure reconstructed by the decoder to minimize the differences between its path invariants and loop invariants and the structural invariants of the original feature topology. The specific formula for calculating the constraint term loss is as follows: in: The loss value represents the structural invariant constraint term. and These are weighting coefficients used to balance the two losses. This represents a representative set of paths selected from the original feature topology. Paths in the original feature topology The path invariant calculation value, This represents the corresponding path in the reconstructed network structure. The path invariant calculation value, Represents absolute value operation. This represents a representative set of loops selected from the original feature topology network. Loops in the original characteristic topology network The loop invariant vector, This represents the corresponding loop in the reconstructed network structure. The loop invariant vector, It represents the L2 norm of a vector.
[0044] In practice, the overall training loss of the generative network consists of reconstruction loss and structural invariant constraint term loss. Reconstruction loss measures the mean square error between the node features of the original topology and the node features of the reconstructed network structure. The parameters of the generative network are optimized using the backpropagation algorithm, with weight coefficients... Set to 0.7, weighting coefficient The value was set to 0.3, and the training process lasted for 500 epochs. Through training, the generative network learned the key topological rules for encoding the feature topology in the latent space. The decoder was able to output a new network structure. The new network structure retained the connection relationships and path attributes defined by structural invariants in the original feature topology. At the same time, the dimension of the feature node vectors in the new network structure was increased from the original 32 dimensions to 128 dimensions, containing richer contextual semantic information.
[0045] It is understandable that the structure of generative networks is not limited to graph autoencoders; graph variational autoencoders or other generative graph network models can be used. In specific implementations, generative graph network models can be implemented in various ways. For example, graph variational autoencoders, as a common model, also map feature nodes in a feature topology network to latent space vectors using an encoder. However, they introduce a variational inference mechanism to learn the probability distribution of latent variables, thereby enhancing the diversity of generation. The decoder samples from the latent space and reconstructs the network structure, while strictly incorporating constraints defined by structural invariants into the loss function to ensure the consistency of path invariants and loop invariants with the original feature topology network. Other generative graph network models, such as attention-based graph generative networks or recurrent graph neural networks, can also be configured according to the same principle: the encoder extracts the latent representations of feature nodes, and during the decoding process, structural invariants are used as topological rule constraints to optimize the network. The final output is a new network structure that is enhanced in the node feature dimension while maintaining topological logic, which is then decoded into an enhanced feature representation layer. The feature node vectors in the new network structure output by the generative network are mapped back to a feature space with the same dimension as the original stable feature layer through a dedicated fully connected decoding layer. The feature set in the mapped feature space is the enhanced feature representation layer, which strengthens the feature discrimination between the solder joint region and the background region. In some embodiments, the path set With loop The selection is based on importance sampling, prioritizing the paths and loops where feature nodes with high connectivity are located.
[0046] See Figure 5 This is a heatmap of image response values for AI visual inspection, used to display the distribution of detection response intensity at different locations in image space. This heatmap primarily serves feature localization and anomaly identification in visual inspection. High-response (red) areas correspond to regions with significant features in the image and are the core focus of visual inspection; low-response (blue) areas can be considered background or meaningless interference, aiding in accurate focusing of the detection area; the gradient distribution of response values reflects the detection algorithm's ability to distinguish spatial features and serves as a reference for algorithm performance calibration. Each response region exhibits a "gradient diffusion" characteristic, consistent with the spatial decay law of image features.
[0047] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.
[0048] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. An artificial intelligence visual inspection method, characterized in that, include: Establish a spatiotemporal field for visual perception, which consists of a sequence of image frames acquired by an image sensing device; The dynamic behavior trajectory of pixels is constructed in the spatiotemporal field. The evolution characteristics of the dynamic behavior trajectory are formed by analyzing the fluctuation pattern of pixel intensity in the time dimension and the propagation pattern in the spatial neighborhood. The correlation matrix of pixels is calculated based on evolutionary features. Pixel clusters with aggregation are identified from the correlation matrix. Multi-level feature decoupling is performed on the pixel clusters. Stable feature layers representing the inherent properties of the object to be detected and transient feature layers representing environmental interference and noise are extracted from the pixel clusters. Topological weaving is performed on the stable feature layers. The dispersed stable feature layers are woven into a connected feature topology network by simulating the attraction and linking process in the physical field. The structural invariants in the feature topology network are extracted, and the structural invariants are used to guide the generative network to construct an enhanced feature expression layer. The optimization objective of the generative network is constrained by the topological rules defined by the structural invariants. The enhanced feature representation layer is fused and projected with the original sequence image frames after removing the transient feature layer to generate a visual detection image for judging the surface state of an object.
2. The artificial intelligence visual inspection method according to claim 1, characterized in that, The construction of the dynamic behavior trajectory of pixels within the spatiotemporal field includes: Each pixel in a sequence of image frames contains intensity data and spectral channel data; Obtain the intensity change curve of each pixel on the time axis in the sequence of image frames; Define the spatial neighborhood range of each pixel as the center, and calculate the statistical correlation of the intensity change curves of all pixels within the spatial neighborhood. The intensity change curve of each pixel is fused with the statistical correlation of the intensity change curves of pixels in its spatial neighborhood to form a composite feature curve describing the dynamics of the pixel itself and its dynamics in conjunction with its neighborhood, which serves as the dynamic behavior trajectory of the pixel.
3. The artificial intelligence visual inspection method according to claim 2, characterized in that, The calculation of the pixel correlation matrix based on evolutionary features includes: The correlation matrix reflects the synchronous change pattern and coupling strength of the dynamic behavior trajectory of pixels in the spatiotemporal field; Calculate the similarity measure between the dynamic behavior trajectories of every two pixels; Based on the similarity metric, a two-dimensional matrix is constructed. The rows and columns of the two-dimensional matrix correspond to all pixels in the spatiotemporal field. Each element value in the matrix represents the similarity metric value between the dynamic behavioral trajectories of two corresponding pixels. This two-dimensional matrix is the correlation matrix.
4. The artificial intelligence visual inspection method according to claim 3, characterized in that, The process of identifying clustered pixel groups from the correlation matrix includes: Pixel communities consist of contiguous pixel regions with similar evolutionary characteristics and high coupling strength in the correlation matrix; The correlation matrix is transformed into a graph structure, treating each pixel as a node in the graph structure, and connecting the two pixels corresponding to the element values in the correlation matrix that are greater than the preset correlation threshold with an edge. The community detection algorithm is performed on the graph structure to find the set of nodes that are tightly connected internally and sparsely connected externally. Each such set of nodes is mapped back to the original image space, and the resulting continuous pixel region is a pixel community.
5. The artificial intelligence visual inspection method according to claim 1, characterized in that, The multi-level feature decoupling of pixel communities includes: Modal decomposition is performed on the dynamic behavior trajectory of all pixels in the pixel cluster to separate low-frequency components with a change frequency below a preset threshold and high-frequency components with a change frequency above a preset threshold. The set of low-frequency components is defined as the stable feature layer, which is used to reflect the slow deformation or inherent texture of the surface of the object to be detected. The set of high-frequency components is defined as the transient feature layer, which is used to reflect rapid changes in ambient light fluctuations and sensor noise.
6. The artificial intelligence visual inspection method according to claim 5, characterized in that, The topology weaving of the stable feature layer includes: Each low-frequency component in the stable feature layer is regarded as a feature node, and the distance between every two feature nodes in the spatiotemporal coordinate system and the phase difference of their change patterns are calculated. Virtual links are established between feature nodes. The strength of the virtual links is inversely proportional to the distance and directly proportional to the cosine of the phase difference. Through an iterative optimization process, virtual links with strength greater than the link strength threshold are retained, while virtual links with strength less than the link strength threshold are removed. Finally, a mesh structure is formed by the feature nodes and the retained virtual links, which is the feature topology mesh.
7. The artificial intelligence visual inspection method according to claim 6, characterized in that, The structural invariants extracted from the feature topology include: Structural invariants are the connection relationships and path properties of a characteristic topology that remain unchanged under geometric deformation and intensity scaling transformations. Define a path on the feature topology network. The path consists of a series of feature nodes connected sequentially by virtual links. Calculate the length and tortuosity of all possible paths, and define the path properties that maintain a constant proportional relationship between length and tortuosity when the characteristic topology undergoes an affine transformation as path invariants; Loops in a feature topology network are identified, and the number of feature nodes constituting the loop and the strength distribution pattern of virtual links on the loop are defined as loop invariants. The structural invariants are composed of the path invariants and the loop invariants.
8. The artificial intelligence visual inspection method according to claim 7, characterized in that, The method of constructing an enhanced feature representation layer using a structure invariant-guided generative network includes: Configure the encoder of the generative network, which is used to map feature nodes in the feature topology network to latent space vectors; In the loss function of the decoder of the generative network, a constraint term is added, which forces the network structure reconstructed by the decoder to minimize the difference between its path invariants and loop invariants and the structural invariants of the original feature topology. Through training, the generative network is able to output a new network structure that retains the original feature topology invariants while being enhanced in the node feature dimension. This new network structure is then decoded back into the image feature space to obtain the enhanced feature representation layer.
9. An artificial intelligence visual inspection system, characterized in that, The method for implementing the artificial intelligence visual inspection method as described in any one of claims 1-8 includes: The spatiotemporal field construction module establishes a spatiotemporal field for visual perception, which consists of a sequence of image frames acquired by an image sensing device. The dynamic trajectory evolution module constructs the dynamic behavior trajectory of pixels in the spatiotemporal field. It forms the evolution characteristics of the dynamic behavior trajectory by analyzing the fluctuation pattern of pixel intensity in the time dimension and the propagation pattern in the spatial neighborhood. The feature decoupling and recognition module calculates the correlation matrix of pixels based on evolutionary features, identifies clustered pixel groups from the correlation matrix, performs multi-level feature decoupling on the pixel groups, and extracts stable feature layers representing the inherent properties of the object to be detected, as well as transient feature layers representing environmental interference and noise from the pixel groups. The topology enhancement generation module performs topology weaving on the stable feature layers. It weaves the dispersed stable feature layers into a connected feature topology network by simulating the attraction and linking process in the physical field. It extracts the structural invariants in the feature topology network and uses the structural invariants to guide the generative network to construct an enhanced feature expression layer. The optimization objective of the generative network is constrained by the topology rules defined by the structural invariants. The fusion projection detection module fuses and projects the enhanced feature representation layer with the original sequence image frames after removing the transient feature layer to generate a visual detection image for judging the surface state of an object.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, causes the processor to implement the artificial intelligence visual inspection method as described in any one of claims 1 to 8.