Abstract

At present, the gap of agricultural talents in China is continuously widening, and most enterprises lack agricultural core talents, which has caused great impact on the social economy. To solve this problem, an improved AHP-KNN algorithm is proposed by combining the analytic hierarchy process (AHP) and the optimized K-nearest neighbor algorithm, and an agricultural talent training model is proposed based on this algorithm. The results show that the classification accuracy and classification time of the improved AHP-KNN algorithm are 96.2% and 27.5 seconds, respectively, both of which are superior to the comparison algorithm. The result shows that the classification accuracy of agricultural talents can be improved by using this algorithm. Therefore, the model can be used to classify agricultural talents with the same characteristics into one class, carry out targeted training, and train all-round agricultural talents efficiently and quickly, so as to improve the serious shortage of agricultural talents at present.

1. Introduction

Agriculture is an important pillar of the national economy, and the training of agricultural talents is crucial for the sustainable development of agriculture [1]. However, in the current rapidly developing social context, there are many problems with the traditional agricultural talent cultivation model, which limits the development of the agricultural field and the effectiveness of agricultural talent cultivation. For example, there is a disconnect between education and industry; a mismatch between knowledge and skills; a lack of comprehensive quality training, practical opportunities, and industrial cooperation; and a lack of interdisciplinary training [2]. In order to promote the modernization and sustainable development of agriculture, we need to innovate agricultural talent training models to meet the needs and challenges of the agricultural industry. Therefore, it has become an urgent task to build a scientific and effective agricultural talent training model [3]. K-nearest neighbor (KNN) algorithm is a simple and effective machine learning algorithm, which is based on the classification method of instances. By calculating the distance between the new sample and the existing sample, the KNN algorithm classifies the new sample into the same category as its nearest neighbor [4]. The KNN algorithm is simple and intuitive, is nonparametric and insensitive to outliers, and has some disadvantages such as high computational complexity and the need to determine the value. Analytic hierarchy process (AHP) is a quantitative method used in decision analysis. It decomposes the complexity of a problem into a series of hierarchical structures and determines the best decision scheme by comparing criteria and choices [5]. Analytic hierarchy process (AHP) has the advantages of structure, quantification, flexibility, and comprehensiveness, but it also has disadvantages such as too much subjectivity, data uncertainty, and complexity. Therefore, the effect of applying KNN algorithm and AHP algorithm alone to the agricultural talent training model is not ideal. Therefore, this study combines AHP algorithm and KNN algorithm to build a comprehensive agricultural talent training model. This comprehensive application method is still less explored in agricultural talent training research and provides a new idea and method for research in this field. Through this model, researchers can conduct a comprehensive evaluation and analysis of agricultural personnel training and provide scientific decision support for relevant decisions. This research is not only innovative and theoretical contribution but also has practical application value. By constructing AHP-KNN model, it can provide scientific talent selection and training programs for agricultural talent training institutions, agricultural enterprises, and farmers and improve the effect and quality of agricultural talent training.

2. Literature Review

With the increase of data hierarchical requirements in various fields, hierarchical analysis is applied in various fields. Zheng et al. proposed a hierarchical analysis method based on correlation process for better evaluation of transmission line tripping. The method uses clustering algorithm to obtain the characteristic factors and establish an objective evaluation matrix. The empirical analysis of the model shows that the consistency between the estimated results of the model and the actual values is 76%, which is very practical [6]. Yadav proposed a decision model based on hybrid hierarchical analysis for optimal selection of dental conforming materials, and the dental composites were selected with this model, and the results showed that the model selected dental composites with better performance than other models [7]. Yildiz et al. proposed an evaluation model based on fuzzy analytic hierarchy process to address the issue of difficult evaluation of public expectations in water plants and used this model to evaluate public expectations. The results indicate that the evaluation results are relatively close to actual public expectations, and this model can be used to evaluate public expectations and develop water plant governance strategies based on this [8]. As a basic classification algorithm, KNN algorithm is also widely used in various fields. Liang et al. proposed a multilabel classification model with KNN algorithm to improve the efficiency of inspection and maintenance of nonsolidly grounded distribution networks. The empirical analysis of this model showed that the model proposed in the study has better feasibility and advantages [9]. Ning et al. proposed a classifier model based on KNN algorithm to identify lysine formylation sites in response to the problem of insufficient calculation methods for predicting lysine formylation. Empirical analysis shows that the specificity and sensitivity of the model are 79.9% and 81.4%, respectively, indicating that the model can be used to predict lysine formylation [10]. Wolff et al. proposed an approximate nearest neighbor clustering method based on position sensitive hashing to better reduce the computational resources of single cell Hi-C technology. Comparative experiments have shown that this method can effectively reduce computational resources compared to competitive algorithms [11].

