π View on Devpost
An AI-powered maritime intelligence platform that continuously monitors ship behavior patterns and generates real-time alerts for suspicious activities.
Interactive map with vessel monitoring and behavior analysis
Main interface showing real-time ship tracking and alert management
AI-powered alert generation and risk assessment interface
- Continuous Ship Monitoring: Real-time analysis of vessel movements and behavior patterns
- Behavior Pattern Detection: Identifies loitering, encounters, port visits, route deviations, and speed anomalies
- Risk Assessment: AI-powered risk scoring and threat evaluation
- Automated Alert Generation: Creates detailed alerts with reasoning and evidence
- Real-time Ship Tracking: Live vessel positions with interactive markers
- Alert Integration: AI-generated alerts displayed in the sidebar
- Ship Selection: Click on ships to view detailed information and behavior analysis
- Filtering & Search: Advanced alert filtering by severity, type, and time
- Real-time Alerts: Instant notifications for suspicious activities
- Severity Levels: Critical, High, Medium, and Low priority alerts
- Alert Types: Loitering, Port Entry/Exit, Suspicious Routes, Speed Anomalies, Encounters, Tracking Gaps
- Evidence Tracking: Detailed reasoning and evidence for each alert
OceanWatch Platform
βββ π€ AI Agent (Python/FastAPI)
β βββ GPT-4 Powered Analysis
β βββ MongoDB Integration
β βββ Real-time Monitoring
β βββ Alert Generation
βββ π Frontend (Next.js/React)
β βββ Interactive Map (Mapbox)
β βββ Alert Dashboard
β βββ Ship Management
β βββ Real-time Updates
βββ ποΈ Database (MongoDB)
βββ Ship Data
βββ Event History
βββ Alerts
βββ Behavior Analysis
- Python 3.11+
- Node.js 18+
- OpenAI API Key
- MongoDB Atlas Account
git clone <repository-url>
cd OceanWatchBackend (AI Agent)
cd server
pip install -r requirements.txtFrontend
cd client
npm installCreate a .env file in the server directory:
OPENAI_API_KEY=your_openai_api_key_here
MONGODB_URI=mongodb+srv://johnliu:pword@neptune-main.2w2qohn.mongodb.net/main
MONGODB_DB=mainOption 1: Using the startup script
python start_OceanWatch.pyOption 2: Manual startup
Terminal 1 (AI Agent):
cd server
python api_server.pyTerminal 2 (Frontend):
cd client
npm run dev- Frontend: http://localhost:3000
- API Documentation: http://localhost:8000/docs
- API Health Check: http://localhost:8000/health
- Navigate to the API documentation at http://localhost:8000/docs
- Use the
/start-monitoringendpoint to begin continuous monitoring - The AI agent will start analyzing ship behavior patterns every 5 minutes
- Open the frontend at http://localhost:3000
- Alerts will appear in the sidebar automatically
- Click on alerts to view detailed information
- Use filters to focus on specific alert types or severity levels
- Click on any ship marker on the map
- View detailed ship information and behavior analysis
- Check for any associated alerts
- Review historical patterns and risk assessments
| Variable | Description | Default |
|---|---|---|
OPENAI_API_KEY |
Your OpenAI API key | Required |
OPENAI_MODEL |
OpenAI model to use | gpt-4 |
MONGODB_URI |
MongoDB connection string | Pre-configured |
MONITORING_INTERVAL_SECONDS |
Monitoring frequency | 300 |
ALERT_SEVERITY_THRESHOLD |
Risk threshold for alerts | 0.5 |
- Loitering: Vessels staying in restricted areas
- Port Entry/Exit: Unusual port activity patterns
- Suspicious Routes: Deviations from normal routes
- Speed Anomalies: Unusual speed patterns
- Encounters: Suspicious vessel meetings
- Tracking Gaps: Missing tracking data
- Critical: Immediate action required
- High: Significant risk requiring attention
- Medium: Moderate risk requiring monitoring
- Low: Minor concerns
GET /- Health checkGET /health- Detailed health checkPOST /start-monitoring- Start AI monitoringPOST /stop-monitoring- Stop AI monitoringGET /monitoring-status- Get monitoring status
POST /analyze-ship/{id}- Analyze specific shipGET /ships- Get ships list
GET /recent-alerts- Get recent alertsGET /alert-stats- Get alert statisticsPOST /generate-alert- Generate manual alert
- Loitering Detection: Identifies vessels loitering in sensitive areas
- Port Activity: Monitors port entries/exits and unusual visit patterns
- Ship Encounters: Detects suspicious encounters between vessels
- Route Analysis: Identifies deviations from normal routes
- Speed Anomalies: Detects unusual speed patterns
- Tracking Gaps: Identifies periods of missing tracking data
- Historical Pattern Analysis: Compares current behavior to historical patterns
- Geographic Context: Considers location-based risk factors
- Vessel Type Analysis: Different risk profiles for different vessel types
- Time Pattern Analysis: Identifies temporal anomalies
- Frequency Analysis: Detects unusual event frequencies
- Store API keys securely using environment variables
- Implement proper access controls for MongoDB
- Monitor API usage and costs
- Regularly update dependencies
- Implement rate limiting for API calls
python start_OceanWatch.pyFor production deployment, consider:
- Using a process manager (PM2, Supervisor)
- Setting up proper logging
- Implementing health checks
- Using environment-specific configurations
- Setting up monitoring and alerting
FROM python:3.11-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
CMD ["python", "api_server.py"]The platform provides detailed logging for:
- Database queries and results
- AI analysis outcomes
- Alert generation
- Error handling
- Performance metrics
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is part of the OceanWatch Maritime Intelligence platform.
For issues and questions:
- Check the logs for error details
- Verify your configuration
- Test connections using the health check endpoint
- Review the MongoDB data structure
- Check the API documentation at http://localhost:8000/docs
- Machine Learning Models: Enhanced pattern recognition
- Predictive Analytics: Forecast potential security threats
- Mobile App: iOS and Android applications
- Integration APIs: Connect with other maritime systems
- Advanced Visualization: 3D maps and advanced analytics
- Automated Response: Automated threat response systems
OceanWatch Maritime Intelligence Platform - Protecting maritime security through AI-powered monitoring and analysis.