Skip to content

Latest commit

 

History

34 Commits

Folders and files

Repository files navigation

Marine Insight Microplastics

An end-to-end full-stack platform for uploading marine sample images, running AI-based microplastic detection, and viewing analysis results.

This project combines computer vision, environmental hazard scoring, and generative AI to help researchers analyze marine microplastic pollution more efficiently.

Overview

Current methods for monitoring microplastic pollution rely heavily on manual microscopy, which is labor-intensive, error-prone, and difficult to scale for real-time environmental monitoring. Marine Insight bridges this gap by combining high-speed instance segmentation with a retrieval-augmented generation workflow.

The system detects and measures microplastics from microscopic water sample images, calculates their physical risk, and synthesizes the data into evidence-backed ecological reports.

Marine Insight dashboard preview Microplastic analysis interface Analysis results page Detection results view Dashboard summary view

Key Features

  • Real-time instance segmentation powered by YOLOv8-Seg for detecting and classifying microplastics into fiber, film, fragment, and pellet morphologies.
  • Multidimensional hazard assessment that calculates particle-level risk based on size and shape.
  • RAG-powered report generation that turns quantitative findings into human-readable ecological insights.
  • Full-stack analytics dashboard with React and Django for upload, analysis, results, and reporting workflows.

Tech Stack

  • Machine Learning and AI: Python, YOLOv8-Seg, transfer learning
  • Generative AI: retrieval-augmented generation, dense vector indexing, LLMs
  • Backend: Django, REST APIs
  • Frontend: React + Vite
  • Data and annotation: Roboflow

Local Setup

Prerequisites

Make sure you have the following installed locally:

  • Python 3.10+ (recommended 3.11)
  • Node.js 18+ and npm
  • Git

1. Clone the repository

git clone <your-repo-url>
cd MarinePhase2

2. Set up the Django backend

Open a terminal in the project root and run:

cd djangoproject
python -m venv venv

On Windows:

venv\\Scripts\\activate

On macOS/Linux:

source venv/bin/activate

Install the Python dependencies:

pip install -r requirements.txt

Apply the database migrations:

python manage.py migrate

Start the Django server:

python manage.py runserver 0.0.0.0:8000

The backend API should now be available at:

3. Set up the React frontend

Open a second terminal and run:

cd frontend
npm install

Start the frontend development server:

npm run dev

The frontend should open at:

4. Create an account and use the app

  1. Open the frontend in your browser.
  2. Sign up or log in.
  3. Upload images for analysis from the upload page.
  4. View the generated results from the results dashboard.

5. Notes

  • The frontend expects the Django API at the URL defined in frontend/src/api.js. By default it uses:
  • If you are running Django on a different port, update the VITE_DJANGO_API_URL environment variable or the fallback URL in frontend/src/api.js.
  • If you want to build the frontend for production:
cd frontend
npm run build

Project Structure

  • djangoproject - Django backend, models, API views, and ML logic
  • frontend - React frontend built with Vite

Troubleshooting

  • If Django cannot start, make sure the virtual environment is activated and dependencies were installed successfully.
  • If the frontend cannot connect to the backend, confirm the Django server is running and that the API URL is correct.
  • If you see authentication issues, create a new user account and log in again.

Releases

Packages

Contributors

Languages