# Indoor-Outdoor Detection in Mobile Networks Using Quantum Machine Learning Approaches
## 4 Quantum Machine Learning Approaches
### Quantum Annealing-Based SVM  
The third approach is a quantum implementation of so-called kernel-based support vector machines (SVMs). SVMs are supervised machine learning algorithms for classification and regression problems. [PERSON] et al. proposed an approach to implement SVMs on a quantum annealer [43]. We use this approach and show the performance on the newest releases of the D-Wave quantum annealers. The approach involves the SVM being translated to a QUBO formulation. We assume a labelled dataset, containing \(N\) data points \((x_{n},y_{n})\), where \(x_{n}\) is a feature vector and \(y_{n}\in\{-1,1\}\) is the corresponding label. A first step is to formulate the SVM as a quadratic problem:  
\[\text{minimise}\,\left(\frac{1}{2}\sum_{n=1}^{N}\sum_{m=1}^{N} \alpha_{n}\alpha_{m}y_{n}y_{m}k(x_{n},x_{m})-\sum_{n}\alpha_{n}\right), \tag{11}\] \[\text{subject to}\,\,0\leq\alpha_{n}\leq C\quad\forall n=1,...,N,\] (12) \[\sum_{n=1}^{N}\alpha_{n}y_{n}=0, \tag{13}\]  
where \(\alpha_{n}\) is a coefficient, \(C\) a regularisation parameter and \(k(\cdot,\cdot)\) the kernel function. A commonly used kernel is the Gaussian kernel \(k(x_{n},x_{m})=e^{-\gamma||x_{n}-x_{m}||^{2}}\), using a hyperparameter \(\gamma>0\). The coefficients define a decision boundary that separates the vector space into two regions, corresponding to the predicted class labels. To translate this quadratic \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**N** & **F1** & **Acc** & **Pr** & **Rc** \\ \hline
256 & 1 & 1 & 1 & 1 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Overview of performance indicators for the validation data set for the distance-based classification trained on 256 data points. Figure 11: Resulting assignments of the distance-based classifier with 256 training data points and 44 validation points. programming formulation to a QUBO formulation, there are two main steps. First, the \(\alpha\)-values have to be translated to binary input, using the encoding:  
\[\alpha_{n}=\sum_{k=0}^{K-1}B^{k}a_{K_{n+k}} \tag{14}\]  
with \(a_{K_{n+k}}\in\{0,1\}\) binary variables, \(K\) being the number of binary variables to encode \(\alpha_{n}\) and \(B\) being the base used for the encoding, usually \(B=2\) or \(B=10\). More details about the choice for \(K\) can be found in [43]. The second step is to translate the constraints to the objective function, using a penalty factor \(\xi\) for a quadratic penalty. The resulting objective function then becomes:  
\[\frac{1}{2}\sum_{n,m,k,j}a_{K_{n+k}}a_{K_{m+j}}B^{k+j}y_{n}y_{m}k(x_{n},x_{m}) -\sum_{n,k}B_{k}a_{K_{n+k}}+\xi\big{(}\sum_{n,k}B^{k}a_{K_{n+k}}y_{n}\big{)}^{2}. \tag{15}\]  
If we want to solve this QUBO using the D-Wave hardware, the first approach is to directly embed this problem on the quantum chip. However, D-Wave also offers ready-to-use alternatives to solve the QUBO conventionally using simulated annealing. In this way, the problem does not have to be decomposed and can be calculated directly as a benchmark of using the QPU. In this implementation we also use cases where the ratio between the training data and the validation set equals \(75/25\). We use the parameters \(K=2\), \(B=2\), \(C=3\), \(\xi=5\) and \(\gamma=16\). Starting with the simulated annealing solver, we get the results as shown in Figure 12.  
Using the QPU, we are restricted by the size of the current architecture, namely 2000 qubits in a Chimera architecture or the 5000 qubits in the latest Pegasus architecture. Pegasus qubits have a degree of 15, i.e., they are externally coupled to 15 different qubits. When the problem is embedded onto the qubit structure, the number of available qubits and the limitations lead to problems. In most cases, it is not possible to find a correct embedding. Problem decomposition techniques can help to cut the problem into pieces, where each piece is solved separately and then combined back together. However, this is at the expense of the quality of the solution.