Multimodal video retrieval model training method

By constructing a semantically difficult-aware online synthesis engine and dynamic temperature control, the overfitting and modal gap shift problems of multimodal video retrieval models are solved, achieving efficient and robust video-text retrieval, which is suitable for industrial security monitoring and intelligent video editing platforms.

CN123161237APending Publication Date: 2026-11-24LINKER
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611092747.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-22
Publication Date
2026-11-24

AI Technical Summary

Technical Problem

Existing video-text retrieval models suffer from overfitting, modal gap shift, and high training costs when handling complex queries such as time reversal, logical negation, and multimodal editing commands.

Method used

By constructing a semantic difficulty-aware online synthesis engine, designing a modal gap differentiability metric and a dynamic temperature control loop, and training a multimodal video retrieval model using lightweight text triples, the model combines cross-modal center alignment and hyperspherical uniformity regularization loss to update only the text decoding layer parameters.

Benefits of technology

It significantly reduces training costs, improves the retrieval robustness and industrial deployment feasibility of complex semantic queries, and enhances fine-grained semantic discriminative power and modal gap adaptive convergence.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123161237A_ABST
    Figure CN123161237A_ABST
Patent Text Reader

Abstract

This invention discloses a training method for a multimodal video retrieval model, comprising the following steps: constructing an explicit semantic compression embedding extraction module; performing uniform keyframe sampling on the video and converting it into a visual tag sequence after freezing the visual encoder, and then concatenating time-position encoding; truncating the autoregressive generation link through a single-word constraint prompt template, and outputting a standardized cross-modal embedding vector after linear projection and L2 normalization; calculating the cosine similarity between anchor points and negative samples, generating multiple types of semantically difficult negative samples online and constructing difficulty-aware weights, and resampling according to the weights to select a high-adversarial training set; constructing an adaptive contrastive loss by combining the difficulty weights; superimposing alignment loss and uniformity regularization loss to form the overall objective, and terminating training using a parameter-efficient fine-tuning strategy and a double early stopping criterion. This invention can improve the retrieval accuracy and robustness under complex semantic queries, significantly reduce training computational consumption, and has good industrial deployment feasibility.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence foundational layer model architecture and training algorithm technology, and more specifically to a multimodal video retrieval model training method. Background Technology

[0002] Existing video-text retrieval models generally face three major technical bottlenecks when handling complex queries such as time-series reversal, logical negation, and multimodal editing commands: (1) Traditional contrastive training relies on offline constructed static image-text pairing datasets. The difficult samples lack dynamic semantic adversarialness in the training process, which makes the model prone to overfitting or underlearning at fine-grained discrimination boundaries. (2) There is a systematic shift (modal gap) in the multimodal representation space. The text and video embeddings are unevenly distributed on the hypersphere. The contrast loss at a fixed temperature cannot adapt to the gradient oscillation in the early stage of training and the boundary sharpening requirements in the later stage. (3) The joint fine-tuning of the vision and language modules consumes a lot of computing power and lacks a pure text-driven efficient convergence mechanism and a deployable mathematical early stopping criterion. Summary of the Invention

[0003] To address the shortcomings of existing technologies, this invention aims to provide a method for fine-tuning a video retrieval model that features online dynamic adversarial capabilities, adaptive gap adjustment, and pure text-driven processing. By constructing an online synthesis engine for semantically difficult negative samples and designing a modal gap differentiable metric and dynamic temperature control loop, a multimodal large model can achieve high-precision cross-modal alignment relying solely on lightweight text triples. This significantly reduces training costs while improving retrieval robustness and industrial deployment feasibility under complex semantic queries.

[0004] To achieve the above objectives, this invention provides the following technical solution: a multimodal video retrieval model training method, comprising the following steps: Step 1, constructing an explicit semantic compression embedding extraction module, using a pre-trained multimodal large language model as the shared representation backbone, directly retaining the original semantic input of the text, performing uniform keyframe sampling on the video, then converting it into a visual tag sequence by freezing the visual encoder and splicing time position encoding; truncating the autoregressive generation link through a single-word restriction prompt template, forcing the model to condense all multimodal context semantics into the hidden state of the first predicted token, and then processing it with learnable linear projection and L2 normalization to output a standardized cross-modal embedding vector constrained on a unit hypersphere; Step 2, based on the embedding vector output in Step 1, calculating the cosine similarity between the anchor sample and the candidate negative sample; relying on dependency syntax rules to generate time reversal, logical negation, and other multimodal functions online. For example, in step one, semantically difficult samples are combined with similarity values ​​to construct difficulty-aware weights. Resampling with replacement is performed within a batch according to these weights to select a high-adversarial training sample set. In step two, based on the embedding results from step one, modal centers of text and video within the batch are calculated, and the differentiable modal gap norm is measured. The modal gap is mapped to a dynamic contrast temperature using the Sigmoid function, adaptively adjusted between preset upper and lower bounds. Simultaneously, combined with the sample difficulty weights output from step two, an adaptive contrast loss for modal gaps is constructed, and the model's learnable parameters are updated through backpropagation. In step four, based on the contrast loss from step three, cross-modal center alignment loss and hyperspherical uniformity regularization loss are superimposed, and the weighted sum of these three constitutes the overall optimization objective. An efficient fine-tuning strategy that only updates the parameters of the text decoding layer is adopted, while setting dual early stopping criteria: a modal gap convergence threshold and a gradient stability threshold. Training terminates when either condition is met.

[0005] As a further improvement to the present invention, the specific method for constructing the standardized cross-modal embedding vector constrained on a unit hypersphere by the output of the explicit semantic compression embedding extraction module in step one is as follows: A pre-trained multimodal large language model is used as the cross-modal shared representation backbone for the input text query. or video frame sequence Construct explicit single-word restriction prompt template The forced autoregressive decoder condenses the multimodal context into the hidden state of the first predicted token before the generation action is triggered. The extraction process is defined as follows: in, Indicates the first step after forward reasoning The first layer output sequence The hidden state vector at each location; This represents the total number of layers in the model. Indicates the index of the first marked position; Input modal data; A function to generate templates for single-character restriction prompts; Forward propagation operator for multimodal large language models; For learnable linear projection matrices, Embed dimensions for the target. The hidden layer dimension of the model; For normalized cross-modal embedding vectors; express Norm; is a numerical stability constant; for video input, the system pre-extracts F frames using a uniform sampling strategy, converts them into a labeled sequence using a frozen visual encoder and projection mapping network, and then splices time position codes and cue templates together.

[0006] As a further improvement to the present invention, the specific method for selecting the highly adversarial training sample set in step two is as follows: Deploy an asynchronous cached semantic perturbation generator during the training iteration. The generator Employing a dependency syntax rule template library, a lightweight context replacer, and an asynchronous sampling buffer architecture, the current batch of anchor text is processed. Real-time analysis of target fine-grained types Perform local semantic substitution to generate adversarial examples: in, For the current batch Anchor text; For generated hard-to-bear samples; For directional semantic perturbation operators oriented to a specified fine-grained type; This indicates a local substitution operation that preserves syntactic dependencies. For context entity consistency constraint functions; This is a dependency syntax entity matching rate function used to calculate the overlap ratio between anchor points and negative samples in the subject-verb-object core nodes and argument structures. Overlap threshold; generator Training throughput is ensured through asynchronous pre-filled buffer pooling; semantic difficulty-aware weights are calculated based on the embedding vectors output from step one. in, The cosine similarity between the anchor point and the negative sample; This represents the vector dot product operation; Scaling hyperparameters to adjust difficulty; This is the current training batch size; For the first batch Anchor negative similarity of each sample; It is a smoothing constant; For the first The difficulty-perceived weights for each sample are determined during training based on... Constructing a multinomial distribution Within the current batch, sampling with replacement is performed to replace low-adversarial samples, ensuring that the optimization gradient continues to focus on the fine-grained discrimination boundary.

[0007] As a further improvement of the present invention, the specific method for constructing the modal gap adaptive contrast loss in step three and updating the learnable parameters of the model through backpropagation is as follows: Based on the standard contrast loss, a real-time measurement and temperature adaptive adjustment mechanism for modal gap is introduced, assuming that the batch centers of the current batch of text and video embeddings are respectively: in, This represents the batch center vector of the text modality; The video modality batch center vector; and The modal gap norm is calculated using text and video embedding extraction functions, respectively. in, To measure the gap between differentiable modes, a smooth adaptive temperature coefficient is constructed: in, The adaptive contrast temperature for the current training step; and These are the lower and upper bounds, respectively; This is the gap sensitivity coefficient; Using the Sigmoid activation function, the contrastive loss is modified as follows: in, Adaptive contrast loss for modal gaps; The similarity between the anchor point and the positive sample; For positive sample index; For the first The set of hard-to-bear sample indexes corresponding to each anchor point; For anchors and indexes Similarity between corresponding samples.

[0008] As a further improvement of the present invention, the specific method for superimposing the cross-modal center alignment loss and the hyperspherical uniformity regularization loss in step four, and weighting the three to form the overall optimization objective, is as follows: Introducing a center alignment term and a hyperspherical uniformity regularization term:

[0009] in, For cross-modal center alignment loss; This refers to the batch center alignment weight coefficient. For instance-level pairing alignment weight coefficients; For text Benchmark video for semantic matching; For hyperspherical homogeneity regularization loss; The number of pairs of unlabeled samples randomly sampled within a batch; These are two embedded samples that are independently and randomly drawn from the current batch; To ensure uniform bandwidth control, the overall optimization objective is defined as:

[0010] in, To jointly optimize the total loss; This is the weighting coefficient for hyperspherical homogeneity regularization, used to adjust the contribution ratio of the homogeneity constraint term to the total loss.

[0011] As a further improvement to the present invention, the efficient fine-tuning strategy for updating only the parameters of the text decoding layer in step four is as follows: Let the total parameter set of the model be divided into... That is, text decoding layer parameters, That is, the visual encoder parameters and That is, the parameters of the cross-modal projection layer, and during training, only the parameters of the cross-modal projection layer are adjusted. Perform gradient updates, for and The parameter freeze operation is performed, and the parameter update rules are described as follows:

[0012] in, Indicates the first The parameter status of the step; Base learning rate; and These are the first-order and second-order momentum estimates for the adaptive optimizer; This represents element-wise multiplication; The gradient of the total loss with respect to the text decoding layer parameters; when the early stopping condition is met. or continuous Step gradient norm When the time is reached, training is terminated and the fine-tuned retrieval model is output; where, The modal gap convergence threshold, This is the gradient stabilization threshold.

[0013] Beneficial effects of the present invention Training efficiency and data costs are significantly optimized: This method abandons the reliance on massive amounts of image-text pairing data, relying solely on plain text triples and an online dynamic generation mechanism for model fine-tuning. This drastically reduces computational resource consumption and training cycle, effectively lowering the training threshold and data annotation costs for multimodal retrieval models.

[0014] Significantly enhanced fine-grained semantic discriminative power: The online synthesis of dynamic hard-to-bear samples, combined with a difficulty-aware resampling mechanism, allows the model to continuously encounter highly adversarial boundary samples throughout the entire training cycle. In complex long-tail query scenarios such as time reversal, logical negation, and multimodal editing commands, the model can effectively distinguish subtle semantic differences, resulting in substantial improvements in both retrieval recall and average precision.

[0015] Modal gap adaptive convergence and spatial distribution optimization: Empirical hyperparameters are transformed into differentiable dynamic temperature control variables. Combined with center alignment and uniformity regularization terms, this promotes the natural convergence of text and video embedding centers during the optimization process. This mechanism effectively eliminates systematic shifts across modal representation spaces, making the hyperspherical distribution more uniform and significantly improving the stability and robustness of similarity calculation during the inference stage.

[0016] Strong industrial-grade deployment compatibility and scalability: It provides clear mathematical early stopping criteria and a plain text fine-tuning paradigm, which can be seamlessly adapted to mainstream open-source multimodal large model architectures. The inference phase requires only a small number of video frame samples and a single round of forward propagation. Combined with an efficient vector indexing engine, it can meet the needs of real-time retrieval and low-latency deployment scenarios at the edge, demonstrating good engineering feasibility and architectural compatibility. Attached Figure Description

[0017] Figure 1 This is a schematic diagram of the overall process of the multimodal video retrieval model training method of the present invention. Detailed Implementation

[0018] The present invention will now be described in further detail with reference to the embodiments shown in the accompanying drawings.

[0019] Reference Figure 1As shown, the multimodal video retrieval model training method in this embodiment includes the following steps: Step 1, constructing an explicit semantic compression embedding extraction module, using a pre-trained multimodal large language model as the shared representation backbone, directly retaining the original semantic input for text, performing uniform keyframe sampling on the video, then converting it into a visual tag sequence by freezing the visual encoder and splicing time position encoding; truncating the autoregressive generation link through a single-word restriction prompt template, forcing the model to condense all multimodal context semantics into the hidden state of the first predicted token, and then processing it with learnable linear projection and L2 normalization to output a standardized cross-modal embedding vector constrained on a unit hypersphere; Step 2, based on the embedding vector output in Step 1, calculating the cosine similarity between the anchor sample and the candidate negative sample; relying on dependency syntax rules to generate multiple types of semantically difficult negative samples such as temporal reversal and logical negation online. In step one, difficulty-aware weights are constructed by combining similarity values. Resampling with replacement is performed within batches according to these weights to select a high-adversarial training sample set. In step two, modal centers of text and video within a batch are calculated based on the embedding results from step one, and the differentiable modal gap norm is measured. The modal gap is mapped to a dynamic contrast temperature using the Sigmoid function, adaptively adjusting within preset upper and lower bounds. Simultaneously, combined with the sample difficulty weights output from step two, an adaptive contrast loss for modal gaps is constructed, and the model's learnable parameters are updated through backpropagation. In step three, based on the contrast loss from step three, cross-modal center alignment loss and hyperspherical uniformity regularization loss are superimposed, and the weighted sum of these three constitutes the overall optimization objective. An efficient fine-tuning strategy that only updates the parameters of the text decoding layer is adopted, while setting dual early stopping criteria: a modal gap convergence threshold and a gradient stability threshold. Training terminates when either condition is met.

[0020] In this scheme, the explicit semantic compression embedding extraction module is based on a pre-trained multimodal large language model. It truncates the autoregressive generation process using single-word constraint prompt templates, compressing multimodal semantics into the hidden state of a single token. This is then normalized by projection to obtain a unit hyperspherical embedding, providing a standardized representation foundation for subsequent contrastive learning. The online hard-to-bear sample generation and difficulty-aware resampling mechanism breaks the limitations of traditional static datasets. It generates highly adversarial samples such as temporal reversal and logical negation in real time using dependency syntax rules, and dynamically selects training samples based on similarity weights. This allows the model to continuously focus on fine-grained discrimination boundaries, effectively addressing the problem of insufficient discrimination ability under complex queries. The modal gap adaptive temperature mechanism dynamically adjusts the temperature coefficient of the contrast loss by measuring the modal center distance between text and video in real time. A higher temperature is used to smooth the gradient when the modal gap is large in the early stages of training, and a lower temperature is used to sharpen the boundary when the modal gap shrinks in the later stages of training. This adapts to the optimization needs of different training stages and alleviates alignment bias caused by modal space shifts. The parameter-efficient fine-tuning strategy updates only the text decoding layer and freezes the visual encoder and projection layer, significantly reducing the computational cost of fine-tuning. The dual early stopping criteria judge the convergence state from two dimensions: modality alignment and gradient stability, avoiding invalid training iterations and achieving an efficient and controllable training process. This solves the problems of high cost and difficulty in predicting convergence in traditional full-scale fine-tuning.

[0021] Furthermore, the specific method for constructing the standardized cross-modal embedding vector constrained on the unit hypersphere by the explicit semantic compression embedding extraction module in step one is as follows: A pre-trained multimodal large language model is used as the cross-modal shared representation backbone, targeting the input text query... or video frame sequence Construct explicit single-word restriction prompt template The forced autoregressive decoder condenses the multimodal context into the hidden state of the first predicted token before the generation action is triggered. The extraction process is defined as follows:

[0022] in, Indicates the first step after forward reasoning The first layer output sequence The hidden state vector at each location; This represents the total number of layers in the model. Indicates the index of the first marked position; Input modal data; A function to generate templates for single-character restriction prompts; Forward propagation operator for multimodal large language models; For learnable linear projection matrices, Embed dimensions for the target. The hidden layer dimension of the model; For normalized cross-modal embedding vectors; express Norm; It is the numerical stability constant; For video input, the system pre-extracts F frames using a uniform sampling strategy, converts them into a labeled sequence using a frozen visual encoder and projection mapping network, and then splices time-position codes and cue templates together.

[0023] This step clarifies the semantic compression mechanism of single-word restriction prompt templates through mathematical embedding extraction definitions. Leveraging the contextual understanding capabilities of a multimodal large language model, cross-modal information is condensed into the hidden state of the first token. Linear projection and L2 normalization then constrain the embedding onto a unit hypersphere, ensuring the effectiveness and stability of cosine similarity calculation. For the video side, uniform sampling combined with a frozen visual encoder is employed. This preserves the temporal information of the video while avoiding the computational overhead of fine-tuning the visual encoder, thus improving the consistency of cross-modal representations and training efficiency.

