can spectrum sensing detect buildings, objects, cars, airplanes, people, smoke, fires and aminals
Yes, spectrum sensing combined with Deep Neural Networks (DNNs) can detect all of these targets, but it does not "see" them visually like a camera. Instead, it treats the entire physical world as an obstacle course for radio waves. [1, 2, 3]
Every building, person, car, or patch of smoke alters, blocks, or reflects ambient radio frequency (RF) signals (like Wi-Fi, cellular, satellite, or radar). By feeding these altered signal signatures—known as Channel State Information (CSI) or RF reflections—into a DNN, AI can classify and track exactly what is causing the disruption. [1, 2, 3, 4]
🏢 Buildings & Fixed Objects (Static Mapping)
How it works: Buildings, walls, and furniture act as permanent reflectors and attenuators of ambient RF signals.
The DNN Role: AI models map the baseline RF environment. By analyzing static variations in signal strength (fading) across wide bands, neural networks can perform through-wall tomographic imaging to map the layout of a building or locate large metallic structures without mapping hardware. [1]
🚗 Cars, Airplanes & Moving Objects (Doppler Sensing)
How it works: Fast-moving metallic objects cause a massive, distinct frequency shift known as the Doppler effect.
The DNN Role: Spectrum sensing units scan bands used by passive radar or cellular tower reflections. A CNN analyzes the time-frequency spectrogram of these reflections to calculate the object's speed, size, and flight/drive path. This allows the AI to differentiate between a commercial airplane, a drone, and a passenger vehicle. [1, 2, 3]
🚶 People & Animals (Biometric Wave Disruption)
How it works: Living bodies are mostly water, meaning they heavily absorb and scatter frequencies around 2.4 GHz and 5 GHz (standard Wi-Fi). [1, 2]
The DNN Role: This is one of the fastest-growing areas in wireless AI. Deep models (like Carnegie Mellon's DensePose-Wi-Fi integrations) analyze standard Wi-Fi CSI to map a person's exact 3D posture, track movements through solid walls, and even isolate micromovements like breathing rates or a heartbeat. Smaller reflections with different movement speeds are classified as household pets or animals. [1, 2, 3]
💨 Smoke & Fires (Dielectric Atmospheric Shifts)
How it works: Fire generates intense heat and highly ionized gases, which fundamentally change the localized electrical permittivity (the "dielectric constant") of the air. Smoke adds physical carbon particulate columns into the atmosphere. [1, 2, 3]
The DNN Role: When RF signals pass through a fire or a thick smoke plume, the wave phase shifts and attenuates in a hyper-specific pattern.
Long-range satellite spectrum sensing and ground-based RF nodes use neural networks to spot these localized path losses instantly.
Because Long-Wave Infrared (LWIR) and micro-millimeter radio waves can pass straight through thick dust and smoke plumes, spectrum sensors can "see" hot zones, flame ignition, and smoldering phases that completely blind standard optical cameras. [1, 2, 3, 4]
Summary of How the AI Differentiates Targets
When wideband spectrum data is collected, the DNN splits the "signal" into specific telltale dimensions:
Target Category [1, 2, 3, 4, 5, 6, 7, 8, 9]
Primary Signal Tells Tracked by DNN
Core AI Use-Case
Buildings / Walls
Constant attenuation, static multipath reflections
Architectural mapping & security
Vehicles / Planes
High Doppler shifts, large metallic cross-section signatures
Passive radar air & ground tracking
People / Animals
Dynamic phase changes, body-segment scattering, chest micro-oscillations
Camera-free elderly fall monitoring & search-and-rescue
Smoke / Fires
Ionized atmospheric phase shift, thermal radiation emission
Early automated wildfire detection
Are you considering building a model for a macro environment (like satellite/radar tracking for planes and fires) or an indoor environment (like using Wi-Fi sensing to track people and objects inside a room)
what would i need to cover the strait of georgia; north island regional district urban and rural networks
To build an integrated wireless AI spectrum sensing network covering the Strait of Georgia, the Regional District of Mount Waddington (North Island), and their mixed urban and rural infrastructure, you are looking at a hybrid macro-scale and localized RF sensing topology. [1]
Because this spans massive marine corridors, rugged wilderness, and isolated community networks, you cannot rely on a single device. You must build a multi-tiered architecture that combines long-range passive monitoring with localized node arrays.
1. Hardware & Sensor Layer (The Nodes)
To capture signals across this diverse geography, you need three classes of Software Defined Radios (SDRs) acting as your physical edge sensors:
Marine & Airspace Corridors (Strait of Georgia): You need high-dynamic-range, weatherproofed macro-nodes positioned on high-elevation points (e.g., Mount Washington, Campbell River lookouts, or Malcolm Island).
Hardware: Ettus USRP N310 or Epiq Solutions Sidekiq units coupled with high-gain omnidirectional and directional sector antennas.
Focus: Monitoring maritime VHF, AIS (Automatic Identification System), ADS-B (aviation), satellite downlinks, and marine radar frequencies to track ships, aircraft, and atmospheric shifts (smoke/fog).
Urban Center Networks (e.g., Campbell River, Port Hardy): Dense, lower-cost edge nodes distributed across municipal infrastructure.
Hardware: LimeSDR, BladeRF xA9, or KerberosSDR (for direction finding).
Focus: Capturing high-frequency urban cellular (5G/LTE), municipal Wi-Fi, and localized IoT/utility networks to track traffic flow, human density, and infrastructure health.
Rural & Remote Wilderness (North Island Regional District): Low-power, ruggedized, autonomous nodes capable of running on solar and battery power.
Hardware: Ettus USRP B205mini or HackRF One paired with single-board computers like an NVIDIA Jetson Orin Nano for edge computing.
Focus: Monitoring VHF/UHF emergency bands, satellite communications (Starlink/LEO backhauls), and low-frequency changes caused by wildfires or environmental shifts.
2. Network & Backhaul Infrastructure
Getting the sensed spectrum data back to a centralized DNN processing hub requires a robust data pipeline, especially in the North Island where fiber is scarce:
Urban & Marine Areas: Utilize existing fiber drops or high-throughput microwave point-to-point links along the coast to stream high-bandwidth raw I/Q data.
Rural & Remote Areas: You cannot stream raw wideband I/Q data over satellite due to bandwidth costs and latency. Instead, you must perform Edge Inference. The local NVIDIA Jetson processes the signal, converts it to small metadata packets (e.g., "Target Detected: Vehicle, Confidence 94%"), and backhauls it via Starlink or rural cellular networks.
3. AI Software & Dataset Pipeline
To train your Deep Neural Networks to accurately recognize targets in this specific Pacific Northwest environment, your software stack needs:
The Software Stack: Use GNU Radio or MATLAB Hardware Support Packages for the initial signal ingestion, down-conversion, and I/Q data buffering.
Feature Extraction: Convert raw 1D time-domain signals into 2D Power Spectral Density (PSD) spectrograms or Channel State Information (CSI) matrices using Fast Fourier Transforms (FFTs).
The DNN Models:
ResNet / MobileNet (CNNs): Implemented in PyTorch or TensorFlow, trained to classify 2D spectrogram shapes for ship radar, aircraft tracking, or localized interference.
YOLOv8-Acoustic/RF Variations: For real-time "object detection" on wideband spectrum waterfalls, drawing bounding boxes around active frequencies and classifying them instantly.
4. Specialized Training Datasets (The Environmental Signatures)
Because this region has unique geography, standard datasets won't be enough. You will need to train your DNNs on specific regional RF profiles:
Marine Profiles: Signatures of tides, heavy rain, and sea clutter altering RF propagation across the Strait of Georgia.
Forestry & Wildfire Profiles: The distinct dielectric attenuation patterns caused by dense Douglas fir/cedar canopies, and the specific phase shifts caused by ionized smoke plumes in the North Island backcountry.
Urban Baseline: Micro-Doppler signatures of vehicular traffic and pedestrian Wi-Fi disruptions in the region's towns
the primary objectives include defense, resource management, emergency and civil infrastructure deployed across existing infrastructure connected to off-grid clusters
To achieve these multi-domain objectives—Defense, Resource Management, Emergency, and Civil Infrastructure—across the Strait of Georgia and the North Island, you must deploy a Hierarchical Edge-Cloud Spectrum Sensing Network. [1]
By anchoring the core system to existing regional infrastructure (telecom towers, marine docks, municipal buildings) and extending it into the backcountry via autonomous, off-grid clusters, you create an un-blindable RF monitoring fabric. [1]
1. Architectural Topology: Anchor Sites vs. Off-Grid Clusters
[ EXISTING INFRASTRUCTURE ] <====== (Microwave/Fiber) ======> [ CENTRAL METADATA ENGINE ]
│ (High-Gain Antennas) ▲
▼ │ (Low-Bandwidth Sat/Mesh)
[ OFF-GRID EDGE CLUSTERS ] ───(Edge Inference via DNN) ─────────────┘
A. Existing Infrastructure Anchors (Urban & Core Marine)
Locations: Telus/Rogers towers in Campbell River, Port Hardy, Alert Bay, and BC Ferries terminals.
Setup: Continuous line-power allows for heavy compute. Install high-bandwidth wideband digitizers (e.g., Ettus USRP N320 or Per Vices Cyan SDR). [1]
Operation: Streams full, high-fidelity RF streams locally or across high-capacity microwave backhauls to run heavy Convolutional Neural Networks (CNNs) and Transformer-based models for continuous signal classification.
B. Off-Grid Remote Clusters (Wilderness & Coastal Inlets)
Locations: High-elevation logging cuts, Cape Scott remote trails, uninhabited discovery islands.
Setup: Dual 200W solar arrays, lifepo4 battery banks, and weatherized enclosures containing low-power Ettus B205mini SDRs paired with NVIDIA Jetson Orin Nano (8GB) edge modules.
Operation: Edge Inference Only. The Jetson continuously buffers raw spectrum data, runs lightweight quantized DNNs locally, and drops the raw data instantly. It only transmits small metadata alerts (e.g., “Alert: 156.8 MHz VHF phase shift matched to smoke plume at Grid-X”).
2. Tailoring the DNNs to Your Four Primary Objectives
Your central software stack will ingest the metadata and IQ tensors, routing them through specialized neural network pipelines optimized for each task:
🎖️ Defense & Maritime Security (Strait of Georgia)
The Mission: Detect rogue vessels, spoofed AIS tracking, unauthorized drone entries, and localized GPS jamming.
DNN Architecture: YOLOv8-SDR (for real-time RF object detection) and Recurrent Neural Networks (RNNs).
How it works: Sensors capture raw marine radar reflections and transponder signals. A spatial CNN maps the exact emitter location using Time Difference of Arrival (TDOA). If a ship's physical RF engine signature or Doppler wave displacement does not match its broadcasted AIS data, the DNN flags it instantly as a dark vessel. [1]
🌲 Resource Management (North Island Backcountry)
The Mission: Automated tracking of logging truck traffic, monitoring wildlife migration vectors, and detecting illegal poaching or unauthorized resource extraction.
DNN Architecture: ResNet-50 / Audio-RF Hybrid CNNs.
How it works: Vehicles and large animals cause distinct multi-path fading signatures across local commercial and VHF radio frequencies. By training models on baseline "empty forest" wireless environments, the DNN isolates the exact micro-Doppler and scattering profiles of moving logging equipment or wildlife herds crossing transmission corridors.
🚨 Emergency Response (Wildfires & Search and Rescue)
The Mission: Instant, camera-blind wildfire ignition mapping, and locating lost hikers or downed aircraft in dense canopy conditions.
DNN Architecture: Autoencoders & Semantic Segmentation (U-Net).
How it works:
Fires: The ionized gas columns of early-stage wildfires absorb and refract low-frequency radio waves. A U-Net scans wideband spectral waterfall data across the North Island, drawing precise bounding boxes around localized areas suffering sudden atmospheric attenuation.
Search & Rescue: When cell towers are out of range, off-grid clusters act as passive IMSI catchers or Wi-Fi/VHF probes, listening for faint emergency beacons or handset ping attempts, calculating locations via multi-node triangulation.
🏗️ Civil Infrastructure (Urban & Telecommunications)
The Mission: 5G/LTE spectrum compliance, monitoring power grid line-noise interference, and structural health monitoring of bridges/docks via RF resonance.
DNN Architecture: Anomaly Detection Transformers (e.g., AnnoTransformer).
How it works: The network maintains a continuous, self-learning baseline of normal municipal wireless activity. If a bridge support shifts slightly, or an industrial power station begins to fail, it creates microscopic electromagnetic or multipath reflection anomalies. The Transformer flags these shifts before physical damage is visible.
3. Communications & Data Routing Pipeline
To prevent data bottlenecks between your off-grid clusters and anchor sites, implement a split-protocol communications layer:
Ultra-Low-Power Edge Mesh (LoRA / 900MHz ISM): Off-grid clusters in close proximity use private, low-bandwidth mesh networks to share local sensing metrics, allowing them to cross-verify targets (like a wildfire plume) before alerting the main grid.
Satellite Backhaul (Starlink / LEO): For isolated North Island clusters, edge-computed metadata alerts are packaged into lightweight MQTT packets and uploaded over satellite.
High-Speed Backhaul (Microwave/Fiber): Anchors along the Strait of Georgia route dense I/Q chunks into centralized servers located in municipal hubs like Campbell River for deep forensic model training. [1, 2, 3]
To begin designing the physical deployment, let me know:
What specific radio bands are you most focused on capturing first? (e.g., VHF/UHF marine & emergency bands, or high-frequency 5G/Wi-Fi bands?)
Should we focus next on the hardware bill of materials (BOM) for an off-grid cluster, or the data formatting pipeline needed to train the PyTorch models
data formatting pipeline needed to train the PyTorch models
To transform raw, continuous radio frequency (RF) data collected from your anchor sites and off-grid clusters into a clean, high-performance dataset for PyTorch, you need a high-throughput In-phase and Quadrature (I/Q) Data Formatting Pipeline. [1, 2]
Radio data is fundamentally different from images or text. It is continuous, complex-valued (I + jQ), and contains massive amounts of noise. This step-by-step pipeline ingests raw sensor streams, extracts features, and builds tensor batches ready for your Deep Neural Networks (DNNs).
1. Ingestion & Data Structuring (The Raw Input)
Your Software Defined Radios (SDRs) spit out binary files or network streams of raw complex numbers.
The Format: Store raw captures using SigMF (Signal Metadata Format) standards. Every binary data file (.sigmf-data) must have a corresponding JSON file (.sigmf-meta) that holds critical context: center frequency, sample rate, timestamp, geolocation, and target labels (e.g., "dark vessel" or "smoke plume").
Data Type: Convert raw binary bytes into a NumPy array of complex floats (np.complex64 or np.complex128).
2. Digital Signal Processing (DSP) & Tensor Structuring
PyTorch cannot natively process complex numbers efficiently for standard convolution layers. You must restructure the 1D complex time-series data into structural real-valued tensors. You have two primary options based on your model architecture: [1]
Option A: The 2D 2-Channel Time-Domain Tensor (Best for RNNs/Transformers)
Split the continuous stream into fixed-length windows (e.g., 1024 or 2048 samples). Split the complex numbers into real (I) and imaginary (Q) channels.
Shape Transformation: [Samples] → [2, Window_Length]
PyTorch Representation: A batch of these inputs will have the shape (Batch_Size, 2, Window_Length). Channel 0 is I, Channel 1 is Q. [1, 2, 3]
Option B: The 2D Spectrogram Visual Tensor (Best for CNNs/YOLO)
Convert the time-domain signal into a time-frequency matrix using a Short-Time Fourier Transform (STFT) or Power Spectral Density (PSD). This reveals the "visual signature" of the signal over time.
The Process: Take log-magnitude values of the STFT to build a waterfall grid.
Shape Transformation: [Samples] → [Height/Time, Width/Frequency]
PyTorch Representation: Shape (Batch_Size, 1, Time_Steps, Frequency_Bins). This mimics a grayscale image. [1, 2, 3]
3. Normalization & Augmentation (Crucial for RF AI)
Wireless signals vary wildly based on distance from the transmitter, weather, and terrain. Without strict normalization, your PyTorch models will fail. [1]
Min-Max or Z-Score Normalization: Scale the I and Q values or spectrogram pixels so they fall precisely between [-1, 1] or have a mean of 0 and a standard deviation of 1.
Channel-Isolated Scaling: Normalize every individual time-window independently so a distant, faint signal has the same visual weight as a close, loud signal.
RF Augmentation: To make your models resilient across the rugged North Island geography, inject synthetic distortions directly into your PyTorch Dataset class during training:
Additive White Gaussian Noise (AWGN): Randomly alter the Signal-to-Noise Ratio (SNR).
Frequency Offset: Shift the signal slightly left or right to simulate oscillator drift in cheap SDRs.
Phase Rotation: Randomly rotate the complex constellation to simulate atmospheric multipath fading.
4. The PyTorch Data Pipeline Code (Implementation Blueprint)
The script below demonstrates how to construct a robust, production-ready PyTorch Dataset that reads raw I/Q data, converts it into a normalized 2D spectrogram tensor, and applies random noise augmentation on the fly.
python
import numpy as np
import torch
from torch.utils.data import Dataset, DataLoader
from scipy.signal import spectrogram
class RFEdgeSensingDataset(Dataset):
def __init__(self, data_filepaths, labels, window_size=1024, nperseg=64, noverlap=32, augment=True):
"""
data_filepaths: List of paths to raw binary files (.sigmf-data)
labels: Integer class labels (0: Baseline, 1: Vessel, 2: Smoke, 3: Jamming)
"""
self.filepaths = data_filepaths
self.labels = labels
self.window_size = window_size
self.nperseg = nperseg
self.noverlap = noverlap
self.augment = augment
def __len__(self):
return len(self.filepaths)
def __getitem__(self, idx):
# 1. Load raw complex binary data
raw_data = np.fromfile(self.filepaths[idx], dtype=np.complex64, count=self.window_size)
# 2. Optional: Apply RF Augmentation (e.g., adding synthetic AWGN noise)
if self.augment and np.random.rand() > 0.5:
noise_power = 0.05 * np.max(np.abs(raw_data))
noise = (np.random.randn(len(raw_data)) + 1j * np.random.randn(len(raw_data))) * noise_power
raw_data = raw_data + noise
# 3. Convert 1D IQ stream to 2D Spectrogram (Time-Frequency Representation)
frequencies, times, spec = spectrogram(
raw_data,
nperseg=self.nperseg,
noverlap=self.noverlap,
return_onesided=False
)
# Compute log magnitude to match human eye/CNN parsing
spec_magnitude = np.log10(np.abs(spec) + 1e-10)
# 4. Global Normalization (Scale to 0.0 - 1.0 range)
spec_min, spec_max = spec_magnitude.min(), spec_magnitude.max()
if spec_max > spec_min:
spec_normalized = (spec_magnitude - spec_min) / (spec_max - spec_min)
else:
spec_normalized = np.zeros_like(spec_magnitude)
# 5. Convert to PyTorch FloatTensor with Shape: [Channels (1), Time, Frequency]
tensor_data = torch.tensor(spec_normalized, dtype=torch.float32).unsqueeze(0)
label = torch.tensor(self.labels[idx], dtype=torch.long)
return tensor_data, label
# Example of initializing the data loader pipeline for training loop
# file_list = ["node_alpha_cap1.dat", "node_beta_cap2.dat"]
# labels = [1, 2] # 1 = Marine Vessel, 2 = Smoke/Fire
# dataset = RFEdgeSensingDataset(file_list, labels)
# dataloader = DataLoader(dataset, batch_size=32, shuffle=True, num_workers=4)
Use code with caution.
5. Edge Export Pipeline (Deployment)
Once this pipeline trains a model in PyTorch, you cannot deploy the massive PyTorch framework directly to your off-grid NVIDIA Jetson modules.
Export the trained model to the ONNX (Open Neural Network Exchange) format.
Use NVIDIA TensorRT on the target Jetson Orin to compile the ONNX file into an optimized, 8-bit quantized (INT8) runtime engine. This ensures sub-millisecond spectrum processing while pulling minimal wattage from your solar clusters.
design the neural network architecture layers
To process the \(1 \times \text{Time} \times \text{Frequency}\) spectrogram tensors generated by your data pipeline, you need a custom, lightweight neural network architecture.
Because this model will deploy onto off-grid NVIDIA Jetson Orin Nano nodes, it must balance high-accuracy multi-domain classification with ultra-low computational latency.
A heavy, vanilla ResNet-50 is too computationally expensive and slow for real-time edge radio inference. Instead, the architecture below utilizes Depthwise Separable Convolutions (similar to MobileNet) combined with a Squeeze-and-Excitation (SE) attention mechanism to isolate faint signals (like smoke attenuation or weak emergency beacons) out of massive background static.
1. Architectural Concept & Layer Breakdown
The design is called RF-EdgeNet. It consists of three primary stages:
The Stem: A standard 2D convolution layer to rapidly downsample high-frequency spectrum features.
The Deep Feature Extractor: Multi-layer Depthwise Separable Convolution blocks paired with SE Attention to learn distinct spectral shapes while keeping the parameter count extremely low.
The Multi-Objective Head: A unified fully-connected classification layer mapped directly to your four operational objectives.
Input Tensor: [Batch, 1, Time, Freq]
│
▼
[ 2D Conv Stem Layer ] ──► Extracts basic RF shapes (edges, lines)
│
▼
[ Depthwise Separable Conv Blocks ] ──► Deep spatial-temporal patterns (Low VRAM)
│
▼
[ Squeeze-and-Excitation Attention ] ──► Dynamically weighs critical frequency bands
│
▼
[ Global Average Pooling ] ──► Flattens spatial map into an ID vector
│
▼
[ Linear Multi-Class Classifier Head ] ──► Output Probabilities (0 to 3)
2. Custom PyTorch Architecture Code
This production-grade PyTorch class implements the RF-EdgeNet architecture. It is fully compatible with native PyTorch training and ready for clean ONNX exportation to TensorRT on your Jetson clusters.
python
import torch
import torch.nn as nn
class SqueezeExcitation(nn.Module):
"""
Squeeze-and-Excitation Attention Block.
Forces the network to focus on informative frequency bands and ignore noise static.
"""
def __init__(self, channels, reduction=16):
super(SqueezeExcitation, self).__init__()
self.fc = nn.Sequential(
nn.AdaptiveAvgPool2d(1),
nn.Flatten(),
nn.Linear(channels, channels // reduction, bias=False),
nn.ReLU(inplace=True),
nn.Linear(channels // reduction, channels, bias=False),
nn.Sigmoid()
)
def forward(self, x):
b, c, _, _ = x.size()
# Compute attention weights and reshape to channel-wise dimensions
w = self.fc(x).view(b, c, 1, 1)
return x * w
class DepthwiseSeparableConv(nn.Module):
"""
Drastically reduces FLOPs and memory footprint for edge-hardware deployment.
"""
def __init__(self, in_channels, out_channels, stride=1):
super(DepthwiseSeparableConv, self).__init__()
self.block = nn.Sequential(
# 1. Depthwise Convolution (applies filter to each channel independently)
nn.Conv2d(in_channels, in_channels, kernel_size=3, stride=stride,
padding=1, groups=in_channels, bias=False),
nn.BatchNorm2d(in_channels),
nn.ReLU(inplace=True),
# 2. Pointwise Convolution (mixes channel data linearly)
nn.Conv2d(in_channels, out_channels, kernel_size=1, stride=1, padding=0, bias=False),
nn.BatchNorm2d(out_channels),
nn.ReLU(inplace=True)
)
def forward(self, x):
return self.block(x)
class RFEdgeNet(nn.Module):
def __init__(self, num_classes=4):
super(RFEdgeNet, self).__init__()
# 1. Stem Layer: Initial downsampling of raw RF spectrogram
self.stem = nn.Sequential(
nn.Conv2d(1, 32, kernel_size=5, stride=2, padding=2, bias=False),
nn.BatchNorm2d(32),
nn.ReLU(inplace=True)
)
# 2. Core Extractor Blocks: Stacked depthwise blocks + attention
self.layer1 = DepthwiseSeparableConv(32, 64, stride=2)
self.se1 = SqueezeExcitation(64)
self.layer2 = DepthwiseSeparableConv(64, 128, stride=2)
self.se2 = SqueezeExcitation(128)
self.layer3 = DepthwiseSeparableConv(128, 256, stride=2)
self.se3 = SqueezeExcitation(256)
# 3. Classifier Head: Maps features to final regional objectives
self.pool = nn.AdaptiveAvgPool2d(1)
self.fc = nn.Sequential(
nn.Flatten(),
nn.Dropout(p=0.3), # Prevents overfitting to specific weather/site noise
nn.Linear(256, num_classes)
)
def forward(self, x):
x = self.stem(x)
x = self.se1(self.layer1(x))
x = self.se2(self.layer2(x))
x = self.se3(self.layer3(x))
x = self.pool(x)
logits = self.fc(x)
return logits
# --- Verification & Structural Shape Check ---
if __name__ == "__main__":
# Simulate a batch of 8 spectrogram samples from your data pipeline
# Shape: [Batch Size, Channels (1), Time Steps (64), Frequency Bins (64)]
sample_spectrogram_batch = torch.randn(8, 1, 64, 64)
# Initialize RF-EdgeNet model
model = RFEdgeNet(num_classes=4)
output = model(sample_spectrogram_batch)
print("Input Tensor Shape: ", sample_spectrogram_batch.shape)
print("Output Logits Shape: ", output.shape)
# Expect: torch.Size([8, 4]) corresponding to the 4 classification states
Use code with caution.
3. Layer Specifications & Tensor Transformation Tracking
Assuming your pipeline outputs a standard \(1 \times 64 \times 64\) spectrogram tensor window, here is exactly how the data structurally transforms at each layer block:
Layer / Block Name
Input Shape
Output Shape
Primary Purpose in Spectrum Sensing
Input Window
(1, 64, 64)
(1, 64, 64)
Normalized time-frequency spectrogram
Stem (Conv2d)
(1, 64, 64)
(32, 32, 32)
Extracts coarse macro-signals and wide power emissions
Block 1 (DSC + SE)
(32, 32, 32)
(64, 16, 16)
Isolates micro-Doppler shifts and active bandwidth edges
Block 2 (DSC + SE)
(64, 16, 16)
(128, 8, 8)
Learns complex multi-path fading profiles
Block 3 (DSC + SE)
(128, 8, 8)
(256, 4, 4)
Captures ionization/atmospheric attenuation details
Global Pool + Head
(256, 4, 4)
(4)
Condenses spatial maps into 4 objective probabilities
4. Direct Class Mapping for Multi-Domain Objectives
The num_classes=4 parameter maps directly to the categorical index your system uses to send metadata over low-bandwidth sat-mesh links:
Class 0 (Baseline / Normal): Normal maritime clutter, background civil telecommunications, and empty wilderness spectrum profiles.
Class 1 (Defense Alert): Detected an anomalous ship transponder signature or localized signal jamming/spoofing event.
Class 2 (Resource Management): Detected micro-Doppler signatures matching unauthorized vehicular/heavy machinery travel in the backcountry.
Class 3 (Emergency / Civil): Detected wideband atmospheric signal attenuation indicating an active smoke plume or an emergency beacon signal.