Abstract
From the perspective of China’s food safety management practices, effective early warning and intervention of food safety risks in the food industry chain will greatly reduce the possibility of food safety accidents, thereby improving the safety and stability of people’s social life. This study builds a food safety risk intelligence early warning model based on support vector machines. First, it discusses the process of food safety risk intelligence early warning, classifies warning indicators of warning indicators, and sets the principles of early warning. Secondly, based on the theory of support vector machine technology, an intelligence early warning model for food safety risks is constructed, and the collection and processing of sample data are explained. Finally, based on the analysis results of the early warning model, the results are discussed to verify the effectiveness and accuracy of the early warning model.
Introduction
Food is the most important thing for the people, and safety is the most important thing. With the rapid development of the economy and society, the food industry has also grown with high quality. The increase in new food technologies, the emergence of new food technologies, and changes in dietary patterns have made the public more and more concerned about food safety issues. Especially in recent years, the outbreaks of food safety incidents such as “mad cow disease”, “lean meat essence”, “gutter oil”, “zombie meat” and “takeaway hygiene” have not only endangered the life and health of the public, but also caused the immeasurable negative social impact, which has caused the public to question the government’s ability to govern the public. How to manage food safety issues to make people feel at ease has gradually become the focus of attention in the theoretical and practical circles.
From the perspective of China’s food safety management practices, effective early warning and intervention of food safety risks in the food industry chain will greatly reduce the possibility of food safety accidents, thereby improving the safety and stability of people’s social life [1]. According to the theory of risk management, pre-warning, risk analysis, and control of food safety risks are two important parts that cannot be ignored in the process of food safety risk management and control [2]. However, in the practical process of food safety supervision, there are often problems of “emphasis on control and neglect on early warning”. That is, in most cases, when a food safety accident occurs, the problem of the risk caused by its causative factors is improved and eliminated, and the pre-warning of food safety risks is neglected [3]. Especially from the perspective of intelligence flow, with the continuous improvement of China’s food safety supervision system, such as the implementation of the food information traceability system and the food safety information disclosure mechanism, related food has been formed among various stakeholders in the food industry chain. Safety information intelligence flow, food safety intelligence can provide strong information decision support for food safety risk early warning [4]. Therefore, in the context of increasing public safety requirements for food safety, it is necessary to effectively grasp and make good use of food safety information in order to achieve effective risk early warning and control of food safety.
Literature review
At present, the issue of early warning of food safety risks has received widespread attention from scholars at home and abroad, mainly focusing on two aspects: First, the establishment of a risk assessment index system, Williams et al. [5] based on the division of the supply chain, discussed the possible food safety risk factors, and established a microbial food safety risk early warning framework on this basis. Zhang et al. [6] combined the requirements for agricultural quality control in China GAP standards (Chinese Good Agricultural Practices), and established the main nodes in the supply chain: “vegetable planting bases”, “vegetable processing production enterprises”, and “dealers at all levels” “As the core vegetable food safety risk assessment index system. Lu et al. believed that the assessment and early warning of food safety risks should be able to establish early warning indicators that can comprehensively reflect food safety from aspects of food production, transportation, consumption and trade. Li [7] considered that the assessment of food safety risks should include three aspects of food quantity safety, food quality safety, and sustainable food safety based on the connotation characteristics of food safety, and designed detailed based on the above three aspects Index system. Kleter et al. [8] believed that for the design of food safety risk assessment index system in the new period, we must fully consider the new requirements of the new environment for risk assessment, and must be able to reflect food safety risks in the external environment, food production chain, consumption and new features in many aspects. The second is the selection of risk early warning model assessment methods. Hoornstra et al. [9] believed that risk analysis is a structured process that includes three independent and interrelated elements: risk assessment, risk management, and risk information sharing. Risk assessment is a scientific process for hazard identification, exposure estimation, hazard characterization, and risk characterization. LeBlanc et al. [10] proposed a method for designing and aggregating a related database for the distribution simulation tools for predicting the food safety risks associated with contaminated foods to facilitate their collection of data. This database is mainly applied to single-variety foods, convenience foods and vegetable foods nationwide and products related to the widespread spread of infectious microorganisms. Chen et al. [11] designed food safety risk assessment indicators based on the catastrophe model and structural stability theory from the perspective of the food industry chain to measure the risk of food production, distribution and consumption, respectively. Draw the total risk of food safety in China in recent years, and find out the weak links in our food. Chai [12] discussed many problems in the safety assessment process of genetically modified foods, and introduced a method of combining hierarchical whole system modeling (HHM), analytic hierarchy process (AHP) and evidence theory to establish a multi-attribute information fusion decision model, and developed an intelligent evaluation platform for edible food safety.
According to the literature review of related research, although these research results provide a solid theoretical basis and decision support for the practice of food safety risk early warning, the existing research has not yet formed a consensus and authoritative early warning model, especially from the perspective of intelligence flow, the issue of early warning of food safety risks is rare. Due to the characteristics of food safety intelligence and information flow, it is decided to conduct a new review on the issue of early warning of food safety risks. Therefore, with the help of the good performance of support vector machine theory in predictive ability, this study uses support vector machine to establish a food safety risk intelligence early warning model and research the food safety risk early warning.
The organizational layout of this article is as follows: Part III discusses the process of food safety risk intelligence early warning, classifies warning indicators, and builds an information early warning model of food safety risks based on the principles of support vector machine technology. The collection and processing are explained. The fourth part discusses the results based on the analysis results of the early warning model to verify the validity and accuracy of the early warning model. The fifth part gives the research conclusions of this study based on the previous analysis.
Research method
Food safety risk intelligence early warning process
The food safety risk intelligence early warning process constructed in this study mainly includes three main steps, including the establishment of an early warning indicator system, early warning model construction, and application evaluation of the early warning model. The purpose is to pre-warn all stakeholders in the food industry chain that food may occur at safety risk step, which can avoid food safety accidents. Specifically, it adopts the idea of ex-ante control [13], establishes a set of early-warning and evaluation index systems that focus on monitoring food safety risks, and uses the food safety intelligence flow among various stakeholders in the food industry chain to monitor, judge and analyze possible risk links and objects, the causes of food safety risks, and how to take preventive measures to further correct the risk points of possible food safety accidents. Food safety risk intelligence early warning process is shown in Fig. 1.

Food safety risk intelligence early warning process.
It can be seen from Fig. 1 that in the process of establishing an early warning indicator system, the selection of early warning evaluation indicators, the alertness classification of the evaluation indicators and the early warning criteria for setting the evaluation indicators are included. Among them, whether the selection of early-warning evaluation indicators is reasonable is the key to scientifically establishing an early-warning evaluation index system, and also a prerequisite for whether an early-warning model can accurately give police information [14]. For food safety risk early-warning indicators, it is necessary to be able to comprehensively reflect the characteristics of food safety risks, not only to reflect the risk factors contained in the stakeholders in each link of the food industry chain, and the internal relationship between these risk factors, but also to be able to highlight the characteristics of food safety intelligence flowing between different stakeholders from the perspective of intelligence flow. For the alertness classification of the evaluation indicators, the food safety risk intelligence early warning model is to predict the alertness of food safety risks, that is, to give different degrees and types of alertness to food safety risks based on the alertness classification. For the warning indicators of evaluation indicators, it is the principles and standards for evaluating food safety risks. That is, according to the early warning guidelines for evaluation indicators, whether the early warning model should give a warning forecast based on actual food safety information in a specific situation, and what level and type of alert is issued.
In the construction of the early warning model, the focus includes three tasks: data preprocessing and quantification, using the support vector machine model to construct the early warning model, and using data to learn the early warning model. Among them, the data used in the construction of the early warning model are derived from food safety information issued by various stakeholders in the food industry chain. Due to the differences in the effective carriers used in the formation of intelligence [15], it is necessary to refine the information collected According to the early-warning indicator system; the index attribute information contained in the food safety intelligence is quantified. On this basis, the initial data is further filled with vacant values, data noise is eliminated, and inconsistent data is cleaned to ensure the validity of the data during the construction of the early warning model and the learning process. The construction of the early warning model mainly uses the technical theory of support vector machines. Because support vector machines are a machine learning algorithm based on mathematical statistics learning, they have very good small sample learning performance for processing incomplete data and small amounts of data. And generalization ability, the technology theory has achieved very successful applications in the fields of portrait recognition, speech recognition, etc. [16]. Therefore, support vector machines are also very suitable for the application of food safety risk intelligence early warning. Finally, the early warning data based on the support vector machine is used to train the early warning model to determine the optimal parameter set in the model.
In the application and evaluation of the early warning model, it is necessary to use the trained early warning model to make early warning judgments on the food safety information reflected by the risk objects according to the early warning evaluation indicators. When the evaluation result of the early-warning object is in a low-risk state, it indicates that the food safety risk factors reflected by the early-warning index have not changed in the direction of the occurrence of food safety accidents. It is only necessary to perform routine intelligence early-warning monitoring on the early-warning object to prevent the risk factors from deterioration. When the results of the early warning evaluation show that the early warning object is in a high-risk state, it indicates that at this time, certain food risk factors have exceeded the risk threshold, and the development and change of risk factors will lead to a food safety accident at a certain time in the future. The subject must pay particular attention at this time, and must design and implement relevant risk response measures for specific risk factor characterization, eliminate and prevent further deterioration and spread of food safety risks, and minimize the possibility of detection of food safety incidents.
From the perspective of the food safety risk intelligence early warning process, the prerequisite for the construction of the food safety risk intelligence early warning model is to design a suitable food safety risk early warning indicator system, and set reasonable early warning alert standards and early warning principles for the early warning indicators. Only in this way can the scientific and effective follow-up process of food safety risk intelligence early warning be ensured and the food safety risks can be more accurately warned from the perspective of intelligence flow.
This article analyzes the sources of food safety information obtained by the stakeholders in the main links of the food industry chain, and extracts 14 related food safety risk factors, including:
In the production of raw materials, there are three risk factors including personal safety awareness risk factors, natural environment pollution risk factors, and agricultural and veterinary drug residue risk factors. Among them, the personal safety awareness factor refers to the individual’s willingness to subjectively control the quality of the food raw material production process. When the personal safety awareness is insufficient, it will cause the farmers’ subjective initiative to standardize the safe production of food materials to a certain extent, which will increase the possibility of food safety risks. Natural environment pollution factors refer to food safety risks caused by pollution of natural resources such as soil and water. Agricultural and veterinary drug residue factors refer to the excessive or improper use of pesticides or veterinary drugs during the production of food raw materials, resulting in defects in the quality or nutrition of the food raw materials, thereby causing food safety risks.
In the process of food processing, there are 5 factors including the risk factors of unsafe raw materials, the hygiene risk factors of the processing environment, the risk factors of the use of unsafe excipients, the risk factors of unqualified packaging, and the risk factors of unqualified processing procedures. Among them, the risk factors for the use of unsafe raw materials are that when unsafe raw materials produced by raw material producers are transferred to food processors, hidden safety hazards are caused in the finished food products due to the use of unsafe raw materials [17]. The sanitary risk factors of the processing environment refer to the hidden risks of safety risks in the finished food products due to the hygienic conditions of the processing environment that do not meet the standards during the production and processing of food. The risk factors for the use of unsafe excipients refer to the illegal use of production aids such as additives, preservatives, etc. during food production and processing [18]. The risk factor of packaging failure is that the packaging of the finished food by the processing company does not meet the food storage standards, or the packaging material has hidden safety hazards [19]. The risk factor of unsatisfactory processing procedures refers to the fact that the processing procedures of food processing enterprises do not meet the required standard processes, and the processed food products do not meet the standards.
In the food circulation, there are two factors, such as risk factors of unqualified storage and transportation and risk factors of improper disposal of waste food. Among them, the risk factors of unqualified storage and transportation refer to the food safety risks caused by food deterioration during the storage or transportation of food due to the difficulty of ensuring the storage requirements of the food in the storage environment or transportation conditions [20]. Risk factors of improper disposal of waste food refer to the risk of spoilage of the rest of the food due to the fact that the food itself is perishable, and the food that was normally consumed due to spoilage during storage and transportation was not disposed of in a timely manner [21].
In terms of food consumption, there are risk factors for non-compliance of food establishments and risk factors for improper eating procedures. Among them, the risk factor of catering establishments failing to meet the standards refers to the food safety risks caused by the food supply and hygiene standards of catering establishments not meeting the standards. Risk factors of improper eating procedures refer to the safety risks of food poisoning and expired food consumption caused by consumers in the final catering process due to substandard food consumption standards.
In food supervision, there are risk factors for food safety supervision and risk factors for public opinion information on food safety. Among them, the risk factors of food safety supervision refer to the food safety risks caused by insufficient control of food safety and quality in the production, processing, distribution and consumption links by the government’s food safety supervision department [23]. Food safety public opinion information risk factors refer to news media, online self-media, and the general public’s reports and concerns on food safety issues [24]. Inadequate attention to food safety issues will lead to rent-seeking space for food safety-related stakeholders, increasing potential risks of major food safety incidents.
Food safety risk intelligence early warning evaluation index system is shown in Fig. 2.

