# Music Online Education Reform and Wireless Network Optimization Using Artificial Intelligence Piano Teaching

Authors: Rui Guo; Jingna Ding; Weihua Zang
Journal: Wireless Communications and Mobile Computing
 (2021)

---

## Abstract

The purpose is to realize the intelligent reform of piano online teaching and the intelligent optimization of wireless networks. Empirical research is realized with quantitative research and algorithm simulation as the starting point. First, regression fitting algorithm and Relief F weight algorithm are adopted to extract the effectiveness of each characteristic variable. Next, under the guidance of metric learning theory, K-Nearest Neighbors (KNN) in Projected Feature Space (P-KNN) algorithm is proposed to complete the hierarchical recognition of piano teaching influence features. Metric Learning With Support Vector Machine (ML-SVM) classification algorithm is employed to identify the feature performance affecting piano teaching. Finally, the performance of P-KNN algorithm and ML-SVM algorithm is compared with KNN algorithm and Information-Theoretic-Metric-Learning (ITML) algorithm. It is concluded that the recognition accuracies of P-KNN and ML-SVM are 82.78% and 83.97%, respectively. Based on the quantitative research on the characteristics affecting piano teaching, artificial intelligence and wireless network optimization are combined to explore the implementation path of intelligent technology in piano teaching reform, reflect the use value of modern science and technology in piano teaching, and innovate the process of music online education reform of piano teaching.


---

## Body

## 1. Introduction

Art education is a crucial part of China’s education. Piano teaching reform is urgent with the infiltration of artificial intelligence (AI) in the art education system [1–3]. Piano, as a musical instrument, adds a lively atmosphere to people, while the traditional piano teaching cost is large and the audience is small, which is not conducive to the popularization of piano teaching. With the assistance of AI and wireless network, the online education of piano teaching can better promote the popularization of piano teaching. Realizing intellectualization in the process of piano online teaching, implanting AI system [4, 5], and applying network technology to transform and expand the structure of original musical instruments can better serve teaching and life without changing the traditional piano and improve the popularity and influence of piano art in social life [6, 7].However, the existing research simplifies the relationship between teaching difficulty and characteristic performance from multiple linear regression and stepwise regression. Moreover, the overall research process tends to be explanatory. Although the functional relationship between teaching difficulty and feature performance is verified, the research on the classification relationship between teaching difficulty and feature performance under this discrete value is not well described [8, 9], and the persuasion is limited. From the perspective of the clustering algorithm, some scholars have verified the function distribution state between teaching difficulty and characteristic performance [10–12] but ignored the reference value of existing teaching problems in the research process. In general, the main and urgent problems to be solved in the piano teaching reform based on AI are to expand the characteristic variables affecting piano teaching and extract them by algorithm under the guidance of AI to make up for the shortcomings of human subjective recognition [13, 14]; moreover, based on each influencing characteristic variable, the classification algorithm is employed to quantify the teaching difficulty and the performance of characteristic variables, so as to provide recognition accuracy and promote the optimization of characteristic performance.First, the deficiency of insufficient representation of characteristic variables in the existing research is made up. Based on the expansion of the characteristic variables related to piano teaching, the effectiveness of each relevant feature is verified by comparative experiments and the Relief F weight algorithm. Under the guidance of metric learning theory, a new algorithm, K-Nearest Neighbors (KNN) in Projected Feature Space (P-KNN) algorithm, is proposed under the KNN classification algorithm to complete the hierarchical recognition of the influence of various features of piano teaching. With the support of the Gaussian radial basis function (RBF) kernel algorithm, Metric Learning With Support Vector Machine (ML-SVM) classification algorithm is adopted to further identify the feature performance affecting piano teaching. Finally, the P-KNN algorithm and ML-SVM algorithm are compared with logistic regression (LR), Lagrangian Support Vector Machine (LSVM), Proximal Support Vector Machine (PSVM), and other algorithms. On this basis, the teaching reform strategy is obtained through the quantitative research on the characteristic variables affecting the piano teaching reform, which has a certain reference significance for the specific implementation of the music online education reform of innovative piano teaching.


## 2. Materials and Methods

For the problems faced by the piano in the field of teaching complexity judgment and the shortcomings of existing teaching complexity recognition algorithms, an efficient and accurate algorithm is proposed in this part to identify the complexity of piano music notes. First, to further expand the characteristic variables, the difficulty classification standard in the piano playing process of major music websites is analyzed based on interviews with massive professional piano teachers, so as to better verify the effectiveness of the characteristic variables extracted. Various data sources are collected during processing by analyzing the operation level of the problem [15]. The new algorithm is tested by the Relief F weight algorithm. Then, through the analysis of algorithm distribution state of teaching difficulties and feature performance, KNN nonlinear classification algorithm is improved based on the original theory to avoid the defect that it cannot make full use of the data obtained in training to identify knowledge. A P-KNN algorithm based on contour projection is proposed to determine the complexity of spectrum. Besides, this part is to further discuss the measurement research theory of improved Gaussian RBF kernel, proposes ML-SVM algorithm, improves the Gaussian RBF kernel based on measurement research and support vector classifier [16], and realizes the difficulty recognition between piano teaching and characteristic variables.


### 2.1. Material Characteristic Collection and Quantitative Processing

Table1 shows the extended characteristic variables.Table 1
Naming table of characteristic variables.
VariablesThird chordsSpeed changeNote densityMinimum rhythm valueKey speed entropyMelody complexityNameTCSRNDSRVPVEMCVariableSeventh chordBeat changeInterval changeAverage pitch valueMaximum standard deviationPlaying speedNameSCBVIRAPVSDPVPSVariableNine chordsHand movement rateHand exchange ratePitch change rateThe standard deviation of durationDifferent knocking rateNameNCHRHDPRSDDVDSRMusical Instrument Digital Interface notes (MIDI notes) are taken as the experimental data source, including time, beat, sound effect, chord, speed, and other information. Considering that many situations in piano teaching can be used for four difficulty levels and massive music network sites, it also provides a digital representation of four difficulty levels (simple, beginner, intermediate, and advanced). 400 groups of notes are collected on the large music website 8notes, in order to evaluate the scalability of the algorithm more effectively and apply it to the learning process more realistically [17]. It consists of four groups of difficulty level data, and each difficulty level has 100 MIDI. The difference between nine groups of complexity data is called “Nine S,” and the difference between four groups of complexity data is called “Four S.”Before the collected MIDI spectrum data are processed, it is essential to conduct quantitative evaluation and standardize the received data to avoid the problem of data imbalance. MIDI keyboard generates note files with high time resolution, so some notes do not need to be displayed in special positions. The MIDI file of notes must be quantified before attribute extraction to make the generation time and duration of notes appear at the correct rhythm and be quantified [18, 19]. Figure 1 displays the dataset quantization process.Figure 1
Schematic diagram of dataset quantization.After variable feature extraction, some feature variables have larger values while some feature variables have smaller values (the numerical difference is in two or more orders of magnitude). In order to avoid the influence of large numerical differences and strong dispersion of characteristic variables on the overall classification utility, the Min-Max normalization algorithm is employed for data optimization. The characteristic variable values are normalized to the [0,1] interval after data optimization. Min-max normalization, also known as discrete normalization, is a linear transformation of the original data, as shown in equation (1):
(1)Xi∗=Xi−minmax−min.In (1), min and max represent the minimum and maximum values of the characteristic variable Xi, respectively, and Xi∗ represents the normalized characteristics of characteristic Xi.


### 2.2. Comparative Analysis of Regression Fitting of Characteristic Variables

First, the regression fitting comparative experiment of characteristic variables is carried out. Three regression algorithms (multilinear regression, stepwise regression, and support regression) are adopted to check the effectiveness of the new attributes and compared with previous studies. The support of vector regression in extended function space is compared with the data, and it is compared withR2 value. Equation (2) is the calculation equation of R2 value. yi is the actual value, yi~ is the predicted value, (yi−yi~) is called the residual, and R2 is the index to measure the fitting degree of the trend line.
(2)R2=1−∑i=1pyi−yi~2∑i=1pyi−y¯2.In (2), y¯ refers to the mean value of the actual difficulty level. yi~ and y¯ are the teaching difficulty index and the actual teaching difficulty index of group i music scores predicted by the regression fitting comparison algorithm, respectively. When R2 is equal to 1, the algorithm model can fully fit the data. On the contrary, when the value of R2 is negative, the fitting effect of the algorithm model is not as good as that of simple sampling [20, 21]. The data are fitted by three regression algorithms: multiple linear regression, stepwise regression and support regression for third chords (TC), seventh chord (SC), and nine chords (NC). Table 2 displays the numerical results of R2.Table 2
DataR2 regression numerical results.
Characteristic variableR2 (Nine S)Multiple linear regressionStepwise regressionSupport regressionTC0.3420.4120.431SC0.3950.4260.436NC0.4120.4280.512Table2 reveals that the three regression algorithms can achieve better R2 values under the extended characteristic variables. It verifies that for the extended characteristic variables, multiple linear regression, stepwise regression, and support regression can achieve good data fitting. The data results indirectly show that the newly extracted characteristic variables related to the difficulty of piano teaching can enhance the recognition ability among various characteristic categories [22]. However, the value of R2 under the best regression algorithm is 51.2%, which is still not particularly ideal, so it is essential to further improve the numerical fitting effect of characteristic variables.


### 2.3. Analysis of Relief F Weight Algorithm for Characteristic Variables

Based on regression fitting comparison experiment, to further prove the utility level of the newly extended feature variables in the recognition of the relationship between piano teaching difficulty and feature variables, Relief F weight algorithm is introduced for in-depth quantitative exploration, so as to give the weight of each feature variable and measure the effectiveness of the newly extracted feature variables. Different weight values are weighted to the characteristic variables according to the discrimination ability of each characteristic variable to close samples. If the weight is less than a certain threshold, the characteristic variables will be removed from the database [23]. The working principle of the algorithm is expressed as follows:
(3)WA=WA−j=1kdiffA,R,Hjm∗k+∑C≠classRpC/1−pclassR∑j=1kdiffA,R,MjC/m∗km∗k.In (3), WA represents the weight value of characteristic variable A, m represents the sampling times of samples, C represents the category number (C is a positive integer greater than or equal to 2), class R represents the category number of sample R, pC represents the ratio of the number of class C samples to the total number of samples, Hj is the j-th nearest neighbor sample in H set, and MjC indicates the j-th nearest neighbor sample in category number C. diffA,R1,R2 represents the difference between sample R1 and sample R2 on feature A, and its equation is as follows:
(4)diffA,R1,R2=R1A−R2AmaxA−minAifAiscontinuous,0ifAisdiscreteandR1A=R2A,1ifAisdiscreteandR1A≠R2A.


### 2.4. Analysis of Characteristic Variables by ML-SVM Classification Model

Based on the previous regression fitting comparison experiment and Relief F weight algorithm, the measure DM is supervised from the collected dataset itself. The Gaussian RBF kernel is improved based on this achievement, and then, a new ML-SVM algorithm is proposed to complete the level recognition of the difficulty of intelligent piano teaching. Figure2 presents the operation principle of the ML-SVM algorithm model.Figure 2
Flow chart of ML-SVM algorithm.In order to make up for the defect of SVM algorithm in processing objects differently according to the importance of characteristic variables, metric learning is further adopted to obtain a new distance measure DM from the obtained training samples to replace the Euclidean distance measure of the original Gaussian RBF kernel [24, 25]. The form of the improved kernel function can be expressed as (5):
(5)KMXi,Xj=exp−12σ2DMXi,Xj.DM is expressed as:
(6)DM=Xi−XjTMXi−Xj.For the acquired data sampleXi,Xj,i=1,2,⋯,n, Xi∈Rn is the n-dimensional vector, and Yi∈−1,1 is the sample label, which represents two different categories; n represents the number of samples. Based on the new distance measure DM obtained by metric learning, the ML-SVM algorithm after the Gaussian RBF kernel is improved to solve the problem of optimal hyperplane. The solution principle is expressed as follows:
(7)maxfα=∑i=1pαi−12∑i,j=1pαiαjyiyjKM,s.t.∑i=1pαiyi=0,0≤αi≤C,i=1,⋯,p,KM=exp−12σ2DMXi,Xj.α represents the Lagrange coefficient, C represents the penalty parameter of error classification, and KM represents the improved Gaussian RBF kernel of the algorithm. DMXi,Xj in the kernel function expression represents the distance measure obtained by metric learning. The objective function can be solved by the algorithm to obtain the optimal solution b∗=α1∗,⋯,αn∗T. A positive component αj∗ of α∗ less than C is selected and calculated accordingly:
(8)b∗=yj−∑i=1pαiαi∗KXi,Xj.On this basis, the decision function is further constructed:(9)fx=sgn∑i=1pyiαi∗KXi,Xj+b∗.The category of the obtained preclassified data samplex can be calculated by the algorithm of decision function equation.


## 2.1. Material Characteristic Collection and Quantitative Processing

Table1 shows the extended characteristic variables.Table 1
Naming table of characteristic variables.
VariablesThird chordsSpeed changeNote densityMinimum rhythm valueKey speed entropyMelody complexityNameTCSRNDSRVPVEMCVariableSeventh chordBeat changeInterval changeAverage pitch valueMaximum standard deviationPlaying speedNameSCBVIRAPVSDPVPSVariableNine chordsHand movement rateHand exchange ratePitch change rateThe standard deviation of durationDifferent knocking rateNameNCHRHDPRSDDVDSRMusical Instrument Digital Interface notes (MIDI notes) are taken as the experimental data source, including time, beat, sound effect, chord, speed, and other information. Considering that many situations in piano teaching can be used for four difficulty levels and massive music network sites, it also provides a digital representation of four difficulty levels (simple, beginner, intermediate, and advanced). 400 groups of notes are collected on the large music website 8notes, in order to evaluate the scalability of the algorithm more effectively and apply it to the learning process more realistically [17]. It consists of four groups of difficulty level data, and each difficulty level has 100 MIDI. The difference between nine groups of complexity data is called “Nine S,” and the difference between four groups of complexity data is called “Four S.”Before the collected MIDI spectrum data are processed, it is essential to conduct quantitative evaluation and standardize the received data to avoid the problem of data imbalance. MIDI keyboard generates note files with high time resolution, so some notes do not need to be displayed in special positions. The MIDI file of notes must be quantified before attribute extraction to make the generation time and duration of notes appear at the correct rhythm and be quantified [18, 19]. Figure 1 displays the dataset quantization process.Figure 1
Schematic diagram of dataset quantization.After variable feature extraction, some feature variables have larger values while some feature variables have smaller values (the numerical difference is in two or more orders of magnitude). In order to avoid the influence of large numerical differences and strong dispersion of characteristic variables on the overall classification utility, the Min-Max normalization algorithm is employed for data optimization. The characteristic variable values are normalized to the [0,1] interval after data optimization. Min-max normalization, also known as discrete normalization, is a linear transformation of the original data, as shown in equation (1):
(1)Xi∗=Xi−minmax−min.In (1), min and max represent the minimum and maximum values of the characteristic variable Xi, respectively, and Xi∗ represents the normalized characteristics of characteristic Xi.


## 2.2. Comparative Analysis of Regression Fitting of Characteristic Variables

First, the regression fitting comparative experiment of characteristic variables is carried out. Three regression algorithms (multilinear regression, stepwise regression, and support regression) are adopted to check the effectiveness of the new attributes and compared with previous studies. The support of vector regression in extended function space is compared with the data, and it is compared withR2 value. Equation (2) is the calculation equation of R2 value. yi is the actual value, yi~ is the predicted value, (yi−yi~) is called the residual, and R2 is the index to measure the fitting degree of the trend line.
(2)R2=1−∑i=1pyi−yi~2∑i=1pyi−y¯2.In (2), y¯ refers to the mean value of the actual difficulty level. yi~ and y¯ are the teaching difficulty index and the actual teaching difficulty index of group i music scores predicted by the regression fitting comparison algorithm, respectively. When R2 is equal to 1, the algorithm model can fully fit the data. On the contrary, when the value of R2 is negative, the fitting effect of the algorithm model is not as good as that of simple sampling [20, 21]. The data are fitted by three regression algorithms: multiple linear regression, stepwise regression and support regression for third chords (TC), seventh chord (SC), and nine chords (NC). Table 2 displays the numerical results of R2.Table 2
DataR2 regression numerical results.
Characteristic variableR2 (Nine S)Multiple linear regressionStepwise regressionSupport regressionTC0.3420.4120.431SC0.3950.4260.436NC0.4120.4280.512Table2 reveals that the three regression algorithms can achieve better R2 values under the extended characteristic variables. It verifies that for the extended characteristic variables, multiple linear regression, stepwise regression, and support regression can achieve good data fitting. The data results indirectly show that the newly extracted characteristic variables related to the difficulty of piano teaching can enhance the recognition ability among various characteristic categories [22]. However, the value of R2 under the best regression algorithm is 51.2%, which is still not particularly ideal, so it is essential to further improve the numerical fitting effect of characteristic variables.


## 2.3. Analysis of Relief F Weight Algorithm for Characteristic Variables

Based on regression fitting comparison experiment, to further prove the utility level of the newly extended feature variables in the recognition of the relationship between piano teaching difficulty and feature variables, Relief F weight algorithm is introduced for in-depth quantitative exploration, so as to give the weight of each feature variable and measure the effectiveness of the newly extracted feature variables. Different weight values are weighted to the characteristic variables according to the discrimination ability of each characteristic variable to close samples. If the weight is less than a certain threshold, the characteristic variables will be removed from the database [23]. The working principle of the algorithm is expressed as follows:
(3)WA=WA−j=1kdiffA,R,Hjm∗k+∑C≠classRpC/1−pclassR∑j=1kdiffA,R,MjC/m∗km∗k.In (3), WA represents the weight value of characteristic variable A, m represents the sampling times of samples, C represents the category number (C is a positive integer greater than or equal to 2), class R represents the category number of sample R, pC represents the ratio of the number of class C samples to the total number of samples, Hj is the j-th nearest neighbor sample in H set, and MjC indicates the j-th nearest neighbor sample in category number C. diffA,R1,R2 represents the difference between sample R1 and sample R2 on feature A, and its equation is as follows:
(4)diffA,R1,R2=R1A−R2AmaxA−minAifAiscontinuous,0ifAisdiscreteandR1A=R2A,1ifAisdiscreteandR1A≠R2A.


## 2.4. Analysis of Characteristic Variables by ML-SVM Classification Model

Based on the previous regression fitting comparison experiment and Relief F weight algorithm, the measure DM is supervised from the collected dataset itself. The Gaussian RBF kernel is improved based on this achievement, and then, a new ML-SVM algorithm is proposed to complete the level recognition of the difficulty of intelligent piano teaching. Figure2 presents the operation principle of the ML-SVM algorithm model.Figure 2
Flow chart of ML-SVM algorithm.In order to make up for the defect of SVM algorithm in processing objects differently according to the importance of characteristic variables, metric learning is further adopted to obtain a new distance measure DM from the obtained training samples to replace the Euclidean distance measure of the original Gaussian RBF kernel [24, 25]. The form of the improved kernel function can be expressed as (5):
(5)KMXi,Xj=exp−12σ2DMXi,Xj.DM is expressed as:
(6)DM=Xi−XjTMXi−Xj.For the acquired data sampleXi,Xj,i=1,2,⋯,n, Xi∈Rn is the n-dimensional vector, and Yi∈−1,1 is the sample label, which represents two different categories; n represents the number of samples. Based on the new distance measure DM obtained by metric learning, the ML-SVM algorithm after the Gaussian RBF kernel is improved to solve the problem of optimal hyperplane. The solution principle is expressed as follows:
(7)maxfα=∑i=1pαi−12∑i,j=1pαiαjyiyjKM,s.t.∑i=1pαiyi=0,0≤αi≤C,i=1,⋯,p,KM=exp−12σ2DMXi,Xj.α represents the Lagrange coefficient, C represents the penalty parameter of error classification, and KM represents the improved Gaussian RBF kernel of the algorithm. DMXi,Xj in the kernel function expression represents the distance measure obtained by metric learning. The objective function can be solved by the algorithm to obtain the optimal solution b∗=α1∗,⋯,αn∗T. A positive component αj∗ of α∗ less than C is selected and calculated accordingly:
(8)b∗=yj−∑i=1pαiαi∗KXi,Xj.On this basis, the decision function is further constructed:(9)fx=sgn∑i=1pyiαi∗KXi,Xj+b∗.The category of the obtained preclassified data samplex can be calculated by the algorithm of decision function equation.


## 3. Results

### 3.1. Weight Distribution Results under Relief F Algorithm

The Relief F weight algorithm is adopted to measure the effectiveness of the new characteristic variables. All datasets are taken as the train set, the sampling times of samplesm=5, and the number of nearest neighbors k=5. Figures 3 and 4 show the weight value of each characteristic variable under the Relief F algorithm.Figure 3
Nine S weight distribution sequence.Figure 4
Four S weight distribution sequence.Figure4 suggests that the weights of most characteristic variables are different for Nine S and Four S datasets. Moreover, compared with the Nine S dataset, the weights of feature variables in the Four S dataset are generally large, and the weights of some feature variables are quite different. It shows that the more detailed the classification of feature variables is, the more unbalanced the corresponding weights are. In the weight distribution of the two datasets, some of them are very close, and the pitch change is the largest weight. For the two datasets, the top-weighted variables are velocity change and note density, as well as key speed entropy, note density, and melody complexity which are newly expanded here. This also fully shows that the new characteristic variables newly expanded are effective and have a strong ability to distinguish the difficulty level of piano teaching.


### 3.2. K-Fold Cross-Validation and Experimental Results

Cross-validation is a statistical analysis method used to evaluate the generalization ability of machine learning algorithms on the training dataset and to verify the performance of classification algorithms or parameter optimization. It is to divide the dataset into a train set and the other datasets into a verification set or test set. First, the train set is adopted to train the classification algorithm. Then, the validation set is adopted to test the trained model. Cross-validation can obtain as much information as possible from the limited training data and provide a basis for the performance evaluation of the classifier to a certain extent. To avoid the overfitting problem, the commonly used cross-validation methods include maintaining cross-validation, one-time cross-validation, and k-fold cross-validation. According to the characteristics of the collected dataset, k-fold cross-validation is more appropriate when the complexity of the algorithm is not increased.K-fold cross-validation can effectively avoid the degree of piano learning too high or too low, so as to enhance the credibility of the results. Thereby, each experiment is repeated 5 times to better evaluate the classification performance and generalization ability of the k-fold cross-validation algorithm. For each 50% cross-check, the average accuracy is taken as the final result to calculate the 90% confidence interval of the result. Figure5 displays the 90% confidence interval of the final recognition accuracy and results of each algorithm.Figure 5
Recognition accuracy of various algorithms.Figure5 reveals that the proposed P-KNN algorithm has the best recognition accuracy in the Nine S dataset and Four S dataset, and the recognition accuracy reaches 75.7% and 82.78%, respectively, which is significantly improved compared with other algorithms. In the simulation experiment, the regularization parameter λ of LR is 0.1, M-SVM uses the third-order polynomial function as the kernel function, and the penalty factor is the default value. Moreover, for two datasets, compared with the KNN algorithm, the recognition accuracy of the proposed improved KNN algorithm-P-KNN is significantly improved. In the Nine S dataset and Four S dataset, the recognition accuracy of ITML is general, but the confidence interval has always been the narrowest, which fully shows that the results are stabler. The recognition effect of LR and multiclassification SVM (M-SVM) based on third-order polynomial function as kernel function is not very obvious in the experiment.


### 3.3. The Influence of KNN on the Result

