## The Importance of Identifying Shipwrecks
Shipwrecks serve as vital artificial reefs, fostering diverse marine ecosystems by providing habitats for fish and other sea life. However, many submerged wrecks remain undiscovered, complicating efforts to protect these biodiversity hotspots from threats like illegal fishing or anchoring damage. Traditional detection methods, such as sonar surveys, are costly and time-intensive. A more efficient approach leverages machine learning on overhead satellite imagery, allowing researchers to scan vast ocean areas systematically.
This technique highlights the power of computer vision in environmental conservation, turning remote sensing data into actionable insights. By automating detection, conservationists can prioritize field surveys and enforcement, ultimately preserving underwater heritage and wildlife.
## Sourcing High-Resolution Satellite Data
To detect shipwrecks effectively, you need imagery with sufficient detail to distinguish small objects from surrounding water or seabed. Researchers turned to Maxar's WorldView-3 satellite, which captures panchromatic images at 30 cm resolution—sharp enough to reveal wreck outlines even in shallow waters.
### Step 1: Identify Target Locations
- Compile a list of known shipwreck coordinates from public databases like NOAA's wrecks database or historical records.
- Focus on coastal or shallow areas (under 20m depth) where visibility is optimal and wrecks protrude visibly.
### Step 2: Acquire Images
- Use platforms like Maxar's Open Data Program or commercial APIs to download cloud-free images centered on wreck sites.
- Aim for 1 km x 1 km tiles to capture context around each wreck.
- In this project, approximately 100 confirmed wrecks were targeted, yielding thousands of image chips.
Practical tip: Tools like Google Earth Engine or Sentinel Hub can supplement with free lower-res data for initial scouting, but high-res commercial sources are essential for training.
## Preparing and Annotating the Dataset
Raw satellite images require meticulous labeling to train a detection model. The process involved extracting 2,902 image chips (each 640x640 pixels) centered on known wrecks and drawing bounding boxes around visible structures.
### Step 3: Chip Extraction
- Crop images into smaller tiles to fit model input sizes and increase dataset volume.
- Use Python libraries like `rasterio` or `geopandas` for geospatial cropping:
```python
import rasterio
from rasterio.windows import Window
with rasterio.open('satellite_image.tif') as src:
window = Window(col_off=1000, row_off=1000, width=640, height=640)
chip = src.read(window=window)
```
### Step 4: Annotation with Bounding Boxes
- Employ free tools like LabelImg (YOLO format exporter) to manually outline shipwrecks.
- Each box captures the wreck's hull or debris field, ignoring ambiguous features like rocks.
- Split data: 80% train, 20% validation.
This labor-intensive step is crucial—accurate labels ensure the model learns true wreck signatures, such as elongated shapes contrasting with water.
Adding value: For larger scales, consider semi-supervised tools like LabelStudio with pre-trained models or active learning to reduce manual effort by 50-70%.
## Training the YOLOv8 Detection Model
YOLOv8, Ultralytics' latest object detection framework, excels in real-time accuracy with minimal resources. The nano variant (YOLOv8n) was selected for its efficiency on edge devices.
### Step 5: Setup Environment
- Install Ultralytics: `pip install ultralytics`
- Prepare YAML config for dataset:
```yaml
path: /path/to/dataset
train: images/train
val: images/val
nc: 1 # number of classes
names: ['shipwreck']
```
### Step 6: Train the Model
- Run training with a simple CLI or Python script:
```python
from ultralytics import YOLO
model = YOLO('yolov8n.pt') # pretrained nano
results = model.train(data='shipwreck.yaml', epochs=100, imgsz=640, batch=16)
```
Key hyperparameters:
- Epochs: 100
- Image size: 640x640
- Batch size: 16 (adjust per GPU)
- Optimizer: Default SGD with auto-augmentation
Training on a single NVIDIA A100 took ~1 hour, achieving mAP50 of 0.85 on validation—indicating strong generalization to unseen wrecks.
### Real-World Application Example
Visualize predictions:
```python
results = model('new_satellite_chip.tif')
results[0].show() # Displays image with boxes
```
The model distinguishes wrecks by their distinct linear forms and shadows, robust to varying water clarity.
## Evaluating and Refining Performance
Metrics breakdown:
- **Precision/Recall**: High due to clean training data.
- **mAP50**: 0.85 (mean Average Precision at IoU=0.5)
- Confusion analysis: False positives minimized by wreck-specific shapes.
### Step 7: Inference on New Regions
- Applied to 6,000+ images across uncharted areas.
- Identified 20+ potential new wrecks for verification via divers or sonar.
Enhancement tip: Post-process with Non-Maximum Suppression (NMS) and depth estimation from bathymetry data to filter deep-water false positives.
## Deploying for Conservation Impact
Export the model for broader use:
```python
model.export(format='onnx') # For web/mobile deployment
```
Integrate into dashboards with Streamlit or Gradio for marine agencies to upload images and get instant detections.
## Replicating the Full Project
All code, including a Jupyter notebook for end-to-end training and inference, is available in this [GitHub repository](https://github.com/robmarkcole/shipwreck-detection). Clone it and follow the README:
```bash
git clone https://github.com/robmarkcole/shipwreck-detection
git clone https://github.com/robmarkcole/shipwreck-detection
cd shipwreck-detection
pip install -r requirements.txt
jupyter notebook train.ipynb
```
This open-source resource democratizes the approach, enabling global teams to adapt it for local waters.
## Challenges and Future Enhancements
Limitations include:
- Dependency on clear-water conditions.
- Small dataset size (mitigate with augmentation: flips, mosaics).
Future directions:
- Multi-class detection (e.g., wreck types, debris).
- Fusion with multispectral bands for turbidity compensation.
- Scaling to full global oceans using swarm satellites.
By following these steps, you can build similar systems for other challenges, like debris tracking or habitat monitoring. This project exemplifies how accessible deep learning drives real-world environmental good, with YOLOv8 lowering barriers for non-experts.
---
<div style="text-align: center; margin-top: 2rem;">
<a href="https://www.deeplearning.ai/the-batch/wreck-recognition/" target="_blank" rel="noopener noreferrer" class="view-full-resource-btn" style="display: inline-block; background-color: #f97316; color: white; padding: 12px 24px; border-radius: 8px; text-decoration: none; font-weight: 600; transition: background-color 0.2s;">View Full Resource</a>
</div>