A neural network construction method for joint optimization of visual inspection and parameter control in screen printing machines

CN122242581BActive Publication Date: 2026-08-14FUJIAN FUQIANG PRECISION PRINTED CIRCUIT BOARD CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-04-28
Publication Date
2026-08-14

AI Technical Summary

Technical Problem

[0003]现有联合优化网络多采用特征晚期拼接、浅层交叉或全局注意力机制处理图像空间张量与工艺时序序列;丝印图像固有的周期性网纹噪声、复杂光照畸变与工艺参数的动态演化、相位跳变在数据分布上呈现强异构性;传统神经网络模型缺乏空间缺陷像素与多维工艺参数间的细粒度语义关联建模机制,难以实现跨模态特征的精准对齐与分布融合,导致特征交互过程中存在严重的信息损耗与模态分布偏移,制约了联合表征的判别纯度与泛化能力;

Benefits of technology

[0015]由上述本发明提供的技术方案可以看出,本发明提供的一种丝印机视觉检测与参数调控联合优化的神经网络构建方法,有益效果是:

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122242581B_ABST
    Figure CN122242581B_ABST
Patent Text Reader

Abstract

This invention relates to the field of neural network architecture design technology, and in particular to a neural network construction method for joint optimization of visual inspection and parameter control in screen printing machines. The method acquires time-synchronized images of screen-printed products and real-time process parameters of the screen printing machine, and completes standardized preprocessing. It constructs a dual-branch network for visual feature extraction and parameter encoding, respectively extracting spatial distribution features of printing defects and dynamic evolution features of process parameters. A spatial parameter cross-attention mechanism is used to achieve deep fusion of cross-modal features, generating a unified joint feature representation. A dual-head parallel prediction structure for defect detection and parameter control is designed, simultaneously outputting defect detection results and process parameter control increments. A multi-task joint loss function is constructed, and an adaptive task weight and gradient collaborative optimization strategy are introduced to achieve end-to-end joint training of the network. This invention achieves integrated closed-loop control of visual inspection and parameter control in screen printing machines, effectively improving defect recognition accuracy and parameter control response speed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of neural network architecture design technology, specifically to a method for constructing a neural network that combines visual inspection and parameter control optimization for screen printing machines. Background Technology

[0002] With the rapid development of industrial automation and intelligent manufacturing technologies, deep learning-based machine vision and process closed-loop control have been widely applied to the quality control of precision manufacturing equipment such as screen printing. Traditional screen printing machine quality control typically separates visual inspection and parameter adjustment, first using independent convolutional neural networks to identify and locate defects, then inputting the inspection results or manually extracted features into a control module based on a rule engine or independent regression model to generate process adjustment instructions. In recent years, some research has attempted to construct end-to-end multi-task neural networks to achieve joint optimization of vision and control. However, existing solutions still face significant technical bottlenecks in terms of neural network architecture, training algorithms, and control integration.

[0003] Existing joint optimization networks mostly employ late feature stitching, shallow crossover, or global attention mechanisms to process image spatial tensors and process time sequences. The inherent periodic mesh noise, complex illumination distortion, dynamic evolution of process parameters, and phase jumps in screen printing images exhibit strong heterogeneity in data distribution. Traditional neural network models lack fine-grained semantic association modeling mechanisms between spatial defect pixels and multi-dimensional process parameters, making it difficult to achieve accurate alignment and distribution fusion of cross-modal features. This results in severe information loss and modal distribution shift during feature interaction, which restricts the discriminative purity and generalization ability of joint representations.

[0004] Existing parameter control predictors typically use unconstrained fully connected layers to directly output continuous adjustment values, failing to embed the kinematic boundaries of the screen printing machine actuator, the multi-parameter coupling and mutual exclusion rules, and the integral drift characteristics in long-cycle control into the network forward propagation path in a differentiable form. This purely data-driven architecture violates the stringent requirements of industrial closed-loop control for output safety, boundary compliance, and long-term robustness. Under complex operating conditions, it is prone to generating out-of-bounds commands or accumulating control drift, posing potential equipment safety hazards, and the model decision-making process lacks engineering interpretability.

[0005] In pursuit of detection accuracy, existing high-precision multimodal networks often stack deep convolutions and dense attention modules, resulting in a large number of parameters and high redundancy in feature map computation. At the same time, the lack of gradient-sensitive lightweight decoding design for the blurred edge characteristics of industrial defects leads to high network inference latency and large memory consumption, making it difficult to meet the engineering requirements of screen printing production lines for millisecond-level response and deployment of low-computing-power edge computing devices, thus limiting the large-scale deployment of models in real-time closed-loop control.

[0006] In summary, existing technologies have significant shortcomings in cross-modal alignment architectures for neural networks, multi-task gradient collaborative optimization, physically constrained differentiable integration, and lightweight edge deployment. Therefore, there is an urgent need for a method focusing on the underlying construction and joint optimization mechanisms of neural networks. This method should fundamentally solve the technical challenges of feature fusion, training collaboration, secure control, and real-time inference in multimodal industrial neural networks by innovating fine-grained cross-modal fusion strategies, dynamic variance adaptive weight allocation, hard-limited regression at physical boundaries, and gradient-sensitive decoding topologies. This would enable high-precision and high-reliability joint optimization of visual inspection and parameter control in screen printing machines. Summary of the Invention

[0007] The purpose of this invention is to provide a neural network construction method for joint optimization of visual inspection and parameter control in screen printing machines, so as to solve the problems mentioned in the background art.

[0008] To achieve the above objectives, the present invention provides the following technical solution:

[0009] A method for constructing a neural network for joint optimization of visual inspection and parameter control in a screen printing machine includes the following steps:

[0010] S1. Acquire the screen printing product image data and screen printing machine real-time process parameter data collected synchronously. Perform noise reduction, size normalization and time window alignment preprocessing on the image data to obtain the standardized image tensor and the aligned process parameter sequence.

[0011] S2. Input the standardized image tensor into the visual feature extraction branch, and after multi-scale convolution and spatial attention processing, extract the spatial distribution features of printing defects and output the defect feature map; input the aligned process parameter sequence into the parameter encoding branch, and after temporal convolution and positional encoding processing, extract the dynamic evolution features of the process parameters and output the parameter temporal encoding vector.

[0012] S3. Input the defect feature map and the parameter temporal coding vector into the cross-modal fusion module. Through the spatial-parameter cross-attention mechanism, calculate the correlation weight matrix between the spatial location of the defect and the dimension of the process parameters. Perform cross-modal mask weighting on the defect feature map, and perform feature concatenation and dimensionality reduction projection with the parameter temporal coding vector to output the joint feature representation.

[0013] S4. Input the joint feature representation into the defect detection head and the parameter control prediction head in parallel; the defect detection head outputs the defect category probability and defect location mask through the decoder; the parameter control prediction head outputs the control increment vector relative to the parameter at the last moment in the aligned process parameter sequence through the regression layer.

[0014] S5. Construct a joint loss function, which includes a defect classification and localization loss term, a parameter regulation regression loss term, and a cross-modal feature distribution alignment constraint term. Adaptive task weight coefficients based on training dynamic variance are also introduced. Based on the joint loss function, a gradient collaborative optimization strategy is used to perform end-to-end joint training on the visual feature extraction branch, parameter encoding branch, cross-modal fusion module, defect detection head, and parameter regulation prediction head until the loss function converges, resulting in a jointly optimized neural network model for screen printing machine visual detection and parameter regulation.

[0015] As can be seen from the technical solution provided by the present invention above, the neural network construction method for joint optimization of visual inspection and parameter control in screen printing machines provided by the present invention has the following beneficial effects:

[0016] This invention constructs a parallel extraction architecture for visual spatial branches and process parameter temporal branches. By introducing dual-response spatial attention with frequency domain texture suppression, process phase-aware position encoding, and adaptive gated temporal pooling, it effectively overcomes the representation bottleneck of traditional CNN / RNN in terms of periodic background noise interference and long-term dynamic dependency modeling. Combining spatial-parameter cross-attention mechanism and cross-modal mask weighted projection, it realizes fine-grained correlation mapping between defect pixel-level spatial location and multi-dimensional weighted process parameters, significantly reducing intermodal distribution differences and information loss, and enabling a substantial leap in the cross-modal feature alignment accuracy and representation purity of neural networks under complex working conditions.

[0017] This invention abandons the fixed-ratio multi-task loss design and pioneers an adaptive task weight allocation strategy based on the dynamic inverse of the variance of the training sliding window. During end-to-end joint training, this mechanism quantifies the optimization uncertainty of defect detection, parameter tuning, and cross-modal distribution alignment tasks in real time, and dynamically adjusts the gradient contribution ratio of each task. In conjunction with the gradient orthogonal projection pruning unit, it accurately calculates and filters out the orthogonal conflict components of the update directions of the visual modality and the parameter modality, and generates a gradient collaborative update vector. This strategy fundamentally avoids the "gradient cancellation" or "single task dominance" phenomenon commonly found in traditional multi-task networks, significantly accelerates the convergence trajectory of the joint loss, and improves the generalization stability of the model under multi-objective trade-offs.

[0018] This invention innovatively constructs a physical constraint regression layer in the parameter control prediction head, directly embedding the equipment kinematic boundary and multi-parameter coupling and mutual exclusion rules into the network forward propagation path in the form of a differentiable hard-limited activation function, and introducing an integral anti-saturation compensation mechanism for historical control residuals. This architecture makes the continuous regression output of the neural network naturally constrained by the physical safety operating domain, eliminating the out-of-bounds instructions and cumulative drift problems that are prone to occur in pure data-driven models. Through the closed-loop design of "learnable feature mapping + hard physical constraint truncation + soft integral compensation", the output safety, interpretability and long-term control robustness of industrial neural networks in closed-loop control scenarios are greatly enhanced.

