11institutetext: Department of Physics and Earth Science of the University of
Ferrara, Via Saragat 1, I-44122 Ferrara, Italy 22institutetext: INAF –
Astronomical Observatory of Capodimonte, Salita Moiariello 16, I-80131 Napoli,
Italy 33institutetext: INAF – OAS, Astronomical Observatory of Bologna, via
Gobetti 93/3, 40129 Bologna, Italy 44institutetext: Department of Physics “E.
Pancini”, University of Napoli “Federico II”, Via Cinthia 21, 80126, Napoli,
Italy 55institutetext: Department of Physics of the University of Milano, via
Celoria 16, I-20133 Milano, Italy 66institutetext: INAF – IASF Milano, via A.
Corti 12, I-20133 Milano, Italy 77institutetext: Technische Universität
München, Physik-Department, James-Franck Str. 1, 85741 Garching, Germany
88institutetext: Max-Planck-Institut für Astrophysik, Karl-Schwarzschild-Str.
1, D-85748 Garching, Germany 99institutetext: INAF – Astronomical Observatory
of Trieste, via G. B. Tiepolo 11, I-34131, Trieste, Italy 1010institutetext:
INFN, Sezione di Ferrara, Via Saragat 1, 44122 Ferrara, Italy
1111institutetext: Department of Physics of the University of Salerno - Via
Giovanni Paolo II, 132, 84084, Fisciano (SA), Italy 1212institutetext:
University Observatory, Faculty of Physics, Ludwig-Maximilians-Universität
München, Scheinerstr. 1, 81679 Munich, Germany

# Searching for galaxy-scale strong-lenses in galaxy clusters with deep
networks - I: methodology and network performance

G. Angora, Searching for galaxy-scale strong-lenses in galaxy clusters with
deep networks - I: methodology and network performanceSearching for galaxy-
scale strong-lenses in galaxy clusters with deep networks - I: methodology and
network performanceSearching for galaxy-scale strong-lenses in galaxy clusters
with deep networks - I: methodology and network performanceSearching for
galaxy-scale strong-lenses in galaxy clusters with deep networks - I:
methodology and network performance<EMAIL_ADDRESS>P. Rosati Searching
for galaxy-scale strong-lenses in galaxy clusters with deep networks - I:
methodology and network performanceSearching for galaxy-scale strong-lenses in
galaxy clusters with deep networks - I: methodology and network
performanceSearching for galaxy-scale strong-lenses in galaxy clusters with
deep networks - I: methodology and network performanceSearching for galaxy-
scale strong-lenses in galaxy clusters with deep networks - I: methodology and
network performanceSearching for galaxy-scale strong-lenses in galaxy clusters
with deep networks - I: methodology and network performanceSearching for
galaxy-scale strong-lenses in galaxy clusters with deep networks - I:
methodology and network performance M. Meneghetti Searching for galaxy-scale
strong-lenses in galaxy clusters with deep networks - I: methodology and
network performanceSearching for galaxy-scale strong-lenses in galaxy clusters
with deep networks - I: methodology and network performance M. Brescia
Searching for galaxy-scale strong-lenses in galaxy clusters with deep networks
- I: methodology and network performanceSearching for galaxy-scale strong-
lenses in galaxy clusters with deep networks - I: methodology and network
performanceSearching for galaxy-scale strong-lenses in galaxy clusters with
deep networks - I: methodology and network performanceSearching for galaxy-
scale strong-lenses in galaxy clusters with deep networks - I: methodology and
network performance A. Mercurio Searching for galaxy-scale strong-lenses in
galaxy clusters with deep networks - I: methodology and network
performanceSearching for galaxy-scale strong-lenses in galaxy clusters with
deep networks - I: methodology and network performanceSearching for galaxy-
scale strong-lenses in galaxy clusters with deep networks - I: methodology and
network performanceSearching for galaxy-scale strong-lenses in galaxy clusters
with deep networks - I: methodology and network performance C. Grillo
Searching for galaxy-scale strong-lenses in galaxy clusters with deep networks
- I: methodology and network performanceSearching for galaxy-scale strong-
lenses in galaxy clusters with deep networks - I: methodology and network
performanceSearching for galaxy-scale strong-lenses in galaxy clusters with
deep networks - I: methodology and network performanceSearching for galaxy-
scale strong-lenses in galaxy clusters with deep networks - I: methodology and
network performance P. Bergamini Searching for galaxy-scale strong-lenses in
galaxy clusters with deep networks - I: methodology and network
performanceSearching for galaxy-scale strong-lenses in galaxy clusters with
deep networks - I: methodology and network performanceSearching for galaxy-
scale strong-lenses in galaxy clusters with deep networks - I: methodology and
network performanceSearching for galaxy-scale strong-lenses in galaxy clusters
with deep networks - I: methodology and network performance A. Acebron
Searching for galaxy-scale strong-lenses in galaxy clusters with deep networks
- I: methodology and network performanceSearching for galaxy-scale strong-
lenses in galaxy clusters with deep networks - I: methodology and network
performanceSearching for galaxy-scale strong-lenses in galaxy clusters with
deep networks - I: methodology and network performanceSearching for galaxy-
scale strong-lenses in galaxy clusters with deep networks - I: methodology and
network performance G. Caminha Searching for galaxy-scale strong-lenses in
galaxy clusters with deep networks - I: methodology and network
performanceSearching for galaxy-scale strong-lenses in galaxy clusters with
deep networks - I: methodology and network performanceSearching for galaxy-
scale strong-lenses in galaxy clusters with deep networks - I: methodology and
network performanceSearching for galaxy-scale strong-lenses in galaxy clusters
with deep networks - I: methodology and network performance M. Nonino
Searching for galaxy-scale strong-lenses in galaxy clusters with deep networks
- I: methodology and network performanceSearching for galaxy-scale strong-
lenses in galaxy clusters with deep networks - I: methodology and network
performance L. Tortorelli Searching for galaxy-scale strong-lenses in galaxy
clusters with deep networks - I: methodology and network performanceSearching
for galaxy-scale strong-lenses in galaxy clusters with deep networks - I:
methodology and network performance L. Bazzanini Searching for galaxy-scale
strong-lenses in galaxy clusters with deep networks - I: methodology and
network performanceSearching for galaxy-scale strong-lenses in galaxy clusters
with deep networks - I: methodology and network performance E. Vanzella
Searching for galaxy-scale strong-lenses in galaxy clusters with deep networks
- I: methodology and network performanceSearching for galaxy-scale strong-
lenses in galaxy clusters with deep networks - I: methodology and network
performance

(Received xxx; accepted xxx)

Galaxy-scale strong lenses in galaxy clusters provide a unique tool to
investigate their inner mass distribution and the sub-halo density profiles in
the low-mass regime, which can be compared with the predictions from
$\Lambda$CDM cosmological simulations. We search for galaxy-galaxy strong-
lensing systems in the HST multi-band imaging of galaxy cluster cores from the
CLASH and Hubble Frontier Fields programs by exploring the classification
capabilities of deep learning techniques. Convolutional neural networks are
trained utilising highly-realistic simulations of galaxy-scale strong lenses
injected into the HST cluster fields around cluster members. To this aim, we
take advantage of extensive spectroscopic information on member galaxies in 16
clusters and the accurate knowledge of the deflection fields in half of these
from high-precision strong lensing models. Using observationally-based
distributions, we sample the magnitudes (down to $F814W=29$AB), redshifts and
sizes of the background galaxy population. By placing these sources within the
secondary caustics associated with the cluster galaxies, we build a sample of
$\sim\\!3000$ galaxy-galaxy strong lenses which preserve the full complexity
of real multi-colour data and produce a wide diversity of strong lensing
configurations. We study two deep learning networks processing a large sample
of image cutouts in three HST/ACS bands, and we quantify their classification
performance using several standard metrics. We find that both networks achieve
a very good trade-off between purity and completeness ($85\%$–$95\%$), as well
as a good stability with fluctuations within $2\%$–$4\%$. We characterise the
limited number of false negatives and false positives in terms of the physical
properties of the background sources (magnitudes, colours, redshifts and
effective radii) and cluster members (Einstein radii and morphology). We also
demonstrate the neural networks’ high degree of generalisation by applying our
method to HST observations of 12 clusters with previously known galaxy-scale
lensing systems.

###### Key Words.:

Gravitational lensing, galaxies: clusters: general, galaxies: photometry,
galaxies: distances and redshifts, techniques: image processing, methods: data
analysis

##  1 Introduction

Strong gravitational lensing is a powerful tool for studying the mass
distribution of galaxies and galaxy clusters and for testing cosmological
models. Over the last decades, strong lensing has been exploited, for example,
to analyse galaxy structures and study their evolution (e.g. Treu & Koopmans,
2002; Auger et al., 2010; Sonnenfeld et al., 2013), to measure the value of
the Hubble constant using time delay measurements (e.g. Suyu et al., 2017,
2020; Grillo et al., 2018; Millon et al., 2020; Moresco et al., 2022), to
constrain the dark energy equation of state (e.g. Jullo et al., 2010; Cao et
al., 2012; Collett & Auger, 2014; Caminha et al., 2022), and to estimate the
dark matter fraction in massive early-type galaxies (e.g. Grillo, 2010;
Tortora et al., 2010; Sonnenfeld et al., 2015). On cluster-scales, strong
lensing models allow for the study of the inner total mass distribution of
clusters by exploiting an increasing number of multiple images of background
sources (e.g. Caminha et al., 2017, 2019; Acebron et al., 2018; Bergamini et
al., 2019, 2021b; Lagattuta et al., 2019, 2022). In addition, the strong
lensing magnification enables clusters to be used as cosmic telescopes to
study explore the intrinsic properties of high-redshift faint (lensed)
sources, otherwise undetectable (e.g. Swinbank et al., 2009; Richard et al.,
2011; Vanzella et al., 2020, 2021).

Recently, by utilising cluster mass maps from high-precision strong-lensing
models, Meneghetti et al. (2020, 2022) reported an excess of galaxy-galaxy
strong lensing (GGSL) events in galaxy clusters compared with the expectations
from the $\Lambda$CDM structure formation model. This has opened a debate on
whether such an excess could be due to limitations in cosmological simulations
(e.g. in the mass resolution or in the treatment of baryonic physics) or to
more fundamental aspects related to the properties of dark-matter (Meneghetti
et al. 2022 and references therein).

We focus this study on the search for GGSL systems embedded in galaxy cluster
halos. In this environment, the probability of GGSLs is generally higher than
in the field, for a given lens mass, owing to the contribution of the cluster-
scale lensing effect. Traditionally, GGSLs are identified through the visual
inspection of candidates selected with spectroscopic or photometric criteria
(e.g. Le Fèvre & Hammer, 1988; Jackson, 2008; Sygnet et al., 2010; Pawase et
al., 2014). However, this will not be a viable method with the upcoming data-
intensive surveys based on the next-generation facilities, such as the
European Space Agency (ESA) Euclid satellite (Laureijs et al., 2011) and the
Vera Rubin Observatory (Ivezić et al., 2019), which are expected to find tens
of thousands of galaxy clusters and $\sim 10^{5}$ GGSLs (LSST Dark Energy
Science Collaboration, 2012; Euclid Collaboration et al., 2019).

Several techniques have recently been developed to handle this unprecedented
amount of survey imaging data. These range from semi-automatic algorithms
searching for arc and ring-shaped features (e.g. More et al., 2012; Gavazzi et
al., 2014; Sonnenfeld et al., 2018), to crowdsourcing science (e.g. Marshall
et al., 2016; Sonnenfeld et al., 2020). In this context, machine learning and
deep learning methods appear to be a reliable and efficient mean to identify
GGSLs (see, for example, the discussion in Metcalf et al. 2019), although they
need to be trained on appropriate simulated datasets. In fact, the restricted
number of confirmed strong-lensing examples in galaxy clusters prevents from
training machine learning methods with real data. Moreover, the large redshift
range over which GGSLs are searched for, their different morphologies, colours
and magnitudes require realistic simulations to make deep learning-based
methods effective in detecting real strong lenses.

To this aim, significant efforts have been made over the last years to
simulate the GGSL population as those observed by current and upcoming
surveys. Mock images of strong-lensing events are obtained by coadding
simulated lensed sources to foreground galaxies with different methods. For
example, dark matter halos and galaxies can be extracted from semi-analytical
catalogues (e.g. with the Millennium Observatory project, as done by Metcalf
et al. 2019), using mass density profiles (e.g. Collett, 2015; He et al.,
2020; Lanusse et al., 2018), or deep learning algorithms (Lanusse et al.,
2021). Other studies opted for a hybrid approach which consists in modelling
the mass density profile of photometrically selected galaxies (e.g. Petrillo
et al., 2017, 2019; Li et al., 2020, 2021; Gentile et al., 2022; Cañameras et
al., 2021; Akhazhanov et al., 2022). Similarly, lensed sources can be
simulated by modelling their surface brightness distributions (e.g. Petrillo
et al., 2017, 2019; Li et al., 2020, 2021; Gentile et al., 2022) or sampled
from observations (e.g. Meneghetti et al., 2008, 2010; Metcalf et al., 2019),
and then coadded to real or synthetic images through ray-tracing techniques
(e.g. GLAMER Metcalf & Petkova 2014; Petkova et al. 2014, GRAVLENS Keeton
2001).

In this work, we present a novel approach which exploits accurate cluster
deflection fields to generate thousands of galaxy-galaxy strong lenses in
galaxy clusters. The deflection angle maps are provided by high-precision
cluster lens models, constructed by Bergamini et al. (2019, 2021b) and Caminha
et al. (2019) with the LensTool software (Kneib et al., 1996; Jullo et al.,
2007; Jullo & Kneib, 2009), by exploiting large numbers of spectroscopic
multiple images. These models accurately describe both the cluster-scale mass
component and the sub-halo mass distribution associated to the cluster
galaxies, which together affect the morphology, brightness and frequency of
galaxy-scale lensing events, for a given distribution of background sources.
Thus, GGSLs can be simulated with a realistic description of the cluster
galaxies acting as lenses in combination with the cluster-scale deflection
field.

We test this methodology by injecting background source galaxies in multi-band
images obtained with the Hubble Space Telescope (HST) as part of dedicated
campaigns over the last decade, such as the Cluster Lensing And Supernova
survey with Hubble (CLASH, Postman et al., 2012), Hubble Frontier Fields (HFF,
Lotz et al., 2017) and Reionization Lensing Cluster Survey (RELICS, Coe et
al., 2019). This high-quality imaging dataset is completed with intensive
spectroscopic programs, such as the CLASH-VLT (Rosati et al., 2014) with VIMOS
(Visible MultiObject Spectrograph, Le Fèvre et al., 2003) and MUSE
observations (Multi Unit Spectroscopic Explorer, Bacon et al., 2012, 2014,
2015) from the Very Large Telecscope (VLT), and GLASS (Grism Lens-Amplified
Survey from Space, Treu et al., 2015; Schmidt et al., 2014), which have
offered a three-dimensional view of $\sim 50$ clusters, providing spectra for
several thousand galaxies. We exploit the combination of the imaging and
spectroscopic datasets to construct our convolutional neural networks’
knowledge base (KB).

This paper is structured as follows. In Sec. 2, we describe the two
implemented convolutional neural networks. In Sec. 3, we illustrate the
simulation methodology and dataset configuration. We detail the network
performances in Sec. 4, including a complete analysis of the network
misclassifications as a function of the physical parameters. In Sec. 5, we
test the generalisation capabilities acquired by the networks by processing a
set of known GGSLs. Finally, we draw our conclusions in Sec. 6.

Throughout the paper, we adopt a flat $\Lambda$CDM cosmological model with
$\Omega_{M}$=0.3, $\Omega_{\Lambda}$= 0.7, and H${}_{0}=70$ km s-1 Mpc-1. All
astronomical images are oriented north to the top and east to the left. Unless
otherwise specified, magnitudes are in the AB system.

##  2 Convolutional neural network

Among the deep learning methods, convolutional neural networks (CNNs, LeCun et
al. 1989, 1998) have become well-established techniques to search for GGSLs in
imaging surveys, owing to their ability to automatically extract information
from raw data (e.g. Petrillo et al., 2017, 2019; Spiniello et al., 2018;
Jacobs et al., 2019a, b; Cañameras et al., 2020; Huang et al., 2020; Li et
al., 2020, 2021; Gentile et al., 2022). Here, we present the results achieved
by two CNN architectures111We tested different network architectures, e.g.
Residual Net X (He et al., 2015; Xie et al., 2016) and Inception Net (Szegedy
et al., 2014). Due to their lower performances and higher computational cost,
we limit the description of our results to deep models which achieved the best
performances., both of which are inspired by the Visual Group Geometry network
Simonyan & Zisserman (2014). The first network (similarly to the one described
in Angora et al. 2020), hereafter named VGG, consists of a chain of
convolution and pooling layers, whose ensemble of extracted feature maps are
connected to the output through two dense layers. The second network consists
of parallel VGGs, each of which processes a single HST band; hence, we name
this architecture Single Channel VGG (SC-VGG). Since we use the F435W, F606W,
F814W ACS bands in this work, the SC-VGG is composed of three parallel VGGs.
Therefore, while the VGG performs a (linear) combination of filters in the
first convolutional layer, the SC-VGG separates the informative contribution
carried by the three bands. To obtain a single probability value, we average
the probabilities for a GGSL event derived from each parallel VGG, which is
used to measure the loss function and to update the training parameters. For
both networks, we set the binary cross-entropy as loss function (Goodfellow et
al., 2016), the Leaky version of the Rectified Linear Unit (LeReLU, Maas et
al., 2013) as the activation function for each layer and Adadelta (Zeiler,
2012) as optimiser.

Furthermore, we include (i) an early stopping regularisation criterion
(Prechelt, 1997; Raskutti et al., 2011) preventing overfitting; and (ii) a
gradual reduction of the learning rate on the plateau of the loss function (as
a function of iterations, Bengio, 2012). These techniques evaluate the network
performance during the training phase, using a validation set previously
extracted from the whole KB. At the same time, we opt for a stratified k-fold
approach (Kohavi, 1995; Hastie et al., 2009) to handle the training-testing
splitting, where a fraction of the training image cutouts is augmented through
flipping and rotations, as described in Angora et al. (2020).

Finally, to avoid memory loss, the networks have been trained with input data
batches which include $32$ and $16$ patterns, respectively, for the VGG and
the SC-VGG models. All networks have been implemented through keras (Chollet
et al., 2015), with tensorflow (Abadi et al., 2015) as back-end system.

##  3 Methodology

###  3.1 The simulation process

Figure 1: HST colour-composite images (combining the F435W, F606W, F814W
filters) of three of the clusters in the sample (see Tab. 1). The tangential
critical lines corresponding to $4$ different redshifts,
$z=[1.5,3.0,4.5,6.0]$, are shown in cyan, green, orange and red, respectively.
Table 1: Description of the cluster sample included in the GGSL simulation.

Cluster |  | $z_{cluster}$ | Survey | $M_{200c}^{(a)}[10^{14}M_{\odot}]$ | N${}_{\text{img}}$ | $\Delta_{rms}[\arcsec]$ | ref
---|---|---|---|---|---|---|---
RX J2129+0005 | R2129 | 0.234 | CLASH | 7.78$\pm$2.43 | 22 | 0.20 | (1)
RX J2248-4431(b) | R2248 | 0.346 | HFF | 19.81$\pm$5.97 | 55 | 0.55 | (2)
MACS J1931-2635 | M1931 | 0.352 | CLASH | 11.62$\pm$8.84 | 19 | 0.38 | (1)
MACS J0416-2403 | M0416 | 0.397 | HFF | 11.43$\pm$2.66 | 182 | 0.40 | (3)
MACS J1206-0847 | M1206 | 0.439 | CLASH | 15.05$\pm$3.20 | 82 | 0.46 | (2)
MACS J0329-0211 | M0329 | 0.450 | CLASH | 12.70$\pm$2.19 | 23 | 0.24 | (1)
RX J1347-1145 | R1347 | 0.451 | CLASH | 35.40$\pm$5.05 | 20 | 0.36 | (1)
MACS J2129-0741 | M2129 | 0.587 | CLASH | N/A | 38 | 0.56 | (1)
222The first three columns list the: cluster names, short names and redshifts.
The fourth column specifies the program from which the images are extracted.
N${}_{\text{img}}$ (Col. 5) is the number of multiple images used to constrain
the model, $\Delta_{\text{rms}}$ is the root-mean-square separation between
the observed and model-predicted multiple images positions. The reference lens
model for each cluster is quoted in the last column.
(a) The cluster virial mass values have been measured by Umetsu et al. (2018).
(b) The cluster RX J2248.7$-$4431 is also known as Abell S1063.

(1) Caminha et al. (2019); (2) Bergamini et al. (2019); (3) Bergamini et al.
(2021b).

Figure 2: Example of a GGSL simulation. Left panel: HST image of the cluster M1206 at $z=0.439$ ($\sim 2\arcmin$ across), with the critical lines (in white) at $z=2.5$ from the lens model (Bergamini et al., 2019). A specific secondary critical line is marked in red and zoomed-in in the upper left $\sim 1\arcsec$ inset; the green spot indicates the position of the corresponding caustic on the source plane. Central panel: source plane at $z=2.5$ showing the caustic (in red), corresponding to the selected critical line, including the buffer (black dotted line) delimiting the injecting region; the injected source has a Sérsic profile (index $n=1.5$, $R_{eff}=0.14\arcsec$), mag${}_{F814W}=26.3$ and a start-forming galaxy SED. Right panel: colour composite image of the resulting simulated GGSL system, together with the critical line (red dotted line, with a circularised $\theta_{E}=1.7\arcsec$); the cutout is $\sim 10\arcsec$ across.  Table 2: List of Sérsic parameters and their adopted value ranges for the injected sources. Parameter | Symbol | Extraction description
---|---|---
Coordinate (source plane) | $y_{s}$ | Extracted within a buffer around the caustic (width $0.5\,r_{e}$)
Source magnitude | $m_{F814W}$ | Sampled from PDF, $p(i)$, COSMOS $+$ HST fields
Source redshift | $z_{s}$ | Sampled from PDF, $p(z|\Delta i)$, COSMOS
Effective Radius | $R_{e}$ |  $R_{e}=2.54$ kpc, $z\leq 1$
$R_{e}(z)=B(1+z)^{\beta}$, $z>1$ (Shibuya et al., 2015)
Sérsic index | $n$ | Extracted within $(1.0,2.0)$
axis ratio | $q$ | Extracted within $(0.2,1.0)$
position angle | $\varphi$ | Extracted within $(0,\pi)$
Figure 3: Left panel: galaxy number counts estimated from the COSMOS $i$-band
catalogue (grey bars), compared with (Capak et al., 2007, black line),
together with the $5\sigma$ HFF and CLASH $F814W$ depth limit (cyan and green
vertical lines). Galaxy counts added in the faint end to match the HST deep
counts are coloured in magenta. Right panels: redshift distributions for six
magnitude bins, $p(z|\Delta m)$, coloured according to the magnitude bin from
which they are extracted (left plot).  Figure 4: Left panel: adopted relation
for the redshift evolution of $R_{e}$, constant for $z\leq 1$ and taken from
Shibuya et al. (2015) for $z>1$, together with the upper and lower limits
within which $R_{e}$ is extracted (light red area). The black dashed line
shows the $0.070\arcsec$ threshold, under which the source size is
indistinguishable from the PSF, after the convolution. Right panel: the
resulting scaling relation, i.e. $\theta_{E}$ vs. $F160W$, compared to that
from Bergamini et al. (2019, 2021b) and Caminha et al. (2019), in red.  Table
3: Description of the cluster sample used in the non-GGSL selection.

Cluster |  | $z_{cluster}$ | $N$
---|---|---|---
Abell 383 | A383 | 0.188 | 70
Abell 209 | A209 | 0.209 | 75
RX J2129+0005 | R2129 | 0.234 | 51
Abell 2744 | A2744 | 0.308 | 126
MS 2137-2353 | MS2137 | 0.316 | 52
RX J2248-4431(b) | R2248 | 0.346 | 178
MACS J1931-2635 | M1931 | 0.352 | 28
MACS 1115+0129 | M1115 | 0.352 | 96
Abell 370 | A370 | 0.375 | 172
MACS J0416-2403 | M0416 | 0.397 | 120
MACS J1206-0847 | M1206 | 0.439 | 147
MACS J0329-0211 | M0329 | 0.450 | 66
RX J1347-1145 | R1347 | 0.451 | 44
MACS J1311-0310 | M1311 | 0.494 | 53
MACS J1149+2223 | M1149 | 0.542 | 130
MACS J2129-0741 | M2129 | 0.587 | 45
333The cluster name, short name, and redshift are listed in the first $3$
columns. The fourth column shows the number of non-GGSLs identified through
visual inspection.
(a) The cluster RX J2248.7$-$4431 is also known as Abell S1063.

To simulate the GGSL events, we exploit the deflection angle maps of eight
galaxy clusters obtained from cluster lens models444The cluster lens models
are publicly available at https://www.fe.infn.it/astro/lensing/. provided by
Bergamini et al. (2019, 2021b) and Caminha et al. (2019). The cluster sample
is described in Tab. 1, while three of the clusters are shown in Fig. 1. The
cluster total mass distribution of each cluster is modelled with a parametric
description of the overall lensing potential, which includes a cluster-scale
term composed of a dark matter halo and the smooth intra-cluster hot-gas mass
from Chandra X-ray data, when available (Bonamigo et al., 2017, 2018), and a
clumpy component associated to the cluster member galaxies (CLMs). For the
latter, the mass density profile of each sub-halo, containing both dark matter
and baryons, is modeled with a circular, singular dual-pseudo isothermal
profile (Limousin et al., 2005; Elíasdóttir et al., 2007) and further
calibrated with the measured stellar velocity dispersions of a large samples
of member galaxies (Bergamini et al., 2021a). Such lens models are able to
reproduce the observed positions of many multiple images (ranging from $\sim
20$ to $\sim 200$, see Table. 1) with a typical accuracy of $\lesssim
0.5\arcsec$.

LensTool reconstructs the cluster potential by minimising the difference
between the observed and model-predicted positions of the multiple images,
given a set of model parameter values. The deflection angle maps,
$\@vec{\alpha}$, describe the relation between the source real position
($\@vec{\beta}$) and its observed position ($\@vec{\theta}$) via the lens
equation: $\@vec{\beta}=\@vec{\theta}-\@vec{\alpha}$. The simulation process
is carried out with PyLensLib (Meneghetti, 2021) and can be summarised as
follows:

  * -

From the deflection angle maps, we derive the convergence and the shear maps,
i.e. the elements of the Jacobian matrix describing the image deformation,
whose inverse matrix is the so-called magnification tensor. Then, the critical
curves are found where the magnification goes to infinity. Examples of
tangential critical curves, corresponding to sources at four different
redshifts, are shown in Fig. 1, overlaid onto the HST field of view (FoV).

  * -

To avoid the primary critical lines associated to the cluster potential and
very small-scale galaxies, we select the secondary critical lines whose
equivalent (circularised) Einstein radius is
$0.2\arcsec<\theta_{E}<3.5\arcsec$, which is consistent with the expected
distribution of the equivalent Einstein radii associated to secondary critical
lines in galaxy clusters (see, for example, Fig. 7 in Meneghetti et al. 2022).
Moreover, we assign a selection probability proportional to $\theta_{E}$ (i.e.
larger critical lines are more likely to be extracted). In this way, a mass-
limited sample of lens galaxies is selected from the secondary critical lines,
circumventing any photometric selection (see the left panel in Fig. 2).

  * -

The selected secondary critical line is mapped into the corresponding caustic
on the source plane (see the central panel in Fig. 2) using the lens equation.

  * -

The source is simulated by injecting a Sérsic surface brightness profile
(Sérsic, 1963, 1968), $I(\@vec{\beta})$, within the caustic, including a
buffer whose width is set equal to half of the source effective radius.
Therefore, since the lens mapping conserves the surface brightness, i.e.
$I(\@vec{\theta})=I(\@vec{\beta})$, the observed surface brightness is
computed as $I(\@vec{\theta}=\@vec{\beta}+\@vec{\alpha})$. The resulting GGSL
is finally generated by convolving the simulated multiple image system with
the HST point spread function (PSF) for each band and then coadded to the HST
ACS image in a given filter (right panel in Fig. 2). The used PSFs are
estimated with morphofit (Tortorelli & Mercurio 2023, see also Tortorelli et
al. 2018, 2023).

In this work, we adopt a source spectral energy distribution (SED) of a star-
forming galaxy template from Kinney et al. (1996). The list of Sérsic
parameters and their adopted value range are shown in Tab. 2. The Sérsic index
is extracted from a uniform distribution between $n=1.0$ and $2.0$, typical of
late-type galaxy star-burst profiles. The axis ratio and the position angle
values are randomly extracted from uniform distributions in $(0.2,1.0)$ and
$(0,\pi)$, respectively. To closely reproduce the HST observations, we do not
use a uniform sampling for the other parameters. Specifically, for the source
magnitudes and redshifts, we estimate the number counts in the $i$-band (i.e.
the number of galaxies per square degree per magnitude bin) from the COSMOS
2015 catalogue (Scoville et al., 2007; Laigle et al., 2016), complemented with
HST Deep Field North and South observations (Williams et al., 1996; Metcalfe
et al., 2001) in $F814W$ (taken from Capak et al. 2007), which extends the
galaxy counts to the faint end, down to $F814W=29$ mag, (see the left panel of
Fig. 3). In each of the six magnitude bins (with $i$ limits
$=\\{22,24,25,26,27,28,29\\}$ mag), we use the COSMOS photometric redshift
catalogue to estimate a redshift probability density function (PDF), i.e.
$p(z\,|\Delta i)$, by fitting it with a simple function of the form:
$p(z\,|\Delta i)=Az^{2}e^{-z/z_{0}}$ for $i\in[22,24)$ and $p(z\,|\Delta
i)=Az^{2}e^{-(z/z_{0})^{1/2}}$ for the other magnitude bins (see, e.g.
Lombardi & Bertin, 1999; Lombardi et al., 2005). The redshift limit of the
COSMOS catalogue is $z\sim 7$, appropriate for our studies in which the
reddest band is $F814W$. The six modelled PDFs are shown in the right panels
of Fig. 3. For a given total number of galaxies to inject in the cluster
field, appropriate for the depth of the HST observations, we then use these
PDFs to assign a source magnitude and redshift to each background galaxy. We
also impose a minimum value for the source redshift
$z_{\text{src}}=z_{\text{cls}}+0.4$, as suggested by Meneghetti et al. (2022),
who measured the lensing cross-section for the galaxy clusters considered in
this work, finding that it becomes significantly larger than zero for
$z_{\text{src}}\gtrsim z_{\text{cls}}+0.4$.

Finally, to assign an effective radius value to the background galaxies, we
exploit an empirical relation describing the redshift evolution of galaxy
physical sizes proposed by Shibuya et al. (2015), approximated with a function
of the form: $R_{e}=B(1+z)^{\beta}$ (fitted by combining galaxy radii
estimated in the UV and optical bands). However, since a comparison of these
values with the effective radii measured by Tortorelli et al. (2018) for
low-$z$ galaxies shows a significant overestimate, we limit the application of
this relation only at $z>1$, adopting a constant value at $z\leq 1$ (see the
fourth row in Tab. 2 and the left panel in Fig. 4). As suggested by the
Shibuya et al. (2015) analysis, we assume a scatter $\sigma=0.25\,$kpc over
the entire redshift range, and randomly extract a value of $R_{e}$ at a given
redshift $z$ within the $[-1.5\sigma,+1\sigma]$ range (see the left panel in
Fig. 4). The chosen asymmetrical range allows us to sample $R_{e}$ values down
to $R_{e}\lesssim 0.5$ kpc at $z\gtrsim 4$ (as shown in the left panel of Fig.
4).

In the effort to verify that our simulated galaxy-scale lenses statistically
reproduce the observations, we compare the $\theta_{E}-m_{F160W}$ relation
obtained for our mock GGSL sample with the cluster member velocity dispersion
scaling relation, measured in Bergamini et al. (2019, 2021b) and used to build
the lens models, i.e.
$\sigma^{\text{CLM}}_{i}=\sigma^{\text{ref}}(L_{i}/L^{\text{ref}})^{\alpha}$
(see also Brainerd et al. 1996 and Jullo et al. 2007). To this aim, we compute
the expected Einstein radius as a function of the lens galaxy $F160W$
magnitude by assuming a singular isothermal sphere for the lens galaxy mass
density profile (Schneider, 2006):

$\theta_{E,i}=4\pi\Bigg{(}\frac{\sigma_{v}^{\text{ref}}}{c}\Bigg{)}^{2}\Bigg{(}\frac{D_{LS}}{D_{S}}\Bigg{)}10^{\displaystyle
0.8\,\alpha\,\Big{(}m^{\text{ref}}_{F160W}-m^{\text{CLM}}_{i}\Big{)}},$

where $m^{\text{ref}}_{F160W}$ is the $F160W$ reference magnitude,
corresponding to the brightest cluster galaxy (BCG); $\sigma_{v}^{\text{ref}}$
is a free parameter of the lens model (the normalization of the $\sigma-m$
scaling relation); $D_{S}$ is the angular diameter distance to the source, and
$D_{LS}$ is that between the lens and the source. The value of the slope of
the scaling relation, $\alpha$, is the one used in the lens models (directly
inferred from the stellar velocity dispersion measurements (Bergamini et al.,
2019, 2021b). In Fig. 4, we show the latter relation as a red line and remark
that it closely follows the distribution of effective Einstein radius values
inferred from the secondary critical lines.

###  3.2 Building the knowledge base

The described methodology can simulate an arbitrary number of realistic GGSLs
embedded in the complex environment of galaxy clusters, as observed with the
HST. To build a KB containing a large variety of GGSLs, we generate twice as
many mock GGSLs as non-GGSLs (NGGSLs, i.e. the negative class for the
classification problem). To this aim, we exploit the spectroscopic information
obtained by combining the CLASH-VLT VIMOS programme with the MUSE archival
observations and extract $10\arcsec$ cutouts centered on the CLM positions,
with a rest-frame velocity separation of $|v|\leq 5000$ km s-1, belonging to
$16$ clusters (see Tab. 3). Since some of these cutouts may contain strong
lensing features, they have been visually inspected by lensing experts in our
group. To help this classification process, each RGB image cutout was
inspected together with the $F435W$, $F606W$, $F814W$ bands, with knowledge of
any nearby spectroscopic source with $z_{s}\geq z_{\text{cluster}}+0.1$. A
score of $+1$, $+0.5$ or $-1$ was assigned to each CLM in case of a reliable
GGSL, a less likely GGSL or a non-GGSL, respectively. The cutouts containing
bright stars, nearby bright galaxies or with an incomplete multi-band coverage
near the edge of the FoV were also excluded. In this way, using the average
scores, a visual inspection of $20$ galaxy clusters led to the classification
of a pure sample $1453$ non-GGSL. At the same time, $320$ were classified as
candidate GGSLs and $282$ cutouts were excluded.

Therefore, the resulting KB comprises $1453$ observed non-GGSLs and $3000$
simulated GGSLs. This initial mismatch, motivated by the need for a sufficient
diversity of mock GGSLs, is later compensated during the validation and
augmentation of the input dataset, which leads to a training set of $\sim
3800$ images for each class. The KB dataset is then built by extracting
$128\times 128$ pixel cutouts ($3.84\arcsec$ by side).

A sample of simulated GGSLs and cutouts classified as non-GGSLs is shown in
Fig. 5, where the input images are indicated as red squares. GGSLs are sorted
in order of increasing $\theta_{E}$ (across columns) and source intrinsic
$F814W$ magnitude (across rows). Besides the typical arc-like and ring-like
features, several GGSL mock images do not reveal any apparent strong lensing
feature. This may occur (i) when the injected source is too faint, so that the
lens galaxy outshines the GGSL signal ($30\%$ of sources have $F814W>28$ mag);
(ii) for small-scale lenses (small $\theta_{E}$), where the lens galaxy halo
hides multiple images ($32\%$ of lenses have $\theta_{E}<0.5\arcsec$); (iii)
or a combination of the previous two cases ($10\%$ of GGSLs have both
$F814W>28$ mag and $\theta_{E}<0.5\arcsec$). Although these cutouts represent
the most challenging cases for the classifier, they act as adversarial
examples (Szegedy et al., 2013), preventing network overfitting and allowing
the network to gain a high degree of generalisation (Goodfellow et al., 2014;
Zhao et al., 2020; Kong et al., 2020). We also performed some experiments to
verify this by removing faint sources and small-scale lenses from the training
phase. Even though the network achieves nearly perfect results, it appears
unable to identify real strong lensing events, lacking enough generalisation
capabilities. Finally, we note that the same CLM cutout can be used in the
training set as a mock GGSL or a non-GGLS (i.e. no background source is
injected); however, we expect this to have a negligible impact on the CNN
performance.

Figure 5: Examples of RGB cutouts of GGSLs and non-GGSL obtained by combining
the $F435W$, $F606W$, $F814W$ bands. GGSL cutouts are sorted in order of
increasing $\theta_{E}$ (along columns) and $F814W$ magnitude (along rows)
values. The images have been stretched to emphasise faint features by clipping
values within $\pm 3\sigma$ and normalising them. Cutouts are $\sim 9\arcsec$
across; red squares indicate the $4\times 4\arcsec$ areas which are processed
by the networks. The labels at the bottom of each image indicate the values of
$z_{s}$, $\theta_{E}$ and $F814W$ magnitude.

##  4 Network performances

###  4.1 Statistical metrics

In order to assess the network classification performance, we use a set of
metrics that are computed from the binary confusion matrix (Stehman, 1997, see
middle panel of Fig. 6), namely the average efficiency (AE), purity (pur),
completeness (compl), and the F1-score, which is the harmonic mean between
purity and completeness. The accuracy represents a global average score which
includes both classes, while the other three estimators are measured for each
class. In this work, we refer to the GGSLs as the “positive” class. Therefore,
the four elements of a binary confusion matrix assume the following meaning:
true positives (TPs) are GGSLs correctly classified, false positives (FPs) are
non-GGSLs incorrectly flagged as GGSLs, false negatives (FNs) are GGSLs
wrongly predicted as non-GGSLs, true negatives (TNs) are non-GGSLs which are
correctly classified. These estimators, as well as the confusion matrix, are
computed by assuming a given threshold on the probability assigned by the CNN
to each object. Unless otherwise specified, such a probability threshold is
set to $0.50$. The performance assessment is completed by including the so-
called receiver operating characteristic curve (ROC, Hanley & McNeil, 1982),
which represents the trade-off between the true positive rate (TPR, i.e. the
completeness rate) and the false positive rate (FPR, i.e. the contamination
rate) as a function of the probability threshold (see the middle panel in Fig.
6). The area under this curve (AUC) can be used as an additional estimator of
the network classification capabilities. Finally, since the training-test
split has been implemented with a $k$-fold approach, we can also analyse the
metrics fluctuations over the $10$ folds (see Angora et al. 2020) and
represent them graphically as in the bottom panel of Fig. 6. For each metric,
the box delimits the $25$th and $75$th percentiles, i.e. the first and third
quartile ($Q_{1}$ and $Q_{3}$); their difference, the so-called interquartile
range, $IQR=Q_{3}-Q_{1}$; the error bars (ranging from $Q_{1}-1.5\cdot IQR$ to
$Q_{3}+1.5\cdot IQR$) correspond to the $90.3\%$ of data (i.e. within $\pm
2.698\sigma$ values); the horizontal line indicates the median value.

###  4.2 Performances

Figure 6: Comparison between the performance of the two networks under study
(in all panels the VGG and SC-VGG results are shown in green and in cyan,
respectively). Top panel: statistical performance estimators for the GGSL and
non-GGSL classes. Middle panel: ROC curves for the GGSL classification, i.e.
true positive rate vs false positive rate (the lines and the coloured areas
represent the mean and the $1\sigma$ level, respectively), the AUC (area under
the curve) values are quoted in the legend; the normalised confusion matrices
are also shown. Bottom panel: box plots for the GGSL metrics and average
efficiency (AE) for both classes (see Sec. 4.1 for details).

A summary of the performances is shown in Tab. 4 and in the top panel of Fig.
6 in terms of the statistical estimators (purity, completeness, F1-score and
average efficiency) for both classes. Globally, CNNs correctly classified at
least $87\%$ of the sources. Concerning the GGSL identification, both CNNs
appear more pure than complete, with pur$-$compl differences ranging from
$1.4\%$ to $4.8\%$. As for the non-GGSLs, the networks reveal an opposite
behaviour and a wider trade-off (pur$-$compl between $-8.7\%$ and $-2.7\%$).
Such a dichotomy results from an unclear distinction between the two classes
for a fraction of sources, which in our case is represented by faint sources
and small-scale lenses (i.e, the adversarial examples). As mentioned above,
these images prevent model overfitting when included in the training set;
however, we measure the statistical estimators with and without these
adversarial images in the test sets to quantify their effect on estimating the
model performances. These re-estimated metrics (i.e. without the adversarial
cutouts) are marked with an asterisk in Tab. 4. Clearly, the non-GGSL
completeness is not affected by this modification, while the non-GGSL purity
increases by $15.6\%$ and $11.9\%$, reaching $92.3\%$ and $93.3\%$,
respectively, for the VGG and SC-VGG models. Correspondingly, the F1-score
increases to $\sim 88\%$, with an improvement of $7.6\%$ for the VGG and
$5.7\%$ for the SC-VGG. Regarding the GGSL set, we find a more balanced trade-
off between purity and completeness: the drop in purity ($\sim 6\%$) is
balanced by a gain in completeness ($\sim 3\%$); while the F1-score drop
remains within $\lesssim 2\%$.

A further analysis of the CNN performances is illustrated in Fig. 6. In the
middle panel, the ROC curves and the corresponding AUC values are similar
(within $1\%$), whereas the bottom panel better details the network
classification capabilities, quantifying the performance fluctuations (values
listed in Tab. 5). Both networks have similar GGSL purity (median, $\sim
93\%$, first and third quartile, $Q_{1}\sim 92\%$ and $Q_{3}\sim 94\%$, and
inter-quartile range $IQR=2.1\%$). More significant variations occur for the
other GGSL metrics: the SC-VGG performances show an overall significant
improvement in terms of completeness (median: $2.8\%$, $Q_{1}$ and $Q_{3}$:
$4.5\%$, $2.1\%$), which in turn is reflected into an F1-score gain (from
$0.8\%$ to $3.8\%$). Concerning the non-GGSL metrics (only listed in Tab. 5),
SC-VGG achieves larger purity values ($4.7\%$), while VGG shows better
completeness ($1.0\%$). SC-VGG achieves the best non-GGSL F1 score, with an
average improvement of $1.6\%$.

Based on this analysis, SC-VGG shows the best purity-completeness trade-off
for both GGSL and non-GGSL ($92.4\%$ – $82.8\%$ vs. $91.0\%$ – $81.1\%$), it
appears more robust when dealing with adversarial examples and is less subject
to metric fluctuations ($\langle IQR\rangle_{SC-VGG}=2.1\%$ vs $\langle
IQR\rangle_{VGG}=3.4\%$), particularly for the GGSL completeness.

Furthermore, we also perform an experiment using single-band cutouts (the
$F435W$, $F606W$ and $F814W$ independently), i.e. removing the multi-band
information. The results are outlined in Tab. 6, to be compared with the
performances of the VGG and SC-VGG models. Although single-band performances
reproduce the VGG and SC-VGG purity-completeness trends, the use of single-
band data implies a loss of performance based on all metrics: an average
reduction of $1.8\%$, $1.3\%$ and $3.5\%$, respectively for the AE, GGSL and
non-GGSL F1-scores. However, this moderate performance loss suggests that
GGSLs can also be classified using single bands when multi-band imagining is
not available (see also Petrillo et al. 2017, Petrillo et al. 2019 Li et al.
2021, who use the Kilo-Degree Survey data by de Jong et al. 2015). When using
single band information, our tests show a better performance with the blue
filter, owing to the larger contrast between the lens galaxy (red) and the
strong-lensing features (generally blue).

We also tested the network performance using a KB built with cutouts twice as
large ($256$ pixels $\simeq 7.7\arcsec$ side). These experiments show a $10\%$
drop in the performance metrics. Considering also the significant extra burden
of computing resources, we did not pursue this strategy further.

Finally, we compare the predictions made by our neural networks with the
outcome of the visual inspection by gravitational lensing experts. As pointed
out, since we aim to produce a highly pure non-GGSL sample, the resulting set
of GGSL candidates is strongly contaminated, as it includes objects with
uncertain visual classification (conservatively excluded from the non-GGSL
set). Thus, a human-machine comparison is more appropriate for identifying
non-GGSLs rather than GGSLs. Indeed, by considering the $\sim 1800$ visually
inspected sources, we measure a high fraction of non-GGSL predicted in common
($\sim 95\%$), whereas the percentage of common GGSLs is just $\sim 35\%$.
However, by increasing the CNN probability threshold from $0.50$ to $0.75$, we
find that all the $105$ candidates are classified as GGSLs by both neural
networks and astronomers, underscoring the high effectiveness of the CNN
developed in this work.

###  4.3 False positives and false negatives

Figure 7: Selection of false positives common to both the VGG and SC-VGG
models. The probability of belonging to the GGSL class is shown in each
thumbnail (referred to the SC-VGG model). Cutouts are $\sim 4\arcsec$ across.

Figure 8: True negative (TN) and false positive (FP) analysis related to the
VGG and SC-VGG performances, as a function of the lens galaxy lens photometry:
$F814W$ magnitude (left panel), $(F606W-F814W)_{\text{norm}}$ normalised
colour (right panel). In both panels, the TN rates are plotted with purple and
magenta lines, while the FP rates with red and orange lines (respectively for
the SC-VGG and VGG), in both cases, solid for SC-VGG, dashed for VGG. The FP
ratio is plotted at the bottom of each panel (as a purple line for VGG, red
for SC-VGG).

In this section, we specifically analyse the properties of the false positives
and false negatives produced by the CNN, which are characterised based on the
galaxy magnitude and colour of FPs, and the GGSL system properties of FNs
(source redshift and intrinsic magnitude, together with the lens Einstein
radius).

Concerning the non-GGSL mistakenly classified as strong-lenses, a selection of
false positives common to both VGG and SC-VGG models is displayed in Fig. 7.
In Fig. 8, we show the TN, FP and the false positive ratio
($FPR=\frac{FP}{TN+FP}$) as a function of the cluster member photometry:
$F814W$ magnitude (left panel) and the normalised colour (right panel), whose
values are summarised in Tab. 7. We use the galaxy red-sequence dependence on
the redshift to compensate for the K-correction of CLMs, thus obtaining a
normalised colour. We use the Girardi et al. (2015) relation,
$(F814W-F606W)_{\text{norm}}=(F814W-F606W)_{\text{obs}}-\text{CM}(F814W)$,
that is the difference between the observed galaxy colour and the one
determined from the colour-magnitude (CM) relation at a given $F814W$
magnitude. We fit the CM sequence for the spectroscopically confirmed galaxy
members by using a robust linear regression (Cappellari et al., 2013) that
considers a possible intrinsic data scatter and clips out outliers, adopting
the least trimmed squares technique (Rousseeuw & Driessen, 2006). With this
correction, red galaxies are centred around zero, while blue galaxies have
colours $\lesssim-0.2$ mag, regardless of their redshift.

The number of false positives correlates both with the non-GGSL magnitudes and
colours for $F814W>19$ and $(F606W-F814W)_{\text{norm}}>-0.5$ (see the
approximately constant FPR in the bottom panels of Fig. 8). There are two FP
excesses in the brighter and bluer part of the parameter space. The FP
increase for progressively bluer objects ($7\%$ for objects bluer than $-0.5$
mag, up to $90\%$ and $50\%$, respectively for VGG and SC-VGG, in the bin
around $-0.7$ mag ). These are disc galaxies with a red bulge surrounded by
blue spiral-like structures (see the first row in Fig. 7) or generally blue
galaxies, which are under-represented in the KB, since our sample is extracted
from cluster cores mainly populated by red members.

The two models also have similar trends as a function of the $F814W$
magnitude, with a constant FPR of $\sim 0.16$ for $F814W>19.5$ and an FP
excess in the brightest bins. This can be due to embedded lensed features in
the training cutouts, which are outshone by the galaxy halo, so that when
bright lens galaxies are present, the networks are trained to predict the
existence of a GGSL with hidden lensed features (see the second row in Fig.
7). Indeed, these non-GGSL images appear similar to mock GGSLs with hidden
lensed features included in the training set. A bidimensional representation
of the distribution of FPRs in the colour-magnitude space is also shown in the
top panels of Fig. 13, for the VGG and SC-VGG models, which illustrate the
trends discussed above.

Figure 9: True positive (TP, green lines) and false negative (FP, blue lines)
distributions as a function of source redshift ($z_{src}$, top panel),
Einstein radius ($\theta_{E}$, middle panel), and source intrinsic $F814W$
magnitude (bottom panel) for the VGG (dashed lines) and SC-VGG (solid lines)
models. The corresponding FN ratio is plotted at the bottom of each panel.
Figure 10: Selection of false negative common to both the VGG and SC-VGG
models. The probability of belonging to the GGSL class is shown in each
thumbnail (referred to the SC-VGG model). Cutouts are $\sim 4\arcsec$ across.

Regarding the strong-lenses misclassified as non-GGSLs (i.e. the FNs), Fig. 9
shows the distributions of FN, TP and the false negative ratio
($FNR=\frac{FN}{TP+FN}$) as a function of the source redshift (top left
panel), galaxy-lens $\theta_{E}$ (top right panel), and the source intrinsic
$F814W$ magnitude (middle right panel). The main dependencies are also
summarised in Tab. 8. The number of FN decreases with $\theta_{E}$, with an
FNR ratio $\lesssim 0.06$ for $\theta_{E}\gtrsim 2\arcsec$. On the other hand,
FNs are mainly associated with small-scale galaxy-lenses (FNR $\gtrsim 0.10$
for $\theta_{E}<0.5\arcsec$). Likewise, misclassifications increase with the
source magnitude, with an FN fraction $\sim 0.10$ for $F814W\geq 27$. The VGG
and SC-VGG FN ratios are similar ($\sim 0.05$) down to $F814W=27$, whereas the
VGG FNR continues to increase up to $0.20$ at fainter magnitudes. A
2D-distribution of the FN ratio as a function of $\theta_{E}$ and $F814W$ is
shown in the middle panels of Fig. 13 for both CNNs. These plots clearly show
that the SC-VGG model outperforms the VGG network for faint sources and small-
scale lenses (FNR${}_{\text{VGG}}\simeq 2\times$FNR${}_{\text{SC-VGG}}$).

Similarly, the dependence of the FNR on the source redshift for the VGG and
SC-VGG models are comparable ($\sim 0.10$) up to $z\sim 3$, which represents
the $70\%$ of the whole FN set. However, the VGG FNR significantly
deteriorates (up to $\sim 0.21$) at larger redshifts, whereas SC-VGG FNR
remains approximately constant. The better performance of the SC-VGG model
over the VGG at $z\gtrsim 3$ is likely connected to the drop out effect for
lensed galaxies due to the Lyman-break shift out of the bluest filter. In the
VGG model, images in the three filters are combined in the first convolution
layer, thus mixing the multi-band information. Instead, with the single-
channel approach, only filters which carry information (useful to disentangle
GGSLs from non-GGSLs) contribute to the classification. In contrast, the drop-
out images (no signal) are down-weighted by the network model.

We also verify that there is no significant dependence of the FNR on the
source effective radius ($r_{e}$), as illustrated in the bottom panel of Fig.
13, where FNR values $\gtrsim 0.3$ are mainly confined in the high redshift
bin for the VGG model only, as discussed above.

Figure 11: Purity (red) and completeness (orange) as a function of the GGSL
probability threshold. Vertical lines correspond to the purity-completeness
intersection at $Pr=0.25$ (as a solid line) and to the classical threshold at
$Pr=0.50$ (as a dotted line). Purity and completeness values at $Pr=0.25$ and
$Pr=0.5$ are shown in the panel.

A selection of false negatives is shown in Fig. 10. The first row includes the
adversarial examples containing faint sources ($F814W>27.5$) and small-scale
lenses ($0.10\arcsec<\theta_{E}<0.25\arcsec$). These cases should be compared
with the FPs discussed above (see the second row in Fig. 7) The second row
includes bonafide GGSLs, with visible arc-like features. All the adversarial
FNs have probabilities (to be a GGSL) equal to zero, whereas bonafide GGSLs
have probabilities not far below the adopted threshold of $0.50$. This
suggests that these FNs could be recovered by lowering the GGSL probability
threshold. For example, one could adopt a threshold corresponding to the value
where the purity and the completeness functions intersect. Fig. 11 shows that
such a value is $Pr=0.25$ for the SC-VGG model. By adopting such a threshold,
all FNs in the second row of Fig. 10 are recovered; while analysing the entire
sample, we find that the completeness increases by $3.5\%$ at the expense of a
$1.8\%$ drop in purity. The optimal strategy on the $Pr$ value will depend on
the number of GGSL candidates in a given imaging dataset and specific science
objectives.

The analysis carried out in this section can be compared with other studies in
blank field (i.e. not in clusters) based on different imaging datasets,
adopting a similar methodology. For example, Petrillo et al. (2019) and
Gentile et al. (2022) use the KiDS (de Jong et al., 2015) and VOICE (Vaccari
et al., 2016) imaging surveys to search for GGSLs with similar CNNs. They
trained their networks with simulated lensed galaxies, adopting simple
Singular Isothermal Sphere models for lens early-type galaxies. A comparison
of our FN distributions as a function of $\theta_{E}$ (middle panel in Fig. 9)
with those from these studies shows similar FNR ranges, especially in the case
of Petrillo et al. (2019), who found FNR values in the $4\%$–$15\%$ range (see
their Fig. 3), while Gentile et al. (2022) obtained larger FNR values
($10\%$–$35\%$, see their Fig. 6).

##  5 Searching for strong-lenses in galaxy clusters

The experiments described in the previous sections are mostly focused on the
classification efficiency of the image-based CNN with simulated lenses by
evaluating its dependence on several observational parameters, such as the
magnitude, colour and Einstein radius. In this section, we are mainly
interested in evaluating the degree of generalisation achieved by the trained
CNNs in classifying real sources as GGSLs. This process step is commonly
referred to as run in the machine learning context. To maximise the parameter
space sampling, we do not use the k-fold approach utilised for performance
testing but rather exploit the whole KB by excluding the validation set used
for the regularisation processes.

To test the network generalisation capability, we perform a run on $24$
candidate GGSLs previously known in the HST sample of galaxy clusters. These
systems are listed in Tab. 9 and shown in Fig. 12. We assume as “secure” those
objects whose GGSL nature is based on the presence of clear strong-lensing
features, in some cases with a spectroscopic confirmation; those with
uncertain classification are flagged as “uncertain”, i.e. to be confirmed with
further observations. We note that some of these secure GGSLs (panels E2, E4,
E5, E6, G2) are part of multiple image systems produced by the cluster
deflection field in addition to the lens galaxy. We consider $20$ of these
candidates as secure. We organize the CNN predictions according to three
probability intervals: $Pr>0.5$, $0.2\leq Pr<0.5$ and $Pr\leq 0.2$,
respectively defined as true positive (TP), quasi-true positive (qTP) and
false negative (FN). Out of the $24$ processed GGSLs, both CNN models yield
the same classification for $15$ objects ($17$ by including qTPs), $13$ of
which are correctly classified ($15$ by including qTPs). By adopting a
probability threshold $Pr>0.2$, out of $20$ secure GGSLs, the true positives
are $18$ and $16$ for the VGG and SC-VGG, respectively ($16$ and $14$ by
excluding the qTPs).

All typical lenses, with arc-like or ring-like features, have been correctly
classified (see, for example, the Einstein rings shown in panels A2, C1, I1
and L2, or the arc-like structures in panels D2, E3, E4, F1, K1 and L1). The
system in panel B1 in Fig. 12, visually identified as a GGSL by Desprez et al.
(2018) in Abell 383, is predicted as a non-GGSL by both CNNs. However, a
further inspection, including also the HST/WFC3 bands, shows that the faint
sources, in a seemingly Einsten cross configuration, have different colors
suggesting a correct CNN classification (for this reason, we set this
classification as true negative (TN) in Tab. 9).

Concerning the FNs, the system in panel E1 is a spectroscopic multiply imaged
system in M0416 (named ID.14) studied by Caminha et al. (2016) and Vanzella et
al. (2017). This somewhat surprising misclassification may be due to a
peculiar lens configuration with two cluster galaxies, which is not well
represented in the training set (less than $0.01\%$ of the input lenses).
Other FNs (E2, G2) seem to be associated with cluster-scale lensing features,
a category which somewhat bridges GGSLs to giant arcs. Interestingly, the
remaining systems (G4, H1 and J2) with uncertain classification (see Tab. 9)
are characterised by almost complementary probabilities by the two CNN models.
This behaviour underscores the hard challenge of the (human or machine-based)
GGSL classification process in the presence of peculiar or complex
morphologies.

Figure 12: Known GGSLs processed by both VGG and SC-VGG networks (see Tab. 9).
The GGSL probability is reported in each thumbnail (referred to the VGG and
SC-VGG, respectively). Cutouts are $7.7\arcsec$ across. The inner red squares
enclose the area actually processed by the networks ($\sim 4\arcsec$).
According to the classification probability, cutouts are surrounded by a box
coloured in green (at least one probability is $>0.5$), orange (at least one
probability is $\in(0.2,0.5]$), and grey (otherwise).

##  6 Conclusions

In this work, we build the methodology to search for galaxy-scale strong
lensing systems in the HST multi-band imaging of galaxy clusters by utilising
deep learning techniques. We present a novel approach to simulate GGSLs in
galaxy clusters, which takes advantage of extensive spectroscopic information
on member galaxies in eight clusters whose inner total mass distribution is
determined with high accuracy through strong lensing modelling. The accurate
knowledge of the deflection field in each cluster allows us to inject
background sources near the secondary caustics associated with the cluster
galaxies and to simulate highly realistic GGSL systems into the HST cluster
field. To this aim, we sample the magnitude and photometric redshift
distributions of background galaxies, using Sérsic light profiles with a
physical size estimated from an empirical redshift evolution of the effective
radius of distant galaxies and a given star-forming SED.

In this way, we generate thousands of mock GGSLs which reproduce the
observations with high fidelity, preserving the full complexity of the real
data. We use the image cutouts of these simulated GGSL systems in three ACS
filters as a knowledge base to train two main CNNs. Their efficiency in
identifying and classifying GGSLs in HST images down to $F814W=29$ is
quantified using several standard metrics. The main results of our study can
be summarised as follows.

  * -

We investigate two CNN architectures: one combines the $F435W$, $F606W$ and
$F814W$ ACS bands (VGG model), while the other processes the three channels
independently (SC-VGG model). We find that both models achieve a very good
trade-off between purity and completeness ($85\%$–$95\%$). This reflects the
comprehensive sampling of the parameter space describing the source and lens
properties and a highly pure classification of non-GGSL events based on the
visual inspection of lensing experts. We also find that performance
fluctuations, measured with independent experiments iteratively using a
portion of the dataset (the so-called k-fold approach), are within
$2\%$–$4\%$, underlying the robustness of the network efficiency.

  * -

The analysis of the false positive and false negative rates shows that FPs are
typically spiral or disk galaxies whose structure is sometimes mistaken for
lensing features. An interesting category of false positives and false
negatives includes, respectively, bright galaxies and small cross-section
lenses (small Einstein radii), for which the lens galaxy outshines possible
multiple images. Although this category encompasses a significant fraction of
misclassification, its inclusion in the KB is important to avoid network
overfitting.

  * -

Overall, the SC-VGG model performs slightly better than the VGG model, based
on all the adopted metrics. This is particularly evident for faint and
relatively red lensed sources, for which the single-channel approach seems to
better take into account the K-correction effects.

  * -

When testing our CNN models on GGSLs previously known from the literature in
12 CLASH and HFF clusters, both networks are able to identify almost all
systems deemed as secure GGSLs, thus demonstrating a high degree of
generalisation. These true positive cases include a wide range of galaxy-scale
strong lensing configurations, while the false negatives seem to be generally
associated with GGSLs whose configuration suggests a significant contribution
from cluster-scale lensing.

In a forthcoming paper, we plan to perform a systematic search for GGSLs
around cluster members in $\sim 50$ galaxy clusters, part of several HST
programs (CLASH, HFF and RELICS). In future works, we also intend to extend
this methodology to the forthcoming ground and space-based datasets, such as
the Euclid (Laureijs et al., 2011) and Vera Rubin Observatory (Ivezić et al.,
2019) wide-area surveys, as well as the James Webb Space Telescope (Gardner et
al., 2006) NIRCAM imaging data, whose extraordinary potential in the study of
strongly lensed sources has been shown in the first observations of galaxy
cluster cores (e.g. Treu et al., 2022; Adams et al., 2023). Moreover, we will
explore other deep learning networks, such as deep auto-encoders (Goodfellow,
2010) and generative adversarial networks (Mirza & Osindero, 2014), in the
effort to automate the search and classification of strong-lensing events in
these next-generation datasets. In this context, other deep architectures
(e.g. region-based CNN, Ren et al. 2015, or masked region CNN, He et al. 2017)
can be tested by exploiting the trained convolutional layers developed in this
paper.

###### Acknowledgements.

We acknowledge financial support through grants PRIN-MIUR 2015W7KAWC,
2017WSCC32, and 2020SKSTHZ. MB acknowledges financial contributions from the
agreement ASI/INAF 2018-23-HH.0, Euclid ESA mission– Phase D. AA has received
funding from the European Union’s Horizon 2020 research and innovation
programme under the Marie Skłodowska-Curie grant agreement No 101024195 —
ROSEAU. MM thanks INAF for support through Minigrant “The Big-Data era of
cluster len- sing”. We gratefully acknowledge the support of NVIDIA
Corporation, with the donation of the Titan Xp GPUs used for this research.
In this work several public software was used: Topcat (Taylor, 2005), Astropy
(Astropy Collaboration et al., 2013, 2018), TensorFlow (Abadi et al., 2015),
Keras (Chollet et al., 2015) and Scikit-Learn (Pedregosa et al., 2011).

## References

  * Abadi et al. (2015) Abadi, M., Agarwal, A., Barham, P., et al. 2015, TensorFlow: Large-Scale Machine Learning on Heterogeneous Systems, software available from tensorflow.org
  * Acebron et al. (2018) Acebron, A., Cibirka, N., Zitrin, A., et al. 2018, ApJ, 858, 42
  * Adams et al. (2023) Adams, N. J., Conselice, C. J., Ferreira, L., et al. 2023, MNRAS, 518, 4755
  * Akhazhanov et al. (2022) Akhazhanov, A., More, A., Amini, A., et al. 2022, MNRAS, 513, 2407
  * Angora et al. (2020) Angora, G., Rosati, P., Brescia, M., et al. 2020, A&A, 643, A177
  * Astropy Collaboration et al. (2018) Astropy Collaboration, Price-Whelan, A. M., Sipőcz, B. M., et al. 2018, AJ, 156, 123
  * Astropy Collaboration et al. (2013) Astropy Collaboration, Robitaille, T. P., Tollerud, E. J., et al. 2013, A&A, 558, A33
  * Auger et al. (2010) Auger, M. W., Treu, T., Gavazzi, R., et al. 2010, ApJ, 721, L163
  * Bacon et al. (2012) Bacon, R., Accardo, M., Adjali, L., et al. 2012, The Messenger, 147, 4
  * Bacon et al. (2015) Bacon, R., Brinchmann, J., Richard, J., et al. 2015, A&A, 575, A75
  * Bacon et al. (2014) Bacon, R., Vernet, J., Borisova, E., et al. 2014, The Messenger, 157, 13
  * Bengio (2012) Bengio, Y. 2012, CoRR, abs/1206.5533
  * Bergamini et al. (2021a) Bergamini, P., Agnello, A., & Caminha, G. B. 2021a, A&A, 648, A123
  * Bergamini et al. (2019) Bergamini, P., Rosati, P., Mercurio, A., et al. 2019, A&A, 631, A130
  * Bergamini et al. (2021b) Bergamini, P., Rosati, P., Vanzella, E., et al. 2021b, A&A, 645, A140
  * Bonamigo et al. (2017) Bonamigo, M., Grillo, C., Ettori, S., et al. 2017, ApJ, 842, 132
  * Bonamigo et al. (2018) Bonamigo, M., Grillo, C., Ettori, S., et al. 2018, ApJ, 864, 98
  * Brainerd et al. (1996) Brainerd, T. G., Blandford, R. D., & Smail, I. 1996, ApJ, 466, 623
  * Cañameras et al. (2021) Cañameras, R., Schuldt, S., Shu, Y., et al. 2021, A&A, 653, L6
  * Cañameras et al. (2020) Cañameras, R., Schuldt, S., Suyu, S. H., et al. 2020, A&A, 644, A163
  * Caminha et al. (2016) Caminha, G. B., Grillo, C., Rosati, P., et al. 2016, A&A, 587, A80
  * Caminha et al. (2017) Caminha, G. B., Grillo, C., Rosati, P., et al. 2017, A&A, 607, A93
  * Caminha et al. (2019) Caminha, G. B., Rosati, P., Grillo, C., et al. 2019, A&A, 632, A36
  * Caminha et al. (2022) Caminha, G. B., Suyu, S. H., Grillo, C., & Rosati, P. 2022, A&A, 657, A83
  * Cao et al. (2012) Cao, S., Covone, G., & Zhu, Z.-H. 2012, ApJ, 755, 31
  * Capak et al. (2007) Capak, P., Aussel, H., Ajiki, M., et al. 2007, ApJS, 172, 99
  * Cappellari et al. (2013) Cappellari, M., Scott, N., Alatalo, K., et al. 2013, MNRAS, 432, 1709
  * Chollet et al. (2015) Chollet, F. et al. 2015, Keras, https://keras.io
  * Coe et al. (2019) Coe, D., Salmon, B., Bradač, M., et al. 2019, ApJ, 884, 85
  * Collett (2015) Collett, T. E. 2015, ApJ, 811, 20
  * Collett & Auger (2014) Collett, T. E. & Auger, M. W. 2014, MNRAS, 443, 969
  * de Jong et al. (2015) de Jong, J. T. A., Verdoes Kleijn, G. A., Boxhoorn, D. R., et al. 2015, A&A, 582, A62
  * Desprez et al. (2018) Desprez, G., Richard, J., Jauzac, M., et al. 2018, MNRAS, 479, 2630
  * Diego et al. (2015) Diego, J. M., Broadhurst, T., Benitez, N., Lim, J., & Lam, D. 2015, MNRAS, 449, 588
  * Elíasdóttir et al. (2007) Elíasdóttir, Á., Limousin, M., Richard, J., et al. 2007, arXiv e-prints, arXiv:0710.5636
  * Euclid Collaboration et al. (2019) Euclid Collaboration, Adam, R., Vannier, M., et al. 2019, A&A, 627, A23
  * Gardner et al. (2006) Gardner, J. P., Mather, J. C., Clampin, M., et al. 2006, Space Sci. Rev., 123, 485
  * Gavazzi et al. (2014) Gavazzi, R., Marshall, P. J., Treu, T., & Sonnenfeld, A. 2014, ApJ, 785, 144
  * Gentile et al. (2022) Gentile, F., Tortora, C., Covone, G., et al. 2022, MNRAS, 510, 500
  * Girardi et al. (2015) Girardi, M., Mercurio, A., Balestra, I., et al. 2015, A&A, 579, A4
  * Goodfellow et al. (2016) Goodfellow, I., Bengio, Y., & Courville, A. 2016, Deep Learning (MIT Press), http://www.deeplearningbook.org
  * Goodfellow (2010) Goodfellow, I. J. 2010, Technical Report: Multidimensional, Downsampled Convolution for Autoencoders, Tech. rep., Université de Montréal
  * Goodfellow et al. (2014) Goodfellow, I. J., Shlens, J., & Szegedy, C. 2014, arXiv e-prints, arXiv:1412.6572
  * Grillo (2010) Grillo, C. 2010, ApJ, 722, 779
  * Grillo et al. (2018) Grillo, C., Rosati, P., Suyu, S. H., et al. 2018, ApJ, 860, 94
  * Hanley & McNeil (1982) Hanley, J. A. & McNeil, B. J. 1982, Radiology, 143, 29
  * Hastie et al. (2009) Hastie, T., Tibshirani, R., & Friedman, J. 2009, The Elements of Statistical Learning: Data Mining, Inference, and Prediction, Second Edition, Springer Series in Statistics (Springer New York)
  * He et al. (2017) He, K., Gkioxari, G., Dollár, P., & Girshick, R. 2017, arXiv e-prints, arXiv:1703.06870
  * He et al. (2015) He, K., Zhang, X., Ren, S., & Sun, J. 2015, arXiv e-prints, arXiv:1512.03385
  * He et al. (2020) He, Z., Er, X., Long, Q., et al. 2020, MNRAS, 497, 556
  * Huang et al. (2020) Huang, X., Storfer, C., Ravi, V., et al. 2020, ApJ, 894, 78
  * Ivezić et al. (2019) Ivezić, Ž., Kahn, S. M., Tyson, J. A., et al. 2019, ApJ, 873, 111
  * Jackson (2008) Jackson, N. 2008, MNRAS, 389, 1311
  * Jacobs et al. (2019a) Jacobs, C., Collett, T., Glazebrook, K., et al. 2019a, ApJS, 243, 17
  * Jacobs et al. (2019b) Jacobs, C., Collett, T., Glazebrook, K., et al. 2019b, MNRAS, 484, 5330
  * Jullo & Kneib (2009) Jullo, E. & Kneib, J. P. 2009, MNRAS, 395, 1319
  * Jullo et al. (2007) Jullo, E., Kneib, J. P., Limousin, M., et al. 2007, New Journal of Physics, 9, 447
  * Jullo et al. (2010) Jullo, E., Natarajan, P., Kneib, J. P., et al. 2010, Science, 329, 924
  * Keeton (2001) Keeton, C. R. 2001, arXiv e-prints, astro
  * Kinney et al. (1996) Kinney, A. L., Calzetti, D., Bohlin, R. C., et al. 1996, ApJ, 467, 38
  * Kneib et al. (1996) Kneib, J. P., Ellis, R. S., Smail, I., Couch, W. J., & Sharples, R. M. 1996, ApJ, 471, 643
  * Kohavi (1995) Kohavi, R. 1995, in Proceedings of the 14th International Joint Conference on Artificial Intelligence - Volume 2, IJCAI’95 (San Francisco, CA, USA: Morgan Kaufmann Publishers Inc.), 1137–1143
  * Kong et al. (2020) Kong, K., Li, G., Ding, M., et al. 2020, arXiv e-prints, arXiv:2010.09891
  * Lagattuta et al. (2022) Lagattuta, D. J., Richard, J., Bauer, F. E., et al. 2022, MNRAS, 514, 497
  * Lagattuta et al. (2019) Lagattuta, D. J., Richard, J., Bauer, F. E., et al. 2019, MNRAS, 485, 3738
  * Laigle et al. (2016) Laigle, C., McCracken, H. J., Ilbert, O., et al. 2016, ApJS, 224, 24
  * Lanusse et al. (2018) Lanusse, F., Ma, Q., Li, N., et al. 2018, MNRAS, 473, 3895
  * Lanusse et al. (2021) Lanusse, F., Mandelbaum, R., Ravanbakhsh, S., et al. 2021, MNRAS, 504, 5543
  * Laureijs et al. (2011) Laureijs, R., Amiaux, J., Arduini, S., et al. 2011, arXiv e-prints, arXiv:1110.3193
  * Le Fèvre & Hammer (1988) Le Fèvre, O. & Hammer, F. 1988, ApJ, 333, L37
  * Le Fèvre et al. (2003) Le Fèvre, O., Saisse, M., Mancini, D., et al. 2003, in Society of Photo-Optical Instrumentation Engineers (SPIE) Conference Series, Vol. 4841, Instrument Design and Performance for Optical/Infrared Ground-based Telescopes, ed. M. Iye & A. F. M. Moorwood, 1670–1681
  * LeCun et al. (1989) LeCun, Y., Boser, B., Denker, J. S., et al. 1989, Neural Comput., 1, 541
  * LeCun et al. (1998) LeCun, Y., Bottou, L., Bengio, Y., & Haffner, P. 1998, Proceedings of the Institute of Radio Engineers, 86, 2278
  * Li et al. (2021) Li, R., Napolitano, N. R., Spiniello, C., et al. 2021, ApJ, 923, 16
  * Li et al. (2020) Li, R., Napolitano, N. R., Tortora, C., et al. 2020, ApJ, 899, 30
  * Limousin et al. (2005) Limousin, M., Kneib, J.-P., & Natarajan, P. 2005, MNRAS, 356, 309
  * Lombardi & Bertin (1999) Lombardi, M. & Bertin, G. 1999, A&A, 342, 337
  * Lombardi et al. (2005) Lombardi, M., Rosati, P., Blakeslee, J. P., et al. 2005, ApJ, 623, 42
  * Lotz et al. (2017) Lotz, J. M., Koekemoer, A., Coe, D., et al. 2017, ApJ, 837, 97
  * LSST Dark Energy Science Collaboration (2012) LSST Dark Energy Science Collaboration. 2012, arXiv e-prints, arXiv:1211.0310
  * Maas et al. (2013) Maas, A. L., Hannun, A. Y., & Ng, A. Y. 2013, in ICML Workshop on Deep Learning for Audio, Speech and Language Processing
  * Marshall et al. (2016) Marshall, P. J., Verma, A., More, A., et al. 2016, MNRAS, 455, 1171
  * Meneghetti (2021) Meneghetti, M. 2021, Introduction to Gravitational Lensing, 1st edn., Lecture Notes in Physics (Springer International Publishing)
  * Meneghetti et al. (2020) Meneghetti, M., Davoli, G., Bergamini, P., et al. 2020, Science, 369, 1347
  * Meneghetti et al. (2008) Meneghetti, M., Melchior, P., Grazian, A., et al. 2008, A&A, 482, 403
  * Meneghetti et al. (2022) Meneghetti, M., Ragagnin, A., Borgani, S., et al. 2022, A&A, 668, A188
  * Meneghetti et al. (2010) Meneghetti, M., Rasia, E., Merten, J., et al. 2010, A&A, 514, A93
  * Metcalf et al. (2019) Metcalf, R. B., Meneghetti, M., Avestruz, C., et al. 2019, A&A, 625, A119
  * Metcalf & Petkova (2014) Metcalf, R. B. & Petkova, M. 2014, MNRAS, 445, 1942
  * Metcalfe et al. (2001) Metcalfe, N., Shanks, T., Campos, A., McCracken, H. J., & Fong, R. 2001, MNRAS, 323, 795
  * Millon et al. (2020) Millon, M., Galan, A., Courbin, F., et al. 2020, A&A, 639, A101
  * Mirza & Osindero (2014) Mirza, M. & Osindero, S. 2014, arXiv e-prints, arXiv:1411.1784
  * More et al. (2012) More, A., Cabanac, R., More, S., et al. 2012, ApJ, 749, 38
  * Moresco et al. (2022) Moresco, M., Amati, L., Amendola, L., et al. 2022, Living Reviews in Relativity, 25, 6
  * Pawase et al. (2014) Pawase, R. S., Courbin, F., Faure, C., Kokotanekova, R., & Meylan, G. 2014, MNRAS, 439, 3392
  * Pedregosa et al. (2011) Pedregosa, F., Varoquaux, G., Gramfort, A., et al. 2011, J. Mach. Learn. Res., 12, 2825
  * Petkova et al. (2014) Petkova, M., Metcalf, R. B., & Giocoli, C. 2014, MNRAS, 445, 1954
  * Petrillo et al. (2017) Petrillo, C. E., Tortora, C., Chatterjee, S., et al. 2017, MNRAS, 472, 1129
  * Petrillo et al. (2019) Petrillo, C. E., Tortora, C., Vernardos, G., et al. 2019, MNRAS, 484, 3879
  * Postman et al. (2012) Postman, M., Coe, D., Benítez, N., et al. 2012, ApJS, 199, 25
  * Prechelt (1997) Prechelt, L. 1997, in Neural Networks: Tricks of the Trade, volume 1524 of LNCS, chapter 2 (Springer-Verlag), 55–69
  * Raskutti et al. (2011) Raskutti, G., Wainwright, M. J., & Yu, B. 2011, in 2011 49th Annual Allerton Conference on Communication, Control, and Computing (Allerton), 1318–1325
  * Ren et al. (2015) Ren, S., He, K., Girshick, R., & Sun, J. 2015, arXiv e-prints, arXiv:1506.01497
  * Richard et al. (2011) Richard, J., Kneib, J.-P., Ebeling, H., et al. 2011, MNRAS, 414, L31
  * Rosati et al. (2014) Rosati, P., Balestra, I., Grillo, C., et al. 2014, The Messenger, 158, 48
  * Rousseeuw & Driessen (2006) Rousseeuw, P. J. & Driessen, K. 2006, Data Min. Knowl. Discov., 12, 29–45
  * Schmidt et al. (2014) Schmidt, K. B., Treu, T., Brammer, G. B., et al. 2014, ApJ, 782, L36
  * Schneider (2006) Schneider, P. 2006, Extragalactic Astronomy and Cosmology (Springer Berlin Heidelberg)
  * Scoville et al. (2007) Scoville, N., Aussel, H., Brusa, M., et al. 2007, ApJS, 172, 1
  * Sérsic (1963) Sérsic, J. L. 1963, Boletin de la Asociacion Argentina de Astronomia La Plata Argentina, 6, 41
  * Sérsic (1968) Sérsic, J. L. 1968, Atlas de Galaxias Australes (Cordoba, Argentina: Observatorio Astronomico)
  * Shibuya et al. (2015) Shibuya, T., Ouchi, M., & Harikane, Y. 2015, ApJS, 219, 15
  * Simonyan & Zisserman (2014) Simonyan, K. & Zisserman, A. 2014, arXiv e-prints, arXiv:1409.1556
  * Smith et al. (2005) Smith, G. P., Kneib, J.-P., Smail, I., et al. 2005, MNRAS, 359, 417
  * Sonnenfeld et al. (2018) Sonnenfeld, A., Chan, J. H. H., Shu, Y., et al. 2018, PASJ, 70, S29
  * Sonnenfeld et al. (2013) Sonnenfeld, A., Treu, T., Gavazzi, R., et al. 2013, ApJ, 777, 98
  * Sonnenfeld et al. (2015) Sonnenfeld, A., Treu, T., Marshall, P. J., et al. 2015, ApJ, 800, 94
  * Sonnenfeld et al. (2020) Sonnenfeld, A., Verma, A., More, A., et al. 2020, A&A, 642, A148
  * Spiniello et al. (2018) Spiniello, C., Agnello, A., Napolitano, N. R., et al. 2018, MNRAS, 480, 1163
  * Stehman (1997) Stehman, S. V. 1997, Remote Sensing of Environment, 62, 77
  * Suyu et al. (2017) Suyu, S. H., Bonvin, V., Courbin, F., et al. 2017, MNRAS, 468, 2590
  * Suyu et al. (2020) Suyu, S. H., Huber, S., Cañameras, R., et al. 2020, A&A, 644, A162
  * Swinbank et al. (2009) Swinbank, A. M., Webb, T. M., Richard, J., et al. 2009, MNRAS, 400, 1121
  * Sygnet et al. (2010) Sygnet, J. F., Tu, H., Fort, B., & Gavazzi, R. 2010, A&A, 517, A25
  * Szegedy et al. (2014) Szegedy, C., Liu, W., Jia, Y., et al. 2014, arXiv e-prints, arXiv:1409.4842
  * Szegedy et al. (2013) Szegedy, C., Zaremba, W., Sutskever, I., et al. 2013, arXiv e-prints, arXiv:1312.6199
  * Taylor (2005) Taylor, M. B. 2005, in Astronomical Society of the Pacific Conference Series, Vol. 347, Astronomical Data Analysis Software and Systems XIV, ed. P. Shopbell, M. Britton, & R. Ebert, 29
  * Tortora et al. (2010) Tortora, C., Napolitano, N. R., Romanowsky, A. J., & Jetzer, P. 2010, ApJ, 721, L1
  * Tortorelli & Mercurio (2023) Tortorelli, L. & Mercurio, A. 2023, arXiv e-prints, arXiv:2302.07890
  * Tortorelli et al. (2023) Tortorelli, L., Mercurio, A., Granata, G., et al. 2023, arXiv e-prints, arXiv:2302.07896
  * Tortorelli et al. (2018) Tortorelli, L., Mercurio, A., Paolillo, M., et al. 2018, MNRAS, 477, 648
  * Treu & Koopmans (2002) Treu, T. & Koopmans, L. V. E. 2002, ApJ, 575, 87
  * Treu et al. (2022) Treu, T., Roberts-Borsani, G., Bradac, M., et al. 2022, ApJ, 935, 110
  * Treu et al. (2015) Treu, T., Schmidt, K. B., Brammer, G. B., et al. 2015, ApJ, 812, 114
  * Umetsu et al. (2018) Umetsu, K., Sereno, M., Tam, S.-I., et al. 2018, ApJ, 860, 104
  * Vaccari et al. (2016) Vaccari, M., Covone, G., Radovich, M., et al. 2016, in The 4th Annual Conference on High Energy Astrophysics in Southern Africa (HEASA 2016), 26
  * Vanzella et al. (2021) Vanzella, E., Caminha, G. B., Rosati, P., et al. 2021, A&A, 646, A57
  * Vanzella et al. (2017) Vanzella, E., Castellano, M., Meneghetti, M., et al. 2017, ApJ, 842, 47
  * Vanzella et al. (2020) Vanzella, E., Meneghetti, M., Caminha, G. B., et al. 2020, MNRAS, 494, L81
  * Williams et al. (1996) Williams, R. E., Blacker, B., Dickinson, M., et al. 1996, AJ, 112, 1335
  * Xie et al. (2016) Xie, S., Girshick, R., Dollár, P., Tu, Z., & He, K. 2016, arXiv e-prints, arXiv:1611.05431
  * Zeiler (2012) Zeiler, M. D. 2012, arXiv e-prints, arXiv:1212.5701
  * Zhao et al. (2020) Zhao, L., Liu, T., Peng, X., & Metaxas, D. 2020, arXiv e-prints, arXiv:2010.08001

##  Appendix A Complementary tables and figures

In this appendix, we include additional tables and figures related to the CNN
performance evaluation. Tab. 4 shows a comparison between the VGG and the SC-
VGG in terms of statistical estimators, by also excluding the adversarial
examples from the metric computation (quoted with an asterisk). The analysis
of performance fluctuations (for both VGG and SC-VGG) evaluated over the $10$
folds is summarised in Tab. 5. Tab. 6 shows a comparison of the results
achieved by the networks trained with the three ACS bands (the adopted method)
with performances obtained using a single band. A summary of the false
positive and false negative distributions is outlined in Tab. 7 and Tab. 8,
respectively. Fig. 13 shows the false positive rates and false negative rates
as 2D histograms. Tab. 9 illustrates the run performed by both VGG and SC-VGG
by processing a set of known GGSLs in a sample of galaxy clusters observed
with HST.

Table 4: Performance comparison between the two CNN architectures.

| [%] | VGG | VGG* | SC-VGG | SC-VGG*
---|---|---|---|---|---
| AE | 87.7 | 89.6 | 89.4 | 89.5
GGSL | pur | 93.4 | 87.5 | 93.1 | 86.7
compl | 88.6 | 93.4 | 91.7 | 94.5
F1 | 91.0 | 90.4 | 92.4 | 90.4
NGGSL | pur | 76.7 | 92.3 | 81.4 | 93.3
compl | 85.4 | 85.4 | 84.1 | 84.1
F1 | 81.1 | 88.7 | 82.8 | 88.5
555Network pperformances are reevaluated by removing faint sources and small-
scale lenses ($F814W>28$ mag and $\theta_{E}<0.5\arcsec$) are marked by an
asterisk.

Table 5: Fluctuations of the performances for the VGG and SC-VGG models.

|  | median | $Q_{1}$ | $Q_{3}$
---|---|---|---|---
| [%] | VGG | SC-VGG | VGG | SC-VGG | VGG | SC-VGG
| AE | 88.3 | 89.3 | 86.2 | 88.6 | 88.6 | 90.3
GGSL | pur | 93.3 | 93.3 | 92.5 | 92.3 | 94.8 | 94.2
compl | 89.1 | 91.9 | 86.7 | 91.2 | 90.4 | 92.5
F1 | 91.5 | 92.3 | 89.8 | 91.8 | 91.5 | 93.0
NGGSL | pur | 77.6 | 81.9 | 74.0 | 79.7 | 79.0 | 82.9
compl | 85.6 | 84.2 | 82.3 | 81.7 | 88.1 | 87.2
F1 | 91.5 | 92.3 | 89.8 | 91.8 | 91.5 | 93.0
|  | $IQR$ | $Q_{1}-1.5\cdot IQR$ | $Q_{3}+1.5\cdot IQR$
| [%] | VGG | SC-VGG | VGG | SC-VGG | VGG | SC-VGG
| AE | 2.4 | 1.7 | 85.3 | 87.8 | 89.7 | 91.4
GGSL | pur | 2.3 | 1.9 | 90.7 | 90.1 | 95.6 | 95.7
compl | 3.7 | 1.4 | 84.1 | 90.4 | 92.5 | 94.1
F1 | 1.8 | 1.2 | 88.8 | 91.0 | 92.6 | 93.9
NGGSL | pur | 5.0 | 3.2 | 70.5 | 76.1 | 81.8 | 85.6
compl | 5.8 | 5.4 | 79.7 | 77.6 | 90.7 | 90.7
F1 | 1.8 | 1.2 | 88.8 | 91.0 | 92.6 | 93.9

666$Q_{1}$ and $Q_{3}$ are the 25th and 75th percentiles. The inter-quartile
range $IQR=Q_{3}-Q_{1}$; the range $(Q_{1}-1.5\cdot IQR,\,Q_{3}+1.5\cdot IQR)$
encloses the metric fluctuation within $\pm 2.698\sigma$. The best results are
highlighted in bold. Average efficiency and GGSL estimators are graphically
shown in the bottom panels of Fig. 6.

Table 6: Network performances trained with 3 HST/ACS bands (VGG, SC-VGG) compared with single band training.  | [%] | VGG | SC-VGG | $F435W$ | $F606W$ | $F814W$
---|---|---|---|---|---|---
| AE | 87.7 | 89.4 | 87.2 | 86.1 | 86.8
GGSL | pur | 93.4 | 93.1 | 91.8 | 91.1 | 91.5
compl | 88.6 | 91.7 | 89.8 | 88.8 | 89.3
F1 | 91.0 | 92.4 | 90.8 | 89.9 | 90.4
NGGSL | pur | 76.7 | 81.4 | 77.5 | 75.4 | 76.6
compl | 85.4 | 84.1 | 81.3 | 79.9 | 80.9
F1 | 81.1 | 82.8 | 79.3 | 77.6 | 78.7
Table 7: Summary of false positive distributions for the VGG and SC-VGG
networks.

|  | VGG | SC-VGG
---|---|---|---
| NGGSL | FP | FP/TN | FP | FP/TN
Total Number | 1037 | 154 | 0.174 | 170 | 0.196
$F814W<19.5$ | 9.6% | 16.8% | 0.263 | 15.3% | 0.356
$F814W\geq 19.5$ | 90.4% | 83.2% | 0.158 | 84.7% | 0.181
colour $<-0.5$ | 3.9% | 6.5% | 0.333 | 7.6% | 0.481
colour $\geq-0.5$ | 96.1% | 93.5% | 0.169 | 92.3% | 0.187

777Fractions of NGGSL (Col. 2), FP (Col. 3 and Col. 5) and FN to TN ratio
(Col. 4 and Col. 6) as a function of source magnitude (second and third row)
and galaxy normalized colour (i.e. $(F606W-F814W)_{\text{norm}}$, fourth and
fifth row). The total number of spectroscopic NGGLSs and FPs are quoted in the
first row.

Table 8: Summary of the false negative distributions, split between VGG and
SC-VGG network.

|  | VGG | SC-VGG
---|---|---|---
| GGSL | FN | FN/TP | FN | FN/TP
Total Number | 2704 | 307 | 0.128 | 224 | 0.090
$F814W\geq 28.0$ | 31.1% | 52.1% | 0.235 | 38.8% | 0.115
$F814W\geq 27.0$ | 61.0% | 83.1% | 0.183 | 73.2% | 0.110
$F814W<27.0$ | 39.0% | 17.9% | 0.052 | 26.8% | 0.060
$\theta_{E}<0.5\arcsec$ | 32.2% | 41.4% | 0.171 | 46.9% | 0.137
$\theta_{E}\geq 0.5\arcsec$ | 67.8% | 58.6% | 0.109 | 53.1% | 0.069
$z_{src}\geq 5$ | 5.9% | 11.4% | 0.282 | 4.9% | 0.074
$z_{src}\geq 4$ | 12.9% | 20.8% | 0.225 | 10.7% | 0.074
$z_{src}\geq 3$ | 25.5% | 31.9% | 0.166 | 20.1% | 0.070
$z_{src}<3$ | 74.5% | 68.1% | 0.116 | 70.9% | 0.098

888Fractions of GGSL (Col. 2), FN (Col. 3 and Col. 5) and FN to TP ratio (Col.
4 and Col. 6) as a function of source magnitude (second to fourth row), lens
galaxy $\theta_{E}$ (fifth and sixth row) and source redshift (seventh to
eighth row). The total number of GGLSs and FNs are quoted in the first row.

Figure 13: False positive and false negative ratio represented as a 2D
histogram. Top panels: FP ratios on a galaxy colour-magnitude diagram (i.e.
$(F606W-F814W)_{\text{norm}}$ vs $F814W$). Middle panels: FN ratios on a lens
$\theta_{E}$ vs source $F814W$ magnitude diagram. Bottom panels: FN ratios on
a source $r_{e}$ vs source redshift diagram. The VGG and the SC-VGG results
are shown on the left and right panels, respectively. The regions of the
parameter space with zero true negative or zero true positive values are left
white. Table 9: Catalogue of known GGSLs processed by both the VGG and SC-VGG
networks

Cluster | RA | DEC | Image | VGG | SC-VGG | ref |
---|---|---|---|---|---|---|---
A209 | 22.95776 | -13.60326 | A1 | TP | TP | (1) | secure
A209 | 22.96488 | -13.63631 | A2 | TP | TP | (1) | secure
A383 | 42.01136 | -3.54803 | B1 | TN | TN | (1) | no
M0329 | 52.42013 | -2.22163 | C1 | TP | TP | (1) | secure, $z=1.112$
M1149 | 177.40389 | 22.42663 | D1 | TP | FN | (2) | secure, $z=1.806$
M1149 | 177.39314 | 22.41134 | D2 | TP | qTP | (2) | secure
M0416 | 64.03408 | -24.06675 | E1 | FN | FN | (3) | secure, $z=3.222$
M0416 | 64.02847 | -24.08567 | E2 | qTP | FN | (1,5) | secure, $z=2.218$
M0416 | 64.01709 | -24.08955 | E3 | TP | TP | (4) | secure
M0416 | 64.03262 | -24.06838 | E4 | TP | TP | (5) | secure, $z=2.095$
M0416 | 64.03250 | -24.07849 | E5 | TP | FN | (5) | secure, $z=2.542$
M0416 | 64.02442 | -24.08106 | E6 | TP | TP | (5) | secure, $z=1.964$
M1115 | 168.95626 | 1.49741 | F1 | TP | TP | (1) | secure
R2248 | 342.15574 | -44.54591 | G1 | qTP | TP | (1) | secure, $z=0.9406$
R2248 | 342.16336 | -44.52972 | G2 | FN | qTP | (1) | secure
R2248 | 342.18205 | -44.54035 | G3 | TP | TP | (6) | secure, $z=1.837$
R2248 | 342.17554 | -44.53558 | G4 | FN | TP | (6) | uncertain
R1347 | 206.89603 | -11.75360 | H1 | FN | TP | (1) | uncertain
R2129 | 22.42878 | 0.10807 | I1 | TP | TP | (1) | secure
M0429 | 67.40208 | -2.87139 | J1 | TP | TP | (1) | secure
M0429 | 67.38925 | -2.87412 | J2 | TP | FN | (1) | uncertain
M0744 | 116.21217 | 39.45987 | K1 | TP | TP | (1) | secure
M1206 | 181.56667 | -08.80478 | L1 | TP | TP | (7) | secure, $z=3.752$
M1206 | 181.55309 | -08.79486 | L2 | TP | TP | (7) | secure, $z=1.425$
|  |  | N${}_{\text{TP}}$ | 16 | 14 |  |
|  | TOTAL | N${}_{\text{qTP}}$ | 2 | 2 |  |
|  |  | N${}_{\text{FN}}$ | 2 | 4 |  |
999Based on GGSL probability computed by the two CNN models, systems are
classified as: true positive (TP, $Pr>0.5$), quasi-true Positive (qTP,
$0.2\leq Pr<0.5$), false negative (FN, $Pr<0.2$). The last column refers to
the classification as GGSL: “secure” for bonafide galaxy-scale systems (with
the source redshift when available), “uncertain” for those which need
verification and “no” for non-GGSL systems. See Sec. 5 for details. The total
number of TPs, qTPs and FNs, shown at the bottom of the table, are computed by
considering only the secure systems.

(1) Desprez et al. (2018); (2) Smith et al. (2005); (3) Vanzella et al.
(2017); (4) Diego et al. (2015); (5) Bergamini et al. (2021b); (6) Caminha et
al. (2016); (7) Bergamini et al. (2019).