# IEC-61850 performance evaluation in a 5G Cellular Network: UDP and TCP
Analysis

Iurii Demidov  Department of Electrical Engineering
School of Energy Systems
LUT University
<EMAIL_ADDRESS>Dick Carrillo Melgarejo  Department of Electrical
Engineering
School of Energy Systems
LUT University
<EMAIL_ADDRESS>Antti Pinomaa  Department of Electrical
Engineering
School of Energy Systems
LUT University
<EMAIL_ADDRESS>Author4  Department of Electrical Engineering
School of Energy Systems
LUT University
e-mail Author5  Department of Electrical Engineering
School of Energy Systems
LUT University
e-mail

###### Abstract

This chapter summarizes the results obtained during a test bed, which is
composed by a microgrid and a wireless network, both following real and
practical premises. This test bed aims to evaluate application protocols
considered in the transport layer of the standard IEC-61850.

The application is a data gathering system, where IEC-61850 messages are
transmitted from and between different elements in the microgrid system, such
as IED, publishers, and subscribers, which are node elements that are part of
the utility grid.

The standard IEC-61850 defines many protocols, such as SV, GOOSE, and MMS,
each of them with a variety of requirements and sharing similar transport
communication protocols such as TCP and UDP. So, a testing framework is used
during the test bed in order to evaluate the performance of these protocols
that aim to enable the communication in a real microgrid deployment.

The IEC-61850 messages transported by TCP or UDP are transmitted to a
centralized location, where a local database stores the information under
different test scenarios and using different transmission sample times.

The overall results are promising and indicate that the protocols based on TCP
in combination with 5G cellular network architecture would be suitable for
most applications within the studied microgrid case. In the case of UDP the
performance indicated some specific constraints related to the multiple access
nature of simultaneous transmissions and also based on the SINR .

##  1 Introduction

The impact of cellular networks on society has been defined by the evolution
of wireless communication technologies, which are being applied during many
generations. Most of these development were focused in human applications.
However, nowadays the cellular networks aim to support many industrial or
vertical applications, such as in energy systems, grid automation, mining
industry, and process automation industry.

###  1.1 The Evolution on Power System Industry

Traditional power grids with unidirectional power flow are being transformed
to bi-directional flow, which is related to the increased number of
distributed generation and energy storage units connected to grid. In other
words the traditional end consumers is being displaced by prosumers, which are
the users that consume and generate energy. These new elements have brought up
attractive and interesting use case scenarios on microgrid systems. For
instance, some electricity distribution networks parts, that are connected to
grids, are able to run in islanded 111A microgrid is said to be in islanded
mode when it is disconnected from the main grid and it operates independently
with micro sources and load. mode. In other cases, RES (RES) in power grids,
such as weather dependent wind and solar power generation, as well as the
energy storage distributed to power systems increase the need of having more
monitoring, control, and protection applications that support the requirements
of grid automation. Accordingly, these grid application set more strict
requirements to the communication networks enabling data exchange between
different nodes in the grid and between the grid and the remote systems of
DSO.

Nowadays, these applications are run on wired networks such as power line
communication and fiber Optic, which are mostly based on Ethernet protocol.
For instance, fiber optic networks are used in the automation of substations
and also to connect two different substations, in which the communication
network is used as a backhaul between networks, for example the connectivity
between two remote monitoring rooms of two different DSO.

###  1.2 The Evolution on Cellular Network Industry

Likewise the power grid evolution, in the last decade, the 4G (4G)
revolutionized the cellular network industry because it was the first system
supporting an end-to-end packet-switched network; for instance, voice calls
can be done using a full IP (IP) network. The improvements of a variety of
features in the protocol stack enabled connectivity between devices and
applications on a diversity of industrial applications. However, most of the
critical applications are still being supported by wired solutions. In
contrast to the counter part, wireless connectivity offers scalability,
flexibility, and cost efficiency because it reduces the need of expensive
wires and installation costs.

Today, wired networks are popular because the microgrid and energy system
domains have set specialized requirements for communications, such as latency,
reliability, availability, and throughput. For example, failures or anomalies
in data delivery can cause severe damages in the control and automation used
on microgrids.

###  1.3 State of the Art

In the state of the art, there are many research works and case studies, which
aim to address the performance evaluation of specialized protocols, such as
IEC-61850 over a private LTE networks described in [eriksson2017performance].
Here, a prototype emulates an IED (IED), which was derived from an
IEC-61850-90-5 open source project. In this work, different metrics, such as
reliability, availability, latency, and throughput were evaluated. Based on a
simulation analysis, the authors in [mms_lte_karaginannis] investigated
whether LTE (LTE) can be used in combination with IEC-61850 and MMS (MMS) to
support smart metering and remote control communication. In
[musaddiq2014performance] a substation automation system was modeled and
simulated under a wireless and hybrid networks for three type of messages,
GOOSE (GOOSE), SV (SV), and interbay trip messages. The authors conclude that
when circuit breakers were connected wireless, trip messages had high delays.
Many other works aim to address similar performance evaluations
[kheaksong2016performance] and [parikh2010opportunities]. However, most of
them only address ideal scenarios using simulations.

In contrast of the current state of the art, the results reported in this
manuscript considered fully realistic scenarios, which is represented by real
microgrid rural users and a practical deployment of a private cellular network
that is based on a 5G (5G) architecture that considers the application of edge
computing to reduce the backhaul latency. It also considers a truly radio
propagation with a diversity of wireless networking impairments. This
condition, makes the output of this work unique.

##  2 Test Bed Description

###  2.1 Wireless Communication

The connectivity used on the field test bed, was based on a 5G architecture,
which is mostly characterized by the utilization of an edge computing
implementation of the core network to avoid latency impairments between the
RAN (RAN) and the core network, which is managed remotely through the cloud.
The RAN is based on an LTE Advanced, which is operating in band 40 with a
bandwidth of 20 MHz.

The architecture of the wireless cellular network was based on an end-to-end
private wireless network with edge computing platform. It aims to support
real-time applications for industrial applications. Compared with a
traditional 4G cellular network, the architecture of the network deployed in
the field considers a edge server, where the main core network server elements
are deployed. This edge computing core network is capable to be configured
remotely from anywhere by Internet. However, as it is the edge, the latency
constraints in the core network are avoided. So, only the wireless access
network represents the most important source of degradation when the latency
is the KPI (KPI).

The CPE are complaint with the downlink category 15 and uplink category 13 of
the 3GPP (3GPP) specifications. So, the radio support downlink carrier
aggregation with 256 QAM and 2x2 MIMO (MIMO) technology, and the uplink single
carrier with 64 QAM 2x2 MIMO. Each CPE has a fixed beam antenna with up to
12.5 dBi gain and a power transmission of 23 dBm. The base station operates
with a power transmission of 35 dBm with a omnidirectional antenna with a gain
of 4 dBi.

###  2.2 LVDC micro-grid pilot

the LVDC (LVDC) micro-grid field pilot is a part of the local distribution
network owned by a Finnish energy corporation Suur-Savon Sähkö Ltd. (SSS Ltd.)
and operated by its subsidiary distribution company Järvi-Suomen Energia Ltd.
The platform has been realised in collaboration with Lappeenranta University
of Technology (LUT) as a part of the Finnish national Smart Grids and Energy
Markets research program.
The system is designed to meet flexible testing needs and has exhaustive
distribution system functionality. The pilot is implemented according to the
the national low voltage standard series SFS 6000 based on HD 60364, IEC
60364, IEC 60664. Based on the EN 50160 standard, the voltage quality
requirements were set, but some limit values were changed [6683522].

####  2.2.1 Architecture

The LVDC pilot has a structure which follows the concept of LVDC distribution
system. Figure 1 presents the grid configuration of the pilot. The setup
consists of a 70 kVA rectifying substation, supplied with a double-tier
transformer from 20 kV MV network, BESS (BESS), comprising 2 x 30 kWh nominal
capacity sections, 2 x 35 kVA converters and 100 kVA transformer, a 1.7 km
long underground cabled bipolar ±750 V DC network, three 16 kVA CEI (CEI)s
and, PV (PV) array, which is currently out of operation. Two CEIs are
connected to the plus pole of the ±750 V DC network and one is connected to
the negative. The CEIs supply four end-consumer with three-phase 230/400 V AC
voltage. The third CEI supplies two end-users as their consumption is lower
than the inverter’s nominal power. CEIs have a three-phase structure with
galvanic isolation that allows using of terrain-isolated functionalities
unearth (IT) grounding in the DC distribution grid with the functionality of
earthed (TN) grounding of the end-consumer, which is typically used in Finland
[6777363].
The system is normally operated in grid connection mode. However in case of MV
supply interruption, it is switched into island operation mode, when CEIs are
supplied from BESS. The voltage variation in the DC grid is supported within
+10% -20% during normal operation and -30% while isolated operation mode. End-
consumers has a 50±0.2% of frequency variation, and ±1% while normal operation
and ±15% while island mode operation voltage variations [6302501].

Figure 1: Grid configuration

####  2.2.2 Application

Figure 2 illustrates the network structure with a wired FO (FO) communication
network, installed alongside LVDC underground cables. FO is a single-mode
multicore fiber with 16 cores. CEIs are connected with a rectifier with a core
per connection. The information and communication system of the pilot is
realized with a Linux-based IPC (IPC) and has a client-server architecture.
Each CEI has an IPC, the model is Matrix 522, which is connected with a
measurement card and applies monitoring, control, data logging, and web-client
functions. The solar plant is equipped with another model of IPC (Matrix504),
which brings similar to CEIs’ devices functionality. The BESS control and
monitoring, server, and database are realized on a IPCs placed at the
rectifier sub-station [7152001]. The server has the following functionalities:
gathering the data from all client applications, the gateway of remote
connection, updates of web portal, data logging, control of CEIs, and data
transferring to the remote database. The collected data is also stored at the
local database, located at the SSD connected to the database IPC.

Figure 2: Wired network structure

Figure 3 presents architecture of ICT (ICT) system of the pilot, showing
monitoring and control solutions. Web-portal provides remote control and
uninterrupted monitoring of the system. All supervised data is presented on
the portal and logged and stored locally. The web-portal allows to monitor the
following operation monitoring functions [7152001]:

  * •

Statuses of the network and its components

  * •

Power flow monitoring - the data consists of minimum, maximum and average
power, voltage and current values with one minute resolution.

  * •

Power quality monitoring - includes harmonic content, defined by fast-Fourier
transform (FFT) and power quality indices. The measurement intervals is 16 and
18 seconds for the CEIs and rectifier respectively.

  * •

System supervision portal - allows to access to the pilot without installation
additional software. The update rate of the web-portal is 10 s.

  * •

Fault identification - records the fault code and corresponding measurements
window of current and voltages with timestamps, and notify support personal.
The measurements of currents and voltages are applied at the rectifier sub-
station.

  * •

Network rectifier station - controls and monitors over network front-end
rectifier, which is required for ensuring for the reliable network operation.

  * •

BESS monitoring and control - applies full control of the BESS and condition
monitoring. It allows automatic transfer form island mode and normal
operation.

  * •

CEI control diagnostic - is designed to meet requirements of public network,
actual end-users and research purposes.

Figure 3: ICT architecture

###  2.3 Test Bed Objectives

The main objective of this test bed is to benchmark and evaluate the
performance of a private cellular network on a fully real scenario located in
a rural area of Suomeniemi (South Finland), where a microgrid pilot provides
power supply to local citizens. The objectives of the this study are:

  * •

evaluate the system performance of a cellular network that is based on a 5G
architecture using edge core network to reduce potential impairments on the
backhaul between the radio and core network.

  * •

evaluate the throughput between IED and an edge cloud device. Each IED is
connected to the cellular network CPE and the edge cloud device is connected
to the PDN (PDN)-gateway in the LTE-CPE (core network).

  * •

evaluated the system performance in terms of throughput and latency in
different scenarios, such as data rate, simultaneous traces for TCP (TCP) and
UDP (UDP) packages.

  * •

evaluate the performance of the standard IEC-61850 based the premise that the
protocols, such as MMS, GOOSE, and SV are enabled by TCP and UDP on a wireless
network.

  * •

generate a radio coverage mapping based on measurements obtained in the field
and a temporal analysis of typical LTE metrics, such as RSSI (RSSI), RSRP
(RSRP), RSRP, and SINR (SINR) in each point where the LTE CPE are installed.

##  3 IEC61850

The preparation of IEC 61850 began in 1995 in the United States. Initially, it
was conducted by two independent, parallel working groups: the first one is
UCA International users, developing a common object model of substation
equipment (GOMFSE); the second was formed within the framework of the IEC
Technical Committee 57 and was engaged into the creation of a standard of data
transmission protocols at a substation. In 1997, the work of both groups was
combined under the auspices of Working Group 10 of IEC TC 57 and became the
basis of the IEC 61850 standard.
The standard is based on the following statements:

  * •

technological independence, i.e. regardless of technological progress, the
standard should be subject to minimal changes over time

  * •

flexibility, i.e. it should allow for different tasks to be solved using the
same standardized mechanisms

  * •

extensibility i.e meeting the requirements, the standard allows you to meet
the changing needs of the electric power industry and use the latest advances
in computer, communication, and measurement technologies

The main features of the IEC61850:

  * •

It defines not only how, but also what information should be exchanged. The
standard describes abstract models of the object’s hardware and the functions
performed. The information model underlying the standard is presented in the
form of classes of data objects, data attributes, abstract services, and
descriptions of the relationships between them

  * •

It defines the system design and setup process

  * •

It defines the System Configuration description Language (SCL). This language
provides the ability to exchange information about the configuration of
devices in a standardized format between software from different manufacturers

  * •

It describes the methods of testing and acceptance of equipment

The key aspect of IEC-61850 defined before is the definition of a three-level
automation system architecture, which includes: the process level, the bay
level, and the station level. The process level includes sensors, remote I/Os,
and actuators. The bay level consists of control, protection, and monitoring
Intelligent Electronic Devices (IED). Station level comprises station computer
with databases, operators user interfaces (UI), and remote communication. The
standard has an object-oriented approach that allows establishing logical
communication among IED, merging unit (MU), and system operator.
Initially, the standard defined only an automation system within a single
object, and the links between substations were not included in the model. In
2012 IEC61850 was expanded with parts 90-1, 90-5. The updated model presented
the communication system architecture described in the second edition of the
standard, which also provides for connections between substations. The
structure of information exchange is described between the levels, as well as
within each of them. These parts allow to an expansion of the communication
standardization beyond substation limits and made it possible to apply the
standard to the smart grids also.
IEC61850 defines three key communication protocols to implement data exchange
within and between defined levels:

  * •

MMS (Manufacturing Message Specification) – is a client-server TCP protocol
using for real time data exchange among network devices and computer
applications. It is described in the 8-1 part of IEC61850.

  * •

GOOSE (Generic Object Oriented Substation Events) – is a publisher-subscriber
UDP protocol which is applied for ultra-high messaging speed transmission of
grouped status or value data and ensuring enhanced reliability. It is also
described in the 8-1 part of IEC61850.

  * •

SV (Sampled Values) - is a publisher-subscriber UDP protocol, used for data
exchange between MU and IED with exactly defined time interval. It is
described in the 9-2 and 9-2LE parts of IEC61850.

###  3.1 MMS

Part 8-1 of IEC 61850 describes the MMS (Manufacturing Message Specification)
protocols used for data exchange, for which time delay is not critical. They
operate on the full OSI model on top of the TCP stack, which means that data
transmission over this protocol is carried out with relatively large time
delays. For example, this protocol can be used to send remote control
commands, collect telemeasurement and telesignalling data, and send reports
and logs from remote devices [Typhoon_mms]. The MMS defines:

  * •

a set of standard objects on which operations are performed that must be
present in the device (for example, reading and writing variables, signaling
events, etc.)

  * •

a set of standard messages that are exchanged between the client and the
server for control operations

  * •

a set of rules for encoding these messages (how values and parameters are
assigned to the corresponding bits and bytes when forwarding)

  * •

a set of protocols (rules for exchanging messages between devices)

Therefore, the MMS protocol itself is not a communication protocol, it only
defines the messages that should be transmitted over a specific network. As a
communication protocol, MMS uses the TCP/IP stack, so it belongs to the
transport layer of the OSI model.

###  3.2 GOOSE

Part 8-1 describes also the GOOSE protocol as a UDP publisher/subscriber type
communication. The information content of this protocol is defined in IEC
61850-7-2. There is a description of the protocol syntax, the definition of
the data assignment of an Ethernet frame in accordance with ISO/IEC 8802-3,
and the procedures related to the use of this frame. Due to the fact that the
data in this protocol is assigned directly to the Ethernet frame, bypassing
the TCP stack, data transmission in it is carried out with significantly lower
time delays, compared to MMS. This allows the GOOSE protocol to be used to
transmit commands to disconnect the circuit breaker from the protection and
other signals for which time delay is critical [Typhoon_goose]. Initially, the
data sets are grouped for their subsequent sending using the GOOSE protocols.
Then, in the GOOSE sending control unit, a reference to the created dataset is
specified, in this case, the publisher knows exactly what data to send. Within
the framework of a single GOOSE message, both one value (for example, the
overcurrent protection trigger signal) and several values can be sent
simultaneously (for example, the start and overcurrent protection trigger
signals, etc.). The subscriber can extract from the packet only the data that
it needs. The transmitted GOOSE message packet contains all the current values
of the data attributes entered in the dataset. If any of the attribute values
change, the device immediately initiates sending a new GOOSE message with the
updated data.

###  3.3 SV Messages

SV protocol, defined at IEC61850 9-2 is used to transmit measured values from
the process to the bay level with a predefined time interval within a power
facility [Typhoon_sv]. The data transmission is critical to the latency and
should have a high bandwidth. Time interval depends on measured signal
frequency and Samples Per Period (SPP). The part 9-2LE of IEC618950 defines
two possible SPP in 80 and 256 samples. Therefore, for example for frequency
50Hz time interval will be equal $1/(80\cdot 50)=250\mu s$. The maximal delay
for SV multi-cast data transmission is $<208.3msecs$ [CiscoSV]. Figure 4
illustrates the structure of a SV message. The APDU field contains the payload
of the SV messages. Every APDU (Application Protocol Data Unit) contains up to
8 ASDU (Application Specific Data Unit), where each ASDU has a unique SV
identification value and contains one three phase current and voltage
measurements.

Figure 4: Structure of SV message

SV is a UDP protocol which has publisher/subscriber structure. All messages
are published under a topic. Subscriber receives all SV messages from all
publishers, then filters and parses according to subscribed topic.

###  3.4 R-SV, R-GOOSE

SV and GOOSE protocols defined at the IEC61850 9-2 and 8-1 respectively. Both
operates in a publisher/subscriber mode over layer 2 in a generic network
protocol stack. As a consequence, the data transmission is limited to LAN.
There are two options to transmit GOOSE or SV messages over WAN (WAN)
[article]. The first one is tunneling messages over high speed network such as
SDH or SONNET. The second option is aplication of Routable-SV/GOOSE
(R-SV/R-GOOSE) defined at the extended version of protocols (IEC61850-90-5) by
adding network and transport layer. The first option is less preferable as it
leads to employment of a gateway and message exchange is done in point to
point manner. While R-SV messages can be multicasted in WANs. R-SV protocol
also includes Group Domain of Interpretation (GDOI) security mechanism for
protecting data transmission [8979307].

###  3.5 Summary of the Standard IEC-61850

IEC 61850 is an Ethernet-based international standard, which has become the
standard for communication at many energy facilities and substations. IEC
61850 standard is aimed to integrate all protection, control, measurement, and
monitoring functions to the energy facilities. The control monitoring and
protection functions are places at the IED, the measurement one is applied
with MU. Figure /refIEC 61850 is an Ethernet-based international standard,
which has become the standard for communication at many energy facilities and
substations. IEC 61850 standard is aimed to integrate all protection, control,
measurement, and monitoring functions to the energy facilities. The control
monitoring and protection functions are places at the IED, the measurement one
is applied with MU. Figure 5 illustrated the structure of the protocol
application. MMS is a TCP client/server-based protocol used for not time-
critical control signals. GOOSE is a UDP publisher/subscriber-based protocol
applied for the transmission of time-critical control and protection-related
data. SV is a UDP publisher/subscriber-based protocol utilized for instance
measurements data exchange with constant sampling frequency. The latency and
bandwidth are critical for SV data transmission. GOOSE and SV can be used only
within LAN. R-GOOSE and R-SV are extension versions of the protocols that
allow transmission of data over WAN. Therefore, IEC61850 can be used not only
within substations but also utilized for Smart grids. illustrated the
structure of the protocol application. MMS is a TCP client/server-based
protocol used for not time-critical control signals. GOOSE is a UDP
publisher/subscriber-based protocol applied for the transmission of time-
critical control and protection-related data. SV is a UDP
publisher/subscriber-based protocol utilized for instance measurements data
exchange with constant sampling frequency. The latency and bandwidth are
critical for SV data transmission. GOOSE and SV can be used only within LAN.
R-GOOSE and R-SV are extension versions of the protocols that allow
transmission of data over WAN. Therefore, IEC61850 can be used not only within
substations but also utilized for Smart grids [summary_picture].

Figure 5: Structure of the IEC61850 protocols application

##  4 Test Bed Setup and Tools

###  4.1 Deployment

The microgrid is running in Suomeniemi (South Finland), which is a small
community with a high forest density and some challenging elevations that
generates impairments in the radio propagation. In Fig. (6), it is possible to
visualize the elements of the network. In each microgrid element, one CPE is
installed.

Figure 6: Geographical location of microgrid elements. In each of these points
a CPE is installed

During the deployment a pre-analysis was considered based on a radio
propagation prediction of the network coverage. This radio coverage prediction
was done using a simplified link budget that depends of the power
transmission, antenna gain, and height location of antennas. The output of
this analysis is represented in Fig. 7. In the case of the base station, the
antennas were installed over 25 meters and the CPE where installed to an
average height of 3 m.

Figure 7: Radio propagation coverage with some specific SINR values in some
points obtained during the drive test. Red color indicates high SINR, green
medium SINR, and blue indicates cellular edge border (SINR$<$0 dB)

The test setup is composed by a base station, which is complaint with LTE-
Advanced specifications, an EPC (EPC), which is complaint with 5G
architectures using edge computing specifications, and five CPE, which are the
capilar access of the network. One computer, named PC0, is connected to the
core routing unit and each CPE is connected to one embedded system, as shown
in Fig. 8. To avoid routing issues on the network, the bridge mode was enabled
in each CPE.

Figure 8: generic architecture of the network used during the system
performance evaluation in the field.

The tool used to evaluate the throughput is IPERF [dugan2010iperf]. There are
many testing configuration setups that are evaluated using an automatic Python
script, which was used to manage the measurements to be done in the network.
The scripts used in this stage are public available in the following
repository: https://github.com/aikonbrasil/NetMeter.

####  4.1.1 Database description

Figure 9 illustrates the structure of the local database, where data gathered
from all applications is stored. The database is placed on the interconnection
of SSD and Raspberry Pi 4 and located at the rectifier station. It contains
eleven tables, where each table includes data related to the specific LVDC
grid application. The database is used in the testing as a source for the
forming of emulated data packages. As RS (RS), BESS and database is placed at
the same place, the data from corresponding tables are not used in testing as
IPC of these devices and database have a wired connection that is not replaced
with a wireless system. CEIs and Solar installations are under wireless
connection through CPE, therefore the data from the CEI and solar applications
can be used for testing. However, due to the PV array is out of operation at
the moment of testing and only a small part of the information is available
from that installation, only data from CEI related tables is used in testing.

Figure 9: Generic database structure of the LVDC system used in the field.

There are four groups of tables, related to the different equipment: CEI,
BESS, RS, and PV. The BESS group includes three tables: BESS_BMS, where data
from the battery management system is collected (total voltage, total current,
state of charge, etc.); BESS_BMS_CELLS, where data about cells are included
(cell id, cell voltage, cell temperature, etc.); and BESS_BMS_MC, which
contains information from the measurement card of BESS (BESS grid voltage,
BESS grid current, BESS power, etc.). Another group is rectifier related, and
includes 3 tables: RS_CONVERTER, where general data about the converter is
gathered (power, line current, DC voltage, etc.); RS_MC including information
from the measurement card of rectifier station (grid voltages and currents,
FFT and THD of currents, etc.); and INSULATION table that comprise alarm and
fault-related logs. As CEI tables are used in testing and PV related tables
can be used after returning PV into operation, more detailed description of
the attributes of the tables is presented in Tables 1-3.

Table 1: CEI tables description part 1 Table name |  Column name |  Description
---|---|---
ARM_LOG_CEI |  TIMESTAMP |  Time a the client side
ARM_LOG_CEI |  CEI_ID |  ID of the client (from what inverter data is sent)
ARM_LOG_CEI |  U_DC |  Input inverter voltage (before inverting), direct voltage
ARM_LOG_CEI |  I_DC |  Input inverter current (before inverting), direct current
ARM_LOG_CEI |  U_RMS_A, U_RMS_B, U_RMS_C |  Phase voltages on the inverter output side (3 phase inverter), alternate voltages (AC)
ARM_LOG_CEI |  I_RMS_A, I_RMS_B, I_RMS_C |  Phase currents on the inverter output side (3 phase inverter), currents voltages (AC)
ARM_LOG_CEI |  S_RMS_A, S_RMS_B, S_RMS_C |  Phase powers on the inverter output side (3 phase inverter), phase powers (AC)
ARM_LOG_CEI |  T_IGBT |  Temperature at the switchers (internal inverter sensor)
ARM_LOG_CEI |  T_AMBIENT |  Temperature in the cabinet
ARM_LOG_CEI |  STATUS_FLAGS |  Based on this status THD values are set to 0 or factual values.
ARM_LOG_CEI |  FAULT_FLAGS |  Flag shows is there any faults at the inverter side
Table 2: CEI tables description part 2 Table name |  Column name |  Description
---|---|---
CEI_ACI |  TIMESTAMP |  Time a the client side
CEI_ACI |  CEI_ID |  ID of the client (from what inverter data is sent)
CEI_ACI |  T_L1, T_L2, T_W1, T_W2 |  ACI box temperatures
CEI_ACI |  R1-R6 |  States of relays in the inverter ACI box
CEI_ACI |  Connected |  Connection state
PQ_LOG_CEI |  TIMESTAMP |  Time a the client side
PQ_LOG_CEI |  CEI_ID |  ID of the client (from what inverter data is sent)
The description of the other columns of PQ_LOG_CEI contains in their names:
Active_power_CEI, Apparent_power_CEI, Apparent_power_output_RMS_CEI,
Fundamental_Active_power_CEI, Fundamental_Apparent_power_CEI,
Fundamental_power_factor_CEI, Fundamental_reactive_power_CEI,
Harmonic_Active_power_CEI, Harmonic_Apparemt_power_CEI,
Harmonic_distortion_power_CEI, Harmonic_polution_CEI, NonActive_power_CEI,
NonFundamental_Apparemt_power_CEI, Power_factor_CEI, I_distortion_power_CEI,
V_distortion_power_CEI, Input_power_DC_FFT, Input_power_DC_RMS,
I_Fundamental_A, U_Fundamental_A, Active_power_A, Apparemt_power_A,
Apparemt_power_output_RMS_A, Fundamental_Active_power_A,
Fundamental_Apparemt_power_A, Fundamental_power_factor_A,
Fundamental_ective_power_A, Harmonic_Active_power_A,
Harmonic_Apparemt_power_A, Harmonic_distortion_power_A, Harmonic_polution_A,
NonActive_power_A, NonFundamental_Apparemt_power_A, Power_factor_A,
I_distortion_power_A, V_distortion_power_A, THDI_A, THDU_A, I_Fundamental_B,
U_Fundamental_B, Active_power_B, Apparemt_power_B,
Apparemt_power_output_RMS_B, Fundamental_Active_power_B,
Fundamental_Apparemt_power_B, Fundamental_power_factor_B,
Fundamental_reActive_power_B, Harmonic_Active_power_B,
Harmonic_Apparemt_power_B, Harmonic_distortion_power_B, Harmonic_polution_B,
NonActive_power_B, NonFundamental_Apparemt_power_B, Power_factor_B,
I_distortion_power_B, V_distortion_power_B, THDI_B, THDU_B, I_Fundamental_C,
U_Fundamental_C, Active_power_C, Apparemt_power_C,
Apparemt_power_output_RMS_C, Fundamental_Active_power_C,
Fundamental_Apparemt_power_C, Fundamental_power_factor_C,
Fundamental_reActive_power_C, Harmonic_Active_power_C,
Harmonic_Apparemt_power_C, Harmonic_distortion_power_C, Harmonic_polution_C,
NonActive_power_C, NonFundamental_Apparemt_power_C, Power_factor_C,
I_distortion_power_C, V_distortion_power_C, THDI_C, THDU_C
Table 3: PV tables description Table name | Column name |  Description
---|---|---
SOLAR_CABINET | TIMESTAMP |  Time a the client side
SOLAR_CABINET | CABINET_ID |  ID of solar plant (we have only 1 in the system)
SOLAR_CABINET | Heater, Fan |  States of heating or cooling operation device
SOLAR_CABINET | CB |  Current breaker state
SOLAR_CABINET | Tcabinet |  Temperature in the solar cabinet
SOLAR_CABINET | Connected |  Connection state
SOLAR_CONVERTER | TIMESTAMP |  Time a the client side
SOLAR_CONVERTER | CABINET_ID |  ID of solar plant (we have only 1 in the system)
SOLAR_CONVERTER | DCUPOWER |  Ensto DC/DC converter internal power reference
SOLAR_CONVERTER | ActualPowerReference |  Actual Power Reference of the Solar plant
SOLAR_CONVERTER | DC_Link_Current |  Current in the DC link between grid and solar
SOLAR_CONVERTER | DC_Link_Power |  power in the DC link between grid and solar
SOLAR_CONVERTER | DC_Link_Voltage |  voltage in the DC link between grid and solar
SOLAR_CONVERTER | DC_Out_Current |  solar output current
SOLAR_CONVERTER | DC_Out_Power |  solar output power
SOLAR_CONVERTER | DC_Out_Voltage |  solar output voltage
SOLAR_CONVERTER | Temp1 ,Temp2 |  temperatures in a converter
SOLAR_CONVERTER | SetpointPowerReference |  Set Power Reference for the Solar plant
SOLAR_CONVERTER | MSW |  Main Status Word
SOLAR_CONVERTER | Fan |  Cooling state
SOLAR_CONVERTER | Connected |  Connection state

##  5 Measurement Procedure and Results

Three different procedures were considered during the measurements. The first
one is based on a isolated and simultaneous analysis of the TCP and UDP
protocols between PC0 node and each of the embedded systems installed in each
CPE, this analysis is done in terms of throughput. The second procedure is
based on the analysis of the latency evaluated with the ICMP (ICMP) protocol.
Finally, the third procedure focused in the analysis of the application. So,
the database information was emulated in each embedded system, following the
sampling time that the data is generated in the real IED. This information is
transmitted via TCP and UDP to the embedded system that host the database. In
this particular procedure, the data integrity was evaluated in the received
side to obtain numerical values indicating potential package lost.

The results of each procedure are described in the following.

###  5.1 Throughput performance evaluation

In Figures (10), (11), (12), (13), (14); the isolated and simultaneously
analysis of the performance are described for both, uplink and downlink.

Figure 10: Performance evaluation done in the embedded system connected to the
CPE that was installed in the Rectifier. Figure 11: Performance evaluation
done in the embedded system connected to the CPE that was installed in the
Inverter 01. Figure 12: Performance evaluation done in the embedded system
connected to the CPE that was installed in the Inverter 02. Figure 13:
Performance evaluation done in the embedded system connected to the CPE that
was installed in the Solar Panel. Figure 14: Performance evaluation done in
the embedded system connected to the CPE that was installed in the Inverter
03.

###  5.2 ICMP performance evaluation

Here, the isolated and simultaneous analysis was done based on the ICMP
protocol that measure the round trip time transmission of the data between the
transmitter and receiver. As the previous case, an specialized script was used
to automate this measurement. The results for each of the five points are
described in Fig. (15), (16), (17), (18), and Fig. (19).

Figure 15: ICMP analysis between the embedded system connected to the CPE that
was installed in the Rectifier and the PC0 connected in the core network.
Figure 16: ICMP analysis between the embedded system connected to the CPE that
was installed in the Inverter 01 and the PC0 connected in the core network.
Figure 17: ICMP analysis between the embedded system connected to the CPE that
was installed in the Inverter 02 and the PC0 connected in the core network.
Figure 18: ICMP analysis between the embedded system connected to the CPE that
was installed in the Solar Panel and the PC0 connected in the core network.
Figure 19: ICMP analysis between the embedded system connected to the CPE that
was installed in the Inverter 03 and the PC0 connected in the core network.

###  5.3 Performance Evaluation of the Application

As described before, the application is based on the telemetry transmission of
data gathered in each IED installed in each microgrid element. These devices
transmit over TCP and UDP 222TCP and UDP are the transport layer elements used
by the standard IEC-61850 relevant information using different sample times
between 1 sample per second and 1 sample every 65 seconds. The generic
architecture of this setup is show in Fig. (20), and the messages transmitted
to the database are described in Fig. (21)

Figure 20: High level architecture of the setup used to evaluate the
application performance. Each Inverter transmits three different messages.
Figure 21: Description of the messages transmitted from each IED following the
database structure.

The application transmission sequence were emulated with a TCP client-server
application. These script enable us to configure customized sample times for
each scenario. A similar script was used to evaluate UDP. The Scripts are
described in Fig. (22)

Figure 22: Description of the messages transmitted from each IED following the
database structure.

In this specific analysis, there are different performance outputs. The first
one is related to a simultaneous analysis of the message transmission from
each Inverter to the database using only TCP. As described in Table 4, the
network obtained 0% of data lost in all messages.

| TCP - D1 | TCP - D2 | TCP - D3
---|---|---|---
Inverter 01 | 0% | 0% | 0%
Inverter 02 | 0% | 0% | 0%
Inverter 03 | 0% | 0% | 0%
Table 4: Message lost during simultaneous transmission of different messages,
which are transmitted using different sampling times (between 1 to 65 seconds
for each message transmission).

In spite that the application uses only TCP, based on the flexibility of the
python client-server script, the evaluation was extended to use UDP. This
evaluation was only focused in the message that is transmitted every second.
So, in Table 5 it is possible to visualize that the TCP is always getting a
data message lost of 0%. However, in the scenario with UDP, some marginal
error rate is obtained.

| TCP (Simultaneous) - Error Rate (%) | UDP (Simultaneous) - Error Rate (%)
---|---|---
Inverter 01 | 0% | 0.2178%
Inverter 02 | 0% | 0.21669%
Inverter 03 | 0% | 0.2777%
Table 5: Message lost during simultaneous transmission of different messages,
which are transmitted using different sampling times (between 1 to 65 seconds
for each message transmission).

###  5.4 Other Results

One interesting output of the field measurements is the time varying
evaluation of specific radio metrics, such as RSRP, RSRQ (RSRQ), SINR, and
RSSI. These metrics are shown in Fig. (23), (24), (25), and (26).

Figure 23: RSSI Figure 24: RSRP Figure 25: RSRQ Figure 26: SINR

##  6 Discussion

The main goal of this test bed was to evaluate the performance of a 5G private
cellular network. The idea was to examine the readiness of TCP and UDP stack
to transport specific telemetry information, which was gathered from different
points in a real microgrid. TCP and UDP are considered, because they are the
transport layer protocol defined in the standard IEC-51850. Based on this
assumptions, different performance analysis were performed to evaluate the
throughput, latency, and data message integrity in the application.

The throughput was evaluated in both scenarios, the first approach considered
a simultaneous transmission, and the other one an isolated transmission for
each node. Here, the throughput was between 111.9 Kbps (Node in the edge -
Inverter 03) and a most robust node that obtains 85 Mbps, considering both
scenarios. In general, the simultaneous scenario reduced the the throughput in
each node. However, in the case of the edge node (Inverter 03) the uplink
outperformed the simultaneous setup when compared to the isolated scenario.
Probably this performance is related to the diversity and self power
controlling of the RAN when multiples nodes are being used.

In the case of the latency, the ICMP measurement indicates that in all cases
(simultaneous and isolated), including nodes in the edge of the network,
obtained an average latency of 20 ms, which is the maximum latency based on
the numerology available in LTE-Advanced specifications.

In the case of the application analysis, the message integrity evaluation
indicated that using TCP the wireless network obtains 0% of lost. However,
this performance was slightly degradated when UDP is used as transport
protocol.

  *[IED]:
  *[SV]:
  *[GOOSE]:
  *[MMS]:
  *[TCP]:
  *[UDP]:
  *[5G]:
  *[SINR]:
  *[RES]:
  *[DSO]:
  *[4G]:
  *[IP]:
  *[LTE]:
  *[RAN]:
  *[KPI]:
  *[3GPP]:
  *[MIMO]:
  *[CPE]:
  *[LVDC]:
  *[BESS]:
  *[CEI]:
  *[PV]:
  *[FO]:
  *[IPC]:
  *[ICT]:
  *[PDN]:
  *[RSSI]:
  *[RSRP]:
  *[WAN]:
  *[EPC]:
  *[RS]:
  *[ICMP]:
  *[RSRQ]:


# Bayesian multi-band fitting of alerts for kilonovae detection

Biswajit Biswas
AstroParticule et Cosmologie
Université Paris Cité, CNRS
F-75013, Paris, France
<EMAIL_ADDRESS>
Junpeng Lao
Google Switzerland
Gustav-Gull-Platz 1
8004 Zurich, Switzerland
Eric Aubourg
AstroParticule et Cosmologie
Université Paris Cité, CNRS
F-75013, Paris, France
Alexandre Boucaud
AstroParticule et Cosmologie
Université Paris Cité, CNRS
F-75013, Paris, France
Axel Guinot
AstroParticule et Cosmologie
Université Paris Cité, CNRS
F-75013, Paris, France
Emille E. O. Ishida
LPC, Université Clermont Auvergne
CNRS/IN2P3
F-63000, Clermont-Ferrand, France
Cécile Roucelle
AstroParticule et Cosmologie
Université Paris Cité, CNRS
F-75013, Paris, France

###### Abstract

In the era of multi-messenger astronomy, early classification of photometric
alerts from wide-field and high-cadence surveys is a necessity to trigger
spectroscopic follow-ups. These classifications are expected to play a key
role in identifying potential candidates that might have a corresponding
gravitational wave (GW) signature. Machine learning classifiers using features
from parametric fitting of light curves are widely deployed by broker software
to analyze millions of alerts, but most of these algorithms require as many
points in the filter as the number of parameters to produce the fit, which
increases the chances of missing a short transient. Moreover, the classifiers
are not able to account for the uncertainty in the fits when producing the
final score. In this context, we present a novel classification strategy that
incorporates data-driven priors for extracting a joint posterior distribution
of fit parameters and hence obtaining a distribution of classification scores.
We train and test a classifier to identify kilonovae events which originate
from binary neutron star mergers or neutron star black hole mergers, among
simulations for the Zwicky Transient Facility observations with 19 other non-
kilonovae-type events. We demonstrate that our method can estimate the
uncertainty of misclassification, and the mean of the distribution of
classification scores as point estimate obtains an AUC score of 0.96 on
simulated data. We further show that using this method we can process the
entire alert steam in real-time and bring down the sample of probable events
to a scale where they can be analyzed by domain experts.

##  1 Introduction

The detection of the binary neutron star (BNS) merger event GW170817 [Abbott
et al., 2017] marked the dawn of multi-messenger astronomy as the
electromagnetic (EM) counterpart of the event was detected following the
initial GW detection by LIGO and VIRGO collaborations. This EM counterpart,
so-called kilonova (KN), originates from BNS and possibly from neutron star
black hole mergers and is a source of heavy element production via the
r-process[Villar et al., 2017]. Moreover, detecting such events along with the
GW counterpart gives us a way to evaluate the value of Hubble’s Constant
($H_{0}$) [Schutz, 1986] and addresses the tension between the Cosmic
Microwave Background and Type Ia supernovae (SNIa) measurements of
$H_{0}$[Freedman, 2021].

To a certain extent, GW detectors can localize events in the sky. However, a
large sky fraction needs to be scanned to look for EM counterparts within the
localization error boxes obtained from GW signal. Although spectroscopic
measurement is necessary to obtain an accurate spectrum of these events, wide-
field surveys observe a much bigger patch of the sky in broadband filters so
they can be used to select targets for deployment of the expensive
spectroscopic follow-up. Hence considerable efforts are being put into
identifying potential events using the Zwicky Transient Facility [ZTF, Bellm
et al., 2018, Andreoni et al., 2021], Dark Energy Camera[Flaugher et al.,
2015, Garcia et al., 2020] and also preparing for the arrival of data from the
Rubin Observatory Legacy Survey of Space and Time [LSST, Ivezić et al., 2019].

Whenever a $5\sigma$ signal is detected above the background, ZTF creates
alerts containing a 30-day history of the event. Since around one million such
alerts are generated each night by ZTF, intermediary broker software is
required to process the incoming alert stream and identify events of interest.
Typical methods of classification rely on parameters obtained from performing
parametric fits of the light curves, independently on each filter. A major
challenge in identifying KNe events in the alert stream is the limited
availability of photometric detection points in each broadband filter. As we
move from ZTF to LSST, we will have more photometric bands, but fewer points
per band. Hence we need to prepare for the complexity of classification with
scarce data.

In the context of the Fink broker [Möller et al., 2020] that is being
developed for LSST and is currently processing alerts from the ZTF, we present
a new approach to combine information from multiple bands and jointly fit all
the filters of an alert by performing a Bayesian fit using Monte Carlo Markov
Chain (MCMC) with a data-driven prior. By performing a simultaneous fit, we
remove the constraint of a minimum number of points and also provide a
distribution of the scores of the classification. Although our approach can be
extended to any parametric fitting, in this work we use the parametric fitting
scheme presented in Biswas, B. et al. [2023].

##  2 Dataset

To train and test our classifier we use simulations from Muthukrishna et al.
[2019] generated with SNANA simulator [Kessler et al., 2009] and models from
the Photometric LSST Astronomical Classification Challenge [PLAsTiCC, Kessler
et al., 2019]. This set consists of 42568 events among which 38000 are non-KNe
representing 19 other types of events, while the remaining 4568 KNe
simulations comprise 2 KN models (see Muthukrishna et al. [2019] for details).
Moreover, to represent a more recent ZTF cadence, another 1000 KNe events from
Stachie et al. [2020] were added to this dataset.

To mimic alert data, we consider 30 days of data around the observation with
the highest signal-to-noise ratio, starting 10 days before and running up to
20 days after. This assumption is not exactly true for alerts because we will
have information only up to the day of the alert. However, it serves as a
necessary first test to evaluate our method before testing on a more complex
setting. This combined dataset is then split into a training set of 3280 KNe
and 19000 non-KNe and a test set of 2288 KNe and 19000 non-KNe. For more
details, readers can refer to Biswas, B. et al. [2023].

##  3 Methodology

(a) Basis vectors for reconstructing light curves where each principal
component is used as a template in the linear combination for generating fits.

(b) Examples of reconstructions using basis vectors where dashed black lines
are generated from the original work, and colored lines represent samples from
our fit.

Figure 1: Parametric fitting of light curves.

To demonstrate the performance of our approach we use the method proposed by
Biswas, B. et al. [2023] where each filter of the light curve is represented
as a linear combination of three basis vectors generated by performing
principal component analysis on noiseless light curve realizations. Figure
1(a) shows the set of templates that are used as basis vectors to fit the
light curves from day $-50$ to $50$, where day $0$ is approximately the
maximum observed flux. The optimized coefficients of this linear combination
constitute a set of features that are fed to a random forest [RF, Ho, 1995]
classifier to classify alerts as KNe by the authors. A limitation of such
approaches is that the parametric fit is performed independently on each
filter. It requires at least as many points in each filter as the number of
free parameters. Moreover, the uncertainty of the fit is not taken into
account during the classification process since the fit is deterministic.

In this work, we first develop a data-driven prior for the joint distribution
of parameters of all the filters. We combine the prior with Gaussian log-
likelihood for the observed points to generate MCMC chains to obtain a
posterior distribution for the parameters. Figure 1(b) shows an example of the
distribution of fits we obtained from our algorithm instead of the
deterministic fit proposed by [Biswas, B. et al., 2023]. The authors generate
fits even when there are fewer points than the number of free parameters by
using strong regularization, but they still require at least $2$ points in
each band. As we move towards LSST, such a constraint on all the $6$ LSST
bands will result in missing faster transients like KNe. Hence, motivating a
joint multi-band Bayesian fitting to eliminate this constraint.

###  3.1 Generating features

To build the data-driven prior, we need to identify a sample of events for
which we are confident that we have good fits. Ideally, the goal would be to
construct this prior from real data but due to the lack of availability to
real KNe events, we rely on the features generated by Biswas, B. et al. [2023]
on the realistic training set simulations. These features were generated only
on events with multiple points in each filter thus ensuring reliable fits. As
KNe events are short and more difficult to fit, we extract a joint multi-band
covariance matrix from the features of only the KNe events to act as a prior
for our Bayesian fit.

Although we have all the necessary components, before running the MCMC chains
we must normalize the light curve data in the same manner as Biswas, B. et al.
[2023]. We thus divide the data of each band by the maximum observed flux in
that band. Once the parameters of the fit are obtained, we include this
information, once again, in the classifier by passing the normalization factor
as a separate feature. For each event, after a warmup phase of 500 steps, we
generate 4 MCMC chains with 500 samples in each chain which provides us with a
posterior distribution of 2000 samples per event.

###  3.2 Classification

One approach for classification could be to use summary statistics such as the
mean and standard deviation of the posterior distribution to obtain a discrete
score for the event. But in a high-dimension space, if the distribution is
non-Gaussian, these summary statistics will not encompass all the information.
Instead, we chose to obtain a distribution of classification scores by
classifying each posterior sample individually.

Figure 2: Receiver operating characteristics curve.

Figure 3: Examples of distribution of scores for $5$ events with mean score
close to $1$ and $5$ events near the classification threshold of $0.5$.

Along with the fit parameters, we also pass as features to the classifier the
maximum value of flux in each band and the log-likelihood of the fit. We
compared an RF using scikit-learn [Pedregosa et al., 2011] and XGBoost
classifier [Chen and Guestrin, 2016] with 30 trees and a max depth of 42 as no
significant performance gain was observed with a more complicated model. For
training, we used a balanced set of 200k samples drawn from the complete pool
of samples and found that the performances were comparable(Figure 3). Hence,
we hereafter consider only the results from the RF classifier. Figure 3 shows
the distribution of scores for some events with mean scores around $0.5$ and
some around $1$. As we do not observe a bimodal distribution for the scores,
we use the mean and standard deviation of the distribution for each alert as
summary statistics to draw our final conclusions.

##  4 Results

Upon using the classifier on the test sample, we obtain the ROC curve shown in
figure 3 using the mean as a point estimate of the classification score. The
exact choice of threshold would depend upon the application of such a
classifier. For example, as there are around one million alerts from ZTF every
night, we might want to restrict ourselves to a smaller false positive (FP)
rate so that we have a reliable sample that can be followed up by experts. On
the other hand, if we have a GW localization in a particular region of the
sky, our goal would be to not miss the event, even if it is at the cost of a
high FP rate.

Since the classification threshold should ideally be dynamic, we present
results with the threshold set to $0.5$. Under this setting, we obtain a
precision of $0.45$ and recall of $0.85$. Even though the value of precision
might seem fairly low, we can bring down the number of potential events to a
scale where they can be analyzed by domain experts while maintaining a high
value for the recall, i.e., without missing many actual KNe events. In Figure
4 we further observe that the FP events have relatively lower values of scores
and a higher value of uncertainty associated with the classification hence
validating the uncertainty quantification. A direct comparison with the
results of Biswas, B. et al. [2023] where the authors require at least 2
points in each band, we obtain a drop in performance in terms of both
precision and recall. However, such a comparison can be misleading as our
sample contains events with less than 2 data points per band as well since
there is no constraint on the minimum number of points.

(a) Distribution of scores and sigma for True positives.

(b) Distribution of scores and sigma for False positives.

Figure 4: Distribution of mean($\mu$) and sigma($\sigma$) for each event in
test set.

##  5 Conclusion and Outlook

As we prepare for the arrival of LSST, we need robust classification
algorithms that can operate on a small number of points for early
classification of short-term transients. Our Bayesian fitting approach for KN
classification takes a step in this direction by jointly fitting all filters,
thereby combining information from all photometric bands to generate a
parametric fit. Our algorithm is not only able to incorporate information from
a data-driven prior but also estimate the uncertainty of the fits.

As the next step, we must retrain the classifier on more alert-like curves
with no data after the day of the alert. Although a slight drop in performance
is expected because there will be incomplete data about the light curve, we
expect the results to generalize fairly well. Once trained, it is
straightforward to integrate the method proposed here within the Fink broker
to be tested on real ZTF alerts before being extended for the 6 bands of LSST.
Additionally, the computational cost needs to be taken into account when
pushing the module into production. We were able to generate features for
around 1000 events per minute using a single CPU. The algorithm being written
in the JAX[Bradbury et al., 2018] framework, can easily be parallelized for
faster computing efficiency. Although our algorithm is capable of processing
the entire ZTF alert stream, processing the LSST stream, which will be at
least one order of magnitude larger, would still be a challenge. However, we
can easily introduce appropriate selections to discard a major fraction of
events at an earlier stage to significantly reduce the computational cost. For
LSST, in particular, this module will be used in combination with a series of
selection cuts which would result in a feasible mechanism to analyze the alert
stream and filter out interesting events in real-time so that spectroscopic
follow-up can be triggered on these events.

## Acknowledgments and Disclosure of Funding

We deeply thank Daniel Muthukrishna and Cosmin Stachie for providing a set of
simulated KNe data used to train the model. This project has received funding
from the European Union’s Horizon 2020 research and innovation program under
the Marie Skłodowska-Curie grant agreement No 945304 – Cofund AI4theSciences
hosted by PSL University. This work was developed within the Fink community
and made use of the Fink community broker resources. Fink is supported by
LSST-France and CNRS/IN2P3.

## References

## References

  * Abbott et al. [2017] B. P. Abbott, R. Abbott, T. D. Abbott, F. Acernese, K. Ackley, C. Adams, T. Adams, P. Addesso, and et al.  Gw170817: Observation of gravitational waves from a binary neutron star inspiral.  _Phys. Rev. Lett._ , 119:161101, Oct 2017.  doi: 10.1103/PhysRevLett.119.161101.  URL https://link.aps.org/doi/10.1103/PhysRevLett.119.161101.
  * Andreoni et al. [2021] I. Andreoni, M. W. Coughlin, E. C. Kool, M. M. Kasliwal, H. Kumar, V. Bhalerao, A. S. Carracedo, A. Y. Q. Ho, P. T. H. Pang, D. Saraogi, K. Sharma, V. Shenoy, E. Burns, T. Ahumada, S. Anand, L. P. Singer, D. A. Perley, K. De, U. C. Fremling, E. C. Bellm, M. Bulla, A. Crellin-Quick, T. Dietrich, A. Drake, D. A. Duev, A. Goobar, M. J. Graham, D. L. Kaplan, S. R. Kulkarni, R. R. Laher, A. A. Mahabal, D. L. Shupe, J. Sollerman, R. Walters, and Y. Yao.  Fast-transient Searches in Real Time with ZTFReST: Identification of Three Optically Discovered Gamma-Ray Burst Afterglows and New Constraints on the Kilonova Rate.  _ApJ_ , 918(2):63, Sept. 2021.  doi: 10.3847/1538-4357/ac0bc7.
  * Bellm et al. [2018] E. C. Bellm, S. R. Kulkarni, M. J. Graham, R. Dekany, R. M. Smith, R. Riddle, F. J. Masci, G. Helou, T. A. Prince, S. M. Adams, C. Barbarino, T. Barlow, J. Bauer, R. Beck, J. Belicki, R. Biswas, N. Blagorodnova, D. Bodewits, B. Bolin, V. Brinnel, T. Brooke, B. Bue, M. Bulla, R. Burruss, S. B. Cenko, C.-K. Chang, A. Connolly, M. Coughlin, J. Cromer, V. Cunningham, K. De, A. Delacroix, V. Desai, D. A. Duev, G. Eadie, T. L. Farnham, M. Feeney, U. Feindt, D. Flynn, A. Franckowiak, S. Frederick, C. Fremling, A. Gal-Yam, S. Gezari, M. Giomi, D. A. Goldstein, V. Z. Golkhou, A. Goobar, S. Groom, E. Hacopians, D. Hale, J. Henning, A. Y. Q. Ho, D. Hover, J. Howell, T. Hung, D. Huppenkothen, D. Imel, W.-H. Ip, Željko Ivezić, E. Jackson, L. Jones, M. Juric, M. M. Kasliwal, S. Kaspi, S. Kaye, M. S. P. Kelley, M. Kowalski, E. Kramer, T. Kupfer, W. Landry, R. R. Laher, C.-D. Lee, H. W. Lin, Z.-Y. Lin, R. Lunnan, M. Giomi, A. Mahabal, P. Mao, A. A. Miller, S. Monkewitz, P. Murphy, C.-C. Ngeow, J. Nordin, P. Nugent, E. Ofek, M. T. Patterson, B. Penprase, M. Porter, L. Rauch, U. Rebbapragada, D. Reiley, M. Rigault, H. Rodriguez, J. van Roestel, B. Rusholme, J. van Santen, S. Schulze, D. L. Shupe, L. P. Singer, M. T. Soumagnac, R. Stein, J. Surace, J. Sollerman, P. Szkody, F. Taddia, S. Terek, A. V. Sistine, S. van Velzen, W. T. Vestrand, R. Walters, C. Ward, Q.-Z. Ye, P.-C. Yu, L. Yan, and J. Zolkower.  The zwicky transient facility: System overview, performance, and first results.  _Publications of the Astronomical Society of the Pacific_ , 131(995):018002, dec 2018.  doi: 10.1088/1538-3873/aaecbe.  URL https://dx.doi.org/10.1088/1538-3873/aaecbe.
  * Biswas, B. et al. [2023] Biswas, B., Ishida, E. E. O., Peloton, J., Möller, A., Pruzhinskaya, M. V., de Souza, R. S., and Muthukrishna, D.  Enabling the discovery of fast transients - a kilonova science module for the fink broker.  _A &A_, 677:A77, 2023.  doi: 10.1051/0004-6361/202245340.  URL https://doi.org/10.1051/0004-6361/202245340.
  * Bradbury et al. [2018] J. Bradbury, R. Frostig, P. Hawkins, M. J. Johnson, C. Leary, D. Maclaurin, G. Necula, A. Paszke, J. VanderPlas, S. Wanderman-Milne, and Q. Zhang.  JAX: composable transformations of Python+NumPy programs, 2018.  URL http://github.com/google/jax.
  * Chen and Guestrin [2016] T. Chen and C. Guestrin.  XGBoost: A scalable tree boosting system.  In _Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining_ , KDD ’16, pages 785–794, New York, NY, USA, 2016. ACM.  ISBN 978-1-4503-4232-2.  doi: 10.1145/2939672.2939785.  URL http://doi.acm.org/10.1145/2939672.2939785.
  * Flaugher et al. [2015] B. Flaugher, H. T. Diehl, K. Honscheid, T. M. C. Abbott, O. Alvarez, R. Angstadt, J. T. Annis, M. Antonik, O. Ballester, L. Beaufore, G. M. Bernstein, R. A. Bernstein, B. Bigelow, M. Bonati, D. Boprie, D. Brooks, E. J. Buckley-Geer, J. Campa, L. Cardiel-Sas, F. J. Castander, J. Castilla, H. Cease, J. M. Cela-Ruiz, S. Chappa, E. Chi, C. Cooper, L. N. da Costa, E. Dede, G. Derylo, D. L. DePoy, J. de Vicente, P. Doel, A. Drlica-Wagner, J. Eiting, A. E. Elliott, J. Emes, J. Estrada, A. F. Neto, D. A. Finley, R. Flores, J. Frieman, D. Gerdes, M. D. Gladders, B. Gregory, G. R. Gutierrez, J. Hao, S. E. Holland, S. Holm, D. Huffman, C. Jackson, D. J. James, M. Jonas, A. Karcher, I. Karliner, S. Kent, R. Kessler, M. Kozlovsky, R. G. Kron, D. Kubik, K. Kuehn, S. Kuhlmann, K. Kuk, O. Lahav, A. Lathrop, J. Lee, M. E. Levi, P. Lewis, T. S. Li, I. Mandrichenko, J. L. Marshall, G. Martinez, K. W. Merritt, R. Miquel, F. Muñoz, E. H. Neilsen, R. C. Nichol, B. Nord, R. Ogando, J. Olsen, N. Palaio, K. Patton, J. Peoples, A. A. Plazas, J. Rauch, K. Reil, J.-P. Rheault, N. A. Roe, H. Rogers, A. Roodman, E. Sanchez, V. Scarpine, R. H. Schindler, R. Schmidt, R. Schmitt, M. Schubnell, K. Schultz, P. Schurter, L. Scott, S. Serrano, T. M. Shaw, R. C. Smith, M. Soares-Santos, A. Stefanik, W. Stuermer, E. Suchyta, A. Sypniewski, G. Tarle, J. Thaler, R. Tighe, C. Tran, D. Tucker, A. R. Walker, G. Wang, M. Watson, C. Weaverdyck, W. Wester, R. Woods, B. Yanny, and T. D. Collaboration).  The dark energy camera.  _The Astronomical Journal_ , 150(5):150, oct 2015.  doi: 10.1088/0004-6256/150/5/150.  URL https://dx.doi.org/10.1088/0004-6256/150/5/150.
  * Freedman [2021] W. L. Freedman.  Measurements of the Hubble Constant: Tensions in Perspective.  _ApJ_ , 919(1):16, Sept. 2021.  doi: 10.3847/1538-4357/ac0e95.
  * Garcia et al. [2020] A. Garcia, R. Morgan, K. Herner, A. Palmese, M. Soares-Santos, J. Annis, D. Brout, A. K. Vivas, A. Drlica-Wagner, L. Santana-Silva, D. L. Tucker, S. Allam, M. Wiesner, J. García-Bellido, M. S. S. Gill, M. Sako, R. Kessler, T. M. Davis, D. Scolnic, J. Casares, H. Chen, C. Conselice, J. Cooke, Z. Doctor, R. J. Foley, J. Horvath, D. A. Howell, C. D. Kilpatrick, C. Lidman, F. Olivares E., F. Paz-Chinchón, J. Pineda-G., J. Quirola-Vásquez, A. Rest, N. Sherman, T. M. C. Abbott, M. Aguena, S. Avila, E. Bertin, S. Bhargava, D. Brooks, D. L. Burke, A. Carnero Rosell, M. Carrasco Kind, J. Carretero, M. Costanzi, L. N. da Costa, S. Desai, H. T. Diehl, J. P. Dietrich, P. Doel, S. Everett, B. Flaugher, P. Fosalba, D. Friedel, J. Frieman, E. Gaztanaga, D. W. Gerdes, D. Gruen, R. A. Gruendl, J. Gschwend, G. Gutierrez, S. R. Hinton, D. L. Hollowood, K. Honscheid, D. J. James, K. Kuehn, N. Kuropatkin, O. Lahav, M. Lima, M. A. G. Maia, M. March, J. L. Marshall, F. Menanteau, R. Miquel, R. L. C. Ogando, A. A. Plazas, A. K. Romer, A. Roodman, E. Sanchez, V. Scarpine, M. Schubnell, S. Serrano, I. Sevilla-Noarbe, M. Smith, E. Suchyta, M. E. C. Swanson, G. Tarle, D. Thomas, T. N. Varga, A. R. Walker, J. Weller, and DES Collaboration.  A DESGW Search for the Electromagnetic Counterpart to the LIGO/Virgo Gravitational-wave Binary Neutron Star Merger Candidate S190510g.  _ApJ_ , 903(1):75, Nov. 2020.  doi: 10.3847/1538-4357/abb823.
  * Ho [1995] T. K. Ho.  Random decision forests.  In _Proceedings of 3rd international conference on document analysis and recognition_ , volume 1, pages 278–282. IEEE, 1995.
  * Ivezić et al. [2019] Ž. Ivezić, S. M. Kahn, J. A. Tyson, B. Abel, E. Acosta, R. Allsman, D. Alonso, Y. AlSayyad, S. F. Anderson, J. Andrew, and et al.  LSST: From Science Drivers to Reference Design and Anticipated Data Products.  _ApJ_ , 873:111, Mar. 2019.  doi: 10.3847/1538-4357/ab042c.
  * Kessler et al. [2009] R. Kessler, J. P. Bernstein, D. Cinabro, B. Dilday, J. A. Frieman, S. Jha, S. Kuhlmann, G. Miknaitis, M. Sako, M. Taylor, and J. Vanderplas.  Snana: A public software package for supernova analysis.  _Publications of the Astronomical Society of the Pacific_ , 121(883):1028, aug 2009.  doi: 10.1086/605984.  URL https://dx.doi.org/10.1086/605984.
  * Kessler et al. [2019] R. Kessler, G. Narayan, A. Avelino, E. Bachelet, R. Biswas, P. J. Brown, D. F. Chernoff, A. J. Connolly, M. Dai, S. Daniel, R. Di Stefano, M. R. Drout, L. Galbany, S. González-Gaitán, M. L. Graham, R. Hložek, E. E. O. Ishida, J. Guillochon, S. W. Jha, D. O. Jones, K. S. Mandel, D. Muthukrishna, A. O’Grady, C. M. Peters, J. R. Pierel, K. A. Ponder, A. Prša, S. Rodney, V. A. Villar, LSST Dark Energy Science Collaboration, and Transient and Variable Stars Science Collaboration.  Models and Simulations for the Photometric LSST Astronomical Time Series Classification Challenge (PLAsTiCC).  _PASP_ , 131(1003):094501, Sept. 2019.  doi: 10.1088/1538-3873/ab26f1.
  * Muthukrishna et al. [2019] D. Muthukrishna, G. Narayan, K. S. Mandel, R. Biswas, and R. Hložek.  Rapid: Early classification of explosive transients using deep learning.  _Publications of the Astronomical Society of the Pacific_ , 131(1005):118002, sep 2019.  doi: 10.1088/1538-3873/ab1609.  URL https://dx.doi.org/10.1088/1538-3873/ab1609.
  * Möller et al. [2020] A. Möller, J. Peloton, E. E. O. Ishida, C. Arnault, E. Bachelet, T. Blaineau, D. Boutigny, A. Chauhan, E. Gangler, F. Hernandez, J. Hrivnac, M. Leoni, N. Leroy, M. Moniez, S. Pateyron, A. Ramparison, D. Turpin, R. Ansari, T. Allam Jr, A. Bajat, B. Biswas, A. Boucaud, J. Bregeon, J.-E. Campagne, J. Cohen-Tanugi, A. Coleiro, D. Dornic, D. Fouchez, O. Godet, P. Gris, S. Karpov, A. Nebot Gomez-Moran, J. Neveu, S. Plaszczynski, V. Savchenko, and N. Webb.  fink, a new generation of broker for the LSST community.  _Monthly Notices of the Royal Astronomical Society_ , 501(3):3272–3288, 11 2020.  ISSN 0035-8711.  doi: 10.1093/mnras/staa3602.  URL https://doi.org/10.1093/mnras/staa3602.
  * Pedregosa et al. [2011] F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel, P. Prettenhofer, R. Weiss, V. Dubourg, J. Vanderplas, A. Passos, D. Cournapeau, M. Brucher, M. Perrot, and E. Duchesnay.  Scikit-learn: Machine learning in Python.  _Journal of Machine Learning Research_ , 12:2825–2830, 2011.
  * Schutz [1986] B. F. Schutz.  Determining the Hubble constant from gravitational wave observations.  _Nature_ , 323(6086):310–311, Sept. 1986.  doi: 10.1038/323310a0.
  * Stachie et al. [2020] C. Stachie, M. W. Coughlin, N. Christensen, and D. Muthukrishna.  Using machine learning for transient classification in searches for gravitational-wave counterparts.  _Monthly Notices of the Royal Astronomical Society_ , 497(2):1320–1331, 06 2020.  ISSN 0035-8711.  doi: 10.1093/mnras/staa1776.  URL https://doi.org/10.1093/mnras/staa1776.
  * Villar et al. [2017] V. A. Villar, J. Guillochon, E. Berger, B. D. Metzger, P. S. Cowperthwaite, M. Nicholl, K. D. Alexander, P. K. Blanchard, R. Chornock, T. Eftekhari, W. Fong, R. Margutti, and P. K. G. Williams.  The Combined Ultraviolet, Optical, and Near-infrared Light Curves of the Kilonova Associated with the Binary Neutron Star Merger GW170817: Unified Data Set, Analytic Models, and Physical Implications.  _ApJ_ , 851(1):L21, Dec. 2017.  doi: 10.3847/2041-8213/aa9c84.