Industrial continuous anomaly detection method and system based on embedded feature playback

By using an embedded feature replay method, the problem of insufficient effectiveness of replay strategies in industrial continuous anomaly detection is solved. By storing only one feature map per task and using a lightweight reconstruction network, the effectiveness of replay is significantly improved and forgetting is reduced, thus achieving efficient anomaly detection and localization.

CN121837735APending Publication Date: 2026-04-10HUNAN FIRST NORMAL UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511965841.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-24
Publication Date
2026-04-10

Smart Images

  • Figure CN121837735A_ABST
    Figure CN121837735A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of industrial detection, and discloses an industrial continuous anomaly detection method and system based on embedded feature playback. According to the method, the embedded playback CAD is provided, only one feature map is stored in each task, the whole feature space of a training set is covered to the maximum extent, and therefore the playback effectiveness is remarkably improved. In addition, a fine-grained embedding reconstruction is also designed to further reduce forgetting. A lightweight reconstruction network is designed to carry out anomaly detection and positioning. The method has a small parameter scale, and the overfitting of old tasks is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of industrial detection, and in particular to an industrial continual anomaly detection method and system based on embedded feature replay. BACKGROUND

[0002] Anomaly detection (AD) has a wide range of applications, including network security, medical imaging, and industrial production. Most existing AD methods usually rely on the assumption of static data, training a unified model for a fixed number of classes. However, this assumption fundamentally contradicts the dynamic data stream of real-world scenarios, where data is usually continuously input in the form of sequential tasks. When AD methods are directly applied to continual learning, there is a serious problem of catastrophic forgetting. To solve this problem, continual anomaly detection (CAD) has emerged as an innovative technology.

[0003] CAD, as a hybrid of anomaly detection and continual learning, is used to solve the problem of catastrophic forgetting in sequential auxiliary design tasks. In this method, the model is expected to learn new normal patterns while retaining knowledge from previous AD tasks, thereby preventing performance degradation as the task progresses. One basic strategy for continual learning is replay, which stores historical samples and trains them jointly with new task data to mitigate forgetting. However, as the task sequence progresses, the storage and computational costs become very large. Therefore, improving the effectiveness of the replay strategy under limited sample conditions remains a key issue. In existing methods, catastrophic forgetting of image samples can be effectively avoided. However, the images generated or randomly sampled by this existing method often do not fully cover the feature space of the training set, and may even deviate from the feature space of the training set. This deviation limits the ability of the replay method to preserve key knowledge from previous tasks.

[0004] Therefore, there is an urgent need for an industrial continual anomaly detection method that improves the effectiveness of replay and reduces forgetting. SUMMARY

[0005] The present application provides an industrial continual anomaly detection method and system based on embedded feature replay to solve the problem of difficulty in improving the effectiveness of replay and reducing forgetting in the prior art.

[0006] In a first aspect, the present application provides an industrial continual anomaly detection method based on embedded feature replay, characterized in that it comprises: Collecting images of N categories and dividing them into K index independent tasks, wherein each task only stores one feature map; A lightweight reconstruction network is constructed; the lightweight reconstruction network comprises an encoder, a feature fusion layer and a decoder connected in sequence, the encoder is used for mapping an input image into a high-dimensional space to obtain cross-level aggregated features; the feature fusion layer is used for further fusing the cross-level aggregated features; and the decoder is used for reconstructing original encoded features according to the fused features; The reconstruction features are determined based on the lightweight reconstruction network and the task; An embedding library is adopted to perform embedding playback training and embedding reconstruction inference processing based on the reconstruction features to generate an abnormal score map.

[0007] In a second aspect, the present application provides an industrial continuous anomaly detection system based on embedded feature playback, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, and the processor implements the steps of the method of the first aspect when executing the computer program.

[0008] The present application has the following beneficial effects: The industrial continuous anomaly detection optimization method based on embedded feature playback of the present application proposes an embedding playback CAD, which maximally covers the entire feature space of the training set by storing only one feature map for each task, thereby significantly improving the effectiveness of playback. In addition, a fine-grained embedding reconstruction is designed to further reduce forgetting. A lightweight reconstruction network is designed for anomaly detection and positioning. The method has a small parameter scale, reducing overfitting to old tasks.

[0009] In addition to the purposes, features and advantages described above, the present application has other purposes, features and advantages.

[0010] The present application will be further described below with reference to the drawings. BRIEF DESCRIPTION OF DRAWINGS

[0011] The accompanying drawings, which form a part of this application, are intended to provide further understanding of the application and are incorporated herein in their entirety, and the illustrative embodiments of the application and their description serve the purpose of explanations rather than limiting the application. In the drawings: Figure 1 is a flowchart of an industrial continuous anomaly detection method based on embedded feature playback according to a preferred embodiment of the present application; Figure 2 is a component framework diagram of YORO according to a preferred embodiment of the present application; Figure 3 is a positioning result diagram of YORO on MVTec AD and VisA under the SCLT-CAD environment according to a preferred embodiment of the present application. DETAILED DESCRIPTION

[0012] The technical solutions of the present application will be described clearly and completely below. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of the present application.

[0013] Unless otherwise defined, the technical terms or scientific terms used in the present application shall have the meanings commonly understood by those skilled in the art to which the present application belongs. The terms "first", "second" and similar terms used in the present application do not represent any order, number or importance, but are only used to distinguish different components. Similarly, the terms "one" or "a" and similar terms do not represent a quantity limitation, but represent the existence of at least one.

[0014] Please refer to Figure 1 The present application provides an industrial continuous anomaly detection method based on embedded feature playback, comprising: Collecting images of N categories and dividing them into K index independent tasks, wherein each task only stores one feature map; Constructing a lightweight reconstruction network; the lightweight reconstruction network comprises an encoder, a feature fusion layer and a decoder connected in turn, the encoder is used to map the input image to a high-dimensional space to obtain cross-level aggregated features; the feature fusion layer is used to further fuse the cross-level aggregated features; the decoder is used to reconstruct the original encoded features according to the fused features; Determine the reconstruction features based on the lightweight reconstruction network and the task; Using an embedding library to perform embedding playback training and embedding reconstruction inference processing based on the reconstruction features to generate an anomaly score map.

[0015] The above-mentioned industrial continuous anomaly detection optimization method based on embedded feature playback proposes an embedded playback CAD, which maximally covers the entire feature space of the training set by storing only one feature map for each task, thereby significantly improving the effectiveness of the playback. In addition, a fine-grained embedding reconstruction is designed to further reduce forgetting. A lightweight reconstruction network is designed for anomaly detection and positioning. This method has a small parameter scale, which reduces the overfitting to old tasks.

[0016] Next, the steps of the above-mentioned industrial continuous anomaly detection method based on embedded feature playback will be described in a complete example: 1. Problem definition In the context of anomaly detection, the dataset is composed of a training set Dntrain containing only normal images and Dntest containing both normal and abnormal images, n belongs to {1...N}, N represents the total number of classes. In the case of continuous anomaly detection, the images of a single or multiple classes are divided into independent tasks Tk indexed by k = 1…K. The training set in each task Tk contains normal images of one or more classes, denoted as: (1) where the subset represents the training set of the kth task, and the corresponding test set is defined as . It should be noted that when K is equal to N, the task type is a single-class long-term CAD task; otherwise, it is a multi-class short-term CAD task.

[0017] After the end of the kth incremental task, the model performance is evaluated by

[0018] 2. Method framework As shown in Figure 2 , the industrial continuous anomaly detection method based on embedded feature playback (YORO) provided by the present application is composed of two main parts: an embedding library and a lightweight reconstruction network. Specifically, the embedding library is constructed by greedy kernel set sampling, the purpose of which is to approximate the entire feature space. These embeddings are used for playback during training and reconstruction guidance during inference. The lightweight reconstruction network is responsible for extracting the embeddings of the memory library and reconstructing the original features.

[0019] 3. Lightweight reconstruction network The network uses a self-supervised trained ViT as an encoder, an MLP as a feature fusion layer, and a DSC as a decoder.

[0020] 1) Encoder: This module is to map the input image into a high-dimensional space to provide embeddings with rich information for the following reconstruction and playback. A vision transformer trained on Imagenet is used to extract features of all training data. Specifically, given the training set image , the previous multi-layer feature paradigm is followed to capture low-level spatial information and deep semantic information. This process is formalized as: (2) Here represents the output of the ith block, containing Np embeddings of specified dimensions C, L is the target layer set, represents the real domain, is the ith layer feature of the image x, ​is the final feature of the image. Finally, to obtain the cross-level aggregated features with both local detailed information and global semantic information, and also to reduce the storage amount of the embedding, the mean aggregation is performed on all layers as follows: (3) 2) Feature Fusioner: This module is responsible for further fusing the cross-level aggregated features to enhance the consistency of cross-scale semantics and the reconstruction expression ability. Considering the demand for computational efficiency, this application does not introduce complex attention or convolution operations, but uses two sets of linear transformations to compress and reorganize the fusion features. In addition, simple dropout operations are used to add perturbation information to the normal representation. This process can be formalized as: (4) Here, D is the Dropout operation, is the activation function.

[0021] 3) Feature Decoder: This module reconstructs the original encoding features from the fusion features . The decoder is composed of L DSC blocks, forming a stacked structure. Each block is composed of two layer normalization operations and a DSC, each followed by a residual connection. Finally, following the same operation as the encoder, the outputs of all blocks are averaged to produce the final reconstructed features Frec. It is worth noting that the resolution of is equal to . This process can be defined as: (5); (6); Here, is the fusion feature , is the final reconstructed feature, is the lth layer decoder, is the output of the lth layer decoder.

[0022] 4, Embedding Memory Bank Given the training set of task Tk-1 , the encoder extracts the mean features of all images . The mean feature map is divided into Np embeddings of fixed dimension C, so that the subsequent memory bank down-sampling process is at the pixel level rather than the image level. Finally, for the entire dataset, the memory bank Mk can be defined as: (7) (8) where, represents the feature of image x, is the i-th embedding in the feature map of image x, i = 1, 2... represents the number of embeddings, is the memory bank of task k, is the number of training images of task k; The memory bank MK will increase dramatically, followed by the time consumption of training new tasks and the storage required. The greedy core set algorithm is introduced in this application to extract the most representative embeddings from the embedding memory bank MK. This method achieves uniform coverage of the entire feature distribution by iteratively selecting the embedding farthest from the currently selected sample.

[0023] (9); where, is the embedding memory bank of task k, is the embedding in the constructed memory bank, is the embedding of the current task; After sampling the memory bank of the current task, is directly spliced with the previous memory bank and stored in the memory bank.

[0024] 5. Embedding replay training When the incremental task Tk is accessed, the model needs to be trained jointly with the training data and the embeddings in the embedding memory bank. Therefore, in this application, the cross-level feature map set of the current task training image is first extracted . Then, the set is sampled by the greedy core set to reduce the training data of the new task. It is worth noting that this undersampling is sampling feature maps rather than embeddings. At the same time, the stored embeddings of historical tasks are retrieved from the memory bank, and they are combined to include k-1 fake cross-level feature map sets, denoted as . Then, the current task features and historical features are merged to form the training feature set: (10); where, is the sampling rate, and is input to the latter part of the model to obtain the reconstructed feature $\hat{F}_{rec}$. Here, the reconstruction loss function is constructed by calculating the cosine similarity between and . (11) For task T1, the model only updates 6. Embedding reconstruction inference In the inference phase, the present application proposes an embedding reconstruction strategy to prevent the model from effectively reconstructing abnormal patterns. This strategy is only applicable to old tasks. Compared with previous methods based on the entire feature map, this strategy queries the most similar corresponding item for each embedding. These fine-grained embeddings can prevent misjudgments caused by local changes. Specifically, the feature map of the test image is obtained , as shown in (2) -(3). Subsequently, the feature map is decomposed into N embeddings, which are used as queries to retrieve the most similar support items from the database. Here, L2 distance is used for similarity matching. Finally, the retrieved embeddings will replace the original embeddings. This process can be expressed as follows: (12) Then, the new feature map is processed by the fusion and decoder described in (4) - (6) to generate the predicted feature . Finally, the cosine similarity of and at all positions is calculated to generate the anomaly score map . The image score is defined as the average of the U highest values in .

[0025] Below, according to the experimental verification, the effect of the above-mentioned industrial continuous anomaly detection method based on embedded feature playback is verified: The experimental setup is as follows: 1) Dataset: A large number of experiments were conducted on MVTec AD and VisA, which are the most commonly used in industrial anomaly detection.

[0026] The MVTec AD dataset contains 15 types of industrial product images, which can be divided into texture and object categories. The data includes a total of 5354 images. Among them, the training set includes a total of 3629 normal images for training. In addition, the test set contains 467 abnormal images and 1258 normal images.

[0027] The VISA dataset contains 12 types of industrial product images. It includes complex structures, multiple instances, and single instances. The training set of each category includes 450-900 normal images. The test set consists of 100 normal images and 100 abnormal images.

[0028] In order to verify the performance of the proposed method in the context of continuous learning, the present application sets up two incremental experiments: long-term incremental experiment and short-term incremental experiment For long-increment experiments, i.e., single-class incremental experiments, following previous work, this application divides MVTec AD into 15 tasks. After learning the first task, 14 incremental experiments are performed. For VisA, this application divides it into 12 tasks, and after learning the first task, 11 incremental experiments are performed. In addition, this application concatenates MVTec AD and VisA into a single dataset and performs 26 incremental experiments.

[0029] Short-term incremental experiments, also known as multi-class incremental experiments, are conducted. In this experimental setup, previous studies have represented the task sequence as XY with N Steps. Here, X represents the number of classes the model learns at once before incremental learning, Y represents the number of classes learned in each incremental task, and N represents the number of incremental tasks. For MVTec AD_MCCL, this application employs four task settings: 14-1 with 1 step, 10-5 with 1 step, 3-3 with 4 steps, and 10-1 with 5 steps.

[0030] For VisA_MCCL, this application designs three task settings: 11-1 with 1 step,8-4 with 1 step,8-1 with 4 steps.

[0031] 2) Evaluation indicators: In accordance with previous research practices, this application uses AUROC and AUPR as evaluation indicators.

[0032] In addition, to test the model's memory capacity in the context of continuous learning, this application introduces an average forgetting metric to assess the degree to which the model forgets previous tasks.

[0033] (14) Where K represents the total number of tasks, ai, j represents the model's performance on task Tj after learning task Ti, and aK, j represents the model's final performance on task Tj.

[0034] 3) Implementation Details: Network Setup: This application uses Vit-Base / 14 of DINOv2 as the encoder, with an output feature size of 784×768. The feature size remains consistent after passing through the neck network. Before entering the decoder, the features are resized to 28×28×768. To minimize memory consumption and facilitate model training, 784 feature points are sampled for each task, corresponding to one feature map, occupying a total memory space of 2.3MB. For the MVTEC dataset (3652MB) containing 3629 training images, the memory pool comprised of all tasks accounts for approximately 0.8% of the total image storage.

[0035] Training strategy: The training images are resized to 448x448 and center-cropped to 392x392. We train the model on a single Nvidia 4070 GPU. During training, the encoder is kept frozen, and the neck network and the decoder are updated by the StableAdamW optimizer with lr=2e-3. The model is trained for 5 epochs on MVTec AD. On VISA and MVTec-VisA, we train for 7 epochs. Moreover, we keep all the settings consistent with Dinomaly.

[0036] 4) Comparison methods: We quantitatively analyze the proposed method with the current state-of-the-art methods. This includes a) unsupervised anomaly detection methods, patchcore, UniAD and Dinomaly; b) unsupervised continual anomaly detection methods: UCAD, CFRCD, DNE. The UAD method is not suitable for the incremental scenario, for which we design a replay memory of the same size as the proposed method.

[0037] Comparison with SOTA: 1) Evaluation under long-term incremental experiment: Table 1 shows the comparison of the performance of the proposed method and other methods under the long-term incremental setting. As shown in Table 1: the proposed method achieves the best performance on both MVTec AD and VisA datasets. Specifically, the proposed method achieves an improvement of 3.5% in image-level AUROC on MVTec AD and 2.7% on VISA dataset compared with the previous sota method ReplayCAD.

[0038] From the content in Table 1, the present application also understands that the previous UAD method exhibits a serious forgetting phenomenon after continuous exposure to 14 new tasks. Among them, Dinomaly exhibits a slighter forgetting than other UAD methods, and the present application believes that this is not because the model has a certain memory ability, but because the last zipper has similarity with part of the historical tasks, thereby reducing the forgetting degree. In addition, the previous method IUF and CDAD, which focuses on short-term increments, exhibit similar performance to UAD methods when facing long-term incremental tasks, which shows that methods that adjust the gradient update direction through SVD and the like will still face serious forgetting problems when facing long-term incremental tasks. Although CFRDC and ReplyCAD can still achieve a satisfactory result by replaying the image-level features of historical tasks and generating real samples, there is still a big gap compared with the method of the present application. In addition, by generating samples, not only does it increase the training cost of the model, but as the continuous learning progresses, more image samples will need to be generated, further increasing the training cost of the model. In contrast, the method of the present application only needs to save 784 embeddings, which is equivalent to saving only one image for each new task, which maximally reduces the additional training cost. Finally, in order to intuitively show the memory ability of YORO, the present application gives the positioning results of all categories of MVTec AD and VisA along the entire task sequence, as shown in Figure 3 Figure 8. The present application can observe that the positioning results of YORO remain consistent to a large extent.

[0039] In the SCLT-CAD environment, the positioning results of YORO on MVTec AD and VisA. The lower left is the positioning result after each incremental task of each class learning in MVTec AD. The upper right is the abnormal positioning result after each incremental task of each class learning in VisA.

[0040] Table 1 Comparison of performance of the method of the present application and other methods

[0041] 2) Evaluation under MVTec_MCCL: To further explore the adaptability of the method of the present application under short-term multi-class continual learning, the present application carried out a large number of experiments under the multi-class incremental experimental setting of MVTecAd. As shown in Table 2, although the current UCAD method achieved a relatively satisfactory performance under the short incremental task setting of learning one class at a time, i.e. 14-1-with 1 step, it performed disappointingly under the short incremental task setting of learning multiple classes at a time. This is mainly due to the fact that IUF and CDAD use SVD to control the gradient of the new task to update in the direction of the gradient of the historical task, but when learning multiple classes at a time, the gradient direction difference is huge, resulting in the inability to cover all fronts. And UCAD does not consider the inter-class conflict when training the prompt, thus leading to semantic confusion and reducing the model performance. In contrast, the method of the present application achieved the best performance in multiple settings, especially in the 3-3 with 4 step experiment, the image-level AUROC increased by as much as 8.8%, significantly outperforming the previous optimal method, demonstrating the strong advantage of the method of the present application under complex short-term multi-class incremental tasks. It is worth noting that, as shown in Table 2, the FM of the method of the present application also achieved the best result under multiple short-term incremental experimental settings, and the index of the method of the present application is less than 0 in the three tasks. This means that as the continual learning deepens, the method of the present application not only does not forget, but also achieves performance improvement. The present application believes that this is mainly due to the fact that the decoder structure of the model is simple and it is difficult to learn key features from a large number of redundant features, and after kcenter sampling, the model can focus on more representative features.

[0042] Table 2 Performance comparison of the method of the present application under multiple short-term incremental experimental settings

[0043] To further verify the continual learning ability of the model of the present application, the present application designed three multi-class short-term incremental experiments on the more complex VisA dataset: 11-1 with 1 step, 8-4 with 1 step and 8-1 with 4 step. As shown in Table 3, the catastrophic forgetting problem shows more significant catastrophic forgetting on the Visa dataset. This is reflected in the fact that the FM index of the UAD method and the UCAD method shows a certain degree of decline compared to this index on MVTec_MCCL. Although the method of the present application did not achieve the absolute best in the FM index in all settings, the method of the present application still achieved all the best results in the three experimental settings. In particular, in the 8-1 with 4 step, the method of the present application increased by 9.7% in I-AUROC compared to the second place.

[0044] Table 3. Illustration of three multi-class short-term incremental experiments

[0045] Ablation experiments and analysis are as follows: All the following experiments are conducted by MVTec AD under one-class incremental.

[0046] Effectiveness of main components: The present application first investigates the effectiveness of three main components: (C1) embedding replay, (C2) embedding reconstruction, (C3) lightweight reconstruction network, as shown in Table 4. The first row shows the baseline performance under the sct-cad setting. It can be observed that without embedding replay (the second row), the model suffers from severe catastrophic forgetting. In addition, combining embedding reconstruction can significantly improve, with an increase of 15.5% in I-AUROC and 20.1% in P-AP compared with the baseline (the third row). In order to further verify the effectiveness of embedding replay, the present application constructs an image-level feature map library with the same size, and uses greedy kernel set sampling. As shown in Table 5, compared with image-level replay, embedding replay achieves significant improvement on all indicators.

[0047] Table 4. Illustration of effectiveness of three main components

[0048] Table 5. Illustration compared with image-level replay

[0049] In addition, as shown in Table 4, the lightweight reconstruction network has a significant contribution to the anomaly detection performance (the fourth and fifth rows). Specifically, using the lightweight reconstruction network and the undersampling strategy, the performance on the MVTec dataset is improved by 2.9%, and the performance on the VisA dataset is improved by 6.1%.

[0050] 2) Effectiveness of different backbone networks The present application reports the results of different backbone networks on MVTec AD in Table 6. It is worth noting that the present application observes that different backbone networks have a very serious impact on anomaly detection under the incremental scene, which presents a significant difference from unsupervised multi-class anomaly detection. This result can be attributed to the feature redundancy under the anomaly detection scene, and different pre-training models can model semantic information, so the difference is small. In the incremental anomaly detection scene, the present application only replays a few key pixel-level features, which significantly magnifies the difference between the modeling capabilities of the model features. Among them, MAE focuses on reconstructing low-level spatial information. This cannot capture the representation with rich semantic information for the decoder, making it difficult to support the decoder to adapt to the change of class distribution in the incremental task. In contrast, DINOv2 enhances the representation ability of local regions and general discriminative features through self-supervised contrastive learning, and is more suitable for the requirements of feature stability and generalization under the pixel-level playback mechanism, so it performs significantly better in incremental anomaly detection. In addition, the present application notes that Vit trained with supervised learning is lower than pre-training models trained with self-supervised learning. This result can be attributed to the fact that supervised models rely on task-specific label-driven semantic learning, lack the ability to model cross-task general features, and are more likely to forget old task knowledge when faced with incremental tasks.

[0051] Table 6 Results of different backbone networks on MVTec AD

[0052] 3) Effectiveness of different knowledge base sizes: To explore the impact of the number of examples on the present application method, the present application scales the number of examples to 0.25, 0.5, 0.75, 2, 4 of the base number. The base example is to sample 784 embeddigs for each class, corresponding to one example. As shown, when the capacity increases from 0.25 to 1.0, the performance rises rapidly from about 96.4% to 98.3%. In addition, when the storage capacity is 2, the method of the present application reaches 99.0%, which has exceeded some anomaly detection algorithms. More notably, the method of the present application still exceeds the current SOTA method by 1.5% in I-AUROC even when replaying "one quarter of the image". This significant achievement fully demonstrates the effectiveness of pixel feature playback for preserving old task knowledge.

[0053] In addition, the present application further analyzes the relationship between different memory bank capacities and inference speeds. As shown in Table 7, when the memory bank capacity is set as the base setting, the storage space occupied by YORO increases from 8.05 MB to 128.8 MB as the memory bank capacity increases from 0.25 times to 4 times, and the inference frame rate (FPS) gradually decreases from 66.14 to 46.19. However, when the storage space is less than 64.4 MB (i.e., the memory bank capacity does not exceed 2 times), the inference speed is basically maintained above 57 FPS, indicating that the expansion of the memory bank has little effect on the inference efficiency of the model within this range. Therefore, in actual deployment, the memory bank can be moderately expanded without significantly sacrificing speed to improve detection performance.

[0054] Table 7 Relationship between different memory bank capacities and inference speeds

[0055] In summary, the present application proposes a simple and effective continuous anomaly detection framework YORO. It constructs an embedding bank to avoid the problem of catastrophic forgetting. This memory bank has only one sample for each class, which is very close to the feature distribution of the training set, preventing normal samples from being misclassified. In addition, considering that historical samples only account for a small part of the training data, a lightweight reconstruction network with small parameter size is proposed to alleviate overfitting. Comprehensive experiments show that the method of the present application achieves the state-of-the-art performance in both long-term and short-term continuous anomaly detection scenarios, with an inference speed of 61.5 FPS. Notably, it achieves an I-AUROC of 96.2% in the ultra-long-term continuous anomaly detection setting, covering 27 tasks. In the future, the goal of the present application is to introduce a biased reconstruction loss to guide the model to focus on limited samples, thereby improving its performance.

[0056] The present application also provides an industrial continuous anomaly detection system based on embedded feature playback, including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program. The industrial continuous anomaly detection system based on embedded feature playback can implement various embodiments of the above industrial continuous anomaly detection method based on embedded feature playback and achieve the same beneficial effects, which will not be described here.

[0057] The above is merely a specific implementation of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any changes or replacements within the technical scope disclosed by the present disclosure can be easily thought of by those skilled in the art, which should be covered within the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be subject to the protection scope of the claims.

Claims

1. A method of industrial continuous anomaly detection based on embedded feature playback, characterized in that, include: Collect images of N categories and divide them into K index-independent tasks, where each task stores only one feature map; A lightweight reconstruction network is constructed, comprising an encoder, a feature fusion layer, and a decoder connected in sequence. The encoder maps the input image to a high-dimensional space to obtain cross-level aggregated features. The feature fusion layer further fuses the cross-level aggregated features. The decoder reconstructs the original encoded features based on the fused features. Reconstruction features are determined based on the lightweight reconstruction network and the task. An embedding library is used to perform embedding playback training and embedding reconstruction inference processing based on reconstructed features to generate anomaly scoring maps.

2. The method of claim 1, wherein, The encoder's processing steps include: Given training set images Following the previous multi-layer feature paradigm to capture low-level spatial information and deep-level semantic information, the following relationship is satisfied: ; wherein, represents the output of the i-th block, containing Npembeddings of a specified dimension C, L is the target layer set, denotes the real number field, is the i-th layer feature of the image x, is the final feature of the image; The cross-level aggregated features are obtained by aggregating the mean across all layers, as follows: 。 3. The method of claim 1, wherein, The processing steps of the feature fusion layer are as follows: Two sets of linear transformations are used to compress and reshape the fused features, and dropout operation is used to add perturbation information to the normal representation, satisfying the following relationship: ; In the formula, D is a Dropout operation, is an activation function.

4. The method of claim 1, wherein, Decoder comprises L DSC blocks forming a stacked structure, each DSC block comprises two layer normalization operations and one DSC, each operation followed by a residual connection, finally, the outputs of all blocks are averaged following the encoder operation to produce the final reconstructed feature ; the resolution of the output of the decoder is equal to , satisfying the following relation: ; ; wherein is a fusion feature , is a final reconstruction feature, is an l-th layer decoder, is an output of the l-th layer decoder.

5. The method of claim 1, wherein, The method of using an embedding library for embedding playback training based on reconstructed features includes: For the entire dataset, the memory Mk is defined as follows: ; ; wherein, represents a feature of an image x, is the i-th embedding in the feature map of image x, i = 1, 2... represents the number of embeddings, is the memory bank of the k-th task, is the number of training images of task k; A greedy kernel set algorithm is introduced to extract the most representative embeddings from the embedding memory Mk. By iteratively selecting the embedding that is furthest away from the currently selected sample, uniform coverage of the entire feature distribution is achieved, as follows: ; wherein is an embedding memory bank for the kth task, is an embedding in the built memory bank, is an embedding for the current task; After sampling the memory pool of the current task, the memory pool is stored in the memory pool after being directly spliced with the previous memory pool. After sampling the memory pool of the current task, the memory pool is stored in the memory pool after being directly spliced with the previous memory pool. When the incremental task Tk is accessed, the model needs to be jointly trained with the training data and the embeddings in the embedding memory bank, first, the cross-level feature map set of the current task training image is extracted , then, the set is greedily core set sampled, where this undersampling is sampling feature maps rather than embeddings; meanwhile, the stored embeddings of the historical tasks are retrieved from the memory bank and combined with k-1 fake cross-level feature map sets, denoted as , then, the current task features and the historical features are merged to form the training feature set: ; where, is the sampling rate, and is input to the second half of the model to obtain reconstructed features where the reconstruction loss function is constructed by computing the cosine similarity between and as follows: ; For task T1, the model is updated only based on all training data for the current task.

6. The method of claim 1, wherein, The steps of the embedding reconstruction inference process are as follows: In the inference phase, for each embedding query, the most similar corresponding item is obtained for the old task, and the feature map of the test image is obtained , then the feature map is decomposed into N embeddings, which are used as queries to retrieve the most similar support items from the database, with L2 distance for similarity matching, finally, the retrieved embeddings replace the original embeddings, satisfying the following relationship: ; Then, the new feature maps are processed by the fusion and decoder. Generate predictive features ; Compute and Cosine similarity at all positions, generate anomaly score map , where image score is defined as the mean of the U highest values in U.

7. An industrial continuous anomaly detection system based on embedded feature playback, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method described in any one of claims 1-6.