nhalle / rat-openfield-maskrcnn

Rat tracking for open field videos using a Mask R-CNN #tensorflow #neuralnetwork
MIT License
1 stars 1 forks source link

Object detection: Tracking Rats in Open Field Videos

This project tracks the movement of rats in open field videos using the Mask R-CNN repository and a Mask R-CNN model mask_rcnn_rat_cfg_0005.h5

Description

The Open Field Maze(OFM) is a common method to study loco-motor ability and anxiety-like behavior in rats, and thus being used for various psychology research. Automating behavioral observations is necessary to enable researchers to study behavior in more reliable and consistent ways and allow experiments to be conducted in longer periods of time. Therefore, this project used the Mask-Region-based Convolutional Neural Network model (Mask-RCNN) to develop a reliable program that tracks rat movement in the OFM.

Installation

Requirements

This project requires python 3.4, tensorflow version 1.14 (tensorflow 2.0 is not compatible with the Mask_RCNN library unfortunately), and Keras 2.3.1. We recommend using pip3 and venv to manage packages.

Instructions

  1. Clone this repository

  2. Setup virtual environment

       python3 -m venv venv
    
       source venv/bin/activate
  3. Install dependencies

       pip install -r requirements.txt

Usage

To run the open field video analyzer:

    python analyze_video.py <path of video> <video name> <number of frames>

ex.

    python analyze_video.py ./video/Video1.mp4 test1 20

Credits

First we'd like to thank the psychology department of Franklin and Marshall college for providing the video of OFM. We would also like to thank the authors who providing tutorials introducing how to use the mask R-CNN model in keras with tensorflow object detection platform

Contributers: Kitty Chen & Noah Halle

License

MIT License

Copyright (c) 2020 Noah Halle