Food safety risk intelligence early warning evaluation index system.
The warning level of food safety risk intelligence early warning is based on the characteristics of food safety issues, which are very destructive and will cause serious economic losses and social hazards. It also draws on the classification of risk warning level methods by Zhang et al. [25]. This literature divided the warning degree of food safety risk intelligence warning into two types: high risk and low risk. The high risk of food safety means that the evolution and development of a certain risk factor has seriously deviated from the normal safety state, has seriously affected the normal nutritional level of food, produced toxic and harmful substances that endanger human health, and endangered human health. When a certain risk factor is in a high-risk state, a food safety accident is very likely to occur, causing extremely serious loss of life and economics, and bringing negative social impacts. Therefore, according to the characteristics of risk factors, emergency risk response measures must be adopted to prevent further deterioration of their status. Low food safety risk means that the development and change status of a certain risk factor is within the normal food safety range, and its risk level is at a low level. It does not affect the normal nutritional level of food, nor will it produce toxic and harmful substances that endanger human health. When a risk factor is in a low-risk state, it is only necessary to continue to conduct early warning and monitoring of the risk factor through food safety intelligence to prevent the risk factor from developing into an unsafe state.
In addition, in order to carry out accurate early warning evaluation of food safety risks, the principles of food safety risk early warning need to be further clarified, that is, the standards and principles of food safety risk early warning evaluation need to be determined, and it is used to guide the early-warning model to give early-warning warnings on the food safety risk status in different situations, and to what extent early-warning warnings are given. As the evaluation of food safety risk intelligence early-warning indicators is mainly based on the use of relevant food safety intelligence to evaluate the status of a certain risk factor, it is difficult to measure through specific quantitative indicators. The Delphi method has the characteristics of anonymity and convergence of evaluation results in related evaluation studies. It can use the expertise and experience of experts and scholars in related fields to give a more objective analysis of evaluation results. Therefore, referring to the research of Zhou and Xiao [26], this article uses Delphi method to evaluate the actual occurrence of food safety risk indicators. Specifically, it issues food safety information related to a risk factor to food. Experts and scholars in the field of security management evaluate the status of risk factors by experts and scholars in combination with their actual information. The risk is assigned a score of 1 to 5 according to the magnitude of the risk, with 5 points representing the risk of the factor. The degree is the largest, and 1 point indicates that the risk of the factor is the smallest. When the average score of a risk factor early warning evaluation index is greater than or equal to 3, the risk factor is judged to be in a high-risk state; when the average score of a risk factor early warning evaluation index is less than 3, the risk factor is judged to be low Risk status.
It should be noted that in the foregoing research, the identification of food safety risk factors based on intelligence flow found that food safety regulatory risk, food safety public opinion information risk, and personal safety awareness risk are the key factors affecting food safety risk from the perspective of intelligence flow. The sanitary risks of the processing environment, the risk of unqualified processing procedures, and the risks of improper eating procedures are the direct factors that cause food safety risks. The evolution and development of these factors mentioned above are more sensitive to the overall impact of food safety than other factors. Their subtle development and changes to an unsafe state will greatly affect the state of food safety risks, leading to food safety accidents. Therefore, the early-warning evaluation criteria for the above-mentioned food safety risk factors are tightened and more sensitive, that is, the weights of the above-mentioned risk factor early-warning evaluation indexes are twice that of other indexes.
Principle of support vector machine
The data source of food safety risk intelligence warning should be based on the food safety information disclosed by various stakeholders in the food industry chain. However, on the one hand, intelligence serves for early warning decision-making through the process of intelligence analysis and evaluation [27], and on the other hand, the problem of information distortion also occurs during the flow of information, which determines to a certain extent that the construction of food safety risk intelligence early warning models is to be carried out in a more high-dimensional, non-linear and noisy situation, and support vector machine theory has a good performance of small sample learning and generalization in the context of incomplete data and small data volume, and the widespread application of support vector machine theory provides a solution for the establishment of food safety risk intelligence early warning models.
Statistical learning theory is the theoretical foundation of Support Vector Machines (SVM). It mainly explores the rules of machine learning in the context of small samples. In the analysis of statistical learning of small samples, statistical learning theory not only considers requirement of sample gradualness, it also emphasizes the pursuit of optimal learning results under the constraint of limited sample resources [28]. Specifically, for the analysis method of support vector machine, it mainly applies the VC dimension (Vapnik–Chervonenkis Dimension) theory and the principle of Structural Risk Minimization in statistical learning theory. It is based on the limited sample data, to find the best compromise between the replication model of the support vector machine and the learning ability to obtain the best learning ability and generalization ability. In a specific method implementation, the support vector machine maps the nonlinear data of the original sample space to the high-dimensional feature space by introducing the kernel function, and builds a linear function in this space, and trains and learns from the sample data, so that the support vector machine model can intelligently identify those support vectors with good discrimination ability, and thus construct a classifier that maximizes the interval between classes, that is, the model has a good generalization ability and a high recognition ability for support vectors [29]. That is, the support vector machine further distinguishes the final classification results of the samples by the categories of the boundary samples in the region where the training sample class is located.
Generally speaking, the support vector machine mainly faces the analysis situation where the sample is linearly separable and the sample is linearly inseparable [30]. When the samples are linearly separable, the support vector machine needs to determine a classification boundary and classify the training samples into two types, and then find the maximum distance between the two types of sample points and the classification boundary. When the sample is linearly inseparable, the training sample is mapped to a high-dimensional space non-linearly through the kernel function, so that the linearly inseparable case is transformed into the linearly separable case, and the model continues to be trained.
Figure 3 shows the classification principle of the support vector machine when the samples are linearly time-divisible. In the figure, the solid dots and hollow dots represent two different types of training samples, L2 represents the determined classification boundary, and L1 and L3 are two. The two training lines are closest to the classification boundary L2 and are two parallel straight lines, that is, after the two types of training samples are distinguished, the distance between L1 and L3 must be maximized. The purpose is to further control the generalization of the model, and ability to ensure the minimum structural risk of the trained model [31].

Classification principle of support vector machine in linear separability of samples.
It can be seen that the support vector machine has the following advantages when processing small samples of machine learning: Support vector machine is a statistical learning method that specifically solves the problem of limited samples. Unlike the previous emphasis on solving the optimal solution when the sample tended to infinity, the goal of support vector machines is to solve the optimal solution under the condition of restricted sample information. The support vector machine solves the problem of local value optimization that cannot be performed by the neural network algorithm. It is a transformation of the support vector machine algorithm into a quadratic type optimization, thereby obtaining the global best advantage. Support vector machines use kernel functions to transform real-world problems from non-linear spaces to high-dimensional feature spaces. It is to map the non-linear data of the original sample space to the high-dimensional feature space and build a linear discriminant function in this space to ensure that the model machine has good generalization ability. In addition, the complexity of the SVM algorithm is independent of the sample information dimension, and to some extent, it solves the problem of restricting the sample dimension in existing learning algorithms.
During the modeling of support vector machine, it is assumed that there are n training sample sets in the initial state (x i , y i ), x i ∈ R d , y∈{1,-1}, i = 1, 2, ·· · , n, among these, x i represented as the feature vector of the training sample and set it as a point in the d-dimensional space. y i represents the classification coding of training samples. There are two values: 1 and –1. When the training sample set (x i , y i ) is linearly separable, there is a hyperplane to classify the training samples differently, that is,
Further, the optimal classification hyperplane can be obtained by maximizing the geometric interval. That is, solving the following linear programming problem:
Where, ∥w∥ is the second norm of the vector.
However, in a real situation, the training sample set is often not completely linearly separable. At this time, the usual processing method is to introduce a relaxation variable ξ i and a standard parameter C to define the soft interval, and solve the generalized classification hyperplane under this condition, that is:
And using the Lagrangian parameter optimization method, the above optimal classification problem is transformed into its corresponding dual problem, so that the optimal classification function can be obtained:
In the above formula,
In addition, for the case where the training samples are linearly indivisible (i.e., non-linear problems), a kernel function K (x i , x) needs to be introduced. The classification function at this time is:
That is, the support vector machine first calculates the feature vector in the initial low-dimensional space, and then transforms the input space into the high-dimensional feature space through the kernel function K (x i , x), thereby transforming the original low-dimensional nonlinear problem into a high Linear classification in dimensional space, that is, constructing the optimal classification hyperplane in high-dimensional feature space.
It can be seen that the key to constructing an early warning model with high stability and high prediction ability based on support vector machine is to determine the kernel function. The form and parameters of the kernel function have an important impact on the performance of the support vector machine. Generally speaking, the existing research often uses the Radial Basis Function [32] based on the inner product, and its function expression is:
After the kernel function K (x
i
, x) is determined, the key parameters in the classification function must be further determined: the Lagrangian parameter
This article uses the food safety supervision and sampling information released by the Food and Drug Administration of Hubei Province in 2018 to collect and sort out the food sampling unqualified items in a total of 44 issues of information announcements issued throughout the year, and combines the national food (product) safety Traceability platform (http://www.chinatrace.org/), food company website information, and food safety random inspection reports of government regulatory agencies, according to 14 indicators of food safety risk intelligence early warning, the relevant information obtained is classified into categories induction. Due to the unavailability of relevant information of some food companies, project samples with incomplete information corresponding to the early warning indicators have been eliminated to ensure that relevant experts can accurately judge the food safety risk level of the project samples when the information is sufficient.
Through the collection and processing of the above sample data, a total of 40 food safety risk early-warning index information with complete samples of unqualified food sampling items were obtained. In addition, in order to make the sample data more diversified, this article further selects 10 samples of qualified food sampling items with complete food safety risk early-warning indicator information to form a sample of this empirical analysis. On this basis, between April 2019 and May 2019, the materials and information of the above project samples were sent to 20 people in food safety risk management, food safety supervision intelligence control, academic experts in the field of food supply chain management, middle and senior management personnel of food companies, and staff of government food regulatory departments will judge the alertness according to the warning score standards set earlier. After obtaining the expert evaluation score, calculate the average value of each early-warning evaluation index, and then return the average value of the first round of scoring results to the experts. Each expert will modify his own evaluation based on the first round of scoring results, and will finally obtain the expert’s evaluation score is then calculated by the mean value, so as to obtain a more consistent evaluation value.
After the above series of sample data collection and processing, a total of 41 high-risk state project samples and 9 low-risk state project samples were obtained, for a total of 50 sample data. The detailed information is shown in Table 1.
Descriptive statistical analysis of samples
Descriptive statistical analysis of samples
Identification of training samples and test samples
According to the previous process of constructing the food safety risk intelligence early warning model, the food safety risk intelligence early warning indicator system includes 18 specific indicators, that is, the input of the support vector machine is the s dimension (s = 18). According to the determination of the warning level, food safety risks include two types of high-risk states and low-risk states, that is, using 1 and –1 as the output of the support vector machine. When the output of the support vector machine is t = 1, it means that the sample is in a high-risk state of food safety; when the output of the support vector machine is t = –1, it indicates that the sample is in a low-risk state of food safety.
Further, for the determination of the proportion of training sample and test sample of the support vector machine model, according to the suggestion of Ahn et al. [34], for the purpose of improving the effectiveness of the model, the overall sample is generally trained according to a 1:1 ratio and division of test samples. In other words, 25 samples of the 50 overall samples are used as training samples to train the support vector machine, and the remaining 25 samples are used as test samples to test the model’s learning and generalization capabilities. The specific information is shown in the Table 2.
Sample distribution
Sample distribution
For the determination of the support vector machine kernel function, combined with the previous analysis, the radial basis kernel function widely used in the existing research is still used. The determination of the key parameters Lagrangian parameter
Specifically, the training samples and the SVMcgForClass function (grid search method), gaSVMcgForClass function (genetic algorithm), and psoSVMcgForClass function (particle swarm algorithm) provided by the libsvm toolbox in Matlab 2015b software are used to perform experiments [36]. The Lagrangian parameter
Experimental results of parameter selection
Experimental results of parameter selection
From the experimental results in Table 3, it can be seen that when the particle swarm algorithm is used to select the key parameters of the support vector machine model, the model prediction classification accuracy is the highest, which is 95.0733%, which is greater than the result of the grid search method 93.8452% and the result of the genetic algorithm 94.3281%, indicating that the optimal parameters obtained by the particle swarm algorithm
Using the support vector machine model that has been trained through the training samples and the remaining 25 test samples, the application of the food safety risk intelligence early warning model based on the support vector machine is tested. By calling the svmpredict function, the verification results of the early warning model are shown in Table 4 and Fig. 4.
Comparison of model verification results with actual values
Comparison of model verification results with actual values

Classification comparison between predicted value and actual value of test sample.
From Table 4 and Fig. 4, it can be seen that the prediction results of food safety risk intelligence early warning of 22 of the 25 test samples are high-risk states, and the prediction results of 3 samples are low-risk states, which are in line with the actual results of the test samples. In comparison, only the prediction results of the food safety risk intelligence early warning of samples 10 and 20 are biased from the actual results, and the low-risk state of the actual result is misidentified as the high-risk state. The above results show that the food safety risk intelligence early warning model based on the support vector machine predicts 25 test samples, and the prediction results of 23 samples are consistent with the actual results, that is, the prediction accuracy of the early warning model is 92%. Although the prediction accuracy of the test sample is slightly lower than 95.0733% of the training sample accuracy, this is because the test sample is completely new to the early warning model, and its prediction accuracy can reflect the true warning level of the model. According to Wu and Dietterich [37] on the prediction accuracy of support vector machines, the prediction accuracy of 92% of the test samples can better judge the high-risk state and low-risk state of food safety risks, and can obtain credible prediction results. In addition, according to the classification results of the test samples, the prediction results of the 20 high-risk state samples in the test samples are consistent with the actual results, and only 2 samples whose actual results are low-risk states are misjudged as high-risk states. It also shows from the side that the trained early warning model is more sensitive to food safety risks, and from the perspective of risk pre-control, the misjudgment of the small-scale low-risk state to the high-risk state of the early warning model is also acceptable.
In summary, through the above research results, it can be found that the model prediction accuracy obtained by determining the key parameters in the food safety risk intelligence early warning model through particle swarm optimization is the highest, and combined with the test sample verification of the early warning model, the prediction accuracy is reached at a level of 92%, in an acceptable range, and showed good prediction results, indicating that the food safety risk intelligence early warning model based on support vector machine has good generalization ability, the model is robust, and can effectively provide early warning of possible food safety risks based on the information flow between various stakeholders in the food industry chain, and it can helps various stakeholders to take targeted risk prevention and control measures according to the characteristics of risk factors, so as to make scientific and reliable risk prevention and control decisions.
This study focuses on the construction of food safety risk intelligence early warning model based on support vector machine. Analyze the process and indicator system of food safety risk intelligence early warning, use radial basis function and particle swarm algorithm to determine the optimal parameters in the support vector machine model, and collect the risk status of 60 food sampling inspection projects in 2018. To study the sample, the early warning model was trained and verified. It was found that the food safety risk intelligence early warning model has good learning and generalization capabilities, can obtain more accurate prediction results, and the prediction accuracy rate reaches 92%, which better solves the food safety risk intelligence early warning classification problem.
The construction of the food safety risk intelligence early warning model in this study is based on the support vector machine classification technology. Although the support vector machine technology supports the establishment of the early warning model well, and has obtained relatively ideal research results. But with the continuous development and improvement of big data intelligent technologies such as machine learning and deep learning, it is bound to study the existence of more ideal model training and prediction algorithms in the future. Therefore, further research can be combined with more cutting-edge big data intelligence technologies for the construction of early warning models.
