Winding coating online incremental defect detection method and system based on gradient sensing parameter decoupling and medium

By using gradient sensing parameter decoupling technology, the problem of catastrophic forgetting in the roll-to-roll coating production line was solved, enabling continuous learning of new defect modes and stable detection of existing defect types, thus improving the overall performance of the detection system.

CN121937360APending Publication Date: 2026-04-28SHANGHAI INST OF CERAMIC CHEM & TECH CHINESE ACAD OF SCI
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHANGHAI INST OF CERAMIC CHEM & TECH CHINESE ACAD OF SCI
Filing Date
2025-12-08
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

Existing roll-to-roll coating production lines suffer from catastrophic amnesia when facing dynamically changing industrial environments, making it difficult to continuously and effectively detect and identify new defect patterns, while also affecting the ability to detect existing defect types.

Method used

An online incremental defect detection method for roll-to-roll coating based on gradient-aware parameter decoupling is adopted. Image features are extracted by a ViT encoder with frozen parameters, and parameter decoupling and gradient projection are performed to ensure the independence between tasks. The feature sharing and generalization ability in multi-task scenarios are improved by intermediate layer feature alignment.

Benefits of technology

It effectively avoids catastrophic forgetting, enables continuous learning of new defect patterns, maintains the ability to detect existing defect types, improves the overall detection performance of the system, and reduces the demand for computing resources and storage space.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121937360A_ABST
    Figure CN121937360A_ABST
Patent Text Reader

Abstract

The invention relates to a winding coating online incremental defect detection method and system based on gradient sensing parameter decoupling and a medium. The method comprises the following steps: carrying out data preprocessing and block embedding on an input image; extracting image features by using a ViT encoder of freezing parameters; the features are decoded through a ViT decoder; performing middle layer feature alignment; executing parameter decoupling, and separating parameters of different tasks; performing gradient projection on the gradient of the new task to avoid interference on the feature space of the existing task; and the decoder parameters are updated, so that the adaptation to a new task is realized. The problem of disastrous forgetting can be effectively avoided in the online incremental learning process of the winding coating production line, continuous learning of a new defect mode is achieved, and meanwhile the detection capacity of existing defect types is kept.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of roll-to-roll coating equipment, and in particular to a method, system, and medium for online incremental defect detection in roll-to-roll coating based on gradient sensing parameter decoupling. Background Technology

[0002] Roll-to-roll coating equipment is widely used in the industrial production of thin film materials, producing various functional thin film products through continuous coating processes on substrate surfaces. In the roll-to-roll coating process, the substrate passes through the coating chamber in a roll-to-roll manner, while the desired thin film material is deposited on its surface. Existing roll-to-roll coating production lines are typically equipped with basic quality inspection systems, which primarily rely on traditional image processing techniques and statistical methods to identify defects on the film surface. Anomaly detection technology plays a crucial role in such applications, including reconstruction-based methods and unsupervised learning techniques, which identify anomalous samples by learning the distribution of normal samples. Self-supervised learning methods learn feature representations of data by designing auxiliary tasks, thereby identifying anomalous patterns that differ from normal samples.

[0003] However, existing anomaly detection technologies face numerous challenges when dealing with the complex and dynamically changing roll-to-roll coating production lines in industrial environments. As new defect patterns continuously emerge on the production line, existing technologies often suffer from catastrophic forgetting, meaning they lose knowledge of older tasks when learning new ones. While some methods attempt to mitigate forgetting through memory replay or regularization techniques, these methods typically require additional computational resources and storage space, increasing system complexity. Furthermore, these methods have limited effectiveness in parameter sharing and task isolation between tasks, especially when multiple tasks need to be processed simultaneously. Parameter updates between tasks often interfere with each other, affecting the model's adaptability to new tasks and its stability with older tasks. In continuous anomaly detection settings, existing models struggle to effectively maintain their detection capabilities from previous tasks, leading to a gradual decline in overall model performance as new tasks are learned, making it impossible to continuously and effectively detect and identify various anomalies in the roll-to-roll coating production process. Summary of the Invention

[0004] In view of the shortcomings of the prior art described above, the purpose of this invention is to provide an online incremental defect detection method, system and medium for roll-to-roll coating based on gradient sensing parameter decoupling. This method can effectively avoid catastrophic forgetting problems during the online incremental learning process of roll-to-roll coating production lines, and achieve continuous learning of new defect patterns while maintaining the ability to detect existing defect types.

[0005] To achieve the above objectives, the present invention adopts the following technical solution.

[0006] In a first aspect, the present invention provides an online incremental defect detection method for roll-to-roll coatings based on gradient sensing parameter decoupling, which adopts the following technical solution: Data preprocessing and block embedding are performed on the input image; Image features are extracted using the ViT encoder with frozen parameters; The features are decoded using the ViT decoder; Perform intermediate layer feature alignment; Decouple execution parameters and separate parameters for different tasks; Gradient projection is performed on the gradient of the new task to avoid interference with the feature space of the existing task; and Update the decoder parameters to adapt to new tasks.

[0007] Furthermore, in the above-mentioned online incremental defect detection method, the data preprocessing includes scaling and normalizing the input image.

[0008] Furthermore, in the above-mentioned online incremental defect detection method, the block embedding divides the image into small blocks and converts them into embedding vectors.

[0009] Furthermore, in the above-mentioned online incremental defect detection method, the parameter decoupling is achieved by generating a task mask to separate the parameters of different tasks, thereby ensuring the parameter independence between tasks.

[0010] Furthermore, in the above-mentioned online incremental defect detection method, the gradient projection adopts orthogonal gradient projection technology, which projects the gradient of the new task onto a direction orthogonal to the feature space of the old task.

[0011] Furthermore, in the above-mentioned online incremental defect detection method, the intermediate layer feature alignment matches and fuses features from different levels to improve feature sharing and generalization capabilities in multi-task scenarios.

[0012] Furthermore, the above-mentioned online incremental defect detection method also includes saving the feature information of the old task before learning the new task and maintaining task independence during the learning process of the new task.

[0013] Furthermore, in the above-mentioned online incremental defect detection method, saving the feature information of the old task includes storing the feature representations learned during the learning process of the old task, and avoiding interference with existing knowledge by freezing the encoder parameters.

[0014] Secondly, the present invention provides an online incremental defect detection system for roll-to-roll coating based on gradient sensing parameter decoupling, which adopts the following technical solution: The data preprocessing module is used to preprocess and embed the input image into blocks. The feature extraction module includes a ViT encoder with frozen parameters for extracting image features; The feature decoding module includes a ViT decoder, used to decode features; The feature alignment module is used to align intermediate layer features; The parameter decoupling module is used to perform parameter decoupling and separate the parameters of different tasks; The gradient projection module is used to project the gradients of a new task, avoiding interference with the existing task feature space; and The parameter update module is used to update the decoder parameters to adapt to new tasks.

[0015] Thirdly, the present invention provides a readable storage medium, which adopts the following technical solution: A readable storage medium storing computer instructions that, when executed by a processor, implement the online incremental defect detection method as described in any one of the first aspects above.

[0016] In summary, compared with the prior art, the present invention has at least one of the following beneficial technical effects: By employing gradient-aware parameter decoupling technology, the catastrophic forgetting problem of anomaly detection systems in roll-to-roll coating production lines can be effectively solved, maintaining the ability to detect existing defect types while learning new defect patterns. The parameter decoupling strategy of freezing encoder parameters and task masks can achieve parameter independence between different tasks, avoiding mutual interference between parameter updates. Orthogonal gradient projection technology can project the gradient of new tasks onto directions orthogonal to the feature space of old tasks, effectively protecting learned feature representations. The intermediate layer feature alignment mechanism can improve feature sharing and generalization capabilities in multi-task scenarios, enhancing the overall detection performance of the system. Compared to traditional memory playback or regularization methods, this invention reduces computational resource and storage space requirements while achieving better task isolation and continuous learning capabilities. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 A flowchart of an online incremental defect detection method for roll-to-roll coating based on gradient-sensing parameter decoupling is shown.

[0019] Figure 2 A flowchart of the parameter decoupling process is shown. Detailed Implementation

[0020] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application. Furthermore, it should be understood that the specific embodiments described herein are only for illustration and explanation of this application and are not intended to limit this application.

[0021] It should be noted that the order of description of the following embodiments is not intended to limit the preferred order of the embodiments of this application. Furthermore, the descriptions of each embodiment in the following embodiments have their own emphasis; for parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0022] The method steps described in this embodiment of the invention can be executed in the order described in the specific implementation, or the execution order of each step can be adjusted according to actual needs, provided that the technical problem can be solved. These are not listed one by one here.

[0023] Reference Figure 1 A gradient-sensing parameter decoupling-based online incremental defect detection method for roll-to-roll coating is specifically designed for coating defect detection applications in industrial roll-to-roll processes. This method employs gradient-sensing parameter decoupling technology to achieve continuous learning and detection of newly emerging defect patterns in a dynamically changing industrial environment through a systematic process. In roll-to-roll coating production lines, this method can handle continuously emerging new defect types while maintaining the ability to detect already learned defect patterns.

[0024] First, the input image undergoes data preprocessing and block embedding. Specifically, the system is designed for typical process parameters of a roll-to-roll coating production line, supporting a line speed ≤10 m / min, strip width 1.2 m, camera resolution 32000×1000, frame rate 200 fps, and employing an externally triggered synchronous exposure mechanism with end-to-end latency controlled within 200 ms. The system allows for no more than 10% of old data to be replayed to support the real-time performance and feasibility of online incremental learning. The data preprocessing stage performs standardization operations on the raw images acquired from the roll-to-roll coating production line, including image resizing, pixel value normalization, and noise filtering. The block embedding process divides the preprocessed image into multiple image blocks of fixed size, and each image block is converted into a high-dimensional embedding vector representation. This block processing method enables the subsequent visual Transformer to effectively process local feature information of the image. In roll-to-roll coating applications, block embedding can capture subtle texture changes and local defect features on the coating surface, providing a basic data structure for subsequent feature extraction and defect identification.

[0025] Next, the ViT encoder with frozen parameters is used to extract image features. The ViT encoder employs a pre-trained visual Transformer architecture, whose parameters are frozen during incremental learning to prevent interference from new task learning on existing knowledge. The encoder extracts multi-level feature representations from the input image patch embedding vectors through a multi-head self-attention mechanism and a feedforward neural network layer. The parameter-freezing strategy ensures that the encoder does not destroy its learned feature extraction capabilities when processing new defect types. In coating defect detection applications, the frozen ViT encoder can stably extract basic visual features of the coating surface, including texture patterns, edge information, and spatial relationships, providing a reliable feature foundation for subsequent task-specific processing. To achieve stability and efficiency in online incremental learning, this method divides the ViT model into two main modules: an encoder and a decoder. The encoder is frozen as a whole, maintaining its pre-trained feature extraction capabilities unaffected by new tasks; the decoder and the Prompt module are trainable modules responsible for adapting features and classification / detection outputs to new tasks. After adding 8 task decoder layers to the ViT-Base / 14 architecture (pre-trained DINOv2-R), the encoder parameters are approximately 86M, and the decoder and Prompt module parameters are approximately 6M, accounting for approximately 6.5% of the total model parameters. This design ensures the stability of feature extraction, while significantly reducing the computational and communication burden of online training and maintaining a balance between the performance of the new and old tasks.

[0026] The ViT decoder transforms abstract feature representations into specific defect detection results. It receives multi-layered feature representations from the encoder and maps these high-dimensional features back to the original image space or a specific detection output format using a reverse Transformer structure. During decoding, the decoder fuses feature information from different levels using a cross-attention mechanism to generate a detection response specific to a particular defect type. In some implementations, the decoder output includes spatial localization information of the defect location and classification probability of the defect type. The decoder parameters are allowed to be updated during incremental learning, enabling it to adapt to new defect detection tasks while avoiding negative impacts on performance on older tasks through parameter decoupling mechanisms.

