# The Application of Satellite Image Analysis in Oil Spill Detection
## 2 Materials and Methods
### Methodology Description
#### 2.2.3 Classification  
In order to create the classification, the Sentinel-2 image from \(31\) May \(2020\) (\(2\) days after the oil leak) was used. For the purposes of this study, the supervised SVM (support vector machine) classification was selected from Geomatica Banff software (version \(2018\) SP2), and the object-based SVM classifier was used in Python environment [44]. The support vector machine classifies the data by searching for a hyperplane that maximizes the margin between classes in the training data. The algorithm is named after a relatively small number of observations, called support vectors. The classification parameters of this study are mainly useful for high resolution data [45]. We decided to use Geomatica Banff software as it allows us to carry out such classification on lower resolution images. The first steps inthe workflow are to segment, calculate attributes, and import ground truth points for the initial image. Once that is done, the attributes fields are exported to a text file. Then, the training model is generated and SVM classification is run on that initial image. Figure 3 shows the basic workflow. The SVM classification approach, which is used by Geomatica Banff software, is called one against all. This approach generates \(n\) classifiers, where \(n\) is the number of classes. The output is the class that corresponds to the SVM with the largest margin. With multiclass, SVM has to interpret \(n\) hyperplanes. This requires \(n\) quadratic programming (QP) optimization problems, each of which separates one class from the remaining classes. Applying each classifier to the test-data vectors gives one vote to the winning class. The data are assigned to the class label of the class with the most votes. First, the hierarchical segmentation elements (step 1 of Figure 3) have been defined. The input layer is the initial image. As an output, segmentation data with parameters, i.e., scale parameters, is expected. In this study, we established set scale = 35 to create larger segments. The next step (step 2 of Figure 3) adds attributes of objects to the attribute of the vector layer. In this study, bands 2-5 from Sentinel-2 image were used, which are: Blue, Green, Red and Near-Infrared. Then, the statistical mean values were calculated: Mean_Blue, Mean_Green, Mean_Red, Mean_NIR. Moreover, we calculated geometric values which are: elongation, roundness, compactness, squareness, shape factor, convexity, solidity, main axis length, and minor axis length. Additionally, an NDVI index was calculated which helped to classify vegetation, meaning: the mean of the vegetation indices across all pixels contained within each object. All these values are assigned to the segmentation layer calculated in Step 1. The segmentation result is shown in Figure 4. Furthermore, training site collection information was obtained and imported into Step 3 for compilation. This information is used to conduct quantitative accuracy assessments after the evaluation program is started. The number of training and test fields is shown in Table 1. The last stage of the initial image processing is to export the obtained data to text files as variables of the Geomatica Banff (version 2019) software classifier. If two classes cannot be distinguished linearly in two-dimensional spaces, they might be separated in high-dimensional spaces (hyperplanes). The SVM classification uses the kernel function to map support vectors extracted from training data to higher dimensions. In this article, we have used the radial-basis function (RBF) kernel, respectively. Typically, it provides the best results. In Geomatica Banff software, it is recommended to normalize data so that each attribute can be treated equally to discriminate classes. Attributes are normalized by using linear scaling to produce a range from 0 to 1. The minimum value is mapped to zero and the maximum is mapped to one. All of the values in between are scaled linearly. Figure 3: Basic SVM classification workflow.