Bag of Features (BoF) Based Deep Learning Framework for Bleached Corals Detection

: Coral reefs are the sub-aqueous calcium carbonate structures collected by the invertebrates known as corals. The charm and beauty of coral reefs attract tourists, and they play a vital role in preserving biodiversity, ceasing coastal erosion, and promoting business trade. However, they are declining because of over-exploitation, damaging ﬁshery, marine pollution, and global climate changes. Also, coral reefs help treat human immune-deﬁciency virus (HIV), heart disease, and coastal erosion. The corals of Australia’s great barrier reef have started bleaching due to the ocean acidiﬁcation, and global warming, which is an alarming threat to the earth’s ecosystem. Many techniques have been developed to address such issues. However, each method has a limitation due to the low resolution of images, diverse weather conditions, etc. In this paper, we propose a bag of features (BoF) based approach that can detect and localize the bleached corals before the safety measures are applied. The dataset contains images of bleached and unbleached corals, and various kernels are used to support the vector machine so that extracted features can be classiﬁed. The accuracy of handcrafted descriptors and deep convolutional neural networks is analyzed and provided in detail with comparison to the current method. Various handcrafted descriptors like local binary pattern, a histogram of an oriented gradient, locally encoded transform feature histogram, gray level co-occurrence matrix, and completed joint scale local binary pattern are used for feature extraction. Speciﬁc deep convolutional neural networks such as AlexNet, GoogLeNet, VGG-19, ResNet-50, Inception v3, and CoralNet are being used for feature extraction. From experimental analysis and results, the proposed technique outperforms in comparison to the current state-of-the-art methods. The proposed technique achieves 99.08% accuracy with a classiﬁcation error of 0.92%. A novel bleached coral positioning algorithm is also proposed to locate bleached corals in the coral reef images.


Introduction
Coral reefs are one of the most important ecosystems on the planet because they help to maintain biodiversity and the life cycles of so many marine species. Many large-scale mass mortality incidents linked to coral bleaching have unfortunately been reported. Coral reefs have diverse intra-class variations in their color, shape, size, and texture. The color of the corals vary significantly due to light attenuation and light scattering phenomena. The coral reef has a vital role in preserving biodiversity, ceasing coastal erosion, and promoting the business trade. However, they are declining because of over-exploitation, damaging fishery, marine pollution, global climate change, and many more. Corals seem pale when they get bleached due to climate change. Coral bleaching is the leading cause of the decline in corals. Human activities on the earth have caused a tremendous increase in carbon dioxide concentration and ultimately lead to marine ecosystem devastation that mainly includes coral reefs [1][2][3][4].  Recently, the government of Australia has started a research program to protect the great barrier reef. Various methods have been adopted to detect bleached corals in the literature. In [5], they proposed a satellite bleaching hotspot remote sensing technique to monitor coral bleaching. However, this method is less efficient in anomalously high temperatures. In [6], they demonstrated the framework of using radar to monitor coral bleaching, which got a significant drawback of too much equipment to be utilized on the ocean surface and very expensive. In [7], they demonstrated the use of an airborne hyperspectral sensor to classify bleached corals. The airborne hyper-spectral sensor ranked only twenty-four points correctly out of thirty points and has a classification accuracy of 80%.
Similarly, in [8] hyper-spectral bottom index imagery is used for bottom-type classification in coral reef areas. The drawback of this technique is the need for an enormous number of samples in the dataset for achieving higher accuracy. In [9], they proposed a method of deep convolutional neural network VGG-19 for corresponding coral classification that needs a massive dataset for better accuracy.
Motivated by the marine ecosystem's protection, this manuscript proposes a deep learning influenced vision-based technique to detect and classify bleached and unbleached corals. The accuracy of various handcrafted descriptors and deep convolutional neural networks are compared. Various hand-crafted descriptors like Local Binary Pattern (LBP) [10], Histogram of Oriented Gradient (HOG) [11], Locally Encoded Transform Feature Histogram (LETRIST) [12], Gray Level Co-occurrence Matrix (GLCM) [13], Completed Joint scale Local Binary Pattern (CJLBP) [14], Local Tetra Pattern (LTrP) [15], Non-Redundant Local Binary Pattern (NRLBP) [16] are utilized for feature extraction. Deep convolutional neural networks including AlexNet [17], ResNet-50 [18], VGG-19 [19], GoogLeNet [20], Inception v3 [21] CoralNet are being used for the purpose of feature extraction. Support Vector Machine (SVM), decision tree and k-nearest neighbor (kNN) are used as a classifier in combination with the corresponding deep learning influenced vision-based technique. This manuscript's main contribution is the classification of the bleached and unbleached corals using visual vocabulary which is combination of spatial, texture, and color features, followed by SVM with a linear kernel.
The organization of the manuscript is carried out in the following manner. Section 2 describes the literature review and related work performed for the classification of the bleached and unbleached corals. Section 3 demonstrates the proposed methodology and provide detail information regarding feature extraction technique and classifiers. Section 4 examines the experimental results for various test cases which is followed by a conclusion section.

