Skip to content

Computer Vision 🧫 - Analysis of the motion of microorganisms 🦠 | Work in progress

License

Notifications You must be signed in to change notification settings

Ophiase/Microorganism-Computer-Vision

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

61 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Microorganism Computer Vision 🧫

License: Apache 2.0 Python 3.11.5+

A comprehensive computer vision pipeline for analyzing microorganism 🦠 motility patterns and diffusion characteristics.

Deadline: 28th February 2025

🌟 Features

  • Multi-modal Tracking
    • Optical flow-based motion estimation
    • Kalman-filter enhanced object detection
    • Synthetic trajectory generation
  • Advanced Diffusion Analysis
    • 6 statistical hypothesis tests for motility patterns
    • Automated trajectory classification
    • Comprehensive visualization toolkit
  • Scalable Architecture
    • Modular pipeline design
    • Configurable hypothesis parameters
    • Batch processing capabilities

🧩 Diffusion Hypothesis Tests

Our framework implements sophisticated statistical tests to characterize microbial motion:

Hypothesis Test Key Mechanism Biological Relevance
Circular Motion
CircularMotionTest
Curvature analysis + rotation angle detection Magnetotactic bacteria, spiral-seeking organisms
Directional Switching
DirectionalSwitchTest
Fourier analysis of angular changes Run-and-tumble motility (e.g., E. coli)
Gaussian Random Walk
GaussianRandomWalkTest
Kolmogorov-Smirnov normality test Passive diffusion in isotropic environments
MSD Linear Fit
MSDLinearTest
RΒ² evaluation of mean squared displacement Normal diffusion processes
Persistent Motion
PersistentMotionTest
Velocity autocorrelation analysis Active transport mechanisms
Subdiffusion
SubDiffusionTest
Power law exponent ($\alpha < 1$) detection Crowded environments, viscoelastic media

πŸš€ Installation

# Clone repository
git clone [email protected]:Ophiase/Microorganism-Computer-Vision.git
cd Microorganism-Computer-Vision

# Install dependencies
make pip

# Download sample dataset
make extract

πŸ§ͺ Usage

Process real videos:

# Full pipeline execution
make transform      # Preprocess videos
make detection      # Track microorganisms
make render         # Generate gifs
make analysis       # Run statistical tests and graphics

Generate synthetic data:

make synthetic      # Create trajectory datasets
python3 -m script.main --task analysis --video synthetic_brownian
# "brownian" can be replaced by directed, sinusoidal, confined, ctrw, ...

Key Makefile Targets:

detection     # Track objects in videos
render        # Generate trajectory visualizations
analysis      # Perform statistical testing
synthetic     # Generate synthetic trajectories

πŸ“Š Results Interpretation

πŸ“‚ Data Structure

microorganism-cv/
β”œβ”€β”€ data/                           # Raw and processed data
β”‚   β”œβ”€β”€ preprocessed/               # Normalized video tensors
β”‚   └── tracking/                   # Trajectory datasets
β”œβ”€β”€ logic/                          # Core algorithms
β”‚   β”œβ”€β”€ diffusion/                  # Statistical tests
β”‚   β”œβ”€β”€ filters/                    # Image processing
β”‚   └── structure/                  # Data models
β”œβ”€β”€ script/                         # Pipeline components
└── visualization/                  # Plotting utilities

πŸ“š Methodology

Our pipeline implements a multi-stage analysis process:

Preprocessing

  • Optical flow estimation
  • Spatial normalization
  • Noise reduction

Object Detection

  • Adaptive thresholding (❌ not implemented)
  • Connected component analysis
  • Kalman-filter based tracking

Trajectory Analysis

  • MSD calculations
  • Velocity autocorrelation
  • Directional persistence metrics

Statistical Classification

  • Hypothesis testing
  • Confidence interval estimation (❌ not implemented)
  • Motility pattern classification

About

Computer Vision 🧫 - Analysis of the motion of microorganisms 🦠 | Work in progress

Topics

Resources

License

Stars

Watchers

Forks