## 4 CNN-Based Signal Classification Model
### Data Collection  
Before the network training, a data set must be collected first for model training and training effect evaluation. This article uses hardware equipment to generate signals for testing and data acquisition. The equipment selection is as follows:  
We select TP-Link mini wireless router node TL-WR802N as WiFi equipment, which main control chip is Qualcomm QCA9533. It follows IEEE802.11n standard, and runs in AP mode by default, transmission power <20 dbm. The photos of the TL-WR802N and the time-frequency image are in Figure 13.  
We select the E18-TBL-01 module produced by EBYTE as ZigBee equipment. The main control chip of the module is IT's CC2530 chip, which integrates an enhanced 8051 CPU, follows the IEEE802.15.4 standard. Transmit power can set as 4.5/20/27 dBm. The module works in broadcast mode by default. The photos of the E18-TBL-01 and the time-frequency image are in Figure 14.  
The Bluetooth equipment uses Social Retail's iBeacon node, and the main control chip is IT's CC2541 Bluetooth chip. The iBeacon carries on BLE broadcasting whose frame period is 500 ms, and transmission power is 0 dBm. The photos of the Bluetooth iBeacon and the time-frequency image are in Figure 15.  
We choose a spacious environment for signal acquisition and to ensure that there was no interference signals. In order to monitor possible external interference sources at the test area (such as other Wi-Fi equipment), we used Rohde & Schwarz's FSH8 spectrum analyzer which is shown in Figure 16. Figure 17 shows the spectrum analyzer detection result measured in two ways: (a) using the max hold mode to measure the maximum level within a period of time; and (b) using the clear/write mode, observe whether there is a jump on the 2.4 G spectrum. Perform interference detection before each experiment to check external interference, so as to avoid results bias.  
Figure 14: ZigBee equipment: (**a**) photo of E18-TBL-01; (**b**) ZigBee signal time-frequency image.  
Figure 13: WiFi equipment: (**a**) photo of TL-WR802N; (**b**) WiFi signal time-frequency image.  
If we acquire signal time-frequency images at the same time, the acquired image should only contain low-power noise signal and USRP device thermal noise which is shown in Figure 18.  
Figure 16: Rohde and Schwarz FSH8 Spectrum Analyzer.  
Figure 17: Interference signal detection result by spectrum analyzer: (**a**) max hold model detection result; (**b**) clear/write model detection result.  
Figure 15: Bluetooth equipment: (**a**) photo of iBeacon node; (**b**) Bluetooth signal time-frequency image.  
After confirming no external interference sources in the experimental environment, place the signal source equipment and turn on the signal acquisition system to collect time-frequency images under different signal combinations. The number of each type of node in the working state is variable, and should include all the signal combinations which is better in conformity with practical channel environment. Three types of signals can enumerate seven types of signal combination situations, as shown in Figure 19. If the number of working signal source can change at the same time, the combination will be more complicated, so we do not list them one by one here.  
We chose all situations in the Figure 19 above as data set labels, and each label collected at least 200 pictures. In the actual acquisition process, images with weak signal characteristics or no signal at all will appear, and these poor-quality data need to be manually eliminated. Finally, we use 80% of the data set as the training set, 20% as the validation set, and collect other 20 images for each type of label as the test set. Figure 20 shows a part of the data set.  
Figure 19: Types of signal combinations.  
Figure 20: Part of the data set.