How nikitasharma768/farm-ng-pest-model works
This repository implements pest detection for farm-ng Amiga, with both an offline image-folder workflow and a ROS 2 deployment. The primary workflow detects a trap, filters for insects, classifies species, then records detections for field heatmaps. Dataset preparation, model training, evaluation, and taxonomic/data-gap analysis are supporting product capabilities. ROS topic links and the offline output workflow are documented; source excerpts establish the central inference calls and ROS heatmap generation. Other unsampled implementation details are not inferred.
Main entry points: pipeline.py Inference orchestrator · heatmap_node.py ROS heatmap logger · pest_detection.launch.py ROS launch · trap_detector_node.py ROS trap detector
Components 24
Inference pipeline
- Batch runner
src/run_all.py - Inference orchestrator
src/pipeline.py - Trap detection
src/trap_detector.py - Insect filter
src/pipeline.py - Species classifier
src/pipeline.py
ROS deployment
- ROS trap detector
ros2_nodes/pest_detection_nodes/trap_detector_node.py - ROS insect filter
ros2_nodes/pest_detection_nodes/binary_filter_node.py - ROS species classifier
ros2_nodes/pest_detection_nodes/species_classifier_node.py - ROS heatmap logger
ros2_nodes/pest_detection_nodes/heatmap_node.py - ROS launch
ros2_nodes/launch/pest_detection.launch.py
Field outputs
- PNG heatmap
src/heatmap.py - HTML heatmap
src/heatmap_html.py
Data and models
- Dataset preparation
src/prepare_dataset.py - Binary dataset builder
src/build_binary_dataset.py - Species model training
src/train.py - Binary model training
src/train_binary.py
Evaluation and analysis
- Pipeline evaluation
src/evaluate_pipeline.py - Binary evaluation
src/evaluate_binary.py - Dataset gap analysis
src/gap_analysis.py - Taxonomic error analysis
src/analyze_confusion.py - Taxonomy validation
src/taxonomy_check.py
Other components
- Image operator
- Amiga camera
- Amiga GPS
Connections 24
- Image operator → Batch runner: provides images
README.md - Batch runner → Inference orchestrator: runs pipeline
README.md - Inference orchestrator → Trap detection: detects traps
src/pipeline.py - Inference orchestrator → Insect filter: classifies insect
src/pipeline.py - Inference orchestrator → Species classifier: classifies species
src/pipeline.py - Inference orchestrator → PNG heatmap: produces heatmap
- Inference orchestrator → HTML heatmap: produces heatmap
- Amiga camera → ROS trap detector: publishes frames
README.md - ROS trap detector → ROS insect filter: publishes crops
README.md - ROS insect filter → ROS species classifier: forwards insects
README.md - ROS species classifier → ROS heatmap logger: publishes species
README.md - Amiga GPS → ROS heatmap logger: provides fixes
README.md - ROS heatmap logger → PNG heatmap: runs generator
ros2_nodes/pest_detection_nodes/heatmap_node.py - ROS heatmap logger → HTML heatmap: runs generator
ros2_nodes/pest_detection_nodes/heatmap_node.py - ROS launch → ROS trap detector: starts node
ros2_nodes/launch/pest_detection.launch.py - ROS launch → ROS insect filter: starts node
ros2_nodes/launch/pest_detection.launch.py - ROS launch → ROS species classifier: starts node
ros2_nodes/launch/pest_detection.launch.py - ROS launch → ROS heatmap logger: starts node
ros2_nodes/launch/pest_detection.launch.py - Dataset preparation → Species model training: prepares data
- Binary dataset builder → Binary model training: prepares data
- Inference orchestrator → Pipeline evaluation: evaluated by
src/evaluate_pipeline.py - Binary model training → Binary evaluation: evaluated by
- Dataset gap analysis → Dataset preparation: guides coverage
- Taxonomic error analysis → Taxonomy validation: checks taxonomy