# US 2025/0166111 A1 · Active-defense detection method based on facial landmark watermarking

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2025/0166111 A1
- Document ID: US20250166111A1
- Status: Published application
- Kind: A1
- Application number: 18/755,736
- Filed: 2024-06-27
- Published: 2025-05-22
- Earliest claimed: 2023-11-22
- Assignees: Qilu University of Technology (Shandong Academy of Sciences); Shandong Artificial Intelligence Institute; Shandong Computer Science Center (National Supercomputing Center In Jinan)
- Applicants: Qilu University of Technology (Shandong Academy of Sciences); Shandong Artificial Intelligence Institute; Shandong Computer Science Center (National Supercomputing Center In Jinan)
- Inventors: Minglei SHU; Mengxiao HUANG; Shuwang ZHOU; Zhaoyang LIU; Pengyao XU
- Web page: https://patentgrep.com/patent/US20250166111A1

## CPC

- G06T 1/005: {Robust watermarking, e.g. average attack or collusion attack resistant}
- G06V 10/454: {Integrating the filters into a hierarchical structure, e.g. convolutional neural networks [CNN]}
- G06V 10/82: using neural networks
- G06V 40/168: {Feature extraction; Face representation}
- G06V 40/40: Spoof detection, e.g. liveness detection
- G06T: IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06V: IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING

## Abstract

An active-defense detection method based on facial landmark watermarking is provided. The active-defense detection method includes: extracting facial landmarks from an original image, converting the extracted facial landmarks into a binary watermark, embedding the binary watermark into the original image to form a watermark image, and subjecting the watermark image to a non-malicious/malicious operation to form a noise image or a malicious image such that a model is robust to the non-malicious/malicious operation. By introducing the facial landmarks, the active-defense detection method can generate a unique watermark for each individual and achieve traceability and detection functions.

## Claims

### Claim 1

An active-defense detection method based on a facial landmark watermarking, comprising the following steps:
a) acquiring n facial images to form a facial image set I, I={I1, I2, . . . , Ii, . . . , In}, wherein Ii denotes an i-th facial image, i ∈ {1, . . . ,n}; and preprocessing the i-th facial image Ii, i ε {1, . . . ,n}, to acquire a preprocessed i-th facial image Icover_i, wherein a preprocessed facial image set Icover is acquired;
b) extracting facial landmarks from the preprocessed i-th facial image Icover_i, and converting the facial landmarks into a watermark Wm;
c) constructing an encoder, and inputting the i-th facial image Icover_i and the watermark Wm into the encoder to acquire a watermark image Iwm;
d) injecting the watermark image Iwm into a noise pool to acquire a noise image Inoise, and injecting the watermark image Iwm into a malicious pool to acquire a malicious image Idep;
e) constructing a decoder, and inputting the noise image Inoise or the malicious image Idep into the decoder to acquire a final watermark Wm1; and
f) determining whether the noise image Inoise and the malicious image Idep are real or fake images based on the final watermark Wm1.

### Claim 2 (depends on 1)

The active-defense detection method based on the facial landmark watermarking according to claim 1, wherein the step a) comprises:
a-1) acquiring the n facial images from a CelebA-HQ dataset to form the facial image set I; and
a-2) resizing, by a resize( ) function in a Python imaging library (PIL), the i-th facial image Ii into a 256×256 image, wherein the preprocessed i-th facial image Icover_i and the preprocessed facial image set Icover={Icover_1, Icover_2, . . . , Icover_i, . . . , Icover_n} are acquired.

### Claim 3 (depends on 1)

The active-defense detection method based on the facial landmark watermarking according to claim 1, wherein the step b) comprises:
b-1) detecting, by a Dlib facial landmark detection algorithm, the facial landmarks in the preprocessed i-th facial image Icover_i to acquire a facial landmark set Lm comprising m facial landmarks, Lm={l1,l2, . . . ,lm}, m=68, wherein {l1, l2, . . . ,l17} are landmarks of a jawline, {l18,l19, . . . ,l22} are landmarks of a right eyebrow, {l23, l24, . . . ,l27} are landmarks of a left eyebrow, {l28, l29, . . . ,l36} are landmarks of a nose, {l37, l38, . . . ,l42} are landmarks of a right eye, {l43, l44, . . . , l48} are landmarks of a left eye, and {l49,l50, . . . , l68} are landmarks of a mouth; and
b-2) defining an i-th landmark li by a horizontal coordinate xi and a vertical coordinate yi; mapping a value of the horizontal coordinate xi to an integer range of 0-15 through a linear transformation, and converting, by a bin( ) function in Python, the value of the horizontal coordinate xi that is mapped to the integer range of 0-15 into a binary representation Wxi with a length of 4; mapping a value of the vertical coordinate yi to the integer range of 0-15 through the linear transformation, and converting, by the bin( ) function in Python, the value of the vertical coordinate yi that is mapped to the integer range of 0-15 into a binary representation Wyi with the length of 4; splicing the binary representation Wxi and the binary representation Wyi into a binary representation Wxy-i with a length of 8; splicing binary representations of the 68 facial landmarks together into a binary representation W68 with a length of 544; and compressing, by a principal component analysis (PCA)-based dimensionality reduction method, the binary representation W68 to a binary representation with a length of 256 as the watermark Wm.

### Claim 4 (depends on 1)

The active-defense detection method based on the facial landmark watermarking according to claim 1, wherein the step c) comprises:
c-1) constructing the encoder, comprising an original image processing unit, a watermark processing unit, a first convolutional layer, a batch normalization (BatchNorm) layer, an activation function layer, and a second convolutional layer;
c-2) constructing the original image processing unit of the encoder, comprising a convolutional layer, a BatchNorm layer, a first rectified linear unit (ReLU) activation function, an atrous convolutional layer, a second ReLU activation function, a Dropout layer, a first combined pooling and convolution (CPC) module, a second CPC module, and a third CPC module; inputting the i-th facial image Icover_i into the convolutional layer, the BatchNorm layer, and the first ReLU activation function of the original image processing unit in sequence to acquire an image feature Fcover_1; and inputting the image feature Fcover_1 into the atrous convolutional layer, the second ReLU activation function, and the Dropout layer of the original image processing unit in sequence to acquire an image feature Fcover_2;
c-3) constructing the first CPC module, the second CPC module, and the third CPC module, each comprising a first branch and a second branch, wherein the first branch comprises a first convolutional layer, a first BatchNorm layer, a first ReLU activation function, a second convolutional layer, a second BatchNorm layer, a second ReLU activation function, a third convolutional layer, a third BatchNorm layer, and a third ReLU activation function in sequence, while the second branch comprises an average pooling layer, a first convolutional layer, a ReLU activation function, and a second convolutional layer in sequence; inputting the image feature Fcover_2 into the first convolutional layer, the first BatchNorm layer, and the first ReLU activation function in the first branch of the first CPC module in sequence to acquire an image feature Fcover_2_1; inputting the image feature Fcover_2_1 into the second convolutional layer, the second BatchNorm layer, and the second ReLU activation function in the first branch of the first CPC module in sequence to acquire an image feature Fcover_2_2; inputting the image feature Fcover_2_2 into the third convolutional layer, the third BatchNorm layer, and the third ReLU activation function in the first branch of the first CPC module in sequence to acquire an image feature Fcover_2_3; inputting the image feature Fcover_2 into the second branch of the first CPC module to acquire an image feature Fcover_3; subjecting the image feature Fcover_3 and the image feature Fcover_2_3 to element-wise multiplication to acquire an image feature Fcover_4; subjecting the image feature Fcover_4 and the image feature Fcover_2 to corresponding-elements addition to acquire an image feature Fcover_5; inputting the image feature Fcover_5 into the first convolutional layer, the first BatchNorm layer, and the first ReLU activation function in the first branch of the second CPC module in sequence to acquire an image feature Fcover_5_1; inputting the image feature Fcover_5_1 into the second convolutional layer, the second BatchNorm layer, and the second ReLU activation function in the first branch of the second CPC module in sequence to acquire an image feature Fcover_5_2; inputting the image feature Fcover_5_2 into the third convolutional layer, the third BatchNorm layer, and the third ReLU activation function in the first branch of the second CPC module in sequence to acquire an image feature Fcover_5; inputting the image feature Fcover_5 into the second branch of the second CPC module to acquire an image feature Fcover_6; subjecting the image feature Fcover_6 and the image feature Fcover_5_3 to the element-wise multiplication to acquire an image feature Fcover_7; subjecting the image feature Fcover_7 and the image feature Fcover_5 to the corresponding-elements addition to acquire an image feature Fcover_8; inputting the image feature Fcover_8 into the first convolutional layer, the first BatchNorm layer, and the first ReLU activation function in the first branch of the third CPC module in sequence to acquire an image feature Fcover_8_1; inputting the image feature Fcover_8_1 into the second convolutional layer, the second BatchNorm layer, and the second ReLU activation function in the first branch of the third CPC module in sequence to acquire an image feature Fcover_8_2; inputting the image feature Fcover_8_2 into the third convolutional layer, the third BatchNorm layer, and the third ReLU activation function in the first branch of the third CPC module in sequence to acquire an image feature Fcover_8_3; inputting the image feature Fcover_8 into the second branch of the third CPC module to acquire an image feature Fcover_9; subjecting the image feature Fcover_9 and the image feature Fcover_8_3 to the element-wise multiplication to acquire an image feature Fcover_10; and subjecting the image feature Fcover_10 and the image feature Fcover_8 to the corresponding-elements addition to acquire an image feature Fcover_11;
c-4) constructing the watermark processing unit of the encoder, comprising a linear layer, a convolutional layer, a first BatchNorm layer, a first ReLU activation function, an atrous convolutional layer, a second ReLU activation function, a first Dropout layer, a first deconvolutional layer, a second BatchNorm layer, a third ReLU activation function, a second deconvolutional layer, a fourth ReLU activation function, a second Dropout layer, a first CPC module, a second CPC module, and a third CPC module; inputting the watermark Wm into the linear layer of the watermark processing unit to acquire a watermark feature f1; inputting the watermark feature f1 into the convolutional layer, the first BatchNorm layer, and the first ReLU activation function of the watermark processing unit in sequence to acquire a watermark feature f2; inputting the watermark feature f2 into the atrous convolutional layer, the second ReLU activation function, and the first Dropout layer of the watermark processing unit in sequence to acquire a watermark feature f3; inputting the watermark feature f3 into the first deconvolutional layer, the second BatchNorm layer, and the third ReLU activation function of the watermark processing unit in sequence to acquire a watermark feature f4; inputting the watermark feature f4 into the second deconvolutional layer, the fourth ReLU activation function, and the second Dropout layer of the watermark processing unit in sequence to acquire a watermark feature f5; inputting the watermark feature f5 into the first convolutional layer, the first BatchNorm layer, and the first ReLU activation function in the first branch of the first CPC module in sequence to acquire a watermark feature fm_5_1; inputting the watermark feature fm_5_1 into the second convolutional layer, the second BatchNorm layer, and the second ReLU activation function in the first branch of the first CPC module in sequence to acquire a watermark feature fm_5_2; inputting the watermark feature fm_5_2 into the third convolutional layer, the third BatchNorm layer, and the third ReLU activation function in the first branch of the first CPC module in sequence to acquire a watermark feature fm_5_3; inputting the watermark feature f5 into the second branch of the first CPC module to acquire a watermark feature fm_6; subjecting the watermark feature fm_6 and the watermark feature fm_5_3 to the element-wise multiplication to acquire a watermark feature fm_7; subjecting the watermark feature fm_7 and the watermark feature f5 to the corresponding-elements addition to acquire a watermark feature fm_8; inputting the watermark feature fm_8 into the first convolutional layer, the first BatchNorm layer, and the first ReLU activation function in the first branch of the second CPC module in sequence to acquire a watermark feature fm_8_1; inputting the watermark feature fm_8_1 into the second convolutional layer, the second BatchNorm layer, and the second ReLU activation function in the first branch of the second CPC module in sequence to acquire a watermark feature fm_8_2; inputting the watermark feature fm_8_2 into the third convolutional layer, the third BatchNorm layer, and the third ReLU activation function in the first branch of the second CPC module in sequence to acquire a watermark feature fm_8_3; inputting the watermark feature fm_8 into the second branch of the second CPC module to acquire a watermark feature fm_9; subjecting the watermark feature fm_9 and the watermark feature fm_8_3 to the element-wise multiplication to acquire a watermark feature fm_10; subjecting the watermark feature fm_10 and the watermark feature fm_8 to the corresponding-elements addition to acquire a watermark feature fm_11; inputting the watermark feature fm_11 into the first convolutional layer, the first BatchNorm layer, and the first ReLU activation function in the first branch of the third CPC module in sequence to acquire a watermark feature fm_11_1; inputting the watermark feature fm_11_1 into the second convolutional layer, the second BatchNorm layer, and the second ReLU activation function in the first branch of the third CPC module in sequence to acquire a watermark feature fm_11_2; inputting the watermark feature fm_11_2 into the third convolutional layer, the third BatchNorm layer, and the third ReLU activation function in the first branch of the third CPC module in sequence to acquire a watermark feature fm_11_3; inputting the watermark feature fm_11 into the second branch of the third CPC module to acquire a watermark feature fm_12; subjecting the watermark feature fm_12 and the watermark feature fm_11_3 to the element-wise multiplication to acquire a watermark feature fm_13; and subjecting the watermark feature fm_13 and the watermark feature fm_11 to the corresponding-elements addition to acquire a watermark feature f6; and
c-5) subjecting the image feature Fcover_11 and the watermark feature f6 to the corresponding-elements addition to acquire a feature F1; inputting the feature F1 into the first convolutional layer, the BatchNorm layer, and the activation function layer of the encoder in sequence to acquire a feature F2; and inputting the feature F2 into the second convolutional layer of the encoder to acquire the watermark image Iwm.