[0027] The intermediate layer feature alignment process matches and fuses feature representations from different depth layers of the ViT encoder. This alignment mechanism establishes features through feature dimension transformation and spatial correspondence, ensuring that features at different levels can work effectively together. The feature alignment process uses a learnable alignment matrix and attention weights to dynamically adjust the contribution of features from different layers. In roll-to-roll coating defect detection, intermediate layer feature alignment can integrate multi-level information from low-level texture features to high-level semantic features, improving the ability to recognize complex defect patterns. The aligned feature representation has stronger expressive power and better inter-task generalization performance.

[0028] The parameter decoupling process analyzes the dependencies of different tasks on network parameters, dividing model parameters into two categories: task-shared parameters and task-specific parameters. Task-shared parameters are responsible for extracting general visual features, while task-specific parameters handle the detection logic for specific defect types. The decoupling mechanism employs parameter importance assessment and gradient analysis to identify the subset of parameters critical to each task. During new task learning, the decoupling strategy ensures that parameter updates for new tasks do not affect the critical parameters of old tasks, thus maintaining detection performance for learned defect types. Parameter decoupling also includes dynamic mask generation, creating dedicated parameter access paths for different tasks.

[0029] Gradient projection of the gradients of new tasks, avoiding interference with the feature space of existing tasks, is a technical measure to maintain the stability of incremental learning. The gradient projection process employs orthogonal projection technology, projecting the parameter gradients generated by the new task onto a direction orthogonal to the feature space of the old task. In coating defect detection applications, gradient projection technology enables the system to continuously learn newly emerging defect patterns while maintaining accurate identification of historical defect types.

[0030] Specifically, let the gradient of the new task be The orthogonal basis matrix of the feature subspace of the old task is (The column vectors are pairwise orthogonal and have the unit norm, i.e.) Then the gradient projection formula is: When λ=1, it degenerates into a fully orthogonal projection (hard projection). When λ∈(0,1), it is a partial projection (soft projection), which allows for a trade-off between preserving the learning ability of new tasks and preventing forgetting. The construction method of the old task feature subspace UUU is as follows: Before saving Uncentralized covariance of Gejiu task ,in Input for the task, For the sample size; Perform Singular Value Decomposition (SVD): , This is a salient feature subspace (which has a significant impact on older tasks). For low-impact subspaces (safely updatable); selected based on singular value size. The corresponding base λ% singular values ​​are used as the gradient projection subspace. The update cycle is task-level to avoid adding extra computational overhead in each iteration. Projection is triggered by the cosine similarity or angle between the gradient vector and the old task subspace; projection is triggered when the similarity exceeds a set threshold (e.g., 0.7–0.9). The projection intensity coefficient φ can be selected within the range of [0.5, 1.0] to balance learning new tasks with protecting old tasks. In coating defect detection applications, gradient projection technology enables the system to continuously learn newly emerging defect patterns while maintaining accurate identification of historical defect types.

[0031] Finally, the decoder parameters are updated to adapt to the new task. The decoder parameter update is based on the optimized signal processed by gradient projection, selectively locating and adjusting parameter components strongly correlated with the new task (such as novel defect detection). This design effectively avoids interference from irrelevant parameter changes on the performance of the old task and is a key support for the -0.9% positive transfer of the old mAP class (as shown in Table 1). The update process employs a strategy combining adaptive learning rate and parameter importance weighting: the adaptive learning rate dynamically adjusts the step size according to the parameter update magnitude, ensuring rapid convergence of new task features without overshoot; parameter importance weighting prioritizes optimizing parameters that play a crucial role in the characterization of the new defect, helping the new mAP class achieve a high performance of 94.5%, while controlling the convergence rounds to 22, balancing efficiency and stability. Furthermore, parameter updates incorporate regularization constraints and stability checks: regularization constraints suppress parameter overfitting, ensuring the decoder's generalization ability for different new defect types; stability checks monitor the model's performance changes on older tasks in real time. If a downward trend in the old class's mAP is detected, parameter adjustment rollback is immediately triggered, further protecting the original defect detection capability from degradation. In some implementations, decoder parameter updates employ a phased strategy of "coarse adjustment + fine optimization": first, coarse adjustment is performed using gradient projection signals to quickly adapt to the overall feature distribution of the new task; then, fine optimization is performed on a subset of key parameters to further improve the detection accuracy of new classes and the performance stability of old classes. After the update, the decoder not only has the ability to handle new defect types but also maintains a high performance level for the original defect detection task through the dual protection of parameter decoupling and gradient projection.

[0032] Table 1

[0033] Furthermore, the scaling and normalization operations in the data preprocessing stage establish a standardized input format for subsequent ViT processing. The scaling operation adjusts the raw images acquired from the roll-to-roll coating production line to a uniform size specification, typically using bilinear or bicubic interpolation algorithms for size transformation. In some implementations, the scaling operation adjusts the input image to a standard size of 224×224 pixels or 384×384 pixels, sizes that match the input requirements of the pre-trained ViT model. The scaling process maintains the aspect ratio of the original image, handling size mismatches through padding or cropping strategies. For roll-to-roll coating applications, the scaling operation ensures that coating surface images of different resolutions can be processed uniformly while preserving the spatial distribution information of defect features.

[0034] The normalization operation standardizes the pixel values ​​of the scaled image, adjusting the range of pixel values ​​to a predefined numerical interval. In some implementations, the normalization operation uses a zero-mean, unit-variance standardization method, converting the pixel values ​​into a distribution with a mean of 0 and a standard deviation of 1. The normalization process uses the statistical parameters of the pre-trained ViT model, including the mean and standard deviation values ​​for each color channel. For RGB images, the normalization operation applies different mean and standard deviation parameters to the red, green, and blue color channels respectively. Normalization eliminates the influence of different lighting conditions and imaging device differences on image quality, providing a stable input data distribution for the ViT encoder.

