## 2 Method
### Recognition Model for Estimating Lateral Distance  
The camera layout is shown in Figure 5, wherein it can be seen that two downward cameras are placed in the rear-view mirrors. Relying on this placement, the region of interest (ROI) is limited to a small area around the vehicle, and most of the disordered information in the images can be eliminated to obtain a satisfactory low-resolution camera [39]. This study aims to build a model that can recognize a lateral distance between vehicle and lane boundaries. The \(Y_{L}\) and \(Y_{R}\) in Figure 5 denote the distance to the lane marking on left and right. As CNN is widely used in image recognition due to its good robustness, high accuracy, and efficiency, inspired by the method in [30], a deep CNN is used in this study to acquire a lateral distance between vehicle and two-lane boundaries directly without pre-processing and post-processing. The recognition of lateral distance is considered as a multitasking detection problem. For a given image \(X_{i}\), the label that indicates the distance between lane strip and vehicle is \(d_{i}\). The output vector of softmax layer is \(Y_{i}=(y_{0},y_{1},\ldots,y_{320})\). In fact, there are possibly no lanes on the road surface, so we assumed \(d_{i}=321\). Furthermore, the entry \(y_{k}\) is the probability that row \(k\) in image \(X_{i}\) contains the position of the lane marking. After the image \(X_{i}\) is fed through the network, the position of lane \(e_{i}\) is assumed the image row in line with the entry in \(Y_{i}\) with the maximum likelihood:  
\[e_{i}=\underset{0\leq k\leq 321}{\text{arg max}}y_{k} \tag{12}\]  
Figure 5: Extrinsic configuration of the side cameras and associated coordinate systems. In the training process of the model, the cross-entropy [40] that defined by (13) is introduced as the cost function, which is used as a criterion for measurement of the distinction between \(e_{i}\) and corresponding label \(d_{i}\). \[J(\eta)=-\frac{1}{m}{\sum\limits_{i=1}^{m}y^{(i)}\log\Bigl{(}h_{\eta}\Bigl{(}x^ {(i)}\Bigr{)}\Bigr{)}+\Bigl{(}1-y^{(i)}\Bigr{)}\log\Bigl{(}1-h_{\eta}\Bigl{(}x^ {(i)}\Bigr{)}\Bigr{)} \tag{13}\]  
where \(h_{\eta}(x^{(i)})=1/(1+e^{-\eta^{T}x^{(i)}})\) is the activation function, and \(m\) is the number of categories, \(\eta=(\eta_{0}\), \(\eta_{1}\),..., \(\eta_{p})\) are the set of model parameters, \(y^{(i)}\) is the ground truth value that corresponds to the label \(d_{i}\), and \(h_{\eta}(x^{(i)})\) is the predictive value. The essence of network training is to update the parameters of the CNN model, which guarantees that the output of network conforms to the reality. As a result, with the optimization of Adam [41], the model parameters are updated along with the direction of gradient of \(J(\eta)\). The update processes of parameters are as follows:  
(1) The first and second order moments of gradient are calculated by (14) and (15), respectively:  
\[m_{t}=\lambda_{1}\cdot m_{t-1}+\frac{(1-\lambda_{1})}{m}{\sum\limits_{i=1}^{m }\Bigl{(}h_{\eta}\Bigl{(}x^{(i)}\Bigr{)}-y^{(i)}\Bigr{)}x_{j}^{(i)}} \tag{14}\]  
\[n_{t}=\lambda_{2}n_{t-1}+\frac{(1-\lambda_{2})}{m^{2}}\Biggl{(}{\sum\limits_{ i=1}^{m}\Bigl{(}h_{\eta}\Bigl{(}x^{(i)}\Bigr{)}-y^{(i)}\Bigr{)}x_{j}^{(i)}} \Biggr{)}^{2} \tag{15}\]  
where \(\lambda_{1},\lambda_{2}\in[0,1]\) are the descent rates, and \(t\) denotes the \(t\)th iteration.