The influence of the nearest neighbor valuek (only including k value between 1 and 21) in KNN, P-KNN, and ITML on the recognition accuracy is further studied to further explore the effectiveness of P-KNN algorithm in Nine S dataset and Four S dataset. Tables 3 and 4 display the results.Table 3
Influence ofk value on recognition accuracy under three kinds of algorithms in Nine S.
Recognition accuracy (%)k valuek=1k=3k=5k=7k=9k=11k=13k=15k=17k=19k=21KNN67.8665.6965.6170.2168.9869.5170.3869.6368.8970.2266.24P-KNN70.1170.2671.9175.8373.9576.5372.6471.4275.6372.1374.34ITML67.5863.4562.7768.2167.2769.3366.3670.6767.9368.5169.31Table 4
Influence ofk value on recognition accuracy under three kinds of algorithms in Four S.
Recognition accuracy (%)k valuek=1k=3k=5k=7k=9k=11k=13k=15k=17k=19k=21KNN77.2176.5377.8380.1180.0181.5480.3078.8177.6477.5478.35P-KNN76.9578.9181.5981.9078.4580.6479.4882.9981.7480.9179.50ITML73.5173.5873.9774.6974.2775.4874.0774.1373.3072.7974.74Tables3 and 4 show that the recognition accuracy of P-KNN is always the highest with the change of k value in the Nine S dataset. With the increase of K value, the recognition accuracy of P-KNN first increases and then decreases and then fluctuates around 80%. The recognition accuracy of ITML for some k values is slightly lower than KNN, but the recognition accuracy is still stable. For Four S datasets, P-KNN also has the best recognition accuracy in most cases, but it has the highest recognition accuracy among K values 9, 11, and 13. The number of K-Nearest Neighbors selected by the KNN algorithm exerts a certain impact on the recognition results. Low k value means that only the training samples closer to the input samples can play a role in the prediction results, but it is easy to fit. If the number of nearest neighbors k is large, the training estimation error can be reduced, and the approximation error may increase. In this case, the training samples far away from the input samples may also play a role in the prediction, resulting in the prediction error. The recognition accuracy of P-KNN in nine datasets is always the best. The loss of recognition performance is small for different k values in four datasets with relatively rough classification.


### 3.4. Linear Classification Results under SVM Algorithm

The traditional pattern recognition technology only takes the minimum training error as the recognition goal and only considers the fitting classification effect of the classifier on the training samples. Based on the principle of structural risk minimization, SVM can ensure that the training error (empirical risk) is as small as possible, and the test accuracy is as high as possible. This is reflected in the selection of classification model and model parameters and finding the optimal classification hyperplane to meet the classification requirements. The interval between the hyperplane and the sample is maximized to ensure the classification accuracy of the hyperplane and then obtain the linear classification problem in two-dimensional space, as shown in Figure6.Figure 6
Legend of classification hyperplane in two-dimensional space.Figure6 suggests that many lines can completely separate the two types of samples. The classification lines close to the sampling point are sensitive to noise, have low classification ability for data, have stable straight lines away from all training samples, and have strong recognition ability. If the direction w of the normal vector of the thick line L1 in the figure has been given, the line can completely separate the two samples and move the classification line parallel to the line until it stops when it contacts the classification point for the first time. In this way, the other two lines L2 and L3 can be obtained, respectively. The distance r between L2 and L3 is called the interval corresponding to the direction of the normal vector. Obviously, the larger the interval is, the better it is. Thereby, the classification line with the largest interval is selected as the best classification line.


### 3.5. Test Results of Recognition Accuracy of ML-SVM Algorithm

Figure7 shows the recognition accuracy and confidence interval under the ML-SVM algorithm.Figure 7
Recognition accuracy of various algorithms.Figure7 displays the recognition accuracy and 90% confidence interval of the proposed ML-SVM algorithm, LR, and LSVM classification algorithms. PSVM and GSVM are in two datasets with different characteristics (Nine S dataset and Four S dataset). Each SVM algorithm is extended to multiple classifications based on a pair of residual methods. The grid search algorithm is adopted to cross-verify layer 0.5 and layer 5 in the range of 2-10 to 210, and the optimal parameters are obtained. LSVM and PSVM (polynomial order d=3) only need to optimize the penalty factor C; GSVM and ML-SVM need to optimize the best combination of penalty factor C and kernel function parameter g. Conventional LR parameter λ takes 0 and 1.Figure8 shows the final combination of parameters.Figure 8
Optimal parameter combination of each algorithm.Figure8 displays that on the two datasets with different characteristics, the ML-SVM based on the improved Gaussian RBF kernel has the highest recognition accuracy, reaching 68.74% and 84.67%, respectively. Compared with the algorithm before optimization, the performance is improved by 3.4% and 2.1%, respectively. In the two groups of data, the final recognition accuracy of the proposed ML-SVM algorithm is 68.74% and 84.67%, respectively, which is better than the GSVM based on the original Gaussian radial basis function kernel. Especially on the Four S dataset, the recognition accuracy of the algorithm is 83.97%, which is 1.45% higher than the M-SVM algorithm based on the original Gaussian RBF; the recognition accuracy is improved by 63%, and the result is stabler (with a narrow confidence interval). The results show that the algorithm effectively improves the classification performance of multiclassification LSVM based on Gaussian RBF kernel, while the classification effect of multiclassification SVM based on linear kernel function is not as good as LR. Therefore, the performance of multiclassification PSVM is better than the algorithm proposed.


## 3.1. Weight Distribution Results under Relief F Algorithm

The Relief F weight algorithm is adopted to measure the effectiveness of the new characteristic variables. All datasets are taken as the train set, the sampling times of samplesm=5, and the number of nearest neighbors k=5. Figures 3 and 4 show the weight value of each characteristic variable under the Relief F algorithm.Figure 3
Nine S weight distribution sequence.Figure 4
Four S weight distribution sequence.Figure4 suggests that the weights of most characteristic variables are different for Nine S and Four S datasets. Moreover, compared with the Nine S dataset, the weights of feature variables in the Four S dataset are generally large, and the weights of some feature variables are quite different. It shows that the more detailed the classification of feature variables is, the more unbalanced the corresponding weights are. In the weight distribution of the two datasets, some of them are very close, and the pitch change is the largest weight. For the two datasets, the top-weighted variables are velocity change and note density, as well as key speed entropy, note density, and melody complexity which are newly expanded here. This also fully shows that the new characteristic variables newly expanded are effective and have a strong ability to distinguish the difficulty level of piano teaching.


## 3.2. K-Fold Cross-Validation and Experimental Results

Cross-validation is a statistical analysis method used to evaluate the generalization ability of machine learning algorithms on the training dataset and to verify the performance of classification algorithms or parameter optimization. It is to divide the dataset into a train set and the other datasets into a verification set or test set. First, the train set is adopted to train the classification algorithm. Then, the validation set is adopted to test the trained model. Cross-validation can obtain as much information as possible from the limited training data and provide a basis for the performance evaluation of the classifier to a certain extent. To avoid the overfitting problem, the commonly used cross-validation methods include maintaining cross-validation, one-time cross-validation, and k-fold cross-validation. According to the characteristics of the collected dataset, k-fold cross-validation is more appropriate when the complexity of the algorithm is not increased.K-fold cross-validation can effectively avoid the degree of piano learning too high or too low, so as to enhance the credibility of the results. Thereby, each experiment is repeated 5 times to better evaluate the classification performance and generalization ability of the k-fold cross-validation algorithm. For each 50% cross-check, the average accuracy is taken as the final result to calculate the 90% confidence interval of the result. Figure5 displays the 90% confidence interval of the final recognition accuracy and results of each algorithm.Figure 5
Recognition accuracy of various algorithms.Figure5 reveals that the proposed P-KNN algorithm has the best recognition accuracy in the Nine S dataset and Four S dataset, and the recognition accuracy reaches 75.7% and 82.78%, respectively, which is significantly improved compared with other algorithms. In the simulation experiment, the regularization parameter λ of LR is 0.1, M-SVM uses the third-order polynomial function as the kernel function, and the penalty factor is the default value. Moreover, for two datasets, compared with the KNN algorithm, the recognition accuracy of the proposed improved KNN algorithm-P-KNN is significantly improved. In the Nine S dataset and Four S dataset, the recognition accuracy of ITML is general, but the confidence interval has always been the narrowest, which fully shows that the results are stabler. The recognition effect of LR and multiclassification SVM (M-SVM) based on third-order polynomial function as kernel function is not very obvious in the experiment.


## 3.3. The Influence of KNN on the Result

The influence of the nearest neighbor valuek (only including k value between 1 and 21) in KNN, P-KNN, and ITML on the recognition accuracy is further studied to further explore the effectiveness of P-KNN algorithm in Nine S dataset and Four S dataset. Tables 3 and 4 display the results.Table 3
Influence ofk value on recognition accuracy under three kinds of algorithms in Nine S.
Recognition accuracy (%)k valuek=1k=3k=5k=7k=9k=11k=13k=15k=17k=19k=21KNN67.8665.6965.6170.2168.9869.5170.3869.6368.8970.2266.24P-KNN70.1170.2671.9175.8373.9576.5372.6471.4275.6372.1374.34ITML67.5863.4562.7768.2167.2769.3366.3670.6767.9368.5169.31Table 4
Influence ofk value on recognition accuracy under three kinds of algorithms in Four S.
Recognition accuracy (%)k valuek=1k=3k=5k=7k=9k=11k=13k=15k=17k=19k=21KNN77.2176.5377.8380.1180.0181.5480.3078.8177.6477.5478.35P-KNN76.9578.9181.5981.9078.4580.6479.4882.9981.7480.9179.50ITML73.5173.5873.9774.6974.2775.4874.0774.1373.3072.7974.74Tables3 and 4 show that the recognition accuracy of P-KNN is always the highest with the change of k value in the Nine S dataset. With the increase of K value, the recognition accuracy of P-KNN first increases and then decreases and then fluctuates around 80%. The recognition accuracy of ITML for some k values is slightly lower than KNN, but the recognition accuracy is still stable. For Four S datasets, P-KNN also has the best recognition accuracy in most cases, but it has the highest recognition accuracy among K values 9, 11, and 13. The number of K-Nearest Neighbors selected by the KNN algorithm exerts a certain impact on the recognition results. Low k value means that only the training samples closer to the input samples can play a role in the prediction results, but it is easy to fit. If the number of nearest neighbors k is large, the training estimation error can be reduced, and the approximation error may increase. In this case, the training samples far away from the input samples may also play a role in the prediction, resulting in the prediction error. The recognition accuracy of P-KNN in nine datasets is always the best. The loss of recognition performance is small for different k values in four datasets with relatively rough classification.


## 3.4. Linear Classification Results under SVM Algorithm

The traditional pattern recognition technology only takes the minimum training error as the recognition goal and only considers the fitting classification effect of the classifier on the training samples. Based on the principle of structural risk minimization, SVM can ensure that the training error (empirical risk) is as small as possible, and the test accuracy is as high as possible. This is reflected in the selection of classification model and model parameters and finding the optimal classification hyperplane to meet the classification requirements. The interval between the hyperplane and the sample is maximized to ensure the classification accuracy of the hyperplane and then obtain the linear classification problem in two-dimensional space, as shown in Figure6.Figure 6
Legend of classification hyperplane in two-dimensional space.Figure6 suggests that many lines can completely separate the two types of samples. The classification lines close to the sampling point are sensitive to noise, have low classification ability for data, have stable straight lines away from all training samples, and have strong recognition ability. If the direction w of the normal vector of the thick line L1 in the figure has been given, the line can completely separate the two samples and move the classification line parallel to the line until it stops when it contacts the classification point for the first time. In this way, the other two lines L2 and L3 can be obtained, respectively. The distance r between L2 and L3 is called the interval corresponding to the direction of the normal vector. Obviously, the larger the interval is, the better it is. Thereby, the classification line with the largest interval is selected as the best classification line.


## 3.5. Test Results of Recognition Accuracy of ML-SVM Algorithm

Figure7 shows the recognition accuracy and confidence interval under the ML-SVM algorithm.Figure 7
Recognition accuracy of various algorithms.Figure7 displays the recognition accuracy and 90% confidence interval of the proposed ML-SVM algorithm, LR, and LSVM classification algorithms. PSVM and GSVM are in two datasets with different characteristics (Nine S dataset and Four S dataset). Each SVM algorithm is extended to multiple classifications based on a pair of residual methods. The grid search algorithm is adopted to cross-verify layer 0.5 and layer 5 in the range of 2-10 to 210, and the optimal parameters are obtained. LSVM and PSVM (polynomial order d=3) only need to optimize the penalty factor C; GSVM and ML-SVM need to optimize the best combination of penalty factor C and kernel function parameter g. Conventional LR parameter λ takes 0 and 1.Figure8 shows the final combination of parameters.Figure 8
Optimal parameter combination of each algorithm.Figure8 displays that on the two datasets with different characteristics, the ML-SVM based on the improved Gaussian RBF kernel has the highest recognition accuracy, reaching 68.74% and 84.67%, respectively. Compared with the algorithm before optimization, the performance is improved by 3.4% and 2.1%, respectively. In the two groups of data, the final recognition accuracy of the proposed ML-SVM algorithm is 68.74% and 84.67%, respectively, which is better than the GSVM based on the original Gaussian radial basis function kernel. Especially on the Four S dataset, the recognition accuracy of the algorithm is 83.97%, which is 1.45% higher than the M-SVM algorithm based on the original Gaussian RBF; the recognition accuracy is improved by 63%, and the result is stabler (with a narrow confidence interval). The results show that the algorithm effectively improves the classification performance of multiclassification LSVM based on Gaussian RBF kernel, while the classification effect of multiclassification SVM based on linear kernel function is not as good as LR. Therefore, the performance of multiclassification PSVM is better than the algorithm proposed.


## 4. Conclusion

Eight characteristic variables related to teaching difficulty were added, and the existing characteristic variables were expanded. Through the comparison of Nine S dataset and Four S dataset with reference weighting algorithm and metric learning theory, P-KNN difficulty level recognition algorithm and ML-SVM classification algorithm are proposed on the basis of analyzing the characteristic variables affecting the piano teaching process, and the piano teaching reform strategy is obtained. The strategies of piano teaching reform include intelligent teaching, intelligent scoring, networked piano classroom, and automatic playing function. Under the framework of AI and wireless network optimization, the piano teaching mode of “people + equipment” is adopted, and the “complementary” piano teaching mode and “remote network” piano teaching mode are continuously improved to comply with the development trend of the increasing integration of piano performance art form and modern high technology. The combination of traditional piano teaching and modern high-tech innovation promotes the continuous renewal of piano education concept, the continuous promotion of education development, and the continuous enhancement of system power and gradually improves the standardization and scientization of piano education. However, the research data obtained are relatively scarce. Only sufficient data can help to improve the accuracy and representativeness of the algorithm, so as to verify the scientific performance of the algorithm more objectively. At present, there is no comprehensive, complete, and open database about the difficulty of piano teaching. If the obtained data can be tested on an open and comprehensive dataset and compared with the actual teaching status and theoretical teaching standards through different algorithms, it will make the research results more convincing and meaningful.



---

*Source: 6456734-2021-11-26.xml*