Skip to content

tnc-ca-geo/em_edge_trace

Repository files navigation

First-mile transparency and traceability on the edge: integrating traceability and AI-powered monitoring to deliver actionable insights on verification, risk, and quality

This repository contains the public release of a first-mile seafood traceability system designed to make the earliest stage of the seafood supply chain more transparent, verifiable, and useful to downstream buyers.

The system combines RFID tagging, onboard sensor data, and outputs from an AI-powered electronic monitoring (EM) system to generate fish-level traceability records. These records connect catch events with handling, storage, location, and sustainability information.

It can:

  • create fish-level traceability records from RFID scan events
  • connect each fish to onboard handling, storage, and location data
  • integrate outputs from an AI-powered electronic monitoring system
  • organize records into trips and fishing sets
  • derive quality and sustainability indicators for downstream use
  • store and manage traceability data in PostgreSQL
  • prepare structured outputs for downstream traceability platforms such as Wholechain

🧩 Companion repository

This repository is closely related to the open-source project Monitoring fishing activity on the edge: mobilizing AI and edge technologies to advance near real-time electronic monitoring footage review, which provides the AI-powered electronic monitoring system used to generate the sustainability-related outputs integrated here.

While this repository focuses on the traceability and data-integration layer, the related repository focuses on the AI-powered EM layer, including onboard catch detection, counting, classification, and automated daily reporting.

Together, the two repositories show how onboard monitoring and first-mile traceability can be connected to produce fish-level records that link catch events, handling data, and sustainability information.

🔗 Companion repository: Monitoring fishing activity on the edge

🔗 Companion report: Report: Monitoring fishing activity on the edge

📢 About this repository

This repository is intended as a reusable reference implementation for first-mile seafood traceability. It can be adapted to different vessels, fisheries, hardware setups, and downstream supply-chain workflows.

The pilot deployment used RFID tags and readers, temperature sensing, and integrations with an existing EM system. Those specific hardware and service choices are not requirements of the overall approach. This implementation is shared as an example and can be adapted to other devices, providers, and downstream platforms, as long as equivalent data can be captured and mapped into the workflow.

License

This repository is made available under a custom license. See the LICENSE file for the full terms.

📦 Released components

traceability/traceability_api/ - API layer

FastAPI service for capturing RFID tag reads, exposing operational endpoints, and supporting trip finalization workflows.

📘 See traceability/traceability_api/README.md for endpoints, request formats, and API module details.

traceability/database/ - Database layer

Database layer for the traceability system, including schema definitions, connection utilities, initialization, and core database operations.

traceability/traceability_data_integration.py - Core traceability integration

Main integration logic that consolidates and enriches fish-level records using supporting data such as GPS, temperature, trip, and sustainability-related inputs.

📘 See traceability/database/README.md for schema definitions and core database operations.

traceability/wholechain_integration.py - Wholechain integration

Integration layer for packaging and sending structured traceability outputs to downstream platforms such as Wholechain.

📘 See traceability/README.md for package structure, pipeline flow, and configuration notes.

Supporting utilities

Shared supporting modules for configuration, logging, geospatial calculations, and storage/export helpers.

Deployment

Docker and Docker Compose configuration for running PostgreSQL, initializing the database schema, and starting the API.

Documentation

Repository documentation, including the top-level README and module-level READMEs.

📄 Technical report

The full technical report provides end-to-end details on the traceability system, including workflow, hardware setup, data model, and pilot results:

📥 Download Technical Report (PDF)

🐳 Getting started with Docker

Docker Compose can be used to run PostgreSQL, initialize the database schema, and start the API locally.

This repository provides the traceability and integration layer, but it depends on external systems and data sources to execute the full workflow end to end.

Requirements

  • Docker and Docker Compose installed on your system
  • a .env file with the required configuration values
  • access to the following external systems and data sources:
    • LICOR Cloud API for temperature logger data
    • Wholechain API for downstream traceability export
    • an AI-powered electronic monitoring system that generates sustainability-related outputs
    • an S3 bucket (or equivalent object storage) for CSV exports
    • a coastline GeoJSON file for distance-to-coast calculations

Build the containers

Build the container image from the root directory:

docker compose build

Start the system

docker compose up -d

Check container status:

docker compose ps

View logs:

docker compose logs -f api
docker compose logs -f postgres

About

Codebase for “First-mile transparency and traceability on the edge" — a seafood traceability system combining RFID, onboard sensors and AI-powered electronic monitoring outputs to generate buyer-facing quality and sustainability traceability records.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors