Skip to content

jiyajahnavi/Satelite-Image-Classification

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Satellite Image Classification

A machine learning system that classifies satellite images into three categories and prepares them for transmission:

  • Horizon Detection
  • Image Quality Evaluation
  • Flare (sunburn) Detection
  • Compression

The system provides individual detectors for each feature as well as a unified pipeline combining all three detectors.


Project Structure

SATELLITE IMAGE CLASSIFICATION/
│
├── results/
│   └── visualizations/
│       ├── flare_visualizations/
│       │   ├── flare_detector_accuracy.png
│       │   ├── flare_detector_loss.png
│       │   ├── flare_detector_test_results.txt
│       │   ├── flare_visualizations_grid.png
│       │   └── flare.png
│       │
│       ├── horizon/
│       │   ├── horizon_detector_test_results.txt
│       │   ├── horizon_detector_training_history.png
│       │   ├── horizon_vis_0.png
│       │   ├── horizon_vis_1.png
│       │   ├── horizon_vis_2.png
│       │   ├── horizon_vis_3.png
│       │   ├── horizon_vis_4.png
│       │   ├── horizon_vis_5.png
│       │   ├── horizon_vis_6.png
│       │   ├── horizon_vis_7.png
│       │   ├── horizon_vis_8.png
│       │   ├── horizon_vis_9.png
│       │   ├── horizon_vis_10.png
│       │   ├── horizon_vis_11.png
│       │   ├── horizon_vis_12.png
│       │   ├── horizon_vis_13.png
│       │   ├── horizon_vis_14.png
│       │   ├── horizon_vis_15.png
│       │   ├── horizon_vis_16.png
│       │   ├── horizon_visualizations_grid.png
│       │   ├── horizon.png
│       │   ├── no-flare.png
│       │   └── no-horizon.png
│       │
│       ├── quality_visualizations/
│       │   ├── quality_1_Bad_Bad_Correct.png
│       │   ├── quality_1_Good_Bad_Incorrect.png
│       │   ├── quality_2_Bad_Bad_Correct.png
│       │   ├── quality_2_Good_Bad_Incorrect.png
│       │   ├── quality_3_Bad_Bad_Correct.png
│       │   ├── quality_4_Bad_Bad_Correct.png
│       │   ├── quality_5_Bad_Bad_Correct.png
│       │   ├── quality_6_Bad_Bad_Correct.png
│       │   ├── quality_7_Bad_Bad_Correct.png
│       │   ├── quality_8_Bad_Bad_Correct.png
│       │   ├── quality_9_Bad_Bad_Correct.png
│       │   ├── quality_10_Bad_Bad_Correct.png
│       │   ├── quality_detector_test_results.txt
│       │   ├── quality_detector_training_history.png
│       │   ├── quality-bad.png
│       │   └── quality-good.png
│       │
│       ├── final-result1.jpg
│       ├── final-result2.jpg
│       ├── final-result3.jpg
│       ├── final-result4.jpg
│       ├── final-result5.jpg
│       ├── final-result6.jpg
│       ├── final-result7.jpg
│       ├── final-result8.jpg
│       ├── final-result9.jpg
│       ├── final-result10.jpg
│       ├── final-result11.jpg
│       ├── final-result12.jpg
│       ├── final-result13.jpg
│       ├── final-result14.jpg
│       └──final-result15.jpg
│
├── src/
│   ├── compression/
│   │   └── compress.py
│   │
│   ├── data/
│   │   ├── dataset.py
│   │   └── preprocess.py
│   │
│   ├── detection/
│   │   ├── flare_evaluation.py
│   │   ├── horizon_evaluation.py
│   │   └── quality_evaluation.py
│   │
│   ├── models/
│   │   ├── flare_detector.py
│   │   ├── horizon_detector.py
│   │   ├── predict.py
│   │   ├── quality_detector.py
│   │   ├── train_flare_detector.py
│   │   ├── train_horizon_detector.py
│   │   ├── train_quality_detector.py
│   │   └── unified_classifier.py
│   │
│   └── utils/
│       └── common.py
│
├── .gitignore
├── img.jpg
├── README.md
├── requirements.txt
└── test_commands.txt

🔄 Data Preprocessing

The preprocessing pipeline prepares the raw satellite images for training by:

  • Resizing images to 224x224 or 256x256
  • Splitting into train/validation/test sets
  • Applying data augmentation (rotation, flips, brightness/contrast)

Command:

python src/data/preprocess.py

🧠 Model Training

The system consists of three binary classification models:

  1. Horizon Detection Model – Detects horizon in images
  2. Flare Detection Model – Detects sun flares or glare
  3. Image Quality Detection Model – Classifies images as good or bad

Training Commands:

python src/models/train_horizon_detector.py --batch_size 32 --img_size 224 --num_epochs 20 --learning_rate 0.001
python src/models/train_flare_detector.py --batch_size 32 --img_size 224 --num_epochs 20 --learning_rate 0.001
python src/models/train_quality_detector.py --batch_size 32 --img_size 224 --num_epochs 20 --learning_rate 0.001

📊 Evaluation and Visualization

Individual Detector Evaluation:

python -m src.detection.horizon_evaluation --image_path path/to/image.jpg --show
python -m src.detection.flare_evaluation --image_path path/to/image.jpg --show
python -m src.detection.quality_evaluation --image_path path/to/image.jpg --show

Each module:

  • Loads the detector model
  • Classifies input images
  • Provides confidence scores
  • Generates visualization (original + prediction) with color-coded indicators

🔄 Unified Pipeline

python -m src.models.unified_classifier --image_path path/to/image.jpg --visualize --save_viz results/output.jpg
  • Processes input images through all three detectors
  • Compresses good-quality images to ≤100KB
  • Generates visualization and JSON output with confidence scores

📉 Image Compression

Images classified as good quality are compressed using a standalone module:

python -m src.compression.compress --input path/to/image.jpg --target_size 100
  • Adaptive quality reduction to meet target size
  • Falls back to resizing if needed
  • Optimized JPEG compression

🔍 Example Output

{
  "horizon": true,
  "horizon_confidence": 0.9568,
  "flare": false,
  "flare_confidence": 0.9999,
  "quality": "good",
  "quality_confidence": 0.9245,
  "compressed": {
    "path": "results/compressed_image.jpg",
    "compressed_size_kb": 83.45
  }
}

🧰 Tech Stack

  • Python
  • Scikit-learn
  • OpenCV
  • NumPy, Pandas
  • Matplotlib

📄 License

This project is licensed under the MIT License.

About

Developed a machine learning system to classify satellite images into horizon, flare, and quality categories.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages