\documentclass[acmtog,nonacm,screen]{acmart}

\usepackage[utf8]{inputenc} % allow utf-8 input
\usepackage[T1]{fontenc}    % use 8-bit T1 fonts
\usepackage{url}            % simple URL typesetting
\usepackage{microtype}      % microtypography

\usepackage{xcolor}        
\usepackage{pdfpages}
\usepackage{graphicx}
\usepackage{svg}
\usepackage[labelfont=bf,textfont=it,font=small]{caption}
\usepackage{parskip}

%\usepackage{mathpazo}
% \usepackage{times}
\usepackage{booktabs}
\usepackage{listings}
\usepackage{float}
\usepackage{subcaption} 
\usepackage{adjustbox}
\usepackage{tcolorbox}

\usepackage{listings} % settings in macros.tex
\usepackage{xspace} % used for latin abbrevation macros
\usepackage{graphicx} %% used by snippet-styling
\usepackage{mdframed} %% used by snippet-styling
\usepackage{lipsum} %% used for testing

\usepackage{ifthen}
\usepackage{enumitem}
\usepackage{placeins}
\usepackage{afterpage}
\usepackage{subfiles}
\usepackage{textcomp}
\usepackage{manyfoot}

\usepackage[noend]{algpseudocode}
\usepackage{algorithm}
\usepackage{amsmath}

%% Mathematical typesetting
%% The amssymb package provides various useful mathematical symbols
%% The amsthm package provides extended theorem environments
% \usepackage{amssymb}
\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{nicefrac}        % compact symbols for 1/2, etc.
\usepackage{siunitx}
\usepackage{amsfonts}
\usepackage{mathrsfs}

\usepackage[title]{appendix}


% \usepackage{algorithm}%
% \usepackage{algorithmicx}%
% \usepackage{algpseudocode}%
% \usepackage{listings}%

% \usepackage{algorithm}
% \usepackage[algo2e,ruled,noend]{algorithm2e}
% \usepackage{algorithm2e}
% \usepackage{algorithmic}
% \usepackage{algpseudocode}

% \usepackage[numbers,sort&compress]{natbib} 


\usepackage{tikz}
\usetikzlibrary{patterns}
\usepackage{pgfplots}
\usepackage{pgfplotstable}
\pgfplotsset{compat=newest,scaled y ticks=true} % Allows to place the legend below plot
\usepgfplotslibrary{units} % Allows to enter the units nicely
\usetikzlibrary{spy}
\usetikzlibrary{backgrounds}
\usetikzlibrary{shapes,arrows,positioning,intersections,quotes}
\usetikzlibrary{matrix}
\usepackage{csvsimple}
\usepackage{graphbox} %loads graphicx package

%% Fixed Width Tables
% \usepackage{multicol}
\usepackage{tabularray}
\usepackage{tabulary}
\usepackage{colortbl}
\usepackage[referable]{threeparttablex}
\usepackage{multirow}
\usepackage{verbatim}
% \usepackage{fancyvrb}
\usepackage{fvextra}
% \usepackage[switch,pagewise]{lineno} 

% Hyperref must be the last package loaded
% \usepackage[pdfborder={0 0 0},allcolors=DarkBlue]{hyperref}

