Swapping Data-Sharing Partners for Decentralized Gait Models Across Clinics

Wearable motion sensors (inertial measurement units, or IMUs: small accelerometer-plus-gyroscope chips strapped to the back, waist or feet) can measure how patients walk at home. The algorithms that turn these signals into clinical numbers such as stride length or freezing-of-gait alarms perform very differently across diseases and walking speeds. Each clinic, though, sees only a few patients, and privacy rules and competing institutional interests keep it from pooling raw recordings with other clinics. One remedy is decentralized learning. Clinics train models locally and periodically average them with a handful of partner clinics, with no central server involved. That approach is known to collapse when partners' data differ strongly and the partner network is sparse. We propose to treat the choice of partners as the object of optimization. Each clinic keeps a fixed number of bilateral data-sharing agreements. Clinics then repeatedly trade partners in pairs, borrowing the "swap-matching" procedure from wireless resource allocation. A trade goes through only if no clinic involved is made worse off.

The central point is that a partner's value to a clinic is not a private, fixed quantity. It depends on whom that partner is itself connected to, because models propagate through the network over several averaging rounds. This dependence of one agent's payoff on other agents' choices is what matching theory calls an externality, and it is the case where simple propose-and-reject matching fails and swap-based matching is designed to work. The question we test is whether this partner-trading layer closes most of the gap between peer-to-peer and server-based learning on fragmented clinical gait data, under a fixed budget of partners per clinic. We also test whether it beats the obvious topology-only and similarity-only alternatives.

Core Claim

Under a hard per-clinic limit on the number of partners, a degree-preserving swap-matching game can choose the peer-to-peer averaging graph for decentralized gait-model training. Each clinic's payoff in this game combines how relevant each other clinic's data are to it with how strongly that clinic's model reaches it through the network. We claim the resulting graph gives lower per-clinic error on real-world gait tasks than two alternatives: random well-connected graphs of the same size, and graphs where each clinic simply links to its most similar peers. We also claim it recovers a substantial share of the accuracy of centralized federated averaging while requiring no trusted server and no raw-data exchange.

The motivation comes from two findings in the file. The first is from Which mode is better for federated learning? Centralized or Decentralized. It compares server-based averaging with peer-to-peer gossip averaging on non-identically distributed data. Server-based averaging with 30% participation beat gossip on a ring of 100 clients by nearly 20% test accuracy on Dirichlet-partitioned CIFAR-10 (β = 0.1). The same paper shows gossip avoids collapse only when the network is dense enough, with a spectral quantity satisfying $\kappa_\lambda \leq O(\sqrt{m})$ for $m$ clients. That paper fixes the graph in advance. We make the graph a decision variable chosen by the clinics themselves.

The second finding is from Assessing real-world gait with digital technology? Validation, insights and recommendations from the Mobilise-D consortium. It validated lower-back-sensor algorithms across 108 participants in six clinical cohorts. Accuracy depended strongly on pathology, walking speed below 0.5 m/s, and bouts shorter than 12 steps. This is exactly the heterogeneity that makes "average with everyone equally" a poor default and "average only with look-alikes" a fragile one.

Why Swap-Matching and Not Simpler Matching

The matching literature supplies the method. Deferred acceptance, in which agents propose and receivers tentatively hold or reject offers, converges quickly when each agent's preferences are independent of others' assignments. Semiari et al. show linear convergence in the number of users for mmWave scheduling. Avner shows collision-free channel allocation without explicit communication. Hamidouche et al. apply the same protocol to edge caching.

Ashraf et al. instead face interference, where one vehicle pair's payoff on a radio block depends on which other pairs share it. They start from an initial assignment and let pairs swap resources until no mutually beneficial swap remains. This yields a 65.21 dB SINR gain at the 25th percentile over a fixed-zone reference in a Manhattan-grid V2V simulation.

Our setting has the same structure with a different resource. A clinic's "resource" is its set of partner slots. Its payoff from a partner depends on that partner's other links, which is an externality. A link also requires both clinics' consent, which makes the problem two-sided. That is the property matching theory models and unilateral nearest-neighbour selection ignores. We take the swap-with-externalities mechanism from Ashraf et al. and change what is being swapped: model-averaging edges between clinics instead of spectrum blocks.

We also drop their roadside-unit coordinator, since swaps here are negotiated only among the four clinics involved.

The Mechanism

Each of $m$ clinics trains a local copy of a gait model and averages parameters with its current partners. The partner graph $G$ gives every clinic exactly $d$ partners, where $d$ is a governance budget standing in for the cost of each bilateral agreement. After a short warm-up of local training, clinic $i$ estimates a relevance score $r_{ij} \in [-1, 1]$ for each clinic $j$ it can contact. The score is the cosine similarity between the two clinics' recent model updates, so no raw signals are shared. From $G$ we form the standard symmetric gossip averaging matrix $W(G)$ with Metropolis weights. Clinic $i$'s payoff is

$$u_i(G) = \sum_{j} \big[W(G)^{T}\big]_{ij}\, r_{ij},$$

where $T$ is the number of averaging rounds between graph updates. The entry $[W(G)^T]_{ij}$ measures how much of clinic $j$'s model reaches clinic $i$ after $T$ rounds. This term creates the externality: adding or removing links anywhere changes it.

A swap is a double edge exchange. Links $(a,b)$ and $(c,d)$ are replaced by $(a,d)$ and $(c,b)$, which leaves every clinic's number of partners unchanged. The swap is executed only if two conditions hold. First, no clinic among $a, b, c, d$ has its payoff decrease. Second, the potential

$$\Phi(G) = \sum_i u_i(G) + \lambda\, \gamma(G)$$

strictly increases, where $\gamma(G)$ is the spectral gap of $W(G)$ (a standard measure of how fast averaging mixes) and $\lambda \geq 0$ trades relevance against mixing. The $\gamma$ term is how we target the density condition of Sun et al. directly, instead of hoping relevance-driven wiring happens to satisfy it.

Requiring $\Phi$ to rise at every accepted swap rules out the endless swap cycles that the file flags as a known failure of swap-matching under general externalities. Termination follows because $\Phi$ strictly increases over a finite set of graphs. The endpoint is a swap-stable graph, not a global optimum. Clinics can evaluate $u_i$ locally from $T$-hop neighbourhood information, since only clinics within $T$ hops contribute. Payoffs are re-estimated periodically as models change.

Research Program

The first stage builds a fragmented-clinic testbed from the gait data in the file. Two tasks share an input format. The first is lower-back or waist IMU initial-contact detection with stride-length regression, the digital mobility outcomes defined by Mobilise-D. The second is freezing-of-gait detection on 2.56-second windows, following Deep Learning for Detecting Freezing of Gait Episodes in Parkinson's Disease Based on Accelerometers.

Data sources are the Mobilise-D multi-cohort recordings (subject to their availability to us), the open WearGait-PD cohort of 61 Parkinson's patients and 65 controls, the home freezing-of-gait recordings, and the Barth and Kluge datasets distributed through Gaitmap. Gaitmap's shared coordinate conventions and SI units handle the format fragmentation described in A survey of datasets, applications, and models for IMU sensor signals.

Subjects are assigned to between 30 and 100 virtual clinics, each holding only a few patients. The assignment is skewed by pathology, walking speed and sensor hardware, which reproduces the small, non-representative silos that motivate the work. WearGait-PD's 18% sensor-dropout rate is kept as is, not cleaned away. Because the subject pool totals a few hundred people, clinics are necessarily small. That is the regime of interest, but it also means results must be reported over many random clinic assignments.

The second stage implements the swap protocol on top of standard gossip averaging and characterizes it. We measure how many swaps are needed before no further swap is accepted, how the spectral gap of the reached graph compares with Sun et al.'s density threshold, and how the reached graph relates to cohort structure. We also check whether PD clinics end up linked to other PD clinics while keeping enough cross-cohort links to mix.

The third stage adds two stresses. Clinics drop out mid-training, standing in for institutional churn of the kind Thomas et al. document for patient migration across a regional network. A fraction of clinics also report corrupted updates, standing in for detached or faulty sensors. We check whether the relevance scores route around both. We treat the Byzantine case only empirically; Byzantine Stable Matching is a theoretical frame, not a component we reuse.

Baselines

The naive reference is local-only training. Each clinic fits the same model on its own patients with no exchange. This bounds what collaboration must beat and shows how badly small silos do on slow-walking and severely impaired cohorts.

The non-learned reference is the published single-sensor pipeline performance from Mobilise-D: stride-length absolute error below 0.21 m, cadence relative error below 8.5%, and initial-contact sensitivity above 0.79 with positive predictive value above 0.89. For freezing of gait, the reference is the centrally trained 1D convolutional network at 88.6% sensitivity and 78% specificity on 15 home-recorded patients. Both numbers come from centralized, homogeneous training and serve as orientation, not as matched comparisons. We found no reported result on Lacuna for decentralized or federated training on any IMU gait dataset.

The strongest competitor is centralized federated averaging with partial participation. Sun et al. show it beats gossip by nearly 20% test accuracy on non-IID CIFAR-10. We run it on identical clinic partitions, with the same model, the same total number of local steps, the same communication rounds and the same hyperparameter search budget. Beating it is not required. The proposal succeeds if it recovers at least half of the gap between the best fixed-graph gossip baseline and centralized averaging while using no server. It would be a stronger result if it matched centralized averaging on the worst-off cohort, where global averaging tends to favour the majority.

The topology-only competitor is gossip on a random $d$-regular graph with the same degree budget. Such graphs mix well and are the natural way to satisfy the density condition without any data awareness. Gossip on a ring is included to reproduce the collapse Sun et al. report.

The data-only competitor links each clinic to its $d$ most similar peers by the same update-cosine score, resolving non-mutual choices greedily. This isolates whether mutual consent and swapping add anything over plain similarity.

A centralized oracle solves the same objective $\Phi$ with full knowledge, using simulated annealing over degree-preserving graphs. It measures how much the decentralized swap process loses against a planner.

Two ablations target the key ingredient. The first sets the payoff to direct-neighbour relevance only ($T = 1$), which removes the externality. The second sets $\lambda = 0$, which removes the mixing term. All methods share clinic partitions, model architecture, compute budget and tuning budget. We report means and confidence intervals over at least ten random clinic assignments.

Why not just…?

Why not just use a central server running federated averaging? On accuracy alone this is the most serious threat, and Sun et al. give it strong support. The case against it is institutional. Weissler et al. describe how even federated collaboration among competing parties required elaborate orchestration arrangements (the MELODDY consortium), and a trusted aggregator is a single legal and technical point of failure. We do not argue that this cost always outweighs accuracy. We measure the accuracy price of going serverless with and without partner swapping, and report it honestly. If swapping recovers little of the gap, the conclusion is that clinics should build the server.

Why not just use a random well-connected graph? An expander with $d$ partners per clinic already satisfies the density condition, so if the problem were purely about mixing, graph design would be pointless. It is a real threat. The Mobilise-D finding suggests it will fall short on minority cohorts, because pathology-dependent accuracy means indiscriminate averaging pulls a femoral-fracture clinic toward healthy-walker models. The random-regular baseline and the $\lambda$-only variant test this directly. If they match the full method, cohort-aware wiring adds nothing and we will say so.

Why not just link each clinic to its most similar peers? Similarity-only wiring is cheap and personalizes well. It tends to split the network into disconnected cohort islands, which is the sparse, poorly mixing regime where Sun et al. observe collapse. It also ignores that a link needs both parties' consent. The $k$-nearest-neighbour baseline and the $T = 1$ ablation measure this. A win for the full method on the per-cohort worst case, together with a larger spectral gap, would show the externality term is doing work.

Why not just use deferred acceptance instead of swaps? Propose-and-reject matching converges quickly when payoffs are independent, as Semiari et al. show. Here payoffs change whenever a partner's other links change, which is the case where Ashraf et al. needed swaps. We include a deferred-acceptance variant using the same relevance scores as preferences and record both its final error and whether it settles.

Proposed Experiments and Decisive Checks

The first check reproduces Sun et al. on Dirichlet CIFAR-10 with 100 clients, confirming the roughly 20% ring-versus-server gap in our implementation. We then test whether swapped graphs under the same degree budget close it. Topology effects are best understood on a benchmark with a published number before moving to scarce clinical data.

The main experiment runs all baselines on the gait testbed. We report stride-length absolute error, cadence and initial-contact errors in the Mobilise-D definitions, and freezing-of-gait sensitivity and specificity. Each metric is broken down by cohort and by walking-speed band, with separate reporting below 0.5 m/s. The decisive comparison is on the worst-performing cohort, not the average.

The idea is falsified if either of two outcomes holds. The first is that random-regular gossip or nearest-neighbour wiring comes within the confidence interval of the swapped graph on the worst cohort. The second is that the $T = 1$ ablation performs as well as the full payoff.

Secondary checks sweep the degree budget $d$ from 2 to 8 and measure where the benefit of swapping disappears; we expect it to vanish as graphs become dense. Further checks measure swap counts and communication overhead until swap-stability, and track error under clinic churn and under a fraction of corrupted clinics.

We also report what the relevance scores leak about each clinic's cohort composition. Sharing update similarities is not free from a privacy standpoint, and a membership-style test on cohort labels quantifies that cost.