Smarter customs management in Zambia, building from learnings in Paraguay
Chirundu border area.
African Union Development Agency
Jonathan Chang (Research Manager, Conflict and Governance Program) shares new insights from Paraguay, where CEGA faculty Fred Finan, Ernesto Dal Bo) and coauthors (Raul Duarte, Laura Schechter) developed a machine learning model that improved customs officials’ ability to detect customs fraud by 50% over the status quo method. Now, they’re taking their experience and approach to the Zambia Revenue Authority to further hone the model and generate new evidence about its impact in a new context.
At the Chirundu Border Post in southern Zambia, hundreds of trucks arrive from Zimbabwe each day. They come filled with all sorts of items, such as electronics, food products, and building materials. A full physical check of one truck can take several hours, and at Chirundu Border Post a single officer may conduct up to 60 inspections in a 12-hour shift.
Zambia relies on customs duties to fund public services, and estimates suggest about half of owed taxes are lost to revenue leakage and evasion. Some importers misdeclare by accident. Others do it on purpose: declaring vegetables while carrying alcohol, understating value, misstating the country of origin, or hiding goods in vehicle compartments.
Customs cannot open every truck, so it has to choose. In March 2026, CEGA Scientific Director Fred Finan and his team, funded by the International Growth Centre, worked with the Zambia Revenue Authority’s (ZRA) Artificial Intelligence unit to assess whether machine learning could help. We visited four ports, interviewed officers and leadership, and assessed the central customs database. Our starting point was work in Paraguay, where our team has partnered with the Customs Authority for over two years.
Helping Paraguayan inspectors choose which shipments to inspect
ZRA, like customs in over 100 countries, runs ASYCUDA, a UN system that routes each declaration to a channel by fixed risk rules: green or blue for minimal checks, yellow for documents, red for a full physical inspection. In Paraguay (which uses a similar type of rules-based system) we saw two ways that these systems fall short: they flag more shipments than ports can properly inspect and they poorly assign declarations to appropriate channels.
To address this issue, we developed a Random Forest model on the Paraguay Customs Authority’s own records, using over 110 standard features from customs declarations, such as declared value, product code, country of origin and the importer’s compliance history. The machine learning model — which classifies imports and predicts those most likely to evade customs tax — runs on the authority’s own hardware and was piloted live at two ports for 15 months. We applied it to the 82,188 shipments Paraguay’s existing rules sent to physical inspection between September 2024 and February 2026. Surprisingly, the algorithm recommended officials conduct less inspections, flagging only about 55% of them, while generating other efficiencies:
- Inspectors found an irregularity in 38% of the shipments it flagged, against 25% under the status quo.
- The flagged shipments held 84% of all irregularities found and 90% of the additional assessed value.
- Flagged shipments carried an average additional assessment of US$1,030, against US$135 for the rest.
In other words, the algorithm caught most of the fraud while recommending just over half as many shipments to inspection. For inspectors who are often overwhelmed by the sheer volume, this is a major win.
However, we were still curious about how well the model could help flag shipments in other contexts. To answer this question, we had to travel elsewhere.
The lesson that matters most for Zambia: the data
A model learns from past shipments where both the declaration and the inspection result are known, and Paraguay taught us that those records can be less reliable than they look. An officer with too many trucks to clear may do a partial check and find nothing. An officer who does find a discrepancy may record a smaller adjustment, or none, in exchange for an informal payment. Either way, the official record shows a clean inspection. Trained on enough of these records, an algorithm might learn the opposite of what it should.
Our scoping in Zambia showed that, as in many customs authorities, the records a model needs are not yet all in one place. Each shipment’s original declaration and its inspection result need to be linked and stored centrally, and inspections need enough time to be thorough.
A new initiative in Zambia
We are now working closely with ZRA to develop a data collection exercise, so that it has a high-quality dataset to train a first model on. Like many CEGA studies, the design draws on our previous learnings and includes:
- Random-sample inspections. Shipments chosen at random for thorough inspection, independently of the current rules, with results captured in a clean system. The resulting records avoid the selection bias in the historical data.
- Quality built in from the start. Because these records will train the first model, the exercise is designed so that each inspection is comparably thorough and each result is recorded accurately and linked to the original declaration.
Once a model is trained, a randomized pilot comparing the algorithm with the current rules will measure the effect on revenue. The system will read from customs records without writing to it, and flag only as many shipments as a station can thoroughly inspect that day. On a short-staffed day, officers get fewer flags and can check each one properly. CEGA is excited about our partnership with ZRA, and we look forward to working together to improve customs management in Zambia.