Contaminated consignment simulation to support risk-based inspection design

Invasive nonnative plant pests can cause extensive environmental and economic damage and are very difﬁcult to eradicate once established. Phytosanitary inspections that aim to prevent biological invasions by limiting movement of nonnative plant pests across borders are a critical component of the biosecurity continuum. Inspec-tions can also provide valuable information about when and where plant pests are crossing national boundaries. However, only a limited portion of the massive volume of goods imported daily can be inspected, necessitating a highly targeted, risk-based strategy. Furthermore, since inspections must prioritize detection and efﬁciency, their outcomes generally cannot be used to make inferences about risk for cargo pathways as a whole. Phytosanitary agencies need better tools for quantifying pests going undetected and designing risk-based inspection strategies appropriate for changing operational conditions. In this research, we present PoPS (Pest or Pathogen Spread) Border, an open-source consignment inspection simulator for measuring inspection outcomes under various cargo contamination scenarios to support recommendations for inspection protocols and estimate pest slippage rates. We used the tool to estimate contamination rates of historical interception data, quantify tradeoffs in effectiveness and workload for inspection strategies, and identify vulnerabilities in sampling protocols as changes in cargo conﬁgurations and contamination occur. These use cases demonstrate how this simulation approach permits testing inspection strategies and measuring quantities that would otherwise be impossible in a ﬁeld-based setting. This work represents the ﬁrst steps toward a decision support tool for creating dynamic inspection protocols that respond to changes in available resources, workload, and commerce trends.


INTRODUCTION
Phytosanitary inspections of imported goods serve as an important biosecurity measure to prevent the transport of nonnative species that can become invasive and cause extensive economic and environmental harm.However, given the volume of goods imported into the United States, totaling 2.67 trillion dollars in 2019, it is infeasible for the limited number of border inspection personnel to fully inspect all incom-ing consignments (U.S. Customs & Border Protection, 2021).Efficiently targeting inspection resources through programs that are designed to expedite commodities with low risk, such as risk-based sampling and commodity release programs, are important strategies for minimizing the entry of nonnative species under constrained resources (Kim et al., 2019;Robinson et al., 2017).Optimization of sampling strategies to detect low frequency contaminants with limited resources has been relatively well studied, with many recommendations for maximizing inspection efficiency (Chen et al., 2018;International Plant Protection Convention, 2016;Robinson et al., 2011Robinson et al., , 2015;;Rossiter & Hester, 2017;Saccaggi et al., 2016;Surkov et al., 2008).In practice, however, inspections face diverse challenges and constraints that are often unaccounted for in optimization models related to limited personnel or other resources, commerce dynamics driving changes in import/export volumes and shifts in packaging trends, or prioritization of other objectives, like screening for trade of illicit items.Tools are needed to quantify inspection outcomes under various scenarios to choose the best strategy for specific conditions.
Another critical aspect of border biosecurity efforts is quantifying where and when pests are going undetected and entering domestic areas.Understanding pest propagule pressure can help prioritize postborder surveillance and management efforts (Lockwood et al., 2009).Many national phytosanitary agencies store decades of port interception records.However, most historical inspection data cannot be used to quantify patterns of pest slippage (i.e., proportion of pests or contaminants that fail to be intercepted by border inspections), because these data are generally collected during border security inspections that are designed to prioritize detection over statistical inference (Caley et al., 2015;Saccaggi et al., 2016).Sampling methods are often not recorded and vary widely by inspection objectives, resource availability, workload, and officer training (Saccaggi et al., 2016).This results in nonstatistical samples that cannot be used to draw conclusions about consignments or trade pathways as a whole.Many phytosanitary agencies conduct initiatives specifically designed to gather statistically valid interception data, such as the United States Department of Agriculture (USDA) Animal and Plant Health Inspection Service (APHIS) Agriculture Quarantine Inspection Monitoring (AQIM) program (USDA APHIS PPQ, 2011).However, these programs are limited and do not collect data that represent all incoming trade pathways.Directly measuring pest slippage rates is not possible in operational, field-based settings; therefore, alternative approaches are needed for leveraging limited data to estimate what is passing through international borders undetected.
Commerce trends, operational resources, and the mandate to streamline international trade make the optimal pest inspection strategy a moving target (Epanchin-Niell et al., 2021).There is a need for more flexible tools to help inspection agencies prevent entry of nonnative species and identify vulnerabilities within inspection protocols to quantify pest slippage, while also responding to commerce and operational dynamics.In this research, we present PoPS (Pest or Pathogen Spread) Border-an open-source software package that is designed to measure inspection outcomes under various cargo contamination scenarios to support recommendations for inspection protocols (Petras et al., 2022).Using a simulation approach, in which we fully recreate the cargo inspection process including consignments, contaminants, and inspections, we are able to directly count interception events and the contaminants being missed by inspections.