\newcommand{\cref}[2]{\hyperref[#2]{#1~\ref*{#2}}}
\newcommand{\colref}[3]{\hyperref[#2]{#1~\ref*{#2}{#3}}}
\newcommand{\figref}[1]{\cref{Fig.}{#1}}
\newcommand{\figrefA}[2]{\colref{Fig.}{#1}{#2}}
\newcommand{\secref}[1]{\cref{Section}{#1}}
\newcommand{\eqnref}[1]{\cref{Equation}{#1}}
\newcommand{\tabref}[1]{\cref{Table}{#1}}
\newcommand{\algoref}[1]{\cref{Algorithm}{#1}}
\newcommand{\thmref}[1]{\cref{Theorem}{#1}}
\newcommand{\lemref}[1]{\cref{Lemma}{#1}}
\newcommand{\remref}[1]{\cref{Remark}{#1}}
\newcommand{\figrefs}[2]{\hyperref[#1]{Figure~(\ref*{#1}--\ref*{#2})}} 


\graphicspath{{Figures/}}
\DeclareGraphicsExtensions{.pdf,.png,.jpg}
\setlength{\textfloatsep}{6pt plus 1pt minus 2pt}
\setlength{\abovecaptionskip}{6pt plus 1pt minus 2pt} 

\begin{document}
\bibliographystyle{unsrtnat}

% Title options from plain.txt
% "PestIDBot: Region-Aware Knowledge Exchange for Sustainable Pest Management"
% "Cross-Regional Pest Management Knowledge Through Digital Integration"
% "PestIDBot: Bridging Regional Pest Management Knowledge Gaps"
\title{PestIDBot: Region-Aware AI for Sustainable Pest Management}
%Vision Enabled Conversational AI Agent for Integrated Pest Management Applications in Agriculture }


% \author{Muhammad Arbab Arshad}
% \affiliation{%
%   \institution{Iowa State University }
%   \country{USA}
% }
%\author{Elizabeth Tranel}
% \email{arti@iastate.edu} 
% \authornote{Corresponding author.}
% \affiliation{%
%   \institution{Iowa State University}
%   \country{USA}
% }

% \author{Hossein ZareMehrjerdi}
% \affiliation{%
%   \institution{Iowa State University}
%   \country{USA}
% }

% \author{Asheesh K Singh}
% \affiliation{%
%   \institution{Iowa State University}
%   \country{USA}
% }
% \author{Baskar Ganapathysubramanian}
% % \email{baskarg@iastate.edu}
% % \authornote{Corresponding author.}
% \affiliation{%
%   \institution{Iowa State University}
%   \country{USA}
% }
% \author{Arti Singh}
% \email{arti@iastate.edu} 
% \authornote{Corresponding author.}
% \affiliation{%
%   \institution{Iowa State University}
%   \country{USA}
% }

% \author{Soumik Sarkar}
% % \email{soumiks@iastate.edu}
% % \authornote{Corresponding author.}
% \affiliation{%
%   \institution{Iowa State University}
%   \country{USA}
% }
% \author{Authors List incomplete}
% \email{soumiks@iastate.edu}
% \authornote{Corresponding author.}
% \affiliation{%
%   \institution{XYZ}
%   \country{USA}
% }



\renewcommand{\shortauthors}{Arshad et al.}


\begin{abstract}
\textbf{70 words} 

Effective pest management is local, yet the guidance is fragmented. PestIDBot pairs specialist vision models for insects and weeds with region-aware retrieval-augmented generation to deliver species- and location-specific IPM. Across 90 priority species in North America, Africa, and India, it increases retrieval relevance and expert-verified applicability while abstaining under uncertainty, thus reducing misidentification and hallucinated advice that commonly arise with generalist frontier models...
% Regional pest management requires access to locally relevant information, yet knowledge remains fragmented across geographic boundaries, limiting farmers' ability to implement effective control strategies for transboundary pests.
% PestIDBot addresses this challenge by integrating deep learning-based pest identification (InsectNet and WeedNet) with a species-specific metadata filtering system that selectively retrieves regionally appropriate information from expert-curated resources, increasing retrieval precision from {\color{gray}X\%} to {\color{gray}Y\%}
% Our conversational interface leverages this filtered knowledge through a retrieval-augmented generation pipeline, enabling large language models to provide regionally appropriate management strategies with {\color{gray}X\%} expert-verified accuracy across North America, Africa, and India. This two-stage approach delivers contextually relevant recommendations for 90 pest species while maintaining a natural conversational experience throughout the decision-making process.
% Length: ~70 words, 3 sentences
\end{abstract}

\keywords{
Integrated Pest Management (IPM); 
Region-aware AI; 
Retrieval-Augmented Generation (RAG); Agricultural Computer Vision; 
Uncertainty-Aware Decision Support 
Invasive and Transboundary Pests; 
Sustainable Agriculture; 
Human-in-the-Loop AI.
}

\maketitle

\textbf{1500 words with no headers} 

Pests and weeds spread across countries and continents through trade, travel, and climate-driven range shifts, so national borders no longer reliably protect farmers ~\cite{Paini2016}. Local management systems through extension, regulations, and IPM programs were designed for relatively stable, well‑known pest complexes and struggle when new or shifting pests keep arriving, turning “local” problems into trans-boundary ones ~\cite{Montgomery2023}. Meanwhile, high‑quality, context‑specific management guidance in local language, aligned with regulations, product availability, and resistance status, diffuses much more slowly. Consequently, a farmer may encounter a pest introduced from another country long before best practices and policies developed elsewhere become accessible in a timely, usable, and localized form. 

Current foundation models exhibit strong pattern recognition and text generation capabilities, yet their output remains poorly conditioned on local agronomic, regulatory, and market constraints. While image classifiers can assign species labels from field photographs and large language models can synthesize management narratives, these generic inferences typically fail to incorporate jurisdiction-specific regulations, product registrations and withdrawals, resistance-management requirements, and farm-level resource constraints. Recent agricultural question–answering benchmarks explicitly designed to evaluate locality awareness and multi-step agronomic reasoning report that state-of-the-art frontier models correctly resolve only ~36\% of items, indicating that they frequently produce high-confidence recommendations that are legally non-compliant, logistically infeasible, or misaligned with integrated pest and resistance management principles. This performance gap underscores the need for architectures that couple foundation models with structures for local knowledge, decision constraints, and human oversight, rather than treating them as standalone agronomic decision-makers.~\cite{zaremehrjerdi2025towards}.

Effective pest management is inherently context-dependent, yet decision support for farmers remains siloed across taxa, regions, and information systems. PestIDBot integrates specialist supervised vision models for insects and weeds with a region-aware retrieval-augmented generation architecture that conditions the jurisdiction, production system, and resistance status to deliver species- and location-specific IPM recommendations. Instead of relying solely on end-to-end generation, the system constrains output through curated, geo-indexed IPM corpora, label and regulatory documents, and extension guidance, and employs explicit abstention policies when classification confidence, retrieval relevance, or regulatory alignment fall below predefined thresholds. In evaluations spanning 90 priority species across North America, Africa, and India, PestIDBot improves document-level retrieval relevance and expert-verified applicability relative to generalist frontier models, while substantially reducing misidentification and hallucinated or non-compliant advice. Framed within a sustainability perspective, this architecture operationalizes AI as a boundary technology that links local agronomic realities with global model capabilities, supporting more precise, regulation-aligned interventions, and reducing unnecessary broad-spectrum pesticide use.

\begin{figure}[t]
    \centering
    \includegraphics[width=\linewidth]{figures-in-making/agricultural-ai-system-compact.pdf}
    \caption{Overview of the PestIDBot system, showing the integration of specialist vision models and region-aware retrieval-augmented generation for pest management.}
    \label{fig:system-overview}
\end{figure}

Its reliability is based on two choices that depart from standard “frontier model” pipelines. First, we build on specialist vision models tuned for agriculture. InsectNet~\cite{chiranjeevi2025insectnet} recognizes> 4000 species with> 98\% precision and provides global to local fine-tuning for region-specific identification. Similarly, WeedNet~\cite{shen2025weednet} recognizes> 1500 weed species with > 91\% accuracy, with global-to-local finetuning producing> 97.38\% accuracy for an Iowa-localized model that covers 85 species. Both specialist vision models incorporate out-of-distribution (OOD) detection and conformal prediction to avoid brittle predictions and abstain when uncertain. This is a pattern that we exploit to maintain robust ID while allowing retrieval to drive regional nuance. Generic frontier LLM/LVMs, by contrast, struggle to deliver context-specific agronomic actions and are prone to hallucinating management steps without proper sources; their limitations motivate our decision to ground every response in curated, region-tagged documents rather than relying solely on generation.

Stage 1 (InsectNet) achieved a top-1 precision of 98. 6\% across broader taxa that map to multiple genera or families rather than single species (see the supplementary for details). Regional F1 scores were 0.98 in North America, 0.93 in Africa, and 0.94 in India. The detection of OOD reached an AUROC of 0.99, and the conformal prediction with $\alpha = 0.05$ covered the correct label in 95\% of the cases. The system mainly abstained from low-light, occluded, or unfamiliar views, thereby preventing misidentification from cascading into harmful advice. WeedNet follows the same uncertainty controls; performance details are in the supplementary materials. The prior validations of our specialist models (life-stage invariance in insects; global-to-local generalization in weeds) support these outcomes.

Stage 2 converts species and region into retrieval metadata based on a curated knowledge base of extension bulletins, field guides, and research synopses. Documents are chunked and tagged with [$species$, $region$]; queries first retrieve [$species$ $\cap$ $region$], then back off to [$species$-only] with a rerank that prioritizes ecological/regulatory similarity (see the Methods and Appendix for additional details). The different metadata filtering strategies across species and geographies, region-aware retrieval proves decisive: precision@5 jumps from 0.80 (no filtering, semantic search only) to 1.00 when both species and geography metadata are applied, while species-only filtering also reaches 1.00, and nDCG@5 climbs from 0.69 to 0.90. Geography-only filtering contributes modestly (precision@5: 0.82), but the combination of species and geography metadata delivers the strongest performance, ensuring that regionally appropriate guidance surfaces first without sacrificing coverage. In a multi-region expert study (\textcolor{red}{FF} agronomists/extensionists/region), the share of responses rated applicable in the rater's context increases by \textcolor{red}{GG} percentage points, and intended broad-spectrum pesticide use decreases by \textcolor{red}{HH\%} relative to region-agnostic retrieval. These gains flow from localization, and not verbosity. The system produces concise, cited answers when the evidence is strong and retrieval-only summaries when it is not.

Four vignettes illustrate why localization and specialization matter.

% ============================================================================
% PESTIDBOT MOTIVATION TABLE
% ============================================================================
\begin{table}[t]
\centering
\footnotesize
\renewcommand{\arraystretch}{1.2}
\begin{threeparttable}
\caption{Four vignettes illustrating regional differences and the need for specialized vision and region-aware retrieval in pest management.}
\label{tab:motivation}
\begin{tabular}{m{0.85cm}m{3.1cm}m{2.9cm}}
\toprule
\textbf{Pest} \newline \textbf{Species} & \textbf{Regional Difference / Challenge} & \textbf{PestIDBot Capability} \\
\midrule
\midrule
\rotatebox[origin=c]{90}{\parbox{1.8cm}{\centering Spotted\\ Lanternfly}}\tnote{a} & Varies across life stages (eggs, instars, adults); risk of misidentification requires confident detection & Life-stage robust ID; abstains when uncertain \newline \textit{(Stage 1)} \\
\midrule
\rotatebox[origin=c]{90}{\parbox{1.8cm}{\centering Witchweed\\ \textit{(Striga)}}}\tnote{b} & Africa/India (smallholder constraints): resistant varieties, intercrops; US: eradication protocols, quarantine & Region-filtered recommendations \newline \textit{(Stage 2)} \\
\midrule
\rotatebox[origin=c]{90}{\parbox{1.8cm}{\centering Old World\\ Bollworm}}\tnote{c} & Management recommendations approved in the US may not be approved for use in African or Indian production systems.& Regulatory-aware guidance \newline \textit{(Stage 2)} \\
\midrule
\rotatebox[origin=c]{90}{\parbox{1.8cm}{\centering Sahara\\ Mustard}}\tnote{d} & Port-of-entry screening; partial/low-light images; misidentification historically enabled spread & Abstention $\rightarrow$ triage $\rightarrow$ escalate \newline \textit{(Stage 1+2)} \\
\bottomrule
\end{tabular}
\begin{tablenotes}
\footnotesize
\item[a] Confirmed in 18 US states; $\sim$23M acres in Iowa valued at US\$17.5B at risk.
\item[b] Infests $\sim$50M ha in sub-Saharan Africa (up to 75\% yield loss, >\$10B annual damage); regulated on 2,530 acres in US.
\item[c] Causes $\sim$\$3B damage annually; spread from Africa, Asia, Australia, Europe to Americas.
\item[d] Threatens Coachella Valley and Mojave desert ecosystems; reduces biodiversity.
\end{tablenotes}
\end{threeparttable}
\end{table}

\textbf{Spotted lanternfly (SLF) and tree of heaven:}
\textit{Ailanthus altissima}, introduced to the United States in the 1700s as an ornamental plant, now dominates many disturbed landscapes and serves as a principal host for \textit{Lycorma delicatula} \citep{Hu1979, AnimalandPlantHealthInspectionService2024}. When SLF was first reported in 2014, the population sizes indicated the introduction 2-3 years earlier, underscoring the value of early detection \citep{Barringer2015}. SLF is now confirmed in 18 US states, including a 2023 detection in Illinois, and its host range exceeds 100 plant species, including soybeans and corn, covering ~23 million acres in Iowa valued at approximately US \$17.5 billion \citep{IllinoisDepartmentofAgriculture2023, CDFASLF, CornellCALS, USDepartmentofAgriculture2024, NASS2024}. Although not yet established in Iowa, establishment would pose serious risks to state and regional agriculture with broader economic impacts \citep{Schumm2025}.

With specialist training, PestIDBot returns lifestage-robust IDs (egg masses, early/late instars, adults) with an accuracy of \textcolor{red}{99\%}. In a high-confidence SLF identification, the response is immediately localized, with surveillance trap density, quarantine, and reporting links, as well as treatment windows tailored to the user's jurisdiction, all sourced from extension bulletins and regulatory guidance. When confidence is low (e.g. backlit egg masses on rough bark), OOD / conformal guardrails abstain and change to a reimage / escalation script so novice users avoid brittle guesses and move quickly from first sighting to the correct local action (scouting $\rightarrow$ reporting $\rightarrow$ containment) rather than defaulting to generic pesticide use.


\textbf{Witchweed (\textit{Striga} spp.):} Parasitic \textit{Striga} is native to Africa and India and is among the most destructive weeds of staple cereals; in sub-Saharan Africa it infests $\sim$ 50 million hectares, causing up to 75\% yield loss and $>$ US\$10 billion annual damage \citep{UnitedStatesDepartmentofAgricultureWitchweed2025, dafaallah2019biology, David2022}. In the United States, \textit{S. asiatica} was first detected in 1956 and triggered long-running eradication programs; today red witchweed remains regulated on 2,530 acres in seven counties in North and South Carolina to prevent spread \citep{Garriss1956, Davidson2024}. A midwestern incursion would imperil corn and soybean production. PestIDBot compiles expert-curated guidance from Africa, India, and the United States and orders responses by region first. Then it provides cross-regional alternatives with clear transferability notes. In smallholder settings with constraints on seed, labor, herbicide access, and resistance management, region-aware retrieval prioritizes host resistance, intercrops (\textit{Desmodium}), sanitation, and seed treatments; in contrast, North American materials emphasize eradication protocols, quarantine, and regulated movement. When local documentation is limited (e.g., biological control in a specific subregion), the system acknowledges the gap, presents vetted practices from ecologically similar regions, and flags items requiring local validation. For users with limited connectivity or extension access, the response involves a staged plan that includes pre-season sanitation and the use of resistant varieties, followed by in-season scouting with selective interventions, and concluding with post-harvest field hygiene. This replaces 'herbicide first' defaults, reduces unnecessary spending, and shortens time-to-action. See \secref{sec:supp} for region-specific exemplars and source sets.

\textbf{Old World bollworm (\textit{Helicoverpa armigera}) and regulatory context:} A highly polyphagous lepidopteran, \textit{H. armigera} feeds on a wide variety of crops and is estimated to cause $\sim$US\$3 billion in damage annually; in recent years, it has spread from native ranges in Africa, Asia, Australia, and Europe to Central and South America \citep{Riaz2021, UnitedStatesDepartmentofAgricultureUSDA2025}. 
Control methods for pests vary by region due to resource availability, legal regulations, or socially accepted practices thus making 'one-size-fits-all' guidance impractical~\citep{ISAAA2019}. PestIDBot detects the user region and returns two clearly separated pathways based on the source. Where chemical methods are approved and available, it emphasizes chemical names, rates, and mixes; where accepted management techniques rely more on cultural controls, it provides recommendations such as crop timing, sanitation, pheromone-based monitoring, / mitigation disruption, and biological control methods. In practice, this steers decisions toward compliant, lower-risk interventions and curbs drift to broad-spectrum pesticides when recommended options are not actually available.

\textbf{Ports of entry and Sahara mustard (\textit{Brassica tournefortii}):} \textit{B. tournefortii} is native to the Middle East and surrounding regions and was likely introduced to the United States in the early 20\textsuperscript{th} century through trade to California \citep{SandersAndMinnich}. Its rapid spread was long misidentified, aided by prolific seed production and broad environmental tolerance \citep{SandersAndMinnich, Rodriguez}. At US ports of entry, Customs and Border Protection (CBP) screens materials for invasive pests in coordination with APHIS; intercepted samples are stored for further diagnostics, which can extend the interval between first sighting and confirmed identification \citep{USDHS, USCustomsandBorderProtection2024}. PestIDBot is designed for precisely these conditions. When images are partial, low light, or motion blurred, the OOD/conformal guardrails abstain and switch to a retrieval-only triage card: how to reimage (scale reference, multiple angles), how to secure a specimen (bag/label, chain-of-custody fields), and which jurisdiction-specific hold-and-notify steps to follow, with links to local diagnostic laboratories and reporting portals. When confidence is high, the guidance is immediately region-specific (containment and sanitation checklists, label-conformant disinfestation options, and agency-appropriate documentation templates), reducing time to escalation and the risk of off-label actions. Retrospectively, such an abstain $\rightarrow$ triage $\rightarrow$ escalate loop could have flagged early US detections of Sahara mustard as OOD/possible look-alike, prompted targeted reimaging and rapid expert confirmation, and surfaced desert-ecosystem containment SOPs before widespread misidentification. Ideally, the same loop shortens the path from the first sighting to a compliant action, enabling earlier, lower-risk interventions by inspectors and land managers. This matters: In the Coachella Valley and the Mojave, Sahara mustard outperforms native species by germinating earlier and monopolizing soil resources, thereby reducing biodiversity and weakening the ecosystem's resilience under a warming climate \citep{Dianne2008}.

These examples underscore why specialized and grounded architectures are better than superior to generic and fluent ones. Specialist vision reduces misidentification; uncertainty gates keep the system honest; region-aware retrieval changes what is said. Together, they lead to earlier action, fewer harmful recommendations, and less intended use of broad-spectrum chemicals, which is exactly the sustainability levers IPM seeks to pull. By making local the default and generic the fallback, PestIDBot offers a practical approach to less pesticide-intensive management, while remaining transparent about the associated gaps and trade-offs.

% \textbf{Spotted lanternfly (SLF) and tree of heaven}: \textit{Ailanthus altissima} is ubiquitous across disturbed landscapes in North America and serves as a principal host of \textit{Lycorma delicatula}. SLF identification requires life-stage coverage (egg masses, early/late instars, adults) and strict differentiation from look-alikes. With specialist training, PestIDBot returns life-stage-robust IDs with accuracy of \textcolor{red}{99\%}. For a high-confidence SLF identification, the response is immediately localized, providing suggestions about surveillance trap density, quarantine and reporting links, and treatment windows for the user’s jurisdiction, all sourced from extension bulletins. When confidence is low (e.g., backlit eggs on rough bark), the OOD/conformal guardrails abstain and suggest additional re-imaging or escalation to a human via submitting a report. This prevents novice users from acting on brittle guesses and shortens the path from first sighting to the correct local action (scouting $\rightarrow$ reporting $\rightarrow$ containment) instead of resorting to generic pesticide use.

\section*{Methods}
\textbf{500 words max}
Methods ($\leq$500 words)

\textbf{Scope and datasets}: We curated \textcolor{red}{N} images for 90 species (⟨insects: \textcolor{red}{A}; weeds: \textcolor{red}{B}) spanning North America, Africa, and India. Each item is assigned species and region tags that are assigned to standardized taxonomies. We created train/validation/test splits stratified by species and region (for robustness, we defined two OOD protocols: (i) held-out species and (ii) held-out geography (species seen in training, region unseen)). Detailed knowledgebank characteristics are provided in the supplementary materials (Figure~\ref{fig:knowledgebank-analysis}).

\textbf{Models and uncertainty}. Stage 1 uses specialist vision models, including InsectNet and WeedNet. InsectNet is trained on millions of insect images and validated across >2,500 species with >95\% accuracy, utilizing energy-based OOD detection and conformal prediction that provides abstention and coverage-guaranteed prediction sets. WeedNet is trained via global-to-local pretraining/fine-tuning (global: 1,593 species, 91.02\%), and we adopt the same uncertainty stack. For PestIDBot, we fine-tuned on region-stratified data with class-balanced sampling; thresholds for OOD and conformal risk were set on the validation split.

\textbf{Region-aware retrieval and generation}. The extensions and research documents were chunked and tagged with [$species$, $region$] metadata in a vector index. At query time, we filter by [$species$ $\cup$ $region$]; when local documents are sparse, we back off to [species-only] and re-rank by ecological/regulatory similarity. The LLM outputs source-grounded text with inline citations to retrieved chunks; when retrieval confidence is low or conflicting, the system produces a retrieval-only summary and prompts for expert escalation.

\textbf{Retrieval evaluation}. We generate test queries from 100 document chunks using GPT-4o, where each chunk serves as the ground-truth answer to its generated question. We evaluated four retrieval configurations: (i) no metadata filtering (semantic search only), (ii) species metadata filtering, (iii) region metadata filtering, and (iv) combined species and region filtering. For each query, we retrieve the top-5 documents and measure precision@k (whether the ground truth appears in the top-k) and nDCG@k (accounting for rank position) at k=1, 3, and 5. Technical details are in the Supplementary. 



The code, prompts, and curation scripts will be released under license at \textbf{XXX}.


\bibliography{References}

\section{supplementary}

\begin{appendices}
\section{Supplementary Material}
\label{sec:supp}

\subsection{Stage-1 Taxonomic Resolution}

InsectNet's reported accuracy reflects performance across broader taxa categories that map to multiple genera or families (e.g., "ladybeetle") rather than single species. This taxonomic resolution aligns with the decision-making process of IPM, where management strategies are often applied at the family or functional group level.

\subsection{Stage-2 Retrieval Evaluation: Metadata Filtering Strategies}

We evaluated retrieval performance across different metadata filtering strategies in queries spanning multiple species and geographic regions. Documents are tagged with species and region metadata; filters narrow the search space before semantic retrieval.

\textbf{Implementation details}. The knowledge base was built using ChromaDB with OpenAI text-embedding-ada-002 embeddings. The documents were chunked using RecursiveCharacterTextSplitter (chunk\_size=512, overlap=10) from LangChain. Each chunk was tagged with species and region metadata. Metadata filtering applied logical constraints to narrow retrieval to matching species, region, or both. The test questions were generated using GPT-4o (temperature=0.7, max tokens=100) with a rate limit of 1 request per 10 requests, per second. For each query, we retrieve k = 5 documents and compute the precision@k and nDCG@k metrics.
\begin{table}[h]
\centering
\caption{Precision@k results for different metadata filtering strategies. Precision@k measures whether the ground-truth document appears in the top-k results.}
\label{tab:precision-results}
\begin{tabular}{lccc}
\toprule
\textbf{Pipeline} & \textbf{P@1} & \textbf{P@3} & \textbf{P@5} \\
\midrule
No Filter              & 0.550 & 0.740 & 0.800 \\
Species Only           & 0.720 & \textbf{1.000} & \textbf{1.000} \\
Region Only            & 0.560 & 0.740 & 0.820 \\
Species + Region       & \textbf{0.740} & \textbf{1.000} & \textbf{1.000} \\
\bottomrule
\end{tabular}
\end{table}

\begin{table}[h]
\centering
\caption{nDCG@k results for different metadata filtering strategies. nDCG@k accounts for the ranking position of relevant documents.}
\label{tab:ndcg-results}
\begin{tabular}{lccc}
\toprule
\textbf{Pipeline} & \textbf{nDCG@1} & \textbf{nDCG@3} & \textbf{nDCG@5} \\
\midrule
No Filter              & 0.550 & 0.662 & 0.687 \\
Species Only           & 0.720 & 0.886 & 0.886 \\
Region Only            & 0.560 & 0.668 & 0.701 \\
Species + Region       & \textbf{0.740} & \textbf{0.896} & \textbf{0.896} \\
\bottomrule
\end{tabular}
\end{table}

Species metadata is the dominant factor, with both species-only and species+geography filtering achieving perfect precision@5 (1.00). The combination ensures regionally appropriate guidance surfaces first.

\subsection{Knowledgebank Characteristics}

\begin{figure*}[t]
    \centering
    \includegraphics[width=0.95\textwidth]{figures-in-making/species_analysis.pdf}
    \caption{Knowledgebank characteristics across three geographic regions. The analysis encompasses 126 pest species with a balanced representation of insects and weeds. The system demonstrates high identification accuracy, with a mean accuracy of 88.7\% and 70\% of species achieving 85-100\% accuracy. Regional distributions show minimal species overlap, highlighting the importance of region-specific pest management strategies.}
    \label{fig:knowledgebank-analysis}
\end{figure*}

Figure~\ref{fig:knowledgebank-analysis} presents a comprehensive analysis of the PestIDBot knowledge base across four dimensions: species distribution, pest type composition, accuracy performance, and regional overlap. The knowledge base encompasses 126 pest species distributed across three geographic regions. The dataset includes balanced coverage of major pest categories. The vision models demonstrate robust identification capabilities across all regions. The analysis reveals predominantly region-specific species composition with limited overlap, emphasizing the importance of region-aware retrieval systems for pest management applications.

\subsection{Cross-Regional Knowledge Transfer: Witchweed Example}

Witchweed (\textit{Striga asiatica}) is an invasive and parasitic pest found in sub–Saharan Africa and India, but has spread to the Eastern region of the United States ~\citep{UnitedStatesDepartmentofAgricultureWitchweed2025, dafaallah2019biology, David2022, Davidson2024}. When a user selects the region of interest of Africa, and inquires of the most effective management strategy, PestIDBot responds primarily with expert curated information derived from African IPM strategies, then with supplementary expert curated information about the most effective management strategy. PestIDBot responds primarily with expert-curated information derived from African IPM strategies, then with supplementary expert-curated developed in other regions. General knowledge of the LLM is supplemented by curated, non-expert information.

\end{appendices}

\end{document}

% todo: 
% Insert chainpdf.pdf image from main.tex as Figure 2
% Create retrieval performance visualization comparing regional vs. non-regional filtering based on metrics in main.tex
% Develop a geographic visualization of species coverage across regions
% Extract an example conversation from main.tex focusing on cross-regional knowledge transfer for fall armyworm

