
Photo by Alberto Rodríguez on Unsplash
Engineering project
Machine-learning fraud detection in the supply chain
Flag likely fraud in an international logistics group’s shipment data with a machine-learning model served through an API.
The project
For an international logistics group, a machine-learning model assesses shipments to flag likely fraud. Shipment data stored in Teradata, consolidated files and business reference data feed features prepared upstream, including account and address references. The service exposes two REST endpoints, /train and /predict. FastAPI receives the requests, Redis holds the feature matrix, and results return as JSON to business rules, exception handling and alerting.
Engineering approach
Request handling, Redis data access and model computation are separate. Redis calls use asynchronous I/O, while training and prediction run in threads. The overview separates the API scope from the surrounding platform functions. Weekly retraining and result evaluation belong to the model lifecycle; business rules and alerts belong to operational processing.
Work delivered
A containerised fraud-detection service integrated into the logistics production flow. Applications send requests to the API and receive the model’s results as JSON, which business rules route to validation, exception handling or alerts.
My contribution
- Development of the FastAPI /train and /predict routes, Pydantic validation and Redis data access
- Integration of the prepared features, including account and address references, into the computation exposed by the API
- Asynchronous I/O with asyncio and aioredis under Uvicorn, separated from training and prediction calculations executed through threads
- Integration of scikit-learn and Joblib for model processing and caching; Python dependency management with Poetry
- Organisation into two Docker services, FastAPI and Redis, deployed in a Kubernetes environment on OpenShift
- Connection of the API to decision rules, exception handling and alert monitoring
Functional overview
The machine-learning API receives features prepared from shipment data and returns its fraud predictions to logistics applications. The diagram connects the service to preprocessing, retraining, business rules and result monitoring. Internal system names are replaced by their functions.
Splunk
Teradata
Components and flows
- Teradata data, consolidated files and business reference data feed feature preparation
- Incoming calls and predictions through the API; downstream rules and integration
- Weekly retraining and result evaluation in the platform context
- Analytical storage, visualisation, Splunk monitoring and alerts; the source diagram does not determine the final storage product
Processing logic
Related capabilities
- Predictive analytics and anomaly detection
- Custom software and applications
- APIs and systems integration
- Observability and operations
- AI infrastructure and model deployment
Services by sector
Other projects
Discuss your project
A discussion of your project’s design, development and production deployment.