Video detection method and device based on multi-modal thought chain and direct preference optimization

CN122336626BActive Publication Date: 2026-10-30DALIAN UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610388347.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-03-27
Publication Date
2026-10-30
Estimated Expiration
2046-03-27

AI Technical Summary

Technical Problem

这种缺乏深层逻辑推理能力的缺陷,导致模型在面对复杂边界样本时容易产生误判,且无法生成逻辑连贯、证据确凿的解释文本

Benefits of technology

[0061]本发明通过构建包含信息增强与推理增强的双阶段框架,结合多模态思维链与直接偏好优化算法,在数学原理上保证了模型对多模态上下文信息的最大化互信息利用,并通过对比学习机制有效抑制了虚假相关性的干扰。实验结果表明,本发明取得了较好的检测性能,并在解释生成的信息量、逻辑性和说服力方面表现出显著优势。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122336626B_ABST
    Figure CN122336626B_ABST
Patent Text Reader

Abstract

The application discloses a video detection method and device based on a multi-modal thinking chain and direct preference optimization, comprising: obtaining a video sample set with known labels as a training set, and constructing an enhanced input sample containing multi-source information, further realizing optimization of an open source visual language large model, so that the open source visual language large model generates predicted labels and predicted reasoning for unknown videos. By constructing a two-stage framework containing information enhancement and reasoning enhancement, combining a multi-modal thinking chain and a direct preference optimization algorithm, the maximum mutual information utilization of the model on multi-modal context information is guaranteed on the mathematical principle, and the interference of false correlation is effectively inhibited through a contrast learning mechanism. Experimental results show that the application has good detection performance and has significant advantages in the amount of generated information, logic and persuasiveness of explanation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of video detection technology, and in particular to a video detection method and apparatus based on multimodal thinking chain and direct preference optimization. Background Technology

[0002] With the rapid development of mobile internet and multimedia technology, video has become a major medium for the public to express emotions, disseminate opinions, and engage in social interaction. However, this convenience has also been accompanied by a massive influx of harmful information, among which the problem of hateful videos is particularly prominent.

[0003] Existing negative video detection technologies primarily rely on deep neural networks. They extract multimodal features from video frames, audio-to-text transcription (ASR), and optical character recognition (OCR), fusing these features using techniques such as feature concatenation, bilinear pooling, or attention mechanisms to classify video content. While these methods have achieved some detection accuracy on specific benchmark datasets, they are mainly limited to binary classification tasks, outputting only a label indicating whether a video belongs to the negative category, without providing corresponding decision-making basis or reasons. This "black box" nature severely limits the application of these models in real-world content moderation scenarios, as human moderators and platform users often require explicit explanations to understand the specific reasons why a video is marked as violating in order to conduct reviews or appeals. The lack of interpretability not only reduces the transparency and credibility of the system but also makes it difficult to meet the current legal and regulatory requirements for algorithm interpretability.

[0004] Furthermore, existing general-purpose multimodal large models still face significant challenges in processing negative videos. First, negative content is often expressed in an implicit and ambiguous manner, conveying malice through cross-modal metaphors or specific cultural symbols. Existing models often struggle to capture these subtle contextual clues, leading to insufficient evidence extraction. Second, existing models are prone to the trap of "shortcut learning," i.e., over-reliance on spurious correlations in the data. For example, a model might incorrectly classify videos containing profanity or intense physical conflict as negative content, ignoring the possibility that they are merely non-specific arguments or documentary footage. This lack of deep logical reasoning ability makes models prone to misjudgment when faced with complex boundary samples and unable to generate logically coherent and well-supported explanatory texts. Summary of the Invention

[0005] Therefore, it is necessary to propose a video detection method and device based on multimodal thinking chain and direct preference optimization to address the above problems.

[0006] A video detection method based on multimodal thinking chain and direct preference optimization, the method comprising:

[0007] A set of video samples with known labels is obtained as a training set. The set of video samples consists of multiple video samples, each of which contains a video frame sequence, an audio signal, and embedded text appearing in the video frame sequence. The audio signal is mapped into a text sequence using an automatic speech recognition model. The embedded text is extracted from the video frame sequence using an optical character recognition tool. The video samples include video descriptions and potentially harmful elements, which include text modal harmful elements and visual modal harmful elements.

[0008] For each video sample, an enhanced input sample containing multi-source information is constructed, and multiple enhanced input samples constitute an enhanced input; the multi-source information includes: video frame sequence, video text, video description, text modality harmful elements, visual modality harmful elements, and instruction template; the video text is the union of the text sequence and the embedded text;

[0009] The enhanced input is converted into a high-dimensional feature vector sequence through the embedding layer of the open-source visual language large model, and the high-dimensional feature vector sequence is then... The matrix is ​​projected into a query matrix, a key matrix, and a value matrix, respectively; based on the query matrix and the key matrix, the attention score matrix of each attention head of the open-source visual language large model is determined; based on the attention score matrix and the value matrix, the attention score value matrix of each attention head is determined.

[0010] The attention score matrices of all heads are concatenated and then linearly transformed to obtain the multi-head attention output; the final output feature sequence is obtained based on the multi-head attention output and the high-dimensional feature vector sequence; the final output feature sequence is encoded using a low-rank adaptation technique to obtain the encoded output;

[0011] Based on the supervised fine-tuning loss function, and combined with the encoded output and enhanced input, the negative log-likelihood loss of the target sequence is determined. The parameters in the open-source visual language large model are optimized by the negative log-likelihood loss, thereby obtaining the optimized open-source visual language large model.

[0012] For the augmented input, the positive sample set is defined as a sequence containing correct labels and correct reasons; by constructing adversarial instructions, the optimized open-source visual language large model is induced to generate incorrect labels and incorrect reasons that support video samples, thereby constructing the negative sample set; the augmented input, the positive sample set, and the negative sample set constitute the preference dataset;

[0013] The direct preference optimization loss is determined by using the direct preference optimization algorithm and combining it with the preference dataset. The detection model is then further optimized by using the direct preference optimization loss on the optimized open-source visual language large model.

[0014] The negative log-likelihood loss and the direct preference optimization loss are weighted and combined to obtain the inference enhancement loss, through... The optimizer minimizes the inference enhancement loss, thereby updating the parameters of the detection model to obtain an optimized detection model.

[0015] For an unknown video, a corresponding test input sample is generated and input into the optimized detection model. The optimized detection model generates a target prediction sequence through an autoregressive decoding strategy. The target prediction sequence is a tuple containing a prediction label and a prediction reason. The prediction label is either a negative video or a non-negative video.

[0016] In one embodiment,

[0017] The harmful elements in the text modality are a set of matching words obtained by matching video text with a predefined library of offensive words;

[0018] The visual modal harmful elements are obtained by identifying the video frame sequence through a target detection algorithm.

[0019] In one embodiment, the process of generating the error reason is as follows:

[0020] Optimize open-source visual language models to mine superficial features in video samples: non-malicious fighting or non-targeted insults are used to forcefully prove erroneous conclusions, thereby generating false reasons driven by spurious correlations.

[0021] In one embodiment, the attention scoring matrix and the attention scoring value matrix are implemented using the following expression:

[0022]

[0023]

[0024]

[0025]

[0026]

[0027] in, For query matrix; The key matrix; It is a value matrix; It is a high-dimensional feature vector sequence; The projection matrix is ​​learnable; Feature dimensions for each attention head; For the first Attention rating matrix based on size; This is a matrix of attention ratings.

[0028] In one embodiment,

[0029] The multi-head attention output is achieved through the following expression:

[0030]

[0031] in, For multi-head attention output; To output the projection matrix; For splicing operations;

[0032] The final output feature sequence is achieved through the following expression:

[0033]

[0034]

[0035]

[0036] in, This is the updated high-dimensional feature vector sequence; It is a high-dimensional feature vector sequence; This is the feedforward output sequence; and This is the weight matrix; and For bias terms; For the intermediate layer dimensions of the feedforward network; The final output feature sequence;

[0037] The encoded output is achieved through the following expression:

[0038]

[0039] in, For encoded output; is a random weight matrix; is a scaling factor; and All are low-rank matrices; A low-rank matrix and rank, .

[0040] In one embodiment, the negative log-likelihood loss for determining the target sequence based on the supervised fine-tuning loss function, combined with the encoded output and the enhanced input, is implemented by the following expression:

[0041]

[0042]

[0043] in, For encoded output; The loss is negative log-likelihood. Indicates in model parameters Given augmented input At that time, the target sequence is generated. The conditional probability; This represents the training dataset used for supervised fine-tuning, containing augmented inputs. and target sequence The sample pairs formed and These represent the time steps. and time step Previous generated sequences; For encoded output; M is the total number of time steps.

[0044] In one embodiment,

[0045] The negative log-likelihood loss based on supervised fine-tuning of the loss function, combined with the encoded output and enhanced input, to determine the target sequence is implemented through the following expression:

[0046]

[0047] in, Optimize the loss for direct preferences; This represents the Sigmoid activation function, used to map reward differences to a probability distribution; To detect the probability that the model generates the correct label and the correct reason; The probability of generating the correct label and correct reason for the reference model; To detect the probability of the model generating incorrect labels and reasons for errors; The probability of generating error labels and error reasons for the reference model; To control deviation from the reference model The degree of hyperparameter temperature coefficient.

[0048] In one embodiment, the target prediction sequence is implemented by the following expression:

[0049]

[0050] in, Predict the target sequence Indicates in model parameters Given the test input At that time, generate the target prediction sequence. The conditional probability; Input samples for testing; For time steps; The target sequence.

[0051] A video detection device based on multimodal thinking chain and direct preference optimization, the device comprising:

[0052] An extraction module is used to acquire a set of video samples with known labels as a training set. The set of video samples consists of multiple video samples, each containing a video frame sequence, an audio signal, and embedded text appearing in the video frame sequence. An automatic speech recognition model is used to map the audio signal into a text sequence. An optical character recognition tool is used to extract the embedded text from the video frame sequence. The video samples include video descriptions and potentially harmful elements, and the potentially harmful elements include text modal harmful elements and visual modal harmful elements.

[0053] The first construction module is used to construct an enhanced input sample containing multi-source information for each video sample, and multiple enhanced input samples constitute an enhanced input; the multi-source information includes: video frame sequence, video text, video description, text modality harmful elements, visual modality harmful elements, and instruction template; the video text is the union of the text sequence and the embedded text;

[0054] The projection module converts the augmented input into a high-dimensional feature vector sequence through the embedding layer of the open-source visual language large model, and then... The matrix is ​​projected into a query matrix, a key matrix, and a value matrix, respectively; based on the query matrix and the key matrix, the attention score matrix of each attention head of the open-source visual language large model is determined; based on the attention score matrix and the value matrix, the attention score value matrix of each attention head is determined.

[0055] The encoding module concatenates the attention score matrices of all heads and performs a linear transformation to obtain the multi-head attention output; based on the multi-head attention output and the high-dimensional feature vector sequence, it obtains the final output feature sequence; and it encodes the final output feature sequence using a low-rank adaptation technique to obtain the encoded output.

[0056] The first optimization module is used to determine the negative log-likelihood loss of the target sequence based on the supervised fine-tuning loss function and in combination with the encoded output and the enhanced input. The negative log-likelihood loss is used to optimize the parameters in the open-source visual language large model, thereby obtaining the optimized open-source visual language large model.

[0057] The second construction module is used to define the positive sample set as a sequence containing correct labels and correct reasons for the augmented input; and to construct a negative sample set by constructing adversarial instructions to induce the optimized open-source visual language large model to generate incorrect labels and incorrect reasons that support video samples; the augmented input, the positive sample set, and the negative sample set constitute the preference dataset.

[0058] The first optimization module is used to determine the direct preference optimization loss by using the direct preference optimization algorithm and combining it with the preference dataset, so as to further optimize the optimized open source visual language large model to obtain a detection model through the direct preference optimization loss;

[0059] The second optimization module is used to obtain the inference enhancement loss by weighted combination of the negative log-likelihood loss and the direct preference optimization loss, through... The optimizer minimizes the inference enhancement loss, thereby updating the parameters of the detection model to obtain an optimized detection model.

[0060] The generation module is used to generate corresponding test input samples for unknown videos, and input the test input samples into the optimized detection model. The optimized detection model generates a target prediction sequence through an autoregressive decoding strategy. The target prediction sequence is a tuple containing a prediction label and a prediction reason. The prediction label is either a negative video or a non-negative video.

[0061] This invention constructs a two-stage framework incorporating information enhancement and reasoning enhancement, combining a multimodal thought chain with a direct preference optimization algorithm. Mathematically, this ensures the model maximizes mutual information utilization of multimodal contextual information and effectively suppresses spurious relevance interference through a contrastive learning mechanism. Experimental results demonstrate that this invention achieves superior detection performance and exhibits significant advantages in interpreting the generated information content, logicality, and persuasiveness. Attached Figure Description

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

[0063] in:

[0064] Figure 1 This is an application environment diagram of a video detection method based on multimodal thinking chain and direct preference optimization in one embodiment;

[0065] Figure 2This is a flowchart of a video detection method based on multimodal thinking chain and direct preference optimization in one embodiment;

[0066] Figure 3 This is a structural block diagram of a video detection device based on multimodal thinking chain and direct preference optimization in one embodiment;

[0067] Figure 4 This is a structural block diagram of a computer device in one embodiment. Detailed Implementation

[0068] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0069] To address the aforementioned technical issues, this application provides a video detection method based on multimodal thinking chain and direct preference optimization.

[0070] Figure 1 This is a diagram illustrating the application environment of a video detection method based on multimodal thinking chain and direct preference optimization in one embodiment. (Refer to...) Figure 1This video detection method based on multimodal thinking chain and direct preference optimization is applied to a video detection system based on multimodal thinking chain and direct preference optimization. The system includes a terminal 110 and a server 120. The terminal 110 and server 120 are connected via a network. The terminal 110 can be a desktop terminal or a mobile terminal, specifically a mobile phone, tablet computer, laptop computer, or at least one of these. The server 120 can be a standalone server or a server cluster consisting of multiple servers. Terminal 110 is used to acquire a set of video samples with known labels as a training set. The video sample set consists of multiple video samples, each containing a video frame sequence, an audio signal, and embedded text appearing in the video frame sequence. An automatic speech recognition model is used to map the audio signal into a text sequence. An optical character recognition tool is used to extract the embedded text from the video frame sequence. The video samples include video descriptions and potentially harmful elements, including text modality harmful elements and visual modality harmful elements. Server 120 is used to construct an enhanced input sample containing multi-source information for each video sample. Multiple enhanced input samples constitute the enhanced input. The multi-source information includes: video frame sequence, video text, video description, text modality harmful elements, visual modality harmful elements, and instruction templates. The video text is the union of the text sequence and the embedded text. The enhanced input is converted into a high-dimensional feature vector sequence through the embedding layer of an open-source visual language large model, and the high-dimensional feature vector sequence is... The parameters are projected into a query matrix, a key matrix, and a value matrix, respectively. Based on the query matrix and key matrix, the attention score matrix for each attention head of the open-source visual language large model is determined. Based on the attention score matrix and the value matrix, the attention score value matrix for each attention head is determined. The attention score value matrices of all heads are concatenated and then linearly transformed to obtain the multi-head attention output. Based on the multi-head attention output and the high-dimensional feature vector sequence, the final output feature sequence is obtained. The final output feature sequence is encoded using a low-rank adaptation technique to obtain the encoded output. Based on a supervised fine-tuning loss function, and combined with the encoded output and enhanced input, the negative log-likelihood loss of the target sequence is determined. The negative log-likelihood loss is then used to adjust the open-source visual language... The parameters in the large model are optimized to obtain an optimized open-source visual language large model. For the augmented input, the positive sample set is defined as a sequence containing correct labels and correct reasons. By constructing adversarial instructions, the optimized open-source visual language large model is induced to generate incorrect reasons for incorrect labels that support video samples, thereby constructing a negative sample set. The augmented input, the positive sample set, and the negative sample set constitute a preference dataset. The direct preference optimization algorithm is used in conjunction with the preference dataset to determine the direct preference optimization loss, which is then used to further optimize the optimized open-source visual language large model to obtain a detection model. The negative log-likelihood loss and the direct preference optimization loss are weighted together to obtain the inference augmentation loss. The optimizer minimizes the inference enhancement loss, thereby updating the parameters of the detection model to obtain an optimized detection model. For unknown videos, corresponding test input samples are generated and input into the optimized detection model. The optimized detection model generates a target prediction sequence through an autoregressive decoding strategy. The target prediction sequence is a tuple containing a prediction label and a prediction reason. The prediction label is either a negative video or a non-negative video.

[0071] This invention provides an interpretable multimodal negative video detection method based on information augmentation and reasoning augmentation. First, this invention constructs two interpretable negative video datasets with fine-grained annotations: Ex-HateMM and Ex-ImpliHateVid. During the data acquisition phase, for ethical and copyright compliance considerations, this invention extends the existing peer-reviewed datasets HateMM and ImpliHateVid, whose original data mainly comes from video sharing platforms such as BitChute and Odysee. The method involves deep analysis and structured reconstruction of the original multimodal data.

[0072] like Figure 2As shown, in one embodiment, a video detection method based on multimodal thinking chain and direct preference optimization is provided. This method can be applied to both terminals and servers; this embodiment illustrates its application to a terminal. The video detection method based on multimodal thinking chain and direct preference optimization specifically includes the following steps:

[0073] S10: Obtain a set of video samples with known labels as a training set. The set of video samples consists of multiple video samples, each of which contains a video frame sequence, an audio signal, and embedded text appearing in the video frame sequence. Use an automatic speech recognition model to map the audio signal into a text sequence. Use an optical character recognition tool to extract the embedded text from the video frame sequence. The video samples include video descriptions and potentially harmful elements. The potentially harmful elements include text modal harmful elements and visual modal harmful elements.

[0074] S20: For each video sample, construct an enhanced input sample containing multi-source information, and multiple enhanced input samples constitute an enhanced input; the multi-source information includes: video frame sequence, video text, video description, text modality harmful elements, visual modality harmful elements, and instruction template; the video text is the union of the text sequence and the embedded text;

[0075] S30: The enhanced input is converted into a high-dimensional feature vector sequence through the embedding layer of the open-source visual language large model, and the high-dimensional feature vector sequence is... The matrix is ​​projected into a query matrix, a key matrix, and a value matrix, respectively; based on the query matrix and the key matrix, the attention score matrix of each attention head of the open-source visual language large model is determined; based on the attention score matrix and the value matrix, the attention score value matrix of each attention head is determined.

[0076] S40: After concatenating the attention score matrices of all heads, a linear transformation is performed to obtain the multi-head attention output; based on the multi-head attention output and the high-dimensional feature vector sequence, the final output feature sequence is obtained; the final output feature sequence is encoded using a low-rank adaptation technique to obtain the encoded output;

[0077] S50: Based on the supervised fine-tuning loss function, and combined with the encoded output and enhanced input, the negative log-likelihood loss of the target sequence is determined. The parameters in the open-source visual language large model are optimized through the negative log-likelihood loss, thereby obtaining the optimized open-source visual language large model.

[0078] S60: For the augmented input, the positive sample set is defined as a sequence containing correct labels and correct reasons; by constructing adversarial instructions, the optimized open-source visual language large model is induced to generate incorrect labels and incorrect reasons that support video samples, thereby constructing a negative sample set; the augmented input, the positive sample set, and the negative sample set constitute a preference dataset;

[0079] S70: Determine the direct preference optimization loss by using the direct preference optimization algorithm and combining it with the preference dataset, and further optimize the optimized open-source visual language large model to obtain the detection model by using the direct preference optimization loss;

[0080] S80: The negative log-likelihood loss and the direct preference optimization loss are weighted and combined to obtain the inference enhancement loss, which is then used to... The optimizer minimizes the inference enhancement loss, thereby updating the parameters of the detection model to obtain an optimized detection model.

[0081] S90: For unknown videos, generate corresponding test input samples and input the test input samples into the optimized detection model. The optimized detection model generates a target prediction sequence through an autoregressive decoding strategy. The target prediction sequence is a tuple containing prediction labels and prediction reasons. The prediction labels are negative videos or non-negative videos.

[0082] Specifically, a set of video samples with known labels is obtained as the training set. The video sample set is... ,in The total number of samples, the video sample set For multiple video samples Composition, each video sample Includes video frame sequence Audio signals and video frame sequences Embedded text appearing in To ensure data quality, this invention implements a rigorous preprocessing procedure: ffmpeg is used to decode and verify video files to remove corrupted samples, and equally spaced time sampling is performed to extract keyframe sequences. To bridge the multimodal semantic gap, non-textual modalities are first converted into textual modal representations through a preprocessing module.

[0083] For audio signals Using the Automatic Speech Recognition (ASR) Whisper-large model Map it to a text sequence For video frame sequences Using the PaddleOCR tool for optical character recognition (OCR) from video frame sequences Extracting embedded text .

[0084] Furthermore, to enhance the objective understanding of video content by the open-source Large Model for Visual Language (MLLM), this invention introduces a fact-and-inference separation annotation strategy to construct a fine-grained annotation set. Video samples are defined. The video description is Potentially harmful elements are The video description includes... Annotators are required to objectively and neutrally summarize the main scenes and actions in the video, without incorporating subjective assumptions; potentially harmful elements. Contains harmful elements in text modality and visual modal harmful elements .

[0085] Text modal harmful elements It is by using video text With a predefined list of offensive vocabulary The set of matched words obtained after matching, i.e. , To match words.

[0086] Visual modal harmful elements Then, the video frame sequence is identified using an object detection algorithm. get.

[0087] Subsequently, this invention constructs video samples. reason Based on the identified factual elements, a natural language text is generated to explain in detail the logical basis for determining whether the video belongs to a negative or non-negative category. To balance efficiency and quality, a human-machine collaborative model was adopted: GPT-4o-mini was used as an auxiliary tool to generate pre-annotated text, which was then independently revised and confirmed by two senior annotators with master's degrees. Finally, a doctoral-level expert performed consistency verification and integration of the annotation results.

[0088] After completing the dataset, this invention performs a two-stage training process: information augmentation (IA) and reasoning augmentation (RE).

[0089] For each video sample Construct an enhanced input sample containing multi-source information. ,in For use in detecting video samples The instruction template. To stimulate the reasoning ability of the open-source Large Model for Visual Language (MLLM), this step adopts the Multimodal Thinking Chain (MCoT) mechanism, utilizing instruction templates. Multi-source information The enhanced input sample was obtained by filling the specific prompt word slots. The following is an example: "You are a negative video detection expert. The input context includes: video frame sequence." Video text Video description Harmful elements in text modality Harmful elements in visual modality Please output the prediction result (hate / non-hate) and the reasoning.

[0090] In the information augmentation (IA) stage, this invention aims to utilize the generative capabilities of an open-source large visual language model (MLLM). In this application, the open-source large visual language model is Qwen2.5-VL. Supervised fine-tuning (SFT) enables the model to learn from augmented inputs. Inferring predicted labels and corresponding reasons The ability to enhance input For multiple augmented input samples The set that constitutes the composition.

[0091] Define the parameters of the open-source visual language large model as follows Its underlying architecture is based on the Transformer network. For enhanced input... First, the input is enhanced through the embedding layer of the open-source Large Model for Visual Language (MLLM). Convert to a high-dimensional feature vector sequence ,in For sequence length, This refers to the hidden layer dimension. The core computational unit of the open-source visual language large model is the multi-head self-attention mechanism (MHSA). It is assumed that the model contains... The first attention point, for the first Size, High-dimensional feature vector sequence Projected as a query matrix Key matrix Sum matrix The calculation formula is as follows:

[0092]

[0093]

[0094]

[0095] in, It is a high-dimensional feature vector sequence; The projection matrix is ​​learnable. For each attention head, there are specific feature dimensions. The attention weights are calculated using a scaled dot product:

[0096]

[0097] in, For the first Attention rating matrix for individuals.

[0098] For high-dimensional feature vector sequences The first thing that the bulls are paying attention to. The output of each head is an attention score matrix:

[0099]

[0100] Final multi-head attention output It is obtained by concatenating the attention score matrices of all heads and then performing a linear transformation:

[0101]

[0102] in, For multi-head attention output; To output the projection matrix; This is for splicing operations.

[0103] Subsequently, the high-dimensional feature vector sequence After layer normalization (LN) and feed-forward network (FFN) processing, residual connections are introduced:

[0104]

[0105] Feedforward output sequence The calculation formula is:

[0106]

[0107]

[0108] in, This is the updated high-dimensional feature vector sequence; It is a high-dimensional feature vector sequence; This is the feedforward output sequence; and This is the weight matrix; and For bias terms; For the intermediate layer dimensions of the feedforward network; The final output feature sequence is obtained by stacking multiple layers of the Transformer network described above. The model is able to capture long-distance dependencies and cross-modal interactions in the input information.

[0109] By stacking multiple layers of the aforementioned Transformer network, the model can capture long-range dependencies and cross-modal interactions in the input information. To reduce computational costs and improve training efficiency during training, this invention introduces Low-Rank Adaptation (LoRA) technology in the information augmentation stage. For the pre-trained model parameters... The random weight matrix in Freeze the system and introduce two low-rank matrices. and Update, among which A low-rank matrix and rank, and .

[0110] The final output feature sequence is encoded using the low-rank adaptation (LoRA) technique to obtain the encoded output. for:

[0111]

[0112] in, This is the updated high-dimensional feature vector sequence; It is a high-dimensional feature vector sequence; This is the feedforward output sequence; and This is the weight matrix; and For bias terms; For the intermediate layer dimensions of the feedforward network; The final output feature sequence;

[0113] Based on the above model architecture, this invention introduces an information enhancement stage, the optimization objective of which is to maximize the generation of the target sequence. Conditional probability, target sequence set , = ;in, For the first Video text The target sequence, The total length of the output sequence. For the first Video text The correct corresponding label, For the first Video text The corresponding correct reason. This is achieved by constructing an instruction template. The requirement is for an open-source Large Model for Visual Language (MLLM) to be used based on augmented input. Output formatted prediction results. Supervised fine-tuning (SFT) loss. Defined as target sequence The negative log-likelihood loss, through the negative log-likelihood loss Parameters in the open-source Large Model for Visual Language (MLLM) Optimization was performed to obtain the optimized open-source Large Scale Visual Language Model (MLLM):

[0114]

[0115]

[0116] in, for Encoded output The loss is negative log-likelihood. Indicates in model parameters Given augmented input At that time, the target sequence is generated. The conditional probability, This represents the training dataset used for supervised fine-tuning, containing augmented inputs. and target sequence The sample pairs formed and These represent the time steps. and time step The previously generated sequence; M is the total number of time steps.

[0117] By minimizing the supervised fine-tuning (SFT) loss This makes the parameters of the large open-source visual language model... It has been updated to fully utilize enhanced contextual information, including the video description set. By generating evidence-rich reasons from the set of potentially harmful elements H, a paradigm shift from simple label prediction to evidence-based reasoning is achieved.

[0118] Building upon this, to prevent the model from learning spurious correlations in the data distribution, this invention further proposes an inference enhancement stage. In this stage, the invention constructs preference pairs containing both correct and incorrect inference paths.

[0119] For enhanced input Define the set of positive samples To include the correct tags and the correct reason sequence, that is Simultaneously, by constructing adversarial instructions, the open-source Large Model for Visual Language (MLLM) is induced to generate incorrect labels that support video samples. The wrong reason Thus constructing a negative sample set For example, for a sample whose correct label is "non-negative", the input instruction is: "Please explain why this video sample is a negative video".

[0120] Among them, the reasons for the error The generation process is as follows: the optimized open-source Large Model for Visual Language (MLLM) is forced to mine superficial features in video samples (such as non-malicious fighting or non-targeted insults) to forcibly prove erroneous conclusions, thereby generating erroneous reasons driven by false correlations. This process leverages the generative capabilities of large language models to explicitly expose spurious features that the model might rely on. Ultimately, this augments the input. Positive sample set and negative sample set A preference dataset was jointly constructed. To ensure the quality of negative samples, the system introduces a filtering mechanism to remove samples that the model cannot generate coherent explanations for. These samples are usually unambiguous and simple, thus focusing on complex samples that are prone to causing confusion.

[0121] In the inference enhancement stage, this invention employs the Direct Preference Optimization (DPO) algorithm to further post-train the model trained by SFT. The Direct Preference Optimization (DPO) algorithm aims to further optimize the aforementioned optimized open-source Large Model for Visual Language (MLLM) to obtain a detection model. , making the detection model In order to satisfy and optimize the open-source Large Model for Visual Language (MLLM) (i.e., the reference model) Under the constraint of proximity, the algorithm maximizes the reward for human preference (i.e., correct reasoning is better than incorrect reasoning). The Direct Preference Optimization (DPO) algorithm... as follows:

[0122]

[0123] in, Optimize the loss for direct preferences; This represents the Sigmoid activation function, used to map reward differences to a probability distribution; To detect the probability that the model generates the correct label and the correct reason; The probability of generating the correct label and correct reason for the reference model; To detect the probability of the model generating incorrect labels and reasons for errors; The probability of generating error labels and error reasons for the reference model; To control deviation from the reference model The degree of hyperparameter temperature coefficient. The gradient of this loss function has an intuitive physical meaning: when the detection model... For negative sample set The generation probability relative to the reference model As the number of positive correlations increases, the loss value increases, thus penalizing the model's dependence on spurious correlations; conversely, when the model performs well on the defined sample set... As the generation probability increases relatively, the loss value decreases, thus encouraging logically consistent reasoning. The gradient of this loss function can intuitively increase the probability of generating positive samples. The relative log probability, while reducing the probability for negative sample sets. The relative log probability. Through this optimization process, the model is explicitly guided to distinguish between logically sound causal reasoning and erroneous attributions based on spurious correlations, thereby significantly improving the logical coherence and persuasiveness of the generated reasons.

[0124] To enhance inference capabilities while maintaining model stability on generation tasks and preventing model degradation on out-of-distribution samples, this invention also introduces the SFT loss function during the inference enhancement stage. As an auxiliary regularization term, it enhances the final inference loss. Optimize loss using direct preferences and negative log-likelihood loss Composed of weighted combinations:

[0125]

[0126] in, Enhance the loss for reasoning; This is the balance coefficient; Add it to the direct preference optimization loss; It is a negative log-likelihood loss.

[0127] Enhance loss by optimizing reasoning. This invention can simultaneously enhance the detection model. The ability to memorize correct knowledge and to identify flawed logic. This is achieved through the use of... The optimizer minimizes the inference enhancement loss. This leads to the detection model parameters The final update is obtained to optimize the detection model. This process forces the optimization of the detection model. In the probability space, it is necessary not only to predict the correct label, but also to generate logically sound reasons and explicitly suppress the erroneous reasoning pattern of "forced attribution".

[0128] In the model inference and application phase, for a given unknown video... The system first automatically executes a preprocessing procedure to generate unknown videos. Corresponding test input samples ,in, This is the instruction template for the previously defined video detection. Then... The input is fed into the optimized detection model obtained after two stages of training. 'In China, optimize the detection model.' 'Generate predicted sequences using an autoregressive decoding strategy. Let...' The output probability distribution at time t is A greedy search algorithm is used to determine the final target prediction sequence. The target prediction sequence For including prediction labels and the reasons for the prediction The tuple, the predicted label Negative or non-negative video:

[0129]

[0130] in, Predict the target sequence Indicates in model parameters Given the test input At that time, generate the target prediction sequence. The conditional probability; Input samples for testing; For time steps; The target sequence.

[0131] The final output includes not only the predicted labels It also includes a natural language description of the reasoning behind the prediction. The reason for this prediction The model for determining unknown videos is explained in detail. This provides a basis for the nature of the content, thus offering interpretable support for content moderation.

[0132] In summary, this invention constructs a two-stage framework incorporating information enhancement and reasoning enhancement, combining a multimodal thought chain with a direct preference optimization algorithm. Mathematically, this ensures the model maximizes mutual information utilization of multimodal contextual information and effectively suppresses spurious relevance interference through a contrastive learning mechanism. Experimental results demonstrate that this method achieves superior detection performance compared to existing state-of-the-art methods on datasets such as Ex-HateMM and Ex-ImpliHateVid, and exhibits significant advantages in interpreting the generated information content, logicality, and persuasiveness.

[0133] To verify the effectiveness of the proposed method, experiments were conducted using two datasets: Ex-HateMM and Ex-ImpliHateVid. The dataset split ratio was consistent with existing benchmarks (e.g., Ex-HateMM used a 7:1:2 training, validation, and testing split). Regarding hardware and training parameter settings, all experiments were performed on a server equipped with four NVIDIA H20 GPUs. Low-rank adaptation (LoRA) was used for model training to reduce memory overhead, and the LoRA rank was set accordingly. scaling factor The dropout rate was set to 0.05. The optimizer used was AdamW, and the learning rate was set to [value missing] during the information augmentation (IA) phase. The training period is 2 epochs, aiming to minimize the negative log-likelihood loss. During the reasoning enhancement (RE) phase, the learning rate is adjusted to... The training period is 1 epoch, and the temperature parameter is... Set to 0.3, balance coefficient Used to combine the final loss To ensure the simplicity of the generated reason, the maximum generated length is limited to 100 tokens. To comprehensively evaluate the detection performance of the method of this invention, this embodiment selects accuracy (Acc.), precision, recall, and macro average F1 score (F1) as evaluation metrics. Among them, Macro F1 is the primary metric, and its calculation formula is as follows: This approach effectively balances the bias caused by uneven sample sizes across different categories. The benchmark models compared include unimodal models (BERT, ViT, MFCC), traditional multimodal models (TTM, MulT, CSID, MoRE, TCL), and advanced multimodal large language models (GLM4.1V, Qwen2.5-VL). Table 1 details the performance comparison data between the proposed method (IARE) and the aforementioned benchmark models on two datasets.

[0134] Table 1

[0135]

[0136] A thorough analysis of the data in Table 1 reveals that the proposed method achieves significant advantages across all key metrics. Specifically, on the Ex-HateMM dataset, the IARE method based on Qwen2.5-VL achieves a Macro F1 score of 90.14%, a 6.6 percentage point improvement over the strongest baseline model, TCL (83.54%). On the Ex-ImpliHateVid dataset, the F1 score reaches 91.75%, outperforming TCL's 87.73%. This indicates that, compared to traditional multimodal methods that only utilize feature concatenation or contrastive learning, the present invention, by introducing multimodal thought chains and preference optimization, can more effectively capture subtle negative cues in videos. Furthermore, compared to the original base model (such as Qwen2.5-VL w / SFT), the introduction of IARE brings stable performance gains (F1 scores improved by 4.28% and 2.25%, respectively), validating the necessity of the inference enhancement (RE) stage for correcting spurious correlations and improving logical reasoning capabilities.

[0137] In addition to improving detection accuracy, this invention also focuses on the interpretability of the model. To quantify the quality of the generated reasons, the experiment used GPT-4 as the evaluator, supplemented by human evaluation. The evaluation dimensions included: information content, readability, rationality, and persuasiveness. The scoring used a Likert scale of 1-5 points. Table 2 shows a comparison of the quality scores of the reasons generated at different stages (original model, IA only, and full IARE).

[0138] Table 2

[0139]

[0140] Analysis of Table 2 shows that the IARE framework proposed in this invention outperforms the baseline model in all interpretability dimensions. In particular, the "persuasiveness" metric shows the most significant improvement after introducing the reasoning enhancement (RE) stage (GPT-4 score increased from 3.37 to 3.92, and human score increased from 3.66 to 4.22). This is attributed to the DPO algorithm's optimization of the loss function. This forces the model to significantly distinguish correct reasoning in the probability space. erroneous reasoning based on spurious correlations This results in explanations that are not only grammatically fluent but also logically rigorous and strongly supported by evidence. Meanwhile, the increased "information content" (e.g., the GPT-4 score rising from 3.43 to 3.88) is primarily attributed to the effective injection of knowledge about video captions and harmful elements during the information augmentation (IA) stage. In conclusion, the experimental data fully demonstrates the dual beneficial effects of this invention in improving both the accuracy and interpretability of negative video detection.

[0141] This application also provides a video detection device based on multimodal thinking chain and direct preference optimization, such as Figure 3 As shown, the device includes:

[0142] Extraction module 10 is used to acquire a set of video samples with known labels as a training set. The set of video samples consists of multiple video samples, each of which contains a video frame sequence, an audio signal, and embedded text appearing in the video frame sequence. The audio signal is mapped to a text sequence using an automatic speech recognition model. The embedded text is extracted from the video frame sequence using an optical character recognition tool. The video samples include video descriptions and potentially harmful elements, and the potentially harmful elements include text modal harmful elements and visual modal harmful elements.

[0143] The first construction module 20 is used to construct an enhanced input sample containing multi-source information for each video sample, and multiple enhanced input samples constitute an enhanced input; the multi-source information includes: video frame sequence, video text, video description, text modality harmful elements, visual modality harmful elements, and instruction template; the video text is the union of the text sequence and the embedded text;

[0144] Projection module 30 converts the enhanced input into a high-dimensional feature vector sequence through the embedding layer of the open-source visual language large model, and then... The matrix is ​​projected into a query matrix, a key matrix, and a value matrix, respectively; based on the query matrix and the key matrix, the attention score matrix of each attention head of the open-source visual language large model is determined; based on the attention score matrix and the value matrix, the attention score value matrix of each attention head is determined.

[0145] Encoding module 40 concatenates the attention score matrices of all heads and performs a linear transformation to obtain multi-head attention output; based on the multi-head attention output and the high-dimensional feature vector sequence, it obtains the final output feature sequence; and encodes the final output feature sequence using low-rank adaptation technology to obtain the encoded output.

[0146] The first optimization module 50 is used to determine the negative log-likelihood loss of the target sequence based on the supervised fine-tuning loss function and in combination with the encoded output and the enhanced input. The negative log-likelihood loss is used to optimize the parameters in the open-source visual language large model, thereby obtaining the optimized open-source visual language large model.

[0147] The second construction module 60 is used to define the positive sample set as a sequence containing correct labels and correct reasons for the augmented input; and to construct a negative sample set by constructing adversarial instructions to induce the optimized open-source visual language large model to generate incorrect labels and incorrect reasons that support video samples; the augmented input, the positive sample set, and the negative sample set constitute a preference dataset.

[0148] The first optimization module 70 is used to determine the direct preference optimization loss by using the direct preference optimization algorithm and combining it with the preference dataset, so as to further optimize the optimized open source visual language large model to obtain a detection model through the direct preference optimization loss;

[0149] The second optimization module 80 is used to obtain the inference enhancement loss by weighted combination of the negative log-likelihood loss and the direct preference optimization loss, through... The optimizer minimizes the inference enhancement loss, thereby updating the parameters of the detection model to obtain an optimized detection model.

[0150] The generation module 90 is used to generate corresponding test input samples for unknown videos, and input the test input samples into the optimized detection model. The optimized detection model generates a target prediction sequence through an autoregressive decoding strategy. The target prediction sequence is a tuple containing a prediction label and a prediction reason. The prediction label is a negative video or a non-negative video.

[0151] Figure 4 An internal structural diagram of a computer device in one embodiment is shown. This computer device can specifically be a terminal or a server. Figure 4 As shown, the computer device includes a processor, memory, and network interface connected via a system bus. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and may also store a computer program. When executed by the processor, this computer program enables the processor to implement a video detection method based on multimodal thinking chains and direct preference optimization. The internal memory may also store a computer program, which, when executed by the processor, enables the processor to implement the video detection method based on multimodal thinking chains and direct preference optimization. Those skilled in the art will understand that… Figure 4 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0152] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.

[0153] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0154] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. A video detection method based on multimodal thinking chain and direct preference optimization, characterized in that, The method includes: A set of video samples with known labels is obtained as a training set. The set of video samples consists of multiple video samples, each of which contains a video frame sequence, an audio signal, and embedded text appearing in the video frame sequence. The audio signal is mapped into a text sequence using an automatic speech recognition model. The embedded text is extracted from the video frame sequence using an optical character recognition tool. The video samples include video descriptions and potentially harmful elements, which include text modal harmful elements and visual modal harmful elements. For each video sample, an enhanced input sample containing multi-source information is constructed, and multiple enhanced input samples constitute the enhanced input; the multi-source information includes: video frame sequence, video text, video description, text modality harmful elements, visual modality harmful elements, and instruction template; the video text is the union of the text sequence and the embedded text; The enhanced input is converted into a high-dimensional feature vector sequence through the embedding layer of the open-source visual language large model, and the high-dimensional feature vector sequence is then... The matrix is ​​projected into a query matrix, a key matrix, and a value matrix, respectively; based on the query matrix and the key matrix, the attention score matrix of each attention head of the open-source visual language large model is determined; based on the attention score matrix and the value matrix, the attention score value matrix of each attention head is determined. The attention score matrices of all heads are concatenated and then linearly transformed to obtain the multi-head attention output; the final output feature sequence is obtained based on the multi-head attention output and the high-dimensional feature vector sequence; the final output feature sequence is encoded using a low-rank adaptation technique to obtain the encoded output; Based on the supervised fine-tuning loss function, and combined with the encoded output and enhanced input, the negative log-likelihood loss of the target sequence is determined. The parameters in the open-source visual language large model are optimized by the negative log-likelihood loss, thereby obtaining the optimized open-source visual language large model. For the augmented input, the positive sample set is defined as a sequence containing correct labels and correct reasons; by constructing adversarial instructions, the optimized open-source visual language large model is induced to generate incorrect labels and incorrect reasons that support video samples, thereby constructing the negative sample set; the augmented input, the positive sample set, and the negative sample set constitute the preference dataset; The direct preference optimization loss is determined by using the direct preference optimization algorithm and combining it with the preference dataset. The detection model is then further optimized by using the direct preference optimization loss on the optimized open-source visual language large model. The negative log-likelihood loss and the direct preference optimization loss are weighted and combined to obtain the inference enhancement loss, through... The optimizer minimizes the inference enhancement loss, thereby updating the parameters of the detection model to obtain an optimized detection model. For an unknown video, a corresponding test input sample is generated and input into the optimized detection model. The optimized detection model generates a target prediction sequence through an autoregressive decoding strategy. The target prediction sequence is a tuple containing a prediction label and a prediction reason. The prediction label is either a negative video or a non-negative video.

2. The video detection method based on multimodal thinking chain and direct preference optimization according to claim 1, characterized in that, The harmful elements in the text modality are a set of matching words obtained by matching video text with a predefined library of offensive words; The visual modal harmful elements are obtained by identifying the video frame sequence through a target detection algorithm.

3. The video detection method based on multimodal thinking chain and direct preference optimization according to claim 1, characterized in that, The process of generating the error reason is as follows: Optimize open-source visual language models to mine superficial features in video samples: non-malicious fighting or non-targeted insults are used to forcefully prove erroneous conclusions, thereby generating false reasons driven by spurious correlations.

4. The video detection method based on multimodal thinking chain and direct preference optimization according to claim 1, characterized in that, The attention scoring matrix and the attention scoring value matrix are implemented by the following expressions: in, For query matrix; The key matrix; It is a value matrix; It is a high-dimensional feature vector sequence; The projection matrix is ​​learnable; Feature dimensions for each attention head; For the first Attention rating matrix based on size; This is a matrix of attention ratings.

5. The video detection method based on multimodal thinking chain and direct preference optimization according to claim 1, characterized in that, The multi-head attention output is achieved through the following expression: in, For multi-head attention output; To output the projection matrix; For splicing operations; The final output feature sequence is achieved through the following expression: in, This is the updated high-dimensional feature vector sequence; It is a high-dimensional feature vector sequence; This is the feedforward output sequence; and This is the weight matrix; and For bias terms; For the intermediate layer dimensions of the feedforward network; The final output feature sequence; The encoded output is achieved through the following expression: in, For encoded output; is a random weight matrix; is a scaling factor; and All are low-rank matrices; A low-rank matrix and rank, .

6. The video detection method based on multimodal thinking chain and direct preference optimization according to claim 1, characterized in that, The negative log-likelihood loss based on supervised fine-tuning of the loss function, combined with the encoded output and enhanced input, to determine the target sequence is implemented through the following expression: in, for The encoded output; The loss is negative log-likelihood. Indicates in model parameters Given augmented input At that time, the target sequence is generated. The conditional probability; This represents the training dataset used for supervised fine-tuning, containing augmented inputs. and target sequence The sample pairs formed and These represent the time steps. and time step Previous generated sequences; For encoded output; M is the total number of time steps.

7. The video detection method based on multimodal thinking chain and direct preference optimization according to claim 1, characterized in that, The connection preference optimization loss is implemented using the following expression: in, Optimize the loss for direct preferences; This represents the Sigmoid activation function, used to map reward differences to a probability distribution; To detect the probability that the model generates the correct label and the correct reason; The probability of generating the correct label and correct reason for the reference model; To detect the probability of the model generating incorrect labels and reasons for errors; The probability of generating error labels and error reasons for the reference model; To control deviation from the reference model The degree of hyperparameter temperature coefficient.

8. The video detection method based on multimodal thinking chain and direct preference optimization according to claim 1, characterized in that, The target prediction sequence is achieved through the following expression: in, Predict the target sequence Indicates in model parameters Given the test input At that time, generate the target prediction sequence. The conditional probability; Input samples for testing; For time steps; The target sequence.

9. A video detection device based on multimodal thinking chain and direct preference optimization, characterized in that, The device includes: An extraction module is used to acquire a set of video samples with known labels as a training set. The set of video samples consists of multiple video samples, each containing a video frame sequence, an audio signal, and embedded text appearing in the video frame sequence. An automatic speech recognition model is used to map the audio signal into a text sequence. An optical character recognition tool is used to extract the embedded text from the video frame sequence. The video samples include video descriptions and potentially harmful elements, and the potentially harmful elements include text modal harmful elements and visual modal harmful elements. The first construction module is used to construct an enhanced input sample containing multi-source information for each video sample, and multiple enhanced input samples constitute an enhanced input; the multi-source information includes: video frame sequence, video text, video description, text modality harmful elements, visual modality harmful elements, and instruction template; the video text is the union of the text sequence and the embedded text; The projection module converts the augmented input into a high-dimensional feature vector sequence through the embedding layer of the open-source visual language large model, and then... The matrix is ​​projected into a query matrix, a key matrix, and a value matrix, respectively; based on the query matrix and the key matrix, the attention score matrix of each attention head of the open-source visual language large model is determined; based on the attention score matrix and the value matrix, the attention score value matrix of each attention head is determined. The encoding module concatenates the attention score matrices of all heads and performs a linear transformation to obtain the multi-head attention output; based on the multi-head attention output and the high-dimensional feature vector sequence, it obtains the final output feature sequence; and it encodes the final output feature sequence using a low-rank adaptation technique to obtain the encoded output. The first optimization module is used to determine the negative log-likelihood loss of the target sequence based on the supervised fine-tuning loss function and in combination with the encoded output and the enhanced input. The negative log-likelihood loss is used to optimize the parameters in the open-source visual language large model, thereby obtaining the optimized open-source visual language large model. The second construction module is used to define the positive sample set as a sequence containing correct labels and correct reasons for the augmented input; and to construct a negative sample set by constructing adversarial instructions to induce the optimized open-source visual language large model to generate incorrect labels and incorrect reasons that support video samples; the augmented input, the positive sample set, and the negative sample set constitute the preference dataset. The second optimization module is used to determine the direct preference optimization loss by using the direct preference optimization algorithm and combining it with the preference dataset, so as to further optimize the optimized open source visual language large model to obtain a detection model through the direct preference optimization loss; The third optimization module is used to obtain the inference enhancement loss by weighted combination of the negative log-likelihood loss and the direct preference optimization loss, through... The optimizer minimizes the inference enhancement loss, thereby updating the parameters of the detection model to obtain an optimized detection model. The generation module is used to generate corresponding test input samples for unknown videos, and input the test input samples into the optimized detection model. The optimized detection model generates a target prediction sequence through an autoregressive decoding strategy. The target prediction sequence is a tuple containing a prediction label and a prediction reason. The prediction label is either a negative video or a non-negative video.