Morteza<EMAIL_ADDRESS>Sidharth
<EMAIL_ADDRESS>Chandra
<EMAIL_ADDRESS>Ryan<EMAIL_ADDRESS>John<EMAIL_ADDRESS>Michael
<EMAIL_ADDRESS>Dirk B. Waltherbernhardt-
<EMAIL_ADDRESS>Department of Psychology
University of Toronto
Toronto, Canada Department of Computer
Science, University of Toronto
Toronto, Canada Department of Mechanical &
Industrial Engineering
University of Toronto
Toronto, Canada Department of Electrical and
Computer Engineering
University of Toronto
Toronto, Canada

# Contour-guided Image Completion with
Perceptual Grouping

###### Abstract

Humans are excellent at perceiving illusory outlines. We are readily able to
complete contours, shapes, scenes, and even unseen objects when provided with
images that contain broken fragments of a connected appearance. In vision
science, this ability is largely explained by perceptual grouping: a
foundational set of processes in human vision that describes how separated
elements can be grouped. In this paper, we revisit an algorithm called
Stochastic Completion Fields (SCFs) that mechanizes a set of such processes –
good continuity, closure, and proximity – through contour completion. This
paper implements a modernized model of the SCF algorithm, and uses it in an
image editing framework where we propose novel methods to complete fragmented
contours. We show how the SCF algorithm plausibly mimics results in human
perception. We use the SCF completed contours as guides for inpainting, and
show that our guides improve the performance of state-of-the-art models.
Additionally, we show that the SCF aids in finding edges in high-noise
environments. Overall, our described algorithms resemble an important
mechanism in the human visual system, and offer a novel framework that modern
computer vision models can benefit from.

##  1 Introduction

Perceptual grouping is the process of grouping small visual elements, such as
edges, into larger, more meaningful structures. Perceptual grouping has a long
history in computer vision [Witkin and Tenenbaum(1983), Lowe(1985), Sarkar and
Boyer(1993)], but with the advent of deep learning, it has been overlooked in
the context of modern computer vision tasks in the past decade. This is
possibly because such rules are not easily implemented into modules that can
be readily integrated within end-to-end deep learning systems. In this paper,
we propose a modernized framework that mechanizes classical ideas in
perceptual grouping, and address the aforementioned limitation by offering
novel ways to integrate perceptual grouping principles in modern computer
vision systems. In perceptual grouping, Gestalt psychologists have proposed
qualitative grouping principles that govern how the human visual system groups
visual content [Koffka(1922)]. These principles include proximity, good
continuation, symmetry, and closure. While these ideas started as qualitative
rules, several concrete and quantitative algorithms are continually being
implemented as models of human visual system functions [Elder and
Zucker(1993), Wagemans et al.(2012a)Wagemans, Elder, Kubovy, Palmer, Peterson,
Singh, and von der Heydt, Wagemans et al.(2012b)Wagemans, Feldman, Gepshtein,
Kimchi, Pomerantz, van der Helm, and van Leeuwen, Jäkel et al.(2016)Jäkel,
Singh, Wichmann, and Herzog, Wilder et al.(2019)Wilder, Rezanejad, Dickinson,
Siddiqi, Jepson, and Walther, Rezanejad et al.(2019a)Rezanejad, Downs, Wilder,
Walther, Jepson, Dickinson, and Siddiqi]. The same principles have formed the
basis for many computer vision algorithms as well [Elder and Zucker(1996),
Siddiqi et al.(1999)Siddiqi, Shokoufandeh, Dickinson, and Zucker, Rezanejad
and Siddiqi(2015), Levinshtein et al.(2013)Levinshtein, Sminchisescu, and
Dickinson, Lee et al.(2015)Lee, Fidler, and Dickinson, Rezanejad et
al.(2015)Rezanejad, Samari, Rekleitis, Siddiqi, and Dudek].

Figure 1: Here is an example overall view of our stochastic completion field
(SCF) processing pipeline used in an image inpainting model. We begin with an
original image. First we detect the edges and trace them into individual
contours (shown in different colors). Next, we find the keypoints (points to
be connected; denoted sources and sinks) and the orientations at each
keypoint. These orientations will be the starting directions of the random
walks in the SCF. After completing the walks, we can determine the probability
of a path going through each point; the brightness in the SCF image represents
such probability. Zooming in, we show a vector field that represents the most
probable orientation at each point, with the vector magnitude representing
probability. We then find the most probably path through the $(x,y,\theta)$
space from one keypoint (source) to the next (sink). We show the combination
of the completed path with the original outline and a new, complete outline.
We also show the completion over the original masked image, and improved
result from inpainting.

The effortlessness nature of implicit knowledge extraction by deep neural
networks paved the way for scientists to focus less on computationally complex
models designed for perceptual grouping, simply due to the fact that these
models lack the ability to be integrated in modern deep-net systems. However,
such frameworks can still benefit and learn cues that are perceptually
motivated. [Verbin and Zickler(2020), Camaro et al.(2020)Camaro, Rezanejad,
Tsogkas, Siddiqi, and Dickinson, Rezanejad(2020)] have shown that their
perceptual grouping framework “Field of junctions" detects edges better than
any state-of-the-art edge detection CNNs, especially in the presence of a
large amount of noise. Perceptual grouping-based salience measures can also be
combined with neural networks to aid in scene categorization [Rezanejad et
al.(2019b)Rezanejad, Downs, Wilder, Walther, Jepson, Dickinson, and Siddiqi].
Both of these methods achieve boosts in performance without any additional
training, and are integrated within larger computer vision systems. Here, we
propose making use of a perceptual grouping framework, _the stochastic
completion field_ (SCF), to help group contour elements in an image by filling
in the gaps between the contours [Williams and Jacobs(1997b), Williams and
Jacobs(1997a), Williams et al.(1999)Williams, Zweck, Wang, and Thornber,
Momayyez and Siddiqi(2009)]. We build upon existing frameworks [Williams and
Jacobs(1996), Williams and Jacobs(1997a)] that compute probability density
maps for incomplete contours that can potentially be connected. We revise and
modernize the algorithm to achieve contour completion on real appearance
images and then use that to address some of the most challenging problems in
computer vision. Our contributions are three-fold: 1) We revive and improve
the original SCF algorithm in two ways: first by removing the need to assign
labels; and second by defining a data structure that allows us to complete
contours. 2) We show that our SCF algorithm quantitatively models perceptual
grouping processes, and produces results consistent with human behavioural
studies. 3) We show that our SCF framework can be integrated in any computer
vision model that uses contour shape structures – be it deep learning or
classical (see Fig. 1 for an example of SCF used in inpainting). Specifically,
we integrate our SCF algorithm with models for inpainting and edge-detection
in noisy environments, and find that our methods significantly improve
performance in those tasks. Our software framework is made open-source and is
available on GitHub
(https://github.com/sidguptacode/Stochastic_Completion_Fields).

##  2 Our Approach to Contour Completion

In this section, we will address the problem of completing fragmented
contours. Let’s assume an incomplete contour fragment (e.g., the one shown in
Figure 2a) that we want to complete.

Figure 2: (a): Fragment figure. (b): Keypoints of fragment with tangents.
(c):Particle on a random walk in $[0,W]\times[0,H]$ at time $t$. (d): For each
position, $\theta^{*}$ is the orientation which results in the maximum field
value across all orientations. (e) SCF applied to the source and sink points.
(d) Contour traced as the maximum probability path along the SCF.

We will first find the keypoints on this fragmented contour, which are the
points of interest that need to be connected. Keypoints can be identified in
many ways; as the intersection of masks and the original photograph; as where
contours of an object or a scene meet the image boundary; where an object is
occluded by another object; or in general any start and end point of a contour
that is perceptually perceived by the visual input. We can find these
keypoints and their tangential orientations (see Fig. 2b) using an independent
model (such as an edge map generator + logical linear operator [Iverson and
Zucker(1995)]). From here, we seek to compute a probability density function
called the stochastic completion field (SCF) as shown in Figure 2c-e. This SCF
will then pave the way to extract a completion path as shown in Figure 2f.

###  2.1 The Stochastic Completion Field

The likelihood of a candidate contour being the completion between a pair of
keypoints is related to the likelihood of a particle starting at one of those
keypoints, called the source, and traveling along the contour before stopping
at the other keypoint, called the sink. To compute "one" completion path in
this space, we consider a particle that travels from any source to any sink on
a random walk in a 2-dimensional region that contains all of the keypoints.
Without loss of generality, we take this region to be $[0,W]\times[0,H]$ (see
Fig. 2c). The state of the particle at time $t$ is defined by a 3-tuple
$(x(t),y(t),\theta(t))$, where ($x(t)$ and $y(t)$) defines the particle’s
position, and $\theta(t)$ defines it’s direction of linear velocity. Assuming
that the particle’s linear velocity is a unit vector, we can model the change
in it’s position as $\dot{x}(t)=\cos{\left(\theta(t)\right)}\text{ and
}\dot{y}(t)=\sin{\left(\theta(t)\right)}$, with a change in orientation
$\dot{\theta}(t)$ that is sampled from a normally distributed stochastic
process $\mathcal{N}(0,\sigma^{2})$ (with some constant $\sigma$). This
procedure allows for a prior expectation of a smooth, unbroken set of
completion contours, or in other words, contours with “good continuation”.
Now, we can represent the stochastic completion field by a function
$C:[0,W]\times[0,H]\times[0,2\pi)\rightarrow[0,1]$, such that $C(s)$ gives the
likelihood of being in a state $s$, when moving from any source to any sink.
If we let $p(u,s,v)$ be the likelihood that a random walk starts at $u$,
passes through $s$ and ends at $v$, then C(s) can be written as $\iint
p(u,s,v)dudv$. Next, we expand $p(u,s,v)$ by introducing four components: 1)
the likelihood that $u$ is the source of a random walk, denoted
$p_{\mathcal{U}}(u)$; 2) the likelihood that a random walk begins at $u$ ,
ends at $s$, denoted $p(s|u)$; 3) the likelihood that a random walk begins at
$u$ and passes through $s$, ends at $v$, denoted $p(v|u,s)$; 4) the likelihood
that $v$ is a sink, denoted, $p_{\mathcal{V}}(v)$. A random walk is a Markov
process, meaning a future state is only influenced by the current state and
nothing before. This means that the likelihood $p(v|u,s)$ is independent of
the starting point $u$ and only depends on the current state $s$, so
$p(v|u,s)=p(v|s)$. Therefore, we can compute the $p(u,s,v)$ by separating the
conditionals on $u$ and $v$. Specifically, this means that the SCF can be
computed as $C(s)=U(s)V(s)$ where $U(s)$ and $V(s)$ are probability maps
defined as: $U(s)=\int{p_{\mathcal{U}}(u)p(s|u)du}$ for the source field and
$V(s)=\int{p_{\mathcal{V}}(v)p(v|s)dv}$ for the sink field. We can evaluate
$C(s)$ by first computing the conditional distribution at a given time, $t$,
which we denote as $C(s;t)$, and then marginalizing over all $t$. Using the
same principles, $C(s;t)=U(s;t)V(s;t)$ where
$U(s;t)=\int{p_{\mathcal{U}}(u)p(s|u;t)du}$ and
$V(s;t)=\int{p_{\mathcal{V}}(v)p(v|s;t)dv}$. Both the source field ($U(s;t)$)
and the sink field ($V(s;t)$) can be computed in the same way, because if $u$
and $v$ are swapped, we will achieve the same distribution. Now, we will
simplify our computations by detailing how these fields can be computationally
modeled. Let us imagine that we are computing a source / sink field, and
$P(x,y,\theta,t)$ represents the likelihood of a state $s=(x,y,\theta)$ at
time $t$. This density $P$ can be computed from the initial condition ($t=0$)
with the following Fokker-Planck equation [Williams and Jacobs(1996)]
$P(x,y,\theta,t)=P(x,y,\theta,0)+\int_{0}^{t}\frac{\partial
P(x,y,\theta,t^{\prime})}{\partial t}dt^{\prime},$ and$\frac{\partial
P}{\partial t}=-\cos{\theta}\frac{\partial P}{\partial
x}-\sin{\theta}\frac{\partial P}{\partial
y}+\frac{\sigma^{2}}{2}\frac{\partial^{2}P}{\partial\theta^{2}}-\frac{1}{\tau}P$
where $P(x,y,\theta;t)$ represents the probability that a particle is at
position $(x,y)$ with orientation $\theta$ at time $t$. The term $\tau$ is a
constant particle decay rate which enables a prior expectation of “proximity”,
i.e., ensuring that the likelihood of being on a path gets exponentially
smaller as we get further away from a source or sink.

Algorithm 1 Fokker-Plank($x,y,\theta,\tilde{P}_{\text{init}},T_{\text{max}}$)

$\lambda\leftarrow\sigma^{2}/2(\Delta\theta)^{2}$

for $t=0,\dots,T_{\text{max}}$ do

$\tilde{P}^{t}_{x,y,\theta}\leftarrow\tilde{P}^{t}_{x,y,\theta}-\cos{\theta}\cdot\tilde{P}^{t}_{x,y,\theta}+\cos{\theta}\cdot\tilde{P}^{t}_{x-\Delta
x,y,\theta}\text{ if }\cos{\theta}\geq 0$ {Derivative along $x$}

$\tilde{P}^{t}_{x,y,\theta}\leftarrow\tilde{P}^{t}_{x,y,\theta}-\cos{\theta}\cdot\tilde{P}^{t}_{x+\Delta
x,y,\theta}+\cos{\theta}\cdot\tilde{P}^{t}_{x,y,\theta}\text{ if
}\cos{\theta}<0$ {Derivative along $x$}

$\tilde{P}^{t}_{x,y,\theta}\leftarrow\tilde{P}^{t}_{x,y,\theta}-\sin{\theta}\cdot\tilde{P}^{t}_{x,y,\theta}+\sin{\theta}\cdot\tilde{P}^{t}_{x,y-\Delta
y,\theta}\text{ if }\sin{\theta}\geq 0$ {Derivative along $y$}

$\tilde{P}^{t}_{x,y,\theta}\leftarrow\tilde{P}^{t}_{x,y,\theta}-\sin{\theta}\cdot\tilde{P}^{t}_{x,y+\Delta
y,\theta}+\sin{\theta}\cdot\tilde{P}^{t}_{x,y,\theta}\text{ if
}\sin{\theta}<0$ {Derivative along $y$}

$\tilde{P}^{t}_{x,y,\theta}\leftarrow\lambda\tilde{P}^{t}_{x,y,\theta-\Delta\theta}+(1-2\lambda)\tilde{P}^{t}_{x,y,\theta}+\lambda\tilde{P}^{t}_{x,y,\theta+\lambda\theta}$
{Derivative along $\theta$}

$\tilde{P}^{t+1}_{x,y,\theta}\leftarrow\exp\left\\{{-\frac{1}{\tau}}\right\\}\cdot\tilde{P}^{t}_{x,y,\theta}$
{Update decay factor}

end for

The solution to the Fokker-Planck equation can be approximated using a finite
difference method derived by taking the first-order terms of a Taylor series.
We consider $W/\Delta x$ evenly spaced points over $[0,W]$, $H/\Delta y$
evenly spaced points over $[0,H]$, and $2\pi/\Delta\theta$ evenly spaced
angles over $[0,2\pi)$. We then define a function,
Fokker_Plank$(x,y,\theta,T_{\text{max}})$, that approximates $P(x,y,\theta,t)$
for a discrete state, $(x,y,\theta)$ and all $t\leq T_{\text{max}}$. Its
implementation is described in Alg. 1. Applying Fokker_Plank to each state, we
obtain $\tilde{P}$, the finite difference approximation of $P$ for $t\leq
T_{\text{max}}$. We can then readily approximate $p(s|u;t)$ and $p(v|s;t)$ by
choosing $\tilde{P}_{\text{init}}$ to be the discrete approximations of
$p_{\mathcal{U}}$ and $p_{\mathcal{V}}$, respectively. From here, computing
$C$ becomes a matter of integration. Finally, we can do all these computations
using a neural network model with weights that are updated by the sampling
function for orientation and the decay factor, as shown in Fig. 3.

Figure 3: A schematic representation of how the SCF can be computed using a
neural network model. Given a source and sink, the neural network computes two
3D tensors: “source field” and “sink field”. Each layer applies one step of
the Fokker-Plank algorithm (see Alg. 1). The recurrence relationship given by
the Fokker-Plank equations can be computed through the kernel filter
convolutions given in this figure.

###  2.2 Assigning Sources and Sinks

Generating an SCF requires labelling keypoints as either sources or sinks,
since we need to know the specific pairs of keypoints that should be
connected. The original formulation of SCFs assumes that this labelling is
given, but that is most often not the case when we see broken contour
fragments. We propose an algorithm that labels keypoints as sources or sinks
automatically, letting us know which points should be connected. Our approach
is to marginalize the distribution over all possible assignments of sources
and sinks. We define a loop, where during the $i$th iteration, we compute an
SCF by assigning the $i$th keypoint as the source, and the remaining keypoints
as sinks. Intuitively, this generates a probability distribution modeling the
path from that specific source and visiting any of the remaining keypoints. We
accumulate the SCFs computed at each iteration into one SCF.

###  2.3 Tracing Optimal Completion Paths

We now describe our approach for tracing the optimal completion paths given an
SCF. First, for each discrete position, $\mathbf{p}=(x,y)$, we find the
discrete orientation, $\theta^{*}$, which maximizes the field value, that is,
$\theta^{*}=\operatorname*{arg\,max}_{\theta}{\tilde{C}(x,y,\theta)}$.
$\mathbf{p}$ is then assigned a vector whose magnitude is
$\tilde{C}(x,y,\theta^{*})$ and whose direction is $\theta^{*}$. The result is
a discrete vector field, $\tilde{C}_{\text{vec}}(x,y)$, that gives the most
likely instantaneous direction of motion of the particle at $(x,y)$. Given a
starting point $(x_{1},y_{1})$ and end point $(x_{2},y_{2})$, we can now trace
the most optimal path by greedily taking steps of a particular size in these
most probable directions. As the resulting positions may no longer be on the
discrete grid, we use a linear interpolation of $\tilde{C}_{\text{vec}}$ over
$[0,W]\times[0,H]$ to compute the corresponding vector on the new position
from the vector field. The algorithm iteratively builds a list of points
representing our traced path as described, and it terminates once the current
position is near the specified end point (within a distance radius of a
particular value). Now the result is an automated algorithm that
computationally completes fragments from disconnected boundaries, without any
training. The applications of such a toolbox, as well as its effectiveness,
are explored in the following sections.

Figure 4: Pipeline of how SCFs are used in computer vision systems. The orange
blocks can represent any computer vision model that uses contour information
(in this case, we have a contour generator and an inpainting model). The green
blocks show how SCFs integrate into the system for added perceptual grouping
information. The Marginalized SCF block can be implemented via Alg. 1, or as
the neural network mentioned in Fig. 3.

##  3 Image Inpainting

Image inpainting is the process of recovering content from an image with
missing regions. These missing regions are represented as pixels without
actual image information, and hence there is uncertainty of the content.
Recently, it has been demonstrated that modern inpainting methods can be
improved through guiding the inpainting models with added geometric
constraints [Yu et al.(2018)Yu, Lin, Yang, Shen, Lu, and Huang, Xiong et
al.(2019a)Xiong, Yu, Lin, Yang, Lu, Barnes, and Luo, Xiong et al.(2019b)Xiong,
Yu, Lin, Yang, Lu, Barnes, and Luo]. [Yu et al.(2019)Yu, Lin, Yang, Shen, Lu,
and Huang] found that by adding a "guide" to show where there is a boundary
between regions of distinct image content, the inpainted images are rated as
more similar to the intact images by human observers. EdgeConnect [Nazeri et
al.(2019)Nazeri, Ng, Joseph, Qureshi, and Ebrahimi] take this further by
trying to “hallucinate” missing edges, which yields images with more
boundaries, and allows the generated inpainted images to retain finer details.
Here, we show that completion of missing contour fragments can play a big role
in solving problems of this nature. Concretely, we use SCFs to generate
contours that will serve as guidance for inpainting models. We first complete
the contours through a masked region, as described in section 2.3. Then, those
contours guide the generative inpainting models to fill in the missing context
from the original image, with our added geometric constraints (see Fig. 4 for
a visual representation of how our inpainting setup is implemented).

##  4 Experiments and Results

###  4.1 Object Boundary Completion

We start this section by showing some “toy” examples of SCFs in Fig. 5 (left).
The three images show the result when three or four pairs of keypoints are
positioned next to each other in opposite directions, as if they lie on a
circle, on a square or on a triangle.

Figure 5: Examples of stochastic completion fields. Probability is denoted by
luminance (dark = high probability). Near the sources and sinks there is high
probability, and as we get farther from the keypoints there is less
probability. Probability is averaged over all orientations of the completion
field. Right: example completion fields for half-image line drawings of an
anchor. The original line drawings are from [Snodgrass and Vanderwart(1980)].
The left image shows the completion for the junction half image, and the right
shows the completion for the middle half image. We show the dot product with
the completed SCF, and the image containing only the missing segments, as
described in Section 4.

[Biederman and Cooper(1991b)] showed that human observers are better at
classifying degraded line drawings when shown only contour junctions than when
shown only the middle segments. When subjects are given an incomplete object
boundary, their visual systems try to complete the missing boundary fragments
as much as possible to make a better prediction of what the representative
object class could be. When the visual system has difficulty completing the
objects, the object is not recognizable. In this section, we show how the
SCF’s computational power compares with human behavioural studies. In this
experiment, which was motivated by the behavioural experiment of [Biederman
and Cooper(1991a)], we tested the algorithm on the Snodgrass and Vanderwart
dataset of 260 manually traced line drawings of objects [Snodgrass and
Vanderwart(1980)]. The traced objects were separated into half-images, one set
with the segments containing junctions, and the other set with the segments
containing the pieces between junctions (middle segments). We then completed
the two types of half-drawings using the SCF algorithm. To test the quality of
the completion, we take the dot product with the completed SCF, and the image
containing only the missing segments. This gives a single number representing
how well the SCF matches the missing segments. Our results show that the SCF
completes the half-images with the junctions more faithfully than the half-
images with the middle segments in 241 / 260 (93%) of the drawings, aligning
with the results of [Biederman and Cooper(1991b)] (see Fig. 5 left). The
difference in the quality of the completions was highly significant
($t(259)=20.64,p<2.2\times 10^{-16}$). Table 1 shows a comparison of the
results.

| Mid-segments | Junctions
---|---|---
Proportion Correct [Biederman and Cooper(1991b)] | 0.833 | 0.727
SCF dot product a.u. ($\sigma$) | 0.298 (0.49) | 0.152 (0.14)
Table 1: Table comparing the human results [Biederman and Cooper(1991b)] and
the SCF. The quality of the completions matches how human observers recognize
incomplete objects. The human proportion of correct recognition is higher for
junctions, just as the dot product between the truth and the completion of the
SCF for junctions is higher.

This suggests that SCFs are useful for predicting the types of incomplete line
drawings that are easy to complete by the human visual system. It also
demonstrates that SCFs can form a plausible algorithmic implementation of the
Gestalt principle of good continuation.

|  |  |  |  |
---|---|---|---|---|---
|  |  |  |  |
|  |  |  |  |
|  |  |  |  |
|  |  |  |  |
|  |  |  |  |
|  |  |  |  |
Input | Contours | GatedConv | EdgeConnect | Ours | Ground Truth
Figure 6: Results comparing between in-painting methods, including EdgeConnect
(EC) that uses contour guidance. In ours, we complete edges using SCF to
provide guidance in the place of hallucinated contours generated by
EdgeConnect. Please note that in the second column, our contours are shown by
“green” and contours hallucinated by EdgeConnect are shown in “blue”. See
supplementary materials for more examples.

###  4.2 Inpainting Experiments

We evaluate our image completion pipeline on the MSRA-10K dataset, which is a
dataset of objects originally used for object salience detection [Hou et
al.(2019)Hou, Cheng, Hu, Borji, Tu, and Torr]. We show the output of [Yu et
al.(2019)Yu, Lin, Yang, Shen, Lu, and Huang, Nazeri et al.(2019)Nazeri, Ng,
Joseph, Qureshi, and Ebrahimi] and our method, along with the completed
contours used for guidance in Figure 6 for several examples from the MSRA-10k
dataset.