Related Work
For assessing the impact of disturbance on reefs and following subsequent recovery or decline, increasing awareness of the extent of risks facing coral reef ecosystems and monitoring operations has become crucial. Coral reefs have long been vital to the health of coastlines and tens of thousands of enterprises. Global warming, on the other hand, is becoming a serious threat to coral reefs. It has caused coral bleaching, in which stressed corals expel their symbiotic algae, potentially increasing the risk of coral morbidity and mortality. There is a serious need for more timely and cost-effective coral bleaching mapping.
Corals have distinct structures and colors. Image characteristics play a critical role in the classification of coral reefs. In [22], the normalized chromaticity coordinates (NCC) along with LBP are followed by a three-layer back-propagation neural network to detect the existence of bleached corals. This approach helps to organize five classes like coral with algae, dead coral, abiotic algae,and living coral. Nevertheless, this scheme is not successful for complex underwater images. In [23], they proposed a hybrid handcrafted and CNN model-based corals classification technique that has the capability to correctly classify healthy corals. The use of an airborne hyper-spectral sensor and other techniques are explained in [1]. The author has used this method to classify bleached corals. However, this approach gained the accuracy of 80% and was marked twenty-four points out of thirty points. Likewise, in [24], the authors have used the hyper-spectral bottom index imagery technique. This method helps in bottom-type classification in the coral reefs, but for achieving higher accuracy, this approach needs a huge number of samples present in the dataset. There is a direct relationship between the accuracy and samples, as the sample increases the accuracy increases and vice versa. In [9], another method is presented for the classification of coral reefs known as deep convolutional neural network VGG-19, but this method also requires an enormous dataset for higher accuracy. Also, in [25], the authors proposed a pseudo invariant features based technique for the detection of the bleached corals. The method achieves the maximum accuracy of 88.9%. In [26], a model to detect the scleractinian corals. The article also highlights the impact of micro-plastics on coral reefs. I. Conti-Jerpi et al. [3], performed a Bayesian analysis of carbon and nitrogen isotopes to find the overlap between corals. This articles suggests that the tropical corals can be used as resistance to the corals bleaching in coral building reefs.
Moreover, some authors have presented about the hyper-spectral imaging technology as well. In [27], they proposed a remote sensing-based technique that allows for the simultaneous examination of large reef areas in order to examine species composition and a sampling intensity of surveillance in order to assess temporal variations. In most images classification and recognition tasks, image representations generated from pre-trained deep networks outperformed handcrafted features [28]. These acquired representations are generalizable and transformable to other domains, such as underwater picture categorization.

Motivation and Contribution
After analyzing related work it is evident that there are some technique present in the literature but those techniques have limitations. In this article we propose a novel BoF based technique to locate bleached corals by using images captured by under water drones. Following are our contributions.

1.
We have created a novel custom CNN named as CoralNet for the classification of bleached and unbleached corals.

2.
We propose a novel Bag of Features (BoF) technique integrated with SVM to classify bleached and unbleached corals with high accuracy. BoF is a vector containing handcrafted features extracted with the help of HOG and LBP as well as spatial features extracted with AlexNet and CoralNet.

3.
We also propose a novel bleached corals positioning algorithm to locate the position of bleached corals.
In the upcoming section, the proposed BoF based technique is explained.

Proposed Framework
The proposed BoF based framework is presented in Figure 2. Test images are captured with underwater drones [29] then passed through the ground station for obtaining the output. The model is trained with 15k images of bleached and unbleached corals of the Great Barrier Coral Reef of Australia. The SVM classifier is employed to categorize the features extracted through D-CNN and handcrafted descriptors. The basic steps involved in the proposed methodology are visually represented in Figure 3. Initially, a patch is extracted from the coral reef image. In next step, the texture and color features are extracted with the help of handcrafted descriptors while the spatial features are extracted with the help of D-CNN models. These Bags of Features (BoF) are concatenated to form visual vocabulary (VV) vector which is provided as an input to the classifier.

Explanation of Steps
Initially, an image is taken with the help of an underwater drone. In the next step, the image is segmentized and divided into small patches. Features are extracted from each patch with the help of handcrafted descriptors and D-CNNs. A visual vocabulary (VV) is created, as shown in Figure 4, this visual vocabulary is the features extracted from these features, and the training features are passed to classifier i.e., SVM, which classifies whether the VV-features are of bleached coral or healthy coral. We used different handcrafted features as well as different D-CNN's but AlexNet shows the highest accuracy. We used different classifiers i.e., SVM, kNN, and decision tree, but SVM outperforms all other classifiers.

Feature Extraction
Handcrafted and spatial features are concatenated to obtained visual vocabularies (VV). The texture and color features are extracted with the help of handcrafted descriptors while spatial features are extracted with the D-CNN models.

Spatial Features
Features are extracted with handcrafted descriptors as well as D-CNN models. Initially, an image is captured with the help of underwater drones. Then the image is preprocessed and resized to the input size of D-CNN.

Pretrained D-CNN
In the case of AlexNet, the input image size is 227 × 227 × 3. AlexNet is an ImageNet with a total of twenty-five layers. There are five convolutional layers in AlexNet to extract the spatial features. The other layers involved in AlexNet architecture are fully connected layers, max-pooling layers, sigmoid layer, and ReLU layer. The feature vector is obtained at fully connected layer 7 (FC-7) of the AlexNet. Figure 5 illustrates the convolutional layers of AlexNet.

Custom D-CNN: CoralNet
We create a custom D-CNN named as CoralNet for the extraction of the spatial features. CoralNet has thirteen layers in which three layers are convolutional layers (Conv2D), two max-pooling (MaxPooling2D) layers, two dense layers, one flatten layer, three activation layers. The input layer size is kept at 227 × 227 × 3. Two activation layers have rectified linear unit (ReLU) as activation function while the last activation layer uses softmax as activation function. Features are extracted with Conv2D layers and the feature vector is extracted at the last layer. The training options used for training CoralNet are summarized in Table 1. The simplified architecture of the CoralNet is shown in Figure 6.

Handcrafted Features
The handcrafted features are extracted from the images using several handcrafted descriptors. The input images are preprocessed and local binary patterns, Gray Level Co-occurrence Matrix, histogram of oriented gradient, and several other texture features are extracted all these features are combined and a combined feature vector is created.

Bag of Features (BoF) and Visual Vocabulary (VV)
The spatial features and handcrafted features are concatenated and a single feature vector is created which is called bag of features (BoF). However, after applying K-means clustering the clustered BoF vector is called visual vocabulary (VV).

K-Means Clustering Algorithm
K-means clustering algorithm is applied to the selected features these features are color features, texture features, and spatial features. There are total eight clusters formed with the centroid is selected randomly at the start and updated with every iteration. The pseudo code of k-means clustering algorithm is given in Algorithm 1.

Validation of Clusters
For the validation and evaluation of clusters obtained from the k-means clustering algorithm we use Silhouette Analysis. Silhouette analysis gives degree of separation between clusters. The pseudo code for Silhouette Analysis is given in Algorithm 2.

Algorithm 1: k-means Clustering Algorithm.
Input: Features as data points Let features F = {F 1 , F 2 , F 2 , ..., F n } is set of data points and C = {C 1 , C 2 , C 3 , ..., C o } is set of centers. 1. Randomly select 'o' cluster centers. 2. Calculate the distance between feature and cluster centers. 3. Assign the feature to the cluster center whose distance from the cluster center is minimum of all the cluster centers. 4. Recalculate the new cluster center using:

Classifier
The classifier used is SVM [30][31][32][33]. It makes classification of the objects and samples by creating a hyperplane between the objects as depicted in Figure 7. To achieve higher accuracy the margin is kept high. A high margin gives better accuracy. There are three kernels of SVM. For binary classification linear kernel of SVM proves efficient while for multi-class classification Gaussian and polynomial kernel prove effective. The equations of these kernels are Equations (1)-(3), respectively.
Here ξ i and ξ j are used for calculating the dot products of both vectors, and are plotted in a space of order ρ.
where ξ i − ξ j provides the Euclidean distance between two samples. Width of Gaussian kernel can be set by variance that controls the classifier performance.

Confusion Matrix
It is the parameter to validate the performance of a machine learning model. It also tells us the accomplishment of the classification problem. Following are some of the essential parameters of the confusion matrix.

1.
True Positive (T P ): It is the accurate prediction of the bleached corals. Sensitivity (T PR ): It is the ratio of accurate prediction of the corals and can be given by Equation (4).
6. Specificity (S y ): It is the ratio of the prediction of unbleached corals and can be given by Equation (5).
7. Accuracy: The ratio of correct prediction to the total number of instances can be given by Equation (6).
8. F1-score: It is the weighted mean of sensitivity and specificity and can be given by Equation (7). 9.
Cohen's Kappa (κ): κ gives us the amount of data by the execution of classifier for the examination of the its performance in case of some coincidence. It can be calculated by Equation (8) [34].

Dataset
The datasets used for research contain images of corals of the Great Barrier Coral Reef of Australia. Most of the images are captured with underwater drone [22]. The model is trained with 60% of the images, 20% of the images are used for validation while testing is done on the remaining 20%. The first dataset can be publicly accessed at [35]. While the other two datasets Bleached and Unbleached corals and bleached, healthy, and dead (BHD) corals dataset can be publicly accessed at [36,37], respectively. We have used a publicly available dataset having nine different classes to test the generalized performance of the model. This dataset can be easily accessed at [38]. We created bleached and unbleached corals datasets to compare the performance of the model trained on the first dataset. We also created a BHD dataset for the classification of bleached, healthy, and dead corals. We also tested our model to classify Crustose Coralline Algae (CCA), Turf algae, Macroalgae, Sand, Acropora, Pavona, Montipora, Pocillopora, and Porites. These classes of corals and non-corals are explained in detail in [39]. Figure 8 shows samples of patches extracted from the pictures of the datasets. The datasets are preprocessed to avoid over-fitting.