F I G U R E 1
The consignment inspection simulation can be used to evaluate the effect of different contaminant quantities, contaminant clustering, sampling protocols, and cargo configurations on inspection outcomes.Blue squares represent sampled units PoPS Border is part of a suite of tools developed to support phytosanitary management decisions along the biosecurity continuum, including PoPS, a generalized spatially explicit, discrete-time model used for simulating landscape spread of plant pests and pathogens (Jones et al., 2021) and PoPS Global, a flexible spatiotemporal network model for forecasting global plant pest invasions (Montgomery et al., 2022).PoPS Border can be used to create synthetic data representing consignments with variations in sizes, cargo packaging, contamination rates, and contaminant distributions to test approaches for calculating sample sizes and selecting units for inspection (Figure 1).The effectiveness of the approaches for detecting contaminants can be quantified and compared to tradeoffs in the amount of work and resources required.We demonstrate possible applications of the simulation via three use cases.First, we use PoPS Border to estimate contamination rates of cut flower consignments using high-quality inspection records from AQIM.Second, we quantify the tradeoffs in inspection effectiveness and work required for various sampling strategies.Finally, we compare inspection outcomes for shipments with variations in cargo packaging and contamination.This work represents the first steps toward an agile decision support tool for designing dynamic inspection protocols that effectively respond to changes in available resources, workload, and commerce trends.Border uses hypothetical scenarios for cargo packaging and contamination to create fully synthetic consignment data.Alternatively, it can be configured to produce realistic scenarios by providing additional information, such as phytosanitary inspections records to recreate real consignments or modeled estimates of noncompliance to simulate variations in pathway risk.We divided the simulation process into three steps-consignment generation, contamination, and inspection with configurable parameters for each (Figure 2).A summary of the inputs required for running the simulation is provided in Table 1.

Consignment generation
Consignments are generated as an array of items stratified into boxes and are given attributes describing the consignment origin, commodity, arrival date, port of entry, and mode of transport.If generating parameter-based synthetic consignments, the number of boxes in each consignment is chosen using a discrete uniform distribution to vary the consignment sizes between user-defined minimum and maximum number of total boxes.Each box is then filled with a specified number of items.

Consignment contamination
Approaches for contaminating consignments in PoPS Border are based on the contamination unit, rate, and arrangement.Contamination unit indicates whether individual items or entire boxes in the consignment should be contaminated.Contamination rate (i.e., the proportion of units in a consignment that are contaminated) can be fixed for all consignments or treated as a random variable and stochastically selected for each consignment from a beta probability distribution with user-defined shape parameters.The number of units to contaminate in each consignment is computed using the selected contamination rate and contamination unit as: where n contaminate is the number of units that will be contaminated in the consignment, N is the total number of contamination units in the consignment (boxes or sub-box items), and r is the contamination rate.
The user can also specify how contaminants are arranged within the consignments.The units to contaminate may be selected randomly or in a clustered arrangement.Examples of random and clustered contamination arrangements are shown in Figure 3 for the item contamination unit and Figure 4 for Examples of contaminated consignments with various contaminant arrangements at 1%, 10%, and 20% contamination rates using the item contamination unit.Each example includes three simulated consignments containing 10 boxes each (rows) with 50 items per box (columns).The dark blue grid cells represent contaminated items.The clustered arrangements use 25 contaminated items per cluster and a cluster width of 50 items the box contamination unit.When using a clustered arrangement, the number of units to contaminate is divided by the user-defined cluster size to determine the total number of clusters needed.To ensure the clusters do not overlap, the array of units is divided into sections that are the size of one contaminant cluster, and the sections are randomly selected for each cluster.When using the item contamination unit with a clustered arrangement, the items to contaminate within each selected section are chosen either continuously or randomly.If done continuously, the contaminated units are placed sequentially, side by side.If done randomly, two parameters must be specified-total cluster width and number of contaminated items per cluster.The cluster width is the range over which items may be randomly selected for con-tamination.These two parameters determine the density of contaminated units within the clusters.

Consignment inspection
Inspection strategies used in PoPS Border are a combination of inspection unit, sample size calculation method, and sample selection method.The inspection unit is used to define the total number of inspectable units in the consignment from which a sample is taken.The simulation is designed to accept two possible inspection units-boxes or items-although further packaging hierarchy could be implemented in the future.Options for sample size calculation methods include fixed number of units, fixed proportion of units, and using the Examples of consignments with various contaminant arrangements at 1%, 10%, and 20% contamination rates using the box contamination unit.Each example includes three simulated consignments containing 10 boxes each (rows) with 50 items per box (columns).The dark blue grid cells represent contaminated items.The clustered contaminant arrangement is indistinguishable from the random arrangement when using the box contamination unit, unless the contamination rate is high enough to contaminate more than one box hypergeometric distribution with user-defined detection and confidence levels (Fosgate, 2009;International Plant Protection Convention, 2016).The sample size when using the hypergeometric method is calculated as: where n sample is the sample size, β is the confidence level, D is the detection level, and N is the number of inspection units in the consignment.If sample units are selected randomly, the hypergeometric sample size should detect contamination rates above or equal to the specified detection level with the level of confidence specified.The user can also specify a contamination tolerance level so that the simulation tracks the number of missed consignments with contamination rates below a phytosanitary threshold.This can be useful if a low level of contamination is considered tolerable or unavoidable and the user would like to adjust inspection slippage rates to only include missed consignments with contamination rates above the phytosanitary threshold.For all sample selection methods, the selected units are inspected assuming 100% efficacy, so that if the sampled unit is contaminated, it will be detected.The sample selection method options include choosing units uniform randomly, convenience style (i.e., select first N inspection units until sample size is met), systematically at a user-specified inter-val, or in clusters.Figures 5 and 6 show examples of simulated inspections using various sample sizes and selection methods.Cluster selection works by selecting groups of items (e.g., boxes) to make up the required total sample size.The cluster selection method is only available when using items as the inspection unit, as boxes represent the cluster unit.The user must specify the method for selecting the boxes to sample from, which can be systematic at a specified interval or uniform randomly, and the minimum proportion of each box to inspect.If the sample size cannot be reached with the cluster specifications, the proportion of the boxes to inspect is automatically increased.For example, if interval clusters are used and every nth box is sampled from, the proportion of each box inspected must be high enough to reach the sample size.This is illustrated in the larger sample size example in Figure 5, where the cluster sizes were increased from 25% of each box sampled used in the random clusters, to approximately 55% of each box sampled in the interval clusters.The total number of clusters needed to reach the overall sample size is computed as: where n clusters is the number of sample clusters required, n sample is the total sample size, i is the number of items per box, and p is the proportion of each box that will be inspected.

Inspection outcomes
For each inspected consignment, several metrics are recorded to quantify the inspection effort and effectiveness.To estimate the overall amount of work done, the number of items inspected and the number of boxes opened is recorded.The information recorded for measuring inspection effectiveness includes the successful detection of an existing contamina-tion, the total number of contaminated units in the consignment (regardless of detection), and the number of contaminated units in the inspected sample.The outcomes are measured based on two scenarios-the entire sample is fully inspected, or the inspection stops after the first contamination is detected.Recording metrics for these two scenarios for each inspection provides additional information about the tradeoffs between inspection effort and gathering statistically

INSPECTION SIMULATION USE CASES
To demonstrate potential applications of PoPS Border, we created three hypothetical use cases that provide examples of how the tool can be used for consignment inspection testing and design.The first use case shows how to use the tool to estimate contamination rates for a set of consignments based on the outcomes of inspections previously conducted on the consignments.The second use case compares the effort and effectiveness of a range of inspection protocols on a set of consignments.The third use case tests the performance of a single inspection protocol on different types of consignments.The assumptions made about the cargo being inspected, including contamination rates and contaminant arrangements, are detailed in each use case section.The simulation could also be used to conduct further sensitivity analyses to quantify the impact of uncertainty in those assumptions on the scenario outcomes.
The use cases presented below were applied to a subset of data from imported cut flower consignment inspections conducted by the USDA APHIS Agriculture Quarantine Inspection Monitoring (AQIM) program from January 2011 to October 2020.Since these inspections used known, statistically valid sampling approaches, we were able to use PoPS Border to estimate the contamination rates of the consignments and do experiments to measure what the inspection outcomes would be under various scenarios.The AQIM inspection data (8,051 records) included information about the consignment size, inspection unit, inspected sample size, sample selection method, and the inspection outcomes (pest detected or not).The data were filtered to include inspections that used a box inspection unit and sample sizes specified by the hypergeometric distribution, leaving 3,313 records.
The data included consignments with sizes ranging from 8 to 21,364 boxes, with an average size of 304 boxes.The number of stems contained in each box was not recorded and we assumed 200 stems per box for the use cases.Other information describing the consignments, including origin, cut flower species, port of entry, and arrival date, was also included in the data, but was not utilized in this study.

