## 2 Proof-of-Concept Experiment and Algorithm
After grayscale value conversion, each pixel row will be arranged according to their grayscale values; hence, the blurred grayscale values due to water ripple and air bubbles can be arranged so that they will not be selected in the subsequent column matrix selection. In column matrix selection, grayscale values between 80% and 90% of the largest value are selected. The reason for the 80-90% threshold is explained as follows: Since we have rearranged the data according to the grayscale value (i.e., brightness) of each pixel in each individual row, the far right and far left values represent the highest brightness and lowest brightness, respectively. We know that overexposed or excessively bright pixels will be placed at the far right, and overly dark pixels, due to uneven brightness distribution, will be placed at the far left. The 80-90% threshold range was determined empirically after multiple trials, which consistently showed that this range best preserves the intended brightness distribution. Hence, those grayscale value columns which are too dark/bright for identifying all four levels of PAM4 signal can be removed. After column matrix selection, the payload and header will be identified. Then, pixel per symbol (PPS) and re-sampling rate are calculated to make sure the same number of pixels is used in each logic symbol for the CuDNNLSTM label. Here, one-hot encoding is performed. The GPU used was an Nvidia(r) GeForce RTX3050. Figure 3: Mechanism of RS operation of the CMOS camera, and the ambiguity produced when the LED Tx “ON” state occurs during part of the pixel row exposure time. The details of the CuDNNLSTM model are shown in Figure 5. The CuDNNLSTM model consists of two CuDNNLSTM layers working within the GPU, producing better runtime performance and accuracy. As shown in Figure 5, the numbers of neuron cells used in the two CuDNNLSTM layers are 32 and 16, respectively. After this, three fully-connected dense layers are used. These three fully-connected dense layers have 32, 16 and 16 neuron cells, respectively. There are two dropout layers to prevent overfitting after the first two fully-connected dense layers. Finally, an output layer obtains the output probabilities of the four levels in the PAM4 signal. The activation function and loss function are ReLU and categorical cross entropy, respectively. The optimizer is Adam for updating parameters. Softmax is used at the output layer to predict the four different logic probabilities. Figure 5 also shows the CuDNNLSTM cell in the first two CuDNNLSTM layers. The detail of the CuDNNLSTM cell can be found in [31]. There are several parameters used in the CuDNNLSTM cell: \(x_{t}\), \(x_{t-1}\), \(x_{t+1}\), \(h_{t}\), \(h_{t-1}\), \(h_{t+1}\), representing the current input, input of last time-step, input of next time-step, hidden state of current cell, hidden state of previous cell, and hidden state of the next cell, respectively. There are three gates in each CuDNNLSTM cell, namely forget gate, memory gate, and output gate. The forget gate decides what kind of information is to be erased, while the memory gate determines what  
Figure 4: Architectures of the image and data processing model and the machine learning model. Figure 5: Detailed architecture of the CuDNNLSTM model. kind of new information to memorize. The output gate generates outputs based on the CuDNNLSTM cell state after different operations. Equation (1) is the forget gate operation, where \(W\) and \(B\) are the weight and base, respectively. \(\sigma\) is the sigmoid activation function. \[F_{t}=\sigma(W_{F}[x_{t},h_{t-1}]+B_{F}) \tag{1}\]  
Equation (2) is the memory gate operation. \[I_{t}=\sigma(W_{I}[x_{t},h_{t-1}]+B_{F}) \tag{2}\]  
Equations (3) and (4) are the temporary and the current cell state operations, respectively. \[C_{t}^{\prime}=\tanh(W_{C}[x_{t},h_{t-1}]+B_{C}) \tag{3}\]  
Figure 2:0  
As shown in Equation (4), the current cell state can be obtained from the forget gate and the memory gate by multiplying the cell state in its last time-step by the temporary cell state.