This project implements a Convolutional Neural Network (CNN) model to detect the presence of solar panels in satellite images. The model is trained on labeled image data and aims to classify images as either containing solar panels or not.
The rapid growth in solar energy adoption has increased the need for automated methods to identify solar panel installations. This project addresses this challenge by leveraging deep learning to classify satellite images. The CNN model is trained on a dataset of images labeled as either containing solar panels or not.
The dataset consists of satellite images with corresponding labels indicating the presence or absence of solar panels. The data is divided into training and validation sets, and the images are processed to a uniform size of 101x101x3.
The CNN model consists of the following layers:
•Convolutional layers with ReLU activation and Batch Normalization
•MaxPooling layers to downsample feature maps
•Global MaxPooling before the output layer
•Dense output layer with a sigmoid activation function
_________________________________________________________________
Layer (type) Output Shape Param #
=================================================================
conv2d (Conv2D) (None, 99, 99, 32) 896
batch_normalization (BatchNormalization) (None, 99, 99, 32) 128
conv2d_1 (Conv2D) (None, 97, 97, 64) 18496
...
global_max_pooling2d (GlobalMaxPooling2D) (None, 128) 0
dense (Dense) (None, 1) 129
=================================================================
Total params: 391105
Trainable params: 389889
Non-trainable params: 1216
The model is trained using binary cross-entropy loss and the Adam optimizer. Stratified K-Fold cross-validation is employed to assess the model's performance across different splits of the dataset.
During training, class weights are applied to handle the imbalance in the dataset (with more images not containing solar panels than those that do).
The model achieves high accuracy and demonstrates strong performance across various metrics.
The following images illustrate examples of true positives, true negatives, false positives, and false negatives:
•True Positives: Images correctly classified as containing solar panels.
•False Positives: Images incorrectly classified as containing solar panels.
•True Negatives: Images correctly classified as not containing solar panels.
•False Negatives: Images incorrectly classified as not containing solar panels.
Clone the project
git clone https://github.com/diaz3z/Solar-Panel-Detection.git
Go to the project directory
cd Solar-Panel-DetectionInstall the required libraries:
pip install tensorflow
pip install torch torchvision
pip install keras
pip install pandas
pip install opencv-python
pip install numpy
pip install matplotlib
pip install scikit-learn
pip install seaborn
pip install albumentations
pip install glob2
pip install tqdm
pip install pillow
Run the training notebook:
This project is licensed under the MIT License - see the LICENSE file for details.
