# Compensating Uncertainties in Force Sensing for Robotic-Assisted Palpation
## 3 Neural-Network-Based Modelling of Inertial Force and Compensation  
In order to get the accurate model of inertial force during the dynamic robotic motion, a neural-network-based approach is used. The general structure of the feed-forward fully-connected artificial neural network (ANN) can be viewed in Figure 4, in which a three-layer neural network is presented, namely the input, hidden and output layers. The input layer passes the \(n_{in}\)-dimensional input vector (feature vector) to the hidden layer and then to the output layer. In a more detailed way, the output of the \(i\)-th node in the input layer is given as follows:  
\[f_{i}^{(1)}(t)=x_{i}(t),i=1,2,\ldots,n_{in}, \tag{6}\]  
and the output of the \(j\)-th node in the hidden layer is given as follows:  
\[f_{j}^{2}(t)=tf^{(1)}\Big{(}\sum_{i=1}^{n_{in}}w_{ji}^{(1)}f_{i} ^{(1)}(t)+b_{j}^{(1)}\Big{)},\] \[j=1,2,\ldots,n_{h}, \tag{7}\]  
where \(tf^{(1)}(\cdot)\) denotes the transfer function for the hidden layer, \(n_{h}\) denotes the number of hidden nodes, \(b_{j}^{(1)}\) denotes the bias in the hidden layer, and \(w_{ji}^{(1)}\) denotes the weight between the \(j\)-th node in the hidden layer and the \(i\)-th node in the input layer.  
The \(j\)-th output of the neural network is given as follows:  
\[y_{j}(t)=tf^{(2)}\Big{(}\sum_{i=1}^{n_{h}}w_{ji}^{(2)}f_{i}^{(2) }(t)+b_{j}^{(2)}\Big{)},\] \[j=1,2,\ldots,n_{out}, \tag{8}\]  
where \(tf^{(2)}(\cdot)\) denotes the transfer/activation function for the output layer, \(n_{h}\) denotes the number of hidden nodes, \(b_{j}^{(2)}\) denotes the bias in the output layer, and \(w_{ji}^{(2)}\) denotes the weight between the \(j\)-th node in the output layer and the \(i\)-th node in the hidden layer.  
Figure 4: A three-layer feed-forward fully-connected neural network. In the proposed force compensation approach, the input of the neural network is the state feature of the force sensor during moving and the output the force response of the force sensor.  
It has been proved that the three-layer neural network is capable of approximating any smooth nonlinear function in a compact domain to an arbitrary accuracy [37]. Given that the structural complexity indicates the over-fitting issue, the above three-layer structure is adopted in the proposed approach without increasing the layers to improve the generalization of the model.  
To eliminate the effects of inertial force, unknown disturbance and uncertainty from the output of the force sensor, it is helpful to build the model of the force sensor. In the model, the state information of movement will be utilized as the input of the model while the force output of the force sensor will be used as the output of the model. During the model design process, we seek to observe the relationship between the movements and the outputs of the force sensor, thus the model can be employed to compensate the output of the force sensor. By considering the mapping from the input to the output, it is natural to adopt the supervised learning method [38]. It is worth mentioning that the artificial neural-network-based approaches are reported in [37; 39], in which the ANN-based methods are used to successfully classify the materials by the force sensor. In this paper, we propose the neural-network-based approach to model the force sensor in a supervised learning manner.