Abstract

Offshore channel clearance is an essential underwater task to protect vessels and divers effectively, but current underwater target classification relies heavily on operator identification. Machine learning provides highly accurate methods for image classification as well as detection. In this paper, a new hybrid quantum-classical classification algorithm is proposed. It uses quantum devices to reduce dimension and denoise data sets, greatly reducing the difficulty of classical computer processing data. Using abundant classical classification algorithms, the classification problem of different scenarios can be processed, improving the classification efficiency. Using two kinds of underwater object data sets as examples, the numerical simulation results show that the quantum algorithm can accurately achieve dimensionality reduction. This hybrid algorithm has polynomial acceleration in dimension reduction than classical methods, even considering the classical readout of quantum data. The results also show that the classification accuracy of the training set improves from 0.772 to 0.821 compared to the original dataset. Furthermore, different classical classifiers can be selected in the case of different objects, so this hybrid algorithm has broad application prospects in different fields.

1. Introduction

Underwater target classification research is of great significance in both military and civilian area. In the military area, it is helpful to find mines and torpedoes, etc., and in the civilian area, it is helpful to find fish schools and underwater exploration [1]. Underwater detection typically requires operations that last for several months, making it particularly necessary to have a fast and resource-efficient method. Active sonar is an essential device for underwater detection at this stage. However, due to the complex topography of the seafloor, especially in shallow waters, sediments, reefs, submarine ridges, and ship radiation, can lead to a large number of miscellaneous false alarms mixed with echo signals, so the efficiency accurate classification of sonar data critical [2]. Compared with common classification problems, underwater target classification faces more challenges.

In the past few decades, the continuous improvement of computer computing power and machine learning algorithms have made it possible for more and more tasks that used to be done by humans to be replaced by machines [3], such as image recognition and classification. In some areas, machine learning or artificial intelligence has shown the ability to surpass the highest level of humans, such as Alpha-Go and Alpha-Zero. For a classification problem, many algorithms can be used, like Logistic Regression, Linear Discriminant Analysis, Decision Tree, Gaussian Process, K Nearest Neighbors, Neural Net, Random Forest, and Support Vector Machine (SVM) [4]. If the dimensions of a dataset are much high and have lots of redundant information, it is necessary to preprocess these data like dimension reduction (DR). The common DR methods are Linear Discriminant Analysis, Principal Component Analysis, Hotelling Transform, Multiple Dimensional Scaling, Isometric Mapping, and Locally linear embedding [5].

However, with the continuous development of machine learning algorithms, the computational resources required are also increasing. For example, deep neural networks, as a powerful machine learning model, have achieved many tasks that were previously difficult for computers to accomplish. As its capabilities increase, the resources required for deep neural networks are enormous and may even increase exponentially with the size of the problem being processed. To solve this challenge, scientists have proposed many new computational models [6], and quantum computers are one of them. A quantum computer is a computer designed according to the principles of quantum mechanics, which is consistent with the principles of quantum mechanics and has advantages that classical computers do not have [7]. Currently, prototype quantum computers have been built and have achieved computing power beyond that of classical computers for specific problems. If a general-purpose quantum computer is available, how to use quantum computers to achieve processing and solving of classical problems is also an important issue. In the last two decades, many quantum algorithms have been proposed [811], often with polynomial or exponential speedups over the corresponding classical algorithms.

In this paper, a new hybrid quantum-classical algorithm is proposed to achieve the classification of data. The algorithm first uses the quantum resonant transition algorithm to reduce the dimensionality of the data and then uses a classical computer to perform the classification process. As a result, the dimensionality of the data after dimensionality reduction is much smaller than before dimensionality reduction. Usually, the classical classification algorithms used on classical computers are unrestricted. In this paper, we choose the SVM with a simple model, strong interpretability, and good robustness as an example for numerical simulation. Using the underwater sonar dataset, our hybrid algorithm can process these data faster than directly using classical classifier in theory, and the accuracy also has a little improvement.

This paper is structured as follows. Section 2 briefly introduces principle component analysis (PCA) dimensionality reduction, SVM, and quantum resonant transition algorithm. Section 3 introduces the hybrid classifier based on quantum dimensionality reduction, and its numerical simulation results are shown in Section 4. Section 5 discusses the complexity of algorithm, outlook, and conclusion.

2. Brief Review of the Theory

2.1. Principal Component Analysis for Dimension Reduction

This section provides a brief introduction to dimensionality reduction. Dimension reduction is a commonly used tool in machine learning, which is usually a method of projecting high-dimensional samples into a low-dimensional space and retaining as much valid information as possible. In classical computing, the time that a machine learning algorithm takes to learn, i.e., the time complexity, usually grows polynomially or exponentially with the dimensionality of the data to be processed. When the dimensionality of the data to be processed is enormous, it will greatly increase the time required for training. However, many times such huge data dimensions have much redundant information. If the critical information can be retained while the redundant information is removed, the dimensionality of the data can be greatly reduced, thus reducing the training time. In addition, in some cases, dimensionality reduction can also remove some noise from the data, improve accuracy, reduce the resources needed for storage, etc.

There are several dimensionality reduction methods, such as decision trees, random forests, and principal component analysis dimensionality reduction. Here, we only introduce PCA dimensionality reduction. PCA dimensionality reduction can be described as the following process: the dimensional matrix composed of - dimensional samples is decomposed into singular values to obtain nonzero singular values and the - dimensional left singular vectors and - dimensional right singular vectors correspond to these singular values. The first right singular vectors are taken, and the projection of the - th sample on these first right singular vectors are calculated separately, and the new vector formed by these projections is the reduced dimensional vector. The process can be described by the following equation: - dimensional vectors form the sample matrix, haswhere is the - th singular value from large to small, and are the - th singular vectors, and is the rank of . For the - th sample vector , its reduced dimensional vector can be written asif the same operation is performed for all samples, the dimensionality reduction of the data can be achieved, and finally, the new sample matrix after dimensionality reduction is obtained.

2.2. Support Vector Machine

Support vector machine is a well-known classification algorithm in classical machine learning, centered on finding a hyperplane in the sample space to distinguish between two classes of samples, thus predicting the classification of a new sample classification. Many new techniques based on SVM have also been developed, leading to nonlinear classification and multiclassification tasks. In this paper, the support vector machine is chosen mainly because of the following reasons: the results are usually stable for the same samples; they have moderate computational complexity; they have good interpretability.

SVM can be summarized as the following process: for linearly divisible samples , there exists a hyperplane to separate them such that the distance from any sample point to that plane is greater than or equal to 1. and are the normal vectors and intercepts of the hyperplane. For linearly indivisible samples, the original feature space is first mapped to a high-dimensional feature space, and then there exists a hyperplane to separate them where is the mapping function that can be replaced by a kernel function to simplify the computation [12]. The commonly used kernel functions are the polynomial kernel, radial basis function kernel, Laplacian kernel, and Sigmoid kernel.

2.3. Quantum Resonant Transitions

Quantum resonant transition (QRT) is a common quantum phenomenon. In 2016, Wang used QRT to design a quantum algorithm for solving the eigenproblem [13], which solves the energy spectrum and eigenstates of the molecular Hamiltonian. Li et al. used this algorithm to achieve the solution of the eigenenergy and the ground state of the Hamiltonian of the water molecule on an NMR platform in 2019 [14]. In 2021, Li et al. used the algorithm to achieve the principal component analysis of a 4-dimensional Ermey matrix on a diamond-nitrogen vacancy center and obtained the maximum singular value corresponding to this density matrix [15].

The QRT algorithm is usually implemented by simulating such a Hamiltonianwhere is Pauli matrix and is coupling strength, which will affect the final error. The first term is the energy of the ancillary qubits, is usually needed to be adjusted in the calculation. The second term is the reference point of the input state . There are different settings in different cases and usually, takes 0 or 1, which is usually fixed in one calculation. is the Hermitian matrix corresponding to the problem to be solved, such as the covariance matrix corresponding to the sample matrix mentioned above. is the resonance strength, which usually needs to be smaller than the energy interval of . is the matrix describing the interaction, and the unitary matrix is taken in the PCA problem. For an initial state , the quantum state has a certain probability of evolving from to when approaches some eigenvalue of the matrix , where is the eigenstate of the matrix corresponding to the eigenvalue . By changing the parameter , the eigenvalues of can be obtained from the measurement of the ancillary qubits, and then the corresponding eigenstate can be prepared. In this section, only the general QRT algorithm is introduced, and how to use QRT to achieve PCA dimensionality reduction will be introduced in the next section.

3. Quantum-Classical Hybrid Classifier

In the previous sections, we have introduced QRT, PCA, and classical classification algorithms. This section will describe how to use these to construct an effective hybrid quantum-classical classifier.

There are many existing classical classification algorithms, each of which has its advantages and disadvantages, while quantum computing can solve some problems efficiently due to its parallel and coherent nature. This hybrid algorithm, which uses QRT to achieve PCA-DR and classical classifier to classify data, combines the two and gives full play to their respective advantages to accomplish the classification task more accurately and efficiently.

Here, we assume that the first eigenvalues of are obtained by arbitrary eigensolver like variational quantum eigensolver [16], quantum phase estimation [17] and classical algorithms. Firstly, we prepare the state in quantum register where is the computational basis, is the - th element of , and is the norm of . The input state is . Next, the core step of QRT-based PCA DR is simulating this Hamiltonianwhere is the resonant parameter. is the -th eigenvalue of . If we set evolution time , the state after Hamiltonian simulation operator is as follows [13]:then we use quantum amplitude estimation just for ancilla qubit to obtain the element of sample after DR.

Repeating it for each sample vector and first eigenvalues, the final matrix after PCA-DR can be obtained in classical. Taking and as the input data, different classical classifier can be chosen to predict the label . The algorithm is shown in Algorithm 1:

Require: Sample matrix where row is .
Ensure: Predicted label .
(1) solve the first singular values of the matrix using eigensolver.
(2) for j = 1 to M + 1 do
(3) prepare initial state .
(4) for k = 1 to R do
(5) construct operator where , and apply it on .
(6) estimate the amplitude of state and obtain .
(7) end for
(8) end for
(9) use classical classifier to predict the label of .

Since the classical data can be delivered after the quantum algorithm, the classical classification algorithm can be selected according to the requirements and data characteristics, and there is no restriction here. The issues of partial complexity and validity of quantum algorithms will be discussed in the next chapter.

The sign of values after DR should not be ignored in machine learning generally, but the most quantum amplitude estimate method cannot obtain it directly. This is a common problem in quantum algorithms, and here, we give a method to calculate the sign of each value.

In classical PCA-DR, a negative sign can be added to the eigenvector without affecting the result. However, once the eigenvectors are determined, the eigenvectors cannot be changed in all subsequent projection calculations. Similarly, we need to choose an eigenstate as the reference state in the quantum algorithm. Here, we take an eigenstate as an example to show the processing of obtaining the sign of values by quantum circuit.

The first step of this method is to choose the reference state. For the -th eigenvector, we set as the reference state if it satisfies and prepare this statewhere is the sample state to be reduced. By using our QRT-DR algorithm, the final state isthen the Hadamard gate is applied to the first ancilla qubit, and the state isusing the quantum amplitude estimation [18], the sign of can be obtainedthe sign of can be recovered by this method, and it just needs an extra qubit and repeats QRT-DR again, which just adds a constant for the complexity.

How to prepare the input state in a quantum computer is an open question now, and some methods such as quantum random access memory [19, 20] can do this in principle. It is supposed that we can prepare the initial state , for a time evolution operator like simulation , the complexity is [2124], where is the sparsity of . In QRT, the accuracy is related to as follows: , and the complexity of amplitude estimation for the second term in equation (5) with accuracy is . The dimensionality reduction is performed for samples, considering eigenvalues, so the total complexity is . We have considered the readout job of quantum data; therefore, the complexity is just polynomial with R. Furthermore, some quantum classification algorithms are the potential to solve this problem [25, 26], like QSVM and QCNN, and it is an interesting work to develop a full quantum DR algorithm by QRT, which the input and output are both quantum data [2729]. By using a quantum classifier to avoid the classical readout of quantum data, this quantum DR method may achieve better speedup for classification tasks. The complexity of the classical classifier part is determined by specific algorithms. For example, the complexity of support vector machines is usually from to .

4. Numerical Simulation Results

The sonar data set is Connectionist Bench (Sonar, Mines vs. Rocks) Data Set. It consists of 208 samples, including 111 mine samples and 97 rock samples, all of which are reflected waves of acoustic signals received from different directions in different states, with 60 input features and 1 output feature [30].

The cross plot can show the close degree of the relationship between the data. Since the characteristics of sonar change from low frequency to high frequency, the sample data are obtained according to time. The cross plot is used to reflect the correlation degree between the data samples. Figures 1(a) and 1(b) show the cross plots between sample 1, 2 and 2, 30, respectively, from which we can see that the degree of correlation of 1, 2 is higher than that of 2, 30.

This section uses a classical classifier to classify the original data. Then, we simulate the quantum PCA-DR processing the original data before the same classifier as a comparison.

4.1. Performance of Classifier without Diemension Reduction

The data are divided into training set and test set. Random_state is a random seed, which is used as a parameter in any class or function with randomness to control the random pattern [31]. Determining random_state ensures that the model is built the same each time, the generated dataset is the same, and the splitting result is the same each time. Normally, random_state is set to 42.

Commonly used classification algorithms include logistic regression, linear discriminant analysis, decision tree, Gaussian process, K nearest neighbors, neural net, random forest, and SVM, using the default optimization parameter to compare algorithms. However, different features often have different dimensions, which may result in a large difference in values. When spatial distance calculation or gradient descent method is involved, the accuracy of data analysis results will be affected if it is not processed. In order to eliminate the impact that may be caused by the difference in dimensionality and value range between features, the data set is first standardized to eliminate the impact of dimensionality between data, and the result will be more accurate. Table 1 shows the accuracy of each algorithm after normalization. The bold value 0.745 is the highest accuracy among these classification algorithms under the same conditions.

The performance of SVM is primarily determined by the kernel function, and the common types of basis kernel functions are linear, polynomial, Gaussian (RBF), and Sigmoid [32]. The choice of kernel function currently has no set of theories to judge directly and relies mainly on training and testing, so we choose multiple parameters to perform the calculation.

K-fold cross-validation can evade the limitation and specificity of data set division [33]. The original data are divided into K groups, the first part is used as the test set and the rest as the training set, the accuracy is calculated on the test set, and the above-given steps are repeated K times each time with different parts as the test set, and the average accuracy is the ultimate accuracy.

Box diagram in Figure 2 can reflect the distribution characteristics of original data, is not affected by outliers, and can describe the discrete distribution of data relatively stable way. The box diagram provides a clear view of the distribution of accuracy calculated during cross-validation. SVM performs well in processing this dataset, so we choose SVM.

The penalty coefficient is used to control the loss function, which is the tolerance for error. Too large a value of will result in overfitting [34], and it is generally necessary to select a suitable by cross-validation. We search for the optimal parameters as well as the kernel function in the range of [0.1, 0.3, 0.5, 0.7, 0.9, 1.0, 1.3, 1.5, 1.7, 2]. After normalizing and dividing the data set, the optimal parameters are determined using the grid search method within the range of penalty coefficients, kernel functions [“linear,” “poly,” “rbf,” “sigmoid”], using the default gamma and cross-validation.

From Table 2, we can get that when , kernel = rbf, the bold value 0.779 is the highest accuracy of the training set, and the accuracy of the test set with corresponding parameters is 0.905.

4.2. Performance of Classifier after Diemension Reduction

These classification algorithms are also used to classify the data after quantum DR, and the result is shown in Figure 3. This QRT-based PCA-DR algorithm in Section 3 is simulated in our classical computer.

Figure 3 is a line graph of the classification accuracy of support vector machine with the “rbf” kernel function and reduced data set. It can be seen from the graph that the accuracy of the training set after dimension reduction is improved almost to different degrees. When , the accuracy of the training set is 0.821, and that of the test set is 0.921. It can be found that the accuracy of both the training set and the test set is improved after the data DR.

5. Conclusion

In this paper, we propose a new quantum-classical hybrid classification algorithm, which can take advantage of the high-speed computing power of quantum devices and the diversity of classical algorithms. It employs QRT-based PCA dimension reduction and uses classical classifies the data. The quantum PCA dimension reduction algorithm can reduce the dimension from to for samples in time . This new hybrid algorithm uses a quantum method to solve the hard problem and highly improve the speed of classification. For some data sets, such as sonar data in our numerical simulation, this hybrid algorithm improves the accuracy of classification from 0.772 to 0.821. Similar to common classification problems, different classic classifiers may be chosen for objects with different characteristics. In the future, it may need to quickly process the data from the detector and make an accurate classification.

Data Availability

The data used to support the study are available from the corresponding author upon request. The sonar data set is Connectionist Bench (Sonar, Mines vs. Rocks) Data Set. https://archive.ics.uci.edu/ml/datasets/connectionist+bench+(sonar,+mines+vs.+rocks).

Conflicts of Interest

The authors declare that they have no conflicts of interest.

Authors’ Contributions

Furong Wang and Fan Yang contributed equally to this work.

Acknowledgments

This research was supported by the National Basic Research Program of China and Shanxi Scholarship Council of China (2020-108). The authors gratefully acknowledge the support from the National Natural Science Foundation of China under Grant nos. 11974205 and 11774197; the National Key Research and Development Program of China under Grant no. 2017YFA0303700; and the Key Research and Development Program of Guangdong province under Grant no. 2018B030325002, and L. He was supported by Graduate Education Innovation Project of Shanxi Province (Grant no. 2022Y593).