With the development of technology, various fields are paying more and more attention to talent training, and there are various methods applied to talent training. Wen [12] proposed a talent training model based on BIM 5D technology and related information technology to address the problem of insufficient personnel for assembly-type intelligent buildings and applied the model to actual talent training. Yushchik [13] proposed a fishery talent training model based on digital literacy to address the impact of digitalization on fishery practitioners and applied it to practical fishery enterprises. This model is practical for cultivating fishery talents. Fishery personnel trained using this model can successfully use Li and Cui’s virtual reality-based sports talent training system to improve athletes’ athletic abilities. Using this system to provide scientific training assistance for athletes can improve their various sports abilities. The system was empirically analyzed and found that the model is beneficial to improve the athletic ability of athletic personnel and can help train athletic personnel [14]. Jones et al. proposed a hemostatic talent training model to address the shortage of hemostatic talents in the school system and applied this model to cultivate hemostatic talents. This mode can correctly respond to hemostatic events and teach hemostatic methods to others, with high practicality [15].

The above research indicates that analytic hierarchy process and KNN algorithm have been widely applied in various fields, and there are also many methods applied in talent cultivation. However, there are few studies that combine analytic hierarchy process (AHP) and KNN algorithm to apply to talent cultivation models. Therefore, the paper applies the AHP-KNN algorithm to the agricultural talent training model to improve new ideas for the training of agricultural talents.

3. Construction of Agricultural Talent Training Model Based on AHP-KNN Algorithm

3.1. Application of AHP-KNN Algorithm in Agricultural Talent Training

With the development of modern agriculture, the demand for agricultural talents in major enterprises has increased greatly, but it is more difficult to identify and train agricultural talents [16]. The current requirements of enterprises for agricultural talents are shown in Figure 1.

As shown in Figure 1, the agricultural talents needed by enterprises should have the foundation of digital agriculture. With the advent of the digital era, more and more agricultural production processes are applying digital technology, and agricultural talents with this technology can supervise the production process and make suggestions. Secondly, in modern agriculture, family farms have become the main mode of operation. As agricultural talents, they are essential for the management of family farms, so they must have excellent knowledge of enterprise management and strategic management. After the further development of family farms, they will certainly go the way of marketization and scale, so there are also requirements for the ability of chain management of agricultural talents. Thirdly, with the rapid improvement of the country’s comprehensive grain production capacity, the promotion of agricultural technology, prevention and control of animal and plant diseases, and standardized agricultural production are gradually increasing in agricultural development. Therefore, agricultural talents need to have a foundation in modern agricultural technology in order to solve these problems in practice and ensure the safe circulation of agricultural products [17]. In addition, with the implementation of agricultural trade promotion measures, the export value of agricultural products has been on a growing trend. All agricultural talents also need to possess international trade and marketing capabilities to help improve the management of agricultural product marketing systems and increase the export trade value of agricultural products. These two abilities not only require good communication skills, but also good professional qualities. Finally, modern agriculture requires scientific management concepts as management tools. Agricultural talents are also essential for the management and enterprise management capabilities of rural professional cooperatives. This requires good basic knowledge of cooperative and enterprise management, as well as excellent business acumen and innovative knowledge, to properly handle problems in the management process. The quality of agricultural talents is determined through a large number of literature researches on agricultural talents and a questionnaire survey on the management personnel of relevant agricultural enterprises. Then, according to the recognition of the quality of the identified agricultural talents by the agricultural production enterprises, the specific characteristics of the proposed agricultural talents and the recognition evaluation results are shown in Table 1.

After a lot of literature research, a detailed analysis of the qualities that agricultural talents have has been conducted, and see Table 1 for details.

From Table 1, the level of identification among agricultural production enterprises with the various quality characteristics possessed by agricultural talents is not consistent. Among them, the recognition of the basic features of digital agriculture is the highest, and the recognition of agricultural security management ability is the lowest. Two features with a recognition level of less than 75% in Table 1 were removed, leaving 10 features with serial numbers E1-E10. The recognition degree of each of the ten features is different, so their weight in the algorithmic model of agricultural talent training is also different, and the study uses the AHP algorithm to quantify the weight of different features. The AHP algorithm is used to determine the weight of different features by comparing the importance of any two features and judging that the product of the elements in the stacked positions of the matrix is always 1. The specific comparison criteria used in the study are as follows: A scale of 1 indicates that two elements are equally important; a scale of 3, 5, 7, and 9 indicates that the former is slightly, obviously, strongly, and extremely important than the latter; a scale of inverse indicates that the positions of the two elements have been reversed. Using this method to evaluate the ten characteristic elements in the agricultural talent cultivation model, the evaluation matrix obtained is shown in Table 2. A1-A10 of horizontal axis and vertical axis in Table 2, respectively, represent ten different feature elements. The data in the table are obtained by comparing the feature degree between the two features. See the following details for specific comparison criteria.

After obtaining the judgment matrix as shown in Table 2, if the weights of different eigenvalues are to be obtained, further operations on the judgment matrix are required. Firstly, the column vectors are normalized, and the calculation formula is shown in

In Equation (1), represents one of the ten features of the horizontal axis; represents one of the ten features of the vertical axis, and denotes the weight value between features and . Then, the row vectors are normalized, and the formula is shown in

In formula (2), represents the sum of the row vectors after normalization, and finally, the expression of the weight value of for each feature is obtained by normalizing it as shown in

The weight values of different features of agricultural talents can be obtained by Equation (3). KNN algorithm is a commonly used classification algorithm, which is widely used in many classification situations because of its simple algorithm and high classification accuracy [18]. The AHP-KNN algorithm obtained by combining KNN and AHP is mainly used to calculate the distance between unknown samples and agricultural talent sample data with known labels. The impact of adding different feature weights on agricultural talent cultivation models is quantified, and the impact of different feature values on agricultural talent classification is quantified. Then, the KNN classification algorithm is used to classify the samples and find the category of the given sample. The specific steps of AHP-KNN algorithm are shown in Figure 2.

As shown in Figure 2, in the process of this algorithm, the data set must first be preprocessed and then divided into a training set and a test set. Then, the judgment matrix between the target layer and the criterion layer is initialized, hierarchical ordering is performed, and then, it is judged whether it passes the consistency test. If it fails, the judgment matrix is adjusted, and we return to the previous step. If it passes, the judgment matrix of the criterion layer and the schema layer is initialized, and hierarchical simple ordering is performed. Then, it is also judged to see if it passes the consistency test. If it fails, the evaluation matrix is adjusted and returned to the previous step. If it passes, the overall hierarchical ranking is performed, and the weight of each influencing factor in the scheme layer is obtained. Then, different values are set to traverse the test set, the Euclidean distance between the test sample and the training set is calculated, the KNN algorithm is executed, and finally, the classification of each sample in the test set is obtained, and the algorithm is finished. By calculating the weights of the features of agricultural talents and classifying them by KNN algorithm, agricultural talents are divided into four categories: excellent, good, pass, and fail. The sample set of agricultural talents is set to , and the weight value of different characteristics is set to . represents any sample in set ; then, the distance between sample and set is related to the weight value of the feature and the distance between sample and . The specific expression is shown in

Equation (4) is the weight value of different features, and denotes any sample in the set . Then, according to the input values, the training samples with known labels that are closest to the unknown samples are selected, and the category with the largest number of labeled unknown samples is selected to obtain the category of unknown samples. Each agricultural talent can be targeted by classifying the agricultural talent samples, so as to cultivate agricultural talents with excellent rank and then make up for the shortage of agricultural talents in our enterprises.

3.2. Improved KNN Algorithm Based on Value Selection Strategy

The KNN classification algorithm mainly consists of three elements: value, distance metric, and classification rule, and its classification principle is mainly to classify the samples to be tested by the category and classification rule of the samples closest to the samples to be tested [19]. In the KNN algorithm, the selection of value is very important; if the value is too small, the classification model will become complex, and the overall accuracy of the classification model will be reduced; if the value is too large, it will lead to the participation of samples that are not too similar to the sample to be tested and reduce the accuracy of the classification [20]. In the traditional KNN classification algorithm, the sample under test is classified by comparing the number of each type of each of the neighboring samples of the sample under test, and the sample under test is classified into the class with the highest number of neighboring samples. However, the traditional KNN algorithm is prone to classification errors due to the fact that the class with the highest number of neighbor occurrences is tied for first.

As shown in Figure 3(a), the number of both triangles and circles in the near samples of the data set is 2, which makes it impossible to determine whether the samples to be tested are classified as triangles or circles. In addition, the traditional KNN classification algorithm usually has an odd number of values, which is less prone to classification errors in the binary classification problem, but prone to classification errors in the multiclassification problem. As shown in Figure 3(b), the value is 5, and the five selected neighboring samples are 2 triangles, 2 circles, and 1 pentagon. At this point, the number of triangles and circles is tied for first place, and the classification of the samples to be tested cannot yet be accurately judged. In order to better solve the above problems, an improved algorithm based on the proliferation coefficient viscosity value selection strategy was proposed. The value of can be used as an even number. When the number of samples in adjacent samples is equal, the average distance from the tested sample is used as the classification indicator to classify the tested sample as a class with the average distance from the tested sample. In Figures 3(a) and 3(b), the number of triangular samples and circular samples is the same, but the average distance of the triangle from the sample to be tested is short, so the sample to be tested is classified as the triangular sample; in Figures 3(c) and 3(d), the number of triangular samples and circular samples is the same, and the average distance of both from the sample to be tested is the same, so the sample to be tested is classified as the type that is the closest sample to the sample to be tested. Therefore, in Figures 3(c) and 3(d), the sample to be tested should be classified as the sample of the circle class that is closer to it. The principle flowchart of the optimal classification algorithm based on the value selection strategy is shown in Figure 4.

In Figure 4, the process of the optimized KNN algorithm is divided into nine steps. The first step is to collect and prepare the data from the database and extract the features of the data. The second step is to use the data in the dataset as the training dataset and construct the sample set , and the range of the set is shown in

In Equation (5), denotes the first sample, while denotes the dimensional space. The next step is the initial setting of the value of . The fourth step is to find the samples closest to the sample to be measured in the set by using the Euclidean distance formula, which is denoted as . At this point, the Euclidean distance between the samples and is shown in

In Equation (6), is the first attribute of for the first sample. At this point, the category label of is set to , and the range of is made as shown in

In Equation (7), denotes the number of categories in the training sample set, while denotes the label of the th category. The fifth step is to determine the formula for the category of the sample to be tested according to the classification rules as shown in

In Equation (8), shows the feature function. The sixth step of the optimization KNN algorithm is to judge whether the obtained is unique or not. If the value of is unique, the classification effect is judged. If the classification effect is good, a conclusion is drawn. If the classification effect is not good, the value is reset in the third step until the classification effect is good. If it is found that the value of is not unique, it means that there are two types of samples with the same number of samples among close samples. Then, the average distance between the two types of samples with the same number needs to be calculated.

In Equation (9), and denote the two types of samples with the same number of samples, and denotes the number of samples in both types. After finding the average distance of the two types of samples, the average distances of the two types of samples and are compared. If they are equal, then Equation (10) can be obtained.

in Equation (10) is determined by

Equation (11) indicates that is the class. belongs to the proximity samples that are closest to the sample to be tested, . If and are not equal, then Equation (12) is obtained.

Equation (12) indicates that the sample to be tested is classified as the sample class with small distance, and at this time, to determine whether the classification effect reaches a high level, if it does, the result is output, if not, go back to the third step to reset the value to continue the cycle. By optimizing the KNN algorithm with better classification performance, and then applying it to the AHP-KNN algorithm model, it can help improve the classification accuracy of this algorithm model, which is beneficial to the targeted training of agricultural talents.

4. Improved AHP-KNN Algorithm Performance Comparison Analysis

To test the performance of the improved AHP-KNN algorithm based on value selection strategy in this study, two simulation comparisons were conducted on PyCharm software for AHP-KNN and KNN. The experiment compared the classification accuracy, error rate, and classification time of three algorithms under different values and compared the performance of the three algorithms by comparing the results of these three indicators. The error rate curves at different values are shown in Figure 5.

Figure 5 shows the error rate curves at different values, where Figure 5(a) shows the error rate curves at different values in the first comparison experiment. From Figure 5(a), the error rate curve of the optimized AHP-KNN algorithm is significantly lower than the other two error rate curves, and the optimized AHP-KNN algorithm has the lowest error rate at value of 6. The optimized AHP-KNN algorithm has the lowest error rate at value of 6, at which time the error rate is 1.7%; both the AHP-KNN algorithm and the KNN algorithm also have the lowest error rate at value of 6, with the lowest error rates of 4.2% and 4.9% for the two algorithms, respectively. Figure 5(b) shows the error rate curves of the three algorithms at different values in the second comparison experiment. From Figure 5(b), the error rate curves of the optimized AHP-KNN algorithm are also significantly lower than the other two error rate curves, and all three algorithms have the lowest error rate at value of 6, with the optimized AHP-KNN algorithm having the lowest error rate of 1.6%. From the above results, it can be obtained that among the three algorithms, the lowest error rate of the optimized AHP-KNN algorithm is lower than the other two algorithms, and this result indicates that the optimized AHP-KNN algorithm outperforms the AHP-KNN algorithm and the KNN algorithm in terms of the error rate dimension. The classification recognition rate results of the three algorithms with different values are shown in Figure 6.

Figure 6 shows the images of the classification accuracy of the three algorithms at different values, where Figure 6(a) shows the images of the classification accuracy at different values in the first comparison experiment. From Figure 6(a), the classification recognition rate images of the optimized AHP-KNN algorithm are significantly higher than those of the other two algorithms. The optimized AHP-KNN algorithm has the highest classification recognition rate at value of 6, at which time its classification recognition rate is 98.1%; the AHP-KNN algorithm also has the highest classification recognition rate at value of 6, 96.2%. The KNN algorithm has the highest classification recognition rate at value of 5, 93.8%. Figure 6(b) shows the classification recognition rate images at different values in the second comparison experiment. From Figure 6(b), the classification recognition rate images of the optimized AHP-KNN algorithm are significantly higher than the other two algorithms, and the highest rate of it is also higher than the others. The above results indicate that among the three algorithms, the optimized AHP-KNN has a better highest classification recognition rate. The classification times of the three algorithms at different values are shown in Table 3.

From Table 3, it can be obtained that in the two comparison experiments, the classification time of KNN among the three algorithms is much higher than the other two algorithms. Its classification time is around 400 seconds, while the overall difference between the classification time of optimized AHP-KNN and AHP-KNN is not much. The overall classification time of the optimized AHP-KNN is slightly lower than that of the AHP-KNN. Its minimum classification time is 27.5 seconds, which is lower than that of the AHP-KNN in 30.8 seconds. The above results indicate that the optimized AHP-KNN outperforms the two comparison algorithms in terms of the classification time dimension. To better improve the classification performance of the algorithms, the study will analyze the effect of the ratio of training samples on the classification performance of the algorithms, and the study sets the value of to 6. The three algorithms are applied to two comparison experiments on data sets with different training sample ratios, and the error results are plotted as shown in Figure 7.

Figure 7 shows the scatter plots of the error results of the three algorithms in different training sample ratios. Figure 7(a) shows the scatter plots of the error results of the three algorithms in different training sample ratios in the first comparison experiment. From Figure 7(a), all three algorithms have the lowest error rate at the training sample ratio of 0.8, and the optimized AHP-KNN has the lowest error rate of 0.8%, which is much lower than the 4.2% of the AHP-KNN and the 7.8% of the KNN. Figure 7(b) shows the scatter plots of the error results of the three algorithms for different training sample ratios in the second comparison experiment. From Figure 7(b), when the training sample ratio is 0.8, the error rate of the three algorithms is the lowest. The optimized AHP-KNN has the lowest error rate, which is significantly lower than the other two comparison algorithms. Combining the comparison results of error rate, classification recognition rate, and classification time, the optimized AHP-KNN has better classification performance. By using this algorithm to classify agricultural talents, it is possible to classify agricultural talents more accurately and accurately. Thus, it can better target the cultivation of agricultural talents and make up for the serious shortage of agricultural talents in China.

5. Conclusion

With the rapid development of modern technology, the demand for core talents in agricultural enterprises has greatly increased, but most agricultural practitioners do not have the required skills of agricultural talents. To improve the professional quality of agricultural professionals, this study proposes an agricultural talent training model based on AHP-KNN. It uses the optimized AHP-KNN to accurately classify agricultural professionals and then trains them according to the classification results of different types, achieving their transformation into agricultural talents. In the performance comparison experiment, it is found that the classification accuracy of the optimized AHP-KNN algorithm, AHP-KNN algorithm, and KNN algorithm is 98.1%, 96.2%, and 93.8%, respectively. The classification time of the three algorithms is 27.5 s, 30.8 s, and 400 s, respectively, which is better than the other two comparative algorithms. In addition, this study also found that when the value is 6, the error rates of the improved AHP-KNN algorithm, AHP-KNN algorithm, and KNN algorithm are 0.8%, 4.2%, and 7.8%, respectively. The above results show that the proposed classification algorithm has better classification performance and can improve the training efficiency of agricultural talents on this basis. Although the classification algorithm proposed in this study has good performance, the selection of agricultural talent characteristics during the experimental process is too objective and one-sided. Therefore, the future research direction is to propose a classification algorithm that can target more comprehensive agricultural talent characteristics.

Data Availability

The datasets used and/or analyzed during the current study are available from the corresponding author on reasonable request.

Conflicts of Interest

The authors declare no conflict of interest.

Acknowledgments

This work was supported by the Projects of Major Humanities and Social Sciences of Anhui Universities (grant: SK2021ZD0044), the Project of National Innovation and Entrepreneurship for College Students (grant: 202210363117X), and the Humanities & Social Sciences of the Ministry of Education (grant: 18YJCZH228).