remote sensing VIGIA: A Thermal and Visible Imagery System to Track Volcanic Explosions

: The monitoring of the frequency, intensity/magnitude and dynamics of explosive events at volcanoes in a state of unrest is key to surveying and forecasting their activity. Thermal and visual video observations of eruptive phenomena, and their correlation with data from deformation and seismic networks, are often limited by technical constraints including lack of time synchronisation, data volumes and power consumption. Several solutions are currently available and here we present an instrument designed for the permanent and real-time observation of volcanic explosive events in the visible and thermal infrared wavelengths, the output of which can be fully synchronised with ancillary monitoring data. Our system (VIGIA: visual and infrared ground-based imagery analyser) follows an edge computing approach whereby information is processed on-site, and periodic reports are sent to the local observatory and the system “decides” when to acquire high-temporal resolution data so as to capture key explosive events. As a permanent installation, VIGIA enables the continuous, long-term and time-synchronised observation of volcanic activity while reducing power consumption and data volumes. We suggest that VIGIA-style instruments could provide useful scientiﬁc and monitoring information, and provide here the key details of the components, assembly, and code so that observatories can replicate the system and build their own VIGIA at minimal cost. We use the Reventador volcano, in Ecuador, as a case study to present the capabilities of the instrument.


Introduction
Explosive volcanic eruptions can have damaging consequences over a wide range of scales, from the global scale, as seen in the 1991 eruption of Pinatubo in the Philippines (e.g., [1]); the regional scale such as the 2010 eruption of Eyjafjallajökull in Iceland (e.g., [2]); and the local scale such as the 1999-2017 Tungurahua and 2002 Reventador eruptions (e.g., [3,4]). The dynamics of volcanic explosions have been studied from two different perspectives: to constrain the parameters of the eruptive regime (e.g., [5][6][7][8][9]) and to model the dispersion of pyroclasts (e.g., [10][11][12]). Describing the dynamics of volcanic explosive eruptions at the local level is key for the volcanic observatories' aim of reducing the associated risk. Video cameras have been used for several decades to monitor and study explosive eruptions (e.g., [7,13]); more recently, the use of infrared thermal imaging has been added as remote and ground-based surveillance (e.g., [14]). Airborne-and ground-based thermal infrared imagery has proved to be an efficient and powerful tool to monitor volcanic activity. It has been used to observe superficial changes around volcanic craters (e.g., [15][16][17]), locate and track lava flows (e.g., [18][19][20]), identify pyroclastic density current deposits (e.g., [21,22]), estimate lava effusion rates (e.g., [23,24]), study lava domes' growth and collapse [25], monitor lava lakes (e.g., [26,27]), characterise explosive eruptions (e.g., [28,29]) and describe plume shape and dynamics (e.g., [30][31][32]). Most of these results have been obtained during measurement campaigns, either with fixed instruments or mounted on manned or autonomous aircraft (including unmanned aerial vehicles, UAVs). Thermal and visual video observations of eruptive phenomena, and their correlation with data from deformation, acoustic and seismic networks, however, are often limited by technical constraints. Limitations include time synchronisation, data volumes and power consumption. Although these constraints can all be addressed (e.g., [33,34]), there are still few observatories that use permanent stations for long-term studies.
In this work, we present VIGIA, an instrument based on thermal and visible imagery intended to serve as a permanent observation station that follows an edge computing approach whereby information is processed on site. We use the Reventador volcano in Ecuador as a case study to prove the capabilities of the instrument, which decides when to acquire high-temporal resolution data so as to capture key explosive eruptions and sends periodic reports to the Instituto Geofísico of the Escuela Politécnica Nacional (IGEPN), the local observatory.
The Reventador volcano is a stratovolcano located in the limit between the Andean cordillera and the Amazon basin ( Figure 1a). Its currently active edifice is located inside a 4 km wide U-shaped debris avalanche scar open to the east (Figure 1b). Its last, and still ongoing, activity period started in November 2002 with almost no precursory activity; the paroxysmal phase of that eruption started with a VEI-4 explosion that produced an ash column 16-17 km high, and pyroclastic currents which flowed east, and reached the Coca River, 8 km to the east [3]. The current active cone is located inside a 4 km wide U-shaped debris avalanche scar. VIGIA is installed within the property of Hostería Reventador, 7 km eastward from the active cone.

Brief, Non-Exhaustive, History of Permanently Deployed Instrumentation for Thermography
One of the earliest remote temperature measurements in the study of volcanoes (see Figure 2) was documented by Thomas A. Jaggar in his investigation at Kilauea [35]. Although Jaggar used Seger cones, commonly employed in pottery, to determine the temperature gradient in the uppermost 15 m of the Halema'uma'u lava lake [36], he also mentioned that Daly, in 1909, and Day and Shepherd, in 1912, used optical pyrometers to measure the temperature of active lava fountains in the same lava lake. Several authors followed this schema and carried out measurement campaigns to obtain the volcanofeature's surface temperature from several kilometres away; for example, the temperature of the dacitic dome's surface at Santiaguito volcano was measured by Zies (1941) [37], who used an optical pyrometer calibrated in the range of 550 to 950 • C to obtain lava temperatures of 700 ± 25 • C. It was in 1967, that Zettwoog and Tazieff promoted the use of permanently installed instrumentation, deployed at Etna, to measure vent temperatures [38]. In the same context, in his 1971 report for UNESCO [39], Robert M. Moxham presented the state-of-the-art possibilities for permanent deployments, which included portable direct-reading radiometers with optional recorders, and aerial radiometric systems. The main challenges at that time were the harsh environmental conditions and equipment bulk [40]. Moxham et al. (1972) [41] conducted an experiment in which temperature data from fumaroles at Mount Rainier were received in Washington via a satellite link. In this experiment, an insulated plywood box contained the instruments including the main power supply battery which was replenished by a solar-cell panel. The box was heated by a system connected to a wind generator. Although some of the instruments were destroyed after five weeks, the results were optimistically reported, confirming the feasibility of using satellites for the telemetry of volcanic temperatures. Another attempt to implement instrumentation to measure volcanic temperature was executed in 1978 by Brivio and Tomasoni (1980) [42], who modified a commercial radiometer and installed it on a 2.5 m high pillar overlooking the fumarolic field at Vulcano. The data were transmitted by a 5 km radio link back to Lipari. Once again, environmental conditions, high salinity, humidity, wind, and rain eventually caused the system to fail after a few months. A significant step in increasing the durability of instruments deployed in the harsh environment that often characterise volcanic landscape was achieved by Carl R. Thornber (1997) [43], who successfully installed a remote video telemetry system (RVTS) for the surveillance of Kilauea, transmitting visible images of the Pu'u O'o eruptive vent to the Hawaiian Volcano Observatory (HVO). Despite not having pursued temperature measurements, this RVTS was the basis for the development of the thermal monitoring system for Kilauea volcano, which was named DUCKS, designed and built in 1999 by Harris et al. [44]. The DUCKS system was a low-cost robust modular system based on thermal infrared thermometers that used radio transceivers to transmit thermal data to the HVO. The system was modified to be installed at Stromboli volcano in 2002, where its robustness was severely tested during the paroxysmal eruption of 5 April 2003. The instrument recorded good, unsaturated data during the whole eruption [45]. Based on the idea of robustness, Aster et al. (2004) [46] installed an integrated surveillance instrumental network at Mount Erebus volcano, in Antarctica, which included dual-frequency GPS receivers, broadband seismometers, digital radiometers, video cameras and radio transceivers for data transmission. The RVTS was also the starting point for the development of volcano monitoring systems based on thermal imaging. Camcorder-style thermal cameras appeared in the market from 1995 [47], but it took some years until they evolved to fulfil the necessary characteristics to function as parts of permanent deployed stations. In 2004, two thermal cameras were added to the existing video surveillance system at Etna volcano [48], allowing the implementation of real-time analysis of the images to discriminate the type of activity (between gas emission, lava effusion and absence of activity) and thus change the storing rate of the images and provide statistics of volcanic phenomena. The deployment of this system resulted in the detailed study of the 2011-2013 Etna lava fountaining episode (e.g., [49,50] [52] used a permanently installed thermal camera to automatically evaluate the volcanic explosion rate, the magnitude of the explosions, the maximum height above the crater rim reached by the ejecta, the maximum velocity of the pyroclastic material and gas, and the distribution of the thermal activity along the active vents at Stromboli. Many equipment features have improved over the last few years, allowing equipment to be interconnected, sampling rates to be increased and image resolution to be boosted. Another example of permanent deployment based on thermal cameras for volcanic surveillance was described by Patrick et al. (2014) [34], who installed thermal cameras between 2010 and 2012 at Kilauea and Mauna Loa in order to monitor lava lakes, intracrater vents, fissure eruptions, lava flows and fumarolic activity. During the subsequent years, image processing algorithms using visible images were implemented to calculate plume heights [50,53] and to estimate mass eruption rates [54]. In 2014, a team from Laboratoire Magmas et Volcans (LMV) and the Observatoire de Physique du Globe de Clermont Ferrand (OPGC) implemented an integral system based on thermal and visible imagery to monitor the lava dome dynamics at the Merapi volcano [25]. The system includes four stations, placed in pairs, so that they produce stereoscopic images that allow objects to be spatially located and their trajectories reconstructed. Each station contains a digital single lens reflex camera (DSLR), an infrared thermal camera and one or two webcams. The instrument presented in this paper is based on the central idea of the instrument developed for Merapi.

Materials and Methods
Our instrument, VIGIA (visual and infrared ground-based imagery analyser; named in honour of the Vigia network of local observers during the Tungurahua 1999-2017 eruption; [55,56]), was developed to record and analyse thermal and visible images at a high sampling rate (32 images per second) during volcanic explosive eruptions. The main components of this instrument are grouped as depicted in the diagram of Figure 3a, into four groups: (1) the power supply system; (2) the computing unit, which includes the timing module, the external pressure-temperature-relative-humidity (P-T-RH) sensor, the Ethernet port and the storage drive; (3) the cameras, consisting of the thermal module and the visible module; and (4) the communications module. VIGIA was conceived to work permanently, thus the power supply and communications were designed to keep the instrument running continuously and to optimize the amount of data transmitted. The computing unit, hereinafter referred to simply as the central computer, is the backbone of the instrument, having the function of controlling the cameras, retrieving the images and processing them. It is based on a Raspberry Pi 4 as the hardware core running Raspberry OS (previously Raspbian) which is an operating system based on the Debian Linux distribution. Although the instrument can operate autonomously, there is also the possibility to control it remotely. The complete set of configuration files and scripts can be found as Supplementary Material.   Figure 4 depicts the schematics of the diode-based circuit, which uses Schottky diodes with low internal resistance and very low reverse current. In case of failure in the national power network, the photovoltaic system provides the energy necessary for the instrument to run normally and, in case the solar panels get covered or disconnected, external lead-acid batteries provide an autonomy of up to 72 h. The instrument's components receive the power they need to operate from a power management board (Figure 3d-4), designed and built at the OPGC, which ensures that the voltage delivered to each component is stable. A web relay (Figure 3d-5) controls individually the power of the central computer (Figure 3e-6), the DSLR camera (see Visual Module section below) (Figure 3b-11), the window defog heater (Figure 3g-14), and includes the possibility to send signals remotely for a soft reboot, shutdown and a hard reboot of the central computer. . This diode-based circuit allows the implementation of a dual power supply system, switching between Vin_1 and Vin_2 depending on the higher voltage. It uses Schottky diodes with low dynamic resistance and very low reverse current to minimize the power transfer between the two power sources.

Computer Unit
The computer unit is responsible for data acquisition, processing and communication. It counts with a GPS module (Figure 3e-7) to ensure that all data recorded by the VIGIA is UTC time stamped to microsecond accuracy. The GPS module used is based on the L80-39 chip, which uses a serial port for communication and needs a GPIO pin to send the pulse-per-second signal. The system synchronises its own clock with the GPS time using standard Linux utilities (gpsd, pps-tools and ntp). An external sensor (P-T-RH) (Figure 3f-8) measures ambient pressure, ambient temperature and relative humidity to check the possible influence of these parameters on the thermal data (script included within the Supplementary Material). The transmission of the data processing results takes place mainly via the Ethernet connection (Figure 3b,d-9). The communication process is described in more detail below. The raw data, as well as the processed results are stored on a solid-state drive (SSD) (Figure 3e-10). The SSD was chosen instead of a hard disk drive (HDD) because of its reliability against shock, vibration and extreme temperatures, not to mention write and read speed.

Thermal Module
We used an 8-14µm Optris PI 640 thermal camera (Figure 3b,g-12) to record static 640 × 480 pixel images and 32 frames-per-second (fps) video. Evocortex provides a Software Development Kit (SDK) called IRImagerDirect SDK [57] which includes the PI imager library to control the camera and the documentation. The library can be integrated into C++ programs and also in Python scripts to connect to the camera and retrieve images including metadata. VIGIA has different modes for recording thermal data, depending on the status of the volcano. If the volcano is clouded, the instrument remains in a waiting state, just checking periodically whether the volcano becomes clear or not (see Volcano Recognition section below). Once the volcano becomes unclouded, the crater is identifiable, then the system goes into an acquisition state in which it acquires periodic static thermal pictures and, by obtaining the maximum temperature within a region of interest (ROI) located just above the crater rim, it generates a thermal timeseries with the maximum temperature in the ROI at 32 samples per second (sps). The central computer applies a triggering system on the thermal timeseries to identify explosive eruptions. Every time an explosion is detected, the system records a thermal video.
For computers, a thermal image is an array of floating-point numbers (32 or 64 bits) representing the temperature of each pixel, plus an array of integers containing the metadata (time stamp, camera identifier, among other information). Optris, the thermal camera manufacturer, uses lossless compression algorithms to change the representation to 16-bit integers. We used the Python module Numpy to manage and store data with its conventional .npz extension. Each thermal file has an identifier in the name telling the type of data contained. Examples of thermal filenames are VIGIA_IR_<date>_<time>.npz for still thermal infrared picture, VIGIA_THVID_<date>_<time>.npz for thermal infrared video frames and VIGIA_METAD_<date>_<time>.npz for thermal video metadata.

Visible Module
The visible module of the VIGIA includes a 5-megapixel visible camera (Figure 3b,g-13) rendering images through the MIPI Camera Serial Interface (MIPI CSI) connection provided by the Raspberry Pi, and an 18-megapixel DSLR Canon camera (Figure 3b-11) connected using the USB port. A python script, written by the OPGC technical team, retrieves videos from the 5-megapixel camera when an explosion is triggered. The video recorded includes a five-second pre-trigger period and its length is set to 1.5 min. At night, all images and videos from the 5-megapixel camera are dark, the DSLR camera is used then in bulb mode to capture long exposure pictures rendering the volcano visible. During the daytime, the DSLR camera captures a series of 10 individual shots. Both visual cameras are triggered by the thermal module.

Volcano Recognition
Most volcanoes have their summit at least occasionally obstructed from view by cloud cover. At volcanoes such as Reventador, located in the sub-Andean region where the Amazonian Forest environment is very humid, the periods in which the volcano is clear from cloud cover can be as small as ten hours in a week. In order to optimize the amount of disk space and transmission bandwidth, VIGIA counts with an algorithm to recognize whether the volcano is clear or clouded ( Figure 5). This algorithm uses the contours of the crater in good conditions (i.e., no clouds or gas in the surroundings) as a template that the computer searches for in each picture (Figure 5a). The algorithm also uses a weighted mask to enhance the importance of the flanks of the volcano over the upper rim (Figure 5b). The mask was defined based on the rapid changes of the morphology observed at the upper rim [58]. We applied a normalised 2D cross-correlation algorithm included in OpenCV API to search for the template and locate the point with the highest correlation coefficient between the image and the template. As a result of this operation, we have the normalised the cross-correlation coefficient and the location of the pattern in row and column coordinates from the origin; in the particular case shown in Figure 5, from the lower left corner. We used this coefficient to discriminate if the volcano appears in the image by simply comparing it to a predefined threshold; if the volcano is clouded, the coefficient is very low, and the location is reported as the origin. We tested the volcano recognition procedure in three stages. During the first stage, we used 80 images acquired at different times of the day to adjust the threshold value above which the image is defined as clear or cloudy. In the second stage we used 780 images from different months in which the volcano appears in different locations inside the frame, showing that the result of the recognition is indifferent to changes in position caused by wind, vibrations or slight displacements of the camera. The third test was performed on a sample of 2600 images taken at different times of the day, on different days of different seasons. Each new image obtained has a probability of success independent of the result of the previous ones. In these tests we have defined a hit or success as the coincidence between the label resulted from the recognition script and the rating that a volcanologist assigned to the image.

Communication Module
The communication module of the VIGIA instrument works on the physical communication components of the central computer, i.e., on the Ethernet interface. It is through this interface that we have access to the different components and data generated by the instrument. Several communication protocols allow us to remotely control the central system, such as SSH and VNC connections, and remote desktop applications such as AnyDesk [59] or DWService [60]. Access to the graphical environment of the host computer is necessary specifically to observe the images from the cameras in real time in the process of framing and focusing during field installation.
The logic part of the communications module is in charge of delivering the results of the measurements and processing. We created a series of scripts that allow VIGIA to deliver periodic reports about the volcano (see Supplementary Material). Each time a thermal image is acquired, the volcano recognition script appends to a daily log file the date and time, the normalised cross-correlation coefficient, the image quality, the position of the volcano summit pattern, and a "Clear" or "Clouded" label. At the end of the day, a script is dedicated to obtaining statistical data from the log file; more specifically the portion of the day observed, the portion of that period when the volcano was unclouded, and the time when the volcano was last seen to be clear. These data are included in a report together with the thermal image with the best quality factor of the day and VIGIA distributes it using a telegram bot.

Results
We deployed the instrument and installed it as a permanent station at Reventador volcano, Ecuador. All the code scripts are available at https://github.com/fvasconez/ VIGIA.git (accessed on 10 February 2022). Our instrument is located 7 km away from the active cone, within the property of the Hostería Reventador. It has been regularly recording data since August 2021. Figure 6 show examples of still images, in infrared and visible spectra, during the beginning (Figure 6a) and the second pulse (Figure 6b) of an explosion; it also shows a false event triggered by a simple-threshold triggering algorithm.
In the first phase, we setup VIGIA to record still thermal images every five minutes. We used these images to define the threshold that allows the instrument to discriminate whether the volcano appears in the image or not. In the second phase, the trigger frequency was increased to one shot every two minutes. During this phase, we were able to experiment with the impact of noise on the thermal images on the recognition procedure, and to adjust the parameters of the denoising procedure to increase the success rate of volcano recognition. In the third phase, the image capture frequency was dynamically adjusted to the visibility conditions, capturing one image per minute under clear conditions and one image every five minutes under cloudy conditions. Daily, the staff of the IGEPN receives a report with the information of the visibility of the volcano during the day, together with the best rated picture, directly to their mobile phones (Figure 7).
Based on the still images recorded and processed, we obtained the portion of each day when the volcano is recognizable by the station, i.e., when cloud cover is low and measurements are possible. Figure 8 shows these daily intervals, specifying whether these are working hours (between 07h00 and 17h00, local time) during which other observation tasks can be performed, or are intervals during the night. Figure 8 includes the uncertainty, linked to images that were corrupted or not acquired for any reason. We found that the volcano was unclouded 20.3-41.7% of the observed time; and during working hours, the volcano was unclouded 2.4-23.8% of the time. In other words, clear conditions for observation were found to be mostly at night. Thermal imaging depends on the radiation received by the thermal camera. The presence of clouds surrounding the volcano or the observation point impacts directly on the number of images captured, and consequently the number of explosions detected. Observation techniques such as seismicity or infrasound do not encounter this problem although they lack information about the external activity of the volcano (explosions, passive degassing, rock falls, pyroclastic currents, etc.). Unlike VIGIA, most video-and seismic-based monitoring systems count with a module for data processing at the receiving end (observatory), so data processing performed on-site remains minimal. Table 1 shows a comparison between VIGIA and generic seismicity-and video-based monitoring systems. Infrared thermal images with an adequate time stamp hence complement seismic and acoustic observational data to provide an integral description of external manifestations of volcanic activity as shown in Figure 9. For those explosions detected by thermal imaging, we can retrieve more information, such as the plume height, ascent rate, the volume of ejected material, and the size and dispersion direction of the plume [30,31,33,61]. Moving to a shorter time scale, data recorded as thermal video allows us to analyse and characterise individual explosions (cf. [62][63][64]). As an example, Figure 10 shows the comparison of the temperature of the material erupted in one of the explosions that occurred at Reventador volcano on 2022-01-16 with its corresponding seismic waveform recorded by the REVN seismic station, located~4 km from the current active vent.  . The portion of the day when the volcano is observable by thermal camera (day and night) is represented by stacked blue bars, while the "working" portion of the day (07h00 to 17h00, local time) when the volcano is observable is represented with orange bars. The uncertainty, in grey, depends on the quantity of images that are corrupted or the instrument did not acquire for any reason.  One second of thermal video file contains, in the case of VIGIA, 32 images of 640 × 480 pixels, which use 18.75 MB of disk space. This means that one hour of continuous thermal video takes up about 66 GB, and one day will use 1582 GB (1.5 TB). Continuous acquisition of high-resolution thermal video therefore makes little practical sense, especially considering periods where the view of the volcano is impeded by clouds, which, in the case of our study, was about 60% of the time. We therefore configured the system to trigger the recording of thermal videos only when an explosion is detected. The videos are 49 s in duration (four seconds before the trigger plus 45 s after it), which uses around one GB of storage space. During an average day, in terms of volcanic activity and cloud conditions, the system identified 46 explosions, recording 41 GB of thermal video data. Figure 10. Thermal data recorded as video allow the analysis of explosions on a short timescale. In this example from the Reventador volcano, frames (a) extracted from the thermal video show the surficial state of the volcano: (a1) before the plume appears over the crater; (a2) at the moment when the temperature measured was maximal; (a3) at the middle of the explosion; and (a4) at the end of the explosion. Panel (b) show the timeseries of the maximal temperature inside the region of interest located just above the crater rim (ROI at (a1)), which can be compared with the record from the REVN seismic station located~4 km from the active vent, ploted in panel (c).

Summary and Further Work
In the current state (to June 2022), the VIGIA system captures still images in infrared and visible spectrum, which can be used to perform long term studies, for example, studies of morphology changes (e.g., [65]) and of effusion of lava flows (e.g., [23]). The system automatically recognizes when the volcano is unclouded and when an explosion occurs, then it captures high-temporal resolution thermal videos of the explosion; the resulting videos constitute the input material for studies of explosion or plume dynamics (e.g., [66,67]). VIGIA also records information from temperature, pressure and relative humidity sensors. Daily, it chooses the image of the day and attaches it to the daily report to send it to the IGEPN.
The next stage includes the capability to automatically report dynamic parameters of the explosions, such as maximum plume height and ascent rate. The data provided by VIGIA are already being used as input for the analysis of the long-term explosive activity of the Reventador volcano, which is beyond the scope of this article.

Conclusions
We have presented VIGIA, a visible and thermal infrared observation system for active volcanoes that follows an edge computing approach whereby the station decides when to acquire high frequency data and transmits statistics and daily reports to the observatory while keeping energy consumption and data volume to a minimum. We have presented the results from the permanent deployment of such a station at the Reventador volcano showing that it successfully identifies adequate observational conditions and automatically triggers the recording of explosions at high resolution; explosions of which the nature and magnitude can be directly compared to seismic information. We have described the hardware and software components of the system extensively (all code scripts available at