TerraAI

Detecting Illegal Cannabis Cultivations in Northern California National Forests using Machine Learning

Introduction

TerraAI harnesses the power of machine learning to detect forest cover in satellite imagery, combining this with ArcGIS layers to identify potential illegal cannabis cultivation sites. Our focus is on four Northern California National Forests: Mendocino, Shasta-Trinity, Six Rivers, and Klamath. By integrating advanced algorithms and geospatial analysis, TerraAI aims to protect these critical ecosystems from illegal activities and preserve their natural beauty.

The Issue of Illegal Cannabis Cultivation

Illegal cannabis cultivation is a significant problem in many national forests across the United States, particularly in Northern California. These activities cause extensive environmental damage, posing a threat to the delicate ecosystems within these protected areas.

Environmental Impact

  • Deforestation and Habitat Destruction: Illegal growers often clear large areas of forest to plant cannabis, leading to deforestation and loss of habitat for native wildlife. This destruction disrupts the biodiversity and balance of the forest ecosystem while also increasing the risk of wildfires.
  • Soil Degradation: The intensive agricultural practices employed in illegal cannabis cultivation can lead to soil erosion and degradation. This impacts the soil's ability to support native vegetation and can lead to increased runoff and sedimentation in waterways.
  • Water Theft and Contamination: Cannabis cultivation requires substantial amounts of water. Illegal operations frequently divert water from natural sources such as rivers and streams, leading to water scarcity for native plants and animals. Additionally, these sites often use harmful pesticides and fertilizers that contaminate water sources, affecting both wildlife and downstream human communities.
  • Trash and waste: Illegal cultivation sites generate significant amounts of trash and waste. This includes plastic irrigation tubing, fertilizer bags, pesticide containers, food wrappers, and other refuse left behind by growers. These materials not only ruin the natural beauty of the forests but also pose direct threats to wildlife. Animals can ingest or become entangled in plastic waste, and toxic substances can leach into the soil and water, causing further environmental harm.

Legal and Social Implications

  • Public Safety Concerns: Illegal cultivation sites are often associated with criminal activities, including the presence of armed guards and booby traps to protect the crops. This poses significant risk to hikers, forest workers, and law enforcement officers.
  • Economic Costs: The cleanup of illegal grow sites is costly and resource-intensive. It involves removal of toxic chemicals, restoration of the land, and continuous monitoring to prevent re-establishment.
  • Legislative Challenges: Despite legalization in many states, the black market for cannabis persists due to the higher cost of legal cannons focusing on taxes and regulation over illegal cultivations.

Why Northern California?

Northern California is a hotspot for illegal cannabis cultivation due to its remote and densely forested areas, which provide cover and access to water sources. The four national forests—Mendocino, Shasta-Trinity, Six Rivers, and Klamath—are particularly vulnerable due to their vast and difficult-to-monitor terrains. Temperature range throughout the year is not extreme, making it the ideal climate as well.

Map indicating the four national forests of interest - Mendocino, Six Rivers, Shasta-Trinity, and Klamath National Forests in Northern California

The Need for Advanced Detection Methods

Traditional methods of detecting illegal cultivation, such as ground patrols and aerial surveys, are resource-intensive and often insufficient. The vastness of these forests makes it challenging to monitor all areas effectively. This is where TerraAI comes in, utilizing satellite imagery and machine learning to provide a more efficient and scalable solution.

TerraAI's approach

By leveraging high-resolution satellite images and sophisticated machine learning algorithms, TerraAI can detect signs of deforestation. These detections are then layered with geospatial data in ArcGIS, pinpointing potential illegal grow sites for further investigation and action by authorities.

Identifying Cultivation Sites

Illegal cannabis cultivation sites often exhibit certain characteristics and environmental modifications that can be identified using satellite imagery. These are the primary factors indicating a potential cultivation site:

  1. Deforestation and clearings: In dense forestry, trees need to be cleared in order for the operation to set up cannabis plants and their monitoring areas.
  2. Proximity to water sources: Outdoor operations require close proximity to water sources to funnel water back to the cultivation site. Typically, these sites are located within 100 to 500 meters of a water source - close enough but far enough that funnel materials are not easily detected.
  3. Temperature and humidity: There is a complex interplay between temperature and humidity in cannabis cultivation. Different stages of the plant require different temperature ranges, but the ideal temperature for optimal photosynthesis ranges from 68°F to 78°F during the day and cooler at night. The optimal relative humidity range is between 40% and 60%.
  4. Land Slope and Terrain: The terrain should have slopes no steeper than 15 degrees to ensure stable ground for cultivation and access.

The Role of Satellite Imagery in Terra AI

The key characteristics we chose to focus on, considering the timeline, were as follows:

  1. Deforestation Patterns:
    1. Monitoring patterns of deforestation over time allows us to identify areas where illegal activities might be taking place. By comparing historical and current satellite images, we can detect changes in forest cover that indicate possible illegal cannabis cultivation.
    2. It is important to note that forest management practices, such as the clearing of dead trees to reduce wildfire risks, occur throughout the year. Additionally, natural forest growth is prevalent during the summer months.
  2. Multispectral and Hyperspectral Imaging:
    1. These imaging techniques capture data across multiple wavelengths, allowing for the detection of subtle changes in vegetation health and land cover. This is particularly useful for identifying cleared areas and differentiating between types of vegetation.
  3. Integration with GIS:
    1. Geographic Information Systems (GIS) are used to integrate satellite imagery with other geospatial data, such as proximity to water sources and land slope, allowing for a comprehensive analysis of potential cultivation sites based on multiple factors.
    2. This layering also ensures that our detection methods differentiate between legal forest management activities, natural growth, and potential illegal cannabis cultivation.

Our Machine Learning Approach

Dataset

  1. Our training dataset is derived from the Global Forest Change dataset, which analyzes Landsat images to track global forest extent and changes from 2000 to 2022. This dataset includes:
  • Tree Canopy Cover for 2000: Percentage of canopy closure for vegetation taller than 5 meters.
  • Forest Cover Gain (2000-2012): Areas where non-forest changed to forest.
  • Forest Loss (2000-2022): Areas of forest loss, indicated by year.
  • Data Mask: Differentiates areas of no data, land surface, and water bodies.
  • Landsat Composite Images: Cloud-free imagery from circa 2000 and 2022. Source:  Global Forest Change  by Hansen/UMD/Google/USGS/NASA

2. For testing, we use satellite imagery from the Copernicus Browser for four national forests: Klamath, Six Rivers, Shasta Trinity, and Mendocino. The imagery covers January to December 2021, aligned with USDA data on illegal cultivation sites shut down in 2021 - which we are awaiting for future works. Source:  Copernicus Browser 

Model Architecture

To effectively track forest loss, Terra AI utilizes a UNET Transformer model for 2D image segmentation. The model’s architecture leverages an encoder-decoder structure designed to capture and reconstruct image features efficiently.

  • Encoder Component: The encoder compresses images into smaller, more abstract representations. It incorporates a transformer encoder that applies multi-headed self-attention, which is crucial for segmentation tasks that require focusing on specific areas of an image and understanding relationships across different parts of the image.
  • Decoder Component: The decoder expands these compressed representations back to the original image size. It uses a series of convolutional and de-convolutional layers to upsample the encoded features, capturing both high-level features and detailed information.
  • Skip Connections: Direct connections between the encoder and decoder at specific layers are used at different resolutions. These skip connections help combine global and detailed information, producing outputs that are closely related to the inputs.

After running the model on the test dataset, the results were processed into a binary map. In this map, pixels with a value of 0 indicate no deforestation, while pixels with a value of 255 indicate deforestation.

Enhancing Detection

(Left) Map of slope elevation layer (Right) Map of slope elevation layer and river & streams layer on top

We used the  USA Rivers and Streams dataset  and slope data derived from the  United States Geological Survey's 3D Elevation Program . As well as incorporating the shape files of national forests from the  USDA. 

Once the feature layers were added to the map, the binary map of forest loss was overlaid. By analyzing areas within 100 to 500 meters of water sources and with slopes under 15 degrees, we pinpointed regions of deforestation with a higher likelihood of illegal cultivation. This approach helps us distinguish potential illegal activities from legitimate forest management practices.

Predictions and Results

Potential Illegal Cultivation sites identified within Klamath, Six Rivers, Shasta-Trinity and Mendocino National Forest

Conclusions and Next Steps

In this project, we identified areas of deforestation that intersected with additional geospatial features, such as proximity to water sources and slope gradient. These intersections suggest potential illegal cannabis cultivation sites. However, to further refine the model, reasonable next steps would be to incorporate additional features within the machine learning framework. This includes detecting man-made structures, water diversion systems, soil disturbances, roads and paths, and thermal signatures. By integrating these additional features, the accuracy and robustness of the detection model can be improved. Enhancing geospatial analysis by including factors such as soil characteristics, such as soil pH and moisture levels, which are critical for ideal cannabis cultivation, would also be beneficial.

Additionally, to make the tool more user-friendly and scalable for stakeholders, developing an API that agencies can use to select a national forest of interest, automatically crop and load satellite images into the algorithm, and overlay the results within ArcGIS is ideal for scaleability. This would provide an immediate visual representation of potential cultivation sites, making it easier for agencies to take action.

By continuing to refine the model and expand its capabilities, the goal is to raise public awareness of the environmental damage caused by illegal cannabis cultivation and provide a valuable tool for the USDA and Water Board to detect and address these issues more quickly.

References

  1. Hansen, M. C., P. V. Potapov, R. Moore, M. Hancher, S. A. Turubanova, A. Tyukavina, D. Thau, S. V. Stehman, S. J. Goetz, T. R. Loveland, A. Kommareddy, A. Egorov, L. Chini, C. O. Justice, and J. R. G. Townshend. "High-Resolution Global Maps of 21st-Century Forest Cover Change." Science, vol. 342, no. 15, 2013, pp. 850-53. Data available on-line from:  https://glad.earthengine.app/view/global-forest-change .
  2. United States Geological Survey. United States Geological Survey 3D Elevation Program 1/3 arc-second Digital Elevation Model. Distributed by OpenTopography, 2021.  https://doi.org/10.5069/G98K778D . Accessed 5 Aug. 2024.
  3. Esri. "USA Rivers and Streams." ArcGIS Online,  https://www.arcgis.com/home/item.html?id=0baca6c9ffd6499fb8e5fad50174c4e0 .