MCPcopy Index your code
hub / github.com/earthrise-media/mining-detector

github.com/earthrise-media/mining-detector @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
147 symbols 504 edges 30 files 82 documented · 56%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Gold Mine Detector

Code for the automated detection of artisanal gold mines in Sentinel-2 satellite imagery, with links to related journalism. The data are presented at amazonminingwatch.org. Amazon Mining Watch is a partnership betwen the Pulitzer Center's Rainforest Investigations Network, Amazon Conservation Association, and Earth Genome.

mining-header-planet

Quick links: * NOVEMBER 2025 UPDATES * MARCH 2024 DATA AND MODEL UPDATES * INTERPRETING THE FINDINGS * JOURNALISM * METHODOLOGY * MINING AND AIRSTRIPS DATASETS


November 2025 updates

Ahead of COP in Belém, we significantly redeveloped Amazon Mining Watch, with:

  • A new webiste, showing trends through time for different jurisdictions and calculations of the socio-economic costs of mining. Current mining hospots are highlighted for further analysis.
  • Quarterly data updates, starting from Q2, 2025.
  • New models, built on a global geospatial foundation model. Details are in the methodology.
  • Revised mined area estimation, using a secondary segmentation algorithm that more closely delineates around mine scars.

The transition to new models remains work in progress. On the website, 2024 and 2025 data reflects new models outputs, which have largely been cleaned of false positive detections by a human reviewer.

March 2024 data and model updates

Development of the mining detector halted in 2022 when we lost access to the geospatial computing platform at Descartes Labs. With the arrival of new API methods to export pixels from Google Earth Engine (GEE), we were able to swap GEE in for Descartes Labs as image source. The original Amazon Mining Watch survey was built on 2020 composite Sentinel-2 satellite imagery. With the redevelopment comes:

  • Yearly assessments of mining activity for 2018-2023.
  • A new Sentinel-2 satellite data pipeline based on Google Earth Engine. Anyone with a GEE account should be able to run this code.
  • New models. While preserving the original model architecture, we trained from scratch using the GEE data, with added positive and negative data sampling based on model evaluations and our improved understanding of the scope of mining activities in the Amazon basin.

Mining expanded each year in the study period, notably into previously untouched areas of Yanomami, Kayapó, and Munduruku indigenous territories. It continues to spread into scattered and remote regions of the Amazon rainforest. Even some of the tiniest isolated detections are working mines. In western Amazonas, Brazil, floating dredges are scooping soils from river banks and bottoms in the search for gold, seen in the ravaged riverbanks of Rio Puré and Rio Boia in the most recent years' data.

Interpreting the findings

The mining of concern here touches every country in the Amazon basin. In the typical process, miners slash the rainforest to bare earth and then pump water through underlying sediments to liberate the minerals. They introduce mercury to form an amalgam with the gold, to separte it from other particles, and later they burn off the mercury to arrive at a fairly pure gold metal. This type of mining is called artisanal because it is practiced by small groups of individuals with some machinery, such as pumps, dredges, and excavators. The mining proceeds along streams and rivers, which provide water and access into the rainforest.

Scars from the mining can be seen from satellite. On the banks of a river, you will observe muddy flats jumbled together with multi-colored toxic wastewater pools. The pools can be brown, tan, yellow, different shades of green, even turquoise. For the most part they are irregular in size, shape, and orientation. Often nearby you can observe miners' encampments, perhaps with blue-tarped tents, and in well-developed mines, a dirt airstrip cut to fly in miners and to fly out the gold.

Here are some characteristic examples of mines:

MinesEx (These are mines.)

With limited bootstrap sampling, we extrapolated to run over the whole of the Amazon basin. There are some false detections, and we encourage users to apply discretion in interpreting the findings. Terrain features that can masquerade as mines include sandbars in rivers, braided rivers, farm ponds, and aquaculture ponds, like so:

NotMinesEx (These are not mines.)

You can recognize aquaculture ponds by their geometric shape, efficient use of space, and presence in agricultural zones.

From the March 2024 data release, we note in particular some false positives from aquaculture and other wet industrial operations around Manaus and an area of landslides in hilly terrain of southern Loreto, Peru.

A more common model error is the false negative, where the model fails to detect a mine or the full extent of a mine.

Where the rainforest has begun to heal, mine scars may not be detected in later years, and so mined area both expands and recedes over time. We see some value in this model response and we decided not to correct it.

On the whole, false detections are relatively few given how widespread the mining is, and we hope this will be a useful resource to those interested in tracking mining activity in the region.

Detection Accuracy

The Amazon basin encompasses an enormous, complex geography extending over 8.5 million square kilometers. For each quarterly dataset, the neural networks make over 100 million assessments for mining. By constrast, in late 2025, the labeled data we withhold to evaluate model performance consists of around 6400 examples. The metrics we derive from the withheld dataset can only be considered roughly indicative of how the networks will perform in extrapolating to the whole of the territory. At threshold t=0.925, the 2025 model ensemble operates with a precision of 99.6% and a recall of 79.6% for the detection of mine scars, which translates to an overall accuracy of 98.1%. Those metrics apply before post-processing, aggregation of detections to polygons, and human review.

For the 2024 models, which yield the 2018-2023 data on the Amazon Mining Watch website, we ran the following complimentary test. We evaulated by hand a random sample of 500 patch detections from 2023-year data. Of the 500 samples, 498 show scars from artisanal mining. One is an industrial mine, and one is a remnant of the construction of the Balbina dam and power station from around 1985. From this, we can estimate the precision or positive predictive value for that classifier again (in a numerical coincidence) to be 99.6%. In essence, the precision tells you the likelihood that a patch marked as a mine is actually a mine.

Area estimation

The primary goal of this work is to detect mines, and our classification operates on square image patches covering around twenty hectares each. However, we have been working to improve area estimates, first by deploying an NDVI mask to exclude intact vegetation, and more recently, deploying a fine-tuned SAM2 segmentation model on RGB channels of the Sentinel-2 imagery to delineate the borders of the mining scars.

As of March, 2026, this remains a work in progress. Area estimates on amazonminingwatch.org still derive from NDVI masking, which somewhat undercounts areas in forest backgrounds and can have high uncertainties over bare ground. The first SAM2 mining scar rasters are available on source.coop.

We would like to thank Michael Braun, Daemon Li, and Divas Subedi, masters students in computer science at Georgia Tech University, who fine-tuned and tested the SAM2 model for this work.

Journalism

MiningTitlesCollage

This work grew out of a series of collaborations with journalists and with advocates at Survival International seeking to expose illegal gold mining activity and document its impacts on the environment and on local indigenous communities. We began identifying mines by sight in satellite imagery. Later, some high school classes helped sift through images. Finally it made sense to try to automate the identification of mine sites. The training datasets for the machine-learned models followed from those initial human surveys.

Selected reporting using the automated detections

Clandestine airstrips and airstrips dataset

Rough dirt airstrips, often cut illegally from the forest and unregistered with authorities, allow miners to access the mines and to fly out the gold. The Intercept Brasil and The New York Times surveyed over a thousand clandestine airstrips in Brazil's Legal Amazon, identifying 362 landing strips within 20 kilometers of mining activity. The inquiry into the airstrips' role in the expansion of mining led to a pair of stories and a short documentary film:

The airstrip location data are available for download. The clandestine airstrips dataset is the result of a collaborative reporting effort by The Intercept Brasil, The New York Times, and the Rainforest Investigations Network, an initiative of The Pulitzer Center. The Intercept Brasil created the project with

Core symbols most depended-on inside this repo

save_tile
called by 5
gee/gee.py
available_collections
called by 4
gee/gee.py
get_tile_data
called by 4
gee/gee.py
predict
called by 4
gee/gee.py
make_layer
called by 4
gee/model_library.py
ensure_output_path_exists
called by 3
scripts/boundaries/preprocess_mining_areas.py
_make_embedding_cache_path
called by 3
gee/gee.py
predict_on_tile_embeddings
called by 3
gee/gee.py

Shape

Function 82
Method 55
Class 10

Languages

Python100%

Modules by API surface

gee/gee.py46 symbols
deprecated/scripts/dl_utils.py20 symbols
scripts/boundaries/preprocess_mining_areas.py13 symbols
gee/model_library.py8 symbols
gee/tile_utils.py7 symbols
gee/sam2_build_cog.py7 symbols
gee/get_training_data.py5 symbols
utils/embeddings_rasters_to_parquet.py4 symbols
scripts/boundaries/sync_source_data_to_s3.py4 symbols
gee/postprocess.py4 symbols
scripts/boundaries/standardize_subnational_admin_areas.py3 symbols
scripts/boundaries/standardize_it_and_pa_areas.py3 symbols

For agents

$ claude mcp add mining-detector \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact