How abhij1401/ais-illegal-fishing-detection works
Project Type & Purpose
• This is an open-source, single-page Streamlit application that ingests AIS vessel data, applies hybrid ML models (Isolation Forest + Autoencoder) to flag suspicious (illegal) fishing activities, and provides real-time geospatial visualization.
Main Architectural Components
a. Presentation Layer (Frontend)
• app.py: Streamlit web app that renders forms, maps, and results.
b. Business Logic / ML Engine (Backend)
• model.py: Data preprocessing pipelines, feature engineering (speed, heading changes), calls to Isolation Forest & Autoencoder models.
c. Data Layer
• dataset/ais_data.csv & illegal_Data.txt: Historical AIS data used for seeding or re-training models.
• prediction_log.csv: Append-only CSV log of all user inputs & model outputs.
d. Visualization Subsystem
• Streamlit’s built-in map functions (with Folium/pydeck under the hood) to render vessel positions, popular ports, and anomalies.
e. External Services & Dependencies
• Python libraries: pandas, scikit-learn, TensorFlow/Keras or PyTorch, Streamlit, geospatial libs.
• (Optional) External tile server/APIs for map backgrounds.
Component Interactions & Data Flow
1. User opens the Streamlit UI (app.py).
2. User inputs vessel navigational features via forms.
3. app.py calls functions in model.py:
• Data cleaning & feature generation
• Pass features to Isolation Forest and Autoencoder
4. model.py returns a prediction (normal vs. anomalous).
5. app.py:
• Renders geospatial map with vessel point + ports layer.
• Displays prediction labels and metrics.
• Appends a new row (input features + prediction + timestamp) to prediction_log.csv.
Architectural Patterns & Design Principles
• Separation of Concerns: UI (app.py) vs. ML logic (model.py) vs. persistent storage (CSV files).
• Modular Design: model.py encapsulates all preprocessing + model code; easy to swap or extend models.
• Data Logging: Immutable log file for audit trail of predictions.
Final Checklist
• Clear, descriptive labels on all components.