### Claim 5 (depends on 4)

The active-defense detection method based on the facial landmark watermarking according to claim 4, wherein
in the step c-2), the convolutional layer of the original image processing unit comprises 64 channels and a convolutional kernel, with a size of 3, a stride of 1, and a padding of 1; and the atrous convolutional layer of the original image processing unit comprises 64 channels and a convolutional kernel, with a size of 3, a dilation rate of 2, a stride of 1, and a padding of 1;
in the step c-3), the first convolutional layer, the second convolutional layer, and the third convolutional layer in the first branch each comprise 64 channels and a convolutional kernel, with a size of 3, a stride of 1, and a padding of 1; the first convolutional layer and the second convolutional layer in the second branch each comprise 64 channels and a convolutional kernel, with a size of 3, a stride of 1, and a padding of 1; and the average pooling layer in the second branch has a window size of 4;
in the step c-4), the linear layer of the watermark processing unit comprises 256 input nodes and 256 output nodes; the convolutional layer of the watermark processing unit comprises 64 channels and a convolutional kernel, with a size of 3, a stride of 1, and a padding of 1; the atrous convolutional layer of the watermark processing unit comprises 64 channels and a convolutional kernel, with a size of 3, a dilation rate of 2, a stride of 1, and a padding of 1; and the first deconvolutional layer and the second deconvolutional layer of the watermark processing unit each comprise 64 channels and a convolutional kernel, with a size of 3, a stride of 1, and a padding of 1; and
in the step c-5), the first convolutional layer of the encoder comprises 64 channels and a convolutional kernel, with a size of 3, a stride of 1, and a padding of 1; and the second convolutional layer of the encoder comprises 3 channels and a convolutional kernel, with a size of 1, a stride of 1, and a padding of 1.

### Claim 6 (depends on 1)

The active-defense detection method based on the facial landmark watermarking according to claim 1, wherein the step d) comprises:
d-1) constructing the noise pool, comprising Identity noise, Dropout noise, Crop noise, GaussianNoise noise, SaltPepper noise, GaussianBlur noise, MedBlur noise, and joint photographic experts group (JPEG) noise; injecting the watermark image Iwm into the noise pool; and adding a noise randomly selected from the noise pool to the watermark image Iwm to form the noise image Inoise; and
d-2) constructing the malicious pool, comprising a simple swapping (SimSwap) model, an information bottleneck disentanglement for identity swapping (InfoSwap) model, a unified cross-entropy loss for deep face recognition (UniFace) model, and attribute manipulation algorithms; injecting the watermark image Iwm into the malicious pool; and manipulating, by a model or attribute manipulation algorithm randomly selected from the malicious pool, the watermark image Iwm to form the malicious image Idep.

### Claim 7 (depends on 4)

The active-defense detection method based on the facial landmark watermarking according to claim 4, wherein the step e) comprises:
e-1) constructing the decoder, comprising a first convolutional layer, a first BatchNorm layer, a first ReLU activation function, a first atrous convolutional layer, a second ReLU activation function, a first Dropout layer, a first CPC module, a second CPC module, a third CPC module, a second convolutional layer, a second BatchNorm layer, a third ReLU activation function, a second atrous convolutional layer, a fourth ReLU activation function, a second Dropout layer, a flatten layer, and a fully connected layer;
inputting the noise image Inoise or the malicious image Idep into the first convolutional layer, the first BatchNorm layer, and the first ReLU activation function of the decoder in sequence to acquire an image feature N1;
inputting the image feature N1 into the first atrous convolutional layer, the second ReLU activation function, and the first Dropout layer of the decoder in sequence to acquire an image feature N2;
inputting the image feature N2 into the first convolutional layer, the first BatchNorm layer, and the first ReLU activation function in the first branch of the first CPC module in sequence to acquire an image feature N2_1;
inputting the image feature N2_1 into the second convolutional layer, the second BatchNorm layer, and the second ReLU activation function in the first branch of the first CPC module in sequence to acquire an image feature N2_2;
inputting the image feature N2_2 into the third convolutional layer, the third BatchNorm layer, and the third ReLU activation function in the first branch of the first CPC module in sequence to acquire an image feature N2_3;
inputting the image feature N2 into the second branch of the first CPC module to acquire an image feature N3;
subjecting the image feature N3 and the image feature N2_3 to the element-wise multiplication to acquire an image feature N4;
subjecting the image feature N4 and the image feature N2 to the corresponding-elements addition to acquire an image feature N5;
inputting the image feature N5 into the first convolutional layer, the first BatchNorm layer, and the first ReLU activation function in the first branch of the second CPC module in sequence to acquire an image feature N5_1;
inputting the image feature N5_1 into the second convolutional layer, the second BatchNorm layer, and the second ReLU activation function in the first branch of the second CPC module in sequence to acquire an image feature N5_2;
inputting the image feature N5_2 into the third convolutional layer, the third BatchNorm layer, and the third ReLU activation function in the first branch of the second CPC module in sequence to acquire an image feature N5_3;
inputting the image feature N5 into the second branch of the second CPC module to acquire an image feature N6;
subjecting the image feature N6 and the image feature N5_3 to the element-wise multiplication to acquire an image feature N7;
subjecting the image feature N7 and the image feature N5 to the corresponding-elements addition to acquire an image feature N8;
inputting the image feature N8 into the first convolutional layer, the first BatchNorm layer, and the first ReLU activation function in the first branch of the third CPC module in sequence to acquire an image feature N8_1;
inputting the image feature N8_1 into the second convolutional layer, the second BatchNorm layer, and the second ReLU activation function in the first branch of the third CPC module in sequence to acquire an image feature N8_2;
inputting the image feature N8_2 into the third convolutional layer, the third BatchNorm layer, and the third ReLU activation function in the first branch of the third CPC module in sequence to acquire an image feature N8_3;
inputting the image feature N8 into the second branch of the third CPC module to acquire an image feature N9;
subjecting the image feature N9 and the image feature N8_3 to the element-wise multiplication to acquire an image feature N10;
subjecting the image feature N10 and the image feature N8 to the corresponding-elements addition to acquire an image feature N11;
inputting the image feature N11 into the second convolutional layer, the second BatchNorm layer, and the third ReLU activation function of the decoder in sequence to acquire an image feature N12;
inputting the image feature N12 into the second atrous convolutional layer, the fourth ReLU activation function, and the second Dropout layer of the decoder in sequence to acquire an image feature N13;
inputting the image feature N13 into the flatten layer of the decoder to acquire an image feature N4; and
inputting the image feature N14 into the fully connected layer of the decoder to acquire the final watermark Wm1.

### Claim 8 (depends on 7)

The active-defense detection method based on the facial landmark watermarking according to claim 7, wherein in the step e-1),
the first convolutional layer of the decoder comprises 64 channels and a convolutional kernel, with a size of 3, a stride of 1, and a padding of 1;
the first atrous convolutional layer of the decoder comprises 64 channels and a convolutional kernel, with a size of 3, a dilation rate of 2, a stride of 1, and a padding of 1;
the second convolutional layer of the decoder comprises 64 channels and a convolutional kernel, with a size of 3, a stride of 1, and a padding of 1;
the second atrous convolutional layer of the decoder comprises 64 channels and a convolutional kernel, with a size of 3, a dilation rate of 2, a stride of 1, and a padding of 1; and
the flatten layer and the fully connected layer of the decoder each comprise 256 neurons.

### Claim 9 (depends on 1)

The active-defense detection method based on the facial landmark watermarking according to claim 1, wherein the step f) comprises:
f-1) defining a constant count1 with an initial value of 0; determining whether binary values at corresponding positions of the final watermark Wm1 and the watermark Wm are the same; and when the binary values of the final watermark Wm1 and the watermark Wm are different in one bit: incrementing the constant count1 by 1, and dividing a final value of the constant count1 by 256 to acquire a bit error rate Ebit;
f-2) determining that the noise image Inoise is a real image when the bit error rate Ebit is less than 0.5; and determining that the noise image Inoise is a fake image when the bit error rate Ebit is greater than or equal to 0.5;
f-3) replacing the i-th facial image Icover_i in the step b) with the malicious image Idep, and repeating the step b) to acquire a watermark W′m;
f-4) defining a constant count2 with an initial value of 0; determining whether binary values at corresponding positions of the watermark W′m and the watermark Wm are the same; and when the binary values of the watermark W′m and the watermark Wm are different in one bit: incrementing the constant count2 by 1, and dividing a final value of the constant count2 by 256 to acquire a bit error rate E′bit; and
f-5) determining that the malicious image Idep is a real image when the bit error rate E′bit is less than or equal to 0.5; and determining that the malicious image Idep is a fake image when the bit error rate E′bit, is greater than 0.5.
