# A Lightweight Convolutional Neural Network Method for Two-Dimensional PhotoPlethysmoGraphy Signals
## 2 Methods
### Two-Dimensional Signal Transformation Methods  
Although various deep learning algorithms, such as 1D-CNN and LSTM, have been developed to handle one-dimensional time series data like PPG signals, two-dimensional images possess a wealth of spatial information and structural characteristics. Leveraging deep learning methods for feature extraction can effectively capture edge detection, corner identification, and other informative details, ultimately improving learning efficiency. Hence, the conversion of one-dimensional PPG signals into two-dimensional images is indispensable.  
Figure 1: Overall methodology flowchart for identity authentication using PPG signals.  
This paper adopts the Markov Transition Field (MTF) method to transform the one-dimensional PPG signals into two-dimensional images. MTF is an image encoding technique that uses the Markov transition matrix to encode time series data. It treats the temporal evolution of the time series as a Markov process, where the future state depends solely on the present state, independent of the past states. By constructing the Markov transition matrix to reflect this concept, we encode time series data as images by extending it into a Markov Transition Field. The main steps involved in this process are as follows:  
1. Divide the time series data equally into Q different quantile bins and label these quantile bins from 1 to Q in sequence.
2. Replace each data point in the time series with its bin number.
3. Calculate the transfer frequency between each quantile bin along the time axis of the time series as a 1 st-order Markov chain and construct a Q \(\times\) Q transfer matrix W accordingly, as shown in Formula (1). In this matrix, the element \(\omega_{\text{ij}}\) represents the transition frequency from quantile bin i to quantile bin j. The transition matrix provides quantitative information about the quantile bin transition patterns in the time series. \[\text{W}=\begin{bmatrix}\omega_{11}&\cdots&\omega_{\text{1Q}}\\ \omega_{21}&\cdots&\omega_{\text{2Q}}\\ \vdots&\ddots&\vdots\\ \omega_{\text{Q1}}&\cdots&\omega_{\text{QQ}}\end{bmatrix}\text{s.t.}\sum_{ \text{j}}\omega_{\text{ij}}=1\] (1)
4. In the Markov transfer field, \(x_{1}\) to \(x_{\text{N}}\) are elements in the time series, \(q_{\text{i}}\) and \(q_{\text{j}}\) are quantile intervals of time steps i and j, respectively, and the transfer probability from \(q_{\text{i}}\) to \(q_{\text{j}}\) is \(M_{\text{ij}}\). Considering each probability of time position arrangement, the Markov transfer matrix W is extended to the Markov transfer field M, as shown in Formula (2). \[\text{M}=\begin{bmatrix}\text{M}_{11}&\cdots&\text{M}_{\text{1Q}}\\ \text{M}_{21}&\cdots&\text{M}_{\text{2Q}}\\ \vdots&\ddots&\vdots\\ \text{M}_{\text{Q1}}&\cdots&\text{M}_{\text{QQ}}\end{bmatrix}=\begin{bmatrix} \omega_{\text{ij}}|X_{1}\ \in q_{\text{j}},\ X_{1}\ \in q_{\text{j}}&\cdots&\omega_{\text{ij}}|X_{1}\ \in q_{\text{j}},\ X_{\text{N}}\ \in q_{\text{j}}\\ \omega_{\text{ij}}|X_{2}\ \in q_{\text{j}},\ X_{1}\ \in q_{\text{j}}&\cdots& \omega_{\text{ij}}|X_{2}\ \in q_{\text{j}},\ X_{\text{N}}\ \in q_{\text{j}}\\ \vdots&\ddots&\vdots\\ \omega_{\text{ij}}|X_{\text{N}}\ \in q_{\text{j}},\ X_{1}\ \in q_{\text{j}}& \cdots&\omega_{\text{ij}}|X_{\text{N}}\ \in q_{\text{j}},\ X_{\text{N}}\ \in q_{\text{j}}\end{bmatrix}\] (2)  
This paper uses the peak detection method to split the long-segment PPG signal into independent single-cycle signals. Then, the single-cycle signals are used as input for the neural network model. During the segmentation process, all abnormal single-cycle signals are eliminated to ensure the accuracy and reliability of subsequent analysis. Subsequently, these single-period signals were successfully converted into two-dimensional images with a size of 28 \(\times\) 28 using the Markov transfer field method, as shown in Figure 2.  
Figure 2: Conversion of one-dimensional data to two-dimensional.