Skip to content

pseusys/HogWeedGo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

328 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HogWeedGo

SERVER CLIENT ML-HELPER REPORT

A crowd-sourced monitoring system for Heracleum sosnowskyi (Sosnowsky's hogweed) — an invasive, phototoxic plant species spreading across northern Europe. Built as a bachelor's thesis project; presented at the ETU MOEVM Scientific and Technical Seminar (2022) and published in the proceedings (pp. 12–15). Full thesis report available as a thesis report PDF.

The system integrates a geospatial REST backend, a cross-platform mobile client, and an on-device ML classifier, forming a complete pipeline from field observation to expert review.


Architecture

┌───────────────────────────────────────────────────────────┐
│                        HogWeedGo                          │
│                                                           │
│   ┌──────────────┐     REST/JSON      ┌───────────────┐   │
│   │  Flutter     │ ◄────────────────► │ Django +      │   │
│   │  Mobile App  │                    │ PostGIS       │   │
│   │  (iOS/Android│                    │ Server        │   │
│   │  + TFLite    │                    │               │   │
│   │  classifier) │                    │ PostgreSQL DB │   │
│   └──────────────┘                    └───────────────┘   │
│                                                           │
│   ┌──────────────────────────────────────────────────┐    │
│   │  ML Helper (Jupyter)                             │    │
│   │  MobileNetV2 transfer learning → .tflite export  │    │
│   └──────────────────────────────────────────────────┘    │
└───────────────────────────────────────────────────────────┘

There are two classes of users: volunteers (field observers, drones, etc.) who submit geo-tagged photo reports, and experts (ecologists, administrators) who review, annotate, and manage reports through a web interface. The mobile client also runs an on-device classifier to guide the user before submission.


Components

Server — server/

Stack: Python 3, Django, Django REST Framework, PostGIS, Docker, Nginx

The server exposes a documented REST API (OpenAPI 3.0 spec) covering:

  • Authentication — email-verified registration with time-limited OTP codes; token-based session auth with rate limiting
  • Reports — geo-tagged submissions with multi-photo upload, status lifecycle (RECEIVEDAPPROVED / INVALID), and comment threads
  • Geospatial storage — geographic PointField (PostGIS) with address annotation
  • Expert web interface — custom Django Admin with report management, user administration, and statistics
  • Backup/restore — serialization modes supporting full database export and import, including media files (base64-encoded)

Production deployment uses Nginx + Gunicorn behind TLS, with auto-generated self-signed certificates and a config generation script. A Docker image is published automatically to GHCR on every push to main.

Web interface — reports list Web interface — report detail

Client — client/

Stack: Dart, Flutter (iOS + Android)

The mobile client provides:

  • Interactive map displaying all submitted reports
  • Geo-tagged photo report submission with on-device ML pre-classification
  • User account management (profile photo, password, email change with OTP)
  • Real-time report status tracking

Main map view Report submission User account

ML Helper — ml-helper/

Stack: Python, TensorFlow/Keras, Jupyter, scikit-learn

A Jupyter notebook pipeline for training and exporting the on-device plant classifier. See the ML Helper README for full details.

Model: MobileNetV2 (ImageNet pretrained) with two-phase transfer learning
Dataset: 21,300 images across 3 classes, sourced from iNaturalist and OpenImages
Accuracy: >92% on held-out test set
Output: .tflite model for direct embedding in the Flutter client

Head training — frozen base Fine-tuning — top 80% unfrozen


CI/CD

Four independent GitHub Actions workflows provide full automation:

  • server.yml — (1) runs unit tests against a live PostgreSQL+PostGIS instance; (2) builds the full Docker stack and runs the Postman API test suite via Newman; (3) publishes the Docker image to GHCR; (4) updates the bundled release artifact
  • client.yml — builds the Flutter Android APK
  • ml-helper.yml — fetches the released .tflite model and runs the classifier test suite against the held-out CSV dataset
  • report.yml — compiles the LaTeX thesis report and publishes it as a release asset

Getting Started

Run the server locally (Docker)

  1. Download bundled-server.zip from the releases page, unpack it, and open a shell there.
  2. Run ./config-generator.sh [YOUR_DOMAIN] to generate environment configs.
  3. Run docker-compose -f ./docker-compose.yml --env-file=./system-config.env up.

See server/README.md for full configuration reference (ports, SMTP mocking, HTTPS certificates, superuser credentials).

Build the server from source

cd server
./config-generator.sh localhost
# Install dependencies and initialize the database:
./init-local.sh ./config.env server
# Run the test suite:
./init-local.sh ./config.env test

Build the mobile client

cd client
flutter pub get
flutter build apk   # Android
flutter build ios   # iOS

Train the ML model

See ml-helper/README.md.


Repository Structure

HogWeedGo/
├── server/          # Django backend (API, admin interface, PostGIS models)
├── client/          # Flutter mobile client (iOS + Android)
├── ml-helper/       # Jupyter training pipeline + TFLite export
├── report/          # LaTeX bachelor's thesis source
└── HogWeedGo.openapi.yml  # OpenAPI 3.0 API specification

About

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors