Electronic Commerce

Electronic Commerce Electronic Commerce Electronic Commerce

AI case study

Smarter Screening: How AI Helps Lithuanian Customs Analyze Risk

Customs of the Republic of Lithuania

MemberLithuania

With around 1,000 X-ray images of trucks and railway wagons to review each day when all border posts are operating, Lithuanian Customs has deployed DIRVA, a custom-built artificial intelligence (AI) system that assesses image quality, identifies vehicles, and flags possible anomalies, helping analysts focus on the highest-risk consignments within tight inspection windows.

© Customs of the Republic of Lithuania

The Problem

Lithuanian Customs is the national customs authority of the Republic of Lithuania and forms part of the European Union (EU) customs system. Its core mission is to ensure the lawful, secure and efficient movement of goods across Lithuania’s borders, which include part of the EU’s external border, while protecting the financial, economic and security interests of Lithuania and the EU. When all border posts are fully operational, Lithuanian Customs has around 1,000 X-ray images per day to analyse. A single train can carry around 60 railway wagons, each of which must be matched with its own customs documentation, and Lithuanian Customs analysts have up to 30 minutes to complete the analysis for a whole train. Analysts would need to decide which wagons presented a higher risk of carrying undeclared or prohibited goods that required closer review or physical inspection during the limited inspection window.

Lithuanian Customs previously relied on a combination of existing digital systems, proprietary X-ray analysis software supplied by scanner manufacturers, and manual review processes. This approach had three main limitations. First, customs declarations were received from different systems and had to be matched manually with road vehicles or railway wagons by comparing wagon numbers, declaration documents and scanning dates, to ensure that the declaration matched the correct wagon and scan. This was time-consuming and prone to administrative error. Second, low-quality X-ray images had to be reviewed manually to decide if new images were needed. Third, all vehicle and train wagon X-ray images had to be reviewed by analysts, and because it was not known in advance how many vehicles would require detailed analysis, analysts often had to interrupt their current work when new scans arrived. The use of different proprietary systems at different railway scanning posts compounded these difficulties, as these systems differed in how they identified wagons and presented scan information.

These limitations absorbed analysts' time in preliminary tasks, made workload planning difficult and left less time for complex cases within a limited inspection window. They also created enforcement risk. Without a reliable way to prioritize higher-risk vehicles, there was a greater chance that undeclared or prohibited goods could pass through the border without sufficient inspection. On the railways, any error in identifying the relevant wagon could result in the wrong wagon being inspected while a potentially high-risk wagon passed without examination.

The Solution

The potential of AI for use in customs X-ray analysis became apparent as the technology gained practical and successful application in medical imaging and airport baggage screening. Lithuanian Customs considered conventional software enhancements, but the variety of vehicles, goods, image qualities and file formats meant that such improvements would not address the full scope of operational challenges. An AI-based approach offered the potential to support different requirements for image-quality assessment, vehicle identification, automatic data extraction, anomaly detection and risk-based prioritization at a larger scale and speed.

Lithuanian Customs worked with Novian Group, a Lithuanian information technology services company that develops custom software solutions. Together they built DIRVA (an artificial intelligence-based X-ray image analysis system), a custom-built AI system to perform vehicle type identification, vehicle number extraction from images, X-ray image analysis, matching of vehicle information with customs declarations and related documentation and prioritization of vehicles for further examination. It relies mainly on deep learning, a type of machine learning that learns patterns from large numbers of examples rather than following hand-written rules, applied to computer vision, i.e. the interpretation of images.

When a vehicle or railway wagon is scanned at a border post, DIRVA automatically opens a case and runs a sequence of checks. It first evaluates X-ray image quality, identifying unusable images at an early stage and indicating the reason for rescanning. It then identifies the type of scanned vehicle, distinguishing between nine categories of railway wagon and road vehicles such as trucks, and selects the most appropriate AI algorithm for that vehicle type. It extracts vehicle or wagon numbers directly from images, validating them by comparing information from both sides of a wagon where available, and matches them with the relevant customs declarations and associated records, using the scanning date as a further check.

Finally, the system analyses the X-ray images to identify possible anomalies or suspicious objects, providing a risk score expressed as a percentage and, where a potential undeclared item is detected, displaying a box indicating its location within the image. Based on this analysis, vehicles or wagons are ranked by risk level, allowing analysts to prioritize those that may require further review or physical inspection. Analysts work at the Lithuanian Customs headquarters, monitoring scans from different border posts in a single centralized environment.

After a physical inspection is carried out, the inspection results are updated in DIRVA. These results can later be reviewed by analysts and used to evaluate system performance, improve future analysis and support further training of AI models.

DIRVA does not make legally binding, regulatory or enforcement decisions. The AI provides recommendations, risk indicators and image assessments, but an analyst always makes the final decision on whether an image must be rescanned and whether a vehicle or railway wagon should be physically inspected. All analysis cases are stored in the system database together with AI algorithm metrics and records of user actions, supporting the review of decisions, monitoring of AI performance and identification of areas for model improvement.

Implementation

DIRVA was custom-built to reflect Lithuanian Customs’ operational workflows, infrastructure, available hardware, technical requirements and legal environment. Its development and implementation took approximately two years, with implementation being carried out through a phased approach, with separate milestones and pilot versions tested by analysts in a controlled testing environment before full deployment. Following implementation, one week of training was organized for system users.

Novian was responsible for software development, AI model implementation, workflow implementation, configuration and technical support. They worked with the Lithuanian technical teams and analysts who were the end-users.

The total cost, including the warranty and maintenance period, was approximately EUR 2.2 million including value added tax, funded through the Next Generation EU recovery and resilience measures under the national plan “Next Generation Lithuania”. The main cost components at the development and implementation stages were related to the custom development of the DIRVA system, integration with the existing Lithuanian Customs infrastructure, configuration of the production environment, AI model development, testing, user training, and warranty and maintenance arrangements.

The system is deployed in a government cloud environment. It is integrated with the European Union’s Import Control System 2, the EU's advance cargo information system, through which economic operators declare safety and security data via the Entry Summary Declaration before goods arrive. The system supports the World Customs Organization’s Unified File Format (UFF) 2.0, a standardized data container for X-ray and other non-intrusive inspection equipment. This allows DIRVA to work with images from any X-ray scanner. 

Overview

AI typeDeep learning (computer vision); machine learning for classification and anomaly detection
Training dataOperational X-ray images from customs scanning equipment, classified and labelled by customs analysts; data augmentation techniques to improve the training of an anomaly detection model
PlatformDIRVA, deployed in a government cloud, integrated with the European Union’s Import Control System 2
Core functionalitiesX-ray image quality evaluation, vehicle identification and number extraction, declaration matching, anomaly detection with risk scoring, risk-based prioritization
Primary usersCustoms X-ray image analysis experts

Challenges to operationalization

Computing and storage capacity

AI-based image analysis requires substantial computing resources, particularly graphics processing unit capacity to run AI, machine learning and other computationally intensive algorithms, as well as for secure, fast-access storage for large image files. The system had to be designed around the available scanners, file sizes and central storage capacity, and optimized for efficiency within the existing government cloud.

Limited anomaly training data

Customs X-ray images are not publicly available and cannot be downloaded or purchased, so training images had to be collected from operational scanners. Validated images containing undeclared goods or confirmed anomalies are naturally infrequent. Lithuanian Customs classified images into categories and used data augmentation, i.e. creating modified copies of existing images, to increase the variety of anomaly examples available for training and testing.

Diversity of scanning equipment

Different X-ray machines store images in different formats and with different technical parameters, increasing the complexity and variety of the data. Inconsistent scanning parameters, damaged wagon numbers and different wagon speeds during the scanning, added further variability and affected the quality of the scanned images. DIRVA manages this by supporting a unified X-ray file format and by applying separate algorithms to each vehicle type.

Explainability and transparency

Deep learning models can operate as “black boxes” where their inner workings are unknown to its users, making it difficult to explain how a specific output was generated. Lithuanian Customs addresses this by showing a risk score and the location of each suspected item, ensuring that officers are responsible for final decisions, and recording AI outputs and user actions in an audit trail.

Best practices

Data labelling embedded in daily workflows

Lithuanian Customs incorporated data labelling, a process to label raw data for machine learning, into analysts’ daily work procedures through DIRVA, ensuring that validated and well-labelled data are continuously generated for model retraining and performance enhancement.

Custom algorithms over general-purpose models

Lithuanian Customs found in the early phases that custom AI algorithms performed better than general-purpose ones, although they require specific datasets with sufficient variety. Different vehicle types use different algorithms, and knowledge gained from previous models was reused and adapted for new vehicle categories.

Human-in-the-loop design

The system was designed as a decision-support tool from the outset. AI recommendations may influence inspection priorities, but final decisions remain with authorized customs officers, preserving legal accountability.

Phased development with user testing

Pilot versions were tested by real users in a controlled testing environment at each milestone, enabling Lithuanian Customs to validate functionality and workflow suitability before full deployment.

Analyst involvement throughout

Customs X-ray image analysis experts contributed to the definition of requirements, user testing, pilot activities and feedback sessions, ensuring the system reflected real working practices. This also built greater trust in the performance of DIRVA.

Structured performance monitoring

The system records AI outputs, analyst decisions and inspection outcomes in a structured format, enabling review of trends, assessment of model performance and identification of areas for improvement.

The impact

Faster analysis and improved workflow efficiency

Lithuanian Customs reports that the analysis process has become faster because analysts no longer need to perform several repetitive tasks manually. Railway wagon numbers are identified more efficiently, low-quality X-ray images are automatically marked for rescanning, and AI recommendations help analysts identify vehicles or wagons that may contain anomalies or undeclared items. The full AI analysis of a railway wagon that used to take 8 minutes is completed in under 4–5 minutes. DIRVA also allows several analysts to work on the same train without duplicating work or reviewing the same wagons unnecessarily, improving coordination and reducing overlap. Analysts can focus more quickly on the substantive question of whether cargo appears suspicious, rather than spending time on preliminary tasks such as assessing image quality or verifying vehicle numbers against declarations.

Structured data foundation for more analytical work

Lithuanian Customs had to create a dataset of X-ray images that could be used to train the AI model. This made it possible to evaluate the accuracy of AI recommendations, monitor trends in suspected undeclared goods, and assess the number of vehicles or wagons detained following inspection. Before this project, much of this information was unstructured and difficult to use for systematic evaluation. Lithuanian Customs decided to make data labelling, validation of AI results and the review of historical cases a regular part of analysts' daily work procedures through DIRVA. This revised workflow allows Lithuanian Customs to create the data foundations that can be used to not only train AI models but also the undertaking of longer-term analytical work (e.g. to train humans, to compare historical data etc.).

AI can significantly strengthen customs and trade operations, but its success depends on access to high-quality, well-labelled and legally usable data. Policymakers should support frameworks that enable secure and responsible data sharing between trusted authorities, particularly for specialized use cases such as customs X-ray image analysis.

Glossary

Black Box

An AI system whose internal workings are not known or accessible to the user.

Computer vision

AI that enables computers to interpret and analyse images and videos.

Data augmentation

A technique that creates additional training examples by modifying existing data, for example by rotating, cropping or combining images.

Data labelling

The process of assigning labels to raw data to help provide context for machine learning and deep learning.

Deep learning

A subset of machine learning where neural networks are stacked in multiple layers.

Machine learning

The system learns from past data to make predictions and take decisions.

References

This case study is based on Lithuanian Customs’ written inputs.

Created in November 2026