Estimate contamination rates from high quality inspection data
Monitoring contamination rates is an important part of riskbased sampling design.Since contamination rates generally cannot be directly measured, consignment failure rates are often used as a proxy.However, failure rates only provide information about what is being found versus what is being missed.See Table 3 for the definition of consignment failure rate and other important related terms.PoPS Border provides an environment for recreating consignments and their inspections to estimate contamination rates and measure the amount of undetected, outgoing contaminants.In many cases, the strategies used for sampling during inspections are not known or are inconsistent.Users of PoPS Border can apply assumptions about how inspections were conducted and calibrate the contamination configuration to achieve similar inspection outcomes and narrow down a range of likely contamination rates.However, in this use case, we used data from inspections that used known, statistically valid sampling methods.This allowed us to use a statistical model to estimate a mean contamination rate for the consignments and then use PoPS Border to estimate the standard deviation.
To demonstrate, we recreated the AQIM cut flower consignments and their inspections in PoPS Border to estimate a probability distribution of contamination rates for the consignments.First, we used a statistical maximum likelihood estimation method described by Chen et al. (2018) and Trouvé and Robinson (2020) to estimate the mean contamination rate of the pass/fail inspection data.A generalized linear model with a Bernoulli error term and a complementary log-log link function was fitted to the vector of binary Proportion of all consignments intercepted by inspections.This quantity can be determined in an operational setting without knowledge of the overall number of contaminated consignments.
Interception rate Proportion of contaminated consignments intercepted by inspections.This quantity can only be determined in an experimental or simulated setting with knowledge of the overall number of contaminated consignments.
Noncompliance rate Proportion of all consignments with contamination.This quantity can only be determined in an experimental or simulated setting with knowledge of the overall number of contaminated consignments.

Missed contaminants
Count of total contaminated items in consignments missed by the inspections.This quantity is an estimate of the number of released contaminants.
Average missed contamination rate Average contamination rate of contaminated consignments not detected by inspections.This quantity gives an estimate of the average quality of goods being released.
consignment inspection data (0: passed inspection, 1: failed inspection due to presence of pest).An offset of log(sample size) was used to account for the number of inspected units per inspection.The mean contamination rate was calculated using the model intercept in the inverse complementary loglog function as: where r is the mean contamination rate and λ is the model intercept.
We then computed shape parameters of a beta probability distribution so that the distribution had a mean equal to the estimated mean contamination rate with an arbitrary standard deviation.Using PoPS Border, we generated 3,313 consignments that matched the AQIM shipment sizes and contaminated them using the parameterized contamination rate distribution, the item contamination unit, and a clustered random arrangement with 40 items per cluster.We then iteratively adjusted the standard deviation of the contamination rate distribution and reran the simulation until the simulated inspections resulted in approximately the same proportion of failed consignments as the AQIM inspections, which had a consignment failure rate of 0.049.
The mean contamination rate of the cut flower consignments estimated from the maximum likelihood estimation method was 0.0027.We assumed the contamination rates followed a long-tailed right-skewed beta distribution with most rates being close to zero and few consignments with higher rates.A beta contamination rate distribution with standard deviation of 0.0282 (α = 0.009, β = 3.3062) resulted in a simulated consignment failure rate that matched the AQIM inspection data (Figure 7).
By simulating the consignment inspections with PoPS Border, we were able to obtain additional information beyond the consignment failure rate and mean contamination rate.Since this use case resulted in an estimate of the contamination rate distribution, we also were able to calculate the number of missed contaminants.Over 100 simulations, an average of 501,225 contaminants (97.5%) were intercepted and 12,906 (2.5%) were missed.If we simply applied the mean contamination rate estimated from the statistical model to all of the consignments, the number of missed contaminants F I G U R E 7 Beta probability distribution of contamination rates estimated to match the 0.049 consignment failure rate of the AQIM inspection data.The mean contamination rate was 0.0027 and standard deviation was 0.0282 would be grossly overestimated.By treating contamination rate as a random variable with a beta distribution estimated using PoPS Border, we obtain an assessment of the outgoing quality of the inspected consignments.This example demonstrates how PoPS Border can be used to back-calculate the contamination rates of a set of consignments by recreating the shipments and their inspections.

Measure the effect of deviations in inspection protocols
Understanding the tradeoffs in inspection effectiveness and the amount of work required can help agencies come up with strategies that suit risk tolerance and available resources.However, this can be challenging when considering multiple variables such as sample sizes and methods for sample selection.PoPS Border provides a tool to rapidly compare variations in inspection strategies and quantify outcomes in terms of workload, interception rates, and missed contaminants.To demonstrate, we ran PoPS Border with 18 different inspection approaches applied to the AQIM cut flower consignments and compared tradeoffs in the effectiveness and work required for each.The inspections were combinations of an inspection unit (box and item), a sample size method (hypergeometric samples with 0.05 and 0.1 F I G U R E 8 Outcomes of 18 inspection protocols applied to 3,313 consignments generated to match the AQIM cut flower consignments.The inspection outcomes were averaged over 100 simulation runs.Data were slightly shifted in the x direction to increase visibility of overlapping data points detection levels and 0.02 proportion samples), and a selection method (random, convenience, interval cluster, and random cluster).We generated 3,313 consignments to match the shipment sizes in the AQIM records and applied the contamination configuration estimated in Section 3.1 (beta contamination rate distribution with mean 0.0027, item contamination unit, clustered random contaminant arrangement, 40 items per cluster).The inspection results averaged over 100 simulation runs are shown in Table 4.The graph shown in Figure 8 illustrates the tradeoff in workload and effectiveness for each inspection approach.Proportion samples resulted in a fixed proportion (2% in these examples) of every consignment being inspected, whereas the hypergeometric sample sizes varied based on the number of units (items or boxes depending on the inspection unit) per consignment.If units were selected randomly and contaminants were randomly distributed through the consignments, the hypergeometric sample size detected contamination rates above or equal to the specified detection level (0.05 or 0.1 in these examples) with the level of confidence specified (0.95).The inspections that used a hypergeometric sample with the box sampling unit were very effective at finding contaminants regardless of how the samples were selected.However, the box unit inspections resulted in a very high proportion of items being inspected overall, with each box inspected containing 200 items.The inspections that used a hypergeometric sample with item as the sample unit were very effective and efficient, but only when the inspected items were selected randomly.When these inspections deviated from random sampling, the number of missed contaminants was very high due to the small sample sizes used.This demonstrates that the effectiveness of using a hypergeometric sample in an operational setting may be lower than expected if random selection cannot be ensured.Furthermore, the number of boxes that must be opened to inspect the randomly selected items was high, which should be considered when assessing the overall inspection efficiency (Figure 9).For the item unit inspections, convenience selection was the least effective, while cluster selection performed somewhere between convenience and random selection, with effectiveness increasing with decreasing cluster size.Selecting the clusters from boxes F I G U R E 9 Inspection effort per intercepted consignment for the 18 inspection protocols tested.The work required in terms of items inspection and boxes opened was highly sensitive to the inspection unit and sample selection method used at an interval consistently performed slightly better than from boxes selected randomly.
Agencies can use PoPS Border to compare a range of proposed inspection approaches as demonstrated in this use case to choose a strategy that suits their risk tolerance and available resources.For example, cluster selection with the item sample unit could provide an operationally feasible alternative when random selection is not possible by allowing inspectors to systematically select boxes from which to sample a cluster of items.The tool could be used to identify the cluster sample size that achieves the inspection efficiency needed while effectively intercepting consignments above a phytosanitary threshold and maintaining an acceptable number of missed contaminants overall.Alternatively, a larger sample size using the box inspection unit and convenience selection might be preferred to achieve high interception rates while reducing the workload associated with unpacking randomly selected boxes.The box unit inspections were not sensitive to the selection approach used assuming that the contaminant clusters were arranged randomly throughout the consignments.This use case demonstrates how PoPS Border can be used for rapidly assessing variations in inspection strategies and explicitly measuring the relevant outcomes.

Measure the effect of changes in consignment characteristics
PoPS Border is also useful for understanding how inspection outcomes differ with variations in consignments.For example, shifts in costs or consumer trends may result in rapid changes in the mode of transport or packaging used for commodities.PoPS Border provides a tool for testing the performance of inspections under different conditions to enable a quick response to market or compliance trends by the agen-cies responsible for inspections.To demonstrate, we tested the performance of a fixed inspection protocol that used a box inspection unit, hypergeometric sampling with a 0.1 detection level and 0.95 confidence level, and random selection for three scenarios that represented changes in the consignments.In the following three sections, we generated consignments to match the AQIM inspected cut flower consignments from Section 3.1, but varied one component-consignment sizes and packaging, contaminant arrangement, or contamination rate variability.

Cargo packaging scenarios
Cargo using different modes of transport or going to different types of customers is often associated with different packaging standards.PoPS Border can be used to measure the workload required for inspecting shipments packaged in different ways and develop alternative strategies that balance interception rates with available resources.We ran PoPS Border with three scenarios representing approximately 10,000,000 items shipped via maritime pathways with large consignments and boxes, air pathways with mid-sized consignments and boxes, and direct-to-consumer with very small consignments and boxes (Table 5).For each cargo packaging scenario, we held the contamination constant by using the configuration estimated from the AQIM data in Section 3.1 (beta contamination rate distribution with mean 0.0027, item contamination unit, clustered random contaminant arrangement, 40 items per cluster).We then applied the fixed inspection protocol and averaged the inspection outcomes over 100 stochastic runs.
The inspection protocol was very effective for each cargo scenario, with only 0.5-2% of contaminants missed overall.The amount of work required for the hypergeometric samples varied widely across the cargo types, with F I G U R E 1 0 Inspection protocol efficiency and effectiveness for 10,000,000 items packaged using three cargo scenarios: maritime cargo (100-160 boxes each, 700 items per box), air cargo (20-100 boxes each, 200 items per box), and direct-to-consumer cargo (1-50 boxes each, 100 items per box).Interception rates increased with inspection effort and decreasing consignment size, whereas the proportion of intercepted contaminants decreased the inspection being most efficient for the large maritime consignments (20% cargo inspected) and least efficient for small direct-to-consumer cargo (61% cargo inspected).This is because hypergeometric samples are proportionally larger when the total number of units is relatively small.Hence, the average number of items inspected per maritime consignment was high compared to direct-to-consumer consignments (18,132 vs. 1,559), but the total items inspected overall was much lower since there were fewer maritime consignments.The interception rates (i.e., proportion of contaminated consignments intercepted) increased with increased inspection effort.However, the overall proportion of intercepted contaminants decreased with inspection effort (Figure 10).We assumed here that the contaminants were arranged in clusters of up to 40 items.For very small consignments with low contamination rates, this meant that the contaminants were often all in a single cluster, making them difficult to detect, whereas there may have been multiple contaminant clusters in the larger consignments.This explains why the inspections only missed maritime consignments with very low contamination rates, whereas the inspections missed slightly higher contamination rates in the direct-to-consumer consignments.This use case demonstrates that the efficiency and effectiveness of using hypergeometric samples with the box inspection unit is dependent on consignment size and packaging.PoPS Border can be used in this way to evaluate the suitability of inspection protocols for various cargo packaging scenarios.

Contaminant arrangement scenarios
The spatial distribution of contaminants within consignments influences how easily they are detected by inspections.While it is difficult to know how contaminants are actually arranged within consignments, we can use PoPS Border to understand the implications of potential contaminant arrangement scenarios for various inspection approaches.To demonstrate, we tested the effectiveness of the fixed inspection protocol on 17 contaminant arrangement scenarios ranging from randomly distributed contaminants to highly clustered contaminants.For each scenario, we generated 3,313 consignments to match the shipment sizes in the AQIM records and contaminated them using the contamination rate distribution estimated from the AQIM data in Section 3.1 (beta contamination rate distribution with mean 0.0027, item contamination unit).We varied the contaminant arrangement, increasing the cluster size by 25 items for each scenario.We then applied the fixed inspection protocol and averaged the inspection outcomes over 100 stochastic runs.Overall, interception rates decreased and the proportion of missed contaminants increased as contaminants became more clustered (Figure 11).When the contaminants were randomly distributed, the inspection protocol was very effective, with an interception rate of 0.89 and only 0.04% of contaminants missed.The interception rate dropped to 0.73 when contaminants were grouped into clusters of 25 items.This highlights that the inspections using hypergeometric sample sizes will F I G U R E 1 1 Inspection outcomes for scenarios comparing contaminant arrangements ranging from randomly distributed contaminants to highly clustered contaminants.Contaminants were increasingly difficult to detect with increased clustering be less effective than expected when contaminants are clustered.It is also important to note that if the box contamination unit is used in the simulation, all items within boxes are contaminated until the contamination rate is achieved.This means that using the box contamination unit is equivalent to using the item contamination unit with clusters the size of the of items in one box.PoPS Border is a useful tool for quantifying the range of potential outcomes for different contaminant clustering scenarios when evaluating inspection protocols.

