The Congo Basin is home to the world’s second-largest tropical rainforest, spanning 2.5 million square kilometers over six countries. It is also the world’s last tropical carbon sink and the home of over 1,000 threatened species. This project aims to address deforestation, biodiversity loss, and carbon emissions in the Congo Basin rainforest by providing actionable insights to local communities, civil society, and decision-makers.
- Project Organization
- Project Goals and Objectives
- Data Sources
- Data Labelling Strategy
- Data Preprocessing
- Model Selection Criteria
- Modeling Methodology
- Model Evaluation
- Model Deployment
- Dashboard User Interface (UI) Guidelines
- Ethical Considerations
- Conclusion
- Appendix
Detailed Table of contents
- Project Organization
- Project Goals and Objectives
- Data Sources
- Data Labelling Strategy
- Data Preprocessing
- Model Selection Criteria
- Modeling Methodology
- Model Evaluation
- Model Deployment
- Dashboard User Interface (UI) Guidelines
- Ethical Considerations
- Conclusion
- Appendix
├── LICENSE
├── Makefile <- Makefile with commands like `make data` or `make train`
├── README.md <- The top-level README for developers using this project.
├── data
│ ├── external <- Data from third party sources.
│ ├── interim <- Intermediate data that has been transformed.
│ ├── processed <- The final, canonical data sets for modeling.
│ └── raw <- The original, immutable data dump.
│
├── docs <- A default Sphinx project; see sphinx-doc.org for details
│
├── models <- Trained and serialized models, model predictions, or model summaries
│
├── notebooks <- Jupyter notebooks. Naming convention is a number (for ordering),
│ the creator's initials, and a short `-` delimited description, e.g.
│ `1.0-jqp-initial-data-exploration`.
│
├── references <- Data dictionaries, manuals, and all other explanatory materials.
│
├── reports <- Generated analysis as HTML, PDF, LaTeX, etc.
│ └── figures <- Generated graphics and figures to be used in reporting
│
├── requirements.txt <- The requirements file for reproducing the analysis environment, e.g.
│ generated with `pip freeze > requirements.txt`
│
├── setup.py <- makes project pip installable (pip install -e .) so src can be imported
├── src <- Source code for use in this project.
│ ├── __init__.py <- Makes src a Python module
│ │
│ ├── data <- Scripts to download or generate data
│ │ └── make_dataset.py
│ │
│ ├── features <- Scripts to turn raw data into features for modeling
│ │ └── build_features.py
│ │
│ ├── models <- Scripts to train models and then use trained models to make
│ │ │ predictions
│ │ ├── predict_model.py
│ │ └── train_model.py
│ │
│ └── visualization <- Scripts to create exploratory and results oriented visualizations
│ └── visualize.py
│
└── tox.ini <- tox file with settings for running tox; see tox.readthedocs.io
The primary goal of the project is to enhance CanopyWatch to accurately detect and classify deforestation activities in the Congo Basin rainforest using satellite imagery and machine learning algorithms. The classifications will include different types of deforestation such as logging, slash-and-burn, and industrial agriculture.
-
Improve Precision & Recall for Logging and Slash-and-Burn Detection
- Enhance the existing core machine learning algorithms to achieve higher precision and recall in detecting logging and slash-and-burn deforestation.
-
Expand Deforestation Types (>80% Precision and Recall)
- Extend the detection capabilities to include additional deforestation types, prioritized in the following order: industrial agriculture, mining, and/or habitations. Aim for precision and recall rates exceeding 80%.
-
Optimize Cloud-Free Optical Imagery Retrieval
- Evaluate and enhance the algorithms responsible for acquiring cloud-free optical band imagery from Sentinel-2. Please make sure that you have access to high-quality images for analysis.
-
Enhance Cloud-Free Image Assembly Process
- Evaluate and potentially improve the process of assembling cloud-free maps. Optimize the workflow for efficiency and accuracy in generating coherent imagery.
-
Increase Frequency of Image Retrievals (Annual Basis)
- Enhance the frequency of complete Area of Interest image pulls, ideally on an annual basis from the initiation of the Sentinel-2 service in 2016.
-
Automate Imagery Processing Pipeline
- Develop a pipeline to automate the process of regular imagery pulls and assembly of cloud-free images. Aim for seamless and scheduled updates.
-
Recommend New Front-End Display Service
- Propose and recommend a new front-end display service that optimizes the user interface and interaction for effective exploration of deforestation data.
-
Enhance Final Accuracy through Post-Processing
- Implement post-processing workflows to enhance the final accuracy of the detection system. Focus on eliminating false positives by omitting 'orphan' chips without contiguous/near neighbors.
-
Leverage Open Street Map Metadata
- Utilize Open Street Map metadata to distinguish commercial roads from logging roads and exclude commercial roads from prediction results, improving result accuracy.
-
Automate Inference and Future Imagery Display
- Develop a pipeline to automate the inference and display of future imagery pulls, facilitating real-time insights and updates for end-users.
-
Integrate SAR Imagery (Sentinel-1)
- Integrate SAR (Synthetic Aperture Radar) imagery from Sentinel-1 to augment the array of optical band imagery (RGB, NIR, NDVI) from Sentinel-2. Leverage multiple imaging modalities for enhanced detection accuracy.
-
Sentinel 1 (SAR - Synthetic Aperture Radar)
- Capabilities:
- All-weather, day-and-night radar imaging.
- Detection of changes in forest structure, including logging activities, even under cloud cover.
- Applications:
- Logging Detection: Effective monitoring of deforestation and logging due to all-weather imaging.
- Capabilities:
-
Sentinel 2 Indices
- Capabilities:
- Multispectral imaging.
- Applications:
- Slash-and-Burn Detection: Detecting burned areas and regrowth through multispectral data.
- Industrial Agriculture: Distinguishing crop types and growth stages.
- Capabilities:
-
Planet NICFI Satellite Data
- Capabilities:
- High-resolution imagery (3 meters).
- Frequent revisit times.
- Applications:
- Logging Detection: Ideal for detecting selective logging activities.
- Slash-and-Burn Detection: Almost immediate detection of slash-and-burn activities.
- Capabilities:
-
Landsat Series
- Capabilities:
- Moderate resolution (30 meters).
- Long-term historical archive.
- Applications:
- Industrial Agriculture: Monitoring land use changes from forests to agriculture over time.
- Capabilities:
-
WorldView and GeoEye
- Capabilities:
- Very high-resolution imagery.
- Applications:
- Mining Activity Monitoring: Detailed monitoring of small-scale mining activities.
- Capabilities:
Note: Researchers should consult the respective sources for data access details and adhere to licensing agreements.
This outlines the data labeling strategy for the CanopyWatch project. Ground truth data, consisting of verified instances of deforestation, plays a pivotal role in model training and validation. This strategy details the methodologies and procedures for collecting and utilizing ground truth data effectively.
Ground truth data is the foundation upon which accurate and reliable machine learning models are built. In the context of CanopyWatch, it serves several crucial purposes:
-
Training Models: Ground truth data provides labeled examples of deforestation, enabling machine learning models to learn patterns and features associated with different types of deforestation activities.
-
Validation: It serves as a reference for evaluating model performance. Model predictions can be compared against ground truth data to assess accuracy, precision, recall, and F1-score.
-
Benchmarking: Ground truth data allows us to benchmark model improvements by comparing new models against the performance of existing models.
1. Manual Annotation
Manual annotation involves human experts visually inspecting high-resolution satellite imagery to identify instances of deforestation. This process can be time-consuming but results in highly accurate labels. Key considerations include:
-
Expert Annotators: Employ experts with domain knowledge in remote sensing and deforestation to ensure accurate annotations.
-
High-Resolution Imagery: Utilize high-resolution imagery (e.g., Sentinel-2, WorldView) for detailed analysis.
-
Labeling Tools: Use specialized labeling tools that facilitate the precise marking of deforestation areas.
2. Crowdsourcing
Crowdsourcing can be a cost-effective approach for large-scale ground truth data collection. However, it requires stringent quality control measures to maintain accuracy. Considerations include:
-
Data Quality Control: Implement a rigorous data validation process to filter out erroneous or inaccurate annotations.
-
Annotation Guidelines: Develop clear annotation guidelines and provide annotators with examples of different deforestation types.
-
Iterative Review: Implement an iterative review process where annotations are reviewed and corrected by experts.
For effective model training and validation, it's essential to split the ground truth data into appropriate subsets:
-
Training Data: This subset, typically comprising 70-80% of the ground truth data, is used for training machine learning models. It should cover a diverse range of deforestation types and scenarios.
-
Validation Data: A smaller portion (10-15%) of the data is reserved for model validation. It is used to tune hyperparameters, evaluate model performance, and prevent overfitting.
-
Test Data: The remaining data (10-15%) serves as a holdout test set to assess the model's generalization performance on unseen data.
To enrich the training dataset and improve model robustness, consider data augmentation techniques, especially when ground truth data is limited. Data augmentation may involve:
-
Rotations: Creating variations of the same image by rotating it at different angles.
-
Flipping: Generating mirror images by flipping horizontally or vertically.
-
Brightness and Contrast Adjustments: Introducing variability in image brightness and contrast.
-
Geometric Transformations: Applying geometric transformations like scaling and cropping.
Maintain a robust system for versioning ground truth data, including metadata that records the date of collection, annotator information, and any relevant notes. Document the data collection and labeling process thoroughly, ensuring transparency and reproducibility.
Data preprocessing constitutes a pivotal and intricate phase in the preparation of raw satellite imagery for machine learning (ML) model training. Proper preprocessing is indispensable as it profoundly impacts data quality, reduces noise, and ensures data compatibility with ML algorithms.
Data preprocessing serves as the foundational bedrock for robust and effective ML model development. In the domain of satellite imagery analysis, its significance is further accentuated by the unique characteristics and challenges posed by remote sensing data. Here's an in-depth exploration of its importance:
Satellite imagery often exhibits various forms of noise, such as sensor artifacts, atmospheric interference, and radiometric inconsistencies. Preprocessing techniques are employed to mitigate noise, rendering the data more amenable to meaningful analysis.
By applying calibration and correction methods, data preprocessing elevates the quality of satellite imagery. This enhancement is vital for precise quantitative analysis, facilitating the generation of reliable results.
Preprocessing operations like image resampling, radiometric calibration, and atmospheric correction contribute to the generation of consistent and interpretable features from satellite data. These features are instrumental in ML model training and downstream analysis.
Satellite imagery, due to its multidimensional nature and inherent variability, must undergo preprocessing to ensure compatibility with diverse ML algorithms. Proper preprocessing ensures that the input data aligns with the requirements and assumptions of the chosen algorithms.
To achieve the aforementioned goals, the CanopyWatch project follows a comprehensive data preprocessing pipeline. The following sections provide a detailed overview of key preprocessing steps:
Satellite imagery from different sources often possesses varying spatial resolutions. To harmonize the data, resampling techniques are employed. Resampling ensures that imagery aligns with the desired spatial resolution, facilitating consistency in downstream analysis.
Radiometric calibration is applied to standardize radiometric values across different images. This step is fundamental for quantifying reflectance accurately. Corrections are also applied to rectify sensor-specific variations and atmospheric influences.
Atmospheric effects can obscure the true characteristics of the Earth's surface in satellite imagery. Atmospheric correction methods are instrumental in removing these effects, thereby improving data quality and analysis outcomes.
Clouds and shadows in satellite imagery can impede the analysis of the target area. Robust preprocessing includes the detection and removal of clouds and shadows to ensure clear and consistent input data for ML models.
Enhancement techniques, such as histogram equalization and contrast stretching, are applied to improve the visual quality of satellite images. Enhanced imagery aids analysts in data interpretation and validation.
In cases where multiple sensors or modalities are employed, data fusion techniques are employed to combine complementary information. This fusion enhances the richness of the input data and can lead to improved analysis results.
Preprocessed data is converted into standardized formats, such as GeoTIFF or HDF5, to ensure compatibility with ML frameworks and tools. This standardization streamlines data handling and integration.
Transparent documentation of preprocessing steps, parameters, and software tools used is paramount. Additionally, version control mechanisms should be implemented for preprocessing scripts and configurations. Documentation and version control enhance reproducibility, facilitate error tracking, and support collaboration within the project team.
- Assess the complexity of the detection task. More intricate tasks, such as distinguishing between various stages of selective logging, may necessitate advanced models with high capacity, such as deep neural networks.
- Consider the scalability of the chosen model. Ensure that the selected model can effectively handle large-scale deforestation detection tasks, particularly for monitoring extensive forested regions.
- Assess the need for model interpretability. In certain cases, it is crucial to select models that can provide explanations for their predictions, especially when decisions impact conservation policies.
- Depending on the nature of the data (e.g., satellite imagery, aerial photographs), choose appropriate model architectures. Convolutional Neural Networks (CNNs) are commonly used for image-based tasks, while Recurrent Neural Networks (RNNs) may be suitable for sequential data, such as time series data.
- Consider leveraging pre-trained models (e.g., using models trained on general image datasets like ImageNet) and fine-tuning them for deforestation detection. Transfer learning can significantly reduce the amount of labeled data required for training.
- Evaluate the potential benefits of using ensemble techniques, such as combining predictions from multiple models (e.g., Random Forest, Gradient Boosting) to enhance overall accuracy and robustness.
In the pursuit of detecting and monitoring deforestation activities, choosing the right machine learning model is crucial. Each model comes with its own set of advantages and limitations, and the choice should be driven by the specific requirements and constraints of the deforestation detection task at hand. Additionally, it is essential to consider the availability of annotated data and computational resources when selecting the most suitable model. Ultimately, a well-informed decision will lead to more effective and accurate deforestation detection efforts, contributing to environmental conservation and sustainability.
This provides an overview of various machine learning models for different aspects of deforestation detection, including semantic segmentation, object detection, and classification. Each model is evaluated based on its pros and cons in the context of deforestation detection tasks.
Semantic segmentation is a computer vision task that falls under the broader category of image segmentation. It involves the process of classifying each pixel in an image into a specific category or class. Semantic segmentation aims to provide a higher-level understanding of the image by assigning meaningful labels to every pixel and this level of granularity enables us to differentiate between objects and their boundaries within an image, making it a valuable technique in various computer vision applications.
Pros:
- Well-suited for image segmentation tasks, making it suitable for delineating deforested regions.
- U-Net architecture preserves spatial information through skip connections, which helps capture fine-grained details.
- Effective at capturing the intricacies of deforested regions.
Cons:
- Demands substantial computational resources for training due to its deep architecture.
- Requires a significant amount of annotated data to achieve satisfactory performance.
Pros:
- Employs dilated convolutions to capture multi-scale contextual information, which is crucial for deforestation detection.
- Supports efficient inference through atrous spatial pyramid pooling (ASPP), making it suitable for processing large images.
- Effective for handling large-scale deforestation detection tasks.
Cons:
- Training may require extensive data augmentation to achieve optimal performance.
Pros:
- Combines instance segmentation with semantic segmentation, enabling the identification of specific deforestation-related objects.
- Highly accurate in delineating object boundaries in deforestation scenarios.
Cons:
- Computationally intensive due to its instance-level analysis, making it less suitable for real-time applications.
Object detection is a computer vision task that involves identifying and locating specific objects within an image or a video stream. This recognizes objects and provides information about their precise positions or bounding boxes.
Pros:
- Offers real-time object detection capabilities, suitable for monitoring deforestation activities as they occur.
- Can be adapted to detect specific deforestation-related objects like logging equipment.
Cons:
- May require a large dataset of annotated deforestation objects for effective training.
Pros:
- Known for its accuracy and widespread use in object detection tasks.
- R-CNN architecture enables region-based proposal generation, aiding in the detection of deforestation-related objects.
Cons:
- Computationally intensive, especially during training.
- Adequate annotated data is essential for model success.
Classification is a fundamental task in machine learning and statistics that involves assigning predefined categories or labels to input data based on their characteristics or features. It's a supervised learning technique where a model learns to make predictions by training on a labeled dataset, where each data point is associated with a known class or category.
Pros:
- Robust and resistant to overfitting, making it suitable for handling noisy or imbalanced deforestation datasets.
- Offers good interpretability, enabling feature importance analysis.
- Effective for multi-class classification tasks related to deforestation.
Cons:
- Limited representation of complex spatial patterns in imagery, which may affect its ability to detect subtle deforestation changes.
Pros:
- Excellent for image-based tasks, capturing spatial hierarchies and patterns.
- Has a high accuracy potential when trained on large datasets, suitable for identifying deforestation features.
- Supports transfer learning using pre-trained models, which can expedite model development.
Cons:
- Requires substantial computational resources and large amounts of annotated data, making it less accessible for some applications.
- May be prone to overfitting without appropriate regularization techniques.
Pros:
- Effective for binary and multi-class classification tasks related to deforestation detection.
- Well-suited for tasks with a clear margin of separation between classes, making it useful in scenarios with distinct deforestation patterns.
Cons:
- May not capture complex spatial patterns as effectively as deep learning models.
- Prone to class imbalance issues without proper handling.
Define a comprehensive set of performance metrics tailored to your deforestation detection task. Beyond common metrics like accuracy, precision, recall, F1-score, and AUC-ROC, consider task-specific metrics that align with the objectives of your detection task, such as forest-type classification accuracy or the ability to detect deforestation at different scales.
Explore the impact of varying decision thresholds on model performance metrics. Determine optimal thresholds that balance precision and recall, considering the specific consequences of false positives and false negatives in the context of deforestation detection.
Implement a variety of cross-validation techniques, including stratified K-fold cross-validation, leave-one-out cross-validation, and time-series cross-validation, to thoroughly assess your model's generalization capabilities. This technique helps assess the model's consistency across different data partitions, temporal variations, and spatial distributions.
Experiment with ensemble techniques, such as bagging and boosting, to enhance generalization. Ensemble models can mitigate overfitting and improve overall model robustness.
Conduct an exhaustive hyperparameter search using techniques like grid search or Bayesian optimization. Tune model parameters to achieve the best possible performance while preventing overfitting.
Apply a range of regularization methods, including L1, L2, and dropout, to control model complexity and avoid overfitting. Experiment with different levels of regularization to find the right balance.
Augment your training dataset with diverse data transformations (e.g., rotation, scaling, and flipping) to increase the model's ability to generalize from limited labeled data.
Systematically test the model's robustness against various environmental conditions, including changes in lighting, weather, and sensor noise. Evaluate the model's performance under extreme conditions to ensure it remains reliable in real-world scenarios.
Establish data quality checks and preprocessing steps to handle noisy or incomplete data. Develop strategies to address missing or corrupted data points that may arise during model deployment.
Implement outlier detection techniques to identify and handle anomalies in incoming data streams. Outliers can significantly impact model performance and must be managed effectively.
Collaborate with hardware experts to plan the deployment infrastructure. Consider factors such as GPU availability, memory, and storage to ensure the selected hardware can support model inference requirements.
Design your deployment architecture to be scalable, allowing for easy adaptation to varying workloads. Consider containerization and orchestration solutions to facilitate scalability.
Continuously monitor resource utilization during deployment to optimize hardware resource allocation. Implement dynamic resource scaling to ensure efficient usage.
Develop a comprehensive monitoring dashboard that tracks critical model performance metrics in real time. Include metrics related to inference latency, accuracy, and resource utilization. Set up alerts for deviations from expected behavior.
Implement automated model health checks that regularly assess the model's performance. These checks should identify issues such as drift in data distributions or changes in model behavior.
Continuously validate the integrity of the data pipeline, ensuring that incoming data adheres to expected formats and quality standards. Detect and handle data anomalies in real time.
Establish a model retraining strategy that considers both regular updates and adaptive learning. Retrain models periodically using the latest data to maintain high performance.
Implement failover mechanisms and redundancy for critical components of your deployment architecture to ensure uninterrupted operation in case of hardware or software failures.
Effective dashboard design and implementation are essential for enabling users to interact with data and machine learning models efficiently. The following guidelines outline best practices for creating a user-friendly Dashboard User Interface (UI) for data science and machine learning projects.
- Establish a well-structured data repository that categorizes datasets, including raw data, preprocessed data, and model artifacts.
- Implement version control mechanisms to track changes in datasets and allow users to revert to previous versions. Enable collaboration by tracking contributions.
- Maintain a comprehensive data catalog with metadata and descriptions for datasets, facilitating easy discovery and understanding of available data resources.
- Ensure robust access control features to protect data security and compliance. Assign user roles and permissions based on responsibilities and requirements.
- Integrate basic data preprocessing functionalities, simplifying common data cleaning and transformation tasks for users.
- Leverage Streamlit's rapid development capabilities for creating interactive data apps, allowing agile prototyping and quick iterations.
- Utilize Streamlit's variety of widgets, such as sliders and input fields, to enhance user interaction and data visualization.
- Capitalize on Streamlit's integration with popular Python libraries (e.g., Pandas, Matplotlib) for streamlined data manipulation and visualization.
- Deploy Streamlit apps to cloud platforms for broader accessibility. Share interactive reports and insights with ease.
- Ensure that Streamlit apps are responsive and adapt to various screen sizes, providing a consistent user experience across devices.
- Encourage collaborative development by leveraging Streamlit's open-source nature and facilitating the sharing of custom components within the data science community.
- Gather user feedback and insights during the design and development process to tailor the dashboard UI to user needs and preferences.
- Conduct usability testing to identify and address any usability issues, ensuring that the dashboard is intuitive and easy to navigate.
- Provide clear and accessible documentation for users, explaining how to interact with the dashboard, interpret visualizations, and access data resources.
- Offer training sessions or resources to help users effectively utilize the dashboard's features and functionalities.
- Embrace an iterative development approach, continuously enhancing the dashboard UI based on user feedback and changing requirements.
- Implement performance monitoring to identify and resolve any performance bottlenecks or issues that may arise during usage.
- Ensure that the dashboard complies with security and privacy standards, safeguarding sensitive data and user information.
By adhering to these guidelines, you can create a Dashboard UI that not only supports data exploration, model monitoring, and insights dissemination but also empowers users to make data-driven decisions effectively.
Employ bias detection tools and techniques to identify potential biases in your training data. Analyze data sources, sampling methods, and labeling processes to pinpoint sources of bias.
Develop strategies to mitigate bias in both data and predictions. This may include re-sampling techniques, adversarial debiasing, or fairness-aware training.
Conduct a thorough privacy impact assessment to identify potential privacy risks associated with data collection, storage, and model deployment. Ensure compliance with data protection regulations.
Implement data anonymization techniques to protect individual privacy. Strive to use aggregated data whenever possible to reduce the risk of re-identification.
Establish robust data governance practices to track data usage, access, and sharing. Clearly define roles and responsibilities for data handling and protection.
This technical document outlines the end-to-end data flow of the CanopyWatch project, focusing on improving deforestation detection and classification within the Congo Basin rainforest using satellite imagery and advanced machine learning techniques. By achieving these goals, the project aims to provide critical insights and actionable data to support conservation efforts, biodiversity preservation, and effective decision-making in the region.
In this section, you will find a comprehensive knowledge library that documents the findings and lessons learned from previous iterations of deforestation detection models. This knowledge repository serves as a valuable resource for understanding the evolution of our modeling approaches, the challenges encountered, and the solutions devised over time. It provides insights into the iterative nature of model development and improvement.
- ‘Project Canopy’. GitHub, https://github.com/Project-Canopy.
This section explores alternative approaches and methodologies considered during the development of deforestation detection models. While the chosen approach is documented in the main body of the document, this section serves as a repository for alternative ideas and strategies that were explored but not ultimately adopted.
The glossary section provides a comprehensive list of technical terms and domain-specific terminology used throughout the document. Each term is defined with clear explanations to aid readers in understanding key concepts and jargon associated with deforestation detection and machine learning.
The references section includes a curated list of academic papers, research articles, books, and online resources that have been referenced or consulted during the development of this project.
- ‘CanopyWatch - Enhancing Deforestation Monitoring and Conservation in the Congo Basin Using Machine Learning’. Omdena | Building AI Solutions for Real-World Problems, https://omdena.com/projects/enhancing-deforestation-monitoring-and-conservation-in-the-congo-basin-using-machine-learning/.
Project based on the cookiecutter data science project template.