PODCAST: Ensemble ML Classifier designed for radio frequency (RF) signal classification. It leverages multiple machine learning models, including deep learning architectures like CNNs, LSTMs, and Transformers, alongside traditional ML algorithms such as Random Forest and SVM. The classifier aims to achieve higher accuracy by combining predictions through weighted or majority voting schemes, and it can incorporate feature fusion for enhanced performance. It dynamically loads pre-trained models and extracts time and frequency domain features from IQ data to make robust signal classifications.

Ensemble methods enhance RF signal classification accuracy compared to single models primarily by combining multiple models and voting schemes. This approach is designed to achieve higher accuracy than single models.
The EnsembleMLClassifier
achieves this enhanced accuracy through several key incorporations:
- Multiple Architectures: It utilizes various machine learning architectures, including deep learning models like Convolutional Neural Networks (CNN), Long Short-Term Memory (LSTM), and traditional machine learning models. This diversity means that different models might excel at recognizing different patterns or signal types, and combining their strengths can lead to a more robust overall classification.
- Weighted Voting Based on Model Confidence: The classifier uses voting schemes, such as “majority” or “weighted” voting, to aggregate predictions from individual models. In weighted voting, models with higher confidence in their predictions contribute more to the final classification, which can improve the reliability of the ensemble’s decision.
- Specialized Models for Specific Signal Types: The ensemble can incorporate models that might be particularly effective for certain types of signals, contributing to a more accurate overall system.
- Optional Feature Fusion: The system also includes an option for feature fusion, which can further improve accuracy by combining different types of extracted features (e.g., time-domain and frequency-domain features) before classification. For instance, features are extracted for traditional ML models, including statistical features from both amplitude and phase, as well as spectral and modulation features. Deep learning models also process different input types, such as spectral input for CNNs and temporal input for LSTMs. For transformer models, spectral and temporal features can even be combined.
The EnsembleMLClassifier
integrates several deep learning models to enhance RF signal classification accuracy. These models are part of the “multiple architectures” incorporated by the ensemble.
The specific deep learning models used, which are loaded as ensemble models, include:
- SpectralCNN: This model likely processes spectral input, as indicated by its name and its usage with
_create_spectral_input
. - SignalLSTM: This is a type of Long Short-Term Memory network, typically used for processing temporal (time-domain) data.
- TemporalCNN: Another Convolutional Neural Network variant, designed for temporal input.
- ResNetRF: A Residual Network adapted for RF signals, also utilizing spectral input.
- SignalTransformer: A Transformer model, which can process combined spectral and temporal features.
These models are loaded from specific files (e.g., spectral_cnn.pt
) within the configured ensemble_models_path
. The system also has the capability to incorporate traditional machine learning models if scikit-learn is available. For deep learning models, inputs are prepared specifically for their architecture, such as spectral input for CNNs and temporal input for LSTMs, with transformer models being able to handle combined spectral and temporal features.
Temporal inputs are created by the _create_temporal_input
method within the EnsembleMLClassifier
. This method is specifically designed to prepare IQ data for deep learning models that process temporal sequences, such as LSTM (Long Short-Term Memory) and RNN (Recurrent Neural Network) models.
Here’s a detailed breakdown of how temporal inputs are created:
- Define Target Sequence Length: The process begins by defining a
target_seq_len
, which is set to128
. This ensures a consistent input size for the models. - Separate IQ Data Components: The complex IQ (In-phase and Quadrature) data is converted into its real and imaginary components (
iq_real
andiq_imag
respectively). - Handle NaN Values: The method includes error handling for
NaN
(Not a Number) values that might be present in the IQ data. IfNaN
values are detected, they are replaced with zeros to ensure data integrity for model processing. - Combine Components: The
iq_real
andiq_imag
components are then combined into a single array along a channel dimension, formingiq_combined
. This results in data where each time step has two features (real and imaginary parts). - Resize to Target Length: The
iq_combined
data is resized to match thetarget_seq_len
(128):- If the original sequence length is longer than the target, it is downsampled by taking evenly spaced samples.
- If the original sequence length is shorter, it is padded with zeros at the end to reach the target length.
- Convert to PyTorch Tensor: Finally, the processed
iq_combined
data is converted into a PyTorchFloatTensor
. It is then reshaped to the expected input format for models like LSTMs:[batch_size, seq_len, features]
, specifically “ for a single sample. - Error Handling: The method also incorporates error handling, logging any issues encountered during the input creation process and returning a default zero tensor of the correct shape in case of an error.
Spectral inputs for deep learning models, such as SpectralCNN
and ResNetRF
, are generated by the _create_spectral_input
method within the EnsembleMLClassifier
. This process transforms complex IQ data into a frequency-domain representation suitable for these models.
Here’s how temporal inputs are created:
- Calculate Spectrum: The first step involves calculating the absolute magnitude of the Fast Fourier Transform (FFT) of the complex IQ samples. The
np.fft.fftshift
function is used to shift the zero-frequency component to the center of the spectrum. - Define Target Size: A
target_size
of 256 is defined as the standard size for the spectral input. This ensures consistency for the deep learning models. - Resize Spectrum: The calculated spectrum is then resized to this
target_size
(256) if its original length differs:- If the original spectrum length is larger than 256, it is downsampled by taking evenly spaced samples.
- If the original spectrum length is smaller than 256, it is interpolated to reach the target size.
- Normalize Spectrum: After resizing, the spectrum is normalized by dividing all values by its maximum value. This scales the spectrum to a range between 0 and 1, assuming the maximum value is greater than zero.
- Convert to PyTorch Tensor: Finally, the processed spectral data is converted into a PyTorch
FloatTensor
. It is then reshaped to the expected input format for CNNs:[batch_size, channels, sequence_length]
, specifically “ for a single sample. - Error Handling: The method includes error handling for any issues encountered during the input creation process. In case of an error, a default zero tensor of the correct shape “ is returned.
The EnsembleMLClassifier
enhances RF signal classification accuracy by incorporating multiple architectures, which include both deep learning models and traditional machine learning models.
Here are the various types of models used for signal classification:
Deep Learning Models
The EnsembleMLClassifier
integrates several deep learning models that are loaded from specific files within the configured ensemble_models_path
. These models are specifically chosen to process different aspects of the RF signal data:
- SpectralCNN: This is a Convolutional Neural Network designed to process spectral input (frequency-domain data). It takes the absolute magnitude of the Fast Fourier Transform (FFT) of the IQ data as its input.
- SignalLSTM: This is a Long Short-Term Memory network, which is a type of recurrent neural network. It is typically used for processing temporal input (time-domain data).
- TemporalCNN: Another Convolutional Neural Network variant, this model is also designed to process temporal input.
- ResNetRF: This is a Residual Network adapted for RF signals, and it utilizes spectral input.
- SignalTransformer: This model is a Transformer architecture, capable of processing combined spectral and temporal features.
For deep learning models, inputs are prepared specifically for their architecture: spectral input for CNNs, temporal input for LSTMs, and combined spectral and temporal features for transformer models.
Traditional Machine Learning Models
The EnsembleMLClassifier
also has the capability to incorporate traditional machine learning models, provided that scikit-learn is available in the environment. These models are loaded from pickle files.
The specific traditional ML model types mentioned are:
- RandomForestClassifier
- GradientBoostingClassifier (referred to as “gbm”)
- SVC (Support Vector Classifier, referred to as “svm”)
- KNeighborsClassifier (referred to as “knn”)
For these traditional ML models, features are extracted from the IQ data, including statistical features from both amplitude and phase (time domain), spectral features from the frequency domain, and modulation features like AM modulation index and FM deviation. These extracted features are then used as input for classification by the traditional ML models. A StandardScaler
can also be used to normalize these features.
An RFSignal
is an object within the system that encapsulates radio frequency (RF) signal data. It is the primary input type for the EnsembleMLClassifier
‘s classification processes.
Key characteristics and components of an RFSignal
object include:
- Signal Data: An
RFSignal
object containsiq_data
, which represents the complex IQ (In-phase and Quadrature) samples of the RF signal. - Classification Target: The overall purpose of the
EnsembleMLClassifier
module is the machine learning classification of RF signals. Theclassify_signal
method within theEnsembleMLClassifier
takes anRFSignal
object as its main argument for classification. - Metadata:
RFSignal
objects can also storemetadata
, which includes information like ensemble predictions and confidences for debugging purposes after classification.
In summary, an RFSignal
is the fundamental data structure used to represent an RF signal within this classification system, holding its raw complex IQ data for analysis and classification by various machine learning models.
This module’s purpose is to implement ensemble methods for machine learning classification of RF signals.
Its core aim is to achieve higher accuracy than single models by combining multiple models and voting schemes. Specifically, the EnsembleMLClassifier
within this module enhances classification accuracy through several key incorporations:
- Multiple architectures: It utilizes various machine learning architectures, including deep learning models like Convolutional Neural Networks (CNN), Long Short-Term Memory (LSTM), and traditional machine learning (ML) models.
- Weighted voting based on model confidence: It aggregates predictions from individual models using voting schemes, such as “majority” or “weighted” voting. Weighted voting allows models with higher confidence in their predictions to contribute more to the final classification.
- Specialized models for specific signal types: The ensemble can incorporate models that are particularly effective for certain types of signals.
- Optional feature fusion: It offers an option for feature fusion to further improve accuracy. This involves combining different types of extracted features, such as statistical features from amplitude and phase, spectral features, and modulation features for traditional ML models, or spectral and temporal inputs for deep learning models.
Three deep learning models used in this module are:
- SpectralCNN
- SignalLSTM
- TemporalCNN