Deep Worm Tracker

Realtime C. elegans worm tracker based on Deep Object Detection (YOLO) and Tracking (Strong SORT) models

AI & Machine LearningPythonMIT

Abstract

Deep Worm Tracker is an open-source AI & Machine Learning project. Realtime C. elegans worm tracker based on Deep Object Detection (YOLO) and Tracking (Strong SORT) models. It is built using Python, Deep Learning. Key capabilities include: A large scale annotated dataset containing 3000 worm images is made available for training the object detection model; A first of its kind C. elegans re-id dataset containing 32 worm identities is used for training the tracking model; Annotated images account for background variability like worm trails, eggs, change in magnification, dust particles and marker prints used for demacrating quadrants in actual chemotaxis assays. The complete source code is publicly available on GitHub under the MIT License, making it a useful reference for students building an AI & Machine Learning mini project or final-year project.

1. Introduction

Realtime C. elegans worm tracker based on Deep Object Detection (YOLO) and Tracking (Strong SORT) models

2. Objective

Realtime C. elegans worm tracker based on Deep Object Detection (YOLO) and Tracking (Strong SORT) models

This project demonstrates how Python, Deep Learning can be applied to a real-world AI & Machine Learning problem.

3. Key Features / Modules

  • A large scale annotated dataset containing 3000 worm images is made available for training the object detection model.
  • A first of its kind C. elegans re-id dataset containing 32 worm identities is used for training the tracking model.
  • Annotated images account for background variability like worm trails, eggs, change in magnification, dust particles and marker prints used for demacrating quadrants in actual chemotaxis assays.
  • Training time reduced to just 9 to 26 min based on network dimensions.
  • Fast inference speed of 8 to 15 ms based on the YOLO object detection model.
  • Added functionality to segment and skeletonize tracked worms.
  • Individual worm trajectories are also highlighted.

4. Technology Stack

PythonDeep Learning

5. System Requirements

General requirements for this technology stack — check the README for exact versions.

  • Python 3.8 or later
  • pip / virtualenv for dependencies
  • VS Code, PyCharm or Jupyter Notebook
  • Git (to clone the repository)

6. Installation & Setup

git clone https://github.com/knaticat/Deep-Worm-Tracker.git
cd Deep-Worm-Tracker
  1. Clone the repository:
  2. Setup environments:
  3. Running the tracker after cloning the Deep-Worm-Tracker repository:
#for running the Deep-Worm-Tracker using pretrained model weights (Quick start)
       cd Deep-Worm-Tracker
       conda create -n yolostrong
       pip install -r requirements.txt

       #for training yolo model
       cd yolov5
       conda create -n yolo
       pip install -r requirements.txt

       #for training torchreid model
       cd strong_sort
       conda create -n torchreid
       pip install -r requirements.txt
$ python3 track.py --source <can be video, webcam, image file> --yolo-weights <path to weights file stored in worm_object_weights>
       --strong-sort-weights <one of mobilenetv2_x1_0_worm.pt, mobilenetv2_x1_4_worm.pt, osnet_ain_x0_5_worm.pt, osnet_x0_5_worm.pt, osnet_x0_25_worm.pt>
       --img <network dimension> --do-segment --do-skeleton --show-track --show-id-black --show-vid --save-vid

Full setup instructions are in the project README.

7. Future Enhancements

Suggested extensions you can add to make this your own project.

  • Deploy the model as a web app with Streamlit, Flask or FastAPI
  • Compare against an additional model and report the metric difference
  • Add explainability (SHAP / Grad-CAM)

8. Viva / Review Questions

Common questions examiners ask for projects in this domain.

  1. What dataset does the project use and how was it pre-processed?
  2. Which algorithm / model architecture is used and why was it chosen over alternatives?
  3. How are training and testing data split, and how is overfitting avoided?
  4. Which evaluation metrics (accuracy, precision, recall, F1) are reported and what do they mean here?
  5. How would you deploy this model for real users?

9. Source Code & License

This project is developed by knaticat and published on GitHub under the MIT License. Please follow the license terms and credit the original author when you use or modify this code.

Want to build this as your internship project?

Work on an AI & Machine Learning project like this with mentor guidance, weekly reviews and an internship certificate from Training Trains, Erode — online or offline.

Apply for AI & Machine Learning Internship