ZigBee radio frequency signal data set construction method based on YOLOv8
By constructing a ZigBee radio frequency signal data set based on the YOLOv8 method, the problem of the lack of open source ZigBee signal data sets in the existing technology is solved, efficient and accurate signal collection and storage is achieved, and the application capabilities in the field of Internet of Things security are improved.
Patent Information
- Application Number
- CN202410772558.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-14
- Publication Date
- 2024-10-11
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing technology lacks open source ZigBee signal data sets for the field of radio frequency fingerprint technology, which limits the optimization and generalization capabilities of the radio frequency fingerprint algorithm and affects the further development and application of the technology.
A method based on YOLOv8 is used to construct a ZigBee radio frequency signal data set. Radio frequency modulation signals are sent through ZigBee devices that do not require networking, and then two-dimensional transformations are performed and input into the YOLOv8 model for training to achieve accurate detection and structured storage of signals, and to establish a complete data set.
It significantly improves the collection efficiency and quality of ZigBee signals, reduces interference, enhances the sharing and processing efficiency of signal data, improves the robustness and generalization ability of the model, and promotes applications in the field of Internet of Things security.
Smart Images

Figure CN118764872A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of wireless communications, and in particular is a method for constructing a ZigBee radio frequency signal data set based on YOLOv8. Background Art
[0002] With the development of technologies such as the Internet of Things, the Internet, and sensors, the combination of various sensing devices and networks can realize the interconnection and intelligent evolution of all things; however, it also brings major challenges to data security and privacy protection.
[0003] RF fingerprint technology is an authentication method based on the physical characteristics of wireless signals. Each wireless device will form unique RF characteristics in its hardware circuit and manufacturing process. These characteristics are unique like biological fingerprints. RF fingerprint technology uses these unique characteristics to identify and verify devices, providing more secure protection measures for wireless networks. Compared with traditional passwords or encryption technologies, it has higher security and is not easy to be hacked. Driven by big data and deep learning technology, RF fingerprint recognition is gradually turning to a data-driven method, but this method needs to rely on a large amount of data to train the model to improve the accuracy and efficiency of recognition.
[0004] However, due to many problems in the current data sets, such as inconsistent standards, insufficient diversity of RF signal types, and limited collection scenarios, these problems limit the optimization and generalization capabilities of RF fingerprint algorithms, affecting the further development and application of the technology.
[0005] Currently, signal datasets are mainly constructed using methods such as real environment acquisition and simulated signal generation. The advantage of the real environment acquisition method is that the data is highly authentic, reflects the signal characteristics in the actual scene, and can capture the complex noise and interference in the real environment. However, data acquisition may be expensive and time-consuming. The simulated signal generation method may not be able to fully simulate the complexity of the real scene and is limited by the accuracy and generalization ability of the generated model.
[0006] ZigBee is an efficient and low-power wireless communication technology based on the IEEE 802.15.4 standard and is widely used in the field of the Internet of Things. ZigBee devices have the characteristics of low cost, low power consumption and high capacity, and play an important role in the Internet of Things. However, there is currently a lack of open source ZigBee signal datasets for the field of radio frequency fingerprinting technology.
[0007] Therefore, real-time ZigBee signal sampling is crucial to optimizing and improving the performance of RF fingerprinting technology, which helps to improve the quality and diversity of signal data sets and promote the widespread application of ZigBee devices in the field of IoT security. Summary of the invention
[0008] In view of the above problems, the present invention proposes a method for constructing a ZigBee radio frequency signal dataset based on YOLOv8, which can not only accurately extract ZigBee signals and store them in a structured manner in a local database, thereby establishing a more complete dataset for subsequent deep learning; but also significantly improve the application flexibility of ZigBee technology; this method provides a new technical approach for the field of wireless signal detection and has great practical application value.
[0009] The method for constructing a ZigBee radio frequency signal dataset based on YOLOv8 has the following specific steps:
[0010] Step 1: After parameter setting for the ZigBee device that does not require networking, send out a radio frequency modulated signal.
[0011] Step 2: Perform a two-dimensional transformation on the radio frequency modulated signal to convert it into a two-dimensional visual image;
[0012] Step 3: Input the visualized image into the YOLOv8 model for training to obtain the optimal parameters of the network model.
[0013] Step 4: Use the trained YOLOv8 model to perform real-time signal detection; convert the actually collected signal to be detected into a two-dimensional visual image as input, and output the signal detection result, that is, accurately point out the location information of the ZigBee signal in the signal to be detected.
[0014] The detection result marks the location of the signal in the form of a prediction box, with label information, confidence level, signal area coordinates, etc.
[0015] Step 5: Regionally intercept the detected ZigBee signal and store the signal locally in a structured manner, thereby constructing a structured ZigBee radio frequency signal data set.
[0016] The advantages of the present invention are:
[0017] (1) A method for constructing a ZigBee RF signal dataset based on YOLOv8, which does not require the hardware parameterization of the ZigBee radiation source to be networked. This not only makes the ZigBee signal acquisition process more direct and efficient, effectively avoiding the RF signal interference of the central node, but also greatly reduces the interference from other wireless signals such as Wi-Fi and Bluetooth. In addition, in the initial stage of signal acquisition, this technology ensures the proportion of ZigBee signals in the entire signal segment, which facilitates subsequent signal detection and extraction operations;
[0018] (2) A method for constructing a ZigBee RF signal dataset based on YOLOv8, which avoids traditional signal processing steps such as complex frequency domain transformation, directly utilizes the amplitude and distribution characteristics of the ZigBee RF signal, and combines the advanced YOLOv8 target detection model to effectively achieve accurate detection of ZigBee signals. Compared with the traditional "threshold method", this method effectively avoids the influence of continuous medium-amplitude interference signals and shows superior practicality and accuracy;
[0019] (3) A method for constructing a ZigBee radio frequency signal dataset based on YOLOv8 uses the SigMF format to structure the signal data, significantly improving the efficiency of signal data sharing, management, and processing. This storage method not only enhances the accessibility and operability of signal data, but also helps to ensure the consistency and integrity of the data in subsequent analysis and processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 It is a flow chart of a method for constructing a ZigBee radio frequency signal data set based on YOLOv8 in the present invention;
[0021] Figure 2 It is a diagram of the ZigBee signal radiation source and the USRP B210 device in the present invention;
[0022] Figure 3 is a schematic diagram of a ZigBee signal in the present invention;
[0023] Figure 4 It is a flowchart of hardware programming of ZigBee radiation source without networking in the present invention;
[0024] Figure 5 It is an implementation flow chart of the present invention using YOLOv8 for signal detection;
[0025] Figure 6 It is the result information diagram after the YOLOv8 model training is completed in the present invention;
[0026] Figure 7 This is a diagram showing the detection effect of the signal two-dimensional graph of the present invention;
[0027] Figure 8 It is a two-dimensional diagram of the continuous medium-amplitude interference signal in the present invention. DETAILED DESCRIPTION
[0028] The content of the present invention is described in detail below in conjunction with implementation steps and drawings.
[0029] Based on the characteristics of ZigBee communication signals and the excellent performance of the YOLO series in the field of target detection, this paper draws on the idea of target detection and considers using the emerging YOLOv8 for signal detection and constructing a data set. The new data set can fill the existing deficiencies, reflect the actual communication environment, adapt to different conditions and interferences, help simulate the real environment to improve the robustness and generalization ability of the model, and also support the research and application of new technologies. At the same time, since the Internet of Things environment faces a variety of interference and noise, this type of data is also very valuable for machine learning model training.
[0030] The present invention is based on the method for constructing a ZigBee radio frequency signal data set based on YOLOv8. First, on the basis of ZigBee hardware programming without networking, a hardware platform is constructed, and a large number of signal samples containing ZigBee signals are collected on this basis. Then, the one-dimensional sequence of these signals is converted into a two-dimensional visual image, and then a new image data set for signal detection is created. Then, the YOLOv8 algorithm is trained using the new image data set to obtain an efficient network model. The model can take the two-dimensional image of the signal to be detected actually collected as input, and output the signal detection result, that is, accurately point out the position information of the ZigBee signal in the signal to be detected. Finally, the extracted ZigBee signal is structured and stored to establish a more complete data set.
[0031] like Figure 1 As shown, the specific steps are as follows:
[0032] Step 1: After programming and parameterizing the ZigBee device that does not require networking, send out a radio frequency modulated signal.
[0033] The parameterization settings are as follows:
[0034] (1) Set the payload data byte length to 50 bits;
[0035] (2) Randomly generate 50 bytes of data;
[0036] (3) Unify the source address and destination address;
[0037] (4) Adjust the signal carrier frequency to 2.475 GHz and select the number of channels as 25;
[0038] (5) The frequency of the modulated signal transmitted externally is 1 Hz.
[0039] The RF modulation signal is as follows:
[0040]
[0041] Where real is the real part of the complex signal, t is time, I(t) is the in-phase component of the signal, Q(t) is the quadrature component of the signal, j is the imaginary unit, and f c is the carrier frequency, θ0 is the initial phase, and T is the signal duration.
[0042] Step 2: transform the one-dimensional radio frequency modulated signal into a two-dimensional visual image;
[0043] Specifically, the one-dimensional complex signal is subjected to amplitude operation, and then dimension transformation and grayscale processing are performed to generate a two-dimensional grayscale image as a subsequent model training and detection data set.
[0044] Step 3: After annotating the visualized image, input it into the YOLOv8 model for training to obtain the optimal parameters of the network model.
[0045] Specifically:
[0046] First, the visualized images are divided into training sets and test sets. The targets are manually marked according to the intuitiveness of ZigBee signals in the two-dimensional graph. At the same time, the target category is set (category index starts from 0), and the custom dataset label category and quantity are set.
[0047] Then, modify the data loading yaml configuration file, set model training related parameters such as batch size to 16, epoch to 80, etc., train the model until convergence, and then verify and export the model;
[0048] Step 4: Use the trained YOLOv8 model to perform real-time signal detection; convert the actually collected signal to be detected into a two-dimensional image as input, and output the signal detection result, that is, accurately point out the location information of the ZigBee signal in the signal to be detected.
[0049] The detection result marks the location of the signal in the form of a prediction box, with label information, confidence level, signal area coordinates, etc.
[0050] Step 5: Regionally intercept the detected ZigBee signal and store the signal locally in a structured manner, thereby constructing a structured ZigBee radio frequency signal data set.
[0051] Specifically: the final signal output by the model is reduced in dimension and saved and structured into a SigMF format file;
[0052] Specifically, the position of the ZigBee signal in the signal is determined by the coordinates of the upper left corner and the lower right corner of the output signal area, and the structured data is extracted and saved. A single "SigMF Recording" consists of a binary file and a plain text file with metadata in JSON format. They are named filename.sigmf-data and filename.sigmf-meta respectively, where the file with the data suffix is the signal data file, and the file with the meta suffix is the signal information description file.
[0053] Example:
[0054] Aiming at the problem of scarcity of ZigBee signal data set in real environment in the field of radio frequency fingerprint recognition, the present invention takes ZigBee devices widely used in the Internet of Things as experimental objects, such as Figure 2 As shown, this method is mainly based on the direct acquisition purpose of ZigBee signals and its unique characteristics, and completes the implementation of ZigBee radiation source hardware programming without networking.
[0055] The present invention innovatively introduces visual detection methods into the field of signal detection, specifically by combining the advanced YOLOv8 model in the field of target detection. This method not only solves the problem of scarce ZigBee signal samples in the prior art, but also realizes efficient recognition and extraction of ZigBee signal features. This technology provides new ideas for the field of radio frequency fingerprint recognition, successfully transforming traditional visual detection technology into signal detection technology, thus bringing significant technical advantages to the field of IoT security.
[0056] The method for constructing a ZigBee radio frequency signal dataset based on YOLOv8 is specifically implemented as follows:
[0057] The first step is to implement ZigBee hardware programming without networking;
[0058] like Figure 3 As shown in Figure 1, the structure of ZigBee signal is clear, including two areas: the preamble and the payload. The preamble area contains transient, semi-stable and steady-state signals, while the payload area is characterized by a stable signal. This area includes the start of the frame delimiter, the physical layer header, and the media access control encapsulation of the MAC layer.
[0059] The hardware programming process of the ZigBee radiation source without networking in the present invention is as follows: Figure 4 shown.
[0060] The second step is to receive the signal and perform a two-dimensional transformation on the one-dimensional signal;
[0061] In the present invention, a total of 14 ZigBee devices are programmed as terminal nodes to simulate the scenario of unauthorized devices infiltrating the ZigBee network, and signal transmission is achieved based on step one.
[0062] Use IAR Embedded Workbench for C language hardware programming, set the payload data byte to 50 bits, randomly generate 50-bit byte data, and set a unified ZigBee signal source address and destination identifier;
[0063] The signal carrier frequency is adjusted to 2.475 GHz, the number of channels is adjusted to 25, and the external transmission frequency of the signal is adjusted to 1 Hz, so that ZigBee devices do not need to establish a self-organizing network and avoid interference from other wireless signals such as Wi-Fi and Bluetooth on the same frequency as much as possible.
[0064] Secondly, the USRP B210 receiver is used for signal acquisition. The center frequency of the USRP B210 is set to 2.475GHz and the sampling rate is set to 8MS / s. Under this configuration, the number of sample points processed each time is 409,600, which is equivalent to a sampling cycle lasting 51.2 milliseconds. For the ZigBee signal, there are about 20,000 sample points, and the duration is about 2.0 milliseconds. Among these sample points, in addition to the ZigBee signal, the rest is mainly background noise.
[0065] It is worth pointing out that the amplitude of the ZigBee signal is observed to be more than 10 times larger than the background noise on average.
[0066] Again, Gaussian noise was artificially added to the signals to increase the diversity and challenge of the final dataset, with the signal-to-noise ratio (SNR) range set to -20dB to 20dB.
[0067] Then, the amplitude operation is performed on the received ZigBee signal samples.
[0068] Specifically, according to the principles of modern communication technology, digital modulation signals are transmitted in the form of IQ modulation, which improves the utilization rate of the frequency band.
[0069] The RF modulation signal is as follows:
[0070]
[0071] Here, the ZigBee radio frequency signal is a complex signal. In order to expand it from a one-dimensional sequence into a two-dimensional image, it needs to be represented by amplitude.
[0072] Finally, according to the principle that the YOLOv8 model uses 640×640 size images for training and testing by default, the 409,600 sample points are reshaped into a two-dimensional image and grayscaled to form a 640×640 size image for model input. To facilitate subsequent extraction operations, the present invention stipulates that the starting direction of the signal on the two-dimensional image is from left to right and from top to bottom.
[0073] The third step is to annotate the transformed two-dimensional signal data and then train the YOLOv8 model;
[0074] First, the received signal samples are batch processed in step 2 to generate images, which serve as the image dataset for subsequent YOLOv8 model training and detection.
[0075] Secondly, it is divided into two parts in a 1:1 ratio, one part is used for model training and the other part is used for actual detection, which serves as the basis for constructing the ZigBee signal dataset.
[0076] Then, the ratio of training set, validation set and test set in the image dataset used for model training is set to 7:2:1. For each image in the dataset, the amplitude of the ZigBee signal is significantly higher than the background noise, and its existence is obviously different in the two-dimensional image. The location of the ZigBee signal is identified by manual box marking and the category is set for it (the category index starts from 0). The data annotation format used in this process is the same as that of visual image target detection, and is commonly annotated using the LabelImg tool.
[0077] Then, set the label category and quantity of the custom dataset, including information such as the signal of interest (SOI), regional coordinates, etc. The self-made dataset (including the original image) and the annotated label information file need to be placed in the same directory as the model to facilitate data loading and processing.
[0078] Finally, modify the yaml configuration file for data loading, set the relevant parameters for model training, such as batchsize to 16, epoch to 100, etc., train the model until convergence, and then perform model verification and export.
[0079] The specific implementation process of signal detection using the YOLOv8 model is shown in Figure 5 middle.
[0080] The result information after model training is completed is as follows Figure 6 As shown, the model has a good convergence effect.
[0081] The fourth step is to use the trained YOLOv8 model to perform real-time signal detection;
[0082] First, the two-dimensional image of the signal to be detected is input into the finally trained YOLOv8 model according to the relevant steps in step three for model inference to obtain the detection output result.
[0083] Then, the detection result is obtained in the form of an output prediction box to mark the signal position, and includes label information, confidence, etc., to make the displayed information more intuitive and rich. The output result is shown in the figure below. Figure 7 shown.
[0084] In particular, since continuous interference signals with medium amplitude other than ZigBee, such as Bluetooth and WiFi, are received during the signal collection process, Figure 8 As shown in Figure 1, the traditional ZigBee signal acquisition method that sets the threshold according to the amplitude cannot effectively exclude such signals. However, according to the relationship between the confidence and false detection rate of the YOLOv8 model in the present invention, as shown in Table 1, setting a higher confidence can filter out such signals and achieve a more accurate recognition effect.
[0085] The detection accuracy of the present invention and the traditional "threshold" method obtained by using 3000 sample files is shown in Table 2.
[0086] Table 1
[0087]
[0088] Table 2
[0089]
[0090] Finally, the output information of the model is saved in a txt file, and the format in the txt file (category, coordinate point of the upper left corner of the box, coordinate point of the lower right corner of the box, confidence) is converted into a format that meets the requirements (category, confidence, center point of the box and height and width) for subsequent signal interception and structured storage.
[0091] The fifth step is to perform regional interception of the detected ZigBee signal and implement structured storage of the signal.
[0092] Firstly, the signal is extracted by dimensionality reduction according to the final signal position information output by the model.
[0093] Specifically, the specific position of the ZigBee signal in the entire signal sample is determined by the coordinates and length and width of the signal area, and the ZigBee signal sequence is intercepted by one-dimensional expansion. The location information output by the model includes the normalized center coordinates (x, y) of the output box, the height h and width w of the box. According to the characteristics of the signal area in the picture, it can be determined that x = w = 0.5, and the starting point start_idx and the ending point end_idx of the ZigBee signal can be obtained as follows:
[0094] start_idx=640 2 *y-640*320*h
[0095] end_idx=640 2 *y+640*320*h
[0096] This process effectively extracts the specific ZigBee signal from the complex signal environment by identifying and separating the target signal area.
[0097] Then, the extracted signals are structured and saved in SigMF (Signal Metadata Format) format as the final ZigBee signal dataset.
[0098] Specifically, in the Python environment, the signal is processed using the officially provided SigMF Python package:
[0099] SigMF is an innovative, open metadata format designed specifically to describe and store various types of signal data, including radio frequency (RF) signals, sound, radar signals, and other sensor signals. The standardized nature of SigMF enables signal data from different sources to be effectively recorded and managed. The format not only records basic information about the signal, such as sampling rate and spectrum range, but also describes in detail key parameters such as time domain and frequency domain characteristics, hardware configuration, etc.
[0100] Each "SigMF Recording" consists of a binary file containing IQ samples and a plain text file describing metadata in JSON format, named filename.sigmf-data (signal data file) and filename.sigmf-meta (signal information description file). The key signal information contained in the meta file is shown in Table 3.
[0101] Table 3
[0102]
[0103]
[0104] This invention improves the underlying code of ZigBee hardware to achieve the function of sending radio frequency signals without networking. In addition, the invention combines the cutting-edge algorithm in the field of target detection, the YOLOv8 neural network. Compared with YOLOv5, it is more convenient to apply it to the field of signal detection, especially in the detection of signal existence and regional positioning within a specific frequency range received by the USRP B210 device, with faster operation speed and more accurate detection effect.
[0105] The existence detection and area positioning are specifically:
[0106] (1) In order to adapt the YOLOv8 model, 409,600 sample points are reshaped into a two-dimensional image to form a 640×640 image to adapt to the model input;
[0107] Since ZigBee signals are RF modulated signals, they are as follows:
[0108]
[0109] Therefore, the pre-operation of this step is to perform modulo operation on the signal and grayscale the image to intuitively represent its amplitude;
[0110] (2) The ratio of training set to test set in the ZigBee signal two-dimensional graph dataset used for model training is divided into 9:1. The target is manually marked according to the intuitiveness of the ZigBee signal in the two-dimensional graph, and the category of the target is set (the category index starts from 0), and the category and number of custom dataset labels are set;
[0111] (3) Modify the data loading YAML configuration file, set model training related parameters such as batch size to 16, epoch to 80, etc., train the model until convergence, and then verify and export the model;
[0112] (4) The two-dimensional image of the signal to be detected is input into the final YOLOv8 model to obtain the detection output result, and the signal position is marked in the form of a prediction box. At the same time, in order to make the displayed information more intuitive and rich, it also contains label information, confidence, signal area coordinates, etc.
Claims
1. A method for constructing a ZigBee radio frequency signal dataset based on YOLOv8, characterized in that: The specific steps are as follows: Step 1: Parameterize the bottom layer of the ZigBee device so that it can send RF modulated signals without networking; The RF modulation signal is as follows: Where real is the real part of the complex signal, t is time, I(t) is the in-phase component of the signal, Q(t) is the quadrature component of the signal, j is the imaginary unit, and f c is the carrier frequency, θ0 is the initial phase, and T is the signal duration; Step 2: Perform a two-dimensional transformation on the radio frequency modulated signal to convert it into a two-dimensional visual image; Step 3: Input the visualized image into the YOLOv8 neural network model for training to obtain the optimal parameters of the network model; Step 4: Use the trained YOLOv8 neural network model to perform real-time existence detection and regional positioning of the signals to be detected within the actual collected frequency range, and accurately extract the ZigBee signal; The two-dimensional image converted from the actual collected signal to be detected is used as input, and the signal detection result is output, that is, the position information of the ZigBee signal in the signal to be detected is accurately pointed out; The detection result marks the location of the signal in the form of a prediction box, with label information, confidence and signal area coordinates; Step 5: Regionally intercept the detected ZigBee signal and store the signal locally in a structured manner, thereby constructing a structured ZigBee radio frequency signal data set.
2. The method for constructing a ZigBee radio frequency signal dataset based on YOLOv8 as claimed in claim 1, characterized in that: In step 1, the parameterization settings are as follows: (1) Set the payload data byte length to 50 bits; (2) Randomly generate 50 bytes of data; (3) Unified setting of ZigBee signal source address and destination address; (4) Adjust the signal carrier frequency to 2.475 GHz and select the number of channels as 25; (5) The frequency of the modulated signal transmitted externally is 1 Hz.
3. The method for constructing a ZigBee radio frequency signal dataset based on YOLOv8 as claimed in claim 1, characterized in that: The step three is specifically as follows: First, the visualized image is divided into a training set and a test set. The target is manually marked according to the intuitiveness of the ZigBee signal in the two-dimensional image. At the same time, the category of the target is set. The category index starts from 0, and the custom dataset label category and quantity are set. Then, modify the data loading yaml configuration file, set model training related parameters such as batch size to 16, epoch to 80, etc., train the model until convergence, and then verify and export the model.
4. The method for constructing a ZigBee radio frequency signal dataset based on YOLOv8 as claimed in claim 1, characterized in that: In the step 5, the final signal output by the model is reduced in dimension and saved and structured into a SigMF format file; Specifically, the specific position of the ZigBee signal in the entire signal sample is determined by the coordinates and length and width of the signal area, and the ZigBee signal sequence is intercepted by one-dimensional expansion and saved in a structured manner in a SigMF format file.
Citation Information
Patent Citations
Signal detection method based on improved YOLOv5
CN116738225A
Method for modulating and identifying signal type by using yolov5 network model
CN117135748A
Radar signal sorting method, system and equipment based on image target detection
CN117348003A
