This system combines deep learning-based wildlife classification with explainable AI visualizations and comprehensive reporting. It's designed for wildlife monitoring via camera traps and creates detailed reports for forest officers. Missouri Camera Traps LILA.
- Wildlife species classification using EfficientNet-B3
- Explainable AI visualizations using GradCAM
- Comprehensive HTML reports with model interpretations
- Wildlife safety hazard assessment and handling protocols
- Optional PDF report generation
- Integration with CrewAI for in-depth wildlife analysis
- Various report templates for different species
- Python 3.8+ with pip
- PyTorch and torchvision
- Required Python packages (see requirements.txt)
Run the installation script to set up everything automatically:
python install.pyOr manually install dependencies:
pip install -r requirements.txtTo analyze a wildlife image and generate a comprehensive HTML report:
python analyze_wildlife.py --image_path "path/to/your/image.jpg"To analyze one of the sample images:
python analyze_wildlife.py --sample [number]To generate an enhanced HTML report with integrated markdown analysis:
python integrate_markdown_report.py --image_path "path/to/your/image.jpg"This combines the standard HTML report with additional AI-generated wildlife analysis in markdown format.
For specialized reports focused on wildlife safety, handling procedures, and risk assessment:
python wildlife_safety_protocol.py --image_path "path/to/your/image.jpg"This generates a comprehensive safety report that includes:
- Detailed animal hazard assessment
- Safe handling protocols specific to the species
- Risk factors and safety precautions
- Step-by-step guidance for wildlife management personnel
This feature is especially useful for forest officers and wildlife management teams dealing with potentially dangerous wildlife.
For all report scripts, you can specify:
--output_dir- Directory to save generated reports (default: varies by script)--model_path- Custom model path (default: wildlife_classifier_best.pth)--class_mapping- Custom class mapping file (default: class_mapping.json)
PDF Options (for scripts with PDF support):
--generate_pdf- Generate a PDF version of the report
-
Wildlife Classification
xai_inference_example.py- Core inference with EfficientNet-B3explainable_ai.py- GradCAM visualizations
-
Reporting System
inference_to_cvai.py- Main integration scriptintegrate_markdown_report.py- Enhanced reporting with markdownanalyze_wildlife.py- User-friendly wrapperwildlife_safety_protocol.py- Safety-focused reporting
-
Report Templates
report_templates/- Species-specific report templates
To add templates for new species:
- Create a new file in
report_templates/named[species]_report.txt - Follow the template format in existing reports
You can customize the HTML report by modifying the generate_standalone_report function in inference_to_cvai.py.
If you encounter issues with report generation:
- Ensure all dependencies are installed
- Check file paths and permissions
- For PDF conversion issues, manually convert HTML to PDF using your web browser
- For safety protocol features, ensure CrewAI is properly installed
This project is licensed under the MIT License - see the LICENSE file for details.