-
Notifications
You must be signed in to change notification settings - Fork 0
FAQ
- General Questions
- Installation and Setup
- Technical Requirements
- Video and Camera
- Detection and Tracking
- Analysis and Results
- Performance and Optimization
- Advanced Features
- Troubleshooting
DRerio LogAI is a comprehensive Python application for automated zebrafish behavioral tracking and analysis. It uses AI-powered detection (YOLO, OpenVINO) to track subjects in videos or live camera feeds, calculate behavioral metrics, and generate detailed reports.
Primarily zebrafish (Danio rerio), but the system works with any small aquatic animals including:
- Medaka fish
- Zebrafish larvae
- Small fish species (guppies, etc.)
- Aquatic invertebrates (with appropriate model training)
Yes! DRerio LogAI is open-source software released under the MIT License. You can use, modify, and distribute it freely for academic or commercial purposes.
Absolutely! DRerio LogAI is designed for scientific research. When citing, please use:
DRerio LogAI - Automated Zebrafish Behavioral Tracking System
https://github.com/MarkSant/DRerio-LogAI
(Formal citation format coming soon with publication)
For basic use: None! The GUI is designed for non-programmers.
For advanced use: Python knowledge helpful for:
- Custom analysis scripts
- Model training
- Plugin development
- Batch processing automation
Python 3.12 and Poetry. Then double-click install.bat (Windows) or run
./setup.sh (Debian/Ubuntu) in the extracted repository folder, and start the
app from the DRerio LogAI icon it puts on your desktop.
You do not need Git (download Source code (zip) from the releases page), a C compiler (nothing is compiled since 7.0.1), or a terminal you keep open.
Python 3.12, and 3.13 works too. Python 3.11 and below are not supported.
Python 3.14 does not work. The pinned NumPy publishes no wheel for it, so
the install tries to compile NumPy from source, fails, and leaves the project
uninstalled — and the next command is the one that complains, with
No module named 'zebtrack'. If 3.14 is your default python, install 3.12
alongside it; the installer picks the right one on its own.
To check your Python version:
python --versionNo. It is created for you the first time you run the app — answering the language prompt is what writes it. Camera, Arduino port and the detector settings are all chosen inside the interface, and camera and port are stored per project, where they take precedence over anything set globally.
For NVIDIA GPUs: Yes, install:
- CUDA Toolkit 11.8 or 12.1
- cuDNN 8.x
- Compatible NVIDIA drivers
For Intel GPUs: OpenVINO provides Intel GPU support without CUDA.
poetry install downloads the dependency tree — PyTorch, OpenVINO, OpenCV and
SciPy are the bulk of it. Expect a virtual environment of roughly 1.7 GB. Nothing
is compiled: since 7.0.1 every dependency installs from a prebuilt wheel.
The detector models (~200 MB) are a separate, explicit step:
poetry run fetch-weightsThey are not downloaded automatically at any point. Budget about 3 GB of free disk for the two together. Subsequent launches are fast; only the very first one runs a hardware benchmark, and its result is cached.
Poetry is recommended but not strictly required. Alternative:
# Using pip (advanced users)
pip install -e .However, Poetry ensures consistent dependency versions and is strongly recommended.
cd DRerio-LogAI
git pull origin main
poetry install # Update dependenciesMinimum:
- CPU: Dual-core, 2.0 GHz
- RAM: 8GB
- Storage: 5GB free space
- OS: Windows 10, Linux (Ubuntu 20.04+), macOS 11+
Recommended:
- CPU: Quad-core, 3.0 GHz+
- RAM: 16GB+
- GPU: NVIDIA GTX 1060 or better (6GB VRAM)
- Storage: 20GB+ SSD
Yes! CPU-only mode works but is slower:
- With GPU: 25-60 FPS real-time processing
- CPU only: 5-15 FPS (adequate for pre-recorded videos)
For live analysis, GPU strongly recommended.
Application: ~2GB (including models)
Per video analysis:
- 1-minute 1080p video: ~50MB results
- 10-minute 1080p video: ~300MB results
- 1-hour 4K video: ~2GB results
Plan for 2-3x video file size for complete results.
Yes, if it meets minimum requirements. Performance tips:
- Close other applications
- Use power adapter (not battery)
- Ensure adequate cooling
- Consider external GPU (eGPU) for better performance
All formats supported by OpenCV:
- Recommended: MP4 (H.264 codec)
- Supported: AVI, MOV, MKV, WEBM, FLV
- Not recommended: Uncompressed formats (huge file sizes)
Tested up to: 4K (3840x2160) Recommended: 1080p (1920x1080) Minimum: 480p (640x480)
Higher resolutions:
- ✅ Better detection accuracy
- ❌ Slower processing
- ❌ Larger output files
Resolution: 1080p (1920x1080) Frame rate: 30 FPS
This balances:
- Detection accuracy
- Processing speed
- File size
- Temporal resolution
Current version: No, single camera per session
Workaround: Run multiple instances of the application (resource-intensive)
Roadmap: Multi-camera support planned for v3.0
Lighting:
- Uniform, diffuse lighting (no harsh shadows)
- Avoid glare and reflections
- Consistent brightness across frames
Camera:
- Fixed position (no movement)
- Perpendicular to water surface
- High-quality lens (minimize distortion)
Recording:
- High bitrate (minimize compression artifacts)
- Consistent frame rate (no drops)
- Clean tank (no debris, algae)
Yes, but consider:
- Transfer video to computer first (don't run on phone)
- Use landscape orientation
- Stabilize phone during recording
- Export at highest quality
- Convert to MP4 if needed
Confidence threshold is the minimum score (0.0-1.0) required to accept a detection.
Low threshold (e.g., 0.3):
- ✅ Detects more subjects (fewer misses)
- ❌ More false positives (debris detected as fish)
High threshold (e.g., 0.7):
- ✅ Fewer false positives (high precision)
- ❌ May miss some subjects (lower recall)
Default (0.5): Good balance for most scenarios
YOLO:
- ✅ Better accuracy (state-of-the-art)
- ✅ Works on NVIDIA GPUs
- ❌ Slower on CPU
OpenVINO:
- ✅ Optimized for Intel CPUs
- ✅ Faster on Intel hardware
- ❌ Slightly lower accuracy
Recommendation: Start with YOLO. Switch to OpenVINO if you have Intel CPU and no NVIDIA GPU.
Track ID is a unique identifier assigned to each detected subject across frames.
ID changes (re-identification failures) occur when:
- Subject occlusions (one fish hides another)
- Subject exits and re-enters frame
- Similar-looking subjects swap positions
- Detection gaps (subject temporarily not detected)
To minimize ID changes:
- Increase confidence threshold (more consistent detections)
- Enable multi-subject tracking algorithms
- Improve video quality (better feature extraction)
Yes! Enable Multi-Subject Tracking in Wizard Step 4.
Supports:
- Up to 10 subjects simultaneously (tested)
- Individual metrics per track ID
- Track-by-track analysis in reports
Limitations:
- More prone to ID swaps (re-identification challenges)
- Slightly slower processing
- Requires higher confidence threshold
Typical accuracy (on zebrafish):
- Precision: 95-98% (few false positives)
- Recall: 92-96% (few misses)
- F1 Score: 93-97%
Factors affecting accuracy:
- Video quality (lighting, resolution, clarity)
- Subject size (larger = easier to detect)
- Background complexity (clean tank = better)
- Model selection (YOLO vs OpenVINO)
Yes, for custom species or setups. Requires:
- Annotated dataset (100+ images with bounding boxes)
- YOLO training pipeline (see
docs/MODEL_TRAINING.md- coming soon) - GPU for training (6GB+ VRAM)
- ~4-8 hours training time
Custom models can be loaded in Wizard Step 4.
Spatial metrics:
- Total distance traveled (cm)
- Average speed (cm/s)
- Maximum speed (cm/s)
- Time in each ROI (seconds, %)
Behavioral metrics:
- ROI entries and exits
- Dwell time per ROI
- Movement patterns (trajectory)
- Activity levels (speed over time)
Custom metrics can be calculated from raw tracking data (Parquet files).
Parquet is a columnar binary format for efficient data storage.
Opening Parquet files:
Python (pandas):
import pandas as pd
df = pd.read_parquet("3_CoordMovimento_my_video.parquet")
print(df.head())R:
library(arrow)
df <- read_parquet("3_CoordMovimento_my_video.parquet")
head(df)Excel/Viewer: Use Parquet Viewer (Windows GUI)
Yes! Change export format in Wizard Step 5 → Export Format.
Formats:
- Parquet (default, most efficient)
- CSV (Excel-compatible, larger files)
- JSON (web applications, human-readable)
Or convert after analysis:
import pandas as pd
df = pd.read_parquet("file.parquet")
df.to_csv("file.csv", index=False)Load Parquet file in Python and use pandas:
import pandas as pd
df = pd.read_parquet("3_CoordMovimento_video.parquet")
# Calculate instantaneous speed
df['speed'] = df.groupby('track_id')[['x_cm', 'y_cm']].diff().pow(2).sum(axis=1).pow(0.5)
# Time above threshold (5 cm/s)
fast_frames = df[df['speed'] > 5].shape[0]
fps = 30 # Video frame rate
time_fast = fast_frames / fps
print(f"Time swimming fast: {time_fast:.2f} seconds")More examples: See docs/CUSTOM_ANALYSIS.md (coming soon)
Calibration converts pixel coordinates to physical units (cm).
Without calibration:
- Coordinates in pixels (px)
- No distance/speed metrics
With calibration:
- Coordinates in centimeters (cm)
- Distance traveled (cm)
- Speed (cm/s)
To calibrate: Place object of known size in arena, measure in pixels, specify real size.
Forever (until you delete them). Results are saved locally in:
-
<video_name>_results/(pre-recorded videos) -
live_analysis_sessions/(live camera sessions)
Best practices:
- Archive old results to external storage
- Use descriptive experiment IDs for organization
- Back up important results
Common causes:
- No GPU acceleration: CPU-only mode is 3-5x slower
- High resolution: 4K videos take 4x longer than 1080p
- Low confidence threshold: More detections = more processing
- Insufficient RAM: System swapping to disk
Solutions: See Troubleshooting Guide
For NVIDIA GPUs:
-
Install CUDA Toolkit and cuDNN
-
Install GPU-enabled PyTorch:
poetry run pip install torch torchvision --index-url https://download.pytorch.org/whl/cu118
-
Restart application
-
Check Help → System Info to verify GPU detected
For Intel GPUs:
- OpenVINO automatically uses Intel GPU if available
- No additional configuration needed
Yes! Use Batch Processing:
- File → Batch Processing
- Add videos to queue
- Configure shared settings (or use per-video settings)
- Click Start Batch
Parallel videos: Controlled by performance.max_parallel_videos setting (default: 2)
Frame skipping analyzes every Nth frame instead of all frames.
Skip 1 (default): Analyze every frame Skip 2: Analyze every 2nd frame (50% speed increase) Skip 5: Analyze every 5th frame (5x speed increase)
Use cases:
- ✅ Slow-moving subjects (zebrafish at rest)
- ✅ Long videos (1+ hours)
- ✅ Quick preliminary analysis
Avoid for:
- ❌ Fast movements (may miss behavior)
- ❌ Short videos (minimal time savings)
- ❌ High temporal resolution needed
Typical usage:
- Application: ~500MB
- Video buffer: ~200MB per minute of 1080p video
- AI model: ~500MB (YOLO) to ~1GB (large models)
- Processing: ~1-2GB temporary data
Total: 2-4GB for typical session
High-resolution videos (4K): May use 6-8GB
DRerio LogAI can send commands to Arduino microcontrollers based on ROI events.
Use cases:
- Trigger LED lights when fish enters zone
- Activate pumps/feeders based on behavior
- Synchronize with external devices
- Closed-loop behavioral experiments
Setup: See docs/ARDUINO_INTEGRATION.md (coming soon)
Yes! ROI tools support:
- Rectangle: Click and drag
- Polygon: Click corners to define arbitrary shape
- Circle: Center + radius
Complex shapes: Use polygon tool with many vertices
ROI templates save ROI configurations for reuse across projects.
Workflow:
- Configure ROIs in Project Wizard
- File → Save ROI Template
- In future projects: File → Load ROI Template
Use cases:
- Consistent experimental setup
- Multi-day experiments
- Batch processing with same ROIs
Yes! Heatmaps are automatically saved as PNG images in results directory:
<video_name>_heatmap.png- Resolution matches original video
- Color scale: Blue (low) → Red (high)
Or generate manually:
from zebtrack.analysis import generate_heatmap
generate_heatmap("3_CoordMovimento_video.parquet", output="heatmap.png")Use Python API for automation:
from zebtrack.core import Controller
from zebtrack import load_settings
settings = load_settings()
controller = Controller(settings)
# Process multiple videos
videos = ["video1.mp4", "video2.mp4", "video3.mp4"]
for video in videos:
controller.load_video(video)
controller.configure_detection(confidence=0.5)
controller.run_analysis()
print(f"Completed: {video}")More examples: See docs/SCRIPTING_GUIDE.md (coming soon)
Quick fixes:
- Check camera is connected (USB)
- Try different USB port
- Check camera permissions (Windows: Settings → Privacy → Camera)
- Restart application
- Try different camera ID (0, 1, 2 in settings)
Details: Troubleshooting Guide - Camera Not Found
Immediate fixes:
- Increase confidence threshold (0.5 → 0.6+)
- Improve lighting (uniform, bright)
- Clean tank (remove debris)
- Try different model (YOLO → OpenVINO or vice versa)
Details: Troubleshooting Guide - Low Detection Accuracy
Common causes:
- Insufficient RAM: Close other applications
- Corrupted video file: Try different video
- GPU memory overflow: Reduce batch size or resolution
- Python version mismatch: Ensure Python 3.12+
Debugging:
- Check logs:
logs/zebtrack.log - Run with verbose logging:
poetry run zebtrack --verbose - Report bug: GitHub Issues
Check:
- Calibration: Is physical unit conversion correct?
- ROI definitions: Are ROIs drawn accurately?
- Track IDs: Are there many ID swaps? (affects per-track metrics)
- Video quality: Is detection accuracy acceptable (>90%)?
Validation:
- Manually inspect annotated video
- Check detection rate in analysis summary
- Compare trajectory plots to expected behavior
Documentation:
- User Guide
- Troubleshooting Guide
- Developer docs:
docs/
Community:
Direct support:
- Email: marco.sant@unesp.br
Contributions welcome! See Contributing Guide for:
- Bug reports
- Feature requests
- Code contributions
- Documentation improvements
- Testing and validation
GitHub repository: https://github.com/MarkSant/DRerio-LogAI
Structure:
DRerio-LogAI/
├── src/zebtrack/ # Application code
├── tests/ # Test suite
├── docs/ # Documentation
├── config.yaml # Default settings
└── pyproject.toml # Dependencies
Yes! The MIT License allows commercial use with no restrictions.
Requirements:
- Include original copyright notice
- Include MIT License text
No warranty: Software provided "as-is"
MIT License - permissive, open-source
You are free to:
- Use commercially
- Modify and distribute
- Use privately
- Sublicense
See LICENSE file for full text.
Temporary citation (until formal publication):
DRerio LogAI - Automated Zebrafish Behavioral Tracking System
https://github.com/MarkSant/DRerio-LogAI
Version 2.1 (2025)
Formal citation coming soon with peer-reviewed publication.
Last Updated: November 2025 Version: 2.1 For more questions: Open an issue or email marco.sant@unesp.br