<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Restoration of Archival Images Using Neural Networks</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Raphaela Heil</string-name>
          <email>raphaela.heil@it.uu.se</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Fredrik Wahlberg</string-name>
          <email>fredrik.wahlberg@lingfil.uu.se</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Dept. of Information Technology, Uppsala University</institution>
          ,
          <addr-line>Lägerhyddsvägen 1, 752 37 Uppsala</addr-line>
          ,
          <country country="SE">Sweden</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Dept. of Linguistics and Philology, Uppsala University</institution>
          ,
          <addr-line>Thunbergsvägen 3H, 751 26 Uppsala</addr-line>
          ,
          <country country="SE">Sweden</country>
        </aff>
      </contrib-group>
      <fpage>79</fpage>
      <lpage>93</lpage>
      <abstract>
        <p>Substantial parts of the image material of today's digital archives are of low quality, creating problems for automated processing using machine learning. These quality issues can stem from a multitude of reasons, ranging from damaged originals to the reproduction hardware. Modern machine learning has made automatic “restoration” or “colourization” readily available. Curators and scholars might want to “improve” or “restore” the original's quality to create engagement with the artefacts. However, a fundamental problem of the “restoration” process is that information must always be added to the original, creating reproductions with a synthesized extended realism.</p>
      </abstract>
      <kwd-group>
        <kwd>digitization</kwd>
        <kwd>digital restoration</kwd>
        <kwd>machine learning</kwd>
        <kwd>image processing</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>
        As our archives are housing ever-increasing volumes of digital material, the need for automated
processing is ever more evident. Automated processing for text search in photographed text
[
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], scribal attribution [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], and production year estimation [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] are becoming increasingly useful.
A common issue posing a significant problem to these endeavours is the quality of some digital
reproductions, where old cameras or damaged originals can prove to be impossible obstacles.
Digitized historical manuscripts sometimes contain a variety of reproduction deteriorations,
such as stains, discolouring and compression artefacts. Some examples of such degradations
to the image material are shown in Figure 1. While some types of deteriorations may not
impact the work of a trained scholar, they pose a significant challenge regarding legibility and
interpretability for both laypersons and computerized processing.
CEUR
(a)
(b)
(c)
(d)
(e)
      </p>
      <p>Generally, artefacts in digitized manuscripts can be divided into two distinct categories,
deteriorations inherent to the material and deteriorations introduced during the digitization
process. The former, deteriorations of type I, can often be attributed to the manuscript’s age,
archival conditions, or handling over time. This type of deterioration can typically be found in
all kinds of digitized, historical material. In contrast to these, deteriorations of type II are rooted
in the way a manuscript was digitized. Difering, or lack of, image capture protocols can result
in issues such as inconsistent illumination or viewpoint, as well as deteriorations caused by
the storage process, such as image compression artefacts and colour skewing. Type II is often
found in older digitizations, due to technological and procedural constraints. It can however
also occur while using modern imaging equipment, such as mobile phones. This classification
is not an absolute dichotomy, however, as in the case of some manuscripts on parchment that
would need to be flattened for proper photography. This would ruin the original in some cases,
where the spine was never designed to allow for being fully opened as the parchment aged.</p>
      <p>
        While the efect of both types of deteriorations can be reduced using classical image
processing approaches, these methods are usually highly specialized and require frequent human
intervention. They therefore have to be combined into complex pipelines, together with
detection of degradation type, and be specifically designed for subgroups of images within the same
book. These pipelines seldom generalize well and require both significant on-site expertise and
frequent quality inspections. This is both laborious and expensive. One solution for mitigating
some of the most common road blocks on the path to automatic processing is specialized
cleaning using machine learning [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], which we will focus on in this work.
      </p>
      <p>
        Another area where “enhancing” digital material is useful is for creating engagement with
museum audiences [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. This can include automatic colourization [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ], increasing image resolution
[
        <xref ref-type="bibr" rid="ref7">7</xref>
        ], or adding video frames [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]. A modern film camera doesn’t sufer from the blurriness coming
from long exposure time, uneven frame timing, or colour imbalances from chemically developing
the film 1. These limitations can largely be overcome using modern machine learning techniques
for video and image enhancement. Some audiences can perceive “enhanced” video as much
more engaging, as it looks like something that could have been filmed in the contemporary
world they experience. Old battlefields or everyday streets come to life, giving the onlooker a
sense of closeness to a lost era.
      </p>
      <p>1It does, however, sufer from rolling shutter efects, explaining why some mobile phone videos of helicopters
don’t show the rotors moving, but that’s outside our scope.</p>
      <p>A problem for the analysis and “enhancement” described above is that wherever information
is missing (colour, video frames, manuscript holes, etc.), it will have to be “guessed” and filled in.
This is nothing new to scholars studying any material, as an educated guess can be cultivated
though careful study, which is why we’d rather put our trust in a philologist or historian than a
layman when it comes to interpreting an incomplete manuscript (or even a complete one). We
use the provocative term “guess” here to illustrate the core issue: do you trust the “educated
guess” of a computer? This is the fundamental limitation of any computerized “enhancement”
technique, as we are forced to put our trust in an opaque process, driven by what often seems
like some esoteric mathematical magic. We will argue below that this trust should be a function
of the application area and not an automatic choice following from technological positivism.
Sometimes adding information to the reproduction of the original creates a “fake”, sometimes it
improves your analysis. This is also why we choose to put words implying improvement in
quotes throughout this paper.</p>
    </sec>
    <sec id="sec-2">
      <title>2. Restoration using machine learning</title>
      <p>To better explain the process of “restoring” images, and its limitations, we want to start with
discussing how images are created and represented in the machine. After this, we can go on to
more fully critique the processes and machine learning models of “restoration”.</p>
      <sec id="sec-2-1">
        <title>2.1. The nature of a digital image</title>
        <p>In the machine, a digital image is represented as coloured areas, called pixels, usually organized
in a quadratic grid structure2. If you zoom in on any photo, you will usually be able to see this
grid structure3. A digital camera creates an image by recording the energy from photons (light
particles) hitting the image sensor. These photons create a current in the sensor depending on
their number and frequency. This process is very similar to the light detection in an eye. Just
like in a human eye, there is specialized hardware that detects light of diferent frequency bands,
i.e. colours. The layout of the sensor matches the layout of the pixels in our digital photo.</p>
        <p>In the machine, the colours of an image are (usually) represented by intensities in three colour
bands for each pixel. These are red, green, and blue. The choice of the colour representation is
a trade-of between what a human can see and the technical limitations of computer screens.
As there are a lot of colours in the world humans can’t see, there is no need for us to fill our
camera storage with this information. The colour band intensities are, for historical reasons,
most often represented as three integer numbers between 0 and 255. This allows us to, for
example, encode a pixel in cornflower blue, with colour intensities [100, 149, 237], as the binary
number 011001001001010111101101. This binary number is what is actually stored in the
computer’s memory. An illustration of the colour bands is shown in Figure 2, where the three
colours have been separated into images for the respective colour bands. The left-most image
in the figure is a detail of a cherry blossom, created by putting the three images to the right on
top of each other. If you zoom in on the respective colour channel images, you can read (as</p>
        <sec id="sec-2-1-1">
          <title>2While other types of image grids exist, they are very rare.</title>
          <p>3This statement is not entirely true, as some devices interpolate “intelligently” by add pixels to your photos
when zooming in.
an illustration) the intensity values for each pixel. Another important point illustrated by the
cherry blossom image is that it is often very hard to identify the content of a digital image from
a close-up. While avoiding getting too philosophical, it is beneficial to remember that the digital
image only serves as an inspiration for the image conjured up in our brains. While humans
have this ability for working with images and interpreting the three-dimensional world from
a two-dimensional reproduction, the computer has no such evolutionary history or obvious
way to learn. Luckily for us, computerized image analysis, a subfield of computer science and
mathematics, has been working for decades on building a stack of algorithms which lets us go
from the binary ones and zeros in memory, to the image manipulation of modern processing
software.</p>
          <p>Older camera film only allowed for diferent greyscale colour schemes. When colourizing
such images today, it can be hard to know what the original colour was. As humans, we can
often infer the colour from context. We would recognize the Union Jack in a World War 1 image
and fill in the colours in our minds. When doing a digital conversion to greyscale from the three
RGB colour channels, we mix the colour intensities as 0.299 ⋅  + 0.587 ⋅  + 0.114 ⋅  , where the
letters (r, g, b) are intensity values for their respective colour channel. This gives a greyscale
intensity corresponding to the original colour. There are, however, many triplets of r, g, and b
that give the same greyscale intensity. In Figure 3, we have taken the Swedish flag (top left) and
converted it to greyscale (top right). We then did the same thing with the Scania flag (bottom
left), which is a mix of the Swedish and Danish flags. It turned out that the Swedish and the
Scania flags look the same in greyscale (top and bottom right). This problem becomes almost
impossible to solve when we have less contextual clues, e.g., embroidery on traditional clothing
or petals of extinct flowers.</p>
          <p>To overcome this problem, a machine learning model for automatic colourization would have
to infer colour information from image content. This opens for new challenges, like identifying
objects in the image and correlating how they look to some training material. Luckily, this is
precisely what has been done.</p>
        </sec>
      </sec>
      <sec id="sec-2-2">
        <title>2.2. Generative machine learning models</title>
        <p>In the field of machine learning, the word “model” is an abstract category of algorithms and
processes that describe some set of data. In its simplest form, a model can be a spam filter
that finds particular words or phrases, and then classifies an email as junk mail. A popular
distinction between artificial intelligence (AI) and machine learning (ML) is that the former is a
cleverly designed algorithm, while the latter is cleverly designed to learn from a set of training
data. This means that while an old, AI-based, spam filter would be given specific search terms
and phrases, a spam filter built on ML is trained on a set of emails that a human has labelled as
junk mail or not. The ML-based spam filter would then try to generalize from training data
collected “in the wild”. This gives the ML model the advantage of being able to determine its
own set of classification rules that are relevant to the task, without having to rely on extensive
human eforts. A fundamental characteristic of an ML model is that it must be trained, which
can be quite expensive in terms of data and processing power.</p>
        <p>Generally, machine learning models are grouped into two major categories, discriminative
and generative models. The former deliver categorizations, or classifications, given some data.
The initial spam filter example, is a discriminative model, as it does not describe what an email
might look like, but only makes a decision whether an email should end up in your junk folder.
It can only go in one direction: email input to categorization. This is in contrast to generative
models, which, as the name indicates, might be able to generate a full, authentic-looking, email
that would be classifiable as either spam or not spam.</p>
        <p>
          Various strategies have been proposed to create generative models, however the approach
that is relevant to this paper is adversarial training[
          <xref ref-type="bibr" rid="ref9">9</xref>
          ]. Generative adversarial networks (GANs)
are a group of models that aim to generate synthetic data, e.g. images, that would plausibly fit
into a collection of real examples, also called the domain of the task. The domain of a spam filter
is emails, but the domain where GANs excel is images of natural scenes. Generally, these models
consist of two main components, a generator and an adversarial discriminator, that are placed
in competition with each other during the learning phase. In this competition, on the one side,
the generator tries to create synthetic, albeit plausible data, e.g. images, from the target domain.
On the other hand, the discriminator is tasked with identifying whether a presented piece of
data is real, i.e. taken from the target domain, or fake, i.e. produced by the generator. Both
competitors try to “outsmart” each other by improving their performance on the respective
task. In the ideal case, the generator will reach a generative quality at which the discriminator
cannot distinguish real from fake. The generator can then be used to create fake images, and is
often so good at doing this that humans are fooled. Note that the training data doesn’t need to
be strongly curated, one only needs to make sure that the GAN has enough images from the
intended domain. As an illustration of this, Figure 4 shows some synthetic images generated
with the methodology above. All of the depicted images of people and animals were generated
using a model called StyleGAN2 [
          <xref ref-type="bibr" rid="ref10 ref11">10, 11</xref>
          ].
        </p>
        <p>The outlined general idea of GANs can be put into a real-world context by considering the
analogy of an art student and a critic, where the former takes the role of the generator, creating
paintings, while the latter represents the discriminator, determining whether an artefact is
worthy of a spot in the town’s art gallery4. At the start of the training phase (in our analogy),
both our student and critic start out by being completely unskilled at their respective crafts.
Hence, the critic’s job is fairly easy in the beginning. To make this analogy work, our critic must
be excellent at giving feedback to the student on how they can improve. The critic will now
pick up paintings randomly from either some collection of acceptable art, the domain, or some
paintings made by the student. After careful deliberation, our critic will make a decision on if
this is acceptable art. If the randomly picked painting was made by our student, the critic will
give them feedback on how to create art that looks more like the paintings in the domain. This
process will then continue until our critic, who is constantly getting better at their work, can
no longer distinguish the domain paintings from at artwork by our student. If this was more
than an analogy, an objection to this setup might be that the student isn’t really encouraged to</p>
        <sec id="sec-2-2-1">
          <title>4Goodfellow et al. describe these roles as counterfeiters and police, respectively [9]</title>
          <p>be creative, i.e. actually create art. This is true for the machine learning model too. The model
doesn’t learn creativity, it learns to imitate.</p>
          <p>
            It should be noted that machine learning is an applied field in the sense that models are
researched and trained in order to solve some task. It is widely accepted that “all models are
wrong, but some are useful” [
            <xref ref-type="bibr" rid="ref12">12</xref>
            ]. When a model learns to imitate some training data, the type of
data that is imitated is of crucial importance to “enhancement” using the adversarial generative
techniques described above. Let’s say we have a photo, taken in the 1930s. It is blurry and in
greyscale. One way of “enhancing” the quality of this photo is to make the generative model find
an image, with both high resolution and colour, that matches our original. How do we determine
the best match? We can think of this as the model generating images, we convert them to blurry
greyscale, and then compare, pixel by pixel, to the original. Note that some operations that
are very time-consuming for a human can be well adapted to a computer’s capabilities. After
some searching we could always find multiple images that, after conversion, would match the
original. This is unavoidable, as the original simply doesn’t contain the information needed to
“enhance” detail, e.g., if there is a person in the background or just a trick of the light. Though
the “enhanced” photograph can be very convincing, as we show in Figure 4, this should not
be taken as evidence for that it shows something that is not conjured up by the model, like in
some American crime dramas. However, if the model has been trained on images very much
like the original, perhaps through high quality modern re-enactment or some timeless physical
phenomenon, it is likely to synthesize something highly plausible.
          </p>
        </sec>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>3. Cycle-consistent Generative Adversarial Networks (CycleGANs)</title>
      <p>
        In order to “restore” degraded archival manuscript pages, we propose to employ a type of
GAN, commonly referred to as cycle-consistent generative adversarial networks (CycleGANs)
[
        <xref ref-type="bibr" rid="ref13">13</xref>
        ]. These models have found prior applications in a variety of image translation tasks, such
as the presentation of photos in the style of famous classical painters, e.g. Van Gogh [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ],
the transformation of images like portraits and animal photos to traditional Japanese flower
arrangements [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ] and the removal of strike-through artefacts from handwritten words [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ].
Additionally, CycleGANs have been used to remove certain degradations, such as stains and
watermarks, from printed documents [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ].
      </p>
      <p>The general structure of a CycleGAN is illustrated in Figure 5, using the task of image
restoration as an example. Concretely, this approach consists of two regular GANs that are
trained in conjunction with each other. As shown in the illustration, each of the two generators,
named ‘restore’ and ‘degrade’, are concerned with generating restored, respectively degraded,
images. Discriminator A assesses whether a given clean images is a genuine high-quality one or
was created by the generator, while discriminator B determines whether a presented degradation
is genuine or generated.</p>
      <p>To demonstrate the flow of images through the system, we trace the path of a degraded
image in the following (Figure 5, left). Initially, the degraded image is fed into the generator
‘restore’, which uses it as a basis to produce a restored image. This image is then assessed by
the discriminator A. In addition to this, it is processed by generator ‘degrade’, which returns it
real generated
real restored?
(discriminator A)
cycle
similarity
cycle
similarity
restore
degrade
restore
degrade
generated real
real degraded?
(discriminator B)
to a degraded state. Besides the discriminator’s assessment, feedback regarding the generation
quality is provided to ‘restore’ by comparing the original input image with the restored and
subsequently degraded image. The latter comparison aims for a high similarity, which is referred
to as cycle-consistency, hence the name of the model.</p>
      <p>In parallel to this pass, a second cycle takes place, starting from a clean image. This process is
shown on the right in Figure 5, following the clean input image through the generator ‘degrade’
to a degraded output and back through generator ‘restore’ to a restored image, to close the cycle
via a comparison of the latter with the input. The same feedback mechanisms as in the first
cycle are applied to the respective generator, using the respective discriminator.</p>
      <p>
        Various implementation for the generators and discriminators exist and are often, to some
degree, determined by the task at hand. In this work, we employ dense U-Nets [
        <xref ref-type="bibr" rid="ref17">17</xref>
        ], via the
implementation from [
        <xref ref-type="bibr" rid="ref18">18</xref>
        ] for the generators and the traditional discriminators, proposed by
[
        <xref ref-type="bibr" rid="ref13">13</xref>
        ].
3.1. Data
In order to train and evaluate the proposed approach, we randomly selected 17 manuscripts
from Manuscripta5, a digital collection of medieval and early modern manuscripts, provided by
the National Library of Sweden. The selected manuscripts are dated between ca. 1300 and ca.
1526 and contain texts in Old Swedish. A total of 150 pages were randomly selected from these
manuscripts and split into 75 pages for the training, 25 for the validation and 50 for the test
set. While preparing these splits, we ensured that images from one manuscript would only be
present in exactly one split, in order to avoid information leakage.
      </p>
      <p>With the aim of closely representing real archival image conditions, we consider the following
artificial degradations (cf. Figure 1) in our experiments:
JPEG Compression Page images are converted to a JPEG representation with varying
compression levels, randomly sampled from the range [65,85].</p>
      <p>Greyscale</p>
      <p>
        The standard, weighted greyscale transformation is applied to the input image.
Microform Firstly, the given image is converted to greyscale, following the same weighted
approach as above. Subsequently, the contrast is adjusted via a sigmoid correction [
        <xref ref-type="bibr" rid="ref19">19</xref>
        ]. Lastly,
the illumination of the microform during digitisation, is simulated by superimposing a mask
which darkens the image towards the edges.
      </p>
      <p>
        Warping A small elastic transformation [
        <xref ref-type="bibr" rid="ref20">20</xref>
        ], with alpha and sigma randomly drawn from
[
        <xref ref-type="bibr" rid="ref15">15,25</xref>
        ], respectively [
        <xref ref-type="bibr" rid="ref4 ref6">4,6</xref>
        ] is applied, resulting in warping and slight displacements of the image
content.
      </p>
      <p>
        Following the taxonomy of degradations, outlined in the introduction, Warping can be
categorised as type I, while the other three are examples of type II. Regarding the altered images,
it should be noted that JPEG Compression and Warping produce RGB images, while Greyscale
and Microform result in single-channel representations. For ease of training, outputs from the
latter two transformations are repeated three times and stacked, to result in a three-channel
format. Implementations for JPEG Compression, Greyscale and Warping were provided by [
        <xref ref-type="bibr" rid="ref21">21</xref>
        ],
while Microform is a custom implementation. The code can be found in the accompanying
repository (cf. Appendix A).
      </p>
      <p>For the preparation of the validation set, each page was altered individually by each of the
four outlined approaches. Subsequently, one patch random patch of size 256 by 256 pixels was
cropped from each page, for each of the four augmentations. This results in a set of 100 image
patches, each of which are stored together with the corresponding patch from the unaltered
page, for comparison.</p>
      <p>The test set was prepared in a similar fashion, however instead of a single patch per page
and augmentation, ten random, disjoint, i.e. not overlapping, patches were selected, resulting
in a total of 2000 patches.</p>
      <sec id="sec-3-1">
        <title>3.2. Neural Network Training Protocol</title>
        <p>
          We train the outlined CycleGAN for a total of 60 epochs, using the Adam [
          <xref ref-type="bibr" rid="ref22">22</xref>
          ] optimizer with a
learning rate of 0.001. Each epoch entails the sampling with replacement of 300 pages from the
training set. 50 percent of these are artificially deteriorated, using a randomly selected approach
from the ones outlined above, while the other 50 percent are left unaltered. One randomly
located, square patch of width 256px is cropped from each of the 300 pages. Deteriorated
patches are input into generator ‘restore’ and discriminator B, while clean ones are supplied to
generator ‘degrade’ and discriminator A. Following each training epoch, we assess the restoration
performance on images from the validation set, via the Root-Mean-Square Error (RMSE) and
the Structural Similarity Index Measure (SSIM)[
          <xref ref-type="bibr" rid="ref23">23</xref>
          ]. The model checkpoint exhibiting the best
validation performance is retained and used for evaluation on the test set.
Degradation
        </p>
        <p>Degraded SSIM
Microform
Greyscale
Warping</p>
        <p>JPEG
Overall</p>
      </sec>
      <sec id="sec-3-2">
        <title>3.3. Evaluation</title>
        <p>In order to evaluate the “restoration” performance of our proposed approach, the chosen model
checkpoint was applied to all patches in the test set. A hand-picked selection of model outputs,
one per degradation type, is shown in Figure 6 (bottom row), together with the original state of
the patch (top row) and the altered version that was provided as input to the ‘restore’ generator
(middle row).</p>
        <p>As can be seen from the samples, the generator successfully transforms the microform and
greyscale patches into coloured images. The range of displayed colours is slightly diminished,
one could say muted, as compared to the original images, however none of the patches display
extreme or unexpected colours. For the warped patch, a de-warping efect is not immediately
apparent, however it can be noted that the generator has adapted the colour slightly. A similar
colour efect can be observed for the JPEG-compressed patch. In contrast to the warped one,
however, a “restoration” efect, in the form of smoothing, and reduction of blocking and ringing
artefacts, is visible. Overall, the above observations hold for the majority of the test patches of
types microform, greyscale and warping. Results for the JPEG compression are more diverse in
quality, but some level of improvement or smoothing is generally observable.</p>
        <p>To provide a more comprehensive overview over the model’s “restoration” performance,
Figure 7 illustrates two samples for which the generator provides a convincing “reconstruction”
of the background colour but fails to correctly represent the use of red ink, visible in the original
patch. These examples tangibly demonstrate how the extent of the training data can influence
the model’s “restoration” performance. As red ink is used sparingly, only to highlight selected
words or phrases, it is not represented as frequently in the training data as regular, black ink. The
model will therefore exhibit a strong tendency to colour darker areas, generally corresponding
to some form of ink in the microform and greyscale images, in black or darker greys instead of
other potential ink colours. Training the model on a dataset with more diverse shades of ink
would potentially mitigate this issue.</p>
        <p>Besides the qualitative evaluation, we also present a brief quantitative analysis below. Table 1
shows the RMSE and SSIM values for the altered and the “restored” patches, each calculated
with respect to the ground truth. Notably, the measures only improve for “restored” patches
in the case of microform degradations. In all other cases, the performance appears to drop
by one to five percentage points. Considering that a large portion of the qualitative results
are perceived as reasonable restorations, this raises the question of how the qualitative and
quantitative results can be consolidated and put into context with each other.</p>
        <p>A major aspect to consider, when it comes to the evaluated metrics, is that these require a
concrete reference image, or ground truth, to compare with. Herein, however, lies the crux
of the restoration problem: the true original data is not available. One can only attempt to
obtain an approximation of the truth by making “educated guesses” based on existing clean
and artificially altered data. It can therefore be argued that, while these metrics can be useful
to get a general idea of the similarity and thereby of a certain degree of quality in the context
of artificial data, they should not be considered in isolation. Instead, they should be combined
with the qualitative results and examined by experienced scholars in an appropriate context.</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>4. Discussion &amp; Conclusion</title>
      <p>With the continued increase in computational power and capabilities of machine learning
approaches, many opportunities arise in the humanities. These methods can not only facilitate
novel research questions, but also provide opportunities for engaging with the public. As
demonstrated above, machine learning (ML) can act as a convenient tool, but should not be
used carelessly or trusted blindly. In order to “restore” information, any model will have to
make an educated guess, based on the data it is presented during training. Through this, the
“restorations” run the risk of becoming copies of the training data, instead of approximations of
the true original form, which we are aiming for in the case of image enhancements.</p>
      <p>The incorporation of undesired pieces of information in a “restoration” can have a considerable
detrimental efect when research questions should be answered using the processed data. A
wrong representation or interpretation will afect the results and conclusions. This efect also
has to be considered when data is being refined for consumption by laypersons, for example in
the form of an exhibition or teaching material. It is crucial to ensure that the “reconstructions”
allow observers to get an appropriate idea of the information and its implications. The initial
example of the colour “restoration” of the greyscale flag (cf. Figure 3) serves as a cautionary
tale here: whether the Swedish or the Scanian flag is presented to an audience, whatever level
of expertise they may hold, could considerably afect their interpretation of the context and any
conclusions they draw from it.</p>
      <p>As argued above, generative modelling in machine learning can create digital images of
impressing fake realities. This is done through a process of learning to imitate a domain of real
images, e.g., human faces or landscapes. For museums, “enhancing” historical photographs or
iflm has the potential to create engagement with older image material. As with any generative
model, the frames that are filled in, or the pixels that are added, take their inspiration from both
the original and the image material in the training set of the machine learning method. Hence,
the historical material is merged with modern material to create a synthetic high-quality image.
As such, small details in a historical photograph will be “filled in” by data from the training
images in its high-quality counterpart. How can we be confident that the computer made the
correct choice when filling in this information? If the training data is modern, a square object
in someone’s hand might get interpreted as a mobile phone, whereas originally, it may have
been a cigarette case. When a model is used for sensitive material, the information that it is
trained on therefore needs to be curated carefully.</p>
      <p>Generative modelling for image “enhancement” is likely to get better and less expensive in
the coming years. Making historical film look like it was taken with modern equipment, like
Peter Jackson did with World War 1 footage in “They shall not grow old”, is likely to become
ubiquitous in museums. As computer scientists, we want to caution against using such methods
uncritically. The temptation of technological positivism is strong, with a substantial hype
around “artificial intelligence” (what we here call machine learning). It’s always warranted
to ask about which training data we are “enhancing” from. What do they include, and more
importantly, what type of images or people are not included in the training data? The choice
of using machine learning “enhancement”, and which data to base it on, must follow from the
intended application area. If it improves text recognition, “enhancement” can be used fairly
safely, as the risk of accidentally adding plausible words is very low. If you are going to improve
historical photography, however, make sure the model was trained on similar material to yours.
If you want to make out details that weren’t really visible in the original, you are not working
with the original any more, and your results will be based on a synthetic reality. This last case is
the most important, as there are a lot of imaging applications where super-resolution is viable.
This does not apply to historical imagery, as the material is much more diverse than CT scans
or cartoons. As is often the case with new technology, the potential is great and intriguing.
However, in a world of believable synthetics and deepfakes, the need for a trained human eye
and careful curation has never been greater.</p>
    </sec>
    <sec id="sec-5">
      <title>Acknowledgments</title>
      <p>The computations were enabled by resources provided by the Swedish National Infrastructure
for Computing (SNIC) at Chalmers Centre for Computational Science and Engineering (C3SE)
partially funded by the Swedish Research Council through grant agreement no. 2018-05973.</p>
      <p>This work is partially supported by Riksbankens Jubileumsfond (RJ) under the project “New
Eyes on Sweden’s Medieval Scribes”, Dnr NHS14-2068:1. A special thanks to the PI, professor
Lasse Mårtensson.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>T.</given-names>
            <surname>Wilkinson</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Lindstrom</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Brun</surname>
          </string-name>
          ,
          <string-name>
            <surname>Neural</surname>
          </string-name>
          ctrl-f:
          <article-title>Segmentation-free query-by-string word spotting in handwritten manuscript collections</article-title>
          ,
          <source>in: Proceedings of the IEEE International Conference on Computer Vision</source>
          (ICCV),
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>A.</given-names>
            <surname>Brink</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Smit</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Bulacu</surname>
          </string-name>
          , L. Schomaker,
          <article-title>Writer identification using directional ink-trace width measurements</article-title>
          ,
          <source>Pattern Recognition</source>
          <volume>45</volume>
          (
          <year>2012</year>
          )
          <fpage>162</fpage>
          -
          <lpage>171</lpage>
          . URL: https: //www.sciencedirect.com/science/article/pii/S0031320311002810. doi:https://doi.org/ 10.1016/j.patcog.
          <year>2011</year>
          .
          <volume>07</volume>
          .005.
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>S.</given-names>
            <surname>Boldsen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Wahlberg</surname>
          </string-name>
          ,
          <article-title>Survey and reproduction of computational approaches to dating of historical texts</article-title>
          ,
          <source>in: Proceedings of the 23rd Nordic Conference on Computational Linguistics (NoDaLiDa)</source>
          , Linköping University Electronic Press, Sweden, Reykjavik, Iceland (Online),
          <year>2021</year>
          , pp.
          <fpage>145</fpage>
          -
          <lpage>156</lpage>
          . URL: https://aclanthology.org/
          <year>2021</year>
          .nodalida-main.
          <volume>15</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>R.</given-names>
            <surname>Heil</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E.</given-names>
            <surname>Vats</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Hast</surname>
          </string-name>
          ,
          <article-title>Paired image to image translation for strikethrough removal from handwritten words</article-title>
          ,
          <year>2022</year>
          . arXiv:
          <volume>2201</volume>
          .09633,
          <string-name>
            <surname>Under</surname>
            <given-names>review</given-names>
          </string-name>
          <source>at DAS</source>
          <year>2022</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>H.</given-names>
            <surname>Sommer</surname>
          </string-name>
          ,
          <article-title>Assessing millennial engagement in museum spaces</article-title>
          ,
          <source>in: Theory and Practice</source>
          <volume>1</volume>
          ,
          <string-name>
            <given-names>The</given-names>
            <surname>Museum</surname>
          </string-name>
          <string-name>
            <surname>Scholar</surname>
          </string-name>
          ,
          <year>2018</year>
          . URL: http://articles.themuseumscholar.org/tp_vol1sommer.
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>G.</given-names>
            <surname>Larsson</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Maire</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G.</given-names>
            <surname>Shakhnarovich</surname>
          </string-name>
          ,
          <article-title>Learning representations for automatic colorization</article-title>
          ,
          <year>2017</year>
          . arXiv:
          <volume>1603</volume>
          .
          <fpage>06668</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>C.</given-names>
            <surname>Dong</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C. C.</given-names>
            <surname>Loy</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>He</surname>
          </string-name>
          ,
          <string-name>
            <given-names>X.</given-names>
            <surname>Tang</surname>
          </string-name>
          ,
          <article-title>Image super-resolution using deep convolutional networks</article-title>
          ,
          <source>CoRR abs/1501</source>
          .00092 (
          <year>2015</year>
          ). URL: http://arxiv.org/abs/1501.00092. arXiv:
          <volume>1501</volume>
          .
          <fpage>00092</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>S.</given-names>
            <surname>Niklaus</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Liu</surname>
          </string-name>
          ,
          <article-title>Context-aware synthesis for video frame interpolation</article-title>
          ,
          <source>in: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR)</source>
          ,
          <year>2018</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>I. J.</given-names>
            <surname>Goodfellow</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Pouget-Abadie</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Mirza</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Xu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Warde-Farley</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Ozair</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Courville</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Bengio</surname>
          </string-name>
          , Generative adversarial networks,
          <year>2014</year>
          . arXiv:
          <volume>1406</volume>
          .
          <fpage>2661</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>T.</given-names>
            <surname>Karras</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Laine</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.</given-names>
            <surname>Aila</surname>
          </string-name>
          ,
          <article-title>A style-based generator architecture for generative adversarial networks</article-title>
          ,
          <year>2019</year>
          . arXiv:
          <year>1812</year>
          .04948.
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>T.</given-names>
            <surname>Karras</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Laine</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Aittala</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Hellsten</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Lehtinen</surname>
          </string-name>
          , T. Aila,
          <article-title>Analyzing and improving the image quality of stylegan</article-title>
          ,
          <year>2020</year>
          . arXiv:
          <year>1912</year>
          .04958.
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>G. E. P.</given-names>
            <surname>Box</surname>
          </string-name>
          , Science and statistics,
          <source>Journal of the American Statistical Association</source>
          <volume>71</volume>
          (
          <year>1976</year>
          )
          <fpage>791</fpage>
          -
          <lpage>799</lpage>
          . doi:
          <volume>10</volume>
          .1080/01621459.
          <year>1976</year>
          .
          <volume>10480949</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <surname>J.-Y. Zhu</surname>
            , T. Park,
            <given-names>P.</given-names>
          </string-name>
          <string-name>
            <surname>Isola</surname>
            ,
            <given-names>A. A.</given-names>
          </string-name>
          <string-name>
            <surname>Efros</surname>
          </string-name>
          ,
          <article-title>Unpaired image-to-image translation using cycleconsistent adversarial networks</article-title>
          ,
          <source>in: Proceedings of the IEEE International Conference on Computer Vision</source>
          (ICCV),
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14]
          <string-name>
            <given-names>C. H.</given-names>
            <surname>Mai</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Nakatsu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Tosa</surname>
          </string-name>
          ,
          <article-title>Developing japanese ikebana as a digital painting tool via ai</article-title>
          , in: N. J.
          <string-name>
            <surname>Nunes</surname>
            , L. Ma,
            <given-names>M.</given-names>
          </string-name>
          <string-name>
            <surname>Wang</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          <string-name>
            <surname>Correia</surname>
            ,
            <given-names>Z.</given-names>
          </string-name>
          Pan (Eds.),
          <source>Entertainment Computing - ICEC 2020</source>
          , Springer International Publishing, Cham,
          <year>2020</year>
          , pp.
          <fpage>297</fpage>
          -
          <lpage>307</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          [15]
          <string-name>
            <given-names>R.</given-names>
            <surname>Heil</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E.</given-names>
            <surname>Vats</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Hast</surname>
          </string-name>
          ,
          <article-title>Strikethrough removal from handwritten words using cyclegans</article-title>
          , in: J.
          <string-name>
            <surname>Lladós</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          <string-name>
            <surname>Lopresti</surname>
          </string-name>
          , S. Uchida (Eds.),
          <source>Document Analysis and Recognition - ICDAR 2021</source>
          , Springer International Publishing, Cham,
          <year>2021</year>
          , pp.
          <fpage>572</fpage>
          -
          <lpage>586</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          [16]
          <string-name>
            <given-names>M.</given-names>
            <surname>Sharma</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Verma</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Vig</surname>
          </string-name>
          ,
          <article-title>Learning to clean: A gan perspective</article-title>
          , in: G. Carneiro, S. You (Eds.),
          <source>Computer Vision - ACCV 2018 Workshops</source>
          , Springer International Publishing, Cham,
          <year>2019</year>
          , pp.
          <fpage>174</fpage>
          -
          <lpage>185</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          [17]
          <string-name>
            <given-names>S.</given-names>
            <surname>Jégou</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Drozdzal</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Vazquez</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Romero</surname>
          </string-name>
          ,
          <string-name>
            <surname>Y. Bengio,</surname>
          </string-name>
          <article-title>The one hundred layers tiramisu: Fully convolutional densenets for semantic segmentation</article-title>
          ,
          <source>in: 2017 IEEE Conference on Computer Vision and Pattern Recognition Workshops (CVPRW)</source>
          ,
          <year>2017</year>
          , pp.
          <fpage>1175</fpage>
          -
          <lpage>1183</lpage>
          . doi:
          <volume>10</volume>
          .1109/CVPRW.
          <year>2017</year>
          .
          <volume>156</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          [18]
          <string-name>
            <given-names>N.</given-names>
            <surname>Pielawski</surname>
          </string-name>
          ,
          <source>OctoPyTorch: Segmentation Neural Networks</source>
          ,
          <year>2021</year>
          . URL: https://github. com/npielawski/octopytorch.
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          [19]
          <string-name>
            <given-names>G. J.</given-names>
            <surname>Braun</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M. D.</given-names>
            <surname>Fairchild</surname>
          </string-name>
          ,
          <article-title>Image lightness rescaling using sigmoidal contrast enhancement functions</article-title>
          ,
          <source>Journal of Electronic Imaging</source>
          <volume>8</volume>
          (
          <year>1999</year>
          )
          <fpage>380</fpage>
          -
          <lpage>393</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          [20]
          <string-name>
            <given-names>P.</given-names>
            <surname>Simard</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Steinkraus</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Platt</surname>
          </string-name>
          ,
          <article-title>Best practices for convolutional neural networks applied to visual document analysis</article-title>
          ,
          <source>in: ICDAR</source>
          ,
          <year>2003</year>
          . doi:
          <volume>10</volume>
          .1109/ICDAR.
          <year>2003</year>
          .
          <volume>1227801</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref21">
        <mixed-citation>
          [21]
          <string-name>
            <surname>A. B. Jung</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          <string-name>
            <surname>Wada</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          <string-name>
            <surname>Crall</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          <string-name>
            <surname>Tanaka</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          <string-name>
            <surname>Graving</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          <string-name>
            <surname>Reinders</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          <string-name>
            <surname>Yadav</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          <string-name>
            <surname>Banerjee</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          <string-name>
            <surname>Vecsei</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          <string-name>
            <surname>Kraft</surname>
            ,
            <given-names>Z.</given-names>
          </string-name>
          <string-name>
            <surname>Rui</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          <string-name>
            <surname>Borovec</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          <string-name>
            <surname>Vallentin</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          <string-name>
            <surname>Zhydenko</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          <string-name>
            <surname>Pfeifer</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          <string-name>
            <surname>Cook</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          <string-name>
            <surname>Fernández</surname>
          </string-name>
          ,
          <string-name>
            <surname>F.-M. De Rainville</surname>
            ,
            <given-names>C.-H.</given-names>
          </string-name>
          <string-name>
            <surname>Weng</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          <string-name>
            <surname>Ayala-Acevedo</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          <string-name>
            <surname>Meudec</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          <string-name>
            <surname>Laporte</surname>
          </string-name>
          , et al., imgaug, https://github.com/aleju/imgaug,
          <year>2020</year>
          . Online; accessed 14-Feb-
          <year>2022</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref22">
        <mixed-citation>
          [22]
          <string-name>
            <given-names>D. P.</given-names>
            <surname>Kingma</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Ba</surname>
          </string-name>
          ,
          <article-title>Adam: A method for stochastic optimization</article-title>
          , in: Y. Bengio, Y. LeCun (Eds.),
          <source>3rd International Conference on Learning Representations, ICLR</source>
          <year>2015</year>
          , San Diego, CA, USA, May 7-
          <issue>9</issue>
          ,
          <year>2015</year>
          , Conference Track Proceedings,
          <year>2015</year>
          . URL: http://arxiv.org/abs/ 1412.6980.
        </mixed-citation>
      </ref>
      <ref id="ref23">
        <mixed-citation>
          [23]
          <string-name>
            <given-names>Z.</given-names>
            <surname>Wang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Bovik</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Sheikh</surname>
          </string-name>
          , E. Simoncelli,
          <article-title>Image quality assessment: from error visibility to structural similarity</article-title>
          ,
          <source>IEEE Transactions on Image Processing</source>
          <volume>13</volume>
          (
          <year>2004</year>
          )
          <fpage>600</fpage>
          -
          <lpage>612</lpage>
          . doi:
          <volume>10</volume>
          .1109/TIP.
          <year>2003</year>
          .
          <volume>819861</volume>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>