Method and apparatus for detecting counterfeiting using multitask training and dynamic decisioning

By employing a multi-task training and dynamic decision-making method for forgery detection, and utilizing deep convolutional networks and self-supervised learning, a forgery recognition rule base is generated. This addresses the shortcomings of feature extraction and dynamic updating in forgery detection, achieving efficient forgery detection.

CN122200760APending Publication Date: 2026-06-12BEIJING HISIGN TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING HISIGN TECH
Filing Date
2026-02-28
Publication Date
2026-06-12

AI Technical Summary

Technical Problem

Existing forgery detection methods perform poorly in feature extraction and type recognition, lack self-supervised mechanisms and optimization strategies, and are difficult to achieve efficient dynamic updates and analysis of unknown types, thus affecting detection accuracy and adaptability.

Method used

A forgery detection method employing multi-task training and dynamic decision-making is proposed. Forgery features are extracted through deep convolutional networks, and frequency domain analysis and unsupervised clustering are performed. Combined with self-supervised learning and transfer learning, a forgery recognition rule base is generated, enabling dynamic adjustment and online optimization.

Benefits of technology

It effectively improves the accuracy and adaptability of forgery detection, ensures continuous improvement in detection, and solves the shortcomings of traditional technologies in feature analysis, rule generation, and dynamic updates.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122200760A_ABST
    Figure CN122200760A_ABST
Patent Text Reader

Abstract

The embodiment of the application provides a kind of multi-task training and dynamic decision's forgery detection method and device, and the effective construction of detection is realized by multi-task framework and migration learning.Construct learning optimization mechanism, combine self-supervised analysis and rule generation, establish reliable identification strategy.Introduce dynamic update, through unknown type processing and online optimization, ensure the continuous improvement of detection.The method effectively solves the shortcomings of traditional technology in feature analysis, rule generation and dynamic update, etc., and provides technical support for forgery detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer vision, specifically to a method and apparatus for forgery detection involving multi-task training and dynamic decision-making. Background Technology

[0002] Existing counterfeit detection methods have significant shortcomings. Traditional systems perform poorly in feature extraction and type recognition, failing to effectively analyze counterfeit traces and affecting detection accuracy.

[0003] Furthermore, existing technologies face bottlenecks in sample learning and rule generation. Most systems lack robust self-supervised mechanisms and optimization strategies, resulting in incomplete identification.

[0004] Existing systems have technical shortcomings in dynamic updates. They lack in-depth analysis of unknown types, making it difficult to achieve efficient feature learning through online optimization, thus affecting detection adaptability. Solving these problems is crucial for improving forgery detection capabilities. Summary of the Invention

[0005] To address the problems in existing technologies, this application provides a forgery detection method and apparatus based on multi-task training and dynamic decision-making, which can effectively solve the shortcomings of traditional technologies in feature analysis, rule generation, and dynamic updating, and provide technical support for forgery detection.

[0006] To solve at least one of the above problems, this application provides the following technical solution: Firstly, this application provides a forgery detection method for multi-task training and dynamic decision-making, including: Acquire face image data to be detected, use a deep convolutional network to extract forgery features to generate a basic feature set, perform frequency domain analysis on the basic feature set to generate forgery trace vectors, establish a multi-task framework for authenticity determination and forgery type identification, input the forgery trace vectors into an unsupervised clustering module to generate forgery type classification, construct anti-counterfeiting detection labels based on the forgery types, input the anti-counterfeiting detection labels into a transfer learning module to generate a detection parameter set containing forgery feature mapping and type identification; Based on the detection parameter set, forged sample features are extracted, and self-supervised learning is performed on the forged sample features to generate a forged similarity matrix. Based on the forged similarity matrix, type clustering scores are calculated, and feature consistency of each forged type cluster is quantitatively analyzed to generate an anti-counterfeiting state vector. The anti-counterfeiting state vector is input into a multi-objective optimization function, and a forged identification rule base is generated based on the multi-objective optimization function. Based on the forged identification rule base, the detection categories are dynamically adjusted to generate an anti-counterfeiting label set. The system receives an input image to be detected, extracts feature vectors from the anti-counterfeiting label set to generate a distance distribution, determines the counterfeiting type based on the distance distribution to generate a matching result, inputs unknown counterfeiting types from the matching result into a local clustering module to generate new anti-counterfeiting labels, constructs a detection reward function based on the new anti-counterfeiting labels, uses the detection reward function for online optimization of the feature extractor, and outputs detection data containing authenticity determination and counterfeiting source tracing.

[0007] Furthermore, it also includes: preprocessing the input face image to generate standard image data, extracting texture feature point sequences based on the standard image data, constructing an image pyramid according to a preset resolution, extracting local region descriptors based on the image pyramid, inputting the local region descriptors into a deep convolutional network, generating a region feature map through sliding scan, and constructing a feature dataset containing feature tensors and location identifiers based on the region feature map; Frequency domain transformation is performed based on the feature dataset. The feature tensor is segmented by frequency to generate frequency domain parameters. The frequency domain parameters are grouped by region according to the location identifier. A detection template is established based on the region grouping. The detection template is used for frequency domain response calculation. A region feature sequence is constructed based on the frequency domain response. The region feature sequence is combined into an image feature vector.

[0008] Furthermore, it also includes: normalizing the forgery trace vector to generate standardized features, calculating the distance matrix between samples based on the standardized features, constructing a similarity map based on the distance matrix, inputting the similarity map into the spectral clustering module, generating a clustering feature space through eigenvalue decomposition, establishing a sample mapping relationship based on the clustering feature space, and generating forgery type data containing cluster centers and category identifiers; Based on the forgery type data, transfer training rules are constructed, the cluster center is used as the prototype representation of the forgery type, anti-counterfeiting detection indicators are generated according to the category identifier, the anti-counterfeiting detection indicators are parameter mapped, a detection model training set is established, and the training set is used for the transfer learning process to generate model parameters that include feature extraction and type recognition.

[0009] Furthermore, it also includes: parsing the detection parameter set to obtain feature extraction rules, constructing a sample processing flow according to the feature extraction rules, grouping the input samples into preset batches, extracting local features from the grouped samples, generating a feature vector sequence based on the local features, inputting the feature vector sequence into a self-supervised learning unit, and generating a learning dataset containing positive and negative sample pairs and contrast loss. The similarity between samples is calculated based on the learning dataset. The positive and negative sample pairs are mapped to the metric space. A similarity calculation model is constructed based on the contrast loss. The output of the similarity calculation model is matrixed. The intra-cluster consistency score is calculated based on the matrixing result. An anti-counterfeiting feature vector containing type score and state index is generated.

[0010] Furthermore, it also includes: performing dimensional mapping on the anti-counterfeiting state vector to generate an optimization target set, constructing a constraint condition matrix based on the optimization target set, setting the detection accuracy and computational cost as the optimization dimensions, configuring the parameters of the constraint condition matrix, generating an objective function family based on the parameter configuration, inputting the objective function family into an optimization solver, and generating rule-based data containing the optimal solution and weight coefficients; A dynamic adjustment mechanism is constructed based on the rule-based data. The optimal solution is mapped to a detection rule template. A category division strategy is generated according to the weight coefficients. The detection rule template is updated online. A category adjustment decision tree is established. The category adjustment decision tree is used in the label generation process to generate anti-counterfeiting label data containing detection thresholds and category mappings.

[0011] Furthermore, it also includes: performing standardized preprocessing on the image to be detected to generate an input data stream, extracting a multi-scale feature map based on the input data stream, performing feature matching between the feature map and the anti-counterfeiting label set, calculating a distance vector on the feature matching result, establishing a probability distribution model based on the distance vector, using the probability distribution model for similarity calculation, and generating feature mapping data containing distance metrics and distribution parameters; Based on the feature mapping data, a type determination rule is constructed, the distance metric is divided into intervals according to a preset threshold, a discrimination strategy is generated according to the distribution parameters, the confidence of the discrimination strategy is evaluated, a multi-level determination model is established, the multi-level determination model is used in the type recognition process, and detection result data containing forgery type and matching probability is generated.

[0012] Furthermore, it also includes: filtering the matching results to generate an unknown sample set, extracting local feature descriptors based on the unknown sample set, grouping and clustering similar samples according to preset rules, calculating cluster feature vectors for the grouping and clustering results, establishing a new type representation model based on the cluster feature vectors, using the new type representation model for label generation, and generating new label data containing type encoding and feature prototypes. A reinforcement learning environment is constructed based on the newly added label data. The type encoding is mapped to state space parameters. A reward calculation rule is generated according to the feature prototype. The reward calculation rule is trained online to establish a feature optimization model. The feature optimization model is used to update the extractor and generate an output dataset containing detection conclusions and source information.

[0013] Secondly, this application provides a forgery detection device for multi-task training and dynamic decision-making, comprising: The feature construction module is used to acquire the face image data to be detected, extract the forgery features using a deep convolutional network to generate a basic feature set, perform frequency domain analysis on the basic feature set to generate forgery trace vectors, establish a multi-task framework for authenticity determination and forgery type recognition, input the forgery trace vectors into an unsupervised clustering module to generate forgery type classification, construct anti-counterfeiting detection labels based on the forgery types, input the anti-counterfeiting detection labels into a transfer learning module to generate a detection parameter set containing forgery feature mapping and type recognition; The clustering calculation module is used to extract features of counterfeit samples based on the detection parameter set, perform self-supervised learning on the features of the counterfeit samples to generate a counterfeit similarity matrix, calculate type clustering scores based on the counterfeit similarity matrix, perform quantitative analysis on the feature consistency of each counterfeit type cluster to generate an anti-counterfeiting state vector, input the anti-counterfeiting state vector into a multi-objective optimization function, generate a counterfeit identification rule base based on the multi-objective optimization function, and dynamically adjust the detection categories to generate an anti-counterfeiting label set based on the counterfeit identification rule base. The anti-counterfeiting detection module is used to receive the input image to be detected, extract feature vectors from the anti-counterfeiting label set to generate a distance distribution, determine the counterfeiting type based on the distance distribution to generate a matching result, input the unknown counterfeiting type in the matching result into the local clustering module to generate a new anti-counterfeiting label, construct a detection reward function based on the new anti-counterfeiting label, use the detection reward function for online optimization of the feature extractor, and output detection data containing authenticity determination and counterfeiting traceability.

[0014] Thirdly, this application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the multi-task training and dynamic decision-making forgery detection method.

[0015] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the forgery detection method for multi-task training and dynamic decision-making.

[0016] Fifthly, this application provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the steps of the aforementioned forgery detection method for multi-task training and dynamic decision-making.

[0017] As can be seen from the above technical solution, this application provides a forgery detection method and apparatus based on multi-task training and dynamic decision-making. Through a multi-task framework and transfer learning, it achieves effective detection construction. A learning optimization mechanism is constructed, combining self-supervised analysis and rule generation to establish a reliable identification strategy. Dynamic updates are introduced, and through unknown type handling and online optimization, continuous improvement of detection is ensured. This method effectively solves the shortcomings of traditional techniques in feature analysis, rule generation, and dynamic updates, providing technical support for forgery detection. Attached Figure Description

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

[0019] Figure 1 This is a flowchart illustrating the forgery detection method based on multi-task training and dynamic decision-making in an embodiment of this application. Figure 2 This is a structural diagram of the forgery detection device for multi-task training and dynamic decision-making in the embodiments of this application. Detailed Implementation

[0020] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0021] The acquisition, storage, use, and processing of data in this application comply with relevant laws and regulations.

[0022] To address the problems existing in current technologies, this application provides a forgery detection method and apparatus based on multi-task training and dynamic decision-making. Through a multi-task framework and transfer learning, it achieves effective detection construction. A learning optimization mechanism is constructed, combining self-supervised analysis and rule generation to establish a reliable identification strategy. Dynamic updates are introduced, and through handling unknown types and online optimization, continuous improvement of detection is ensured. This method effectively solves the shortcomings of traditional techniques in feature analysis, rule generation, and dynamic updates, providing technical support for forgery detection.

[0023] To effectively address the shortcomings of traditional technologies in feature analysis, rule generation, and dynamic updating, and to provide technical support for forgery detection, this application provides an embodiment of a forgery detection method based on multi-task training and dynamic decision-making. See [link to embodiment]. Figure 1 The forgery detection method based on multi-task training and dynamic decision-making specifically includes the following: Step S101: Obtain the face image data to be detected, use a deep convolutional network to extract forgery features to generate a basic feature set, perform frequency domain analysis on the basic feature set to generate forgery trace vectors, establish a multi-task framework for authenticity determination and forgery type recognition, input the forgery trace vectors into an unsupervised clustering module to generate forgery type classification, construct anti-counterfeiting detection labels according to the forgery types, input the anti-counterfeiting detection labels into a transfer learning module to generate a detection parameter set containing forgery feature mapping and type recognition; First, after receiving the face image data to be detected, the size is standardized and the color is normalized. The images are then cropped into standard image data according to the face bounding boxes located by the fixed face detector, and batch grouping is completed based on timestamps and source identifiers. For each batch, brightness and sharpness range cropping is performed without changing the content, and overexposed and out-of-focus frames are filtered out to obtain an effective sample set for feature calculation, providing consistent input for subsequent feature extraction.

[0024] Based on the effective sample set, standard image data is input into a deep convolutional network to obtain feature tensors representing texture and geometric distribution. In this embodiment, this network is named a multi-task pre-trained feature extractor. Its output is mapped to the basic feature set, and positional and batch identifiers are added to it along the sample dimension to facilitate region alignment during frequency domain processing. To suppress edge spurious responses, the feature tensor is windowed smoothed channel by channel, and the window coefficients are retained for later reference.

[0025] The basic feature set is fed into the frequency domain analysis unit. First, a fast frequency domain transformation is performed on each channel. Then, the energy and phase inconsistency are calculated for the three segments of low frequency, mid frequency, and high frequency, respectively, to form candidate quantities of forgery traces. To establish a stable forgery trace vector, the candidate quantities are mapped to the upper segment position identifier to synthesize a regional feature sequence. Normalization is then performed at the sequence level to form a forgery trace vector as a unified input for unsupervised clustering.

[0026] Based on the forgery trace vector, a multi-task framework for authenticity determination and forgery type recognition is constructed. This framework includes two output branches: the first branch learns the authenticity determination, and the second branch provides the metric space constraints for type recognition.

[0027] To unify the learning objectives of the two branches, this embodiment sets a joint objective function between the frequency domain response and the true / false distinction: J = a·U + b·R, Where J is the joint objective, U is the aggregation consistency term based on forgery trace vectors, R is the boundary margin term for true / false judgment, and a and b are non-negative weights. U is used to improve the aggregation degree of similar samples in the metric space, and R is used to improve the stability of true / false separation. This formula is only used for constraint construction during training; the intermediate weights obtained from the solution will be read in subsequent clustering and transfer processing stages.

[0028] Based on the metric space trained above, the forgery trace vector is input into the unsupervised clustering module. This module extracts several forgery type clusters based on the distance matrix and density distribution, outputs category identifiers and cluster centers, and archives the cluster centers along with the weights in the joint objective to form the forgery type classification result. To avoid noise from small clusters, the module merges clusters with very few samples, and the merging strategy is linked to the stability of the boundary margin term in the previous section.

[0029] Based on the counterfeit type classification results, anti-counterfeiting detection tags are generated. Specifically, a one-to-one mapping is established between category identifiers and regional feature sequences to obtain tag entries containing type codes and regional confidence. Each tag is then appended with a source batch and a windowing smoothing coefficient to ensure that the frequency domain environment at the time can be reproduced in subsequent migration stages. This tag set constitutes the anti-counterfeiting detection tags and will be directly used as a monitoring signal.

[0030] The anti-counterfeiting detection label is input into the transfer learning module, and a small-step fine-tuning process is constructed by combining the shared layer parameters of the multi-task pre-trained feature extractor. This process uses cluster centers as category prototypes to constrain the metric radius of the new task, ensuring that the feature and type recognition branches share the same feature base. The transfer learning module reads the weights and cluster centers of the aforementioned joint objective, calibrates the loss term ratio, outputs a detection parameter set containing counterfeit feature mapping and type recognition, and records the version number and applicable data domain.

[0031] After the detection parameter set is generated, it is registered in the inference-side cache along with the batch identifier, serving as direct input for the subsequent step S102 to extract features of forged samples. The feature mapping is invoked by the downstream self-supervised learning unit to construct sample pairs, and the type identification sub-parameter is read by the type clustering scoring module to calculate intra-cluster consistency. Through this connection, this embodiment completes a closed loop from image input, frequency domain modeling, type partitioning to parameter deposition within step S101, providing traceable intermediate quantities and interfaces for subsequent dynamic adjustments and local clustering.

[0032] Step S102: Extract counterfeit sample features based on the detection parameter set, perform self-supervised learning on the counterfeit sample features to generate a counterfeit similarity matrix, calculate type clustering scores based on the counterfeit similarity matrix, perform quantitative analysis on the feature consistency of each counterfeit type cluster to generate an anti-counterfeiting state vector, input the anti-counterfeiting state vector into a multi-objective optimization function, generate a counterfeit identification rule base based on the multi-objective optimization function, and dynamically adjust the detection categories to generate an anti-counterfeiting label set based on the counterfeit identification rule base; First, the detection parameter set generated in step S101 is read into the inference-side cache according to its version number and applicable data domain. Two types of sub-parameters, feature mapping and type recognition, are parsed out, and newly arrived samples are grouped according to their source batch. For each group of samples, the shared layer of the multi-task pre-trained feature extractor is invoked to extract local features according to the channel weights in the detection parameter set, and the output is the forged sample feature. To ensure consistency with the frequency domain environment, the windowing smoothing coefficient recorded in step S101 is synchronously applied to the channel response to obtain a normalized feature vector sequence, which serves as the input for self-supervised learning.

[0033] Based on the feature vector sequence, a sample pair organization method for the self-supervised learning unit is constructed. Specifically, according to the category prototypes provided by the type identification sub-parameters, positive sample pairs are sampled from the neighborhood of the same category prototype, and negative sample pairs are sampled from the neighborhood of cross-prototypes. A time window identifier and source batch are attached to each sample pair. The sample pairs and the contrastive loss rule are input into the self-supervised learning unit to obtain an embedding representation mapped to the metric space. This embedding representation establishes a one-to-one reference relationship between the sample and the category prototype, which is used for the subsequent construction of the similarity matrix.

[0034] Once the embedded representation is ready, a forgery similarity matrix is ​​computed. The similarity metric is a weighted combination of cosine similarity and prototype distance, with a class balancing term introduced to obtain the element values ​​of the matrix.

[0035] To facilitate subsequent scoring and stability analysis, this embodiment introduces a combined objective function in the self-supervised stage to guide the convergence direction and boundary margins of the matrix: Q = p·H + q·C r·B.

[0036] In the formula, Q is the optimization objective of the self-supervised stage, H is the aggregation term for positive sample pairs, C is the separation term for negative sample pairs, and B is the class imbalance penalty term; p, q, and r are non-negative weights. H promotes the compactness of the matrix diagonal blocks by increasing the proximity of samples of the same class in the embedding space, C improves the sparsity of the matrix off-diagonal blocks by widening the distance between cross-class samples, and B is used to constrain weight allocation when the proportion of class samples is unbalanced. The embedding corresponding to the optimal solution of this objective is fixed, and a fake similarity matrix is ​​output accordingly.

[0037] Based on the forged similarity matrix, a type clustering score is calculated. Specifically, the matrix is ​​first rearranged according to the category prototype, the diagonal sub-blocks of each type cluster are extracted, and two indices are calculated: average similarity within the cluster and minimum dissimilarity between clusters. The type clustering score is then generated based on these indices. To ensure consistency with the constraints of the detection parameter set, the metric radius of the type identification sub-parameter is read during scoring, and boundary samples are weighted to reduce their weights, preventing boundary samples from affecting the stability of the score. The scoring results serve as direct input for subsequent consistency analysis.

[0038] After the clustering score is available, feature consistency quantification analysis is performed on each counterfeit type cluster to generate an anti-counterfeiting status vector. This vector contains three fields: intra-cluster consistency score, boundary sample ratio, and prototype drift magnitude, and references the row and column indices of the similarity matrix to maintain alignment. To facilitate integration with the optimization phase, source batch and time window identifiers are appended to the vector to ensure that the status of multiple clusters within the same window can be read in parallel at the optimization stage.

[0039] Based on the anti-counterfeiting state vector, a multi-objective optimization function is invoked to generate a counterfeiting identification rule base. The optimization objective consists of a detection accuracy dimension and a computational cost dimension, with constraints derived from the metric radius, minimum class support, and upper limit of the boundary sample proportion. The optimization solver reads the optimal embedding and type clustering score of the aforementioned Q, jointly solves for the basic rule data, including the optimal solution and weight coefficients, and maps the optimal solution to a detection rule template and the weight coefficients to a class partitioning strategy.

[0040] Once the basic rule data is ready, a dynamic adjustment mechanism is established. The mechanism first uses the detection rule template as a starting point and determines whether adjacent type clusters should be merged or split based on the category classification strategy. A split branch is triggered when the prototype drift exceeds the constraint threshold, and a merge branch is triggered when the minimum support is insufficient. The results of the dynamic adjustment are written into the forgery detection rule base, forming a category mapping table and a detection threshold table that can be used by the inference end.

[0041] Based on the counterfeit identification rule base, an anti-counterfeiting label set is generated. Specifically, the type codes in the category mapping table are realigned with the region feature sequences generated in step S101, and each type code is assigned a discriminative weight and a threshold range to form a label entry containing a detection threshold and a category mapping. To ensure consistency in subsequent online judgments, a similarity matrix version and an optimized weight snapshot are retained within each label entry.

[0042] Finally, the anti-counterfeiting label set is registered in the inference-side cache, serving as the direct basis for the subsequent step S103 to receive the image to be detected and generate distance distribution and type determination. The mapping and threshold interval are read by the type determination model, and the time window identifier of the anti-counterfeiting state vector is referenced by the local clustering module to determine the triggering conditions for unknown types, thus achieving a closed-loop connection from parameter extraction and self-supervised learning to rule generation and label updating.

[0043] Step S103: Receive the input image to be detected, extract feature vectors based on the anti-counterfeiting label set to generate a distance distribution, determine the counterfeiting type based on the distance distribution to generate a matching result, input the unknown counterfeiting type in the matching result into the local clustering module to generate a new anti-counterfeiting label, construct a detection reward function based on the new anti-counterfeiting label, use the detection reward function for online optimization of the feature extractor, and output detection data containing authenticity determination and counterfeiting source tracing.

[0044] First, after receiving the image to be detected, the size and color are aligned according to the standardization rules in step S101, and the consistency is verified according to the version number of the anti-counterfeiting label set registered in step S102. For the image that passes the verification, the shared layer and type recognition branch of the multi-task pre-trained feature extractor are invoked to output a multi-scale feature map. The channel responses are weighted according to the discriminative weights in the label entries and combined into a feature vector sequence to be judged, ensuring that it is in the same metric space as the threshold range of the label set.

[0045] Based on the feature vector sequence, the category prototypes and threshold intervals in the anti-counterfeiting tag set are read, the distances to each prototype are calculated, and normalized into a distance distribution. To synchronize the alignment during the self-supervised phase, the distance term is superimposed with the prototype radius and boundary weights, weakening the representation of boundary neighborhood samples in the distribution. The distance distribution is backfilled into the current session using the category code as an index, serving as direct input for type determination.

[0046] Once the distance distribution is ready, type determination rules are constructed and matching results are output. The determination rules perform multi-level comparisons based on the threshold intervals of the label entries. First, candidates are filtered by minimum distance, then candidate categories are compared by distribution difference, ultimately generating result entries containing the forgery type and matching probability. Samples that do not meet any threshold interval are labeled as unknown types, and a snapshot of the distance distribution and its time window identifier are retained for subsequent local clustering.

[0047] Based on the unknown type entries, a local clustering module is triggered. This module only performs feature aggregation on unknown samples, references the similarity matrix version generated in step S102 to maintain metric consistency, and outputs several new cluster centers and type codes to form new anti-counterfeiting labels. The new labels and existing labels establish a subordinate relationship in the category mapping table, and record the prototype inheritance chain for subsequent tracing.

[0048] After the newly added anti-counterfeiting labels become available, a detection reward function is constructed for online optimization of the feature extractor. The reward function uses the clustering consistency of unknown samples and the interval with known neighboring prototypes as positive terms, and the counter-evidence of misclassification into historical categories as a penalty term, forming a guiding signal for the extractor's gradient. During online optimization, only the fine-tuning parameters of the shared layer are updated, and the threshold table of the type recognition branch is locked to prevent short-term drift from disrupting existing category boundaries.

[0049] After the online optimization is completed, the updated feature mapping is written back to the inference cache, and the current batch is quickly re-evaluated. The distance distribution under the new mapping is checked for consistency with the initial evaluation result. If they are consistent, the new label is fixed; if they are inconsistent, it is marked as pending confirmation and proceeds to the next window for re-evaluation. The re-evaluation process ensures that the effectiveness of the new category has a traceable version chain.

[0050] Finally, based on the confirmed matching results and newly added tags, detection data including authenticity determination and forgery tracing is generated. Authenticity determination comes from the authenticity branch of the type determination rule, and forgery tracing traces back to the historical cluster center based on the category prototype and prototype inheritance chain. The detection data is output to the application side with the session identifier and tag version as keys, while the clustering summary and reward parameters of unknown samples are registered in the training side log, providing input for subsequent rule updates and category system maintenance.

[0051] As described above, the forgery detection method based on multi-task training and dynamic decision-making provided in this application can effectively construct detection methods through a multi-task framework and transfer learning. A learning optimization mechanism is constructed, combining self-supervised analysis and rule generation to establish a reliable identification strategy. Dynamic updates are introduced, and through unknown type handling and online optimization, continuous improvement of detection is ensured. This method effectively addresses the shortcomings of traditional techniques in feature analysis, rule generation, and dynamic updates, providing technical support for forgery detection.

[0052] In one embodiment of the forgery detection method for multi-task training and dynamic decision-making in this application, it may further include the following: Step S201: Preprocess the input face image to generate standard image data, extract texture feature point sequences based on the standard image data, construct an image pyramid according to a preset resolution, extract local region descriptors based on the image pyramid, input the local region descriptors into a deep convolutional network, generate a region feature map through sliding scan, and construct a feature dataset containing feature tensors and location identifiers based on the region feature map. Step S202: Perform frequency domain transformation based on the feature dataset, map the feature tensor into frequency domain parameters by frequency segmentation, group the frequency domain parameters into regions according to the location identifier, establish a detection template based on the region grouping, use the detection template for frequency domain response calculation, construct a region feature sequence based on the frequency domain response, and combine the region feature sequence into an image feature vector.

[0053] First, after receiving the original face image, preprocessing is performed, including resampling, color space unification, and face region cropping. Based on the face bounding boxes output by the fixed face detector, the image is normalized into standard image data, and overexposure, blurring, and strong compression artifacts are removed, retaining valid frames for downstream feature calculation. To facilitate subsequent scale-invariant processing, grayscale copies and edge response maps are generated simultaneously at this stage. Both are bound to the standard image data with the same timestamp and source identifier, serving as the input set for texture extraction.

[0054] Based on the standard image data, a sequence of texture feature points is extracted. Specifically, corner and spot candidates are calculated using grayscale copies, and non-maximum suppression is performed on the edge response map to stabilize the localization. Scale and orientation information are recorded for each feature point. After sorting and deduplication, the aforementioned feature points form a sequence of texture feature points, which is aligned with the timestamps of the preceding data and used as anchor points for constructing the image pyramid, ensuring spatial consistency during cross-scale sampling.

[0055] Based on the texture feature point sequence, an image pyramid is generated according to a preset resolution ratio. For each scale layer, local region descriptors are extracted from the neighborhood of the feature points. The descriptors contain three components: intensity distribution, orientation histogram, and local phase cue, along with scale level and coordinate offset. To balance computational overhead and fine-grained representation, the descriptor dimensions are adaptively truncated at each scale layer to maintain consistency of key components. This batch of descriptors serves as the sliding input to the deep convolutional network for subsequent feature computation.

[0056] Based on the local region descriptors, they are input into a deep convolutional network and scanned with a fixed stride, outputting the channel responses at the corresponding locations. The network is a shared layer of a multi-task pre-trained feature extractor, emphasizing joint representation of texture and geometry. The scanning results are reorganized into regional feature maps according to spatial location, and a location identifier is generated for each response block, containing scale level, coordinate index, and channel number. This forms a feature dataset containing feature tensors and location identifiers, providing structured input for frequency domain transformation.

[0057] Based on the aforementioned feature dataset, a frequency domain transformation is performed. A fast frequency domain transformation is applied to each feature tensor channel to obtain the amplitude and phase spectra, which are then segmented and mapped according to low, mid, and high frequencies to generate frequency domain parameters. The mapping rules are bound to location identifiers, ensuring that frequency domain parameters at different scales and spatial locations are traceable within the same indexing system. To reduce boundary ring pseudo-responses, window function attenuation coefficients are superimposed on the high-frequency segments, and these coefficients are retained for subsequent response interpretation.

[0058] Based on the frequency domain parameters, regions are grouped according to location identifiers. Each group corresponds to a regular grid in the original image or a neighborhood block dynamically generated based on feature point density; both share the same identifier structure at the index level. Frequency band energy, phase inconsistency, and inter-band correlation are statistically analyzed for each group, serving as three elements for constructing the detection template. The detection template records the frequency band weights, phase thresholds, and correlation boundaries of each group, forming a response constraint set that can be reused on different samples.

[0059] After the detection template is prepared, frequency domain response calculation is performed on the feature tensor. Specifically, the frequency band weights of the template are multiplied by the corresponding spectrum of the tensor, the phase threshold regions are compared between intervals, and the correlation boundary is used as a penalty term to superimpose the results, thus obtaining the response value for each group. The response values ​​of all groups are backfilled into a regional feature sequence in order of location identifier. The sequence item contains the response scalar and necessary explanatory labels to indicate the cause of low-frequency dominance or high-frequency anomalies.

[0060] Based on the aforementioned regional feature sequence, image-level aggregation is completed. The responses of each group are weighted and summarized according to spatial adjacency, and the window function attenuation coefficient is restored to a uniform proportion to obtain the image feature vector. To facilitate subsequent connection with the forgery trace vector from step S101, the vector retains a statistical summary of frequency band proportions and phase inconsistencies, and maintains consistency with the timestamp and source identifier of the feature dataset, ensuring that the same image has comparable indices in both the spatial and frequency domains.

[0061] Finally, the image feature vector, along with the region feature sequence, is registered as a searchable object, which can be directly referenced in step S101 when constructing the forgery trace vector, along with the frequency band proportion and phase inconsistency summary. Simultaneously, the feature tensor and location identifier continue to serve as the localization basis during self-supervised learning, and are used in step S102 for neighborhood sampling of sample pairs. Through this connection, the products of steps S201 and S202 can be called upon in subsequent type clustering and distance distribution calculations, maintaining consistency in input organization, indexing system, and metric space.

[0062] In one embodiment of the forgery detection method for multi-task training and dynamic decision-making in this application, it may further include the following: Step S301: Normalize the forgery trace vector to generate standardized features, calculate the distance matrix between samples based on the standardized features, construct a similarity map based on the distance matrix, input the similarity map into the spectral clustering module, generate a clustering feature space through eigenvalue decomposition, establish sample mapping relationship based on the clustering feature space, and generate forgery type data containing cluster centers and category identifiers; Step S302: Construct transfer training rules based on the forgery type data, use the cluster center as the prototype representation of the forgery type, generate anti-counterfeiting detection indicators according to the category identifier, perform parameter mapping on the anti-counterfeiting detection indicators, establish a detection model training set, use the training set for the transfer learning process, and generate model parameters that include feature extraction and type recognition.

[0063] First, the image feature vectors and region feature sequences output from steps S201 and S202 are read and aligned according to the batch identifiers registered in step S101. The image feature vectors are then normalized at the same scale and debiased by channels to obtain a set of forgery trace vectors for pre-clustering processing. Amplitude standardization and high-frequency proportion pruning are performed on each vector in the set to form standardized features, ensuring that samples from different sources are within a comparable numerical range in subsequent distance metrics.

[0064] Based on the standardized features, a distance matrix between samples is calculated by comparing each sample pairwise, and this distance matrix is ​​mapped to a similarity graph. The similarity graph uses a monotonic transformation of the distance and superimposes phase inconsistency weights from the regional feature sequences to achieve higher connectivity in the graph structure for frequency domain anomalies. The nodes in the graph serve as sample indices, the edge weights record similarity values, and the source batch and time window identifiers are retained, providing a complete input structure for subsequent spectral clustering.

[0065] Based on the similarity graph, the Laplacian matrix of the graph is fed into the spectral clustering module to perform eigenvalue decomposition and extract the first few eigenvectors, forming the clustering feature space. To avoid small sample clusters being overwhelmed by noise, the spectral clustering module performs neighborhood sparsification within the embedding space, suppressing the edge weights of low-connectivity subgraphs. A one-to-one mapping is established between the embedded coordinates and the original sample indices, serving as the sample mapping relationship for subsequent calculation of cluster centers and generation of category labels.

[0066] After the clustering feature space is ready, a center merging strategy is run based on the sample mapping relationship to output the initial cluster partition and the cluster centers of each cluster. The center vector is obtained by weighted averaging within the embedding space. The weights are derived from the node degree of the similarity graph and the high-frequency proportion statistics of the regional feature sequence to ensure that the centers are more sensitive to frequency domain anomalies. Each cluster is assigned a category label, and the number of supporting samples and the proportion of boundary samples within the cluster are recorded to form fake type data containing cluster centers and category labels, which is used in the transfer learning training process.

[0067] Based on the aforementioned forgery type data, transfer learning training rules are constructed. The rules define cluster centers as prototype representations of forgery types and generate anti-counterfeiting detection indicators based on category identifiers. The indicator items include prototype radius, boundary width, and frequency band weight.

[0068] To unify the training signals, a loss combination is established to constrain the relative importance of prototype alignment and boundary separation: T1 = t4·T2 + t5·T3 t6·T4.

[0069] In the formula, T1 is the target quantity for transfer training; T2 is the alignment term from the sample to its prototype; T3 is the interval term between different prototypes; T4 is the penalty term for frequency band weight imbalance; t4, t5, and t6 are non-negative weights, which remain fixed within the current data domain. The optimal solution to this objective is used to guide subsequent parameter fine-tuning.

[0070] After defining the anti-counterfeiting detection indicators and target quantities, parameter mapping is performed on the indicators to generate training labels and sampling weights. Parameter mapping transforms the prototype radius into the positive sample sampling radius, the boundary width into the hard example mining probability, and the frequency band weight into the channel loss coefficient. The mapping results are aligned with the sample mapping relationship to form a detection model training set. Each record in the training set contains three types of fields: sample embedding, category identifier, and channel coefficient, ensuring that the feature extraction and type recognition subtasks read from the same source.

[0071] Based on the training set of the detection model, a transfer learning process is performed. Specifically, the shared layer of the pre-trained feature extractor is fixed in the early convolution, while the bottleneck and type recognition branch are opened with small-step updates. The loss consists of the aforementioned target value T1 and the conventional classification loss. The optimizer iterates within a single data domain until convergence. During training, the cluster centers of the fake type data are read, and the prototype representation is periodically refreshed to avoid overfitting caused by slight drift in sample distribution.

[0072] After the training converges, model parameters including feature extraction and type recognition are exported. In the parameter package, the feature extraction side records channel coefficients, bottleneck weights, and frequency-sensitive masks, while the type recognition side records prototype vectors, prototype radii, and boundary thresholds. These model parameters are backfilled with a version number and applicable data domain index for registration by the transfer learning module in step S101, and also for use in step S102 to construct positive and negative sample pairs by calling the category prototype during self-supervised learning.

[0073] Finally, the model parameters and forgery type data are written into the inference-side cache, forming a stable entry point for online judgment. The feature extraction parameters are used in step S103 to generate feature vectors and distance distributions, while the category identifier and prototype vector are referenced by the type determination and local clustering module in step S103, achieving a seamless connection from spectral clustering output to transfer training implementation.

[0074] In one embodiment of the forgery detection method for multi-task training and dynamic decision-making in this application, it may further include the following: Step S401: Parse the detection parameter set to obtain feature extraction rules, construct a sample processing flow according to the feature extraction rules, group the input samples according to a preset batch, extract local features from the grouped samples, generate a feature vector sequence according to the local features, input the feature vector sequence into a self-supervised learning unit, and generate a learning dataset containing positive and negative sample pairs and contrast loss. Step S402: Calculate the similarity between samples based on the learning dataset, map the positive and negative sample pairs to the metric space, construct a similarity calculation model according to the contrast loss, perform matrix processing on the output of the similarity calculation model, calculate the intra-cluster consistency score according to the matrix processing result, and generate an anti-counterfeiting feature vector containing type score and state index.

[0075] First, the detection parameter set produced in steps S301 to S302 is read, and verification and alignment are performed in terms of version number and applicable data domain. The verified parameter set is parsed to extract feature extraction rules, which include four types of quantities: channel coefficients, bottleneck layer weights, frequency-sensitive masks, and prototype radius. Based on these rules, a sample processing flow is constructed, grouping newly arrived samples into preset batches based on their source and timestamp combination. The scale level and location identifier marked in step S201 are also loaded into the processing context to ensure consistency between the extracted local features and the subsequent metric space.

[0076] Based on the aforementioned sample processing flow, local features are extracted for each group of samples. Specifically, on a scale-invariant image pyramid, sampling regions are identified by location, and local response vectors are obtained by applying channel coefficients and frequency-sensitive masks. Dimensionality reduction is then performed using bottleneck layer weights to generate a self-supervised feature vector sequence. This sequence inherits the batch identifier and source domain, serving as the index benchmark for subsequent positive and negative sample pair construction, ensuring the traceability of sample pairs in terms of time and source.

[0077] After the feature vector sequence is ready, the input to the self-supervised learning unit is organized. First, based on the prototype radius registered in step S302, positive sample pairs are paired within the prototype neighborhood of the same class, and negative sample pairs are randomly paired across prototype neighborhoods. A weight reduction label is added to boundary samples. These sample pairs, along with the contrastive loss rule, are input into the self-supervised learning unit to obtain the learning dataset for optimization. To avoid gradient bias caused by class imbalance, class frequency weights are registered for each sample pair and bound to a batch identifier for easy weight normalization later.

[0078] Based on the learning dataset, the similarity between samples is calculated and a metric space embedding is constructed.

[0079] This embodiment introduces a combined target to guide the convergence direction of similarity and boundary margins: E = m·G + n·S k·L.

[0080] In the formula, E represents the optimization amount in the self-supervised stage, G is the positive sample pair aggregation term, S is the negative sample pair separation term, and L is the class frequency regularization term; m, n, and k are non-negative weights, fixed within the current parameter set version. G increases the proximity of samples of the same class in the embedding space, S expands the cross-class minimum margin, and L suppresses the dominance effect of high-frequency classes. The optimized converged embeddings are fixed, and the similarity between any two samples is calculated accordingly, resulting in similarity values ​​with sample indices as rows and columns.

[0081] Based on the aforementioned similarity values, the output is matrixed to form a fake similarity matrix. The diagonal blocks of the matrix are rearranged according to category prototypes, and weight reduction is applied to boundary samples. Off-diagonal blocks retain the minimum dissimilarity statistic for stability analysis. The matrix also records the source batch and training dataset version number, ensuring that subsequent consistency evaluations can be traced back to the specific training window.

[0082] Based on the forged similarity matrix, an intra-cluster consistency score is calculated. Specifically, diagonal sub-blocks are extracted for each type of cluster, and two indicators, average similarity and boundary perturbation rate, are calculated. The minimum dissimilarity between adjacent clusters forms a separating reference, which is then used to synthesize the type clustering score. To maintain the same metric as the detection parameter set, the prototype radius is read during the scoring stage for weight correction of boundary samples, making the score robust to small distribution drifts.

[0083] After the type clustering score is available, an anti-spoofing feature vector is generated. This vector, granular at the type cluster level, includes four fields: type score, boundary perturbation rate, prototype short-term drift magnitude, and batch weight. The prototype short-term drift magnitude is derived from the prototype difference between two adjacent training windows and is mapped one-to-one with the row and column indices of the similarity matrix. The anti-spoofing feature vector serves as direct input to subsequent optimization steps and carries the version identifier of the learning dataset in the record to maintain read / write consistency.

[0084] Based on the anti-counterfeiting feature vector, a multi-objective optimization function is invoked to complete the preliminary preparations for rule solving. The optimization end reads the type score as the accuracy dimension input, the boundary perturbation rate and batch weight as the cost and stability dimensions input, and loads the prototype short-term drift amplitude as an auxiliary condition for triggering splitting. Through this organization, subsequent steps can comprehensively balance accuracy and computational cost within a unified parameter space.

[0085] Finally, the forged similarity matrix and anti-forgery feature vector are synchronously registered in the inference-side cache and exposed to the rule solving and label generation interface in the latter half of step S102. The score will be mapped to the weights of the category partitioning strategy, the boundary perturbation rate will be incorporated into the threshold tightening logic, and the matrix version number will be used to constrain the effective range of dynamic adjustments, thereby ensuring that the self-supervised learning product is consistently referenced in subsequent category adjustments and label updates.

[0086] In one embodiment of the forgery detection method for multi-task training and dynamic decision-making in this application, it may further include the following: Step S501: Perform dimension mapping on the anti-counterfeiting state vector to generate an optimization target set, construct a constraint condition matrix based on the optimization target set, set the detection accuracy and computational cost as the optimization dimensions, configure the parameters of the constraint condition matrix, generate an objective function family based on the parameter configuration, input the objective function family into the optimization solver, and generate rule basic data containing the optimal solution and weight coefficients; Step S502: Based on the rule-based data, a dynamic adjustment mechanism is constructed, the optimal solution is mapped to a detection rule template, a category division strategy is generated according to the weight coefficients, the detection rule template is updated online, a category adjustment decision tree is established, and the category adjustment decision tree is used in the label generation process to generate anti-counterfeiting label data containing detection thresholds and category mappings.

[0087] First, the anti-counterfeiting feature vectors generated in steps S401 to S402 are read and aligned in terms of version number and time window dimensions. The aligned anti-counterfeiting feature vectors contain four types of fields: type score, boundary perturbation rate, prototype short-term drift amplitude, and batch weight. Based on these fields, normalization and scale alignment are performed, mapping the type score to the accuracy dimension input, jointly mapping the boundary perturbation rate and batch weight to the cost dimension input, and using the prototype short-term drift amplitude as a stability auxiliary quantity. These are then assembled into an optimization objective set, providing a unified entry point for subsequent constraints and solutions.

[0088] Based on the optimization objective set, a constraint matrix is ​​constructed. The matrix is ​​organized by type clusters as rows and constraint terms as columns. Constraint terms include the minimum support lower bound, the upper bound of the boundary perturbation rate, and the prototype drift threshold. To maintain traceability, a one-to-one mapping is established between constraint entries and type cluster identifiers, and the source window and similarity matrix version number are recorded. Subsequently, the constraint matrix is ​​parameterized, covering constraint priority, relaxation order, and batch weight participation methods, forming a structured input that can be directly read by the optimization solver.

[0089] After the parameters are configured, a family of objective functions is generated, and a joint objective is given for solving the sorting problem: Y = y1·Y2 + y2·Y3 y3·Y1.

[0090] In the formula, Y represents the joint objective; Y2 is the accuracy-related term, with input from the aggregate statistics of type scores; Y3 is the cost-related term, with input from the combination of boundary perturbation rate and batch weight; Y1 is the stability regularization term, with input from the prototype's short-term drift amplitude; y1, y2, and y3 are non-negative weights, fixed within the current optimization session. Y2 promotes the priority retention of high-scoring type clusters, Y3 restricts the expansion of high-cost type clusters, and Y1 suppresses over-adjustment under severe drift conditions.

[0091] Once the objective function family and constraint matrix are ready, they are input into the optimization solver. Under the premise of satisfying the minimum support and the upper limit of the boundary perturbation rate, the solver searches based on the magnitude of Y and outputs the optimal solution and a corresponding set of weight coefficients. The optimal solution provides suggestions for retention, merging, and splitting at the type cluster level, while the weight coefficients provide the threshold tightening or loosening range at the constraint term level. The two are merged to form the rule base data, inheriting the similarity matrix version and time window identifier, serving as the upstream input for dynamic adjustment.

[0092] Based on the aforementioned rule-based data, a dynamic adjustment mechanism is constructed. The mechanism first maps the optimal solution to a detection rule template, which includes three components: type cluster operation instructions, initial threshold interval values, and the order of effectiveness. Then, it generates a category partitioning strategy based on weight coefficients, calculates the merging objects, split boundaries, and threshold correction magnitude for each type cluster, and establishes a reference relationship between the operation results and the prototype vector to maintain the inheritance chain for subsequent tracing. This mapping maintains a fixed version within the same session, avoiding cross-window drift.

[0093] Once the detection rule template is ready, an online update is performed. The online update uses a sliding window to read the latest batch of anti-counterfeiting feature vectors, compares the initial threshold range in the template with the boundary perturbation rate and prototype drift amplitude of the current batch, and triggers fine-tuning logic. Fine-tuning is only performed within the range indicated by the weight coefficients and is subject to priority constraints, without exceeding the minimum support and boundary limits. After the update is complete, a new version of the template is output, and the reasons for the changes and the scope of impact are recorded for subsequent verification.

[0094] Based on the new version of the template, a category adjustment decision tree is established. Decision tree nodes correspond to the type cluster state, branches correspond to three types of operations: merge, split, and retain, and leaf nodes record the final category mapping and threshold range. To maintain consistency with upstream data, the decision tree stores prototype vector references and source window identifiers at the node level, and uses batch weights as the order factor for branch selection to ensure execution stability under high load conditions.

[0095] Based on the category adjustment decision tree, anti-counterfeiting label data is generated. The generation process encodes the category mappings and threshold intervals in the leaf nodes into label entries, aligning them with the regional feature sequence indexes registered in step S101, forming anti-counterfeiting label data containing detection thresholds and category mappings. Simultaneously, it includes a snapshot of the weight coefficients and the version number of the rule base data, enabling subsequent type determination and local clustering to reproduce the experimental conditions.

[0096] Finally, the anti-counterfeiting label data is registered in the inference-side cache for step S103 to read for distance distribution calculation and type determination; the textual operation instructions and threshold ranges are also referenced by the dynamic adjustment trigger conditions in step S102 for evaluating the adjustment effect in the next window. Through the above connection, steps S501 and S502 complete the continuous processing from target construction and solution to rule implementation and label release under a unified index.

[0097] In one embodiment of the forgery detection method for multi-task training and dynamic decision-making in this application, it may further include the following: Step S601: Standardize the image to be detected to generate an input data stream, extract multi-scale feature maps from the input data stream, perform feature matching between the feature maps and the anti-counterfeiting label set, calculate the distance vector based on the feature matching result, establish a probability distribution model based on the distance vector, use the probability distribution model for similarity calculation, and generate feature mapping data containing distance metric and distribution parameters. Step S602: Construct type determination rules based on the feature mapping data, divide the distance metric into intervals according to a preset threshold, generate a discrimination strategy according to the distribution parameters, evaluate the confidence of the discrimination strategy, establish a multi-level determination model, use the multi-level determination model in the type recognition process, and generate detection result data containing forgery type and matching probability.

[0098] First, after receiving the image to be detected, standardized preprocessing is performed, including size resampling, color space unification, and face region cropping. Overexposed and out-of-focus samples are then removed based on illumination and sharpness thresholds, resulting in the input data stream. To ensure consistency with the anti-counterfeiting label data released in steps S501 to S502, the label version and threshold range are loaded for the current session, and the time window and source batch are marked on the input data stream as retrieval keys for subsequent feature matching.

[0099] Based on the input data stream, a multi-scale feature map is extracted. Specifically, an image pyramid is constructed and the shared layer of a multi-task pre-trained feature extractor is invoked to output a multi-scale response containing texture and geometric channels. To maintain frequency domain consistency, the window function attenuation coefficients formed in steps S201 to S202 are read synchronously, and amplitude correction is performed on the high-frequency channels to obtain the corrected multi-scale feature map. The scale level and spatial location are then encoded and backfilled into the map index.

[0100] Based on the multi-scale feature map, feature matching is performed. The map is channel-aligned and normalized according to the category prototypes in the label version, and the matching components between local regions and each prototype are calculated and aggregated into feature matching results. This result is multiplied item by item by the discriminative weights in the label entries and then summed to obtain the response scalar for each category prototype, while retaining the boundary deweighting markers as a direct pre-processing step for distance metric calculation.

[0101] Based on the feature matching results, a distance vector is calculated. The distance term consists of two parts: the prototype center distance and the boundary penalty, with a scale inconsistency penalty added to form a distance vector arranged according to category encoding. To facilitate subsequent probabilistic processing, the distance is monotonically mapped and normalized to a fixed interval, while the original values ​​before mapping are recorded for backtracking verification.

[0102] Based on the distance vector, a probability distribution model is established. To provide a unique solution expression, a joint scoring formula is defined: Z = z1·Z2 + z2·Z1 z3·Z3.

[0103] In the formula, Z represents the category-level score; Z2 is the weighted sum of normalized distances, corresponding to the distance contribution of each prototype; Z1 is the combination of prior and sample confidence, used to reflect the basic frequency of the category and image quality; Z3 is the boundary and scale penalty term, used to suppress excessively high scores for edge samples; z1, z2, and z3 are non-negative weights, fixed within the current decision session. The category posterior is generated jointly by Z and the distribution parameters, forming feature mapping data containing distance metrics and distribution parameters.

[0104] Based on the feature mapping data, type determination rules are constructed. First, the distance metric is divided into intervals according to the threshold range in the anti-counterfeiting label data to obtain a candidate set. Then, the candidate set is re-sorted according to the distribution parameters, and categories with obvious boundary conflicts are screened out. The relative difference between candidates is calculated as a confidence reference. To ensure consistency with the upstream optimization criteria, the weight coefficient snapshot generated in step S501 is loaded at this stage, and categories with high overhead risk are subject to order reduction.

[0105] After the decision rules are finalized, confidence assessment is completed and a multi-level decision model is established. The first level filters high-confidence candidates using a threshold of Z; the second level performs cross-validation using the class posterior and the difference between adjacent classes; the third level applies amplification factors of boundary and scale penalties to the remaining candidates for final confirmation. The output of the multi-level model is a single-class or "unknown" label, along with matching probability and conflict reason labels, facilitating subsequent local clustering and online optimization.

[0106] Based on the multi-level judgment model, detection result data is generated. For samples judged to be of a known category, the forgery type and matching probability are output, and the label version used, weight coefficient snapshot, and time window are backfilled. For samples judged to be unknown, the distance vector and distribution parameter snapshot are retained as input clues for local clustering. The detection result data maintains the same index as the source batch of the input data stream to ensure that it can be restored by session when called across modules.

[0107] After the detection result data is generated, the connection with upstream and downstream processes is completed. The feature mapping data is directly read by the distance distribution verification interface in step S103 for secondary verification; the snapshot of unknown samples is referenced by the local clustering module in step S103 to generate new anti-counterfeiting labels; and the matching records of known categories are backfilled to the statistics side to update the category prior and the initialization of the distribution parameters of subsequent windows. Through this organization, steps S601 and S602 complete continuous processing from preprocessing, matching, probabilization to type determination under the same label version and index system.

[0108] In one embodiment of the forgery detection method for multi-task training and dynamic decision-making in this application, it may further include the following: Step S701: Filter the matching results to generate an unknown sample set, extract local feature descriptors based on the unknown sample set, group similar samples into clusters according to preset rules, calculate cluster feature vectors for the grouping and clustering results, establish a new type representation model based on the cluster feature vectors, use the new type representation model for label generation, and generate new label data containing type encoding and feature prototypes. Step S702: Construct a reinforcement learning environment based on the newly added label data, map the type encoding to state space parameters, generate reward calculation rules according to the feature prototype, train the reward calculation rules online, establish a feature optimization model, use the feature optimization model to update the extractor, and generate an output dataset containing detection conclusions and source information.

[0109] First, the detection result data output from steps S601 to S602 is read, and records marked as unknown are filtered out and aggregated according to time window and source batch to generate an unknown sample set. To ensure consistency with the upstream metric space, the multi-scale feature map and distance vector corresponding to the unknown sample set are loaded together, and out-of-focus and severely compressed samples are marked with low confidence labels for subsequent weight reduction processing during clustering.

[0110] Based on the unknown sample set, local feature descriptors are extracted. Specifically, according to the scale level and location identifier recorded in step S201, region blocks are sampled from the stable region of the image pyramid. Three components—intensity distribution, orientation histogram, and frequency domain phase—are calculated, and the window function attenuation coefficient retained in step S202 are superimposed to form a descriptor vector. A one-to-one mapping is established between the descriptor and the distance vector and distribution parameter snapshot of the unknown sample, serving as the input features for grouping and clustering.

[0111] After the input features are ready, group clustering is performed. Before clustering, coarse segmentation is performed using the principal components of the distance vector, and then density clustering is performed on the local feature descriptors within each segment to obtain several candidate groups. For each group, a cluster feature vector is calculated, which consists of three parts: the descriptor mean, the centroid of the frequency band weights, and the proportion of boundary samples. To stabilize small sample clusters, low-confidence labeled samples are included in the statistics with reduced weights to avoid cluster drift due to a few anomalies.

[0112] Based on the cluster feature vectors, a new type representation model is established. This model uses the mean of the cluster feature vectors as the feature prototype, records the centroid of frequency band weights as type preference, and provides an initial estimate of the prototype radius based on the proportion of boundary samples.

[0113] Based on the cluster feature vectors, a new type representation model is established. To provide a prototype selection metric, a scoring formula is defined: W = w1·W1 + w2·W2 w3·W3.

[0114] In the formula, W represents the prototype score; W1 is the intra-cluster consistency term, whose input source is the combination of the descriptor mean and variance; W2 is the frequency band stability term, whose input source is the stability of the frequency band weight centroid within adjacent windows; W3 is the boundary penalty term, whose input source is the proportion of boundary samples; w1, w2, and w3 are non-negative weights, fixed within the current window. New type prototypes that pass the threshold condition are selected based on the ranking of W.

[0115] After the new type representation model is ready, label generation is completed. New type codes are assigned to the selected prototypes, and an inheritance chain relationship is established with the historical category mapping table. Each prototype is assigned an initial radius value and a discrimination weight, forming new label data. The new labels share a version index with the anti-counterfeiting label data released in step S501, and the source window is recorded for subsequent backtracking and merging judgment.

[0116] Based on the newly added label data, a reinforcement learning environment is constructed. The environment maps type encoding to state-space parameters, where each state includes the current prototype index, radius estimate, and discriminant weights. The action set consists of three components: shared layer fine-tuning step size, channel coefficient fine-tuning, and high-frequency suppression switching. Transitions are driven by changes in sample affiliation between old and new prototypes. The reward calculation rule uses the improvement in cluster consistency of the new prototype as a positive term, the expansion of the minimum margin with neighboring known prototypes as a positive term, and the reversal of misclassification into historical categories as a penalty term. The weights of the rules are read from the discriminant field in the newly added label data.

[0117] After the reward calculation rules are determined, online training is performed to build a feature optimization model. During training, new unknown samples and their neighboring known samples are sampled using a sliding window. The small-step parameters of the shared layer are updated every round, and the threshold table of the type recognition branch is locked to prevent drift of the known category boundary. At the end of each round, the feature optimization model writes back the latest channel coefficients and suppression switch states, and records the fluctuation amplitude of the reward curve as an auxiliary quantity for convergence criteria.

[0118] Once the feature optimization model is ready, it is used to update the feature extractor and perform rapid re-evaluation. The re-evaluation uses the prototype of the newly labeled data as a benchmark, recalculating the distance vector and posterior probability of unknown samples. Samples that achieve stable assignment have their type encoding fixed, while samples that remain unstable retain unknown labels and are postponed to the next window. The updated parameters and label versions are registered together to ensure that the inference side maintains the same standard for recognizing new types and defining the boundaries of old types.

[0119] Finally, an output dataset is generated based on the stable records. The output dataset contains the authenticity detection results and forgery tracing information. The tracing information is derived by tracing back the inheritance chain from the type encoding to the historical cluster centers and corresponding forgery algorithm mappings. The dataset carries the newly added label version, optimization round number, and window identifier, which are used by the upstream statistical side to update the category prior and reference the online optimization records in step S103, thus achieving a closed loop of new type introduction, feature adaptation, and tracing.

[0120] To effectively address the shortcomings of traditional technologies in feature analysis, rule generation, and dynamic updating, and to provide technical support for forgery detection, this application provides an embodiment of a forgery detection apparatus for implementing all or part of the aforementioned multi-task training and dynamic decision-making forgery detection method. See [link to embodiment]. Figure 2 The forgery detection device for multi-task training and dynamic decision-making specifically includes the following components: The feature construction module 10 is used to acquire the face image data to be detected, extract the forgery features using a deep convolutional network to generate a basic feature set, perform frequency domain analysis on the basic feature set to generate forgery trace vectors, establish a multi-task framework for authenticity determination and forgery type recognition, input the forgery trace vectors into an unsupervised clustering module to generate forgery type classification, construct anti-counterfeiting detection labels based on the forgery types, input the anti-counterfeiting detection labels into a transfer learning module to generate a detection parameter set containing forgery feature mapping and type recognition; Clustering calculation module 20 is used to extract features of counterfeit samples based on the detection parameter set, perform self-supervised learning on the features of counterfeit samples to generate a counterfeit similarity matrix, calculate type clustering scores based on the counterfeit similarity matrix, perform quantitative analysis on the feature consistency of each counterfeit type cluster to generate an anti-counterfeiting state vector, input the anti-counterfeiting state vector into a multi-objective optimization function, generate a counterfeit identification rule base based on the multi-objective optimization function, and dynamically adjust the detection categories to generate an anti-counterfeiting label set based on the counterfeit identification rule base. The anti-counterfeiting detection module 30 is used to receive the input image to be detected, extract feature vectors based on the anti-counterfeiting label set to generate a distance distribution, determine the counterfeiting type based on the distance distribution to generate a matching result, input the unknown counterfeiting type in the matching result into the local clustering module to generate a new anti-counterfeiting label, construct a detection reward function based on the new anti-counterfeiting label, use the detection reward function for online optimization of the feature extractor, and output detection data containing authenticity determination and counterfeiting traceability.

[0121] As described above, the forgery detection device with multi-task training and dynamic decision-making provided in this application can effectively construct detection methods through a multi-task framework and transfer learning. It constructs a learning optimization mechanism, combining self-supervised analysis and rule generation to establish a reliable identification strategy. Dynamic updates are introduced, and through unknown type handling and online optimization, continuous improvement of detection is ensured. This method effectively solves the shortcomings of traditional technologies in feature analysis, rule generation, and dynamic updates, providing technical support for forgery detection.

[0122] This invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor performs the forgery detection method of multi-task training and dynamic decision-making.

[0123] This invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the aforementioned forgery detection method for multi-task training and dynamic decision-making.

[0124] This invention also provides a computer program product, which includes a computer program that, when executed by a processor, implements the aforementioned forgery detection method for multi-task training and dynamic decision-making.