[0019] The defect detection head employs a multi-scale pyramid decoder combined with gradient-sensitive boundary enhancement convolution. Through parallel fusion of Sobel gradient kernels and adaptive dynamic threshold morphological filtering, it achieves pixel-level defect edge sharpening and localization with extremely low computational overhead. The entire network incorporates lightweight designs such as residual gating interaction, hard channel decoupling, and nonlinear dimensionality reduction projection, effectively compressing redundant parameters and reducing the computational complexity of feature maps. Finally, a standardized serialized model is output after topological encapsulation, offering the advantage of plug-and-play engineering deployment. Attached Figure Description

[0020] Figure 1 This is a schematic diagram of the steps in constructing a neural network for the joint optimization of visual inspection and parameter control in a screen printing machine according to the present invention. Detailed Implementation

[0021] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0022] To better understand the above technical solutions, the following will provide a detailed explanation of the technical solutions in conjunction with the accompanying drawings and specific embodiments.

[0023] like Figure 1 As shown, this embodiment of the invention provides a neural network construction method for joint optimization of visual detection and parameter control in screen printing machines, including the following steps:

[0024] S1. Acquire the screen printing product image data and screen printing machine real-time process parameter data collected synchronously. Perform noise reduction, size normalization and time window alignment preprocessing on the image data to obtain the standardized image tensor and the aligned process parameter sequence.

[0025] S2. Input the standardized image tensor into the visual feature extraction branch, and after multi-scale convolution and spatial attention processing, extract the spatial distribution features of printing defects and output the defect feature map; input the aligned process parameter sequence into the parameter encoding branch, and after temporal convolution and positional encoding processing, extract the dynamic evolution features of the process parameters and output the parameter temporal encoding vector.

[0026] S3. Input the defect feature map and the parameter temporal coding vector into the cross-modal fusion module. Through the spatial-parameter cross-attention mechanism, calculate the correlation weight matrix between the spatial location of the defect and the dimension of the process parameters. Perform cross-modal mask weighting on the defect feature map, and perform feature concatenation and dimensionality reduction projection with the parameter temporal coding vector to output the joint feature representation.

[0027] S4. Input the joint feature representation into the defect detection head and the parameter control prediction head in parallel; the defect detection head outputs the defect category probability and defect location mask through the decoder; the parameter control prediction head outputs the control increment vector relative to the parameter at the last moment in the aligned process parameter sequence through the regression layer.

[0028] S5. Construct a joint loss function, which includes a defect classification and localization loss term, a parameter regulation regression loss term, and a cross-modal feature distribution alignment constraint term. Adaptive task weight coefficients based on training dynamic variance are also introduced. Based on the joint loss function, a gradient collaborative optimization strategy is used to perform end-to-end joint training on the visual feature extraction branch, parameter encoding branch, cross-modal fusion module, defect detection head, and parameter regulation prediction head until the loss function converges, resulting in a jointly optimized neural network model for screen printing machine visual detection and parameter regulation.

[0029] In this embodiment, the core function of step S1 is to achieve high-precision time-synchronous acquisition and multi-dimensional standardized preprocessing of screen-printed product image data and real-time process parameter data of the screen-printing machine, eliminating noise interference, time asynchrony issues, and dimensional differences in the original data, and providing input data with uniform format and reliable quality for subsequent feature extraction and cross-modal fusion of neural networks; the detailed steps are as follows:

[0030] S1-1: High-precision time synchronization data acquisition and global timestamp binding:

[0031] A high-precision real-time clock module is used as a unified time source, with timestamp accuracy reaching the microsecond level. The screen printing machine control system outputs a hardware trigger pulse at the moment the screen is demolded, and this pulse is simultaneously sent to the industrial camera and the multi-channel data acquisition card to achieve hardware-level synchronization of image acquisition and process parameter acquisition.

[0032] At least 1,000 complete production cycles of raw data were continuously collected. The raw screen printing image frames were acquired by an industrial camera in a line-by-line scanning manner. The raw process parameter sampling sequence included six core process dimensions: squeegee pressure, squeegee speed, screen release height, printing gap, ink temperature, and squeegee stroke.

[0033] Bind a unified global timestamp to each frame in the original screen printing image frame and each sampling data point in the original process parameter sampling sequence, associate the image frame corresponding to the same trigger time with the process parameter sampling point, and output the original data pair with timestamp;

[0034] S1-2: Adaptive Region-Aware Image Denoising Processing

[0035] The original silkscreen image frame is converted into a grayscale image. A 3×3 sliding window is used to traverse all pixels of the image and calculate the grayscale gradient magnitude of each pixel and its neighboring pixels.

[0036] The Otsu method is used to automatically calculate the global optimal gradient threshold. Based on this threshold, the image is dynamically segmented into a low-gradient screen printing substrate uniform light region and a high-gradient printing ink pattern region.

[0037] Nonlocal mean filtering is performed on the two regions respectively. The uniform light region is configured with an 11×11 search window and a 3×3 filter kernel, while the ink pattern region is configured with a 5×5 search window and a 5×5 filter kernel. The differentiated filtering parameter configuration can effectively remove Gaussian noise in the uniform light region while fully preserving the edge details and texture features of the ink pattern, and output a denoised image frame.

[0038] S1-3: Image region of interest cropping and size normalization:

[0039] The screen printing machine's worktable and industrial camera are pre-calibrated using a high-precision calibration plate to determine the pixel coordinates of the upper left and lower right corners of the effective area of ​​the standard screen printing stencil.

[0040] Using this coordinate as a reference, region of interest cropping is performed on the denoised image frame to remove irrelevant background areas containing workbench edges and equipment brackets;

[0041] The cropped image is mapped to a fixed spatial resolution of 512×512 using a bicubic interpolation algorithm. This algorithm achieves image scaling by calculating the weighted average of 16 neighboring pixels, which can preserve the high-frequency edge information of the image to the greatest extent.

[0042] Calculate the horizontal and vertical gradient maps of the scaled image separately, and then stitch the original RGB three-channel image with the horizontal and vertical gradient channels along the channel dimensions to form a five-channel standardized image tensor.

[0043] S1-4: Construction of Asymmetric Causal Time Windows and Extraction of Parameter Subsequences

[0044] Extract the global timestamp corresponding to the standardized image tensor as the visual acquisition reference time;

[0045] Based on the screen printing machine model and preset process parameters, the squeegee downward process response time span is set to 1.5 seconds, and the ink layer leveling stabilization time span is set to 2 seconds; with the visual acquisition reference time as the center, an asymmetric causal time window is constructed by tracing back 1.5 seconds and extending backward 2 seconds.

[0046] The asymmetric design of this time window ensures that the extracted sequence of process parameters completely includes all historical process processes that led to the current printing defect, while excluding subsequent irrelevant process parameter data.

[0047] Iterate through all the original data pairs with timestamps and extract the process parameter sampling data that falls within the asymmetric causal time window as the parameter subsequence to be aligned;

[0048] S1-5: Temporal Hole Detection and Physical Boundary Limiting Interpolation Filling:

[0049] Set the tolerance threshold for the device's nominal sampling period to 1.5 times the nominal sampling period; traverse all adjacent sampling points in the parameter subsequence to be aligned and calculate the time interval between adjacent sampling points;

[0050] When the time interval of a certain interval is greater than the tolerance threshold, it is determined that there is a time hole in that interval;

[0051] A third-order piecewise polynomial interpolation algorithm is used to fill in the gaps in the data, while introducing upper and lower limits of the historical change rate of the process parameter. This constraint is obtained by statistically analyzing the maximum and minimum change rates of the process parameter over the past 100 production cycles.

[0052] If the interpolation result exceeds the historical maximum or minimum value of the process parameter, it is truncated to the corresponding boundary value to avoid generating false data that does not conform to physical laws, and finally a continuous time series parameter sequence is obtained.

[0053] S1-6: Dynamic normalization of process parameter sequences and time-aligned packaging:

[0054] Sliding window extreme value normalization and dynamic zero-mean normalization were independently performed on the six process parameter dimensions in the continuous time series parameter sequence; the sliding window size was set to 100 sampling points, and the statistics were updated in real time as the window slid over time; the sliding window extreme value normalization was calculated as follows: ,in, For a certain process parameter dimension, the first The extreme value normalized value of each sampling point For the first in this dimension The original values ​​of each sampling point This represents the maximum value of this process parameter dimension within the sliding window. This represents the minimum value of this process parameter dimension within the sliding window;

[0055] Dynamic zero-mean calculation is as follows: ,in, For a certain process parameter dimension, the first Zero-mean value of each sampling point This is the arithmetic mean of the normalized extreme values ​​of all sampling points within the sliding window for this process parameter dimension.

[0056] The above processing can effectively eliminate baseline drift caused by long-term operation of the sensor and ensure the consistency of statistical characteristics of data from different batches;

[0057] The six normalized process parameter sequences are arranged in chronological order to form a parameter matrix of dimension 100×6. This parameter matrix and the corresponding normalized image tensor are packaged into a multimodal data sample. All samples are arranged in chronological order of production time to generate a process parameter sequence that is strictly time-aligned with the normalized image tensor.

[0058] In this embodiment, the core function of step S2 is to construct a dual-branch parallel architecture for visual feature extraction and parameter encoding. This architecture extracts multi-scale spatial distribution features of printing defects from the standardized image tensor and extracts dynamic evolution features of parameters fused with process phase information from the aligned process parameter sequence, providing high-quality single-modal feature representations for subsequent cross-modal fusion and joint prediction. The detailed steps are as follows:

[0059] S2-1: Visual Feature Extraction Branch: Multi-scale Feature Extraction and Spatial Attention Enhancement

[0060] S2-1-1: Multi-scale parallel convolutional feature extraction:

[0061] Normalized image tensors are fed in parallel into shallow detail convolutional pathways, mid-layer texture convolutional pathways, and deep topography convolutional pathways. Each pathway employs independent parameter configurations to capture defect features at different scales. The shallow detail convolutional pathway uses a 3×3 kernel with a dilation factor of 1, stacking three convolutional layers to capture micron-level edge burrs and pinhole defects. The mid-layer texture convolutional pathway uses a 5×5 kernel with a dilation factor of 2, stacking four convolutional layers to capture local ink buildup and missing print defects. The deep topography convolutional pathway uses a 7×7 kernel with a dilation factor of 4, stacking five convolutional layers to capture macroscopic overprinting misalignment and large-area ink shortage defects. Each convolutional layer is followed by a batch normalization layer and a linear rectified activation function. Residual connections are added within each pathway to mitigate the gradient vanishing problem in deep networks. The three pathways output shallow, mid, and deep feature sub-maps, respectively.

[0062] S2-1-2: Cross-scale feature aggregation and basic spatial response calculation:

[0063] Shallow, mid-level, and deep feature sub-maps are concatenated along the channel dimension to construct a multi-scale aggregated feature tensor. This multi-scale aggregated feature tensor is then input into a dual response space attention module. First, global average pooling and global max pooling are performed on the multi-scale aggregated feature tensor to obtain two one-dimensional feature vectors. These two one-dimensional feature vectors are then input into a two-layer pointwise convolutional network with shared weights for dimensionality reduction. The first convolutional layer compresses the number of channels to one-sixteenth of the original number, and the second convolutional layer restores the number of channels to the original number. Finally, the two dimensionality-reduced feature vectors are added element-wise to generate the basic spatial response map.

[0064] S2-1-3: Reticulated Periodic Noise Suppression and Attention Weighting:

[0065] By introducing prior constraints on the periodic texture of the screen printing stencil, a Fast Fourier Transform (FFT) is performed on the multi-scale aggregated feature tensor to convert the spatial domain features into frequency domain features. In the frequency domain, frequency components that coincide with the fundamental frequency and second harmonic of the screen printing stencil grid are identified, and the amplitudes of these components are set to zero. An Inverse Fast Fourier Transform (IFFT) is performed on the processed frequency domain features to reconstruct the texture suppression mask. The basic spatial response map is multiplied element-wise with the texture suppression mask to obtain the defect-sensitive attention weight matrix. The defect-sensitive attention weight matrix is ​​then multiplied by the multi-scale aggregated feature tensor through channel-wise spatial broadcasting to enhance the feature response of the defect region while suppressing the periodic texture background noise, and an attention-weighted feature tensor is output.

[0066] S2-1-4: Feature Refinement and Defect Feature Map Generation

[0067] The attention-weighted feature tensor is input into the feature refinement residual block. The feature refinement residual block first compresses channel redundancy through 1×1 pointwise convolution, reducing the number of channels to half of the original number. Then, it performs feature transformation through 3×3 convolution, and then restores the number of channels to the original number through 1×1 pointwise convolution. The transformed features are superimposed with the input attention-weighted feature tensor by an identity mapping. After processing by a linear rectified activation function, the output is a defect feature map that characterizes the spatial distribution and significance of printing defects.

[0068] S2-2: Temporal Feature Extraction of Parametric Encoding Branch and Process Phase Enhancement:

[0069] S2-2-1: Causal dilation temporal convolution feature extraction:

[0070] The aligned process parameter sequence is reshaped into a multi-dimensional parameter temporal matrix and input into a causal dilated temporal convolutional network. The causal dilated temporal convolutional network consists of four stacked one-dimensional causal convolutional layers. Each layer uses non-zero padding on the left to ensure that the features at the current moment depend only on historical process parameter data and avoid introducing future information. The dilation coefficient of each layer increases geometrically, in the order of 1, 2, 4, and 8, expanding the temporal receptive field layer by layer to capture parameter evolution features at different time scales. Each causal convolutional layer is followed by a batch normalization layer and a linear rectified activation function, and residual connections are added. After convolution and stacking residual connections layer by layer, the temporal evolution feature sequence is output.

[0071] S2-2-2: Time-series feature normalization and process phase coding:

[0072] A layer normalization operation is performed on the time-series evolution feature sequence to eliminate dimensional differences and batch statistical biases in multi-source sensor data, resulting in a stationary time-series feature sequence. A process phase sensing position encoding module is constructed, which maps the time step index of the stationary time-series feature sequence to four process phase states based on the standard working cycle of the screen printing machine: the squeegee descent pressure period, the screen contact printing period, the screen demolding springback period, and the squeegee reset idle stroke period. A discrete phase vector in one-hot encoded form is generated for each process phase state, and the discrete phase vector is mapped to a continuous phase position encoding tensor with the same dimension as the stationary time-series feature sequence through a learnable linear embedding layer.

[0073] S2-2-3: Phase Feature Fusion and Adaptive Gated Temporal Pooling:

[0074] The stationary temporal feature sequence is element-wise added to the continuous phase position encoding tensor to achieve feature fusion of absolute time step information and relative process phase information, resulting in a phase-enhanced temporal tensor. This phase-enhanced temporal tensor is then input into an adaptive gated temporal pooling layer. The adaptive gated temporal pooling layer first passes through a fully connected layer and a sigmoid activation function to generate an importance score between 0 and 1 for each time step. The importance score is calculated as follows: ,in, For the first The importance score of each time step It is the sigmoid activation function. This is the weight matrix of the fully connected layer. For the first Phase enhancement feature vectors at each time step, This is the bias vector for the fully connected layer;

[0075] The phase-enhanced time series tensor is weighted and aggregated by multiplying the features of each time step with the corresponding importance score element by element. This process can automatically filter out the features of the steady-state redundant period of the process and highlight the key information of the transient jump of parameters.

[0076] S2-2-4: Generation of parameter timing coding vectors:

[0077] The weighted aggregated temporal features are input into a two-layer fully connected network for dimensionality reduction mapping. The first fully connected layer compresses the feature dimension to half of the original dimension, and after processing by a linear rectified activation function, it is input into the second fully connected layer. The second fully connected layer maps the feature dimension to a preset fixed dimension, and finally outputs a parameter temporal encoding vector.

[0078] In this embodiment, the core function of step S3 is to achieve deep interactive fusion of visual modal defect spatial features and parametric modal temporal evolution features. A quantitative correlation between the spatial location of defects and the dimensions of process parameters is established through a spatial parameter cross-attention mechanism. The defect features are then weighted and enhanced for modal perception. Finally, through feature splicing and nonlinear dimensionality reduction distillation, a unified joint feature representation containing both defect spatial information and process dynamic information is generated, providing high-quality multimodal feature input for subsequent parallel defect detection and parameter control prediction. The detailed steps are as follows:

[0079] S3-1: Construction of Spatial Query Tensor and Parameter Key-Value Sequence:

[0080] The defect feature map is flattened along the spatial dimension into a sequence of spatial location features; the dimension of the defect feature map is... ;in, The height of the feature map; The width of the feature map; The number of feature map channels; the flattening operation will flatten each spatial location. The feature vectors are arranged in row-major order; the generated dimension is... The spatial location feature sequence; where, equal and The product; each element corresponds to a multi-channel feature vector at a unique spatial location in the defect feature map;

[0081] The parameter temporal encoding vector is mapped to a parameter-dimensional feature sequence through a learnable linear projection layer; the dimension of the parameter temporal encoding vector is... The dimension of the weight matrix of the linear projection layer is The bias vector dimension is ;in, The preset feature dimension; the generated dimension after mapping is The intermediate feature vector; reshape the intermediate feature vector into The parameter dimension feature sequence; where, This represents the number of dimensions for the process parameters; each element corresponds to one process parameter dimension. 3D feature vector;

[0082] The spatial location feature sequence is used as the spatial query tensor of the spatial parameter cross-attention mechanism; the parameter dimension feature sequence is used as both the parameter key sequence and the parameter value sequence of the spatial parameter cross-attention mechanism; the spatial query tensor dimension is... The dimension of the parameter key sequence is The parameter value sequence has a dimension of The three features must maintain consistent dimensions to ensure dimensional matching in subsequent dot product similarity calculations.

[0083] S3-2: Calculation of Spatial Parameter Correlation Weight Matrix:

[0084] The element-wise similarity matrix is ​​calculated based on the spatial query tensor and the parameter key sequence; the similarity matrix is ​​calculated using the dot product similarity algorithm; the formula is as follows: ,in, This is an element-wise similarity matrix; For spatial query tensors; For parameter key sequence;

[0085] A learnable temperature coefficient is introduced to scale the similarity matrix; this scaling operation alleviates the gradient vanishing problem of the soft maximization function caused by excessively large dot product values ​​when the feature dimension is high; the scaled similarity matrix is ​​as follows: ,in, This is the scaled similarity matrix; The feature dimension of the parameter key sequence;

[0086] Perform soft-maximization normalization along the row direction on the scaled similarity matrix; generate a dimension of The correlation weight matrix; the soft maximization function is calculated independently for each row; such that the sum of all elements in each row is 1; the first row of the correlation weight matrix... Line 1 Column elements represent the first The defect spatial pixel and the first The coupling strength between various process parameters; the larger the value, the stronger the correlation between them.

[0087] S3-3: Cross-modal mask weighting and defect feature enhancement:

[0088] The correlation weight matrix is ​​reshaped into a two-dimensional spatial mask tensor according to the original spatial topology of the defect feature map; the reshaping operation will convert the length of the mask tensor into a two-dimensional spatial mask tensor. Each row vector is rearranged as OK A two-dimensional matrix of columns; generating dimension is A two-dimensional spatial mask tensor; the value at each spatial location is the weighted sum of the coupling strength between that location and all process parameter dimensions;

[0089] Perform a channel-by-channel, pixel-by-pixel cross-modal mask weighting operation on the defect feature map; the operation process involves performing element-wise multiplication of the two-dimensional spatial mask tensor with each channel of the defect feature map; for the ... The first channel Line 1 The column element; its weighted value is equal to the original value multiplied by the number of elements in the two-dimensional mask tensor. Line 1 The column values; this operation can automatically amplify the defect response region that is strongly correlated with high-weight process parameters; at the same time, it suppresses background noise regions that are unrelated to process parameters; after the operation, the output dimension remains the same. Cross-modal mask weighted feature map;

[0090] S3-4: Multimodal Feature Concatenation and Tensor Construction:

[0091] A global adaptive average pooling operation is performed on the cross-modal masked weighted feature map; the global adaptive average pooling operation is performed on each channel. The arithmetic mean of all elements in the 2D feature map is calculated independently; the 2D feature map of each channel is compressed into a scalar value; the global saliency response of each channel is aggregated; after the pooling operation, a dimension of is generated. Spatial aggregated feature vectors;

[0092] The spatial aggregation feature vector and the parameter temporal encoding vector are concatenated end-to-end along the feature dimension; the concatenation operation joins the two one-dimensional vectors sequentially to generate a vector with dimension [missing information]. The multimodal splicing tensor contains both cross-modal enhanced visual spatial features and the original parametric temporal evolution features, preserving complete information from both modalities.

[0093] S3-5: Output of Nonlinear Dimensionality Reduction Projection and Joint Feature Representation:

[0094] The multimodal stitching tensor is input into the nonlinear dimension reduction projection module; the nonlinear dimension reduction projection module consists of three layers of fully connected networks and two residual gated units stacked alternately; the module input dimension is... The output dimension is a preset fixed dimension. ;

[0095] The first fully connected layer compresses the dimension of the multimodal splicing tensor to two-thirds of the original dimension, resulting in an output dimension of... The first residual gating unit performs a nonlinear transformation and identity mapping on the compressed features. The residual gating unit contains two fully connected layers and a sigmoid gating function. The first fully connected layer maps the feature dimension to half of the original dimension. After processing with a linear rectified activation function, the second fully connected layer restores the dimension to its original value. The sigmoid gating function generates gating coefficients between 0 and 1. The transformed features are weighted and finally superimposed with the input features using an identity mapping to enhance the expressive power of the features.

[0096] The second fully connected layer further compresses the feature dimension to half of the original dimension, resulting in an output dimension of... The second residual gating unit performs the exact same operation as the first residual gating unit, further enhancing the interaction capability of cross-modal features.

[0097] The third fully connected layer maps the feature dimensions to a pre-defined fixed dimension. The final joint feature representation is output. The nonlinear dimensionality reduction projection module realizes deep interaction and information distillation of cross-modal features through multi-layer feature transformation and residual gating mechanism; eliminates the feature distribution difference between visual modality and parametric modality; compresses feature dimension; reduces subsequent computational complexity; the joint feature representation contains both spatial distribution information of printing defects and dynamic evolution information of process parameters; it can be directly input into subsequent defect detection head and parameter control prediction head for parallel prediction.

[0098] In this embodiment, the core function of step S4 is to decouple the unified joint feature representation into two independent branches: spatial defect features and parameter evolution features. These branches are then input into the defect detection head and the parameter control prediction head, respectively, to perform parallel prediction. The defect detection head achieves high-precision defect category recognition and pixel-level localization through multi-scale decoding boundary enhancement and semantic segmentation techniques. The parameter control prediction head generates process parameter control increments that conform to the equipment operating boundaries through temporal state reasoning and physical constraint regression. Finally, the defect detection results and parameter control instructions are output simultaneously, realizing integrated closed-loop control of screen printing machine visual inspection and parameter control. The detailed steps are as follows:

[0099] S4-1: Joint feature representation channel decoupling:

[0100] The joint feature representation is decoupled and segmented along the channel dimension; the dimension of the joint feature representation is... The decoupling operation is performed according to the preset channel allocation ratio; the channel allocation ratio is set according to the complexity of the defect detection task and the parameter control task; the default ratio is 7:3; that is, the first... Each channel is divided into a spatial defect feature subtensor; the remaining... Each channel is divided into parameter evolution feature vectors; satisfying ;in The number of channels of the spatial defect feature subtensor; The dimension of the feature vectors evolves as parameters;

[0101] The spatial defect feature subtensor mainly carries the spatial distribution morphology, texture, and saliency features of printing defects; the parameter evolution feature subvector mainly carries the historical change trend, current steady-state level, and multi-parameter coupling relationship features of process parameters; the decoupling process adopts a hard segmentation method; no additional learnable parameters are introduced; the feature inputs of the two branches are guaranteed not to interfere with each other; at the same time, the correlation information between defects and process parameters established in the cross-modal fusion stage is fully preserved;

[0102] S4-2: Multi-scale pyramid decoding and high-resolution defect reconstruction:

[0103] The spatial defect feature sub-tensor is input into the multi-scale pyramid decoder of the defect detection head. The multi-scale pyramid decoder adopts a bottom-up, step-by-step upsampling and cross-layer skip connection structure. It contains three upsampling units. The structure of each upsampling unit is exactly the same, consisting of two bilinear interpolation upsampling layers. A convolutional layer consists of a batch normalization layer and a linear rectified activation function layer stacked sequentially.

[0104] The first upsampling unit doubles the spatial resolution of the spatial defect feature subtensor. After upsampling, the output feature map is concatenated with the output feature map of the deep morphology convolution path in the visual feature extraction branch along the channel dimension. The number of channels in the concatenated feature map is the sum of the number of channels in both layers. After two... The convolutional layer performs feature transformation and normalized activation processing to generate the first-level decoded feature map. The second-level upsampling unit doubles the spatial resolution of the first-level decoded feature map. The output feature map is then concatenated with the output feature map of the mid-layer texture convolutional path in the visual feature extraction branch along the channel dimension. After the same convolutional transformation and normalized activation processing, the second-level decoded feature map is generated.

[0105] The third-layer upsampling unit increases the spatial resolution of the second-level decoded feature map to match the input normalized image tensor; it concatenates the output feature map with the output feature map of the shallow detail convolution path in the visual feature extraction branch, and performs the same convolution transformation and normalized activation processing to generate a high-resolution defect reconstruction feature map. The spatial resolution of the high-resolution defect reconstruction feature map is 512×512, and the number of channels is 64. Cross-layer feature skip connections can effectively fuse deep semantic features and shallow detail features, compensate for the spatial edge information lost during upsampling, and improve the accuracy of defect localization.

[0106] S4-3: Gradient-sensitive boundary enhancement convolution processing:

[0107] The high-resolution defect reconstruction feature map is input into the gradient-sensitive boundary enhancement convolutional layer; the gradient-sensitive boundary enhancement convolutional layer consists of two parallel gradient calculation branches and one feature fusion branch;

[0108] The first branch is the horizontal gradient calculation branch; using The Sobel horizontal gradient kernel performs the convolution operation; the numerical distribution of the horizontal gradient kernel is as follows: This convolutional kernel can enhance the response to horizontal gray-level abrupt changes in the feature map; it outputs a horizontal gradient feature map.

[0109] The second branch is the vertical gradient calculation branch; using The Sobel vertical gradient kernel performs the convolution operation; the numerical distribution of the vertical gradient kernel is as follows: This convolutional kernel can enhance the vertical gray-level abrupt response in the feature map; it outputs a vertical gradient feature map.

[0110] The horizontal gradient feature map and the vertical gradient feature map are added element-wise to generate a comprehensive gradient feature map. The comprehensive gradient feature map is then added element-wise to the original high-resolution defect reconstruction feature map to generate a boundary sharpening feature map. The dimension of the boundary sharpening feature map is exactly the same as that of the high-resolution defect reconstruction feature map. This operation can significantly improve the gradient contrast between defect edges and internal textures, solve the problem of insufficient positioning accuracy caused by the smooth transition of blurred edges of printing defects, and at the same time preserve the overall semantic information of the defect area.

[0111] S4-4: Defect Category Probability Calculation and Binarized Location Mask Generation:

[0112] The boundary sharpening feature map is fed into the category determination branch and the mask generation branch in parallel; the two branches share the input of the boundary sharpening feature map; and the calculation process is performed independently.

[0113] The category determination branch first performs a global average pooling operation on the boundary sharpening feature map. The global average pooling operation independently calculates the arithmetic mean of all elements in the 512×512 two-dimensional feature map for each channel. This compresses the two-dimensional feature map into a one-dimensional global feature vector with a dimension of 64. The global feature vector is then input into a two-layer multilayer perceptron. The first layer of the multilayer perceptron compresses the feature dimension from 64 to 32. After processing with a linear rectified activation function, the second layer of the multilayer perceptron maps the feature dimension from 32 to a preset number of defect categories. The preset defect categories include six types: edge burrs, ink accumulation, misprints, misregistration, pinholes, and ink shortages. Unnormalized confidence scores for each defect category are generated. Soft maximization normalization is performed on the unnormalized confidence scores. Finally, the defect category probability is output. The defect category probability is a 6-dimensional one-dimensional vector, with each element corresponding to the probability of occurrence of a preset defect category. The sum of all elements is 1.

[0114] The mask generation branch performs pixel-wise semantic segmentation on the boundary sharpening feature map; firstly, a 1×1 pointwise convolution is used to map the number of channels in the feature map from 64 to 1; a continuous defect foreground response field is generated; the spatial resolution of the defect foreground response field is 512×512; the numerical range of each pixel is 0 to 1; representing the probability that the pixel belongs to the defect region;

[0115] Adaptive dynamic thresholding is performed on the defect foreground response field; the formula for calculating the adaptive dynamic threshold is as follows: ,in, For adaptive dynamic thresholds; The global mean of all pixel values ​​in the defective foreground response field; The global standard deviation of all pixel values ​​in the defective foreground response field; This is a preset coefficient; the default value is 1.5.

[0116] The value in the defect foreground response field is greater than the threshold. Pixels marked as defective pixels; assigned a value of 1; less than or equal to the threshold. The pixels are marked as background pixels; the value is assigned to 0; an initial binary mask is generated;

[0117] A morphological opening operation is performed on the initial binary mask. The morphological opening operation first performs a 3×3 erosion operation, then a 3×3 dilation operation to remove isolated noise points with small areas in the initial mask. Then, a morphological closing operation is performed. The morphological closing operation first performs a 3×3 dilation operation, then a 3×3 erosion operation to fill small holes inside the defect area.

[0118] Finally, a connected component filtering operation is performed; all connected components in the binarized mask are traversed; the pixel area of ​​each connected component is calculated; connected components with an area less than 10 pixels are removed; internal holes with an area less than 50 pixels are filled; finally, a binarized defect location mask is generated; the defect location mask has the same spatial resolution as the input normalized image tensor.

[0119] S4-5: Extraction of process dynamic evolution trend and construction of joint vector of current process state:

[0120] The temporal state inference network of the prediction head is controlled by inputting the parameter evolution feature vector. The temporal state inference network consists of two stacked gated temporal units. The hidden layer dimension of each gated temporal unit is set to 128. The gated temporal units effectively capture long temporal dependencies and avoid gradient vanishing and gradient exploding problems through the synergistic effect of input gate, forget gate and output gate.

[0121] The first-layer gated timing unit maps the parameter evolution feature sub-vectors to a first-level hidden state sequence. The length of the first-level hidden state sequence is consistent with the time step length of the aligned process parameter sequence, i.e., 100 time steps. The dimension of the hidden state vector at each time step is 128. The second-layer gated timing unit further extracts the temporal features from the first-level hidden state sequence and outputs a second-level hidden state sequence. The length of the second-level hidden state sequence is still 100, and the dimension of the hidden state vector at each time step is still 128.

[0122] Extract the output vector of the last time step of the second-level hidden state sequence; use it as the process dynamic evolution trend vector; the dimension of the process dynamic evolution trend vector is 128; this vector represents the change pattern of process parameters in the past period and the potential change trend in the future period.

[0123] The dynamic evolution trend vector of the process is concatenated with the absolute values ​​of the parameters at the last moment in the aligned process parameter sequence. The aligned process parameter sequence includes six process parameter dimensions: squeegee pressure, squeegee speed, screen release height, printing gap, ink temperature, and squeegee stroke. The absolute value of the parameter at the last moment is a 6-dimensional vector. After concatenation, a joint vector of the current process state is generated. The dimension of the joint vector of the current process state is 134. This vector simultaneously contains the current steady-state baseline information and the future dynamic evolution trend information of the process system, providing a comprehensive and accurate state basis for subsequent parameter control and prediction.

[0124] S4-6: Physical Constraint Regression and Control Incremental Vector Output:

[0125] The physical constraint regression layer of the prediction head is adjusted by combining the current process state with the vector input parameters. This layer incorporates the kinematic boundaries of the screen printing machine's actuators and multi-parameter coupling and mutual exclusion rules. The actuator kinematic boundaries define the allowable adjustment range for each process parameter: squeegee pressure ranges from 0.2 MPa to 0.8 MPa; squeegee speed ranges from 50 mm / s to 200 mm / s; screen release height ranges from 0.1 mm to 0.5 mm; printing gap ranges from 0.05 mm to 0.3 mm; ink temperature ranges from 20 degrees Celsius to 40 degrees Celsius; and squeegee stroke ranges from 100 mm to 300 mm. The multi-parameter coupling and mutual exclusion rules define the constraint relationships between different process parameters: squeegee pressure and screen release height are negatively correlated; when squeegee pressure increases, the screen release height must decrease accordingly. Squeegee speed and ink temperature are positively correlated; when squeegee speed increases, the ink temperature must increase accordingly.

[0126] The physical constraint regression layer first performs feature transformation on the joint vector of the current process state through two fully connected network layers. The first fully connected network compresses the feature dimension from 134 to 64. After processing by the linear rectified activation function, the second fully connected network maps the feature dimension from 64 to 6, generating the original continuous regression output. The original continuous regression output is a 6-dimensional vector, with each element corresponding to an initial adjustment increment of a process parameter.

[0127] The original continuous regression output is processed using a differentiable hard-limited activation function; the formula for calculating the differentiable hard-limited activation function is as follows: ,in, This is the output value after amplitude limiting; The original input value; This represents the minimum allowable adjustment increment for the corresponding process parameter; This represents the maximum allowable adjustment increment for the corresponding process parameter;

[0128] This function truncates the output value that exceeds the kinematic boundary of the actuator to the corresponding boundary value; at the same time, it ensures that the function is differentiable everywhere in the domain except at the boundary points; and it does not affect the gradient backpropagation process.

[0129] An integral anti-saturation and compensation mechanism based on historical control residuals is introduced. This mechanism caches the control residuals from the past 10 control cycles in real time. The control residual is the difference between the optimal control increment labeled by process experts and the control increment predicted by the model. The integral value of the residual is calculated. The formulas for calculating the integral anti-saturation and compensation values ​​are as follows: ,in, This is the integral anti-saturation and compensation value; This is the integral coefficient; the default value is 0.1. For the first The control residual of a historical control cycle;

[0130] The integral anti-saturation compensation value is added element by element to the regression output after hard limiting; the cumulative drift in the continuous control cycle is eliminated; and the stability of long-term regulation is improved.

[0131] Finally, the control increment vector is output through linear projection mapping; the dimension of the control increment vector is 6; it strictly corresponds one-to-one with the dimension of the process parameters in the aligned process parameter sequence; each element in the control increment vector represents the adjustment amount of the corresponding process parameter relative to the parameter at the last time step in the aligned process parameter sequence; a positive value indicates that the parameter increases; a negative value indicates that the parameter decreases; and a zero value indicates that the parameter remains unchanged.

[0132] In this embodiment, the core function of step S5 is to construct a multi-task joint loss function that integrates the defect detection task, parameter control task, and cross-modal feature alignment task. An adaptive task weight coefficient based on training dynamic variance is introduced to automatically balance the optimization priorities of each task. A gradient collaborative optimization strategy is used to resolve gradient conflicts during multi-task training. This enables end-to-end joint training of the defect detection head and parameter control prediction head of the cross-modal fusion module in the visual feature extraction branch and parameter encoding branch. Finally, a convergent, stable, and well-balanced neural network model for screen printing machine visual detection and parameter control is obtained. The detailed steps are as follows:

[0133] S5-1: Construction of Loss Term for Defect Classification and Localization:

[0134] The defect category probabilities output by the defect detection head and the true labels of the preset defect categories are input into the classification error calculation unit; the deviation between the predicted probability distribution and the true label distribution is calculated using a class imbalance metric algorithm that focuses on difficult-to-classify samples; this algorithm is a focus loss function; the calculation formula is as follows: ,in, This is the classification error term; This refers to the number of samples within a batch. Total number of defect categories; For the first The first sample The true label of the class; For the first The first sample The predicted probability of a class; This is the focus parameter; the default value is [value]. ;

[0135] This algorithm increases the loss contribution of rare defect categories by assigning higher weights to hard-to-classify samples; alleviates the problem of extremely unbalanced distribution of defect samples in screen printing production; and outputs a classification error term.

[0136] The defect location mask output by the defect detection head and the actual mask are input into the positioning error calculation unit; firstly, the regional overlap deviation between the predicted mask and the actual mask is calculated; the regional overlap deviation is calculated using dice loss; the calculation formula is as follows: ,in, This refers to regional overlap deviation; For predicting the first in the mask Line 1 The value of the column pixel; The first in the true mask Line 1 The value of the column pixel;

[0137] Then, the gradient distance between the edge contours of the predicted mask and the real mask is calculated. First, the Sobel operator is used to extract the edge feature maps of the predicted mask and the real mask respectively. Then, the L1 distance between the two edge feature maps is calculated. The calculation formula is as follows: ,in, The edge contour gradient distance; To predict the first edge feature map in the mask. Line 1 The value of the column pixel; The first in the true mask edge feature map Line 1 The value of the column pixel;

[0138] The regional overlap deviation and the edge contour gradient distance are linearly superimposed according to a preset base ratio to generate a positioning error term; the preset base ratio is 0.7 to 0.3; that is, the positioning error term is equal to 0.7 times the regional overlap deviation plus 0.3 times the edge contour gradient distance.

[0139] The classification error term and the location error term are linearly superimposed according to a preset basic ratio to construct the defect classification and location loss term; the preset basic ratio is 1:1; that is, the defect classification and location loss term is equal to the classification error term plus the location error term.

[0140] S5-2: Construction of the parameter-controlled regression loss term:

