Code Monkey home page Code Monkey logo

species-identification-semi-supervised's Introduction

Species Identification in Thermal Imaging

Documentation for COMPSCI 760 group project

Installing Dependencies

$ pip install poetry
$ poetry install
# Replace +cu110 with +cu10.2 if you only have cuda 10.2
$ poetry run python -m pip install torch==1.7.0+cu110 torchaudio==0.7.0 torchvision==0.8.1+cu110 -f https://download.pytorch.org/whl/torch_stable.html

Preprocessing

The main preprocessing code loads the raw dataset.hdf5 file and performs the following operations:

  • Discards videos missing a usable tag.

  • Discards videos with fewer than 45 frames.

  • Trims the length of the videos to 45 frames.

  • Interpolates each of the cropped frames to 24 x 24.

  • Outputs 3 channels:

    • The raw thermal values (min-max normalization)
    • The raw thermal values (each frame normalized independently)
    • The thermal values minus the background (min-max normalization)
  • Splits the data into training, validation, and test sets. This is performed using a fixed seed for reperformability, and the size of the split is 7664/1500/1500 (72%/14%/14%). Stratification is using in the split to ensure classes are equally represented across the data sets.

  • Encodes the labels as integers.

  • Saves the pre-processed data and the labels as numpy arrays.

The single-frame preprocessing code performs the same operations as the main preprocessing code, except it extracts only the most useful single frame from the entire video clip.

The movement preprocessing code collates information of the movement of the cropped region, and outputs 9 normalised variables for each of the 45 frames:

  1. Left boundary of cropped region
  2. Upper boundary of cropped region
  3. Right boundary of cropped region
  4. Lower boundary of cropped region
  5. Number of pixels above a temperature threshold (mass)
  6. Cropped region horizontal velocity
  7. Cropped region vertical velocity
  8. Horizontal velocity scaled by area of cropped region
  9. Vertical velocity scaled by area of cropped region

Data Augmentation

Video augmentation

Movement data

Model Design

Using well-known image recognition architectures with and without pre-training

ResNet-18 without pre-trained model

ResNet-18 with pre-trained model (ImageNet)

ResNet-50 without pre-trained model

ResNet-50 with pre-trained model (ImageNet)

Using image processing model architectures

Conv3D

ConvLSTM

R2.1D

Neural Architecture Search

Hidden / Latent Space Visualisation

The dimentionality reduction code allows any selected layer from any model to be visualised by calling plot_dim_reduction(model, layer)

Hyperparameter Tuning

Hyperparameter tuning is done using the Ray Tune library.

Results

species-identification-semi-supervised's People

Contributors

cddt avatar hamishduncanson avatar zacps avatar aidanbfitzgerald avatar chasecai0121 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.