[0024] Furthermore, the specific method for selecting the highly adversarial training sample set in step two is as follows: Deploy an asynchronous cached semantic perturbation generator during training iterations. The generator Employing a dependency syntax rule template library, a lightweight context replacer, and an asynchronous sampling buffer architecture, the current batch of anchor text is processed. Real-time analysis of target fine-grained types Perform local semantic substitution to generate adversarial examples: in, For the current batch Anchor text; For generated hard-to-bear samples; For directional semantic perturbation operators oriented to a specified fine-grained type; This indicates a local substitution operation that preserves syntactic dependencies. For context entity consistency constraint functions; This is a dependency syntax entity matching rate function used to calculate the overlap ratio between anchor points and negative samples in the subject-verb-object core nodes and argument structures. Overlap threshold; generator Asynchronous pre-filled buffer pools are used to ensure training throughput. Based on the embedding vector output from step one, calculate the semantic difficulty-aware weight. :

[0025] in, The cosine similarity between the anchor point and the negative sample; This represents the vector dot product operation; β is the difficulty scaling hyperparameter. This is the current training batch size; For the first batch Anchor negative similarity of each sample; It is a smoothing constant; For the first The difficulty-perceived weights for each sample are determined during training based on... Constructing a multinomial distribution Within the current batch, sampling with replacement is performed to replace low-adversarial samples, ensuring that the optimization gradient continues to focus on the fine-grained discrimination boundary.

[0026] This step generates samples through semantic perturbations constrained by dependency syntax rules, ensuring consistency between hard-burden samples and anchor text in core entities and syntactic structure. Modifications are made only to fine-grained semantics such as temporal and logical aspects, resulting in more adversarial samples that effectively force the model to learn fine-grained semantic differences. Difficulty-aware weights are constructed based on anchor-negation similarity; samples with higher similarity have greater weights. Resampling with replacement allows more high-difficulty samples to participate in training, strengthening the model's learning of discrimination boundaries. The asynchronous buffer pool architecture decouples hard-burden sample generation from training iterations, preventing the generation process from slowing down training and ensuring training throughput efficiency while improving sample quality.

[0027] Furthermore, in step three, the modal gap adaptive contrastive loss is constructed, and the learnable parameters of the model are updated through backpropagation as follows: Based on the standard contrastive loss, a real-time modal gap measurement and temperature adaptive adjustment mechanism is introduced. Let the batch centers of the current batch of text and video embeddings be:

[0028] in, This represents the batch center vector of the text modality; The video modality batch center vector; and The modal gap norm is calculated using text and video embedding extraction functions, respectively.

[0029] in, To measure the gap between differentiable modes, a smooth adaptive temperature coefficient is constructed:

[0030] in, The adaptive contrast temperature for the current training step; and Let's distinguish between the lower and upper limits of the temperature range; This is the gap sensitivity coefficient; Using the Sigmoid activation function, the contrastive loss is modified as follows:

[0031] in, Adaptive contrast loss for modal gaps; The similarity between the anchor point and the positive sample; For positive sample index; For the first The set of hard-to-bear sample indexes corresponding to each anchor point; For anchors and indexes Similarity between corresponding samples.

[0032] This step measures the modal gap by the difference between batch modal centers. This measurement method is differentiable and computationally efficient, and can reflect the degree of shift between the two modal representation spaces in real time. Based on the dynamic temperature mapping of the Sigmoid function, the modal gap value is smoothly converted into a contrast temperature. When the modal gap is large, the temperature is increased to avoid excessive gradient of the contrast loss, which would cause training oscillations. When the modal gap is small, the temperature is decreased to amplify the similarity difference between samples and sharpen the classification boundary. Combined with the difficulty weight of hard-to-bear samples, the optimization focus is further tilted towards high-difficulty samples, realizing an adaptive and high-precision contrastive learning process, effectively solving the problems of poor adaptability of fixed-temperature contrast loss and difficulty in eliminating modal shift.

[0033] Furthermore, in step four, the cross-modal center alignment loss and the hyperspherical uniformity regularization loss are superimposed, and the weighted average of these three to form the overall optimization objective is as follows: A center alignment term and a hyperspherical uniformity regularization term are introduced:

[0034]

[0035] in, For cross-modal center alignment loss; This refers to the batch center alignment weight coefficient. For instance-level pairing alignment weight coefficients; For text Benchmark video for semantic matching; For hyperspherical homogeneity regularization loss; The number of pairs of unlabeled samples randomly sampled within a batch; These are two embedded samples that are independently and randomly drawn from the current batch; To ensure uniform bandwidth control, the overall optimization objective is defined as:

[0036] in, To jointly optimize the total loss; This is the weighting coefficient for hyperspherical homogeneity regularization, used to adjust the contribution ratio of the homogeneity constraint term to the total loss.

[0037] This step constrains modal alignment at both the batch-wide and instance-pairing levels through cross-modal center alignment loss, further narrowing the modal gap and enhancing the representational consistency of positive sample pairs. Hyperspherical uniformity regularization loss constrains the embedding vectors to be uniformly distributed on a unit hypersphere, avoiding a decrease in retrieval discriminability caused by representation clustering. The weighted joint optimization objective of multiple losses simultaneously considers contrastive discrimination, modal alignment, and spatial uniformity, synergistically improving the model's retrieval accuracy and generalization ability, and assisting the core contrastive loss in achieving superior cross-modal alignment performance.

[0038] Furthermore, the efficient fine-tuning strategy for updating only the parameters of the text decoding layer in step four is as follows: Let the total parameter set of the model be divided into... That is, text decoding layer parameters, That is, the visual encoder parameters and That is, the parameters of the cross-modal projection layer, and during training, only the parameters of the cross-modal projection layer are adjusted. Perform gradient updates, for and The parameter freeze operation is performed, and the parameter update rules are described as follows:

[0039] in, Indicates the first The parameter status of the step; Base learning rate; and These are the first-order and second-order momentum estimates for the adaptive optimizer; This represents element-wise multiplication; The gradient of the total loss with respect to the text decoding layer parameters; when the early stopping condition is met. or continuous Step gradient norm When the time is reached, training is terminated and the fine-tuned retrieval model is output; where, The modal gap convergence threshold, This is the gradient stabilization threshold.

[0040] This step freezes the parameters of the visual encoder and projection layer, fine-tuning only the text decoding layer. This significantly reduces the size of trainable parameters, lowers training computational and memory requirements, and enables efficient parameter fine-tuning. Dual early stopping criteria determine training convergence from two dimensions: modal alignment effectiveness and parameter update stability. Modal gap convergence indicates that cross-modal alignment has achieved the expected effect, and gradient stability indicates that parameters are no longer significantly optimized. Training can be terminated when either condition is met, avoiding redundant iterations, improving training efficiency and controllability, and providing quantifiable convergence criteria for industrial deployment.

[0041] The following example is provided in this embodiment: Application scenario: Fine-grained semantic retrieval engine for industrial security monitoring and intelligent video editing platforms.

[0042] Implementation steps: Hardware and basic environment configuration: A multi-GPU computing cluster is used, and the base model is an open-source multimodal large language model with preset parameter sizes. The visual encoder and projection network are frozen, and only the text decoding layer is enabled to participate in gradient updates. Mixed-precision floating-point operations and activation value recalculation techniques are used to reduce GPU memory usage.

[0043] Data stream construction and online synthesis: Input source text anchors are mixed from a basic natural language inference dataset and video description corpus. The system calls the dynamic hard-to-bear sample generation module in real time to dynamically generate batch triples according to a preset ratio. The asynchronous buffer pool is pre-filled with a capacity set to a preset multiple of the batch size to ensure that generation latency does not block the main training loop. Difficulty weights are calculated in real time at each step, and importance resampling is performed.

[0044] Training iteration and convergence control: Set the base learning rate and batch size, and perform multiple rounds of training. Calculate the modal gap in real time at each step and dynamically update the adaptive temperature coefficient. Configure weight decay parameters. Trigger an early stopping mechanism when the retrieval metric on the validation set does not significantly improve for a preset number of consecutive steps, or when the modal gap falls below a preset threshold, automatically saving a snapshot of the optimal weights.

[0045] Inference Deployment and System Integration: In a video retrieval or editing platform, the user inputs a complex command. The system maps the command and candidate videos to a shared space using single-word restriction prompt templates, calculates cosine similarity, and returns a preset number of results. Experimental results show that this method has a significant performance advantage over the baseline model on a standard complex semantic test set, and the inference latency meets the requirements of real-time interaction.

[0046] Engineering Implementation: The fine-tuned model is encapsulated into a standardized microservice interface and integrated with the vector indexing engine. It supports streaming video chunk retrieval and multimodal command parsing, and can be deployed in intelligent monitoring systems and digital media library management platforms, effectively reducing false alarm rates in complex semantic scenarios and improving the efficiency of manual review and content retrieval.

[0047] In summary, this invention achieves standardized cross-modal representation by constructing an explicit semantic compression embedding extraction module, generates multi-type semantically difficult-to-bear samples online based on dependency syntax rules and performs difficulty-aware resampling, constructs an adaptive contrastive loss by combining differentiable modal gap measurement and dynamic temperature adjustment, and then superimposes cross-modal alignment and uniformity regularization losses to form a joint optimization objective. Finally, it completes training using a parameter-efficient fine-tuning strategy and a dual-threshold early stopping mechanism. This scheme effectively solves the problems of insufficient adversarial resistance of difficult-to-bear samples, modal space shift, and high training cost in traditional video retrieval models, significantly improves retrieval accuracy and robustness under complex semantic queries, and greatly reduces training computational consumption, demonstrating good feasibility for industrial deployment.

[0048] The above description is merely a preferred embodiment of the present invention. The scope of protection of the present invention is not limited to the above embodiments. All technical solutions falling within the scope of the present invention's concept are within the scope of protection of the present invention. It should be noted that for those skilled in the art, any improvements and modifications made without departing from the principles of the present invention should also be considered within the scope of protection of the present invention.

Claims

1. A method for training a multimodal video retrieval model, characterized in that: Includes the following steps: Step 1: Construct an explicit semantic compression embedding extraction module. Using a pre-trained multimodal large language model as the shared representation backbone, the original semantic input of the text is directly retained. For the video, uniform keyframe sampling is performed first, and then the video is converted into a visual tag sequence by freezing the visual encoder and splicing the temporal position code. By truncating the autoregressive generation link through a single-word restriction prompt template, the model is forced to condense all multimodal context semantics into the hidden state of the first predicted token. After learningable linear projection and L2 normalization, the output is a standardized cross-modal embedding vector constrained on a unit hypersphere. Step 2: Based on the embedding vector output in Step 1, calculate the cosine similarity between the anchor sample and the candidate negative sample; generate multiple types of semantically difficult negative samples such as temporal reversal and logical negation online based on dependency syntax rules, construct difficulty-aware weights by combining similarity values, and perform resampling with replacement in batches according to the weights to select a set of highly adversarial training samples. Step 3: Calculate the modal centers of text and video within the batch based on the embedding results of Step 1, and measure the differentiable modal gap norm; map the modal gap to a dynamic contrast temperature using the Sigmoid function, and adaptively adjust it between preset upper and lower bounds. At the same time, combine the sample difficulty weights output in Step 2 to construct an adaptive contrast loss for modal gap, and update the learnable parameters of the model through backpropagation. Step four: Based on the contrast loss in step three, the cross-modal center alignment loss and the hyperspherical uniformity regularization loss are superimposed, and the three are weighted to form the overall optimization objective. An efficient fine-tuning strategy of updating only the parameters of the text decoding layer is adopted, and dual early stopping criteria of modal gap convergence threshold and gradient stability threshold are set. Training is terminated when either condition is met.

2. The multimodal video retrieval model training method according to claim 1, characterized in that: The specific method for constructing the standardized cross-modal embedding vector constrained on a unit hypersphere by the explicit semantic compression embedding extraction module in step one is as follows: A pre-trained multimodal large language model is used as the cross-modal shared representation backbone for the input text query. or video frame sequence Construct explicit single-word restriction prompt template The forced autoregressive decoder condenses the multimodal context into the hidden state of the first predicted token before the generation action is triggered. The extraction process is defined as follows: in, Indicates the first step after forward reasoning The first layer output sequence The hidden state vector at each location; This represents the total number of layers in the model. Indicates the index of the first marked position; Input modal data; A function to generate templates for single-character restriction prompts; Forward propagation operator for multimodal large language models; For learnable linear projection matrices, Embed dimensions for the target. The hidden layer dimension of the model; For normalized cross-modal embedding vectors; express Norm; It is the numerical stability constant; For video input, the system pre-extracts F frames using a uniform sampling strategy, converts them into a labeled sequence using a frozen visual encoder and projection mapping network, and then splices time-position codes and cue templates together.

3. The multimodal video retrieval model training method according to claim 2, characterized in that: The specific method for selecting the highly adversarial training sample set in step two is as follows: Deploy an asynchronous cached semantic perturbation generator during training iterations. The generator Employing a dependency syntax rule template library, a lightweight context replacer, and an asynchronous sampling buffer architecture, the current batch of anchor text is processed. Real-time analysis of target fine-grained types Perform local semantic substitution to generate adversarial examples: in, For the current batch Anchor text; For generated hard-to-bear samples; For directional semantic perturbation operators oriented to a specified fine-grained type; This indicates a local substitution operation that preserves syntactic dependencies. For context entity consistency constraint functions; This is a dependency syntax entity matching rate function used to calculate the overlap ratio between anchor points and negative samples in the subject-verb-object core nodes and argument structures. Overlap threshold; generator Asynchronous pre-filled buffer pools are used to ensure training throughput. Based on the embedding vector output from step one, calculate the semantic difficulty-aware weight. : in, The cosine similarity between the anchor point and the negative sample; This represents the vector dot product operation; β is the difficulty scaling hyperparameter. This is the current training batch size; For the first batch Anchor negative similarity of each sample; It is a smoothing constant; For the first The difficulty-perceived weights for each sample are determined during training based on... Constructing a multinomial distribution Within the current batch, sampling with replacement is performed to replace low-adversarial samples, ensuring that the optimization gradient continues to focus on the fine-grained discrimination boundary.

4. The multimodal video retrieval model training method according to claim 3, characterized in that: In step three, the modal gap adaptive contrast loss is constructed, and the learnable parameters of the model are updated through backpropagation in the following specific way: Based on the standard contrast loss, a real-time modal gap measurement and temperature adaptive adjustment mechanism is introduced. Let the batch centers of the current batch of text and video embeddings be: in, This represents the batch center vector of the text modality; The video modality batch center vector; and The modal gap norm is calculated using text and video embedding extraction functions, respectively. in, To measure the gap between differentiable modes, a smooth adaptive temperature coefficient is constructed: in, The adaptive contrast temperature for the current training step; and Let's distinguish between the lower and upper limits of the temperature range; This is the gap sensitivity coefficient; Using the Sigmoid activation function, the contrastive loss is modified as follows: in, Adaptive contrast loss for modal gaps; The similarity between the anchor point and the positive sample; For positive sample index; For the first The set of hard-to-bear sample indexes corresponding to each anchor point; For anchors and indexes Similarity between corresponding samples.

5. The multimodal video retrieval model training method according to claim 4, characterized in that: In step four, the cross-modal center alignment loss and the hyperspherical uniformity regularization loss are superimposed, and the weighted average of these three losses constitutes the overall optimization objective. The specific method for introducing a center alignment term and a hyperspherical uniformity regularization term is as follows: in, For cross-modal center alignment loss; This refers to the batch center alignment weight coefficient. For instance-level pairing alignment weight coefficients; For text Benchmark video for semantic matching; For hyperspherical homogeneity regularization loss; The number of pairs of unlabeled samples randomly sampled within a batch; These are two embedded samples that are independently and randomly drawn from the current batch; To ensure uniform bandwidth control, the overall optimization objective is defined as: in, To jointly optimize the total loss; This is the weighting coefficient for hyperspherical homogeneity regularization, used to adjust the contribution ratio of the homogeneity constraint term to the total loss.

6. The multimodal video retrieval model training method according to claim 5, characterized in that: The efficient fine-tuning strategy for updating only the parameters of the text decoding layer in step four is as follows: Assume the total parameter set of the model is divided into... That is, text decoding layer parameters, That is, the visual encoder parameters and That is, the parameters of the cross-modal projection layer, and during training, only the parameters of the cross-modal projection layer are adjusted. Perform gradient updates, for and The parameter freeze operation is performed, and the parameter update rules are described as follows: in, Indicates the first The parameter status of the step; Base learning rate; and These are the first-order and second-order momentum estimates for the adaptive optimizer; This represents element-wise multiplication; The gradient of the total loss with respect to the text decoding layer parameters; when the early stopping condition is met. or continuous Step gradient norm When the time is reached, training is terminated and the fine-tuned retrieval model is output; where, The modal gap convergence threshold, This is the gradient stabilization threshold.