Exercise Behavior Prediction and Injury Assessment Based on Swarm Intelligence Algorithm

'e biggest view of the whole world on science and technology and sports is that science and technology and sports both represent national strength. At present, the integration of sports and science and technology has not reached a certain height, especially in the prediction of sports behavior and injury assessment, and the investment in science and technology is still lacking.'is leads to a high number of injuries caused by sports every year. However, swarm intelligence algorithm has made few breakthrough achievements in the past few years, and the combination of sports behavior and swarm intelligence algorithm can just solve this problem. It is very important to choose the algorithm for predicting and assessing sports behavior. We should choose an efficient algorithm with high stability, high convergence speed, and optimization ability. In this paper, the IPSGWO algorithm is proposed to realize this application. IPSGWO algorithm is based on the GWO algorithm, with appropriate strategies and ideas, to maximize the improvement. In this paper, the convergence curve of PSO, GWO, and IPSGWO is tested to determine whether the IPSGWO algorithm has more stable and higher performance, and the simulation experiment is used to determine whether the IPSGWO algorithm is suitable for prediction and injury assessment compared with the other two. From the experimental results, the IPSGWO algorithm does have higher performance; because of this, it is more accurate for prediction and injury assessment.


Introduction
In contemporary society, with the rapid development of science and technology, people began to pay attention to sports. e national sports policy has gradually deepened, from the initial social sports to today's science and technology sports, and the state has supported it. At the same time, in order to further improve sports, the prediction of sports behavior and injury assessment has also attracted much attention. e addition of science and technology is undoubtedly a good medicine, and the combination of sports behavior and computer intelligent algorithm is undoubtedly in line with the development trend of contemporary society and even the world. With the addition of intelligent algorithm, sports behavior is more predictable, and the harm it brings can be predicted and avoided in advance to a certain extent, which makes sports more stable and safe, and more children and the elderly can participate in sports activities with confidence and feel the changes brought by science and technology.
Swarm intelligence [1] is developing rapidly nowadays, and it is involved in various fields, such as electronic media, company management, and other related fields. Two unrelated fields can be opened to traffic with swarm intelligence as a bridge. Researchers have also established and implemented important standards for the operation of swarm intelligence, so as to have further research on swarm intelligence. e research of swarm intelligence originated from insects [2], and the behavior characteristics of social insects that have survived for millions of years are not centralized distribution function and self-organization ability. Uncomplicated creatures can also complete complex tasks, and they can generate great abilities only by interacting with each other. Although social insects are not half as intelligent as humans [3], their self-organized work is to consciously accomplish one or more tasks by multiple individuals. However, despite this, they always have very effective ways to deal with all kinds of problems they encounter, and they can quickly adapt to the changing environment around them. After decades of research, scientists have put forward a rigorous mathematical model for this phenomenon of swarm intelligence, which has been applied to business management. Ants can walk the shortest way to find food, and this discovery has been used in telecommunication network communication and airline transportation of goods. Another kind of insect, the bee, performs very highly on activities, performing the most important tasks by comparison. And, this is also applied to truck painting system. Swarm intelligence is mostly used in the direction of artificial intelligence, and its collective behavior is not concentrated and organized in both artificial and natural aspects [4]. Uncomplicated agents or groups are members of swarm intelligence systems. ey never break the rules of swarm intelligence systems, but they can behave arbitrarily and are not limited by centralized control structures. ey communicate with each other to produce global behavioral agents, but the individual does not intervene, resulting in the individual not understanding. Most of the discoveries [5] that are different from the conventional ones and beneficial to scientific progress come from the fusion of some unrelated fields. Basic algorithms, such as simulated annealing, are the best examples of technologies that have been opened to traffic in two closed fields because of the bridge of swarm intelligence. Tough microsystem technology, aiming at innovation on the platform of multiagent system [6] and based on microrobot and swarm intelligence theory, a brand-new discipline, came into being. e algorithm is generated according to swarm intelligence, so that the uncomplicated robot agent can solve complex problems. Now, it is the combination of swarm intelligence and micro-operation tasks, which will have important features: each microrobot can perform shared information and technology. In order to observe the behavior of a large number of people after interaction [7], the experimenter applied swarm intelligence to blog data, from the modeling of collective behavior. Blog data will be trained and tested according to the ant colony optimization model. e combination of ant colony optimization model and CHI is a useful result of this experiment, and the experimenter is full of confidence in future research. Literature [8] most swarm intelligence is reverse analysis and research on a target product and adaptation to collective behavior in nature, so as to obtain a more optimized algorithm. Compared with the previous basic algorithms, these algorithms have stronger adaptability, sensitivity and robustness, which are the properties needed for the development of networks. After the investigation of network protocols, a new taxonomy is added to it, and protocol classification is carried out by this method. At the same time, the field of swarm intelligence needs more evaluation and analysis in order to have a better future. At present, society is not only concerned about the development of science and technology [9] but also very concerned about sports. As early as 1995, a series of problems existing in minority sports have been solved, and traditional sports and sports health have been integrated. At the same time, scientists have never stopped studying sports [10]. Due to personal subjective and socio-economic objective reasons, physical labor will gradually be occupied by sports behavior in the future. And, sports behavior also has extraordinary medical value in some aspects, and human subjective needs will be met. Sports behavior is influenced by individual personality [11]. As early as last century, some scholars have studied sports behavior and personality. Nowadays, research shows that sports personality is one of the important reasons that affect sports behavior. Subjective and objective factors influence each other [12], thus forming sports superstition behavior. Sports type, level, and role are important factors for the formation of sports superstition behavior. e dominant position of competition reflects that the higher the challenge and the lower the certainty, the more they will be. Social objective environment also affects sports superstition behavior. Different from religious belief, sports superstition is more used by athletes for nonphysical assistance. From the perspective of athletes' personal personality factors, nonelites often have no superstition from elites. Among the predictive indexes of sports superstition behavior, the dominant one is the relationship between task difficulty and skills. To sum up, sports superstition has both advantages and disadvantages, and its advantage lies in that it can bring psychological comfort in an unknown objective environment. For sports, injury cannot be avoided [13]. Athletes were divided into injury group and noninjury group, and the relationship between their TABP tendency and sports injury was studied by questionnaire. According to the research, most of the experimental results are consistent with the predicted results, that is, the noninjury group has a lower TABP tendency than the injury group, and the higher the TABP score, the more injuries athletes suffer. Nixon H. L. in [14] explores the relationship between personal subjective factors and accidental or nonaccidental injuries to others in sports or before injuries in team sports through experimental research. Scientists have meaningful insights into the development of sports behavior. Different from female athletes, sports injury behavior is only related to sports contact itself, while male athletes are also related to personal subjective factors. At the same time, according to the experimental results [15], it is found that the identity and behavior of sports fans are obviously higher among men than among women, but the number of sports fans is equal between them. en, in this situation, compared with women, men rarely call themselves sports fans, but prefer to think of themselves as sports fans. e reason for this is that men prefer to participate in sports and get something from them than watching sports with relatives and friends.

