Frequency spectrum intelligent sensing system based on auto-encoder and software radio platform
By combining autoencoders and random forest classifiers, the robustness and accuracy issues of spectrum sensing methods in complex environments are solved, achieving high-precision channel state detection and adapting to changes in the electromagnetic environment.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-23
- Publication Date
- 2026-03-13
AI Technical Summary
Existing spectrum sensing methods are not robust in complex electromagnetic environments, rely on fixed thresholds and require a large amount of labeled data, making it difficult to achieve high-precision channel state detection.
A spectrum intelligent sensing system based on an autoencoder and software radio platform is adopted. Channel state detection is performed by combining unsupervised feature learning and dynamic decision threshold with a random forest classifier, which adapts to noise fluctuations and channel changes.
It achieves high-precision and robust spectrum sensing in complex electromagnetic environments, with an accuracy rate of 94.5%, reducing data annotation costs and the probability of false alarms.
Smart Images

Figure CN121664208A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of wireless communication technology, and in particular to a spectrum intelligent sensing system based on an autoencoder and a software radio platform. Background Technology
[0002] With the large-scale commercialization of 5G mobile communication technology and the continuous deepening of research on 6G mobile communication technology, emerging businesses such as the Internet of Things and the Industrial Internet are experiencing explosive growth, leading to a surge in the number of wireless devices and an increasingly urgent demand for spectrum resources. The traditional fixed spectrum allocation model exclusively licenses specific frequency bands to specific services or operators. In today's dynamic spectrum demand environment, this static allocation method has resulted in a severe imbalance in the utilization of spectrum resources in terms of time, frequency, and space. A large number of licensed frequency bands are idle during off-peak hours, forming "spectrum holes," while other unlicensed frequency bands may be congested, resulting in low overall spectrum utilization.
[0003] To address this challenge, cognitive radio technology emerged. Its core idea is to enable unlicensed users to intelligently sense and utilize licensed but temporarily idle spectrum resources through dynamic spectrum access technology, thereby significantly improving overall spectrum utilization without interfering with licensed users. Spectrum sensing, as a prerequisite and foundational step in cognitive radio, aims to accurately and quickly detect the presence or absence of licensed user signals within a target frequency band, essentially performing a binary hypothesis test: channel idle or channel occupied. Traditional spectrum sensing algorithms, such as energy detection, matched filtering, and cyclostationary feature detection, are effective in ideal or simple channel environments. However, in complex electromagnetic environments, signal propagation faces numerous challenges, including multipath fading, shadowing effects, co-channel interference, and noise power uncertainty. For example, while energy detection is simple to implement and requires no prior signal information, its detection performance heavily relies on a fixed decision threshold. In low signal-to-noise ratio or noise fluctuation environments, the probability of false alarms and missed detections increases sharply. Matched filtering requires precise knowledge of the licensed user's signal characteristics, which is often difficult to obtain in practice, resulting in insufficient generalization ability. The existing technologies mainly have the following problems: First, they are highly dependent on channel conditions or prior knowledge and have poor robustness; second, they rely on fixed thresholds and cannot adapt to dynamically changing electromagnetic environments; third, most advanced methods based on supervised learning require a large amount of labeled training data, while the labeling of spectrum data is costly and error-prone, making it difficult to meet the needs of practical applications.
[0004] Therefore, how to design an intelligent spectrum sensing method and system that can adaptively learn signal features and achieve high precision and high robustness in real-world scenarios where there is a lack of large amounts of labeled data and the environment is complex and ever-changing has become a key technical problem that urgently needs to be solved in this field. Summary of the Invention
[0005] The purpose of this invention is to provide a spectrum intelligent sensing system based on an autoencoder and a software radio platform to solve the problems existing in the prior art.
[0006] To achieve the above objectives, the present invention provides the following solution: This invention provides a spectrum intelligent sensing system based on an autoencoder and a software radio platform, comprising: Software radio platform for acquiring raw I / Q baseband signals in the target frequency band; The preprocessing module is used to perform format cleaning, normalization and standardization on the original I / Q baseband signal to obtain standardized signal data; An autoencoder is used to perform unsupervised feature learning and reconstruction on the standardized signal data, output the reconstructed signal and calculate the reconstruction error; The dynamic decision module is used to set a dynamic decision threshold based on the reconstruction error statistical distribution calculated by the autoencoder during the training phase, and to compare the reconstruction error of the real-time signal with the dynamic decision threshold to make a preliminary judgment on the channel state. A random forest classifier is used to fuse the latent spatial features extracted by the autoencoder with the reconstruction error, perform supervised classification optimization on the preliminary judgment results of the dynamic decision module, and output the final channel occupancy status judgment result.
[0007] Preferably, the software radio platform is a scalable software radio platform, which is connected to the host computer via a dual IP configuration for stable data transmission and control.
[0008] Preferably, the autoencoder includes an encoder and a decoder, wherein the encoder compresses the input signal into a low-dimensional latent space, and the decoder reconstructs the features of the latent space into an output signal; the training of the autoencoder aims to minimize the reconstruction error.
[0009] Preferably, the decision tree in the random forest classifier uses the Gini coefficient as the node splitting criterion and integrates the final classification results through a majority voting mechanism.
[0010] This invention also provides a spectrum intelligent sensing method based on an autoencoder and a software radio platform, comprising the following steps: S1. Signal acquisition: Acquire the raw I / Q baseband signal of the target frequency band through a software radio platform; S2. Preprocessing: The original I / Q baseband signal is cleaned, normalized, and standardized to obtain standardized signal data; S3. Autoencoder feature learning: Input the standardized signal data into the autoencoder for unsupervised feature learning and reconstruction; S4. Dynamic decision threshold setting: Based on the reconstruction error statistical distribution calculated by the autoencoder during the training phase, a dynamic decision threshold is set, using the following formula: ; In the formula, The mean MSE of all samples in the training set; MSE is the standard deviation of the training set; S is the total number of samples in the training set. This is the threshold coefficient; For the final dynamic decision threshold S5. Preliminary judgment: The real-time acquired and preprocessed signal is input into the trained autoencoder, its reconstruction error is calculated, and compared with the dynamic judgment threshold to obtain a preliminary judgment of the channel state. S6. Classification optimization: Construct and train a random forest classifier. The random forest classifier uses the latent spatial features extracted by the autoencoder and the reconstruction error as input, and adopts the Gini coefficient as the node splitting criterion. The formula for calculating the Gini coefficient is as follows: ; In the formula, The sample set of the current decision tree node. For the number of categories, For set The Middle Proportion of class samples The preliminary judgment results are subjected to supervised classification and optimization, and the final channel occupancy status is output.
[0011] Preferably, in step S2, the normalization calculation formula is: ; In the formula, The original data, , These are the extreme values of the data; The formula for standardization is: ; In the formula, The original data, The mean, The standard deviation is denoted as .
[0012] Preferably, in step S3, the autoencoder includes an encoder and a decoder, wherein the encoding process is represented as follows: ; In the formula, It is a 2D original I / Q signal; This is the encoder weight matrix; This is the encoder bias vector; 8 represents the potential spatial dimension; The ReLU activation function is expressed as follows: The compressed low-dimensional latent feature vector The decoding process is represented as follows: ; In the formula, This is the decoder weight matrix; This is the decoder bias vector; Reconstructed I / Q signal samples from the decoder output The reconstruction error is calculated using the mean squared error as the loss function, and the formula is as follows: ; In the formula, This is the i-th original I / Q signal sample; B represents the i-th reconstructed I / Q signal sample; B is the number of training samples in a single batch. It is a 2-norm used to calculate the cumulative error at the vector level. Preferably, during the training process of the autoencoder, Dropout regularization is applied to the hidden layer, and its operation is represented as follows: ; In the formula, This is the original output vector of the hidden layer; Let be the Bernoulli distribution mask vector, satisfying , This represents the probability of neuron inactivation. Element-wise product; This is the output of the hidden layer after Dropout processing.
[0013] Preferably, in step S6, the random forest classifier generates a training subset of multiple decision trees through Bootstrap sampling, and integrates the final results through a majority voting mechanism. Its final output is represented as follows: ; In the formula, For the number of decision trees, This is the predicted output of the i-th decision tree, with a multi-dimensional feature vector as input. , This is an indicator function that takes the value 1 if the condition is met, and 0 otherwise. This indicates that the channel is idle. Represents "channel occupancy" Preferably, the spectrum sensing problem is based on a binary hypothesis testing model, which is expressed as: ; In the formula, The time-domain continuous signal received by the SU; The signal is a continuous-time signal emitted by the PU and satisfies the power constraint condition. , The average power of the PU signal; The channel fading coefficient follows a Rayleigh distribution. , The variance of the fading coefficient; It is additive white Gaussian noise.
[0014] The present invention achieves the following beneficial technical effects compared to the prior art: This invention provides a spectrum intelligent sensing system based on an autoencoder and a software-defined radio platform. It creatively employs an unsupervised learning autoencoder as the core feature extractor, enabling it to automatically learn the essential features and reconstruction patterns directly from raw I / Q signals without relying on large amounts of difficult-to-obtain labeled data, effectively solving the problem of high data labeling costs in traditional supervised learning methods. By introducing a dynamic decision threshold mechanism based on the statistical characteristics of reconstruction errors, replacing the fixed threshold in traditional energy detection, the system can adapt to noise fluctuations and channel changes, significantly improving detection robustness and accuracy in complex electromagnetic environments. Combined with a random forest classifier for supervised optimization of the deep features extracted by the autoencoder, the accuracy of the final state judgment is further corrected and improved. Experiments show that the system's recognition accuracy can reach 94.5%, outperforming traditional energy detection methods. The entire system is built on a hardware-software co-developed XSRP platform, achieving end-to-end closed-loop verification from signal acquisition, preprocessing, feature learning to intelligent decision-making. It provides a directly deployable complete technical solution for dynamic spectrum access and has significant practical value. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0016] Figure 1 A spectrum intelligent sensing system architecture diagram based on an autoencoder and software radio platform provided for this invention; Figure 2 This is a block diagram of the internal structure of the Software-Defined Radio Platform (XSRP) in this invention; Figure 3 This is a graph showing the training and validation loss of the autoencoder model of this invention. Figure 4 This is a performance comparison chart showing the impact of the dynamic threshold coefficient k of the present invention on the detection accuracy (a) and false detection rate (b) under different signal-to-noise ratios; Figure 5 This is a comparison chart of confusion matrices under different dynamic threshold coefficients k (1.0, 1.5, 2.0, 2.5, 3.0) according to the present invention; Figure 6 This is a global view and a detailed view of the anomaly detection results when the optimal threshold coefficient k=1.0 according to the present invention; Figure 7 This is a performance comparison chart of the proposed method (AE+RF) with pure autoencoder (AE), pure random forest (RF) and traditional energy detection (ED) methods in terms of detection accuracy (a) and false alarm rate (b). Figure 8 A comparison chart of the system's overall score corresponding to different dynamic threshold coefficient k values. Detailed Implementation
[0017] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0018] The purpose of this invention is to provide a spectrum intelligent sensing system based on an autoencoder and software radio platform, which aims to solve the problems of poor robustness of traditional spectrum sensing methods in complex electromagnetic environments, reliance on fixed thresholds, and the need for a large amount of labeled data. This system automatically extracts the essential features of the signal through unsupervised learning and combines adaptive decision and supervised optimization to achieve high-precision and highly robust channel state detection.
[0019] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0020] Example 1: like Figure 1As shown, the system of this invention adopts a hybrid model architecture of "unsupervised feature extraction and initial screening + supervised feature fusion and fine classification". Its workflow is as follows: First, the XSRP platform acquires the raw I / Q baseband signal of the target frequency band. Next, the preprocessing module cleans, normalizes, and standardizes the signal. The processed data is fed into a pre-trained autoencoder. This autoencoder compresses the signal into an 8-dimensional latent space, extracting deep abstract features (denoted as the latent feature vector z). Simultaneously, it reconstructs the signal through a decoder and calculates the mean square error (MSE) between the reconstructed signal and the original signal. The dynamic decision module calculates a dynamic decision threshold τ based on the MSE distribution obtained during the training phase and compares it with the real-time signal's MSE to preliminarily determine the channel state (if MSE > τ, it is initially judged as "channel occupancy"). Finally, the random forest classifier receives the 8-dimensional latent feature z and the 1-dimensional MSE error output by the autoencoder, fuses them into a 9-dimensional feature vector for fine classification, outputs the final channel occupancy status decision result, and corrects and optimizes the autoencoder's preliminary judgment.
[0021] This invention employs the XSRP software radio platform as its hardware core. For example... Figure 2 As shown, the XSRP integrates a wideband radio frequency unit (supporting the 70MHz-6GHz frequency band) and a digital baseband unit with "ARM+DSP+FPGA" as its core, possessing high reconfigurability and real-time processing capabilities.
[0022] To ensure stable communication between the host computer and the XSRP device, a dual IP configuration is required. Specifically, the PC's IP address should be 192.168.1.181, and the XSRP device's IP address should be 192.168.1.167.
[0023] Data sources include measured data and publicly available datasets to ensure diversity: Measured data was generated collaboratively using MATLAB and the XSRP software radio platform. The experimental environment was selected in the electromagnetic compatibility (EMC) experimental area of the laboratory. This area is far from high-power RF equipment, free from strong electromagnetic interference sources, with the ambient temperature controlled at 25±2℃ and relative humidity at 45%-60%. It is an open indoor area without metal shielding. The distance between the XSRP transmitter and receiver is ≥1.5m, and both antennas are 1.2m high with vertical polarization to reduce multipath reflections and signal attenuation interference. In this environment, a dual-IP configuration (PC IP: 192.168.1.181, XSRP IP: 192.168.1.167) was used to avoid communication conflicts, controlling the XSRP to acquire I / Q baseband signals (frequency F=6kHz, amplitude A=80, meeting the requirements) in the 70MHz~6GHz frequency band. , Orthogonal relationship), generating 30,720 sample points in a single batch, and adding Gaussian white noise that matches the environmental background ( The interference generated by conventional electronic equipment in the simulation laboratory (interference intensity ≤ -80dBm) was converted from the original data in .m format to .p format. At the same time, it was adapted to the RML2016.10a public dataset with 300,000+ samples. This dataset contains 10 modulation methods and the signal-to-noise ratio covers -10dB to 20dB. It was converted into a .dat file by PyCharm and the I / Q signals were extracted and arranged into a 2D structure to match the XSRP measured data format, ensuring the consistency and compatibility of the two types of data.
[0024] Raw data often suffers from inconsistencies in units and outliers, which can negatively impact model performance and stability if used directly for training. Therefore, this invention employs a systematic preprocessing procedure for these two types of data, with the specific steps as follows: Format cleaning: First, remove constant columns (i.e., columns with all the same value) from the data, then apply 3... Outliers are removed as a rule. For the sample If it satisfies (in The characteristic mean, If the value is less than or equal to the standard deviation, it is considered an outlier and is deleted.
[0025] Normalization: To eliminate dimensional differences between features, the data is mapped to the interval [0, 1]. The Min-Max normalization method is used, and its calculation formula is as follows: ; In the formula, The original data, , These are the minimum and maximum values of the corresponding features in the dataset, respectively.
[0026] Standardization: To ensure the data conforms to a standard normal distribution and accelerate model convergence, Z-score standardization is performed. The calculation formula is as follows: ; In the formula, The original data, The mean, The standard deviation is 1; after this step, the mean of the data is 0 and the standard deviation is 1.
[0027] Numerical range compression: For data with large energy differences, additional compression is performed... That is, the np.log1p() function compresses the numerical range, eliminates the interference of amplitude and distribution differences on the model, and further stabilizes the training process.
[0028] The core of this invention lies in constructing a hybrid machine learning model that combines unsupervised feature extraction with supervised classification optimization. This model first learns the unlabeled features of the signal through an autoencoder, and then utilizes random forests to improve classification accuracy.
[0029] An autoencoder is an unsupervised neural network whose goal is to learn an efficient encoding (compressed representation) of input data and reconstruct the original input from this encoding. The autoencoder designed in this invention is specifically adapted to two-dimensional I / Q signals.
[0030] Model structure: The autoencoder adopts a symmetrical encoder-decoder structure.
[0031] The encoder is responsible for compressing the 2D I / Q input signal q into an 8D latent space. Its network path is: 2 → 32 → 16 → 8. The encoding process can be represented as: ; In the formula, It is a 2D original I / Q signal (containing in-phase and quadrature components, in vector form); This is the encoder weight matrix; This is the encoder bias vector; 8 represents the potential spatial dimension; The ReLU activation function is expressed as follows: This represents the compressed low-dimensional latent feature vector. The decoder is responsible for reverse mapping the latent features to reconstruct the original signal dimension for restoration. Its mathematical expression is: ; In the formula, This is the decoder weight matrix; This is the decoder bias vector; The output of the decoder contains reconstructed I / Q signal samples (in vector form). To ensure accurate reconstruction of continuous-value signals, no additional activation function is applied to the decoder output layer. The autoencoder output contains 8-dimensional latent features. Corresponding to the core physical characteristics of spectral signals, here This corresponds to the statistical stability of the I / Q signal amplitude, specifically the peak-to-peak ratio. This characteristic is a key indicator for distinguishing between "noise-dominated" and "signal-dominated" signals, and it has the highest criticality. This reflects the phase difference stability of the I / Q quadrature components. This feature can effectively suppress the phase disturbance caused by multipath fading and improve the decision robustness under complex channels. This corresponds to the uniformity of the signal spectrum distribution. The variance normalization value of the spectrum is calculated by using the short-time Fourier transform. This feature can effectively distinguish between broadband noise and narrowband signals, and prevent strong noise from being mistakenly identified as a signal. It reflects the degree of separation between signal and noise, which is obtained by calculating the improvement in signal-to-noise ratio between the reconstructed signal and the original signal. This feature reflects the model's ability to extract useful signals and can also reduce the probability of misjudgment in low signal-to-noise ratio scenarios. This corresponds to the stationarity of the signal in the time domain. It is used to quantify the rate of change of the amplitude variance of the signal within the sliding window, which can effectively capture the transient characteristics of burst signals and adapt to the detection requirements of pulse-type PU signals. It represents the concentration of spectral peaks, which can be used to distinguish single-frequency signals, multi-frequency signals, and broadband noise, thereby improving the recognition accuracy of complex modulated signals; It reflects the smoothness of the phase spectrum, which can suppress the phase distortion caused by Doppler frequency shift, thus adapting to high-speed moving scenes; This corresponds to the signal's energy attenuation rate. By using the attenuation coefficient of the fitted signal envelope, continuous signals and transient interference can be distinguished, reducing misjudgments of unauthorized burst interference. The 8-dimensional latent features achieve synergy through a "primary-secondary combination": As the primary feature, it directly distinguishes the core difference between signal and noise. As a secondary feature, it corrects the decision bias of the primary feature in complex environments.
[0032] Autoencoders are trained without labeled data, relying solely on the raw I / Q signals. The model learns the reconstruction patterns of normal channel signals, distinguishing channel states by the "error difference between the original and reconstructed signals." This reconstruction error is quantified using the mean square error (MSE) loss function, with the following formula: ; In the formula, This is the i-th original I / Q signal sample; B represents the i-th reconstructed I / Q signal sample; B is the number of training samples in a single batch. The 2-norm is used to calculate the cumulative error at the vector level. The training parameter configuration is shown in Table 1. Table 1 Autoencoder training parameters Parameter name Value Function Description Input Dimensions 2 Adapt to the original signal dimension Encoder path 2→32→16→8 Compress the signal into a 4-dimensional potential space decoder path 8→16→32→2 Reconstructing the original signal from the potential space loss function MSE Measuring the difference between the original and reconstructed signals Optimizer Adam Adaptive learning rate adjustment Learning rate 1e-3 Balancing training speed and stability Batch size 256 Improve training efficiency Training rounds 100 Avoid overfitting The hidden layer dimension and latent dimension of an autoencoder are core design considerations that balance the complexity of signal features, model performance requirements, and computational efficiency. Although I / Q signals are only 2-dimensional inputs, they contain multiple physical characteristics such as amplitude stability, phase consistency, frequency distribution characteristics, and signal-noise separation. Furthermore, signal features in complex electromagnetic environments exhibit nonlinear correlations, requiring gradual extraction and abstraction through layered hidden layers while avoiding redundant computations and overfitting risks.
[0033] Based on practical experience in the field of spectrum sensing, for autoencoders of low-dimensional I / Q signals, the dimensionality of the intermediate hidden layer typically needs to be 8 to 16 times the input dimension to ensure sufficient space for feature mapping; while the latent dimension needs to be controlled at 4 to 8 times the input dimension to achieve a compact representation of core information. Therefore, this design adopts a stepwise dimensionality reduction hidden layer structure: the first hidden layer is set to 32 dimensions to initially capture the shallow, intuitive features of the signal; the second hidden layer is set to 16 dimensions to further refine deep, abstract features; finally, the latent dimension is set to 8 dimensions, which both preserves the core identifiable information of the signal and achieves efficient feature compression.
[0034] This hierarchical dimensionality reduction hidden layer design not only fully covers the complex physical characteristics of I / Q signals through the 32-dimensional and 16-dimensional intermediate layers, but also avoids feature redundancy and sudden increases in computational overhead through the 8-dimensional latent space. At the same time, it conforms to the design conventions of autoencoders for low-dimensional input signals, ensuring that the model achieves an optimal balance between capturing effective features and lightweight deployment.
[0035] To enhance the model's robustness to noise in complex environments, a Dropout regularization mechanism is introduced during training, adding a random deactivation operation to the hidden layers of the encoder and decoder. The mathematical expression is as follows: ; In the formula, This is the original output vector of the hidden layer; Let be the Bernoulli distribution mask vector, satisfying ( (Probability of neuron inactivation). Element-wise product; This is the output of the hidden layer after Dropout processing. By randomly dropping some neurons, the model can avoid over-reliance on specific signal features, effectively improving generalization ability.
[0036] Dynamic decision threshold setting: This invention abandons fixed thresholds and adopts dynamic thresholds based on the statistical characteristics of the training set MSE. ; In the formula, The mean MSE of all samples in the training set; S is the standard deviation of the MSE of the training set; S is the total number of samples in the training set. This is the threshold coefficient; This is the final dynamic decision threshold. A dynamic threshold means that when the channel is idle, the signal characteristic distribution is stable, and the reconstruction error is extremely small (MSE < 0.05). When the channel is occupied, the intervention of the PU signal causes the original signal to deviate from its normal distribution, significantly increasing the reconstruction error (MSE>). This "label-free adaptability" perfectly solves the pain points of high difficulty and cost in labeling spectrum data, greatly reducing the workload of data acquisition and preprocessing. Traditional fixed thresholds face obstacles in dealing with noise fluctuations in different environments, while the threshold coefficient k, by combining with the statistical characteristics of the data, allows the threshold to be adjusted. The dynamic threshold is adjusted based on the data distribution. As k increases, the dynamic threshold... The threshold value will increase, and the detection sensitivity will decrease. In this case, it becomes more difficult for the system to determine a sample as "channel occupied," and the false alarm phenomenon of "misjudging an idle channel as occupied" will decrease. However, the false alarm rate of "misjudging an occupied channel as idle" may increase. When k decreases, the dynamic threshold value will also decrease. Lowering the threshold increases detection sensitivity. The system can more easily identify "channel occupancy" states, reducing the false alarm rate. However, it may misjudge more noise as a signal, leading to an increase in the false alarm rate. The value of k directly determines the definition of the "normal sample distribution range." It ensures that the dynamic threshold does not deviate from the actual distribution of the data and can effectively distinguish between normal and abnormal states, which is the key to overcoming the limitations of traditional fixed thresholds.
[0037] To improve the accuracy of the final decision, a random forest classifier is introduced to perform supervised optimization of the autoencoder output.
[0038] Feature input: The 8-dimensional latent feature vector z extracted by the autoencoder is concatenated with the 1-dimensional reconstruction error MSE to form a 9-dimensional feature vector f, which is used as the input of the random forest.
[0039] Model Training: Random Forest is an ensemble learning algorithm that classifies data by constructing multiple decision trees and combining their predictions. Specific parameter configurations are shown in Table 2. Table 2 Random Forest Training Parameters Parameter Name, Values, and Functions Number of decision trees: 100 Balanced classification accuracy Computational cost Feature input: 8-dimensional latent features + 1-dimensional MSE error Multidimensional features Improve classification accuracy Node splitting criterion: Gini coefficient measures feature purity; random seed: 42 to ensure repeatability; maximum tree depth: None to avoid pruning affecting generalization ability. The core advantage of random forests is that they reduce generalization error through voting among multiple decision trees. Their accuracy increases rapidly with the number of decision trees, then gradually saturates. For spectrum-aware binary classification tasks (channel idle / occupied), the number of decision trees needs to be sufficient to cover the diversity of data distribution without overfitting. The conventional effective range in the field is 50 to 200 trees, with 100 trees being in the middle of this range, which is a reasonable starting point for balancing accuracy and complexity.
[0040] To determine the optimal number of decision trees, five sets of comparative experiments were designed, with the number of decision trees set to 50, 80, 100, 150, and 200 respectively. Under the same feature input (8-dimensional latent features + 1-dimensional MSE error) and evaluation criteria, the classification performance and computational complexity of the model were tested. The results are shown in Table 3. Table 3. Performance Comparison of Models with Different Numbers of Decision Trees Number of decision trees Recall rate False negative rate F1 score accuracy False alarm rate Computational complexity trend 50 0.8436 0.1564 0.9104 0.9917 0.0005 Low 80 0.8306 0.1694 0.9059 0.9914 0.0002 middle 100 0.8730 0.1270 0.9257 0.9930 0.0007 balance 150 0.8208 0.1792 0.8968 0.9906 0.0005 high 200 0.8078 0.1922 0.8921 0.9902 0.0002 Extremely high The F1 score in the table is the harmonic mean of precision and recall. Its core function is to avoid misjudgments caused by uneven data distribution of a single indicator, and it has the dual ability to comprehensively reflect the model's ability to "correctly identify targets" and "avoid misjudgments". When the number of decision trees is ≤80, the "voting correction" effect of ensemble learning is lacking, with a detection probability ≤0.844 and a false negative rate ≥0.156, making it difficult to meet the effective detection requirements of authorized user signals in complex electromagnetic environments. When the number of decision trees is 100, the detection probability can reach 0.873, and the false negative rate decreases to 0.127. At this time, the F1 score and precision are at the optimal level for each number, and its computational complexity is compatible with the DSP / FPGA unit architecture of the XSRP platform, enabling lightweight and real-time deployment. When the number of decision trees is ≥150, the detection probability does not increase but decreases, and the core performance indicators do not improve positively or even decline. However, the computational overhead and inference burden increase significantly, increasing the hardware resource utilization of the XSRP platform and significantly reducing deployment efficiency. Therefore, setting up 100 decision trees is quite reasonable.
[0041] Gini coefficient: The Gini coefficient is used to select the optimal feature when splitting nodes in each decision tree. The formula for calculating the Gini coefficient is: ; In the formula, The sample set of the current decision tree node. For the number of categories (in this article) (corresponding to channel idle / occupied) For set The Middle The proportion of samples of each class; The smaller the coefficient, the higher the purity of the node samples, and the better the splitting effect. The final model uses a majority voting mechanism to output the classification result, and its mathematical expression is as follows: ; In the formula, For the number of decision trees, The predicted output of the i-th decision tree (input is a multi-dimensional feature vector) ), This is an indicator function (it takes the value 1 if the condition is met, and 0 otherwise). This indicates "channel idle". This represents "channel occupancy". By aggregating the prediction results of all decision trees, the category with the highest proportion is selected as the final output, further refining the initial judgment of the autoencoder, thereby improving classification accuracy.
[0042] To verify the effectiveness of the system of the present invention, a comprehensive experiment and performance analysis were conducted.
[0043] Complexity analysis: Calculations show that the autoencoder has approximately 2816 FLOPs per sample and about 1514 parameters; the random forest (100 trees) has approximately 25200 FLOPs per sample and about 13800 parameters. The overall model is lightweight and suitable for real-time deployment on the XSRP platform's DSP / FPGA.
[0044] To comprehensively evaluate the performance of the improved autoencoder in spectrum sensing tasks, this experiment utilized two types of data sources for training and testing: firstly, measured signals collected in a laboratory environment using the XSRP platform; and secondly, the publicly available RML2016.10a dataset to increase data diversity. Experimental parameter settings: the training data employed QPSK modulation, with a signal-to-noise ratio ranging from -10dB to 20dB, and a carrier frequency of 1MHz.
[0045] In the training phase, I / Q time-series data collected by the XSRP platform were used to conduct end-to-end training of the improved autoencoder model. The training parameters were set as follows: the Adam optimizer was selected, the initial learning rate was set to 1e-3, the batch size was determined to be 256, and an early stopping mechanism was introduced with a patience value set to 10 to avoid overfitting. During the training process, the model's loss function changed with the training epochs as follows: Figure 3 As shown.
[0046] from Figure 3 It can be observed that both the training loss and validation loss of the model decrease rapidly from their initial values of around 0.7, and then gradually converge after the 6th training epoch. The two curves exhibit a high degree of synchronization throughout the training cycle, and the validation loss eventually stabilizes at a level slightly lower than the training loss, with a difference of approximately 0.03-0.04. This fully demonstrates that the features learned by the model on the training set can effectively generalize to the validation set, without exhibiting significant overfitting. The model basically converges after about 12 epochs of training, and the final validation loss stabilizes below 0.01. This confirms the effectiveness and efficiency of the autoencoder network in extracting robust features from the raw I / Q signals, laying a solid foundation for subsequent anomaly detection tasks.
[0047] The dynamic threshold is a key parameter for anomaly detection in autoencoders, and its setting directly affects the system's false alarm rate and false detection rate. In order to deeply analyze the influence of the threshold coefficient k on detection performance, this paper designed a controlled variable experiment with k=1.0, 1.5, 2.0, 2.5, and 3.0, and systematically analyzed the impact of each k value on accuracy and false alarm rate under different signal-to-noise ratio conditions.
[0048] Figure 4 This presents the combined impact of various k values on system performance under different signal-to-noise ratios, from... Figure 4 As can be clearly seen in (a) to (b), the selection of the k value requires a trade-off between accuracy and false alarm rate. Specifically, when the signal-to-noise ratio is low, such as -10dB, the detection accuracy corresponding to k = 2.0 is 94.5%. As the k value changes from 1.0 to 2.0, the false alarm rate decreases significantly, and the detection accuracy becomes more precise. When k is greater than or equal to 2, the false alarm rate does not change significantly with the increase of the signal-to-noise ratio.
[0049] To verify whether the threshold selection is reasonable, a qualitative analysis of the detection results under different k values is conducted using a confusion matrix. Figure 5 The system's detection results are clearly presented when k equals 1.0, 1.5, 2.0, 2.5, and 3.0. The dark blue area on the diagonal of the matrix represents the number of correctly classified samples, while the off-diagonal area represents misclassified samples. Figure 5 As shown in (a) and (b), as k increases from 1.0 to 1.5, the number of abnormal samples misclassified as normal increases slightly, while the number of normal samples misclassified as abnormal decreases significantly. This further verifies the finding from a quantitative perspective. Figure 4 The conclusions provide an intuitive basis for the selection of threshold coefficients.
[0050] Based on the trained autoencoder model, a dynamic thresholding strategy is used to detect spectral anomalies. The threshold is set according to the statistical distribution of reconstruction errors in the training set. The principle is dynamically calculated. To clearly present the working mechanism of autoencoder anomaly detection, the optimal threshold coefficient k = 1.0 is selected, and the detection process is visualized and analyzed. The results are as follows: Figure 6 As shown.
[0051] In the global view, the green vertical lines represent the reconstruction error of each test sample, while the red dashed lines represent the dynamic threshold calculated based on k = 1.0. As shown in the figure, the reconstruction errors of most samples are concentrated at a low level. However, the points marked with a red asterisk as "detected anomalies" have reconstruction errors that significantly exceed the threshold. In the magnified detail view, the contrast between "true anomalies" and "detected anomalies" can be clearly observed. For example, high reconstruction error peaks appear near sample indices 80, 125, and 250. The system successfully detected these anomalies. In most normal signal ranges, the reconstruction error remains below the threshold, with very few false alarms. This intuitive visualization strongly confirms that the autoencoder can effectively learn normal signal patterns and highlight anomalous signals that deviate significantly from the pattern with high reconstruction errors, achieving reliable blind spectrum sensing. To comprehensively evaluate the performance of the proposed method, Autoencoder + Random Forest (AE+RF), in terms of accuracy, false negative rate, and false positive rate, it is compared with the Energy Detection (ED) method and two baseline methods (Method A: Autoencoder, AE; Method B: Random Forest, RF) under different signal-to-noise ratio conditions.
[0052] First, a detailed evaluation of the inference efficiency of the AE+RF model on the test set was conducted, and the specific results are shown in Table 4. As can be clearly seen from the table, the proposed AE+RF model has a significant advantage in inference speed on the CPU compared to single autoencoder or random forest methods, fully demonstrating its good real-time processing potential. Although the energy detection method has the lowest latency, its detection performance is significantly lower than that of the proposed method. This fully demonstrates that the AE+RF method achieves a good balance between detection accuracy and computational complexity.
[0053] Table 4. Comparison of Complexity and Performance of Different Methods method Average inference latency (CPU) Accuracy (SNR=0dB) Is a large amount of labeled data required? AE+RF (Ours) 2.1ms 98.81% No (Unsupervised) Method A (AE) 5.7ms 98.14% yes Method B (RF) 8.9ms 99.30% yes Energy Detection <0.1ms 65.3% no Figure 7 The performance curves of different sensing methods, including detection probability, missed detection probability, and false alarm probability, are described. From... Figure 7 (a) It can be seen that at low signal-to-noise ratios, such as 0 dB, the detection probability of the proposed AE+RF method is about 33.5% higher than that of the ED method. This is mainly because the autoencoder unsupervised feature learning has strong robustness to noise, and the random forest ensemble learning has certain advantages. As the signal-to-noise ratio increases, the detection performance of all three methods improves, but the AE+RF method is significantly better. Figure 7 (b) indicates that, in terms of controlling false alarms, the false alarm probability of the AE+RF method is relatively low under all test signal-to-noise ratios, and its advantage is more obvious in low signal-to-noise ratio environments. This fully demonstrates that the hybrid model that integrates autoencoder reconstruction error and random forest classifier can effectively capture weak signal features and maintain a low risk of misjudgment, achieving a good balance between detection probability and false alarm probability.
[0054] In order to quantitatively evaluate the overall performance of strategies with different k values, Figure 8 The comprehensive scores for each k value under the default signal-to-noise ratio (SNR) are summarized. This score comprehensively considers the weighted impact between the false negative and false positive rates. The bar chart clearly shows that the system achieves the highest comprehensive score when k=1.0. This result aligns with the conclusions drawn from the multi-SNR analysis, confirming the reliability of using k=1.0 as the optimal threshold. This result implies that, through parameter sensitivity analysis of the system, an optimal robust operating point can be determined for the autoencoder-based spectrum sensing system in practical applications.
[0055] This invention discloses a spectrum intelligent sensing system and method based on an autoencoder and a software radio platform. Through the organic combination of unsupervised and supervised learning, it successfully achieves high-precision, adaptive intelligent sensing of channel occupancy status. The system automatically extracts essential features from the raw I / Q signals using an autoencoder, overcomes the limitations of fixed thresholds through a statistically based dynamic threshold mechanism, and further optimizes decision accuracy using random forest ensemble learning. Experimental results show that the system effectively reduces dependence on external labeled data and prior knowledge, improves the robustness and accuracy of sensing in dynamic and complex environments, and provides a complete and engineerable solution for cognitive radio and dynamic spectrum access technologies.
[0056] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0057] It should be noted that the components mentioned in the above embodiments are all general standard parts or components known to those skilled in the art. Their structures and principles can be learned by those skilled in the art through technical manuals or conventional experimental methods.
[0058] This invention has illustrated its principles and implementation methods using specific examples. The descriptions of these embodiments are merely illustrative of the method and its core ideas; furthermore, those skilled in the art will recognize that modifications may be made to the specific implementation methods and application scope based on the principles of this invention. Therefore, the content of this specification should not be construed as limiting the invention.
Claims
1. A spectrum intelligent sensing system based on an autoencoder and a software radio platform, characterized in that, include: Software radio platform for acquiring raw I / Q baseband signals in the target frequency band; The preprocessing module is used to perform format cleaning, normalization and standardization on the original I / Q baseband signal to obtain standardized signal data; An autoencoder is used to perform unsupervised feature learning and reconstruction on the standardized signal data, output the reconstructed signal and calculate the reconstruction error; The dynamic decision module is used to set a dynamic decision threshold based on the reconstruction error statistical distribution calculated by the autoencoder during the training phase, and to compare the reconstruction error of the real-time signal with the dynamic decision threshold to make a preliminary judgment on the channel state. A random forest classifier is used to fuse the latent spatial features extracted by the autoencoder with the reconstruction error, perform supervised classification optimization on the preliminary judgment results of the dynamic decision module, and output the final channel occupancy status judgment result.
2. The spectrum intelligent sensing system based on an autoencoder and software radio platform according to claim 1, characterized in that, The software radio platform is a scalable software radio platform that connects to the host computer via a dual IP configuration for stable data transmission and control.
3. The spectrum intelligent sensing system based on an autoencoder and software radio platform according to claim 1, characterized in that, The autoencoder includes an encoder and a decoder. The encoder compresses the input signal into a low-dimensional latent space, and the decoder reconstructs the features of the latent space into an output signal. The training of the autoencoder aims to minimize the reconstruction error.
4. The spectrum intelligent sensing system based on an autoencoder and software radio platform according to claim 1, characterized in that, The decision tree in the random forest classifier uses the Gini coefficient as the node splitting criterion and integrates the final classification results through a majority voting mechanism.
5. A spectrum intelligent sensing method based on an autoencoder and software radio platform, characterized in that, Includes the following steps: S1. Signal acquisition: Acquire the raw I / Q baseband signal of the target frequency band through a software radio platform; S2. Preprocessing: The original I / Q baseband signal is cleaned, normalized, and standardized to obtain standardized signal data; S3. Autoencoder feature learning: Input the standardized signal data into the autoencoder for unsupervised feature learning and reconstruction; S4. Dynamic decision threshold setting: Based on the reconstruction error statistical distribution calculated by the autoencoder during the training phase, a dynamic decision threshold is set, using the following formula: ; In the formula, The mean MSE of all samples in the training set; MSE is the standard deviation of the training set; S is the total number of samples in the training set. This is the threshold coefficient; This is the final dynamic decision threshold; S5. Preliminary judgment: The real-time acquired and preprocessed signal is input into the trained autoencoder, its reconstruction error is calculated, and compared with the dynamic judgment threshold to obtain a preliminary judgment of the channel state. S6. Classification optimization: Construct and train a random forest classifier. The random forest classifier uses the latent spatial features extracted by the autoencoder and the reconstruction error as input, and adopts the Gini coefficient as the node splitting criterion. The formula for calculating the Gini coefficient is as follows: ; In the formula, The sample set of the current decision tree node. For the number of categories, For set The Middle The proportion of samples of each class; The preliminary judgment results are subjected to supervised classification and optimization, and the final channel occupancy status is output.
6. The spectrum intelligent sensing method based on an autoencoder and software radio platform according to claim 5, characterized in that, In step S2, the normalization calculation formula is as follows: ; In the formula, The original data, , These are the extreme values of the data; The formula for standardization is: ; In the formula, The original data, The mean, The standard deviation is denoted as .
7. The spectrum intelligent sensing method based on an autoencoder and software radio platform according to claim 5, characterized in that, In step S3, the autoencoder includes an encoder and a decoder, wherein the encoding process is represented as follows: ; In the formula, It is a 2D original I / Q signal; This is the encoder weight matrix; This is the encoder bias vector; 8 represents the potential spatial dimension; The ReLU activation function is expressed as follows: The compressed low-dimensional latent feature vector; The decoding process is represented as follows: ; In the formula, This is the decoder weight matrix; This is the decoder bias vector; These are the reconstructed I / Q signal samples output by the decoder; The reconstruction error is calculated using the mean squared error as the loss function, and the formula is as follows: ; In the formula, This is the i-th original I / Q signal sample; B represents the i-th reconstructed I / Q signal sample; B is the number of training samples in a single batch. It is a 2-norm used to calculate the cumulative error at the vector level.
8. The spectrum intelligent sensing method based on an autoencoder and software radio platform according to claim 7, characterized in that, During the training of the autoencoder, Dropout regularization is applied to the hidden layer, and its operation is represented as follows: ; In the formula, This is the original output vector of the hidden layer; Let be the Bernoulli distribution mask vector, satisfying , This represents the probability of neuron inactivation. Element-wise product; This is the output of the hidden layer after Dropout processing.
9. The spectrum intelligent sensing method based on an autoencoder and software radio platform according to claim 5, characterized in that, In step S6, the random forest classifier generates training subsets of multiple decision trees through Bootstrap sampling, and integrates the final results through a majority voting mechanism. Its final output is represented as follows: ; In the formula, For the number of decision trees, This is the predicted output of the i-th decision tree, with a multi-dimensional feature vector as input. , This is an indicator function that takes the value 1 if the condition is met, and 0 otherwise. This indicates "channel idle". It represents "channel occupancy".
10. The spectrum intelligent sensing method based on an autoencoder and software radio platform according to any one of claims 5-9, characterized in that, The spectrum sensing problem is based on a binary hypothesis testing model, which is expressed as: ; In the formula, The time-domain continuous signal received by the SU; The signal is a continuous-time signal emitted by the PU and satisfies the power constraint condition. , The average power of the PU signal; The channel fading coefficient follows a Rayleigh distribution. , The variance of the fading coefficient; It is additive white Gaussian noise.