In a test set of 1688 different images, we ran edge connect [Nazeri et
al.(2019)Nazeri, Ng, Joseph, Qureshi, and Ebrahimi] using hallucinated edges
(with no manual intervention), and also using the same set of edges, this time
completed with SCFs. We compare how each of these methods perform by using the
structured similarity index measure (SSIM). We found that inpainting using the
SCF completions were significantly closer to the ground truth than inpainting
using only EdgeConnect’s hallucinated edges ($t(1687)=13.05,p<3.6\times
10^{-37}$). In fact, on 1066 of the 1688 images tested, inpainting with the
SCFs as a guide yielded better results than its counterpart alternative
(EdgeConnect). We compared the quality of the results to other methods,
including peak signal-to-noise ratio (PSNR), $\mathit{l}_{1}$ and
$\mathit{l}_{2}$. PSNR also shows that our results are a significant
improvement over EdgeConnect ($t(1687)=3.06,p=0.002$), though the effect is
less strong under this measure. $\mathit{l}_{1}$ and $\mathit{l}_{2}$ show
that our method is a highly significant improvement over EdgeConnect
($t(1687)=29.21,p=3.8\times 10^{-152}$, and $t(1687)=14.52,p=4.3\times
10^{-45}$ respectively).

Measure | gPb | DexiNed | Ours
---|---|---|---
Precision | 0.1258 | 0.4189 | 0.6895
Recall | 0.3130 | 0.1131 | 0.1636
$F1$ | 0.1795 | 0.1781 | 0.2645
Table 2: Results (Precision, Recall and $F1$) scores for different methods of
detecting edges

###  4.3 Detecting Edges in Noise

Another application of our SCF framework is to aid contour detection in images
with high levels of noise. In cases where the image noise is extremely high,
especially if edges are of low contrast, edge detection becomes extremely
difficult. In Figure 7, we show images of a low contrast letter and a low
contrast scene contaminated with noise. In such cases, edge detection by
classical algorithms [Canny(1986), Maire et al.(2008)Maire, Arbeláez, Fowlkes,
and Malik], and even state-of-the-art ones [Poma et al.(2020)Poma, Riba, and
Sappa] fail. Here, we propose a perceptual grouping based approach to detect
such edges in the presence of noise. We first downscale the image. In cases
where the noise is uncorrelated, reducing the image size will average out some
of the noise, and allow some, but not all, of the edge to be detected. We
detect edges using the logical-linear edge detector [Iverson and
Zucker(1995)]. The benefit of this edge detector is that it gives precise
orientation information at each point. It can even give multiple orientations
at a single point, allowing for the accurate representation of contour
junctions and corners. The edge detector returns a map of edges and associated
strengths in each direction. We binarize the map and trace the contours to
obtain contour fragments that are each one pixel wide. After detecting edges
we upscale the image. Up-scaling the image back to the original size will
increase the number of missing contour segments. We make use of the
orientation information given by the logical-linear edge detector as our
keypoints. We then use SCFs to complete the gaps and yield a complete
boundary.

|  |  |  |  |
---|---|---|---|---|---
|  |  |  |  |
|  |  |  |  |
|  |  |  |  |
Noisy Image | Low-res Edges | DexiNed | gPb | Ours | Ground Truth
Figure 7: Examples of detecting the edges of noisy images. Gaussian noise was
added to low-contrast images of letters (with $\sigma=39\%$ of the range of
the pixel values) and scenes (with $\sigma=79\%$). Using SCFs we can make use
of the low-resolution edges, by upscaling to the original size and completing
the broken contours. The resulting boundary recovers many more of the edges in
the images. The same procedure of downscaling to remove noise did not improve
the performance of the other edge-detection algorithms. See supplementary
materials for more examples.

To perform a more in-depth analysis of how well our edge detection performs in
noise, we used the Artist dataset. In this dataset, color photographs from six
categories of natural scenes (beaches, city streets, forests, highways,
mountains, and offices) were downloaded from the internet and selected by
Amazon MechanicalTurk workers looking for the most representative scenes for
each category. Line drawings of these photographs were generated by trained
artists at the Lotus Hill Research Institute [Walther et al.(2011)Walther,
Chai, Caddigan, Beck, and Fei-Fei]. The resulting database had 475 line
drawings in total with 76-80 exemplars from each of the six categories:
beaches, mountains, forests, highway scenes, city scenes, and office scenes.
Images with fire or other potentially upsetting content were removed from the
experiment (five images total). In Table 2, we compare our method to the
DexiNed [Poma et al.(2020)Poma, Riba, and Sappa] and gPb [Maire et
al.(2008)Maire, Arbeláez, Fowlkes, and Malik] algorithms.

##  5 Conclusion

In this paper, we introduce a modernized SCF algorithm, and demonstrate its
power when integrated with deep computer vision models. Our improvements
include a method for automatically finding sources and sinks, so that our SCF
algorithm no longer needs to have prior knowledge about the source and sink
pairs for computation. In addition, we show that our algorithm mechanizes
perceptual grouping processes, and mimics results in human perception when
completing broken contour fragments. In addition to a Fokker-Planck equation
implementation of the SCF algorithm, we introduce a 4-layer neural network
model that computes SCF probability maps using a set of small kernel filters.
We show how these implementations can be substituted into computer vision
models that explicitly represent contour information. Specifically, we
integrate our SCF blocks with inpainting generative models and models for
edge-detection in noisy images. We find that our results outperform the state-
of-the-art models with no additional training. Ultimately, our work improves
upon the SCF algorithm and demonstrates how to integrate it in modern computer
vision systems.

## References

  * [Biederman and Cooper(1991a)] Irving Biederman and Eric E Cooper.  Evidence for complete translational and reflectional invariance in visual object priming.  _Perception_ , 20(5):585–593, 1991a.
  * [Biederman and Cooper(1991b)] Irving Biederman and Eric E Cooper.  Priming contour-deleted images: Evidence for intermediate representations in visual object recognition.  _Cognitive psychology_ , 23(3):393–419, 1991b.
  * [Camaro et al.(2020)Camaro, Rezanejad, Tsogkas, Siddiqi, and Dickinson] Charles-Olivier Dufresne Camaro, Morteza Rezanejad, Stavros Tsogkas, Kaleem Siddiqi, and Sven Dickinson.  Appearance shock grammar for fast medial axis extraction from real images.  In _Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition_ , pages 14382–14391, 2020.
  * [Canny(1986)] John Canny.  A computational approach to edge detection.  _IEEE Transactions on pattern analysis and machine intelligence_ , (6):679–698, 1986.
  * [Elder and Zucker(1993)] James Elder and Steven Zucker.  The effect of contour closure on the rapid discrimination of two-dimensional shapes.  _Vision research_ , 33(7):981–991, 1993.
  * [Elder and Zucker(1996)] James H Elder and Steven W Zucker.  Computing contour closure.  In _European Conference on Computer Vision_ , pages 399–412. Springer, 1996.
  * [Hou et al.(2019)Hou, Cheng, Hu, Borji, Tu, and Torr] Qibin Hou, Ming-Ming Cheng, Xiaowei Hu, Ali Borji, Zhuowen Tu, and Philip Torr.  Deeply supervised salient object detection with short connections.  _IEEE TPAMI_ , 41(4):815–828, 2019.  10.1109/TPAMI.2018.2815688.
  * [Iverson and Zucker(1995)] Lee A. Iverson and Steven W. Zucker.  Logical/linear operators for image curves.  _IEEE Transactions on Pattern Analysis and Machine Intelligence_ , 17(10):982–996, 1995.
  * [Jäkel et al.(2016)Jäkel, Singh, Wichmann, and Herzog] Frank Jäkel, Manish Singh, Felix A Wichmann, and Michael H Herzog.  An overview of quantitative approaches in gestalt perception.  _Vision research_ , 126:3–8, 2016.
  * [Koffka(1922)] Kurt Koffka.  Perception: an introduction to the gestalt-theorie.  _Psychological Bulletin_ , 19(10):531, 1922.
  * [Lee et al.(2015)Lee, Fidler, and Dickinson] Tom Lee, Sanja Fidler, and Sven Dickinson.  Learning to combine mid-level cues for object proposal generation.  In _Proceedings of the IEEE International Conference on Computer Vision_ , pages 1680–1688, 2015.
  * [Levinshtein et al.(2013)Levinshtein, Sminchisescu, and Dickinson] Alex Levinshtein, Cristian Sminchisescu, and Sven Dickinson.  Multiscale symmetric part detection and grouping.  _International journal of computer vision_ , 104(2):117–134, 2013.
  * [Lowe(1985)] David G. Lowe.  _Perceptual Organization and Visual Recognition_.  Kluwer Academic Publishers, USA, 1985.  ISBN 089838172X.
  * [Maire et al.(2008)Maire, Arbeláez, Fowlkes, and Malik] Michael Maire, Pablo Arbeláez, Charless Fowlkes, and Jitendra Malik.  Using contours to detect and localize junctions in natural images.  In _2008 IEEE Conference on Computer Vision and Pattern Recognition_ , pages 1–8. IEEE, 2008.
  * [Momayyez and Siddiqi(2009)] Parya Momayyez and Kaleem Siddiqi.  3d stochastic completion fields for fiber tractography.  In _2009 IEEE Computer Society Conference on Computer Vision and Pattern Recognition Workshops_ , pages 178–185. IEEE, 2009.
  * [Nazeri et al.(2019)Nazeri, Ng, Joseph, Qureshi, and Ebrahimi] Kamyar Nazeri, Eric Ng, Tony Joseph, Faisal Z Qureshi, and Mehran Ebrahimi.  Edgeconnect: Generative image inpainting with adversarial edge learning.  _arXiv preprint arXiv:1901.00212_ , 2019.
  * [Poma et al.(2020)Poma, Riba, and Sappa] Xavier Soria Poma, Edgar Riba, and Angel Sappa.  Dense extreme inception network: Towards a robust cnn model for edge detection.  In _Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision_ , pages 1923–1932, 2020.
  * [Rezanejad(2020)] Morteza Rezanejad.  _Medial measures for recognition, mapping and categorization_.  McGill University, 2020.
  * [Rezanejad and Siddiqi(2015)] Morteza Rezanejad and Kaleem Siddiqi.  View sphere partitioning via flux graphs boosts recognition from sparse views.  _Frontiers in ICT_ , 2:24, 2015.
  * [Rezanejad et al.(2015)Rezanejad, Samari, Rekleitis, Siddiqi, and Dudek] Morteza Rezanejad, Babak Samari, I Rekleitis, Kaleem Siddiqi, and Gregory Dudek.  Robust environment mapping using flux skeletons.  In _2015 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS)_ , pages 5700–5705. IEEE, 2015.
  * [Rezanejad et al.(2019a)Rezanejad, Downs, Wilder, Walther, Jepson, Dickinson, and Siddiqi] Morteza Rezanejad, Gabriel Downs, John Wilder, Dirk B Walther, Allan Jepson, Sven Dickinson, and Kaleem Siddiqi.  Gestalt-based contour weights improve scene categorization by cnns.  In _Conference on Cognitive Computational Neuroscience (CCN 2019)_ , 2019a.
  * [Rezanejad et al.(2019b)Rezanejad, Downs, Wilder, Walther, Jepson, Dickinson, and Siddiqi] Morteza Rezanejad, Gabriel Downs, John Wilder, Dirk B Walther, Allan Jepson, Sven Dickinson, and Kaleem Siddiqi.  Scene categorization from contours: Medial axis based salience measures.  In _Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition_ , pages 4116–4124, 2019b.
  * [Sarkar and Boyer(1993)] Sudeep Sarkar and Kim L Boyer.  Perceptual organization in computer vision: A review and a proposal for a classificatory structure.  _IEEE Transactions on Systems, Man, and Cybernetics_ , 23(2):382–399, 1993.
  * [Siddiqi et al.(1999)Siddiqi, Shokoufandeh, Dickinson, and Zucker] Kaleem Siddiqi, Ali Shokoufandeh, Sven J Dickinson, and Steven W Zucker.  Shock graphs and shape matching.  _International Journal of Computer Vision_ , 35(1):13–32, 1999.
  * [Snodgrass and Vanderwart(1980)] Joan G Snodgrass and Mary Vanderwart.  A standardized set of 260 pictures: norms for name agreement, image agreement, familiarity, and visual complexity.  _Journal of experimental psychology: Human learning and memory_ , 6(2):174, 1980.
  * [Verbin and Zickler(2020)] Dor Verbin and Todd Zickler.  Field of junctions, 2020.
  * [Wagemans et al.(2012a)Wagemans, Elder, Kubovy, Palmer, Peterson, Singh, and von der Heydt] Johan Wagemans, James H Elder, Michael Kubovy, Stephen E Palmer, Mary A Peterson, Manish Singh, and Rüdiger von der Heydt.  A century of gestalt psychology in visual perception: I. perceptual grouping and figure–ground organization.  _Psychological bulletin_ , 138(6):1172, 2012a.
  * [Wagemans et al.(2012b)Wagemans, Feldman, Gepshtein, Kimchi, Pomerantz, van der Helm, and van Leeuwen] Johan Wagemans, Jacob Feldman, Sergei Gepshtein, Ruth Kimchi, James R Pomerantz, Peter A van der Helm, and Cees van Leeuwen.  A century of gestalt psychology in visual perception: Ii. conceptual and theoretical foundations.  _Psychological Bulletin_ , 138(6):1218, 2012b.
  * [Walther et al.(2011)Walther, Chai, Caddigan, Beck, and Fei-Fei] Dirk B Walther, Barry Chai, Eamon Caddigan, Diane M Beck, and Li Fei-Fei.  Simple line drawings suffice for functional mri decoding of natural scene categories.  _Proceedings of the National Academy of Sciences_ , 108(23):9661–9666, 2011.
  * [Wilder et al.(2019)Wilder, Rezanejad, Dickinson, Siddiqi, Jepson, and Walther] John Wilder, Morteza Rezanejad, Sven Dickinson, Kaleem Siddiqi, Allan Jepson, and Dirk B. Walther.  Local contour symmetry facilitates scene categorization.  _Cognition_ , 182:307 – 317, 2019.  ISSN 0010-0277.  https://doi.org/10.1016/j.cognition.2018.09.014.  URL http://www.sciencedirect.com/science/article/pii/S0010027718302506.
  * [Williams et al.(1999)Williams, Zweck, Wang, and Thornber] Lance Williams, John Zweck, Tairan Wang, and Karvel Thornber.  Computing stochastic completion fields in linear-time using a resolution pyramid.  _Computer Vision and Image Understanding_ , 76(3):289–297, 1999.
  * [Williams and Jacobs(1996)] Lance R Williams and David W Jacobs.  Local parallel computation of stochastic completion fields.  In _Proceedings CVPR IEEE Computer Society Conference on Computer Vision and Pattern Recognition_ , pages 161–168. IEEE, 1996.
  * [Williams and Jacobs(1997a)] Lance R Williams and David W Jacobs.  Local parallel computation of stochastic completion fields.  _Neural computation_ , 9(4):859–881, 1997a.
  * [Williams and Jacobs(1997b)] Lance R Williams and David W Jacobs.  Stochastic completion fields: A neural model of illusory contour shape and salience.  _Neural computation_ , 9(4):837–858, 1997b.
  * [Witkin and Tenenbaum(1983)] Andrew P Witkin and Jay M Tenenbaum.  On the role of structure in vision.  In _Human and machine vision_ , pages 481–543. Elsevier, 1983.
  * [Xiong et al.(2019a)Xiong, Yu, Lin, Yang, Lu, Barnes, and Luo] Wei Xiong, Jiahui Yu, Zhe Lin, Jimei Yang, Xin Lu, Connelly Barnes, and Jiebo Luo.  Foreground-aware image inpainting.  In _Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition_ , pages 5840–5848, 2019a.
  * [Xiong et al.(2019b)Xiong, Yu, Lin, Yang, Lu, Barnes, and Luo] Wei Xiong, Jiahui Yu, Zhe Lin, Jimei Yang, Xin Lu, Connelly Barnes, and Jiebo Luo.  Foreground-aware image inpainting.  In _Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)_ , June 2019b.
  * [Yu et al.(2018)Yu, Lin, Yang, Shen, Lu, and Huang] Jiahui Yu, Zhe Lin, Jimei Yang, Xiaohui Shen, Xin Lu, and Thomas S. Huang.  Generative image inpainting with contextual attention.  In _Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR)_ , June 2018.
  * [Yu et al.(2019)Yu, Lin, Yang, Shen, Lu, and Huang] Jiahui Yu, Zhe Lin, Jimei Yang, Xiaohui Shen, Xin Lu, and Thomas S Huang.  Free-form image inpainting with gated convolution.  In _Proceedings of the IEEE/CVF International Conference on Computer Vision_ , pages 4471–4480, 2019.


