Concise example notebook that trains a small CNN to classify 20×20 satellite image crops as Plane or NotPlane.
Satellite_Plane_Classification.ipynb— the primary notebook that prepares data, builds and trains the model, evaluates results, and savesplane_classifier_cnn.h5.- Dataset path expected by the notebook:
data/planesnet/planesnet(place the dataset here before running).
- Ensure you have Python 3.8+ installed.
- Install the core dependencies (recommended):
pip install numpy pandas tensorflow scikit-learn matplotlib seaborn pillow- Place the downloaded dataset under
data/planesnet/planesnetrelative to the repository root. - Open
Satellite_Plane_Classification.ipynbin Jupyter or VS Code and run the cells in order.
- Inspects and balances classes in the dataset (the notebook removes 10k random "NotPlane" images as part of balancing).
- Creates
TrainValidTestsplits and ImageDataGenerators. - Builds a small CNN (Conv2D layers with 32/64/128 filters, Dense 256) and trains for 20 epochs using class weights.
- Evaluates on a held-out test set, plots metrics and confusion matrix, and saves the trained model as
plane_classifier_cnn.h5.
- The notebook performs file operations (randomly deleting and moving images). Keep a backup of your original dataset if you need to preserve it.
- Images are resized to 20×20 prior to training — this is intentional in the example but may not suit all use cases.
- Add a
requirements.txtfor reproducible installs. - Extract the notebook into a script for non-interactive training runs.
If you'd like, I can also add a requirements.txt or convert the notebook into a runnable training script.