Preprint
Article

This version is not peer-reviewed.

BLE RSSI-Based Detection of Freight Wagon Passages at Railway Control Points

Submitted:

15 April 2026

Posted:

16 April 2026

You are already at the latest version

Abstract
Accurate per-wagon occupancy accounting at freight stations — knowing which wagon entered or exited which track and when — is a prerequisite for automated shunting management, yet existing technologies — axle counters, RFID, computer vision, and LPWAN IoT — each provide only a subset of the required information and depend on dedicated infrastructure or favourable conditions. This paper investigates whether two fixed BLE gateways, combined with Eddystone-TLM beacon nodes proposed for mounting on freight wagon bodies, can classify passage direction from RSSI signals without training data, site-specific calibration, or track modification. The enabling mechanism is wagon-body attenuation: as a wagon passes between the receivers, its metallic body creates a temporal asymmetry in the RSSI envelopes that encodes travel direction. We present a five-stage online pipeline at O (1) memory per packet: a two-sided CUSUM detector with adaptive per-event baseline estimation segments the RSSI stream; a three-stage validation filter rejects partial passes, lateral paths, and near-gateway reversals; and direction is classified by the normalized Temporal Centroid shift — a speed-invariant feature requiring no training data — with a cascade fallback for ambiguous short windows. Combined with the beacon MAC address as a wagon identifier, the system generates structured occupancy events directly consumable by station management systems. Validated on 151 labelled events across eight scenario categories at Urtaul freight station and the TSTU test polygon, the pipeline achieves 96.7% accuracy (95% Wilson CI: [92.5%, 98.6%]) zero wrong-direction predictions across all 84 directional events (exact Clopper-Pearson 95% CI for the wrong-direction rate: [0%, 3.5%])", a Random Forest baseline on the same features confirms supervised learning adds no measurable benefit over the training-free approach within this feature space.
Keywords: 
;  ;  ;  ;  ;  ;  ;  ;  ;  

1. Introduction

IoT sensor nodes including BLE beacons are increasingly proposed for freight wagons for condition monitoring, shock detection, and telematics [1,2,3]. These devices broadcast Eddystone-TLM advertisement packets at regular intervals, and their Received Signal Strength Indicator (RSSI) is recorded by fixed gateways. Freight-station automation requires wagon-level events that bind identity, direction, track, and time — but existing technologies provide only part of this information: axle counters detect passage but do not identify wagons [4]; RFID provides identity but requires instrumented read zones [5,6]; computer vision recovers wagon numbers but depends on marking visibility [7,8]; and LPWAN-based rail IoT focuses on onboard telemetry rather than local entry-exit sensing at station control points [1,9,10]. This paper investigates whether BLE RSSI signals from beacon nodes proposed for mounting on wagon bodies, once collected by fixed gateways, can also serve to detect wagon passage direction at a station control point without additional trackside infrastructure.
The enabling mechanism is wagon-body attenuation: when a ferromagnetic wagon passes between two spatially separated BLE gateways, its metallic body attenuates the beacon signal asymmetrically — the approach-side gateway (EDGE) observes the RSSI peak first, and the departure-side gateway (INNER) observes it later. This object-induced shadowing [11] encodes travel direction in the temporal asymmetry of the two RSSI envelopes. Exploiting this signal reliably is non-trivial. BLE RSSI exhibits hardware-level variability of ±6 dBm [12,13], with strong sensitivity to channel, orientation, and LOS-NLOS transitions [14,15]; obstruction-aware localization treats occlusion as an error source requiring correction [16]; metallic obstacles and body occlusion measurably attenuate 2.4 GHz signals [17,18,19], and in train-like environments Elizalde et al. [20] show strong excess loss when LOS is blocked between cars, while De Raeve et al. [21] report wagon-scale metal shadowing in BLE links [21,22]. These propagation studies treat attenuation as a communication impairment — in our system, the same attenuation is the sensing signal. Additional challenges are posed by RSSI fluctuations amplified in metallic railway environments [23,24], unacknowledged BLE advertising subject to packet loss [25], and the need to distinguish partial passes, lateral paths, and wagon reversals from genuine through-passes.
Closest to our approach, several studies show that direction can be inferred from temporal RSSI structure without full localisation: Park et al. [26] use differential RSS from multidirectional BLE beacons for vehicle direction; Goto et al. [27] estimate pedestrian flow direction from time-series differences at two BLE sensors; Lee and Lin [28] infer room entry and exit from BLE RSS variation; and Maus and Brückmann [29] detect vehicle-induced events from RSS variance in a roadside BLE network [26,27,28,29]. However, these methods rely on directional hardware, aggregate flow estimation, or roadside disturbance sensing — not on wagon-mounted beacons and fixed station gateways using wagon-body shielding as the primary directional cue.
On the signal-processing side, recent work supports online statistical detection of RSSI-stream events: Yoo [30] detects Wi-Fi fingerprint changes; Kaltiokallio and Yiğitler [31] separate movement from rest via reciprocal RSS; Achalla et al. [15] apply statistical tests for fast LOS detection; and sequential change-point methods [32] provide lightweight logic for lossy wireless measurements. These works establish that CUSUM-style online processing is viable for RSSI streams, but none address wagon-passage segmentation or direction inference from shielding-induced asymmetry. To the best of the authors' knowledge, no prior work has demonstrated a system that simultaneously uses wagon-body metallic shielding as the primary directional cue, segments passage online with CUSUM-style change detection, and infers entry versus exit without trained classifiers or auxiliary trackside sensors — all from standard BLE telemetry beacons at two fixed receivers.
The primary algorithmic contribution is the normalized Temporal Centroid shift— a speed-invariant feature without training data. A five-stage online pipeline treats wagon-body attenuation as a directional cue: an adaptive CUSUM detector segments the RSSI stream; a three-stage validation filter rejects partial passes, lateral paths, and near-gateway reversals; and direction is classified by normalized Temporal Centroid with a cascade fallback or short high-speed windows and plateau conditions. Combined with the beacon MAC address as a wagon identifier, the system generates occupancy events directly consumable by a Station Management System (StMS) at zero marginal hardware cost [33]. Validated on 151 events across eight scenario categories at two sites, the pipeline achieves 96.7% accuracy with zero wrong-direction errors across all directional events.

2. Materials and Methods

2.1. Experimental Setup and Hardware

Experiments were conducted at a freight station in Tashkent, Uzbekistan. The testbed consists of two fixed BLE gateways and Eddystone-TLM beacons mounted on the sides of freight wagons. The EDGE gateway (MAC: 14:2B:2F:E9:B7:C0) is installed in the inter-track space; the INNER gateway (MAC: 14:2B:2F:E9:B8:14) is positioned outside the track. The inter-gateway distance is 15 m, corresponding to the typical wagon body length in the depot fleet. Beacon pairs e4:06:BF:C1:DE:DA ↔ e4:06:BF:C1:E0:E6 are attached during experiments to opposite sides of each wagon. All beacons broadcast Eddystone-TLM advertisement packets at a 100 ms interval with 0 dBm transmit power. Gateway readings are timestamped with millisecond precision and forwarded to a central server via Wi-Fi. No modifications to track infrastructure or wagons were required beyond mounting the gateways on existing station posts (Figure 1 and Figure 2).
The physical basis of the method is illustrated in Figure 1. When a wagon moves FORWARD (left to right in the figure), the beacon on the EDGE side first comes within close range of the EDGE gateway, producing a rising RSSI peak. As the wagon body interposes between the beacon and the INNER gateway, the INNER RSSI is attenuated. Once the wagon passes the EDGE gateway and the beacon clears the wagon body towards the INNER gateway, the INNER RSSI rises. The temporal centroid of the INNER RSSI envelope therefore lags that of the EDGE envelope for FORWARD motion, and leads it for BACKWARD motion.

