Positioning analysis method, system, device and storage medium for time forgery
By building a weakly supervised temporal forgery localization model and using video-level tags to train the model, we solve the problem of identifying fake clips under video-level label conditions, achieve more accurate and precise positioning of fake clips, improve positioning performance, and save resource consumption.
Patent Information
- Application Number
- CN202410816209.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-24
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2044-06-24
AI Technical Summary
The existing technology lacks an effective temporal forgery positioning method in weakly supervised scenarios of video-level tags. Especially when only video-level tags can be collected, it is difficult to identify forged segments in videos, and frame-level tag collection resources consume a lot of resources. And it is difficult to expand the diversity of training data.
Construct a weakly supervised temporal forgery localization model, including a feature extractor, feature optimization module, attention module, feature fusion module and classifier. The model is trained through video-level labels, using feature optimization and attention weight sequences to generate forgery activation sequences, combined with video Level label calculation time forges the basic loss function for positioning, and performs model training and positioning.
It realizes the function of locating fake clips under video-level label conditions, saves frame-level label resource consumption, improves positioning performance, and can more accurately and precisely identify fake clips in videos, as a powerful supplement to fully supervised training.
Smart Images

Figure CN118379668B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of time forgery positioning, and in particular to a positioning analysis method, system, device and storage medium for time forgery. Background Art
[0002] To address the ongoing threat posed by face forgery technology on social media and the widespread dissemination of artificial intelligence generated content (AIGC), traditional binary forgery detection methods can only judge the authenticity of a video as a whole, while the recently emerging temporal forgery localization methods can provide a more refined perspective by locating the timestamps of forged segments.
[0003] Although some progress has been made in the research of temporal forgery localization with frame-level supervision, there is still a lack of relevant research in the weak supervision scenario with only video-level labels in academia and industry. Considering that in some cases, collecting frame-level labels consumes a lot of resources or is even infeasible, in order to be able to train data with only video-level labels, or use them as a supplement to fully supervised training to expand the diversity of training data, it is also necessary to study related solutions in the weak supervision scenario with video-level labels to identify forged clips in videos.
[0004] In view of this, the present invention is proposed. Summary of the invention
[0005] The purpose of the present invention is to provide a positioning analysis method, system, device and storage medium for time forgery, which can effectively realize the positioning analysis of weakly supervised time forgery, accurately and finely identify forged clips in the video, and at the same time is a powerful supplement to full supervised training.
[0006] The objective of the present invention is achieved through the following technical solutions:
[0007] A positioning analysis method for time forgery, comprising:
[0008] Construct a weakly supervised temporal forgery localization model, including: feature extractor, feature optimization module, attention module, feature fusion module, classifier and localization module;
[0009] The weakly supervised temporal forgery positioning model is trained using video data with video-level labels, including: inputting video data into the weakly supervised temporal forgery positioning model, extracting multi-category features through the feature extractor, optimizing the features of each category through the feature optimization module, extracting attention weight sequences from the optimized features through the attention module, and obtaining fused attention weight sequences through fusion operations, and generating forged activation sequences through the classifier after the optimized features are fused through the feature fusion module, and obtaining suppressed forgery activation sequences in combination with the fused attention weight sequences, and calculating the temporal forgery positioning basic loss function using the forged activation sequence, the suppressed forgery activation sequence, and the corresponding video-level labels by the positioning module; inputting the given features of the real video and the forged video into the feature optimization module, performing feature optimization through the feature optimization module, and optimizing the objective function to increase the similarity between the features of the real video and reduce the similarity between the features of the real video and the features of the forged video; constructing a training loss in combination with the temporal forgery positioning basic loss function and the optimization objective function, and training the weakly supervised temporal forgery positioning model;
[0010] The trained weakly supervised temporal forgery localization model is used to perform temporal forgery localization on the input video data to be detected.
[0011] A positioning analysis system for time forgery, comprising:
[0012] A model building unit, used to build a weakly supervised temporal forgery localization model, including: a feature extractor, a feature optimization module, an attention module, a feature fusion module, a classifier and a localization module;
[0013] A model training unit is used to train a weakly supervised temporal forgery positioning model using video data with video-level labels, including: inputting video data into the weakly supervised temporal forgery positioning model, extracting multi-category features through the feature extractor, optimizing the features of each category through the feature optimization module, extracting attention weight sequences from the optimized features through the attention module, and obtaining fused attention weight sequences through fusion operations, and generating forged activation sequences through a classifier after the optimized features are fused through the feature fusion module, and obtaining suppressed forgery activation sequences in combination with the fused attention weight sequences, and calculating the temporal forgery positioning basic loss function using the forged activation sequence, the suppressed forgery activation sequence, and the corresponding video-level labels by the positioning module; inputting the given features of the real video and the forged video into the feature optimization module, performing feature optimization through the feature optimization module, and optimizing the objective function to increase the similarity between the features of the real video and reduce the similarity between the features of the real video and the features of the forged video; constructing a training loss in combination with the temporal forgery positioning basic loss function and the optimization objective function, and training the weakly supervised temporal forgery positioning model;
[0014] The temporal forgery positioning unit is used to perform temporal forgery positioning on the input video data to be detected by using the trained weakly supervised temporal forgery positioning model.
[0015] A processing device, comprising: one or more processors; a memory for storing one or more programs;
[0016] When the one or more programs are executed by the one or more processors, the one or more processors implement the aforementioned method.
[0017] A readable storage medium stores a computer program, which implements the above method when the computer program is executed by a processor.
[0018] It can be seen from the technical solution provided by the present invention that the present invention provides a positioning and analysis solution for temporal forgery based on weakly supervised learning, which can be trained using collected video data with only video-level labels. After training, it has the function of locating forged fragments on the test set, which can save a lot of resources consumed by collecting frame-level labels. At the same time, the feature optimization module introduced in the model can improve the positioning performance. Therefore, the present invention not only effectively realizes the positioning of weakly supervised temporal forgery, but also ensures the positioning performance of temporal forgery, and more accurately and finely identifies forged fragments in videos. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0020] Figure 1 A flow chart of a method for locating and analyzing time forgery provided by an embodiment of the present invention;
[0021] Figure 2 A schematic diagram of the training and testing process of a weakly supervised temporal forgery positioning task provided by an embodiment of the present invention;
[0022] Figure 3 A schematic diagram of a weakly supervised temporal forgery positioning model provided by an embodiment of the present invention;
[0023] Figure 4 A structural thumbnail of the TSN feature extractor provided in an embodiment of the present invention;
[0024] Figure 5 A structural thumbnail of the I3D feature extractor provided in an embodiment of the present invention;
[0025] Figure 6 A structural thumbnail of the SlowFast feature extractor provided in an embodiment of the present invention;
[0026] Figure 7 A schematic diagram of a positioning analysis system for time forgery provided by an embodiment of the present invention;
[0027] Figure 8 A schematic diagram of a processing device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0028] The following is a clear and complete description of the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the protection scope of the present invention.
[0029] First, the terms that may be used in this article are explained as follows:
[0030] The terms "include", "comprises", "contains", "has" or other descriptions with similar semantics should be interpreted as non-exclusive inclusion. For example, including certain technical feature elements (such as raw materials, components, ingredients, carriers, dosage forms, materials, dimensions, parts, components, mechanisms, devices, steps, procedures, methods, reaction conditions, processing conditions, parameters, algorithms, signals, data, products or products, etc.) should be interpreted as including not only certain technical feature elements explicitly listed, but also other technical feature elements known in the art that are not explicitly listed.
[0031] The term "consisting of..." means excluding any technical feature elements not explicitly listed. If this term is used in a claim, it will make the claim closed, so that it does not contain technical feature elements other than the technical feature elements explicitly listed, except for the conventional impurities related to them. If this term only appears in a clause of a claim, it only limits the elements explicitly listed in the clause, and the elements recorded in other clauses are not excluded from the overall claim.
[0032] The following is a detailed description of the positioning analysis method, system, device and storage medium for time forgery provided by the present invention. The contents not described in detail in the embodiments of the present invention belong to the prior art known to professional and technical personnel in the field. If no specific conditions are specified in the embodiments of the present invention, they shall be carried out according to the conventional conditions in the field or the conditions recommended by the manufacturer.
[0033] Embodiment 1
[0034] The embodiment of the present invention provides a positioning analysis method for time forgery, which is a positioning analysis method for time forgery based on weakly supervised learning. It proposes and clarifies that the positioning analysis task of weakly supervised time forgery is to train a model on video data with only video-level labels (true or false) so that it has the positioning function of forged clips on a test set and can ensure the positioning performance; Figure 1 As shown, the method mainly includes the following steps:
[0035] Step 1: Build a weakly supervised temporal forgery localization model.
[0036] In the embodiment of the present invention, the constructed weakly supervised temporal forgery localization model mainly includes: a feature extractor, a feature optimization module, an attention module, a feature fusion module, a classifier and a localization module.
[0037] Step 2: Use video data with video-level labels to train a weakly supervised temporal forgery localization model.
[0038] In an embodiment of the present invention, the model training scheme is as follows: input video data to a weakly supervised temporal forgery positioning model, extract multi-category features through the feature extractor, optimize each category of features respectively through a feature optimization module, extract attention weight sequences from each type of optimized features through an attention module, and obtain fused attention weight sequences through a fusion operation, and generate forged activation sequences through a classifier after fusion of each type of optimized features through a feature fusion module, and obtain a suppressed forged activation sequence in combination with the fused attention weight sequence, and calculate a temporal forgery positioning basic loss function using the forged activation sequence, the suppressed forged activation sequence, and the corresponding video-level labels by a positioning module; input the given features of the real video and the forged video into the feature optimization module, perform feature optimization through the feature optimization module, and optimize the objective function to increase the similarity between the features of the real video and reduce the similarity between the features of the real video and the features of the forged video; construct a training loss in combination with the temporal forgery positioning basic loss function and the optimization objective function to train the weakly supervised temporal forgery positioning model.
[0039] Step 3: Use the trained weakly supervised temporal forgery localization model to perform temporal forgery localization on the input video data to be detected.
[0040] In the embodiment of the present invention, the trained weakly supervised temporal forgery localization model can be deployed on a computer or server to automatically locate the input video (e.g., forged segments of face videos or AIGC videos), and can be applied to major social platforms such as short video websites. In particular, for data with only video-level labels, such as "This video may contain AI forgeries, please pay attention to distinguish", but it is unknown which part of the video data is forged, the present invention can effectively use them for weakly supervised training of the model.
[0041] In order to more clearly demonstrate the technical solution and technical effects provided by the present invention, the method provided by the embodiment of the present invention is described in detail with reference to specific embodiments below.
[0042] 1. Definition of program tasks.
[0043] like Figure 2 As shown, given a training video and its corresponding category label For training, 0 represents real video and 1 represents forged video. The task of the present invention (weakly supervised temporal forgery localization task) aims to identify forged clips on the test set. ,in and It is The start and end timestamps of the fake segments, is the predicted confidence score and N is the total number of forged segments in the video.
[0044] 2. Model framework and its working plan.
[0045] In the embodiment of the present invention, a weakly supervised temporal forgery localization model including a feature extractor, a feature optimization module, an attention module, a feature fusion module and a classifier is constructed. Figure 3 shown.
[0046] 1. Feature extractor.
[0047] The feature extractor includes: a visual feature extractor and an optical flow feature extractor. During training, an uncut video is divided into multiple non-overlapping video segments and then input into the model; each video segment is respectively extracted visual features and optical flow features by the visual feature extractor and the optical flow feature extractor, which are recorded as , where each item represents the characteristics of a category, is the symbol of a real number set, T is the total number of video clips, D is the feature dimension, , Refers to the type of visual feature (for example, RGB features, RGB refers to the three channels of red, green and blue), Refers to the optical flow feature type.
[0048] 2. Feature optimization module.
[0049] Considering that the real and fake segments may have fuzzy boundaries and be difficult to distinguish, the present invention considers the relative distance between the real and fake features. Therefore, a feature optimization module is introduced to optimize the output features of the feature extractor to improve the positioning performance. For the sake of simplicity, the following uniformly removes the superscript indicating the feature type and directly expresses it as .
[0050] In order to ensure the feature optimization effect, the corresponding optimization objectives are designed below.
[0051] The characteristics of the real video are recorded as , where each item represents the feature of a real video clip, T is the total number of video clips; the feature of the forged video is recorded as , each of which represents a feature of a forged video clip; the features described here include the various features introduced in the previous article, such as visual features and optical flow features, that is, various features need to be calculated by the method described below.
[0052] The attention module extracts corresponding attention weight sequences from the features of the real video and the fake video respectively (which will be introduced later), and extracts the top K (abbreviated as top-K) features with the highest attention scores from their respective attention weight sequences.
[0053] Calculate the similarity between the features of real videos , and calculate the similarity between the top K features with the highest attention scores in the features of the real video and the features of the fake video , expressed as:
[0054] ;
[0055] ;
[0056] ;
[0057] in, and Represents the features of the i-th and j-th real video clips; is the average of the top K features with the highest attention scores in the real video features, The index of the top K features with the highest attention scores among the features of the real video is Features; is the average of the top K features with the highest attention scores among the features of the forged video, The index of the top K features with the highest attention scores among the features of the forged video is features; L(.) represents a similarity calculation function; illustratively, the cosine similarity function cos can be selected.
[0058] Similarity Based on similarity Reduced, expressed as: At the same time, the similarity between the features of real videos gradually increases. Based on this, the optimization objective function is defined express:
[0059] ;
[0060] Among them, the max(.) function is used to return the maximum value; margin is a set value, which ensures that the similarity between true and false features << the similarity between real features, that is, it ensures that the distance between true and false classes >> the distance within the real class, thereby allowing the model to better distinguish between real features and fake features. The specific value of margin can be determined through experiments and may even be 0 (in the extreme case).
[0061] Those skilled in the art can understand that the symbol << is a much less than symbol, and the symbol >> is a much greater than symbol. The definitions of the two can refer to conventional technologies and are not elaborated in the present invention.
[0062] The optimization process of the above feature optimization module can be called relative distance learning (Relative Distance Learning).
[0063] 3. Attention module.
[0064] The attention module is mainly responsible for calculating the attention of the input features and outputting the attention weight sequence.
[0065] remember is the optimized feature, that is, the superscript * is represents the optimized visual features, and the superscript * When represents the optimized optical flow feature, after inputting it into the attention module, the attention weight sequence is obtained, which is expressed as:
[0066] ;
[0067] in, represents the attention module, inputting the optimized visual features of the corresponding type, The optimized features The corresponding attention weight sequence; specifically: the superscript * is r hour, Represents the visual features after processing optimization The attention module, Represents the optimized visual features The corresponding attention weight sequence, superscript * is f hour, Represents the optical flow features after processing and optimization The attention module, Represents the optimized optical flow feature The corresponding attention weight sequence. Exemplarily, the attention module can be composed of a convolutional layer and a sigmoid (S-shaped growth curve) activation function.
[0068] The two attention weight sequences are generally fused in the feature fusion module of the backbone network, expressed as:
[0069] ;
[0070] in, In order to fuse the attention weight sequence, the feature fusion module of the backbone network receives both the temporal features and the attention sequence as input. A variety of different baselines (mechanisms) can be used to fuse the two within the backbone network to further enhance the features.
[0071] 4. Feature fusion module and classifier.
[0072] In the embodiment of the present invention, the feature fusion module and the classifier together constitute a backbone network. The specific structure of the backbone network is not limited. The user can select an existing network structure according to actual conditions, and the present invention will not elaborate on it.
[0073] The optimized features are fused by the feature fusion module and then generated into a fake activation sequence (called class activation sequence in the temporal action localization task) through the classifier. The above process is expressed as:
[0074] ;
[0075] Where p is the forged activation sequence, each element of which is the forged score of a temporal position, is the operator that connects along the channel dimension, is the feature fusion module, is a classifier, which is a classifier containing 1 fake category and 1 real category; For the optimized visual features, is the optimized optical flow feature.
[0076] Furthermore, the fused attention weight sequence can be combined to obtain the suppression of forged activation sequence , expressed as: ; Among them, the symbol Represents element-wise multiplication.
[0077] 5. Positioning module.
[0078] During the training process, the positioning module can calculate the temporal forgery positioning basic loss function based on the output of the classifier: Specifically, it can be combined with forged activation sequence and suppression of forged activation sequence Calculate the temporal forgery localization basic loss function with the category label y (video-level label) The temporal forgery positioning basic loss function described here belongs to the conventional and common loss function in the field of weakly supervised temporal action positioning. Taking the multi-instance loss (MIL loss) as an example, the temporal forgery positioning basic loss function Mainly includes the use of suppression of forged activation sequences The multi-instance loss calculated by the forged activation sequence p and the category label y, as well as the multi-instance loss calculated by the forged activation sequence p and the category label y, can achieve the purpose of supervised training using only video-level labels.
[0079] Based on the above introduction, the present invention can use the optimization objective function of the aforementioned feature optimization module and the time forgery positioning basic loss function Construct training loss to train the weakly supervised temporal forgery positioning model. In order to further improve the positioning performance, a reconstruction module is also introduced during training. The reconstruction module includes a fully connected layer and an auxiliary network connected in sequence. After training, the auxiliary network in the reconstruction module is removed, and the fully connected layer is retained. The optimized features are processed by the fully connected layer and then input into the attention module and the feature fusion module. The principle is that reconstructing the real category helps the model remember the real distribution and helps predict the forged content. Therefore, the present invention performs reconstruction learning (Reconstruction Learning) on the features of the real video. For the introduction of the features of the real video, please refer to the aforementioned feature optimization module section. Exemplarily, two fully connected layers (FC layers) plus an auxiliary network can be used as a reconstruction module. During training, the reconstruction module learns the features of the input real video. The features of the real video are reconstructed through the auxiliary network after the fully connected layer, and the reconstruction loss function is calculated; the training loss is constructed by combining the temporal forgery positioning basic loss function, the optimization objective function and the reconstruction loss function, and the weakly supervised temporal forgery positioning model is trained.
[0080] Specifically, the features of the real video (D dimension) are passed through two fully connected layers in sequence to obtain embedded features (D / 2 dimensions). The auxiliary network uses the embedded features to reconstruct the features of the real video. In particular, only the features of the top-K real videos selected in the aforementioned feature optimization module can be reconstructed here, and the corresponding top-K real video features are recorded as , the reconstructed features are recorded as , the reconstruction loss function is expressed as:
[0081] ;
[0082] Among them, L1 represents the mean absolute error, Representation calculation and The mean absolute error, is the reconstruction loss function based on the mean absolute error.
[0083] In the embodiment of the present invention, the auxiliary network may be an existing convolutional neural network, and the specific network structure may be selected by the user according to actual conditions, and the present invention does not impose any limitation thereto.
[0084] Finally, the training loss Loss is constructed by combining the temporal forgery positioning basic loss function, the optimization objective function and the reconstruction loss function as follows:
[0085]
[0086] in, and are the weight factors of the feature optimization module and the reconstruction module respectively.
[0087] In an embodiment of the present invention, feature extractors are pre-trained, and their parameters can be frozen in the present invention, and the parameters of other modules in the training model, namely, feature optimization module, reconstruction module, attention module, feature fusion module, and classifier, are trained through training loss.
[0088] After training, the standard positioning process can be followed to perform temporal forgery positioning, that is, to detect the video data to be detected and output all forged segment information, where each forged segment information includes: the start timestamp and end timestamp of the forged segment, and the corresponding confidence score; Figure 3 As shown in the figure, the positioning module uses a series of loss functions to supervise the training using video-level labels during the training phase; in the testing phase, the video data to be detected is input, and a forged activation sequence is obtained through the feature extractor, feature optimization module, attention module, feature fusion module and classifier. The positioning module combines the forged activation sequence and obtains proposals (candidate time series boxes, including start timestamps and end timestamps) with different forgery scores through operations such as non-maximum suppression, so that forged segments with higher confidence and corresponding timestamps can be obtained.
[0089] 3. Different baseline methods and feature extractors.
[0090] This paper explores the impact of different baseline methods and feature extractors on weakly supervised temporal forgery localization.
[0091] 1. Baseline method.
[0092] The feature fusion module in the backbone network (baseline method) introduced above is replaced with different baseline methods from weakly supervised video anomaly detection (WS-VAD) and weakly supervised temporal action localization (WS-TAL) tasks, including memory banks and graph convolutional networks (GCNs) used in WS-VAD, as well as pseudo-label self-supervised learning and relation learning from WS-TAL. Two representative network structures are selected for each baseline method for empirical research on the tasks of the present invention.
[0093] 2. Feature extractor. This paper mainly explores the role of three video feature extractors, namely TSN (time segment network), I3D (inflated three-dimensional convolutional network) and SlowFast (slow-fast network), in this invention. Figure 4~Figure 6 Their structural thumbnails are shown. TSN is a simple two-dimensional convolutional neural network that processes each input frame separately. I3D follows the design of the Inception network structure for image recognition, but expands all convolutional layers and pooling layers into three-dimensional convolutional layers. SlowFast consists of a slow channel and a fast channel, which process sparsely and densely sampled video frames respectively. The three are used to extract video features and their performance is compared on this task.
[0094] Figure 4~Figure 6 The rectangular boxes in the thumbnails shown are all convolutional layer blocks. The characters behind each convolution block (for example, A1~A3, B1~B3, C1~C7) mainly serve as identification, and each convolution block contains several convolutional layers. Since the present invention mainly considers time information, in order to intuitively compare the differences between the three feature extractors, the thumbnails reasonably omit all spatial dimension information and only display the time dimension information. The long side of the rectangular box represents the number of time frames (T'). The longer the long side, the more frames it represents; the wide side of the rectangular box represents the number of time channels (C). The longer the wide side, the deeper the time dimension (the larger the number of time channels). After the update Figure 4~Figure 6 In the figure, we can see that from left to right, the network becomes deeper and deeper, and the channel dimension becomes deeper (the network learns more abstract information).
[0095] The solution provided by the embodiment of the present invention is the first solution to solve the training problem of data with only video-level labels; and, currently, on the lavdf and tvil datasets, the performance comparison of this task on different baseline methods and feature extractors is achieved. For the baseline, the discriminative-driven graph network in WS-TAL has the best effect; for the feature extractor, TSN has the best effect; in addition, the feature optimization module and reconstruction module provided by the present invention are universal for most baseline methods, improving the positioning performance. The invention effectively realizes the positioning of weakly supervised temporal forgery, and is a powerful supplement to supervised training.
[0096] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above embodiments can be implemented by software, or by means of software plus necessary general hardware platforms. Based on such understanding, the technical solutions of the above embodiments can be embodied in the form of software products, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), including several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0097] Embodiment 2
[0098] The present invention also provides a positioning analysis system for time forgery, which is mainly used to implement the method provided in the above embodiment, such as Figure 7 As shown, the system mainly includes:
[0099] A model building unit, used to build a weakly supervised temporal forgery localization model, including: a feature extractor, a feature optimization module, an attention module, a feature fusion module, a classifier and a localization module;
[0100] A model training unit is used to train a weakly supervised temporal forgery positioning model using video data with video-level labels, including: inputting video data into the weakly supervised temporal forgery positioning model, extracting multi-category features through the feature extractor, optimizing the features of each category through the feature optimization module, extracting attention weight sequences from the optimized features through the attention module, and obtaining fused attention weight sequences through fusion operations, and generating forged activation sequences through a classifier after the optimized features are fused through the feature fusion module, and obtaining suppressed forgery activation sequences in combination with the fused attention weight sequences, and calculating the temporal forgery positioning basic loss function using the forged activation sequence, the suppressed forgery activation sequence, and the corresponding video-level labels by the positioning module; inputting the given features of the real video and the forged video into the feature optimization module, performing feature optimization through the feature optimization module, and optimizing the objective function to increase the similarity between the features of the real video and reduce the similarity between the features of the real video and the features of the forged video; constructing a training loss in combination with the temporal forgery positioning basic loss function and the optimization objective function, and training the weakly supervised temporal forgery positioning model;
[0101] The temporal forgery positioning unit is used to perform temporal forgery positioning on the input video data to be detected by using the trained weakly supervised temporal forgery positioning model.
[0102] Considering that the specific technical details involved in the system have been introduced in detail in the previous embodiments, they will not be repeated here.
[0103] Technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the system can be divided into different functional modules to complete all or part of the functions described above.
[0104] Embodiment 3
[0105] The present invention also provides a processing device, such as Figure 8 As shown, it mainly includes: one or more processors; a memory for storing one or more programs; wherein, when the one or more programs are executed by the one or more processors, the one or more processors implement the methods provided in the aforementioned embodiments.
[0106] Furthermore, the processing device also includes at least one input device and at least one output device; in the processing device, the processor, memory, input device, and output device are connected via a bus.
[0107] In the embodiment of the present invention, the specific types of the memory, input device and output device are not limited; for example:
[0108] The input device may be a touch screen, an image acquisition device, a physical button or a mouse, etc.;
[0109] The output device may be a display terminal;
[0110] The memory may be a random access memory (RAM) or a non-volatile memory such as a disk storage.
[0111] Embodiment 4
[0112] The present invention also provides a readable storage medium storing a computer program, which implements the method provided in the above embodiment when the computer program is executed by a processor.
[0113] In the embodiment of the present invention, the readable storage medium is a computer-readable storage medium and can be set in the aforementioned processing device, for example, as a memory in the processing device. In addition, the readable storage medium can also be a U disk, a mobile hard disk, a read-only memory (ROM), a disk or an optical disk, etc., which can store program codes.
[0114] The above is only a preferred specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A positioning analysis method for time forgery, characterized in that: include: Construct a weakly supervised temporal forgery localization model, including: feature extractor, feature optimization module, attention module, feature fusion module, classifier and localization module; wherein the classifier is a classifier containing 1 forgery category and 1 real category; The weakly supervised temporal forgery positioning model is trained using video data with video-level labels, including: inputting video data into the weakly supervised temporal forgery positioning model, extracting multi-category features through the feature extractor, optimizing the features of each category through the feature optimization module, extracting attention weight sequences from the optimized features through the attention module, and obtaining fused attention weight sequences through fusion operations, and generating forged activation sequences through the classifier after the optimized features are fused through the feature fusion module, and obtaining suppressed forgery activation sequences in combination with the fused attention weight sequences, and calculating the temporal forgery positioning basic loss function using the forged activation sequence, the suppressed forgery activation sequence, and the corresponding video-level labels by the positioning module; inputting the given features of the real video and the forged video into the feature optimization module, performing feature optimization through the feature optimization module, and optimizing the objective function to increase the similarity between the features of the real video and reduce the similarity between the features of the real video and the features of the forged video; constructing a training loss in combination with the temporal forgery positioning basic loss function and the optimization objective function, and training the weakly supervised temporal forgery positioning model; The trained weakly supervised temporal forgery localization model is used to perform temporal forgery localization on the input video data to be detected; The features of the given real video and the forged video are input into the feature optimization module, and the feature optimization module is used to optimize the features. The optimization objective function is to increase the similarity between the features of the real video and reduce the similarity between the features of the real video and the features of the forged video, and includes: The characteristics of the real video are recorded as , where each item represents the feature of a real video clip, T is the total number of video clips; the feature of the forged video is recorded as , where each item represents a feature of a forged video clip; The attention module extracts the corresponding attention weight sequences from the features of the real video and the fake video respectively, and extracts the top K features with the highest attention scores from their respective attention weight sequences; Calculate the similarity between the features of real videos , and calculate the similarity between the features of the real video and the top K features with the highest attention scores in the features of the fake video , expressed as: ; ; ; in, and Represents the features of the i-th and j-th real video clips; is the average of the top K features with the highest attention scores in the real video features, The index of the top K features with the highest attention scores among the features of the real video is Features; is the average of the top K features with the highest attention scores among the features of the forged video, The index of the top K features with the highest attention scores among the features of the forged video is Features; L(.) represents the similarity calculation function; Similarity Based on similarity Reduce, expressed as: At the same time, the similarity between the features of real videos gradually increases. Based on this, the optimization objective function is defined express: ; Among them, the max(.) function is used to return the maximum value; margin is the set value.
2. A method for locating and analyzing time forgery according to claim 1, characterized in that: Extracting multi-category features by the feature extractor includes: The input video data includes a plurality of non-overlapping video clips. The feature extractor includes a visual feature extractor and an optical flow feature extractor. For each video clip, the visual feature extractor and the optical flow feature extractor are used to extract visual features and optical flow features respectively.
3. A method for locating and analyzing time forgery according to claim 2, characterized in that: The optimized features are fused by the feature fusion module and then the forged activation sequence is generated by the classifier as follows: ; Where p is the forged activation sequence, is the operator that connects along the channel dimension, is the feature fusion module, is a classifier; For the optimized visual features, is the optimized optical flow feature.
4. A method for locating and analyzing time forgery according to claim 1, characterized in that: The suppression forgery activation sequence obtained by combining the fused attention weight sequence is expressed as: ; in, To suppress spurious activation sequences, is the fused attention weight sequence, p is the forged activation sequence, and the symbol Represents element-wise multiplication.
5. The method for locating and analyzing time forgery according to claim 1, characterized in that: The weakly supervised temporal forgery positioning model also includes: a reconstruction module, the reconstruction module includes a fully connected layer and an auxiliary network connected in sequence. After training, the auxiliary network in the reconstruction module is removed, and the fully connected layer is retained. The optimized various features are processed by the fully connected layer and then input into the attention module and the feature fusion module. During training, the features of the real video are passed through the fully connected layer and then reconstructed into the corresponding real video features through the auxiliary network, and the reconstruction loss function is calculated. The training loss is constructed by combining the temporal forgery positioning basic loss function, the optimization objective function and the reconstruction loss function, and the weakly supervised temporal forgery positioning model is trained.
6. A method for locating and analyzing time forgery according to claim 1, characterized in that: The method of using the trained weakly supervised temporal forgery positioning model to perform temporal forgery positioning on the input video data to be detected includes: The video data to be detected is detected, and all the forged segment information is output, wherein each forged segment information includes: a start timestamp and an end timestamp of the forged segment, and a corresponding confidence score.
7. A positioning analysis system for time forgery, characterized in that: include: A model building unit, used to build a weakly supervised temporal forgery localization model, including: a feature extractor, a feature optimization module, an attention module, a feature fusion module, a classifier and a localization module; wherein the classifier is a classifier including one forgery category and one real category; A model training unit is used to train a weakly supervised temporal forgery positioning model using video data with video-level labels, including: inputting video data into the weakly supervised temporal forgery positioning model, extracting multi-category features through the feature extractor, optimizing the features of each category through the feature optimization module, extracting attention weight sequences from the optimized features through the attention module, and obtaining fused attention weight sequences through fusion operations, and generating forged activation sequences through a classifier after the optimized features are fused through the feature fusion module, and obtaining suppressed forgery activation sequences in combination with the fused attention weight sequences, and calculating the temporal forgery positioning basic loss function using the forged activation sequence, the suppressed forgery activation sequence, and the corresponding video-level labels by the positioning module; inputting the given features of the real video and the forged video into the feature optimization module, performing feature optimization through the feature optimization module, and optimizing the objective function to increase the similarity between the features of the real video and reduce the similarity between the features of the real video and the features of the forged video; constructing a training loss in combination with the temporal forgery positioning basic loss function and the optimization objective function, and training the weakly supervised temporal forgery positioning model; A temporal forgery positioning unit, used for performing temporal forgery positioning on input video data to be detected by using a trained weakly supervised temporal forgery positioning model; The features of the given real video and the forged video are input into the feature optimization module, and the feature optimization module is used to optimize the features. The optimization objective function is to increase the similarity between the features of the real video and reduce the similarity between the features of the real video and the features of the forged video, and includes: The characteristics of the real video are recorded as , where each item represents the feature of a real video clip, T is the total number of video clips; the feature of the forged video is recorded as , where each item represents a feature of a forged video clip; The attention module extracts the corresponding attention weight sequences from the features of the real video and the fake video respectively, and extracts the top K features with the highest attention scores from their respective attention weight sequences; Calculate the similarity between the features of real videos , and calculate the similarity between the features of the real video and the top K features with the highest attention scores in the features of the fake video , expressed as: ; ; ; in, and Represents the features of the i-th and j-th real video clips; is the average of the top K features with the highest attention scores in the real video features, The index of the top K features with the highest attention scores among the features of the real video is Features; is the average of the top K features with the highest attention scores among the features of the forged video, The index of the top K features with the highest attention scores among the features of the forged video is Features; L(.) represents the similarity calculation function; Similarity Based on similarity Reduce, expressed as: At the same time, the similarity between the features of real videos gradually increases. Based on this, the optimization objective function is defined express: ; Among them, the max(.) function is used to return the maximum value; margin is the set value.
8. A processing device, characterized in that: include: one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.
9. A readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