[0035] Data preprocessing also includes auxiliary operations such as noise filtering and contrast enhancement to further optimize image quality. Noise filtering employs Gaussian filtering or median filtering techniques to remove random and system noise introduced during image acquisition. Contrast enhancement improves the visual quality and feature discernibility of the image through histogram equalization or adaptive contrast adjustment. In some implementations, the preprocessing workflow also includes color space conversion, converting the image from the BGR color space to the RGB color space to ensure compatibility with the input format of the ViT model. The parameter settings for these preprocessing operations are adjusted according to the specific coating material type and imaging conditions to achieve the best feature extraction results.

[0036] The output format of the preprocessing operation adopts a standardized tensor structure, facilitating subsequent block embedding processing. The processed image data is stored in floating-point format, with pixel values ​​typically ranging from -2.0 to 2.0. The data tensor's dimensional structure is [batch size, number of channels, height, width], conforming to the standard input format of deep learning frameworks. In some implementations, the preprocessing module also generates image metadata information, including the original image size, scaling ratio, and normalization parameters. This metadata is used for subsequent result interpretation and coordinate mapping. The output of the preprocessing stage provides the ViT encoder with stable, uniformly formatted input data, ensuring the consistency and reliability of the feature extraction process.

[0037] Furthermore, the block embedding process divides the preprocessed image into multiple non-overlapping image blocks according to a fixed spatial grid pattern. In some implementations, the image block size is set to 16×16 pixels or 32×32 pixels, which matches the standard configuration of the ViT architecture. The partitioning operation starts from the top left corner of the image and extracts image blocks sequentially from left to right and from top to bottom. For an input image of size 224×224 pixels, using a block size of 16×16 pixels will produce 196 image blocks, forming a 14×14 spatial grid layout. Each image block retains the original color channel information; for an RGB image, a single image block contains 16×16×3=768 pixel values.

[0038] The linear embedding transformation of image patches converts two-dimensional image patches into one-dimensional vector representations. The embedding transformation process first reshapes the image patch from a three-dimensional tensor [height, width, number of channels] into a one-dimensional vector [height × width × number of channels]. In some implementations, a 16×16×3 image patch is flattened into a one-dimensional vector of length 768. The linear embedding layer uses a learnable weight matrix to map the flattened image patch vector to an embedding space of a specified dimension. The embedding dimension is typically set to 768, 1024, or higher, depending on the architecture configuration of the ViT model. The linear transformation operation is implemented through matrix multiplication, calculated as the embedding vector equals the product of the image patch vector and the embedding weight matrix.

[0039] Location encoding information is added to the image patch embedding vectors, providing spatial location information for the ViT model. Location encoding uses a learnable parameter matrix to assign a unique encoding vector to each image patch location. In some implementations, the dimension of the location encoding matrix is ​​the same as the dimension of the image patch embedding vectors, and location information is fused into the embedding representation through vector addition. Location encoding enables the ViT model to understand the spatial relationships between different image patches, compensating for the insensitivity of the self-attention mechanism to location information. For a 14×14 image patch grid, the location encoding matrix contains 196 distinct location vectors, each corresponding to specific spatial coordinates.

[0040] Patch embedding also includes the addition of class labels and the construction of a sequence format. A class label is a special learnable vector added to the beginning of the image patch embedding sequence. In some implementations, the class label has the same dimension as the image patch embedding vector, aggregating feature information from the entire image through global average pooling or an attention mechanism. The final embedding sequence contains 197 vectors, where the first vector is the class label, and the subsequent 196 vectors are the image patch embeddings. The construction of the sequence format provides a standardized input format for the ViT encoder, enabling the self-attention mechanism to process both global and local features simultaneously.

[0041] The numerical range and distribution characteristics of the embedding vectors affect the training stability and convergence speed of the ViT model. In some implementations, the embedding weight matrix is ​​initialized using Xavier or He initialization methods to ensure that the embedding vectors have an appropriate numerical range. The standard deviation of the embedding vectors is typically controlled between 0.1 and 1.0 to avoid gradient vanishing or exploding problems. For applications involving the detection of defects in rolled-up coatings, the embedding vectors can capture the texture details and defect features of the coating surface, providing rich information representation for subsequent feature extraction and analysis.

[0042] The computational complexity of the block embedding process is linearly related to the image size and embedding dimension. For a single image, the time complexity of the block operation is O(H×W), where H and W represent the image height and width, respectively. The computational complexity of the linear embedding transformation is O(N×P×D), where N represents the number of image blocks, P represents the number of pixels in each image block, and D represents the embedding dimension. In some implementations, the block embedding process employs a batch processing strategy, processing multiple images simultaneously to improve computational efficiency. GPU acceleration techniques are used to parallelize matrix operations, significantly reducing the computation time of the embedding transformation.

[0043] The output format of the block embedding uses a standardized tensor structure, which facilitates subsequent processing by the ViT encoder. The dimensional structure of the embedding sequence is [batch size, sequence length, embedding dimension], where the sequence length equals the number of image patches plus one. In some implementations, the embedding tensor also includes attention mask information to control the computational scope of the self-attention mechanism. The feature representation generated by the block embedding process preserves the spatial structure information of the original image while converting pixel-level visual information into a vector format suitable for Transformer processing. This conversion lays the foundation for the application of the ViT architecture in image understanding tasks, enabling the self-attention mechanism to effectively model the dependencies between image patches.

[0044] Reference Figure 2 The parameter decoupling mechanism separates parameters for different tasks by generating task masks, ensuring parameter independence between tasks. The decoupling process begins by loading a pre-trained ViT model, which contains weight parameters and network structure configurations trained on a large-scale dataset. The loading process copies the pre-trained model's parameter weights into the current system's network structure, including the encoder layer, decoder layer, and various linear transformation matrices. The pre-trained model's parameters provide a robust feature extraction foundation for subsequent task-specific learning; these parameters, after thorough training, possess a general ability to represent visual features. In the application of roll-to-roll coating defect detection, the pre-trained ViT model can identify basic visual patterns and structural features, laying the foundation for learning specific defect types.

[0045] The "Freeze Encoder Parameters" operation sets all parameters of the pre-trained ViT encoder to a non-updateable state, preventing the learning process of new tasks from corrupting existing knowledge. The freeze operation sets the gradient calculation flag of the parameters to False, ensuring these parameters do not receive gradient updates during backpropagation. The scope of frozen encoder parameters includes the queries of the multi-head self-attention layer, the key-value weight matrix, the linear transformation parameters of the feedforward neural network, and the scaling and offset parameters for layer normalization. In some implementations, the freeze operation also includes position encoding parameters and class label vectors, ensuring the encoder's full feature extraction capability is protected. The freezing strategy enables the encoder to maintain stable extraction capabilities of basic visual features when handling new defect detection tasks, avoiding feature representation degradation caused by learning new tasks.

[0046] The process of saving old task features (22) persistently stores the feature representation information of the learned task, providing a reference benchmark for subsequent parameter decoupling operations. Feature saving operations include extracting the activation value distribution, gradient statistics, and parameter importance scores of the old task across different network layers. In some implementations, old task features are saved using a feature prototype storage method, saving the typical feature vectors of each learned defect category as prototype representations. The feature saving process also records the old task's dependencies on network parameters, identifying a subset of parameters critical to the old task's performance by analyzing the magnitude and direction of parameter gradients. The stored feature information includes the mean, variance, covariance matrix, and higher-order statistics of the feature vectors; these statistics are used for subsequent task mask generation and parameter importance evaluation.

[0047] The 23-stage feature information storage phase establishes a complete knowledge base for legacy tasks, containing multi-dimensional information such as feature representations, parameter dependencies, and performance metrics. The storage system employs a hierarchical structure, storing different types of feature information in corresponding storage modules. The feature vector storage module stores activation value statistics for each network layer, the parameter importance storage module records the contribution of each parameter to the performance of the legacy task, and the gradient information storage module stores the gradient distribution characteristics during the training process of the legacy task. In some implementations, the storage system also includes task metadata information, recording the task's learning time, data distribution characteristics, and performance metric trends. The stored feature information uses a compressed encoding format to reduce storage space usage while maintaining information integrity and accessibility.

[0048] The new task feature extraction process involves 24 operations to obtain feature representation information from a new defect detection task, providing input data for task mask generation. The new task feature extraction process uses a frozen ViT encoder to process the training samples of the new task, obtaining the feature activation values ​​of each network layer. Feature extraction includes the intermediate layer outputs during forward propagation, the distribution of attention weights, and the statistical properties of the feature vectors. In some implementations, new task feature extraction also includes gradient information collection, obtaining the distribution characteristics of parameter gradients by performing forward and backward propagation on the new task samples. The extracted new task features are compared and analyzed with stored old task features to identify the uniqueness of the new task and the degree of similarity with the old task, providing a basis for subsequent parameter allocation and mask generation.

[0049] The process of generating a new task mask (25) is based on a comparative analysis of the features of the new task and the features of the old task, creating a task-specific parameter access control mechanism. The task mask generation algorithm first calculates the similarity metric between the features of the new task and the features of the old task, using cosine similarity, Euclidean distance, or more complex feature matching methods. Based on the similarity analysis results, the mask generation algorithm divides the network parameters into three categories: new task-specific parameters, task-shared parameters, and old task-protected parameters. New task-specific parameters are allowed to be freely updated during the new task learning process, task-shared parameters adopt a controlled update strategy, and old task-protected parameters remain frozen. In some implementations, the task mask is represented by a binary mask matrix, where a mask value of 1 indicates that the parameter is updatable, and a mask value of 0 indicates that the parameter is protected.

[0050] The task mask generation process also includes parameter importance assessment and conflict detection mechanisms. Parameter importance assessment determines the allocation priority of parameters by analyzing their contribution to the performance of different tasks. Importance assessment uses Fisher information matrix, gradient magnitude statistics, or attention-based importance measurement methods. The conflict detection mechanism identifies competing requirements for the same parameters between new and old tasks and resolves conflicts through parameter sharing or parameter duplication strategies. In some implementations, the mask generation process employs an iterative optimization algorithm, obtaining the optimal parameter allocation scheme through multiple rounds of adjustment and verification. The generated task mask not only controls the update permissions of parameters but also guides the execution path of gradient calculation and optimization processes.

[0051] The task masking process integrates the generated mask information into the network's training and inference processes, achieving parameter-level task isolation. The masking mechanism controls the activation state of parameters during forward propagation and the gradient propagation path during backpropagation. For parameters protected by the mask, the gradient calculation results are set to zero, preventing these parameters from being updated during optimization. For parameters that are allowed to be updated, the masking mechanism can also adjust the learning rate and regularization strength, achieving fine-grained parameter control. In some implementations, task masking employs a soft masking strategy, using continuous values ​​instead of binary values ​​to control the degree of parameter updates, providing a more flexible parameter management mechanism.

[0052] The parameter independence guarantee mechanism prevents parameter interference between different tasks through a multi-layered isolation strategy. Parameter independence guarantees include three dimensions: spatial isolation, temporal isolation, and functional isolation. Spatial isolation uses task masks to assign different tasks to different subsets of network parameters, avoiding conflicts caused by parameter sharing. Temporal isolation uses a task switching mechanism to ensure that only one task's parameters are updated within a specific time period. Functional isolation provides independent computation paths for different tasks through task-specific network branches or adapter modules. In some implementations, parameter independence is also achieved through orthogonal constraints, requiring that the parameter update directions of different tasks maintain an orthogonal relationship to maximize task independence.

[0053] The dynamic adjustment mechanism for the task mask optimizes parameter allocation strategies in real time based on performance feedback during the learning process. The dynamic adjustment process monitors the learning progress of new tasks and the performance retention of old tasks, triggering mask regeneration when performance anomalies are detected. The adjustment mechanism employs multiple monitoring methods, including performance threshold monitoring, gradient conflict detection, and feature drift analysis. In some implementations, dynamic adjustment also includes mask expansion and contraction operations, adjusting the scale of parameter allocation according to changes in task complexity. The mask adjustment process adopts a gradual strategy to avoid drastic parameter reallocation impacting model stability, ensuring the effectiveness and stability of the parameter decoupling mechanism throughout the incremental learning process.

[0054] Orthogonal gradient projection (ORP) redirects the gradients of parameters generated by a new task to a subspace orthogonal to the feature space of the old task through mathematical transformations, thus preventing the learning of the new task from destructively affecting the established feature representations. The ORP operation is based on the vector projection principle in linear algebra, decomposing the gradient vector of the new task into parallel and orthogonal components. The parallel components represent gradient directions that overlap with the feature space of the old task, while the orthogonal components represent gradient directions independent of the feature space of the old task. The projection algorithm retains the orthogonal components for parameter updates and discards the parallel components to prevent interference with the knowledge of the old task. In some implementations, the ORP transformation uses the Gram-Schmidt orthogonalization process or singular value decomposition to achieve orthogonal decomposition of the vector space.

[0055] The gradient calculation process for the new task begins with the training samples of the new task, obtaining the gradient information of the network parameters through forward and backward propagation. Gradient calculation employs the standard chain rule, propagating the error signal backward from the loss function to the parameters of each layer of the network. The loss function for the new task typically uses cross-entropy loss or mean squared error loss, with the appropriate loss calculation method selected based on the specific type of the new task. The backpropagation process calculates the partial derivatives of the loss function with respect to each network parameter, generating a gradient tensor with the same dimension as the network parameters. In some implementations, gradient calculation also includes the contribution of a regularization term, constraining the parameter update magnitude through L1 or L2 regularization. The calculated gradient for the new task contains complete information about the network parameter adjustment requirements of the new task.

[0056] The construction of the old task feature space is based on the saved feature information of the old task and the parameter importance evaluation results. The feature space construction process first extracts the feature vectors of the old task at each network layer, and identifies the main directions of the feature space through principal component analysis or independent component analysis. The old task feature space is represented by a set of orthogonal basis vectors, which span a representation subspace of the old task knowledge. The selection of basis vectors is based on the contribution of feature variance and the relevance to task performance, retaining feature directions that are important to the performance of the old task. In some implementations, the feature space construction also considers the historical distribution of parameter gradients, incorporating the gradient directions from the old task training process into the definition of the feature space. The constructed feature space is stored in the form of an orthogonal matrix, where the column vectors of the matrix correspond to the basis directions of the feature space.

[0057] The mathematical implementation of orthogonal projection uses projection matrix operations to project the gradient vector of the new task onto the complement space orthogonal to the feature space of the old task. The projection matrix is ​​calculated based on the orthogonal basis matrix of the feature space of the old task through matrix operations. Construct a projection operator, where I represents the identity matrix and U represents the orthogonal basis matrix of the old task feature space. The projection operation is performed using matrix multiplication. Implementation, in which This represents the original gradient vector for the new task. This represents the projected gradient vector. The projected gradient vector is orthogonal to any vector in the feature space of the old task, ensuring that the parameter updates of the new task do not affect the feature representation of the old task.

[0058] The gradient projection algorithm also includes an adaptive adjustment mechanism for projection intensity, dynamically adjusting the strictness of the projection based on the similarity between the new and old tasks. Similarity evaluation is achieved by calculating the cosine similarity or feature distance between the features of the new and old tasks. When the similarity between the new and old tasks is high, the projection operation employs stricter orthogonal constraints to minimize interference between tasks. When the similarity is low, the projection constraints can be appropriately relaxed, allowing the new task to utilize some shared features for learning. In some implementations, adaptive adjustment employs a weighted projection strategy, controlling the projection intensity by adjusting the weight coefficients of the projection matrix. The weight coefficients are dynamically calculated based on task similarity, learning progress, and performance metrics, enabling fine-grained control of the projection operation.

[0059] The quality assessment of the projected gradient monitors the effectiveness and rationality of the projection operation through multiple metrics. These metrics include the magnitude retention rate of the projected gradient, the direction deviation angle, and the orthogonality measure with the gradient of the old task. The magnitude retention rate measures the degree to which the projection operation retains gradient information, avoiding gradient information loss due to over-projection. The direction deviation angle measures the degree of change in the gradient direction before and after projection, assessing the impact of the projection operation on the optimization direction. The orthogonality measure verifies the orthogonality relationship between the projected gradient and the feature space of the old task, ensuring the effectiveness of task isolation. In some implementations, the quality assessment also includes convergence analysis of the projected gradient, predicting the stability of the optimization process by monitoring gradient change trends.

[0060] The computational optimization of gradient projection employs efficient numerical algorithms to reduce the computational overhead of projection operations. Computational optimization includes pre-computation of matrix factorization, sparse matrix operations, and parallel computing strategies. The projection matrix is ​​constructed using an incremental update approach; when the feature space of the old task changes, only the affected parts are updated, avoiding complete recomputation. Sparse matrix techniques leverage the sparsity of the projection matrix, reducing computational load through compressed storage and fast matrix multiplication. Parallel computing decomposes the projection operation into multiple independent subtasks, utilizing multi-core processors or GPUs to accelerate the computation process. In some implementations, computational optimization also employs approximate projection algorithms, significantly reducing computational complexity while maintaining projection effectiveness through dimensionality reduction techniques and random projection methods.

[0061] The intermediate layer feature alignment is achieved using a multi-level feature fusion algorithm, which effectively integrates feature information by establishing correspondences between network layers of different depths. The feature alignment process extracts feature representations from multiple intermediate layers of the ViT encoder, including shallow local texture features, mid-layer structural pattern features, and deep semantic abstract features. The alignment algorithm uses a feature dimension transformation matrix to map features from different layers to a unified feature space. This transformation matrix is ​​adaptively adjusted using learnable parameters. In some implementations, feature alignment employs an attention weighting mechanism, assigning dynamic weight coefficients to features at different levels. The weight calculation is based on feature correlation analysis and task relevance evaluation.

