# Resource Allocation in Downlink VLC-NOMA Systems for Factory Automation Scenario
## 3 Proposed Resource Allocation Schemes
### DNN-Based Power Allocation  
In this subsection, DBPA for power allocation between NU and PU is described. A multi-layer perceptron (MLP) is adopted for power allocation between NU and FU. An MLP is a class of feedforward artificial neural networks. It comprises an input layer, one or more hidden layers, and an output layer. The proposed MLP model comprises two hidden layers. A detailed model description is shown in Table 2. The input layer consists of three nodes--that is, the channel gains between NU and FU from the transmitter, and the noise level. The channel gains are calculated by (1), which considers the distance and angles between the LED and node. Therefore, channel gains can be considered representative of  
Figure 4: (**a**) OMA frame structure; (**b**) NOMA frame structure. Figure 5: Deployed nodes and LED for factory automation. parameters such as the distance and the angles. Then, we assume noise levels \(N_{0}\) are the same for all nodes. The output layer consists of one node, which is the power allocation factor for NU, \(p_{n}\). The power allocation factor for FU, \(p_{f}\), is not included in the output because we can obtain it by subtracting \(p_{n}\) from 1. This implies that the power factors for both users can be expressed as \(1=p_{n}+p_{f}\). Additionally, the rectified linear unit (ReLU) was adopted as the activation function. It has two additional major benefits: sparsity and reduced likelihood of vanishing gradient. The activation function of this model, ReLU \(f\), is defined as follows:  
\[f(x)= \begin{cases}0&\text{if }x<0,\\ x&\text{if }x\geq 0.\end{cases}  \tag{28}\]  
This model consists of two hidden layers; its equation is expressed as  
\[Y=f(f(XW_{1}^{T})W_{2}^{T})W_{3}^{T}). \tag{29}\]  
\(X\) is the input vector consisting of the channel gains between users and the transmitter and the noise level, \(W\) is the weight vector of each layer, and \(T\) is the transpose. The output \(Y\) is the power ratio for NU, \(p_{n}\). Using the regression output of the model, the power ratio between NU and FU can be obtained. Based on (14) and (26), the average BER of both NU and FU with imperfect SIC can be calculated. As the study focuses on improving reliability, the minimum point of the average BER for NU and FU can be determined by changing the power allocation factor. Therefore, the power allocation factor that results in the minimum average BER can be used as a dataset compared with the model's output. The equation of average BER on power ratio for NU and FU is as follows:  
\[ \begin{split} p(e|h_{n},h_{f},p_{n})=\frac{1}{8}\bigg{[}\bigg{(} erfc\bigg{(}0.5h_{f}\sqrt{\frac{E_{b}}{N_{0}}}\bigg{)}+erfc\bigg{(}(0.5-p_{n})h_{ f}\sqrt{\frac{E_{b}}{N_{0}}}\bigg{)}\bigg{)},\\ +\bigg{(}2-0.5\bigg{(}erfc\bigg{(}0.5h_{n}\sqrt{\frac{E_{b}}{N_{0} }}\bigg{)}+erfc\bigg{(}(0.5-p_{n})h_{n}\sqrt{\frac{E_{b}}{N_{0}}}\bigg{)}\bigg{)} \bigg{)}erfc\bigg{(}\frac{p_{n}h_{n}}{2}\sqrt{\frac{E_{b}}{N_{0}}}\bigg{)}\\ +\bigg{(}erfc\bigg{(}0.5h_{n}\sqrt{\frac{E_{b}}{N_{0}}}\bigg{)}+ erfc\bigg{(}(0.5-p_{n})h_{n}\sqrt{\frac{E_{b}}{N_{0}}}\bigg{)}-\bigg{(}erfc \bigg{(}(1-1.5p_{n})h_{n}\sqrt{\frac{E_{b}}{N_{0}}}\bigg{)}\\ +\frac{1}{\sqrt{\pi}}\int_{-\frac{1}{2}h_{n}\sqrt{\frac{E_{b}}{N_{0 }}}}^{\frac{p_{n}h_{n}\sqrt{\frac{E_{b}}{N_{0}}}-2h_{n}\sqrt{\frac{E_{b}}{N_{0 }}}}{2\sqrt{N_{0}}}}e^{-z}dz\bigg{)}\bigg{]}.\end{split}  \tag{30}\]  
\(h_{n}\) and \(h_{f}\) are the channel gains for NU and FU, respectively. \(P_{n}\) is the power allocation ratio for NU. The minimum average BER can be determined by iteratively changing \(p_{n}\) from zero to one. However, finding the minimum average BER iteratively takes a lot of time in a real-time situation. Instead, an iterative method can be used to create datasets for training the model. The power ratio, which can make the minimum average BER, can be used as a training dataset. As shown in Figure 6, datasets for training a DNN model for DBPA are generated. First, the locations of FU and NU are randomly generated.