[0141] The control increment vector output by the parameter control prediction head and the true value of the optimal control increment labeled by the process expert are input into the regression error calculation unit; the numerical deviation between the predicted control amount and the true value is calculated using a smoothing norm metric algorithm robust to sensor noise; this algorithm uses the Huber loss function; the calculation formula is as follows: ,in, For parameter-controlled regression loss term; This refers to the number of samples within a training batch. The number of dimensions for process parameters; For the first The first sample The true value of the optimal control increment for each process parameter; For the first The first sample Predictive control increments for each process parameter; This is the threshold parameter; the default value is 1.0.

[0142] This algorithm uses the L2 norm for calculation when the error is small and the L1 norm for calculation when the error is large, which can effectively reduce the impact of outliers and sensor noise on the regression results; the output parameters can adjust the regression loss term.

[0143] S5-3: Construction of cross-modal feature distribution alignment constraint terms:

[0144] Extract the joint feature representation of the cross-modal fusion module output into the feature vector distribution in the hidden layer mapping space; extract the visual modality feature subsequence and the parametric modality feature subsequence respectively; the visual modality feature subsequence is obtained by global pooling of the cross-modal mask weighted feature map; the parametric modality feature subsequence is directly obtained from the parametric temporal encoding vector;

[0145] Calculate the distributional similarity between visual modality feature subsequences and parametric modality feature subsequences on a shared manifold; construct a mutual information maximization penalty term based on a contrastive learning paradigm; this penalty term uses the InfoNCE loss function; the calculation formula is as follows: ,in, This is an alignment constraint term for cross-modal feature distributions; For the first Visual modal feature vectors of each sample; For the first The parametric modal feature vector of each sample; This is the temperature coefficient; the default value is 0.1.

[0146] This penalty term achieves alignment of the two modal feature distributions by maximizing the mutual information between visual modal features and parametric modal features in the same sample, while minimizing the mutual information between visual modal features and parametric modal features in different samples; this penalty term serves as a constraint for cross-modal feature distribution alignment.

[0147] S5-4: Calculation of adaptive task weight coefficients based on training dynamic variance:

[0148] During model iterative training, the historical numerical sequence of defect classification and localization loss terms, regression loss terms, and cross-modal feature distribution alignment constraints within a preset sliding window is cached in real time. The preset sliding window size is set to 50 training batches. The sliding window adopts a first-in-first-out update method. After each training batch is completed, the three loss values ​​of the current batch are added to the window, while the loss value of the oldest batch is removed from the window.

[0149] Calculate the rolling dynamic variance for each loss term sequence separately; the formula for calculating the rolling dynamic variance is as follows: ,in, For rolling dynamic variance; To adjust the sliding window size; For the first The loss value for each training batch; This is the arithmetic mean of all loss values ​​within the sliding window;

[0150] The task uncertainty quantification scalar is based on the inverse mapping of each rolling dynamic variance; the higher the task uncertainty, the larger the corresponding rolling dynamic variance, the smaller its inverse, and the lower the task weight. The calculation formula for the task uncertainty quantification scalar is as follows: ,in, For the first The uncertainty of a task is quantified as a scalar; For the first The rolling dynamic variance of each task; This is the numerical stability constant; the default value is... ;

[0151] The uncertainty quantization scalars for the three tasks are subjected to soft maximization normalization; adaptive task weight coefficients are generated that evolve with the training phase; the calculation formula for soft maximization normalization is as follows: ,in, For the first Adaptive weighting coefficients for each task;

[0152] The sum of the weight coefficients of the three adaptive tasks is 1; these correspond to the defect classification and localization task, the parameter adjustment task, and the cross-modal feature alignment task, respectively. In the early stage of training, the uncertainty of the cross-modal feature alignment task is relatively high, so its weight is relatively large. In the later stage of training, the uncertainty of the defect detection and parameter adjustment tasks gradually decreases, so its weight gradually increases, thereby realizing the automatic adjustment of task priority during training.

[0153] S5-5: Construction of the final joint loss function:

[0154] The adaptive task weight coefficients are coupled element-wise with the parameter adjustment regression loss term and the cross-modal feature distribution alignment constraint term of the defect classification and localization loss term, respectively; and the weighted loss terms are algebraically summed.

[0155] A parameter magnitude regularization penalty term is introduced to constrain the network weight size; this prevents model overfitting; the parameter magnitude regularization penalty term uses L2 regularization; the calculation formula is as follows: ,in, This is a penalty term for parameter magnitude regularization; This is the regularization coefficient; the default value is [value]. ; It is the set of all learnable parameters of the network; For a single network parameter;

[0156] The parameter magnitude regularization penalty term is added to the weighted multi-task loss; the final joint loss function is constructed; the formula for calculating the final joint loss function is as follows: ,in, This is the final joint loss function; For defect classification and location loss items, These are the adaptive task weight coefficients for defect classification and localization tasks. To adjust the adaptive task weight coefficients for the regression task using parameters. Adaptive task weight coefficients for aligning tasks across modal feature distributions;

[0157] S5-6: Training Data Preparation and Network Parameter Initialization

[0158] The network parameter weights of the visual feature extraction branch, encoding branch, cross-modal fusion module, defect detection head, and parameter control prediction head are initialized using the Xavier uniform distribution initialization method for all convolutional and fully connected layers; the Xavier uniform distribution value range is... ;in, The number of input neurons; This represents the number of output neurons; all bias parameters are initialized to 0.

[0159] Construct training batch queues and validation batch queues containing time-synchronized sample pairs; all samples are arranged in production time order; ensure no data overlap between the training set and validation set; the training batch queue contains 80% labeled samples; the validation batch queue contains 20% labeled samples; each training batch contains 32 time-synchronized sample pairs; each validation batch contains 16 time-synchronized sample pairs.

[0160] S5-7: Forward Inference and Joint Loss Calculation

[0161] Samples from the current batch are extracted from the training batch queue; the standardized image tensor and the aligned process parameter sequence are fed into the network architecture in parallel to perform forward inference; the defect feature map is extracted sequentially through the visual feature extraction branch; the parameter encoding branch extracts the parameter temporal encoding vector; the cross-modal fusion module generates a joint feature representation; the defect detection head outputs the defect category probability and defect location mask; the parameter control prediction head outputs the control increment vector.

[0162] Substitute the prediction results and corresponding real labels into the joint loss function; calculate the joint loss value for the current batch; simultaneously calculate the individual loss values ​​for the defect classification and localization loss terms, the parameter-adjusted regression loss term, and the cross-modal feature distribution alignment constraint term; save each loss value for subsequent gradient separation and weight updates;

[0163] S5-8: Gradient Backpropagation and Conflict Resolution:

[0164] Perform back-differential propagation based on the joint loss value of the current batch; calculate the original gradient tensor of the joint loss value with respect to the parameters of each network module;

[0165] The gradient flow of the visual task driving visual modality update and the gradient flow of the parametric task driving parametric modality update are separated. The gradient flow of the visual task is obtained by backpropagation of the defect classification and localization loss term. The gradient flow of the parametric task is obtained by backpropagation of the parameter-controlled regression loss term. The gradient of the cross-modal feature distribution alignment constraint term contributes to both task gradient flows.

[0166] The gradient streams from the visual task and the parametric task are input into the gradient conflict resolution unit; the angle between the directions of the two gradient streams and the projection overlap component are calculated in the parameter update space; the formula for calculating the angle between the directions is as follows: ,in, The angle between the directions of the two gradient flows; Gradient flow for visual tasks; Gradient flow for parameterized tasks;

[0167] The preset orthogonality threshold is 90 degrees. When the angle between the directions is greater than 90 degrees, it is determined that there is a conflict between the two gradient flows. The gradient orthogonal projection clipping operation is performed to filter out the reverse components that cause the optimization direction conflict between the visual detection task and the parameter adjustment task. The calculation formula for gradient orthogonal projection clipping is as follows: ,in, The gradient vector after projection; This is the original gradient vector; The collision gradient vector;

[0168] The processed visual task gradient stream is added element-wise to the parametric task gradient stream to generate a gradient co-update vector.

[0169] S5-9: Adaptive Step Size Scheduling and Parameter Update:

[0170] The gradient collaborative update vector is input into the adaptive step size scheduler; the difficulty index of each task is optimized based on the training dynamic variance feedback; differentiated learning rate decay coefficients are assigned to the visual feature extraction branch and the parameter encoding branch; the higher the optimization difficulty of the task, the smaller the corresponding learning rate decay coefficient and the longer the learning rate is maintained.

[0171] The initial learning rate is set to 0.001; the initial learning rate for the visual feature extraction branch is 0.001; the initial learning rate for the parameter encoding branch is 0.0005; and the initial learning rate for the cross-modal fusion module defect detection head and parameter control prediction head is 0.001.

[0172] A cosine annealing learning rate scheduling strategy is adopted; the learning rate decreases with the increase of training rounds according to a cosine curve; the minimum learning rate is set to 10⁻⁶.

[0173] The Adam optimizer is used to perform gradient descent iterative updates of the network parameter weights; the first-order moment estimation coefficients of the Adam optimizer are set to 0.9; the second-order moment estimation coefficients are set to 0.999; the numerical stability constant is set to 10⁻⁸; the update formula is as follows: ,in, For the updated network parameters; The network parameters were as before the update. The learning rate; This is a first-order moment estimate; It is a second-order moment estimate; It is the numerical stability constant;

[0174] Complete the single-batch parameter optimization loop; continue to extract the next batch of samples from the training batch queue; repeat the forward inference loss calculation, gradient backpropagation, and parameter update operations;

[0175] S5-10: Training convergence judgment and model solidification:

