An open API service indexing awesome lists of open source software.

https://github.com/ophiase/microorganism-computer-vision

Computer Vision ๐Ÿงซ - Analysis of the motion of microorganisms ๐Ÿฆ  | Work in progress
https://github.com/ophiase/microorganism-computer-vision

computer-vision microorganism motion-analysis

Last synced: 3 months ago
JSON representation

Computer Vision ๐Ÿงซ - Analysis of the motion of microorganisms ๐Ÿฆ  | Work in progress

Awesome Lists containing this project

README

        

# Microorganism Computer Vision ๐Ÿงซ

[![License: Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-green.svg)](https://opensource.org/licenses/Apache-2.0)
[![Python 3.11.5+](https://img.shields.io/badge/Python-3.11.5%2B-yellow.svg)](https://www.python.org/)

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

```bash
# 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:
```bash
# 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:

```bash
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:

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

## ๐Ÿ“Š Results Interpretation

-




-




## ๐Ÿ“‚ Data Structure

```bash
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](https://en.wikipedia.org/wiki/Mean_squared_displacement) calculations
- Velocity autocorrelation
- Directional persistence metrics

### Statistical Classification
- Hypothesis testing
- Confidence interval estimation (โŒ not implemented)
- [Motility](https://en.wikipedia.org/wiki/Motility) pattern classification