A weakly supervised video anomaly detection method and system based on continuous thought chain reasoning

By employing a weakly supervised video anomaly detection method based on continuous thought chain reasoning, combined with a large language model and an adaptive learning mechanism, this method addresses the shortcomings of interpretability and generalization in existing technologies. It achieves high-precision and interpretable video anomaly detection, adapts to dynamic environmental changes, and reduces catastrophic forgetting.

CN122391700APending Publication Date: 2026-07-14UNIV OF ELECTRONICS SCI & TECH OF CHINA

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
UNIV OF ELECTRONICS SCI & TECH OF CHINA
Filing Date
2026-04-02
Publication Date
2026-07-14

AI Technical Summary

Technical Problem

Existing video anomaly detection methods are inadequate in terms of interpretability, generalization ability, and high-level semantic understanding. They are difficult to adapt to changes in dynamic environments and are prone to catastrophic forgetting.

Method used

We employ a weakly supervised video anomaly detection method based on continuous thought chain reasoning, combining a large language model and an adaptive continuous learning mechanism. Through semantic feature embedding and interpretable anomaly scoring, we generate a coherent dynamic continuous thought chain reasoning model, achieving high-precision detection and continuous adaptive learning.

Benefits of technology

It achieves high-precision anomaly detection, provides interpretable inference output, has adaptive capabilities, and can continuously learn in dynamic environments while reducing catastrophic forgetting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122391700A_ABST
    Figure CN122391700A_ABST
Patent Text Reader

Abstract

The application discloses a weakly supervised video anomaly detection method and system based on continuous thinking chain reasoning. The weakly supervised video anomaly detection method based on continuous thinking chain reasoning comprises the following steps: performing data preprocessing on a video to be detected, and extracting low-level spatiotemporal features; embedding the low-level spatiotemporal features through semantic features, and converting the low-level spatiotemporal features into a high-order continuous feature sequence; driving the high-order continuous feature sequence through an interpretable anomaly score and thinking reasoning, comparing the similarity according to a hidden space prototype, constructing a causal reasoning feature, and generating an anomaly score; performing self-adaptive continuous learning and memory integration, combining new knowledge, and reserving constraints of old experience; and outputting an anomaly detection result. The weakly supervised video anomaly detection method and system based on continuous thinking chain reasoning provide a new solution with engineering deployment value for weakly supervised video anomaly detection in real and complex monitoring scenes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of video understanding in computer vision, specifically relating to a weakly supervised video anomaly detection method and system based on continuous thought chain reasoning. Background Technology

[0002] With the continuous development of modern surveillance and security systems, Video Anomaly Detection (VAD) has become a crucial cornerstone for ensuring public safety (such as the timely identification of threats arising from irregular events like accidents, attacks, or theft). By automating and monitoring large-scale video streams, the workload of human operators can be significantly reduced, situational awareness can be improved, and rapid intervention in emergency situations can be achieved. With the exponential growth of video data and surveillance infrastructure, there is an increasing need for new anomaly detection frameworks that are highly reliable, scalable, and interpretable.

[0003] Current research on video anomaly detection can be broadly categorized into unsupervised and weakly supervised methods. Unsupervised methods typically model normal behavioral patterns from large amounts of unlabeled data and label deviations from these patterns as anomalies. While these methods avoid the cost of manual annotation, they often face the risk of failure when anomalous features are visually similar to normal features (e.g., slow-motion violence or prolonged slow lingering). Weakly supervised video anomaly detection (WSVAD), on the other hand, utilizes more economical video-level labels, significantly reducing frame-level annotation costs and achieving remarkable progress in learning discriminative features, thus becoming the mainstream paradigm.

[0004] Despite the progress made by methods such as weakly supervised multiple instance learning (MIL) in video anomaly detection, the following persistent limitations remain:

[0005] (1) Severe lack of interpretability: Most existing methods rely on using 3D convolutional neural networks and other means to extract low-level visual embeddings, and train the mapping end-to-end to output a single and opaque anomaly score. The model lacks internal reasoning logic that can be understood by humans. In real-world surveillance applications that are extremely safety-critical, this typical "black box" prediction significantly reduces the trustworthiness of the detection results.

[0006] (2) Limited generalization ability when facing emerging and dynamically evolving anomalies: Most existing WSVAD frameworks are static or only fit the training set data, making it difficult to adapt to the real generalization needs arising from the continuous evolution of scene, lighting, personnel, and anomaly types in dynamic environments. In practice, this often leads to feature drift or missed detection of long-tail anomalies. Once an emerging anomaly pattern appears, the model usually needs to undergo costly data playback and full retraining. Some existing continuous learning (CL) methods developed for image classification are prone to falling into a serious catastrophic forgetting trap when faced with video anomaly detection data in continuous stream format and with highly imbalanced classes.

[0007] (3) Lack of high-level intent and semantic understanding: Such methods lack the broad general knowledge and structured understanding modules that utilize large-scale text pre-trained models, making it difficult to capture high-level features such as object entity interaction, criminal intent and scene deep context. This part of the context information is crucial for identifying subtle or ambiguous complex abnormal events.

[0008] To address the aforementioned issues, this invention proposes a weakly supervised video anomaly detection method and system based on continuous thought chain reasoning. It introduces common sense understanding from Large Language Models (LLM) into anomaly detection, combining video spatiotemporal embedding with textual prompts to generate a coherent dynamic continuous thought chain reasoning model (TW-VAD). Based on this, an adaptive continuous learning mechanism with incremental memory caching is developed to enable accurate multimodal anomaly popularity reasoning and precise localization prediction techniques for datasets exhibiting dynamic evolution characteristics. Summary of the Invention

[0009] The purpose of this invention is to provide a weakly supervised video anomaly detection method based on continuous thought chain reasoning. This method is based on continuous thought chain reasoning and has an autonomous smooth update mechanism, which can simultaneously achieve high-precision detection, complete and interpretable reasoning output, and continuous adaptive learning.

[0010] To achieve the above objectives, the technical solution adopted is as follows:

[0011] A weakly supervised video anomaly detection method based on continuous thought chain reasoning includes the following steps:

[0012] S1: Perform data preprocessing on the video to be detected, extract appearance features and motion features, and obtain low-level spatiotemporal features;

[0013] S2: The low-level spatiotemporal features are embedded with semantic features and transformed into a high-order continuous feature sequence that covers interaction relationships and contextual information;

[0014] S3: Through interpretable anomaly scoring and reasoning, driven by the aforementioned high-order continuous feature sequence, causal reasoning features are constructed and anomaly scores are generated based on the similarity of latent space prototypes.

[0015] S4: Through adaptive continuous learning and memory integration, the constraints of combining new knowledge and retaining old experience are completed;

[0016] S5: Output the anomaly detection results.

[0017] Furthermore, in step S2, the transformation process through semantic feature embedding is as follows:

[0018] S21: Combine appearance and motion features from low-level spatiotemporal features to form a complete segment-level joint feature state vector, and then generate enhanced features through data augmentation;

[0019] S22: The enhanced features are placed into a self-attention-based transition adapter, and then sequentially processed through linear mapping, ReLU nonlinear activation, positional encoding injection, and layer normalization to align the feature space to a higher-order semantic embedding space while maintaining temporal order, resulting in an adapted embedding vector. ;

[0020] S23: Embed the aforementioned adaptation vector The original spatiotemporal visual features are aligned and input into the joint mapping space after being fed into the large language model to obtain the segment semantic embedding vector. Then, the semantic embedding vectors of the entire video segments are used. By arranging them sequentially, the semantic sequence of the entire video is obtained. ;

[0021] S24: Regarding the aforementioned semantic sequence A timing encoder that preserves the continuity and consistency between consecutive frames. After processing, the final structured semantic feature sequence is obtained. That is, the higher-order continuous feature sequence.

[0022] Furthermore, the specific process of step S22 is as follows:

[0023] S221: Project the enhanced features from the original high-dimensional video feature space to a dimensionless space using a linear mapping. The unified embedding space yields the intermediate projection vector. ;

[0024] S222: Regarding the intermediate projection vector First, apply the ReLU activation function to introduce nonlinear discrimination capability, then use position encoding. Injecting temporal location information yields a feature vector with temporal awareness capabilities. ;

[0025] S223: Regarding the aforementioned feature vector The execution layer normalizes and outputs the adapted embedding vector for the fragment. .

[0026] Furthermore, the specific process of step S23 is as follows:

[0027] S231: Embed the aforementioned adaptation vector The input is fed into a large language model to generate semantic context encoding vectors. ;

[0028] S232: Then through a learnable linear mapping operator The output features of the lightweight large language model, which includes large-scale pre-trained commonsense weights, are projected onto a unified semantic embedding space dimension. After further layer normalization, the segment semantic embedding vector is obtained. The formula is as follows:

[0029] ;

[0030] All The semantic embeddings of each time segment are arranged sequentially to obtain the semantic sequence of the entire video. .

[0031] Furthermore, the process of interpreting anomaly scoring and reasoning in step S3 is as follows:

[0032] S31: Single-frame embedding By linear projection mapping operator A preliminary anomaly score was obtained. Then, after applying a differential activation function, the baseline outlier score distribution at the current fragment level is quantitatively estimated and obtained. ;

[0033] S32: Build size is Learnable reference prototype library Then, calculate the cosine similarity between the current fragment embedding and each prototype; then... The cosine similarity scores are horizontally concatenated to obtain a result reflecting the current segment. Similarity alignment vector with the entire prototype library ;

[0034] S33: Reconstruct the alignment vector into structured verification features, and perform a chain-of-thought transformation. Subsequently, through refinement, reasoning characteristics targeting the analysis of explanatory intent are obtained. Summary of results .

[0035] Furthermore, the adaptive continuous learning and memory integration process in step S4 is as follows:

[0036] S41: Reasoning Features Introducing parameter space to obtain ; Utilizing time-gated cyclic units to analyze contextual step dependencies within long sequences, forming temporally related context embeddings;

[0037] S42: A one-dimensional convolutional filter is used to locally aggregate the context embeddings of three adjacent time steps, suppressing embedding jitter caused by video artifacts and short-term noise, and reconstructing a smoother temporal embedding response. ;

[0038] S43: Based on the aforementioned embedded response The Softmax attention probabilistic addressing mechanism calculates the attention weights of the current segment to each memory slot; then it performs a weighted linear combination of the attention weights for all activated memory slots.

[0039] S44: Establish continuous update and iteration operations Each time segment is processed, the memory matrix is ​​modified. Perform a lightweight adaptive incremental fine-tuning to ensure that the memory continuously absorbs emerging anomalies while protecting historical knowledge from being overwritten.

[0040] Furthermore, in step S42, the variation magnitude between embeddings at adjacent time steps is directly constrained in the training objective to construct a temporal consistency penalty loss term, the formula of which is shown below:

[0041] ;

[0042] Among them, the aforementioned For time-series smoothing weight hyperparameters, This represents the total number of time segments in the current video. The difference between two adjacent context embedding vectors The square of the norm.

[0043] Furthermore, in step S43, the formula for calculating the attention weight is as follows:

[0044] ;

[0045] in, The number of memory slots For memory slot index, t is time; For the first Each memory slot stores a vector of historical feature anchor points. For the current reasoning embedding and the first The dot product of memory slots;

[0046] The formula for calculating the state of historical knowledge integration is: .

[0047] Furthermore, in step S44, the update iteration operation process is as follows:

[0048] S441: Calculate the residual offset vector between the current inference embedding and each memory slot. Its formula is: ;

[0049] S442: Based on the attention weights described above For the The formula for weighted incremental updates of memory slots is as follows: ;in, This is the hyperparameter for memory learning rate.

[0050] Another objective of this invention is to provide a weakly supervised video anomaly detection system based on continuous thought chain reasoning.

[0051] To achieve the above objectives, the technical solution adopted is as follows:

[0052] A weakly supervised video anomaly detection system based on continuous thought chain reasoning, used to implement the aforementioned weakly supervised video anomaly detection method, includes:

[0053] Data preprocessing module: Extracts appearance and motion features to obtain low-level spatiotemporal features;

[0054] Semantic feature embedding module: converts the low-level spatiotemporal features into a high-order continuous feature sequence that covers interaction relationships and contextual information;

[0055] Explainable Anomaly Scoring and Reasoning Module: Constructs causal reasoning features and generates anomaly scores based on similarity comparison of latent space prototypes;

[0056] Adaptive continuous learning and memory integration module: Introduces memory slot attention allocation weights to complete the constraints of combining new knowledge and retaining old experience.

[0057] Compared with the prior art, the present invention has the following advantages:

[0058] This invention belongs to the field of video understanding in computer vision and machine learning. It proposes a video anomaly detection method and system based on continuous thought chain reasoning (TW-VAD), a method based on deep learning and large language models, primarily focusing on weakly supervised video anomaly detection (WSVAD). This invention mainly utilizes a semantic feature embedding module driven by a large language model (LLM) to achieve high-level semantic expression, and generates interpretable anomaly scores and thought chain (CoT) reasoning processes through prototype comparison. Furthermore, by integrating an adaptive continuous learning module, it incrementally updates the anomaly and normal pattern libraries, mitigating catastrophic forgetting and enabling the model to adapt to the constantly evolving dynamic monitoring environment in real-world scenarios. By combining traditional feature-driven detection with language-based logical reasoning and continuous learning, it aims to enhance the accuracy and interpretability of anomaly score prediction under weakly supervised single-label data. The specific innovations are as follows:

[0059] 1. This invention proposes a TW-VAD (Thinking While Watching, a specific implementation of Video Anomaly Detection) integration method and system, successfully achieving accurate detection driven by deep semantic fusion. Its integrated SFE module completely abandons purely low-level stacked feature operators, feeding traditional optical flow motion video features into a large language model to achieve high-level semantic expression. It can capture subtle touch interactions between objects and long-range intentions within the environment, breaking through the technical bottleneck of previous frameworks lacking high-dimensional information integration (leading to easy misjudgment of actions).

[0060] 2. The technical solution of this invention provides highly interpretable feedback in the system's decision-making mechanism. The scoring module (EAS) built by this invention anchors the thin neural expression to the latent space prototype. It is no longer limited to single-threshold probability alarms; due to the addition of the thought chain dimension generation, the model's feedback includes precise judgment and analysis of the behavior's location and intuitive textual descriptions with complete structure and intermediate logic, ensuring transparency and human verifiability in security control and alarm feedback.

[0061] 3. The technical solution of this invention possesses a highly robust, anti-crash, adaptive, and continuous learning function. Relying on the combination of adaptive memory caching and smoothing constraint terms (ACM continuous learning module), when dealing with new anomalous modalities that have not been seen for a long time or background migrations with drastic lighting changes, the system performs generic alignment through memory matrix attention on the one hand, and adjusts the knowledge base capacity in real time through the difference evolution formula on the other hand, thus fundamentally solving the catastrophic feature forgetting problem that often occurs in video stream detection. Attached Figure Description

[0062] Figure 1 This is a diagram showing the internal basic process and module distribution of the core framework system of the weakly supervised video anomaly detection (TW-VAD) based on continuous thought chain reasoning proposed in this invention. Detailed Implementation

[0063] To further illustrate the present invention's weakly supervised video anomaly detection method and system based on continuous thought chain reasoning, and to achieve the intended objectives, the following detailed description, in conjunction with preferred embodiments, details the specific implementation, structure, features, and effects of the method and system based on continuous thought chain reasoning proposed in this invention. In the following description, different "embodiments" or "embodiments" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics in one or more embodiments can be combined in any suitable manner.

[0064] Before elaborating on the weakly supervised video anomaly detection method and system based on continuous thought chain reasoning of the present invention, it is necessary to further explain the relevant terms mentioned in the present invention in order to achieve better results.

[0065] Terminology Explanation:

[0066] WSVAD: Weakly Supervised Video Anomaly Detection. This visual early warning research technique means that the data used to train the network model often only needs to provide coarse-grained, whole-video-level positive and negative labels indicating whether an accident or anomaly has occurred, without needing to label and confirm "every frame" of the anomaly's start and end segments, which is extremely labor-intensive.

[0067] LLM stands for Large Language Model. In this invention, it refers to a model trained on a broad semantic and textual corpus, possessing strong generalization and reasoning / cognitive association capabilities. It typically functions as an analyzer for semantic contextual information in videos.

[0068] CoT: Chain-of-Thought, refers to a chain-of-thought reasoning scheme. When a model encounters a task requiring long and tedious judgments, it is guided to break down the conclusion steps that would normally jump directly to the end into a series of intermediate step-by-step verification logics with correlations and progressive derivation sequences (from hidden features to explicit language), thereby enabling it to be self-explanatory.

[0069] Having understood the relevant terminology mentioned in this invention, the following will provide a more detailed description of a weakly supervised video anomaly detection method and system based on continuous thought chain reasoning, in conjunction with specific embodiments:

[0070] Example 1.

[0071] The purpose of this invention is to overcome the problems of poor interpretability of output results, lack of high-level semantic understanding, and susceptibility to feature drift and catastrophic forgetting in existing video anomaly detection methods when faced with dynamically evolving continuous streaming data. This invention introduces a large language model as the core semantic feature embedder, extracting abstract representations with temporal consistency and logical coherence. This is then combined with prototype-based high-dimensional space matching and thought chain reasoning, supplemented by an adaptive attention memory slot update and retention mechanism. Ultimately, this enables accurate segment-by-segment anomaly scoring in downstream detection tasks, and simultaneously outputs human-readable written clues interpreted by reasoning embeddings.

[0072] Based on the above-mentioned inventive concept, this invention proposes a weakly supervised video anomaly detection method (TW-VAD) based on continuous thought chain reasoning, which specifically includes the following steps:

[0073] S1 Preprocessing

[0074] This paper defines and preprocesses the data for weakly supervised video anomaly detection in this field. It assumes that each input video to be monitored is divided into... For a fixed-length time segment (temporal segment), for the first For each time segment, a pre-trained optical feature extractor (such as the I3D model) is used to extract its features in dimension 1. RGB spatial appearance features and dimensions are optical flow motion characteristics Under weakly supervised annotation settings, only binary video-level labels reflecting whether anomalies have occurred in the entire video are provided, without providing specific frame boundaries where anomalies have occurred.

[0075] S2 Semantic Feature Embedder (SFE)

[0076] The semantic feature embedding process, combined with a multimodal large language model (LLM), transforms the extracted low-level spatiotemporal features into a representative high-order continuous feature sequence encompassing interaction relationships and contextual information. SFE is the core module connecting low-level spatiotemporal video features with high-level semantic reasoning. The specific algorithm and feature transfer operations are as follows:

[0077] S21: Combine appearance features and motion features to form a complete segment-level joint feature state vector. Data augmentation operations Adding random Gaussian noise and data replaying / scaling enhances the generation of enhanced features. The complete input sequence is represented as follows: .

[0078] S22: Apply the enhanced features obtained in step S21 The I3D feature space is aligned to a higher-order semantic embedding space while maintaining temporal order by sequentially passing through a self-attention-based transition adapter, followed by linear mapping, ReLU nonlinear activation, positional encoding injection, and layer normalization. The complete transformation is performed in three sub-steps S221-S223, specifically:

[0079] S221: Enhancement features Apply linear mapping module From the original Projecting the high-dimensional video feature space onto a dimension of The unified embedding space yields the intermediate projection vector. The formula is as follows:

[0080]

[0081] in, For the first The joint feature vector of each time segment after data augmentation (obtained from step S21), superscript This indicates that it has been enhanced; superscript. Indicate the current time step; It is a learnable linear transformation matrix (fully connected layer), subscript Derived from projection, responsible for changing dimensions from Compress or expand to the target dimension ; For the mapped dimensional intermediate feature vector, subscript This indicates that the vector comes from a linear projection operation. To unify the dimensional hyperparameters of the embedding space.

[0082] S222: Projection vector First, an element-wise ReLU activation function is applied to introduce nonlinear discriminative capability, and then positional encoding is used. Injecting temporal location information yields a feature vector with temporal awareness capabilities. The formula is as follows:

[0083]

[0084] in, For the rectified linear unit activation function, Calculate each element By setting negative values ​​to zero, invalid activations are filtered out, enhancing the sparse discriminative power of features; For the positional encoding operator, the segment temporal index is... The corresponding location information is additively incorporated into the feature vector, enabling the model to distinguish segments of the same content appearing at different time locations, including the index. Derived from positional; To introduce the feature vector after temporal location awareness, the subscript This indicates that the vector has been enhanced with positional encoding.

[0085] S223: For eigenvectors Execution layer normalization This stabilizes the activation distribution across all dimensions, ultimately outputting the adapted embedding vector for the segment. The formula is as follows:

[0086]

[0087] in, Layer Normalization normalizes the mean and variance of the input vector to zero, making the numerical scale of each dimension uniform, avoiding gradient explosion or vanishing during training, and making the feature distribution close to the input expectation of subsequent large language models. The wavy line is the final adapted embedding vector for the current segment. This indicates that enhancements and adaptations have been performed; subscript... As a time segment index, this vector will be input into the large language model in the subsequent step S23; To adapt to the embedding dimension and maintain consistency with the subsequent semantic embedding space dimension, it is determined by the hyperparameter.

[0088] S23: The adaptation embedding vector output in step S22 The input is fed into a lightweight large language model (LLM) containing a large number of pre-trained commonsense weights, fusing visual embeddings and textual description cues to enable the model to perform high-level abstraction of the semantic content of the current video segment at the linguistic logic level. This step is completed in two sub-steps, S231 and S232, as follows:

[0089] S231: Embed the adapter Input LLM and generate semantic context encoding vectors The formula is as follows:

[0090]

[0091] in, The output of step S22 is the first Segment adaptation embedding carries aligned visual spatiotemporal information processed by linear mapping, ReLU activation, position encoding, and layer normalization, with subscripts... For time segment indexing; This represents a lightweight large language model (this invention uses the all-MiniLM-L6-v2 branch of SentenceTransformer), whose internal weights are derived from pre-training on a large-scale corpus, and has the ability to map visual input to a high-order latent vector space carrying common sense semantics. The semantic context feature vector output by LLM, with subscripts... This indicates that it originates from a large language model, superscript Mark the current processing time segment; The intermediate semantic dimension of the LLM hidden layer output is usually determined by the hidden layer width of the selected model.

[0092] S232: Through learnable linear mapping operators Projecting LLM output features onto a unified semantic embedding space dimension of the system. After further layer normalization, the segment semantic embedding vector is obtained. The formula is as follows:

[0093]

[0094] in, This is a learnable text-side projection mapping operator responsible for adjusting the output dimension of the LLM. Align with the semantic embedding dimension used uniformly by the system. subscript This indicates that the mapping is aligned with text / semantic features; To normalize the layers, stabilize the activation distribution of each dimension after projection, reduce training instability, and ensure that the input scale of the subsequent temporal encoder is consistent. The final output of the model The semantic embedding vector of each time segment, index For time step indexing, letters The name originates from "semantic," which encodes high-level semantic information including object interaction, scene context, and behavioral intent. The semantic embedding dimension is a unified dimension for the system and is a key hyperparameter that runs through all subsequent modules.

[0095] All The semantic embeddings of each time segment are arranged sequentially to obtain the semantic sequence of the entire video. ,in The total number of time segments into which the video is evenly divided, in matrix form. This indicates that each row corresponds to one time step. Semantic embedding. This sequence encodes high-level semantics such as object interaction, scene context, and behavioral intent, providing input for the temporal refinement in step S24.

[0096] S24: Utilizing a timing encoder specifically designed to preserve the continuity and consistency between consecutive frames. Processing Sequence This refinement yields a final structured semantic feature sequence expression that possesses smooth transition capabilities while preserving local continuity and global temporal context. .

[0097] S3 Explainable Anomaly Scorer (EAS) and Reasoning

[0098] The process of explaining abnormal scoring and reasoning can be represented by feature sequences. As the driving force, scoring predictions are generated based on key attributes maintained in the latent space, and a structured representation of the thought chain evidence for the causal logic of events is constructed. This module aims to bridge the gap between automated detection and interpretable analysis, and its specific operations include steps S31-S33, as follows:

[0099] S31: Refined Single-Frame Embedding Implementing a linear projection mapping operator trained by a network A preliminary anomaly score was obtained. After passing through a differential activation function (such as the Sigmoid response function) ), quantitatively estimate to obtain the current segment-level baseline anomaly score distribution .

[0100] S32: Build size is Learnable reference prototype library This is used to anchor different semantic centers of typical normal and typical abnormal behaviors. By calculating the cosine similarity between the current segment embedding and each prototype, the semantic matching degree of the segment with various behavioral modalities is quantified. The cosine similarity formula is as follows:

[0101]

[0102] in, For step S2 (SFE module) via timing encoder The first output after refinement Semantic embedding vectors of time segments, marked with apostrophes This indicates that timing refinement has been performed; subscript... For time step index; For prototype library The Middle There are reference prototype vectors, representing the semantic centers of a typical normal or abnormal behavior, with a total of _____ reference prototype vectors, _____. A prototype (the present invention is designed) ( ), all are dimensions The trainable parameter vector is optimized during training into anchor points that are representative of different behavioral modalities; The dot product (inner product) of two vectors, i.e. It measures the magnitude of the projection of two vectors in the same direction; The superscript indicates the transpose of a vector; For semantic embedding vectors Norm (Euclidean modulus), i.e. It measures the overall magnitude of the vector; For the first prototype vectors The norm is used to normalize the scale by multiplying the two numbers and using the denominator, thus eliminating the influence of vector magnitude differences on similarity calculation. For the first The first time segment and the first Cosine similarity score between prototypes, subscript Indicates the current time step, index This is the prototype index; the closer the value is to 1, the closer the semantic distribution of the fragment is to the behavioral modality represented by the prototype. The more it deviates; Indicates all The similarity score is calculated for each prototype.

[0103] Will The cosine similarity scores are horizontally concatenated to obtain a result reflecting the current segment. Similarity alignment vector with the entire prototype library: ,in for 3D column vector, superscript This indicates transposing a row vector to form a column vector. This indicates that the vector lives In the 3D real space, each dimension corresponds to a similarity score of a prototype. This vector encodes the comprehensive semantic matching of the current segment relative to all normal and abnormal prototypes, and will be further fed into the thought chain mapping in step S33. To generate interpretable reasoning embeddings.

[0104] S33: Using a mapping mechanism The alignment vectors are reconstructed into structured verification features, and then transformed using a chain-of-thought approach. Furthermore, by refining with local temporal aggregation operators, reasoning feature fragments specialized for interpretive intent analysis are obtained. The explanatory feature set is obtained by summarizing. Incremental updates to the prototype Like projection mapping, EAS also supports adaptive evolution of abnormal patterns while maintaining semantic consistency.

[0105] S4 Adaptive Continuous Learning and Memory Integration (ACM)

[0106] To address the challenges of handling complex incremental data streams, and to maintain robustness over extended periods, a mechanism with temporal consistency and an iterative buffer is constructed to mitigate catastrophic forgetting. The two main objectives of ACM are: to enhance temporal stability to reduce artifact fluctuations and to introduce an adaptive memory mechanism to integrate new and old knowledge. Specific operations, including S41-S44, are as follows:

[0107] S41: First, express the reasoning. (i.e., the reasoning feature fragment of step S33) The parameter space is obtained by introducing it a second time. By relying on the temporally gated cyclic unit (GRU) to analyze the contextual stride dependencies within long sequences, a temporally associated context embedding is formed.

[0108] S42: A one-dimensional convolutional filter is used to locally aggregate the context embeddings of three adjacent time steps, suppressing embedding jitter caused by video artifacts and short-term noise, and reconstructing a smoother temporal embedding response. The formula is as follows:

[0109]

[0110] in, They are time steps , , The corresponding context embedding vectors are all output by the time-gated cyclic unit (GRU) in step S41, and the subscripts are the corresponding time indices; This means concatenating the context vectors of three adjacent time steps along the time dimension to form a local temporal window input that covers the step before and after the current time step, with a window size of 3; This is a one-dimensional convolution operator that can learn the convolution kernel to adaptively learn smooth weights between adjacent frames within a local temporal window, effectively eliminating short-term jitter noise caused by video compression, lighting changes, or occlusion. (Subscript...) Derived from convolution; For the first The context embedding vector after local convolution smoothing at each time step (The hat symbol) in mathematical convention represents a processed or estimated quantity, subscript. For time step indexing.

[0111] To further constrain the variation magnitude between embeddings at adjacent time steps in the training objective, a temporal consistency penalty loss term is constructed, the formula of which is shown below:

[0112]

[0113] in, For temporal smoothing consistency penalty loss (i.e., temporal smoothing loss function), cursive script Represents the loss function, subscript Originating from temporal, this term serves as a regularization constraint for the overall training objective and is jointly optimized with the main detection loss; The time-series smoothing weight hyperparameter (set in this invention) The relative proportion of this regularization term in the total loss is controlled by a product. The larger the value, the more emphasis is placed on the stability of adjacent segment features; the smaller the value, the less constraint is placed on temporal changes. Given the total number of time segments in the current video, sum from... arrive Covers all adjacent time steps; The difference between two adjacent context embedding vectors The square of the norm, i.e. It measures the abrupt changes in the semantic space between adjacent time steps; the smaller the value, the smoother the semantic features of adjacent frames. For all The penalty is calculated by averaging adjacent segments, ensuring that the penalty does not vary with video length. Linear growth ensures that the penalty magnitude is consistent and comparable for videos of different durations.

[0114] S43: Establish a scale of Adaptive semantic memory matrix This is used to continuously maintain a historical anchor point library of normal and abnormal behavioral features during training. It utilizes data based on the current embedded response. The Softmax attention probabilistic addressing mechanism calculates the activation weights (i.e., attention weights) of the current segment for each memory slot, as shown in the following formula:

[0115]

[0116] in, Features output by step S3 (EAS module) After further mapping and GRU modeling in step S41, the following results are obtained: ), and after local temporal convolution smoothing and refining in step S42, the first The context embedding vector at each time step, with the hat symbol. Indicates estimation and refinement processes, subscript. For time step index; For memory matrix, cursive script Represents a set structure, with a total of One memory slot (as designed in this invention) ), For memory slot index, ; For the first Each memory slot stores a historical feature anchor vector, the dimension of which corresponds to the system semantic embedding dimension. Consistent, the update rules in step S44 are continuously iterated and evolved during training; For the current reasoning embedding and the first The dot product (inner product) of the memory slots measures the semantic similarity between the two. The larger the dot product, the closer the current feature is to the memory anchor. Represented by natural constant An exponential function with base 1 maps the dot product similarity to a positive value, ensuring the weights are non-negative; the denominator... For all The summation of the exponential similarity of the memory slots serves as a normalization function. For the current embedding of the first The Softmax attention weights of each memory slot satisfy... The larger the weight, the closer the semantics of the current segment is to the historical pattern encoded by the slot, and the more significant the contribution of the slot to the current state.

[0117] Subsequently, all The activated memory slots are weighted linearly according to attention weights to restore the historical knowledge fusion state corresponding to the current time step, and the formula is as follows:

[0118]

[0119] in, For all memory slot vectors By weight The convex combination (weighted average) results in a soft readout output of the memory matrix under the current embedding guidance; For memory-aligned integrated knowledge embedding vectors, superscript Derived from memory, subscript For the current time step, this vector integrates the current inference state with information from multiple prototypes in the historical knowledge base, and is used for the adaptive memory update in step S44, as well as the comprehensive estimation of the final anomaly score.

[0120] S44: Establish continuous update and iteration operations Each time segment is processed, the memory matrix is ​​modified. A lightweight adaptive incremental fine-tuning is performed to ensure the memory continuously absorbs emerging anomalies while protecting historical knowledge from being overwritten. The update process is completed in two sub-steps, S441-S442, specifically:

[0121] S441: Calculate the residual offset vector between the current inference embedding and each memory slot, as shown in the following formula:

[0122]

[0123] in, The difference residual vector, represented by uppercase Greek letters. (Delta) represents the increment / difference; For the current time step The temporally smoothed embedding vector represents the model's latest semantic understanding of the behavioral patterns of the current video segment; Let the historical semantic anchor vector currently stored in the i-th memory slot be denoted as . Subtracting element by element yields the offset direction and magnitude of the current observation relative to the memory slot, indicating which direction and by what step the slot needs to be adjusted to move closer to the current observation; The larger the value, the greater the difference between the current embedding and the historical anchor point of the slot; the smaller the value, the higher the semantic alignment between the two.

[0124] S442: Based on attention weights For the The formula for weighted incremental updates across memory slots is as follows:

[0125]

[0126] in: This represents an assignment / update operation, where the right side shows the value before the update, and the left side shows the value after the update. Replaced with the new value; The learning rate hyperparameter controls the overall step size of each update, i.e., the speed of knowledge fusion / replacement. The larger the size, the faster new observations shape memory (but may lead to the loss of historical knowledge), while the smaller the size, the more historical knowledge is retained (but the slower the absorption of new knowledge). The first calculated in step S43 The Softmax attention weights for each memory slot indicate that the current embedding is more relevant to that slot, thus receiving a larger update for that slot. Conversely, memory slots with lower relevance to the current input receive less attention. It is hardly ever updated, thus preserving historical knowledge; The actual update amount, modulated by both the learning rate and attention weights, is proportional to the semantic difference between the current embedding and the slot, as well as their correlation. Through this slot-by-slot, weight-adaptive incremental update rule, the model can selectively update the most relevant memory slots as it continuously receives new video segments, while keeping historical knowledge slots unrelated to the current input almost unchanged. This systematically mitigates catastrophic forgetting and ensures detection stability during long-term deployment. Through this iterative memory replay and adaptive adjustment, the model continuously digests emerging anomalies from new videos while retaining its accumulated long-term normal and anomaly feature library.

[0127] Analysis of S5 Model Optimization and Training Iteration Mechanism

[0128] Considering the overall time complexity of the model requires combining high-level abstraction and video scanning; the complexity of SFE processing sequence operations is limited to... The complexity of EAS includes space traversal and similarity calculation. It exhibits superior inference performance with relatively low latency. During parameter tuning, we employ a focus loss mechanism that integrates multi-instance learning loss (MIL) and positive / negative example comparison, supplemented by a temporal smoothing loss function to complete loop closure. We use the AdamW optimizer with dynamic weight decay configuration and a nested cosine annealing mechanism that allows for warm-up and restart to update parameters; we use validation set performance for convergence feedback to avoid static crashes.

[0129] S6 Video Reasoning Analysis Scoring

[0130] The optimal training model parameters are saved, and the system is loaded and deployed to perform video inference analysis and scoring. A test set stream containing covert behavior is input into the TW-VAD model system, which can synchronously and in parallel output corresponding sequences of probability scores for abnormal threats accurate to the segment level. Furthermore, it reverses the process by transforming the embedded thought state into intuitive, sequential causal statements and inferences in human natural language (through output matching from the backend of a large model). This enables a dual-mode joint assessment and early warning system.

[0131] Example 2.

[0132] Combination Figure 1 An interpretable weakly supervised video anomaly detection system based on continuous thought chain reasoning is presented, demonstrating the complete processing flow from the input of the video to be monitored to the final detection result and analysis interpretation. The figure also shows the data flow and interaction relationships between the modules. This weakly supervised video anomaly detection system can implement the weakly supervised video anomaly detection method of Example 1, including:

[0133] (1) Data preprocessing module: Using a pre-trained optical feature extractor, the data is preprocessed to extract the first... Extracting each time segment, specifically extracting its dimension . RGB spatial appearance features and dimensions are optical flow motion characteristics This represents low-level spatiotemporal characteristics.

[0134] (2) Semantic Feature Embedding Module (LLM): Aligns the original spatiotemporal visual features (i.e., low-level spatiotemporal features) and inputs them into the joint mapping space to generate logical feature embeddings containing high-level semantics (i.e., high-order continuous feature sequences covering interaction relationships and contextual information).

[0135] (3) Explainable Anomaly Scoring and Reasoning Module (EAS): This module compares the similarity between video semantic vectors and latent space prototypes, then constructs causal reasoning features and generates anomaly scores. Specifically, it uses feature sequences... As the driving force, scoring predictions are generated based on key attributes maintained in the latent space, and a structured representation of the thought chain evidence for the causal logic of events is constructed. This module aims to bridge the gap between automated detection and interpretable analysis.

[0136] (4) Adaptive Continuous Learning and Memory Integration Module (ACM): Introduces memory slot attention allocation weights to complete the constraints of combining new knowledge and retaining old experience.

[0137] (5) Anomaly detection result output module.

[0138] The anomaly detection result output module is used to output the detection results. The implementation details of this weakly supervised video anomaly detection system include:

[0139] The core deployment details are described below: Basic computing power utilizes an NVIDIA RTX 3090 graphics accelerator with a PyTorch environment and an Intel Core i5 CPU. During low-level data processing, 2048-dimensional motion optical flow and appearance structure features are extracted using an I3D backbone network pre-trained based on Kinetics platform parameter freezing. SFE processing uses the open-source model SentenceTransformer (all-MiniLM-L6-v2 branch) for dimensionality reduction to 512 dimensions. The base number of reference feature prototypes used as the comparison scale for various events is set to [number missing]. A vector center with specific behavioral attribute distribution characteristics; continuously update module settings parameters utilize the highest capacity space. A priority replay memory pool mechanism for each sampling unit's historical retention set is used to set a time series smoothness weight loss parameter in order to reduce abrupt noise in the time series. The batch size for the entire training process is set to 32, and the fusion attenuation setting is [value missing]. It also possesses a moderate growth strategy coupled with a projected decline value to The AdamW learning rate optimization algorithm is used for dynamic optimization.

[0140] Example 3: Experimental Testing

[0141] 1. Dataset

[0142] The method of this invention and existing frameworks such as MIST and Tian were tested on the following mainstream datasets:

[0143] UCF-Crime Dataset: This is a complex dataset of extremely long surveillance logs, containing mixed scenarios of data fragments of 13 common serious surveillance threat behaviors (such as theft, arson, fighting, etc.) and similar normal behaviors.

[0144] ShanghaiTech Dataset: This is a dataset built for short-term monitoring scenarios on university campuses, mainly containing high-resolution videos with single behavioral anomalies (such as fighting, chasing, etc.).

[0145] 2. Indicators

[0146] Frame-level AUC (Area Under Curve) is used as an indicator to evaluate the model's predictive performance.

[0147] Frame-level AUC is an evaluation metric used in video segment and frame-level prediction to measure the diagnostic accuracy of detection algorithms. It is mainly calculated by taking the area under the receiver operating characteristic (ROC) curve to eliminate the influence of different specific probability threshold selections on the discrimination result calculation and to reflect the probability that positive samples are ranked before negative samples. The higher the value, the better.

[0148] 3. Baseline Model

[0149] The remaining comparative experimental methods in the table are described below:

[0150] RTFM model: This is a novel robust detection method proposed to address the pain point that multi-instance learning is easily affected by the dominance of normal video segments in weakly supervised video anomaly detection. It effectively identifies anomalous segments by training a feature amplitude learning function and cleverly combines dilated convolution and self-attention mechanism to capture the long-short-term dependencies in the video, thereby significantly enhancing the model's ability to discriminate minor anomalies and the efficiency of sample utilization.

[0151] MSL Model: This is a novel self-trained detection framework proposed to address the pain point of traditional multi-instance learning in weakly supervised video anomaly detection, which is prone to misselecting anomalous segments. It innovatively uses a sequence composed of multiple segments instead of a single instance as the optimization unit, and combines a Transformer network with a self-training strategy to gradually reduce the sequence length to refine the anomaly score, thereby effectively reducing the early selection error of the model and significantly improving the detection accuracy.

[0152] MGFN Model: This is a novel amplitude contrast "glimpse and focus" network framework proposed to address the pain points of insufficient spatiotemporal context awareness in long videos in weakly supervised video anomaly detection, as well as the susceptibility of traditional feature amplitudes to interference from scene changes. It not only effectively integrates global and local spatiotemporal information through the glimpse and focus mechanism, but also innovatively introduces a feature amplification mechanism and amplitude contrast loss to eliminate the inconsistency of feature amplitudes across scenes, thereby significantly enhancing the discriminative power and detection accuracy of anomaly features.

[0153] HSN Model: This is a novel baseline framework for weakly supervised video anomaly detection. It captures both subtle and strong spatiotemporal cues through a separation mechanism to learn discriminative representations of humans and scenes. It also innovatively combines self-rectifying loss to dynamically compute pseudo-temporal annotations from video-level labels, thereby effectively solving the problem of poor separation between normal and anomalous instances under weak supervision.

[0154] CDL Model: This is a weakly supervised cross-domain learning framework for video anomaly detection. It significantly improves the anomaly detection and localization performance in cross-domain scenarios by introducing external unlabeled data during the training phase and adaptively minimizing prediction bias by utilizing prediction uncertainty.

[0155] Video-ChatGPT Model: This is a novel multimodal model that combines the representational power of a pre-trained visual encoder with the generative power of a large language model. By fine-tuning it on a new dataset consisting of 100,000 video-instruction pairs, it can not only understand the spatiotemporal features of video content, but also engage in detailed and coherent human-like dialogue around the video.

[0156] LAVAD Model: This is a pioneering training-free video anomaly detection framework. It uses a visual language model (VLM) to generate text descriptions of video frames and designs a specific cue mechanism to stimulate the large language model to perform temporal aggregation and anomaly score estimation. At the same time, it combines cross-modal similarity technology to clean up noise and optimize scores, thereby achieving efficient video anomaly detection without any additional data collection or model training.

[0157] AnomalyRuler model: This is a detection framework based on rule reasoning of a large language model, which is proposed to address the lack of interpretability in existing video anomaly detection and the difficulty in directly adapting the general knowledge of large language models to specific scenarios. It innovatively uses a small number of normal samples to summarize scene-specific detection rules, and combines rule aggregation and perceptual smoothing strategies to perform deductive reasoning on test videos. Thus, it achieves video anomaly detection with high interpretability, high robustness and easy and fast cross-scene adaptation without the need for fine-tuning of the full set of samples.

[0158] SUVAD Model: This is a training-free detection framework proposed to address the pain points of traditional visual feature-based video anomaly detection methods, such as poor scene generalization and lack of interpretability. It uses a multimodal large language model to generate detailed video text descriptions to achieve deep semantic understanding and directly perform anomaly detection. At the same time, it is supplemented by special techniques to alleviate model illusions, thereby significantly improving the model's cross-scene generalization ability, anomaly interpretability, and flexibility in anomaly definition adjustment without retraining.

[0159] AR-Net Model: This is an anomaly regression network framework proposed for weakly supervised video anomaly detection. It transforms anomaly detection into a regression problem of calculating anomaly scores for video segments and innovatively combines dynamic multi-instance learning loss to expand the inter-class distance between normal and abnormal instances, while introducing center loss to reduce the intra-class distance of normal instances. This effectively learns highly discriminative features to improve detection performance.

[0160] STGCNs model: This is a spatiotemporal graph-based convolutional network framework proposed to address the problem that existing weakly supervised methods neglect the complex spatiotemporal correlation of videos. It constructs video segments as graph nodes, combines attention mechanisms and adaptive weights to deeply integrate spatial similarity and temporal consistency features, and introduces ranking and classification losses for joint optimization, thereby significantly improving the robustness and accuracy of video anomaly detection.

[0161] Fed-WS-VAD is a privacy-preserving architecture proposed to address the pain points of existing centralized video anomaly detection methods, such as privacy leakage risks and susceptibility to domain differences. It introduces a gated local-to-global hybrid expert mechanism to dynamically learn and fuse features on the edge device client, and combines it with a video tube attention mechanism, thereby effectively overcoming the domain offset problem and achieving fine-grained anomaly localization without sharing local data.

[0162] 4. Main performance results

[0163] The test results are shown in Tables 1 and 2.

[0164] Table 1: Comparison of Frame-Level AUC of Various Methods on the UCF-Crime Dataset

[0165]

[0166] Table 2: Comparison of Frame-Level AUC for Various Methods on the ShanghaiTech Dataset

[0167]

[0168] As shown in Tables 1 and 2, the TW-VAD framework proposed in this invention underwent comprehensive benchmark testing against representative methods in the field of weakly supervised and interpretable video anomaly detection. It demonstrated sustained performance improvements and enhanced interpretability on both the UCF-Crime and ShanghaiTech datasets. Through the semantic abstraction capabilities of the SFE module and the prototype-based scoring mechanism of the EAS module, this framework effectively captures high-level semantic contextual dependencies often overlooked in purely visual representations, including information such as inter-target interactions, scene dynamics, and behavioral intent. Furthermore, the introduction of CoT (Conceptual Chain of Reasoning) inference provides a transparent and human-readable explanation for anomaly prediction, fundamentally bridging the gap between automated detection and interpretable decision-making.

[0169] A detailed analysis of the comparative data in Table 1 (UCF-Crime dataset) reveals that, in traditional weakly supervised methods lacking interpretability, although MGFN achieves a relatively high AUC of 86.12% thanks to its multi-instance learning and stronger backbone network, these methods are essentially still "black box" mappings, unable to provide any human-understandable reasoning for the prediction results, and lack a trustworthy foundation in security deployments. Some methods (such as RTFM's 84.07% or HSN's 84.31%) even exhibit limitations in long-term, multi-type anomaly scenarios due to over-reliance on static visual features. Among the interpretable methods, Video-ChatGPT, based on a large multimodal language model for video question answering, possesses some semantic reasoning ability, but its AUC is only 75.30%, far lower than the level of this invention, indicating that coarse-grained language understanding is insufficient to support accurate frame-level anomaly localization. LAVAD embeds language features into distribution alignment, achieving an AUC of 82.28%. AnomalyRuler uses a rule-based reasoning engine based on a language model combined with textual prompts for fine-tuning, achieving an AUC of 83.10%. SUVAD uses a large multimodal model for training-free detection, achieving an AUC of 83.90%. While these interpretable methods provide some textual explanation, they all have significant shortcomings in detection accuracy. In contrast, the TW-VAD of this invention, while maintaining complete interpretable output, achieves an AUC of 86.33% on the UCF-Crime dataset, surpassing not only all competing methods with equivalent interpretability but also the strongest pure vision method (MGFN's 86.12%), which prioritizes accuracy over interpretability. This fully demonstrates that the present invention, through semantic alignment of the large language model of SFE, effectively compensates for the accuracy loss caused by the lack of deep visual-semantic alignment in complex and long-term abnormal scenarios of interpretable methods, and truly achieves the dual goals of high accuracy and strong interpretability.

[0170] Further observation of the results in Table 2 (ShanghaiTech dataset) reveals that the TW-VAD model exhibits superior cross-scene generalization ability and robustness on this dataset. The ShanghaiTech dataset focuses on short-term, fine-grained abnormal behaviors (such as running, fighting, and chasing) in a campus setting. The background is relatively static, but anomalies are sparse, placing stringent demands on the model's spatial detail perception and anomaly sensitivity. Among methods lacking interpretability, Fed-WS-VAD leads with an AUC of 97.10%, while HSN and STGCNs achieve 93.72% and 92.30% respectively, both among the top in the field. However, among interpretable methods, only AnomalyRuler, with an AUC of 96.50%, is currently included in the comparison. The TW-VAD method achieved an AUC of 97.37% on this dataset, surpassing not only all interpretable methods but also its strongest non-interpretable competitor, Fed-WS-VAD (97.10%), ranking first in both categories. This achievement is key to the dual role of the ACM adaptive continuous learning module in this invention: firstly, it suppresses feature jitter caused by short-term artifacts and sparsity anomalies through temporal smoothing constraints and GRU modeling, ensuring the stability of the frame-level scoring curve; secondly, the attention addressing and continuous incremental update mechanism of the memory matrix enables the model to fully retain accumulated historical normal behavior patterns when adaptively switching between camera views, avoiding catastrophic forgetting due to scene distribution migration, thus maintaining continuous and efficient detection capabilities in multi-view, multi-scene campus monitoring environments. Meanwhile, previous models that rely on static visual embeddings or task-specific retraining (such as AR-Net and AnomalyRuler) show obvious limitations when facing dynamic changes in the scene. However, the framework of this invention can maintain stability under distribution drift by incrementally refining the representations of normal and abnormal behaviors, demonstrating a truly continuous adaptability for actual deployment.

[0171] The experimental results from both datasets lead to the conclusion that the TW-VAD proposed in this invention is one of the very few video anomaly detection frameworks capable of simultaneously achieving high-precision detection, complete interpretable inference output, and continuous adaptive learning. Compared to the common dilemma of existing methods that struggle to balance interpretability and accuracy, TW-VAD achieves an organic unity of accuracy, interpretability, and robustness through the collaborative design of its three modules: SFE, EAS, and ACM. This provides a novel and engineering-deployable solution for weakly supervised video anomaly detection in real-world, complex surveillance scenarios.

[0172] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Any simple modifications, equivalent changes, and alterations made to the above embodiments based on the technical essence of the present invention shall still fall within the scope of the technical solution of the present invention.

Claims

1. A weakly supervised video anomaly detection method based on continuous thought chain reasoning, characterized in that, Includes the following steps: S1: Perform data preprocessing on the video to be detected, extract appearance features and motion features, and obtain low-level spatiotemporal features; S2: The low-level spatiotemporal features are embedded with semantic features and transformed into a high-order continuous feature sequence that covers interaction relationships and contextual information; S3: Through interpretable anomaly scoring and reasoning, driven by the aforementioned high-order continuous feature sequence, causal reasoning features are constructed and anomaly scores are generated based on the similarity of latent space prototypes. S4: Through adaptive continuous learning and memory integration, the constraints of combining new knowledge and retaining old experience are completed; S5: Output the anomaly detection results.

2. The weakly supervised video anomaly detection method according to claim 1, characterized in that, In step S2, the transformation process through semantic feature embedding is as follows: S21: Combine appearance and motion features from low-level spatiotemporal features to form a complete segment-level joint feature state vector, and then generate enhanced features through data augmentation; S22: The enhanced features are placed into a self-attention-based transition adapter, and then sequentially processed through linear mapping, ReLU nonlinear activation, positional encoding injection, and layer normalization to align the feature space to a higher-order semantic embedding space while maintaining temporal order, resulting in an adapted embedding vector. ; S23: Embed the aforementioned adaptation vector The original spatiotemporal visual features are aligned and input into the joint mapping space after being fed into the large language model to obtain the segment semantic embedding vector. Then, the semantic embedding vectors of the entire video segments are used. By arranging them sequentially, the semantic sequence of the entire video is obtained. ; S24: Regarding the semantic sequence A timing encoder that preserves the continuity and consistency between consecutive frames. After processing, the final structured semantic feature sequence is obtained. That is, the higher-order continuous feature sequence.

3. The weakly supervised video anomaly detection method according to claim 2, characterized in that, The specific process of step S22 is as follows: S221: Project the enhanced features from the original high-dimensional video feature space to a dimensionless space using a linear mapping. The unified embedding space yields the intermediate projection vector. ; S222: Regarding the intermediate projection vector First, apply the ReLU activation function to introduce nonlinear discriminative capability, then use position encoding. Injecting temporal location information yields a feature vector with temporal awareness capabilities. ; S223: Regarding the aforementioned feature vector The execution layer normalizes and outputs the adapted embedding vector for the fragment. .

4. The weakly supervised video anomaly detection method according to claim 2, characterized in that, The specific process of step S23 is as follows: S231: Embed the aforementioned adaptation vector The input is fed into a large language model to generate semantic context encoding vectors. ; S232: Then through a learnable linear mapping operator The output features of the lightweight large language model, which includes large-scale pre-trained commonsense weights, are projected onto a unified semantic embedding space dimension. After further layer normalization, the segment semantic embedding vector is obtained. The formula is as follows: ; All The semantic embeddings of each time segment are arranged sequentially to obtain the semantic sequence of the entire video. .

5. The weakly supervised video anomaly detection method according to claim 1, characterized in that, The process of interpreting anomaly scoring and reasoning in step S3 is as follows: S31: Single-frame embedding By linear projection mapping operator A preliminary anomaly score was obtained. Then, after applying a differential activation function, the baseline outlier score distribution at the current fragment level is quantitatively estimated and obtained. ; S32: Build size is Learnable reference prototype library Then, calculate the cosine similarity between the current fragment embedding and each prototype; then... The cosine similarity scores are horizontally concatenated to obtain a result reflecting the current segment. Similarity alignment vector with the entire prototype library ; S33: Reconstruct the alignment vector into structured verification features, and perform a chain-of-thought transformation. Then; refine and obtain the reasoning characteristics for interpretive intent analysis. Summary of results .

6. The weakly supervised video anomaly detection method according to claim 1, characterized in that, The adaptive continuous learning and memory integration process in step S4 is as follows: S41: Reasoning Features Introducing parameter space to obtain ; Utilizing time-gated cyclic units to analyze contextual step dependencies within long sequences, forming temporally related context embeddings; S42: A one-dimensional convolutional filter is used to locally aggregate the context embeddings of three adjacent time steps, suppressing embedding jitter caused by video artifacts and short-term noise, and reconstructing a smoother temporal embedding response. ; S43: Based on the aforementioned embedded response The Softmax attention probabilistic addressing mechanism calculates the attention weights of the current segment to each memory slot; then it performs a weighted linear combination of the attention weights for all activated memory slots. S44: Establish continuous update and iteration operations Each time segment is processed, the memory matrix is ​​modified. Perform a lightweight adaptive incremental fine-tuning to ensure that the memory continuously absorbs emerging anomalies while protecting historical knowledge from being overwritten.

7. The weakly supervised video anomaly detection method according to claim 6, characterized in that, In step S42, the variation magnitude between embeddings at adjacent time steps is directly constrained in the training objective to construct a temporal consistency penalty loss term, the formula of which is as follows: ; Among them, the aforementioned For time-series smoothing weight hyperparameters, This represents the total number of time segments in the current video. The difference between two adjacent context embedding vectors The square of the norm.

8. The weakly supervised video anomaly detection method according to claim 6, characterized in that, In step S43, the formula for calculating the attention weight is as follows: ; in, The number of memory slots For memory slot index, t is time; For the first Each memory slot stores a vector of historical feature anchor points. For the current reasoning embedding and the first The dot product of memory slots; The formula for calculating the state of historical knowledge integration is: .

9. The weakly supervised video anomaly detection method according to claim 6, characterized in that, In step S44, the update iteration operation is performed as follows: S441: Calculate the residual offset vector between the current inference embedding and each memory slot. Its formula is: ; S442: Based on the attention weights described above For the first The formula for weighted incremental updates of memory slots is as follows: ;in, This is the hyperparameter for memory learning rate.

10. A weakly supervised video anomaly detection system based on continuous thought chain reasoning, characterized in that, The method for implementing the weakly supervised video anomaly detection method according to any one of claims 1-9 includes: Data preprocessing module: Extracts appearance and motion features to obtain low-level spatiotemporal features; Semantic feature embedding module: converts the low-level spatiotemporal features into a high-order continuous feature sequence that covers interaction relationships and contextual information; Explainable Anomaly Scoring and Reasoning Module: Constructs causal reasoning features and generates anomaly scores based on similarity comparison of latent space prototypes; Adaptive continuous learning and memory integration module: Introduces memory slot attention allocation weights to complete the constraints of combining new knowledge and retaining old experience.