Contamination rate variability scenarios
As shown in Section 3.1, it may be possible to estimate the mean contamination rate from statistically robust inspection data, but the rate variance may be unknown.The variability of contamination rates within a consignment pathway will influence the consignment failure rates.For example, a pathway with a low mean contamination rate with very low variability will have high compliance and a low consignment failure rate, but there may be a greater number of missed contaminants overall due to very few interceptions over time.To demonstrate how PoPS Border can be used to quantify the potential implications of contamination rate variability, we generated three scenarios with 3,313 consignments matching the AQIM records using contamination rate distributions with a mean of 0.0027 and three different standard deviations representing low, mid, and high variability in contamination rates.We ran the three scenarios using the box and item contamination unit.We then applied the fixed inspection protocol and averaged the inspection outcomes over one hundred stochastic runs.
Inspection effectiveness in terms of intercepted consignments and contaminants increased with contamination rate variability (Figure 12).Pathways with higher contamination rate variability will have more consignments with higher contamination rates, which are easier to detect by inspections.The lower interception rates and higher proportion of missed contaminants for the box contamination unit overall reflect the higher contaminant clustering associated with using the box contamination unit.This use case demonstrates that when the mean contamination rate of a set of consignments is very low, higher variability in rates will result in more interceptions.If a pathway has consistent, low contamination rates above zero, the number of missed contaminants will be relatively high over time compared to pathways with higher variability in rates.PoPS Border provides a tool for measuring the potential range of missed contaminants for pathways where the contamination rate variability is unknown.

DISCUSSION
We have presented PoPS Border, an open-source tool for evaluating inspection strategies for detecting rare occurrences, and three example use cases for the tool.The three use cases presented here are for cut flower pest inspections; however, PoPS Border can be used for many types of inspections, including industrial quality control sampling, law enforcement, or border control inspections.PoPS Border can be applied with minimal inputs or can be further enhanced with additional data to increase sophistication of the consignments and inspections simulated.For example, results from pathway risk analysis models could be used to inform contamination rates that vary by origin, season, mode of transport, and commodity.Cargo configurations, such as number of items per box, could be made more realistic by setting the related parameters to vary by commodity type or mode of transport.The amount of work required for inspections could be improved by incorporating accurate estimates of the man hours required to inspect various types of commodities.This work represents the first steps toward building an inspection protocol evaluation tool that can be iteratively improved to reflect the realities of border inspection operations.PoPS Border can be used to evaluate risk-based sampling methods or consignment release programs under various conditions.For example, the example use cases show simulated outcomes for hypergeometric sampling approaches, which are common in many risk-based sampling programs.As shown in Figure 8, the outcomes are highly sensitive to the inspection unit and selection approach used, with clear tradeoffs between high interception rates and the amount of work required.PoPS Border can also enable development of costsaving consignment release programs, which release low risk consignments without inspection according to an inspection As shown in the use cases, PoPS Border can be used to extend statistically robust, high quality inspection data to simulate incoming consignment contamination levels and estimate slippage rates under specific inspection protocols.If applied using actual shipment volumes coming through ports of entry, PoPS Border could provide an estimate of regional propagule pressure and inform pest surveillance efforts.Future enhancements of the tool should include an automated method for calibrating contamination rate distributions from inspection data.However, since inspection outcomes are influenced by how contaminants are clustered within consignments, better information on contaminant arrangement is needed to precisely estimate contamination rates.There may be opportunities to gain insights on contaminant arrangement by using PoPS Border with contamination rate data.As better information on contaminant arrangement becomes available, the methods for generating clusters in the simulation can be improved.For example, future implementations should use dynamic cluster sizes based on contamination rates.
The inspection approaches currently implemented in PoPS Border were chosen in collaboration with USDA APHIS analysts and include primary sampling methods used by inspectors.However, additional approaches could be implemented in future versions of the tool.For example, cost-saving strategies, such as acceptance or skip lot sampling, or strategies for targeting clustered contaminants, such as adaptive sampling, are approaches that could be simulated to facilitate inspection program design.Also, if a contaminated item is selected for inspection, the contaminant will always be detected in the current version of the tool.Future implementations should include a user-defined efficacy rate so that some inspections do not detect contaminated items.This variable inspection efficacy could be used to simulate different inspection techniques, technologies, or conditions.As the sophistication of the tool is increased, more complex scenarios with commingled commodities and multiple types of contaminants can be simulated.For example, contaminants may be characterized as quarantine significant or not, so that some detected contaminants are considered not actionable and released without treatment.Further enhancements of the simulated inspections could provide opportunities to evaluate inspection protocols for more diverse types of contamination with variations in risk and actions taken.

CONCLUSION
Preventing nonnative pests and pathogens from crossing borders is very challenging due to the massive volume of goods passing through ports of entry daily.Phytosanitary agencies need better tools to understand how tradeoffs in inspection efficiency and effectiveness may change with shifts in operations and commerce.By simulating consignments and inspections, PoPS Border provides a way to measure contaminant slippage, quantify workload, and perform computational experiments to refine inspection protocols before deploying them in the field.Further development of a webbased analytics dashboard for running PoPS Border and visualizing results would provide a valuable decision support tool to help agencies create more agile, risk-based inspection strategies.

A C K N O W L E D G M E N T S
This study was conducted as part of graduate study and made possible, in part, by cooperative agreements from U.S. Department of Agriculture (USDA), Animal and Plant Health Inspection Service (APHIS), Plant Protection and Quarantine (PPQ), Science and Technology.This paper does not necessarily reflect the views of APHIS.We would like to thank E. Hain, M. Colunga, S. Hong, and A. Neeley for guidance on the study, R. Hallberg for providing editorial suggestions, and D. Gaydos, S.Jones, and A. Petrasova for contributing to the design and creation of Figures 1 and 12. K.M., V.P., C.S.K., and Y.T. developed the idea for the simulation.K.M. and V.P. designed the simulation with extensive feedback from Y.T. and C.S.K. V.P. created the Python package, wrote the initial code, and implemented automated code testing.K.M. implemented the code for the contamination and inspection modules.K.M. did the simulation validation and designed and conducted the use cases.K.M. wrote the manuscript.All authors provided manuscript editorial reviews.

D ATA AVA I L A B I L I T Y S TAT E M E N T
Software and tools developed through this research are open-source and freely available under the GNU General Public License.The source code for PoPS Border is at https://github.com/ncsulandscape-dynamics/popsborder.This research used PoPS Border version 1.0.2(Petras et al., 2022).Jupyter notebooks containing code used for the validation tests and the use cases can be found in the GitHub repository as well.The imported cut flower consignment inspection data collected by the USDA APHIS Agriculture Quarantine Inspection Monitoring (AQIM) program from January 2011 to October 2020 are not publicly available.

TA B L E 1
Summary of inspection simulation inputs Consignmentconfiguration File of consignment records (comma-separated values) or Consignment parameters: Items per box-option to vary by mode of transport or commodity Minimum and maximum boxes possible per consignment Lists of possible values for origin, commodity, port of entry, mode of transport, and arrival date Contaminationconfiguration Contamination unit Contamination rate (fixed-value or a beta distribution of rates) Contaminant arrangement (clustered or random) Inspectionconfiguration Inspection unit Sample size method (proportion, hypergeometric, or fixed number) Selection method (random, convenience, or cluster) Proportion of each box to inspect Tolerance level Minimum number of boxes to inspect F I G U R E 2 The PoPS Border framework consists of three components-consignment generation, consignment contamination, and consignment inspection.The user provides configuration parameters for each component.The simulation outputs include outcomes measuring inspection effort and effectiveness

F
Examples of consignments sampled with various sample sizes and selection methods using item inspection unit.Each example includes one simulated consignment containing ten boxes each (rows) with 50 items per box (columns).The dark blue grid cells represent inspected items F I G U R E 6 Examples of consignments sampled with various sample sizes and selection methods using box inspection unit.Each example includes one simulated consignment containing ten boxes each (rows) with 50 items per box (columns).The dark blue grid cells represent inspected items.Box inspection unit sample sizes are rounded to the nearest integer

F
Comparison of inspection outcomes for contamination rate variability scenarios.The scenarios used combinations of item or box contamination unit and contamination rate distributions with low, mid, and high standard deviations.Interception rates increased with increased variability in contamination rates F I G U R E 1 3 Conceptual diagram of the prototype consignment release program simulation.Each scenario illustrates a possible inspection outcome under the release programschedule.Although the simulation does not currently include a realistic release program, the basic mechanics have been tested with a simple prototype based on the National Cut Flower Release Program (NCFRP).In the prototype release program, consignments that fit specified origin and commodity criteria are released without inspection unless the simu-lated arrival date falls on a user-defined inspection calendar (Figure13).Further development of the tool's release program features could provide valuable information on program vulnerabilities and a way to test proposed program updates.
Cargo packaging scenario configurations and inspection outcomes