# Noise verification

Given a tested image $$J$$ and a verification key $$K = \left(k\_i\right)\_{1 \leq i \leq n}$$, the goal of noise verification is to recover and check the trails of noises in $$J$$ at all regions $$k\_i$$. For each $$k\_i$$, we pick an atomic enveloping region $$v\_i$$ determined by:

$$
v\_i \triangleq \left(x^{\mathtt{ul}}*i - \delta^{x}*{i}, y^{\mathtt{ul}}*{i} - \delta^{y}*i ,x^{\mathtt{lr}}*i + \delta^{x}*{i}, y^{\mathtt{lr}}*{i} + \delta^{y}*{i}\right)
$$

where $$\delta^{x}*{i}$$ and $$\delta^{y}*{i}$$ are the width and the height of $$k\_i$$:

$$
\delta^{x}\_{i} = x^{\mathtt{lr}}\_i - x^{\mathtt{ul}}*i + 1 \qquad \delta^{y}*{i} = y^{\mathtt{lr}}\_i - y^{\mathtt{ul}}\_i + 1
$$

Since any enveloping region is so small that spectral analysis cannot give reliable results, hence to filter the distortions of noises (i.e. the trails of high energy) we compare gradients of the region and the contained distortion region; one way to do that is using the Laplacian filter. Let $$abla^2$$ denote the Laplacian operator, calculate the mean of each enveloping region $$v\_i$$:

$$
\overline{v}*i = \frac{1}{\lvert v\_i \rvert} \sum\limits*{\left(x,y\right) \in v\_i} \left( \nabla^2 v\_i \right) \left(x,y\right)
$$

and the mean of corresponding distortion region:

$$
\overline{k}*i = \frac{1}{\lvert k\_i \rvert} \sum\limits*{\left(x,y\right) \in k\_i} \left( \nabla^2 v\_i \right) \left(x,y\right)
$$

where $$\lvert v\_i \rvert$$ and $$\lvert k\_i \rvert$$ are respectively the area of $$v\_i$$ and of $$k\_i$$. Then compare the deviation (c.f.\~\cref{equ:noise\_recovery,equ:noise\_difference}):

$$
e\_i \triangleq \lvert \overline{v}\_i - \overline{k}\_i \rvert
$$

with some energy threshold. Using the [noise tuning](https://docs.inferix.io/inferix-whitepaper/implementation/adaptive-noise-spreading), we experimentally accept the existence of the atomic watermarked $$w\_i$$ when $$e\_i \geq 5$$.

If there is a distortion region where the deviation $$e\_i$$ is lower than the threshold then the image $$J$$ is immediately rejected, otherwise $$J$$ is accepted.

***Remark.*** *From the construction of enveloping regions from distortion regions, the areas can be simply calculated by* $$\lvert k\_i \rvert = \delta^{x}*{i} \times \delta^{x}*{i}$$ *and* $$\lvert v\_i \rvert = 9 \times \lvert k\_i \rvert$$*.*

#### Figure 6: <a href="#fig_enveloping_region_laplacian" id="fig_enveloping_region_laplacian"></a>

<figure><img src="https://3032367557-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcE7ARktdPinaZgrdSJOX%2Fuploads%2F7pK5nXfgTr5NsPTuTsCp%2Fenveloping_region_laplacian.png?alt=media&#x26;token=d22f0418-f38b-4a9d-bfdc-42e599c6464e" alt=""><figcaption><p>Noise verification using Laplacian filter</p></figcaption></figure>

The figure on the left shows an enveloping region of size $$9 \times 9$$, its distortion region is of size $$3 \times 3$$ located at the center, numbers at each pixel are the RGB color values. The right one shows the enveloping region after applying the Laplacian convolution.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.inferix.io/inferix-whitepaper/implementation/noise-verification.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