[0062] The matching algorithm uses cosine similarity to calculate the correlation between feature vectors and filters out highly correlated feature pairs by setting a similarity threshold. The matching process also includes spatial alignment to ensure that features from different layers maintain a consistent correspondence in the spatial dimension. In some implementations, feature matching employs a bidirectional matching strategy, considering both shallow-to-deep and deep-to-shallow feature correspondences, and improving the accuracy and stability of matching through cross-validation.

[0063] Feature fusion combines matched multi-layer features into a unified feature representation through weighted summation or concatenation. The fusion weights are dynamically calculated using a gating mechanism; the gating unit receives features from each layer as input and outputs the corresponding fusion weight coefficients. The fusion process employs a residual connection structure, preserving original feature information while introducing cross-layer feature interactions. In some implementations, feature fusion also includes a feature selection mechanism, using sparsity operations to filter out feature components that contribute significantly to the current task, reducing the interference of redundant information on the fusion effect.

[0064] Alignment mechanisms enhance knowledge transfer capabilities between different tasks in multi-task scenarios by sharing feature representations. The sharing mechanism uses aligned features as common representations across tasks, enabling different defect detection tasks to learn from similar visual patterns. Improved generalization is achieved through feature regularization constraints, which encourage different tasks to learn similar intermediate layer representations, enhancing the model's adaptability to new tasks. In some implementations, the alignment mechanism also includes a task-specific feature modulation module, which fine-tunes the shared features according to specific task requirements, maintaining shared features while meeting task-specific representation needs.

[0065] Furthermore, the feature storage module adopts a hierarchical storage architecture, organizing and saving the feature representations generated by previous tasks at different network layers in a hierarchical structure. The storage process includes feature vector extraction, statistical information calculation, and importance weight evaluation. In some implementations, the feature storage module creates an independent storage space for each learned defect detection task to avoid mutual overwriting and interference between feature information from different tasks. The stored feature representations include the activation value distribution of each network layer, attention weight patterns, and statistical properties of the feature vectors; this information constitutes a complete representation of the knowledge from previous tasks.

[0066] The feature representation storage operation is performed after the old task learning is completed, obtaining a statistical description of the feature distribution by traversing the training dataset. The stored procedure calculates the mean, variance, and covariance matrix of the feature vectors for each network layer, forming a mathematical description of the feature distribution. In some implementations, feature storage also includes feature prototype extraction of typical samples, identifying representative feature vectors for each defect category through clustering algorithms. Prototype features, as a compact representation of the old task knowledge, provide a reference benchmark for subsequent task comparison and conflict detection. The storage module employs compression coding techniques to reduce storage space usage, and retains the main components of the feature information through principal component analysis or sparse coding methods.

[0067] The implementation of parameter freezing in the ViT encoder protects existing knowledge by setting parameter update flags and gradient masking mechanisms. The freezing operation marks all learnable parameters in the ViT encoder as non-updateable, including the weight matrices of the multi-head self-attention layers, the linear transformation parameters of the feedforward network, and the scaling factors for layer normalization. In some implementations, parameter freezing employs a gradient masking strategy, setting the gradient values ​​of the frozen parameters to zero during backpropagation to prevent the optimization algorithm from updating these parameters. The freezing mechanism ensures that the encoder maintains stable feature extraction capabilities when processing new tasks, avoiding the degradation of old task feature representations during the new task learning process.

[0068] The task independence maintenance mechanism ensures the independence between different learning tasks through a multi-dimensional isolation strategy. Independence maintenance includes three levels of control measures: parameter space isolation, feature space isolation, and optimization process isolation. Parameter space isolation ensures that different tasks use independent subsets of parameters for learning and inference through task-specific parameter allocation. Feature space isolation prevents new task features from intruding into the feature space of older tasks through orthogonal constraints and feature projection techniques. In some implementations, task independence maintenance also includes learning rate isolation and regularization isolation, setting independent optimization hyperparameters and constraints for different tasks. The isolation mechanism ensures that the independence between tasks is effectively maintained throughout the incremental learning process through dynamic monitoring and adjustment, preventing mutual interference of knowledge between tasks and performance degradation.

[0069] This invention also discloses an online incremental defect detection system for roll-to-roll coating based on gradient sensing parameter decoupling.

[0070] The gradient-aware parameter decoupling-based online incremental defect detection system for roll-to-roll coating achieves continuous learning and detection of defect patterns in industrial coating production lines through the coordinated operation of multiple dedicated functional modules. The data preprocessing module, serving as the system's input interface, receives raw image data from the coating production line and performs preprocessing operations such as image size standardization, pixel value normalization, and noise filtering. This module also integrates a block embedding function, dividing the preprocessed image into multiple image blocks according to a fixed grid pattern and converting these image blocks into high-dimensional embedding vector representations through linear transformation. In some implementations, the data preprocessing module adopts a pipelined processing architecture, supporting parallel processing of multiple images and improving data processing efficiency through caching mechanisms and batch processing strategies.

[0071] The feature extraction module includes a ViT encoder with frozen parameters, forming the core feature extraction component of the system. The feature extraction module receives image patch embedding sequences from the data preprocessing module and extracts multi-level visual feature representations through a multi-layer Transformer structure. The parameters of the ViT encoder remain frozen during system operation, and a parameter locking mechanism prevents interference from new task learning on existing feature extraction capabilities. The feature extraction module also includes a feature caching subsystem for storing intermediate layer feature outputs, providing data support for subsequent feature alignment and decoding operations. In some implementations, the feature extraction module employs a hierarchical feature output strategy, simultaneously providing multi-dimensional feature representations of shallow texture features, mid-level structural features, and deep semantic features.

[0072] The feature decoding module includes the ViT decoder, responsible for converting abstract feature representations into concrete defect detection results. The decoder employs a reverse Transformer architecture, fusing feature information from different levels of the encoder through a cross-attention mechanism to generate detection outputs for spatial localization and category classification. The parameters of the feature decoding module can be updated during incremental learning, allowing it to adapt to new defect detection task requirements. The feature decoding module also integrates a task switching mechanism, dynamically adjusting the decoding strategy and output format based on the currently processed defect type. The feature alignment module works in conjunction with the feature decoding module, establishing correspondences between features from different network layers to achieve effective integration and fusion of multi-level feature information.

[0073] The parameter decoupling module performs parameter separation operations between tasks. By analyzing the dependencies of different defect detection tasks on network parameters, it classifies model parameters into two categories: task-shared and task-specific. The module integrates a parameter importance evaluation algorithm and a task mask generation mechanism, creating a dedicated parameter access control strategy for each learning task. The gradient projection module works closely with the parameter decoupling module, performing orthogonal projection transformations on the parameter gradients generated by the new task, redirecting the gradients to a subspace orthogonal to the feature space of the old task. The projection operation uses mathematical transformations to ensure that the learning of the new task does not destroy the established feature representations, maintaining the system's ability to detect historical defect types. The parameter update module receives the optimized signal processed by gradient projection and selectively updates the parameter components in the decoder related to the new task, achieving adaptation to new defect patterns. Simultaneously, through coordination with the parameter decoupling module, it ensures the isolation and security of parameter updates.

[0074] Referring to Table 2, the performance evaluation of the online incremental defect detection system described in this embodiment of the invention uses two key indicators, AUROC and forgetting rate, to quantify the detection effect and knowledge retention capability in the incremental learning scenario.

[0075] Table 2 The AUROC metric assesses the system's defect detection capability by calculating the area under the receiver operating characteristic curve (ROC). This metric comprehensively considers the trade-off between true positive rate and false positive rate under different threshold settings. The AUROC value is calculated based on the detection results of a large number of test samples, and accurate performance evaluation is obtained through statistical analysis. The system achieves an AUROC performance of 95.4% in four incremental learning scenarios and reaches an AUROC level of 96.5% to 96.8% in one incremental learning scenario. These performance data demonstrate that the system possesses excellent defect identification capabilities.

[0076] The Forgetting Rate (FM) metric quantifies the degree to which a system retains knowledge from previous tasks while learning a new task. This metric is calculated by comparing the performance changes of the old task before and after learning the new task. The forgetting rate is calculated as the ratio of the performance decline of the old task to the original performance; a lower value indicates stronger knowledge retention. The system uses gradient-aware parameter decoupling technology to control the forgetting rate at an extremely low level of 0.2% to 0.7%, significantly outperforming traditional incremental learning methods. The forgetting rate is measured using a multi-round evaluation strategy, performing performance tests on all learned tasks at different time points, and monitoring the stability of knowledge retention through time series analysis.

[0077] The performance of thin film anomaly detection based on the embodiments of the present invention is significantly improved compared with the basic method. It not only greatly improves the detection accuracy, but also almost completely eliminates the forgetting phenomenon, and shows strong stability and practical value in continuous learning.

[0078] This invention also discloses a readable storage medium.

[0079] A computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the online incremental defect detection method described in any of the above embodiments. The computer-readable storage medium may include any entity or device capable of carrying a computer program, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), and a software distribution medium, etc. The computer program includes computer program code. The computer program code may be in the form of source code, object code, an executable file, or some intermediate form, etc. The computer-readable storage medium may include any entity or device capable of carrying computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), and a software distribution medium, etc.

[0080] Any process or method description in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing a particular logical function or process, and the scope of the preferred embodiments of the invention includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as will be understood by those skilled in the art to which embodiments of the invention pertain.

[0081] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus or device (such as a computer-based system, a system including a processing module or other system that can fetch and execute instructions from, an instruction execution system, apparatus or device).

[0082] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for online incremental defect detection of roll-to-roll coatings based on gradient-sensing parameter decoupling, characterized in that, include: Data preprocessing and block embedding are performed on the input image; Image features are extracted using the ViT encoder with frozen parameters; The features are decoded using the ViT decoder; Perform intermediate layer feature alignment; Decouple execution parameters and separate parameters for different tasks; Gradient projection is performed on the gradient of the new task to avoid interference with the feature space of the existing task. as well as Update the decoder parameters to adapt to new tasks.

2. The online incremental defect detection method according to claim 1, characterized in that, The data preprocessing includes scaling and normalizing the input image.

3. The online incremental defect detection method according to claim 2, characterized in that, The block embedding divides the image into small blocks and converts them into embedding vectors.

4. The online incremental defect detection method according to claim 1, characterized in that, The parameter decoupling is achieved by generating a task mask to separate the parameters of different tasks, ensuring the independence of parameters between tasks.

5. The online incremental defect detection method according to claim 4, characterized in that, The gradient projection employs orthogonal gradient projection technology, projecting the gradient of the new task onto a direction orthogonal to the feature space of the old task.

6. The online incremental defect detection method according to claim 1, characterized in that, The intermediate layer feature alignment matches and fuses features from different levels to improve feature sharing and generalization capabilities in multi-task scenarios.

7. The online incremental defect detection method according to claim 1, characterized in that, It also includes saving the feature information of old tasks before learning new tasks and maintaining task independence during the learning process of new tasks.

8. The online incremental defect detection method according to claim 7, characterized in that, The process of saving the feature information of the old task includes storing the feature representations learned during the learning process of the old task and avoiding interference with existing knowledge by freezing the encoder parameters.

9. A roll-to-roll coating online incremental defect detection system based on gradient sensing parameter decoupling, characterized in that, include: The data preprocessing module is used to preprocess and embed the input image into blocks. The feature extraction module includes a ViT encoder with frozen parameters for extracting image features; The feature decoding module includes a ViT decoder, used to decode features; The feature alignment module is used to align intermediate layer features; The parameter decoupling module is used to perform parameter decoupling and separate the parameters of different tasks; The gradient projection module is used to project the gradient of a new task, avoiding interference with the feature space of the existing task. as well as The parameter update module is used to update the decoder parameters to adapt to new tasks.

10. A readable storage medium, characterized in that, The readable storage medium stores computer instructions that, when executed by a processor, implement the online incremental defect detection method as described in any one of claims 1-8.