FishNet detects illegal fishing activities by analyzing AIS (Automatic Identification System) silence patterns, correlating dark periods with vessel proximity, location, and time to flag suspicious behavior.
- Detects AIS gaps > 10 minutes (configurable threshold)
- Enriches events with metadata:
- Region classification (EEZ edges, fishing zones)
- Start/end locations and timestamps
- Vessel information and fishing gear type
- Duration calculations
Output Format:
{
"mmsi": 231982000,
"start": "2024-01-01T03:00Z",
"end": "2024-01-01T05:30Z",
"region": "Eastern Pacific",
"location": [15.2, -88.0],
"duration_hours": 2.5,
"is_fishing_vessel": true
}- Builds "who was near whom and when" dataset
- Uses BallTree spatial indexing for efficient querying
- Time-binned analysis (10-minute windows)
- Distance-based vessel pairing (< 20 km)
- Haversine distance calculations for accuracy
- Validates dark events by checking nearby vessel transmissions
- Calculates coverage reliability:
- More nearby vessels transmitting = higher confidence
- Identifies if AIS coverage was available
- Assigns confidence scores (0-1) to each dark event
Comprehensive scoring system with weighted factors:
| Factor | Weight | Description |
|---|---|---|
| Dark gap length | 30% | Longer gaps = more suspicious |
| Coverage reliability | 20% | Low coverage = higher suspicion |
| EEZ proximity | 20% | Near borders = higher risk |
| Fishing vessel proximity | 20% | Co-occurrence patterns |
| Repeat offender | 10% | Frequency of dark events |
Also includes:
- DBSCAN spatial clustering (identifies hotspots)
- Hexbin aggregation for heatmap visualization
Builds vessel relationship network:
- Nodes: Vessels with dark events
- Edges: Co-occurrence during dark periods
Metrics Calculated:
- Degree centrality: Vessels with many connections
- Betweenness centrality: Potential coordinators/bridges
- Closeness centrality: Network position
- Community detection: Louvain algorithm to find coordinated fleets
- Transshipment detection: Identifies potential motherships
Generates comprehensive visualizations:
- Suspicion heatmaps (geographical distribution by score/frequency)
- Network graphs (centrality analysis, community structure)
- Temporal pattern analysis (hourly distribution, duration patterns)
- Frontend data package (JSON with top events, hotspots, communities)
Cross-references dark events with:
- Fishing gear types: longlines, trawlers, purse seines, trollers, pole & line, fixed gear
- Marine protected areas: WDPA database
- Fleet composition analysis: Multi-gear vessels, flag states
data_preprocessing.py- Data loading and cleaningdark_event_detection.py- Basic dark event detectionspatial_proximity_analysis.py- KD-tree proximity searchpattern_analysis.py- Pattern flaggingvisualization.py- Basic plots
Flask API with CORS-enabled endpoints:
GET /api/summary- Overall statisticsGET /api/network/stats- Network metrics
GET /api/suspicious-events?limit=50&min_score=0.7&fishing_only=trueGET /api/hotspots?limit=20- Hexbin aggregated hotspotsGET /api/clusters?hotspots_only=true- DBSCAN clusters
GET /api/communities?limit=10- Suspicious vessel communitiesGET /api/coordinators?limit=20- High betweenness centrality vesselsGET /api/motherships- Potential transshipment vessels
GET /api/vessel/{mmsi}- Individual vessel historyGET /api/search?lat=15.2&lon=-88.0&radius_km=50- Spatial/temporal search
- Real-time statistics dashboard
- Suspicious events list with filtering
- Community network visualization placeholder
- Map integration ready (Leaflet/Mapbox/deck.gl)
- Responsive design with glassmorphism UI
1. AIS Data + Fishing Gear CSVs + Protected Areas
โ
2. Enhanced Dark Event Detection
โ
3. Vessel Proximity Index (BallTree)
โ
4. Context Validation (Coverage Check)
โ
5. Multi-Factor Suspicion Scoring
โ
6. Spatial Clustering (DBSCAN) + Hexbin
โ
7. Network Analysis (Graph Theory)
โ
8. Visualization Generation
โ
9. Frontend Data Package (JSON)
โ
10. REST API โ Frontend Dashboard
cd backend
pip install -r requirements.txtcd app
# Fast mode (recommended for testing)
python run_pipeline.py
# Full mode (includes proximity index - slower)
python run_pipeline.py --fullpython api.py
# Server runs on http://localhost:5000open ../frontend/example_dashboard.html
# or serve with: python -m http.server 8000enhanced_dark_events.json- Enriched dark eventscontextualized_dark_events.json- With coverage contextscored_dark_events.json- Suspicion scoresdark_zone_clusters.json- DBSCAN clustersdark_zone_hexbins.json- Hexbin heatmap datavessel_communities.json- Network communitiescentrality_scores.json- Network centralitypotential_motherships.json- Transshipment candidatesfrontend_data_package.json- Main frontend data sourcedataset_analysis.json- Gear type cross-reference
suspicion_heatmap.png- Geographic heatmapnetwork_viz.png- Network analysis plotstemporal_analysis.png- Temporal patterns
vessel_network.gexf- Graph file (Gephi/Cytoscape compatible)
- Spatial Indexing: BallTree (scikit-learn) for O(log n) proximity queries
- Clustering: DBSCAN for density-based hotspot detection
- Network Analysis: NetworkX for graph metrics and community detection
- Community Detection: Louvain algorithm for fleet identification
- Scoring: Weighted multi-factor model with normalization
- Aggregation: Hexagonal binning for heatmap visualization
- Small datasets (< 100k records): ~2-5 minutes (full pipeline)
- Medium datasets (100k-500k): ~10-20 minutes
- Large datasets (> 500k): Use
--fastmode (skips proximity index)
Optimization tips:
- Proximity index is O(nยฒ) - most expensive step
- Use sampling for initial testing
- Run on server with adequate RAM for large datasets
Display high-suspicion vessels for regulatory review
Show dark zone hotspots on interactive map (deck.gl, kepler.gl)
Visualize vessel relationships and coordinated fleets
Real-time monitoring of new suspicious events
Generate compliance reports with evidence packages
- Multi-factor scoring
- Network analysis
- Spatial clustering
- REST API
- Frontend dashboard
- Real-time streaming: Process AIS data in real-time
- Machine learning: Train models on historical patterns
- Satellite imagery: Validate dark events with imagery
- Weather overlay: Correlate with weather data
- EEZ boundaries: Use actual EEZ polygon data
- Temporal modeling: Kalman filter for position prediction
- Alert system: Email/SMS notifications
- Multi-source fusion: Combine with Global Fishing Watch data
- Backend README:
/backend/README.md- Complete API documentation - Code comments: Each script has detailed docstrings
- This summary: High-level overview
- Comprehensive Pipeline: End-to-end analysis from raw AIS to frontend-ready insights
- Advanced Methods: Graph theory, spatial clustering, multi-factor scoring
- Production Ready: REST API, modular design, error handling
- Well Documented: README, docstrings, example dashboard
- Flexible: Fast/full modes, configurable parameters
- Dataset Integration: Fishing gear types, protected areas
HackHarvard 2024 - Truth & Trust Track (Security)
Project: FishNet - Detecting illegal fishing via AIS silence patterns
Backend:
- Python 3.9+
- pandas, numpy (data processing)
- scikit-learn (BallTree, DBSCAN)
- NetworkX (graph analysis)
- scipy (spatial algorithms)
- Flask + Flask-CORS (API)
- matplotlib, seaborn (visualization)
Frontend:
- HTML5, CSS3, JavaScript (ES6+)
- Fetch API for REST calls
- Ready for: Leaflet, Mapbox, deck.gl integration
- Check README:
/backend/README.md - API Health:
curl http://localhost:5000/api/health - Run Tests: Individual scripts can run standalone
- Debug Mode: API runs with
debug=True
Status: โ
Complete and ready for deployment
Branch: maureen-fishnet-analysis
Last Updated: 2025-10-04