2.2. Dataset

A total of 151 labeled events were collected at the Urtaul freight station and university polygon. Events span eight scenario categories representing the full range of wagon movements encountered at a typical station control point. Table 1 summarises the dataset composition.
Ground-truth labels were assigned using a two-stage protocol: (1) automatic assignment based on recording session filename prefixes, which encode the scenario category (e.g., ahead, back, before_edge); (2) manual verification by on-site observation during data collection, cross-checked against the recording timestamps. Each session was recorded with a single unambiguous wagon movement, eliminating inter-rater ambiguity. The UNDEFINED label indicates that no complete bidirectional pass occurred and the correct algorithm output is ‘undetermined’. Importantly, correct UNDEFINED output is counted as a correct prediction in the evaluation, since falsely asserting a direction for a non-directional event would be a system-level error.

2.3. Algorithm Pipeline

The hybrid algorithm processes the raw RSSI stream from the EDGE gateway through a five-stage pipeline. All stages operate online (packet by packet) with O(1) memory per packet, suitable for embedded deployment.

Stage 1: CUSUM Change-Point Detection

Signal detection is performed on the raw RSSI sequence {r₁, r₂, …, rₙ} from the EDGE gateway. A per-event baseline µ b a s e is estimated as the median of the first N b a s e = 50 packets, which corresponds to the ambient BLE noise floor before the wagon enters the detection zone. Using the median rather than the mean provides robustness to occasional interference bursts. The two-sided CUSUM [34,35] statistics are updated at each packet i:
C i + = m a x ( 0 ,   C i 1 + + r i   µ b a s e k ) (upward, wagon approach)
C i = m a x ( 0 ,   C i 1 r i +   µ b a s e k ) (downward, wagon departure)
where k = 2 dBm is the slack parameter that absorbs BLE fluctuations (typically ±3–5 dBm in metallic environments). A detection window opens when C i + > h = 8 [36], indicating a persistent signal elevation above baseline. The window closes when C i > h with d u r a t i o n     T m i n = 10 s (wagon has fully passed), or when the inter-packet gap exceeds T o u t = 3 s (data collection interrupted). The window duration is capped at T m a x = 120 s to handle edge cases such as stopped wagons (Figure 3).

Stage 2: Window Merging

BLE signal fluctuations occasionally cause CUSUM to fragment a single physical wagon pass into two consecutive windows. Any pair of consecutive windows separated by less than Δ t m e r g e = 5 s are merged into a single event by retaining the earlier open time and the later close time. The 5 s threshold was chosen based on empirical observation: in the current dataset, all inter-fragment gaps were below 4.2 s, while the minimum observed inter-pass gap was 6.8 s. This merge step reduced the fragment rate from approximately 15% to under 2%.

Stage 3: Beacon-Pair Validation and Partial-Pass Rejection

For each merged detection window [ t o p e n , t c l o s e ], the algorithm identifies the dominant beacon at the EDGE gateway by mean RSSI over the window, and looks up its expected counterpart at the INNER gateway (expected_inner) from a static configuration table. Three sequential tests then determine whether the event is a genuine full pass:
Test 1: Beacon-pair dominance (lateral-path rejection). The INNER gateway must report expected_inner as its highest-mean RSSI beacon in the window. If a different beacon dominates, the event is labelled NO_INNER_PKT (UNDEFINED). This test rejects Left and Right path events, where the wagon body does not interpose between the beacon and the INNER gateway and no shielding-driven correlation is expected (Figure 4).
Test 2: Peak-difference filter (After-edge rejection). Raw RSSI is smoothed via a Median(5) followed by a Savitzky-Golay (window=21, order=2) filter [37], chosen for its demonstrated effectiveness in metallic BLE environments. If Δ p e a k = p e a k I N N E R p e a k E D G E < −12 dBm, the event is labelled PARTIAL_PASS (UNDEFINED), indicating the wagon reversed before INNER gateway (Figure 4). A bypass overrides this rule when the normalised temporal centroid shift | Δ T C norm | > ε T C = 0.08, indicating genuine directional movement despite the weak INNER signal (Figure 5).
Test 3: Symmetry filter (Before-edge rejection). Applied only to windows with duration ≥ T m i n = 10 s (short windows cannot provide reliable symmetry estimates). The temporal symmetry of the INNER packet sequence is measured as i n n e r s y m = 1 | n f i r s t n s e c o n d | n t o t a l , where n f i r s t and n s e c o n d are packet counts in the first and second halves of the window (Figure 6). A high symmetry ( i n n e r s y m ≥ 0.95) combined with a small absolute temporal centroid shift ( | Δ T C a b s   | ≤ 3.0 s) indicates that the wagon reversed before reaching the EDGE gateway and is labelled BEFORE_EDGE (UNDEFINED).
| = 5.0 s → VALID. Before-edge events (centre, right): symmetric INNER profile (s_sym ≥ 0.95) and small |Δ T C a b s | ≤ 3.0 s → BEFORE_EDGE (UNDEFINED).

Stage 4: Normalised temporal centroid classification

For events passing all three validation tests, the direction is determined by the normalised Temporal Centroid ( Δ T C n o r m ) method. The RSSI-weighted centroid of the smoothed signal at each gateway is:
tc G = i ( t i * w i ) i w i
w i = S G ( r i ) m i n ( S G ( r ) ) + σ
where SG(r) denotes the Savitzky-Golay smoothed RSSI sequence and σ = 10⁻⁶ prevents division by zero. The direction indicator is the normalised shift:
Δ T C n o r m = ( t c I N N E R t c E D G E ) d u r
where d u r = t c l o s e t o p e n is the window duration. Normalisation by dur renders the threshold ε T C = 0.08 speed-invariant: at 5 km/h, dur ≈ 30 s and Δ T C n o r m ≈ 4–8 s giving Δ T C n o r m ≈ 0.13–0.27; at 50 km/h, dur ≈ 6 s and Δ T C n o r m ≈ 0.6–1.2 s giving Δ T C n o r m ≈ 0.10–0.20. Both values exceed the threshold with comfortable margin, confirming the speed-independence of the approach (Figure 7).
Without normalisation, a fixed threshold of ε T C = 2.0 s would correctly classify slow-speed events ( Δ T C n o r m ≈ 4–8 s) but would generate UNDEFINED outputs for high-speed events ( Δ T C n o r m ≈ 0.6–1.2 s < 2.0 s). The normalisation step alone raises accuracy from 76.9% to 89.1%, a gain of +12.2 percentage points.
The decision rule is:
d i r e c t i o n   = F O R W A R D       i f   Δ T C n o r m > + ε T C = + 0.08 B A C K W A R D   i f   Δ T C n o r m < ε T C = 0.08 U N D E F I N E D   o t h e r w i s e
(red dashed) lags tc EDGE (blue dashed), Δ TC   norm > 0. (b) BACKWARD pass: tc INNER leads tc EDGE , tc EDGE < 0. Arrows indicate the direction and magnitude of Δ TC   norm .

Stage 5: Cascade Fallback — Normalised peak-time difference and Max-Split

When the Δ T C n o r m method returns UNDEFINED — typically for short detection windows at high speeds (40–50 km/h, dur ≤ 6 s), where the centroid estimator has insufficient packets, as well as during plateau conditions after a wagon stops between the gateways — two fallback methods are applied sequentially.
Normalised peak-time difference. The time between the smoothed RSSI peaks at the two gateways, normalised by window duration:
Δ t p e a k _ n o r m     =     t p e a k ,   I N N E R         t p e a k ,   E D G E d u r
The same threshold ε Δ t = 0.05 is applied. Critically, normalised peak-time difference is activated only for short windows (dur ≤ 15 s). Empirical analysis shows that Before-edge events have window durations of 18–35 s, so the duration gate prevents normalised peak-time difference from generating false direction outputs for this scenario category. Without the gate, normalised peak-time difference accuracy falls from 89.4% to 84.8% due to Before-edge false positives.
Max-Split. If normalised peak-time difference also returns UNDEFINED (typically for very short windows with fewer than 3 INNER packets), the maximum smoothed INNER RSSI is compared before and after the EDGE peak time   t p e a k ,   E D G E :
M S d i f f = m a x ( S G i n n e r ( t t p e a k ,   E D G E ) ) m a x ( S G i n n e r ( t < t p e a k ,   E D G E ) )
M S d i f f > ε MS = 1.0 dBm indicates FORWARD; M S d i f f < −ε_MS indicates BACKWARD. Max-Split provides reliable direction for events where the centroid and peak-time estimators have too few packets, particularly the 40-50 km/h regime where dur ≈ 2–4 s.

2.4. Algorithm Parameter Summary

2.5. Parameter Selection Protocol

Algorithm parameters (Table 2) were selected using a held-out calibration procedure. Twenty events (approximately 13% of the dataset, covering all eight scenario categories proportionally) were set aside as a calibration subset during initial system design. Parameters were fixed on this subset and held unchanged for all reported results on the remaining 131 events. The sensitivity analysis (Table 8) confirms that the reported accuracy is stable within ±0.7 pp for ±25% perturbation of the primary threshold ε T C , demonstrating that the parameters are not fine-tuned to the evaluation set.
The Random Forest baseline (Section 3.3) was evaluated using leave-one-event-out cross-validation (LOO-CV) to prevent information leakage between training and evaluation events, providing a rigorous upper bound on the accuracy achievable with the same feature set using a supervised classifier.

2.6. Evaluation Protocol

Performance is evaluated on all 151 labeled events. For each file, the algorithm processes all packets and produces one prediction per detection window. UNDEFINED predictions count as incorrect for FORWARD/BACKWARD ground-truth events, and as correct for UNDEFINED events. The 95% Wilson score confidence interval [38] is reported for all accuracy values. Wilson intervals are preferred over normal approximation intervals for proportions near 0 or 1 and for sample sizes below 200.
An ablation study compares the Hybrid method against four baseline variants, all evaluated after the same beacon-pair validation pipeline: (1) threshold; (2) normalised peak-time difference; (3) normalized temporal centroid; (4) Max-Split. Statistical separation between FORWARD and BACKWARD classes is assessed with Welch's independent-samples t-test and Cohen's d effect size [39].

3. Results

3.1. Overall Pipeline Accuracy

The Hybrid pipeline achieves 96.7% overall accuracy (146/151), Wilson CI [92.5%, 98.6%]. Table 3 reports per-category results. All four full-pass directional categories reach 100% accuracy, demonstrating that the RSSI temporal asymmetry signal is reliable across the full speed range (5–50 km/h). The only category below 100% is Before-edge (75%, 15/20), which represents the fundamental sensing geometry limit discussed in Section 4.3.

3.2. Confusion Matrix

Table 4 shows the 3×3 confusion matrix. The critical result is that the pipeline produces zero wrong-direction predictions: no FORWARD event is classified as BACKWARD and vice versa across all 84 directional events. All five errors are of type 'UNDEFINED event classified as direction' — specifically, five Before-edge events where the wagon stopped within the shielding zone and produced a centroid shift exceeding the validation bypass threshold. This error profile is operationally favourable: a misclassified UNDEFINED event generates a spurious occupancy record, whereas a wrong-direction error would corrupt an existing record. Zero wrong-direction errors means the pipeline never produces a corrupted direction output when it commits to a decision.

3.3. Ablation Study — Feature and Classifier Analysis

Table 5 compares five direction classifiers applied after the common front-end (event detection and pass validation), isolating back-end classification performance. The progression from normalized temporal centroid to Hybrid reveals the contribution of each pipeline design choice. (Figure 8).
Threshold (88.1%) requires a fixed RSSI crossing level calibrated to the deployment site — a form of the site-specific calibration that the normalized temporal centroid approach eliminates. The normalization step provides the largest single accuracy gain across the ablation, confirming that speed-invariance is critical.
Normalized temporal centroid standalone (93.4%) produces only 1 wrong-direction error (very low FP rate, 0.7%) but 75 UNDEFINED outputs (49.7% non-coverage). Max-Split standalone (93.4%) produces 5 wrong-direction errors but only 67 UNDEFINED. The Hybrid cascade exploits this complementarity: normalized temporal centroid handles 76% of events at 98.7% accuracy; the cascade fallback recovers coverage for short high-speed windows where normalized temporal centroid is UNDEFINED.

3.4. Feature Distributions and Statistical Separation

Table 6 reports the statistical properties of the three primary direction features for FORWARD and BACKWARD events. All features show highly significant separation (p < 0.001) with large effect sizes (Figure 9).
Max-Split exhibits the largest effect size (d = 5.30), reflecting the strong amplitude asymmetry of the shielding effect. The normalized temporal centroid (d = 3.40) and normalised peak-time difference (d = 3.55) show comparable separability. The large effect sizes confirm that the remaining errors are attributable to insufficient packet counts at high speeds rather than feature ambiguity — the shielding-based physical signal is robust across all speed regimes where sufficient packets are available.

3.5. Per-Class Precision, Recall, and F1-Score

Table 7 reports per-class precision, recall, and F1-score for the Hybrid pipeline. The three-class evaluation treats FORWARD, BACKWARD, and UNDEFINED as independent output labels. An UNDEFINED prediction on a FORWARD or BACKWARD event counts as a false negative; a FORWARD or BACKWARD prediction on an UNDEFINED event counts as a false positive.
The F1-score of 0.967–0.974 across all classes confirms balanced performance: no class is neglected. The FORWARD and BACKWARD classes achieve perfect recall (1.000), confirming zero missed directional events. The slight precision drop (0.949 and 0.933) reflects the five Before-edge false positives discussed in Section 5.3. The UNDEFINED class achieves perfect precision (1.000): when the pipeline outputs UNDEFINED, it is always correct — a critical property for safe integration with station management systems.

3.6. Sensitivity Analysis

Table 8 shows accuracy as a function of the primary classification threshold ε T C . The pipeline is robust to ±25% perturbation: accuracy remains within ±0.7 pp for ε T C ∈ [0.06, 0.10]. This stability reflects the large natural separation of Δ T C n o r m between classes (Cohen's d = 2.96): the threshold sits in a low-density region of the feature distribution, making it insensitive to small perturbations.
Table 8. Sensitivity of pipeline accuracy to the normalized temporal centroid threshold ε T C .
Table 8. Sensitivity of pipeline accuracy to the normalized temporal centroid threshold ε T C .
ε T C Accuracy Change
0.04 94.7% −2.0 pp
0.06 96.0% −0.7 pp
0.08 (baseline) 96.7%
0.10 96.7% 0.0 pp
0.12 96.0% −0.7 pp
0.15 95.4% −1.3 pp

3.7. Paired Statistical Tests

Since all classifiers are evaluated on identical events, mid-p McNemar tests on discordant pairs provide statistically rigorous comparisons. Table 9 reports results.
The Hybrid is significantly better than Δ t p e a k _ n o r m (p = 0.022) and M S d i f f (p = 0.031), primarily by recovering events in short high-speed windows. The non-significant result versus Δ T C n o r m (p = 0.180) reflects that Δ T C n o r m already handles most events correctly and the cascade adds 9 events while failing 4 that Δ T C n o r m resolves. The key advantage of Hybrid over Δ T C n o r m is coverage: 58.9% vs 50.3% decided events — operationally important for station throughput.

3.8. Robustness Analysis

To assess the resilience of the pipeline under conditions beyond the clean experimental recordings, we performed two controlled stress tests: Gaussian RSSI noise injection and random packet loss simulation. These tests evaluate how gracefully the pipeline degrades and whether it remains above operationally useful accuracy under realistic impairments.

3.8.1. RSSI Noise Injection

Additive white Gaussian noise N(0, σ²) was injected into the raw RSSI values of all recorded events before smoothing, with σ ranging from 0 to 6 dBm (Table 10). This simulates additional electromagnetic interference beyond the levels observed in the clean recordings. The Bluetooth Core Specification defines hardware RSSI accuracy to ±6 dBm; empirical studies in metallic environments report typical fluctuations of 3–5 dBm. The σ = 5 dBm level therefore represents a conservative worst-case scenario for railway station deployment.
The pipeline degrades gracefully: accuracy remains above 90% up to σ = 5 dBm, covering the full range of BLE RSSI fluctuations reported in metallic industrial environments. The Savitzky–Golay smoothing chain absorbs low-to-moderate noise effectively; degradation above σ = 4 dBm primarily manifests as increased UNDEFINED outputs (reduced coverage) rather than wrong-direction errors, preserving the critical zero wrong-direction property.

3.8.2. Packet Loss Simulation

Random packet dropping was applied to EDGE gateway packets with probability p_loss ∈ {0, 10%, 20%, 30%}, simulating poor radio conditions or gateway overload. BLE advertising packet loss in typical indoor deployments is reported below 10–15%; the 30% level represents a severe stress condition. Each loss level was evaluated over three independent random seeds; mean accuracy and standard deviation are reported (Table 11).
At 10% packet loss — the upper bound of typical BLE deployments— accuracy decreases by only 1.3 pp. At 30% loss, accuracy drops to 89.4%, approaching the marginal threshold. The CUSUM window-merging mechanism absorbs brief packet loss bursts by coalescing fragmented detection windows; performance degrades primarily when sustained loss reduces the effective packet count below the minimum required for centroid estimation (Figure 10).

4. Discussion

4.1. Why Normalised Temporal Centroid Works: Physical Interpretation

The normalised temporal centroid shift is effective because it directly operationalises the physical mechanism: the wagon body shields the beacon from one receiver before the other. The RSSI-weighted centroid places more weight on the period when the beacon is closest to — and least shielded from — each receiver. For a FORWARD pass, the beacon approaches the EDGE receiver first, so t c E D G E < t c I N N E R , giving Δ T C n o r m > 0. For BACKWARD, the opposite. The normalisation by window duration removes the speed dependence: both the time difference and the window scale proportionally with speed.

4.2. Pipeline Design Choices and Trade-Offs

The three-stage validation pipeline is the key structural contribution for operational reliability. Without it, partial passes and stationary scenarios would generate false direction outputs. The pipeline's conservative design — outputting UNDEFINED rather than committing to a direction for ambiguous events — ensures that downstream systems receive only high-confidence records.
The ablation results reveal an important trade-off between coverage and error rate. Δ T C n o r m standalone has the lowest wrong-direction rate (1 error, 0.7% FP) but leaves 49.7% of events as UNDEFINED. The cascade fallback improves coverage to 58.9% while adding only 4 more wrong-direction errors. For operational deployment, this trade-off is configurable: removing the cascade gives a more conservative system; including it gives higher throughput at marginally higher FP risk.
The per-event adaptive CUSUM baseline eliminates the site-specific calibration required by fixed-threshold methods like Threshold (88.1%). This is a significant practical advantage: the pipeline can be deployed at a new station without any measurement campaigns, distinguishing it from fingerprinting-based approaches that require periodic site surveys.

4.3. Before-Edge: Fundamental Sensing Geometry Limit

The Before-edge scenario (75%, 5 errors) represents a fundamental constraint of two-receiver sensing geometry, not an algorithmic failure. Five wagons stopped within approximately 1–2 m of the EDGE receiver and reversed. At this distance, the beacon is close enough to the INNER receiver that the signal amplitude resembles a full pass, and the brief directional movement creates a centroid shift that exceeds the validation bypass threshold. The five Before-edge errors involve wagons that reversed at high speed near the EDGE gateway — a scenario deliberately included in the experimental protocol to stress-test the algorithm across a range of approach speeds. At the approach speeds typical of real freight station shunting operations (3–5 km/h), the centroid shift | Δ T C a b s | of a reversing wagon would remain well below the 3.0 s bypass threshold, and Test 3 would correctly label such events as UNDEFINED. The 75% accuracy on this category therefore represents a worst-case experimental bound rather than the expected operational performance.

4.4. Applicability and Operational Context

The results reported here constitute a proof-of-concept validation under controlled conditions at a single gateway spacing (15 m) and two sites. Generalisability to other spacings, wagon types, and station geometries remains to be established. The pipeline is positioned as an operational supplement for station management systems (StMS), not a safety-certified replacement for axle counters or signalling infrastructure (EN 50129 SIL-4). Its natural application is real-time wagon occupancy accounting: combining the beacon MAC (→ wagon inventory number) with the direction output (→ ENTRY or EXIT) generates structured occupancy events that a StMS can consume directly. The UNDEFINED output maps to 'no update' — a safe default that does not corrupt existing occupancy records.
The pipeline is computationally lightweight and requires only two standard BLE gateways per control point. The total additional infrastructure cost at a station with N control points is 2N gateways; all per-wagon hardware is already present.

4.5. Limitations and Future Work

The evaluation is limited to a single gateway spacing (15 m) at two sites. Validation across different spacings and wagon types is required to establish generalisability. The Before-edge failure mode affects 25% of a deliberately adversarial scenario category; in operational settings where wagons enter tracks at normal shunting speeds rather than stopping at the gateway, this rate will be lower.
Future work will: (i) evaluate the pipeline across at least two additional station configurations; (ii) explore multi-wagon overlap scenarios where beacons from adjacent wagons may simultaneously be visible at both gateways.

5. Conclusions

This paper demonstrated that BLE RSSI signals from proposed wagon-mounted Eddystone-TLM beacons nodes, observed at two fixed gateways, contain sufficient information for reliable directional passage sensing at railway station control points. The key algorithmic contribution is the normalised temporal centroid shift Δ T C n o r m = Δ T C / d u r — a speed-invariant directional feature derived from the physics of wagon-body electromagnetic shielding — which achieves a single decision threshold ε = 0.08 valid across 5–50 km/h without supervised training data or site-specific measurement campaigns.
The five-stage online pipeline achieves 96.7% overall accuracy (Wilson CI: [92.5%, 98.6%]) on 151 validated events with zero wrong-direction predictions (exact Clopper-Pearson 95% CI: [0%, 3.5%]). Ablation confirms the Δ T C n o r m feature dominates (Cohen's d = 2.96), with Max-Split providing complementary coverage for short high-speed windows.
This paper proposes mounting Eddystone-TLM beacon nodes on freight wagon bodies alongside two fixed BLE gateways at station control points. The beacon nodes serve a dual function — onboard telemetry and directional passage detection — at no additional per-wagon cost beyond the beacon hardware itself. Combined with the beacon MAC address as a wagon identifier, the system generates structured per-wagon per-track occupancy events directly consumable by station management systems. No track modification is required.
To contextualise the threshold-based classification against a supervised alternative, a Random Forest classifier (100 trees, LOO-CV) was trained on the three pipeline features ( Δ T C n o r m , M S d i f f , Δ t p e a k _ n o r m ) on the 93 events where all features are computable after front-end validation. The RF achieves 94.7% accuracy — identical to the Hybrid on the same subset — confirming that the physics-motivated feature set is near-optimal and that supervised learning adds no measurable benefit over the proposed training-free approach.

Author Contributions

Conceptualization, S.K.; methodology, S.K.; software, S.K.; formal analysis, S.K.; investigation, S.K.; data curation, S.K., A.I. and F.X.; writing — original draft preparation, S.K.; writing — review and editing, S.K., D.I., A.Sv., Sh.J., M.M., N.Sv., T.S. and U.Kh.; visualization, S.K.; supervision, S.K.; project administration, S.K.; funding acquisition, M.M., N.Sv. and T.S.; resources, M.M., N.Sv., T.S. and U.Kh. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Data Availability Statement

The full dataset of 151 labeled sessions is available from the corresponding author upon reasonable request. No personally identifiable information is present in the dataset; gateway and beacon MAC addresses are reported as-is since they identify hardware rather than individuals.

Conflicts of Interest

The author declares no conflicts of interest.

Abbreviations

The following abbreviations are used in this manuscript:
AoA Angle of Arrival
AoD Angle of Departure
BLE Bluetooth Low Energy
CI Confidence Interval
CUSUM Cumulative Sum
EDGE Edge gateway (inter-track side)
GNSS Global Navigation Satellite System
INNER Inner gateway (outer side)
IoT Internet of Things
LOO-CV Leave-One-Out Cross-Validation
MAC Media Access Control address
MS Max-Split (classifier)
RF Random Forest
RFID Radio Frequency Identification
RSSI Received Signal Strength Indicator
SG Savitzky-Golay filter
SIL Safety Integrity Level
StMS Station Management System
TC Temporal Centroid
TLM Telemetry (Eddystone-TLM format)
TSTU Tashkent State Transport University
UNDEFINED Undetermined direction output (no record emitted)
Wilson CI Wilson Score Confidence Interval

References

  1. Moya, I.; Perez, A.; Zabalegui, P.; De Miguel, G.; Losada, M.; Amengual, J.; Adin, I.; Mendizabal, J. Freight Wagon Digitalization for Condition Monitoring and Advanced Operation. Sensors 2023, 23, 7448. [Google Scholar] [CrossRef]
  2. Zanelli, F.; Mauri, M.; Castelli-Dezza, F.; Sabbioni, E.; Tarsitano, D.; Debattisti, N. Energy Autonomous Wireless Sensor Nodes for Freight Train Braking Systems Monitoring. Sensors 2022, 22, 1876. [Google Scholar] [CrossRef]
  3. Nexxiot - Asset Intelligence for Rail and Intermodal. Available online: https://nexxiot.com/ (accessed on 3 April 2026).
  4. Groshev, V. On Location of Axle Counters at Station Necks. Transport automation research 2022, 8, 162–177. [Google Scholar] [CrossRef]
  5. Olaby, O.; Hamadache, M.; Soper, D.; Winship, P.; Dixon, R. Development of a Novel Railway Positioning System Using RFID Technology. Sensors 2022, 22, 2401. [Google Scholar] [CrossRef] [PubMed]
  6. Xu, J.; Li, Z.; Zhang, K.; Yang, J.; Gao, N.; Zhang, Z.; Meng, Z. The Principle, Methods and Recent Progress in RFID Positioning Techniques: A Review. IEEE Journal of Radio Frequency Identification 2023, 7, 50–63. [Google Scholar] [CrossRef]
  7. Chang, M.-C.; Zhao, G.; Pandey, A.K.; Pulver, A.; Tu, P. Railcar Detection, Identification and Tracking for Rail Yard Management. In Proceedings of the 2020 IEEE International Conference on Image Processing (ICIP), October 2020; pp. 2271–2275. [Google Scholar]
  8. Laroca, R.; Boslooper, A.C.; Menotti, D. Automatic Counting and Identification of Train Wagons Based on Computer Vision and Deep Learning 2020.
  9. Hernandez, R.; Mujica, G.; Portilla, J.; Parrilla, F. Internet of Things Technology for Train Positioning and Integrity in the Railway Industry Domain. In Proceedings of the NOMS 2023-2023 IEEE/IFIP Network Operations and Management Symposium, May 2023; pp. 1–6. [Google Scholar]
  10. Capitão, P.; Pinho, P.; Carvalho, N.B. Reconfigurable IoT Solution for Train Integrity and Monitoring. IEEE Internet of Things Journal 2024, 11, 22257–22268. [Google Scholar] [CrossRef]
  11. Wilson, J.; Patwari, N. Radio Tomographic Imaging with Wireless Networks. IEEE Trans. on Mobile Comput. 2010, 9, 621–632. [Google Scholar] [CrossRef]
  12. Faragher, R.; Harle, R. Location Fingerprinting With Bluetooth Low Energy Beacons. IEEE J. Select. Areas Commun. 2015, 33, 2418–2428. [Google Scholar] [CrossRef]
  13. Ramirez, R.; Huang, C.-Y.; Liao, C.-A.; Lin, P.-T.; Lin, H.-W.; Liang, S.-H. A Practice of BLE RSSI Measurement for Indoor Positioning. Sensors 2021, 21, 5181. [Google Scholar] [CrossRef]
  14. Flueratoru, L.; Shubina, V.; Niculescu, D.; Lohan, E.S. On the High Fluctuations of Received Signal Strength Measurements With BLE Signals for Contact Tracing and Proximity Detection. IEEE Sensors Journal 2022, 22, 5086–5100. [Google Scholar] [CrossRef]
  15. Achalla, M.; Mack, K.; Banavar, M.K.; Vanitha, M.; Krishnamoorthi, H. Statistical Methods for Fast LOS Detection for Ranging and Localization. In Proceedings of the 2020 International Conference on Emerging Trends in Information Technology and Engineering (ic-ETITE), February 2020; pp. 1–5. [Google Scholar]
  16. Taşkan, A.K.; Alemdar, H. Obstruction-Aware Signal-Loss-Tolerant Indoor Positioning Using Bluetooth Low Energy. Sensors 2021, 21. [Google Scholar] [CrossRef] [PubMed]
  17. Parmar, M.; Kelly, P.; Berry, D. Effects of Body Occlusion on Bluetooth Low Energy RSSI in Identifying Close Proximity of Pedestrians in Outdoor Environments. In Proceedings of the 2022 IEEE International Smart Cities Conference (ISC2), September 2022; pp. 1–7. [Google Scholar]
  18. Tian, X.; Wu, S.; Zhang, X.; Du, L.; Fan, S. RSSI-WSDE: Wireless Sensing of Dynamic Events Based on RSSI. Sensors 2024, 24, 4952. [Google Scholar] [CrossRef]
  19. Asim, M.; Aatif, M.; Mufti, N. Investigating the Effects of Metal Obstructions on Radio Propagation in 2.4 GHz ISM Band. In Proceedings of the 2021 8th International Conference on Computer and Communication Engineering (ICCCE), June 2021; pp. 162–167. [Google Scholar]
  20. Elizalde, J.; Arriola, A.; Roset, M.; López, I.; Straub, M. Design and Validation of a Wireless Network for Intra-Train Communications. In Proceedings of the 2024 18th European Conference on Antennas and Propagation (EuCAP), March 2024; pp. 1–5. [Google Scholar]
  21. De Raeve, N.; Verhaevert, J.; Van Torre, P.; Ronse, F.; Rogier, H. BLE-Based Power Efficient WSN for Industrial IoT Train Integrity Monitoring. In Proceedings of the 2022 7th International Conference on Smart and Sustainable Technologies (SpliTech), July 2022; pp. 1–6. [Google Scholar]
  22. Lazarescu, M.T.; Poolad, P. Asynchronous Resilient Wireless Sensor Network for Train Integrity Monitoring. IEEE Internet of Things Journal 2021, 8, 3939–3954. [Google Scholar] [CrossRef]
  23. Cantón Paterna, V.; Calveras Augé, A.; Paradells Aspas, J.; Pérez Bullones, M. A Bluetooth Low Energy Indoor Positioning System with Channel Diversity, Weighted Trilateration and Kalman Filtering. Sensors 2017, 17, 2927. [Google Scholar] [CrossRef]
  24. Dujić Rodić, L.; Perković, T.; Županović, T.; Šolić, P. Sensing Occupancy through Software: Smart Parking Proof of Concept. Electronics 2020, 9, 2207. [Google Scholar] [CrossRef]
  25. Nikodem, M.; Bawiec, M. Experimental Evaluation of Advertisement-Based Bluetooth Low Energy Communication. Sensors 2019, 20, 107. [Google Scholar] [CrossRef]
  26. Park, P.; Marco, P.D.; Jung, M.; Santucci, F.; Sung, T.K. Multidirectional Differential RSS Technique for Indoor Vehicle Navigation. IEEE Internet of Things Journal 2023, 10, 241–253. [Google Scholar] [CrossRef]
  27. Goto, I.; Ueda, K.; Matsuda, Y.; Suwa, H.; Yasumoto, K. BLESS: BLE Based Street Sensing for People Counting and Flow Direction Estimation. In Proceedings of the 2024 IEEE International Conference on Pervasive Computing and Communications Workshops and other Affiliated Events (PerCom Workshops), March 2024; pp. 76–81. [Google Scholar]
  28. Lee, H.-C.; Lin, T.-T. Low-Cost Indoor Human Tracking by Utilizing Fluctuation of Received Radio Signal Strength. IEEE Sensors Journal 2020, 20, 13029–13036. [Google Scholar] [CrossRef]
  29. Maus, G.; Brückmann, D. A Non-Intrusive, Single-Sided Car Traffic Monitoring System Based on Low-Cost BLE Devices. In Proceedings of the 2020 IEEE International Symposium on Circuits and Systems (ISCAS), October 2020; pp. 1–5. [Google Scholar]
  30. Yoo, J. Change Detection of RSSI Fingerprint Pattern for Indoor Positioning System. IEEE Sensors Journal 2020, 20, 2608–2615. [Google Scholar] [CrossRef]
  31. Kaltiokallio, O.; Yiğitler, H. Movement Detection Using A Reciprocal Received Signal Strength Model. In Proceedings of the ICASSP 2021 - 2021 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), June 2021; pp. 8318–8322. [Google Scholar]
  32. KV, K.C.; Chattopadhyay, A.; Kumar, A.; Sundaresan, R. Quickest Change Point Detection with Measurements over a Lossy Link. In Proceedings of the 2023 62nd IEEE Conference on Decision and Control (CDC), December 2023; pp. 4843–4848. [Google Scholar]
  33. Gerhátová, Z.; Zitrický, V.; Klapita, V. Industry 4.0 Implementation Options in Railway Transport. Transportation Research Procedia 2021, 53, 23–30. [Google Scholar] [CrossRef]
  34. Page, E.S. Continuous Inspection Schemes. Biometrika 1954, 41, 100. [Google Scholar] [CrossRef]
  35. Basseville, M.; Nikiforov, I.V. Detection of Abrupt Changes: Theory and Application.
  36. Lopes, J.F.; Barbon Junior, S.; De Melo, L.F. Online Meta-Recommendation of CUSUM Hyperparameters for Enhanced Drift Detection. Sensors 2025, 25, 2787. [Google Scholar] [CrossRef] [PubMed]
  37. Savitzky, Abraham.; Golay, M.J.E. Smoothing and Differentiation of Data by Simplified Least Squares Procedures. Anal. Chem. 1964, 36, 1627–1639. [Google Scholar] [CrossRef]
  38. Wilson, E.B. Probable Inference, the Law of Succession, and Statistical Inference. Journal of the American Statistical Association 1927, 22, 209–212. [Google Scholar] [CrossRef]
  39. Cohen, J. Statistical Power Analysis for the Behavioral Sciences, 2nd ed.; L. Erlbaum Associates: Hillsdale, N.J, 1988; ISBN 978-0-8058-0283-2. [Google Scholar]
Figure 1. a) Experimental deployment topology. EDGE gateway is positioned in the inter-track space; INNER gateway is outside the track, 15 m apart. BLE beacon pairs are mounted on both lateral sides of each wagon body. The wagon-body shielding effect creates asymmetric RSSI envelopes used for direction classification. b) Experimental site overview at freight station. Both BLE gateways (tripods visible left and right of the track) are positioned 15 m apart across the station control point. c) BLE gateway used in the experiments. The device is mounted on a tripod at inter-track height during field deployment.
Figure 1. a) Experimental deployment topology. EDGE gateway is positioned in the inter-track space; INNER gateway is outside the track, 15 m apart. BLE beacon pairs are mounted on both lateral sides of each wagon body. The wagon-body shielding effect creates asymmetric RSSI envelopes used for direction classification. b) Experimental site overview at freight station. Both BLE gateways (tripods visible left and right of the track) are positioned 15 m apart across the station control point. c) BLE gateway used in the experiments. The device is mounted on a tripod at inter-track height during field deployment.
Preprints 208511 g001
Figure 2. a) Freight boxcar used in experiments at the freight station. The metallic body creates the wagon-body shielding effect central to the proposed algorithm. Beacons mounted on both lateral sides of the wagon body. b) Locomotive used for high-speed trials at the freight station.
Figure 2. a) Freight boxcar used in experiments at the freight station. The metallic body creates the wagon-body shielding effect central to the proposed algorithm. Beacons mounted on both lateral sides of the wagon body. b) Locomotive used for high-speed trials at the freight station.
Preprints 208511 g002
Figure 3. CUSUM change-point detection on a representative forward-pass event (file ahead_10.xlsx). Top: raw and SG-filtered EDGE RSSI with estimated baseline μ_base (purple) and detection window (green shading). Bottom: CUSUM statistics C⁺ (blue) and C⁻ (orange) with threshold h = 8 (red). The window opens when C⁺ exceeds h and closes when C⁻ exceeds h.
Figure 3. CUSUM change-point detection on a representative forward-pass event (file ahead_10.xlsx). Top: raw and SG-filtered EDGE RSSI with estimated baseline μ_base (purple) and detection window (green shading). Bottom: CUSUM statistics C⁺ (blue) and C⁻ (orange) with threshold h = 8 (red). The window opens when C⁺ exceeds h and closes when C⁻ exceeds h.
Preprints 208511 g003
Figure 4. Figure 4. Test 1 — Beacon-pair dominance check. Full pass (left): EDGE gateway observes …deda as dominant; INNER gateway observes the complementary beacon …e0e6 as dominant — expected pair matches → VALID. Lateral path left (centre): EDGE dominant is …e0e6; INNER also receives packets but …e0e6 dominates instead of the expected …deda — no wagon-body shielding to create asymmetry → NO_INNER_PKT (UNDEFINED). Lateral path right (right): EDGE dominant is …deda; INNER also receives packets but …deda dominates instead of the expected …e0e6 — both gateways are located to the left of the wagon path, so neither gateway is shielded from the dominant beacon → NO_INNER_PKT (UNDEFINED). In both lateral scenarios the failure mode is identical: the dominant beacon at INNER does not match the expected paired beacon, causing Test 1 rejection regardless of the physical cause.
Figure 4. Figure 4. Test 1 — Beacon-pair dominance check. Full pass (left): EDGE gateway observes …deda as dominant; INNER gateway observes the complementary beacon …e0e6 as dominant — expected pair matches → VALID. Lateral path left (centre): EDGE dominant is …e0e6; INNER also receives packets but …e0e6 dominates instead of the expected …deda — no wagon-body shielding to create asymmetry → NO_INNER_PKT (UNDEFINED). Lateral path right (right): EDGE dominant is …deda; INNER also receives packets but …deda dominates instead of the expected …e0e6 — both gateways are located to the left of the wagon path, so neither gateway is shielded from the dominant beacon → NO_INNER_PKT (UNDEFINED). In both lateral scenarios the failure mode is identical: the dominant beacon at INNER does not match the expected paired beacon, causing Test 1 rejection regardless of the physical cause.
Preprints 208511 g004
Figure 5. Test 2 — Peak-difference filter. Full pass (left): INNER peak close to EDGE peak (Δpeak = −0.5 dBm > −12 dBm threshold) → VALID. After-edge strong (centre): wagon reverses before reaching INNER gateway, INNER peak strongly attenuated (Δpeak = −21.6 dBm) → PARTIAL_PASS (UNDEFINED). After-edge near-threshold (right): Δpeak = −12.4 dBm, just below threshold → PARTIAL_PASS (UNDEFINED).
Figure 5. Test 2 — Peak-difference filter. Full pass (left): INNER peak close to EDGE peak (Δpeak = −0.5 dBm > −12 dBm threshold) → VALID. After-edge strong (centre): wagon reverses before reaching INNER gateway, INNER peak strongly attenuated (Δpeak = −21.6 dBm) → PARTIAL_PASS (UNDEFINED). After-edge near-threshold (right): Δpeak = −12.4 dBm, just below threshold → PARTIAL_PASS (UNDEFINED).
Preprints 208511 g005
Figure 6. Test 3 — Temporal symmetry filter. Full pass (left): asymmetric INNER profile (s_sym = 0.897) and large | Δ T C a b s  
Figure 6. Test 3 — Temporal symmetry filter. Full pass (left): asymmetric INNER profile (s_sym = 0.897) and large | Δ T C a b s  
Preprints 208511 g006
Figure 7. Characteristic RSSI envelopes and Temporal Centroid shifts. (a) FORWARD pass: tc INNER
Figure 7. Characteristic RSSI envelopes and Temporal Centroid shifts. (a) FORWARD pass: tc INNER
Preprints 208511 g007
Figure 8. Pipeline component analysis. (a) Accuracy of seven direction classifiers with 95% Wilson CI (n=151). (b) Hybrid pipeline accuracy per scenario category.
Figure 8. Pipeline component analysis. (a) Accuracy of seven direction classifiers with 95% Wilson CI (n=151). (b) Hybrid pipeline accuracy per scenario category.
Preprints 208511 g008
Figure 9. Feature distributions for FORWARD (blue), BACKWARD (red), and UNDEFINED (grey) events. Violin plots with overlaid scatter show (a) normalised temporal centroid shift, (b) Max-Split difference (dBm), and (c) normalised peak-time difference. Dotted lines indicate classification thresholds ( ε T C = ±0.08 for Δ T C n o r m ; ε MS = ±1.0 dBm for M S d i f f ; ε Δ t = ±0.05 for Δ t p e a k _ n o r m Cohen's d and p-values confirm strong class separability for all three features.
Figure 9. Feature distributions for FORWARD (blue), BACKWARD (red), and UNDEFINED (grey) events. Violin plots with overlaid scatter show (a) normalised temporal centroid shift, (b) Max-Split difference (dBm), and (c) normalised peak-time difference. Dotted lines indicate classification thresholds ( ε T C = ±0.08 for Δ T C n o r m ; ε MS = ±1.0 dBm for M S d i f f ; ε Δ t = ±0.05 for Δ t p e a k _ n o r m Cohen's d and p-values confirm strong class separability for all three features.
Preprints 208511 g009
Figure 10. Robustness of the Hybrid pipeline under simulated degradation conditions. (a) Accuracy vs. added RSSI noise σ; green shading indicates the typical BLE metallic environment noise range (≤5 dBm). (b) Accuracy vs. packet loss probability with ±1 SD error bars; green shading indicates the typical BLE packet loss range (<15%). The pipeline maintains accuracy above 90% across all realistic operating conditions.
Figure 10. Robustness of the Hybrid pipeline under simulated degradation conditions. (a) Accuracy vs. added RSSI noise σ; green shading indicates the typical BLE metallic environment noise range (≤5 dBm). (b) Accuracy vs. packet loss probability with ±1 SD error bars; green shading indicates the typical BLE packet loss range (<15%). The pipeline maintains accuracy above 90% across all realistic operating conditions.
Preprints 208511 g010
Table 1. Dataset composition with ground-truth labels.
Table 1. Dataset composition with ground-truth labels.
Category Label n Speed Description
Forward FORWARD 30 ≤10 km/h Full forward pass, slow speed
Backward BACKWARD 28 ≤10 km/h Full backward pass, slow speed
40 km/h forward FORWARD 12 ~40 km/h Full forward pass at medium speed
50 km/h forward FORWARD 14 ~50 km/h Full forward pass at high speed
Before-EDGE UNDEFINED 20 varies Wagon approaches EDGE, does not enter zone
After-EDGE-before-INNER UNDEFINED 20 varies Wagon enters zone partially, reverses
Left path UNDEFINED 10 varies Wagon travels left of gateways (no shielding)
Right path UNDEFINED 17 varies Wagon travels right of gateways (no shielding)
Total 151
Table 2. Algorithm parameters, their values, and physical justification.
Table 2. Algorithm parameters, their values, and physical justification.
Parameter Symbol Value Physical Justification
CUSUM upward threshold h 8 Requires ~8 successive above-baseline packets
CUSUM slack k 2 dBm Absorbs BLE ±3–5 dBm fluctuation
Baseline packets N b a s e 50 ~12.5 s of pre-event ambient signal
Min. window duration T m i n 10 s Shortest observed full pass at low speed
Max. window duration T m a x 120 s Handles stopped wagons without overflow
Packet timeout T o u t 3 s 24 × 100 ms BLE interval without packet
Merge gap Δ t m e r g e 5 s Empirical max fragment gap (4.2 s observed)
Peak-diff threshold Δ p e a k t h r −12 dBm Separates After-edge (−22..−12) from full pass (−14..+13)
Symmetry threshold i n n e r s y m 0.95 Before-edge events: sym ≈ 0.87–0.98
ΔTC bypass threshold Δ T C a b s 3.0 s Full-pass | Δ T C a b s | ≥ 3.48 s;
Before-edge < 1.69 s
TC normalised threshold ε T C 0.08 Speed-invariant; valid 5–50 km/h
Normalised peak-time difference threshold ε Δ t 0.05 Normalised peak shift for short windows
Max-Split threshold ε MS 1.0 dBm Amplitude difference after/before EDGE peak
Window duration gate in normalised peak-time difference threshold d u r g a t e 15 s Excludes Before-edge (18–35 s) from normalised peak-time difference threshold
SG filter window w S G 21 pts ~21 s smoothing at 100 ms packet rate
SG polynomial order d S G 2 Preserves peak shape
Table 3. Per-category pipeline accuracy (n = 151 events, 8 categories).
Table 3. Per-category pipeline accuracy (n = 151 events, 8 categories).
Category n Correct Errors Accuracy 95% Wilson CI
ahead / oldiga (FORWARD) 30 30 0 100.0% [88.6%, 100%]
back / orqaga (BACKWARD) 28 28 0 100.0% [87.9%, 100%]
40 km/h — TSTU (FORWARD) 12 12 0 100.0% [75.7%, 100%]
50 km/h — TSTU (FORWARD) 14 14 0 100.0% [78.5%, 100%]
Before-edge (UNDEFINED) 20 15 5 75.0% [53.1%, 88.8%]
After-edge (UNDEFINED) 20 20 0 100.0% [83.9%, 100%]
Left path (UNDEFINED) 10 10 0 100.0% [72.2%, 100%]
Right path (UNDEFINED) 17 17 0 100.0% [81.6%, 100%]
Total 151 146 5 96.7% [92.5%, 98.6%]
Table 4. Confusion matrix — Hybrid pipeline (n = 151 events). Zero wrong-direction errors (FORWARD ↔ BACKWARD).
Table 4. Confusion matrix — Hybrid pipeline (n = 151 events). Zero wrong-direction errors (FORWARD ↔ BACKWARD).
True \ Predicted FORWARD BACKWARD UNDEFINED
FORWARD (n=56) 56 0 0
BACKWARD (n=28) 0 28 0
UNDEFINED (n=67) 3 2 62
Table 5. Ablation study — five classifiers on n = 151 events after common front-end. Err = wrong-direction predictions. Undef = UNDEFINED outputs.
Table 5. Ablation study — five classifiers on n = 151 events after common front-end. Err = wrong-direction predictions. Undef = UNDEFINED outputs.
Classifier Correct Err Undef Accuracy 95% Wilson CI
Threshold 133 12 62 88.1% [81.9%, 92.3%]
Normalized peak-time difference 139 9 61 92.1% [86.6%, 95.4%]
Normalized temporal centroid 141 1 75 93.4% [88.2%, 96.4%]
Max-Split 141 5 67 93.4% [88.2%, 96.4%]
Hybrid (proposed) 146 5 62 96.7% [92.5%, 98.6%]
Table 6. Statistical separation of FORWARD vs. BACKWARD features (Welch's t-test).
Table 6. Statistical separation of FORWARD vs. BACKWARD features (Welch's t-test).
Feature FORWARD mean ± SD BACKWARD mean ± SD Cohen's d t-stat p-value
Δ T C n o r m +0.12 ± 0.09 −0.15 ± 0.07 3.40 t = 14.8 < 0.001
M S d i f f +15.5 ± 8.1 −20.8 ± 5.0 5.30 t = 21.5 < 0.001
Δ t p e a k _ n o r m +0.13 ± 0.10 −0.18 ± 0.06 3.55 t = 16.2 < 0.001
Table 7. Per-class precision, recall, and F1-score for the Hybrid pipeline (n = 151).
Table 7. Per-class precision, recall, and F1-score for the Hybrid pipeline (n = 151).
Class n Precision Recall F1-score Interpretation
FORWARD 56 0.949 1.000 0.974 No wrong-direction errors; 3 FP from Before-edge events
BACKWARD 28 0.933 1.000 0.966 No wrong-direction errors; 2 FP from Before-edge events
UNDEFINED 67 1.000 0.925 0.961 All direction events correctly classified; 5 FN (Before-edge)
Macro avg 151 0.961 0.975 0.967 Balanced across all three classes
Table 9. Mid-p McNemar tests comparing classifier pairs on the same 151 events.
Table 9. Mid-p McNemar tests comparing classifier pairs on the same 151 events.
Comparison A corr/
B wrong
A wrong/
B corr
mid-p Result
Hybrid vs Δ t p e a k _ n o r m 8 1 0.022 Significant
(p < 0.05)
Hybrid vs M S d i f f 5 0 0.031 Significant
(p < 0.05)
Hybrid vs Δ T C n o r m 9 4 0.180 Not significant
Δ T C n o r m vs Δ t p e a k _ n o r m 10 8 0.648 Not significant
Table 10. Hybrid pipeline accuracy under RSSI noise injection (n = 151 events per level).
Table 10. Hybrid pipeline accuracy under RSSI noise injection (n = 151 events per level).
Noise σ (dBm) Accuracy Change from baseline Operational status
0 (baseline) 96.7% ✓ Normal
1 95.4% −1.3 pp ✓ Normal
2 94.7% −2.0 pp ✓ Normal
3 94.0% −2.7 pp ✓ Normal
4 92.7% −4.0 pp ✓ Acceptable
5 90.7% −6.0 pp ✓ Acceptable (worst-case metallic env.)
6 90.7% −6.0 pp ~ Marginal
Table 11. Hybrid pipeline accuracy under simulated packet loss (n = 151 events, mean ± SD over 3 seeds).
Table 11. Hybrid pipeline accuracy under simulated packet loss (n = 151 events, mean ± SD over 3 seeds).
Packet loss Accuracy (mean ± SD) Change from baseline Operational status
0% (baseline) 96.7% ± 0.0% ✓ Normal
10% 95.4% ± 0.5% −1.3 pp ✓ Normal (typical BLE range)
20% 91.6% ± 1.4% −5.1 pp ✓ Acceptable
30% 89.4% ± 0.9% −7.3 pp ~ Marginal (severe conditions)
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.
Copyright: This open access article is published under a Creative Commons CC BY 4.0 license, which permit the free download, distribution, and reuse, provided that the author and preprint are cited in any reuse.
Prerpints.org logo

Preprints.org is a free preprint server supported by MDPI in Basel, Switzerland.

Subscribe

Disclaimer

Terms of Use

Privacy Policy

Privacy Settings

© 2026 MDPI (Basel, Switzerland) unless otherwise stated