Poli Usp Pro
November 19, 2026
Analysis of historical MDVR data for operational risk monitoring in cargo fleets
Priscila Pagliari Pinheiro; Ronaldo De Lucio
DOI: 10.22167/2675-6528-202603827
Article derived from a Final Course Work (TCC), with content based on the student’s original work and adapted to the editorial format of the E&S Magazine with the support of the ResumeAI tool, an artificial intelligence solution developed by Instituto Pecege for textual synthesis and organization.
Summary
The growth of road freight transport in Brazil generated millions of behavioral alert records by embedded systems Mobile Digital Video Recorder (MDVR) and Driver Monitoring System (DMS), increasing the complexity of fleet safety management. This study analyzed a historical database of 29.07 million alerts, from 14,709 devices over nine months of operation (August 2025 to April 2026), with the objective of monitoring fleet operational risk. To this end, an open-source analytical platform in Python (Flask and DuckDB) was developed, which integrated the data processing pipeline and analysis methods. A Weighted Risk Index was constructed with severity weights derived by the Analytic Hierarchy Process (Consistency Ratio of 0.0088). The fleet was segmented into risk profiles by the K-Means algorithm, and anomaly detection employed Z-score and Isolation Forest. Temporal analysis used STL decomposition and linear regression. The results indicated a predominance of alerts associated with fatigue. Segmentation isolated a group of 363 critical risk devices (2.5% of the fleet) for intervention prioritization, and automatic detection signaled 399 devices with atypical operation patterns. Temporal analysis revealed strong weekly seasonality and an increasing trend in alert volume. The viability of an open-source analytical solution to support operational safety management in road freight transport fleets was demonstrated.
Keywords: Behavior analysis; Driver Monitoring System; Business Intelligence; Road safety; Embedded systems.
1. Introduction
Road freight transport is the backbone of Brazilian logistics, being responsible for more than sixty percent of the flow of goods in the country (National Confederation of Transport, 2018). However, road safety associated with this mode represents a serious public health problem. The World Health Organization (2023) estimated 1.19 million deaths from traffic accidents in 2021, with the age group of five to twenty-nine years being the most affected.
Driver behavior is the most critical human factor in these accidents. Fatigue, for example, is implicated in sixteen to twenty-three percent of highway accidents (Horne and Reyner, 1995), with fatality rates similar to those observed in alcohol-related accidents (Pack et al., 1995). Increasing drowsiness precedes serious events (Horne and Reyner, 2001), and the use of a cell phone while driving simultaneously compromises visual, manual, and cognitive attention (Young and Regan, 2007). The systematic detection of these behaviors is, therefore, a priority for operational safety management of fleets.
Vehicle telematics has emerged as a consolidated technological response (Ghaffarpasand et al., 2022). Mobile Digital Video Recorders (MDVR) record and transmit videos and operational data, while Driver Monitoring Systems (DMS) assess attention and behavior in real-time using sensors and cameras. Accurate assessment of driver behavior and risk perception requires multi-channel systems that synchronize vehicle operational data with camera images (Sappl and Kubjatko, 2023).
Computer vision, from pioneering approaches (Bergasa et al., 2006) to convolutional neural networks, has been employed to infer fatigue by markers such as the percentage of eye closure (Bergasa et al., 2006; Liu et al., 2022). The effectiveness of these techniques is consolidated by literature reviews (Al-Quraishi et al., 2024; Halin et al., 2021; Qu et al., 2024; Visconti et al., 2025). Integrated into DMS and Advanced Driver-Assistance Systems (ADAS), these modules record risk events with type, timestamp, and location, generating a criticality taxonomy. In large fleets, this results in millions of alerts over months.
Although the volume of data generated by these systems can, in principle, enable robust statistical analyses of patterns, risk profiles, anomalies, and temporal trends, in practice, it rarely translates into operational intelligence. The data often remains without deeper analytical exploitation (Wang, 2026), despite the potential for Logistics 4.0 (Dintén et al., 2023) and data-driven fleet management (Kaushik, 2025). To unlock this potential, it is necessary to process the historical base, weigh alerts by their relative criticality, segment the fleet by risk profile, and distinguish behavioral anomalies from device anomalies, such as miscalibrated equipment that generates systematic false positives (Min et al., 2023), a task unfeasible by manual inspection in large fleets.
Business intelligence dashboards, which convert data into actionable insights for decision-making (Sherman, 2015), have already demonstrated applicability in monitoring drivers and truck operations (Vashisht, 2023; Wang, 2026; Khalid et al., 2020). However, national literature on data science applied to risk monitoring in fleets, using real data from DMS and ADAS, is still scarce, with studies based on simulations or small-scale samples predominating. The present study does not cover individual driver evaluation or behavioral re-education actions, but focuses on aggregated patterns, detection of behavioral or technical anomalies, and consistency of monitoring parameters. The research problem lies in how historical DMS and ADAS data can be analyzed, using statistical techniques and open-source business intelligence tools, to reveal fleet risk patterns, relationships between alert types, and inconsistencies in event generation, supporting operational safety management. The general objective of this study was to develop an open-source analytical platform to support the monitoring and evaluation of operational safety in road freight transport.
2. Material and Methods
The research adopted a descriptive and exploratory nature, with a quantitative approach and a secondary data survey design. The study followed Resolution No. 510/2016 of the National Health Council [CNS], which waives registration with the Research Ethics Committee [CEP] for analyses of aggregated databases without individual identification. The General Law on Personal Data Protection (Brazil, 2018) was observed. The primary unit of analysis was `device_id`, representing the embedded physical equipment.
The data were collected from Mobile Digital Video Recorder (MDVR) systems integrated with Driver Monitoring System (DMS) and Advanced Driver Assistance Systems (ADAS) modules, installed in road freight transport vehicles in Brazil and Mercosur. The records were exported from the vendor’s proprietary platform in Excel format (.xlsx), totaling 301 monthly files. The analysis period comprised nine months (August 1, 2025, to April 30, 2026), totaling 29,077,673 alerts from 14,709 unique devices and 15,303 distinct vehicles.
The data processing followed a three-phase extraction, transformation, and load (ETL) pipeline. The first phase involved acquisition and consolidation of files. The second focused on quality and treatment, including structure validation, model identification, record filtering, duplicate removal (by the key `alarm_time`, `device_id`, `alarm_type` with `keep=’first’`) and standardization. The third phase consisted of building and storing the analytical base in DuckDB, an embedded database, with parallelized reading and restricted to 13 columns.
The Weighted Risk Index (WRI) was the central metric, calculated for periods and by hour of the day. Severity weights (`wt`) for the nine main alert types were derived by the Analytic Hierarchy Process (AHP) (Saaty, 1980). The paired comparison matrix, developed by the author, demonstrated high internal consistency (Consistency Ratio of 0.0088). The four alert types not included in the matrix were assigned a floor weight of 0.010. Normalization of the WRI by device-day allowed for comparison between periods.
The fleet clustering was performed by the K-Means algorithm (Hartigan and Wong, 1979). Each device was characterized by an eight-dimensional vector, including total alert volume, hourly intensity, proportion of critical behavioral alerts, and specific counts of five alert types. The dimensions were standardized by Z-score (StandardScaler). The number of clusters was set to four, after exploratory analysis, with K-Means++ initialization.
For anomaly detection, two methods were applied to devices with at least 50 alerts, with volume normalized to alerts per active day. The first method used the combined Euclidean distance of two dimensions standardized by Z-score (volume and proportion of critical alerts), classifying as anomalous any device whose distance exceeded three. The second method employed the Isolation Forest (Liu et al., 2008; Nair, 2025), with a contamination parameter of 0.10, to identify atypical patterns.
The temporal analysis of alerts was conducted by STL decomposition (Cleveland et al., 1990), which separated the time series into trend, weekly seasonality, and residual components, using a 180-day backward window. Ordinary least squares (OLS) regression was applied to assess the hourly trend of the IRP, with a significance test at 0.05. The correlation between Yawn and Fatigue alerts was quantified by Pearson’s coefficient (Cohen, 1988) in one-minute windows, with temporal lag analysis.
The analytical platform was developed in Python (Flask) with a three-tier architecture (routes, services, and repository). DuckDB acted as the data engine, and interactive visualizations were generated with Chart.js. The columns `alarm_time`, `alarm_type`, and `device_id` were indexed to optimize query performance.
3. Results and Discussion
The analysis of the historical database of 29.07 million alerts, collected from 14,709 MDVR and DMS devices over nine months, revealed significant patterns of operational risk in the road freight transport fleet. The developed analytical platform, using open-source tools such as Python (Flask) and DuckDB, proved effective in organizing, processing, and interpreting this data, converting it into actionable intelligence for safety management. The findings allowed for an in-depth understanding of alert distribution, device risk profiles, anomaly detection, and temporal trends, directly addressing the objective of monitoring the fleet’s operational risk.
The distribution of alerts by type showed a predominance of behavioral DMS events. Excluding ADAS alerts, the “Yawn” type registered the highest frequency, with 6,534,849 occurrences, representing 22.8% of the total. Following this, “Making Phone Calls” accounted for 6,173,032 alerts (21.5%), and “Fatigue” summed up to 2,063,759 occurrences (7.2%). The combination of “Yawn” and “Fatigue” totaled 8,598,608 alerts, or 29.9% of the volume, consolidating fatigue as the main operational risk factor identified in the fleet, a finding that resonates with the literature on the prevalence of drowsiness in road accidents (Horne and Reyner, 1995).
The expressiveness of yawning alerts as an indicator of fatigue is widely supported by studies in computer vision that identify prolonged eye closure and recurrent yawning as measurable precursors of drowsiness (Liu et al., 2022; Yu et al., 2024). The high incidence of “Making Phone Calls” is equally critical, as mobile phone use while driving quadruples the risk of collision, simultaneously compromising the driver’s visual, manual, and cognitive attention (Young and Regan, 2007). The continuous detection of these behaviors, as observed, underscores the need for strict policies on the use of mobile devices during operation.
A relevant finding was the high occurrence of “Video Block”, with 3,933,678 records (13.7%), indicating technical failures or, potentially, intentional obstructions in the recording devices. These events compromise the continuity of monitoring and may underestimate the count of critical events, introducing a negative bias in risk indicators. The reliability of risk profiles intrinsically depends on the quality of the collected data (Ellison et al., 2015), which points to the need for a preventive maintenance plan and regular auditing of the fleet’s equipment to ensure the integrity of the monitoring system.
The circadian pattern of alerts revealed a significant concentration in the time slots of 06h-10h and 14h-22h. This bimodality is consistent with the typical operational schedule of fleets that start routes at dawn or perform afternoon and evening departures. However, this pattern partially diverges from that described by Pack et al. (1995) for drowsy driving accidents in the United States, which indicate peaks between midnight and 07h and around 3 PM. This difference suggests that the risk thresholds derived from international literature should be carefully calibrated to the specific operational profile of the Brazilian fleet before being applied in safety programs.
The analysis of alert density by day and hour, presented in a heatmap, identified “hotspots” corresponding to periods of highest operational risk. Time slots with high alert density over several consecutive days indicated structural patterns, likely associated with fixed operation shifts. On the other hand, isolated high-density cells signaled specific events that warrant further investigation. This two-dimensional visualization offers an intuitive tool for identifying both systemic risks and isolated anomalies, enabling more proactive and targeted safety management.
The temporal evolution of the daily average of alerts over the six months analyzed (November 2025 to April 2026) demonstrated consistent growth, with a punctual retraction in December 2025 (approximately 95 thousand alerts/day), followed by recovery from January 2026. Linear regression applied to monthly data estimated a positive angular coefficient, indicating that the daily average of alerts increased from about 98 thousand in November 2025 to approximately 121 thousand in April 2026, a growth of 24.3% in the period. This result was corroborated by seasonal and trend decomposition by LOESS (STL), which pointed to a trend strength of 0.83 and a growth of 37.1% in the volume of alerts.
Data normalization by the average number of active devices per day was crucial for accurate interpretation. It was observed that the number of active devices grew by 23.9% in the same period, and the ratio of alerts per active device remained stable, varying from 16.17 to 16.23 alerts per active device (+0.3%). Consequently, the monthly Weighted Risk Index (WRI) decreased by 11.9% and the overall monthly WRI decreased by 24.9%. This indicates that the growth in the total volume of alerts is mainly due to the expansion of the monitored fleet, and not to a deterioration of operational risk per device, which is a positive finding for management.
The analysis of the dispersion of the hourly Weighted Risk Index, combined with a one-dimensional K-Means clustering (k=3), partitioned the 24 hours into three statistically distinct bands. A period of “Low Risk” (0h-4h and 11p-12a), “Moderate Risk” (5a and 7p-10p), and “High Risk” (6a-6p) was identified, with the latter being the most extensive, covering 54.2% of the day’s hours. The identification of these “High Risk” hours has direct implications for operational policies, suggesting the need for work schedule adjustments and preventive breaks, especially during the daytime. The increase in the risk score throughout the day is consistent with the afternoon peak in sleep-related accidents, as described by Horne and Reyner (1995).
The fleet clustering by risk profile, using the K-Means algorithm (K=4) on 14,424 devices, generated four distinct groups that guide staggered interventions. “Cluster C0” (Controlled Risk) covers 50.0% of the fleet, with 1,250 alerts per device and 17% of critical alerts. “Cluster C2” (Moderate Risk), with 9.0% of the fleet, stood out for the highest total volume of alerts (8,032/device), with 49% of critical alerts. This pattern is compatible with the hypothesis of uncalibrated sensors, which generate spurious records (Min et al., 2023), demanding technical inspection before any operational action.
The “Cluster C3” (High Risk) represents 38.5% of the fleet, with 1,328 alerts per device and 59% of critical alerts. This profile indicates that the risk is concentrated in the quality of alerts, not just the quantity, requiring direct intervention in the associated operation. The “Cluster C1” (Critical Risk), although smaller in proportion (2.5% of the fleet, 363 devices), presented the highest volume of alerts per device (5,757) and the highest proportion of critical alerts (72%). The prioritization of this group for interventions aligns with road safety management guidelines that advocate concentrating efforts on the greatest risk contributors to maximize cost-benefit ratio (Bliss and Breen, 2013; FIA Foundation, n.d.).
Anomaly detection in devices was performed by two complementary methods. The combined Euclidean distance criterion flagged 399 anomalous devices, corresponding to 2.8% of the analyzed fleet. These devices presented a volume of alerts and/or proportion of critical events significantly above the fleet average, suggesting both technical problems (descalibration, incorrect camera positioning) and adverse operational patterns. The predominance of “Video Block” or “Storage Abnormality” alerts would indicate technical failure, while “Fatigue” or “Distraction” would point to a risky operational pattern, requiring contextual investigation.
The Isolation Forest method, in turn, identified 1,395 anomalous devices, an anomaly rate of 10.0%. Unlike the Euclidean criterion, which focuses on extreme radial deviations, Isolation Forest operates in the two-dimensional space of alerts per active day and proportion of critical alerts, without distributional assumptions, identifying devices in low-density regions. The comparison between the methods revealed that the 399 devices flagged by the Euclidean criterion are a subset of those identified by Isolation Forest, which expands coverage for a more comprehensive preventive screening, while the Euclidean method delimits the most extreme core, suitable for restricted inspection capacity.
The hypothesis that yawning acts as an early behavioral indicator of the initial stage of fatigue (Yu et al., 2024) was empirically tested, revealing a positive and large effect correlation between “Yawn” and “Fatigue” counts per one-minute window. The observed Pearson coefficient was r = 0.583 (p < 0.001), a magnitude classified as a large effect on Cohen’s scale (1988). The correlation was maximal with a five-minute lag (rmax = 0.588), with yawning preceding fatigue. Although this study demonstrates an association and not a definitive causal relationship, the pattern is consistent with the internal coherence of the DMS system and the hypothesis of yawning as an early indicator of sleepiness.
The STL decomposition of the daily alert time series (November 2025 to April 2026) separated the trend, seasonality, and residual components. The trend component registered a 37.1% growth in alert volume, from 99,379 to an estimated 136,217 alerts per day, with a trend strength (F_T) of 0.83, indicating a strong trend. This trend, when normalized by active devices, confirmed the expansion of the monitored fleet and not an increase in risk per device. The seasonal component revealed a dominant seven-day cycle, with a seasonality strength (F_S) of 0.86, evidencing a higher alert volume on weekdays and a systematic reduction on weekends, reflecting the fleet’s operational calendar.
The residual component isolated non-structural fluctuations and identified three temporally anomalous events: Christmas (December 25, 2025), New Year (January 01, 2026), and Good Friday (April 03, 2026). These events, marked by significant drops in alert volume compared to the expected pattern, coincide with national holidays of recognized operational impact. The residual component’s ability to signal pattern ruptures demonstrates its usefulness in identifying atypical events that may require investigation or adjustments in operational management, such as the reduction in fleet activity during festive periods.
The developed analytical platform integrated all these results into a main interface and an advanced graphics tab, allowing the visualization of operational indicators, alert distribution, temporal trend, heat map, hourly IRP dispersion, device clustering, STL decomposition, and correlation between alert types. The Global Fleet Risk Score, calculated by the Weighted Risk Index, classified the fleet at the “High” risk level, positioning itself between the second and third quartiles of the historical monthly distribution. This indicates that the fleet’s risk load remains in the upper range of its historical variation, requiring persistent management attention.
The composition of the weighted risk load reinforces that, although yawning dominates in quantity, fatigue and imminent collision concentrate the effective risk. The critical severity types (Fatigue and Front Collision) account for 37.1% of the weighted risk, and the high severity types (No Driver, Making Phone Calls, and Video Block) add up to 43.6%, totaling 80.7% of the weighted risk. The platform processed the 29,077,673 records with an average query time of 10.92 ms for typical dashboard operations and 62.11 ms for a complete database scan, demonstrating the technical viability and adequate performance of the open-source solution to support operational safety management in road freight transport fleets.
4. Conclusion
This study aimed to develop an open-source analytical platform to support the monitoring and evaluation of operational safety in road freight transport. To this end, a historical database of 29.07 million alerts from embedded systems in 14,709 devices over nine months was analyzed. A predominance of alerts associated with fatigue, such as yawning and tiredness itself, and with the use of mobile phones was observed, which together represented a significant portion of the events. The platform allowed for fleet segmentation, isolating a group of 363 critical risk devices, corresponding to 2.5% of the fleet, for intervention prioritization. Additionally, anomaly detection flagged 399 devices with severe deviations and 1,395 with atypical operation patterns. Temporal analysis revealed strong weekly seasonality and a growing trend in the total volume of alerts, which, after normalization by the number of active devices, indicated an expansion of the monitored fleet and not an increase in operational risk per device. The Weighted Risk Index classified the fleet at a High risk level, with 80.7% of the weighted load concentrated in critical and high severity events.
The main contribution of this study lies in demonstrating the technical and managerial feasibility of an open-source analytical solution for operational safety management in road freight transport fleets. Methodologically, consolidated data science techniques were coherently articulated on a real, large-scale historical database, proposing a normalized Weighted Risk Index and the combined use of clustering, anomaly detection, and temporal analysis within a reproducible framework. In the practical scope, the developed platform allows for identifying risk patterns, segmenting devices by profile, signaling anomalous situations that require technical or operational action, and consolidating information to support managerial decision-making. However, it is recognized that the severity weights were defined by the author’s judgment, without expert validation, and the segmentation and anomaly classifications were not validated with operations, limiting inferences to the descriptive level and to devices, not drivers. For future studies, it is suggested to perform blind sample validation of the classifications, expert judgment for the weight matrix, precedence tests with Granger causality, and the incorporation of exposure data with an extended window to cover a full annual cycle.
Bibliographic References
Confederação Nacional do Transporte [CNT]. 2018. Plano CNT de transporte e logística 2018. CNT, Brasília, DF, Brasil. Disponível em: <https://planotransporte.cnt.org.br/Content/docs/Plano%20CNT%20Transporte%20-%20Pesquisa%20Completa.pdf>. Acesso em: 09 jun. 2026.
Horne, J.A.; Reyner, L.A. 1995. Sleep related vehicle accidents. British Medical Journal 310(6979): 565–567.
Horne, J.A.; Reyner, L.A. 2001. Sleep-related
Pack, A.I.; Pack, A.M.; Rodgman, E.; Cucchiara, A.; Dinges, D.F.; Schwab, C.W. 1995. Characteristics of crashes attributed to the driver having fallen asleep. Accident Analysis & Prevention 27(6): 769–775.
World Health Organization [WHO]. 2023. Global status report on road safety 2023. WHO, Genebra, Suíça. Disponível em: <https://www.who.int/publications/i/item/9789240086517>. Acesso em: 12 jun. 2026.
Article originating from the Final Course Work of the Specialization in Data Science and Analytics of the MBA USP/Esalq
To learn more about the course, click here and access the MBX Academy platform