A false video source tracking method and system for hash data lookup and a medium

By constructing triplet samples and training with a hash triple loss function, a temporary hash center is generated and iteratively optimized, which solves the problems of insufficient interpretability and robustness in fake video detection and achieves efficient and stable source tracing in a highly similar video library.

CN122113065APending Publication Date: 2026-05-29ZHONGKE TIANWANG (GUANGDONG) TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ZHONGKE TIANWANG (GUANGDONG) TECH CO LTD
Filing Date
2026-01-14
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

Existing fake video detection and tracing technologies suffer from a lack of interpretable evidence in probabilistic judgments, insufficient robustness to common post-processing, and traditional hash retrieval struggles to efficiently differentiate subtle differences and reliably locate the unique source video in highly similar real video libraries.

Method used

By constructing triplet samples, a hash feature extraction network and a hash triple loss function are used for dynamic training to generate video hash codes. A temporary hash center is generated through a voting mechanism, and the distribution of the hash center is iteratively optimized. The hash data is searched by combining Hamming distance to locate the target hash center and output the source tracking result.

Benefits of technology

It significantly improves the interpretability and reliability of detection results, can stably locate unique source videos in highly similar video libraries, has good generalization ability and robustness, and is applicable to various types of fake videos.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122113065A_ABST
    Figure CN122113065A_ABST
Patent Text Reader

Abstract

The application discloses a false video source tracking method and system based on hash data search and a medium, and relates to the technical field of data processing. The method comprises the following steps: uniformly preprocessing a video dataset to be tracked, and constructing a video sample set with consistent structures; constructing a triple sample set comprising original video samples, corresponding fake video samples and different source comparison video samples based on the video sample set; inputting the triple sample set into a hash feature extraction network to generate video hash codes, and dynamically training a plurality of hash centers based on a hash triple loss function; generating a temporary hash center through a voting mechanism and iteratively optimizing the distribution distance between the hash centers during the training process; extracting a video hash code of a video to be detected, performing hash data search in the hash centers, and determining a target hash center; outputting a source tracking result of the video to be detected based on a real video associated with the target hash center, and realizing stable positioning of a unique source video.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and in particular to a method, system, and medium for tracking the source of fake videos using hash data lookup. Background Technology

[0002] With the rapid development of digital media technology and online dissemination platforms, video has become an important carrier of information. However, the decreasing barriers to video editing and generation technologies have led to a proliferation of fake videos created through methods such as video restoration, content splicing, and object removal or replacement in the online environment, posing serious risks to areas such as political opinion guidance, judicial evidence collection, and social governance. Therefore, how to accurately and reliably identify fake videos and trace their true sources has become a pressing technical problem that needs to be solved in the field of digital content security.

[0003] Existing fake video detection methods primarily rely on deep learning models to analyze video content and output corresponding forgery probability values ​​or classification results. These methods are typically trained based on features such as texture anomalies, temporal inconsistencies, or forgery traces, and can achieve certain results in experimental environments. However, in practical applications, these methods generally suffer from insufficient interpretability, and the detection results struggle to provide intuitive and verifiable evidence chains. Furthermore, their robustness to common processing operations such as video compression, blurring, and resolution changes is poor, leading to significant performance degradation under cross-scene or independent testing conditions, thus limiting their engineering deployment capabilities.

[0004] Compared to probabilistic discriminative detection methods, fake video source tracing technology provides a more credible basis for detection results by retrieving the original source of fake videos from a real video database. Existing source tracing solutions often rely on similarity search techniques such as hash retrieval to map videos into binary hash codes for efficient comparison. However, traditional hash retrieval methods are typically designed for cross-category retrieval tasks with significant semantic differences, and the training of their hash centers depends on obvious differences between categories. In fake video source tracing scenarios, many real videos are highly similar in content, with only minor spatiotemporal differences, making it difficult for the initial hash codes to effectively distinguish between different source videos, resulting in low hash center training efficiency and insufficient discriminative power.

[0005] Furthermore, non-smooth optimization problems in hash retrieval (such as the non-differentiable Hamming distance) increase the difficulty of model training; traditional triplet learning methods focus on local sample relationships, making it difficult to characterize the global data distribution, which can easily lead to insufficient hash center spacing, thus affecting retrieval accuracy. At the same time, some existing methods rely excessively on specific forgery trace features, have limited generalization ability, and are difficult to adapt to diverse forgery types such as object removal, object addition, and object swapping.

[0006] In summary, the existing technology has at least the following technical problems: Existing fake video detection and tracing technologies suffer from a combination of technical problems, including a lack of interpretable evidence for probabilistic judgments, insufficient robustness to common post-processing, and the difficulty of efficiently differentiating subtle differences and stably locating unique source videos in highly similar real video libraries using traditional hash retrieval. Summary of the Invention

[0007] The purpose of this invention is to provide a method, system, and medium for tracing the source of fake videos using hash data lookup, in order to solve the comprehensive technical problems of existing fake video detection and tracing technologies, such as the lack of interpretable evidence for probability determination, insufficient robustness to common post-processing, and the difficulty of traditional hash retrieval in efficiently distinguishing subtle differences and stably locating unique source videos in highly similar real video libraries.

[0008] The preferred technical solutions among the many technical solutions provided by this invention can produce a variety of technical effects, which are described in detail below.

[0009] To address the aforementioned technical problems, the present invention provides the following technical solution: This invention provides a method for tracking the source of fake videos by hash data lookup, including the following steps: S1, preprocessing: obtaining the video dataset to be tracked, and performing unified preprocessing on the video dataset to obtain a set of video samples with consistent structure; S2. Constructing triplet samples: Constructing triplet samples for hash training based on the video sample set, wherein each triplet sample includes at least the original video sample corresponding to the same real video, a fake video sample, and a comparison video sample from a different source than the real video. S3. Dynamic training: Input the triplet samples into the hash feature extraction network to generate the corresponding video hash code, and perform dynamic training on multiple hash centers based on the hash triple loss function. S4. Iterative optimization: During the training of the hash center, based on the statistical results of the video hash codes in the triplet samples, a temporary hash center is generated through a preset voting mechanism, and the distribution spacing between each hash center is iteratively optimized. S5. Hash data lookup: For the input video to be detected, extract the corresponding video hash code, and perform a hash data lookup in the hash center to determine the target hash center with the minimum similarity metric value to the video to be detected. The similarity metric value includes Hamming distance. S6. Output source tracing results: Based on the real video associated with the target hash center, output the source tracing results of the video to be detected to assist in determining whether the video to be detected is a fake video and its corresponding real source video.

[0010] In one approach, the unified preprocessing in S1 includes at least one or more of the following: frame rate normalization, resolution unification, color space consistency, and keyframe extraction of the video.

[0011] In one approach, in the triplet samples constructed in S2, the original video sample and the fake video sample originate from the same real video, while the comparison video sample originates from different real videos or different shooting scenarios.

[0012] In one approach, at least a portion of the triplet samples are derived from videos with highly similar content but corresponding to different acquisition times, shooting devices, or original data sources, in order to enhance the ability to distinguish subtle differences.

[0013] In one embodiment, the hash feature extraction network includes a spatial feature extraction module for extracting spatial features, a temporal feature extraction module for extracting temporal features, and a hash encoding module for generating binary hash codes.

[0014] In one approach, the hash triple loss function is used to simultaneously constrain: the intra-class distance between video hash codes corresponding to the same real video is less than a preset threshold, and the inter-class distance between video hash codes corresponding to different real videos is greater than a preset threshold.

[0015] In one approach, the voting mechanism in S4 includes: performing bitwise statistical analysis on the symbol distribution of multiple video hash codes within the same triplet sample, and generating the temporary hash center based on the statistical results.

[0016] In one approach, the optimization process of the hash center avoids direct non-differentiable optimization of the Hamming distance by substituting the vector distances in the continuous feature space.

[0017] In one approach, the hash data lookup performed in S5 includes: calculating the Hamming distance between the video hash code of the video to be detected and each of the hash centers, and selecting the hash center with the smallest distance as the matching result.

[0018] In one approach, S6 further includes visually comparing the video to be detected with the original source video to assist in manual confirmation of the tracing results.

[0019] A fake video source tracking system based on hash data lookup is also provided, which implements a fake video source tracking method, including: a data acquisition and preprocessing module for acquiring video data and performing unified preprocessing; a triplet construction module for constructing hash training triplets based on real and fake videos; a hash feature extraction and center training module for generating video hash codes and dynamically training hash centers based on a hash triple loss function; and a hash retrieval and source tracking module for performing hash data lookup on the video to be detected and determining the corresponding real source video.

[0020] One approach also includes a visualization comparison module to display the comparison results between the video to be detected and the original source video.

[0021] A medium for hash data lookup is also provided, including a computer-readable storage medium on which a computer program is stored, the computer program being executed by a processor to implement a method for tracing the source of fake videos.

[0022] The beneficial effects of this invention are as follows: (1) Significantly improve the interpretability and reliability of test results through source tracing. This technical solution does not merely output false probability or classification results, but rather uses hash data to locate the most similar real source video in the real video library to the video to be detected, and outputs clear source tracking results. This provides verifiable original video evidence for the determination of false videos, effectively solving the problem that existing probability determination methods lack intuitive explanation and evidence support. It is especially suitable for application scenarios with high requirements for the credibility of results, such as judicial evidence collection and public opinion verification.

[0023] (2) By constructing triplet samples and training with the hash triple loss function, the subtle differences between highly similar videos can be effectively differentiated. This technical solution constructs a training mechanism that includes triplet samples containing original video samples, corresponding fake video samples, and comparison video samples from different sources. It also combines a hash triple loss function for dynamic training, enabling the same real video and its fake version to form compact clusters in the hash space. At the same time, it increases the hash center distance between different real videos, thereby solving the problem that traditional hash retrieval is unable to distinguish videos from different sources in a highly similar real video library.

[0024] (3) Improve the stability and discriminative power of hash center training by generating temporary hash centers through voting and iterative optimization. In the training process of the hash center, this technical solution introduces a voting mechanism based on the statistical results of video hash codes within triplet samples to generate temporary hash centers. The distribution of hash centers is adjusted through iterative optimization, so that the hash centers can more stably reflect the feature distribution of different real videos, effectively avoiding the problems of low training efficiency and unstable convergence of traditional hash centers.

[0025] (4) Achieve efficient and robust video source localization through hash data lookup mechanism. This technical solution adopts a hash data lookup method, which quickly locates the target hash center in the hash center based on the similarity metric value. It has the characteristics of high computational efficiency and low storage overhead. At the same time, the hash representation based on content features has strong robustness to common post-processing operations such as video compression, blurring, and re-encoding, and can maintain stable source tracking capability under various video perturbation conditions.

[0026] (5) Applicable to various types of fake videos and has good generalization ability. Since this technical solution uses hash modeling based on the overall spatiotemporal features of the video and does not rely on local forgery traces generated by specific forgery algorithms, it can be applied to various types of fake videos such as face swapping, video splicing, object removal or replacement, effectively improving the applicability and reliability of existing fake video detection and tracing technologies in complex real-world scenarios. Attached Figure Description

[0027] To more clearly illustrate the technical solution of the present invention, the drawings used in the embodiments 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.

[0028] Figure 1 This is a schematic diagram of the process steps of the method for tracking the source of fake videos according to the present invention. Detailed Implementation

[0029] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings.

[0030] A specific implementation provides a method, system, and medium for tracking the source of fake videos using hash data lookup. The method includes: uniformly preprocessing the video dataset to be tracked to construct a video sample set with a consistent structure; constructing triplet samples based on the video sample set, containing original video samples, corresponding fake video samples, and comparison video samples from different sources; inputting the triplet samples into a hash feature extraction network to generate video hash codes, and dynamically training multiple hash centers based on a hash triple loss function; generating temporary hash centers through a voting mechanism during training and iteratively optimizing the distribution spacing between each hash center; extracting the video hash code of the video to be detected, and then... The algorithm performs a hash data lookup within the target hash center to determine the target hash center with the minimum similarity metric. Based on the real videos associated with the target hash center, it outputs the source tracing results of the video to be detected. This improves the interpretability of fake video detection results through source tracing and can stably locate the unique source video in a highly similar real video library. It has high detection accuracy, robustness, and engineering application value. It effectively solves the comprehensive technical problems of existing fake video detection and source tracing technologies, such as the lack of interpretable evidence for probability determination, insufficient robustness to common post-processing, and the difficulty of traditional hash retrieval in efficiently distinguishing subtle differences and stably locating the unique source video in a highly similar real video library.

[0031] The first implementation of the fake video source tracking method is as follows: Figure 1 As shown, the process includes the following steps: S1, Preprocessing: Obtain the video dataset to be tracked and perform uniform preprocessing on the video dataset to obtain a set of video samples with consistent structure; S2. Constructing triplet samples: Construct triplet samples for hash training based on the video sample set, wherein each triplet sample includes at least the original video sample corresponding to the same real video, the fake video sample, and the comparison video sample that is different from the real video source. S3. Dynamic Training: Input the triplet samples into the hash feature extraction network to generate the corresponding video hash code, and dynamically train multiple hash centers based on the hash triple loss function. S4. Iterative optimization: During the training of the hash center, based on the statistical results of the video hash codes in the triplet samples, a temporary hash center is generated through a preset voting mechanism, and the distribution spacing between each hash center is iteratively optimized. S5. Hash Data Lookup: For the input video to be detected, extract the corresponding video hash code and perform a hash data lookup in the hash center to determine the target hash center with the minimum similarity metric value to the video to be detected. The similarity metric value includes Hamming distance. S6. Output source tracing results: Based on the real video associated with the target hash center, output the source tracing results of the video to be detected, which is used to help determine whether the video to be detected is a fake video and its corresponding real source video.

[0032] Specifically, addressing the comprehensive technical problems of existing fake video detection and tracing technologies, such as the lack of interpretable evidence in probability determination, insufficient robustness to common post-processing, and the difficulty of traditional hash retrieval in efficiently differentiating subtle differences and stably locating a unique source video in a highly similar real video library, this paper proposes a fake video source tracing method based on hash data lookup. This method offers several technical and practical advantages: it significantly improves the interpretability and reliability of detection results through source tracing; and it does not merely output fake probability or classification results, but rather locates the most similar real source video in the real video library through hash data lookup and outputs a clear source tracing result. This provides verifiable original video evidence for fake video determination, effectively solving the problem of existing probability determination methods lacking intuitive explanation and evidentiary support. It is particularly suitable for applications requiring high reliability, such as judicial evidence collection and public opinion verification.

[0033] By constructing triplet samples and training with a hash triple loss function, subtle differences between highly similar videos can be effectively differentiated. This technical solution constructs a training mechanism that includes triplet samples containing original video samples, corresponding forged video samples, and comparison video samples from different sources. Combined with dynamic training using a hash triple loss function, this enables the same real video and its forged version to form compact clusters in the hash space, while increasing the hash center distance between different real videos. This solves the problem that traditional hash retrieval is unable to distinguish videos from different sources in a highly similar real video library.

[0034] This technical solution improves the stability and discriminative power of hash center training by generating temporary hash centers through voting and iterative optimization. During the hash center training process, a voting mechanism based on the statistical results of video hash codes within triplet samples is introduced to generate temporary hash centers. The distribution of hash centers is adjusted through iterative optimization, so that the hash centers can more stably reflect the feature distribution of different real videos, effectively avoiding the problems of low training efficiency and unstable convergence of traditional hash centers.

[0035] This technical solution achieves efficient and robust video source localization through a hash data lookup mechanism. It adopts a hash data lookup method to quickly locate the target hash center based on similarity metrics within the hash center, which features high computational efficiency and low storage overhead. At the same time, the hash representation based on content features has strong robustness to common post-processing operations such as video compression, blurring, and re-encoding, and can maintain stable source tracking capabilities under various video perturbation conditions.

[0036] It is applicable to various types of fake videos and has good generalization ability. Since this technical solution is based on hash modeling of the overall spatiotemporal features of the video and does not rely on local forgery traces generated by specific forgery algorithms, it can be applied to various types of fake videos such as face swapping, video splicing, object removal or replacement, effectively improving the applicability and reliability of existing fake video detection and tracing technologies in complex real-world scenarios.

[0037] As one alternative implementation method: Regarding the above-mentioned S1 preprocessing steps, the unified preprocessing of S1 includes at least one or more of the following: frame rate normalization, resolution unification, color space consistency, and key frame extraction.

[0038] In application, by performing at least one or more of the following processes on the video during the preprocessing stage: frame rate standardization, resolution unification, color space consistency, and keyframe extraction, videos from different acquisition devices, encoding formats, or publishing platforms possess a unified data structure and statistical distribution characteristics before entering the subsequent hash feature extraction network. On the one hand, unified preprocessing can effectively reduce non-content-related differences introduced during the acquisition or post-processing stages, avoiding interference with hash feature learning due to inconsistent frame rates, resolution differences, or color space shifts. On the other hand, keyframe extraction reduces the participation of redundant frames, allowing subsequent hash feature extraction to focus more on the core semantics and spatiotemporal structural changes of the video. The preprocessing step works synergistically with the subsequent triplet construction and hash center training processes, providing a foundation for maintaining the comparability and stability of hash codes across different videos, thereby improving the overall accuracy and robustness of source tracing and solving the problem of unstable detection results caused by video format differences in existing technologies.

[0039] In other implementations, unified preprocessing may also include video denoising, brightness normalization, time cropping, or sliding window sampling to adapt to video data of different lengths or with different noise levels.

[0040] In the above-mentioned S2 step of constructing triplet samples, the original video sample and the fake video sample in the constructed triplet samples come from the same real video, while the comparison video samples come from different real videos or different shooting scenes.

[0041] In application, by using both the original video sample corresponding to the same real video and its forged video sample as positive sample pairs, and introducing videos from different sources or shooting scenes as comparison samples, the hash feature extraction network can be explicitly guided to focus on the "intrinsic consistency between videos from the same source" and the "key differences between videos from different sources" during the training phase. The triple sample construction method and the hash triple loss function work together to continuously compress the intra-class distance between the same real video and its forged version in the hash space during the training process, while expanding the inter-class distance between different real videos. This lays the foundation for subsequent unique source localization through hash data search, effectively solving the problem that traditional hash retrieval is only suitable for coarse-grained similarity search and is difficult to use for precise source tracing.

[0042] In other embodiments, the comparison video samples can also be selected from videos of the same event taken at different time periods to further enhance the model's ability to distinguish differences across time and scenes.

[0043] Regarding the specific sample limitations of the aforementioned triplet samples, at least a portion of the triplet samples are from videos with highly similar content but corresponding to different acquisition times, shooting devices, or original data sources, in order to enhance the ability to distinguish subtle differences.

[0044] In application, by introducing videos with highly similar content but different collection times, shooting devices, or original data sources into the triplet samples, the hash feature extraction network is forced to learn more granular spatiotemporal difference features during training, rather than relying solely on significant semantic changes for differentiation. In synergy with the dynamic training hash center and voting optimization mechanism, the hash center can stably widen the distance between extremely similar videos in the high-dimensional hash space. Thus, even when there are a large number of similar materials in the real video library, it can still accurately locate the unique source video, effectively solving the problem of insufficient source tracing accuracy in high-similarity video scenarios of existing technologies.

[0045] In other embodiments, highly similar videos may also include video samples from the same shooting location but with different shooting angles, focal lengths, or lighting conditions.

[0046] In steps S1 and S2, the video dataset is defined as follows: ; For each Partition into a class and create a separate class for each data type. Training a hash center During training, triplet samples are formed. ,in It's a real video. These are two randomly selected fake videos. To train independent hash centers for forgery, each triplet sample unit always contains the original real video. It is recommended that the triplet sample unit size be [size missing]. This ensures that the data is evenly and reasonably distributed across different categories; and data preprocessing is only applied during the training phase.

[0047] Regarding the specific application modules of the hash feature extraction network mentioned above, the hash feature extraction network includes a spatial feature extraction module for extracting spatial features, a temporal feature extraction module for extracting temporal features, and a hash encoding module for generating binary hash codes.

[0048] In application, the hash feature extraction network is divided into a spatial feature extraction module, a temporal feature extraction module, and a hash encoding module. This allows for the separate modeling of static spatial information and dynamic temporal changes in the video, which are then fused in subsequent stages. On one hand, the spatial feature extraction module captures the structural features of a single frame or local region; on the other hand, the temporal feature extraction module models the temporal relationships and dynamic changes between frames. The combined effect of these two modules is mapped into a stable binary hash code by the hash encoding module. This modular design, in conjunction with the triplet training mechanism and hash center optimization process, ensures that the generated hash code possesses both discriminative power to distinguish videos from different sources and robustness against post-processing operations such as video compression and blurring, thereby improving the reliability of source tracking in complex real-world environments.

[0049] In other embodiments, the feature extraction module may also introduce multi-scale feature fusion or attention mechanisms to enhance the ability to perceive local detail changes.

[0050] After the spatiotemporal features are extracted, a hash encoding module is set up to map the fused global features to a hash value of length 1. Continuous vectors ( (where the hash value is the number of bits). The activation function then limits the output to... Interval, and according to the formula: ; Convert it into the final binary hash code.

[0051] Regarding the specific training constraints of the aforementioned triple hash loss function, the triple hash loss function is used to simultaneously constrain: the intra-class distance between video hash codes corresponding to the same real video is less than a preset threshold, and the inter-class distance between video hash codes corresponding to different real videos is greater than a preset threshold.

[0052] In application, by simultaneously constraining intra-class and inter-class distances in the hash triple loss function, the training process not only focuses on the discriminative power between different videos but also ensures the compact clustering of the same real video and its forged versions in the hash space. This constraint mechanism, in conjunction with the triple sample construction strategy and the dynamic hash center training process, enables the hash center to gradually converge to stable feature positions representing different real video sources. This provides a reliable basis for subsequent hash data searches based on similarity metrics, effectively overcoming the problem that traditional triple learning only captures local relationships and fails to reflect the global distribution.

[0053] In other implementations, the preset threshold can be adaptively adjusted based on the size of the video library or the length of the hash code.

[0054] Among them, hash bits The hash center can be configured according to specific task requirements, typically using 64 bits, 128 bits, or 256 bits to balance feature representation capability and storage / computation efficiency. The number of hash centers corresponds to the number of video groups of different categories or forgery sources in the training dataset, with one hash center for each category or forgery source, ensuring compact intra-class samples and separation between inter-class samples. During training, temporary hash centers are continuously updated through a voting mechanism. Each center calculates the average value based on the hash code set of its category, and after normalization, participates in loss function optimization. This ensures that the hash centers obtained after training can stably reflect the feature distribution of videos from different sources, providing a reliable basis for tracing the source of forged videos.

[0055] ; ; Multiple hash centers are dynamically trained based on a triple hash loss function, where the triple video consists of the original video and two randomly correlated fake videos. The trained hash centers are then used to track the source of the fake videos.

[0056] In the main function of the algorithm, a double loop iterates through all sample hash codes and hash centers: when a sample label matches a hash center label, the algorithm accumulates the intra-class loss; when a sample label does not match a hash center label, the algorithm accumulates the inter-class loss. The final loss function is the sum of the normalized intra-class loss and the inter-class loss, mathematically expressed as: ; Where m is the number of videos in the same class (within the class), and n is the number of videos in different classes (between classes). .

[0057] In the S4 iterative optimization steps mentioned above, the voting mechanism includes: statistically analyzing the symbol distribution of multiple video hash codes within the same triplet sample bit by bit, and generating a temporary hash center based on the statistical results.

[0058] In application, by performing bit-by-bit statistical analysis on multiple video hash codes within the same triplet sample and generating a temporary hash center, the update of the hash center is not dependent on a single sample but is based on the statistical results of multiple related samples, thereby reducing the interference of noisy or outlier samples on the training process. This voting mechanism, in conjunction with the hash triple loss function, enables the hash center to gradually converge towards the optimal position during training, improving the stability and discriminative power of the hash center and effectively solving the problem of oscillation or unstable convergence that easily occurs during the training process of traditional hash centers.

[0059] In other embodiments, the voting process may also introduce weighting factors to weight the contributions of different samples.

[0060] Voting to generate a temporary hash center: During each training iteration, given a template of triples... The hash feature extraction network outputs the corresponding hash code; each triplet sample use A temporary hash center is generated by voting. ,in Represents a triplet The element in the i-th column. If If the mean of the hash is greater than 0, the output is 1; otherwise, it is 0. The voting method for the temporary hash center is as follows: ; Intra-class loss encourages hash codes of identical triples to move closer to this temporary hash center, while hash centers of different triples are pushed apart by inter-class loss. This process is achieved through the loss function. Implementation. Through repeated iterative training and optimization, the temporary hash center gradually approaches the optimal hash center, with its average Hamming distance approaching half the hash code length. The trained model and hash center files are saved for future use.

[0061] Regarding the specific calculation method of the optimization process of the aforementioned hash center, the optimization process of the hash center is carried out by substituting the vector distance in the continuous feature space to avoid directly optimizing the Hamming distance as it is not differentiable.

[0062] In application, by using vector distance in continuous feature space as an alternative calculation method in the optimization process of hash center, the non-differentiable optimization based directly on Hamming distance is avoided, so that the training process can be carried out stably under differentiable or approximately differentiable conditions. In synergy with hash feature extraction network and hash triple loss function, hash center can achieve efficient and stable training optimization while maintaining the advantages of binary hash representation, thereby improving the overall training efficiency and reducing the difficulty of model parameter tuning, and solving the problem of non-smooth optimization difficulty in convergence in existing hash retrieval methods.

[0063] In other implementations, alternative calculation methods may include approximate calculations based on cosine distance or weighted Euclidean distance.

[0064] Among them, non-differentiable optimization of similar videos: Since the hash codes between similar videos have high similarity, non-differentiable optimization is often used for the generation of hash codes based on deep learning. This is because non-smooth similarity measures such as Hamming distance can be solved by subdifferentiation.

[0065] For functions : Secondly, the differential is defined as follows:

[0066] in Indicates the inner product. express At point The second derivative at point . The non-smooth optimization problem can be denoted as: ,in It is a non-smooth function.

[0067] Subgradient methods can be used to solve non-smooth optimization problems, such as learning optimal hash centers. Specifically, the subgradient of the similarity metric relative to the hash code can be computed, and this subgradient can be used to update the hash code. The update rule for the subgradient method is as follows: ; in, This represents the hash code at iteration t. Represents a similarity measure. Indicates the learning rate, express The subgradient of the similarity measure at a given location.

[0068] In the implementation of hash triplet loss, the mean value is used instead of the non-smooth Hamming distance to calculate vector distance. Hamming distance measures the similarity between two hash codes of the same length by calculating the difference in bits. The smaller the difference, the higher the similarity. The implementation uses the mean absolute difference between two vectors to measure similarity, where a smaller value indicates a higher similarity to the hash center.

[0069] In the S5 hash data lookup step described above, the hash data lookup includes: calculating the Hamming distance between the video hash code of the video to be detected and each hash center, and selecting the hash center with the smallest distance as the matching result.

[0070] In application, the Hamming distance between the hash code of the video to be detected and each hash center is calculated, and the hash center with the smallest distance is selected as the matching result, transforming the source tracing process into an efficient hash data lookup problem. This lookup method works synergistically with the aforementioned hash center training and optimization mechanism, significantly reducing computational complexity and storage overhead while ensuring retrieval accuracy. It can quickly locate candidate source videos in a large-scale real video library, effectively solving the problems of slow response speed and high resource consumption of existing source tracing technologies in big data scenarios.

[0071] In other embodiments, similarity metrics can also be combined with multi-level filtering strategies to further improve retrieval efficiency.

[0072] The second embodiment of the method for tracing the source of fake videos differs from the first embodiment in that S6 further includes visually comparing the video to be detected with the real source video to assist in manual confirmation of the tracing results.

[0073] When applied, by introducing a visual comparison between the video to be detected and the actual source video based on the output source tracing results, human reviewers can intuitively observe the differences between the two in semantic content or spatiotemporal structure. This visual comparison step complements the automatic hash tracing results, improving the credibility and interpretability of the tracing results while reducing the risk of misjudgment. It is particularly suitable for application scenarios with high requirements for result reliability, such as judicial evidence collection and news verification, thus effectively compensating for the limitations of purely automated algorithms in complex real-world scenarios.

[0074] In other implementations, visual comparisons can be combined with annotation tools or difference highlighting to help manual identification of forged areas.

[0075] Based on the above embodiments of the fake video source tracking method, a fake video source tracking system using hash data lookup is provided to implement the fake video source tracking method. The system includes: a data acquisition and preprocessing module for acquiring video data and performing unified preprocessing; a triplet construction module for constructing hash training triples based on real and fake videos; a hash feature extraction and center training module for generating video hash codes and dynamically training hash centers based on a hash triple loss function; and a hash retrieval and source tracking module for performing hash data lookup on the video to be detected and determining the corresponding real source video.

[0076] In application, the fake video source tracing process is implemented with a modular system architecture, enabling the hash data lookup-based fake video source tracing method to run stably and scalably in engineering environments. The data acquisition and preprocessing module handles videos from different sources and formats uniformly, providing a consistent data foundation for subsequent feature extraction. The triplet construction module works in conjunction with the hash feature extraction and center training module to form structured training units within the system for real, fake, and comparison videos, and dynamically trains the hash center using a hash triple loss function. The hash retrieval and source tracing module, based on the trained hash center, performs efficient hash data lookups on the videos to be detected, thus outputting a clear video from the real source. This systematization of fake video source tracing integrates the previously fragmented algorithmic processes into a complete data processing chain, ensuring the stability and repeatability of source tracing results while significantly improving the system's processing efficiency under large-scale video database conditions. This effectively solves the problems of existing fake video detection and source tracing technologies being difficult to deploy in engineering and operate stably for long periods.

[0077] In other implementations, the fake video source tracking system can also adopt a distributed deployment approach, deploying the data acquisition and preprocessing module, feature extraction and training module, and retrieval module on different computing nodes to adapt to ultra-large-scale video data environments.

[0078] The data acquisition and preprocessing module performs unified preprocessing operations on the input videos, ensuring that videos from different acquisition devices, platforms, or encoding standards have consistent data structure and statistical characteristics after entering the system. This module works in conjunction with the triplet construction module to ensure the comparability of the constructed hash training samples at the data level, thereby avoiding interference from video format differences or non-content-related disturbances on hash feature learning. By introducing this module, the system can stably access multi-source video data in complex real-world environments and provide reliable input for subsequent hash feature extraction and central training, effectively solving the problem of inconsistent processing results caused by the diversity of video sources in existing systems.

[0079] In other embodiments, the data acquisition and preprocessing module may also integrate video quality assessment or anomaly detection functions to filter severely damaged or incomplete video data in advance.

[0080] Regarding the triplet construction module, by combining real videos, corresponding forged videos, and comparison videos from different sources at the system level, the hash feature extraction and center training modules can clearly distinguish between "same-source relationships" and "different-source relationships" during the training phase. The triplet construction module works in synergy with the hash feature extraction and center training modules to guide the system to simultaneously compress the feature distribution of the same real video and its forged version in the hash space, and to increase the feature spacing between different real videos. This provides a highly discriminative hash center foundation for subsequent hash retrieval and source tracing modules, effectively solving the problem of traditional hash retrieval systems struggling to locate a unique source in highly similar video libraries.

[0081] In other implementations, the triplet construction module can also dynamically adjust the selection strategy of the comparison videos in the triplet based on the effect of the training phase, so as to enhance the system's ability to learn from difficult-to-distinguish samples.

[0082] The hash feature extraction and center training module jointly models the spatial and temporal features of the video and maps the fused features to binary hash codes, enabling the video content to be represented in a compact and efficient form within the hash space. This module works in synergy with the triplet construction module and the hash retrieval and source tracking module. On one hand, it dynamically trains multiple hash centers using a triple hash loss function, ensuring a stable distribution of different real video sources within the hash space. On the other hand, it provides a highly discriminative and robust hash representation for subsequent retrieval stages. By introducing the hash feature extraction and center training module, the system significantly reduces storage and computational overhead while maintaining high tracking accuracy, effectively addressing the problems of high computational cost and insufficient real-time performance in existing deep learning detection methods.

[0083] In other embodiments, the hash feature extraction and center training module can also support hash code configurations of different lengths to allow for a flexible trade-off between accuracy and efficiency.

[0084] The hash retrieval and source tracing module calculates the similarity metric between the hash code of the video to be detected and each hash center, and selects the optimal matching result to quickly locate the video from the real source. Working in conjunction with the aforementioned hash center training results, the hash retrieval and source tracing module transforms the process of tracing the source of fake videos into an efficient hash data search problem. This ensures stable response speed and retrieval accuracy even in large-scale real video databases, effectively solving the problem of drastic performance degradation in existing source tracing technologies as the video volume increases.

[0085] In other implementations, the hash retrieval and source tracing module can also introduce multi-level retrieval or caching mechanisms to further improve the overall system throughput.

[0086] In addition, it includes a visualization comparison module, which displays the comparison results between the video to be detected and the video from the real source.

[0087] When applied, the system incorporates a visual comparison module, enabling it to visually demonstrate the comparison between the video under investigation and the original source video to human reviewers while outputting automated source tracing results. The visual comparison module works in conjunction with the hash retrieval and source tracing modules to enhance the interpretability and credibility of the tracing results, while providing intuitive evidence for human review. This is particularly suitable for applications with high reliability requirements, such as judicial evidence collection and news verification, thus compensating for the shortcomings of purely automated algorithms in complex real-world environments.

[0088] In other embodiments, the visualization comparison module may also support highlighting of difference areas or synchronous playback of keyframes.

[0089] Based on the above embodiments of the fake video source tracing method, a fake video source tracing medium for hash data lookup is provided, including a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it is used to implement the fake video source tracing method.

[0090] In application, by storing the fake video source tracing method as a computer program on a computer-readable storage medium, the method can be flexibly deployed and repeatedly executed on different hardware platforms or system environments. This computer-readable storage medium works synergistically with the aforementioned fake video source tracing system, enabling the fake video source tracing function to be provided as a complete system or integrated into existing video processing platforms as a software module or algorithm service. This enhances the versatility and engineering adaptability of the present invention, effectively solving the problems of algorithm transferability and reusability in existing technologies.

[0091] In other implementations, the computer-readable storage medium may be a local storage medium, a network storage medium, or a cloud storage medium to support different deployment modes.

[0092] 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.

Claims

1. A method for tracing the source of fake videos using hash data lookup, characterized in that, The process includes the following steps: S1, Preprocessing: Obtain the video dataset to be tracked, and perform uniform preprocessing on the video dataset to obtain a set of video samples with consistent structure; S2. Constructing triplet samples: Constructing triplet samples for hash training based on the video sample set, wherein each triplet sample includes at least the original video sample corresponding to the same real video, a fake video sample, and a comparison video sample from a different source than the real video. S3. Dynamic training: Input the triplet samples into the hash feature extraction network to generate the corresponding video hash code, and perform dynamic training on multiple hash centers based on the hash triple loss function. S4. Iterative optimization: During the training of the hash center, based on the statistical results of the video hash codes in the triplet samples, a temporary hash center is generated through a preset voting mechanism, and the distribution spacing between each hash center is iteratively optimized. S5. Hash data lookup: For the input video to be detected, extract the corresponding video hash code, and perform a hash data lookup in the hash center to determine the target hash center with the minimum similarity metric value to the video to be detected. The similarity metric value includes Hamming distance. S6. Output source tracing results: Based on the real video associated with the target hash center, output the source tracing results of the video to be detected to assist in determining whether the video to be detected is a fake video and its corresponding real source video.

2. The method for tracing the source of fake videos according to claim 1, characterized in that, The unified preprocessing in S1 includes at least one or more of the following: frame rate normalization, resolution unification, color space consistency, and keyframe extraction.

3. The method for tracing the source of fake videos according to claim 1, characterized in that, In the triplet samples constructed in S2, the original video sample and the fake video sample originate from the same real video, while the comparison video sample originates from different real videos or different shooting scenarios.

4. The method for tracing the source of fake videos according to claim 1, characterized in that, At least a portion of the triplet samples are from videos with highly similar content but different acquisition times, shooting devices, or original data sources, in order to enhance the ability to distinguish subtle differences.

5. The method for tracing the source of fake videos according to claim 1, characterized in that, The hash feature extraction network includes a spatial feature extraction module for extracting spatial features, a temporal feature extraction module for extracting temporal features, and a hash encoding module for generating binary hash codes.

6. The method for tracing the source of fake videos according to claim 1, characterized in that, The hash triple loss function is used to simultaneously constrain: the intra-class distance between video hash codes corresponding to the same real video is less than a preset threshold, and the inter-class distance between video hash codes corresponding to different real videos is greater than a preset threshold.

7. The method for tracing the source of fake videos according to claim 1, characterized in that, The voting mechanism in S4 includes: statistically analyzing the symbol distribution of multiple video hash codes within the same triplet sample bit by bit, and generating the temporary hash center based on the statistical results.

8. The method for tracing the source of fake videos according to claim 1, characterized in that, In the optimization process of the hash center, the vector distance in the continuous feature space is calculated by substitution to avoid directly optimizing the Hamming distance as it is not differentiable.

9. The method for tracing the source of fake videos according to claim 1, characterized in that, The hash data lookup performed in S5 includes: calculating the Hamming distance between the video hash code of the video to be detected and each hash center, and selecting the hash center with the smallest distance as the matching result.

10. The method for tracing the source of fake videos according to claim 1, characterized in that, S6 also includes visually comparing the video to be detected with the video from the real source to assist in manual confirmation of the source tracing results.

11. A fake video source tracking system based on hash data lookup, used to implement the fake video source tracking method according to claims 1 to 10. Its features are, Includes: a data acquisition and preprocessing module, used to acquire video data and perform unified preprocessing; And a triplet construction module, used to construct hash training triples based on real and fake videos; And a hash feature extraction and center training module, used to generate video hash codes and dynamically train hash centers based on the hash triple loss function; It also includes a hash retrieval and source tracing module, which performs hash data lookup on the video to be detected and determines the corresponding real source video.

12. The fake video source tracking system according to claim 11, characterized in that, It also includes a visualization comparison module, which displays the comparison results between the video to be detected and the video from the real source.

13. A falsified video source tracking medium for hash data lookup, comprising a computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the fake video source tracking method according to any one of claims 1 to 10.