A comprehensive Python package for integrating Google Earth Engine (GEE) with Deep Learning for advanced Earth observation analysis.
- π Easy GEE Authentication: Simple authentication and initialization
- π₯ Data Download: Direct download using geemap
- π Spectral Indices: Calculate NDVI, EVI, NDWI, NDBI, NBR, and more
- π§ Deep Learning Models: Pre-built classifiers for land cover classification
- πΊοΈ Change Detection: Temporal analysis and change detection
- π Visualization: Built-in plotting and mapping functions
- π― Multiple Use Cases: Land cover, crop monitoring, disaster response
pip install deepgeepip install deepgee[tensorflow]git clone https://github.com/your-repo/deepgee.git
cd deepgee
pip install -e .[dev]import deepgee
# Authenticate (first time only)
deepgee.authenticate_gee()
# Initialize with your project
deepgee.initialize_gee(project='your-project-id')from deepgee import GEEDataDownloader
# Create downloader
downloader = GEEDataDownloader()
# Define region of interest
roi = [85.0, 20.0, 87.0, 22.0] # [lon_min, lat_min, lon_max, lat_max]
# Create composite
composite = downloader.create_composite(
roi=roi,
start_date='2023-01-01',
end_date='2023-12-31',
sensor='landsat8',
add_indices=True,
add_elevation=True
)
# Download to local file
downloader.download_image(
composite,
output_path='composite.tif',
roi=roi,
scale=30
)from deepgee import LandCoverClassifier
import pandas as pd
# Load training data
samples = pd.read_csv('training_samples.csv')
X = samples[feature_columns].values
y = samples['class'].values
# Create classifier
classifier = LandCoverClassifier(n_classes=9, architecture='dense')
# Build model
classifier.build_model(input_shape=(14,))
# Prepare data
X_train, X_test, y_train, y_test = classifier.prepare_data(X, y)
# Train
history = classifier.train(X_train, y_train, epochs=50)
# Evaluate
results = classifier.evaluate(X_test, y_test, class_names=class_names)
print(f"Accuracy: {results['accuracy']:.4f}")from deepgee import load_geotiff, save_geotiff
# Load image
image, meta = load_geotiff('composite.tif')
# Reshape for prediction
n_bands, height, width = image.shape
image_reshaped = image.reshape(n_bands, -1).T
# Predict
predictions = classifier.predict(image_reshaped)
classified = predictions.reshape(height, width)
# Save result
save_geotiff(classified, 'classified.tif', meta, nodata=255)See the examples/ directory for complete workflows:
- Land Cover Classification:
examples/land_cover_classification.py - Change Detection:
examples/change_detection.py - Crop Monitoring:
examples/crop_monitoring.py - Disaster Assessment:
examples/disaster_assessment.py
import deepgee
# Authenticate
deepgee.authenticate_gee()
# Initialize
deepgee.initialize_gee(project='your-project-id')
# Check status
status = deepgee.auth.check_gee_status()from deepgee import GEEDataDownloader, SpectralIndices
downloader = GEEDataDownloader()
# Create composite
composite = downloader.create_composite(roi, '2023-01-01', '2023-12-31')
# Add spectral indices
composite = SpectralIndices.add_all_indices(composite, sensor='landsat8')
# Download
downloader.download_image(composite, 'output.tif', roi=roi)from deepgee import LandCoverClassifier, ChangeDetector
# Land cover classification
classifier = LandCoverClassifier(n_classes=9)
classifier.build_model(input_shape=(14,))
classifier.train(X_train, y_train)
# Change detection
detector = ChangeDetector(method='difference')
changes = detector.detect_changes(image1, image2, threshold=0.2)from deepgee import (
load_geotiff, save_geotiff, calculate_area_stats,
plot_confusion_matrix, plot_classification_map
)
# Load/save data
image, meta = load_geotiff('input.tif')
save_geotiff(output, 'output.tif', meta)
# Calculate statistics
stats = calculate_area_stats(classified, class_names, pixel_size=30)
# Visualize
plot_classification_map(classified, class_names, class_colors)Full documentation available at: https://deepgee.readthedocs.io/
Classify satellite imagery into multiple land cover types using deep learning.
Monitor crop health and predict yields using time series analysis.
Detect changes in land cover over time for deforestation, urbanization, etc.
Rapid assessment of flood extent, fire damage, or other disasters.
Extract building footprints and monitor urban growth.
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
This project is licensed under the MIT License - see LICENSE file for details.
- Google Earth Engine team for the amazing platform
- geemap developers for the excellent Python package
- TensorFlow/Keras teams for deep learning frameworks
- Issues: GitHub Issues
- Email: pulakesh.mid@gmail.com>
- Documentation: ReadTheDocs
If you use DeepGEE in your research, please cite:
@software{deepgee2024,
title={DeepGEE: Earth Observation with Google Earth Engine and Deep Learning},
author={Pulakesh Pradhan},
year={2024},
url={https://github.com/pulakeshpradhan/deepgee}
}Made with β€οΈ for the Earth Observation community