#  SuperAGILE data processing services

Lazzarotto F., Costa E., Del Monte E., Donnarumma I., Evangelista Y., Feroci
M., Lapshov I., Pacciani L., Soffitta P.  Trifoglio M., Bulgarelli A.,
Gianotti F

###### Abstract

The SuperAGILE (SA) instrument is a X-ray detector for Astrophysics
measurements, part of the Italian AGILE satellite for X-Ray and Gamma-Ray
Astronomy launched at 23/04/2007 from India. SuperAGILE is now studying the
sky in the 18 - 60 KeV energy band. It is detecting sources with advanced
imaging and timing detection capabilities and good spectral detection
capabilities. Several astrophysical sources has been detected and localized,
including Crab, Vela and GX 301-2. The instrument has the skill to resolve
correctly sources in a field of view of [-40, +40] degrees interval, with the
angular resolution of 6 arcmin, and a spectral analysis with the resolution of
8 keV. Transient events are regularly detected by SA with the aid of its
temporal resolution (2 microseconds) and using signal coincidence on different
portions of the instrument, with confirmation from other observatories. The SA
data processing scientiﬁc software performing at the AGILE Ground Segment is
divided in modules, grouped in a processing pipeline named SASOA. The
processing steps can be summarized in data reduction, photonlist building,
sources extraction and sources analysis. The software services allow orbital
data processing (near real-time), daily data set integration, Temporal Data
Set (TDS) processing and TDS processing with source target optimization
(TDS_SRC). Automatic data processing monitoring and interactive data analysis
is possible from an internet connected workstation, with the use of SA data
processing Web services. Many solutions were implemented in order to achieve
fault tolerance. Archive management and data storage are performed with the
help of relational database instruments.

National Institute for Astrophysics (INAF) IASF Rome, Italy

National Institute for Astrophysics (INAF) IASF Bologna, Italy

##  1\. The SuperAGILE processing pipeline

SASOA software Data Processing Stages


# Dissipative learning of a quantum classifier

Ufuk Korkmaz  Deniz Türkpençe<EMAIL_ADDRESS>Department of Electrical
Engineering, İstanbul Technical University, 34469 İstanbul, Turkey

###### Abstract

The expectation that quantum computation might bring performance advantages in
machine learning algorithms motivates the work on the quantum versions of
artificial neural networks. In this study, we analyze the learning dynamics of
a quantum classifier model that works as an open quantum system which is an
alternative to the standard quantum circuit model. According to the obtained
results, the model can be successfully trained with a gradient descent (GD)
based algorithm. The fact that these optimization processes have been obtained
with continuous dynamics, shows promise for the development of a
differentiable activation function for the classifier model.

quantum learning, open quantum system, cost function, quantum classifier,
training.

##  I Introduction

The theory of learning artificial neural networks is foun-ded on mathematical
models adapted to the working principle of the human brain, introduced by
McCulloch, Pitts and Rosenblatt [1, 2]. Particularly in the new millennium, in
which the computing capacities of computers have increased, it has become a
period in which deep learning methods outperform other methods in multi-layer
artificial neural networks, which bring many useful applications [3, 4, 5].

Quantum computation (QC) brings exciting advantages to computer science and
all relevant computational sciences [6, 7]. Although many efforts have been
paid for quantum versions of neural networks (QNN), there is no broadly
accepted QNN, even at a single neuron level [8, 9, 10, 11, 12, 13]. In
addition, quantum noise severely limits the performance of gate-based quantum
network proposals. Therefore hardware-efficient solutions have began to emerge
[14, 15].

In past work, we proposed a dissipative quantum classifier as a basic unit of
QNN hardware, based on repeated interactions protocol [16, 17, 18, 19].
Dissipation-based quantum computing has been shown to be equivalent to the
standard QC model [20]. In the protocol, identical qubit sequences with pure
initial quantum state successively interact with a target qubit. The repeated
interactions are unitary in the weak coupling limit in a vanishingly small
time portion. However, the quantum state of the target qubit is obtained by
calculating the reduced dynamics, so that global evolution is a non-unitary
process. We dub these identical qubit sequences quantum information reservoir
[21, 22]. As a result of repeated interactions, the target qubit reaches a
steady state in which the diagonal entries of its density matrix become
identical to the information reservoir units. This process is known as quantum
homogenization [23].

In this task, some amount of information is transferred from the reservoir to
the target qubit at the steady state. This can be interpreted as quantum
reservoirs being quantum channels that transfer information to open systems
[24, 25]. All these approaches make sense for open quantum neuron design when
the target qubit is connected to more than one information reservoir with
arbitrary coupling strengths. In this case, the target qubit reaches a non-
trivial steady state depending on the coupling coefficients (weights) and the
input data parameters. We have numerically and analytically proposed that this
model is an open quantum classifier that returns a binary decision at the
steady state when measured by Pauli observables [16, 17].

In the current work, we study this model in the framework of supervised
learning schemes by adopting a gradient descent-based model. To this end, we
derive a cost function setting different parameters of the system as variables
and examine the availability of the model for learning tasks. We observe that
the cost function can be smoothly minimized for all relevant parameters with
appropriate differentiability.

##  II Model and System Dynamics

###  II.1 Classic model

Binary classification is a subtask for machine learning (ML) covering ANN
alongside different models. However, If we discuss, in particular the
artificial neural network model, the perceptron is referred to as a basic unit
of ANN computing performing binary classification tasks. Technically speaking,
a perceptron performs a binary decision $z$ with binary labels $\\{0,1\\}$
depending on the input. In the model, input is formulated as
$\varphi_{in}=\bf{x}^{T}\bf{w}$ where $\bf{x}=[x_{1},\ldots x_{N}]^{T}$
defines input feature instances and $\bf{w}=[w_{1},\ldots w_{N}]^{T}$ is the
set of corresponding weight vectors.

The binary output is modulated by, in general a non-linear function $f(.)$
where $z=f(\varphi_{in})$. The decision rule reads $z=0$ if
$z=f(\varphi_{in})\geq 0$ and $z=1$ else. The choice of binary labels is
arbitrary and can be defined variously depending on the expressivity
requirements. Note that, in principle, a perceptron with identity activation
can still achieve linear classification. However, non-linear activation
functions are desirable for multi-layer ANN learning tasks. Although our
model, in principle, is a quantum perceptron with identity activation, we
prefer to present our model and related learning tasks as ”quantum classifier
learning”.

Supervised learning can be defined as a mapping from a feature space to a
binary label set

$\mathcal{X,Y}\rightarrow\\{0,1\\}$ (1)

where $\mathcal{X}$ and $\mathcal{Y}$ are, respectively, the input and output
data of a given a training set $\mathcal{S}=(\mathcal{X},\mathcal{Y})$. In
this scheme, the $\mathcal{Y}$ part of the training set is the desired output,
and the cost function $C$ quantifies how close the actual output is to the
desired output.

In analogy with the least squares method, the cost function expression reads

$C=\frac{1}{2}(\bf{Y}-\bf{A})^{2}$ (2)

where $\bf{A}$ is the actual and $\bf{Y}$ is the desired output. In general,
the weight instances are updated

$\bf{w}_{k+1}=\bf{w}_{k}+\delta\bf{w}_{k}$ (3)

iteratively by back-propagation. However, any desired parameter can be
adjusted to minimize the cost. Among different procedures, we adopt a
gradient-descent based method for the training task. In this method, the
change in the parameter reads

$\delta{w}_{k}=-\eta\frac{\partial C}{\partial{w}_{k}}$ (4)

where $\eta$ is a non-negative number, the so-called learning rate,
characterizing the speed of the learning task. As the name of the method
implies, the partial derivative expresses the change of the parameter to be
adjusted in the direction of the largest descent.

###  II.2 Quantum dissipative dynamics

In this subsection, we discuss the open system dynamics with preliminary
definitions. As we have pointed out in the previous sections, the model
operates by a dissipative protocol. The input data expressed classically can
be rephrased as

$\varphi_{in}=\bf{x}^{T}\bf{w}=\sum_{i}w_{i}x_{i}.$ (5)

the weighted summation of the input features. In our view, the quantum
equivalent of the classic description above reads

$\displaystyle\Lambda_{t}[\varrho_{0}]=\sum_{i}P_{i}\Phi_{t}^{(i)}{[\varrho_{0}]}$
(6)

where $\Phi_{t}^{(i)}$ is a completely positive trace preserving (CPTP)
quantum dynamical map acting on the target qubit $\varrho_{0}$, $P_{i}$ is the
probability of the map interacting with the $i$th information reservoir. The
subscript $t$ stands for the time dependence of the maps generated by a
physical process

$\displaystyle\Phi^{(i)}_{t}[\varrho_{0}]=\text{Tr}_{\mathcal{R}_{i}}\\{U_{t}(\varrho_{0}\otimes\varrho_{\mathcal{R}_{i}})U_{t}^{\dagger}\\}$
(7)

with a unitary propagator $U_{t}$ acting on both the target qubit and the
reservoir. Here, $\rho_{\mathcal{R}_{i}}$ is the $i$th reservoir quantum state
and $\text{Tr}_{\mathcal{R}_{i}}$ is the partial trace over the $i$th
reservoir.

The quantum reservoirs provide initial quantum data in pure states. Each
reservoir is composed of non-correlated, non-interacting two-level quantum
systems (subunits) defined by

$\displaystyle\rho_{\mathcal{R}_{i}}=\bigotimes_{k=1}^{n}\rho_{k}(\theta_{i},\phi_{i}).$
(8)

the tensor product of finite $n$ subunits. As each subunit is in a pure
quantum state, they could initially be prepared by identical Bloch parameters
$\rho_{k}(\theta_{i},\phi_{i})$. This parametrization allows for a dissipative
equivalence of the model with parametrized quantum circuits.

###  II.3 Quantum collision model and the quantum
classifier

As mentioned above, the dynamical process of the introduced model relies on a
standard quantum collisional model [26, 23, 27]. In our proposal, the target
qubit undergoes a collisional dissipative process under multiple, independent
information reservoirs with arbitrary couplings. In this scheme, the steady
state readout of the target qubit by Pauli observables gives the binary
classification output. The dynamical process in the presence of the $i$th
information reservoir reads

$\displaystyle\Phi^{(i)}_{n\tau}=$
$\displaystyle\text{Tr}_{n}\big{[}\mathcal{U}_{0i_{n}}\ldots\text{Tr}_{1}[\mathcal{U}_{0i_{1}}\left(\varrho_{0}\otimes\rho_{\mathcal{R}_{i_{1}}}\right)\mathcal{U}_{0i_{1}}^{\dagger}]\otimes\ldots$
$\displaystyle\ldots\otimes\rho_{\mathfrak{R}_{i_{n}}}\mathcal{U}_{0i_{n}}^{\dagger}\big{]}.$
(9)

Here, $n\tau$ is the time elapsed of the dynamical map for $n$ collisions and
$\mathcal{U}_{0i_{k}}=\text{exp}[-\text{i}\mathcal{H}^{k}_{0i}\tau]$ is the
unitary propagator. Initially, system plus reservoir quantum states prepared
in $\varrho(0)=\varrho_{0}(0)\otimes\rho_{\mathcal{R}_{i}}$ a tensor product
state. Note that the time dependence is only relevant for the target qubit,
and after every collision, the reservoir states are reset to their initial
state.

Figure 1:  (Colour online.) The steady state magnetization of the target qubit
depending on the variation of the couplings to the reservoirs. Variations of
the coupling rates are $g_{1}=g/2-\Delta g$, $g_{2}=g/2+\Delta g$. Here,
$\Delta g$ represents a fraction of $g$ with $g=0.01$. The probe qubit
prepared initially in $\ket{+}=(\ket{e}+\ket{g})/\sqrt{2}$ state and
interacted collisionally with the reservoir units $\ket{\Psi(\theta,\phi)}$
with $\theta=0$, $\phi=0$ and $\theta=\pi$, $\phi=0$. The target qubit-
reservoir interaction time $\tau=3$ and the coupling coefficient $g$ are
dimensionless and scaled by $\omega_{r}$.

On the other hand, the Hamiltonian governing the system plus reservoir
dynamics depicted as $\mathcal{H}=\mathcal{H}_{0}+\mathcal{H}_{int}$ where

$\displaystyle\mathcal{H}_{0}=\frac{\hbar\omega_{0}}{2}\sigma_{0}^{z}+\frac{\hbar\omega_{i}}{2}\sum_{k=1}^{n}\sigma_{k_{i}}^{z}$
(10)

is the free part and

$\mathcal{H}_{int}=\hbar\sum_{k=1}^{n}g_{i}(\sigma_{0}^{+}\sigma_{k_{i}}^{-}+\text{H.c.}),$
(11)

is the interaction part. Here, respectively, the Pauli-$z$ operator, the Pauli
raising and lowering operators read as $\sigma^{z}$, $\sigma^{+}$ and
$\sigma^{-}$. The Planck’s constant divided by $2\pi$ is taken as $\hbar=1$
throughout the calculations. As a notable point, the value of the coupling
coefficient $g_{i}\ll\omega_{0}$ ranges within the weak coupling regime where
the cross-talk between the reservoirs is avoided. Moreover, the coefficients
are proportional to the probabilities $g_{i}\propto P_{i}$ in eq. (6) as the
quantum equivalent to the weights in the classic model.

Following the recipe above, the steady state of the target qubit in the
presence of $N$ distinct reservoirs reported as the solution of the
collisional master equation [17]

$\displaystyle\varrho_{0}^{\text{ss}}=$
$\displaystyle\frac{1}{\sum_{i}^{N}g_{i}^{2}}\sum_{i=1}^{N}g_{i}^{2}\Big{(}\langle\sigma_{i}^{+}\sigma_{i}^{-}\rangle\ket{e}\bra{e}+\langle\sigma_{i}^{-}\sigma_{i}^{+}\rangle\ket{g}\bra{g}$
$\displaystyle+i\gamma_{1}^{-}\left(\langle\sigma_{i}^{+}\sigma_{i}^{-}\rangle-\langle\sigma_{i}^{-}\sigma_{i}^{+}\rangle\right)\ket{e}\bra{g}+\text{H.c.}\Big{)}$
(12)

where $\ket{e}$ and $\ket{g}$ are the computational basis and
$\gamma^{-}_{1}=r\tau\sum_{i=1}^{N}g_{i}\langle\sigma_{i}^{-}\rangle$ , $r$
being the interaction rate of the master equation. The binary decision at the
steady state is read upon the Pauli-$z$ operator acting on the target qubit

$\displaystyle\langle\sigma_{z}^{0}\rangle^{ss}=\frac{1}{g_{\sum}}\sum_{i}^{N}g_{i}^{2}\langle\sigma_{z}\rangle_{i}$
(13)

as the classification identifier where $g_{\sum}=\sum_{i}g_{i}^{2}$. Based the
eqs (II.3) and (13), finally the binary classification rule reads

$Decision:\begin{cases}0,&\langle\sigma_{z}^{0}\rangle^{ss}=\frac{1}{g_{\sum}}\sum_{i}^{N}g_{i}^{2}\langle\sigma_{z}\rangle_{i}\geq
0\\\ 1,&\text{else}\end{cases}$ (14)

where $\langle\sigma_{z}\rangle_{i}$ is the $i$th information reservoir
magnetization. The steady state binary decision expressed by the Pauli-$z$
observable is a summation of the input quantum data weighted by respective
couplings. This is reasonable as the classic model has a similar expression.

(a)

(b)

Figure 2: Cost function minimization depending on different learning rates
against the variation of $g$ and $\theta$ respectively. (a) The initial values
of the reservoirs are $\langle\sigma_{z}^{1}\rangle=0.95$,
$\langle\sigma_{z}^{2}\rangle=-0.15$, $g_{1}=0.001$, $g_{2}=0.06$ and
$\langle\sigma_{z}^{0}\rangle_{des}^{ss}=0.4$, respectively. (b) The initial
values $\theta_{1}=170\,^{\circ}$, $\theta_{2}=160\,^{\circ}$,
$g=g_{1}=g_{2}=0.05$ and $\langle\sigma_{z}^{0}\rangle_{des}^{ss}=0$,
respectively.

Figure 1 depicts the numerical verification of the introduced model as a
benchmark calculation. Here, the target qubit contacted two different
information reservoirs with $g_{1}$ and $g_{2}$ couplings. The quantum state
of the reservoirs are $\ket{\Psi(\theta=0,\phi=0)}\equiv\ket{\uparrow}$ and
$\ket{\Psi(\theta=\pi,\phi=0)}\equiv\ket{\downarrow}$, respectively. The dots
on the curve represents the steady state magnetization of the target qubit
corresponding to $g_{1},g_{2}$ coupling values. These values modulated as
$g_{1}=g/2-\Delta g$ and $g_{2}=g/2+\Delta g$ where $-0.5g<\Delta g<0.5g$. For
instance, when $\Delta g=-0.5g$, $g_{1}=g$ and $g_{2}=0$ means that the target
qubit is in contact only with the first reservoir with the quantum state
$\ket{\uparrow}$ and vice versa. In these limits, the steady state
magnetization gets $\langle\sigma_{z}\rangle=1,-1$ and takes intermediate
values when $-0.5g<\Delta g<0.5g$ as expected. In the numerical simulation, we
have used the realistic parameters of the superconducting circuits in the weak
coupling range [28]. Transmon qubits operate at a resonator frequency
$\omega_{r}\sim 1-10$ GHz with $g\sim 1-100$ MHz effective qubit-qubit
coupling.

As depicted above, the relevant parameters are the Bloch parameters
$\\{\theta,\phi\\}$, characterizing the input quantum data. Looking more
closely at eqs II.3 and 13, one can see the signatures of input data at the
steady state as expected values. The expected values can be related to the
Bloch parameters as

$\displaystyle\mathcal{\rho}_{\mathcal{R}_{i}}$
$\displaystyle=\begin{bmatrix}\frac{1+\cos\theta_{i}}{2}&\frac{e^{-i\phi_{i}}}{2}\sin\theta_{i}\\\
\frac{e^{i\phi_{i}}}{2}\sin\theta_{i}&\frac{1-\cos\theta_{i}}{2}\end{bmatrix}$
$\displaystyle:=\begin{bmatrix}\langle\sigma_{i}^{+}\sigma_{i}^{-}\rangle&\langle\sigma_{i}^{-}\rangle\\\
\langle\sigma_{i}^{+}\rangle&\langle\sigma_{i}^{-}\sigma_{i}^{+}\rangle\end{bmatrix}$
(15)

where $\mathcal{\rho}_{\mathcal{R}_{i}}$ is the quantum state of the $i$th
reservoir. Therefore in our model, Pauli-$z$ and Pauli-$y$ observables can be
chosen to extract relevant information for $\theta$ and $\phi$ parameters,
respectively, at the steady state. Expectation value of the Pauli-$y$
observable of the target qubit at the steady state reads

$\displaystyle\langle\sigma_{y}^{0}\rangle^{ss}=\frac{-(\gamma_{1}^{-}+\gamma_{2}^{+})}{g_{\sum}}\sum_{i}^{N}g_{i}^{2}\langle\sigma_{z}\rangle_{i}$
(16)

where $\gamma^{-}_{1}=r\tau\sum_{i=1}^{N}g_{i}\langle\sigma_{i}^{-}\rangle$,
$\gamma^{+}_{2}=r\tau\sum_{i=1}^{N}g_{i}\langle\sigma_{i}^{+}\rangle$.
Regarding eqs (13) and (16) together, one evaluates that relevant information
of the Bloch parameters can be extracted at the steady state of the target
qubit through Pauli observables.

##  III Learning of the model

In this section, we explore the gradient descent-based learning of the
introduced open classifier model. First we define the cost function to be
optimized as

$C=\frac{1}{2}(\langle\sigma_{\lambda}^{0}\rangle_{des}^{ss}-\langle\sigma_{\lambda}^{0}\rangle_{act}^{ss})^{2},$
(17)

where $\lambda=\\{y,z\\}$ denotes the Pauli matrices we choose for specific
parameters. Here, $\sigma_{\lambda}^{0}\rangle_{des}^{ss}$ is the desired and
$\langle\sigma_{\lambda}^{0}\rangle_{act}^{ss}$ is the actual steady state
expectation values of the target qubit for the Pauli observable
$\sigma_{\lambda}$. Definition of the cost function above is similar to [29],
however, note that the expected values are obtained in steady states in our
task.

Following the classic definitions, we rephrase eqs (4) and (5) as

$\displaystyle\bf{\nu}_{k+1}=\bf{\nu}_{k}+\delta\bf{\nu}_{k}$ (18)
$\displaystyle\delta{\nu}_{k}=-\eta\frac{\partial C}{\partial{\nu}_{k}}$ (19)

where $\nu$=$\\{g,\theta,\phi\\}$. Therefore, the relevant parameters are the
Bloch parameters and the couplings of the target qubit with the reservoirs. We
first derive the cost function for $g$ corresponding to the weights in the
classic model (see A). However, we also examine the learning tasks for the
Bloch parameters $\theta$ and $\phi$ corresponding to fixed values of $g$.

Figure 2(a) depicts the cost minimization given the parameters against the
episodes (the $k$ index) of $\nu=g$ in eqs (18) and (19) depending on
different values of $\eta$ when the target qubit contacted to two reservoirs.
That is, we examine the model using different learning rates (or different
optimization speeds). We observe that the optimization always has a smooth
feature for different $\eta$s. In the problem, we also observe that the
largest possible learning rate is one order of magnitude smaller than the
coupling rate.

(a)

(b)

Figure 3: Cost function minimization with surface depiction against the
variation of $g_{1}$ and $g_{2}$. (a) The learning rate $\eta=2.8\times
10^{-5}$, $\langle\sigma_{z}^{1}\rangle=0.95$,
$\langle\sigma_{z}^{2}\rangle=-0.15$, the target magnetization is
$\langle\sigma_{z}^{0}\rangle_{des}^{ss}=0.4$ and the initial coupling rates
before optimization is $g_{1}=0.001$, $g_{2}=0.06$. (b) The learning rate
$\eta=2.5\times 10^{-2}$, $\langle\sigma_{z}^{1}\rangle=0.95$,
$\langle\sigma_{z}^{2}\rangle=-0.15$, the target magnetization is
$\langle\sigma_{z}^{0}\rangle_{des}^{ss}=0.4$ and the initial coupling rates
before optimization is $g_{1}=0.001$, $g_{2}=0.06$.

Figures 3(a) and 3(b) present the same minimization problem when considering
the surface topology of the cost function. In the single target qubit case
coupled to two information reservoirs, the structure of the surface cost
function seems trivial to optimize without any local plateaus. Therefore, the
success of optimization depends on the selection of the learning rate value.
In figure 3(a), the model successfully performs the optimization task with an
appropriate learning rate. However, an unstable procedure occurs when a very
large value of $\eta$ is selected, as in figure 3(b). Although, in the figure,
cost function minimization seems to have been successfully achieved, in most
similar problems the iteration value extends beyond the cost function surface.
This is known as ‘overshooting’ the minimum.

(a)

(b)

Figure 4:  (a) Cost function minimization with surface depiction against the
variation of $\theta_{1}$ and $\theta_{2}$. The learning rate $\eta=0.5$, the
couplings are $g=g_{1}=g_{2}=0.03$ and
$\langle\sigma_{z}^{0}\rangle_{des}^{ss}=0$. Initial values for the problem
are $\theta_{1}=170\,^{\circ}$, $\theta_{2}=160\,^{\circ}$. (b) Cost function
minimization depending on different learning rates against the variation of
$\phi$. Here, $\phi_{1}=350\,^{\circ}$, $\phi_{2}=340\,^{\circ}$,
$\theta_{1}=\theta_{2}=60\,^{\circ}$, $g=g_{1}=g_{2}=0.01$ and
$\langle\sigma_{y}^{0}\rangle_{des}^{ss}=0$, $r=0.36$, $\tau=3$.

Conversely, extremely small learning rate values lead to being stuck in the
local minimums. Therefore adaptive tasks, in which the learning rates might
take different values during the process, are developed for GD-based methods
[30]. We find that for the training of the open classifier model, one order of
magnitude around the coupling rate in the weak coupling regime seems a
reasonable choice for $\eta$.

As we have pointed out above, we also examine the cases where the couplings to
the reservoirs are fixed. In this case, input data parameters are assumed to
be adjustable to obtain the desired output. Regarding figure 2(b), we observe,
again, smooth convergence with three orders of magnitude greater learning rate
than the coupling coefficient. Corresponding cost function is depicted in
figure 4(a). In this case, the Bloch parameter $\theta$ is iterated to
minimize the cost. See eqs (21) and (A) to obtain the cost function in case of
the $\theta$ parameter-dependent iteration. The Pauli-$z$ observable is,
again, relevant in the calculations.

Next, we consider the training task concerning the Bloch parameter $\phi$. The
Pauli-$y$ observable was chosen to extract $\phi$ parameter-dependent data.
This task requires special attention as the proposed classifier operates as an
open quantum system, driven by non-equilibrium reservoirs. Steady states bear
mixed quantum states in which quantum coherent information is irreversibly
lost. However, some non-vanishing quantum coherence may exist when the system
is driven by non-equilibrium environments. [31, 32]. In our case, eq. (II.3)
demonstrates that the target qubit retains quantum coherence at the steady
state as the non-diagonal part of the density matrix is non-zero. In addition,
eq. (16) states that the steady coherence is weighted by the coupling
coefficients where it can be parametrized by $\phi$ through the Pauli-$y$
observable.

Figure 5:  (Colour online.) Cost function minimization with surface depiction
against the variation of $\phi_{1}$ and $\phi_{2}$. Here, the initial values
for the dashed (optimization) line are $\eta=500$, $\phi_{1}=350\,^{\circ}$,
$\phi_{2}=340\,^{\circ}$, $\theta_{1}=\theta_{2}=60\,^{\circ}$,
$g=g_{1}=g_{2}=0.01$ and $\langle\sigma_{y}^{0}\rangle_{des}^{ss}=0$,
$r=0.36$, $\tau=3$ respectively.

Figure 4(b) shows the cost minimization depending on different learning rates.
The cost function values around the $\times 10^{-5}$ scale reveals a small
coherence value at the steady state compared to the diagonal elements of the
target qubit density matrix. In addition, the $\eta$ value for the $\phi$
parameter optimization has the largest value compared to the optimizations for
the $g,\theta$ parameters. Finally, figure 5 represents he cost function
minimization considering the update of Bloch parameters $\phi_{1}$ and
$\phi_{2}$. The 3D surface of the cost function is similar to figure 4(a),
only differing by the value of the learning rate.

If a comment is made by evaluating all the results together, we see that the
proposed classifier is suitable for GD-based training schemes. Moreover, open
system dynamics allows for smooth convergence in learning tasks which makes
the model favourable for multi layer feed-forward networks once an activation
function is introduced. Since binary classification is a task in itself for
ML, the model we propose is a candidate to be a trainable model in ML
processes, even when considered alone.

##  IV Conclusions

In this study, we examined the training of a classifier model based on the
open quantum model in different parameter spaces with the GD-based method.
Using our analytical results, we have derived cost functions for three
different parameters for training our model and made calculations that
minimize the cost functions with the gradient descent algorithm. Obtaining the
classification response of the model in a stationary state makes the system
dynamics continuous dynamics. As a result of this, we achieved optimization of
the model, namely its training with smooth, continuous results. Since the
training processes are continuous, which means that they are differentiable,
it is concluded that the model we propose is suitable for developing an
activation function and using it in larger quantum networks. In addition,
although the classification result is taken in a stationary state, it becomes
possible to train in all Bloch parameter spaces as well as the coupling
coefficients by the steady quantum coherence.

Our study revealed that the derived cost functions are trained at different
values of learning rates for corresponding parameters. In our model, cost
functions successfully minimized with appropriate learning coefficients.

## Acknowledgment

The authors acknowledge support from the Scientific and Technological Research
Council of Turkey (TÜBİTAK-Grant No. 120F353). The authors also wish to extend
special thanks to the Cognitive Systems Lab in the Department of Electrical
Engineering providing the atmosphere for motivational and stimulating
discussions.

##  Appendix A Derivation of the cost function

In this section, we present the mathematical justifications for numerical
calculations in the text. First, we substitute $\nu=g$ in eq. (19)

$\delta{g}_{i}=-\eta\frac{\partial C}{\partial{g}_{i}}.$ (20)

and obtain the cost function expression taking the partial derivative with
respect to the coupling constant $g$.

$\frac{\partial
C}{\partial{g}_{i}}=(\langle\sigma_{z}^{0}\rangle_{des}^{ss}-\langle\sigma_{z}^{0}\rangle_{act}^{ss})(-\frac{\partial\langle\sigma_{z}^{0}\rangle_{act}^{ss}}{\partial{g}_{i}})$
(21)

In our current example, we have two information reservoirs corresponding to
specific magnetizations. Therefore, the actual steady state magnetization (eq.
(13)) reads as

$A=\langle\sigma_{z}^{0}\rangle_{act}^{ss}=\frac{g_{1}^{2}\langle\sigma_{z}^{1}\rangle+g_{2}^{2}\langle\sigma_{z}^{2}\rangle}{g_{1}^{2}+g_{2}^{2}}.$
(22)

According to the recipe to derive the cost function, the partial derivatives
with respect to $g_{1}$ and $g_{2}$ separately obtained as

$\displaystyle\frac{\partial
A}{\partial{g}_{1}}=\frac{2g_{1}\langle\sigma_{z}^{1}\rangle(g_{1}^{2}+g_{2}^{2})-2g_{1}(g_{1}^{2}\langle\sigma_{z}^{1}\rangle+g_{2}^{2}\langle\sigma_{z}^{2}\rangle)}{(g_{1}^{2}+g_{2}^{2})^{2}}$
$\displaystyle\frac{\partial
A}{\partial{g}_{2}}=\frac{2g_{2}\langle\sigma_{z}^{2}\rangle(g_{1}^{2}+g_{2}^{2})-2g_{2}(g_{1}^{2}\langle\sigma_{z}^{1}\rangle+g_{2}^{2}\langle\sigma_{z}^{2}\rangle)}{(g_{1}^{2}+g_{2}^{2})^{2}}$
(23)

In our example, the desired magnetization is
$\langle\sigma_{z}^{0}\rangle_{des}^{ss}=0.4$ a constant value in the cost
function. After substituting eqs. (22) and (A) in eq. (21), the expression
obtained after substituting them in eq. (20), eq. (18) becomes as follows:

$\displaystyle(g_{1})_{k+1}=(g_{1})_{k}+\delta(g_{1})_{k}$
$\displaystyle(g_{2})_{k+1}=(g_{2})_{k}+\delta(g_{2})_{k}.$ (24)

Next, we substitute $\nu=\theta$ in eq. (19) as

$\delta{\theta}_{i}=-\eta\frac{\partial C}{\partial{\theta}_{i}}.$ (25)

Regarding eq. (II.3), one can easily see that the magnetization of the $i$th
reservoir is
$\langle\sigma_{z}\rangle_{i}=\langle\sigma_{i}^{+}\sigma_{i}^{-}\rangle-\langle\sigma_{i}^{-}\sigma_{i}^{+}\rangle$.
Therefore, azimuth parameter-dependent expression of the magnetization can be
easily written as $\langle\sigma_{z}\rangle_{i}=\cos\theta_{i}$.

Equation (26) is obtained when we take the partial derivative of the cost
function with respect to $\theta$.

$\frac{\partial
C}{\partial{\theta}_{i}}=(\langle\sigma_{z}^{0}\rangle_{des}^{ss}-\langle\sigma_{z}^{0}\rangle_{act}^{ss})(-\frac{\partial\langle\sigma_{z}^{0}\rangle_{act}^{ss}}{\partial{\theta}_{i}})$
(26)

In our current example, we have two information reservoirs corresponding to
specific magnetizations. Therefore, the actual steady state magnetization (eq.
(13)) reads as

$A=\langle\sigma_{z}^{0}\rangle_{act}^{ss}=\frac{g_{1}^{2}\cos\theta_{1}+g_{2}^{2}\cos\theta_{2}}{g_{1}^{2}+g_{2}^{2}}.$
(27)

According to the recipe to derive the cost function, the partial derivatives
with respect to $\theta_{1}$ and $\theta_{2}$ separately obtained as

$\displaystyle\frac{\partial
A}{\partial{\theta}_{1}}=-\frac{g_{1}^{2}\sin\theta_{1}}{g_{1}^{2}+g_{2}^{2}}$
$\displaystyle\frac{\partial
A}{\partial{\theta}_{2}}=-\frac{g_{2}^{2}\sin\theta_{2}}{g_{1}^{2}+g_{2}^{2}}$
(28)

In our example, the desired magnetization is
$\langle\sigma_{z}^{0}\rangle_{des}^{ss}=0$ a constant value in the cost
function. After substituting eqs (27) and (A) in eq. (26), the expression
obtained after substituting them in eq. (25), eq. (18) becomes as follows:

$\displaystyle\bf{(\theta)}_{k+1}=\bf{(\theta_{1})}_{k}+\delta\bf{(\theta_{1})}_{k}$
$\displaystyle\bf{(\theta_{2})}_{k+1}=\bf{(\theta_{2})}_{k}+\delta\bf{(\theta_{2})}_{k}.$
(29)

Let’s edit Eq. (18) for $\nu=\phi$

$\delta{\phi}_{i}=-\eta\frac{\partial C}{\partial{\phi}_{i}}.$ (30)

Equation (31) is obtained when we take the partial derivative of the cost
function with respect to $\phi$.

$\frac{\partial
C}{\partial{\phi}_{i}}=(\langle\sigma_{y}^{0}\rangle_{des}^{ss}-\langle\sigma_{y}^{0}\rangle_{act}^{ss})(-\frac{\partial\langle\sigma_{y}^{0}\rangle_{act}^{ss}}{\partial{\phi}_{i}})$
(31)

In our current example, we have two information reservoirs corresponding to
specific magnetizations. Therefore, the actual steady state magnetization (eq.
(13)) by using eq. (II.3) reads as

$\displaystyle
A=\langle\sigma_{y}^{0}\rangle_{act}^{ss}=-r\tau\frac{g_{1}^{3}\sin\theta_{1}\cos\theta_{1}\cos\phi_{1}+g_{1}g_{2}^{2}\sin\theta_{1}\cos\theta_{2}\cos\phi_{1}+g_{1}^{2}g_{2}\cos\theta_{1}\sin\theta_{2}\cos\phi_{2}+g_{2}^{3}\sin\theta_{2}\cos\theta_{2}\cos\phi_{2}}{g_{1}^{2}+g_{2}^{2}}.$
(32)

According to the recipe to derive the cost function, the partial derivatives
with respect to $\phi_{1}$ and $\phi_{2}$ separately obtained as

$\displaystyle\frac{\partial
A}{\partial{\phi}_{1}}=r\tau\frac{g_{1}^{3}\sin\theta_{1}\cos\theta_{1}\sin\phi_{1}+g_{1}g_{2}^{2}\sin\theta_{1}\cos\theta_{2}\sin\phi_{1}}{g_{1}^{2}+g_{2}^{2}}$
$\displaystyle\frac{\partial
A}{\partial{\phi}_{2}}=r\tau\frac{g_{1}^{2}g_{2}\cos\theta_{1}\sin\theta_{2}\sin\phi_{2}+g_{2}^{3}\sin\theta_{2}\cos\theta_{2}\sin\phi_{2}}{g_{1}^{2}+g_{2}^{2}}$
(33)

In our example, the desired magnetization is
$\langle\sigma_{y}^{0}\rangle_{des}^{ss}=0$ a constant value in the cost
function. After substituting eqs (32) and (A) in eq. (31), the expression
obtained after substituting them in eq. (30), eq. (A) becomes as follows:

$\displaystyle\bf{(\phi)}_{k+1}=\bf{(\phi_{1})}_{k}+\delta\bf{(\phi_{1})}_{k}$
$\displaystyle\bf{(\phi_{2})}_{k+1}=\bf{(\phi_{2})}_{k}+\delta\bf{(\phi_{2})}_{k}.$
(34)

## References

  * McCulloch and Pitts [1943] W. S. McCulloch and W. Pitts, Bulletin of Mathematical Biophysics 5, 115 (1943).
  * Rosenblatt [1958] F. Rosenblatt, Psychological Review 65, 386 (1958).
  * Misra and Saha [2010] J. Misra and I. Saha, Neurocomputing 74, 239 (2010).
  * Gu  _et al._ [2018] J. Gu, Z. Wang, J. Kuen, L. Ma, A. Shahroudy, B. Shuai, T. Liu, X. Wang, G. Wang, J. Cai, and T. Chen, Pattern Recognition 77, 354 (2018).
  * Schmidhuber [2015] J. Schmidhuber, Neural Networks 61, 85 (2015).
  * Bennett and DiVincenzo [2000] C. H. Bennett and D. P. DiVincenzo, Nature 404, 247 (2000).
  * Montanaro [2016] A. Montanaro, npj Quantum Information 2, 1 (2016).
  * Banchi  _et al._ [2016] L. Banchi, N. Pancotti, and S. Bose, npj Quantum Information 2, 16019 (2016).
  * Yamamoto  _et al._ [2018] A. Y. Yamamoto, K. M. Sundqvist, P. Li, and H. R. Harris, Quantum Inf Process 17, 128 (2018).
  * Tacchino  _et al._ [2019] F. Tacchino, C. Macchiavello, D. Gerace, and D. Bajoni, npj Quantum Inf 5, 1 (2019).
  * Torrontegui and García-Ripoll [2019] E. Torrontegui and J. J. García-Ripoll, EPL 125, 30004 (2019).
  * Mangini  _et al._ [2021] S. Mangini, F. Tacchino, D. Gerace, D. Bajoni, and C. Macchiavello, EPL 134, 10002 (2021).
  * Yan  _et al._ [2020] S. Yan, H. Qi, and W. Cui, Physical Review A 102, 052421 (2020).
  * Pechal  _et al._ [2022] M. Pechal, F. Roy, S. A. Wilkinson, G. Salis, M. Werninghaus, M. J. Hartmann, and S. Filipp, Physical Review Research 4, 033190 (2022).
  * Nguyen  _et al._ [2022] T. Nguyen, I. Paik, Y. Watanobe, and T. C. Thang, Electronics 11, 437 (2022).
  * Türkpençe  _et al._ [2019] D. Türkpençe, T. Ç. Akıncı, and S. Şeker, Physics Letters A 383, 1410 (2019).
  * Korkmaz and Türkpençe [2022] U. Korkmaz and D. Türkpençe, Physics Letters A 426, 127887 (2022).
  * Korkmaz  _et al._ [2021] U. Korkmaz, C. Sanga, and D. Türkpençe, in  _2021 5th International Symposium on Multidisciplinary Studies and Innovative Technologies (ISMSIT)_ (2021) pp. 105–109.
  * Korkmaz  _et al._ [2022] U. Korkmaz, C. Sanga, and D. Türkpençe, in  _Electrical and Computer Engineering_, Lecture Notes of the Institute for Computer Sciences, Social Informatics and Telecommunications Engineering, edited by M. N. Seyman (Springer International Publishing, 2022) pp. 159–170.
  * Verstraete  _et al._ [2009] F. Verstraete, M. M. Wolf, and J. Ignacio Cirac, Nature Phys 5, 633 (2009).
  * Deffner and Jarzynski [2013] S. Deffner and C. Jarzynski, Phys. Rev. X 3, 041003 (2013).
  * Deffner [2013] S. Deffner, Phys. Rev. E 88, 062128 (2013).
  * Ziman  _et al._ [2002] M. Ziman, P. Štelmachovič, V. Bužek, M. Hillery, V. Scarani, and N. Gisin, Physical Review A 65, 042105 (2002).
  * Blume-Kohout and Zurek [2005] R. Blume-Kohout and W. H. Zurek, Foundations of Physics 35, 1857 (2005).
  * Zwolak and Zurek [2017] M. Zwolak and W. H. Zurek, Physical Review A 95, 030101 (2017).
  * Scarani  _et al._ [2002] V. Scarani, M. Ziman, P. Štelmachovič, N. Gisin, and V. Bužek, Physical Review Letters 88, 097905 (2002).
  * Nagaj  _et al._ [2002] D. Nagaj, P. Štelmachovič, V. Bužek, and M. Kim, Physical Review A 66, 062307 (2002).
  * Krantz  _et al._ [2019] P. Krantz, M. Kjaergaard, F. Yan, T. P. Orlando, S. Gustavsson, and W. D. Oliver, Appl. Phys. Rev. 6, 021318 (2019).
  * Wan  _et al._ [2017] K. H. Wan, O. Dahlsten, H. Kristjánsson, R. Gardner, and M. S. Kim, npj Quantum Inf 3, 36 (2017).
  * Ruder [2017] S. Ruder, An overview of gradient descent optimization algorithms (2017), arXiv:1609.04747 [cs].
  * Scully  _et al._ [2003] M. O. Scully, M. S. Zubairy, G. S. Agarwal, and H. Walther, Science 299, 862 (2003).
  * Karevski and Platini [2009] D. Karevski and T. Platini, Physical Review Letters 102, 207207 (2009).


# Measurement of the Stray Light in the Advanced Virgo Input Mode Cleaner
Cavity using an instrumented baffle

O. Ballester  O. Blanch  L. Cardiel  M. Cavalli-Sforza  Institut de Física
d’Altes Energies (IFAE), Barcelona Institute of Science and Technology,
E-08193 Barcelona, Spain  A. Chiummo  European Gravitational Observatory
(EGO), Cascina, Pisa, Italy  C. García  J.M. Illa  C. Karathanasis  M.
Kolstein  Institut de Física d’Altes Energies (IFAE), Barcelona Institute of
Science and Technology, E-08193 Barcelona, Spain  M. Martínez  Institut de
Física d’Altes Energies (IFAE), Barcelona Institute of Science and Technology,
E-08193 Barcelona, Spain  Institució Catalana de Recerca i Estudis Avançats
(ICREA), Barcelona, Spain  A. Menéndez-Vázquez  Ll. M. Mir  J. Mundet  A.
Romero-Rodríguez  D. Serrano  Institut de Física d’Altes Energies (IFAE),
Barcelona Institute of Science and Technology, E-08193 Barcelona, Spain  H.
Yamamoto  LIGO laboratory, California Institute of Technology (Caltech),
Pasadena, CA, US

###### Abstract

A new instrumented baffle was installed in Spring 2021 at Virgo surrounding
the suspended mirror in the input mode cleaner triangular cavity. It serves as
a demonstrator of the technology designed to instrument the baffles in the
main arms in the near future. We present, for the first time, results on the
measured scattered light distribution inside the cavity as determined by the
new device using data collected between May and July 2021, with Virgo in
commissioning phase and operating with an input laser power in the cavity of
28.5 W. The sensitivity of the baffle is discussed and the data is compared to
scattered light simulations.

Introduction.— As part of the phase II upgrade of the Advanced Virgo
interferometer Acernese et al. (2015, 2019), the experiment plans to equip the
suspended areas surrounding the main test masses in the Fabry-Perot cavities
with instrumented baffles. This opens up the possibility of monitoring the
scattered light from the mirrors in the cavity at low angles, providing a
dynamic mapping of the mirror surface and defects. In addition, the baffles
would assist in the alignment of the cavities, in the detection of higher-
order laser modes, and in establishing correlations with interferometer
glitches. In April 2021, a first instrumented baffle was installed surrounding
the suspended end mirror of the Virgo’s input mode cleaner (IMC) cavity (see
Figure 1). This intervention took place in the framework of phase I upgrades
in the IMC, including a new suspension payload and a new end mirror. This new
baffle serves as a demonstrator of the technology for instrumenting the
baffles in Virgo’s main arms. This paper presents first results on the
performance of the detector and the comparison with the simulations describing
the scattered light inside the IMC cavity.

Instrumented Baffle.— A very detailed description of the baffle technology
will be provided in a separate publication. Here a brief description is given.
The baffle has an inner radius (in the $x-y$ plane) of 7 cm and an outer
radius of 17.5 cm. It is divided into two halves, each tilted 9 degrees with
respect to the normal to the nominal direction of the laser beam to avoid
complete back reflections in the cavity. The infrared light from the IMC
cavity penetrates the holes in the mirror-polished stainless steel baffle
reaching Si-based $7.37\times 7.37$ mm2 (sensitive area $6.97\times 6.97$ mm2)
newly developed photosensors, provided by the Hamamatsu company in Japan. The
holes have a conical shape centered around the sensors with 4 mm diameter at
the front baffle surface, such that the light does not resolve the sensor edge
and the scattering of light with the hole geometry is minimized. Both the
baffle and the sensor surfaces include anti-reflecting coatings at 1064 nm.
The baffle is equipped with 76 sensors symmetrically placed with respect to
the $y$ axis and mounted on two large gold-plated polyamide-based PCBs. All
the elements in the baffle are certified for ultra-high vacuum (UHV)
conditions.

Figure 1: (left) Picture of the instrumented baffle installed inside the IMC
end mirror vacuum tower. (right) Sketch of the location of the photosensors in
the baffle in the $x-y$ plane. The gray lines define the six regions where
sensors signals are added to determine various observables in the data and
simulation.

The layout of the sensors in the $x-y$ plane is presented in Figure 1. The
sensors are mostly located in two concentric rings at radii of 8.8 and 9.8 cm,
respectively. Additional sensors are distributed across the baffle at larger
radii and different azimuthal angles. The sensor signals are processed by 16
ADCs (8 ADCs in each half baffle), which at present average each of the sensor
signals over 500 ms, translating into a baffle readout rate of 2 Hz, with the
potential to reach up to 10 Hz in the future. The calibration of the
photosensors in the laboratory, using a dedicated laser setup, indicated a
good linearity in the response for the whole range of interest and a less than
3$\%$ sensor-to-sensor variation. The absolute calibration was determined to
be $4.6~{}\mu$W/ADC count, with an uncertainty of about 5$\%$. In addition,
each ADC is instrumented with a temperature sensor, leading to 16 separate
readings. The whole system operates with a limited voltage of 3.3 V.

The performance of the IMC cavity was checked right after the instrumented
baffle was installed and the operations of the IMC cavity restored. The level
of losses and the throughput power in the cavity showed no significant
changes. Currently, the instrumented baffle is an integral part of the Virgo
operations.

The suspended baffle operates at room temperature and under UHV conditions,
with no active cooling possible, given the limitations dictated by the
suspension. Therefore, the potential overheat of the front-end electronics is
a priori an important aspect. Thanks to the moderate operating voltage, the
efficient heat dissipation of the gold-plated PCB, and a careful design of the
mechanical couplings with the stainless steal structure, acting as cold mass,
no overheating is observed. This is illustrated in Figure 2, where the
readings of two temperature sensors are displayed. The system reaches thermal
equilibrium after 40 minutes with temperatures in the range between 22 and
28°C. The sensor with the highest readings corresponds to that closest to the
micro-controller electronics, dissipating most of the heat.

Figure 2: Measurement of the temperature as a function of time for a period of
one hour. The ADCs showing the highest and lowest temperatures are shown.

Raw Measurements.— The baffle showed good performance in the absence of light
in the cavity with average noise levels in the channels limited to up to seven
counts, with an RMS of 0.01 to 0.16 counts, depending on the sensor, and a
signal-to-noise ratio typically in the range between one and more than ten in
the presence of light. The stability of the baffle signals with time was
studied indicating that they remain constant over time. The raw signals in the
individual photosensors in ADC counts, averaged over the period of one hour
and with no noise-suppression applied, are presented in Figure 3 for two
separate data sets. As expected, the signals are concentrated at low radius
with sensors reaching more than 100 counts. The data show a left-right
asymmetry, with more power in the half baffle at negative $x$ values. In
addition, the data suggest the power is concentrated in a plane tilted by
about 15 degrees in the $\phi$ direction with respect to the nominal $x-z$
plane of the triangular cavity. These effects are persistent in all the data
analysed.

Figure 3: Observed light power in the individual sensors, in ADC counts,
averaged over time, for two separate data sets spanning several weeks.

Few special runs were taken after forcing small displacements (of the order of
few $\mu$m) of the IMC end mirror with respect to its nominal position while
maintaining the cavity at resonance. This translated into changes in the IMC
output power and the appearance of laser higher-order modes, which in turn
resulted into about 5$\%$ variations in the total power measured in the
baffle, thus showing the sensitivity of the baffle to the status of the
cavity. Similarly, the baffle proved to be quite sensitive to momentary
unlocks that lead to the absence of circulating light in the cavity, resulting
in an abrupt decrease in baffle signals.

Comparison with Simulations.— The average noise pedestals in each of the
channels, as determined during quiet periods with no laser in the IMC cavity,
are subtracted channel-by-channel in the data before the final absolute
calibration is applied. An additional noise-suppression algorithm is a priori
applied with the aim to remove the channels with signals compatible with noise
within two standard deviations of the noise. However, no channel is removed
from the data because of an excellent signal-to-noise performance of the
instrument.

The calibrated data are compared to simulations Yamamoto et al. (2021) of the
light inside the IMC cavity. The simulation follows closely that presented in
Ref. Romero-Rodríguez et al. (2021), with updated mirror maps and considering
a nominal input laser power of $28.5\pm 0.1$ W, corresponding to the average
input power in the cavity determined during the data taking period under
consideration with an uncertainty of $0.2\%$. The latter is included in the
calibrated data as an additional uncertainty. The simulation does not include
thermal effects in the mirrors induced by the laser, that are expected to be
small. As discussed in Ref. Romero-Rodríguez et al. (2021), the baffle itself
is only approximately simulated as a geometrical position in which the
intensity of the field is evaluated. Figure 4 shows the 2-D distribution of
light (in $\mathrm{W/m^{2}}$) in the baffle area. The power is concentrated
along the $x$-axis (see also Table 1 below). In order to determine a possible
dependency of the simulated fields with the end mirror maps, the results are
compared with those from Ref. Romero-Rodríguez et al. (2021), including
previous mirror maps, resulting into a negligible difference.

Figure 4: 2-D map of the simulated power distribution (in W/m2) in the baffle
surface.

Figure 5 shows the measured differential distribution of the power intensity
in the baffle as a function of $r$ and $\phi$ compared to simulations, where
$r$ and $\phi$ are evaluated at the center of each sensor, and only the active
area of the sensor ($\pi\times 4$ mm2) is taken into account. The data present
a strong dependence with $r$, with the power being concentrated in the inner
part. The power intensity observed varies in the range between 1.1
$\mathrm{W/m^{2}}$ and 52.3 $\mathrm{W/m^{2}}$ at small $r$, and between 0.4
$\mathrm{W/m^{2}}$ and 9.6 $\mathrm{W/m^{2}}$ at very large $r$. As already
anticipated, the data in the two innermost rings present a tilted $\phi$
distribution with two prominent structures in the vicinity of $\phi\sim 0$ and
$\phi\sim\pi$.

Figure 5: Measured differential distribution of the power intensity in the
baffle (dots) as a function of $\phi$ for four different radii. The second
ring includes four sensors at a slightly different radius (see Figure 1) at
$\phi\sim\pi/2$ and $\phi\sim 3\pi/2$. Data are compared to simulations (gray
lines) obtained including the three mirrors (MC1+MC2+MC3) in the IMC cavity,
removing the dihedron right mirror (MC1+MC2) or only including the end mirror
(MC2) surface maps.

The simulation, including the information of the mirror surface maps for all
the mirrors (M1, M2, M3) in the IMC triangular cavity, provides a fair
description of the main features in the data but fails to describe the total
power in the baffle. Table 1 presents the results integrated over the sensors
in each sextant. In the case of the simulation, the results are only presented
normalised by the power circulating in the cavity (9695 W), which factorizes
out uncertainties. A total power in the sensors of about 6.6 mW is observed,
whereas the simulation predicts around 4.4 mW. As shown in Table 1, the
predictions are close to the data in sextants S2 and S5, corresponding to
those with the largest observed power, but underestimates the data in the rest
of sextants. Similarly, the simulation does not completely support the level
of left-right asymmetry observed in the data by comparing the information in
the different sextants.

The measured tilt in $\phi$ cannot be attributed to a misalignment of the
triangular cavity in data and is presumably dominated by the details of the
mirror surface maps. In particular, the dihedron mirrors (here denoted as M1
and M3) are located 143 m away from the end mirror (denoted as M2) in the IMC
cavity, and are facing the instrumented baffle. For illustration purposes, the
simulations were repeated assuming perfect dihedron mirrors and therefore
ignoring their mirror surface map information. As shown in Figure 5, this
translates into the disappearance of any $\phi$ dependence in the simulated
power intensity. Therefore, we conclude that the disagreement between data and
simulation is most probably originated by a non-accurate enough description of
the mirror surface maps in the dihedron, mainly that of the MC3 mirror, which
is responsible for the larger energy deposits in some of the PDs. Thus, this
comparison will help establish the requirements on future IMC mirror surface
specifications. At large radius, the amount of light detected is small and the
predictions might be also affected by large angle scattering contributions not
included in the simulation. Other important dynamics, such as polarisation
mixing might also be missing, and some stray light underestimated. More data
will indicate whether additional work is required in the procedure to subtract
detector pedestals. These are all important topics that will be studied using
the data measured by this instrumented baffle.

Sextant | Data | Simulation
---|---|---
| Power (mW) |  Ratio ($\times 10^{-5}$) |  Ratio ($\times 10^{-5}$)
S1 | $0.47\pm 0.02$ | $4.8\pm 0.2$ | 1.0
S2 | $1.92\pm 0.10$ | $19.8\pm 1.0$ | 19.6
S3 | $0.55\pm 0.03$ | $5.7\pm 0.3$ | 1.6
S4 | $0.67\pm 0.03$ | $6.9\pm 0.4$ | 1.1
S5 | $2.25\pm 0.11$ | $23.2\pm 1.2$ | 20.6
S6 | $0.76\pm 0.04$ | $7.8\pm 0.4$ | 1.5
Table 1: Measured power distribution in the different baffle sextants (see
Figure 1) compared to simulations. The second column shows the total power,
whereas the rightmost columns (“Ratio”) show the total power normalised by the
power circulating in the cavity (9695 W). The uncertainty on the data is
dominated by the uncertainty in the calibration of the sensors (5.0%) as the
uncertainty on the IMC input power (0.2%) is negligible.

Conclusions.— We have presented first results from the new instrumented baffle
installed in the Virgo’s input mode cleaner end mirror in 2021. The data
collected by the baffle have been used to measure, for the first time, the
scattered light inside the cavity. The measured light distribution in the
baffle presents features dominated by scattering processes from the mirrors
facing the instrumented baffle in the cavity. The data have been compared to
simulations that provide an approximate description of the data. These results
will serve to calibrate the simulations and demonstrate already the potential
of instrumented baffles to detect defects in the mirrors and to improve the
understanding of the scattered light inside ground-based gravitational wave
experiments like Virgo.

Acknowledgements.— The authors gratefully acknowledge the European
Gravitational Observatory(EGO) and the Virgo Collaboration for providing
access to the facilities and the support from EGO and the University of Pisa
during the installation of the new instrument in Virgo. The LIGO Observatories
were constructed by the California Institute of Technology and Massachusetts
Institute of Technology with funding from the National Science Foundation
under cooperative agreement PHY-9210038. The LIGO Laboratory operates under
cooperative agreement PHY-1764464. This work is partially supported by the
Spanish MINECO under the grants SEV-2016-0588, PGC2018-101858-B-I00, and
PID2020-113701GB-I00 some of which include ERDF funds from the European Union.
IFAE is partially funded by the CERCA program of the Generalitat de Catalunya.

## References

  * Acernese et al. (2015) F. Acernese et al. (VIRGO), Class. Quant. Grav. 32, 024001 (2015), eprint 1408.3978.
  * Acernese et al. (2019) F. Acernese et al. (Virgo), Phys. Rev. Lett. 123, 231108 (2019).
  * Yamamoto et al. (2021) H. Yamamoto, A. Romero, and T. Edo, LIGO-T2000311-v2 (2021), URL https://dcc.ligo.org/LIGO-T2000311.
  * Romero-Rodríguez et al. (2021) A. Romero-Rodríguez, A. Allocca, A. Chiummo, M. Martínez, L. M. Mir, and H. Yamamoto, Class. Quant. Grav. 38, 045002 (2021), eprint 2008.13740.