How RuView's PageRank Influence Mapping Enables Spatial Reasoning in Wi-Fi Sensing

RuView determines which person in a multi-person Wi-Fi sensing scene is most influential by running a lightweight PageRank algorithm over a correlation graph built from CSI sub-carrier phase data.

RuView is an open-source Wi-Fi sensing framework that transforms raw Channel State Information (CSI) into actionable spatial intelligence. Its PageRank influence mapping module converts complex radio signal interactions into a graph-theoretic representation, enabling real-time spatial reasoning about which subject dominates the wireless channel in multi-person environments.

Building the Correlation Graph from CSI Phase Data

The foundation of RuView's spatial reasoning lies in constructing a correlation graph from sub-carrier phase measurements.

Sub-Carrier Grouping and Data Preparation

Each CSI frame supplies up to 32 sub-carrier phases. The module allocates eight sub-carriers per tracked person using the constant SC_PER_PERSON = 8, creating distinct phase groups for each individual in the scene. This grouping allows the system to treat each person's radio signature as a separate node in the influence graph.

Constructing the Weighted Adjacency Matrix

In rust-port/wifi-densepose-rs/crates/wifi-densepose-wasm-edge/src/spt_pagerank_influence.rs, the build_adjacency function (lines 90-107) constructs the graph structure:

  • It iterates over every pair of tracked persons
  • Computes the normalized cross-correlation between their phase groups using cross_correlation (lines 112-140)
  • Applies the formula: |Σ phase_i·phase_j| / (||phase_i|| · ||phase_j||)
  • Stores symmetric weights in the adjacency matrix adj
  • Forces self-loops to zero to prevent a node from influencing itself

The resulting weighted adjacency matrix quantifies how strongly each person's radio signature correlates with others, forming the basis for dominance detection.

Computing Influence with Power Iteration PageRank

Once the correlation graph is established, RuView applies a classic PageRank algorithm to determine influence hierarchy.

The Transition Matrix and Damping Factor

The graph converts to a column-normalized transition matrix M where each column sums to 1. The implementation uses a standard damping factor DAMPING = 0.85, ensuring the random surfer model accounts for 85% of the transition probability while 15% represents random teleportation across the graph.

The PageRank Iteration Formula

The core algorithm runs a power-iteration loop defined by PR_ITERS = 10 (lines 141-176 in spt_pagerank_influence.rs):


rₖ₊₁ = d·M·rₖ + (1‑d)/N

Where:

  • d is the damping factor (0.85)
  • M is the column-normalized transition matrix
  • rₖ is the rank vector at iteration k
  • N is the current number of tracked persons

After each iteration, the vector normalizes to sum to 1, converging on the stationary distribution that represents each person's influence score.

Event-Driven Spatial Reasoning Output

The module exposes spatial reasoning results through an event system and direct API queries, allowing downstream components to react to dominance changes.

Dominant Person Detection

After ranking completes, build_events (lines 190-232) emits three event types as static (event_id, value) tuples:

  • EVENT_DOMINANT_PERSON (760) – Contains the index of the person with the highest PageRank score
  • EVENT_INFLUENCE_SCORE (761) – Provides the actual rank value of that dominant person
  • EVENT_INFLUENCE_CHANGE (762) – Signals when any person's rank changes by more than CHANGE_THRESHOLD = 0.05 compared to the previous frame, encoding the person ID in the integer part and the signed delta in the fractional part

Querying Rank Values

Consumers can directly query the current state through two methods (lines 236-250):

  • rank(person_id) – Returns the current PageRank score for a specific individual
  • dominant_person() – Returns the index of the most influential person

These APIs enable higher-level spatial reasoning modules—such as pose tracking or activity detection—to focus computational resources on the dominant subject in each frame.

Practical Implementation Example

The following example demonstrates initializing the tracker and processing a synthetic CSI frame:

use wifi_densepose_wasm_edge::spt_pagerank_influence::PageRankInfluence;

// Initialise the tracker.
let mut pr = PageRankInfluence::new();

// Simulated phase data for two people (8 sub‑carriers each).
let phases = [
    // Person 0
    1.0, 1.1, 0.9, 1.2, 1.0, 1.0, 1.1, 0.9,
    // Person 1 (weak signal)
    0.1, 0.0, 0.2, 0.1, 0.0, 0.1, 0.0, 0.2,
];

// Process one CSI frame, reporting two tracked persons.
let events = pr.process_frame(&phases, 2);

// Inspect emitted events.
for (id, value) in events {
    match id {
        760 => println!("Dominant person: {}", value as usize),
        761 => println!("Influence score: {:.3}", value),
        762 => {
            let person = value.trunc() as usize;
            let delta = value.fract();
            println!("Person {} rank changed by {:.3}", person, delta);
        }
        _ => {}
    }
}

// Direct query of the current rank vector.
println!("Rank of person 0: {:.3}", pr.rank(0));
println!("Rank of person 1: {:.3}", pr.rank(1));

Integrating with a higher-level pose tracker:

fn update_pose_tracker(pr: &mut PageRankInfluence, phases: &[f32], n: usize) {
    // Process the frame and let PageRank produce events.
    let evts = pr.process_frame(phases, n);
    // Forward the dominant‑person event to the pose tracker.
    if let Some(&(id, val)) = evts.iter().find(|&&(e, _)| e == 760) {
        let dominant = val as usize;
        pose_tracker.select_focus(dominant);
    }
}

Summary

  • RuView's PageRank influence mapping converts CSI phase correlations into a graph structure where nodes represent persons and edges represent radio signal similarity.
  • The build_adjacency function in spt_pagerank_influence.rs constructs a weighted adjacency matrix using normalized cross-correlation across eight sub-carriers per person.
  • A power-iteration PageRank algorithm with 10 iterations and 0.85 damping factor computes influence scores via the formula rₖ₊₁ = d·M·rₖ + (1‑d)/N.
  • The system emits events for dominant person detection (760), influence scores (761), and threshold-based change detection (762) using CHANGE_THRESHOLD = 0.05.
  • Direct API methods rank() and dominant_person() allow real-time spatial reasoning modules to prioritize the most influential subject in multi-person Wi-Fi sensing scenes.

Frequently Asked Questions

What is the computational complexity of RuView's PageRank implementation?

The implementation operates in O(N²) time per frame, where N is the number of tracked persons. The adjacency construction requires comparing all pairs of phase groups (lines 90-107), while the power iteration runs a fixed 10 rounds (PR_ITERS = 10) over an N×N matrix. This constant iteration bound ensures predictable real-time performance regardless of graph density.

How does the CHANGE_THRESHOLD parameter affect spatial reasoning?

The CHANGE_THRESHOLD = 0.05 constant (defined in spt_pagerank_influence.rs) filters event emissions to reduce noise in spatial reasoning pipelines. When a person's PageRank score fluctuates by less than 0.05 between frames, no EVENT_INFLUENCE_CHANGE (762) is emitted. This hysteresis prevents rapid toggling between dominance states while still capturing meaningful interpersonal influence shifts in the Wi-Fi sensing environment.

Can the PageRank influence mapping handle more than two persons?

Yes. The implementation dynamically adjusts to the current number of tracked persons (N) passed to process_frame(). While the examples show two persons, the adjacency matrix construction (lines 112-140) and PageRank iteration (lines 141-176) scale to any N supported by the CSI frame capacity—up to four persons given the 32 sub-carrier limit (SC_PER_PERSON = 8). The transition matrix normalization and teleportation term (1‑d)/N automatically adapt to varying person counts.

Why use PageRank instead of simple signal strength for dominance detection?

PageRank captures relational influence rather than absolute signal power. In multi-person Wi-Fi sensing, the "dominant" person is not necessarily the one with the strongest raw signal, but the one whose radio signature most strongly correlates with the overall network of phase interactions. By analyzing cross-correlations through cross_correlation and propagating influence through the graph, RuView identifies the person who structurally anchors the spatial scene—a critical distinction for accurate spatial reasoning in complex indoor environments.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →