Conservation Area Prioritization Through Artificial INtelligence
CAPTAIN is a reinforcement learning system for optimizing conservation and restoration strategies in space and time.
⚙️ Engineered for Scale: Complete rewrite for high performance. Full GPU support and optimized sparse matrix operations allow for analysis at larger scales and finer resolutions.
🌱 Dynamic Environment Scenarios: Advanced support for time-evolving scenarios, incorporating climate change projections and dynamic implementation costs.
🧩 Modular & Customizable: A flexible architecture allowing for highly tailored conservation policies and seamless integration of custom spatial data.
🎯 Multi-objective Optimization: Full support to quantify synergies and trade-offs between competing conservation and restoration targets.
This repository contains a preview of CAPTAIN v.3.
- Status: This is an active beta. The core simulation engine and training loops are functional, but the API and internal architecture are subject to change.
- Development: Primary development occurs in a private repository. This public mirror is provided for demonstration, testing, and early-access feedback.
- Support: Please report bugs via GitHub Issues, but note that feature requests may be prioritized based on our internal development roadmap.
uv is a high-performance Python package manager that ensures consistent environments across Windows, macOS, and Linux.
-
macOS / Linux:
curl -LsSf [https://astral.sh/uv/install.sh](https://astral.sh/uv/install.sh) | sh -
Windows (PowerShell):
powershell -ExecutionPolicy ByPass -c "irm [https://astral.sh/uv/install.ps1](https://astral.sh/uv/install.ps1) | iex"
Once uv is installed, clone the repository and sync the dependencies. This will automatically create a virtual environment (.venv) and install the correct version of PyTorch.
# Clone and enter the repository
git clone https://github.com/captain-project/captain3preview
cd captain3preview
# Sync dependencies and create virtual environment
uv syncIf you are on Windows, you may need to perform two quick steps to ensure uv and Python work correctly:
Enable Long Paths: Windows has a default 260-character limit for file paths. High-performance libraries like PyTorch often exceed this.
Run PowerShell as Administrator and execute:
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -ForceExecution Policy: If PowerShell blocks the uv command, run:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUserWorking example scripts are in the examples folder
- plot_input_data.py - Visualize spatial and time-varying input data
- train_policy.py - Full training loop with real data
- run_inference.py - Load a trained model and perform optimization
Example data can be downloaded here. A pre-trained model is available here.
captain3preview/
├── captain/ # Main package
│ ├── agents/ # Policy network, feature extraction, rewards
│ ├── algorithms/ # Evolution strategies trainer, episode runner
│ ├── data/ # SpatialData, ExtinctionRisk classes
│ ├── environment/ # BioEnv simulation engine
│ └── utils/ # Utilities, data loading
└── examples/ # Usage examples
If you use CAPTAIN v.3, please cite:
@software{captain_3_2026,
title = {CAPTAIN v.3 beta: Conservation Area Prioritization Through Artificial INtelligence},
year = {2026},
url = {https://github.com/captain-project/}
}
@article{silvestro2022improving,
title={Improving biodiversity protection through artificial intelligence},
author={Silvestro, Daniele and Goria, Stefano and Sterner, Thomas and Antonelli, Alexandre},
journal={Nature sustainability},
volume={5},
number={5},
pages={415--424},
year={2022},
publisher={Nature Publishing Group UK London}
}
@article{silvestro2025using,
title={Using artificial intelligence to optimize ecological restoration for climate and biodiversity},
author={Silvestro, Daniele and Goria, Stefano and Rau, E-ping and Ferreira de Lima, Renato Augusto and Groom, Ben and Jacobsson, Piotr and Sterner, Thomas and Antonelli, Alexandre},
journal={bioRxiv},
pages={2025--01},
year={2025},
}This project is licensed under Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International, see full license for detail.
For commercial licensing inquiries or permission to deviate from these terms, please contact the development team.