[0125] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0126] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0127] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0128] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0129] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A forgery detection method based on multi-task training and dynamic decision-making, characterized in that, The method includes: Acquire face image data to be detected, use a deep convolutional network to extract forgery features to generate a basic feature set, perform frequency domain analysis on the basic feature set to generate forgery trace vectors, establish a multi-task framework for authenticity determination and forgery type identification, input the forgery trace vectors into an unsupervised clustering module to generate forgery type classification, construct anti-counterfeiting detection labels based on the forgery types, input the anti-counterfeiting detection labels into a transfer learning module to generate a detection parameter set containing forgery feature mapping and type identification; Based on the detection parameter set, forged sample features are extracted, and self-supervised learning is performed on the forged sample features to generate a forged similarity matrix. Based on the forged similarity matrix, type clustering scores are calculated, and feature consistency of each forged type cluster is quantitatively analyzed to generate an anti-counterfeiting state vector. The anti-counterfeiting state vector is input into a multi-objective optimization function, and a forged identification rule base is generated based on the multi-objective optimization function. Based on the forged identification rule base, the detection categories are dynamically adjusted to generate an anti-counterfeiting label set. The system receives an input image to be detected, extracts feature vectors from the anti-counterfeiting label set to generate a distance distribution, determines the counterfeiting type based on the distance distribution to generate a matching result, inputs unknown counterfeiting types from the matching result into a local clustering module to generate new anti-counterfeiting labels, constructs a detection reward function based on the new anti-counterfeiting labels, uses the detection reward function for online optimization of the feature extractor, and outputs detection data containing authenticity determination and counterfeiting source tracing.

2. The forgery detection method for multi-task training and dynamic decision-making according to claim 1, characterized in that, The process involves acquiring the face image data to be detected, using a deep convolutional network to extract forgery features to generate a basic feature set, performing frequency domain analysis on the basic feature set to generate forgery trace vectors, and establishing a multi-task framework for authenticity determination and forgery type identification, including: The input face image is preprocessed to generate standard image data. Texture feature point sequences are extracted from the standard image data. An image pyramid is constructed according to a preset resolution. Local region descriptors are extracted based on the image pyramid. The local region descriptors are input into a deep convolutional network. A region feature map is generated by sliding scan. A feature dataset containing feature tensors and location identifiers is constructed based on the region feature map. Frequency domain transformation is performed based on the feature dataset. The feature tensor is segmented by frequency to generate frequency domain parameters. The frequency domain parameters are grouped by region according to the location identifier. A detection template is established based on the region grouping. The detection template is used for frequency domain response calculation. A region feature sequence is constructed based on the frequency domain response. The region feature sequence is combined into an image feature vector.

3. The forgery detection method for multi-task training and dynamic decision-making according to claim 1, characterized in that, The process involves inputting the forgery trace vector into an unsupervised clustering module to generate forgery type classifications, constructing anti-counterfeiting detection labels based on the forgery types, and inputting the anti-counterfeiting detection labels into a transfer learning module to generate a detection parameter set containing forgery feature mappings and type recognition, including: The forgery trace vector is normalized to generate standardized features. The distance matrix between samples is calculated based on the standardized features. A similarity map is constructed based on the distance matrix. The similarity map is input into the spectral clustering module. A clustering feature space is generated through eigenvalue decomposition. A sample mapping relationship is established based on the clustering feature space to generate forgery type data containing cluster centers and category identifiers. Based on the forgery type data, transfer training rules are constructed, the cluster center is used as the prototype representation of the forgery type, anti-counterfeiting detection indicators are generated according to the category identifier, the anti-counterfeiting detection indicators are parameter mapped, a detection model training set is established, and the training set is used for the transfer learning process to generate model parameters that include feature extraction and type recognition.

4. The forgery detection method for multi-task training and dynamic decision-making according to claim 1, characterized in that, The process involves extracting features of counterfeit samples based on the detection parameter set, performing self-supervised learning on the counterfeit sample features to generate a counterfeit similarity matrix, calculating type clustering scores based on the counterfeit similarity matrix, and quantitatively analyzing the feature consistency of each counterfeit type cluster to generate an anti-counterfeiting state vector, including: The detection parameter set is parsed to obtain feature extraction rules. A sample processing flow is constructed according to the feature extraction rules. The input samples are grouped according to a preset batch. Local features are extracted from the grouped samples. A feature vector sequence is generated according to the local features. The feature vector sequence is input into a self-supervised learning unit to generate a learning dataset containing positive and negative sample pairs and contrast loss. The similarity between samples is calculated based on the learning dataset. The positive and negative sample pairs are mapped to the metric space. A similarity calculation model is constructed based on the contrast loss. The output of the similarity calculation model is matrixed. The intra-cluster consistency score is calculated based on the matrixing result. An anti-counterfeiting feature vector containing type score and state index is generated.

5. The forgery detection method for multi-task training and dynamic decision-making according to claim 1, characterized in that, The step of inputting the anti-counterfeiting state vector into a multi-objective optimization function, generating a counterfeiting identification rule base based on the multi-objective optimization function, and dynamically adjusting the detection categories according to the counterfeiting identification rule base to generate an anti-counterfeiting label set includes: An optimization target set is generated by dimensional mapping of the anti-counterfeiting state vector. A constraint condition matrix is ​​constructed based on the optimization target set. The detection accuracy and computational cost are set as the optimization dimensions. The constraint condition matrix is ​​parameterized. An objective function family is generated based on the parameter configuration. The objective function family is input into an optimization solver to generate rule-based data containing the optimal solution and weight coefficients. A dynamic adjustment mechanism is constructed based on the rule-based data. The optimal solution is mapped to a detection rule template. A category division strategy is generated according to the weight coefficients. The detection rule template is updated online. A category adjustment decision tree is established. The category adjustment decision tree is used in the label generation process to generate anti-counterfeiting label data containing detection thresholds and category mappings.

6. The forgery detection method for multi-task training and dynamic decision-making according to claim 1, characterized in that, The received input image to be detected, based on the anti-counterfeiting label set, extracts feature vectors to generate a distance distribution, and determines the counterfeiting type based on the distance distribution to generate a matching result, including: The image to be detected is standardized and preprocessed to generate an input data stream. Multi-scale feature maps are extracted from the input data stream. The feature maps are matched with anti-counterfeiting label sets. A distance vector is calculated on the feature matching results. A probability distribution model is established based on the distance vector. The probability distribution model is used for similarity calculation to generate feature mapping data containing distance metrics and distribution parameters. Based on the feature mapping data, a type determination rule is constructed, the distance metric is divided into intervals according to a preset threshold, a discrimination strategy is generated according to the distribution parameters, the confidence of the discrimination strategy is evaluated, a multi-level determination model is established, the multi-level determination model is used in the type recognition process, and detection result data containing forgery type and matching probability is generated.

7. The forgery detection method for multi-task training and dynamic decision-making according to claim 1, characterized in that, The process involves inputting the unknown forgery type from the matching results into a local clustering module to generate new anti-counterfeiting labels, constructing a detection reward function based on these labels, using the detection reward function for online optimization of the feature extractor, and outputting detection data containing authenticity determination and forgery tracing, including: The matching results are filtered to generate an unknown sample set. Local feature descriptors are extracted from the unknown sample set. Similar samples are grouped and clustered according to preset rules. Cluster feature vectors are calculated for the grouping and clustering results. A new type representation model is established based on the cluster feature vectors. The new type representation model is used for label generation to generate new label data containing type encoding and feature prototype. A reinforcement learning environment is constructed based on the newly added label data. The type encoding is mapped to state space parameters. A reward calculation rule is generated according to the feature prototype. The reward calculation rule is trained online to establish a feature optimization model. The feature optimization model is used to update the extractor and generate an output dataset containing detection conclusions and source information.

8. A forgery detection device for multi-task training and dynamic decision-making, characterized in that, The device includes: The feature construction module is used to acquire the face image data to be detected, extract the forgery features using a deep convolutional network to generate a basic feature set, perform frequency domain analysis on the basic feature set to generate forgery trace vectors, establish a multi-task framework for authenticity determination and forgery type recognition, input the forgery trace vectors into an unsupervised clustering module to generate forgery type classification, construct anti-counterfeiting detection labels based on the forgery types, input the anti-counterfeiting detection labels into a transfer learning module to generate a detection parameter set containing forgery feature mapping and type recognition; The clustering calculation module is used to extract features of counterfeit samples based on the detection parameter set, perform self-supervised learning on the features of the counterfeit samples to generate a counterfeit similarity matrix, calculate type clustering scores based on the counterfeit similarity matrix, perform quantitative analysis on the feature consistency of each counterfeit type cluster to generate an anti-counterfeiting state vector, input the anti-counterfeiting state vector into a multi-objective optimization function, generate a counterfeit identification rule base based on the multi-objective optimization function, and dynamically adjust the detection categories to generate an anti-counterfeiting label set based on the counterfeit identification rule base. The anti-counterfeiting detection module is used to receive the input image to be detected, extract feature vectors from the anti-counterfeiting label set to generate a distance distribution, determine the counterfeiting type based on the distance distribution to generate a matching result, input the unknown counterfeiting type in the matching result into the local clustering module to generate a new anti-counterfeiting label, construct a detection reward function based on the new anti-counterfeiting label, use the detection reward function for online optimization of the feature extractor, and output detection data containing authenticity determination and counterfeiting traceability.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the forgery detection method of multi-task training and dynamic decision-making as described in any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the steps of the forgery detection method of multi-task training and dynamic decision-making as described in any one of claims 1 to 7.