# A Deep Convolutional Neural Network for Detecting Volcanic Thermal Anomalies from Satellite Images
## 3 Method
### Three-Step Approach  
We propose a satellite thermal monitoring system to automatically detect high-temperature anomalies related to active flows or erupting vents. The monitoring system, based on a deep CNN, can be divided into three steps (Figure 2). The first one builds a balanced volcanic dataset composed of 200 images with high spatial resolution acquired by Landsat 8 and Sentinel-2 in the NIR and SWIR bands, covering the investigated volcanoes. The second step uses the volcanic dataset to re-train the SqueezeNet model applying the transfer learning approach, while the third one combines the different SqueezeNet trained with the Transfer Learning approach, obtaining an Ensemble Classifier, that ingests new NIR and SWIR images as they are available to detect if volcanic thermal anomalies are present. These three steps are described in more detail below. Firstly, we built the volcanic dataset, sampling 135 images from the Sentinel-2 satellite and 65 images from the Landsat 8 satellite, balancing about the same number of images from each sensor between class 1 and class 0. Thus, a total of 100 images are related to the class with volcanic thermal anomalies and a total of 100 images to the class without anomalies. CNNs require balanced training datasets of images to effectively differentiate into two classes by the presence or absence of volcanic thermal anomalies. We named the first class \"Yes Anomaly\", with class ID 1, and the second one \"No Anomaly\", with class ID 0. Images with lava flows and active vents belong to the first class, images with volcanoes at rest to the second one. Every image was assigned to the correct class by carefully analyzing the eruptive activity of each volcano both using the volcanological bulletins (e.g., from Smithsonian Institution, Global Volcanisn Program, available online: [[https://volcano.si.edu/](https://volcano.si.edu/)]([https://volcano.si.edu/](https://volcano.si.edu/)), or from INGV National Institute of Geophysics and Volcanology, available online: [[https://www.ct.ingv.it/](https://www.ct.ingv.it/)]([https://www.ct.ingv.it/](https://www.ct.ingv.it/))) and manually inspecting the scenes. In the same way, we define the \"ground truth\" labels (i.e., the real labels of the scenes) either examining the volcanological bulletins or manually inspecting the scenes. For representativity of the dataset, we choose images for class 0 with different characteristics, e.g., presence of clouds, snows, sea in the scene, or building areas. We have obtained a final balanced dataset composed of 200 images belonging to the 9 different volcanoes investigated (Cumbre Vieja, Etna, Pico do Fogo, Fuego, Geldingadalir, Kflavuea, Klyuchevskaya, Pacaya and Stromboli), with images acquired during the years 2013-2022 (see Table 1). In the pre-processing phase, we convert the TOA images to the.png format (in the 0-255 scale) to feed the SqueezeNet model. Figure 3 shows an example of images sampled from different volcanoes, belonging to class ID 1 and to class ID 0. The complete dataset used for the Transfer Learning approach is available at the link: [[https://zenodo.org/record/794434#ZSGp8](https://zenodo.org/record/794434#ZSGp8) HZBy5c]([https://zenodo.org/record/794434#ZSGp8](https://zenodo.org/record/794434#ZSGp8) HZBy5c), with the doi: 10.5281/zenodo.7944343. Subsequently, we used the SqueezeNet model (from the SqueezeNet 1.0 model website), pretrained with the ImageNet dataset, in Google Colab with the PyTorch library [54], and we readjusted this model for the detection of thermally anomalous pixels, setting two final classes for the classification. The volcanic dataset was randomly divided into three independent subsets: a train set, a validation set and a test set. The train set is used, in general, to train the model, the second one to validate the results in the train phase and to fit the hyperparameters. The last set is used to test the model with images not seen in the training phase and to calculate the predictive performances of the model.