This repository contains code for building a deep learning model to classify satellite images into different categories such as Cloudy, Desert, Green Area, and Water.
The model is designed to take satellite images as input and predict the category of the image, providing insights into the type of terrain or environment captured in the satellite data.
-
Data Preparation:
- The data can be obtained from Kaggle, where it's organized into folders representing different categories (e.g., Cloudy, Desert, Green Area, Water).
- Image paths and labels are extracted from the folder structure and saved into a CSV file for easier handling.
-
Data Preprocessing:
- Images are resized and preprocessed using techniques like rescaling, shear, zoom, flip, and rotation to enhance the model's ability to generalize.
-
Model Architecture:
- A deep learning model is built using Convolutional Neural Networks (CNNs) for feature extraction.
- The model architecture includes multiple Conv2D layers with activation functions like ReLU, MaxPooling layers for spatial downsampling, a Flatten layer to convert the 2D feature maps into a 1D vector, and Dense layers for classification.
- Dropout is used to prevent overfitting by randomly disabling neurons during training.
-
Training and Evaluation:
- The model is trained using the prepared dataset with a specified number of epochs.
- Training and validation metrics such as loss and accuracy are monitored and visualized using matplotlib.
-
Model Deployment:
- After training, the model is saved as a
.h5
file for future use.
- After training, the model is saved as a
-
Prediction:
- The trained model is used to make predictions on new satellite images.
- Users can change the image path in
run_model.py
to any satellite image of their choice, as long as it is the right size (255x255 pixels).
- Python Libraries: pandas, os, numpy, sklearn, keras, PIL, matplotlib, tkinter
- Data Augmentation: ImageDataGenerator for generating augmented images during training.
- Model Building: Sequential model with Conv2D, MaxPooling2D, Flatten, Dense, and Dropout layers.
- Model Evaluation: Metrics such as accuracy and loss are used to evaluate model performance.
- Visualization: Matplotlib is used to visualize training and validation metrics.
- Clone the repository to your local machine.
- Install the required libraries.
- Obtain the dataset from Kaggle and organize it into folders as per the provided structure.
- Run
create_model.py
to train the model and save it asModel.h5
. - Use
run_model.py
to load the trained model and make predictions on new satellite images by changing the image path to your desired satellite image of the right size (255x255 pixels).