A camera prnu fingerprint extraction method and system based on high frequency enhancement
By using a fingerprint extraction network based on Swin Transformer, combined with high-frequency enhancement and frequency domain regularization, the difficulty of camera PRNU fingerprint extraction under conditions of a small number of images in the prior art is solved, and efficient and stable camera recognition results are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHONGQING UNIV
- Filing Date
- 2026-04-23
- Publication Date
- 2026-07-14
AI Technical Summary
Existing technologies struggle to stably and efficiently extract highly discriminative camera PRNU fingerprints with a limited number of images. Traditional methods rely on flat images and are susceptible to semantic noise interference, while directly using Transformer backbone networks results in insufficient high-frequency preservation capabilities.
A fingerprint extraction network based on Swing Transformer is adopted, which combines patch-level fingerprint contrast learning, high-frequency enhancement module and frequency domain fingerprint regularization. Through unsupervised contrast learning and high-frequency mask guidance, the fingerprint extraction network is optimized to enhance high-frequency sensitivity and frequency domain uniformity.
High-accuracy camera recognition can be achieved with only a small number of ordinary images, reducing the reliance on flat images, improving the extraction accuracy and robustness of PRNU fingerprints, and adapting to practical evidence collection scenarios.
Smart Images

Figure CN122090240B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of digital multimedia forensics and image processing technology, and relates to a method and system for extracting PRNU fingerprints from a camera based on high-frequency enhancement. Background Technology
[0002] Digital image source identification is an important research direction in the field of multimedia forensics. Among them, source camera identification technology based on camera light response nonuniformity (PRNU) has attracted widespread attention due to its uniqueness and stability, similar to a device "fingerprint." PRNU fingerprints are tiny differences in the light response of pixels caused by imperfections in the manufacturing process of image sensors. These differences are unique across different devices and do not change with variations in the shooting scene and image content, thus they are widely used for image source authentication.
[0003] Traditional PRNU fingerprint extraction methods typically employ high-pass filters based on wavelet transform to extract residual noise from images and determine source camera attribution by calculating the normalized cross-correlation (NCC) between the query image residual and the reference fingerprint. However, these methods have the following drawbacks: First, they require a large number (usually more than 50) of flat images (such as skies, white walls, etc.) to stably estimate the reference fingerprint. In real-world forensic scenarios, flat images of suspect devices are almost impossible to obtain, and images taken by ordinary users are mostly rich in scene content, making it difficult to meet the requirements of traditional methods. Second, when the number of reference images is extremely small (e.g., less than 10) and the image content is complex, the fingerprints extracted by traditional methods are severely affected by scene structure, resulting in a significant decrease in recognition performance.
[0004] In recent years, fingerprint extraction methods based on convolutional neural networks (CNNs) (such as Noiseprint and PhotoNecf) have been proposed. These methods learn camera fingerprint representations directly from non-flat images using CNNs, reducing reliance on flat images to some extent. However, existing CNN-based methods still struggle to suppress semantic noise when the number of reference images is extremely small (e.g., less than 10) and the image content is complex. The extracted fingerprints are severely affected by scene structure, leading to a significant drop in recognition performance. Furthermore, the Transformer architecture has made significant progress in computer vision tasks due to its powerful global semantic modeling capabilities, and some studies have attempted to apply it to image restoration tasks, but it has not yet been directly used for PRNU fingerprint extraction. Because the Transformer's self-attention mechanism is weak in preserving high-frequency details, while PRNU fingerprints are primarily found in the high-frequency components of the image, this mismatch makes it difficult to effectively extract camera fingerprints using a Transformer backbone network directly.
[0005] Therefore, how to stably and efficiently extract highly discriminative camera fingerprints from a small number of ordinary non-stationary images is a technical problem that urgently needs to be solved in the field of source camera recognition technology. Summary of the Invention
[0006] In view of this, the purpose of this invention is to provide a camera PRNU fingerprint extraction method and system based on high-frequency enhancement, which solves the following technical problems in existing source camera recognition technology: First, the dependence of traditional PRNU fingerprint extraction methods on a large number of flat images; Second, the problem that existing CNN-based methods have insufficient fingerprint extraction accuracy and are easily affected by semantic noise when the number of reference images is very small and the image content is complex; Third, the problem that directly using the Transformer backbone network is difficult to effectively extract PRNU fingerprints due to its weak high-frequency preservation ability.
[0007] To achieve the above objectives, the present invention provides the following technical solution:
[0008] A camera PRNU fingerprint extraction method based on high-frequency enhancement, the method specifically includes the following steps:
[0009] S1. Obtain a training image set, and crop each image in the training image set into multiple image patches of preset sizes;
[0010] S2. Construct a fingerprint extraction network based on Swing Transformer, which is used to extract fingerprint feature maps from the input image patch;
[0011] S3. Using a patch-level fingerprint contrast learning loss function, the fingerprint feature maps of different image patches from the same device are used as positive samples and the fingerprint feature maps of different image patches from different devices are used as negative samples to train the fingerprint extraction network in an unsupervised contrast learning manner.
[0012] S4. Using the high-frequency enhancement module loss function, the fingerprint extraction network is guided to maximize the correlation between the original image patch fingerprint feature map and the high-frequency enhanced patch fingerprint feature map in the high-frequency region of the image indicated by the high-frequency mask.
[0013] S5. The frequency domain fingerprint regularization loss function is used to constrain the power spectral density of the fingerprint feature map extracted by the fingerprint extraction network to be uniformly distributed in the frequency domain.
[0014] S6. Based on the weighted sum of the patch-level fingerprint comparison learning loss function, the high-frequency enhancement module loss function, and the frequency domain fingerprint regularization loss function, a joint loss function is constructed, and the fingerprint extraction network is jointly optimized and trained using the joint loss function.
[0015] S7. Input the query image to be identified and multiple reference images of the target device into the trained fingerprint extraction network, respectively, extract the corresponding query fingerprint feature map and reference fingerprint feature map, calculate the similarity between the query fingerprint feature map and the reference fingerprint feature map, and determine whether the source device of the query image to be identified is the target device based on the similarity.
[0016] Furthermore, in step S2, the fingerprint extraction network uses the SwinIR model as its backbone network, removes the reconstruction module of the SwinIR model, and directly uses the output of its deep feature extraction module as the fingerprint feature map; the fingerprint extraction network is initialized using weights pre-trained on the image denoising task.
[0017] Furthermore, in step S3, the patch-level fingerprint comparison learning loss function is specifically as follows:
[0018] S31. For each training batch, construct a sample set containing G device groups, each group containing M different image patches from the same device, for a total of N = G×M patches;
[0019] S32, For any anchor patch Other equipment within the same equipment group One patch is considered a positive sample; all patches from different device groups are considered negative samples.
[0020] S33. Calculate anchor patch using unsupervised contrastive learning loss. Comparative loss:
[0021]
[0022] in, This is the feature vector obtained after flattening the fingerprint feature map. and These are positive sample patches. and samples The corresponding flattened feature vector; anchor point The set of positive samples; It is a set that includes the anchor point itself and all negative samples; Cosine similarity; The temperature coefficient is used; the contrast loss for the entire batch is the average loss of all anchor points. By minimizing The model brings fingerprints from the same device closer together in the feature space and pushes fingerprints from different devices further apart, thereby learning device-specific fingerprint representations.
[0023] Furthermore, in step S4, the construction step of the loss function of the high-frequency enhancement module includes:
[0024] S41. Patch the input original image. Perform a two-dimensional discrete wavelet transform (DWT) to obtain the diagonal high-frequency subband HH; and generate a high-frequency mask based on the diagonal high-frequency subband HH. The high-frequency mask is used to identify the positions of high-frequency pixels that provide the most information for fingerprint extraction;
[0025] S42, For the original patch High-frequency enhancement processing is performed to obtain a high-frequency enhancement patch. ;
[0026] S43. Input the original image patch and the high-frequency enhancement patch into the fingerprint extraction network respectively to obtain the original fingerprint. and enhanced fingerprints ;
[0027] S44, Based on the high-frequency mask Calculate the Pearson correlation coefficient between the original fingerprint and the enhanced fingerprint in the masked region. ;
[0028] S45. The loss function of the high-frequency enhancement module is defined as follows:
[0029] in, A set of patches for which at least one location is active in the mask; by minimizing The model maximizes the correlation between the original fingerprint and the enhanced fingerprint within the high-frequency mask region, thereby forcing the fingerprint extractor to maintain a consistent response to high-frequency content and enhancing its sensitivity to PRNU signals.
[0030] Furthermore, in step S41, the high-frequency mask is generated as follows: the diagonal high-frequency subband HH is quantized, the first k% of pixels with the highest amplitude after quantization are marked as 1, and the rest are marked as 0, to obtain a high-frequency mask with low-frequency resolution, and then it is restored to the original patch space resolution by upsampling.
[0031] Furthermore, in step S5, the construction step of the frequency domain fingerprint regularization loss function includes:
[0032] S51. For each fingerprint feature map in the batch Perform a two-dimensional discrete Fourier transform to obtain its frequency domain representation. ;
[0033] S52. Calculate the average power spectral density of the entire batch. ;
[0034] S53. The frequency domain fingerprint regularization loss function is defined as the negative logarithm ratio of the geometric mean to the arithmetic mean of the average power spectral density: ,in, K Let be the side length of the fingerprint feature map. It is a small constant.
[0035] Furthermore, in step S6, the joint loss function is expressed as:
[0036]
[0037] in, These are the weights of each type of loss.
[0038] Furthermore, the reference fingerprint feature map of the target device is obtained by averaging the fingerprint feature maps corresponding to multiple reference images of the device; the similarity is calculated using normalized cross-correlation.
[0039] The present invention also provides a camera PRNU fingerprint extraction system based on high-frequency enhancement, which performs the above-described method, and the system includes:
[0040] The data preprocessing module is used to acquire a training image set and crop each image in the training image set into multiple image patches of preset sizes;
[0041] A fingerprint extraction network, built on the Swin Transformer, is used to extract fingerprint feature maps from input image patches;
[0042] The patch-level contrastive learning module is used to perform unsupervised contrastive learning training on the fingerprint extraction network by using the patch-level fingerprint contrastive learning loss function, with fingerprint feature maps of different image patches from the same device as positive samples and fingerprint feature maps of image patches from different devices as negative samples.
[0043] A high-frequency enhancement module is used to guide the fingerprint extraction network to maximize the correlation between the original image patch fingerprint feature map and the high-frequency enhanced patch fingerprint feature map in the high-frequency region of the image indicated by the high-frequency mask by employing a high-frequency enhancement module loss function.
[0044] The frequency domain regularization module is used to constrain the power spectral density of the fingerprint feature map extracted by the fingerprint extraction network to be uniformly distributed in the frequency domain by using the frequency domain fingerprint regularization loss function.
[0045] The joint training module is used to construct a joint loss function based on the weighted sum of the patch-level fingerprint contrast learning loss function, the high-frequency enhancement module loss function, and the frequency domain fingerprint regularization loss function, and to use the joint loss function to jointly optimize and train the fingerprint extraction network.
[0046] The reasoning and recognition module is used to input the query image to be recognized and multiple reference images of the target device into the trained fingerprint extraction network, extract the corresponding query fingerprint feature map and reference fingerprint feature map, calculate the similarity between the two, and determine whether the source device of the query image to be recognized is the target device based on the similarity.
[0047] The beneficial effects of this invention are as follows:
[0048] 1) Extremely low reference image requirement: Only 3 ordinary images are needed to achieve a closed set recognition accuracy of over 90%, which is significantly better than traditional methods.
[0049] 2) High-frequency enhancement guidance: By using high-frequency masks and enhancement branches, the model's sensitivity to PRNU-related high-frequency content is improved, and semantic interference is reduced.
[0050] 3) Frequency domain regularization: Enhances the spectral diversity of fingerprints and improves robustness to image post-processing.
[0051] 4) Label-free contrastive learning: Highly discriminative representations can be learned without manual annotation of fingerprint truth values, making it suitable for real-world unsupervised forensics scenarios.
[0052] Other advantages, objectives, and features of the invention will be set forth in part in the description which follows, and in part will be apparent to those skilled in the art from the following examination, or may be learned from practice of the invention. The objectives and other advantages of the invention can be realized and obtained through the following description. Attached Figure Description
[0053] To make the objectives, technical solutions, and advantages of the present invention clearer, the preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings, wherein:
[0054] Figure 1 This is a schematic diagram of the overall architecture of the camera PRNU fingerprint extraction system based on high-frequency enhancement provided in an embodiment of the present invention. Detailed Implementation
[0055] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Unless otherwise specified, the following embodiments and features can be combined with each other.
[0056] The accompanying drawings are for illustrative purposes only and are schematic diagrams, not actual pictures. They should not be construed as limiting the invention. To better illustrate the embodiments of the invention, some parts in the drawings may be omitted, enlarged, or reduced, and do not represent the actual product dimensions. It is understandable to those skilled in the art that some well-known structures and their descriptions may be omitted in the drawings.
[0057] In the accompanying drawings of the embodiments of the present invention, the same or similar reference numerals correspond to the same or similar components. In the description of the present invention, it should be understood that if terms such as "upper," "lower," "left," "right," "front," and "rear" indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, they are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, the terms used to describe positional relationships in the drawings are only for illustrative purposes and should not be construed as limiting the present invention. For those skilled in the art, the specific meaning of the above terms can be understood according to the specific circumstances.
[0058] This invention proposes a camera PRNU fingerprint extraction method and system based on high-frequency enhancement. The core principle is that camera optical response non-uniformity (PRNU) fingerprints mainly exist in the high-frequency components of an image, while the scene semantic content of a natural image is concentrated in the low-frequency portion. By constructing a fingerprint extraction network based on the Swing Transformer, combined with a high-frequency enhancement module, a frequency domain regularization strategy, and patch-level contrastive learning, this invention can stably and efficiently extract highly discriminative camera fingerprints from a small number (requiring only two) of ordinary non-stationary images, thereby achieving accurate identification of the source camera.
[0059] Figure 1 This is a schematic diagram of the overall architecture of the camera PRNU fingerprint extraction system based on high frequency enhancement provided in an embodiment of the present invention. The overall architecture of the system is based on the Swin Transformer image restoration network (SwinIR) as the backbone network, and three key technical innovation modules are introduced on this basis: Patch-level fingerprint contrast learning (PFC), high frequency enhancement module (HFE), and frequency domain fingerprint regularization (FFR).
[0060] 1) Backbone Network Structure: The backbone network of this invention adopts the SwinIR model, which is built based on SwinTransformer blocks and has powerful global semantic modeling capabilities. SwinIR consists of a shallow feature extraction module, a deep feature extraction module, and a reconstruction module. In this invention, to adapt to the fingerprint extraction task, the reconstruction module is removed, and the output of the deep feature extraction module is directly used as the fingerprint feature map. Specifically: Input image patch First, shallow features are extracted using a convolutional layer. These shallow features are then passed through multiple residual Swing Transformer blocks, each containing window-based multi-head self-attention and shift-window multi-head self-attention to achieve cross-regional information interaction. Finally, a fingerprint feature map is output. ,in The number of channels (in this invention, it is taken as...) (i.e., single-channel fingerprint). The backbone network is initialized using pre-trained weights (at AWGN noise level). (Pre-trained on an image denoising task), and then fine-tuned under the joint loss function of this invention.
[0061] 2) Patch-level fingerprint contrastive learning (PFC): Since there are no real fingerprint labels as supervision, this invention designs a patch-level contrastive learning strategy, which enables the model to learn device-discriminative fingerprint representations without relying on labels.
[0062] Sample organization method: Images are randomly selected from multiple devices in each training batch. Each image is cropped into multiple images of a specific size. The patch. Assume a batch contains... Each device group contains This batch contains patches from different images originating from the same device. Therefore, the batch contains a total of [number missing]. One patch.
[0063] Positive and negative sample definition: For any anchor patch Other equipment within the same equipment group One patch is considered a positive sample; all patches from different device groups are considered negative samples.
[0064] Contrast loss function: Unsupervised contrastive learning loss is used for anchor points. Its comparative loss is:
[0065]
[0066] in, This refers to the feature vector after flattening the fingerprint feature map; anchor point The set of positive samples; It is a set that includes the anchor point itself and all negative samples; Cosine similarity; The temperature coefficient is set as follows: The contrast loss for the entire batch is the average of the losses at all anchor points. By minimizing The model brings fingerprints from the same device closer together in the feature space and pushes fingerprints from different devices further apart, thereby learning device-specific fingerprint representations.
[0067] 3) High-Frequency Enhancement Module (HFE): PRNU fingerprints mainly exist in the high-frequency components of an image, but the high-frequency regions of natural images are often dominated by scene content such as edges and textures, which can easily interfere with fingerprint extraction. Therefore, this invention designs a high-frequency enhancement module to guide the model to focus on the high-frequency regions that are most informative about the fingerprint.
[0068] High-frequency mask generation: for input patch Performing a two-dimensional discrete wavelet transform (DWT) yields four subbands: LL (low-frequency approximation), LH (horizontal high frequency), HL (vertical high frequency), and HH (diagonal high frequency); the HH subband is then selected. This subband contains the highest frequency information; the HH subband is quantized, with the quantization interval set to... To reduce noise interference; select the highest amplitude from the HH subband after quantization. Pixel position (in this embodiment, it is taken as) These positions are marked as 1, and the rest as 0, to obtain a high-frequency mask with low-frequency resolution; this mask is then upsampled (e.g., by bilinear interpolation) to restore the original patch space resolution. ,get .
[0069] High-frequency enhancement branch: Simultaneously, for the original patch... High-frequency enhancement processing is performed to obtain an enhancement patch. The enhancement method can employ high-pass filtering (such as a Laplace filter) or frequency-domain high-pass filtering. In this invention, pass The high-frequency subbands are retained after wavelet transform and then inversely transformed to obtain the result.
[0070] Masked Pearson correlation loss: assuming the original patch fingerprint Enhanced patch fingerprint Flatten both into vectors and using a mask Calculate the mask mean:
[0071]
[0072] Then calculate the mask Pearson correlation coefficient:
[0073]
[0074] The final HFE loss is defined as:
[0075]
[0076] The meanings of the above parameters are as follows: Index of the currently processed image patch; The dimensions of the fingerprint feature map or mask after flattening ( The side length of the fingerprint feature map is shown in the embodiment. ); This is the dimension index of the flattened vector, with a value of [value]. ; For the first The high-frequency mask of the patch is flattened after the first patch. Each element is set to 1 to indicate that the position is a high-frequency pixel with the most information for fingerprint extraction, and 0 to indicate other positions. and These are the original patch fingerprint feature maps. and high-frequency enhanced patch fingerprint feature map The flattened first One element; and They are respectively within the mask area mean and Mean; It is a small constant used to avoid the denominator being zero (numerical stability); For the first The Pearson correlation coefficient between the original fingerprint and the enhanced fingerprint within the masked area for each patch; The mask must have at least one active position (i.e., at least one...) A collection of patches; This represents the number of patches in the set. By minimizing... The model maximizes the correlation between the original fingerprint and the enhanced fingerprint within the high-frequency mask region, thereby forcing the fingerprint extractor to maintain a consistent response to high-frequency content and enhancing its sensitivity to PRNU signals.
[0077] 4) Frequency Domain Fingerprint Regularization (FFR): To improve fingerprint diversity and robustness and avoid excessive concentration of fingerprint energy in certain frequency bands, this invention introduces a frequency domain regularization term to encourage a uniform distribution of fingerprint power spectral density in the frequency domain. For each fingerprint feature map in a batch... Calculate its two-dimensional discrete Fourier transform:
[0078]
[0079] in, For spatial coordinates, The coordinates are in the frequency domain. Then, the average power spectral density (PSD) of the batch is calculated:
[0080]
[0081] FFR loss is defined as the negative logarithm of the geometric mean of PSD to the arithmetic mean:
[0082]
[0083] When this loss is minimized, the geometric mean is close to the arithmetic mean, which means that the PSD distribution is more uniform, thereby preventing the fingerprint spectrum from being overly concentrated in certain frequencies and improving the robustness of the fingerprint to image compression, filtering and other operations.
[0084] 5) Joint loss function: The overall loss function of this invention is the weighted sum of the above three losses.
[0085]
[0086] In this embodiment, the weights are respectively set as .
[0087] 6) Fingerprint extraction and matching in the inference stage: The HF-Printer model can be applied to actual source camera recognition tasks and is divided into two stages.
[0088] Reference fingerprint construction: for each candidate device ,collect A regular image from this device ( Typically 3, 5, or 10. For each image, its fingerprint is extracted (the fingerprint feature map is directly taken after the model output, without additional post-processing), and then the average of these fingerprints is calculated as the reference fingerprint for the device. .
[0089] Query Image Recognition: For the query image to be recognized Similarly, input HF-Printer to extract its fingerprint. .calculate Reference fingerprint for each candidate device Normalized cross-correlation (NCC) between them:
[0090]
[0091] In the closed-set recognition task, the device with the largest NCC value is selected as the recognition result; in the open-set verification task, the NCC value is compared with a preset threshold. If it is greater than the threshold, it is determined to be from that device; otherwise, it is rejected.
[0092] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A camera PRNU fingerprint extraction method based on high-frequency enhancement, characterized in that, The method specifically includes the following steps: S1. Obtain a training image set, and crop each image in the training image set into multiple image patches of preset sizes; S2. Construct a fingerprint extraction network based on the Swin Transformer. The fingerprint extraction network is used to extract fingerprint feature maps from the input image patch. The fingerprint extraction network uses the SwinIR model as the backbone network, removes the reconstruction module of the SwinIR model, and directly uses the output of its deep feature extraction module as the fingerprint feature map. The fingerprint extraction network is initialized using weights pre-trained on the image denoising task. The SwinIR model is built based on the Swin Transformer block. SwinIR consists of a shallow feature extraction module and a deep feature extraction module, and the output of the deep feature extraction module is directly used as the fingerprint feature map. Specifically: input image patch First, shallow features are extracted using a convolutional layer. These shallow features are then passed through multiple residual SwingTransformer blocks, each containing window-based multi-head self-attention and shift-window multi-head self-attention to achieve cross-regional information interaction. Finally, a fingerprint feature map is output. ,in Number of channels; S3. Using a patch-level fingerprint contrast learning loss function, the fingerprint feature maps of different image patches from the same device are used as positive samples and the fingerprint feature maps of different image patches from different devices are used as negative samples to train the fingerprint extraction network in an unsupervised contrast learning manner. S4. Using the high-frequency enhancement module loss function, the fingerprint extraction network is guided to maximize the correlation between the original image patch fingerprint feature map and the high-frequency enhanced patch fingerprint feature map in the high-frequency region of the image indicated by the high-frequency mask. S5. The frequency domain fingerprint regularization loss function is used to constrain the power spectral density of the fingerprint feature map extracted by the fingerprint extraction network to be uniformly distributed in the frequency domain. S6. Based on the weighted sum of the patch-level fingerprint comparison learning loss function, the high-frequency enhancement module loss function, and the frequency domain fingerprint regularization loss function, a joint loss function is constructed, and the fingerprint extraction network is jointly optimized and trained using the joint loss function. S7. Input the query image to be identified and multiple reference images of the target device into the trained fingerprint extraction network, respectively, extract the corresponding query fingerprint feature map and reference fingerprint feature map, calculate the similarity between the query fingerprint feature map and the reference fingerprint feature map, and determine whether the source device of the query image to be identified is the target device based on the similarity.
2. The camera PRNU fingerprint extraction method based on high-frequency enhancement according to claim 1, characterized in that, In step S3, the patch-level fingerprint contrastive learning loss function is specifically as follows: S31. For each training batch, construct a sample set containing G device groups, each group containing M different image patches from the same device, for a total of N = G×M patches; S32, For any anchor patch Other equipment within the same equipment group One patch is considered a positive sample; all patches from different device groups are considered negative samples. S33. Calculate anchor patch using unsupervised contrastive learning loss. Comparative loss: in, This is the feature vector obtained after flattening the fingerprint feature map. and These are positive sample patches. and samples The corresponding flattened feature vector; anchor point The set of positive samples; It is a set that includes the anchor point itself and all negative samples; Cosine similarity; The temperature coefficient is used; the contrast loss for the entire batch is the average loss of all anchor points. By minimizing The model brings fingerprints from the same device closer together in the feature space and pushes fingerprints from different devices further apart, thereby learning device-specific fingerprint representations.
3. The camera PRNU fingerprint extraction method based on high-frequency enhancement according to claim 2, characterized in that, In step S4, the construction steps of the loss function of the high-frequency enhancement module include: S41. Patch the input original image. A two-dimensional discrete wavelet transform is performed to obtain the diagonal high-frequency subband HH; and a high-frequency mask is generated based on the diagonal high-frequency subband HH. The high-frequency mask is used to identify the positions of high-frequency pixels that provide the most information for fingerprint extraction; S42, For the original patch High-frequency enhancement processing is performed to obtain a high-frequency enhancement patch. ; S43. Input the original image patch and the high-frequency enhancement patch into the fingerprint extraction network respectively to obtain the original fingerprint. and enhanced fingerprints ; S44, Based on the high-frequency mask Calculate the Pearson correlation coefficient between the original fingerprint and the enhanced fingerprint in the masked region. ; S45. The loss function of the high-frequency enhancement module is defined as follows: in, A set of patches for which at least one location is active in the mask; by minimizing The model maximizes the correlation between the original fingerprint and the enhanced fingerprint within the high-frequency mask region, thereby forcing the fingerprint extractor to maintain a consistent response to high-frequency content and enhancing its sensitivity to PRNU signals.
4. The camera PRNU fingerprint extraction method based on high-frequency enhancement according to claim 3, characterized in that, In step S41, the high-frequency mask is generated as follows: the diagonal high-frequency subband HH is quantized, the first k% of pixels with the highest amplitude after quantization are marked as 1, and the rest are marked as 0, to obtain a high-frequency mask with low-frequency resolution, and then the original patch space resolution is restored by upsampling.
5. The camera PRNU fingerprint extraction method based on high-frequency enhancement according to claim 4, characterized in that, In step S5, the construction of the frequency domain fingerprint regularization loss function includes: S51. For each fingerprint feature map in the batch Perform a two-dimensional discrete Fourier transform to obtain its frequency domain representation. ; S52. Calculate the average power spectral density of the entire batch. ; S53. The frequency domain fingerprint regularization loss function is defined as the negative logarithm ratio of the geometric mean to the arithmetic mean of the average power spectral density: ,in, K Let be the side length of the fingerprint feature map. It is a small constant.
6. The camera PRNU fingerprint extraction method based on high-frequency enhancement according to claim 5, characterized in that, In step S6, the joint loss function is expressed as: in, These are the weights of each type of loss.
7. The camera PRNU fingerprint extraction method based on high-frequency enhancement according to claim 1, characterized in that, The reference fingerprint feature map of the target device is obtained by averaging the fingerprint feature maps corresponding to multiple reference images of the device; the similarity is calculated using normalized cross-correlation.
8. A camera PRNU fingerprint extraction system based on high-frequency enhancement, wherein the system performs the method according to any one of claims 1 to 7, characterized in that, The system includes: The data preprocessing module is used to acquire a training image set and crop each image in the training image set into multiple image patches of preset sizes; A fingerprint extraction network, built on the Swing Transformer, is used to extract fingerprint feature maps from input image patches; The patch-level contrastive learning module is used to perform unsupervised contrastive learning training on the fingerprint extraction network by using the patch-level fingerprint contrastive learning loss function, with fingerprint feature maps of different image patches from the same device as positive samples and fingerprint feature maps of image patches from different devices as negative samples. A high-frequency enhancement module is used to guide the fingerprint extraction network to maximize the correlation between the original image patch fingerprint feature map and the high-frequency enhanced patch fingerprint feature map in the high-frequency region of the image indicated by the high-frequency mask by employing a high-frequency enhancement module loss function. The frequency domain regularization module is used to constrain the power spectral density of the fingerprint feature map extracted by the fingerprint extraction network to be uniformly distributed in the frequency domain by using the frequency domain fingerprint regularization loss function. The joint training module is used to construct a joint loss function based on the weighted sum of the patch-level fingerprint contrast learning loss function, the high-frequency enhancement module loss function, and the frequency domain fingerprint regularization loss function, and to use the joint loss function to jointly optimize and train the fingerprint extraction network. The reasoning and recognition module is used to input the query image to be recognized and multiple reference images of the target device into the trained fingerprint extraction network, extract the corresponding query fingerprint feature map and reference fingerprint feature map, calculate the similarity between the two, and determine whether the source device of the query image to be recognized is the target device based on the similarity.
Citation Information
Patent Citations
Multi-feature fusion PRNU extraction method and device based on double-layer hybrid model
CN116977657A
Video source identification method combining PRNU matching and inter-frame geometric transformation estimation
CN120580459A