# Design of an SVM Classifier Assisted Intelligent Receiver for Reliable Optical Camera Communication
## 3 OCC System Overview
### Proposed SVM Classifier Assisted Intelligent Receiver  
#### 3.3.1 LED Region Detection by a Convolutional Neural Network  
The workflow of the proposed intelligent receiver system is depicted in Figure 5. The receiver system consists of a CMOS based image sensor that collects optical signals transmitted through the optical channel. We have used the 'Microsoft LifeCam Cinema Webcam' as the receiver during the experiment. Since the captured color image is formed by the combination of three color channels, we have denoted the capture image by \(I_{u\times v\times 3}\), where \(u\) and \(v\) represent the height and width of the images. The captured image is resized into \(512\times 512\), and the resized image is given as an input to the object classifier designed by the CNN algorithm. These algorithms are eligible to extract image features automatically and can learn from those features effectively. To perform the LED detection, the CNN model has been trained by the images of our used LED captured in our lab environment. We have taken 2500 images to build our data set. Images from different angles and distances  
Figure 3: Overall OCC architecture with the proposed classifier model.  
are considered in our data set to train the CNN model more accurately. The CNN model recognizes all light source regions \(I_{u1\times v1\times 3}^{1},I_{u2\times v2\times 3}^{2},I_{u3\times v3\times 3 }^{3},\ldots,I_{uu\times vm\times 3}^{n}\), where \(n\) is the total number of LEDs in the frame by performing the functions like region proposal, feature extraction, classification, etc. Several layers inside CNN, namely convolutional layers, pooling layers, and fully connected (FC) layers, perform those functions, but the convolutional layer is the main part of CNN. The convolutional layers are composed of a convolutional kernel that is used to generate the proposed region and feature maps from the original image. The convolutional kernel can be of many sizes. In our training phase, we have used ten \(4\times 4\) convolutional filters in the first convolutional layer and twenty \(4\times 4\) convolutional filters in the second convolutional layer. The convoluted output is estimated by the following equation [30]:  
\[y=\sum_{q=0}^{q-1}\sum_{p=0}^{p-1}(w_{pq}x_{a+1,b+p}+\Theta),(0\leq a\leq a_{f}, 0\leq b\leq b_{f}). \tag{8}\]  
Figure 4: Illustration of the FSOOK modulation technique and data packet architecture.  
Figure 5: Workflow inside the proposed intelligent OCC receiver.  
Max pooling with a \(2\times 2\) filter and 2 strides is further used in another two layers to reduce the spatial size of the warped images and computation in the network resulting in being less prone to overfitting preserving all features. This pooled feature map was flattened into one column while passing through the FC layer. Here, the FC layer tries to determine the most correlated features of a particular class. The non linear softmax function is used to classify LEDs at the dense layer from other objects in the image frame. The 'Adam' optimizer has been used to optimize our CNN model. As part of the optimization process, the cost function, conventionally called loss function, is required to calculate the error at each cycle of the training of our CNN model. Among various cost functions, we have considered 'binary cross-entropy' function in our work since we needed to recognize whether the object in the image frame is the LED or not. Now, using the chosen optimizer and cost function, the CNN model tries to reduce the error by updating weights in each layer of the neural network.