Next Article in Journal
Assessing the Sustainability of the Prepandemic Impact on Fuzzy Traveling Sellers Problem with a New Fermatean Fuzzy Scoring Function
Previous Article in Journal
An Investigation on the Effect of Outliers for Flood Frequency Analysis: The Case of the Eastern Mediterranean Basin, Turkey
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Prediction of Pork Supply Based on Improved Mayfly Optimization Algorithm and BP Neural Network

College of Engineering, Northeast Agricultural University, Harbin 150030, China
*
Author to whom correspondence should be addressed.
Sustainability 2022, 14(24), 16559; https://doi.org/10.3390/su142416559
Submission received: 19 October 2022 / Revised: 1 December 2022 / Accepted: 6 December 2022 / Published: 9 December 2022
(This article belongs to the Topic Big Data and Artificial Intelligence)

Abstract

:
Focusing on the issues of slow convergence speed and the ease of falling into a local optimum when optimizing the weights and thresholds of a back-propagation artificial neural network (BPANN) by the gradient method, a prediction method for pork supply based on an improved mayfly optimization algorithm (MOA) and BPANN is proposed. Firstly, in order to improve the performance of MOA, an improved mayfly optimization algorithm with an adaptive visibility coefficient (AVC-IMOA) is introduced. Secondly, AVC-IMOA is used to optimize the weights and thresholds of a BPANN (AVC-IMOA_BP). Thirdly, the trained BPANN and the statistical data are adopted to predict the pork supply in Heilongjiang Province from 2000 to 2020. Finally, to demonstrate the effectiveness of the proposed method for predicting pork supply, the pork supply in Heilongjiang Province was predicted by using AVC-IMOA_BP, a BPANN based on the gradient descent method and a BPANN based on a mixed-strategy whale optimization algorithm (MSWOA_BP), a BPANN based on an artificial bee colony algorithm (ABC_BP) and a BPANN based on a firefly algorithm and sparrow search algorithm (FASSA_BP) in the literature. The results show that the prediction accuracy of the proposed method based on AVC-IMOA and a BPANN is obviously better than those of MSWOA_BP, ABC_BP and FASSA_BP, thus verifying the superior performance of AVC-IMOA_BP.

1. Introduction

China is the most populous country in the world and is not only a big pork producer, but also a big pork consumer. From the perspective of the consumption structure of national meat products, pork accounts for about 63.45% of the overall consumption of national meat products. The No. 1 Central Document 2020 pointed out that the stable production and supply of live pigs is a major topic in the current economic work. It is necessary to strengthen market monitoring and regulation, and do a good job of ensuring pork supply and stabilizing pork prices. Whether it is the No. 1 Central Document of 2022 and the No.1 Document of the Ministry of Agriculture and Rural Affairs, or the just-concluded National Two Sessions, ‘stable pig production’ has become a consensus repeatedly mentioned in the field of animal husbandry. In recent years, domestic pork prices have fluctuated greatly; the main factor causing fluctuations in pork prices is the imbalance between supply and demand. Affected by African swine fever, the supply of pork decreased in 2019–2020, and the demand for pork did not change significantly, resulting in an increase in pork prices and a large fluctuation in pork prices. Pork price fluctuations not only affect the income of pig producers and the economic interests of consumers, but also affect the development of other industries related to the pig industry. Accurately predicting the future trend of the pork supply is not only of great significance for ensuring the pork supply and stabilizing pork prices, but also can promote the healthy development of the national economy. To improve prediction accuracy regarding the pork supply, many prediction methods have been deeply studied and discussed. At present, the prediction methods for the pork supply mainly consist of time series prediction [1], regression prediction, grey prediction, improved VAR model prediction, BPANN prediction and combination prediction [2]. In the case of reasonable structure design of a BPANN, the prediction accuracy and stability of a BPANN are higher than other prediction methods [3,4]. In addition, BPANNs have been broadly used for prediction because of their good linear and nonlinear fitting ability, fault tolerance and high prediction accuracy. For example, the BPANN method has achieved more accurate prediction results in human body shape prediction [5], short-term photovoltaic power generation prediction [6], railway passenger traffic volume prediction [7], centrifugal pump performance prediction [8] and other prediction problems. However, because the error function is a multi-extremum function, if the gradient descent method is used to optimize the weights and thresholds of a BPANN, it is easy to fall into a local optimum, which will cause the fitting accuracy to be low. In recent years, intelligent optimization algorithms have developed rapidly and have been broadly used in the field of dealing with complex optimization problems. In addition, an intelligent optimization algorithm has the characteristics of strong search ability and not easily falling into local optima, which can overcome the shortcomings of the gradient descent method in optimizing the weights and thresholds of a BPANN. Therefore, many scholars began to use intelligent optimization algorithms to optimize the weights and thresholds of BPANNs. The authors of several papers [9,10,11,12] selected an improved genetic algorithm, improved grey wolf optimization algorithm, particle swarm optimization algorithm and whale optimization algorithm, respectively, to optimize the weights and thresholds of BPANNs, which improved the fitting accuracy of the BPANNs. It is worth noting that when the weights and thresholds of a BPANN are optimized by an intelligent optimization algorithm, if the performance of intelligent optimization algorithm is improved, the fitting accuracy of the BPANN will also be improved.
All kinds of biological and natural phenomena in nature always give people profound enlightenment, so people obtain design inspiration and put forward a great deal of intelligent optimization algorithms. In 2020, Konstantinos Zervoudakis [13] proposed a new swarm intelligent optimization algorithm, the mayfly optimization algorithm (MOA), inspired by the flight and reproduction behavior of mayflies. Because MOA has good optimization ability, it has been applied to many practical engineering optimization problems such as performance prediction for a solar photovoltaic thermal collector [14], precise modeling of a PEM fuel cell [15], bearing fault diagnosis [16], COVID-19 diagnosis [17], etc. The existing MOA has the problems of slow optimization speed and easy premature convergence when solving high-dimensional nonlinear complex optimization problems. In recent years, more and more scholars have proposed improved research on MOA. After Konstantinos Zervoudak [13] proposed MOA in 2020, he proposed improvement points such as a gravity coefficient and velocity processing to address the shortcomings of the original algorithm. In 2020, Gao et al. [18] considered that attracted mayflies should move as far as possible to the mayflies that attracted them. Based on this, the velocity update formula was revised. In the same year, Gao et al. [19] introduced opposition-based learning rules into the algorithm to find the optimal solution using the worst individual guidance. In 2020, Zhao et al. [20] introduced the idea of Chebyshev mapping into the algorithm to increase the probability of obtaining a better solution. In the same year, Zhao et al. [21] proposed a negative MOA based on the idea that mayflies move away from the worst global position. In 2022, Zhang et al. [22] proposed a mayfly–sparrow search hybrid algorithm with a circle chaotic map and Lévy flight, and used nonlinear inertial coefficients to balance the relationship between global search and local search. In the same year, Zhou et al. [23] further improved the quality of the algorithm by introducing orthogonal learning and a chaotic exploitation strategy.
Because there are many weights and thresholds to be optimized in a BPANN, the optimization of weights and thresholds in a BPANN is a nonlinear and complex optimization problem with multiple extremums. The existing improved MOA algorithm still has the disadvantages of low precision, ease of falling into a local optimum and slow convergence speed when solving complex optimization problems. In order to improve the global search ability and convergence speed of MOA, an improved mayfly optimization algorithm with an adaptive visibility coefficient is proposed (AVC-IMOA), and the improved MOA is used to optimize the weights and thresholds of the BPANN(AVC-IMOA_BP). On this basis, the BPANN with the best weights and thresholds is used to predict the pork supply in Heilongjiang Province, which improves the prediction accuracy of the BPANN.
Based on the above analysis, the main contributions of this paper can be summarized as follows:
(1)
An improved speed updating formula is proposed to overcome the disadvantage that the speed of a mayfly in the mayfly optimization algorithm cannot be updated due to the large distance between individuals;
(2)
An adaptive visibility coefficient is introduced to balance the global search ability and local search ability of the algorithm;
(3)
An improved mating operator is proposed to increase the probability of producing more potential offspring mayflies;
(4)
AVC-IMOA is used to optimize the initial weights and thresholds of the BPNN, which improves the fitting accuracy of the network;
(5)
AVC-IMOA_BP is used to forecast the pork supply in Heilongjiang Province, China, laying a foundation for studying the fluctuation law of the pork price and the balance of pork supply and demand.

2. Material and Methods

2.1. BPANN

Theoretically, it has been proven that for a three-layer BPANN, as long as there are enough neurons in the hidden layer, it can fit any complex nonlinear function, which shows that the BPANN has a strong fitting ability. The structure of the three-layer BPANN is shown in Figure 1. The formulas and charts related to neural networks involved in this section can be found in the literature [24].
In Figure 1, the input sample is X = (X1, X2, …, Xr, …, XS)T, Xr = (x1, x2, …, xi, …, xn)T. The output of the hidden layer is Y = (Y1, Y2, …, Yr, …, YS), and the output of the hidden layer corresponding to the sample Xr is Yr = (y1, y2, …, yj, …, yp)T. The output of the output layer is O = (O1, O2, …, Or, …, OS). The output of the output layer corresponding to the sample Xr is Or = (o1, o2, …, ok, …, om)T. The expected output is D = (D1, D2, …, Dr, …, DS), and the expected output corresponding to the sample Xr is Dr = (d1, d2, …, dm)T. The weight matrix between the input layer and the hidden layer is V = (V1, V2, …, Vj, …, Vp), and Vj is the weight vector corresponding to the j-th neuron in the hidden layer. The weight matrix between the hidden layer and the output layer is W = (W1, W2, …, Wk, …, Wm), and Wk is the weight vector corresponding to the k-th neuron in the output layer.
For the r-th training sample, Xr, the sum of errors of all neurons in the output layer of the BPANN is recorded as Er. The calculation formula of Er is
E r = 0.5 k = 1 m ( d k o k ) 2
The average value of the sum of errors of all samples is recorded as Eav, and the calculation formula of Eav is
E a v = 1 S r = 1 S E r
where S is the number of samples.
First, it is judged whether Eav meets the given error accuracy requirements. If it does, the training is stopped, and the optimal weight and threshold are output; otherwise, the weights and thresholds are adjusted until the given accuracy requirements are met.
To calculate the value of Er, it is necessary to calculate the output of the output layer. Let the output of the output layer be Or = (o1, o2, …, ok, …, om)T, and the net input of the output layer be netk. For the output layer, there are
o k = f ( n e t k )                                 k = 1 , 2 , , m
n e t k = j = 0 p w j k y j                     k = 1 , 2 , , m
Let the net input of the hidden layer be netj; then, the calculation formulas of the net input netj and output yj of the hidden layer are
y j = f ( n e t j )           j = 1 , 2 , , p
n e t j = i = 0 n v i j x i                     j = 1 , 2 , , p
In Equations (3) and (5), the activation functions are Sigmoid functions. The Sigmoid function is as follows
f ( x ) = 1 e x 1 + e x
The derivative of f(x) is
f ( x ) = 1 2 [ 1 f ( x ) 2 ]
With the expansion of Er in Equation (1) to the hidden layer, the calculation formula of Er is
E r = 0.5 k = 1 m [ d k f ( n e t k ) ] 2 = 0.5 k = 1 m [ d k f ( j = 0 p w j k y j ) ] 2
Er in Equation (9) is expanded to the input layer, and there is
E r = 0.5 k = 1 m { d k f [ j = 0 p w j k f ( n e t j ) ] } 2 = 0.5 k = 1 m { d k f [ j = 0 p w j k f ( i = 0 n v i j x i ) ] } 2
From Equations (2) and (10), there is
E a v = 1 S r = 1 S E r = 1 2 S r = 1 S k = 1 m { d r k f [ j = 0 p w j k f ( i = 0 n v i j x r i ) ] } 2
It can be seen from Equation (11) that the size of Eav can be changed by adjusting the weights. When Eave (e is a sufficiently small positive number) or the preset learning times are reached, the training process is ended. Otherwise, the weights and thresholds of each layer are adjusted to gradually reduce Eav.

2.2. MOA

MOA is a swarm intelligence optimization algorithm based on the flight and reproduction behavior of mayflies. Suppose that an initial population X with size n is randomly generated, X = (X1, X2,…, Xi,…, Xn), Xi = (xi1, xi2,…, xiD), and D is the dimension of the variable. X is divided into two groups: one is male mayflies, and the other is female mayflies. The velocity of each mayfly in the population is V, where V = (V1, V2,, Vi,, Vn),Vi = (vi1, vi2,…, viD). Let pbesti be the historically optimal position of the i-th mayfly in the population, and gbest be the historically optimal position of all mayflies in the population. The formula of each part of the standard mayfly optimization algorithm involved in this section can be found in the literature [13].

2.2.1. Position and Velocity Updates of Male Mayflies

Male mayflies gather in groups a few meters above the water to perform courtship dances. They move according to their own and other individuals’ experiences, but not at a rapid rate. Let x t I be the position of the i-th male mayfly at the t-th iteration, and v i t be the velocity of the i-th male mayfly at the t-th iteration. The position update formula for male mayflies is as follows
x i t + 1 = x i t + v i t + 1
The velocity update formula of male mayflies is
v i t + 1 = v i t + a 1 e β r p 2 ( p b e s t i x i t ) + a 2 e β r g 2 (   g b e s t x i t )
where a1 is the individual cognitive coefficient, and a2 is the social contribution coefficient; usually, a1 = 1, while a2 = 1.5. β is the visibility coefficient controlling the visible range of a mayfly; usually, β = 2. rp is the Euclidean distance between the i-th mayfly and pbest, while rg is the Euclidean distance between the i-th mayfly and gbest.
The velocity update formula of the best male mayfly in the population is
v i t + 1 = v i t + d × r               i = 1 , 2 , , n / 2
where d is the dance coefficient—usually, d = 0.1—and r is a D-dimensional random vector evenly distributed between [−1,1].

2.2.2. Position and Velocity Updates of Female Mayflies