Bleached Corals Positioning Algorithm
We propose a novel BoF and VV based algorithm to locate the positions of bleached corals in the full picture captured by underwater drones. In this algorithm, the input image is divided into segments to create the scale of the input image pyramid. From this pyramid a patch with more than 50% is extracted. This patch acts as an input to the handcrafted as well as D-CNN models. The handcrafted and D-CNN features of this local patch are combined to create BoF vector. This BoF vector is passed through kmeans clustering to create VV vector which is given as an input to the SVM classifier. If the output of SVM is bleached corals. Then coordinates of local patch are extracted along with it's corresponding pyramid scale. At the end, using coordinates a boundary box around bleached corals is drawn for the positioning of bleached corals. The pseudo code of algorithm is described in Algorithm 3 whereas the graphical illustration of the algorithm is shown in Figure 9.  In the next section, experimental results are presented.

Experimental Results
Handcrafted descriptors and D-CNN models are utilized for features extraction, while SVM is used as a corresponding classifier. Tables 2-4 show the classification of the highest accuracy, specificity, sensitivity, F1-score, and Cohen's kappa of SVM kernels of each handcrafted descriptor and deep convolutional neural network (D-CNN) for first, second and third dataset, respectively. Whereas Figure 10 shows the performance of the different classifiers when applied on all three datasets. The performance of SVM is compared with kNN, decision tree, and random forest. It is clear that SVM performs better than kNN, decision tree, and random forest. Figure 11, shows the confusion matrices of the proposed method for first and third dataset. The performance of the model is also efficient for the multi-class classification problem. Moreover, the dataset gives identical results when applied to the other binary classification dataset as well. The model is trained one dataset and gives better performance on other dataset as well.   Experimental results show that bag of features (BoF) with a Linear kernel of SVM gives the highest accuracy compared to other combinations as arranged in Tables 2 and 3. The linear kernel's highest accuracy is achieved due to the classification between bleached and corresponding unbleached corals. The problem is binary and can be efficiently separated by a linear line or hyperplane. For binary type, the SVM classifier's linear kernel is more suitable to give better results than Gaussian and polynomial kernel. Gaussian and polynomial kernel demonstrates efficient results in the case of a multi-class scenario. Table 4 shows that the proposed model also gives the highest accuracy when applied to the multi-class dataset. The results show that the recall and precision of proposed method are also more significant than the rest of the state-of-art methods. The output results obtained via positioning algorithm are shown in Figure 12.

Generalized Performance of BoF Model on Moorea Corals Dataset
We trained the model using first dataset [35]. While for generalized testing of the model we have used Moorea Corals dataset [38]. There are nine classes in this dataset four of these classes are non-corals while the remaining five classes are corals. The experimental results obtained on this dataset using conventional handcrafted techniques, pre-trained D-CNN models, and BoF based models are explained in Table 5. The proposed model achieves an accuracy of 98% for this dataset and we can say that the generalized performance of the proposed model is better than other techniques.

Bleached Corals Localization
Various bleached corals are localized via proposed algorithm. The proposed algorithm has the advantage of low execution time which is just 1ms as well as it can be implemented without GPU. The system which used for experimentation is HP core i7 with each processor of 2.6 GHz, 7th generation, and 8 GB RAM. In the next section, a brief conclusion of all the work is presented.

Conclusions
The coral reefs play a vital role in preserving biodiversity, ceasing coastal erosion, and promoting business trade. Ultimately, it enhances the beauty due to its fascinating colors and shape. Coral reefs are also sheltered for many marine animals. The great barrier coral reef of Australia is one of the most beautiful among them in the world. Unfortunately, many large-scale mass mortality events associated with coral bleaching have been documented due to a variety of anthropogenic and environmental influences. This paper proposed a novel technique to resolve this problem by efficiently classifying bleached and unbleached corals. Experimental results demonstrate that bag of features (BoF) with Linear kernel of SVM classifier gives the highest accuracy of 99.08% for binary classification and 98.11% for the multi-class classification and has high precision and recall. The classification of the highest accuracy, specificity, and sensitivity of SVM kernels of each handcrafted descriptor and deep convolutional neural network is also provided and tabulated. The F1 score of the different state of the art techniques are compared and the superiority of BoF over other methods is highlighted.