Counterfeit face image detection method based on extrusion constraint dynamic routing capsule network

By improving the capsule network, using generalized extrusion function and routing weight mapping technology, the intermediate capsules are compressed and optimized, solving the problem of poor detection of fake faces in the existing technology, and achieving higher detection accuracy and generalization capabilities.

CN119580361APending Publication Date: 2025-03-07HENAN UNIVERSITY OF TECHNOLOGY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411656800.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-19
Publication Date
2025-03-07

AI Technical Summary

Technical Problem

Existing capsule networks have poor detection results in forged face detection, making it difficult to generalize to new forged images and low-quality images.

Method used

Improved capsule networks optimize the learning of capsule representation by introducing a generalized extrusion function to compress intermediate capsules and map the main capsules using routing weights.

Benefits of technology

The accuracy and generalization ability of fake face detection are improved, and cross-domain face tampering can be more effectively detected at different compression levels.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119580361A_ABST
    Figure CN119580361A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of counterfeited face detection, and particularly relates to a counterfeited face image detection method based on an extrusion constraint dynamic routing capsule network. The method comprises the following steps: acquiring a to-be-detected face image and inputting the to-be-detected face image into a trained improved capsule network to obtain a forged face detection result; the improved capsule network is obtained by improving a traditional capsule network; the improvement comprises that the digital capsule layer uses a generalized extrusion function to compress an intermediate capsule, and the generalized extrusion function is to adjust a Squash extrusion function and add a hyper-parameter alpha so as to realize normalization of other degrees on the intermediate capsule to optimize learning of capsule characterization. According to the method, more attention is paid to distribution of the middle capsules, learning of capsule representation is optimized, excellent generalization ability is provided for counterfeited face attacks, counterfeited face detection precision is improved, and the method can be used for more generalized counterfeited face detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of forged face detection, and in particular relates to a forged face image detection method based on a squeeze-constrained dynamic routing capsule network. Background Art

[0002] In recent years, the accuracy of face recognition has been continuously improved, and face recognition technology is widely used in all aspects of life. However, the abuse of face recognition technology will also cause people to worry about personal privacy and security. For example, communities and companies force visitors to enter their face information and use face recognition as the only way to enter and exit; mobile applications force users to upload unnecessary face information; and hotels require secondary face authentication.

[0003] As deep learning technology in computer vision continues to improve, face-changing technology, which originally required a lot of resources, can be easily achieved through deep learning. Although this technology can help in video creation, commemorating friends and relatives, the harm caused by the leakage of personal information cannot be underestimated. The abuse of fake face technology may have an immeasurable impact on individuals, society and the country. Therefore, it is crucial to detect fake faces.

[0004] Most of the mainstream fake face detection methods are based on deep learning and can be divided into three categories: analyzing the visual difference of local or overall regions of real and fake faces (AVD-LO), studying the characteristics of generative adversarial network (GAN) technology (SC-GAN), and capturing the mixed boundary information of source and target images (CMB-ST). AVD-LO is the earliest and most commonly used method to study the problem of deep fake detection. It is achieved by improving the convolutional neural network (CNN) architecture, applying data augmentation and metric learning, considering feature inconsistency, and creating a new feature learning framework. SC-GAN appeared later. It introduced the concepts of GAN fingerprint and frequency artifacts, and considered the advantages of combining transformer features and convolution features for improvement, focusing on the characteristics of upsampling operations in GAN operations. CMB-ST is based on the observation that most existing face processing methods have a common step, which is to blur the mixed boundaries in fake face images. Compared with the first two methods, it reveals the difference information on the mixed boundaries, which is more suitable for forgery detection of facial identity replacement attributes in general unconstrained scenarios. Although these methods have made great progress in forged face detection, it is still a big challenge to obtain a general detection model to handle cross-domain face tampering with different compression levels.

[0005] Deepfake detection based on convolutional neural networks (CNNs) has achieved satisfactory performance in several specific attacks. However, simply applying CNNs fails to learn the important spatial correlations between simple and complex objects in images, and designing detection models that can generalize well to new types of forged images and low-quality images remains a big challenge.

[0006] The capsule network is a new type of neural network structure that aims to address some of the limitations of traditional convolutional neural networks. The core idea of ​​the capsule network is to represent features through vectors, rather than using scalars like traditional neurons, so as to better capture the spatial relationship and attributes of features. The capsule network uses a conventional dynamic routing algorithm to learn the final capsule. In the conventional dynamic routing algorithm, the Squash function is applied to the intermediate capsule (the main capsule or its combination) to obtain the final capsule for voting. The capsule is designed to normalize and train stability. The formula is as follows:

[0007]

[0008] In the formula, u i represents the input of the extrusion function (here, the intermediate capsule), f sq () represents the Squash function. The above formula shows that the intermediate capsule u i pass Normalize to unit vector, then pass the scalar Rescaling. If normalization is not used for the intermediate capsules, the final normalized distribution will have large intra-class variation (intra-class variation refers to the variation within the same individual, such as eliminating the difference in the face of the same individual caused by external factors such as expression, decorations, light sources, and viewing angles); if the conventional squeezing function is used for dynamic routing, the intermediate capsules may still maintain large inter-class variation (inter-class variation refers to the variation that should be amplified to distinguish individual differences, such as the difference in facial structure between different individuals), which will not be conducive to promoting the optimization of capsule forensics and ultimately lead to poor forged face detection results. Summary of the invention

[0009] The purpose of the present invention is to provide a forged face image detection method based on a squeeze-constrained dynamic routing capsule network, so as to solve the problem of poor detection effect caused by using the capsule network in the prior art for forged face detection.

[0010] In order to solve the above technical problems, the present invention provides a method for detecting forged face images based on a squeeze-constrained dynamic routing capsule network, the method comprising: obtaining a face image to be tested and inputting it into a trained improved capsule network to obtain a forged face detection result; the improved capsule network is obtained by improving a traditional capsule network; the improvement comprises that a digital capsule layer uses a generalized squeeze function to compress an intermediate capsule, and the generalized squeeze function is:

[0011]

[0012] In the formula, f Gsq is a generalized squeezing function, α is a hyperparameter greater than 0, u i is the input of the generalized squeezing function.

[0013] Furthermore, the improvement also includes that the digital capsule layer in the network uses the routing weight to map the main capsule in the following way: firstly the input main capsule is normalized using the generalized squeezing function, and then the normalized main capsule is mapped using the routing weight.

[0014] Furthermore, the intermediate capsule is an intermediate capsule with a non-zero deviation added.

[0015] Furthermore, the convolutional layers in the network are vgg19 or resnet18.

[0016] Furthermore, the architecture of the main capsule layer in the network is: the main capsule layer includes at least two main capsule units connected in sequence, and each main capsule unit is used to process its input in sequence through convolution, batch normalization, activation function, convolution, batch normalization, activation function, StatsNet, convolution, batch normalization, convolution, batch normalization, and View.

[0017] Furthermore, the loss function used in the process of training the improved capsule network is the cross entropy loss function.

[0018] Furthermore, the optimizer used in the process of training the improved capsule network is the Adam optimizer.

[0019] The present invention is an improved invention with the following beneficial effects: considering the impact of the current capsule network on the performance of forged face detection, the present invention improves the traditional capsule network, specifically adjusts the Squash squeezing function, and adds a hyperparameter α to achieve other degrees of normalization of the intermediate capsules to optimize the learning of capsule representation. This method pays more attention to the distribution of intermediate capsules, actively promotes the optimization of capsule forensics, provides excellent generalization capabilities for forged face attacks, improves the accuracy of forged face detection, and can be used for more generalized forged face detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1It is a framework diagram of the improved capsule network of the present invention;

[0021] Figure 2 It is a framework diagram of the squeeze constraint dynamic routing algorithm used by the digital capsule layer in the improved capsule network of the present invention;

[0022] Figure 3 It is a diagram of the implementation process of the overall parameter optimization algorithm of the squeeze-constrained dynamic routing capsule network of the present invention;

[0023] Figure 4 It is a diagram of the implementation process of the squeeze constraint dynamic routing algorithm used in the digital capsule layer in the improved capsule network of the present invention;

[0024] Figure 5 It is a heat map visualization result diagram of the present invention comparing the same face image and multiple forged face images thereof;

[0025] FIG6(a) and FIG6(b) are AUC test result diagrams when the convolutional layers of the present invention are set to vgg19 and resnet18 respectively;

[0026] Figure 7 It is a graph showing the effects of different degrees of standardization on the intermediate capsule of the present invention. DETAILED DESCRIPTION

[0027] The core concept of the present invention is to improve the squeezing function used in the traditional capsule network, and use a new squeezing function, specifically a generalized squeezing function, which adds a hyperparameter α compared to the squash squeezing function. This method pays more attention to the distribution of intermediate capsules, optimizes the learning of capsule representation, and improves the accuracy of forged face detection. In order to make the purpose, technical solution and advantages of the present invention clearer, the present invention is further described in detail below with reference to the accompanying drawings.

[0028] The present invention improves the traditional capsule network to obtain an improved capsule network, and uses the trained improved capsule network to perform forged face detection. The whole process is introduced in detail below.

[0029] Step 1: Build an improved capsule network.

[0030] Improve the structure of capsule network such as Figure 1 As shown in the figure, like the traditional capsule network, it also contains convolutional layers, main capsule layers and digital capsule layers. Figure 1The upper and lower parts of the figure are introductions to the training and testing parts respectively. Take the upper part as an example, in which the Capsule-Forensics network is the capsule network (essentially the improved capsule network mentioned in this embodiment), the convolutional layer is the CNN model in the figure, which is mainly used to extract features from the input data (i.e., the feature extractor in the figure); the primary capsule layer is the Capsule layer in the figure, and its input is the output of the convolutional layer. The main capsule extracted by the main capsule layer is the primary capsules in the figure; the rest of the content in the figure is the digital capsule layer, and its input is the output of the main capsule layer. It is iteratively updated through a dynamic routing algorithm (including the Routing layer in the figure), and finally outputs the prediction result, i.e., the Face forgery detection in the figure.

[0031] In this embodiment, the convolutional layer uses pre-trained vgg19 or resnet18 for feature extraction, and its network structure is shown in the first column of CNN in Table 1 and the first column of CNN in Table 2, respectively. cnn is a CNN (vgg19 or resnet18) mapping with parameter φ0, whose output can be expressed as f cnn (x,φ0), x represents its input.

[0032] The main capsule layer is Figure 3 The algorithm shown is used to learn the parameters (θ, W), where W is the dynamic routing weight. Specifically, a capsule mapping f with parameters θ is used cap To obtain the main capsule (also called primary capsule), the main capsule is expressed as f cap is a capsule map with parameters θ, is the output vector of the main capsule layer, k represents the dimension of the main capsule, N u Indicates the number of primary capsules. When the feature extraction modules are vgg19 and resnet18, the network architectures of the corresponding primary capsule layers are shown in the second column Capsule of Table 1 and the second column Capsule of Table 2 (in fact, the second columns of Table 1 and Table 2 are consistent). Conv in Tables 1 and 2 both represent convolution, maxpool represents maximum pooling, BatchNorm represents batch normalization, ReLU represents activation function, StatsNet is the abbreviation of Statistical poolinglayer, which means statistical pooling layer, and View represents a function in Pytorch, which is mainly used to modify the dimension of tensor tensor.

[0033] Table 1 The architecture of the main capsule layer when the convolutional layer is vgg19

[0034]

[0035] Table 2 The architecture of the main capsule layer when the convolutional layer is resnet18

[0036]

[0037] The commonly used squeezing function in the dynamic routing algorithm used by the digital capsule layer is the Squash squeezing function. i pass Normalize to unit vector, then pass the scalar Rescale. Assume The scalar design of is not the only option and may not be the best choice for learning the final capsule. In fact, the distribution of intermediate capsules is greatly affected when the scalar is changed. To make it easier to understand, Figure 7 Four different levels of normalized distribution are shown in . Figure 7 As can be seen in Figure 2, different levels of normalization lead to different levels of discriminability. If no normalization is used for the intermediate capsules, the distribution will have large intra-class variation; if only the conventional squeezing function is used for dynamic routing, the intermediate capsules may still maintain large inter-class variation. On the other hand, if the normalization of the intermediate capsules is restricted, the distribution of the learned capsules will have different degrees of discrimination and a distribution more suitable for the agreement vote will be obtained, which will actively promote the optimization of capsule forensics. The above assumptions motivate the proposal of a dynamic routing algorithm that is more suitable for the general capsule representation.

[0038] The implementation framework of the dynamic routing algorithm used by the digital capsule layer in this embodiment is as follows: Figure 2 The specific process is as shown in Figure 4 As shown, it is a method using the generalized squeezing function f Gsq The proposed Squeezed Dynamics Constrained Dynamic Routing algorithm (SCDR), which pays more attention to the distribution of intermediate capsules, aims to optimize the learning of capsule representation for more generalized fake face detection. Figure 2 The primary capsules in are the primary capsules output by the primary capsule layer, First, we use the generalized squeezing function f Gsq To normalize the main capsule, the normalized result is Figure 2 The normalization results in the above example are then used to calculate the routing weights. ( Figure 2 The routing weight for spatial transforms in is used to map the normalized primary capsule for spatial transformation. This process is done by Figure 4 u in formula (11) i =wi f Gsq (u i ) to obtain Figure 2 The primary capsules for routing are shown in the green box without background. Figure 4 In formula (11), rand() represents a random function, size() represents the size, and dropout() is a technique to prevent overfitting of neural networks. Then, u obtained from formula (11) is i Processing to obtain intermediate capsule To alleviate the problem of non-universal approximation, a non-zero bias b is added to the intermediate capsules, and the generalized squeezing function f is used again Gsq To achieve compression, the advanced capsules are updated with routing coefficients through iterative calculation. The whole process is as follows Figure 4 As shown in "2" and "3" in the figure. Figure 4 The rest of the content belongs to the prior art and will not be repeated here. Overall, the main capsule u learns different features of the same input and merges them into the final capsule It is defined by the SCDR as follows:

[0039] v = SCDR (f Gsq ,u,W,r)

[0040] In the formula, is the output vector of the capsule, l is the dimension of the output capsule, N v is the number of output capsules, is the routing matrix used to route u to all capsules, and r represents the number of routing iterations.

[0041] Accordingly, the generalized squeezing function f used in the present invention is Gsq for:

[0042]

[0043] Where α is a hyperparameter with a value range of 0 to positive infinity, providing different levels of constraints for the normalization of intermediate capsules (primary capsules or their combinations), which can be rewritten as:

[0044]

[0045] S in the formula n () and S f () respectively correspond to The normalization and u i Normalization of .

[0046] Step 2: Obtain an image dataset, where each image in the image dataset has a corresponding forged face result label; randomly divide the image set into a training set ( Figure 1 The improved capsule network built in step 1 is trained and tested accordingly ( Figure 1 in the Testing set).

[0047] During the training process, the cross entropy loss function is used and the optimization objective is:

[0048]

[0049] in, is the y predicted probability vector, is the output capsule v j The kth element of , X represents the training data, and Y represents the training label.

[0050] Moreover, Adam optimization is used for training, and the learning rate is set to 0.0005, and β1 and β2 are set to 0.9 and 0.999 respectively. The number of primary capsules is set to 10, and the number of final output capsules is set to 2, that is, N u =10, N v =2; the size of the main capsule is set to 8, and the size of the output capsule is set to 4, i.e., k=8, l=4; the number of routing iterations r is set to 2; and the number of epochs T is set to 25. All models used in the following experiments are trained with a mini-batch size of 16, where 16 is the batchsize, which refers to the parameter value of the batch size. These hyperparameters are fixed for all experiments.

[0051] Step three, obtain the face image to be tested and input it into the improved capsule network after the final training in step two to obtain the forged face detection result.

[0052] So far, the implementation process of the whole method has been introduced. The method of the present invention is applied to the challenging CelebDF, FF++ (c23) and FF++ (c40) datasets to demonstrate the effectiveness of the SCRD of the present invention in improving the generalization ability of the fake face detection model. The experimental results also show that in both cross-dataset evaluations, the proposed method can achieve comparable performance compared with the most advanced fake face detection methods as well as cross-compression evaluation.

[0053] An intuitive example is given below to illustrate why proper normalization of intermediate capsules should be considered during dynamic routing, from which we can see that different levels of normalization lead to different degrees of impact.

[0054] 1) Set up single-constraint and double-constraint experiments for comparison, and compare the AUC (area under the ROC curve, where the ROC curve is the receiver operating characteristic curve) on the same data source FF++ test. The results are shown in Figure 6(a) and Figure 6(b).

[0055] like Figure 4 As shown in formula (11) and formula (12), the proposed f Gsq To compress the intermediate capsules (i.e., normalize them) to obtain the final capsule representation. Gsq The importance of dynamic routing is distinguished in several different situations. ① Double constraints: f Gsq It works for both formula (11) and formula (12); ② Single constraint: f Gsq Only applicable to formula (12), f in formula (11) Gsq Replaced by f in the prior art sq ; ③ Baseline: f in formula (12) and formula (11) Gsq Replaced by f in the prior art sq .

[0056] Figure 6(a) shows the results with and without f when the CNN branch is set to vgg19. Gsq In both “double constraint” and “single constraint”, we can see that almost half of the models outperform the baseline model, which indicates that applying f Gsq In addition, it can be seen that the improvement trend of “double constraint” relative to “baseline” is similar to the improvement trend of “single constraint” relative to the baseline model, which indicates that the f Gsq The importance of applying to formula (12). Similarly, the performance corresponding to resnet18 is shown in Figure 6(b). From the figure, we can see that almost half of the models perform better than the baseline model, and the two curves also have similar trends. Both figures show that f Gsq Importance in dynamic routing, especially f Gsq The importance of applying to formula (12).

[0057] 2) The generalization of the model on FF++(c23) and FF++(C40).

[0058] The model trained on CelebDF (mpeg 4.0 format) is used to test and evaluate four types of face forgery operations in FF++ (c23) and FF++ (c40). Then, not only the experimental results of cross-data evaluation from CelebDF to FF++ can be obtained, but also the experimental results of cross-compression evaluation from MPEG4.0 to light compression c23 and low quality c40 can be obtained respectively. When the CNN branch is set to vgg19, the baseline model with α=1 is denoted as vggA, and the best model with α=100 is denoted as vggB. When the CNN branch is set to resnet18, the baseline model with α=1 is denoted as resA, and the best model with α=100 is denoted as resB. The experimental AUC results are shown in Tables 3 and 4, respectively. The results show that in most types of operations in FF++, the proposed method obtains better generalization ability than the baseline while maintaining a high AUC in FF++DeepFakes.

[0059] Table 3 AUC (%) results of cross-data evaluation of CelebDF and FF++ (c23)

[0060]

[0061] Table 4 AUC (%) results of cross-data evaluation of CelebDF and FF++ (c40)

[0062]

[0063] 3) To evaluate the effectiveness of the proposed method, we first perform in-data evaluation on FF++(c23) and FF++(C40), and then perform cross-data evaluation from FF++ to CelebDF. Similarly, Capsule-Forensics with two CNN settings is used to train a face forgery detection model. For in-data evaluation of FF++(c23) and FF++(C40), when the CNN branch is set to vgg19, we use α=1 and α=100 to obtain the baseline model FFc23-vggA (or FFc40-vggA) and the enhanced model FFc23-vggB (or FFc40-vggB), respectively. Similarly, when the CNN branch is set to resnet18, we use α=1 and α=+∞ to obtain the baseline model FFc23-resA (FFc40-resA) and the enhanced model FFc23-resB (FFc40-resB), respectively. In order to compare the time complexity, three indicators are used: time / iteration (ms), time / epoch (s) and total time (h), as shown in Table 5. When the data compression is set to c23, the proposed method has a slight advantage over the baseline in time complexity; when the training data compression is set to the more challenging c40, the proposed method has similar time complexity compared to the baseline. These all indicate that the proposed method does not increase the burden of model training.

[0064] Table 5 Model training time

[0065]

[0066] 4) Cross-data evaluation from FF++ to CelebDF. The models trained on FF++ (c23) and FF++ (c40) are used to evaluate the test performance on CelebDF. The specific results are shown in Table 6. The results show that the proposed method achieves better generalization than the baseline relative to compressed c40 while maintaining a higher AUC in compressed c23.

[0067] Table 6 AUC (%) evaluation results of cross-data from FF++ to CelebDF

[0068]

[0069] 5) To illustrate the effectiveness of the proposed method, the best model FFc23-resB is used for visualization. The latent features extracted before the statistical pooling layer of the primary capsule are selected and visualized using open source tools. FFc23-resA is denoted as Baseline and FFc23resB is denoted as Ours. The first identity in FF++ is selected for visualization, and four types of facial operations in FF++ are compared. The heat map visualization results of the same face image and its various forged face images are compared. The results are shown in Figure 5. Figure 5 shown.

[0070] Figure 5 The feature maps of FF++ face manipulation of the same real face are compared. The 10 columns of feature maps correspond to the latent features of the 10 primary capsules. From an overall perspective, it can be observed that: (1) the feature maps of the baseline and the proposed model respond to various facial regions, and the regions of interest of different primary capsules are different, which shows the importance of capsule forensics in focusing on the spatial hierarchy between simple and complex objects. (2) The regions of interest of the baseline include eyes, nose, and facial contours, but contain less mouth areas. In contrast, the activations of the proposed model not only adapt to the eyes, nose, and facial contours, but also better adapt to the mouth area.

[0071] From a local perspective, it can be observed that: (1) For DeepFakes and FaceSwap, they belong to face replacement forgery operations. In the DeepFakes comparison, the proposed method learns better face boundaries. Although the baseline learns rectangular face boundaries, the face boundaries corresponding to the baseline contain less face areas than the proposed model, which can be compared from the red rectangle mark. For face replacement, the baseline tends to learn rectangular face boundaries, which is not suitable for the true replacement operation of mixed shapes. In contrast, the proposed model tends not to activate face areas similar to rectangles. (2) For Face2Face, it is an expression manipulation covering different lighting and expressions. The regions of interest of the baseline and the proposed method are mainly the facial regions that make expressions, however, the baseline pays less attention to the mouth region, which is a very important operation region related to expression. (3) For NeuralTextures forgery, it only operates in the mouth region, and the eye region is not modified. For better comparison, the region of interest close to the mouth region is marked with a red rectangle. The baseline tends to activate both the mouth region and the eye region at the same time, which is inconsistent with the actual operation. In contrast, the proposed model tends to activate the mouth area and pays less attention to the eyes. It shows that the proposed method learns better spatial correlation. All experimental results show that the proposed method achieves better generalization than the baseline.

[0072] In summary, in the face of the traditional dynamic routing algorithm used in the traditional capsule network, the routing process cannot solve the problem of non-universal approximation and the problems of unstable training and simulated overfitting. The present invention improves the existing traditional capsule network and proposes a new dynamic routing algorithm combined with universal approximation. The new dynamic routing algorithm mainly no longer uses the traditional commonly used Squash squeezing function to compress the intermediate capsule, but uses the generalized squeezing function proposed by the present invention. This function adds a hyperparameter α on the basis of the Squash squeezing function. By normalizing and redistributing the calculation of dynamic routing, it pays more attention to the distribution of intermediate capsules, aiming to optimize the learning of capsule representation, which can be used for more general face forgery detection. Moreover, the new dynamic routing algorithm can alleviate the instability of training and further improve the generality of the model.

[0073] Specific implementation methods are given above, but the present invention is not limited to the described implementation methods. The basic idea of ​​the present invention lies in the above basic scheme. For ordinary technicians in this field, it does not take creative work to design various deformed models, formulas, and parameters according to the teachings of the present invention. Changes, modifications, substitutions, and variations of the implementation methods without departing from the principles and spirit of the present invention still fall within the scope of protection of the present invention.

Claims

1. A method for detecting fake face images based on a squeeze-constrained dynamic routing capsule network, characterized in that: The method comprises: obtaining a face image to be tested and inputting it into a trained improved capsule network to obtain a forged face detection result; The improved capsule network is obtained by improving the traditional capsule network; the improvement includes that the digital capsule layer uses a generalized squeezing function to compress the intermediate capsule, and the generalized squeezing function is: In the formula, f Gsq is a generalized squeezing function, α is a hyperparameter greater than 0, u i is the input of the generalized squeezing function.

2. The forged face image detection method based on squeeze constraint dynamic routing capsule network according to claim 1 is characterized in that: The improvement also includes that the digital capsule layer in the network uses the routing weight to map the main capsule in the following way: first, the input main capsule is normalized using the generalized squeezing function, and then the normalized main capsule is mapped using the routing weight.

3. The forged face image detection method based on squeeze constraint dynamic routing capsule network according to claim 1 is characterized in that: The intermediate capsule is an intermediate capsule with a non-zero deviation added.

4. The forged face image detection method based on squeeze-constrained dynamic routing capsule network according to any one of claims 1 to 3, characterized in that: The convolutional layers in the network are vgg19 or resnet18.

5. The forged face image detection method based on squeeze-constrained dynamic routing capsule network according to any one of claims 1 to 3, characterized in that: The architecture of the main capsule layer in the network is: the main capsule layer includes at least two main capsule units connected in sequence, each main capsule unit is used to process its input in sequence through convolution, batch normalization, activation function, convolution, batch normalization, activation function, statistical pooling layer, convolution, batch normalization, convolution, batch normalization, and View, where View is used to modify the tensor dimension.

6. The forged face image detection method based on squeeze-constrained dynamic routing capsule network according to any one of claims 1 to 3, characterized in that: The loss function used in the process of training the improved capsule network is the cross entropy loss function.

7. The forged face image detection method based on squeeze-constrained dynamic routing capsule network according to any one of claims 1 to 3, characterized in that: The optimizer used in the process of training the improved capsule network is the Adam optimizer.