Each female mayfly has its own corresponding mate. Male and female mayflies are paired in order, that is, the best male mayfly mates with the best female mayfly, and the suboptimal male mayfly mates with the suboptimal female mayfly. When its spouse is better than itself, the female mayfly moves toward its spouse; otherwise, the female mayfly will randomly walk.
Let y i t be the position of the i-th female mayfly at the t-th iteration. The position update formula of the female mayflies is
y i t + 1 = y i t + v i t + 1                 i = 0.5 n + 1 , 0.5 n + 2 , , n
The velocity update formula of the female mayflies is
v i t + 1 = { v i t + a 2 e β r m 2 ( x i t y i t )   i f   ( y i ) > f ( x i ) v i t + f l × r   o t h e r w i s e  
where rm is the Euclidean distance between a female mayfly and its spouse, fl is the random walk coefficient—usually, fl = 0.1—and r is a D-dimensional random vector evenly distributed between [−1,1].

2.2.3. Mating of Mayflies

During the mating process, the optimal individual of the male mayflies mates with the optimal individual of the female mayflies, the suboptimal individual of male mayflies mates with the suboptimal individual of female mayflies, and so on. Supposing that the male mayfly involved in mating is xm, and the female mayfly is xf, the two offspring individuals obtained after mating are offspring1 and offspring2. The formulas for mating xf and xm to produce offspring are as follows:
offspring 1 = L * x m + ( 1 L ) * x f
offspring 2 = L * x f + ( 1 L ) * x m
In Equations (17) and (18), L is a random number uniformly distributed between [−1,1].

3. Improved Mayfly Optimization Algorithm with Adaptive Visibility Coefficient

3.1. Improved Velocity Update Formula

Because there is a coefficient e β r 2 in the velocity update formula of MOA in the existing literature, when the distance r between the mayflies is large, the value of e β r 2 approaches 0. If the value range of the variable is large, or the distance between the mayflies is large at the beginning iteration, the velocity update formula with the coefficient e β r 2 is almost ineffective. The trend of e β r 2 with r is shown in Figure 2.
It can be seen from Figure 2 that when the distance between mayflies is r ≥ 2, the value of e β r 2 approaches 0. At this time, except for the random walk mayflies, the velocity update formula of most mayflies in the population almost does not work, resulting in almost no update of the position of these mayflies, so potential mayflies cannot be generated. Therefore, when the distance between mayflies is r ≥ 2, the velocity update formula is not instructive, and MOA has a slow convergence speed and weak global search ability. In addition, when the problem is to be optimized with a large range of variable values, the distance between the mayflies is relatively far at the beginning of iteration, e β r 2 approaches 0, and the attraction term does not work. As the number of iterations increases, the distance between the mayflies gradually decreases. When r ≤ 2, the attraction term begins to work, and the heuristic of the velocity update formula gradually increases. The algorithm has a slow convergence speed in the early stage of iteration and a fast convergence speed in the later stage. To solve the above problems, an improved velocity update formula is proposed.
(a)
Improved velocity update formula of male mayflies:
v i t + 1 = v i t + a 1 β / ( 1 + r p ) ( p b e s t i x i t ) + a 2 β / ( 1 + r g ) (   g b e s t x i t )
where a1 is the individual cognitive coefficient, and a2 is the social contribution coefficient; usually, a1 = 1, while a2 = 1.5. rp is the Euclidean distance between the i-th mayfly and pbest, while rg is the Euclidean distance between the i-th mayfly and gbest. The best male mayfly in the population still updates its velocity according to Equation (14).
(b)
Improved velocity update formula of female mayflies:
v i t + 1 = { v i t + a 2 β / ( 1 + r m ) ( x i t y i t )   i f   ( y i ) > f ( x i ) v i t + f l × r   otherwise  
where rm is the Euclidean distance between female mayflies and their spouses, and fl is the random walk coefficient; usually, fl = 0.1, and r is a D-dimensional random vector evenly distributed between [−1,1].
The improved velocity update formula solves the problem that the disturbance term caused by the distance fluctuation not working, and it avoids the situation of the algorithm stagnating and easily falling into a local optimum because the velocity and position of some mayflies are not updated in the search process. The heuristic and search ability of the improved algorithm are enhanced.

3.2. Adaptive Visibility Coefficient

In the existing MOA, the value of β is a constant. If the value of β is large, the exploration ability of the algorithm is strong. If the value of β is small, the algorithm’s development ability is strong. Therefore, when β is a constant, MOA cannot better balance the exploration and exploitation capabilities of the algorithm. Aiming at this problem, a calculation formula of adaptive change for β is given as follows
β = ( 1.8 - r u n t i m e M a x t i m e ) ( 0.8 + 0.1 * r a n d )
where Maxtime is the maximum running time of the algorithm set in advance, runtime is the time the algorithm has run so far, and rand is a random number between [0,1].
Because a1 and a2 are constants, the effect of the attraction term on velocity in Equations (19) and (20) depends on the values of β/(1 + rp), β/(1 + rg) and β/(1 + rm). β/(1 + rg) can be taken as an example to analyze the change trend of β/(1 + rg) with the number of iterations. The C01 test function in CEC 2017 is selected, and the maximum running time of the algorithm is set to 20 s. Taking β/(1 + rg) in the male mayflies update formula as an example, the value of β/(1 + rg) of the 10th male mayfly in the population is recorded every 100 iterations. The trend of β/(1 + rg) with the increase of the number of iterations is shown in Figure 3.
It can be noticed from Figure 3 that as the number of iterations increases, the overall trend of β/(1 + rg) increases first and then decreases. The value of β/(1 + rg) increases gradually at the beginning of iteration and decreases with oscillations later in iteration. Therefore, the exploration ability of a male mayfly is strong in the early stage of iteration, and the exploitation ability of male mayfly is strong in the later stage of iteration. In the whole iteration process, β/(1 + rg) does not approach 0. In summary, the improved velocity update formula can better balance the exploration and exploitation capabilities of the algorithm and help to improve the performance of the algorithm.

3.3. Improved Mayflies Mating Operator

The mating operator L in the existing MOA literature is a random number in a given range, and the two offspring mayflies produced by mating are located on the connection between the two parent mayflies. To illustrate the spatial position of the offspring mayflies produced by mating according to Equations (17) and (18), a two-dimensional space is taken as an example. It is assumed that the male mayfly involved in mating is Xm, the female mayfly is Xf, and L is a random number between [−1,1]. The spatial position of the offspring mayflies produced by mating is shown in Figure 4 and Figure 5.
In Figure 4, the spatial position of the mayflies produced by mating according to Equation (17) is on the line segment XfA. Also, the spatial position of the offspring mayflies produced by mating according to Equation (18) is on the line segment AXm. As the saying goes, ‘One who nears vermilion becomes red, and one who nears ink becomes black’, so the male mayflies among the two parental mayflies have a greater probability of being near the optimal solution. Because Xm is superior to Xf, the offspring of mating mayflies should be located near the male mayflies in the parent generation, which is more likely to produce potential offspring mayflies. However, the offspring mayflies produced by mating according to Equations (17) and (18) have only a small probability of being located near Xm, can only be located on the line XfA or AXm connecting Xf and Xm and cannot be located in other areas near Xm.
In order to overcome the problems of the mating operators in Equations (17) and (18), an improved mating operator is proposed, which causes the offspring mayflies produced by mating to be located near the male mayflies. The specific mating operators are as follows
offspring1 = L1Xm + (1−L1)⊙Xf
offspring2 = L2Xf + (1−L2)⊙Xm
where ⊙ denotes the multiplication of two vectors or the multiplication of elements at the same position in the matrix, L1 is a D-dimensional random vector that is uniformly distributed between [0,0.5], and L2 is a D-dimensional random vector that is uniformly distributed between [0.5,1].
The spatial positions of the offspring mayflies produced by mating according to Equations (22) and (23) are shown in Figure 6 and Figure 7.
The spatial positions of the offspring mayflies produced by mating according to Equations (22) and (23) are the shadowed parts in the figures. It can be seen from Figure 6 and Figure 7 that the probability that the offspring mayflies produced by mating according to Equations (22) and (23) are located near Xm is much higher than that produced by mating according to Equations (17) and (18). Therefore, compared with Equations (17) and (18), mating according to Equations (22) and (23) is more likely to produce more potential offspring individuals.

3.4. Time Complexity Analysis

The time complexity of the algorithm is an important indicator reflecting the advantages and disadvantages of the algorithm, so this section analyzes the time complexity of the proposed AVC-IMOA. The following components are primarily responsible for increasing the time complexity of AVC-IMOA: the generation of the initial population, the speed and position updating of male mayflies, the speed and position updating of female mayflies and the mating operation of male and female mayflies. These four operations are represented by ①, ②, ③ and ④, respectively. Suppose the population size is n, the number of male mayflies is n/2, the number of female mayflies is n/2, and the dimension of the variable is D. The time complexity analysis is summarized in Table 1.

3.5. Flow Chart of AVC-IMOA

Taking the objective function minimization as an example, the flow chart of AVC-IMOA is shown in Figure 8.

3.6. Pseudocode of AVC-IMOA

A maximum running time for the algorithm, denoted as Maxtime, is set. When the algorithm runs to a set maximum, it then stops running and outputs the final result. The pseudocode of the improved mayfly optimization algorithm with an adaptive visibility coefficient is shown in Algorithm 1.
Algorithm 1: Improved mayfly optimization algorithm with adaptive visibility coefficient (AVC-IMOA)
Begin
Randomly generate an initial population with size n and calculate the fitness values of all individuals.
The global optimal position gbest of all mayflies and the optimal position pbest of male mayflies were recorded.
Runtime = 0
 Whileruntime ≤ Maxtime do
    Update the position and velocity of male mayflies according to Equations (12), (14), (19) and (21).
    Update the position and velocity of female mayflies according to Equations (15), (20) and (21).
    Male and female mayflies mate according to Equations (22) and (23) to produce offspring.
    Process the individuals beyond the search scope.
    Recalculate the fitness values of all mayflies and retain n better individuals.
    Update gbest and pbest.
 End while
 Output the optimal solution and the optimal value.
End

4. Numerical Experiments and Analysis

The CEC 2017 test function set is currently the internationally used test function set to measure algorithm performance. All constrained optimization problems in the test function set are minimization problems. To test the performance of the proposed AVC-IMOA, the CEC 2017 test function set [25] is selected as a source of test functions.

4.1. Algorithm Performance Evaluation Indicator

In order to compare the performance of AVC-IMOA and various comparison algorithms, the mean value (Mean), standard deviation (Std) and Friedman rank ranking of algorithms are used as performance evaluation indicators [26].
  • Mean
The mean value is defined as the average of the optimal value of the test function obtained by the algorithm in R independent runs, and is recorded as Mean. The calculation formula of Mean is
M e a n = i = 1 R f i R
where R is the total number of independent runs of the algorithm, and fi is the optimal value of the test function obtained when the algorithm runs independently for the i-th time.
2.
Std
The standard deviation can reflect the dispersion degree between the optimal value obtained by R operations of an algorithm and the average value of R optimal values. The standard deviation is recorded as Std. A large Std represents a large difference between most of the optimal values and their averages; a smaller Std means that the optimal value is closer to the average. Therefore, the smaller the Std, the better the robustness of the algorithm. The calculation formula for Std is
S t d = i = 1 R ( f i M e a n ) 2 R
3.
w/t/l
To better compare the performance of AVC-IMOA with the various algorithms involved in the comparison, the comparison result of the Mean of AVC-IMOA with another algorithm (denoted as, Alg1) involved in the comparison is denoted as w/t/l. For a test function, if the performance of the AVC-IMOA algorithm is better than Alg1, the value of w is denoted as 1. If the performance of the AVC-IMOA algorithm is the same as that of Alg1, the value of t is denoted as 1. If Alg1 performs better than AVC-IMOA, the value of l is recorded as 1. For all test functions, adding the value of w = 1 in Alg1 and AVC-IMOA yields the value of w. Similarly, the values of t and l can be calculated.
4.
Friedman rank ranking
Friedman rank ranking is a nonparametric statistical method which can rank the performance of algorithms involved in comparison [26]. When the number of algorithms participating in the comparison is m and the number of selected test functions is k, the Friedman ranking of the algorithm can be calculated according to the following steps.
(1)
Each algorithm runs R times independently on each test function and retains the optimal value for each run.
(2)
According to Equation (24), the average value of the optimal value obtained from R runs is calculated.
M e a n i j = l = 1 R f i j ( l ) R , i = 1 , 2 , m ;     j = 1 , 2 , k
where m is the number of algorithms involved in the comparison, k is the number of test functions, R is the number of independent runs, and meanfij is the average value of the optimal value obtained by the i-th algorithm independently running R times on the j-th test function.
(3)
For each test function, m algorithms are sorted in accordance with the meanfij from small to large and given the rankij(i = 1, 2,…, m; j = 1, 2,…, k) of each algorithm. Sometimes there will be cases where the algorithms involved in the comparison obtain the same meanfij; in this case, the average value of the ranking position is taken as the rank ranking.
(4)
According to Equation (27), the Averanki of each algorithm is calculated.
A v e r a n k i = 1 m j = 1 k r a n k i j         ,           i = 1 , 2 , m
(5)
After sorting by the Averanki of each algorithm from small to large, the sorting result is the final ranking of the various algorithms.

4.2. Parameter Setting

To verify the performance of AVC-IMOA, four MOA algorithms and two meta-heuristic algorithms are selected for comparison. These are the algorithms involved in the comparison: standard MOA (MOA) [13], MOA with velocity processing and gravity coefficient (VGMOA) [13], MOA with improved velocity update formula (IMOA) [18], MOA with opposition-based learning rules (OBL_MO) [19], sparrow search algorithm (SSA) and opposition-based learning particle swarm optimization by group decision-making (OBLPSOGD) [27]. The parameters of the algorithms involved in the comparison are all the values found in the original literature, and the specific parameter values are shown in Table 2.

4.3. Test Results and Analysis

4.3.1. Test Results

To ensure that the experimental results are fair and reasonable, all test experiments are completed on the same computer. All experiments in this paper are carried out in the same operating environment, that is, under the Windows 10 system, using an AMD Ryzen 9 3900 12-core Processor CPU @ 3.09 GHz desktop computer. The software and version used are: MATLAB R2019b. Let the population size of the seven algorithms be n = 30, the dimension of the variable be D = 30 and the maximum running time be Maxtime = 20 s. When the algorithm reaches the maximum running time, stop the iteration and output the optimal solution and optimal value. Each test function runs 25 times independently, and the Mean and Std of the optimal values of each test function obtained by each algorithm are recorded. The results of each algorithm on the CEC 2017 test function set are shown in Table 3, and the best results for each test function have been bolded. The Friedman mean rank and final rank ranking results of each algorithm are shown in Figure 9.

4.3.2. Result Analysis

(1)
Result analysis of test function
It can be seen from Table 3 that the quality of VGMOA is the best when using the above seven algorithms to solve the C17 and C25 test functions. When solving the C26 test function, the solution quality of IMOA is the best. When solving the seven test functions C03, C04, C13, C15, C22, C24 and C28, the solution quality of OBLPSOGD is the best. When solving the other 19 test functions, AVC-IMOA has the best solution quality. According to the value of w/t/l in Table 3, the performance of AVC-IMOA is better than the other six algorithms.
As can be observed from Figure 9, AVC-IMOA ranks first among all algorithms when the dimension of the variable is D = 30, which indicates that the performance of AVC-IMOA is better than the other six algorithms involved in the comparison.
In addition, in order to verify whether there are significant differences in the performance of the above seven algorithms, the Friedman test method is selected. The Friedman test was first proposed by Friedman in 1945 as a nonparametric test method to determine whether there are significant differences between algorithms [28]. The Friedman test results of the seven algorithms are shown in Table 4.
Table 4 shows that when the significance level is α = 0.05, the critical value is χ2 α[k−1] = 12.50, while the test value is χ2 = 91.62. Therefore, χ2 > χ α [ k 1 ] 2 , which shows that there are significant differences in the performances of the above seven algorithms.
To sum up, from the running results of each algorithm on the CEC 2017 test function set, the performance of AVC-IMOA is better than the other six algorithms, and the performance of each algorithm is significantly different, thus verifying the effectiveness of AVC-IMOA.
(2)
Convergence curve analysis
To verify the convergence of AVC-IMOA, two unimodal test functions, C01 and C02, and two multimodal test functions, C10 and C18, are selected to draw the convergence curves of AVC-IMOA and the other algorithms. The convergence curves are shown in Figure 10, where the x-axis represents the running time of the algorithms and the y-axis represents the fitness function value.
It can be seen from Figure 10 that when calculating the 30-dimensional test function, for the test function C01, AVC-IMOA and SSA have a fast convergence speed early in iteration, which indicates that AVC-IMOA and SSA have strong global search ability. In addition, the solution accuracy of AVC-IMOA is higher than those of the six comparison algorithms, which indicates that AVC-IMOA can not only jump out of a local optimum, but also has strong local search ability. For the test function C02, AVC-IMOA has a faster convergence speed and higher solution accuracy than the other six comparison algorithms, which shows that AVC-IMOA has global search ability and local search ability. For the C10 test function, the convergence speed of AVC-IMOA is faster in the early stage of iteration. In the middle stage of iteration, AVC-IMOA has the same effect as MOA, VGMOA and OBL_MO, but AVC-IMOA has higher accuracy in the later stage of iteration. Other algorithms fall into a local optimum. It can be seen that the global search ability of AVC-IMOA is better those that of the six comparison algorithms. For the test function C18, AVC-IMOA converges faster than the other six comparison algorithms throughout the iteration process, indicating that AVC-IMOA has strong global search ability.

4.4. AVC-IMOA to Optimize BPANN

Because the error function of a BPANN is a nonlinear multi-extremum optimization problem, it is easy to fall into a local optimum when the weights and thresholds of the BPANN are adjusted by the gradient method. When the number of neurons in each layer of a BPANN is large, the number of weights and thresholds is large, that is, there are many variables to be optimized, and it is difficult for the gradient method to obtain satisfactory results in a short time. In recent years, intelligent optimization algorithms have been used to optimize the weights and thresholds of BPANNs, and good results have been achieved. However, when there are many weights and thresholds to be optimized, there are problems such as low optimization accuracy and a poor solution effect. Therefore, an improved algorithm with an adaptive visibility coefficient is proposed to optimize the weights and thresholds of the BPANN.
Because the error function of a BPANN is a function with weights and thresholds as variables, the error function Eav in Equation (11) can be used as the objective function, and the weights and thresholds in Equation (11) can be used as variables. AVC-IMOA is used to optimize the objective function, and the optimal weights and thresholds are given when the iteration termination conditions are satisfied.

5. Prediction of Pork Supply

5.1. Sample Data

The data for pork supply in Heilongjiang Province can be obtained from the China Animal Husbandry and Veterinary Yearbook. The data for pork supply in Heilongjiang Province are shown in Table 5.
When using a BPANN to predict pork supply, sample data need to be normalized. The normalization processing formula is
X new = a + ( b a ) ( X X min X max X min )
where X is the sample data, Xnew is the normalized sample data, Xmax and Xmin are the maximum and minimum values in the sample data, respectively, and a and b are the lower and upper limits of the data processing interval, respectively; usually, a = −0.8, b = 0.8.
The structure of the BPANN is 5-8-1, that is, the numbers of neurons in the input layer, hidden layer and output layer are 5, 8 and 1, respectively. The first training sample takes the data from 2000 to 2004 as input data, and the data from 2005 as the expected output; the second sample takes the data from 2001 to 2005 as input data and the data from 2006 as the expected output. By analogy, a total of 16 groups of sample data were obtained.

5.2. Prediction of Pork Supply

We take a sigmoid function as the activation function of the BPANN. Firstly, the weights and thresholds of the BPANN are initialized, that is, the initial weights and thresholds are randomly generated in the range of [−1,1], and the initial weights and thresholds are used as the initial population of AVC-IMOA. Secondly, taking the error function Eav as the objective function and the weights and thresholds as the variables to be optimized, the objective function is optimized by AVC-IMOA, and the optimal weights and thresholds of the BPANN are given. Finally, the trained BPANN is used to predict the pork supply in Heilongjiang Province from 2005 to 2022. The optimal weights and thresholds of the BPANN are shown in Table 6.
In Table 6, V is the weight matrix from the input layer to the hidden layer, W is the weight matrix from the hidden layer to the output layer, T0 is the threshold of the hidden layer, and T1 is the threshold of the output layer.
To verify the superiority of AVC-IMOA for optimizing the weights and thresholds of the BPANN, a BPANN based on the gradient descent method, a BPANN based on a mixed-strategy whale optimization algorithm (MSWOA_BP) [29], a BPANN based on the standard artificial bee colony algorithm (ABC_BP) [30] and a BPANN based on an improved sparrow search algorithm (FASSA_BP) [31] are selected as comparison algorithms. In addition, in order to fairly compare the performance and the accuracy of prediction of the different models, the structure of the BPANN is 5-8-1, the population size of the four intelligent optimization algorithms is 40, the sigmoid function is used as the transfer function, and the maximum running time of the five algorithms is 60 s. The prediction results and prediction accuracy are shown in Table 7. The fitting accuracy of the five models and the predicted value of pork supply are shown in Figure 11.
According to the data in Table 7, the average relative error of the BPANN is 1.68000%, while the average relative error of MSWOA_BP is 3.08207%; for ABC_BP, it is 0.94325%; for FASSA_BP, it is 2.62584%; and for AVC-IMOA_BP, it is 0.000001%. Therefore, the prediction accuracy of AVC-IMOA_BP is significantly higher than those of the BPANN, MSWOA_BP, ABC_BP and FASSA_BP.
As can be seen from Table 7 and Figure 11, the supply of pork in Heilongjiang Province of China was as high as 1.593 million tons in 2018, and the supply of pork decreased continuously in the following two years, reaching only 1.352 million tons in 2020. This is because the first outbreak of African swine fever in China occurred in August 2018. Since then, there have been sudden outbreaks of African swine fever throughout the country. A total of 800,000 live pigs were culled in 2018, and 390,000 live pigs were culled in 2019, resulting in a decrease in pork supply, higher pork prices, increased enthusiasm of farmers to raise pigs and an increase in the number of new, small sows and breeding sows. In addition, the African swine fever epidemic in China will be effectively controlled in 2020, and the pork supply in Heilongjiang Province will show a steady upward trend in 2021 and 2022. The pork supply numbers in Heilongjiang Province in 2021 and 2022 will be 1.5992 million tons and 1.6126 million tons, respectively.

6. Conclusions

When using the gradient method and existing intelligent optimization algorithms to optimize a BPANN, there are some shortcomings such as slow optimization speed and low precision. An improved MOA is proposed to optimize the weights and thresholds of a BPANN, and then the trained BPANN is used to predict the pork supply in Heilongjiang Province.
To improve the global optimization ability and solution accuracy of MOA, an improved mayfly optimization algorithm with an adaptive visibility coefficient was proposed. Firstly, focusing on the problem of the velocity update formula of some mayflies in the population not working when the distance between mayflies is large in the existing algorithm, an improved velocity update formula is proposed. The improved velocity update formula does not have the limitation that the velocity and position of an individual cannot be updated due to the large distance between individuals in the iterative process. Secondly, a method of adaptively adjusting the visibility coefficient is given, which makes the update method of the position and velocity of the algorithm have strong global search ability in the early stage of iteration and strong local search ability in the later stage of iteration; thus, the global search ability and local search ability of the algorithm are better balanced. Finally, in order to improve the probability of generating better potential solutions in the mating process of mayflies, an improved mating operator is given. The improved mating operator improves the solution quality and convergence speed of the algorithm.
AVC-IMOA is used to optimize the weights and thresholds of the BPANN with a network structure of 5-8-1. The BPANN determined by the obtained optimal weights and thresholds was adopted to predict the pork supply in Heilongjiang Province. In order to verify the performance of AVC-IMOA, AVC-IMOA_BP, a BPANN based on the gradient descent method, MSWOA_BP, ABC_BP and FASSA_BP were used to predict the pork supply in Heilongjiang Province. The prediction results show that the prediction accuracy of AVC-IMOA_BP is obviously better than those of other prediction models, which verifies the effectiveness of the proposed prediction method. In addition, it can be seen from the results that the pork supply in Heilongjiang Province will show a steady growth trend in 2021 and 2022, which can provide a reference for pig producers and governments at all levels to make decisions. Accurately predicting the pork supply lays the foundation for further study of pork price fluctuation and pork supply and demand balance.
In the future, there will be many fields worthy of our research and exploration. In addition to the speed update formula proposed in this paper, the performance of the algorithm will be further improved by starting with the position update formula, mutation method and hybrid algorithm. In addition, AVC-IMOA_BP can also be used to solve similar forecasting problems in production and life, not only for forecasting the supply of agricultural products.

Author Contributions

Conceptualization, J.-Q.W.; Methodology, J.-Q.W. and H.-Y.Z.; Software, H.-Y.Z. and H.-H.S.; Validation, J.-L.B.; Formal analysis, H.-Y.Z.; Investigation, P.-L.Z.; Data curation, H.-Y.Z. and H.-H.S.; Writing—original draft, H.-Y.Z.; Visualization, H.-Y.Z., H.-H.S., P.-L.Z. and J.-L.B.; Supervision, J.-Q.W.; Project administration, J.-Q.W. All authors have read and agreed to the published version of the manuscript.

Funding

This work was supported by Natural Science Foundation of Heilongjiang Province (Grant No. LH2020C004).

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

This paper does not contain any studies with human participants performed by any of the authors.

Data Availability Statement

The statistical data are from the China Animal Husbandry and Veterinary Yearbook.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Shen, Z.; Zhang, Y.; Lu, J.; Xu, J.; Xiao, G. A novel time series forecasting model with deep learning. Neurocomputing 2019, 396, 302–313. [Google Scholar] [CrossRef]
  2. Kadiyala, A.; Kumar, A. Vector-time-series-based back propagation neural network modeling of air quality inside a public transportation bus using available software. Environ. Prog. Sustain. Energy 2015, 35, 7–13. [Google Scholar] [CrossRef]
  3. Che, Z.-G.; Chiang, T.-A.; Che, Z. Feed-forward neural networks training: A comparison between genetic algorithm and back-propagation learning algorithm. Int. J. Innov. Comput. Inf. Control 2011, 7, 5839–5850. [Google Scholar]
  4. Jie, Z.; Qiurui, M. Establishing a Genetic Algorithm-Back Propagation model to predict the pressure of girdles and to determine the model function. Text. Res. J. 2020, 90, 2564–2578. [Google Scholar] [CrossRef]
  5. Cheng, P.; Chen, D.; Wang, J. Clustering of the body shape of the adult male by using principal component analysis and genetic algorithm–BP neural network. Soft Comput. 2020, 24, 13219–13237. [Google Scholar] [CrossRef]
  6. Guo, K.; Cheng, X.; Shi, J. Accuracy Improvement of Short-Term Photovoltaic Power Forecasting Based on PCA and PSO-BP. In Proceedings of the 2021 3rd Asia Energy and Electrical Engineering Symposium (AEEES), Chendu, China, 26–29 March 2021; pp. 893–897. [Google Scholar]
  7. Zhuo, W.; Jia, L.-M.; Yong, Q.; Wang, Y.-H. Railway passenger traffic volume prediction based on neural network. Appl. Artif. Intell. 2007, 21, 1–10. [Google Scholar] [CrossRef]
  8. Han, W.; Nan, L.; Su, M.; Chen, Y.; Li, R.; Zhang, X. Research on the Prediction Method of Centrifugal Pump Performance Based on a Double Hidden Layer BP Neural Network. Energies 2019, 12, 2709. [Google Scholar] [CrossRef] [Green Version]
  9. Cheng, P.; Chen, D.; Wang, J. Research on underwear pressure prediction based on improved GA-BP algorithm. Int. J. Cloth. Sci. Technol. 2021, 33, 619–642. [Google Scholar] [CrossRef]
  10. Meng, C.; Wu, D.; Lei, Y. Neural Network Satellite Clock Bias Prediction Based on the Whale Optimization Algorithm. In Advances in Natural Computation, Fuzzy Systems and Knowledge Discovery. Proceedings of the 2021 17th International Conference on Natural Computation, Fuzzy Systems and Knowledge Discovery (ICNC-FSKD 2021), Guiyang, China, 24–26 July 2021; Xie, Q., Zhao, L., Li, K., Yadav, A., Wang, L., Eds.; Springer International Publishing: Cham, Switzerland, 2022; Volume 89, pp. 1152–1160. [Google Scholar]
  11. Song, L.; Liu, W.; Bo, L. Prediction of Short-Term Traffic Flow Based on PSO-Optimized Chaotic BP Neural Network. In Proceedings of the 2013 International Conference on Computer Sciences and Applications, Wuhan, China, 14–15 December 2013; pp. 292–295. [Google Scholar]
  12. Zhao, G.; Liu, D.; Wang, J.J. Cloud security situation prediction method based on grey wolf optimization and BP neural network. J. China Univ. Posts Telecommun. 2020, 27, 30–41. [Google Scholar]
  13. Zervoudakis, K.; Tsafarakis, S. A mayfly optimization algorithm. Comput. Ind. Eng. 2020, 145, 106559. [Google Scholar] [CrossRef]
  14. Elaziz, M.A.; Senthilraja, S.; Zayed, M.E.; Elsheikh, A.H.; Mostafa, R.R.; Lu, S. A new random vector functional link integrated with mayfly optimization algorithm for performance prediction of solar photovoltaic thermal collector combined with electrolytic hydrogen production system. Appl. Therm. Eng. 2021, 193, 117055. [Google Scholar] [CrossRef]
  15. Shaheen, M.A.M.; Hasanien, H.M.; El Moursi, M.S.; El-Fergany, A.A. Precise modeling of PEM fuel cell using improved chaotic MayFly optimization algorithm. Int. J. Energy Res. 2021, 45, 18754–18769. [Google Scholar] [CrossRef]
  16. Liu, Y.; Chai, Y.; Liu, B.; Wang, Y. Bearing Fault Diagnosis Based on Energy Spectrum Statistics and Modified Mayfly Optimization Algorithm. Sensors 2021, 21, 2245. [Google Scholar] [CrossRef] [PubMed]
  17. Farki, A.; Salekshahrezaee, Z.; Tofigh, A.M.; Ghanavati, R.; Arandian, B.; Chapnevis, A.J. COVID-19 Diagnosis Using Capsule Network and Fuzzy C-Means and Mayfly Optimization Algorithm. BioMed Res. Int. 2021, 2021, 2295920. [Google Scholar] [CrossRef]
  18. Gao, Z.-M.; Zhao, J.; Li, S.-R.; Hu, Y.-R. The improved mayfly optimization algorithm. J. Phys. Conf. Ser. 2020, 1684, 012077. [Google Scholar] [CrossRef]
  19. Gao, Z.-M.; Zhao, J.; Li, S.-R.; Hu, Y.-R. The improved mayfly optimization algorithm with opposition based learning rules. J. Phys. Conf. Ser. 2020, 1693, 012117. [Google Scholar] [CrossRef]
  20. Zhao, J.; Gao, Z.-M. The improved mayfly optimization algorithm with Chebyshev map. J. Phys. Conf. Ser. 2020, 1684, 012075. [Google Scholar] [CrossRef]
  21. Zhao, J.; Gao, Z.-M. The negative mayfly optimization algorithm. J. Phys. Conf. Ser. 2020, 1693, 012098. [Google Scholar] [CrossRef]
  22. Zhang, J.; Zheng, J.; Xie, X.; Lin, Z.; Li, H. Mayfly sparrow search hybrid algorithm for RFID Network Planning. IEEE Sens. J. 2022, 22, 16673–16686. [Google Scholar] [CrossRef]
  23. Zhou, D.; Kang, Z.; Su, X.; Yang, C. An enhanced Mayfly optimization algorithm based on orthogonal learning and chaotic exploitation strategy. Int. J. Mach. Learn. Cybern. 2022, 13, 3625–3643. [Google Scholar] [CrossRef]
  24. Zhang, L.; Wang, F.; Sun, T.; Xu, B. A constrained optimization method based on BP neural network. Neural Comput. Appl. 2016, 29, 413–421. [Google Scholar] [CrossRef]
  25. Wu, G.; Mallipeddi, R.; Suganthan, P.N. Problem Definitions and Evaluation Criteria for the CEC 2017 Competition and Special Session on Constrained Single Objective Real-Parameter Optimization; Technical Report for National University of Defense Technology: Changsha, China; Kyungpook National University: Daegu, Republic of Korea; Nanyang Technological University: Singapore, 2017. [Google Scholar]
  26. Cheng, Z.; Song, H.; Wang, J.; Zhang, H.; Chang, T.; Zhang, M. Hybrid firefly algorithm with grouping attraction for constrained optimization problem. Knowledge-Based Syst. 2021, 220, 106937. [Google Scholar] [CrossRef]
  27. Zhou, M.; Zhao, Z.; Xiong, C.; Kang, Q. An opposition-based particle swarm optimization algorithm for noisy environments. In Proceedings of the 2018 IEEE 15th International Conference on Networking, Sensing and Control (ICNSC), Zhuhai, China, 27–29 March 2018; pp. 1–6. [Google Scholar]
  28. Song, H.; Wang, J.; Song, L.; Zhang, H.; Bei, J.; Ni, J.; Ye, B. Improvement and application of hybrid real-coded genetic algorithm. Appl. Intell. 2022, 52, 17410–17448. [Google Scholar] [CrossRef]
  29. Wang, C.; Li, M.; Wang, R.; Yu, H.; Wang, S. An image denoising method based on BP neural network optimized by improved whale optimization algorithm. EURASIP J. Wirel. Commun. Netw. 2021, 2021, 141. [Google Scholar] [CrossRef]
  30. Karaboga, D.; Akay, B. A comparative study of Artificial Bee Colony algorithm. Appl. Math. Comput. 2009, 214, 108–132. [Google Scholar] [CrossRef]
  31. Shi, L.; Ding, X.; Li, M.; Liu, Y. Research on the Capability Maturity Evaluation of Intelligent Manufacturing Based on Firefly Algorithm, Sparrow Search Algorithm, and BP Neural Network. Complexity 2021, 2021, 5554215. [Google Scholar] [CrossRef]
Figure 1. Three-layer BPANN.
Figure 1. Three-layer BPANN.
Sustainability 14 16559 g001
Figure 2. Change trend of e β r 2 with r.
Figure 2. Change trend of e β r 2 with r.
Sustainability 14 16559 g002
Figure 3. The change trend of β/(1 + rg) with the number of iterations.
Figure 3. The change trend of β/(1 + rg) with the number of iterations.
Sustainability 14 16559 g003
Figure 4. The spatial position of the mayflies produced according to Equation (17).
Figure 4. The spatial position of the mayflies produced according to Equation (17).
Sustainability 14 16559 g004
Figure 5. The spatial position of the mayflies produced according to Equation (18).
Figure 5. The spatial position of the mayflies produced according to Equation (18).
Sustainability 14 16559 g005
Figure 6. The spatial position of the mayflies produced according to Equation (22).
Figure 6. The spatial position of the mayflies produced according to Equation (22).
Sustainability 14 16559 g006
Figure 7. The spatial position of the mayflies produced according to Equation (23).
Figure 7. The spatial position of the mayflies produced according to Equation (23).
Sustainability 14 16559 g007
Figure 8. The flow chart of AVC-IMOA.
Figure 8. The flow chart of AVC-IMOA.
Sustainability 14 16559 g008
Figure 9. Friedman ranking results of various algorithms. (a) Mean rank, (b) Final rank ranking.
Figure 9. Friedman ranking results of various algorithms. (a) Mean rank, (b) Final rank ranking.
Sustainability 14 16559 g009
Figure 10. Convergence curves for partial test functions.
Figure 10. Convergence curves for partial test functions.
Sustainability 14 16559 g010
Figure 11. Trend chart of pork supply in Heilongjiang Province (Unit/10,000 tons).
Figure 11. Trend chart of pork supply in Heilongjiang Province (Unit/10,000 tons).
Sustainability 14 16559 g011
Table 1. The time complexity of AVC-IMOA.
Table 1. The time complexity of AVC-IMOA.
Names of Various OperatorsAVC-IMOA
Time complexityO(n)O(n/2)O(n/2)O(n/2)O(n) + O(n/2) + O(n/2) + O(n/2) = O(n)
Table 2. Algorithms and parameter settings involved in the comparison.
Table 2. Algorithms and parameter settings involved in the comparison.
AlgorithmYearParameters
MOA2020α1 = 1, α2 = 1.5, β = 2, d = 0.1, fl = 0.1
VGMOA2020α1 = 1, α2 = 1.5, β = 2, d = 0.1, fl = 0.1, gmax = 0.9, gmin = 0.5
IMOA2020α1 = 1, α2 = 1.5, β = 2, d = 0.1, fl = 0.1
OBL_MO2020α1 = 1, α2 = 1.5, β = 2, d = 0.1, fl = 0.1
OBLPSOGD2018wmin = 0.4, wmax = 0.9, P0 = 0.3, α = 3.2, k = 15, σ =0.3
SSA2020PD = 0.2NP, SD = 0.1NP, ST = 0.8
AVC-IMOA2022α1 = 1, α2 = 1.5, d = 0.1. fl = 0.1
Table 3. Calculation results of each algorithm.
Table 3. Calculation results of each algorithm.
ProblemStatistical IndicatorsAlgorithm
MOAVGMOAIMOAOBL_MOSSAOBLPSOGDAVC-IMOA
C01Mean1.36 × 10-28.05 × 10-31.69 × 10-12.89 × 10-21.44 × 1057.88 × 1022.22 × 10-13
Std5.09 × 10-33.21 × 10-34.16 × 10-21.55 × 10-24.01 × 1043.37 × 1027.81 × 10-13
C02Mean2.53 × 10-21.16 × 10-22.12 × 10-12.80 × 10-25.32 × 1041.61 × 1033.99 × 10-10
Std8.39 × 10-34.15 × 10-33.28 × 10-21.18 × 10-21.51 × 1047.26 × 1021.54 × 10-9
C03Mean2.94 × 1051.02 × 1063.81 × 1061.80 × 1069.21 × 1076.45 × 1046.53 × 105
Std6.49 × 1051.48 × 1063.20 × 1063.13 × 1063.32 × 1072.94 × 1041.07 × 106
C04Mean8.79 × 1029.16 × 1029.01 × 1028.81 × 1026.17 × 1025.67 × 1026.57 × 102
Std6.95 × 1014.15 × 1015.67 × 1016.55 × 1012.71 × 1016.27 × 1011.92 × 101
C05Mean3.75 × 1014.18 × 1015.75 × 1013.87 × 1016.74 × 1054.98 × 1021.97 × 101
Std2.68 × 1012.75 × 1016.17 × 1012.67 × 1016.76 × 1043.43 × 1026.43 × 100
C06Mean1.00 × 1085.30 × 1076.32 × 1086.70 × 1071.19 × 10101.25 × 1092.98 × 107
Std1.43 × 1081.07 × 1081.51 × 1081.44 × 1084.76 × 1094.43 × 1091.03 × 108
C07Mean8.46 × 1021.25 × 1041.09 × 10123.74 × 1027.67 × 1013−7.28 × 101−3.06 × 102
Std5.25 × 1036.33 × 1041.70 × 10112.20 × 1031.64 × 10131.41 × 1021.47 × 102
C08Mean1.61 × 1031.86 × 1031.04 × 1069.89 × 1031.63 × 10171.17 × 10137.19 × 10-4
Std9.05 × 1021.41 × 1034.62 × 1056.80 × 1035.98 × 10168.10 × 10123.31 × 104
C09Mean7.25 × 1006.22 × 1004.02 × 1066.79 × 1008.31 × 10138.91 × 10112.18 × 100
Std2.40 × 1001.88 × 1001.24 × 1072.31 × 1004.30 × 10132.2 × 10122.97 × 100
C10Mean3.71 × 1013.16 × 1011.19 × 1062.18 × 1023.12 × 10182.23 × 10132.76 × 10-4
Std5.08 × 1012.97 × 1015.67 × 1052.48 × 1029.28 × 10172.07 × 10138.29 × 105
C11Mean2.65 × 10124.61 × 10114.86 × 10133.93 × 10122.14 × 10178.92 × 10165.87 × 1010
Std4.40 × 10127.24 × 10116.45 × 10135.20 × 10128.61 × 10169.96 × 10161.01 × 1011
C12Mean9.68 × 1018.05 × 1011.29 × 1021.09 × 1022.59 × 10171.40 × 10121.31 × 101
Std3.36 × 1012.83 × 1012.85 × 1013.88 × 1014.99 × 10161.80 × 10129.76 × 100
C13Mean6.90 × 10141.78 × 10157.53 × 10151.80 × 10152.86 × 10171.57 × 10135.91 × 1014
Std3.77 × 10148.85 × 10142.66 × 10157.15 × 10143.93 × 10161.22 × 10132.45 × 1014
C14Mean1.94 × 1001.97 × 1002.06 × 1001.97 × 1005.25 × 10172.77 × 10121.41 × 100
Std7.63 × 10-27.50 × 10-28.48 × 10-29.82 × 10-25.42 × 10165.22 × 10122.02 × 102
C15Mean2.31 × 1012.45 × 1012.37 × 1012.27 × 1012.32 × 10171.49 × 1012.57 × 101
Std2.57 × 1003.07 × 1003.76 × 1003.86 × 1003.75 × 10161.60 × 1005.37 × 100
C16Mean2.41 × 1022.39 × 1022.42 × 1022.37 × 1022.42 × 10171.34 × 1021.32 × 102
Std1.01 × 1019.88 × 1001.27 × 1011.15 × 1013.50 × 10167.55 × 1001.46 × 1016
C17Mean9.61 × 10109.61 × 10109.61 × 10109.61 × 10102.86 × 10171.44 × 10129.61 × 1010
Std7.62 × 10-33.93 × 10-39.95 × 10-35.34 × 10-33.44 × 10162.82 × 10124.44 × 102
C18Mean9.95 × 10144.78 × 10141.38 × 10156.52 × 10142.13 × 10283.80 × 10195.97 × 1010
Std1.65 × 10158.14 × 10142.57 × 10159.78 × 10144.43 × 10274.38 × 10191.68 × 1011
C19Mean1.85 × 10171.85 × 10171.85 × 10171.85 × 10171.85 × 10171.84 × 10171.83 × 1017
Std9.16 × 10137.14 × 10138.55 × 10137.91 × 10134.15 × 10131.84 × 10144.87 × 105
C20Mean2.89 × 1003.10 × 1007.61 × 1002.76 × 1008.27 × 1008.26 × 1002.50 × 100
Std5.11 × 10-16.82 × 10-12.79 × 10-14.44 × 10-13.51 × 10-14.10 × 10-14.49 × 10-1
C21Mean1.21 × 1028.53 × 1011.39 × 1021.05 × 1021.10 × 10176.58 × 10121.10 × 101
Std4.03 × 1013.55 × 1012.05 × 1013.26 × 1012.11 × 10166.22 × 10121.03 × 101
C22Mean7.30 × 10141.77 × 10155.77 × 10151.89 × 10151.17 × 10174.64 × 10138.46 × 1014
Std4.40 × 10149.42 × 10142.04 × 10159.23 × 10141.72 × 10163.74 × 10135.17 × 1014
C23Mean1.97 × 1001.99 × 1002.04 × 1001.97 × 1002.00 × 10171.92 × 10131.43 × 100
Std6.09 × 10-28.28 × 10-29.63 × 10-27.98 × 10-23.46 × 10162.80 × 10133.23 × 10-2
C24Mean2.32 × 1012.17 × 1012.37 × 1012.36 × 1019.18 × 10161.59 × 1012.35 × 101
Std4.43 × 1002.51 × 1002.99 × 1004.08 × 1001.17 × 10161.45 × 1003.80 × 100
C25Mean2.42 × 1022.38 × 1022.43 × 1022.40 × 1028.46 × 10161.39 × 1022.42 × 102
Std1.09 × 1019.58 × 1009.05 × 1001.14 × 1011.72 × 10161.01 × 1011.30 × 101
C26Mean9.61 × 10109.61 × 10109.61 × 10109.61 × 10101.17 × 10175.00 × 10129.61 × 1010
Std3.42 × 10-33.14 × 10-33.05 × 10-36.69 × 10-31.71 × 10167.47 × 10124.74 × 10-2
C27Mean2.01 × 10137.94 × 10136.84 × 10142.35 × 10145.86 × 10273.99 × 10198.14 × 1012
Std2.33 × 10132.74 × 10141.05 × 10157.13 × 10141.07 × 10275.09 × 10191.77 × 1013
C28Mean1.85 × 10171.85 × 10171.85 × 10171.85 × 10171.85 × 10171.84 × 10171.85 × 1017
Std1.10 × 10141.12 × 10149.35 × 10138.29 × 10137.60 × 10132.42 × 10141.42 × 1014
Mean: w/t/l26/2/025/2/126/2/026/2/028/0/021/0/7-
Table 4. Friedman test results for each algorithm.
Table 4. Friedman test results for each algorithm.
DimensionSignificance
Level
Number of Algorithmsχ2χ2 α[k−1]p-ValueNull
Hypothesis
Alternative
Hypothesis
D = 30α = 0.05791.6212.501.39345×10−17RejectAccept
Table 5. Pork supply in Heilongjiang province from 2000 to 2020 (unit: 10,000 tons).
Table 5. Pork supply in Heilongjiang province from 2000 to 2020 (unit: 10,000 tons).
YearSupplyYearSupplyYearSupply
200089.03652007101.682014133.4
200187.1200892.112015142.6
200273.1200996.62016138.4
200382.42010108.22017138.2
200485.572011114.482018159.3
200593.872012116.92019149.9
2006100.442013128.42020135.2
Table 6. Optimal weights and thresholds of BPANN.
Table 6. Optimal weights and thresholds of BPANN.
Vi,jV1,1 = 2.1204V2,1 = 0.2963V3,1 = −2.1252V4,1 = −1.8276V5,1 = −1.6392
V1,2 = −3.4353V2,2 = −1.4154V3,2 = −3.8704V4,2 = −2.5717V5,2 = 2.9983
V1,3 = −2.8525V2,3 = −0.5859V3,3 = −0.8830V4,3 = −2.2500V5,3 = 2.5122
V1,4 = 2.0599V2,4 = −1.8145V3,4 = −2.4980V4,4 = 2.2324V5,4 = −11.4764
V1,5 = 0.7585V2,5 = 2.8209V3,5 = −9.8287V4,5 = 3.2329V5,5 = −3.2925
V1,6 = −0.5469V2,6 = 0.5614V3,6 = −0.8615V4,6 = 0.8089V5,6 = 0.3829
V1,7 = 1.4614V2,7 = −0.3741V3,7 = −3.5242V4,7 = 2.1073V5,7 = −0.8814
V1,8 = −1.6766V2,8 = 1.1384V3,8 = −1.0364V4,8 = −2.4203V5,8 = 4.0111
T0T0,1 = −1.7852T0,2 = 5.8729T0,3 = 0.2750T0,4 = 2.4645T0,5 = 1.7107T0,6 = 0.1905T0,7 = 0.6535T0,8 = 0.4202
Wi,jW1,1 = 3.3681W2,1 = 1.7397W3,1=−2.2738W4,1 = −1.9837W5,1 = 0.5642W6,1=−3.6471W7,1=−1.8537W8,1 = 0.4153
T1T1 = 1.6062
Table 7. Prediction accuracy and prediction results.
Table 7. Prediction accuracy and prediction results.
YearPork
Supply Volume
BP
(Gradient Descent)
MSWOA_BPABC_BPFASSA_BPAVC-IMOA_BP
Predicted ValueRelative ErrorAverage Relative ErrorPredicted ValueRelative ErrorAverage Relative ErrorPredicted ValueRelative ErrorAverage Relative ErrorPredicted ValueRelative ErrorAverage Relative ErrorPredicted ValueRelative ErrorAverage Relative Error
200593.8794.4940.66470%1.68000%95.5631.80358%3.08207%95.1391.35233%0.94325%93.4430.45456%2.62584%93.87000 0.000001%0.000001%
2006100.4498.7441.68853%96.9103.51436%99.5530.88350%97.6472.78110%100.44000 0.000000%
2007101.6899.6152.03126%99.7071.94045%98.6982.93291%94.6766.88786%101.68000 0.000000%
200892.11100.3428.93669%100.6839.30729%96.2934.54162%98.1926.60249%92.11000 0.000001%
200996.695.3951.24786%100.2113.73802%95.5921.04387%95.6550.97802%96.60000 0.000002%
2010108.2108.4510.23230%107.8490.32455%107.7700.39724%109.9221.59178%108.20000 0.000001%
2011114.48113.8700.53328%114.4900.00870%115.3340.74561%114.7050.19661%114.48000 0.000000%
2012116.9117.8220.78886%118.3661.25445%116.6820.18688%118.9361.74168%116.90000 0.000000%
2013128.4122.3454.71590%124.8282.78191%128.4780.06087%124.8562.76015%128.40000 0.000002%
2014133.4134.8441.08244%140.3655.22096%133.9210.39041%139.3254.44143%133.40000 0.000000%
2015142.6140.9351.16729%138.7482.70093%141.6790.64612%135.8374.74294%142.60000 0.000001%
2016138.4141.1391.97878%142.5983.03344%138.8410.31868%142.4262.90931%138.40000 0.000000%
2017138.2138.5640.26325%142.9113.40883%138.9660.55450%139.7171.09803%138.20000 0.000001%
2018159.3159.5620.16418%147.8367.19677%158.1370.73001%154.3423.11262%159.30000 0.000002%
2019149.9149.3170.38882%148.7340.77765%149.8900.00634%149.1820.47915%149.90000 0.000000%
2020135.2134.8400.26604%138.3112.30117%134.7930.30111%136.8711.23579%135.20000 0.000000%
2021 175.821 141.856 159.113 150.274 159.92
2022 153.896 148.885 153.209 154.735 161.26
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Wang, J.-Q.; Zhang, H.-Y.; Song, H.-H.; Zhang, P.-L.; Bei, J.-L. Prediction of Pork Supply Based on Improved Mayfly Optimization Algorithm and BP Neural Network. Sustainability 2022, 14, 16559. https://doi.org/10.3390/su142416559

AMA Style

Wang J-Q, Zhang H-Y, Song H-H, Zhang P-L, Bei J-L. Prediction of Pork Supply Based on Improved Mayfly Optimization Algorithm and BP Neural Network. Sustainability. 2022; 14(24):16559. https://doi.org/10.3390/su142416559

Chicago/Turabian Style

Wang, Ji-Quan, Hong-Yu Zhang, Hao-Hao Song, Pan-Li Zhang, and Jin-Ling Bei. 2022. "Prediction of Pork Supply Based on Improved Mayfly Optimization Algorithm and BP Neural Network" Sustainability 14, no. 24: 16559. https://doi.org/10.3390/su142416559

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop