1
1. Introduction
Machine learning (ML) has enabled a large number of artificial intelligence (AI) applications,
including deep fakes. Usually, when people talk about deep fakes, they consider tasks like face
swapping or artificial face generation. In general, it covers anything that includes the generation
of data that looks real to humans. We have barely started to understand the implications that
these technologies have in society (m. Mustak et al., 2022) [1] or could have in the future (M.
Masood et al., 2022 ) [2]. Yet, we still do not know how to regulate them or what to do with and
about them. One side of this report seeks to remind the reader why these regulations are important.
Among these new implementations in ML, there is a technique called inpainting. Inpainting
enables automatic content creation (Ramesh et al., 2021) and manipulation (Yu et al., 2018) by
selecting a part of an image to be cleared out and getting an ML algorithm to fill it in. For example,
you can see in Figure 1 (a) the recent Bolsonaro supporter’s attack on the Brazilian Congress.
The same image on the right (b) shows one of these supports removed by inpainting. The inpainter
here does a very good job with very little effort. We know this because it took seconds to do it
ourselves mainly spent on creating a decent mask. This short anecdote about recreating a mask will
be important later in the report. For now, we know that it is hard for an untrained eye to tell that
this image was edited and even harder to where this edition occurred (we circled it in red for clarity).
Commonly now, people are using this technology to remove any type of information from im-
ages and videos. Yet, as remarked in our example, this can be done for malicious purposes.
Figure 1. Supporters (a) inpainted (b).
The felony we want to bring to light is copy-
righting. Particularly for this report, copy-
righting of artwork by watermark removals.
Watermarks were used in the past to protect
documents from being forfeited by imprinting
different water patterns as hidden signatures
of ownership. Today, the term is still used to
describe marks in digital data that intend to
protect them from being used illegally. Peo-
ple wishing to reuse an image without permis-
sion may want to remove the mark and restore
a plausible background in its place. For the
sake of this report, We will restrict all the pos-
sible data that can be watermarked to images
and artworks (i.e. not videos).
Image owners, already at risk of getting their material stolen, are also incentivized to ensure that
their work is not used in ways that they did not authorize. When such misuse occurs, technical
mechanisms are needed for demonstrating their ownership. Misused images and the mechanisms
to defend and deter unauthorized use are the main objectives of this report.
In ML literature, this is better known as Adversarial Attacking and Defending, which we will
expand on in the theoretical background. We will then explain the neural network (NN) architecture
implementations, divided into three main steps. First, we will use a NN to inpaint images, which will
constitute our attack. Then, we will fit a different NN able to, by implementing some perturbations,
we will make the watermark harder to remove, constituting our defense. Later, we will use a third
NN to classify the image as one with or without a watermark. Finally, we will analyze how
different parameters affect both the attack and the defense. Most interestingly, we will show how
the unification of these three NN constructs a Generative Adversarial Network (GAN) and what
this implies.