Solar Photovoltaic in Aerial Imagery
Skills Employed
- Modelling Techniques: Classification Models - LightGBM, EfficientNet-B4 under AdvProp Training Scheme
- Cross Validation Techniques: K-fold cross validation
- Image Processing Techniques: Entropy Calculation, Edge-detection, Grayscale conversion (using Luminance), Histogram of Oriented Gradient (HOG) descriptor
- Tech Stack: Python
- Libraries: Numpy, Pandas, Skimage, Sklearn, LightGBM, Tensorflow (Keras)
Github Link
The Github repository can be accessed from here.
Introduction
In this project, we consider the problem of using advanced machine learning algorithms, in particular gradient boosting machines and convolutional neural networks (CNN), for the identification of solar panels in aerial images. Our objective is to classify images of buildings and streets that are fed to our algorithms as either containing or not containing solar panels and to, thereby, compare the efficiency of these models for the task of image classification. We consider aerial images restricted to a size of 101x101 pixels with 3 color channels, containing either one or more solar panels each of varying sizes and shapes. Such an approach to identifying solar panels in aerial images can have important applications in a variety of sectors, preeminent among which is its potential to help estimate the scale prevalence of solar power consumption in the US. The key benefit of our approach of using machine learning with regards to estimating solar power prevalence is that the process of labeling images via our algorithms is entirely automated making our approach highly scalable. Without the use of image data, the goal of estimating solar power usage in the US would be incredibly challenging as it would be immensely costly and time consuming. Even with image data, without the use of an algorithm such as ours, the task of identifying solar panels and quantifying their scale would be immensely arduous. As such, machine learning models present a powerful solution to the challenge of identifying solar panels and it is similarly important to determine what algorithms are most successful in this classification exercise. In this report, we compare the performance of the two aforementioned machine learning models for this problem and find that convolutional neural networks clearly outperform the gradient boosting machine, which is perhaps the most powerful of the non-neural network based models. In particular, we make use of the state of the art EfficientNet-B4 with adversarial propagation to achieve near perfect out-of-sample generalization performance on our aerial images.
Data
Our data for this project is comprised of two samples, which we designate as the training and test sets. Our images were stored in the TIFF format. The training dataset has 1500 images. As the test dataset does not have available labels, the models we build either use 10-fold cross validation or create a validation set from the training dataset to assess out-of-sample performance. The training dataset comprises of 505 (33.7%) images having solar panels and the remaining having no solar panels.
Methodology
In this project, we employed 2 different models. A detailed process flow of each model has been stated below.
Light Gradient Boosting Machine Classifier
LightGBM is an ensemble model of decision trees which are trained sequentially on the residual errors of previous iterations[3].
LightGBM uses histogram-based split finding, which converts continuous features into discrete bins leading
to more efficient tree splits, and it further reduces the algorithmic complexity by down-sampling data and
features using Gradient Based One Side Sampling and Exclusive Feature Bundling. It can thus outperform
other tree-based ensemble models like Extreme Gradient Boosting in terms of computational speed and
memory requirements even for large datasets. Since, the feature space in this case is high-dimensional, an
optimized algorithm like LightGBM is a sensible choice.
EfficientNet-B4 under AdvProp Training Scheme
We use EfficientNet-B4 (containing 19 million tunable parameters) under the AdvProp training scheme with pre-trained weights on ImageNet as our model and fine-tune it via training on our aerial images.
Results
The image below compares the ROC curve from both the models.
We find that EfficientNet-B4 consistently performs better than LightGBM both in terms of AUC and confidence
scores for the class assignments. We note that EfficientNet-B4 has superior performance in comparison to
LightGBM as a result of its ability to capture the spatial relationships in the images, which LightGBM
struggles with. To improve the performance of LightGBM, we implement the HOG feature descriptor, which
yields notable improvements due to dimensionality reduction and feature importance concentration. However,
the performance of LightGBM was still inferior in comparison to EfficientNet-B4. This might be attributed
to the fact that HOG is sensitive to the scale and orientation of images. As EfficientNet-B4 is trained with
rotated images, it becomes rotation invariant and yields more robust predictions.
Impact
This project was executed as a part of our coursework at Duke Univeristy for the Machine Learning Course. It was a part of an in-class Kaggle competition. This approach got us the first rank in the competition on the basis of the recall score.
References
The following papers and literature were referred to, for execution and solution approach design.
- Guolin Ke et al (2017) LightGBM: A Highly Efficient Gradient Boosting Decision Tree
- JM Malof et al (2016) Automatic detection of solar photovoltaic arrays in high resolution aerial imagery.
- M Tan et al (2019) EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks