Research on Classification Effect of PSO Optimized SVM 1 Pengyu Zhou1, Lei Liu1,*, Yeguo Sun2, Xing Zhao3, Yihong Liu1 1. School of Computer Science, Huainan Normal University, Huainan, Anhui, 232038, China. 2. School of Finance and Mathematics, Huainan Normal University, Huainan, Anhui, 232038, China. 3. School of Chemistry and Materials Engineering, Huainan Normal, University, Huainan, Anhui, 232038, China. Abstract Support vector machine (SVM) is a very good classification algorithm. When applying SVM, it is necessary to select the corresponding kernel function and corresponding parameters. Different choices will have a greater impact on the classification effect. In this paper, the Gaussian kernel function is selected as an example, and the corresponding parameters are penalty factor C and kernel function parameter g. The particle swarm optimization (PSO) algorithm is used to find the optimal parameters C and g. Through simulation comparison, it is found that the classification effect of the PSO optimized SVM algorithm is obviously better than that of the original SVM algorithm itself. At the same time, this paper gives some theoretical guidance for intelligent algorithm in optimizing SVM algorithm. Keywords SVM, machine learning, PSO 1. Introduction Support vector machine (SVM) is a class of generalized linear classifiers that classify data in a binary way according to supervised learning. Its decision boundary is the maximum margin hyperplane for learning samples. SVM can also perform nonlinear classification through kernel method, which is one of the common kernel learning methods. Because SVM classifier has the advantages of good universality, high classification accuracy and fast classification speed, it is widely used in agriculture, finance, medical industry and equipment fault diagnosis to classify and predict data. Li Zhouzi et al. [1] used SVM model for face color recognition, Ma Lili et al. [2] used PSO-SVM for the classification of optical fiber sensor network signals, Su Xiaojie et al. [3] studied the SVM road extraction method based on SAR polarization characteristics, Pan Lipeng [4] used SVM to classify English question bank topics, and Sun Peisheng et al. [5] used SOA-SVM model to study photovoltaic array fault diagnosis, Kang Jiayu et al. [6] used ANOVA and BO-SVM to study transformer fault diagnosis, Zuo Xueqian et al. [7] used PSO-LSSVM to predict the state of centrifugal pump, Tang Yu et al. [8] used improved sparrow algorithm to optimize SVM to study abnormal points, Fan Jie et al. [9] studied the prediction of natural gas hydrate formation conditions based on PSO-SVM, and Wang Yushu et al. [10] studied the optimization of sandwich shaped charge structure based on PSO and SVM. Relevant scholars have made good research results in different areas of SVM research. AHPCAI2022@2nd International Conference on Algorithms, High Performance Computing and Artificial Intelligence EMAIL: *Corresponding author’s e-mail: 13605545615@163.com (Lei Liu) © 2022 Copyright for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0). CEUR Workshop Proceedings (CEUR-WS.org) 1 2. Correlation algorithm 2.1 Particle Swarm Optimization Particle swarm optimization (PSO) is a common swarm intelligence algorithm, which is designed to imitate the foraging behavior of birds. It starts to initialize a group of particles randomly, and then finds the optimal solution through iterative optimization to achieve the ultimate goal. Particle swarm optimization updates speed and location using the following formula: vid (k + 1) = ω ∗ vid (k ) + c1r1 ( pid (k ) − xid (k )) + c2 r2 ( p gd (k ) − xid (k )) (1) xid (k + 1) = xid (k ) + vid (k ) (2) In the formula, ω is the inertia weight, c1 and c2 are learning factors, and the value range is [1, 2] generally. r1 and r2 are random numbers, and the value range is [0, 1] generally. vid (k ) is the search speed of the i particle in the d dimensions at time k , xid (k ) is the position of the i particle in the d dimensions at time k , pid (k ) is the optimal position of the i particle in the d dimensions at time k , and p gd (k ) is the optimal position of the i entire particle swarm in the d dimensions at time k . In the process of studying particle swarm optimization, generally c1 and c2 , r1 and r2 , ω are the key parameters to be optimized. The optimization performance of particle swarm optimization algorithm often passes the typical single peak test functions: step and sphere functions; Classic multi peak test functions: griewank and rastrigin functions are used for optimization performance test. 2.2 Support Vector Machine Algorithm Support Vector Machine (SVM) is a binary classification model. SVM has been recognized by the industry as the most successful and best performing algorithm in machine learning in the past decade. It maps the feature vectors of instances to some points in space. The goal of SVM is to draw a line to "best" distinguish the two types of points. The classification schematic diagram of SVM is shown in Figure 1. The classification effect of SVM should achieve the minimum impact on the local disturbance of samples and the strongest robustness of classification results. Fig 1. Schematic diagram of SVM classification When applying the SVM algorithm, the selection of kernel functions has a great impact on the algorithm performance. Common kernel functions are: 2 (1)Linear kernel function κ ( xi , x j ) = xiΤ x j (2)Polynomial kernel function κ ( xi , x j ) = ( xiΤ x j ) d (3)Gaussian kernel function || xi − x j ||2 κ ( xi , x j ) = exp(− ) 2δ 2 (4)Laplace kernel function || xi − x j || κ ( xi , x j ) = exp(− ) δ (5) Sigmoid kernel function κ ( xi , x j ) = tanh( β xiΤ x j + θ ) Among them, the Gaussian kernel function is the most commonly used kernel function. When the Gaussian kernel function is selected, the setting of the penalty factor C ofSVM and the kernel function parameter g has an important impact on the classification effect. Too large C will lead to over fitting, too small C will lead to under fitting, too large g value will lead to too few support vectors, too small g value will lead to more support vectors, and the number of support vectors will affect the speed of training and prediction. The reasonable selection of C and g values can achieve better classification efficiency and accuracy. The optimization function of particle swarm optimization algorithm can realize the reasonable selection of parameters, so that SVM can achieve better classification effect. 3. Optimize the effect 3.1 SVM algorithm classification The SVM algorithm is used to classify data sets. The kernel function of the SVM algorithm in this paper is a Gaussian kernel function. The values of parameters C and g are 1 by default. The training set contains 100 samples, and the test set contains 30 samples. The classification effect is shown in Figure 2. 3.2 PSO optimized SVM algorithm classification The PSO optimized SVM algorithm is used to classify the dataset. The selected kernel function is also a Gaussian kernel function. The PSO algorithm is used to find the values of the parameters C and g of the optimal SVM algorithm, and then the optimized SVM algorithm is used to classify the dataset. The classification effect is shown in Figure 3. It can be seen from Figure 2 and Figure 3 that the classification effect of the SVM algorithm optimized by the PSO algorithm is significantly improved compared with the original SVM algorithm, which shows that the optimization effect of the PSO algorithm can be well applied to the classification research of the SVM algorithm. 3 Fig 2. SVM classification Fig 3. PSO optimizes SVM classification effect 4. Conclusion SVM is a very excellent classification algorithm, which has been widely used and improved by many scholars and researchers can achieve good results. This paper combines the characteristics of SVM algorithm classification, takes the selection of Gaussian kernel function as an example, combines PSO algorithm to find the optimal parameters C and g of SVM algorithm, and then carries out simulation classification on the dataset. The simulation results show that the classification effect of the improved SVM algorithm using PSO is significantly higher than that of the original SVM algorithm. Later, relevant research will continue to be carried out to optimize the SVM algorithm through different intelligent algorithms to achieve better classification results. 5. Acknowledgments This study received support from the Huainan Normal University Scientific Research Project (Grant no. 2022XJZD030), and the Key Research and Development Plan Project Foundation of Huainan (Grant no. 2021A2412), the University Natural Science Foundation of Anhui Province (Grant no. KJ2021A0970). 6. References [1] Li Z Z,Feng Y,Lin Z S et al.(2022)Face color recognition based on SVM model optimized by improved PSO algorithm.Computer Simulation,4:241-247. [2] Ma L L,Gao J,Shen Z J et al.(2022)Optical fiber sensor network data recognition system based on PSO-SVM.LASER&INFRARED,5:734-739. [3] Su X J,Liu X Q.(2022)Road extraction based on SAR polarization characteristics and SVM.MICROELECTRONICS&COMPUTER,8:47-53. [4] Pan L P.(2022)Research on Classification and Recommendation of English Item Bank Based on SVM.Automation Technology and Application,8:140-142. [5] SUN P S, CHEN T G, CHENG C et al.(2022)Research on Fault Diagnosis of Photovoltaic Array Based on SOA-SVM Model.Journal of Power Supply,6:85-91. [6] Kang J Y,Zhang S X,Zhang Q P et al.(2022)Fault Diagnosis Method of Transformer Based on ANOVA and BO-SVM.High Voltage Engineering,9:1-16. [7] Zuo X Q,Xiong Z,Nie L et al.(2022)Study of centrifugal pump fault prediction method based on PSO optimization LS-SVM.Electronic Measurement Technology,3:51-56. [8] Tang Y, Dai Q,Yang M Y et al.(2022)Improved Sparrow Algorithm to Optimize SVM Outlier Detection.Computer Engineering & Science,15:98-107. 4 [9] Fan J, Xu X Y, Zhou S D et al.(2022)Prediction of natural gas hydrate formation conditions based on PSO-SVM.Natural Gas Chemical Industry,47:1-6. [10] Wang Y S,Guo R,Liu R Z et al.(2022)Optimum design of double layer shaped charge structure based on PSO and SVM.Journal of Weapon Equipment Engineering,8:244-249. 5