[0176] The training batch queue is iterated until the preset number of training rounds is completed; the preset maximum number of training rounds is set to 200 rounds; the current network parameters are loaded into the validation batch queue and forward evaluation is performed simultaneously; validation evaluation is performed every 5 training rounds.

[0177] Monitor the decay trajectory of the joint loss value and the convergence status of the independent validation metrics; the independent validation metrics include defect detection accuracy, defect location crossover ratio, and parameter control mean square error; the defect detection accuracy is the proportion of correctly classified samples to the total number of samples; the defect location crossover ratio is the average of the crossover ratios of the predicted mask and the true mask; the parameter control mean square error is the mean square error between the predicted control increment and the true value of the optimal control increment.

[0178] When the relative decrease of the joint loss value within 10 consecutive validation cycles is less than the preset convergence tolerance, the training process is determined to have reached a steady state and the iteration is terminated; the preset convergence tolerance is set to 0.001; if the convergence condition is not met even after reaching the maximum number of training rounds, the training is forcibly terminated.

[0179] The final parameter weights of each network module are locked and solidified; the solidified visual feature extraction branch parameter encoding branch cross-modal fusion module defect detection head and parameter control prediction head are topologically encapsulated and serialized for storage; the jointly optimized screen printing machine visual inspection and parameter control neural network model is output; the model storage format is ONNX format; it can be directly deployed to various edge computing devices for operation.

[0180] 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. A neural network construction method for joint optimization of visual inspection and parameter control in a screen printing machine, characterized in that: Includes the following steps: S1. Acquire the screen printing product image data and screen printing machine real-time process parameter data collected synchronously. Perform noise reduction, size normalization and time window alignment preprocessing on the image data to obtain the standardized image tensor and the aligned process parameter sequence. S2. Input the standardized image tensor into the visual feature extraction branch, and after multi-scale convolution and spatial attention processing, extract the spatial distribution features of printing defects and output the defect feature map. The aligned process parameter sequence is input into the parameter encoding branch, and after temporal convolution and positional encoding, the dynamic evolution features of the process parameters are extracted, and the parameter temporal encoding vector is output. S3. Input the defect feature map and the parameter temporal coding vector into the cross-modal fusion module. Through the spatial-parameter cross-attention mechanism, calculate the correlation weight matrix between the spatial location of the defect and the dimension of the process parameters. Perform cross-modal mask weighting on the defect feature map. Pool the weighted feature map to obtain the spatial aggregated feature vector. Perform feature concatenation and dimensionality reduction projection on the spatial aggregated feature vector and the parameter temporal coding vector to output the joint feature representation. S4. Input the joint feature representation into the defect detection head and the parameter control prediction head in parallel; the defect detection head outputs the defect category probability and defect location mask through the decoder; the parameter control prediction head outputs the control increment vector relative to the parameter at the last moment in the aligned process parameter sequence through the regression layer. S5. Construct a joint loss function, which includes a defect classification and localization loss term, a parameter regulation regression loss term, and a cross-modal feature distribution alignment constraint term. Adaptive task weight coefficients based on training dynamic variance are also introduced. Based on the joint loss function, a gradient collaborative optimization strategy is used to perform end-to-end joint training on the visual feature extraction branch, parameter encoding branch, cross-modal fusion module, defect detection head, and parameter regulation prediction head until the loss function converges, resulting in a jointly optimized neural network model for screen printing machine visual detection and parameter regulation.

2. The neural network construction method for joint optimization of visual inspection and parameter control in screen printing machines according to claim 1, characterized in that: The process involves acquiring time-synchronized image data of screen-printed products and real-time process parameter data of the screen-printing machine. Preprocessing of the image data includes denoising, size normalization, and time window alignment with the process parameter data, resulting in a standardized image tensor and an aligned sequence of process parameters. Specifically, this includes: The image acquisition unit and the screen printing machine control system are synchronously controlled by external hardware trigger signals to acquire the original screen printing image frames and the original process parameter sampling sequence within the continuous production cycle. A unified global timestamp is bound to each frame in the original screen printing image frame and each sampling data point in the original process parameter sampling sequence, and the original data pairs with timestamps are output. The original screen printing image frame is input into the adaptive region-aware denoising module, which calculates the gray-level gradient distribution of the local neighborhood of the image. Based on the gradient threshold, the screen printing substrate uniform light region and the printing ink pattern region are dynamically segmented. Differentiated filter kernel weights are configured for the uniform light region and the printing ink pattern region respectively to perform non-local mean filtering and output the denoised image frame. Using the preset coordinates of the effective area of ​​the standard screen printing plate as a reference, the region of interest is cropped on the denoised image frame. Then, the cropped image is mapped to a fixed spatial resolution using a bicubic interpolation algorithm, and tensor recombination is performed according to the color and gradient channel dimensions to output a standardized image tensor. The global timestamp corresponding to the standardized image tensor is extracted as the visual acquisition reference time. The preset time span of the scraper downward process response is traced forward and the preset time span of the ink layer leveling stability is extended backward to construct an asymmetric causal time window. The process parameter sampling data that falls within the asymmetric causal time window in the original data with timestamps is truncated as the parameter subsequence to be aligned. Traverse the time interval between adjacent sampling points in the parameter subsequence to be aligned. When the time interval between a certain adjacent sampling point is greater than the tolerance threshold of the nominal sampling period of the equipment, it is determined that there is a time gap in the time interval between the adjacent sampling points. A piecewise polynomial interpolation algorithm based on the upper and lower limits of the historical change rate of process parameters is used to physically limit and fill the gap time period to obtain a continuous time series parameter sequence. Sliding window extreme value normalization and dynamic zero mean normalization are performed independently on each process parameter dimension in the continuous time-series parameter sequence to eliminate the influence of sensor baseline drift. The normalized sequence is then arranged and encapsulated in chronological order to generate an aligned process parameter sequence that is strictly time-aligned with the standardized image tensor.

3. The neural network construction method for joint optimization of visual inspection and parameter control in screen printing machines according to claim 1, characterized in that: The standardized image tensor is input into the visual feature extraction branch, and after multi-scale convolution and spatial attention processing, the spatial distribution features of printing defects are extracted, and the defect feature map is output, specifically including: Standardized image tensors are fed in parallel into shallow detail convolutional pathways, mid-texture convolutional pathways, and deep topography convolutional pathways. Each pathway is configured with convolutional kernel size from small to large and dilation coefficient from increasing to increase, so as to independently capture micron-level edge burrs, local ink accumulation distortion and macro-registration offset features, and output shallow feature sub-maps, mid-feature sub-maps and deep feature sub-maps respectively. The shallow feature sub-image, the middle feature sub-image and the deep feature sub-image are spliced ​​together across the channel dimension to construct a multi-scale aggregated feature tensor, and the multi-scale aggregated feature tensor is input into the dual-response spatial attention module. In the dual-response spatial attention module, global average pooling and global max pooling are first performed on the multi-scale aggregated feature tensor to extract background stationary distribution features and defect mutation saliency features, respectively. After dimensionality reduction by convolution with shared weights, they are added element by element to generate the basic spatial response map. By introducing a priori constraints on the periodic texture of the screen printing stencil, a fast Fourier transform is performed on the multi-scale aggregated feature tensor to identify and filter out the interference harmonic components that coincide with the fundamental frequency of the screen grid in the frequency domain. The texture suppression mask is then reconstructed through inverse transform. The basic spatial response map is multiplied element-wise with the texture suppression mask to obtain the defect-sensitive attention weight matrix. The defect-sensitive attention weight matrix is ​​then multiplied by the multi-scale aggregated feature tensor through channel-wise spatial broadcasting to complete the feature enhancement of the defect region and the suppression of periodic background noise, and the attention-weighted feature tensor is output. The attention-weighted feature tensor is input into the feature refinement residual block. After pointwise convolution to compress channel redundancy and superimposed identity mapping, the output is a defect feature map that characterizes the spatial distribution and significance of printing defects.

4. The neural network construction method for joint optimization of visual inspection and parameter control in screen printing machines according to claim 3, characterized in that: The aligned process parameter sequence is input into the parameter encoding branch, and after temporal convolution and positional encoding processing, the dynamic evolution features of the process parameters are extracted, and the output parameter temporal encoding vector is generated, specifically including: The aligned process parameter sequence is reshaped into a multi-dimensional parameter temporal matrix and input into a causal dilated temporal convolutional network. The causal dilated temporal convolutional network consists of multiple stacked one-dimensional causal convolutional layers. Each layer is configured with non-zero padding on the left and a geometrically increasing dilation rate to ensure that the current feature only depends on the historical process parameter sequence to build a unidirectional temporal dependency. After convolution layer by layer and superimposed residual connections, the temporal evolution feature sequence is output. A layer normalization operation is performed on the time-series evolution feature sequence to eliminate the differences in the dimensions of data from multiple sources and batch statistical bias, thereby obtaining a stationary time-series feature sequence. A process phase-aware position encoding module is constructed. Based on the standard working cycle of the screen printing machine, the time step index of the stationary time sequence feature sequence is mapped to the phase state labels of the squeegee downward pressure period, the screen contact printing period, the screen demolding springback period and the squeegee reset idle period. Discrete phase vectors are generated and mapped to continuous phase position encoding tensors through a learnable linear embedding layer. The stationary time series feature sequence is added element by element to the continuous phase position encoding tensor to achieve feature fusion of absolute time step and relative process phase, thus obtaining the phase-enhanced time series tensor. The phase-enhanced temporal tensor is input into an adaptive gated temporal pooling layer. A time step importance score gate signal is generated through a nonlinear activation function. The phase-enhanced temporal tensor is then weighted and aggregated to filter out the steady-state redundant time period features of the process and highlight the transient jump information of the parameters. Finally, the tensor is dimensionality-reduced and mapped through a fully connected layer to output a fixed-dimensional parameter temporal encoding vector.

5. The neural network construction method for joint optimization of visual inspection and parameter control in screen printing machines according to claim 1, characterized in that: The defect feature map and the parameter temporal encoding vector are input into the cross-modal fusion module. Through a spatial-parameter cross-attention mechanism, the correlation weight matrix between the defect spatial location and the process parameter dimension is calculated. The defect feature map is then subjected to cross-modal masking weighting, and feature concatenation and dimensionality reduction projection are performed with the parameter temporal encoding vector to output a joint feature representation, specifically including: The defect feature map is flattened along the spatial dimension into a spatial location feature sequence, and the parameter temporal encoding vector is mapped into a parameter dimension feature sequence through a learnable linear projection layer, which serve as the spatial query tensor and parameter key value sequence of the spatial-parameter cross-attention mechanism, respectively. Element-wise similarity is calculated based on spatial query tensor and parameter key value sequence. After scaling with learnable temperature coefficient and row direction normalization, a correlation weight matrix is ​​generated to represent the coupling strength between each defect spatial pixel and each process parameter dimension. The correlation weight matrix is ​​reshaped into a two-dimensional spatial mask tensor according to the spatial topology. Channel-by-channel and pixel-by-pixel cross-modal mask weighting operation is performed on the defect feature map to amplify the defect response area that is strongly correlated with high-weight process parameters and suppress irrelevant background noise, and output the cross-modal mask weighted feature map. A global adaptive pooling operation is performed on the cross-modal mask weighted feature map to compress the spatial dimension and aggregate the channel-level saliency response to generate a spatial aggregated feature vector. The spatial aggregated feature vector and the parameter temporal coding vector are concatenated along the feature dimension to construct a multimodal concatenation tensor. The multimodal splicing tensor is input into the nonlinear dimensionality reduction projection module. Cross-modal feature interaction and information distillation are performed through a multi-layer fully connected network and residual gating mechanism to eliminate the distribution differences between modes and compress them to a preset dimension, outputting a joint feature representation.

6. The neural network construction method for joint optimization of visual inspection and parameter control in screen printing machines according to claim 1, characterized in that: The joint feature representation is input in parallel into the defect detection head and the parameter-controlled prediction head; the defect detection head outputs the defect category probability and the defect location mask through the decoder. The parameter control prediction head outputs a control increment vector relative to the parameters at the last time step in the aligned process parameter sequence through a regression layer, specifically including: The joint feature representation is decoupled along the channel dimension into a spatial defect feature sub-tensor and a parameter evolution feature sub-vector; The spatial defect feature sub-tensor is input into the multi-scale pyramid decoder of the defect detection head. The spatial topology is restored through step-by-step upsampling and cross-layer feature skip connections to generate a high-resolution defect reconstruction feature map. Gradient-sensitive boundary enhancement convolution is performed on the high-resolution defect reconstruction feature map to enhance the gradient contrast between the defect edges and the internal texture, and output a boundary sharpening feature map. The boundary sharpening feature map is fed into the category determination branch and the mask generation branch in parallel. After global pooling to compress the spatial dimension, the category determination branch calculates the unnormalized confidence of each preset defect category through multilayer perceptron mapping, and outputs the defect category probability after processing by the probability normalization function. The mask generation branch generates a continuous defect foreground response field through pixel-by-pixel semantic segmentation operation, and combines adaptive dynamic threshold segmentation and morphological connected component filtering algorithm to remove isolated noise and artifacts, and generates a binarized defect location mask. The parameter evolution feature subvector is input into the temporal state inference network of the parameter control prediction head. The hidden state sequence representing the dynamic evolution trend of the process is extracted through the gated temporal unit. The last step output of the hidden state sequence is concatenated with the absolute value of the parameter at the last moment in the aligned process parameter sequence to construct a joint vector of the current process state containing the steady-state benchmark and the dynamic trend. The physical constraint regression layer of the prediction head is adjusted by inputting the current process state joint vector into the parameters. The physical constraint regression layer incorporates the kinematic boundary and multi-parameter coupling and mutual exclusion rules of the screen printing machine actuator. The original continuous regression output is truncated to a safe operating domain through a differentiable hard-limited activation function. An integral anti-saturation compensation mechanism based on historical control residuals is introduced to eliminate the cumulative drift in the continuous control cycle. Finally, the control increment vector with a dimension that strictly corresponds one-to-one with the dimension of the process parameters in the aligned process parameter sequence is output through linear projection mapping.

7. The neural network construction method for joint optimization of visual inspection and parameter control in screen printing machines according to claim 1, characterized in that: A joint loss function is constructed, which includes a defect classification and localization loss term, a parameter-adjusted regression loss term, and a cross-modal feature distribution alignment constraint term. Adaptive task weight coefficients based on the training dynamic variance are also introduced, specifically including: The defect category probability output by the defect detection head and the real label of the preset defect category are input into the classification error calculation unit. The class imbalance measurement algorithm focusing on difficult samples is used to calculate the deviation between the predicted probability distribution and the real label distribution, and the classification error term is output. The defect location mask output by the defect detection head and the real mask are input into the positioning error calculation unit. The positioning error term is generated by superimposing the region overlap deviation and edge contour gradient distance between the predicted mask and the real mask. The classification error term and the positioning error term are linearly superimposed according to the preset basic ratio to construct the defect classification and positioning loss term. The control increment vector output by the parameter control prediction head and the true value of the optimal control increment marked by the process expert are input into the regression error calculation unit. The smooth norm measurement algorithm, which is robust to sensor noise, is used to calculate the numerical deviation between the predicted control amount and the true value, and the parameter control regression loss term is output. Extract the joint feature representation output by the cross-modal fusion module and its feature vector distribution in the hidden layer mapping space. Calculate the distribution similarity between the visual modal feature subsequence and the parametric modal feature subsequence on the shared manifold. Construct a mutual information maximization penalty term based on the contrastive learning paradigm as a cross-modal feature distribution alignment constraint term. During the model iterative training process, the historical numerical sequences of the defect classification and localization loss term, parameter regulation regression loss term, and cross-modal feature distribution alignment constraint term within a preset sliding window are cached in real time. The rolling dynamic variance of each loss term sequence is calculated, and the inverse of each rolling dynamic variance is mapped to the task uncertainty quantification scalar. After soft maximization normalization, adaptive task weight coefficients that evolve with the training stage are generated. The adaptive task weight coefficients are coupled element-wise with the defect classification and localization loss term, the parameter regulation regression loss term, and the cross-modal feature distribution alignment constraint term. The weighted loss terms are algebraically summed, and a parameter amplitude regularization penalty term is introduced to constrain the network weight scale, thus constructing the final joint loss function.

8. The neural network construction method for joint optimization of visual inspection and parameter control in screen printing machines according to claim 7, characterized in that: Based on the joint loss function, a gradient collaborative optimization strategy is used to perform end-to-end joint training on the visual feature extraction branch, parameter encoding branch, cross-modal fusion module, defect detection head, and parameter control prediction head until the loss function converges, resulting in a jointly optimized neural network model for screen printing machine visual detection and parameter control, specifically including: Initialize the network parameter weights of the visual feature extraction branch, parameter encoding branch, cross-modal fusion module, defect detection head, and parameter control prediction head, and construct a training batch queue and a validation batch queue containing time-synchronized sample pairs; Samples of the current batch are extracted from the training batch queue. The standardized image tensor and the aligned process parameter sequence are fed into the network architecture in parallel to perform forward inference. The samples are then processed through feature extraction, cross-modal fusion and dual-head prediction. The predicted defect category probability, predicted defect location mask and predicted adjustment increment vector of the current batch are output. The prediction results and the corresponding real labels are substituted into the joint loss function to calculate the joint loss value of the current batch. Perform back-differential propagation based on the joint loss value of the current batch, calculate the original gradient tensor of the joint loss value with respect to the parameters of each network module, and separate the visual task gradient flow that drives the visual modality update from the parameter task gradient flow that drives the parameter modality update. The gradient flow of the visual task and the gradient flow of the parameter task are input into the gradient conflict resolution unit. The angle between the directions of the two gradient flows and the projection overlap component in the parameter update space are calculated. When the angle between the directions is greater than the preset orthogonality threshold, the gradient orthogonal projection clipping operation is performed to filter out the reverse component that causes the optimization direction conflict between the visual detection task and the parameter control task, and generate the gradient collaborative update vector. The gradient collaborative update vector is input into the adaptive step size scheduler. Based on the task optimization difficulty index of each task feedback from the training dynamic variance, differentiated learning rate decay coefficients are assigned to the visual feature extraction branch and the parameter encoding branch. The gradient descent iterative update of the network parameter weights is performed to complete the single batch parameter optimization loop. The training batch queue is iterated until the preset training rounds are completed. The current network parameters are loaded into the validation batch queue for forward evaluation. The decay trajectory of the joint loss value and the convergence status of the independent validation metrics are monitored. When the relative decrease of the joint loss value in multiple consecutive validation cycles is lower than the preset convergence tolerance, the training process is determined to have reached a steady state and the iteration is terminated. The final parameter weights of each network module are locked and solidified. The solidified visual feature extraction branch, parameter encoding branch, cross-modal fusion module, defect detection head and parameter control prediction head are topologically encapsulated and serialized for storage, and the jointly optimized neural network model for screen printing machine visual inspection and parameter control is output.

Citation Information

Patent Citations

  • Substation equipment defect identification and detection method and system

    CN118379271A

  • Printing machine equipment operation optimization process and system based on multi-vision analysis

    CN119273934A