FG-SSA: Features Gradient-based Signals Selection Algorithm of Linear
  Complexity for Convolutional Neural Networks
Recently, many convolutional neural networks (CNNs) for classification by
time domain data of multisignals have been developed. Although some signals are
important for correct classification, others are not. When data that do not
include important signals for classification are taken as the CNN input layer,
the calculation, memory, and data collection costs increase. Therefore,
identifying and eliminating nonimportant signals from the input layer are
important. In this study, we proposed features gradient-based signals selection
algorithm (FG-SSA), which can be used for finding and removing nonimportant
signals for classification by utilizing features gradient obtained by the
calculation process of grad-CAM. When we define N as the number of signals, the
computational complexity of the proposed algorithm is linear time O(N), that
is, it has a low calculation cost. We verified the effectiveness of the
algorithm using the OPPORTUNITY Activity Recognition dataset, which is an open
dataset comprising acceleration signals of human activities. In addition, we
checked the average 6.55 signals from a total of 15 acceleration signals (five
triaxial sensors) that were removed by FG-SSA while maintaining high
generalization scores of classification. Therefore, the proposed algorithm
FG-SSA has an effect on finding and removing signals that are not important for
CNN-based classification.
Yuto Omae, Yusuke Sakai, Hirotaka Takahashi
FG-SSA: Features Gradient-based Signals Selection Algorithm of Linear Complexity for Convolutional Neural Networks

###### Abstract

Recently, many convolutional neural networks (CNNs) for classification by time domain data of multisignals have been developed. Although some signals are important for correct classification, others are not. When data that do not include important signals for classification are taken as the CNN input layer, the calculation, memory, and data collection costs increase. Therefore, identifying and eliminating nonimportant signals from the input layer are important. In this study, we proposed features gradient-based signals selection algorithm (FG-SSA), which can be used for finding and removing nonimportant signals for classification by utilizing features gradient obtained by the calculation process of grad-CAM. When we define \(n_{\text{s}}\) as the number of signals, the computational complexity of the proposed algorithm is linear time \(\mathcal{O}(n_{\text{s}})\), that is, it has a low calculation cost. We verified the effectiveness of the algorithm using the OPPORTUNITY Activity Recognition dataset, which is an open dataset comprising acceleration signals of human activities. In addition, we checked the average 6.55 signals from a total of 15 acceleration signals (five triaxial sensors) that were removed by FG-SSA while maintaining high generalization scores of classification. Therefore, the proposed algorithm FG-SSA has an effect on finding and removing signals that are not important for CNN-based classification.

_Impact Statement_--Recently, it has become possible to measure various signals, e.g., electroencephalogram, electrocardiogram, acceleration/gyro, ambient signals, and others. This has led to the development of many artificial intelligences for classification using multiple signals as input data. However, some of the multiple signals are not necessary for class estimation. The such signals increase memory resources, computation time, data measurement cost, and using artificial intelligence cost. Therefore, it is better to remove signals that are not necessary for class estimation from the input layer of the artificial intelligence. Therefore, in this study, we devised an algorithm to remove them. By applying this algorithm to a artificial intelligence that performs class estimation from multiple signals, useless signals are removed and a lightweight model can be constructed.

 Convolutional neural network, signal importance, signal selection algorithm

## I Introduction

Recently, many convolutional neural networks (CNNs) have been developed for classification in the time domain of signals [1, 2, 3, 4]. Although these studies used all signals, signals that are not important for correct classification may be included in the CNN input layer. These signals worsen classification accuracy, and increase calculation costs, required memory, and data collection costs. Therefore, finding and removing nonimportant signals from the CNN input layer and creating a classification model for the minimum signals possible are crucial. However, many CNNs use all signals [5, 4, 6] or manually select signals [7, 8].

We can visually find nonimportant signals using grad-CAM embedded in CNNs. Grad-CAM [9] is a method for determining the activated region on input data, and it was proposed by improving the CAM [10]. The method is primarily used to input image data [11, 12, 13, 14, 15]. Cases of applying grad-CAM to CNNs that input time domain data of signals are continuously increasing. For example, classification of the sleep stages [16], prognostication of comatose patients after cardiac arrest [17], classification of schizophrenia and healthy subjects [18], and classification of motor imagery [19] are performed using electroencephalography (EEG) signal(s). Electrocardiogram (ECG) signals are used to detect nocturnal hypoglycemia [20] and predict 1-year mortality [21] have been reported. Acceleration signals have been used to detect hemiplegic gait [22] and human activity recognition [23].

From these studies, we visually find nonimportant signals for correct classification by applying grad-CAM to CNN, inputting the time domain of the signals. However, because one grad-CAM for one input data is generated, observing all of them and finding nonimportant signals is extremely difficult. Therefore, we propose features gradient-based signals selection algorithm (FG-SSA), which can be used to find and remove nonimportant signals from a CNN input layer by utilizing features gradient obtained by the calculation process of grad-CAM. The algorithm provides a signal subset consisting of only important signals. When we define \(n_{\text{s}}\) as the number of all signals, the computational complexity of the proposed algorithm is linear order \(\mathcal{O}(n_{\text{s}})\), that is, FG-SSA has a low calculation cost.

Kim [24] has proposed a group lasso-based algorithm for signal selection. Although this is an effective method, visual insights into the results are difficult because grad-CAM is not used in the calculation process. By contrast, by using the proposed algorithm FG-SSA, we can visually determine the reason the removed signals are not important.
## II Proposed method

### _Specific problem for classification_

We consider a situation in which the task is to estimate a class \(c\) belonging to class set \(\mathbf{C}\) by CNNs from the measurement data of the signal set \(\mathbf{S}\) of size \(n_{\text{s}}\). Some \(n_{\text{s}}\) signals are important for classification, whereas others are not. Therefore, finding a signal subset \(\mathbf{S}_{\text{use}}\) that are removed the nonimportant signals from all signal sets \(\mathbf{S}\) is crucial. In this study, we provide an algorithm for finding such a subset of signals \(\mathbf{S}_{\text{use}}\subseteq\mathbf{S}\). The applicable targets of the proposed method are all tasks of solving classification problems using CNNs inputting the time domain of multisignals. For an easy understanding of the principle of the proposed method, we set a specific classification problem and explain the proposed algorithm.

"OPPORTUNITY Activity Recognition" is the dataset for activity recognition and it is used in "Activity Recognition Challenge" held by IEEE in 2011 [25, 26]. We regard the dataset as reliable because it is used for the performance evaluation of machine learning in some studies [27, 28]. The dataset contains data on multiple inertial measurement units, 3D acceleration sensors, ambient sensors, 3D localization information, etc. Four subjects performed a natural execution of daily activities. The activity annotations include locomotions (e.g., sitting, standing, walking) and left- and right-hand actions (e.g., reach, grasp, release, etc.). Details of the dataset are described in [25, 26].

In this study, we used five triaxial acceleration sensors from all the measurement devices (sampling frequency: 32 [Hz]). Attachment points of sensors on the humans body are "back," "right arm," "left arm," "right shoe," and "left shoe." The total number of signals was 15, because we adopted five triaxial sensors (\(5\times 3=15\)). We adopted data splitting using the sliding window method with window length \(w=60\) and sliding length \(60\). One signal length was approximately 2 s, because the sampling frequency was 32 [Hz]. Searching for the optimal window length size is important because it is a hyperparameter that affects the estimation accuracy [29, 30]. However, because the main objective of this study was to provide a signal-selection algorithm, we did not tune the window length size.

Next, we labeled the motion class label for each dataset based on human activity. The class labels are combinations of locomotions ("Stand," "Walk," "Sit," and "Lie") and three hands activity ("R": moving right hand, "L": moving left hand, and "N": not moving hands). For example, the class label "Sit R" refers to the sitting and right-hand motions.

Table I lists the results of applying the described procedures to all the data. This indicates that the data size of the left-hand motion is small. We consider that nearly all subjects were right-handed (notably, we could not find a description of the subjects' dominant arm in the explanation of the OPPORTUNITY dataset). Moreover, data belonging to Lie R and L are absent. Therefore, these classes were removed from the estimation task; that is, the total number of classes was 10.

Subsequently, we randomly split all the data into a training dataset (80%) and a test dataset (20%). Moreover, we assigned 20% of the training dataset to the validation dataset. The training, validation, and test datasets were independent because we adopted the sliding window method for the same window and slide length (60 steps).

We define the signal set \(\mathbf{S}\), which has 15 elements, and the class set \(\mathbf{C}\), which has 10 elements, as follows:

\[\mathbf{S}=\{\text{Back X},\text{Back Y},\text{Back Z},\] \[\text{Right arm X},\text{Right arm Y},\text{Right arm Z},\] \[\text{Left arm X},\text{Left arm Y},\text{Left arm Z},\] \[\text{Right shoe X},\text{Right shoe Y},\text{Right shoe Z},\] \[\text{Left shoe X},\text{Left shoe Y},\text{Left shoe Z}\}, \tag{1}\] \[\mathbf{C}=\{\text{Stand N},\text{Stand L},\text{Stand R},\] \[\text{Walk N},\text{Walk L},\text{Walk R},\] \[\text{Sit N},\text{Sit L},\text{Sit R},\text{Lie N}\}. \tag{2}\]

In other words, CNNs solve 10 classification problems from 15 multisignals. Moreover, we provide an algorithm for removing nonimportant signals while maintaining the estimation accuracy. Although the sets \(\mathbf{S}\) and \(\mathbf{C}\) represent acceleration signals and human activities, respectively, the proposed algorithm can be used for other diverse signals, such as EEG, ECG, and others.

### _Class estimation_

The CNN structure for class estimation is shown in Figure 1. The data for the input layer are in the form of a matrix \(w\times n_{\text{s}}\). \(w\) is the window length and \(n_{\text{s}}=|\mathbf{S}|\) is the number of signals. In the case of Subsection II-A, the input layer size is a matrix of \(60\times 15\).

Subsequently, the input data are convoluted using kernel filters of the time-directional convolution size \(s_{\text{c}}\). The number of generated feature maps is \(n_{\text{f}}\) because the number of filters is \(n_{\text{f}}\). The reason for adopting only time-directional convolution is to avoid mixing a signal and others in the convolution process. The input data are convoluted by these \(n_{\text{c}}\) convolution layers, and the CNN generates the feature maps shown in the extracted feature maps in Figure 1. Subsequently, the CNN generates the output vector using some fully connected layers
and the SoftMax function. We define the output vector \(\mathbf{y}\) as follows:

\[\mathbf{y}=[y_{c}]\in\mathbb{R}^{|\mathbf{C}|},\ c\in\mathbf{C},\ \sum_{c\in\mathbf{C}}y_{c}=1. \tag{3}\]

The estimation class \(c^{\prime}\) is

\[c^{\prime}=\operatorname*{argmax}_{c\in\mathbf{C}}\ \{y_{c}|c\in\mathbf{C}\}. \tag{4}\]

Herein, we only define the output vector \(\mathbf{y}\) because it appears in the grad-CAM definition. We explain grad-CAM for time domain signals in the next subsection.

### _Time-directional grad-CAM_

We define the vertical size of the feature map before the fully connected layer as \(s_{\mathrm{f}}\), as shown in Figure 1 "Extracted feature maps." Let us denote the \(k\)th feature map of signal \(s\) as

\[\mathbf{f}^{s,k}=[f_{1}^{s,k}\ \ f_{2}^{s,k}\ \ \cdots\ \ f_{s_{\mathrm{f}} }^{s,k}]^{\top}\in\mathbb{R}^{s_{\mathrm{f}}},\] \[s\in\mathbf{S},\ k\in\{1,\cdots,n_{\mathrm{f}}\}. \tag{5}\]

In the case of CNNs for image-data-based classification, the form of feature maps is a matrix. However, in the case of CNNs consisting of time-directional convolution layers, the form of the feature maps is a vector. We define the effect of the feature map \(\mathbf{f}^{s,k}\) on the estimation class \(c^{\prime}\) as

\[\alpha_{c^{\prime}}^{s,k}=\frac{1}{s_{\mathrm{f}}}\sum_{j=1}^{s_{\mathrm{f}} }\frac{\partial y_{c^{\prime}}}{\partial f_{j}^{s,k}}, \tag{6}\]

Then, we can apply the grad-CAM of signal \(s\) to estimation class \(c^{\prime}\) in the vector form of

\[\mathbf{Z}_{c^{\prime}}^{s}=\mathrm{ReLU}\Big{(}\frac{1}{n_{\mathrm{f}}}\sum_{k=1 }^{n_{\mathrm{f}}}\alpha_{c^{\prime}}^{s,k}\mathbf{f}^{s,k}\Big{)},\ \ \mathbf{Z}_{c^{\prime}}^{s}\in\mathbb{R}_{\geq 0}^{s_{ \mathrm{f}}}. \tag{7}\]

The activated region of each signal can be understood by calculating \(\mathbf{Z}_{c^{\prime}}^{s}\) for all signals \(\forall s\in\mathbf{S}\).

In this paper, we refer to \(\mathbf{Z}_{c^{\prime}}^{s}\) as "time-directional grad-CAM" because it is calculated by the summing partial differentiations of time direction. This was defined by a minor change in the basic grad-CAM for image data [9]. In the case of the basic grad-CAM [9], the CNN generates one grad-CAM for one input data. By contrast, in the case of time-directional grad-CAM, CNN generates grad-CAMs as many as the number of signals \(n_{\mathrm{s}}\) for one input data.

Figure 2 shows the examples of \(\mathbf{Z}_{c^{\prime}}^{s}\) calculated using the CNN described in Section IV. From top to bottom, these results correspond to \(c^{\prime}=\operatorname{Stand}\operatorname{N}\operatorname{Stand} \operatorname{L}\operatorname{,Stand}\operatorname{R}\), and Walk N. We can determine the signals that are important by viewing the time-directional grad-CAM shown in Figure 2. For example, signals from the left arm and left shoe are not used for estimating the Stand N class. Moreover, left arm signals are not used for the estimation of the Stand R class. Therefore, the time-directional grad-CAM is effective for finding nonimportant signals.

### _Signals importance index_

Although we can find nonimportant signals by viewing time-directional grad-CAM, the result varies for each input data. Therefore, when the data size is large, viewing all the

Fig. 1: CNN structure for 10 human activities recognition from 15 acceleration signals. We applied the proposed algorithm to this structure.
grad-CAMs is difficult. Herein, we quantify the importance of signal \(s\) for classification based on \(\alpha_{c^{\prime}}^{s,k}\) defined in Equation 6.

Here, we denote the input dataset of size \(n_{\text{dat}}\) as

\[\mathbf{X}=\{\mathbf{X}_{i}|i=1,\cdots,n_{\text{dat}}\},\ \ \mathbf{X}_{i}\in\mathbb{R}^{w \times n_{s}}. \tag{8}\]

The size of \(i\)th input data \(\mathbf{X}_{i}\) is \(w\times n_{\text{s}}\), which is the window length \(w\) and number of signals \(n_{\text{s}}\). When we define the input dataset of estimation class \(c^{\prime}\in\mathbf{C}\) as \(\mathbf{X}_{c^{\prime}}\), we can represent the input dataset \(\mathbf{X}\) as

\[\mathbf{X}=\bigcup_{c^{\prime}\in\mathbf{C}}\mathbf{X}_{c^{\prime}}. \tag{9}\]

Using the set \(\mathbf{X}_{c^{\prime}}\), we define the importance of the signal \(s\in\mathbf{S}\) to the estimation class \(c^{\prime}\in\mathbf{C}\) as

\[L^{s}(\mathbf{X}_{c^{\prime}})=\frac{1}{|\mathbf{X}_{c^{\prime}}|}\sum_{\mathbf{X}_{i}\in \mathbf{X}_{c^{\prime}}}g_{c^{\prime}}^{s}(\mathbf{X}_{i}), \tag{10}\]

where

\[g_{c^{\prime}}^{s}(\mathbf{X}_{i})=\frac{1}{n_{\text{f}}}\sum_{k=1} ^{n_{\text{f}}}\beta_{c^{\prime}}^{s,k}(\mathbf{X}_{i}),\] \[\beta_{c^{\prime}}^{s,k}(\mathbf{X}_{i})=\begin{cases}\alpha_{c^{ \prime}}^{s,k}(\mathbf{X}_{i}),\ \ \text{if}\ \alpha_{c^{\prime}}^{s,k}(\mathbf{X}_{i})\geq 0\\ 0,\ \ \text{otherwise}\end{cases},\] \[\mathbf{X}_{i}\in\mathbf{X}_{c^{\prime}}. \tag{11}\]

In addition, \(\alpha_{c^{\prime}}^{s,k}(\mathbf{X}_{i})\) is \(\alpha_{c^{\prime}}^{s,k}\) of the input data \(\mathbf{X}_{i}\) to grad-CAM, and \(c^{\prime}\) is the estimated class. Therefore, \(L^{s}(\mathbf{X}_{c^{\prime}})\) represents the importance of signal \(s\) to class \(c^{\prime}\) based on the grad-CAM. Notably, to extract the positive effect on classification, we ignore terms with negative partial derivatives, as shown in Equation 11. Moreover, using \(L^{s}(\mathbf{X}_{c^{\prime}})\), we can obtain the matrix

\[\mathbf{I}_{\text{mat}}(\mathbf{X})=[L^{s}(\mathbf{X}_{c^{\prime}})]\in \mathbb{R}_{\geq 0}^{|\mathbf{S}|\times|\mathbf{C}|}\] \[s\in\mathbf{S},c^{\prime}\in\mathbf{C}. \tag{12}\]

We refer to \(\mathbf{I}_{\text{mat}}(\mathbf{X})\) as the "signals importance matrix (SIM)" because the matrix comprises the importance of all signals and classes using the input dataset \(\mathbf{X}\). We can understand the effect of each signal to all classes by calculating and viewing SIM \(\mathbf{I}_{\text{mat}}(\mathbf{X})\).

Although \(\mathbf{I}_{\text{mat}}(\mathbf{X})\) includes important information, summarizing the SIM is necessary to find signals that are not important to all classes. Therefore, by calculating the summation of the row values of SIM, we denote the importance of signal \(s\) as

\[I^{s}(\mathbf{X})=\frac{1}{|\mathbf{C}|}\sum_{c^{\prime}\in\mathbf{C}}I_{ \text{mat}}^{s,c^{\prime}}(\mathbf{X}), \tag{13}\]

where \(I_{\text{mat}}^{s,c^{\prime}}(\mathbf{X})\) is the value of row \(s\) and column \(c^{\prime}\). By calculating \(I^{s}(\mathbf{X})\) for all signals \(s\), we obtain the vector as

\[\mathbf{I}_{\text{vec}}(\mathbf{X})=[I^{s}(\mathbf{X})]\in\mathbb{R}_{\geq 0}^{|\mathbf{S}|}. \tag{14}\]

We refer to \(\mathbf{I}_{\text{vec}}(\mathbf{X})\) as the "signals importance vector (SIV)" because it is the vector that consists of the signal importance.

SIM and SIV are shown in Figure 3. Examples were calculated using the CNN of condition A described in Section IV (see condition A in Section IV). The result of SIM (columns 1 to 10 in Figure 3) includes various important information, for example, the signals Back Z and Right arm X are important for estimating the class Walk R. Moreover, by viewing SIV (the column 11 in Figure 3), we can identify the signals that are important for all classes.

Fig. 2: Examples of time-directional grad-CAMs of 15 acceleration signals for four estimation classes (Stand N, Stand L, Stand R, and Walk N) calculated by the CNN of condition A described in Section IV. The red color represents high activation and the dark blue represents low activation.
From SIV, we denote the minimum important signal \(s_{\min}\) and maximum signal \(s_{\max}\) as

\[(s_{\min},\ s_{\max})=\Big{(}\underset{s\in\mathbf{S}}{\operatorname{ argmin}}\,I^{s}(\mathbf{X}),\ \underset{s\in\mathbf{S}}{\operatorname{argmax}}\,I^{s}(\mathbf{X})\Big{)}. \tag{15}\]

We expect to maintain the estimation accuracy even when removing \(s_{\min}\) because it is a minimum important signal. By contrast, when we remove \(s_{\max}\) and re-learn the CNN, we expect the accuracy to decrease, because it is the most important signal.

### _Signals Selection Algorithm_

In this study, we proposed an algorithm to find a desirable signal subset \(\mathbf{S}_{\rm use}\subseteq\mathbf{S}\) by removing nonimportant signals. The proposed method is presented in Algorithm 1. The main inputs to the algorithm are the training dataset \(\mathbf{X}_{\rm train}\), validation dataset \(\mathbf{X}_{\rm valid}\), and the input signal set \(\mathbf{S}\). To avoid data leakage, the test dataset was not used in the algorithm. The elements of set \(\mathbf{S}\) are the signal identification names defined in Equation 1. The first procedure is to create the initial signal set \(\mathbf{S}_{0}\), which consists of all signals (line 1). The next step is to develop a CNN using the training dataset \(\mathbf{X}_{\rm train}^{\mathbf{S}_{0}}\), which consists of \(\mathbf{S}_{0}\) (line 3). Subsequently, we measure the validation accuracy \(A(\mathbf{X}_{\rm valid}^{\mathbf{S}_{0}})\) using the validation dataset \(\mathbf{X}_{\rm valid}^{\mathbf{S}_{0}}\) (line 4). Next, we determine the most important signal \(s_{\min}\in\mathbf{S}_{0}\) based on Equation 15 (line 5). Finally, we obtain the next signal set \(\mathbf{S}_{1}\) by removing \(s_{\min}\) from \(\mathbf{S}_{0}\) (line 6).

This procedure is repeated until the number of signals reaches one (i.e., \(t=|\mathbf{S}|-1\)), and record validation accuracies. The algorithm returns the signal subset \(\mathbf{S}_{\rm use}\) leading to maximum validation accuracy (lines 8 and 9). Notably, the case wherein the signal subset leading to the maximum accuracy is the initial signal set can occur, that is, \(\mathbf{S}_{\rm use}=\mathbf{S}\). In cases wherein the main purpose is to achieve maximum accuracy, adopting the initial signal set as an optimal subset is a better option, if \(\mathbf{S}_{\rm use}=\mathbf{S}\) occurs. However, some cases exist that require a decrease in the number of signals. Therefore, we prepare constraints wherein the number of adopted signal sizes is \(\gamma\) or less, that is, \(|\mathbf{S}_{\rm use}|\leq\gamma\). This is a hyperparameter of the proposed algorithm.

When the size of the initial signal set \(\mathbf{S}\) is \(n_{\rm s}\), the number

Fig. 3: Example of signals importance to all class expressed by SIM \(\mathbf{I}_{\rm max}(\mathbf{X})\) and SIV \(\mathbf{I}_{\rm vec}(\mathbf{X})\) calculated to CNNs of Condition A described in Section IV. The columns 1 to 10 are SIM and the column 11 is SIV (“All classes”). The values are standardized from zero to one in each column. The greater the cell’s value, the greater is the relevance of signal \(s\) on estimation class \(c^{\prime}\).
of developing CNN in Algorithm 1 is as follows:

\[T(n_{\mathrm{s}}) =n_{\mathrm{s}}-1\] \[\sim n_{\mathrm{s}}. \tag{16}\]

That is, the computational complexity of Algorithm 1 is \(\mathcal{O}(n_{\mathrm{s}})\). This means that even if the signal size \(n_{\mathrm{s}}\) increases, the signal subset is returned in realistic time.

Generally, the total pattern for choosing \(m\) from \(n\) signals is \({}_{n}\mathrm{C}_{m}\). Because \(m\), the number of signals leading to the maximum validation accuracy, is not known, the total number of combinations of input layers \(T_{\mathrm{bs}}(n_{\mathrm{s}})\) is similar to

\[T_{\mathrm{bs}}(n_{\mathrm{s}}) =\sum_{m=1}^{n_{\mathrm{s}}}{}_{n_{\mathrm{s}}}\mathrm{C}_{m}\] \[\sim\max_{m}{}_{n_{\mathrm{s}}}\mathrm{C}_{m}\] \[={}_{n_{\mathrm{s}}}\mathrm{C}_{\lfloor n_{\mathrm{s}}/2\rfloor}. \tag{17}\]

Therefore, finding the optimal signal subset using a brute-force search is difficult. The computation time tends to be large because the CNN includes many other hyperparameters. From this viewpoint, a fast algorithm such as the proposed method is important.

## III Experiment 1: Relationship between validation accuracy and the number of deleted signals

### _Objective and outline_

Herein, we examine the reliability of \(s_{\mathrm{min},\;\mathrm{max}}\) defined in Equation 15. We expect to maintain estimation accuracy even if the signal \(s_{\mathrm{min}}\) is removed because it is the most nonimportant signal. By contrast, because signal \(s_{\mathrm{max}}\) is the most important signal, the estimation accuracy may decrease by removing it. To verify the aforementioned hypothesis, we gradually removed signal \(s_{\mathrm{min},\;\mathrm{max}}\) using the processes of lines 2 to 7 of Algorithm 1. In addition, we repeatedly developed CNNs and recorded their validation accuracies. We performed verification using a total of 100 seeds because CNN depends on randomness. The adopted layer structure of the CNN is explained in the Appendix section; the number of epochs was 300.

### _Result and discussion_

First, we indicate the validation accuracies when the most nonimportant signal, \(s_{\mathrm{min}}\), is gradually removed, as shown in Figure 4 (A). From left to right in Figure 4 (A), the number of deleted signals increases, that is, the number of signals in the CNN input layer decreases. The leftmost result is obtained using all signals, and the rightmost result is obtained by using only one signal as the CNN input layer. The results show that even if six signals were deleted, the validation accuracy did not decrease. Moreover, by removing seven or more signals, the accuracy decreases significantly. In this case, although CNNs estimate class labels from 15 signals in the set \(\mathbf{S}\), six signals appear unnecessary.

We calculated the average removed timings of the 15 signals to determine the unnecessary signals. The result is shown in Figure 4 (b). This means that the lower the value, the earlier the signal is removed in the procedure of Algorithm 1. The results indicate that the signals of the right and left shoes are removed earlier than those of the other sensors. By contrast, some signals from the back, right arm, and left arm did not disappear early. Therefore, we can regard shoe signals as unimportant for classification. In addition, shoe sensors seem important for walk motion classification. However, even if shoe sensors disappear, we consider that the back sensor attached to centroids of the human body contributes to the classification of walk motions because these motions are periodic.

Next, we indicate the validation accuracies when the most important signal, \(s_{\mathrm{max}}\), is gradually removed in Figure 5 (a). We can verify that the validation accuracy statistically decreases by removing one of the most important signals. Therefore, we consider that removing the most important signal, \(s_{\mathrm{max}}\) leads to a worse accuracy. The average timing of the signal removal is shown in Figure 5 (b). From this figure, we confirm that the signals of back X, right arm X, and left arm Y are removed early. Moreover, we confirm that shoe sensor signals are not removed early. These tendencies are in contrast compared with the case of removing the most nonimportant signal \(s_{\mathrm{min}}\).

Clearly, (1) even if we remove the most nonimportant signal \(s_{\mathrm{min}}\), the estimation performance tends to remain, and (2) when we remove the most important signal \(s_{\mathrm{max}}\), the performance tends to decrease. Therefore, we regard the signal importance \(I^{s}(\mathbf{X})\) defined in Equation 13 as reliable.

## IV Experiment 2: Effectiveness of FG-SSA on generalization scores

### _Objective and outline_

Herein, we confirm the effect of FG-SSA indicated in Algorithm 1 on the generalization performance of the classification. Therefore, we develop the following three conditions for CNNs.

* Condition A: CNN using all signals, i.e., FG-SSA is not used.
* Condition B: CNN for applied FG-SSA of \(\gamma=n_{\mathrm{s}}\).
* Condition C: CNN for applied FG-SSA of \(\gamma=9\).

Condition A means that the CNN does not remove signals but uses all signal sets \(\mathbf{S}\). Condition B refers to the CNN use the signal subset \(\mathbf{S}_{\mathrm{use}}\) obtained by the FG-SSA, given \(n_{\mathrm{s}}\) as the constraint parameter \(\gamma\). Under this condition, when maximum validation accuracy is achieved using all signal sets \(\mathbf{S}\), we allow the algorithm to return \(\mathbf{S}\) as \(\mathbf{S}_{\mathrm{use}}\). In other words, a case wherein no signals are removed can occur. Condition C implies that the number of adopted signals is nine or less for a CNN input layer, that is, \(|\mathbf{S}_{\mathrm{use}}|\leq 9\). In other words, six or more signals were deleted, because the initial number of signals was 15. The value of hyper-parameter \(\gamma=9\) was determined by referring to the result shown in Figure 4 (A).

We developed CNNs using the signal set, which was determined by FG-SSA. Moreover, the optimal epochs leading to a maximum validation accuracy were adopted. The search range of epochs was from 1 to 300. Subsequently, the generalization
performance is measured using the test dataset. The test dataset was used only at this time, that is, it was not used for the parameter search. To remove the randomness effect, we developed CNNs for Conditions A, B, and C with a total of 100 seeds.

### _Result and discussion_

By developing CNNs under conditions A, B, and C on a total of 100 seeds, the average number of signals used was 15.00, 11.94, and 8.35, respectively. In other words, an average of 3.06 and 6.65 signals were removed by FG-SSA in the cases of Condition B and C, respectively. The generalization performance (F score, precision, and recall) measured by the test dataset for each condition is shown in Figure 6. These are histograms of 100 CNNs developed using 100 random seeds.

The results indicated that the generalization scores were nearly the same for conditions A, B, and C. Moreover, \(p\) values of the two-sided \(t\)-test were not statistically significant. Next, we show the confusion matrices obtained by CNNs for each condition in Figure 7. The values were averaged by 100 seed results and standardized, where the summation in each row was 1. Consequently, the confusion matrices were nearly the same. Although the proposed algorithm removed some signals, generalization errors did not increase. Therefore, we consider FG-SSA has the effect of finding and removing signals that are not important for CNN-based classification.

From another viewpoint, the number of correct classifications of left hand motions (Stand L, Walk L, and Sit L) was small in all conditions. We adopted weighted cross-entropy-based learning for CNNs because the original data size of the left hand motions is small, as indicated in Table I. However, we consider that an appropriate classification cannot be performed because the data diversity of these motions is low. Although we believe that nearly all subjects are right-handed, the explanation of subjects' dominant arm in the OPPORTUNITY dataset is insufficient to the best of our

Fig. 4: (A) Maximum validation accuracy in 300 epochs when the most nonimportant signal \(s_{\mathrm{min}}\) is gradually removed and CNNs are re-learned. (B) Average removed timings of each signal. It means the smaller the timing, the earlier the signal is removed. The results of both (A) and (B) are average values of 100 seeds, and the error bars are standard deviations. The \(p\) values in (A) represent the results of two-sided \(t\) test, and the dashed line represents the timing of statistically decreasing validation accuracy.

Fig. 5: (A) Maximum validation accuracy in 300 epochs when the most important signal \(s_{\mathrm{max}}\) is gradually removed and CNNs are re-learned. (B) Average removed timings of each signal. In contrast to that shown in Figure 4, the most important signals are removed.
knowledge.

## V Conclusion, limitations, and future works

In this paper, we describe the following two topics to find and remove nonimportant signals for CNN-based classification.

* (1) The signals importance indices SIM \(\mathbf{I}_{\rm mat}(\mathbf{X})\) and SIV \(\mathbf{I}_{\rm vec}(\mathbf{X})\) are explained in Subsection II-D.
* (2) The algorithm of the linear complexity \(\mathcal{O}(n_{\rm s})\) for obtaining the signals subset \(\mathbf{S}_{\rm use}\) from the initial signals set \(\mathbf{S}\) by finding and removing nonimportant signals (see Algorithm 1).

Although the proposed algorithm performed well in the case of the OPPORTUNITY dataset, it had some limitations. This is explained in the following sections. Future work will confirm these findings.

* (A) The results described in this paper is obtained from limited cases. Although we assume that the algorithm can be applied to other than acceleration signals, e.g., EEG, ECG, and others, it is not validated.
* (B) In this experiment, the initial signals set size was 15.

Fig. 6: Histograms of estimation score using the test dataset (total 100 seeds). The macro averages of 10 classes of F score, precision, and recall from left to right, and Conditions A, B, and C from top to bottom.

Fig. 7: Confusion matrices of the conditions A, B, and C using the test dataset. Values are averaged by results of 100 seeds. The values are standardized wherein the summation in each row is one.
The number of signals may be much higher depending on some situations. It is important to determine the relationship between the number of nonimportant signals and effectiveness of FG-SSA.
* (C) We assume that the algorithm may extract the signals subset weighted specific target class by providing class weights to the signal importance \(I^{s}(\mathbf{X})\) defined in Equation 13. In other words, we denote the importance of signal \(s\) weighted classes as \[I^{s}(\mathbf{X};\mathbf{w})=\frac{1}{|\mathbf{C}|}\sum_{c^{\prime}\in\mathbf{C}}w^{c^{\prime}}I ^{s,c^{\prime}}_{\rm mat}(\mathbf{X}),\] (18) where \(w^{c^{\prime}}\) denotes the weight of class \(c^{\prime}\) and \(\mathbf{w}\) denotes the class weight vector, defined as follows: \[\mathbf{w}=[w^{c^{\prime}}]\in\mathbb{R}^{|\mathbf{C}|},\ \text{s.t.,}\ \sum_{c^{\prime}\in\mathbf{C}}w^{c^{\prime}}=1.\] (19) We note that the algorithm based on \(I^{s}(\mathbf{X};\mathbf{w})\) can return the signals subset weighted specific classes. However, this effect is not confirmed in this paper. This will be studied in the future.

## Appendix: Layers structure of CNNs

The CNNs layer structure is illustrated in Figure 1. First, an input layer exists for inputting \(w\times n_{\rm s}\) size data (\(w\): window length, \(n_{\rm s}\): the number of signals). Then, \(n_{\rm c}=3\) convolution layers exist to generate \(n_{\rm f}\) feature maps using kernel filters of convolution size \(s_{\rm c}\). The convolutions are only in the direction of time. Next, the generated feature maps are transformed into a vector form by the flattened layer. Vector dimensions are gradually reduced to 200, 100, and 50. Finally, an output vector \(\mathbf{y}\) of 10 dimensions is generated, and classification is performed. The total number of CNN layers is nine (one input layer, three convolution layers, four dense layers, and one output layer). The activation function of each layer is ReLu.

We performed a hyperparameter search for convolution size \(s_{\rm c}\) and the number of kernel filters \(n_{\rm f}\) and learning rate \(r\). In particular, CNNs were trained using the training and validation datasets described in Subsection II-A and 300 epochs. We adopted a weighted cross-entropy-based loss function based on the inverse values of class sample sizes because the sample sizes of each class are imbalanced, as listed in Table I.

The parameter candidates are as follows:

\[s_{\rm c} \in\{5,10,15\},\] \[n_{\rm f} \in\{5,10\},\] \[r \in\{10^{-3},10^{-4}\}. \tag{20}\]

The combination of hyperparameters leading to the maximum validation accuracy was \((s_{\rm c},n_{\rm f},r)=(10,10,10^{-4})\) (accuracy: 0.726). Therefore, we adopted these parameters because all CNNs appeared in this study. Although CNNs have many other hyperparameters, we refrained from excessive tuning because the main purpose of this study is to provide and confirm the signal-selection algorithm.
