# Deep Learning for Joint Adapatations of Transmission Rate and Payload Length in Vehicular Networks
## 4 Deep Learning for AMCPLS in IEEE 802.11p V2V Networks
### Deep Convolutional Neural Network Structure  
The structure of the used deep convolutional neural network (DCNN) incorporates six convolutional layers, two average pooling layers, and two fully connected layers, as depicted in Figure 3 and Algorithm 1. Particularly, each of the first, third and fifth convolutional layers has 15 filters. Also, each of the second, fourth, and sixth convolutional layers has 10 filters. All convolutional layers utilize filters of size \(5\times 1\) and rectified linear unit (ReLU) activation function. One of the average pooling layers is after the second convolutional layer, and the second average pooling layer is after the third convolutional layer. Each of the pooling layers has a pool size of four. The first fully connected layer has 50 neurons with ReLU activations. The last layer is a fully connected layer with a number of neurons that is equal to the number of classes. This last layer utilizes softmax activation function. The second norm regularization is adopted in the two fully connected layers in order to alleviate the effect of overfitting [22]. The adam optimizer [25] along with the categorical cross entropy loss function are used for training the DCNN. The DCNN is trained for 100 epochs with a batch size of 100.  
After the DCNN is trained, the receiver can employ it to anticipate the appropriate transmission class, i.e., the optimal combination of MCS and payload length. Then, the receiver feedbacks the MCS and payload length to the transmitter for considering them in the transmission of the next frame. Note that although the channel is varying over different frames, we use the channel estimates of the current frame to construct the input features to DCNN for predicting the suitable transmission class of the next frame. Since the channels between two adjacent frames have high correlations, this feedback mechanism is still rather robust (please see the performance evaluation of our DCNN based AMCPLS scheme in Section 5.2).  
```
1:Input layer
2:First convolutional layer with 15 filters, each of size \(5\times 1\), and relu activation.
3:Second convolutional layer with 10 filters, each of size \(5\times 1\), and relu activation.
4:First average pooling layer with pool size of 4.
5:Third convolutional layer with 15 filters, each of size \(5\times 1\), and relu activation.
6:Second average pooling layer with pool size of 4.
7:Fourth convolutional layer with 10 filters, each of size \(5\times 1\), and relu activation.
8:Fifth convolutional layer with 15 filters, each of size \(5\times 1\), and relu activation.
9:Sixth convolutional layer with 10 filters, each of size \(5\times 1\), and relu activation.
10:Flatten layer.
11:First fully connected layer with 50 neurons, relu activation, and \(l_{2}\) regularization.
12:Second fully connected layer with \(A\) neurons, softmax activation, and \(l_{2}\) regularization.
```  
**Algorithm 1** Proposed DCNN structure  
We remark here that although the training of the DCNN for AMCPLS needs extensive computational resources and is time-consuming, it can be implemented offline in clouds. After the DCNN weights are finalized by the training process, we deploy the trained DCNN in the receiver of vehicles for making online AMCPLS. The implementation of DCNN on vehicles can employ FPGA or ASIC that can be optimized to compute the outputs of neurons in parallel. Furthermore, unlike the training process, the prediction process of DCNN does not require heavy processing as it involves only  
Figure 3: The proposed deep convolutional neural network model.  
matrix multiplication, addition and nonlinear activation. Therefore, the proposed DCNN for AMCPLS can actually have a lower computation latency.