Basic Concepts.
e research of swarm intelligence is originated from the long-lived social insects, which have the characteristics of high efficiency and creativity. erefore, swarm intelligence belongs to decentralized control. Individuals interact with each other and influence each other, so that the whole behavior is changed and a new pattern is formed. After continuous research, swarm intelligence has already set foot in various fields, but at the same time, swarm intelligence needs to strictly follow five basic principles.

Basic Concepts.
e algorithm imitates the process of birds foraging in the ecological circle, and the individuals in the birds always fly in the direction of food. In the model, the population size N and D-dimensional space are initialized. Each individual at position X moves at velocity V like a bird foraging toward a food or target.

PSO Algorithm.
e algorithm flow chart is shown in Figure 1: e basic PSO algorithm formula is as follows: Formulas (1) and (2) are particle iteration update formulas, where v t i represents the velocity of the i-th particle in the t-th iteration, x t i represents the position of the i-th particle in the t-th iteration, and p t i represents the historical optimal position when the i-th particle searches to the t-th generation. p t g indicates the historical optimal position of the whole population when searching to the t generation, that is, the global optimal position. When the superscript is changed to t+1, it indicates that it is the t+1 iteration. c 1 and c 2 denotes the learning factor, and the usual value is 2, r 1 and r 2 denotes the disturbance factor, which is usually randomly selected within [0, 1].
In the PSO algorithm, there is a certain correlation between personality optimization and global optimization. Generally, the global optimum and local optimum are set by setting different inertia factors. Generally, the inertia factor is 0.4 and 0.9 to train the algorithm, which makes it easier to find the individual optimal and global optimal. Generally, individuals are optimized first. When individuals get optimal solutions, and these individuals get optimal solutions, they get a global optimal solution at this time. Repeatedly seeking the individual optimal solution, adjusting the inertia factor and constantly updating the global optimal solution, finally getting a group of individual optimum and getting the global optimal solution. e change of inertia weight ω will cause the change of algorithm performance, which is mainly the global search ability and convergence speed. e increase of ω represents more benefits to the global exploration ability of the algorithm, and at the same time, the population presents more diverse states. On the contrary, the reduction of ω represents more benefits to the local mining ability of the algorithm, and at the same time, the convergence speed is faster. e addition of linear decreasing weight strategy will optimize the whole PSO algorithm. e formula of linear decreasing weight strategy is as follows: In the initial stage of PSO algorithm, enhancing the global search ability can traverse the solution space more likely and avoid falling into the local optimal solution. In the later stage of PSO algorithm, enhancing local search ability can lock the optimal solution more likely and achieve global optimization.
e improved speed update formula is as follows: Among them, t represents the current number of iterations, G max represents the maximum number of iterations, ω max represents the initial inertia weight, ω min indicates the inertia weight at the maximum number of iterations, usually 0.4. Weight is also called inertia factor. When the setting value is large, the global optimization ability is strong, and the local optimization is relatively poor; when the setting value is large, the global ability is poor and the local optimization is easy.
In formula (4), the inertia factor value is set to 0.4, which is based on the GWO algorithm tested in the experimental process, and 0.4 is set to make the GWO algorithm achieve the optimal performance. Generally, it is obtained through a large number of experiments and experiences, showing the best performance in the experiment. It has very important scientific significance and can reflect the rigor of the algorithm.

Basic Concepts.
e gray wolf optimization algorithm has strict regulations, in which the gray wolf in the algorithm is divided into α, β, δ, ω.
is means that they will be assigned different tasks. ese four tasks are in order: α is the command decision, that is, the optimal candidate solution.
e status of β is only lower than α. erefore, β does not obey any other gray wolf except α, which is the second best value; δ is β assistant, helping β to carry out ideological decisions, which is the third best value; ω is the cell of the gray wolf group, that is, the number is large but the status is lowest, which represents that ω is the most basic unit. e algorithm flow chart is shown in Figure 2: 2.3.2. GWO algorithm. In GWO algorithm, the size of gray wolf population X is N. Gray wolves are divided into α, β, δ, ω; among them, the first three are leaders, searching for prey within a certain range. ω gets the prey position according to the leader's guidance, thus updating the personal position. e formula representing the actual distance between the gray wolf and its prey is as follows: e location update formula is as follows: Discrete Dynamics in Nature and Society where t represents the number of iterations, X p (t) represents the position vector of prey, X(t) represents the position vector of each gray wolf individual, D represents the distance vector between gray wolf and prey, a changes from 2 to 0, and its change mode is linear decrease, and r is a random vector value with a range of [0, 1].
After each iteration, the prey movement trend is the leader's position, so while the leader preserves himself as the best solution, ω wolf also needs the leader's command. Only in this way, can the position of ω be updated. e formula for the distance between ω and α, β, and δ is as follows: e update formula of the position of the gray wolf individual is as follows: Formulas (7)- (9) is the method of adjusting the optimal individual position for global optimization. Formula (9) calculates the distance between the position of each wolf and the optimal position formula for Formula (7) to get three different distances, respectively, to get an adjustment of the three wolves after the adjustment of the position. Formula (9) averages the positions of the three wolves after adjustment to obtain the position of the current optimal individual.

Enhanced Gray Wolf Optimization Algorithm Design.
Gray wolf algorithm in the problem solving, although the ability of optimization is relatively strong, but with the increase of iteration times, the similarity between gray wolf individuals exists, and the value is extremely high. With the increasing similarity, the population diversity will decrease, and the final result is the premature convergence phenomenon, which leads to the change of optimization ability.

Immune Cloning Operation.
After calculating the fitness value of preserved gray wolf individuals, m better individuals in gray wolf population are selected to form elite population. e elite population individuals are cloned to form a new elite clone population T, and the population size is N c . e N c formula is as follows: where λ represents a random value with a value range of [0, 1] and b is not less than 1 and is an integer constant.
In order to increase the species diversity of the clonal population, it is necessary to mutate each individual in the elite clonal population to make each individual have a high degree of discrimination. e variation method formula is as follows: Among them, t i represents the gray wolf individual of the elite clone population at the i-th time, t new c represents the elite gray wolf with mutation, r represents random value, and the value range is [0, 1], c max represents the maximum iteration number in mutation, and the value of η tends to 1 at first and approaches 0 with the increase of c.
After the above contents are completed, a better individual is selected from the new population, and the above contents are repeated until the maximum iteration time's stop.

Particle Swarm Position Update Idea.
According to the immune cloning operation, the elite population is the population in the algorithm iteration, so the elite population needs to be arranged in order to find a more accurate Discrete Dynamics in Nature and Society 5 position of prey in the mutation process. e update formula for the location of the gray wolf is as follows: e iterative formula of velocity change is as follows: where w represents a random value with a value range of [0, 1] and r represents an arbitrary value with a value range of [0, 1].

Enhanced Grey Wolf Optimization Algorithm
Flow. e flow of the enhanced gray wolf optimization algorithm is shown in Figure 3:

Test Function and Parameter Settings.
Test functions are used to measure the performance of these three algorithms. e six benchmark function formulas are as follows: x 2 i − 10 cos 2πx i + 10 , −5.12 ≤ x i ≤ 5.12, Among them, the dimensions of six functions are all 30, the iteration times of the algorithm are all 1000 times, and the optimal solution of the function is set to 0. f1-f6 test functions are unimodal functions and multimodal test functions.
ese test functions are commonly used test functions, which are verified by a large number of intelligent algorithms and summarized after comparison. It can guarantee the test effect of the algorithm proposed in this paper and achieve the optimal value is the best effect of the function in the algorithm performance. Other test functions have the same test effect as the test functions in f1-f6.

Experimental Comparison.
For six benchmark functions, after 30 runs of the three algorithms, the average value and standard deviation of the functions are solved, respectively, in which the average value can reflect the convergence speed of the algorithm, while the standard deviation can reflect the stability of the algorithm. e convergence results of functions 1 through 6 are shown in Table 1: e convergence curve of function 1 is shown in e convergence curve of function 3 is shown in Figure 6: e convergence curve of function 4 is shown in Figure 7: e convergence curve of function 5 is shown in Figure 8: e convergence curve of function 6 is shown in Figure 9: 6 Discrete Dynamics in Nature and Society From the above table, it can be seen that the convergence speed, optimization ability, and stability of IPSGWO algorithm are obviously higher than the other two algorithms, whether facing unimodal reference function or multimodal reference function. It can be seen that adding immune cloning method and position adjustment idea to GWO algorithm can obviously optimize the original algorithm.

Begin
Initialize the gray wolf population, population size, elite number, iteration upper limit, moving speed, etc.
Make initial assignment to three wolves in gray wolf population and record their positions Calculate the fitness value of wolves, record the position, find out the best individuals after sorting, and put them into the temporary population Discrete Dynamics in Nature and Society

Establishment of objective function.
Scan the sports behavior of human body. e whole human body will be swept in, and a two-dimensional rectangular coordinate system will be established here. e sports behavior of the swept human body will be put into the coordinate system in a two-dimensional mode, and two kinds of external rectangles of the human body will be quoted for behavior analysis. Rectangle 1 (black) is the rectangle where the position of the human body is initially determined, and the position does not change with the change of the angle of the human body. Rectangle 2 (red) is a variable matrix, which changes with the change of human body angle. e four vertices of the rectangle are defined as A 1 , A 2 , A 3 , A 4 , and they have their own position points in this rectangular coordinate system, so that three characteristics describing regional behavior can be obtained, which can well detect the occurrence and prediction of injuries during sports behavior. e scan result diagram that can be referenced is shown in Figure 10: Centroid difference distribution: where x represents abscissa, y represents ordinate, (x,y)∈rect h(x, y) represents gray values of all pixels in this area, and Y k represents ordinate of centroid of k-th frame.   Discrete Dynamics in Nature and Society When people's movement behavior causes injury, β will obviously become smaller. Width-height ratio of rectangle: When the value of B is much less than 1, it indicates that people's sports behavior is normal, while when the value of B is greater than 1, it indicates that people will fall down.
Tilt angle of rectangular box: When the range of inclination angle is in (0°, 45°) ∪ (145°, 180°), it indicates that people's sports behavior is abnormal and injuries may occur.

Simulation Experiment and Result Analysis.
On the premise of ensuring the same number of people tested during the test, the motion behavior from frame 0 to frame 1000 is tested by objective function, and the actual detection accuracy is calculated with every 100 frames as a calculation  en, IPSGWO, GWO, and PSO algorithms are combined with the objective function to predict the detection accuracy. e formula for calculating the correct rate P is as follows: where W is the total detection time, A is the number of times when the detection behavior is normal, and B is the number of times when the detection behavior is abnormal. Results of the comparative data are shown in Table 2. e actual accuracy of the centroid difference distribution is compared with the predicted values of the three algorithms, such as Figure 11:

12
Discrete Dynamics in Nature and Society e actual accuracy of the rectangular aspect ratio is compared with the predicted values of the three algorithms, such as Figure 12.
e actual correct rate of rectangular frame tilt angle is compared with the predicted values of three algorithms, such as Figure 13: erefore, compared with the other two algorithms, IPSGWO algorithm has higher accuracy and stability and can better predict data. With the help of immune cloning strategy and location updating idea, the performance of GWO algorithm has far exceeded that of GWO algorithm and PSO algorithm. erefore, it can be seen from the experiments that the IPSGWO algorithm proposed in this paper has more advantages, and IPSGWO algorithm is more favorable for sports behavior prediction and injury assessment.

Conclusion
PSO algorithm and GWO algorithm will have problems after many iterations, and it is found that both of them have problems in convergence speed and optimization ability. e optimized and enhanced GWO algorithm, namely, IPSGWO algorithm, has superior stability and optimization ability after choosing appropriate strategies and ideas. erefore, IPSGWO algorithm is more suitable for predicting and evaluating sports behavior.

Data Availability
e experimental data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest
e authors declared that they have no conflicts of interest regarding this work.