Machine learning based uv glue detection data analysis system
By combining the cross-attention decoupling module and the inverted index tree, the interference features of ambient light are removed, solving the problem of data analysis distortion caused by light interference in UV adhesive detection data analysis, and achieving more accurate curing quality analysis.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN XINTAIYING ELECTRONIC MATERIALS CO LTD
- Filing Date
- 2026-04-28
- Publication Date
- 2026-07-24
AI Technical Summary
Existing machine learning-based UV adhesive detection data analysis systems suffer from a high degree of coupling between ambient light interference features and the adhesive's curing texture features when processing UV-cured adhesives. This leads to retrieval results that deviate from the actual curing state, resulting in data analysis distortion.
A cross-attention decoupling module is used to remove ambient lighting interference features. Temporal spectral and two-dimensional surface image features are extracted through a bidirectional long short-term memory network and a multi-scale convolutional neural network. Feature retrieval is performed by combining an inverted index tree and a hash bucket splitting mechanism to ensure the accuracy of retrieval results.
It effectively eliminates the influence of ambient light interference on features, improves the accuracy and efficiency of UV adhesive detection data analysis, and reduces computational resource consumption.
Smart Images

Figure CN122450996A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology and discloses a UV adhesive detection data analysis system based on machine learning. Background Technology
[0002] In industrial production, the curing quality of UV-curable adhesives directly affects the bonding strength and sealing performance of products. Existing machine learning-based UV adhesive detection data analysis systems typically employ a multi-source data joint analysis architecture. Specifically, the system simultaneously acquires temporal spectral sequences and two-dimensional surface images during the curing process. A feature extraction network is then used to process the spectral sequences and images separately to obtain the corresponding temporal and spatial features. Conventional solutions directly concatenate and fuse these two types of features along their respective feature dimensions to generate a joint feature vector. The system stores this joint feature vector as an index key in a feature database. Upon receiving a sample to be tested, the system extracts the joint feature vector of the sample and performs distance calculations and nearest neighbor searches in the database. Based on the search results, it outputs a curing quality analysis label.
[0003] The aforementioned existing technologies have a core flaw in processing UV-curable adhesive detection data. Because the curing process is extremely sensitive to changes in ambient light in the workshop, the acquired two-dimensional surface images contain a large amount of environmental interference information introduced by local shadows or sudden changes in light source. Conventional solutions, when directly stitching temporal and spatial features, exhibit a high degree of coupling between the ambient light interference features in the image and the cured texture features of the adhesive itself at the data level. This results in the generated joint feature vector being mixed with non-cured interference components. When the system uses the joint feature vector containing these interference components for feature matching and nearest neighbor retrieval, the retrieval results deviate from the true cured state, leading to data analysis distortion. Summary of the Invention
[0004] The purpose of this invention is to provide a UV adhesive detection data analysis system based on machine learning, which can effectively solve the problems mentioned in the background art.
[0005] To achieve the above objectives, the technical solution adopted by the present invention is as follows: The machine learning-based UV adhesive detection data analysis system includes a data receiving module, a feature extraction module, a cross-attention decoupling module, an index building module, and a retrieval and analysis module. The data receiving module is used to receive the time-series spectral sequence and two-dimensional surface image during the UV adhesive curing process; The feature extraction module includes a temporal feature extraction branch and a spatial feature extraction branch. The temporal feature extraction branch extracts the spectral attenuation gradient features of the temporal spectral sequence based on a bidirectional long short-term memory network, while the spatial feature extraction branch extracts the bubble and edge texture features of the two-dimensional surface image based on a multi-scale convolutional neural network. The cross-attention decoupling module uses spatial features as query vectors and temporal features as key-value pairs to calculate the attention weight matrix. It strips out ambient light interference features that are greater than the preset weight threshold and splices the decoupled pure spatiotemporal feature vectors to generate a UV glue detection feature map. The index building module stores the UV glue detection feature map as the index key value into the inverted index tree; When the retrieval and analysis module receives the UV adhesive detection data to be analyzed, it extracts the pure spatiotemporal feature vector of the UV adhesive detection data to be analyzed and performs nearest neighbor search in the inverted index tree, and outputs the corresponding curing quality analysis results.
[0006] Preferably, the temporal feature extraction branch includes a forward propagation channel and a reverse propagation channel. The forward propagation channel processes the temporal spectral sequence in chronological order to capture the absorption spectrum change trend of the early curing reaction, while the reverse propagation channel processes the temporal spectral sequence in reverse chronological order to capture the kinetic characteristics of the later curing crosslinking state. The temporal feature extraction branch splices the hidden state output of the forward propagation channel and the hidden state output of the reverse propagation channel in the feature dimension to generate a temporal spectral attenuation gradient feature containing complete curing cycle information. The spatial feature extraction branch contains three convolutional kernels of different sizes set in parallel. The three convolutional kernels of different sizes perform convolution operations on the two-dimensional surface image to extract bubble features and edge texture features at the corresponding scale. The spatial feature extraction branch cascades and fuses the feature maps output by the three convolutional kernels of different sizes in the channel dimension to generate spatial features that fuse multi-scale spatial information.
[0007] Preferably, the cross-attention decoupling module includes a query vector mapping layer, a key vector mapping layer, a value vector mapping layer, and a weight calculation layer. The query vector mapping layer maps spatial features to a query matrix of the first dimension, and the key vector mapping layer and the value vector mapping layer map temporal features to key matrices and value matrices that are the same as the first dimension, respectively. The weight calculation layer performs matrix multiplication on the transpose of the query matrix and the key matrix and introduces a scaling factor for normalization to generate the attention weight matrix. The cross-attention decoupling module sets the weight values in the attention weight matrix that are greater than the preset weight threshold to zero to generate a mask matrix. It then uses the mask matrix and the value matrix to perform element-wise multiplication to filter out the feature components in the value matrix that are related to illumination interference. The filtered value matrix is then used as the decoupled pure spatiotemporal feature vector.
[0008] Preferably, the index building module includes a feature dimensionality reduction component and an inverted file index structure. The feature dimensionality reduction component performs random projection dimensionality reduction on the decoupled pure spatiotemporal feature vector, compressing the high-dimensional pure spatiotemporal feature vector into a fixed-length binary hash code. The inverted file index structure contains multiple hash buckets, each corresponding to a set of binary hash codes with the same hash prefix. The feature dimensionality reduction component allocates the binary hash codes to the corresponding hash buckets according to the prefixes, and stores the mapping relationship between the original spatiotemporal feature vectors contained in the UV glue detection feature map and the binary hash codes in the inverted linked list corresponding to the hash bucket. The binary hash codes serve as the index keys of the inverted index tree.
[0009] Preferably, when the retrieval and analysis module receives the UV adhesive detection data to be analyzed, it calls the feature extraction module and the cross-attention decoupling module to process the UV adhesive detection data to be analyzed, and obtains the pure spatiotemporal feature vector to be analyzed. The retrieval and analysis module then converts the pure spatiotemporal feature vector to be analyzed into the binary hash code to be analyzed. The retrieval and analysis module calculates the Hamming distance between the binary hash code to be analyzed and the bucket number of each hash bucket in the inverted index tree, and selects the target hash bucket with the smallest Hamming distance. The retrieval and analysis module traverses the inverted linked list within the target hash bucket, calculates the cosine similarity between the pure spatiotemporal feature vector to be analyzed and the original spatiotemporal feature vector stored in the inverted linked list, and takes the original spatiotemporal feature vector with the largest cosine similarity as the nearest neighbor retrieval result.
[0010] Preferably, after obtaining the original spatiotemporal feature vector with the highest cosine similarity, the retrieval and analysis module extracts the curing defect labels of the historical UV adhesive detection samples corresponding to the original spatiotemporal feature vector; The retrieval and analysis module obtains the time-series spectral attenuation gradient features of the UV adhesive detection data to be analyzed, and determines whether the difference between the time-series spectral attenuation gradient features to be analyzed and the historical time-series spectral attenuation gradient features corresponding to the original spatiotemporal feature vector is within the preset gradient error range. If it is within the preset gradient error range, the retrieval and analysis module will directly assign the curing defect labels of the historical UV adhesive test samples to the UV adhesive test data to be analyzed in order to generate curing quality analysis results. If the error exceeds the preset gradient error range, the retrieval and analysis module will trigger a manual review instruction and output an early warning analysis result containing the gradient difference.
[0011] Preferably, the temporal feature extraction branch is equipped with an adaptive time step alignment component before inputting the temporal spectral sequence into the bidirectional long short-term memory network; The adaptive time step alignment component reads the acquisition timestamp of the time-series spectral sequence and calculates the actual time interval between two adjacent spectral acquisition points based on the acquisition timestamp; When the actual time interval is not equal to the preset standard interval, the adaptive time step alignment component uses a cubic spline interpolation algorithm to generate virtual spectral data points at the missing time points corresponding to the actual time interval, and inserts the virtual spectral data points into the time-series spectral sequence, so that the time-series spectral sequence input to the bidirectional long short-term memory network has a uniform time step resolution.
[0012] Preferably, the cross-attention decoupling module is equipped with a frequency domain separation component before calculating the attention weight matrix; The frequency domain separation component performs discrete Fourier transforms on spatial features and temporal features respectively, transforming the spatial features and temporal features from the time domain to the frequency domain to obtain frequency domain spatial features and frequency domain temporal features; The frequency domain separation component extracts the low-frequency band component corresponding to the flicker frequency of the ambient light source from the frequency domain time sequence features, subtracts the low-frequency band component from the frequency domain time sequence features, and performs an inverse discrete Fourier transform on the frequency domain time sequence features after subtracting the low-frequency band component to restore the filtered time sequence features. The weight calculation layer uses the filtered temporal features to perform the mapping operation between the key matrix and the value matrix.
[0013] Preferably, the inverted file index structure is equipped with a dynamic bucket splitting mechanism; When the feature reduction component assigns the new binary hash code to the target hash bucket, the inverted file index structure calculates the average Hamming distance between the new binary hash code and the existing binary hash codes in the target hash bucket. When the average Hamming distance is greater than the preset bucket clustering threshold, the inverted file index structure triggers a dynamic bucket splitting mechanism. It uses a locality-sensitive hash function to re-divide the binary hash code in the target hash bucket, splitting the target hash bucket into two sub-hash buckets, and updating the hash prefix routing table recorded in the inverted file index structure so that the re-divided binary hash code is assigned to the inverted linked list of the corresponding sub-hash bucket.
[0014] Preferably, when calculating the cosine similarity between the pure spatiotemporal feature vector to be analyzed and the original spatiotemporal feature vector stored in the inverted linked list, the retrieval and analysis module adopts a multi-granularity feature distance calculation strategy; The retrieval and analysis module reduces the dimension of the pure spatiotemporal feature vector to be analyzed into a global contour feature vector and a local detail feature vector. The global contour feature vector is obtained by average pooling, and the local detail feature vector is obtained by max pooling. The retrieval and analysis module first calculates the first cosine similarity between the global contour feature vector of the pure spatiotemporal feature vector to be analyzed and the global contour feature vector of the original spatiotemporal feature vector. If the first cosine similarity meets the initial screening conditions, the second cosine similarity between the local detail feature vectors is then calculated to replace the cosine similarity as the final sorting criterion.
[0015] Compared with the prior art, the beneficial effects of the present invention are as follows: 1. This invention employs a cross-attention decoupling module. Spatial features are used as query vectors, and temporal features are used as key-value pairs to calculate the attention weight matrix. A mask matrix is generated by setting the weight values to zero according to a preset weight threshold. This mask matrix is then used to filter out feature components in the temporal features associated with illumination interference. This processing logic quantitatively separates ambient illumination interference features from the spatiotemporal joint features before feature fusion, ensuring that the generated pure spatiotemporal feature vector contains only the glue-based solidification information. This eliminates coupling at the feature level and guarantees the accuracy of subsequent nearest neighbor retrieval based on the pure spatiotemporal feature vector.
[0016] 2. This invention constructs an inverted file index structure with a dynamic bucket splitting mechanism in the feature retrieval stage. When a new binary hash code is added to the target hash bucket, causing the average Hamming distance to exceed a preset bucket clustering threshold, a locality-sensitive hash function is triggered to re-split the hash codes within the bucket and update the routing table. This mechanism maintains the cohesiveness of feature vectors within each bucket in the index tree, shortening the traversal path during feature retrieval. Combined with a multi-granularity feature distance calculation strategy, a preliminary screening is performed using global contour feature vectors, followed by a secondary sorting using local detail feature vectors. This reduces the frequency of cosine similarity calculations in the inverted linked list, thereby reducing the computational resource consumption during data retrieval. Attached Figure Description
[0017] Figure 1 This is a flowchart illustrating the overall processing of the present invention; Figure 2 This is a flowchart of the temporal and spatial feature extraction process of the present invention; Figure 3 This is a flowchart of the cross-attention decoupling module of the present invention; Figure 4 This is a flowchart illustrating the frequency domain separation and decoupling process of this invention. Figure 5 This is a flowchart illustrating the feature dimensionality reduction and inverted index construction process of the present invention. Figure 6 This is a flowchart of the multi-granularity nearest neighbor retrieval and analysis process of the present invention. Detailed Implementation
[0018] Please refer to the attached document. Figure 1This embodiment provides a machine learning-based UV adhesive detection data analysis system deployed at a UV adhesive curing detection station on an industrial production line, establishing communication connections with a spectral acquisition device and an industrial camera. The spectral acquisition device collects light absorption intensity data at different wavelengths during the UV adhesive curing process at a preset sampling frequency, generating a time-series spectral sequence. The industrial camera acquires two-dimensional surface images of the UV adhesive curing area at the same time synchronization frequency. The data receiving module receives the time-series spectral sequence output by the spectral acquisition device and the two-dimensional surface image output by the industrial camera via an Ethernet interface, performs format conversion and timestamp alignment on the received data, and transmits the aligned time-series spectral sequence and two-dimensional surface image to the feature extraction module.
[0019] Please refer to the attached document. Figure 2 The feature extraction module includes a temporal feature extraction branch and a spatial feature extraction branch. The temporal feature extraction branch receives the temporal spectral sequence transmitted by the data receiving module and extracts the spectral attenuation gradient features of the temporal spectral sequence based on a bidirectional long short-term memory (LSTM) network. The bidirectional LSM network consists of an input layer, hidden layers, and an output layer. The input layer receives data in a specific dimension. The time-series spectral sequence, in which Indicates the number of time steps. Indicates the number of spectral wavelengths.
[0020] The hidden layer contains multiple Long Short-Term Memory (LSTM) units, each containing an input gate, a forget gate, an output gate, and a cell state. The input gate controls the extent to which current input information enters the cell state, the forget gate controls the extent to which the cell state from the previous time step is retained, and the output gate controls the extent to which the cell state is output to the hidden state. The bidirectional LSM network processes temporal spectral sequences through both forward and backward propagation, capturing spectral variation characteristics at different time stages.
[0021] The spatial feature extraction branch receives the 2D surface image transmitted by the data receiving module and extracts bubble and edge texture features from the 2D surface image based on a multi-scale convolutional neural network. The multi-scale convolutional neural network includes an input layer, multiple convolutional layers, pooling layers, and an output layer. The input layer receives data in dimensions of... Two-dimensional surface images, in which Indicates the image height. The width represents the image, and 3 represents the three color channels (RGB). Convolutional layers perform sliding window convolution operations on the input image using kernels of different sizes to extract local features at different scales. Pooling layers downsample the feature maps output by the convolutional layers, reducing the spatial dimensionality of the feature maps while preserving key feature information. Multi-scale convolutional neural networks extract features at different scales simultaneously through multiple convolutional layers set in parallel.
[0022] Please refer to the attached document. Figure 3The cross-attention decoupling module receives temporal and spatial features output from the feature extraction module. It uses the spatial features as the query vector and the temporal features as key-value pairs to calculate the attention weight matrix. First, the cross-attention decoupling module maps the spatial features to the query matrix and the temporal features to the key and value matrices, respectively. The query matrix, key matrix, and value matrix have the same dimension. The cross-attention decoupling module performs matrix multiplication on the transposes of the query matrix and the key matrix to obtain the original attention score matrix. After normalization by a scaling factor, the original attention score matrix generates the attention weight matrix. The cross-attention decoupling module sets all weights greater than a preset weight threshold in the attention weight matrix to zero, generating a mask matrix. The mask matrix and the value matrix are multiplied element-wise to filter out feature components in the value matrix associated with illumination interference, resulting in a decoupled, clean spatiotemporal feature vector. The cross-attention decoupling module concatenates the clean spatiotemporal feature vectors along the feature dimension to generate a UV adhesive detection feature map.
[0023] The index building module receives the UV adhesive detection feature map output by the cross-attention decoupling module and stores it as an index key in the inverted index tree. First, the index building module preprocesses the UV adhesive detection feature map, converting the high-dimensional feature vectors into a format suitable for index storage. Then, it constructs the inverted index tree structure, which includes a root node, multiple intermediate nodes, and leaf nodes. Each leaf node corresponds to a set of feature vectors, storing the feature vectors and their corresponding curing quality labels. Finally, the index building module inserts the UV adhesive detection feature map into the corresponding leaf node of the inverted index tree, updating the tree's structural information.
[0024] Upon receiving the UV adhesive detection data to be analyzed, the retrieval and analysis module calls the feature extraction module and the cross-attention decoupling module to process the data, obtaining the clean spatiotemporal feature vector to be analyzed. The retrieval and analysis module uses this clean spatiotemporal feature vector as the query vector and performs a nearest neighbor search in the inverted index tree. During the nearest neighbor search, the module starts from the root node of the inverted index tree and traverses downwards layer by layer, comparing the distance between the query vector and the split vectors of each node, selecting the nearest child node to continue traversing until a leaf node is reached. The retrieval and analysis module calculates the distance between the query vector and all feature vectors in the leaf node, selecting the feature vector with the smallest distance as the nearest neighbor search result. The retrieval and analysis module extracts the curing quality label corresponding to the nearest neighbor feature vector, generates the curing quality analysis result, and outputs it.
[0025] In this embodiment, the hidden layer of the bidirectional long short-term memory network contains 128 long short-term memory units, and the input layer dimension is 100×20, where 100 represents the number of time steps and 20 represents the number of spectral wavelengths. The multi-scale convolutional neural network contains three parallel convolutional layers with kernel sizes of 3×3, 5×5, and 7×7, respectively, and each convolutional layer contains 64 kernels. The preset weight threshold of the cross-attention decoupling module is set to 0.7, meaning that feature components with attention weights greater than 0.7 are considered as illumination interference features and are filtered out. The inverted index tree adopts a KD-tree structure, and each leaf node stores a maximum of 100 feature vectors.
[0026] Table 1. Description of input and output parameters for each module in this embodiment. Data receiving module Original time-series spectral sequence variable Aligned time-series spectral sequences 100×20 Data receiving module Original two-dimensional surface image variable Aligned 2D surface image 256×256×3 Temporal feature extraction branch Aligned time-series spectral sequences 100×20 Temporal spectral attenuation gradient characteristics 100×256 Spatial feature extraction branch Aligned 2D surface image 256×256×3 Multi-scale spatial features 32×32×192 Cross-attention decoupling module Temporal spectral attenuation gradient characteristics 100×256 Pure spacetime feature vector 100×256 Cross-attention decoupling module Multi-scale spatial features 32×32×192 UV adhesive detection characteristic spectrum 1×51200 Index building module UV adhesive detection characteristic spectrum 1×51200 Inverted index tree nodes Structured data Search and Analysis Module Pure spatiotemporal feature vectors to be analyzed 1×51200 Curing quality analysis results Text data Table 1 details the input and output parameters and their dimensions for each module in this embodiment. The data receiving module converts the original variable-dimensional data into fixed-dimensional aligned data for easier processing by the subsequent feature extraction module. The temporal feature extraction branch outputs a temporal spectral attenuation gradient feature with a dimension of 100×256, where 100 corresponds to the time step and 256 corresponds to the feature dimension at each time step. The spatial feature extraction branch outputs a multi-scale spatial feature with a dimension of 32×32×192, where 32×32 corresponds to the spatial size of the feature map and 192 corresponds to the number of channels. The cross-attention decoupling module decouples and fuses the temporal and spatial features to generate a UV adhesive detection feature map with a dimension of 1×51200, serving as the basis for index construction. The index construction module stores the feature map as structured inverted index tree nodes for rapid retrieval. The retrieval and analysis module outputs curing quality analysis results in text format, including information such as curing defect type, defect location, and severity.
[0027] In this embodiment, the forward propagation process of the bidirectional long short-term memory network is described by the following mathematical formula:
[0028]
[0029]
[0030]
[0031]
[0032]
[0033] in, Indicates the first The input vector at each time step, Indicates the first The hidden state at each time step Indicates the first Cell state at each time step , , These represent the activation values of the input gate, forget gate, and output gate, respectively. Indicates the state of candidate cells. Indicates the first Cell state at each time step Indicates the first The hidden state at each time step , , , , , , , Represents the weight matrix. , , , This represents the bias vector. This represents the sigmoid activation function. This represents the hyperbolic tangent activation function. This indicates element-wise multiplication.
[0034] The attention weight calculation process of the cross-attention decoupling module is described by the following mathematical formula:
[0035]
[0036]
[0037]
[0038] in, Represents the spatial characteristic matrix, Represents the time series feature matrix. , , These represent the mapping weight matrices for the query vector, key vector, and value vector, respectively. Represents the query matrix. Represents the key matrix. Represents a value matrix, This represents the dimension of the key matrix. This represents the scaling factor, used to prevent the gradient of the softmax function from vanishing due to an excessively large dot product result.
[0039] The generation of the mask matrix and the feature filtering process are described by the following mathematical formula:
[0040]
[0041] in, Represents the first element in the attention weight matrix. Line number Column elements, This indicates a preset weight threshold. Represents the nth element in the mask matrix Line number Column elements, This represents the filtered value matrix.
[0042] This embodiment sets up a cross-attention decoupling module to quantitatively separate ambient light interference features from spatiotemporal joint features before feature fusion, so that the generated pure spatiotemporal feature vector contains only glue body curing information, thus eliminating the coupling phenomenon at the feature level.
[0043] In a preferred embodiment, the temporal feature extraction branch includes a forward propagation channel and a backward propagation channel. The forward propagation channel processes the temporal spectral sequence in chronological order to capture the absorption spectrum variation trend of the early curing reaction. The backward propagation channel processes the temporal spectral sequence in reverse chronological order to capture the kinetic characteristics of the later curing crosslinking state. Both the forward and backward propagation channels employ a Long Short-Term Memory (LSTM) network with the same structure, including an input layer, a hidden layer, and an output layer. The input to the forward propagation channel is the temporal spectral sequence arranged in chronological order, and the output is the forward hidden state sequence. The input to the backward propagation channel is the temporal spectral sequence arranged in reverse chronological order, and the output is the reverse hidden state sequence. The temporal feature extraction branch concatenates the hidden state outputs of the forward propagation channel and the backward propagation channel along the feature dimension to generate a temporal spectral attenuation gradient feature containing complete curing cycle information.
[0044] The spatial feature extraction branch contains three convolutional kernels of different sizes set in parallel. These three kernels perform convolution operations on the two-dimensional surface image respectively, extracting bubble features and edge texture features at corresponding scales. The first convolutional kernel is 3×3, used to extract small bubbles and fine edge texture features. The second convolutional kernel is 5×5, used to extract medium-sized bubbles and medium-thickness edge texture features. The third convolutional kernel is 7×7, used to extract large bubbles and coarse edge texture features.
[0045] Each convolutional kernel is followed by a batch normalization layer and a ReLU activation function layer. The batch normalization layer normalizes the feature maps output by the convolutional layers, accelerating the network training process and preventing gradient vanishing or exploding. The ReLU activation function layer introduces a non-linear transformation, enhancing the network's expressive power. The spatial feature extraction branch cascades and fuses the feature maps output by the three convolutional kernels of different sizes along the channel dimension, generating spatial features that incorporate multi-scale spatial information.
[0046] The cross-attention decoupling module comprises a query vector mapping layer, a key vector mapping layer, a value vector mapping layer, and a weight calculation layer. The query vector mapping layer consists of a fully connected layer that maps spatial features to a query matrix in the first dimension. Both the key and value vector mapping layers are fully connected layers that map temporal features to key and value matrices, respectively, with the same first dimension. The weight calculation layer performs matrix multiplication on the transposes of the query and key matrices and introduces a scaling factor for normalization, generating an attention weight matrix. The cross-attention decoupling module sets weights greater than a preset threshold in the attention weight matrix to zero to generate a mask matrix. It then performs element-wise multiplication between the mask matrix and the value matrix to filter out feature components in the value matrix associated with illumination interference. The filtered value matrix is used as the decoupled, clean spatiotemporal feature vector.
[0047] Before inputting the time-series spectral sequence into the bidirectional long short-term memory (LSTM) network, the temporal feature extraction branch incorporates an adaptive time-step alignment component. This component reads the acquisition timestamps of the time-series spectral sequence and calculates the actual time interval between two adjacent spectral acquisition points. When the actual time interval equals a preset standard interval, the component directly transmits the time-series spectral sequence to the LSTM network. When the actual time interval does not equal the preset standard interval, the component uses a cubic spline interpolation algorithm to generate virtual spectral data points at the missing time points corresponding to the actual time intervals. These virtual spectral data points are then inserted into the time-series spectral sequence, ensuring that the time-series spectral sequence input to the LSTM network has a uniform time-step resolution.
[0048] The implementation process of the cubic spline interpolation algorithm is as follows: Assume that... Time points and their corresponding spectral intensity values It needs to be at a certain time point. Interpolation yields spectral intensity values Cubic spline interpolation function In each interval The above is a cubic polynomial:
[0049] in, The coefficients are polynomials. The cubic spline interpolation function satisfies the following conditions: , That is, the interpolation function is equal to the known function value at the node. That is, the first derivative of the interpolation function is continuous at the nodes. That is, the second derivative of the interpolation function is continuous at the nodes. , That is, natural boundary conditions By solving the system of linear equations formed by the above conditions, the polynomial coefficients for all intervals can be obtained, and then the polynomial coefficients for any time point can be calculated. Interpolated spectral intensity value at .
[0050] Please refer to the attached document. Figure 4 Before calculating the attention weight matrix, the cross-attention decoupling module includes a frequency domain separation component. This component performs Discrete Fourier Transform (DFT) on both spatial and temporal features, transforming them from the time domain to the frequency domain to obtain the frequency-domain spatial and temporal features. The mathematical formula for the Discrete Fourier Transform is:
[0051] in, Represents a time-domain signal. Represents frequency domain signals, Indicates signal length. Indicates frequency index, It represents the imaginary unit.
[0052] The frequency domain separation component extracts the low-frequency components corresponding to the flicker frequency of the ambient light source from the frequency domain time-series features. Ambient light sources are typically powered by 50Hz or 60Hz AC, with a flicker frequency of 100Hz or 120Hz. The frequency domain separation component identifies components with frequencies below 200Hz in the frequency domain time-series features as low-frequency components of the ambient light source flicker frequency. The component subtracts these low-frequency components from the frequency domain time-series features and then performs an inverse discrete Fourier transform (IFT) on the subtracted features to restore the filtered time-series features. The mathematical formula for the IFT is:
[0053] The weight calculation layer uses the filtered temporal features to perform the mapping operation between the key matrix and the value matrix, further reducing the impact of ambient lighting interference on the subsequent feature decoupling process.
[0055] Table 2 Feature types and applicable scenarios extracted by convolutional kernels of different sizes 3×3 Small bubble features, fine edge texture features Detecting microbubbles and fine cracks 256×256 64 5×5 Medium-sized bubble features, medium-thickness edge texture features Detection of regular bubbles and general cracks 256×256 64 7×7 Large bubble features, coarse edge texture features Detection of large air bubbles and obvious layering 256×256 64 Table 2 details the feature types, applicable scenarios, feature map sizes, and number of channels extracted by convolutional kernels of different sizes. A 3×3 convolutional kernel has a small receptive field, capable of capturing local details in an image, and is suitable for detecting tiny bubbles and fine cracks. A 5×5 convolutional kernel has a medium-sized receptive field, capable of capturing medium-scale features in an image, and is suitable for detecting regular bubbles and general cracks. A 7×7 convolutional kernel has a large receptive field, capable of capturing global features in an image, and is suitable for detecting large bubbles and obvious layering. The parallel operation of these three different sized convolutional kernels improves the expressive power of spatial features.
[0056] In this embodiment, the preset standard interval of the adaptive time step alignment component is set to 10ms, meaning that one spectral data point is collected every 10ms. When the actual time interval is greater than 10ms, the adaptive time step alignment component inserts virtual spectral data points at the missing time points. When the actual time interval is less than 10ms, the adaptive time step alignment component performs average sampling on the excess spectral data points, maintaining a time step resolution of 10ms. The low-frequency band cutoff frequency of the frequency domain separation component is set to 200Hz, meaning that components with frequencies below 200Hz are considered ambient light flicker interference and are filtered out. The preset weight threshold of the cross-attention decoupling module is set to 0.65, meaning that feature components with an attention weight greater than 0.65 are considered illumination interference features and are filtered out.
[0057] This embodiment comprehensively captures the spectral variation characteristics at different time stages during the UV adhesive curing process by setting up forward and backward propagation channels in a bidirectional long short-term memory network. A multi-scale convolutional neural network extracts bubble and edge texture features at different scales, improving the expressive power of spatial features. An adaptive time step alignment component solves the problem of inconsistent spectral acquisition time intervals, ensuring the accuracy of temporal feature extraction. A frequency domain separation component pre-filters ambient light flicker interference at the frequency domain level, further improving the feature decoupling effect.
[0058] In a preferred embodiment, please refer to the appendix. Figure 5 The index building module includes a feature dimensionality reduction component and an inverted file index structure. The feature dimensionality reduction component performs random projection dimensionality reduction on the decoupled pure spatiotemporal feature vectors, compressing the high-dimensional pure spatiotemporal feature vectors into fixed-length binary hash codes. The mathematical principle of random projection dimensionality reduction is based on the Johnson-Lindenstrauss lemma, which states that points in a high-dimensional space can be projected into a low-dimensional space while preserving approximately the same distance relationships between points.
[0059] The implementation process of random projection dimensionality reduction is as follows: Let the high-dimensional feature vector be... It needs to be projected onto In 3D space, where Generate a random projection matrix. Each element in the matrix follows a standard normal distribution. . High-dimensional feature vectors With random projection matrix Multiplication yields a low-dimensional feature vector. :
[0060] For low-dimensional feature vectors Perform binarization to generate binary hash codes. :
[0061] in, The first character representing the binary hash code Bit, The first eigenvector of a low-dimensional feature vector Each element.
[0062] The inverted file index structure contains multiple hash buckets, each corresponding to a set of binary hash codes with the same hash prefix. The feature dimensionality reduction component allocates the binary hash codes to the corresponding hash buckets according to their prefixes and stores the mapping relationship between the original spatiotemporal feature vectors contained in the UV glue detection feature map and the binary hash codes in the inverted linked list corresponding to the hash bucket. The binary hash codes serve as the index keys of the inverted index tree.
[0063] The inverted file index structure incorporates a dynamic bucket splitting mechanism. When the feature reduction component assigns a new binary hash code to the target hash bucket, the inverted file index structure calculates the average Hamming distance between the new binary hash code and existing binary hash codes in the target hash bucket. The Hamming distance refers to the number of different characters at corresponding positions in two binary strings of equal length. (Two binary hash codes are then considered.) and The Hamming distance between them is calculated as follows:
[0064] in, Indicates the length of the binary hash code. and These represent the first two binary hash codes respectively. Bit.
[0065] When the average Hamming distance exceeds a preset clustering threshold within a bucket, the inverted file index structure triggers a dynamic bucket splitting mechanism. This mechanism uses a locality-sensitive hash function (LSH) to re-divide the binary hash codes within the target hash bucket, splitting it into two sub-buckets. LSH has the property that similar input data has a higher probability of being mapped to the same hash bucket, while dissimilar input data has a higher probability of being mapped to different hash buckets. The inverted file index structure updates the hash prefix routing table, ensuring that the re-divided binary hash codes are assigned to the inverted linked lists of the corresponding sub-buckets.
[0066] Please refer to the attached document. Figure 6 Upon receiving the UV adhesive detection data to be analyzed, the retrieval and analysis module calls the feature extraction module and the cross-attention decoupling module to process the data, obtaining the clean spatiotemporal feature vector to be analyzed. The retrieval and analysis module converts this clean spatiotemporal feature vector into a binary hash code. It then calculates the Hamming distance between the binary hash code and each hash bucket number in the inverted index tree, selecting the target hash bucket with the smallest Hamming distance. The retrieval and analysis module traverses the inverted linked list within the target hash bucket, calculating the cosine similarity between the clean spatiotemporal feature vector to be analyzed and the original spatiotemporal feature vectors stored in the inverted linked list, and uses the original spatiotemporal feature vector with the largest cosine similarity as the nearest neighbor retrieval result.
[0067] Cosine similarity is an index that measures the degree of similarity between two vectors, and its value ranges from [-1, 1]. Two vectors and The cosine similarity between them is calculated as follows:
[0068] in, Represents the dimension of a vector. and Represent the first and second vectors respectively. Each element.
[0069] After obtaining the original spatiotemporal feature vector with the highest cosine similarity, the retrieval and analysis module extracts the curing defect labels of the historical UV adhesive test samples corresponding to the original spatiotemporal feature vector. The module then obtains the time-series spectral attenuation gradient features of the UV adhesive test data to be analyzed and calculates the difference between these features and the historical time-series spectral attenuation gradient features corresponding to the original spatiotemporal feature vector. The module determines whether this difference is within a preset gradient error range. If it is, the module directly assigns the curing defect labels of the historical UV adhesive test samples to the UV adhesive test data to be analyzed to generate curing quality analysis results. If the difference exceeds the preset gradient error range, the module triggers a manual review instruction and outputs an early warning analysis result containing the gradient difference.
[0070] The retrieval and analysis module employs a multi-granularity feature distance calculation strategy when calculating the cosine similarity between the clean spatiotemporal feature vector to be analyzed and the original spatiotemporal feature vectors stored in the inverted linked list. The module reduces the dimensionality of the clean spatiotemporal feature vector to be analyzed by decomposing it into a global contour feature vector and local detail feature vectors. The global contour feature vector is obtained through average pooling, which averages the values of local regions of the feature vector, preserving the overall information of the feature. The local detail feature vector is obtained through max pooling, which maximizes the values of local regions of the feature vector, preserving the detailed information of the feature.
[0071] The retrieval and analysis module first calculates the first cosine similarity between the global contour feature vector of the pure spatiotemporal feature vector to be analyzed and the global contour feature vector of the original spatiotemporal feature vector. If the first cosine similarity meets the initial screening criteria, the second cosine similarity between the local detail feature vectors is calculated to replace the cosine similarity as the final ranking criterion. The initial screening criterion is set to a first cosine similarity greater than 0.8, meaning only feature vectors with globally similar contours will proceed to the local detail similarity calculation stage.
[0072] Table 3. Triggering conditions and processing flow of the dynamic bucket splitting mechanism Processing Step 1 Calculate the center hash code of all binary hash codes within the target hash bucket. Processing Step 2 Generate a locality-sensitive hash function to divide the hash codes in the bucket into two groups. Processing step 3 Create two sub-hash buckets to store the two sets of hash codes respectively. Processing step 4 Update the hash prefix routing table and add routing information for the two child hash buckets. Processing step 5 Delete the routing information of the original target hash bucket Processing results The original hash bucket is split into two sub-hash buckets, which improves the cohesion of the feature vectors within each bucket. Table 3 details the triggering conditions and processing flow of the dynamic bucket splitting mechanism. When the average Hamming distance within the target hash bucket exceeds the preset bucket clustering threshold, it indicates that the feature vector distribution within the bucket is relatively dispersed and has low cohesion, which will affect retrieval efficiency. The dynamic bucket splitting mechanism splits the original hash bucket into two more cohesive sub-hash buckets through steps such as calculating the central hash code, generating a locality-sensitive hash function, creating sub-hash buckets, and updating the routing table, thereby improving the retrieval efficiency of the index structure.
[0073] In this embodiment, the feature dimensionality reduction component compresses the pure spatiotemporal feature vector with a dimension of 51200 into a 64-bit binary hash code. The inverted file index structure initially contains 1024 hash buckets, each with an initial hash prefix length of 10 bits. The preset bucket clustering threshold is set to 16, meaning that a dynamic bucket splitting mechanism is triggered when the average Hamming distance within the target hash bucket is greater than 16. The preset gradient error range of the retrieval analysis module is set to ±5%, meaning that when the difference in temporal spectral attenuation gradient features is within ±5%, a fixed defect label is directly assigned. The initial screening condition for the multi-granularity feature distance calculation strategy is set to a first cosine similarity greater than 0.8.
[0074] This embodiment employs an inverted file index structure that includes a feature dimensionality reduction component and a dynamic bucket splitting mechanism. Random projection dimensionality reduction compresses high-dimensional feature vectors into binary hash codes, reducing storage space usage. The dynamic bucket splitting mechanism maintains the cohesion of feature vectors within each bucket of the index tree, shortening the traversal path during feature retrieval. A multi-granularity feature distance calculation strategy first uses global contour feature vectors for initial screening, then uses local detail feature vectors for secondary sorting, reducing the frequency of cosine similarity calculations in the inverted linked list and minimizing computational resource consumption during data retrieval.
[0075] In a preferred embodiment, the data receiving module further includes a data preprocessing component to preprocess the received time-series spectral sequence and two-dimensional surface image. The data preprocessing component performs denoising on the time-series spectral sequence, employing a sliding window averaging filter algorithm to remove random noise from the spectral signal. The implementation process of the sliding window averaging filter algorithm is as follows: The window size is set to... For each data point in the time-series spectral sequence Take the front and back of each A window is formed by 10 data points, and the average value of all data points within the window is used as the filtered data point. :
[0076] The data preprocessing component performs grayscale conversion and histogram equalization on the 2D surface image. Grayscale conversion transforms the RGB color image into a grayscale image, reducing the number of image channels and lowering the computational complexity of subsequent processing. Histogram equalization adjusts the grayscale distribution of the image, enhancing image contrast and making bubble and edge texture features more prominent.
[0077] In a preferred embodiment, the feature extraction module further includes a feature normalization component to normalize the extracted temporal and spatial features. The feature normalization component employs the Z-score normalization method, converting each dimension of the feature vector into a standard normal distribution with a mean of 0 and a variance of 1. The mathematical formula for Z-score normalization is:
[0078] in, Represents the original feature values. This represents the mean of the feature dimension. The standard deviation of the feature dimension This represents the normalized eigenvalues.
[0079] Feature normalization eliminates the dimensional differences between different feature dimensions, improving the processing accuracy of subsequent cross-attention decoupling and retrieval analysis modules.
[0080] In a preferred embodiment, the retrieval and analysis module further includes a results visualization component to present the curing quality analysis results to the user in a visual manner. The results visualization component marks the location, type, and severity of curing defects on a two-dimensional surface image, generating a defect-annotated image. The results visualization component also generates a time-series spectral decay curve, displaying the spectral change trend during the UV adhesive curing process, and marking outliers on the curve. The results visualization component combines the defect-annotated image and the time-series spectral decay curve into a visualization report, which is then output to the user via a display device.
Claims
1. A UV adhesive detection data analysis system based on machine learning, characterized in that, It includes a data receiving module, a feature extraction module, a cross-attention decoupling module, an index building module, and a retrieval and analysis module; The data receiving module is used to receive the time-series spectral sequence and two-dimensional surface image during the UV adhesive curing process; The feature extraction module includes a temporal feature extraction branch and a spatial feature extraction branch. The temporal feature extraction branch extracts the spectral attenuation gradient features of the temporal spectral sequence based on a bidirectional long short-term memory network, while the spatial feature extraction branch extracts the bubble and edge texture features of the two-dimensional surface image based on a multi-scale convolutional neural network. The cross-attention decoupling module uses spatial features as query vectors and temporal features as key-value pairs to calculate the attention weight matrix. It strips out ambient light interference features that are greater than the preset weight threshold and splices the decoupled pure spatiotemporal feature vectors to generate a UV glue detection feature map. The index building module stores the UV glue detection feature map as the index key value into the inverted index tree; When the retrieval and analysis module receives the UV adhesive detection data to be analyzed, it extracts the pure spatiotemporal feature vector of the UV adhesive detection data to be analyzed and performs nearest neighbor search in the inverted index tree, and outputs the corresponding curing quality analysis results.
2. The UV adhesive detection data analysis system based on machine learning according to claim 1, characterized in that, The temporal feature extraction branch includes a forward propagation channel and a reverse propagation channel. The forward propagation channel processes the temporal spectral sequence in chronological order to capture the absorption spectrum change trend of the early curing reaction, while the reverse propagation channel processes the temporal spectral sequence in reverse chronological order to capture the dynamic characteristics of the later curing crosslinking state. The temporal feature extraction branch concatenates the hidden state output of the forward propagation channel and the hidden state output of the reverse propagation channel in the feature dimension to generate a temporal spectral attenuation gradient feature containing complete curing cycle information. The spatial feature extraction branch contains three convolutional kernels of different sizes set in parallel. The three convolutional kernels of different sizes perform convolution operations on the two-dimensional surface image to extract bubble features and edge texture features at the corresponding scale. The spatial feature extraction branch cascades and fuses the feature maps output by the three convolutional kernels of different sizes in the channel dimension to generate spatial features that fuse multi-scale spatial information.
3. The UV adhesive detection data analysis system based on machine learning according to claim 1, characterized in that, The cross-attention decoupling module includes a query vector mapping layer, a key vector mapping layer, a value vector mapping layer, and a weight calculation layer. The query vector mapping layer maps spatial features to a query matrix of the first dimension, while the key vector mapping layer and the value vector mapping layer map temporal features to key matrices and value matrices of the same first dimension, respectively. The weight calculation layer performs matrix multiplication on the transpose of the query matrix and the key matrix and introduces a scaling factor for normalization to generate the attention weight matrix. The cross-attention decoupling module sets the weight values in the attention weight matrix that are greater than the preset weight threshold to zero to generate a mask matrix. It then uses the mask matrix and the value matrix to perform element-wise multiplication to filter out the feature components in the value matrix that are related to illumination interference. The filtered value matrix is then used as the decoupled pure spatiotemporal feature vector.
4. The UV adhesive detection data analysis system based on machine learning according to claim 1, characterized in that, The index building module includes a feature dimensionality reduction component and an inverted file index structure. The feature dimensionality reduction component performs random projection dimensionality reduction on the decoupled pure spatiotemporal feature vectors, compressing the high-dimensional pure spatiotemporal feature vectors into fixed-length binary hash codes. The inverted file index structure contains multiple hash buckets, each corresponding to a set of binary hash codes with the same hash prefix. The feature dimensionality reduction component allocates the binary hash codes to the corresponding hash buckets according to the prefixes, and stores the mapping relationship between the original spatiotemporal feature vectors contained in the UV glue detection feature map and the binary hash codes in the inverted linked list corresponding to the hash bucket. The binary hash codes serve as the index keys of the inverted index tree.
5. The UV adhesive detection data analysis system based on machine learning according to claim 1, characterized in that, When the retrieval and analysis module receives the UV adhesive detection data to be analyzed, it calls the feature extraction module and the cross-attention decoupling module to process the UV adhesive detection data to be analyzed, and obtains the pure spatiotemporal feature vector to be analyzed. The retrieval and analysis module then converts the pure spatiotemporal feature vector to be analyzed into the binary hash code to be analyzed. The retrieval and analysis module calculates the Hamming distance between the binary hash code to be analyzed and the bucket number of each hash bucket in the inverted index tree, and selects the target hash bucket with the smallest Hamming distance. The retrieval and analysis module traverses the inverted linked list within the target hash bucket, calculates the cosine similarity between the pure spatiotemporal feature vector to be analyzed and the original spatiotemporal feature vector stored in the inverted linked list, and takes the original spatiotemporal feature vector with the largest cosine similarity as the nearest neighbor retrieval result.
6. The UV adhesive detection data analysis system based on machine learning according to claim 5, characterized in that, After obtaining the original spatiotemporal feature vector with the highest cosine similarity, the retrieval and analysis module extracts the curing defect labels of the historical UV adhesive detection samples corresponding to the original spatiotemporal feature vector. The retrieval and analysis module obtains the time-series spectral attenuation gradient features of the UV adhesive detection data to be analyzed, and determines whether the difference between the time-series spectral attenuation gradient features to be analyzed and the historical time-series spectral attenuation gradient features corresponding to the original spatiotemporal feature vector is within the preset gradient error range. If it is within the preset gradient error range, the retrieval and analysis module will directly assign the curing defect labels of the historical UV adhesive test samples to the UV adhesive test data to be analyzed in order to generate curing quality analysis results. If the error exceeds the preset gradient error range, the retrieval and analysis module will trigger a manual review instruction and output an early warning analysis result containing the gradient difference.
7. The UV adhesive detection data analysis system based on machine learning according to claim 2, characterized in that, The temporal feature extraction branch is equipped with an adaptive time step alignment component before the temporal spectral sequence is input into the bidirectional long short-term memory network; The adaptive time step alignment component reads the acquisition timestamp of the time-series spectral sequence and calculates the actual time interval between two adjacent spectral acquisition points based on the acquisition timestamp; When the actual time interval is not equal to the preset standard interval, the adaptive time step alignment component uses a cubic spline interpolation algorithm to generate virtual spectral data points at the missing time points corresponding to the actual time interval, and inserts the virtual spectral data points into the time-series spectral sequence.
8. The UV adhesive detection data analysis system based on machine learning according to claim 3, characterized in that, The cross-attention decoupling module has a frequency domain separation component before calculating the attention weight matrix; The frequency domain separation component performs discrete Fourier transforms on spatial features and temporal features respectively, transforming the spatial features and temporal features from the time domain to the frequency domain to obtain frequency domain spatial features and frequency domain temporal features; The frequency domain separation component extracts the low-frequency band component corresponding to the flicker frequency of the ambient light source from the frequency domain time sequence features, subtracts the low-frequency band component from the frequency domain time sequence features, and performs an inverse discrete Fourier transform on the frequency domain time sequence features after subtracting the low-frequency band component to restore the filtered time sequence features. The weight calculation layer uses the filtered temporal features to perform the mapping operation between the key matrix and the value matrix.
9. The UV adhesive detection data analysis system based on machine learning according to claim 4, characterized in that, The inverted file index structure has a dynamic bucket splitting mechanism; When the feature reduction component assigns the new binary hash code to the target hash bucket, the inverted file index structure calculates the average Hamming distance between the new binary hash code and the existing binary hash codes in the target hash bucket. When the average Hamming distance is greater than the preset bucket clustering threshold, the inverted file index structure triggers a dynamic bucket splitting mechanism. It uses a locality-sensitive hash function to re-divide the binary hash code in the target hash bucket, splitting the target hash bucket into two sub-hash buckets, and updating the hash prefix routing table recorded in the inverted file index structure so that the re-divided binary hash code is assigned to the inverted linked list of the corresponding sub-hash bucket.
10. The UV adhesive detection data analysis system based on machine learning according to claim 5, characterized in that, When calculating the cosine similarity between the pure spatiotemporal feature vector to be analyzed and the original spatiotemporal feature vector stored in the inverted linked list, the retrieval and analysis module adopts a multi-granularity feature distance calculation strategy. The retrieval and analysis module reduces the dimension of the pure spatiotemporal feature vector to be analyzed into a global contour feature vector and a local detail feature vector. The global contour feature vector is obtained by average pooling, and the local detail feature vector is obtained by max pooling. The retrieval and analysis module first calculates the first cosine similarity between the global contour feature vector of the pure spatiotemporal feature vector to be analyzed and the global contour feature vector of the original spatiotemporal feature vector. If the first cosine similarity meets the initial screening conditions, the second cosine similarity between the local detail feature vectors is then calculated to replace the cosine similarity as the final sorting criterion.