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
- Host: GitHub
- URL: https://github.com/ophiase/microorganism-computer-vision
- Owner: Ophiase
- License: apache-2.0
- Created: 2024-12-06T21:43:17.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2025-02-15T22:06:34.000Z (4 months ago)
- Last Synced: 2025-02-15T23:19:29.500Z (4 months ago)
- Topics: computer-vision, microorganism, motion-analysis
- Language: Python
- Homepage:
- Size: 57.9 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Microorganism Computer Vision ๐งซ
[](https://opensource.org/licenses/Apache-2.0)
[](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