Sequential three-way decisions with a single hidden layer feedforward
  neural network
The three-way decisions strategy has been employed to construct network
topology in a single hidden layer feedforward neural network (SFNN). However,
this model has a general performance, and does not consider the process costs,
since it has fixed threshold parameters. Inspired by the sequential three-way
decisions (STWD), this paper proposes STWD with an SFNN (STWD-SFNN) to enhance
the performance of networks on structured datasets. STWD-SFNN adopts
multi-granularity levels to dynamically learn the number of hidden layer nodes
from coarse to fine, and set the sequential threshold parameters. Specifically,
at the coarse granular level, STWD-SFNN handles easy-to-classify instances by
applying strict threshold conditions, and with the increasing number of hidden
layer nodes at the fine granular level, STWD-SFNN focuses more on disposing of
the difficult-to-classify instances by applying loose threshold conditions,
thereby realizing the classification of instances. Moreover, STWD-SFNN
considers and reports the process cost produced from each granular level. The
experimental results verify that STWD-SFNN has a more compact network on
structured datasets than other SFNN models, and has better generalization
performance than the competitive models. All models and datasets can be
downloaded from https://github.com/wuc567/Machine-learning/tree/main/STWD-SFNN.
Youxi Wu, Shuhui Cheng, Yan Li, Rongjie Lv, Fan Min
# Sequential three-way decisions with a single hidden layer feedforward neural network

###### Abstract

