Patient trials were conducted in which a subject alternated between periods of relaxation, motion, normal activity, and cognitive stress, which was induced by strenuous mental arithmetic. Data was collected by the soft sternal patch simultaneously with Muse 2, a marketed stress detector device. In order to determine the heart’s kinetic energy, the Hilbert analytic envelope was calculated from the filtered SCG data to elucidate the generating power of the signal. This envelope is shown for a representative experiment in Fig 3(a). For the same experiment, the Muse stress shows very minimal change, as shown in Fig 3(b). For the soft patch, the change in cardiac kinetic energy is clear, indicating a large change in stress, whereas this change is negligible or non-existent in the competitor. Next, a machine learning algorithm was trained on this data to automatically classify cognitive stress. First, scalogram images were generated from the Morse wavelet family to understand the power contained in each frequency bin of the signal as a function of time. These frequency contents change markedly with the changes in sternal vibrations and were used as input to the machine learning algorithm. Scalograms were preferred to traditional spectrograms because they are capable of modifying their resolution to match each frequency bin, whereas spectrograms are not well suited to signals with large variations in signal content, like that seen in SCG. For the machine learning implementation, a deep CNN based on residual connections was used to classify these 30 second scalograms into either motion, stress, or normal function, as shown in Fig 3(c). The residual connections were implemented because traditional CNNs can suffer from vanishing gradients, whereas residual networks sacrifice additional complexity and time to train for massive improvement performances in very deep networks(He). These residual connections are shown in Fig 3(d), where the initial layer is fed forward directly to the output for each layer. When trained on 6 datasets collected from 3 subjects, the algorithm demonstrated substantial ability to differentiate between classes, as shown in Fig 3(e-f). These images were generated by forward propagating the neural weights onto a white noise image to visualize the differences in activations, and the stress (e) and normal (f) classes are activated by very different weights. Finally, the algorithm demonstrated very high accuracy when trained on 70% of the data, holding 15% for 4-fold-crossvalidation and 15% for training, as shown in Fig 3(g). The overall accuracy is above 94%, and there were no false alarm events observed. This accuracy is very high, especially considering the lack of competitive alternatives in the market.
Fig 3. Machine learning implementations for classifying stress. a, Hilbert analytic envelope of heart’s kinetic energy divided into three stages. b, EEG output from Muse 2, a marketed stress detector device divided into three stages. c, RNN implementation for stress detection, with an example input image of SCG data during an stress transformed via wavelet element analysis. d, The recurrent node, which forms the building block of the RNN algorithm. e-f, Deep activations showing the highly preferred features for both (e) stress and (f) relax state. g, Confusion matrix demonstrating very high classification accuracy of 94.5%.