Estimating PRNU on Gaussian noise images #21

Closed
opened 2024-03-25 18:01:00 +01:00 by Benjamin_Loison · 6 comments

Should obtain the PRNU by averaging Gaussian noise images by definition.

Let us first try to proceed this way.

As PIL does not seem to allow us to easily see multiple images at the same time to compare them, let us use matplotlib to do so.

import matplotlib.pyplot as plt
import numpy as np

# Some example data to display
x = np.linspace(0, 2 * np.pi, 400)
y = np.sin(x ** 2)

fig, (ax1, ax2) = plt.subplots(1, 2)
fig.suptitle('Horizontally stacked subplots')
ax1.plot(x, y)
ax2.plot(x, -y)

plt.show()

Source: https://matplotlib.org/3.8.0/gallery/subplots_axes_and_figures/subplots_demo.html

Should compute RMS to see the estimated PRNU matches the actual one.

Related to #19.

Should obtain the PRNU by averaging Gaussian noise images by definition. Let us first try to proceed this way. As PIL does not seem to allow us to easily see multiple images at the same time to compare them, let us use matplotlib to do so. ```py import matplotlib.pyplot as plt import numpy as np # Some example data to display x = np.linspace(0, 2 * np.pi, 400) y = np.sin(x ** 2) fig, (ax1, ax2) = plt.subplots(1, 2) fig.suptitle('Horizontally stacked subplots') ax1.plot(x, y) ax2.plot(x, -y) plt.show() ``` Source: https://matplotlib.org/3.8.0/gallery/subplots_axes_and_figures/subplots_demo.html Should compute RMS to see the estimated PRNU matches the actual one. Related to #19.
Benjamin_Loison pinned this 2024-03-25 18:01:15 +01:00
Author
Owner

Showcase an example and now make a curve to make it clearer. Note that if want a maximum precision curve, may have to pay attention to complexity.

Showcase an example and now make a curve to make it clearer. Note that if want a maximum precision curve, may have to pay attention to complexity.
Author
Owner

Could render intermediary image differences, as it is easy to see an almost black uniform image but it is hard to compare 2 random images. However, this assumes that the color scale for each image is identical, which is probably not the case currently.

Could render intermediary image differences, as it is easy to see an almost black uniform image but it is hard to compare 2 random images. However, this assumes that the color scale for each image is identical, which is probably not the case currently.
Author
Owner
plt.title('Actual PRNU')
plt.imshow(prnus[0])
plt.show()
image = np.array(imagesWithPrnu[0][:1]).mean(axis = 0)
plt.title(f'First image with PRNU\ni.e. estimated PRNU\nRMS with actual PRNU = {round(rmsDiffNumpy(image, prnus[0]), 4)}')
plt.imshow(image)
plt.savefig('first_image_with_prnu.svg')

single_prnu_estimation_with_images_being_gaussian_noise_tight_layout

single_prnu_estimation_with_images_being_gaussian_noise

actual_prnu

first_image_without_prnu

first_image_with_prnu

mean_of_first_10_images_with_prnu

mean_of_first_100_images_with_prnu

mean_of_first_1_000_images_with_prnu

mean_of_first_10_000_images_with_prnu

Could make the PRNU actually show PRNU:

image

image

Maybe would have to consider the transparency and not anti-aliasing.

See prnu_written_as_such branch.

single_prnu_estimation_with_images_being_gaussian_noise_tight_layout

single_prnu_estimation_with_images_being_gaussian_noise

actual_prnu

first_image_without_prnu

first_image_with_prnu

mean_of_first_10_images_with_prnu

mean_of_first_100_images_with_prnu

mean_of_first_1_000_images_with_prnu

mean_of_first_10_000_images_with_prnu

```py plt.title('Actual PRNU') plt.imshow(prnus[0]) plt.show() ``` ```py image = np.array(imagesWithPrnu[0][:1]).mean(axis = 0) plt.title(f'First image with PRNU\ni.e. estimated PRNU\nRMS with actual PRNU = {round(rmsDiffNumpy(image, prnus[0]), 4)}') plt.imshow(image) plt.savefig('first_image_with_prnu.svg') ``` ![single_prnu_estimation_with_images_being_gaussian_noise_tight_layout](/attachments/447a1487-c4d6-4ae1-9c5e-3613ff7e6237) ![single_prnu_estimation_with_images_being_gaussian_noise](/attachments/74297d71-f7aa-411f-a22e-b45722d7329c) ![actual_prnu](/attachments/a0a2e89c-f961-45a5-a837-5d5f7046c8a6) ![first_image_without_prnu](/attachments/584472bc-2781-4962-91ca-d76ef724146e) ![first_image_with_prnu](/attachments/1c8c841b-4fdc-4f28-af88-adb67324b74b) ![mean_of_first_10_images_with_prnu](/attachments/86d3a12a-a21d-4cd5-94cf-3763add02e72) ![mean_of_first_100_images_with_prnu](/attachments/2cfcd922-ad25-4ebe-a1ae-ec21d55e96d5) ![mean_of_first_1_000_images_with_prnu](/attachments/9329108c-c3d1-4e67-abc8-a9da46ff98ee) ![mean_of_first_10_000_images_with_prnu](/attachments/d99511d2-2ce7-465a-8b07-c1af08011d75) Could make the PRNU actually show `PRNU`: ![image](/attachments/b2336d14-98db-4854-b2cd-7f68125849c9) ![image](/attachments/06d60ae3-7284-4c61-8267-0068e3a10271) Maybe would have to consider the transparency and not anti-aliasing. See [prnu_written_as_such](https://gitea.lemnoslife.com/Benjamin_Loison/Robust_image_source_identification_on_modern_smartphones/src/branch/prnu_written_as_such) branch. ![single_prnu_estimation_with_images_being_gaussian_noise_tight_layout](/attachments/5a3da1a1-4a51-4d80-b2b8-1733e1a7ba9e) ![single_prnu_estimation_with_images_being_gaussian_noise](/attachments/c8f7b7b6-2dc3-4926-9b50-2068d5c55c78) ![actual_prnu](/attachments/740c8cf3-06f4-4fc2-a85a-91480efaa4cb) ![first_image_without_prnu](/attachments/06e96790-97a3-4bba-a0b6-ca95586e7a4e) ![first_image_with_prnu](/attachments/7377834a-3e40-4bc2-9812-37af1ce58428) ![mean_of_first_10_images_with_prnu](/attachments/3de9187c-6f17-4675-a04a-40f08d9c043d) ![mean_of_first_100_images_with_prnu](/attachments/fefc1382-5d52-4b71-a625-f59ef65127e4) ![mean_of_first_1_000_images_with_prnu](/attachments/08d1308b-07e0-4552-8bed-84430b8185d7) ![mean_of_first_10_000_images_with_prnu](/attachments/0b7d9813-6d63-4094-8830-2cd053cd312e)
Author
Owner

rms_between_actual_prnu_and_the_mean_of_the_first_n_images_with_prnu

rms_between_actual_prnu_and_the_mean_of_the_first_n_images_with_prnu_log_x

rms_between_actual_prnu_and_the_mean_of_the_first_n_images_with_prnu_log_x_and_y

plt.xscale('log')
![rms_between_actual_prnu_and_the_mean_of_the_first_n_images_with_prnu](/attachments/1811d94d-d56b-427e-a3c8-13c4b63303ca) ![rms_between_actual_prnu_and_the_mean_of_the_first_n_images_with_prnu_log_x](/attachments/ac094db8-aa11-46f3-a08b-97fe71f2049c) ![rms_between_actual_prnu_and_the_mean_of_the_first_n_images_with_prnu_log_x_and_y](/attachments/63cbaf48-80a6-478d-9a3e-ee71a2c58a95) ```py plt.xscale('log') ```
Benjamin_Loison added the
epic
high priority
labels 2024-03-26 02:13:52 +01:00
Author
Owner

What is the next step?

Get closer to the real case with the 16 images of https://mcolom.perso.math.cnrs.fr/pages/no_noise_images/.
It is assumed that by their processing, these images do not sound. Thus we add a UNPR and potentially Gaussian noise and we hope that by defusing we will have on the one hand a noiseless image and on the other hand the UNPR, the Gaussian noise and an image residue. As a result, the UNPR will be retained but the Gaussian noise will cancel and it is hoped that the residual image by the number and diversity of scenes on the images will also cancel.
Note that the depressor, depending on the generation of the NRP, can interpret it as stage and therefore not be isolated as desired. To avoid this one can generate a UNPR more likely to be detected as noise by generating it as a Gaussian noise.

From Minutes Google Docs.

Translated with https://libretranslate.com.

What is the next step? > Get closer to the real case with the 16 images of https://mcolom.perso.math.cnrs.fr/pages/no_noise_images/. It is assumed that by their processing, these images do not sound. Thus we add a UNPR and potentially Gaussian noise and we hope that by defusing we will have on the one hand a noiseless image and on the other hand the UNPR, the Gaussian noise and an image residue. As a result, the UNPR will be retained but the Gaussian noise will cancel and it is hoped that the residual image by the number and diversity of scenes on the images will also cancel. Note that the depressor, depending on the generation of the NRP, can interpret it as stage and therefore not be isolated as desired. To avoid this one can generate a UNPR more likely to be detected as noise by generating it as a Gaussian noise. From `Minutes` Google Docs. Translated with https://libretranslate.com.
Author
Owner

As a result continue working at #25.

As a result continue working at #25.
Benjamin_Loison unpinned this 2024-03-28 16:00:23 +01:00
Benjamin_Loison pinned this 2024-03-28 16:00:35 +01:00
Benjamin_Loison unpinned this 2024-03-30 00:08:13 +01:00
Sign in to join this conversation.
No description provided.