# Car-Sense: Vehicle Occupant Legacy Hazard Detection Method Based on DFWS
## 4 Method Design
### Personnel Status Identification
The target geographic area is usually divided into several rectangular grids, and at each grid point, the data fingerprint is obtained by sampling the data over a period of time. Based on the distribution characteristics of Wi-Fi signals in a certain area, the location in the actual environment is associated with the signal \"fingerprint\" of the current location, and a location corresponds to a signal characteristic. The next step is to determine the current position based on the signal characteristics. In this paper, we divide the interior space of the vehicle into a 2*2 grid, as shown on the left side of Figure 8. Using the Received Signal Strength Indicator (\(RSSI\)) [5] as a feature of the signal and constructing a location fingerprint library \(S\) in the offline phase, \(S\) can be expressed as:

\[S=[RSSI_{11},\ RSSI_{12},\ RSSI_{21},\ RSSI_{22}] \tag{5}\]

where \(RSSI_{ij}\) denotes the \(RSSI\) signal data sampled and processed by the person at row \(i\), \(i\in\{1,\ 2\}\), on the grid at column \(j,j\in\{1,\ 2\}\). The difference in the waveforms of the RSSI data can be clearly seen on the right side of Figure 8. We use this difference in features of different time-domain signals to build a fingerprint library and store it on the cloud platform. The system also uses a clustering algorithm to implement a classifier and arrange it on the cloud and uses the computed probability that the signal features belong to a certain distribution (stored in the fingerprint library) to estimate the location of the person. Next, after the wireless signal of the location information of the personnel inside the vehicle is collected at the side end of the online \begin{table}
\begin{tabular}{c c} \hline \hline
**Classification Algorithm** & **Parameters** \\ \hline KNN & K = 3 \\ \hline SVM & C = 1, kernel = ‘RBF’, degree = 3, gamma = ‘auto’ \\ \hline MLP & Number of hidden layer nodes [32; 16; 4] \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Parameters of the three classification algorithms. stage, the target location is located in real-time with the help of the model of the cloud platform, i.e., the classifier is used to classify the target location and obtain the result. ## 5 Experimentation and Evaluation

### Experimental Setup

**Prototype. ** Two ESP32 development boards are used as the main devices in this experiment. The integrated Wi-Fi modules support 802.11 b/g/n protocols, operate at 2.4 GHz with a bandwidth of up to 40 MHz, and can support external antennas to provide higher signal gain. The devices are equipped with ESP32-CSI-Tool [19] tools as RX and TX in the sensing environment, respectively. Moreover, they are equipped with independent power supply modules, so they can normally work for a long time even when the power supply is not available, and they are well prepared for possible power outages when the system is in operation. When the system is running, firstly, RX establishes WLAN LAN, TX connects to the LAN and sends packets to the gateway (RX) at a certain rate, RX parses the required wireless signal data such as CSI and RSSI in the received packets, performs noise reduction in real-time, extracts the amplitude characteristics of the optimal subcarriers to the cloud platform equipped with machine learning models for content recognition, and finally, feeds the recognition results back to TX for real-time results. **Data collection. ** The size layout of the interior space varies depending on the vehicle model and is affected by the multipath effect [20]. So, for this experiment, we conducted it in a general sedan (five seats), as shown in Figure 9. In the above environment, five different personnel situations are set up: no one, one person, two persons, three persons, and four persons. Moreover, the population of people included both large adults and small children. Data were collected continuously for 20 min in each case as offline training data.