# Classification of Respiratory States Using Spectrogram with Convolutional Neural Network
## 3 Proposed Method  
The proposed method visualizes the signal of the respiration state obtained from the UWB radar in both the time and the frequency domains and classifies the respiration state using an artificial neural network. The overall flow chart for apnea detection and respiration classification based on a convolutional neural network considering the visualization of respiration consists of three steps, as shown in Figure 3.  
First, a visualized data set is created based on the time domain and the frequency domain through the segmentation, overlap, and frequency analysis of the respiration state signal input in the pre-processing process. Through the frequency analysis of the divided time domain, it is possible to extract features that consider both the local and global features of the respiration signal and visualize it. Second, in the parameter estimation step, learning is performed based on a training set. Finally, in the last step, the respiration state is classified as a validation set in the state estimation step. The classifier uses a CNN suitable for image classification. In the proposed method, we present the difference between the method of system transformation of the entire feature presented by previous studies and the method of feature visualization presented in this paper. The visualization of the respiratory state periodically represents the frequency change in the input respiratory state signal. The respiratory conditions used were normal breathing, apnea, and normal breathing during a speaking activity. The actual image that visualizes the characteristics of the respiration state acquired by the radar sensor for 60 s is shown in Figure 4. The difference in the visualization image can be confirmed according to the characteristics of the respiration state. The feature visualization method used a spectrogram. As shown in Figure 4, the color red represents a high level of signal power, and the color blue stands for a low level of signal power. Thus, the spectrogram shows the distribution of signal power of different frequencies. Figure 3: Suggested respiration state classification—overall flow chart. If the amount of variation in the respiratory signal is small (or no variation), it means that the signal has a low-frequency value or it is close to 0, and it is determined as apnea. Normal respiration, a visualization model with relatively high-frequency values, is shown in Figure 4a. In the case of the existence of apnea, a spectrogram is shown in Figure 4b. In Figure 4c, the low-frequency values are distributed as similar in the case of normal respiration. The visualized respiration states show a difference in the frequency domain and a pattern of change with time when apnea occurs. For this manner of apnea detection, it is important to change the frequency value over time and not to conduct just a simple frequency analysis. The proposed method constructs a learning-based classifier using a visualization method that considers the regional characteristics of the respiration status and classifies apnea detection and respiration status. Section 3 describes the process in detail, from feature visualization to respiration state classification. A Fourier transform (FT) decomposes an input signal into a sum of sine waves. It is a technique actively used to analyze specific signals in signal and image processing as well as communication fields. The frequency domain Fourier transforms the respiration state for the input time domain into an input value in the frequency domain. The proposed method uses a fast Fourier transform that reduces the number of operations based on the Fourier transform. The fast Fourier transform equation used in the input signal of the respiration state is as follows (1):  
\[X(f)=\prod_{n=0}^{N-1}x(t)e^{-i2\pi ft} \tag{1}\]  
The respiration signals in the time domain used in the experiments are also represented in the frequency domain using the fast Fourier transform.