## 3 System Principle
### LED Recognition  
We extracted six features, so the feature space is six-dimensional space; that is, all test set data are in a six-dimensional space (data from a system similar to LED5 and LED6 is five-dimensional). Furthermore, in our case, for two different LEDs, data is linearly separable. To achieve the recognition of RGB-LED-IDs, in the machine learning field, there are two typical linear classifiers that can be used in this case: a linear support vector machine (SVM) and a back propagation network (BP-network). Select training samples and test samples: 150 groups of LED-ID images taken at different distances were selected, where 120 groups were used as training samples, and the other 30 groups were used as test samples. Part of the input data and classification are shown in Table 1.  
* Support Vector Machine  
SVM is based on the concept of decision planes that define decision boundaries. A decision plane is one that separates between a set of objects having different class memberships. For the linearly separable samples, the optimal classification hyperplane can separate the instances into two categories [22]. We briefly introduce the mathematical principles of SVM as follows: For a two-class case, let the \(x_{i}\), \(i=1,2,\ldots,n\), (\(n=4\) in our case) be the feature vectors of the training set \(x\). The general SVM classification can be described as a mathematical optimization problem:  
\[ \begin{array}{l}\underset{w,p}{\operatorname{argmin}}\frac{1}{2}\parallel w \parallel^{2}\\ \text{s.t.}\,y_{i}(w^{T}x_{i}+b)\geq 1\end{array}  \tag{8}\]  
Once more, the goal is to find a hyperplane that classifies all the training vectors correctly:  
\[f(x)=w^{T}x+b \tag{9}\]  
where \(w\) determines the direction of hyperplane, which has the same dimension of \(x\), \(w^{T}\) represents the transpose of \(w\), and \(b\) determines the exact position of the hyperplane in space. Such a hyperplane is not unique, therefore we define the geometrical margin as:  
\[z=\frac{|f(x)|}{w} \tag{10}\]  
which represents the geometrical distance from the samples to the hyperplane. To get the optimal hyperplane, we aim to maximize \(Z\). Since the value of \(|f(x)|\) can be changed by scaling \(w\) and \(b\), when we make it equal to 1, the solution we have to find is to search the maximum \(\frac{1}{|w|}\). Figure 12: Calculate the skewing. With the help of a Laplace operator, the problem is:  
\[f(x)=\sum_{i=1}^{n}y_{i}\alpha_{i}\langle x,x_{i}\rangle+b \tag{11}\]  
where \(y_{i}\) is the corresponding class indicator of \(x_{i}\) (+1 for \(w_{1}\), \(-1\) for \(w_{2}\)), \(\alpha_{i}\) is the Lagrange multiplier, and \(\langle x,x_{i}\rangle\) represents the vector inner product. A schematic diagram of the SVM classification is shown in Figure 13.  
\(\bullet\) BP-Network  
Artificial neural networks (ANNs) also known as neural networks (NNs), which are based on the physiological research results regarding the brain, is a mathematical model of a simulation of a biological neural network to process information, to simulate certain mechanisms of the brain, to achieve some aspect of function. Self-organizing competitive neural networks and BP neural networks are usually used for classification and pattern recognition [23]. In our case, the BP neural network classifier is designed to classify the different LED-IDs. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline  & \multicolumn{6}{c}{**Input Data**} & \multirow{2}{*}{**Classification**} \\ \hline
**Area (Pixel2)** & **Num R** & **Num G** & **Num B** & **Du-Ra (\%)** & **Skewing** \\ \hline  
\ \hline \hline \end{tabular}
\end{table} 
Table 1: Part of the input data and classification. Figure 13: An example of a linearly separable two-class problem with two possible linear classifiers. Initialize the network: A random initial value of connection weights and thresholds between the nodes of each layer is established between \((-1,1)\), which is usually generated by random functions.