A Design Science Research Prototype for Mobile Detection of New Psychoactive Substances using Physics-Informed Machine Learning and MLOps
PENTION-M is a research prototype developed as part of a Master’s Thesis in Computer Science, grounded in the Design Science Research (DSR) methodology.
The project extends the original PENTION-S concept by introducing a mobile, vehicle-mounted paradigm for the detection and localization of New Psychoactive Substances (NPS) in open and semi-open environments.
The system simulates a mobile forensic laboratory capable of:
- Detecting NPS vapours via mass-spectrometry-based fingerprints
- Modelling atmospheric dispersion using physics-based Gaussian models
- Correcting physical inaccuracies through Physics-Informed Machine Learning (PIML)
- Localizing emission sources
- Operating within a complete MLOps pipeline with monitoring, retraining, and forensic auditability
The entire framework is containerized, modular, and designed to reflect realistic operational constraints while remaining fully reproducible for research and evaluation purposes.
This work was developed within the context of the EU Horizon project PENTION, addressing the urgent need for advanced technologies to detect synthetic drugs and precursors, particularly NPS, which are characterized by:
- Rapid chemical evolution
- Extremely low vapour pressure
- High variability and lack of comprehensive open datasets
Unlike traditional fixed installations, PENTION-M focuses on mobile detection scenarios, such as:
- Clandestine laboratories
- Open urban or industrial areas
- Vehicle-based inspections
All components beyond the NPS classifier rely on synthetic and simulated data, due to the absence of publicly available real-world datasets—a constraint explicitly acknowledged and addressed through simulation fidelity and validation-by-construction.
This project follows the Design Science Research (DSR) paradigm and integrates elements of an Experience Report, emphasizing:
- Iterative development driven by stakeholder requirements
- Continuous validation embedded in the design process
- Close interaction with practitioners and academic supervisors
-
Problem Identification
Detection of NPS in mobile and uncontrolled environments with legal-grade traceability -
Requirements Engineering
- Questionnaires
- Interviews
- Stakeholder workshops (LEAs, researchers, industry partners)
-
Design & Development
Modular microservice architecture with physics-based simulation, PIML models, and MLOps -
Demonstration
End-to-end system execution via UI and APIs -
Evaluation (By Construction)
Continuous feedback-driven refinement and technical validation -
Reflection & Lessons Learned
Documented limitations, trade-offs, and future research directions
PENTION-M is organized as a microservice-based cyber-physical system, orchestrated via Docker Compose.
Core layers include:
- User Interface (UI) – Mobile van simulation and control
- Sensor Simulation – Vapour sampling and EI mass spectra generation
- Physical Dispersion Model – Gaussian Plume/Puff (GaussianPuff)
- PIML Correction Models – CNN-based correction of dispersion maps
- Source Localization – ML-based emission source estimation
- NPS Classification – XGBoost / DNN classifiers on EI spectra
- MLOps Layer – Monitoring, drift detection, retraining
- Forensic Layer – Tamper-evident forensic bundles
- EI mass spectra classification
- XGBoost, Random Forest, DNN models
- Dataset: PENTION_EI_Complete (merged from multiple public sources)
- Physics-based dispersion engine (Plume & Puff)
- Atmospheric stability and wind modelling
- Sensor simulation and spatial sampling
- CNN-based correction of physical dispersion maps
- Physics-informed loss functions
- Binary urban maps derived from OpenStreetMap
- Physics-informed regression for emission source estimation
- Coupling between physical dispersion fields and learned corrections
- Lightweight web-based UI for PENTION-M
- End-to-end orchestration of the mobile pipeline
- Real-time visualization and reporting
A detailed file tree is available here
The repository contains:
- Modular Dockerized services
- Simulation and training pipelines
- Validation notebooks and scripts
- Forensic logs and audit artifacts
- Full LaTeX source of the thesis
- Docker & Docker Compose
docker-compose up --buildOnce all services are running, the PENTION-M user interface is available at:
http://localhost:8005
⚠️ The interface is intended for demonstration and exploratory validation purposes only,
and does not represent a production-ready operational system.
Validation is performed through:
- Module-level tests (physics, PIML, APIs)
- End-to-end simulation scenarios
- Forensic integrity checks
- Monitoring stress tests
All validation activities and experimental artifacts are available in the
validation/ directory.
This approach reflects a validation-by-construction strategy aligned with DSR principles.
The complete thesis manuscript (PDF) is included in the repository and can be accessed here:
Note: The thesis manuscript is written in Italian, as required by the degree programme.
- Integration with real hardware sensors
- Field studies with Law Enforcement Agencies
- Real-world atmospheric measurements
- Extension of PIML constraints
- Scaling to multi-vehicle cooperative scenarios
Marco Di Maio
Master’s Degree in Computer Science
This project is released under the CC BY-NC-SA 4.0 License.
You are free to:
- Share and adapt the material for non-commercial purposes
- As long as proper attribution is given
- And derivatives are shared under the same license