The three-way decisions strategy has been employed to construct network topology in a single hidden layer feedforward neural network (SFNN). However, this model has a general performance, and does not consider the process costs, since it has fixed threshold parameters. Inspired by the sequential three-way decisions (STWD), this paper proposes STWD with an SFNN (STWD-SFNN) to enhance the performance of networks on structured datasets. STWD-SFNN adopts multi-granularity levels to dynamically learn the number of hidden layer nodes from coarse to fine, and set the sequential threshold parameters. Specifically, at the coarse granular level, STWD-SFNN handles easy-to-classify instances by applying strict threshold conditions, and with the increasing number of hidden layer nodes at the fine granular level, STWD-SFNN focuses more on disposing of the difficult-to-classify instances by applying loose threshold conditions, thereby realizing the classification of instances. Moreover, STWD-SFNN considers and reports the process cost produced from each granular level. The experimental results verify that STWD-SFNN has a more compact network on structured datasets than other SFNN models, and has better generalization performance than the competitive models. All models and datasets can be downloaded from [https://github.com/wuc567/Machine-learning/tree/main/STWD-SFNN](https://github.com/wuc567/Machine-learning/tree/main/STWD-SFNN).

keywords: network topology, hidden layer node, sequential three-way decisions, granular level, sequential thresholds +
Footnote †: journal: Information Sciences

## 1 Introduction

Neural networks [6; 17; 21] are the mathematical models that simulate the connection structure of brain neurons. They have been widely implemented in applications, including video frame inpainting [33] and automatic driving [31]. The performance of neural networks is mainly affected by hyperparameter selection and network topology. Hyperparameter selection [3; 4] is a classical topic in machine learning, which can be realized by grid search [26; 32] and particle swarm optimization [1; 24]. In addition, network topology [2; 30; 42] is the key of neural network design, which can be realized through three-way decisions [7] and an incremental learning mechanism [10; 15; 40].

To achieve an effective network structure, three-way decisions with a single hidden layer feedforward neural network (TWD-SFNN) [7] adopts a novel model to guide the number of hidden layer nodes. In addition, as a shallow neural network model, TWD-SFNN provides a new perspective for the topology design of multilayer neural networks, hence laying the theoretical foundation for the framework of deep learning. However, for practical applications, TWD-SFNN has two drawbacks: (i) in terms of the performance of TWD-SFNN, the generalization ability of TWD-SFNN needs to be further improved; and (ii) to analyze the relationship between the costs and number of hidden layer nodes more thoroughly, the process costs of TWD-SFNN need to be considered.

To improve the generalization ability of neural networks on structured datasets, and further enrich the theoretical framework of deep learning, we employ sequential three-way decisions to guide the growth of the network topology.
The sequential three-way decisions (STWD) [28; 38; 46] is a kind of progressive granular computing [9; 25; 48], which realizes the multi-stage learning from coarse to fine by constructing granular levels. Specifically, STWD makes deterministic decisions for only a few instances at the coarse-grained granular level. With the addition of information, the decision of the remaining instances is gradually realized at the finer level. Recently, STWD has been applied to medical treatment [8], face recognition [19], and attribute reduction [27].

To obtain a better performance, we propose a model called STWD with a single hidden layer feedforward neural network (STWD-SFNN). STWD-SFNN enhances the learning ability of the SFNN and ensures the compactness of the network structure. The differences between TWD-SFNN and STWD-SFNN are as follows. Although TWD-SFNN has the multi-granularity property, the process costs produced from granular levels are not investigated in the development discipline of costs. On the other hand, although TWD-SFNN has the sequential property, it partitions the instances by adopting the constant threshold parameters when a new hidden layer node is added, making it difficult to focus on more difficult-to-classify instances. The contributions of this paper are as follows.

1. To improve the generalization ability of TWD-SFNN, we employ the STWD scheme to optimize the structure of SFNN, and propose a new approach called STWD-SFNN.
2. STWD-SFNN handles the easy-to-classify instances by adopting strict conditions. As the number of hidden layer nodes increases, STWD-SFNN addresses the difficult-to-classify instances by adopting loose conditions until all instances can be classified.
3. The experimental results show that the network structure of STWD-SFNN is significantly better than other SFNN models, and STWD-SFNN has better accuracy and weighted-f1 performance than the competitive models.

The remainder of the paper is organized as follows. Section 2 introduces the preliminaries. Section 3 describes the STWD-SFNN model. Section 4 analyzes the performance of STWD-SFNN, and Section 5 presents the conclusions.

## 2 Preliminaries

In this section, we briefly introduce the training of SFNN with focal loss and Adam optimizer, the TWD-SFNN model, and the STWD model.

### Training SFNN with focal loss and Adam optimizer

The parameters connected to the hidden layer are one of the factors affecting the performance of SFNN [5]. Therefore, the focal loss and Adam optimizer for network parameters are introduced as follows.

Since the labels in the classification dataset may have category imbalance, to better deal with the practical problems, the loss function of SFNN adopts the focal loss [49], which also makes the model focus more on the difficult-to-classify instances in training, and is calculated according to Equation (1).

\[L_{\text{FL}}=\left\{\begin{array}{ll}-\delta(1-\hat{y})^{\theta}log\hat{y} &y=+1\\ -(1-\delta)\hat{y}^{\theta}log(1-\hat{y})&y=-1\end{array}\right. \tag{1}\]

where \(\hat{y}\) is the predicted value of the neural network; \(\delta\) is a factor that balances the proportion of positive and negative labels; and \(\theta\) (\(\theta\geq 0\)) is a parameter that adjusts the weight reduction rate of easy-to-classify instances, and the greater the \(\theta\), the greater the weight reduction rate. In this paper, \(\delta\) is the ratio of the number of each label to the total number of labels, and \(\theta\) is set to two which is the same as [7]. In addition, to prevent the overfitting of SFNN, the cost function is calculated according to Equation (2).

\[L_{\text{NN}}=L_{\text{FL}}+\frac{\lambda_{\text{SFNN}}}{2}\times(\|\mathbf{ W}_{1}\|^{2}+\|\mathbf{b}_{1}\|^{2}+\|\mathbf{W}_{2}\|^{2}+\|\mathbf{b}_{2}\|^{2}) \tag{2}\]

where \(\lambda_{\text{SFNN}}\) is a regularization factor of SFNN; \(\mathbf{W}_{1}\) and \(\mathbf{b}_{1}\) are the weight and bias connecting the input layer to the hidden layer of SFNN, respectively; \(\mathbf{W}_{2}\) and \(\mathbf{b}_{2}\) are the weight and bias from the hidden layer to the output layer of SFNN, respectively.

Since the gradient of network parameters may have oscillation in the optimization, to better optimize \(\mathbf{W}_{1}\), \(\mathbf{b}_{1}\),\(\mathbf{W}_{2}\), and \(\mathbf{b}_{2}\), SFNN selects the Adam optimizer [14]. Without loss of generality, we take \(\mathbf{W}_{1}\) as an example which is calculated according to Equation (3).
\[\begin{split}\mathbf{V}^{(h)}_{\text{dW}_{1}}&=\rho_{1} \times\mathbf{V}^{(h-1)}_{\text{dW}_{1}}+(1-\rho_{1})\times\text{d}\mathbf{W}^{( h)}_{1}\\ \mathbf{S}^{(h)}_{\text{dW}_{1}}&=\rho_{2}\times \mathbf{S}^{(h-1)}_{\text{dW}_{1}}+(1-\rho_{2})\times(\text{d}\mathbf{W}^{(h)}_ {1})^{2}\\ \hat{\mathbf{V}}^{(h)}_{\text{dW}_{1}}&=\frac{ \mathbf{V}^{(h)}_{\text{dW}_{1}}}{1-\rho^{(h)}_{1}}\\ \hat{\mathbf{S}}^{(h)}_{\text{dW}_{1}}&=\frac{ \mathbf{S}^{(h)}_{\text{dW}_{1}}}{1-\rho^{(h)}_{2}}\\ \mathbf{W}^{(h)}_{1}&=\mathbf{W}^{(h-1)}_{1}-\mu \times\frac{\hat{\mathbf{V}}^{(h)}_{\text{dW}_{1}}}{\sqrt{\mathbf{S}^{(h)}_{ \text{dW}_{1}}}+\tau}\end{split} \tag{3}\]

where \(\mathbf{V}^{(h)}_{\text{dW}_{1}}\) and \(\mathbf{S}^{(h)}_{\text{dW}_{1}}\) are updated first-order momentum estimates and second-order momentum estimates of \(\mathbf{W}_{1}\), respectively; \(\hat{\mathbf{V}}^{(h)}_{\text{dW}_{1}}\) and \(\hat{\mathbf{S}}^{(h)}_{\text{dW}_{1}}\) are deviation corrections of \(\mathbf{V}^{(h)}_{\text{dW}_{1}}\) and \(\mathbf{S}^{(h)}_{\text{dW}_{1}}\), respectively; \(\mathbf{W}^{(h)}_{1}\) is the updated value of \(\mathbf{W}_{1}\) at the \(h\)-th moment; \(\rho_{1}\) and \(\rho_{2}\) denote the exponential decay rate of the first-order and second-order momentum estimates, respectively; \(\mu\) is the learning rate; \(\tau\) is used to avoid that the denominator of \(\mathbf{W}^{(h)}_{1}\) is zero, and \(\tau\) is set to \(10^{-8}\). For convenience, we mark \(\mathbf{W}^{(h)}_{1}\) returned by Adam as \(\overline{\mathbf{W}}_{1}\). To update the parameters of the rest network, we replace \(\mathbf{W}_{1}\) in Equation (3) with \(\mathbf{b}_{1}\), \(\mathbf{W}_{2}\), and \(\mathbf{b}_{2}\).

### Twd-Sfnn

TWD-SFNN [7] adopts the trisecting-and-acting model [34, 43, 44] to find the number of hidden layer nodes. In essence, TWD-SFNN is a model for dealing with the binary classification problem. Suppose we have a binary classification dataset \(\{\mathbf{x}_{i},\mathbf{y}_{i}\}_{i=1}^{d}\), where \(\mathbf{x}_{i}=(\mathbf{x}_{i1},\mathbf{x}_{i2},\cdots,\mathbf{x}_{im})^{ \mathbf{T}}\in\mathbf{R}^{m}\), \(\mathbf{y}_{i}\in\{+1,-1\}\). We also suppose that TWD-SFNN has total \(d\) instances and \(u\) (\(1\leq u\leq d\)) unclassified instances, where the unclassified instances are the instances that are partitioned into the region of boundary (BND), and \(u\) is the total number of instances minus the total number of instances classified into the regions of positive(POS) and negative(NEG). TWD-SFNN considers the total expected risk of classifying \(u\) instances.

\[\begin{split} Risk_{\text{TWD-SFNN}}&=\min_{(\alpha,\beta),\alpha\gamma}\biggl{(}\sum_{\begin{subarray}{c}i=1\\ p_{o}=\alpha,p_{o}>\gamma\end{subarray}}^{u_{p}}\lambda_{PP}\times p_{o}+ \lambda_{PN}\times(1-p_{o})\\ +\varepsilon\times\sum_{\begin{subarray}{c}i=1\\ p_{o}=\alpha\end{subarray}}^{u_{p}}\lambda_{BP}\times p_{k}+\lambda_{BN} \times(1-p_{k})\\ +\sum_{\begin{subarray}{c}i=1\\ p_{j}=\alpha,p_{j}>\gamma\end{subarray}}^{u_{p}}\lambda_{NP}\times p_{j}+ \lambda_{NN}\times(1-p_{j})\biggr{)}\\ \text{s.t.}&\quad 0<\beta<\gamma<\alpha<1,\quad\varepsilon\geq 1, \quad u=u_{p}+u_{b}+u_{n}\end{split} \tag{4}\]

where \(\varepsilon\) is a penalty factor and \(\varepsilon\geq 1\); \(p_{e}\) is the conditional probability that the \(e\)-th (\(1\leq e\leq u\)) instance belongs to the positive labels set \(Y\), i.e., \(p_{e}=\frac{|Y|\in\{x_{e}\}|}{\|x_{e}\|}\), \(\{x_{e}\}\) is the equivalent class of the \(e\)-th instance, and the equivalence class is a set of instances with the same features; \(u_{p}\), \(u_{b}\), and \(u_{n}\) are the numbers of instances partitioned into POS, BND, and NEG, respectively; \(\lambda_{sP}\) and \(\lambda_{sN}\) are the costs of decision-making when instances belong to the POS and NEG, respectively; \((\alpha,\beta,\gamma)\) are the thresholds, and can be calculated as follows.
\[\alpha = \frac{\lambda_{PN}-\lambda_{BN}}{(\lambda_{PN}-\lambda_{BN})+( \lambda_{BP}-\lambda_{PP})} \tag{5}\] \[\beta = \frac{\lambda_{BN}-\lambda_{NN}}{(\lambda_{BN}-\lambda_{NN})+( \lambda_{NP}-\lambda_{BP})}\] (6) \[\gamma = \frac{\lambda_{PN}-\lambda_{NN}}{(\lambda_{PN}-\lambda_{NN})+( \lambda_{NP}-\lambda_{PP})} \tag{7}\]

To meet the requirements of the three-way decisions on data types, TWD-SFNN adopts \(k\)-means\(++\) to discretize the numerical data into categorical data. When the number of misclassification instances is more than that of clusters specified in \(k\)-means\(++\), \(\alpha\) and \(\beta\) are employed and the classification criteria are as follows.

(P) if \(p_{e}\geq\alpha\), then \([x_{e}]\in\text{POS}(Y)\);

(B) if \(\beta<p_{e}<\alpha\), then \([x_{e}]\in\text{BND}(Y)\);

(N) if \(p_{e}\leq\beta\), then \([x_{e}]\in\text{NEG}(Y)\).

Whereas when the number of instances in the misclassification set is no more than these clusters specified in \(k\)-means\(++\), \(\gamma\) is adopted in TWD-SFNN and the classification criteria are as follows.

(P) if \(p_{e}\geq\gamma\), then \([x_{e}]\in\text{POS}(Y)\);

(N) if \(p_{e}<\gamma\), then \([x_{e}]\in\text{NEG}(Y)\).

TWD-SFNN settles the penalty factor \(\varepsilon(\varepsilon\geq 1)\) in the decision-making risk function, which means that TWD-SFNN can avoid too many training instances being classified into BND, so as to avoid the overfitting of the model. In addition, if BND is not empty, it is necessary to increase the number of hidden layer nodes of TWD-SFNN until BND is empty.

### Stwd

The sequential strategy is an essential application of multi-granularity [22; 23] to three-way decisions. As information continues to be added and updated, a comprehensive decision-making scheme of STWD is gradually developed. STWD [35; 36; 47] relies on the idea of multi-granularity hierarchical processing. STWD has a decision table [27] which is defined as \(S=(U,A=C\cup D,V=\{V_{a}\mid a\in A\},I=\{I_{a}\mid a\in A\})\), where \(U\) is a universe; \(A\) is an attribute set; \(C\) is a conditional attribute set, and \(D\) is a decision attribute set. For any attribute \(a\), \(V_{a}\) is the conditional attribute value, and \(I_{a}\) is the corresponding decision attribute value.

Suppose \(U\) has \(t\) granular levels, denoted by \(\{1,2,\cdots,t\}\), which are added from the first level to the \(t\)-th level step by step. Given a state set \(\{X,\neg X\}\), an action set \(\{a_{P},a_{B},a_{N}\}\), where \(X\) and \(\neg X\) represent different states that the instance \(x\) belongs to \(X\) and \(\neg X\), respectively; \(a_{P}\), \(a_{B}\), and \(a_{N}\) represent the accepted decision-making, the delayed decision-making, and the rejected decision-making, respectively. We suppose that when \(x\in X\) at the \(i\)-th (\(1\leq i\leq t\)) level, \(\lambda_{PP}^{(i)}\), \(\lambda_{BP}^{(i)}\), and \(\lambda_{NP}^{(i)}\) represent the losses caused by taking \(a_{P}\), \(a_{B}\), and \(a_{N}\), respectively, while \(\lambda_{PN}^{(i)}\), \(\lambda_{BN}^{(i)}\), and \(\lambda_{NN}^{(i)}\) represent the corresponding losses when \(x\in\neg X\) at the \(i\)-th level. Thus, under the action of \(a_{P}\), \(a_{B}\), and \(a_{N}\), the expected losses at the \(i\)-th level of STWD are shown as follows.

\[R^{(i)}(a_{P}\mid[x]_{R}) = \lambda_{PP}^{(i)}\times p^{(i)}(X\mid[x]_{R})+\lambda_{PN}^{(i)} \times p^{(i)}(\neg X\mid[x]_{R}) \tag{8}\] \[R^{(i)}(a_{B}\mid[x]_{R}) = \lambda_{BP}^{(i)}\times p^{(i)}(X\mid[x]_{R})+\lambda_{BN}^{(i)} \times p^{(i)}(\neg X\mid[x]_{R})\] (9) \[R^{(i)}(a_{N}\mid[x]_{R}) = \lambda_{NP}^{(i)}\times p^{(i)}(X\mid[x]_{R})+\lambda_{NN}^{(i)} \times p^{(i)}(\neg X\mid[x]_{R}) \tag{10}\]

where \(p^{(i)}(X\mid[x]_{R})\) and \(p^{(i)}(\neg X\mid[x]_{R})\) represent the conditional probability that the equivalent class \([x]_{R}\) at the \(i\)-th (\(1\leq i\leq t\)) level belongs to \(X\) and \(\neg X\), respectively. For convenience, we mark \(p^{(i)}(X\mid[x]_{R})\) as \(p^{(i)}\). According to Bayes decision criterion, the following optimal classification decision rules can be obtained.

(P) If \(R^{(i)}(a_{P}\mid[x]_{R})\leq R^{(i)}(a_{B}\mid[x]_{R})\) and \(R^{(i)}(a_{P}\mid[x]_{R})\leq R^{(i)}(a_{N}\mid[x]_{R})\), then \(x\in\text{POS}^{(i)}(X)\) ;

(B) If \(R^{(i)}(a_{B}\mid[x]_{R})\leq R^{(i)}(a_{P}\mid[x]_{R})\) and \(R^{(i)}(a_{B}\mid[x]_{R})\leq R^{(i)}(a_{N}\mid[x]_{R})\), then \(x\in\text{BND}^{(i)}(X)\) ;

(N) If \(R^{(i)}(a_{N}\mid[x]_{R})\leq R^{(i)}(a_{P}\mid[x]_{R})\) and \(R^{(i)}(a_{N}\mid[x]_{R})\leq R^{(i)}(a_{B}\mid[x]_{R})\), then \(x\in\text{NEG}^{(i)}(X)\).

Furthermore, STWD has a total order relationship over granular levels [44], i.e., \([x]_{R_{1}}\leq[x]_{R_{2}}\leq\cdots\leq[x]_{R_{t}}\), where \([x]_{R_{1}}\) and \([x]_{R_{t}}\) are the equivalent class of instance \(x\) calculated at the coarse-grained level and the fine-grained level, respectively. Moreover, STWD has a conditional probability \(p^{(i)}\) and thresholds \((\alpha_{i},\beta_{i})\) (\(1\leq i\leq t-1\)) for the previous
\(t\)-1 levels and also has a conditional probability \(p^{(t)}\) and a threshold \(\gamma\) at the \(t\)-th level. These parameters satisfy the following conditions.

\[0<\beta_{1}\leq\beta_{2}\leq\cdots\leq\beta_{t-1}<\gamma<\alpha_{t-1}\leq\cdots \leq\alpha_{2}\leq\alpha_{1}<1\]

Compared with \((\alpha_{i},\beta_{i})\), STWD at least increases the range of POS and NEG regions when adopting \((\alpha_{i+1},\beta_{i+1})\). Accordingly, the BND of STWD will be smaller and smaller at the (\(i\)+1)-th granular level. It indicates that the sequential thresholds of STWD gradually realize the classification of the delay decision region, thereby completing the partition of whole instances.

Since STWD learns three-way decision-making from the first level to the (\(t\)-1)-th level, given the \(i\)-th (\(1\leq i\leq t-1\)) granular level \(L_{i}\), \(L_{i}\) can be classified into three disjoint regions:

\[\text{POS}_{(\alpha_{i},\beta_{i})}(Y)=\{x\in U_{i}\mid p^{(t)} \geq_{i}\alpha_{i}\} \tag{11}\] \[\text{BND}_{(\alpha_{i},\beta_{i})}(Y)=\{x\in U_{i}\mid\beta_{i} <_{i}p^{(t)}<_{i}\alpha_{i}\}\] (12) \[\text{NEG}_{(\alpha_{i},\beta_{i})}(Y)=\{x\in U_{i}\mid p^{(t)} \leq_{i}\beta_{i}\} \tag{13}\]

where \(\text{POS}_{(\alpha_{i},\beta_{i})}(Y)\), \(\text{BND}_{(\alpha_{i},\beta_{i})}(Y)\), and \(\text{NEG}_{(\alpha_{i},\beta_{i})}(Y)\) are the POS, BND, and NEG at the \(i\)-th level, respectively. As the number of levels increases, \(\text{BND}_{(\alpha_{i},\beta_{i})}(Y)\) becomes smaller. However, if \(\text{BND}_{(\alpha_{t-1},\beta_{t-1})}(Y)\neq\varnothing\), STWD carries out two-way decisions at the \(t\)-th level, which means that the region in the \(t\)-th level \(L_{t}\) is partitioned into two disjoint regions.

\[\text{POS}_{(\gamma)}(Y)=\{x\in U_{t}\mid p^{(t)}\geq\gamma\} \tag{14}\] \[\text{NEG}_{(\gamma)}(Y)=\{x\in U_{t}\mid p^{(t)}<\gamma\} \tag{15}\]

## 3 Proposed model

In this section, we propose STWD-SFNN which dynamically determines the number of hidden layer nodes by adopting granularity levels and sequential thresholds to improve the performance of network topology. To show the difference between SFNN and STWD-SFNN, Figs. 1 and 2 show the framework of SFNN and STWD-SFNN, respectively. The network topology of SFNN refers to the number of hidden nodes \(z\), and we calculate hidden nodes \(z\) according to the empirical formula methods. However, these methods for determining network topology lack a reliable theoretical basis. Therefore, we propose STWD-SFNN to dynamically determine the number of hidden nodes. As shown in Fig. 2, STWD-SFNN adopts the sequence of STWD to guide the growth of network topology. Moreover, Fig. 3 illustrates the granulation of STWD-SFNN from coarse to fine.

Firstly, if the instances contain numerical features, such as light and humidity in Fig. 2, we adopt \(k\)-means++ [18] to discretize the numerical data to meet the requirements of STWD for data types. Secondly, we initialize the network topology with one hidden layer node and get correctly classified instances, i.e., \(\text{P}_{\text{N}}^{(i)}\) and \(\text{N}_{\text{N}}^{(i)}\), and misclassification instances \(\text{M}_{\text{N}}^{(i)}\). Thirdly, we calculate the conditional probability of the instances belonging to the positive labels and the thresholds \((\alpha_{i},\beta_{i})(1\leq i\leq t-1)\) of the \(i\)-th level. If the conditional probability is no less than \(\alpha_{i}\), the instances are classified into \(\text{P}_{\text{L}}^{(i)}\), if the conditional probability is not greater than \(\beta_{i}\), they are partitioned into \(\text{N}_{\text{L}}^{(i)}\); otherwise, they are classified into \(\text{B}_{\text{L}}^{(i)}\). It means that the information of the \(i\)-th level is not enough to support STWD-SFNN to make decisions, and a hidden layer node is added based on the current network topology, and the above process is repeated

Figure 1: Framework of SFNN
at the (\(i\)+1)-th level. To prevent the overfitting of STWD-SFNN, when \(\text{B}_{\text{L}}^{(t-1)}\) is not empty, we adopt the threshold \(\gamma\) at the \(t\)-th level. If the conditional probability is no less than \(\gamma\), the instances are classified into \(\text{P}_{\text{L}}^{(t)}\); otherwise, they are partitioned into \(\text{N}_{\text{L}}^{(t)}\). Finally, we have the regions of POS, BND, and NEG after \(t\) turns of STWD-SFNN.

### Related definitions

Suppose the granular levels of STWD-SFNN traverse from one to \(t\). Accordingly, the maximum number of hidden layer nodes of STWD-SFNN is \(t\).

**Definition 1**.: Suppose there is a decision table with a number of hidden layer nodes

\[T=(U,A=C\cup D,V=\{V_{a}\mid a\in A\},I=\{I_{a}\mid a\in A\},H)\]

where \(U\), \(A\), \(C\), \(D\), \(V\), and \(I\) have the same meanings as in Section 2.3; \(H\) is a set composed of the hidden layer nodes, i.e., \(H=\{h_{1},h_{2},\cdots,h_{t}\}\) and \(h_{i}\) is the \(i\)-th (\(1\leq i\leq t\)) hidden layer node added.

According to STWD, we have a action set \(\{a_{P},a_{B},a_{N}\}\), which can classify the instances into POS, BND, and NEG, respectively. Hence, we have the following definitions.

Figure 3: Sequential thresholds of STWD-SFNN

Figure 2: Framework of STWD-SFNN. STWD-SFNN has two parts: discretion modular and training modular. If the instances contain numerical features, discretion modular adopts \(k\)-means++ to convert numerical data into discrete data to meet the requirements of STWD for data types. The training modular has \(t\) levels. Each level has two parts: SFNN and STWD. SFNN is a network topology with one hidden layer node and gets correctly classified instances, i.e., \(\text{P}_{\text{N}}^{(t)}\) and \(\text{N}_{\text{N}}^{(t)}\), and misclassification instances \(\text{M}_{\text{N}}^{(t)}\). The first \(t\)-1 part of STWD utilizes the strategy of three ways, and the last part applies the strategy of two ways.
**Definition 2**.: Suppose \(T\) has \(t\) granular levels, the result cost matrix for the \(i\)-th (\(1\leq i\leq t\)) granular level is

\[\mathbf{\Lambda}^{(i)}=\begin{pmatrix}\lambda^{(i)}_{PP}&\lambda^{(i)}_{BP}& \lambda^{(i)}_{NP}\\ \lambda^{(i)}_{PN}&\lambda^{(i)}_{BN}&\lambda^{(i)}_{NN}\end{pmatrix}\]

where \(\lambda^{(i)}_{PP}\), \(\lambda^{(i)}_{BP}\), and \(\lambda^{(i)}_{NP}\) are the result costs of taking actions \(a_{P}\), \(a_{B}\), and \(a_{N}\) for the positive labels, respectively; while \(\lambda^{(i)}_{PN}\), \(\lambda^{(i)}_{BN}\), and \(\lambda^{(i)}_{NN}\) are the costs of taking actions \(a_{P}\), \(a_{B}\), and \(a_{N}\) for the negative labels, respectively. It should be noted that the various elements of \(\mathbf{\Lambda}^{(i)}\) at \(i\)-th level need to satisfy \(0\leq\lambda^{(i)}_{PP}<\lambda^{(i)}_{BP}<\lambda^{(i)}_{NP}<1\), \(0\leq\lambda^{(i)}_{NN}<\lambda^{(i)}_{BN}<\lambda^{(i)}_{PN}<1\), and \((\lambda^{(i)}_{BN}-\lambda^{(i)}_{NN})\times(\lambda^{(i)}_{BP}-\lambda^{(i) }_{PP})\).

**Example 1**.: _Suppose STWD-SFNN has three granular levels, i.e., \(t\) = 3. According to the conditions satisfied by the loss function, i.e., \(0\leq\lambda^{(i)}_{PP}<\lambda^{(i)}_{BP}<\lambda^{(i)}_{NP}<1\), \(0\leq\lambda^{(i)}_{NN}<\lambda^{(i)}_{BN}<\lambda^{(i)}_{PN}<1\), and \((\lambda^{(i)}_{BN}-\lambda^{(i)}_{NN})\times(\lambda^{(i)}_{BP}-\lambda^{(i) }_{PP})<(\lambda^{(i)}_{PN}-\lambda^{(i)}_{BN})\times(\lambda^{(i)}_{NP}-\lambda ^{(i)}_{BP})\), we can achieve the results by randomizing the elements of the result cost matrix in the range of [0,1) at the first granular level, i.e., \(\mathbf{\Lambda}^{(1)}=\begin{bmatrix}0&0.1506&0.9021\\ 0.4592&0.1249&0\end{bmatrix}\). Meanwhile, the result costs at the other two granular levels are \(\mathbf{\Lambda}^{(2)}=\begin{bmatrix}0&0.4617&0.5962\\ 0.6740&0.1344&0\end{bmatrix}\) and \(\mathbf{\Lambda}^{(3)}=\begin{bmatrix}0&0.3626&0.7064\\ 0.7664&0.3727&0\end{bmatrix}\), respectively._

**Definition 3**.: Suppose \(T\) has \(t\) granular levels, the thresholds \((\alpha_{i},\beta_{i})\) of the \(i\)-th (\(1\leq i\leq t-1\)) level are

\[\alpha_{i} =\frac{\lambda^{(i)}_{PN}-\lambda^{(i)}_{BN}}{(\lambda^{(i)}_{PN} -\lambda^{(i)}_{BN})+(\lambda^{(i)}_{BP}-\lambda^{(i)}_{PP})} \tag{16}\] \[\beta_{i} =\frac{\lambda^{(i)}_{BN}-\lambda^{(i)}_{NN}}{(\lambda^{(i)}_{BN }-\lambda^{(i)}_{NN})+(\lambda^{(i)}_{NP}-\lambda^{(i)}_{BP})} \tag{17}\]

**Definition 4**.: Suppose \(T\) has \(t\) granular levels, the threshold \(\gamma\) of the \(t\)-th granular level is

\[\gamma=\frac{\lambda^{(t)}_{PN}-\lambda^{(t)}_{NN}}{(\lambda^{(t)}_{PN}- \lambda^{(t)}_{NN})+(\lambda^{(i)}_{NP}-\lambda^{(i)}_{PP})} \tag{18}\]

**Example 2**.: _In this example, we adopt the result cost matrices in Example 1. According to Definitions 3 and 4, the thresholds of STWD-SFNN at each granular level are (\(\alpha_{1},\beta_{1}\)) = (0.6894, 0.1425), (\(\alpha_{2},\beta_{2}\)) = (0.5389, 0.5016), and \(\gamma\) = 0.5204, respectively. Since the thresholds of STWD-SFNN satisfy \(\beta_{1}<\beta_{2}<\gamma<\alpha_{2}<\alpha_{1}\), we retain the result cost matrices of STWD-SFNN at each granular level. It should be noted that if the thresholds of STWD-SFNN do not meet the sequential property at a certain granular level, we need to reinitialize the result cost matrix at the corresponding level._

**Definition 5**.: Suppose \(T\) has \(t\) granular levels, the regions of POS, BND, and NEG after \(t\) turns are denoted as follows

\[\text{POS}=\bigcup_{i=1}^{t}\lvert\text{IP}_{\text{N}}^{(i)}\cup \text{P}_{\text{L}}^{(i)}\rvert \tag{19}\] \[\text{BND}=\text{M}_{\text{N}}^{(t)}\cup\text{B}_{\text{L}}^{(t)}\] (20) \[\text{NEG}=\bigcup_{i=1}^{t}\lvert\text{N}_{\text{N}}^{(t)}\cup \text{N}_{\text{L}}^{(t)}\rvert \tag{21}\]

where \(\text{P}_{\text{N}}^{(t)}\) and \(\text{P}_{\text{L}}^{(t)}\) represent the set of instances classified into POS by SFNN and STWD at the \(i\)-th turn, respectively; \(\text{M}_{\text{N}}^{(t)}\) and \(\text{B}_{\text{L}}^{(t)}\) represent the set of instances misclassified by SFNN and the set of instances partitioned into BND by STWD at the \(t\)-th turn, respectively; \(\text{N}_{\text{N}}^{(i)}\) and \(\text{N}_{\text{L}}^{(i)}\) represent the set of instances classified into NEG by SFNN and STWD at the \(i\)-th turn, respectively. Since the threshold \(\gamma\) corresponding to the \(t\)-th level can classify the instances of \(\text{B}_{\text{L}}^{(t)}\) into \(\text{P}_{\text{L}}^{(t)}\) and \(\text{N}_{\text{L}}^{(t)}\), we have \(\text{BND}=\varnothing\) at the \(t\)-th turn.

To describe the process costs of granularity [16, 45], STWD-SFNN considers the test cost and delay cost [11, 37, 39].
**Definition 6**.: Suppose \(T\) has \(t\) granular levels, the process cost at the \(t\)-th level is marked as \(Cost_{\text{P}_{i}}\), and

\[Cost_{\text{P}_{i}}=(Cost_{\text{PT}_{i}},Cost_{\text{PD}_{i}}) \tag{22}\]

\[Cost_{\text{PT}_{i}}=\sum_{i=1}^{t}m_{i}\times Cost_{\text{PT}_{i}} \tag{23}\]

\[Cost_{\text{PD}_{i}}=\max_{i=1,2,\cdots,t}m_{i}\times Cost_{\text{PPD}_{i}} \tag{24}\]

where \(Cost_{\text{PT}_{i}}\) and \(Cost_{\text{PD}_{i}}\) represent the test cost and delay cost at the \(t\)-th granular level, respectively; \(m_{i}\) is the number of instances at the \(i\)-th (\(1\leq i\leq t\)) level and \(m_{i}>0\); \(Cost_{\text{PPT}_{i}}\) and \(Cost_{\text{PPT}_{i}}\) are the unit test cost and the unit delay cost at the \(i\)-th (\(1\leq i\leq t\)) level, respectively. It should be noted that when BND is not empty, the model continues to add a new turn of learning which produces the test and delay costs. Since the costs of test and delay are both positive real numbers and \(m_{i}>0\), the unit test cost and the unit delay cost need to satisfy \(Cost_{\text{PPT}_{i}}>0\) and \(Cost_{\text{PPD}_{i}}>0\), respectively. Meanwhile, since the dataset has no data on unit test cost and unit delay cost, and \(m_{i}\) gradually decreases as the model learns, to facilitate the observation of the more general correlation between the costs of test and delay and the granular layers, we can generate unit test costs and unit delay costs randomly and incrementally in the range of positive real numbers.

**Example 3**.: _Suppose we have a two-class classification dataset with 10 instances shown in Table 1, where the training data is \(\{x_{1},x_{2},x_{3},x_{4},x_{5},x_{6}\}\), the validation data is \(\{x_{7},x_{8}\}\), and the testing data is \(\{x_{9},x_{10}\}\). Suppose STWD-SFNN has at most three granular levels, and the unit test cost and unit delay cost at each level are \([Cost_{\text{PPT}_{1}},Cost_{\text{PPT}_{2}},Cost_{\text{PPT}_{3}}]=[1,2,3]\) and \([Cost_{\text{PPD}_{1}},Cost_{\text{PPD}_{2}},Cost_{\text{PPD}_{3}}]=[1,2,3]\), respectively. The calculation of test cost and delay cost is as follows. The instances classified into \(\text{P}_{\text{L}}^{(1)}\), \(\text{B}_{\text{L}}^{(1)}\), and \(\text{N}_{\text{L}}^{(1)}\) at the first granular level are \(\varnothing\), \(\{x_{4},x_{5}\}\), and \(\{x_{1}\}\), respectively. Meanwhile, suppose the two instances \(\{x_{4},x_{5}\}\) are partitioned into \(\text{N}_{\text{L}}^{(2)}\) at the second level (Details will be shown in Section 3.3). Thus, STWD-SFNN has two granular levels, since \(\text{B}_{\text{L}}^{(2)}\) is empty. Hence, \(Cost_{\text{PT}_{1}}\)= 3 \(\times\) 1 = 3 and \(Cost_{\text{PD}_{1}}\) = 3 \(\times\) 1 = 3 at the first level according to Definition 6. Similarly, \(Cost_{\text{PT}_{2}}\) = 3 \(\times\) 1 + 2 \(\times\) 2 = 7 and \(Cost_{\text{PD}_{2}}\) = max (3 \(\times\) 1, 2 \(\times\) 2) = 4 at the second level._

### STWD-SFNN model

To prevent the overfitting of STWD-SFNN, we consider the \(L_{2}\) regularization factor of the loss function in SFNN and the penalty factor \(\varepsilon\) of the risk function in STWD. Hence, STWD-SFNN has three parts: preprocessing of data, SFNN, and STWD.

#### 3.2.1 Preprocessing of data

The instances processed by STWD [41] are usually categorical data, such as teachers and doctors. However, numerical data, such as the temperature and humidity of the weather, need to be processed to meet the calculation requirements of STWD. Therefore, \(k\)-means++ [18] is adopted to discretize the numerical data into the categorical data. Firstly, we randomly select one instance as the initial clustering center. Secondly, we calculate the distance between the cluster center and the remaining instances, and calculate the probability that each instance is selected as the next cluster center. Then, the next clustering center is selected according to the roulette method, and the discretization process is stopped until \(k\) clustering centers are found. Finally, the instances in each cluster are discretized into the same category.

\begin{table}
\begin{tabular}{c c c c c c} \hline  & \(a_{1}\) & \(a_{2}\) & \(a_{3}\) & \(a_{4}\) & D \\ \hline \(x_{1}\) & 0.7415 & 0.5407 & 0.5795 & 0.9009 & 2 \\ \(x_{2}\) & 0.6844 & 0.3210 & 0.0471 & 0.3700 & 1 \\ \(x_{3}\) & 0.7718 & 0.0912 & 0.4874 & 0.5308 & 1 \\ \(x_{4}\) & 0.0818 & 0.4263 & 0.0354 & 0.0621 & 1 \\ \(x_{5}\) & 0.5596 & 0.4643 & 0.3585 & 0.3189 & 2 \\ \(x_{6}\) & 0.6397 & 0.6535 & 0.7739 & 0.6809 & 1 \\ \(x_{7}\) & 0.7425 & 0.0989 & 0.7429 & 0.4131 & 1 \\ \(x_{8}\) & 0.9419 & 0.5958 & 0.4474 & 0.7536 & 2 \\ \(x_{9}\) & 0.4992 & 0.2212 & 0.9525 & 0.4176 & 1 \\ \(x_{10}\) & 0.2990 & 0.4796 & 0.1559 & 0.7456 & 2 \\ \hline \end{tabular}
\end{table}
Table 1: Two-class dataset
#### 3.2.2 Sfnn

Suppose STWD-SFNN contains \(u\) (\(1\leq u\leq d\)) unclassified instances. Firstly, we randomly generate the network parameters with \(i\)-th hidden layer node, including \(\mathbf{w}_{1}^{(i)}\), \(\mathbf{b}_{1}^{(i)}\), \(\mathbf{w}_{2}^{(i)}\), and \(\mathbf{b}_{2}^{(i)}\). To guarantee the repeatability of the experimental results, we set the seed of the random number generator to mg(0). Secondly, we adopt the focal loss function to guide the forward propagation learning, and calculate the learning results with the current network parameters. Thirdly, we apply the Adam optimizer to guide the error backpropagation, adaptively find the optimal network parameters, including \(\mathbf{\overline{w}}_{1}^{(i)}\), \(\mathbf{\overline{b}}_{1}^{(i)}\), \(\mathbf{\overline{w}}_{2}^{(i)}\), and \(\mathbf{\overline{b}}_{2}^{(i)}\). Finally, STWD-SFNN with topology of \(i\)-th hidden layer node yields the positive instances \(\mathrm{P}_{\mathrm{N}}^{(i)}\), the misclassification instances \(\mathrm{M}_{\mathrm{N}}^{(i)}\), and the negative instances \(\mathrm{N}_{\mathrm{N}}^{(i)}\), where the misclassification instances are also called the difficult-to-classify instances.

#### 3.2.3 Stwd

For the difficult-to-classify instances in the network, we first count the label equivalence class \(Y\) that the instances belong to the positive labels and the instance equivalence class \([x]_{e}^{(i)}\). Next, we calculate the conditional probability that the instances belong to the positive labels according to Equation (25).

\[p_{e}^{(i)}=\frac{\left|Y\cap[x]_{e}^{(i)}\right|}{\left|[x]_{e}^{(i)}\right|} \tag{25}\]

In addition, according to Definitions 2 and 3, we can index the result cost matrix \(\mathbf{\Lambda}^{(i)}\) and the thresholds \((\alpha_{i},\beta_{i})\) at the \(i\)-th (\(1\leq i\leq t-1\)) level. Since the risk varies in different regions, STWD-SFNN considers the total decision risk associated with classifying \(u\) instances. The risk is calculated according to Equation (26).

\[\begin{split} Risk^{(i)}&=\min_{(\alpha_{i},\beta_{ i})}\Bigg{(}\sum_{\stackrel{{ m=1}}{{p_{e}^{(i)}\times p_{e}^{(i)}}}}^{u_{p}}\lambda_{PP}^{(i)}\times p _{o}^{(i)}+\lambda_{PN}^{(i)}\times(1-p_{o}^{(i)})\\ &+\varepsilon\times\sum_{\stackrel{{ i=1}}{{p_{e}^{(i)}\times p_{e}^{(i)}}}}^{u_{b}}\lambda_{ BP}^{(i)}\times p_{k}^{(i)}+\lambda_{BN}^{(i)}\times(1-p_{k}^{(i)})\\ &\qquad+\sum_{\stackrel{{ j=1}}{{p_{j}^{(i)}\times p _{k}}}}^{u_{n}}\lambda_{NP}^{(i)}\times p_{j}^{(i)}+\lambda_{NN}^{(i)}\times(1- p_{j}^{(i)})\Bigg{)}\\ \text{s.t.}&\quad 0<\beta_{i}<\alpha_{i}<1,1\leq i \leq t-1,\varepsilon\geq 1,u=u_{p}+u_{b}+u_{n}\end{split} \tag{26}\]

where \(u_{p}\), \(u_{b}\), and \(u_{n}\) are the numbers of instances in \(\mathrm{P}_{\mathrm{L}}^{(i)}\), \(\mathrm{B}_{\mathrm{L}}^{(i)}\), and \(\mathrm{N}_{\mathrm{L}}^{(i)}\), respectively; \(\varepsilon\) is a penalty factor to avoid too many instances being partitioned into \(\mathrm{B}_{\mathrm{L}}^{(i)}\), so as to prevent the overfitting of STWD-SFNN. Therefore, for the \(e\)-th instance at the \(i\)-th (\(1\leq i\leq t-1\)) granular level, the classification criteria are as follows.

(P1) if \(p_{e}^{(i)}\geq\alpha_{i}\), then \([x]_{e}^{(i)}\in\mathrm{P}_{\mathrm{L}}^{(i)}\);

(B1) if \(\beta_{i}<p_{e}^{(i)}<\alpha_{i}\), then \([x]_{e}^{(i)}\in\mathrm{B}_{\mathrm{L}}^{(i)}\);

(N1) if \(p_{e}^{(i)}\leq\beta_{i}\), then \([x]_{e}^{(i)}\in\mathrm{N}_{\mathrm{L}}^{(i)}\).

If BND of the (\(t\)-1)-th level is not empty, we need to add another hidden layer node in STWD-SFNN. Based on Definition 4, we index the result cost matrix \(\mathbf{\Lambda}^{(t)}\) and the threshold \(\gamma\) at the \(t\)-th level. STWD-SFNN computes the total decision risk of classifying \(u\) instances.

\[\begin{split} Risk^{(t)}&=\min_{\gamma}\Bigg{(}\sum_{ \stackrel{{ m=1}}{{p_{e}^{(i)}\times p}}}^{u_{p}}\lambda_{PP}^{(t)} \times p_{o}^{(t)}+\lambda_{PN}^{(t)}\times(1-p_{o}^{(t)})\\ &\qquad+\sum_{\stackrel{{ j=1}}{{p_{j}^{(i)}\times p }}}^{u_{n}}\lambda_{NP}^{(t)}\times p_{j}^{(t)}+\lambda_{NN}^{(t)}\times(1-p_{ j}^{(t)})\Bigg{)}\\ &\qquad\qquad\qquad\qquad\qquad\qquad\qquad\text{s.t.}\quad 0< \gamma<1,u=u_{p}+u_{n}\end{split} \tag{27}\]
where \(u_{p}\) and \(u_{n}\) are the numbers of instances in \(\mathrm{P}_{\mathrm{L}}^{(t)}\) and \(\mathrm{N}_{\mathrm{L}}^{(t)}\), respectively. Hence, for the \(e\)-th instance at the \(t\)-th level, the classification criteria are as follows.

(P2) if \(p_{e}^{(t)}\geq\gamma\), then \([x]_{e}^{(t)}\in\mathrm{P}_{\mathrm{L}}^{(t)}\);

(N2) if \(p_{e}^{(t)}<\gamma\), then \([x]_{e}^{(t)}\in\mathrm{N}_{\mathrm{L}}^{(t)}\).

**Example 4**.: _We adopt the sequential thresholds of Example 2 and the dataset of Example 3. Suppose the first granular level learns the three misclassified instances \([x_{1},x_{4},x_{5}]\) passed from SFNN, which are partitioned into \(\mathrm{P}_{\mathrm{L}}^{(1)}=\varnothing\), \(\mathrm{B}_{\mathrm{L}}^{(1)}=\{x_{4},x_{5}\}\), and \(\mathrm{N}_{\mathrm{L}}^{(1)}=\{x_{1}\}\). Moreover, suppose the conditional probabilities at the first level are \([p_{1}^{(1)},p_{2}^{(1)}]=[0,0.5]\), according to Example 2 and Equation (3), we have the result cost Risk\({}^{(1)}\) = 0 + \(\lambda_{\text{stud}}\)\(\times\) 2 \(\times\) (0.1506 \(\times\) 0.5 + 0.1249 \(\times\) 0.5) + 1 \(\times\) (0.9021 \(\times\) 0 + 0 \(\times\) 1) = 0.5510, where \(\lambda_{\text{stud}}\) = 2. Similarly, suppose the second level classifies \(\{x_{4},x_{5}\}\) into \(\mathrm{N}_{\mathrm{L}}^{(2)}\) with the conditional probability 0.5. Thus, Risk\({}^{(2)}\) = 0 + 0 + 2 \(\times\) (0.5962 \(\times\) 0.5 + 0 \(\times\) 0.5) = 0.5962._

Algorithm 1 shows the pseudocode of STWD-SFNN.

```
1:\(T=(U,A=C\cup D,V=\{V_{a}\mid a\in A\},I=\{I_{a}\mid a\in A\},H)\)
2:\(\mathbf{Output}\): hidden layer nodes \(i\), \(\mathbf{W}_{1}\) and \(\mathbf{b}_{1}\) connected the input layer to the hidden layer, and \(\mathbf{W}_{2}\) and \(\mathbf{b}_{2}\) connected the hidden layer to the output layer
3: Initialization: rng(0), \(i\gets 1\), \(t\gets 10\), \(\theta\gets 2\), \(\rho_{1}\gets 0.9\), \(\rho_{2}\gets 0.999\), \(\tau\gets 10^{-8}\), \(\mathbf{w}_{1}^{(t)}\), \(\mathbf{b}_{1}^{(0)}\), \(\mathbf{w}_{2}^{(t)}\), \(\mathbf{b}_{2}^{(t)}\), activation function (ReLU, leaky ReLU, SeLU, tanh, sigmoid, or swish), distribution of parameters (uniform or normal), POS \(\leftarrow\varnothing\), NEG \(\leftarrow\varnothing\), BND \(\gets T\), \(Cost_{\text{PPT}_{i}}\), \(Cost_{\text{PPD}_{i}}\), \(\Lambda^{(0)}\), (\(\alpha_{i}\),\(\beta_{i}\)), and \(\gamma\);
4:while \(|\) BND \(|\neq\varnothing\)do // Construct SFNN by adding one hidden layer node
5: Calculate the cost function using Equation (2);
6: Update \(\overline{\mathbf{w}}_{1}^{(t)}\), \(\overline{\mathbf{w}}_{1}^{(t)}\), \(\overline{\mathbf{w}}_{2}^{(t)}\), and \(\overline{\mathbf{b}}_{2}^{(t)}\) using Equation (3);
7: Get \(\mathrm{P}_{\mathrm{N}}^{(t)}\), \(\mathrm{N}_{\mathrm{N}}^{(t)}\), and \(\mathrm{N}_{\mathrm{N}}^{(t)}\) of SFNN; // Construct STWD on the misclassified instances
8: Use \(k\)-means++ to discretize the numerical data into categorical data; // Preprocessing of data
9: Calculate probability \(p_{e}^{(t)}\) using Equation (25);
10:if\(i<t\)then
11: Achieve result cost matrix \(\Lambda^{(i)}\), thresholds (\(\alpha_{i}\), \(\beta_{i}\)), and regions \(\mathrm{P}_{\mathrm{L}}^{(t)}\), \(\mathrm{B}_{\mathrm{L}}^{(t)}\), and \(\mathrm{N}_{\mathrm{L}}^{(t)}\) of STWD;
12: Compute \(Risk^{(i)}\) using Equation (26);
13:else
14: Achieve result cost matrix \(\Lambda^{(i)}\), threshold \(\gamma\), and regions \(\mathrm{P}_{\mathrm{L}}^{(t)}\) and \(\mathrm{N}_{\mathrm{L}}^{(t)}\) of STWD;
15: Compute \(Risk^{(i)}\) using Equation (27);
16:endif
17: Compute \(Cost_{\text{PPT}_{i}}\) and \(Cost_{\text{PPD}_{i}}\) using Definition 6;
18: Update POS, BND, and NEG using Definition 5;
19:\(i\gets i+1\);
20:endwhile
21:\(\mathbf{W}_{1}=\begin{bmatrix}\overline{\mathbf{w}}_{1}^{(1)}\\ \cdots\\ \overline{\mathbf{w}}_{1}^{(0)}\end{bmatrix}\), \(\mathbf{b}_{1}=\begin{bmatrix}\overline{\mathbf{b}}_{1}^{(1)}\\ \cdots\\ \overline{\mathbf{b}}_{1}^{(0)}\end{bmatrix}\), \(\mathbf{W}_{2}=\begin{bmatrix}\overline{\mathbf{w}}_{2}^{(1)}\cdots\overline{ \mathbf{w}}_{2}^{(t)}\end{bmatrix}\), and \(\mathbf{b}_{2}=\overline{\mathbf{b}}_{2}^{(t)}\);
22:return\(i\), \(\mathbf{W}_{1}\), \(\mathbf{b}_{1}\), \(\mathbf{W}_{2}\), and \(\mathbf{b}_{2}\);
```

**Algorithm 1** STWD-SFNN.

According to Algorithm 1, there are seven parameters in STWD-SFNN. rng(0) is used to guarantee the repeatability of the experimental results. \(i\) is utilized to guarantee that the number of hidden nodes increases one by one. \(t\) is applied to guarantee the maximum number of hidden nodes. If the number of hidden nodes is small, it means that STWD-SFNN converges faster, and the training time of STWD-SFNN is shorter; otherwise, the training time of STWD-SFNN is longer. \(\theta\) is set to adjust the weight reduction rate of easy-to-classify instances. \(\rho_{1}\) and \(\rho_{2}\) are set to guarantee the exponential decay rate of the first-order and second-order momentum estimates of the Adam optimizer. \(\tau\) is settled to avoid the denominator of Adam being zero.
### An illustrative example

A dataset in Table 1 is adopted to illustrate the principle of STWD-SFNN. Without loss of generality, we select the result cost matrix and sequential thresholds of Examples 1 and 2. The illustrative example is shown as follows.

We initialize the number of hidden nodes to one, and randomize the parameters subjected to uniform distribution, including \(\mathbf{w}_{1}^{(1)}=(0.9168,-1.1743,0.4410,0.0746)\), \(\mathbf{b}_{1}^{(1)}=(0.0047)\), \(\mathbf{w}_{2}^{(1)}=(0.1401,0.0087)^{\top}\), and \(\mathbf{b}_{2}^{(1)}=(0.0018,0.0082)^{\top}\). Meanwhile, we adopt selu function and Adam optimizer, and then validate the classification performance of the model on \(\{x_{7},x_{8}\}\). Correspondingly, the optimized parameters are \(\overline{\mathbf{w}}_{1}^{(1)}=(0.8115,-1.0612,0.3465,0.1514)\), \(\overline{\mathbf{b}}_{1}^{(1)}=(0.1139)\), \(\overline{\mathbf{w}}_{2}^{(1)}=(0.2019,0.0860)^{\top}\), and \(\overline{\mathbf{b}}_{2}^{(1)}=(0.1110,1177)^{\top}\). According to \(\mathbf{\hat{y}}=\overline{\mathbf{w}}_{2}^{(1)}\times\text{selu}(\overline {\mathbf{w}}_{1}^{(1)}\times\mathbf{x}^{\top}+\overline{\mathbf{b}}_{1}^{(1)} +\overline{\mathbf{b}}_{2}^{(1)}\), we have the prediction labels \([1,1,1,2,1,1]\) of SFNN in training dataset. Compared with the truth labels \([2,1,1,1,2,1]\), we have \(\text{P}_{\text{N}}^{(1)}=\{x_{2},x_{3},x_{6}\}\), \(\text{M}_{\text{N}}^{(1)}=\{x_{1},x_{4},x_{5}\}\), and \(\text{N}_{\text{N}}^{(1)}=\varnothing\). Since Table 1 is numerical data, we discretize \(\{x_{1},x_{4},x_{5}\}\) into \(\{[x_{1}\},\{x_{4},x_{5}\}]\) by \(k\)-means\(++\) with two clusters. The conditional probabilities are 0 and 0.5, since the label equivalence class is \(\{[x_{4}\},\{x_{1},x_{5}\}]\). Hence, STWD-SFNN has \(\text{P}_{\text{L}}^{(1)}=\varnothing\), \(\text{B}_{\text{L}}^{(1)}=\{x_{4},x_{5}\}\), and \(\text{N}_{\text{L}}^{(1)}=\{x_{1}\}\) at the first level. According to Examples 3 and 4, we have \(Risk^{(1)}=0.5510\), \(Cost_{\text{P}_{1}}=3\), and \(Cost_{\text{P}_{\text{D}_{1}}}=3\). Simultaneously, the decision of STWD-SFNN in the first turn are \(\text{P}_{\text{N}}^{(1)}\cup\text{P}_{\text{L}}^{(1)}=\{x_{2},x_{3},x_{6}\}\), \(\text{M}_{\text{N}}^{(1)}\cap\text{B}_{\text{L}}^{(1)}=\{x_{4},x_{5}\}\), and \(\text{N}_{\text{N}}^{(1)}\cup\text{N}_{\text{L}}^{(1)}=\{x_{1}\}\).

Since \(\text{M}_{\text{N}}^{(1)}\cap\text{B}_{\text{L}}^{(1)}\) is not empty, we continue to add one hidden node in STWD-SFNN. The parameters to be optimized are \(\mathbf{w}_{1}^{(2)}=(-0.3114,-0.2530,1.0117,0.3236)\), \(\mathbf{b}_{1}^{(2)}=(0.0035)\), \(\mathbf{w}_{2}^{(2)}=(0.1034,-0.0356)^{\top}\), and \(\mathbf{b}_{2}^{(2)}=(0.0018,0.0082)^{\top}\). After optimization, we have \(\overline{\mathbf{w}}_{1}^{(2)}=(-0.2338,-0.1741,0.9333,0.2477)\), \(\overline{\mathbf{b}}_{1}^{(2)}=(0.0818)\), \(\overline{\mathbf{w}}_{2}^{(2)}=(0.1343,0.0133)^{\top}\), and \(\overline{\mathbf{b}}_{2}^{(2)}=(0.0768,0.0821)^{\top}\). STWD-SFNN has \(\text{P}_{\text{N}}^{(2)}=\varnothing\), \(\text{M}_{\text{N}}^{(2)}=\{x_{4},x_{5}\}\), and \(\text{N}_{\text{N}}^{(2)}=\varnothing\). Based on the instance equivalent class \(\{x_{4},x_{5}\}\), label equivalent class \(\{[x_{4}\},\{x_{5}\}]\), and the conditional probability 0.5, we have \(\text{P}_{\text{L}}^{(2)}=\varnothing\), \(\text{B}_{\text{L}}^{(2)}=\varnothing\), and \(\text{N}_{\text{L}}^{(2)}=\{x_{4},x_{5}\}\). Similarly, according to Examples 3 and 4, we have \(Risk^{(2)}=0.5962\), \(Cost_{\text{P}_{2}}=7\), and \(Cost_{\text{P}_{\text{D}_{2}}}=4\). Meanwhile, the decisions for STWD-SFNN in the second turn are \(\text{P}_{\text{N}}^{(2)}\cup\text{P}_{\text{L}}^{(2)}=\varnothing\), \(\text{M}_{\text{N}}^{(2)}\cap\text{B}_{\text{L}}^{(2)}=\varnothing\), and \(\text{N}_{\text{N}}^{(2)}\cup\text{N}_{\text{L}}^{(2)}=\{x_{4},x_{5}\}\).

The learning of STWD-SFNN is stopped, since \(\text{M}_{\text{N}}^{(2)}\cap\text{B}_{\text{L}}^{(2)}\) is empty. According to Definition 5, the decisions of STWD-SFNN with two hidden layer nodes are POS=\(\{x_{2},x_{3},x_{6}\}\), BND=\(\varnothing\), and NEG=\(\{x_{1},x_{4},x_{5}\}\). Meanwhile, the model is \(\mathbf{\hat{y}}=\mathbf{W}_{2}\times\text{selu}(\mathbf{W}_{1}\times\mathbf{x}^ {\top}+\mathbf{b}_{1})+\mathbf{b}_{2}\), where \(\mathbf{W}_{1}=\begin{bmatrix}\overline{\mathbf{w}}_{1}^{(1)}\\ \overline{\mathbf{w}}_{2}^{(2)}\end{bmatrix}=\begin{bmatrix}0.8115,-1.0612,0.346 5,0.1514\\ -0.2338,-0.1741,0.9333,0.2477\end{bmatrix}\), \(\mathbf{b}_{1}=\begin{bmatrix}\overline{\mathbf{b}}_{1}^{(1)}\\ \overline{\mathbf{b}}_{1}^{(2)}\end{bmatrix}=\begin{bmatrix}0.1139\\ 0.0818\end{bmatrix}\), \(\mathbf{W}_{2}=\begin{bmatrix}\overline{\mathbf{w}}_{2}^{(1)},\overline{\mathbf{w}}_ {2}^{(2)}\end{bmatrix}=\begin{bmatrix}0.2019,0.1343\\ 0.0860,0.0133\end{bmatrix}\), and \(\mathbf{b}_{2}=\overline{\mathbf{b}}_{2}^{(2)}=\begin{bmatrix}0.0768\\ 0.0821\end{bmatrix}\). Finally, we obtain the predicted value \(\mathbf{\hat{y}}\) when applying STWD-SFNN to \(\{x_{9},x_{10}\}\).

Since the thresholds of TWD-SFNN are relatively fixed, compared with STWD-SFNN, there are two exceptional cases, i.e., the coarsest thresholds and the finest thresholds. Case 1 (The coarsest): If the thresholds are \((\alpha,\beta)=(\alpha_{1},\beta_{1})=(0.6894,0.1425)\), TWD-SFNN will continue to learn the network topology when the nodes of hidden layer are two. Case 2 (The finest): If the thresholds are \((\alpha,\beta)=(\alpha_{2},\beta_{2})=(0.5389,0.5016)\), TWD-SFNN will stop the training of model early. However, STWD-SFNN adopts sequential thresholds to traverse from coarse-grained level to fine-grained level step by step, thus better handling the problem of network topology. Therefore, STWD-SFNN is a generalized model of TWD-SFNN.

### Theoretical analysis of STWD-SFNN

**Theorem 1**.: _STWD-SFNN algorithm is convergent._

Proof.: (Proof by Contradiction) Suppose STWD-SFNN completes the learning of instances in infinite turns, it means that STWD-SFNN has \(u\) (\(u\geq 1\)) instances which always are classified into BND. STWD-SFNN needs to compare probability \(p_{e}^{(t)}\) of the \(e\)-th (\(1\leq e\leq u\)) instance with thresholds \((\alpha_{t},\beta_{t})\) at the \(t\)-th(\(t\geq 1\)) level. If \(p_{e}^{(t)}\) is larger than \(\alpha_{t}\), then the \(e\)-th (\(1\leq e\leq u\)) instance is classified into POS; if \(p_{e}^{(t)}\) is less than \(\beta_{t}\), then it is classified into NEG. If \(p_{e}^{(t)}\) is in \([\beta_{t},\alpha_{t}]\), then it is classified into BND. The probability of the \(e\)-th instance falls into the range \(\alpha_{t}-\beta_{t}\), and hence the probability for \
## 4 Experiments

To verify the classification performance of STWD-SFNN, we selected ten classification models: \(m_{1}\)-SFNN-R, \(m_{2}\)-SFNN-R, \(m_{3}\)-SFNN-R [5], Grid search optimization of SFNN (GS-SFNN) [26], Particle swarm optimization of SFNN (PSO-SFNN) [24], TWD-SFNN-R [7], STWD-SFNN-NK, support vector classification (SVC) [20], random forest (RF) [13], and k-nearest neighbors (KNN) [12]. These models are used as the competitive models to evaluate the performance of our algorithm from the following six research questions (RQs).

RQ 1: How does STWD-SFNN perform compared with static topology discovery without STWD?

RQ 2: How does STWD-SFNN perform compared with choosing a dynamic tuning model without STWD?

RQ 3: How does STWD-SFNN perform compared with employing TWD to find network topology?

RQ 4: How does STWD-SFNN perform compared with the model without \(k\)-means++ discretization?

RQ 5: How does STWD-SFNN perform compared with other classification models?

RQ 6: How is the process costs of STWD-SFNN related to network topology?

To handle RQ 1, we utilize the SFNN determined by the empirical formula models in Section 4.4.1. In response to RQ 2, we employ grid search and particle swarm optimization to dynamically select the network topology in Section 4.4.2. To address RQ 3, we utilize TWD-SFNN in Sections 4.4.2 and 4.4.4. To answer RQ 4, we adopt STWD-SFNN without \(k\)-means++ as a competitive model in Section 4.4.2. To answer RQ 5, we adopt SVC, RF, and KNN to verify the generalization ability of STWD-SFNN in section 4.4.3. To handle RQ 6, we analyze the STWD-SFNN in Section 4.4.5.

### Benchmark datasets and evaluation criteria

To report the performance of STWD-SFNN, we selected 15 commonly used datasets which can be downloaded from [https://archive.ics.uci.edu/ml/index.php](https://archive.ics.uci.edu/ml/index.php). The characteristics of these datasets are shown in Table 2. All experiments were performed on a computer equipped with an Intel (R) Core (TM) i7-10700K CPU, 16 GB RAM, and a 64-bit version of Windows 10. All models were programmed in Matlab, which can be downloaded from [https://github.com/wuc567/Machine-learning/tree/main/STWD-SFNN](https://github.com/wuc567/Machine-learning/tree/main/STWD-SFNN).

We adopted the weighted-f1 metric [7; 29] to evaluate the performance, since weighted-f1 handles the problem of unbalanced classification data and considers the importance of different categories in classification data. Weighted-f1 can be defined as follows.

\begin{table}
\begin{tabular}{c c c c} \hline Name of datasets & Abbreviation & Number of instances & Number of attributes \\ \hline Online news popularity & ONP & 39,797 & 61 \\ QSAR oral toxicity & QSAR & 8,992 & 1,024 \\ Online shoppers purchasing intention & OSP & 12,330 & 18 \\ Electrical grid stability simulated & EGSS & 10,000 & 14 \\ Skin segmentation & SE & 245,057 & 4 \\ HTRU & HTRU & 17,898 & 9 \\ Default of credit card clients & DCC & 30,000 & 24 \\ Epileptic seizure recognition & ESR & 11,500 & 179 \\ Bank marketing & BM & 45,211 & 17 \\ Polish companies’ bankruptcy & PCB & 10,503 & 64 \\ Shill bidding & SB & 6,321 & 13 \\ Estimation of obesity levels & EOL & 2,111 & 17 \\ Occupancy detection & OD & 20,560 & 7 \\ Room occupancy estimation & ROE & 10,129 & 16 \\ Sepsis survival minimal clinical records & SSMCR & 110,204 & 4 \\ \hline \end{tabular}
\end{table}
Table 2: Benchmark datasets
\[\mathrm{weighted-f1}=\frac{\sum_{i=1}^{2}\mid d_{i}\mid*f_{i}}{\mid d\mid} \tag{28}\]

\[f_{i}=\frac{2\times Precision_{i}\times Recall_{i}}{Precision_{i}+Recall_{i}} \tag{29}\]

\[Precision_{i}=\frac{TP_{i}}{TP_{i}+FP_{i}} \tag{30}\]

\[Recall_{i}=\frac{TP_{i}}{TP_{i}+FN_{i}} \tag{31}\]

where \(\mid d_{i}\mid\) and \(\mid d\mid\) represent the numbers of \(i\)-th label and all label, respectively; \(f_{i}\) represents the f1-score of the \(i\)-th label; \(Precision_{i}\) and \(Recall_{i}\) are the precision rate and the recall rate of \(i\)-th label, respectively; \(TP_{i}\) and \(FP_{i}\) are the numbers of correct and incorrect predictions for instances with positive labels, respectively; and \(FN_{i}\) is the number of incorrect predictions for instances with negative labels. The greater the value of weighted-f1, the better the performance of the model.

In addition, we employ other evaluation criteria, including the accuracy, training time, test time, number of hidden layer nodes, receiver operating characteristic (ROC) curve, and area under the curve of ROC (AUC), where the training time is the learning time of the model under a specified set of parameters. The higher the accuracy and AUC, the shorter the training time, the shorter the test time, the lower number of hidden layer nodes, and the closer the curve to the upper left corner, the better the performance of the model.

### Baseline models

To validate the performance of STWD-SFNN, we compared it with ten competitive models, which are listed as follows.

1. SFNN-R [5]: The network parameters of SFNN are initialized by random numbers, which cannot guarantee the repeatability of the experimental results. To overcome this shortage, we set the seed of the random number generator to \(\mathrm{rng}(0)\), and initialize the hyperparameters in a fixed random number manner to guarantee the repeatability of learning results. We name SFNN with the fixed hyperparameter as SFNN-R. SFNN-R adopts pre-determined hidden layer nodes and learns the optimal network parameters through focal loss and Adam optimizer, thus generating a nonlinear decision boundary. Moreover, for SFNN-R, the numbers of hidden nodes determined by the empirical formula methods are \(m_{1}\)-SFNN-R: \(\sqrt{m+n}+\alpha,(\alpha\in(1,10))\), \(m_{2}\)-SFNN-R: \(log_{2}m\), and \(m_{3}\)-SFNN-R: \(\sqrt{m\times n}\), where \(m\) and \(n\) are the numbers of nodes in the input and output layers, respectively.
2. GS-SFNN [26]: For the hyperparameters of the number of hidden layer nodes in SFNN, we select a common hyperparameters method, i.e., grid search, to find the optimal number of hidden layer nodes of SFNN.
3. PSO-SFNN [24]: To tune the hyperparameters of SFNN, we choose particle swarm optimization, which utilizes collaboration and information sharing among individuals in the group to optimize SFNN.
4. TWD-SFNN-R [7]: The network parameters of TWD-SFNN, the thresholds of three-way decisions, and the cross-validation of the dataset are initialized by random numbers, which cannot guarantee the repeatability of the experimental results. To overcome this shortage, we set the seed of the random number generator to \(\mathrm{rng}(0)\), and initialize the hyperparameters in a fixed random number manner to guarantee the repeatability of learning results. We name TWD-SFNN with the fixed hyperparameter as TWD-SFNN-R which adds a delayed decision region to determine the number of hidden layer nodes, and aims to minimize the decision risk, thereby improving the performance of the model.
5. STWD-SFNN-NK: To verify the performance of the STWD-SFNN model by adopting discretization techniques, we compare it with STWD-SFNN without \(k\)-means++ and name it STWD-SFNN-NK. The parameters affecting STWD-SFNN-NK are consistent with STWD-SFNN.
6. SVC [20]: To obtain the optimal separated hyperplane, SVC converts the maximization problem to a convex quadratic programming optimization problem, and applies the kernel function to learn the nonlinear classifier.
7. RF [13]: To reduce the correlation between decision trees, for the classification problem, RF randomizes features and instances and adopts a voting mechanism to predict the label for each instance.
8. KNN [12]: To learn the similarities between instances, KNN measures the distances between the different eigenvalues and selects the most frequent categories from the nearest \(K\) instance as the decision category of the model.
### Preparation of the experiment

For the hyperparameters of STWD-SFNN, we set the seed of the random number generator to rng(0) to guarantee the repeatability of the experimental results. The selection of process cost is explained as follows. We know that the unit test cost \(Cost_{\text{PPT}_{i}}\) and the unit delay cost \(Cost_{\text{PPT}_{i}}\) at each granular level are part of the input of STWD-SFNN. Without loss of generality, we randomly generate two vectors with dimension \(t\), one is \([Cost_{\text{PPT}_{1}},Cost_{\text{PPT}_{2}},\cdots,Cost_{\text{PPT}_{t}}]\), and the other is \([Cost_{\text{PPD}_{1}},Cost_{\text{PPD}_{2}},\cdots,Cost_{\text{PPD}_{t}}]\). In addition, the selection of the result cost matrix \(\Lambda^{(i)}(1\leq i\leq t)\) is illustrated as follows. Firstly, \(\Lambda^{(i)}\) of the \(i\)-th level is randomly initialized, which needs to satisfy the conditions \(0\leq\lambda^{(i)}_{PP}<\lambda^{(i)}_{BP}<\lambda^{(i)}_{NP}<1\), \(0\leq\lambda^{(i)}_{NN}<\lambda^{(i)}_{BN}<\lambda^{(i)}_{PN}<1\), and \((\lambda^{(i)}_{BN}-\lambda^{(i)}_{NN})\times(\lambda^{(i)}_{BP}-\lambda^{(i)} _{PP})<(\lambda^{(i)}_{PN}-\lambda^{(i)}_{BN})\times(\lambda^{(i)}_{NP}-\lambda ^{(i)}_{BP})\). Next, the thresholds \((\alpha_{i},\beta_{i})(1\leq i\leq t)\) of the previous \(t\)-1 levels and the threshold \(\gamma\) of the \(t\)-th level are defined by Definitions 3 and 4, respectively. Finally, for the (\(i\)+1)-th level, we retain \(\Lambda^{(i+1)}\) and \((\alpha_{i+1},\beta_{i+1})\) or \(\gamma\) if and only if the thresholds satisfy \(\beta_{i}\leq\beta_{i+1}<\gamma\leq\alpha_{i+1}\leq\alpha_{i}\); otherwise, we iterate this process until \(\Lambda^{(i+1)}\) is found. It should be noted that whether there is a better hyperparameter selection method to obtain the result cost matrix is worth investigating in the future.

The hyperparameters of the competitive models are introduced as follows. For the network models, such as SFNNN-R, GS-SFNN, PSO-SFNN, TWD-SFNN-R, and STWD-SFNN-NK, the activation function selects ReLU family (e.g., ReLU, LReLU, and SELU) or tanh family (e.g., tanh, sigmoid, and swish), and the network parameters subject to uniform distribution or normal distribution. Except for SFNN-R, the number of hidden layer nodes in the rest network model increases from one to ten. Meanwhile, for PSO-SFNN, \(max\_iterations\in(10,100)\) with step size ten, and \(max\_particles\in(1,10)\) with step size one. On the other hand, for SVC, polynomial, RBF, and sigmoid kernel functions are selected,\(\gamma\in(-4,4)\) with step size one, and \(C\in(-4,4)\) with step size one. For RF, \(max\_trees\in(100,1000)\) with step size 100, \(max\_depth\in\{q,log_{2}q,\sqrt{q},\phi q\}\), where \(q\) is the number of features, \(\phi\in(0,1)\). For KNN, Euclidean distance and angle cosine are selected to characterize the similarity among instances, \(K\in(10,100)\) with step size ten.

It is worth noting that the dataset is divided into training set, validation set, and test set according to the ratio of 8:1:1, and the 10-fold cross-validation and grid search are adopted to find the optimal hyperparameters of each model. In addition, we utilize the Focal loss and Adam optimizer in Section 2.1 to train the network model, where the regularization factor \(\lambda_{\text{SFNN}}\), the learning rate, and batch size of the optimizer are uniformly set to 0.1, 512, and 0.1, respectively.

### Experimental results and analysis

#### 4.4.1 Comparison with static models

To validate the effectiveness of STWD-SFNN in optimizing the network topology, we select the static models SFNN-R as the competitive models, which adopt three empirical formulas to calculate the number of hidden layer nodes. Fig. 4 shows the comparison of ROC curves of the SFNN-R models and STWD-SFNN. Table 3 reports the comparison of different evaluation criteria of those models. The results give rise to the following observations.

1. The accuracy, weighted-f1, ROC, and AUC of STWD-SFNN are better than those of SFNN-R. For example, on the EOL dataset, Table 3 reports that the accuracy, weighted-f1, and AUC of STWD-SFNN are 83.66%, 81.53%, and 69.78%, respectively. However, the best performance in the SFNN-R models is \(m_{3}\)-SFNN-R whose accuracy, weighted-f1, and AUC are 75.37%, 75.24%, and 63.70%, respectively. Meanwhile, as shown in Fig. 4, the ROC curve of STWD-SFNN is at the top left of \(m_{3}\)-SFNN-R. Similar phenomena can be found in other datasets. The reason is as follows. Compared with SFNN-R which only contains two-way decisions with POS and NEG, STWD-SFNN adds the delayed decision region to store the difficult-to-classify instances, and learns the features of these instances more pertinently in each turn, thereby enhancing the performance of STWD-SFNN. Therefore, the generalization ability of STWD-SFNN is better than that of SFNN-R.

2. The number of hidden layer nodes of STWD-SFNN is lower than that of SFNN-R. For example, on the OD dataset, Table 3 reports that the number of hidden layer nodes of STWD-SFNN is two. However, the competitive models perform better in \(m_{1}\)-SFNN-R and \(m_{2}\)-SFNN-R, with a value of three. Similar phenomena can be found in other datasets. The reason is as follows. Compared with SFNN-R, which statically determines the network topology, the compactness of network topology of STWD-SFNN depends on the number of instances in BND. As the number of difficult-to-classify instances decreases, the number of hidden layer nodes of STWD-SFNN gradually decreases. Therefore, the network topology of STWD-SFNN is better than that of SFNN-R.
Figure 4: Comparison of ROC curves of static models and STWD-SFNN
\begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline \multirow{2}{*}{Dataset} & \multirow{2}{*}{Model} & \multicolumn{2}{c}{Accuracy} & Weighted- & AUC & Training & \multirow{2}{*}{Test time (s)} & \multirow{2}{*}{Nodes} \\  & & (\%) & (\%) & (\%) & (\%) & time(s) & & \\ \hline \multirow{4}{*}{ONP} & \(m_{1}\)-SFNN-R & 85.43\(\pm\)0.37 & 87.42\(\pm\)0.29 & 54.46 & 41.76\(\pm\)0.38 & 0.009\(\pm\)0.000 & 8 \\  & \(m_{2}\)-SFNN-R & 89.09\(\pm\)0.21 & **89.29\(\pm\)0.23** & 56.43 & 34.77\(\pm\)0.62 & 0.008\(\pm\)0.001 & 6 \\  & \(m_{3}\)-SFNN-R & 86.40\(\pm\)0.30 & 88.02\(\pm\)0.27 & 56.50 & 32.04\(\pm\)0.32 & 0.009\(\pm\)0.005 & 11 \\  & STWD-SFNN & **94.41\(\pm\)0.22** & 85.87\(\pm\)0.26 & **57.87** & **15.76\(\pm\)0.76** & **0.003\(\pm\)0.000** & **1.00\(\pm\)0.00** \\ \hline \multirow{4}{*}{QSAR} & \(m_{1}\)-SFNN-R & 62.67\(\pm\)0.83 & 71.00\(\pm\)0.78 & 50.89 & 22.95\(\pm\)0.50 & 0.015\(\pm\)0.007 & 33 \\  & \(m_{2}\)-SFNN-R & 76.57\(\pm\)1.11 & 80.29\(\pm\)1.15 & 55.04 & 16.61\(\pm\)0.24 & 0.013\(\pm\)0.005 & 10 \\  & \(m_{3}\)-SFNN-R & **89.57\(\pm\)0.79** & **87.17\(\pm\)1.04** & 57.63 & **11.06\(\pm\)0.15** & 0.010\(\pm\)0.004 & 46 \\  & STWD-SFNN & 78.26\(\pm\)1.11 & 81.21\(\pm\)1.13 & **61.61** & 12.43\(\pm\)0.15 & **0.008\(\pm\)0.001** & **2.00\(\pm\)0.00** \\ \hline \multirow{4}{*}{OSP} & \(m_{1}\)-SFNN-R & 76.37\(\pm\)0.79 & 74.08\(\pm\)1.00 & **63.89** & 5.58\(\pm\)0.22 & 0.005\(\pm\)0.003 & 5 \\  & \(m_{2}\)-SFNN-R & 76.37\(\pm\)0.79 & 74.08\(\pm\)0.06 & **63.89** & **5.44\(\pm\)0.26** & 0.004\(\pm\)0.002 & 5 \\  & \(m_{3}\)-SFNN-R & **78.41\(\pm\)0.87** & **75.33\(\pm\)1.06** & 55.58 & 5.73\(\pm\)0.23 & 0.004\(\pm\)0.002 & 6 \\  & STWD-SFNN & 68.43\(\pm\)0.66 & 70.01\(\pm\)0.81 & 62.52 & 5.55\(\pm\)0.51 & **0.002\(\pm\)0.000** & **2.00\(\pm\)0.00** \\ \hline \multirow{4}{*}{EGSS} & \(m_{1}\)-SFNN-R & 76.38\(\pm\)0.90 & 76.84\(\pm\)0.86 & 86.59 & 2.08\(\pm\)0.24 & 0.003\(\pm\)0.002 & 5 \\  & \(m_{2}\)-SFNN-R & 84.25\(\pm\)0.82 & 84.56\(\pm\)0.78 & 95.87 & **1.90\(\pm\)0.26** & **0.002\(\pm\)0.001** & 4 \\  & \(m_{3}\)-SFNN-R & 75.27\(\pm\)0.80 & 75.75\(\pm\)0.77 & 84.03 & 2.70\(\pm\)0.18 & **0.002\(\pm\)0.001** & 6 \\  & STWD-SFNN & **85.63\(\pm\)0.70** & **85.91\(\pm\)0.67** & **98.30** & 7.09\(\pm\)0.37 & 0.003\(\pm\)0.000 & **2.00\(\pm\)0.00** \\ \hline \multirow{4}{*}{SE} & \(m_{1}\)-SFNN-R & 79.08\(\pm\)0.40 & 75.18\(\pm\)0.50 & 79.54 & 77.22\(\pm\)1.60 & 0.018\(\pm\)0.007 & 3 \\  & \(m_{2}\)-SFNN-R & 78.81\(\pm\)0.38 & 69.76\(\pm\)0.52 & **91.65** & 49.81\(\pm\)0.92 & **0.007\(\pm\)0.004** & 2 \\  & \(m_{3}\)-SFNN-R & 79.09\(\pm\)0.40 & 75.18\(\pm\)0.50 & 79.54 & **26.60\(\pm\)0.07** & **0.007\(\pm\)0.004** & 3 \\  & STWD-SFNN & **80.89\(\pm\)0.29** & **78.31\(\pm\)0.36** & 87.14 & 7.63\(\pm\)0.29 & 0.011\(\pm\)0.000 & **2.00\(\pm\)0.00** \\ \hline \multirow{4}{*}{HTRU} & \(m_{1}\)-SFNN-R & 90.93\(\pm\)0.37 & 86.72\(\pm\)0.53 & 83.95 & **7.65\(\pm\)0.26** & 0.004\(\pm\)0.002 & 4 \\  & \(m_{2}\)-SFNN-R & 84.95\(\pm\)0.56 & 87.59\(\pm\)0.40 & 96.52 & 8.45\(\pm\)0.17 & **0.003\(\pm\)0.000** & 3 \\  & \(m_{3}\)-SFNN-R & 90.93\(\pm\)0.37 & 86.72\(\pm\)0.53 & 83.95 & 9.04\(\pm\)0.19 & 0.004\(\pm\)0.002 & 4 \\  & STWD-SFNN & **91.80\(\pm\)0.30** & **92.72\(\pm\)0.23** & **98.34** & 10.43\(\pm\)0.61 & 0.004\(\pm\)0.000 & **2.00\(\pm\)0.00** \\ \hline \multirow{4}{*}{DCC} & \(m_{1}\)-SFNN-R & 77.95\(\pm\)0.04 & 68.52\(\pm\)0.57 & 50.50 & 24.36\(\pm\)1.46 & 0.009\(\pm\)0.005 & 6 \\  & \(m_{2}\)-SFNN-R & 74.07\(\pm\)0.26 & 68.31\(\pm\)0.41 & 58.51 & 11.77\(\pm\)0.31 & 0.004\(\pm\)0.002 & 5 \\  & \(m_{3}\)-SFNN-R & 76.77\(\pm\)0.46 & **75.62\(\pm\)0.53** & **67.49** & 10.46\(\pm\)0.33 & 0.004\(\pm\)0.002 & 7 \\  & STWD-SFNN & **78.13\(\pm\)0.40** & 69.70\(\pm\)0.55 & 63.59 & **7.89\(\pm\)0.32** & **0.002\(\pm\)0.000** & **2.00\(\pm\)0.00** \\ \hline \multirow{4}{*}{ESR} & \(m_{1}\)-SFNN-R & 84.27\(\pm\)0.58 & 80.91\(\pm\)0.75 & 54.48 & 4.97\(\pm\)0.26 & 0.004\(\pm\)0.002 & 14 \\  & \(m_{2}\)-SFNN-R & 83.82\(\pm\)0.86 & 79.31\(\pm\)1.14 & 54.99 & 8.54\(\pm\)0.30 & 0.006\(\pm\)0.001 & 8 \\  & \(m_{3}\)-SFNN-R & 83.97\(\pm\)0.67 & 81.41\(\pm\)0.87 & **59.85**
3. The running time of STWD-SFNN is faster than SFNN-R on some datasets. For example, on the BM dataset, Table 3 reports that the training time of STWD-SFNN is 15.19s, and \(m_{3}\)-SFNN-R is the least time-consuming model of SFNN-R with a value of 25.75s. Similar phenomena can be found in other datasets. The reason is as follows. Compared with SFNN-R, which needs to repeatedly learn the features of all instances, STWD-SFNN only learns all instances in the first turn. After the second turn, STWD-SFNN focuses on the features of difficult-to-classify instances by constructing granularity layers and sequential threshold parameters, which takes a relatively short time. Therefore, the efficiency of STWD-SFNN is better than that of SFNN-R.

#### 4.4.2 Comparison with dynamic models

To verify the effectiveness of STWD-SFNN in dynamically constructing network topology, we add three new datasets on the basis of previous work [7] and choose GS-SFNN, PSO-SFNN, TWD-SFNN-R, and STWD-SFNN-NK as the competitive models. Fig. 5 shows the comparison of ROC curves for dynamic models and STWD-SFNN, and Table 4 lists the indices for those models. The results give rise to the following observations.

1. The accuracy, weighted-f1, ROC, and AUC of STWD-SFNN are better than those of GS-SFNN, PSO-SFNN, TWD-SFNN-R, and STWD-SFNN-NK. For example, on the ROE dataset of Table 4, the accuracy, weighted-f1, and AUC of STWD-SFNN are 84.35%, 85.00%, and 80.19%, respectively, which are higher than those of TWD-SFNN-R with best performance in the competitive models, and the values are 84.19%, 84.85%, and 80.19%, respectively. Meanwhile, Fig. 5 shows that the comparison of ROC curves of TWD-SFNN-R and STWD-SFNN overlap. Similar phenomena can be found in other datasets. The reasons are as follows.

1. Compared with GS-SFNN and PSO-SFNN, STWD-SFNN adopts the idea of divide-and-conquer and focuses on learning the features of the difficult-to-classify instances in BND. However, GS-SFNN and PSO-SFNN do not perform targeted processing on the difficult-to-classify instances, but repeatedly learn the features of all instances.
2. Compared with TWD-SFNN-R, STWD-SFNN sets dynamic thresholds and utilizes the sequential property of these thresholds, thereby gradually relaxing the conditions of instances partitioned at different granularity levels. However, TWD-SFNN-R adopts the static threshold in each turn, which is difficult to achieve dynamic adjustment of instance learning.
3. Compared with STWD-SFNN-NK, STWD-SFNN utilizes the discretization technique to handle the data of instances partitioned into the BND region, thereby improving the learning ability of the model. Therefore, the generalization ability of STWD-SFNN is better than that of the competitive models.

2. The number of hidden layer nodes of STWD-SFNN is no more than GS-SFNN, PSO-SFNN, and TWD-SFNN-R, but more than STWD-SFNN-NK in most cases. For example, on the SSMCR dataset in Table 4, STWD-SFNN has the same number of nodes as TWD-SFNN-R, with a value of two. STWD-SFNN has less nodes than GS-SFNN and PSO-SFNN, with values of 3.00 and 5.48, respectively, while STWD-SFNN has more nodes than STWD-SFNN-NK, with a value of 1.00. Similar phenomena can be found in other datasets. The reasons are as follows.

1. Compared with GS-SFNN and PSO-SFNN, STWD-SFNN adopts the idea of sequential three-way decisions, and determines whether to increase the number of hidden layer nodes according to whether there are instances in BND. However, GS-SFNN and PSO-SFNN use the difference in accuracy between adjacent turns. If the accuracy of this turn is lower than that of the previous turn, the number of hidden layer nodes will continue to increase until it reaches a given maximum number of hidden layer nodes.
2. Compared with TWD-SFNN-R, STWD-SFNN constructs granularity layers and sequential thresholds so that it can pay more attention to instances that are difficult to classify, and gradually partition instances that are difficult to classify from the BND region. In addition, STWD-SFNN is a generalization of TWD-SFNN-R, which can ensure that STWD-SFNN has the same advantages as TWD-SFNN-R in network topology.
3. Compared with STWD-SFNN-NK, STWD-SFNN can repeatedly learn the features of difficult-to-classify instances, thereby expanding the network topology. Therefore, the network topology of STWD-SFNN is superior to the competitive models in most cases.

3. The training time of STWD-SFNN is less than GS-SFNN and PSO-SFNN, but more than TWD-SFNN-R and STWD-SFNN-NK on some datasets. For example, on the QSAR dataset in Table 4, the training time of STWD-SFNN is, less than GS-SFNN, PSO-SFNN, TWD-SFNN-R, and STWD-SFNN-NK, with values of 12.43s, 40.13s, 190.05s, 13.61s, and 14.62s, respectively. Similar phenomena can be found in other datasets. The reasons are as follows.
Figure 5: Comparison of ROC curves of dynamic models and STWD-SFNN
\begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline
**Dataset** & **Model** & \multicolumn{2}{c}{Accuracy} & \multicolumn{2}{c}{Weighted-} & \multicolumn{2}{c}{AUC} & \multicolumn{2}{c}{Training} & \multicolumn{2}{c}{Test time (s)} & \multicolumn{2}{c}{Nodes} \\ \hline  & **GS-SFNN** & 47.24\(\pm\)17.13 & 54.65\(\pm\)17.01 & 49.71 & 55.15\(\pm\)11.72 & 0.005\(\pm\)0.001 & 3.10\(\pm\)0.63 \\  & **PSO-SFNN** & 92.20\(\pm\)2.34 & 81.64\(\pm\)18.18 & 53.83 & 91.55\(\pm\)3.51 & **0.003\(\pm\)0.000** & 4.35\(\pm\)1.01 \\
**ONP** & **TWD-SFNN-R** & **94.41\(\pm\)0.22** & **85.78\(\pm\)0.25** & 57.87 & **9.56\(\pm\)0.11** & **0.003\(\pm\)0.000** & **1.00\(\pm\)0.00** \\  & **STWD-SFNN-NK** & **84.16\(\pm\)0.24** & **86.63\(\pm\)0.25** & **59.35** & **44.70\(\pm\)6.10** & 0.008\(\pm\)0.0001 & **1.00\(\pm\)0.00** \\  & **STWD-SFNN** & **94.41\(\pm\)0.22** & 85.87\(\pm\)0.26 & 57.87 & 15.76\(\pm\)0.76 & **0.003\(\pm\)0.000** & **1.00\(\pm\)0.00** \\ \hline  & **GS-SFNN** & 49.47\(\pm\)1.29 & 57.78\(\pm\)10.70 & 43.16 & 40.13\(\pm\)34.71 & 0.011\(\pm\)0.000 & 2.70\(\pm\)0.31 \\  & **PSO-SFNN** & **88.59\(\pm\)2.48** & **85.49\(\pm\)1.06** & 56.32 & 190.05\(\pm\)8.61 & 0.017\(\pm\)0.002 & 5.42\(\pm\)1.61 \\
**QSAR** & **TWD-SFNN-R** & 78.26\(\pm\)1.11 & 81.21\(\pm\)1.13 & 61.61 & 14.62\(\pm\)0.33 & 0.011\(\pm\)0.002 & 2.00\(\pm\)0.00 \\  & **STWD-SFNN-NK** & 67.23\(\pm\)1.15 & 74.42\(\pm\)1.04 & 64.54 & 13.61\(\pm\)1.18 & 0.009\(\pm\)0.001 & **1.00\(\pm\)0.00** \\  & **STWD-SFNN** & 78.26\(\pm\)1.11 & 81.21\(\pm\)1.13 & 61.61 & **12.43\(\pm\)0.15** & **0.008\(\pm\)0.001** & 2.00\(\pm\)0.00 \\ \hline  & **GS-SFNN** & 44.76\(\pm\)1.56 & 27.43\(\pm\)1.29 & 40.62 & 28.78\(\pm\)5.95 & 0.004\(\pm\)0.000 & 2.90\(\pm\)0.63 \\  & **PSO-SFNN** & **80.98\(\pm\)3.59** & 68.07\(\pm\)15.27 & 62.10 & 28.88\(\pm\)2.60 & 0.002\(\pm\)0.001 & 5.62\(\pm\)1.44 \\
**OSP** & **TWD-SFNN-R** & 68.42\(\pm\)0.65 & **70.01\(\pm\)0.80** & 62.52 & **50.40\(\pm\)0.43** & **0.002\(\pm\)0.000** & 2.00\(\pm\)0.00 \\  & **STWD-SFNN** & **65.01\(\pm\)0.65** & 66.98\(\pm\)0.82 & **64.77** & 51.5\(\pm\)0.60 & **0.002\(\pm\)0.000** & **1.00\(\pm\)0.00** \\  & **STWD-SFNN** & **68.43\(\pm\)0.66** & **70.01\(\pm\)0.81** & 62.52 & 5.55\(\pm\)0.51 & **0.002\(\pm\)0.000** & 2.00\(\pm\)0.00 \\ \hline  & **GS-SFNN** & 62.56\(\pm\)14.47 & 58.48\(\pm\)16.67 & 95.07 & 18.36\(\pm\)2.41 & 0.004\(\pm\)0.001 & 2.50\(\pm\)0.45 \\  & **PSO-SFNN** & 84.32\(\pm\)5.05 & 83.30\(\pm\)7.17 & 95.60 & 36.35\(\pm\)3.29 & 0.004\(\pm\)0.001 & 5.53\(\pm\)1.51 \\
**EGSS** & **TWD-SFNN-R** & 85.60\(\pm\)0.70 & 88.80\(\pm\)0.67 & **98.30** & 60.46\(\pm\)0.65 & 0.003\(\pm\)0.000 & 2.00\(\pm\)0.00 \\  & **STWD-SFNN-NK** & 82.26\(\pm\)0.75 & 82.61\(\pm\)0.72 & 96.15 & **4.71\(\pm\)0.57** & **0.002\(\pm\)0.000** & **1.00\(\pm\)0.00** \\  & **STWD-SFNN** & **85.63\(\pm\)0.70** & **85.91\(\pm\)0.67** & **98.30** & 7.009\(\pm\)0.37 & 0.003\(\pm\)0.000 & 2.00\(\pm\)0.00 \\ \hline  & **GS-SFNN** & 55.84\(\pm\)16.66 & 35.60\(\pm\)0.92 & 98.75 & 42.24\(\pm\)8.69 & 0.003\(\pm\)0.000 & 2.50\(\pm\)0.45 \\  & **PSO-SFNN** & 79.01\(\pm\)8.96 & 61.05\(\pm\)22.36 & 87.14 & 192.66\(\pm\)12.37 & 0.004\(\pm\)0.000 & 4.83\(\pm\)1.82 \\
**SE** & **TWD-SFNN-R** & **80.89\(\pm\)0.29** & **78.31\(\pm\)0.36** & **87.14** & **13.84\(\pm\)0.038** & **0.002\(\pm\)0.000** & 2.00\(\pm\)0.00 \\  & **STWD-SFNN-NK** & 79.12\(\pm\)0.29 & 70.21\(\pm\)0.03 & 74.58 & 17.87\(\pm\)0.25 & **0.002\(\pm\)0.000** & **1.00\(\pm\)0.00** \\  & **STWD-SFNN** & **80.89\(\pm\)0.29** & **78.31\(\pm\)0.36** & **87.14** & 20.68\(\pm\)0.57 & 0.003\(\pm\)0.000 & 2.00\(\pm\)0.00 \\ \hline  & **GS-SFNN** & 46.78\(\pm\)17.71 & 52.19\(\pm\)17.94 & 90.43 & 40.34\(\pm\)9.08 & 0.005\(\pm\)0.000 & 3.20\(\pm\)0.72 \\  & **PSO-SFNN** & 89.71\(\pm\)2.35 & 80.99\(\pm\)18.17 & 86.00 & 108.00\(\pm\)9.76 & 0.007\(\pm\)0.001 & 5.64\(\pm\)1.91 \\
**HTRU** & **TWD-SFNN-R** & 91.75\(\pm\)0.27 & 92.68\(\pm\)0.21 & **98.34** & 10.188\(\pm\)0.55 & 0.005\(\pm\)0.001 & 2.00\(\pm\)0.00 \\  & **STWD-SFNN-NK** & 84.50\(\pm\)0.48 & 87.26\(\pm\)0.35 & 96.70 & **5.53\(\pm\)0.30** & **0.002\(\pm\)0.000** & **1.00\(\pm\)0.00** \\  & **STWD-SFNN** & **91.80\(\pm\)0.30** & **92.72\(\pm\)0.23** & **98.34** & 10.
1. Compared with GS-SFNN and PSO-SFNN, STWD-SFNN only has a learning process for all instances in the first turn, and the time cost required for the model gradually decreases as the size of BND decreases. However, GS-SFNN and PSO-SFNN need to spend more time on each turn of learning for all instances.
2. Compared with TWD-SFNN-R which may repeatedly handle the same difficult-to-classify instances in each turn, the sequential thresholds of STWD-SFNN can reduce the condition of partitioned instances in each turn. STWD-SFNN decomposes the more easily classified instances in BND at each granularity level, so as to gradually realize the partition of all instances.
3. Compared with STWD-SFNN-NK, STWD-SFNN adopts \(k\)-means++ discretization technology to increase the learning time of the model. Therefore, STWD-SFNN performs better than the competitive models on most cases.

#### 4.4.3 Comparison with other competitive models

To measure the efficiency of STWD-SFNN, we selected SVC, RF, and KNN as the competitive models. To guarantee the repeatability of the experimental results, SVC, RF, and KNN adopted the same random number seed in 10-fold cross-validation, that is, we fixed the random number seed in 10-fold cross-validation by utilizing rng(0). Fig. 6 shows the comparison of ROC curves of the classification models and STWD-SFNN. Table 5 compares the evaluation criteria of each model. The results give rise to the following observations.

1. The accuracy, weighted-f1, ROC, and AUC of STWD-SFNN are better than SVC, RF, and KNN on some datasets. For example, on the ONP dataset of Table 5, the accuracy, weighted-f1, and AUC of STWD-SFNN are 94.41%, 85.87%, and 57.87%, respectively, while the best-performing competitive model is RF, with 94.40%, 82.53%, and 52.96%, respectively. Meanwhile, as shown in Fig.5, the ROC curve of STWD-SFNN is at the left top of RF. Similar phenomena can be found in the other dataset. The reason is as follows. Compared with SVC, RF, and KNN, STWD-SFNN retains the ability of the neural network to capture the nonlinear relationship of data, and further enhances the performance of the model by adopting sequential three-way decisions. Therefore, in most cases, the generalization ability of STWD-SFNN is better than the competitive models.

2. STWD-SFNN has less training time and test time than SVC, RF, and KNN on some datasets. For example, on the PCB data set of Table 5, the training time and test time of STWD-SFNN are 5.44s and 0.002s, respectively. The competitive models with the least training time and test time are SVC and RF, with values of 200.21s and 0.049s, respectively. Similar phenomena can be found in other datasets. The reason is as follows. Compared with SVC, RF, and KNN, STWD-SFNN can greatly promote the learning process by constructing granularity layers and sequential thresholds, which can improve the operation efficiency of the model. Therefore, in most cases, STWD-SFNN is more efficient than other competitive models.

#### 4.4.4 Comparison with TWD-SFNN with 5-fold cross-validation

From the above-mentioned experimental results, STWD-SFNN has relatively better accuracy, network topology, and operating efficiency. However, the ROC and AUC of TWD-SFNN and STWD-SFNN are not significantly different in Fig. 5 and Table 4. To further illustrate the differences between TWD-SFNN and STWD-SFNN, we adopt a 5-fold cross-validation technique to conduct a further study on 15 datasets. Fig. 7 shows the comparison of ROC curves of TWD-SFNN and STWD-SFNN on 5-fold cross-validation. Table 6 reports the comparison of different evaluation criteria of those models. The results give rise to the following observations.

Table 6 shows that the accuracy, weighted-f1, and AUC of TWD-SFNN and STWD-SFNN have significant differences on some datasets. For example, on the ROE dataset, the accuracy, weighted-f1, and AUC of STWD-SFNN are 87.30%, 87.91%, and 82.48%, respectively, while those of TWD-SFNN are 83.82%, 85.01%, and 82.14%, respectively. Moreover, as shown in Fig. 7, the ROC curve of STWD-SFNN is located at the top left of TWD-SFNN, which means that the performance of STWD-SFNN is better than that of TWD-SFNN. The same conclusion can be found in ONP, QSAR, PCB, OD, and SSMCR datasets. Therefore, TWD-SFNN and STWD-SFNN have some differences under 5-fold cross-validation. It should be noted that whether TWD-SFNN and STWD-SFNN have significant differences under other folds is worth developing in the future.

#### 4.4.5 Analysis of STWD-SFNN

In this section, we analyze the relationship between the process costs and the number of hidden layer nodes in STWD-SFNN, including the costs of test and delay. According to Definition 6, without loss of generality, we randomly
Figure 6: Comparison of ROC curves of other classification models and STWD-SFNN
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline Dataset & Model & Accuracy (\%) & Weighted-f1(\%) & AUC (\%) & Training time(s) & Test time (s) \\ \hline \multirow{4}{*}{ONP} & SVC & 93.29\(\pm\)0.56 & **91.37\(\pm\)0.30** & 54.61 & 1284\(\pm\)117 & 1.015\(\pm\)0.129 \\  & RF & 94.40\(\pm\)0.43 & 82.53\(\pm\)18.34 & 52.96 & 124.20\(\pm\)1.80 & 0.059\(\pm\)0.008 \\  & KNN & 94.39\(\pm\)0.22 & 45.88\(\pm\)0.59 & 53.01 & - & 88.43\(\pm\)17.95 \\  & STWD-SFNN & **94.41\(\pm\)0.22** & 85.87\(\pm\)0.26 & **57.87** & **15.76\(\pm\)0.76** & **0.003\(\pm\)0.000** \\ \hline \multirow{4}{*}{QSAR} & SVC & 91.63\(\pm\)0.46 & 90.06\(\pm\)0.78 & 51.78 & 1.77\(\pm\)0.08 & 0.093\(\pm\)0.008 \\  & RF & **93.75\(\pm\)0.72** & **92.56\(\pm\)0.94** & **62.91** & 1721.7\(\pm\)68.20 & 0.092\(\pm\)0.013 \\  & KNN & 93.51\(\pm\)0.72 & 92.26\(\pm\)0.94 & 51.60 & - & 4.728\(\pm\)3.343 \\  & STWD-SFNN & 78.26\(\pm\)1.11 & 81.21\(\pm\)1.13 & 61.61 & **12.43\(\pm\)0.15** & **0.008\(\pm\)0.001** \\ \hline \multirow{4}{*}{OSP} & SVC & 70.31\(\pm\)18.50 & 63.23\(\pm\)19.50 & 64.46 & 349.12\(\pm\)56.78 & 0.048\(\pm\)0.008 \\  & RF & **90.47\(\pm\)0.49** & **89.97\(\pm\)0.51** & **78.16** & 63.11\(\pm\)0.19 & 0.025\(\pm\)0.001 \\  & KNN & 84.10\(\pm\)0.73 & 78.34\(\pm\)0.98 & 61.05 & - & 12.40\(\pm\)2.24 \\  & STWD-SFNN & 68.43\(\pm\)0.66 & 70.01\(\pm\)0.81 & 62.52 & **5.55\(\pm\)0.51** & **0.002\(\pm\)0.000** \\ \hline \multirow{4}{*}{EGSS} & SVC & 90.17\(\pm\)0.69 & 89.96\(\pm\)0.73 & 99.60 & **3.15\(\pm\)0.24** & 0.070\(\pm\)0.009 \\  & RF & **99.98\(\pm\)0.00** & **99.98\(\pm\)0.00** & **99.93** & 6.07\(\pm\)0.44 & 0.030\(\pm\)0.020 \\  & KNN & 99.68\(\pm\)0.17 & 99.68\(\pm\)0.17 & 72.12 & - & 81.13\(\pm\)7.13 \\  & STWD-SFNN & 85.63\(\pm\)0.70 & 85.91\(\pm\)0.67 & 98.30 & 7.09\(\pm\)0.37 & **0.003\(\pm\)0.000** \\ \hline \multirow{4}{*}{SE} & SVC & 84.77\(\pm\)0.20 & - & - & **24.22\(\pm\)1.14** & 1.981\(\pm\)0.016 \\  & RF & **99.92\(\pm\)0.03** & **99.92\(\pm\)0.03** & **99.83** & 49.26\(\pm\)3.10 & 0.376\(\pm\)0.020 \\  & KNN & 99.64\(\pm\)0.05 & 99.64\(\pm\)0.05 & 94.60 & - & 10324\(\pm\)2993 \\  & STWD-SFNN & 80.89\(\pm\)0.29 & 78.31\(\pm\)0.36 & 87.14 & 85.20\(\pm\)2.33 & **0.012\(\pm\)0.000** \\ \hline \multirow{4}{*}{HTRU} & SVC & 70.15\(\pm\)0.01 & 79.18\(\pm\)0.01 & 87.64 & 492.75\(\pm\)25.27 & 0.073\(\pm\)0.076 \\  & RF & 97.96\(\pm\)0.09 & **97.92\(\pm\)0.10** & 92.57 & **2.52\(\pm\)0.27** & 0.012\(\pm\)0.005 \\  & KNN & **97.97\(\pm\)0.12** & **97.92\(\pm\)0.13** & 64.26 & - & 92.01\(\pm\)10.42 \\  & STWD-SFNN & 91.80\(\pm\)0.30 & 92.72\(\pm\)0.23 & **98.34** & 10.43\(\pm\)0.61 & **0.004\(\pm\)0.000** \\ \hline \multirow{4}{*}{DCC} & SVC & 72.76\(\pm\)1.32 & 67.00\(\pm\)0.86 & **66.67** & 1041.81\(\pm\)27.23 & 0.248\(\pm\)0.064 \\  & RF & **81.84\(\pm\)0.44** & **79.85\(\pm\)0.60** & 66.65 & 131.16\(\pm\)34.93 & 0.339\(\pm\)0.022 \\  & KNN & 81.36\(\pm\)0.42 & 78.85\(\pm\)0.55 & 54.14 & - & 44.49\(\pm\)4.43 \\  & STWD-SFNN & 78.13\(\pm\)0.40 & 69.70\(\pm\)0.55 & 63.59 & **7.89\(\pm\)0.32** & **0.002\(\pm\)0.000** \\ \hline \multirow{4}{*}{ESR} & SVC & 80.00\(\pm\)0.96 & 80.35\(\pm\)0.01 & 51.99 & 12.99\(\pm\)0.51 & 1.327\(\pm\)0.051 \\  & RF & **97.58\(\pm\)0.18** & **97.58\(\pm\)0.18** & **95.12** & 610.17\(\pm\)138.52 & 0.113\(\pm\)0.010 \\  & KNN & 84.43\(\pm\)0.97 & 80.15\(\pm\)1.33 & 60.18 & - & 73.41\(\pm\)7.48 \\  & STWD-SFNN & 84.35\(\pm\)0.47 & 81.55\(\pm\)0.55 & 54.25 & **4.29\(\pm\)0.06** & **0.003\(\pm\)0.000** \\ \hline \multirow{4}{*}{BM} & SVC & 65.62\(\pm\)24.03 & 61.57\(\pm\)25.08 & 77.27 & 908.79\(\pm\)149.27 & 0.361\(\pm\)0.022 \\  & RF & **91.67\(\pm\)0.19** & **91.16\(\pm\)0.24** & **80.41** & 68.11\(\pm\)3.32 & 0.173\(\pm\)0.004 \\  & KNN & 89.41\(\pm\)0.32 & 86.98\(\pm\)0.42 & 59.52 & - & 234.01\(\pm\)35.35 \\  & STWD-SFNN & 87.56\(\pm\)0.34 & 82.85\(\pm\)0.48 & 78.80 & **15.19\(\pm\)0.36** & **0.003\(\pm\)0.001** \\ \hline \multirow{4}{*}{PCB} & SVC & 97.77\(\pm\)0.32 & 96.80\(\pm\)0.45 & 66.26 & 200.21\(\pm\)69.92 & 0.138\(\pm\)0.011 \\  & RF & **98.09\(\pm\)0.27** & **97.56\(\pm\)0.38** & **74.52** & 222.54\(\pm\)61.80 & 0.049\(\pm\)0.004 \\  & KNN & 97.84\(\pm\)0.32 & - & - & - & 29.27\(\pm\)5.60 \\  & STWD-SF
Figure 7: Comparison of ROC curves of TWD-SFNN and STWD-SFNN by adopting 5-fold cross-validation
\begin{table}
\begin{tabular}{c l c c c c c c} \hline \hline \multirow{2}{*}{Dataset} & \multirow{2}{*}{Model} & \multicolumn{2}{c}{Accuracy} & Weighted- & AUC & \multicolumn{1}{c}{Training} & \multicolumn{1}{c}{Test time (s)} & \multicolumn{1}{c}{Nodes} \\  & & (\%) & f1 (\%) & (\%) & time(s) & \multicolumn{1}{c}{Test time (s)} & \multicolumn{1}{c}{Nodes} \\ \hline \multirow{2}{*}{ONP} & TWD-SFNN-R & 92.33\(\pm\)0.20 & 90.94\(\pm\)0.23 & 56.87 & 35.29\(\pm\)0.29 & 0.015\(\pm\)0.002 & 3.00\(\pm\)0.00 \\  & STWD-SFNN & **94.39\(\pm\)0.24** & **91.70\(\pm\)0.35** & **62.45** & **30.63\(\pm\)0.90** & **0.008\(\pm\)0.001** & **1.00\(\pm\)0.00** \\ \hline \multirow{2}{*}{QSAR} & TWD-SFNN-R & 72.63\(\pm\)0.71 & 78.29\(\pm\)0.60 & 61.89 & **6.71\(\pm\)0.22** & 0.010\(\pm\)0.002 & **2.00\(\pm\)0.00** \\  & STWD-SFNN & **82.14\(\pm\)0.36** & **83.60\(\pm\)0.44** & **62.44** & 9.13\(\pm\)0.66 & **0.009\(\pm\)0.001** & 2.80\(\pm\)0.40 \\ \hline \multirow{2}{*}{OSP} & TWD-SFNN-R & **83.14\(\pm\)0.57** & **77.24\(\pm\)0.62** & **70.10** & 2.29\(\pm\)0.05 & **0.003\(\pm\)0.001** & **2.00\(\pm\)0.00** \\  & STWD-SFNN & **83.14\(\pm\)0.57** & **77.24\(\pm\)0.62** & **70.10** & **2.04\(\pm\)0.17** & **0.003\(\pm\)0.001** & **2.00\(\pm\)0.00** \\ \hline \multirow{2}{*}{EGSS} & TWD-SFNN-R & **87.67\(\pm\)0.60** & **87.91\(\pm\)0.56** & **97.05** & **4.23\(\pm\)1.14** & **0.004\(\pm\)0.000** & **1.00\(\pm\)0.00** \\  & STWD-SFNN & **87.67\(\pm\)0.60** & **87.91\(\pm\)0.56** & **97.05** & 4.76\(\pm\)1.16 & 0.004\(\pm\)0.001 & **1.00\(\pm\)0.00** \\ \hline \multirow{2}{*}{SE} & TWD-SFNN-R & **86.00\(\pm\)0.31** & **80.58\(\pm\)0.46** & **90.01** & 365.87\(\pm\)8.21 & **0.008\(\pm\)0.000** & **2.00\(\pm\)0.00** \\  & STWD-SFNN & **86.00\(\pm\)0.31** & **80.58\(\pm\)0.46** & **90.01** & **296.15\(\pm\)3.47** & 0.008\(\pm\)0.004 & **2.00\(\pm\)0.00** \\ \hline \multirow{2}{*}{HTRU} & TWD-SFNN-R & **91.84\(\pm\)0.40** & 92.76\(\pm\)0.29 & **98.10** & **9.02\(\pm\)0.34** & **0.007\(\pm\)0.002** & **2.00\(\pm\)0.00** \\  & STWD-SFNN & **91.84\(\pm\)0.40** & 92.76\(\pm\)0.29 & **98.10** & 18.68\(\pm\)2.99 & 0.012\(\pm\)0.006 & **2.00\(\pm\)0.00** \\ \hline \multirow{2}{*}{DCC} & TWD-SFNN-R & **78.13\(\pm\)0.30** & 69.70\(\pm\)0.32 & **63.07** & **7.81\(\pm\)0.07** & **0.004\(\pm\)0.000** & **2.00\(\pm\)0.00** \\  & STWD-SFNN & **78.13\(\pm\)0.30** & 69.70\(\pm\)0.32 & **63.07** & 14.12\(\pm\)1.30 & 0.007\(\pm\)0.002 & **2.00\(\pm\)0.00** \\ \hline \multirow{2}{*}{ESR} & TWD-SFNN-R & **84.33\(\pm\)0.26** & **81.52\(\pm\)0.37** & **56.23** & **6.18\(\pm\)0.73** & **0.006\(\pm\)0.001** & **2.00\(\pm\)0.00** \\  & STWD-SFNN & **84.33\(\pm\)0.26** & **81.52\(\pm\)0.37** & **56.23** & 14.88\(\pm\)1.26 & 0.011\(\pm\)0.003 & **2.00\(\pm\)0.00** \\ \hline \multirow{2}{*}{BM} & TWD-SFNN-R & **89.27\(\pm\)0.46** & **84.24\(\pm\)0.66** & **81.91** & **11.79\(\pm\)0.38** & **0.003\(\pm\)0.000** & **1.00\(\pm\)0.00** \\  & STWD-SFNN & **89.27\(\pm\)0.48** & **84.24\(\pm\)0.69** & **81.91** & 13.80\(\pm\)0.55 & **0.003\(\pm\)0.000** & **1.00\(\pm\)0.00** \\ \hline \multirow{2}{*}{PCB} & TWD-SFNN-R & 97.75\(\pm\)0.12 & 96.76\(\pm\)0.01 & 73.22 & **6.06\(\pm\)0.16** & **0.006\(\pm\)0.001** & **2.00\(\pm\)0.00** \\  & STWD-SFNN & **97.85\(\pm\)0.74** & **96.95\(\pm\)0.48** & **73.99** & 11.76\(\pm\)0.45 & 0.009\(\pm\)0.002 & **2.00\(\pm\)0.00** \\ \hline \multirow{2}{*}{SB} & TWD-SFNN-R & **89.51\(\pm\)1.20** & **67.61\(\pm\)30.85** & **79.32** & **0.96\(\pm\)0.19** & **0.002\(\pm\)0.001** & **1.80\(\pm\)0.40** \\  & STWD-SFNN & **89.51\(\pm\)1.20** & **67.61\(\pm\)30.85** & **79.32** & 1.16\(\pm\)0.23 & **0.002\(\pm\)0.001** & **1.80\(\pm\)0.40** \\ \hline \multirow{2}{*}{EOL} & TWD-SFNN-R & **86.26\(\pm\)1.30** & **82.68\(\pm\)1.33** & **70.07** & **0.50\(\pm\)0.06** & **0.001\(\pm\)0.000** & **2.00\(\pm\)0.00** \\  & STWD-SFNN & **86.26\(\pm\)1.30** & **82.68\(\pm\)1.33** & **70.07** & 1.46\(\pm\)0.23 & 0.002\(\pm\)0.001 & **2.00\(\pm\)0.00** \\ \hline \multirow{2}{*}{OD} & TWD-SFNN-R & 76.56\(\pm\)0.33 & 66.80\(\pm\)0.43 & 68.33 & **2.85\(\pm\)0.42** & **0.001\(\pm\)0.000** & **2.00\(\pm\)0.00** \\  & STWD-SFNN & **78.50\(\pm\)0.72** & **71.48\(\pm\)1.06** & **69.07** & 12.23\(\pm\)2.76 & 0.003\(\pm\)0.001 & **2.00\(\pm\)0.00** \\ \hline \multirow{2}{*}{ROE} & TWD-SFNN-R & 83.82\(\pm\)0.90 & 85.01\(\pm\)0.81 & 82.14 & **1.13\(\pm\)0.26** & **0.002\(\pm\)0.001** & **2.00\(\pm\)0.00
generate 10 incremental unit test costs in the real range [1.00, 50.00]. To ensure the repeatability of experimental results, the random number seed is 0, i.e., rng (0), and 10 values are generated as unit test costs: [1.00, 6.44, 11.89, 17.33, 22.78, 28.22, 33.67, 39.11, 44.56, 50.00]. The parameter settings of unit delay cost are the same as those of unit test cost. Fig. 8 shows the relationship between the process costs of STWD-SFNN on the training set and the number of hidden layer nodes. Since STWD-SFNN has only one hidden layer node on the ONP dataset, we analyze the process cost on the remaining fourteen datasets. The results give rise to the following observations according to Fig 8.

1. The test cost of STWD-SFNN increases with the number of hidden layer nodes. For example, on the HTRU dataset, according to Definition 6 and \([Cost_{\text{PPT}_{1}},Cost_{\text{PPT}_{2}}]=[1.00,6.44]\), the test costs of the first and second levels are 638.00 and 1540.22, respectively. Similar phenomena can be found in the rest 13 datasets. The reason is that the test cost of STWD-SFNN in the \(t\)-granular level is equivalent to the sum of the test costs of the first (\(t\)-1)-granular level and the \(t\)-granular level.

2. The delay cost of STWD-SFNN and the number of hidden layer nodes report two cases. Case 1: The delay cost tends to be constant with the increase of hidden layer nodes. For example, on the DCC dataset, according to Definition 6 and \([Cost_{\text{PPT}_{1}},Cost_{\text{PPT}_{2}}]=[1.00,6.44]\), the delay costs of the first and second levels are both 5275.00. The same conclusion can be found in OSP, EGSS, SE, ESR, BM, PCB, EOL, OD, and SSMCR. Case 2: The delay cost of STWD-SFNN increases with the number of hidden layer nodes. For example, on the HTRU dataset, the delay costs of the first and second levels are 638.00 and 902.22, respectively. This phenomenon can be found in QSAR and ROE datasets. Specifically, the SE dataset has both Case 1 and Case 2. The reason is that the delay cost of STWD-SFNN in the \(t\) granular level is equivalent to the maximum of the delay cost of the (\(t\)-1)-granular level and the \(t\)-granular level. Specifically, if the delay cost of the \(t\) granular level is not greater than that of the (\(t\)-1)-granular level, the delay cost shows a constant trend; otherwise, it shows an increasing trend.

## 5 Conclusion

Although TWD-SFNN can overcome the shortage of traditional SFNN and obtain a simpler network structure and better performance, it uses fixed threshold parameters to train the network model. Inspired by STWD, this paper proposes a new network topology optimization model, called STWD-SFNN, to enhance the performance of the network on structured datasets. STWD-SFNN adopts a sequential strategy to dynamically determine the number of hidden layer nodes. STWD-SFNN has two parts: discretion modular and training modular. Discretion modular adopts \(k\)-means\(++\) to convert numerical data into discrete data to meet the requirements of STWD for data types. The training modular, as the main part of STWD-SFNN, adopts a sequential strategy to dynamically determine the number of hidden layer nodes. Thus, STWD-SFNN has \(t\) levels. Each level has two parts: SFNN and STWD. SFNN is a network topology with one hidden layer node and gets correctly classified instances and misclassification instances. The first \(t\)-1 part of STWD utilizes the strategy of three ways, and the last part applies the strategy of two ways. The experimental results show that STWD-SFNN has higher operational efficiency and a more compact network structure than SFNN using empirical formulas, GS-SFNN, PSO-SFNN, TWD-SFNN-R, and STWD-SFNN-NK, and has a better generalization ability on structured datasets than the competitive models.

In this paper, we propose STWD-SFNN which improves the performance of SFNN. However, many aspects should be investigated in the future to enrich the theory of neural networks.

1. STWD-SFNN employs sequential three-way decisions to guide the growth of the topology of a single hidden layer neural network. However, for multilayer neural networks, how to adopt our model to handle XOR and other problems to further promote deep learning is worthy of investigation.
2. STWD-SFNN has good performance in binary classification problems by comparing the conditional probability of each instance belonging to the positive region and threshold parameters. For a multi-class classification problem, one method is to convert it into multiple binary classification problems. Obviously, this method is not very effective. How to adopt STWD-SFNN to solve multi-class classification is worthy of consideration.
3. STWD-SFNN adopts \(k\)-means\(++\) to discretize the data when calculating the conditional probability of instances, since STWD is a classification model established on the decision-theoretic rough sets and derived from nominal attributes. However, whether there is a better discretization model to transform non-integer data into integer data, or whether there are other rough set models that can essentially mine numerical or mixed data features.
Figure 8: Relationship between process costs and number of hidden layer nodes
## Acknowledgement

This work was supported by the National Social Science Fund of China under grant number 18BGL191.
