CN107169565B - Spinning quality prediction method for improving BP neural network based on firework algorithm - Google Patents

Spinning quality prediction method for improving BP neural network based on firework algorithm Download PDF

Info

Publication number
CN107169565B
CN107169565B CN201710288559.2A CN201710288559A CN107169565B CN 107169565 B CN107169565 B CN 107169565B CN 201710288559 A CN201710288559 A CN 201710288559A CN 107169565 B CN107169565 B CN 107169565B
Authority
CN
China
Prior art keywords
firework
network
neural network
fireworks
spinning
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN201710288559.2A
Other languages
Chinese (zh)
Other versions
CN107169565A (en
Inventor
邵景峰
马创涛
马晓红
杨小渝
王蕊超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xian Polytechnic University
Original Assignee
Xian Polytechnic University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xian Polytechnic University filed Critical Xian Polytechnic University
Priority to CN201710288559.2A priority Critical patent/CN107169565B/en
Publication of CN107169565A publication Critical patent/CN107169565A/en
Application granted granted Critical
Publication of CN107169565B publication Critical patent/CN107169565B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Molecular Biology (AREA)
  • Artificial Intelligence (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Feedback Control In General (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a spinning quality prediction method for improving a BP (back propagation) neural network based on a firework algorithm, which is characterized in that the firework algorithm is introduced into the BP neural network, the network weight and the threshold of the BP neural network model are optimized by utilizing the optimization mechanism of the firework algorithm, input and output indexes are selected, a spinning quality prediction model based on FWA-BP is constructed, the spinning quality prediction model based on FWA-BP established in the step 2 is learned and trained by utilizing a data set subjected to standardized processing, and finally the prediction of spinning quality is completed. The method solves the problem that the spinning quality is difficult to accurately predict due to numerous factors influencing the yarn quality in a spinning system and mutual coupling, can effectively establish the function mapping relation between the fiber index and the yarn quality, realizes the prediction of the yarn quality in spinning production, and is beneficial to improving the quality management level of a spinning workshop.

Description

基于烟花算法改进BP神经网络的纺纱质量预测方法Improved BP Neural Network Based on Fireworks Algorithm for Spinning Quality Prediction Method

技术领域technical field

本发明属于纺纱质量预测与控制技术领域,涉及一种基于烟花算法改进BP神经网络的纺纱质量预测方法。The invention belongs to the technical field of spinning quality prediction and control, and relates to a spinning quality prediction method based on a firework algorithm improved BP neural network.

背景技术Background technique

纺纱系统处在高温、高湿以及高电磁等多种因素相互交错的复杂环境中,各因素之间存在相互影响的耦合作用关系,加之纺纱生产加工工艺流程复杂且原材料频繁经历物理化学的改性过程,使得纺织生产过程中的质量预测与传统的纯机械加工的质量预测相比更加具有挑战性。特别地,纤维属性指标呈几何状增长,目前已达到300多个,而且纺纱系统中影响因素纱线质量因素众多且相互之间存在耦合关系,加之纤维属性与纱线质量特征值之间成非线性相关关系,使得在小样本数据训练下利用神经网络建立纺纱质量预测模型的预测结果,难以满足纺纱车间生产管理的实际要求。The spinning system is in a complex environment where various factors such as high temperature, high humidity and high electromagnetics are intertwined, and there is a coupling relationship between each factor. The modification process makes quality prediction during textile production more challenging compared to traditional purely mechanical quality prediction. In particular, the fiber attribute index has increased geometrically, and has reached more than 300 at present, and there are many factors affecting yarn quality in the spinning system and there is a coupling relationship between them. In addition, there is a relationship between fiber attributes and yarn quality characteristics. The nonlinear correlation makes it difficult to use the neural network to establish the prediction results of the spinning quality prediction model under the training of small sample data, and it is difficult to meet the actual requirements of the production management of the spinning workshop.

随着纺纱生产信息化程度的提高,纺织生产过程中积累了大量的原料、工艺、设备等纱线质量数据,这使得大样本数据环境下建立基于神经网络的纺纱质量预测模型成为可能。但是,在大量训练样本数据环境下,随着神经网络预测模型中输入神经元个数和训练样本数据量大幅度增加,神经网络模型收敛速度慢且易陷入局部最优的问题进一步凸显,在很大程度上制约着纺纱质量预测的精度。With the improvement of the informatization of spinning production, a large amount of yarn quality data such as raw materials, processes, and equipment has been accumulated in the textile production process, which makes it possible to establish a neural network-based spinning quality prediction model in the environment of large sample data. However, in the environment of a large number of training sample data, with the large increase in the number of input neurons and the amount of training sample data in the neural network prediction model, the problem of slow convergence of the neural network model and easy to fall into local optimum is further highlighted. To a large extent, it restricts the accuracy of spinning quality prediction.

发明内容SUMMARY OF THE INVENTION

本发明的目的是提供一种基于烟花算法改进BP神经网络的纺纱质量预测方法,解决了现有神经网络模型存在的在训练过程中预测精度低且迭代次数高的的问题。The purpose of the present invention is to provide a spinning quality prediction method based on the fireworks algorithm improved BP neural network, which solves the problems of low prediction accuracy and high iteration times in the training process of the existing neural network model.

本发明基于烟花算法改进BP神经网络的纺纱质量预测方法,具体按照以下步骤实施:The present invention improves the spinning quality prediction method of BP neural network based on fireworks algorithm, and is specifically implemented according to the following steps:

步骤1,利用烟花算法的寻优机理对BP神经网络模型的网络权重和阈值进行优化,建立一种基于烟花算法优化的FWA-BP神经网络模型;Step 1, using the optimization mechanism of the fireworks algorithm to optimize the network weight and threshold of the BP neural network model, and establish a FWA-BP neural network model optimized based on the fireworks algorithm;

步骤2,在步骤1的FWA-BP神经网络模型的基础之上,选取输入输出指标,构建基于FWA-BP的纺纱质量预测模型;Step 2, on the basis of the FWA-BP neural network model in step 1, select input and output indicators to construct a spinning quality prediction model based on FWA-BP;

步骤3,利用经过标准化处理的数据集对步骤2中建立的基于FWA-BP的纺纱质量预测模型进行学习和训练,最终完成对纺纱质量的预测;Step 3, use the standardized data set to learn and train the spinning quality prediction model based on FWA-BP established in step 2, and finally complete the prediction of spinning quality;

步骤2中构建基于FWA-BP的纺纱质量预测模型的具体步骤为:The specific steps of constructing the spinning quality prediction model based on FWA-BP in step 2 are as follows:

步骤2.1,输入输出指标的选择:选取纺纱生产加工过程中与纱线质量相关的原料、工艺数据作为输入变量,选取纱线的CV值为输出指标,则整个基于FWA-BP的纱线质量预测模型的输入输出为:Step 2.1, the selection of input and output indicators: select the raw materials and process data related to the yarn quality in the spinning production and processing process as input variables, and select the CV value of the yarn as the output indicator, then the whole yarn quality based on FWA-BP The input and output of the prediction model are:

输入量为:x1=棉条含杂率,x2=粗纱捻系数,x3=回潮率,x4=纤维直径,x5=纤维长度,x6=直径离散系数,x7=纤维质量不匀率,x8=纤维牵伸倍数,x9=细纱钢丝圈号,x10=罗拉转速;输出量为:Y=纱线CV值;The input quantities are: x1 = sliver trash content, x2 = roving twist coefficient, x3 = moisture regain, x4 = fiber diameter, x5 = fiber length, x6 = diameter dispersion coefficient, x7 = fiber quality unevenness, x8 = fiber Drafting ratio, x9=spinning traveler number, x10=roller rotation speed; output: Y=yarn CV value;

步骤2.2,根据步骤2.1得到的输入输出数据建立模型的数据集,并使用Min-Max方法对数据集中的数据进行标准化处理;Step 2.2, establish a data set of the model according to the input and output data obtained in step 2.1, and use the Min-Max method to standardize the data in the data set;

步骤2.3,确定网络结构的策略,根据步骤2.1中选取的输入、输出指标,确定输入、输出及隐含层的层数,FWA-BP纺纱质量预测模型的输入层的节点数m=10,输出层节点数n=1,其中隐层神经元的个数通过下式确定Step 2.3, determine the strategy of the network structure, according to the input and output indicators selected in step 2.1, determine the number of layers of the input, output and hidden layers, the number of nodes in the input layer of the FWA-BP spinning quality prediction model m=10, The number of output layer nodes is n=1, and the number of hidden layer neurons is determined by the following formula

Figure GDA0002427824850000031
Figure GDA0002427824850000031

计算得到s=6;Calculated to get s=6;

步骤2.4,激活函数的选取,输入层采用tansig激活函数,输出层采用purelin激活函数,选取trainlm函数作为网络模型的训练函数。Step 2.4, the selection of the activation function, the input layer adopts the tansig activation function, the output layer adopts the purelin activation function, and the trainlm function is selected as the training function of the network model.

本发明的特点还在于,The present invention is also characterized in that,

步骤1中烟花算法的寻优机理对BP神经网络模型的网络权重和阈值进行优化的具体步骤为:The specific steps for optimizing the network weights and thresholds of the BP neural network model by the optimization mechanism of the fireworks algorithm in step 1 are:

步骤1.1,关键参数编码,选取实数向量的编码策略对模型中的关键参数进行编码,记向量X=[x1,x2,Λ,xD]表示一组待优化的参数,其每一维向量由网络权重和阈值组成,烟花种群的维数为:D=nIW(1,1)+nb(1,1)+nIW(2,1)+nb(2,1),其中,记nIW(1,1)为隐含层与输出层间的权值的个数,nb(1,1)为隐含层神经元阈值的个数,nIW(2,1)为隐含层与输出层间的权值的个数,nb(2,1)输出层神经元阈值的个数;Step 1.1, key parameter coding, select the coding strategy of the real number vector to encode the key parameters in the model, and note that the vector X=[x 1 , x 2 , Λ, x D ] represents a set of parameters to be optimized, each dimension of which is The vector consists of network weights and thresholds, and the dimension of the firework population is: D=n IW(1,1) +n b(1,1) +n IW(2,1) +n b(2,1) , where , denoted n IW(1,1) as the number of weights between the hidden layer and the output layer, n b(1,1) as the number of hidden layer neuron thresholds, n IW(2,1) as The number of weights between the hidden layer and the output layer, the number of n b(2,1) output layer neuron thresholds;

步骤1.2,权重系数及阈值初始化,在步骤1.1的基础之上,利用烟花算法中烟花个体xik的位置表示神经网络中的神经元,将神经网络中第k次迭代过程网络l层中第i个神经元与第j个神经元间的权重系数

Figure GDA0002427824850000032
和阈值θi初始化编码成向量X=[x1,x2,Λ,xD],并利用随机初始化的策略把向量X初始在区间[-1,1]内,则有权重系数wij~U[-1,1],Step 1.2: Initialize the weight coefficient and threshold. On the basis of step 1.1, the position of the firework individual x ik in the firework algorithm is used to represent the neuron in the neural network, and the k-th iteration process in the neural network is used. The weight coefficient between the neuron and the jth neuron
Figure GDA0002427824850000032
and the threshold θ i are initialized and encoded into a vector X=[x 1 ,x 2 ,Λ,x D ], and the random initialization strategy is used to initialize the vector X in the interval [-1,1], then there are weight coefficients w ij ~ U[-1,1],

其中,i指的是网络中第i个神经元节点的权重,j指的是第j个神经元节点的权重,l表示的是这个当前权重所处的网络层数,k表示的是当前的迭代次数;Among them, i refers to the weight of the ith neuron node in the network, j refers to the weight of the jth neuron node, l represents the number of network layers where the current weight is located, and k represents the current the number of iterations;

步骤1.3,计算烟花个体的误差,引入适应度函数并利用公式(1)和公式(2)计算平方误差SSE,公式(1)和公式(2)如下所示:Step 1.3, calculate the error of the individual fireworks, introduce the fitness function and use the formula (1) and formula (2) to calculate the square error SSE, formula (1) and formula (2) are as follows:

Figure GDA0002427824850000041
Figure GDA0002427824850000041

其中,t为网络的期望输出,p为网络的层数,s为网络输出单元的个数,y为网络输出值,其具体如下式:Among them, t is the expected output of the network, p is the number of layers of the network, s is the number of output units of the network, and y is the output value of the network, which is as follows:

Figure GDA0002427824850000042
Figure GDA0002427824850000042

其中,xj为网络的输入,wij为网络节点的权重,θi为网络中第i个神经元的阈值且θi=-wi(n+1);Among them, x j is the input of the network, w ij is the weight of the network node, θ i is the threshold of the ith neuron in the network and θ i = -wi (n+1);

步骤1.4,在步骤1.3计算得到的每个烟花个体xi误差的基础上,引入fi(x)函数作为适应度函数,通过适应度函数计算步骤1.2中向量X每一个烟花个体xi的适应度值,适应度函数如公式(3)如下所示,Step 1.4, based on the error of each firework individual xi calculated in step 1.3, introduce the f i (x) function as the fitness function, and calculate the fitness of each firework individual xi in the vector X in step 1.2 through the fitness function. value, the fitness function is shown in formula (3) as follows,

Figure GDA0002427824850000043
Figure GDA0002427824850000043

步骤1.5,烟花种群寻优,在步骤1.4的基础之上,对于每一个烟花个体xi进行爆炸、位移和变异操作,其中爆炸变异操作以及高斯变异映射规则为公式(4)~公式(6),Step 1.5, firework population optimization, on the basis of step 1.4, perform explosion, displacement and mutation operations for each firework individual xi , wherein the explosion mutation operation and the Gaussian mutation mapping rule are formula (4) ~ formula (6) ,

h=Ai×rand(1,-1) (4)h=A i ×rand(1,-1) (4)

exik=xik+h (5)ex ik = x ik +h (5)

mxik=xik×e (6)mx ik = x ik ×e (6)

其中,Ai为第i个烟花的爆炸半径,h为位置偏移量,xik表示种群中第i个烟花的第k维,exik为第i个烟花经过爆炸后的火花,mxik为xik经过高斯变异后的高斯变异火花,e~N(1,1)的高斯分布;Among them, A i is the explosion radius of the i-th firework, h is the position offset, x ik is the k-th dimension of the i-th firework in the population, ex ik is the spark of the i-th firework after the explosion, and mx ik is the The Gaussian mutation spark of x ik after Gaussian mutation, the Gaussian distribution of e~N(1,1);

步骤1.6,选择下一代烟花种群,对于步骤1.5中经过爆炸、位移和变异操作后的烟花个体xi,利用步骤1.4中的公式计算每个烟花个体xi的适应度值,并使用公式(7)和公式(8)的选择策略,选择最优的烟花个体组成下一代烟花种群,具体的选择策略为:Step 1.6, select the next generation firework population, for the firework individual xi after the explosion, displacement and mutation operations in step 1.5, use the formula in step 1.4 to calculate the fitness value of each firework individual xi , and use formula (7 ) and the selection strategy of formula (8), select the optimal firework individual to form the next generation of fireworks population, and the specific selection strategy is:

选择适应度值最小的min(f(xi))个体xk直接为一下烟花种群个体,其余的N-1个烟花个体采取轮盘赌方式,对于候选个体xi其被选择的概率如下式:Select the min(f( xi )) individual x k with the smallest fitness value as the following firework population, and the remaining N-1 firework individuals adopt the roulette method. For the candidate individual x i , the probability of being selected is as follows: :

Figure GDA0002427824850000051
Figure GDA0002427824850000051

其中,R(xi)表示烟花个体xi与其他个体的距离之和,具体如下式;Among them, R( xi ) represents the sum of the distances between the firework individual xi and other individuals, and the specific formula is as follows;

Figure GDA0002427824850000052
Figure GDA0002427824850000052

步骤1.7,判断终止条件,根据公式(3)和公式(8)计算烟花种群中烟花个体的适应度值f(xi)和烟花个体间的欧式距离R(xi),并判断是否终止条件中达到的最大迭代次数,若满足则计算得到当前烟花种群中的烟花个体的最小适应度值min(f(xi))以及烟花种群中烟花个体间的最大的距离max(R(xi)),并取当前的烟花种群为最优的烟花种群Xbest,否则继续执行步骤1.3;Step 1.7, determine the termination condition, calculate the fitness value f(x i ) of the individual fireworks in the firework population and the Euclidean distance R(x i ) between the individual fireworks according to formula (3) and formula (8), and determine whether the termination condition is The maximum number of iterations reached in the firework population, if it is satisfied, the minimum fitness value min(f(x i )) of the firework individuals in the current firework population and the maximum distance between the firework individuals in the firework population max(R(x i ) ), and take the current fireworks population as the optimal fireworks population X best , otherwise continue to step 1.3;

步骤1.8,优化网络权重和阈值,利用步骤1.7中得到最优烟花种群Xbest对步骤1.2中的向量X中对应的神经网络中的权重和阈值进行初始化。Step 1.8, optimize the network weights and thresholds, and use the optimal firework population X best obtained in step 1.7 to initialize the weights and thresholds in the neural network corresponding to the vector X in step 1.2.

步骤3中利用经过标准化处理的数据集对步骤2中建立的基于FWA-BP的纺纱质量预测模型进行学习和预测的具体步骤为:In step 3, the specific steps for learning and predicting the spinning quality prediction model based on FWA-BP established in step 2 using the standardized data set are as follows:

步骤3.1,训练数据集的选择策略,利用步骤2.2中经过标准化处理的数据集,从中选择80%的数据集作为训练数据集,剩余20%的数据集作为测试数据集;Step 3.1, the selection strategy of the training data set, using the standardized data set in step 2.2, select 80% of the data set as the training data set, and the remaining 20% of the data set as the test data set;

步骤3.2,烟花算法中关键参数的设置,烟花种群的大小N=70,烟花爆炸半径调节常数d=5,烟花爆炸火花数调节常数m=40,烟花爆炸火花个数上界值lm=0.8,烟花爆炸火花个数下界值bm=0.04,高斯变异火花数g=5,最大迭代次数T=100,其中变量的维数D=85,是在步骤1.1的基础之上取网络模型中神经元权重和阈值的总数,具体是在步骤2.3的基础之上通过如下公式计算Step 3.2, the setting of key parameters in the fireworks algorithm, the size of the fireworks population N=70, the adjustment constant of the fireworks explosion radius d=5, the adjustment constant of the number of fireworks explosion sparks m=40, the upper bound value of the number of fireworks explosion sparks lm=0.8, The lower bound value of the number of fireworks explosion sparks bm=0.04, the number of Gaussian variation sparks g=5, the maximum number of iterations T=100, and the dimension of the variable D=85, which is based on step 1.1. The weight of neurons in the network model is obtained and the total number of thresholds, which are calculated by the following formula on the basis of step 2.3

D=m×s+s×n+s+n=10×7+7×1+7+1=85D=m×s+s×n+s+n=10×7+7×1+7+1=85

其中,m,s,n分别为网络的输入层神经元、隐含层神经元以及输出层神经元的个数;Among them, m, s, n are the number of input layer neurons, hidden layer neurons and output layer neurons of the network respectively;

步骤3.3,在步骤3.2中烟花算法参数设置的基础之上,使用步骤3.1中选择的训练数据集对基于FWA-BP的纺纱质量预测模型进行训练,在网络训练过程中相关的参数设置为,学习速率为0.01,动量因子为0.9,最大迭代次数为20000,训练最小误差为0.05;Step 3.3, on the basis of the fireworks algorithm parameter setting in step 3.2, use the training data set selected in step 3.1 to train the spinning quality prediction model based on FWA-BP, and the relevant parameters in the network training process are set as, The learning rate is 0.01, the momentum factor is 0.9, the maximum number of iterations is 20000, and the minimum training error is 0.05;

步骤3.4,通过步骤3.1~3.3训练得到了基于FWA-BP的纺纱质量预测模型,使用步骤3.1中选择的测试数据集,对模型的预测效果进行测试统计分析和实验仿真。In step 3.4, the spinning quality prediction model based on FWA-BP is obtained through the training in steps 3.1 to 3.3, and the test data set selected in step 3.1 is used to perform test statistical analysis and experimental simulation on the prediction effect of the model.

本发明与现有技术对比具有以下效果:本发明提高了纺纱质量预测的精度,降低了网络的迭代次数。本发明主要将烟花算法引入到神经网络模型中,利用烟花爆炸过程中多点同时扩散的机制,对神经网络模型的权重和阈值进行了优化,从而可以减少预测模型的迭代次数,提高模型预测的准确率。Compared with the prior art, the present invention has the following effects: the present invention improves the accuracy of spinning quality prediction and reduces the number of iterations of the network. The invention mainly introduces the firework algorithm into the neural network model, and optimizes the weight and threshold of the neural network model by using the mechanism of simultaneous diffusion of multiple points in the firework explosion process, thereby reducing the number of iterations of the prediction model and improving the prediction accuracy of the model. Accuracy.

附图说明Description of drawings

图1是本发明基于烟花算法改进BP神经网络的纺纱质量预测方法的流程图;Fig. 1 is the flow chart of the spinning quality prediction method that the present invention improves BP neural network based on fireworks algorithm;

图2是本发明基于烟花算法改进BP神经网络的纺纱质量预测方法中实施例的纺纱质量预测值与实际值的仿真结果图;Fig. 2 is the simulation result diagram of the spinning quality prediction value and the actual value of the embodiment in the spinning quality prediction method based on the firework algorithm improvement BP neural network of the present invention;

图3是本发明基于烟花算法改进BP神经网络的纺纱质量预测方法中实施例与其他BP神经网络、GA-BP神经网络以及PSO-BP神经网络的纺纱质量预测结果对比仿真结果图;Fig. 3 is based on the firework algorithm improvement BP neural network in the spinning quality prediction method of the present invention and other BP neural network, GA-BP neural network and PSO-BP neural network spinning quality prediction result contrast simulation result diagram;

图4是本发明的实施例中通过相同参数训练得到的基于BP神经网络建立的输入变量和输出变量间映射关系的相关性分析图;Fig. 4 is the correlation analysis diagram of the mapping relationship between the input variable and the output variable established based on the BP neural network obtained through the same parameter training in the embodiment of the present invention;

图5是本发明的实施例中通过相同参数训练得到的基于GA-BP神经网络建立的输入变量和输出变量间映射关系的相关性分析图;Fig. 5 is the correlation analysis diagram of the mapping relationship between the input variable and the output variable established based on the GA-BP neural network obtained through the same parameter training in the embodiment of the present invention;

图6是本发明的实施例中通过相同参数训练得到的基于PSO-BP神经网络建立的输入变量和输出变量间映射关系的相关性分析图;Fig. 6 is the correlation analysis diagram of the mapping relationship between the input variable and the output variable established based on the PSO-BP neural network obtained through the same parameter training in the embodiment of the present invention;

图7是本发明的实施例中提出的基于FWA-BP神经网络建立的输入变量和输出变量间映射关系的相关性分析图。FIG. 7 is a correlation analysis diagram of the mapping relationship between input variables and output variables established based on the FWA-BP neural network proposed in the embodiment of the present invention.

具体实施方式Detailed ways

下面结合附图和具体实施方式对本发明进行详细说明。The present invention will be described in detail below with reference to the accompanying drawings and specific embodiments.

本发明实施例中基于烟花算法改进BP神经网络的纺纱质量预测方法的流程图,如图1所示,本发明基于烟花算法改进BP神经网络的纺纱质量预测方法,具体按照以下步骤实施:In the embodiment of the present invention, the flow chart of the method for predicting the spinning quality of the BP neural network based on the fireworks algorithm is improved.

步骤1,利用烟花算法的寻优机理对BP神经网络模型的网络权重和阈值进行优化,建立一种基于烟花算法优化的FWA-BP神经网络模型,烟花算法的寻优机理对BP神经网络模型的网络权重和阈值进行优化的具体步骤为:Step 1: Use the optimization mechanism of the fireworks algorithm to optimize the network weights and thresholds of the BP neural network model, and establish a FWA-BP neural network model optimized based on the fireworks algorithm. The specific steps for optimizing network weights and thresholds are:

步骤1.1,关键参数编码,选取实数向量的编码策略对模型中的关键参数进行编码,记向量X=[x1,x2,Λ,xD]表示一组待优化的参数,其每一维向量由网络权重和阈值组成,烟花种群的维数为:D=nIW(1,1)+nb(1,1)+nIW(2,1)+nb(2,1),其中,记nIW(1,1)为隐含层与输出层间的权值的个数,nb(1,1)为隐含层神经元阈值的个数,nIW(2,1)为隐含层与输出层间的权值的个数,nb(2,1)输出层神经元阈值的个数;Step 1.1, key parameter coding, select the coding strategy of the real number vector to encode the key parameters in the model, and note that the vector X=[x 1 , x 2 , Λ, x D ] represents a set of parameters to be optimized, each dimension of which is The vector consists of network weights and thresholds, and the dimension of the firework population is: D=n IW(1,1) +n b(1,1) +n IW(2,1) +n b(2,1) , where , denoted n IW(1,1) as the number of weights between the hidden layer and the output layer, n b(1,1) as the number of hidden layer neuron thresholds, n IW(2,1) as The number of weights between the hidden layer and the output layer, the number of n b(2,1) output layer neuron thresholds;

步骤1.2,权重系数及阈值初始化,在步骤1.1的基础之上,利用烟花算法中烟花个体xik的位置表示神经网络中的神经元,将神经网络中第k次迭代过程网络l层中第i个神经元与第j个神经元间的权重系数

Figure GDA0002427824850000081
和阈值θi初始化编码成向量X=[x1,x2,Λ,xD],并利用随机初始化的策略把向量X初始在区间[-1,1]内,则有权重系数wij~U[-1,1],Step 1.2: Initialize the weight coefficient and threshold. On the basis of step 1.1, the position of the firework individual x ik in the firework algorithm is used to represent the neuron in the neural network, and the k-th iteration process in the neural network is used. The weight coefficient between the neuron and the jth neuron
Figure GDA0002427824850000081
and the threshold θ i are initialized and encoded into a vector X=[x 1 ,x 2 ,Λ,x D ], and the random initialization strategy is used to initialize the vector X in the interval [-1,1], then there are weight coefficients w ij ~ U[-1,1],

其中,i指的是网络中第i个神经元节点的权重,j指的是第j个神经元节点的权重,l表示的是这个当前权重所处的网络层数,k表示的是当前的迭代次数;Among them, i refers to the weight of the ith neuron node in the network, j refers to the weight of the jth neuron node, l represents the number of network layers where the current weight is located, and k represents the current the number of iterations;

步骤1.3,计算烟花个体的误差,引入适应度函数并利用公式(1)和公式(2)计算平方误差SSE,公式(1)和公式(2)如下所示:Step 1.3, calculate the error of the individual fireworks, introduce the fitness function and use the formula (1) and formula (2) to calculate the square error SSE, formula (1) and formula (2) are as follows:

Figure GDA0002427824850000082
Figure GDA0002427824850000082

其中,t为网络的期望输出,p为网络的层数,s为网络输出单元的个数,y为网络输出值,其具体如下式:Among them, t is the expected output of the network, p is the number of layers of the network, s is the number of output units of the network, and y is the output value of the network, which is as follows:

Figure GDA0002427824850000083
Figure GDA0002427824850000083

其中,xj为网络的输入,wij为网络节点的权重,θi为网络中第i个神经元的阈值且θi=-wi(n+1);Among them, x j is the input of the network, w ij is the weight of the network node, θ i is the threshold of the ith neuron in the network and θ i = -wi (n+1);

步骤1.4,在步骤1.3计算得到的每个烟花个体xi误差的基础上,引入fi(x)函数作为适应度函数,通过适应度函数计算步骤1.2中向量X每一个烟花个体xi的适应度值,适应度函数如公式(3)如下所示,Step 1.4, on the basis of the error of each firework individual x i calculated in step 1.3, introduce the f i (x) function as a fitness function, and calculate the fitness of each firework individual x i of the vector X in step 1.2 through the fitness function. degree value, the fitness function is shown in formula (3) as follows,

Figure GDA0002427824850000091
Figure GDA0002427824850000091

步骤1.5,烟花种群寻优,在步骤1.4的基础之上,对于每一个烟花个体xi进行爆炸、位移和变异操作,其中爆炸变异操作以及高斯变异映射规则为公式(4)~公式(6),Step 1.5, firework population optimization, on the basis of step 1.4, perform explosion, displacement and mutation operations for each firework individual xi , wherein the explosion mutation operation and the Gaussian mutation mapping rule are formula (4) ~ formula (6) ,

h=Ai×rand(1,-1) (4)h=A i ×rand(1,-1) (4)

exik=xik+h (5)ex ik = x ik +h (5)

mxik=xik×e (6)mx ik = x ik ×e (6)

其中,Ai为第i个烟花的爆炸半径,h为位置偏移量,xik表示种群中第i个烟花的第k维,exik为第i个烟花经过爆炸后的火花,mxik为xik经过高斯变异后的高斯变异火花,e~N(1,1)的高斯分布;Among them, A i is the explosion radius of the i-th firework, h is the position offset, x ik is the k-th dimension of the i-th firework in the population, ex ik is the spark of the i-th firework after the explosion, and mx ik is the The Gaussian mutation spark of x ik after Gaussian mutation, the Gaussian distribution of e~N(1,1);

步骤1.6,选择下一代烟花种群,对于步骤1.5中经过爆炸、位移和变异操作后的烟花个体xi,利用步骤1.4中的公式计算每个烟花个体xi的适应度值,并使用公式(7)和公式(8)的选择策略,选择最优的烟花个体组成下一代烟花种群,具体的选择策略为:Step 1.6, select the next generation firework population, for the firework individual xi after the explosion, displacement and mutation operations in step 1.5, use the formula in step 1.4 to calculate the fitness value of each firework individual xi , and use formula (7 ) and the selection strategy of formula (8), select the optimal firework individual to form the next generation of fireworks population, and the specific selection strategy is:

选择适应度值最小的min(f(xi))个体xk直接为一下烟花种群个体,其余的N-1个烟花个体采取轮盘赌方式,对于候选个体xi其被选择的概率如下式:Select the min(f( xi )) individual x k with the smallest fitness value as the following firework population, and the remaining N-1 firework individuals adopt the roulette method. For the candidate individual x i , the probability of being selected is as follows: :

Figure GDA0002427824850000092
Figure GDA0002427824850000092

其中,R(xi)表示烟花个体xi与其他个体的距离之和,具体如下式;Among them, R( xi ) represents the sum of the distances between the firework individual xi and other individuals, and the specific formula is as follows;

Figure GDA0002427824850000093
Figure GDA0002427824850000093

步骤1.7,判断终止条件,根据公式(3)和公式(8)计算烟花种群中烟花个体的适应度值f(xi)和烟花个体间的欧式距离R(xi),并判断是否终止条件中达到的最大迭代次数,若满足则计算得到当前烟花种群中的烟花个体的最小适应度值min(f(xi))以及烟花种群中烟花个体间的最大的距离max(R(xi)),并取当前的烟花种群为最优的烟花种群Xbest,否则继续执行步骤1.3;Step 1.7, determine the termination condition, calculate the fitness value f(x i ) of the individual fireworks in the firework population and the Euclidean distance R(x i ) between the individual fireworks according to formula (3) and formula (8), and determine whether the termination condition is The maximum number of iterations reached in the firework population, if it is satisfied, the minimum fitness value min(f(x i )) of the firework individuals in the current firework population and the maximum distance between the firework individuals in the firework population max(R(x i ) ), and take the current fireworks population as the optimal fireworks population X best , otherwise continue to step 1.3;

步骤1.8,优化网络权重和阈值,利用步骤1.7中得到最优烟花种群Xbest对步骤1.2中的向量X中对应的神经网络中的权重和阈值进行初始化。Step 1.8, optimize the network weights and thresholds, and use the optimal firework population X best obtained in step 1.7 to initialize the weights and thresholds in the neural network corresponding to the vector X in step 1.2.

步骤2,在步骤1的FWA-BP神经网络模型的基础之上,选取输入输出指标,构建基于FWA-BP的纺纱质量预测模型,构建基于FWA-BP的纺纱质量预测模型的具体步骤为:Step 2, on the basis of the FWA-BP neural network model in step 1, select the input and output indicators, and construct a spinning quality prediction model based on FWA-BP. The specific steps for constructing a spinning quality prediction model based on FWA-BP are as follows: :

步骤2.1,输入输出指标的选择:Step 2.1, the selection of input and output indicators:

考虑到纺纱生产加工过程处在多因素相互耦合作用下,原料、工艺、设备参数都会对纱线质量产生影响,因而从原料性能、工艺参数、设备参数等方面选取如下表所示的10个指标作为纺纱质量预测模型的输入,选取纱线CV值作为纺纱质量预测模型的输出指标。Considering that the spinning production and processing process is under the interaction of multiple factors, the raw materials, process and equipment parameters will have an impact on the yarn quality. Therefore, from the aspects of raw material performance, process parameters, and equipment parameters, the 10 shown in the following table are selected. The index is used as the input of the spinning quality prediction model, and the yarn CV value is selected as the output index of the spinning quality prediction model.

Figure GDA0002427824850000101
Figure GDA0002427824850000101

步骤2.2,根据步骤2.1得到的输入输出数据建立模型的数据集,并使用Min-Max方法对数据集中的数据进行标准化处理;Step 2.2, establish a data set of the model according to the input and output data obtained in step 2.1, and use the Min-Max method to standardize the data in the data set;

通过以下公式完成数据的标准化处理:

Figure GDA0002427824850000102
Data normalization is done by the following formula:
Figure GDA0002427824850000102

其中,max(X)为训练数据集中的最大值,min(X)为训练数据集中的最大值,通过对数据进行标准化处理后,将训练数据映射到区间[0,1],便于进行综合评价对比。Among them, max(X) is the maximum value in the training data set, and min(X) is the maximum value in the training data set. After standardizing the data, the training data is mapped to the interval [0,1], which is convenient for comprehensive evaluation. Compared.

步骤2.3,确定网络结构的策略,根据步骤2.1中选取的输入、输出指标,确定输入、输出及隐含层的层数,FWA-BP纺纱质量预测模型的输入层的节点数m=10,输出层节点数n=1,其中隐层神经元的个数通过下式确定Step 2.3, determine the strategy of the network structure, according to the input and output indicators selected in step 2.1, determine the number of layers of the input, output and hidden layers, the number of nodes in the input layer of the FWA-BP spinning quality prediction model m=10, The number of output layer nodes is n=1, and the number of hidden layer neurons is determined by the following formula

Figure GDA0002427824850000111
Figure GDA0002427824850000111

其中,m=10和n=1分别为网络的输入层节点个数和输出层节点个数,计算得到s=6;Among them, m=10 and n=1 are the number of input layer nodes and the number of output layer nodes of the network, respectively, and s=6 is calculated;

步骤2.4,激活函数的选取,输入层采用tansig激活函数,输出层采用purelin激活函数,选取trainlm函数作为网络模型的训练函数。Step 2.4, the selection of the activation function, the input layer adopts the tansig activation function, the output layer adopts the purelin activation function, and the trainlm function is selected as the training function of the network model.

步骤3,利用经过标准化处理的数据集对步骤2中建立的基于FWA-BP的纺纱质量预测模型进行学习和训练,最终完成对纺纱质量的预测,具体步骤为:Step 3, use the standardized data set to learn and train the spinning quality prediction model based on FWA-BP established in step 2, and finally complete the prediction of spinning quality. The specific steps are:

步骤3.1,训练数据集的选择策略,取某公司的棉纺纱质量数据,对FWA-BP纺纱质量预测模型算法的有效性进行实验验证。在算法模型的训练过程中,取数据集的前80%的数据为训练数据集,用于对FWA-BP模型进行训练,取数据集的后20%的数据为测试集,用于对模型预测性能的测试;Step 3.1, the selection strategy of the training data set, take the cotton spinning quality data of a company, and verify the effectiveness of the FWA-BP spinning quality prediction model algorithm. In the training process of the algorithm model, the first 80% of the data set is taken as the training data set, which is used to train the FWA-BP model, and the last 20% of the data set is taken as the test set, which is used to predict the model. performance test;

步骤3.2,烟花算法中关键参数的设置,根据待优化的网络的权重值

Figure GDA0002427824850000112
和阈值θi的具体优化目标,并结合相关文献中的实验结果,对烟花算法中的关键参数设置为,烟花种群的大小N=70,烟花爆炸半径调节常数d=5,烟花爆炸火花数调节常数m=40,烟花爆炸火花个数上界值lm=0.8,烟花爆炸火花个数下界值bm=0.04,高斯变异火花数g=5,最大迭代次数T=100,变量的维数D=85,是在步骤1.1的基础之上取网络模型中神经元权重和阈值的总数,具体是在步骤2.3的基础之上通过如下公式计算Step 3.2, the setting of key parameters in the fireworks algorithm, according to the weight value of the network to be optimized
Figure GDA0002427824850000112
and the specific optimization objective of the threshold θ i , combined with the experimental results in the relevant literature, the key parameters in the firework algorithm are set as: the size of the firework population N=70, the firework explosion radius adjustment constant d=5, the firework explosion spark number adjustment The constant m=40, the upper bound value of the number of fireworks explosion sparks lm=0.8, the lower bound value of the number of fireworks explosion sparks bm=0.04, the number of Gaussian variation sparks g=5, the maximum number of iterations T=100, the dimension of the variable D=85 , is to take the total number of neuron weights and thresholds in the network model on the basis of step 1.1, specifically calculated by the following formula on the basis of step 2.3

D=m×s+s×n+s+n=10×7+7×1+7+1=85D=m×s+s×n+s+n=10×7+7×1+7+1=85

其中,m,s,n分别为网络的输入层神经元、隐含层神经元以及输出层神经元的个数;Among them, m, s, n are the number of input layer neurons, hidden layer neurons and output layer neurons of the network respectively;

步骤3.3,在步骤3.2中烟花算法参数设置的基础之上,使用步骤3.1中选择的训练数据集对基于FWA-BP的纺纱质量预测模型进行训练,在网络训练过程中相关的参数设置如下,学习速率为0.01,动量因子为0.9,最大迭代次数为20000,训练最小误差为0.05;Step 3.3, on the basis of the fireworks algorithm parameter setting in step 3.2, use the training data set selected in step 3.1 to train the spinning quality prediction model based on FWA-BP. The relevant parameters in the network training process are set as follows, The learning rate is 0.01, the momentum factor is 0.9, the maximum number of iterations is 20000, and the minimum training error is 0.05;

步骤3.4,通过步骤3.1~3.3训练得到了基于FWA-BP的纺纱质量预测模型,使用步骤3.1中选择的测试数据集,对模型的预测效果进行测试统计分析和实验仿真。In step 3.4, the spinning quality prediction model based on FWA-BP is obtained through the training in steps 3.1 to 3.3, and the test data set selected in step 3.1 is used to perform test statistical analysis and experimental simulation on the prediction effect of the model.

另外,使用步骤2中经过标准化处理的相同的训练集数据对传统的BP神经网络、GA-BP、以及PSO-BP等纺纱质量预测模型进行训练,并计算不同算法预测结果的误差率和迭代次数。In addition, use the same training set data that has been standardized in step 2 to train the traditional BP neural network, GA-BP, and PSO-BP and other spinning quality prediction models, and calculate the error rate and iteration of the prediction results of different algorithms frequency.

为了降低实验过程中的偶然性因素,对同一种算法模型使用同样的数据训练测试10次,分别取10次预测的误差和迭代次数的平均值作为评价该算法的预测误差值和收敛速度,基于FWA-BP的纱线质量预测模型的训练结果如表1所示,由表1可以看出:本具体实施提出的基于FWA-BP神经网络的纺纱质量预测方法,相对于粒子群优化的神经网络(PSO-BP)其纺纱质量特征值波动预报的误差率下降了49.52%,预报的精度达到97.88%,而且该算法的迭代次数减少31.11%。In order to reduce the chance factor in the experimental process, the same algorithm model is trained and tested 10 times with the same data, and the average value of the 10 prediction errors and iterations is taken as the prediction error value and convergence speed of the algorithm. Based on FWA The training results of the yarn quality prediction model of -BP are shown in Table 1. It can be seen from Table 1 that the spinning quality prediction method based on the FWA-BP neural network proposed in this specific implementation is better than the neural network optimized by particle swarm optimization. (PSO-BP), the error rate of eigenvalue fluctuation prediction of spinning quality decreased by 49.52%, the prediction accuracy reached 97.88%, and the number of iterations of the algorithm was reduced by 31.11%.

表1基于FWA-BP的纱线质量预测模型的训练结果Table 1 Training results of the yarn quality prediction model based on FWA-BP

Figure GDA0002427824850000131
Figure GDA0002427824850000131

本发明中实施例的纺纱质量预测值与实际值的仿真结果图,如图2所示,从图中可以看出本发明实施例中提出的基于GA-BP神经网络的纺纱质量预测模型,能够较好地实现对纺纱质量的预测;The simulation result diagram of the spinning quality prediction value and the actual value of the embodiment of the present invention is shown in Figure 2. From the figure, it can be seen that the spinning quality prediction model based on the GA-BP neural network proposed in the embodiment of the present invention is , which can better predict the spinning quality;

本发明中实施例与其他BP神经网络、GA-BP神经网络以及PSO-BP神经网络的纺纱质量预测结果对比仿真结果图,如图3所示,从图中可以看出基于FWA-BP的神经网络模型对于纺纱质量的预测结果更接近于实际值;The simulation results of the comparison of the spinning quality prediction results of the embodiment of the present invention and other BP neural networks, GA-BP neural networks and PSO-BP neural networks are shown in Figure 3. It can be seen from the figure that the FWA-BP-based The prediction result of the neural network model for the spinning quality is closer to the actual value;

本发明中实施例中通过相同参数训练得到的基于BP神经网络建立的输入变量和输出变量间映射关系的相关性分析图,如图4所示,其相关系数R为0.85176;In the embodiment of the present invention, the correlation analysis diagram of the mapping relationship between the input variable and the output variable established based on the BP neural network obtained by training with the same parameters, as shown in FIG. 4 , the correlation coefficient R is 0.85176;

本发明中实施例中通过相同参数训练得到的基于GA-BP神经网络建立的输入变量和输出变量间映射关系的相关性分析图,如图5所示,其相关系数R为0.91472;The correlation analysis diagram of the mapping relationship between the input variable and the output variable based on the GA-BP neural network established by training with the same parameters in the embodiment of the present invention, as shown in Figure 5, the correlation coefficient R is 0.91472;

本发明中实施例中通过相同参数训练得到基于PSO-BP神经网络建立的输入变量和输出变量间映射关系的相关性分析图,如图6所示,其相关系数R为0.92182;In the embodiment of the present invention, the correlation analysis diagram of the mapping relationship between the input variable and the output variable established based on the PSO-BP neural network is obtained by training with the same parameters, as shown in FIG. 6 , the correlation coefficient R is 0.92182;

本发明中实施例中提出的基于FWA-BP神经网络建立的输入变量和输出变量间映射关系的相关性分析图,如图7所示,其相关系数R为0.9479。The correlation analysis diagram of the mapping relationship between input variables and output variables established based on the FWA-BP neural network proposed in the embodiment of the present invention is shown in FIG. 7 , and the correlation coefficient R is 0.9479.

本发明将烟花算法引入到神经网络权值和阈值的优化中,提出了一种基于FWA-BP网络的预测模型,实验和仿真结果表明,本发明提出的方法具有较低的预测误差率和较少的迭代次数,可以有效解决传统神经网络预测模型存在的预测精度低且迭代次数高的问题,为大样本数据下快速有效地解决预测问题提供一种新方法。The invention introduces the fireworks algorithm into the optimization of the neural network weights and thresholds, and proposes a prediction model based on the FWA-BP network. The experimental and simulation results show that the method proposed by the invention has a lower prediction error rate and a higher prediction error rate. With a small number of iterations, it can effectively solve the problems of low prediction accuracy and high number of iterations in traditional neural network prediction models, and provide a new method for quickly and effectively solving prediction problems under large sample data.

Claims (3)

1.基于烟花算法改进BP神经网络的纺纱质量预测方法,其特征在于,具体按照以下步骤实施:1. improve the spinning quality prediction method of BP neural network based on fireworks algorithm, it is characterized in that, specifically implement according to the following steps: 步骤1,利用烟花算法的寻优机理对BP神经网络模型的网络权重和阈值进行优化,建立一种基于烟花算法优化的FWA-BP神经网络模型;Step 1, using the optimization mechanism of the fireworks algorithm to optimize the network weight and threshold of the BP neural network model, and establish a FWA-BP neural network model optimized based on the fireworks algorithm; 步骤2,在步骤1的FWA-BP神经网络模型的基础之上,选取输入输出指标,构建基于FWA-BP的纺纱质量预测模型;Step 2, on the basis of the FWA-BP neural network model in step 1, select input and output indicators to construct a spinning quality prediction model based on FWA-BP; 步骤3,利用经过标准化处理的数据集对步骤2中建立的基于FWA-BP的纺纱质量预测模型进行学习和训练,最终完成对纺纱质量的预测;Step 3, use the standardized data set to learn and train the spinning quality prediction model based on FWA-BP established in step 2, and finally complete the prediction of spinning quality; 所述步骤2中构建基于FWA-BP的纺纱质量预测模型的具体步骤为:The specific steps of constructing the FWA-BP-based spinning quality prediction model in the step 2 are: 步骤2.1,输入输出指标的选择:选取纺纱生产加工过程中与纱线质量相关的原料、工艺数据作为输入变量,选取纱线的CV值为输出指标,则整个基于FWA-BP的纱线质量预测模型的输入输出为:Step 2.1, the selection of input and output indicators: select the raw materials and process data related to the yarn quality in the spinning production and processing process as input variables, and select the CV value of the yarn as the output indicator, then the whole yarn quality based on FWA-BP The input and output of the prediction model are: 输入量为:x1=棉条含杂率,x2=粗纱捻系数,x3=回潮率,x4=纤维直径,x5=纤维长度,x6=直径离散系数,x7=纤维质量不匀率,x8=纤维牵伸倍数,x9=细纱钢丝圈号,x10=罗拉转速;输出量为:Y=纱线CV值;The input quantities are: x1 = sliver trash content, x2 = roving twist coefficient, x3 = moisture regain, x4 = fiber diameter, x5 = fiber length, x6 = diameter dispersion coefficient, x7 = fiber quality unevenness, x8 = fiber Drafting ratio, x9=spinning traveler number, x10=roller rotation speed; output: Y=yarn CV value; 步骤2.2,根据步骤2.1得到的输入输出数据建立模型的数据集,并使用Min-Max方法对数据集中的数据进行标准化处理;Step 2.2, establish a data set of the model according to the input and output data obtained in step 2.1, and use the Min-Max method to standardize the data in the data set; 步骤2.3,确定网络结构的策略,根据步骤2.1中选取的输入、输出指标,确定输入、输出及隐含层的层数,FWA-BP纺纱质量预测模型的输入层的节点数m=10,输出层节点数n=1,其中隐层神经元的个数通过下式确定Step 2.3, determine the strategy of the network structure, according to the input and output indicators selected in step 2.1, determine the number of layers of the input, output and hidden layers, the number of nodes in the input layer of the FWA-BP spinning quality prediction model m=10, The number of output layer nodes is n=1, and the number of hidden layer neurons is determined by the following formula
Figure FDA0002427824840000011
Figure FDA0002427824840000011
计算得到s=6;Calculated to get s=6; 步骤2.4,激活函数的选取,输入层采用tansig激活函数,输出层采用purelin激活函数,选取trainlm函数作为网络模型的训练函数。Step 2.4, the selection of the activation function, the input layer adopts the tansig activation function, the output layer adopts the purelin activation function, and the trainlm function is selected as the training function of the network model.
2.根据权利要求1所述的基于烟花算法改进BP神经网络的纺纱质量预测方法,其特征在于,所述步骤1中烟花算法的寻优机理对BP神经网络模型的网络权重和阈值进行优化的具体步骤为:2. the spinning quality prediction method based on fireworks algorithm improvement BP neural network according to claim 1, is characterized in that, in described step 1, the optimization mechanism of fireworks algorithm optimizes the network weight and the threshold value of BP neural network model The specific steps are: 步骤1.1,关键参数编码,选取实数向量的编码策略对模型中的关键参数进行编码,记向量X=[x1,x2,Λ,xD]表示一组待优化的参数,其每一维向量由网络权重和阈值组成,烟花种群的维数为:D=nIW(1,1)+nb(1,1)+nIW(2,1)+nb(2,1),其中,记nIW(1,1)为隐含层与输出层间的权值的个数,nb(1,1)为隐含层神经元阈值的个数,nIW(2,1)为隐含层与输出层间的权值的个数,nb(2,1)输出层神经元阈值的个数;Step 1.1, key parameter coding, select the coding strategy of the real number vector to encode the key parameters in the model, and note that the vector X=[x 1 , x 2 , Λ, x D ] represents a set of parameters to be optimized, each dimension of which is The vector consists of network weights and thresholds, and the dimension of the firework population is: D=n IW(1,1) +n b(1,1) +n IW(2,1) +n b(2,1) , where , denoted n IW(1,1) as the number of weights between the hidden layer and the output layer, n b(1,1) as the number of hidden layer neuron thresholds, n IW(2,1) as The number of weights between the hidden layer and the output layer, the number of n b(2,1) output layer neuron thresholds; 步骤1.2,权重系数及阈值初始化,在步骤1.1的基础之上,利用烟花算法中烟花个体xik的位置表示神经网络中的神经元,将神经网络中第k次迭代过程网络l层中第i个神经元与第j个神经元间的权重系数
Figure FDA0002427824840000021
和阈值θi初始化编码成向量X=[x1,x2,Λ,xD],并利用随机初始化的策略把向量X初始在区间[-1,1]内,则有权重系数wij~U[-1,1],
Step 1.2: Initialize the weight coefficient and threshold. On the basis of step 1.1, the position of the firework individual x ik in the firework algorithm is used to represent the neuron in the neural network, and the k-th iteration process in the neural network is used. The weight coefficient between the neuron and the jth neuron
Figure FDA0002427824840000021
and the threshold θ i are initialized and encoded into a vector X=[x 1 ,x 2 ,Λ,x D ], and the random initialization strategy is used to initialize the vector X in the interval [-1,1], then there are weight coefficients w ij ~ U[-1,1],
其中,i指的是网络中第i个神经元节点的权重,j指的是第j个神经元节点的权重,l表示的是这个当前权重所处的网络层数,k表示的是当前的迭代次数;Among them, i refers to the weight of the ith neuron node in the network, j refers to the weight of the jth neuron node, l represents the number of network layers where the current weight is located, and k represents the current the number of iterations; 步骤1.3,计算烟花个体的误差,引入适应度函数并利用公式(1)和公式(2)计算平方误差SSE,公式(1)和公式(2)如下所示:Step 1.3, calculate the error of the individual fireworks, introduce the fitness function and use the formula (1) and formula (2) to calculate the square error SSE, formula (1) and formula (2) are as follows:
Figure FDA0002427824840000031
Figure FDA0002427824840000031
其中,t为网络的期望输出,p为网络的层数,s为网络输出单元的个数,y为网络输出值,其具体如下式:Among them, t is the expected output of the network, p is the number of layers of the network, s is the number of output units of the network, and y is the output value of the network, which is as follows:
Figure FDA0002427824840000032
Figure FDA0002427824840000032
其中,xj为网络的输入,wij为网络节点的权重,θi为网络中第i个神经元的阈值且θi=-wi(n+1);Among them, x j is the input of the network, w ij is the weight of the network node, θ i is the threshold of the ith neuron in the network and θ i = -wi (n+1); 步骤1.4,在步骤1.3计算得到的每个烟花个体xi误差的基础上,引入fi(x)函数作为适应度函数,通过适应度函数计算步骤1.2中向量X每一个烟花个体xi的适应度值,适应度函数如公式(3)如下所示,Step 1.4, on the basis of the error of each firework individual x i calculated in step 1.3, introduce the f i (x) function as a fitness function, and calculate the fitness of each firework individual x i of the vector X in step 1.2 through the fitness function. degree value, the fitness function is shown in formula (3) as follows,
Figure FDA0002427824840000033
Figure FDA0002427824840000033
步骤1.5,烟花种群寻优,在步骤1.4的基础之上,对于每一个烟花个体xi进行爆炸、位移和变异操作,其中爆炸变异操作以及高斯变异映射规则为公式(4)~公式(6),Step 1.5, firework population optimization, on the basis of step 1.4, perform explosion, displacement and mutation operations for each firework individual xi , wherein the explosion mutation operation and the Gaussian mutation mapping rule are formula (4) ~ formula (6) , h=Ai×rand(1,-1) (4)h=A i ×rand(1,-1) (4) exik=xik+h (5)ex ik = x ik +h (5) mxik=xik×e (6)mx ik = x ik ×e (6) 其中,Ai为第i个烟花的爆炸半径,h为位置偏移量,xik表示种群中第i个烟花的第k维,exik为第i个烟花经过爆炸后的火花,mxik为xik经过高斯变异后的高斯变异火花,e~N(1,1)的高斯分布;Among them, A i is the explosion radius of the i-th firework, h is the position offset, x ik is the k-th dimension of the i-th firework in the population, ex ik is the spark of the i-th firework after the explosion, and mx ik is the The Gaussian mutation spark of x ik after Gaussian mutation, the Gaussian distribution of e~N(1,1); 步骤1.6,选择下一代烟花种群,对于步骤1.5中经过爆炸、位移和变异操作后的烟花个体xi,利用步骤1.4中的公式计算每个烟花个体xi的适应度值,并使用公式(7)和公式(8)的选择策略,选择最优的烟花个体组成下一代烟花种群,具体的选择策略为:Step 1.6, select the next generation firework population, for the firework individual xi after the explosion, displacement and mutation operations in step 1.5, use the formula in step 1.4 to calculate the fitness value of each firework individual xi , and use formula (7 ) and the selection strategy of formula (8), select the optimal firework individual to form the next generation of fireworks population, and the specific selection strategy is: 选择适应度值最小的min(f(xi))个体xk直接为一下烟花种群个体,其余的N-1个烟花个体采取轮盘赌方式,对于候选个体xi其被选择的概率如下式:Select the min(f( xi )) individual x k with the smallest fitness value as the following firework population, and the remaining N-1 firework individuals adopt the roulette method. For the candidate individual x i , the probability of being selected is as follows: :
Figure FDA0002427824840000041
Figure FDA0002427824840000041
其中,R(xi)表示烟花个体xi与其他个体的距离之和,具体如下式;Among them, R( xi ) represents the sum of the distances between the firework individual xi and other individuals, and the specific formula is as follows;
Figure FDA0002427824840000042
Figure FDA0002427824840000042
步骤1.7,判断终止条件,根据公式(3)和公式(8)计算烟花种群中烟花个体的适应度值f(xi)和烟花个体间的欧式距离R(xi),并判断是否终止条件中达到的最大迭代次数,若满足则计算得到当前烟花种群中的烟花个体的最小适应度值min(f(xi))以及烟花种群中烟花个体间的最大的距离max(R(xi)),并取当前的烟花种群为最优的烟花种群Xbest,否则继续执行步骤1.3;Step 1.7, determine the termination condition, calculate the fitness value f(x i ) of the individual fireworks in the firework population and the Euclidean distance R(x i ) between the individual fireworks according to formula (3) and formula (8), and determine whether the termination condition is The maximum number of iterations reached in the firework population, if it is satisfied, the minimum fitness value min(f(x i )) of the firework individuals in the current firework population and the maximum distance between the firework individuals in the firework population max(R(x i ) ), and take the current fireworks population as the optimal fireworks population X best , otherwise continue to step 1.3; 步骤1.8,优化网络权重和阈值,利用步骤1.7中得到最优烟花种群Xbest对步骤1.2中的向量X中对应的神经网络中的权重和阈值进行初始化。Step 1.8, optimize the network weights and thresholds, and use the optimal firework population X best obtained in step 1.7 to initialize the weights and thresholds in the neural network corresponding to the vector X in step 1.2.
3.根据权利要求1所述的基于烟花算法改进BP神经网络的纺纱质量预测方法,其特征在于,所述步骤3中利用经过标准化处理的数据集对步骤2中建立的基于FWA-BP的纺纱质量预测模型进行学习和预测的具体步骤为:3. the spinning quality prediction method based on fireworks algorithm improvement BP neural network according to claim 1, is characterized in that, utilizes the data set through standardized processing in described step 3 to the FWA-BP-based method established in step 2. The specific steps for the learning and prediction of the spinning quality prediction model are as follows: 步骤3.1,训练数据集的选择策略,利用步骤2.2中经过标准化处理的数据集,从中选择80%的数据集作为训练数据集,剩余20%的数据集作为测试数据集;Step 3.1, the training data set selection strategy, use the standardized data set in step 2.2, select 80% of the data set as the training data set, and the remaining 20% of the data set as the test data set; 步骤3.2,烟花算法中关键参数的设置,烟花种群的大小N=70,烟花爆炸半径调节常数d=5,烟花爆炸火花数调节常数m=40,烟花爆炸火花个数上界值lm=0.8,烟花爆炸火花个数下界值bm=0.04,高斯变异火花数g=5,最大迭代次数T=100,其中变量的维数D=85,是在步骤1.1的基础之上取网络模型中神经元权重和阈值的总数,具体是在步骤2.3的基础之上通过如下公式计算Step 3.2, the setting of key parameters in the firework algorithm, the size of the firework population N=70, the adjustment constant of the firework explosion radius d=5, the adjustment constant of the number of fireworks explosion sparks m=40, the upper bound value of the number of fireworks explosion sparks lm=0.8, The lower bound value of the number of fireworks explosion sparks bm=0.04, the number of Gaussian variation sparks g=5, the maximum number of iterations T=100, and the dimension of the variable D=85, which is based on step 1.1. The weight of neurons in the network model is obtained and the total number of thresholds, which are calculated by the following formula on the basis of step 2.3 D=m×s+s×n+s+n=10×7+7×1+7+1=85D=m×s+s×n+s+n=10×7+7×1+7+1=85 其中,m,s,n分别为网络的输入层神经元、隐含层神经元以及输出层神经元的个数;Among them, m, s, n are the number of input layer neurons, hidden layer neurons and output layer neurons of the network respectively; 步骤3.3,在步骤3.2中烟花算法参数设置的基础之上,使用步骤3.1中选择的训练数据集对基于FWA-BP的纺纱质量预测模型进行训练,在网络训练过程中相关的参数设置为,学习速率为0.01,动量因子为0.9,最大迭代次数为20000,训练最小误差为0.05;Step 3.3, on the basis of the firework algorithm parameter setting in step 3.2, use the training data set selected in step 3.1 to train the spinning quality prediction model based on FWA-BP, and the relevant parameters in the network training process are set as, The learning rate is 0.01, the momentum factor is 0.9, the maximum number of iterations is 20000, and the minimum training error is 0.05; 步骤3.4,通过步骤3.1~3.3训练得到了基于FWA-BP的纺纱质量预测模型,使用步骤3.1中选择的测试数据集,对模型的预测效果进行测试统计分析和实验仿真。In step 3.4, the spinning quality prediction model based on FWA-BP is obtained through the training in steps 3.1 to 3.3, and the test data set selected in step 3.1 is used to perform test statistical analysis and experimental simulation on the prediction effect of the model.
CN201710288559.2A 2017-04-27 2017-04-27 Spinning quality prediction method for improving BP neural network based on firework algorithm Expired - Fee Related CN107169565B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710288559.2A CN107169565B (en) 2017-04-27 2017-04-27 Spinning quality prediction method for improving BP neural network based on firework algorithm

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710288559.2A CN107169565B (en) 2017-04-27 2017-04-27 Spinning quality prediction method for improving BP neural network based on firework algorithm

Publications (2)

Publication Number Publication Date
CN107169565A CN107169565A (en) 2017-09-15
CN107169565B true CN107169565B (en) 2020-06-19

Family

ID=59813156

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710288559.2A Expired - Fee Related CN107169565B (en) 2017-04-27 2017-04-27 Spinning quality prediction method for improving BP neural network based on firework algorithm

Country Status (1)

Country Link
CN (1) CN107169565B (en)

Families Citing this family (23)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107395433B (en) * 2017-08-18 2020-06-09 中南大学 Wireless sensor node deployment method based on firework algorithm
CN107994570B (en) * 2017-12-04 2022-03-25 华北电力大学(保定) State estimation method and system based on neural network
CN108241298A (en) * 2018-01-09 2018-07-03 南京航空航天大学 A FWA-RNN Model Based Fault Diagnosis Method for Aviation Generator
CN108197696A (en) * 2018-01-31 2018-06-22 湖北工业大学 A kind of network navy account recognition methods and system
CN109636014B (en) * 2018-11-28 2020-05-05 郑州轻工业学院 Cotton blending method based on finished yarn quality prediction
CN109542103B (en) * 2018-12-25 2019-12-20 北京理工大学 Robot welding path planning method based on firework particle swarm algorithm
CN110032069B (en) * 2019-04-02 2020-09-15 东华大学 A method for configuring segmented parameters of polyester fiber spinning process based on error compensation
CN113112101B (en) * 2020-01-10 2023-07-25 北京百度网讯科技有限公司 Method and device for monitoring production process, electronic equipment and storage medium
CN111277141A (en) * 2020-02-29 2020-06-12 武汉理工大学 Optimal control method of bidirectional DC/DC converter
CN111460738B (en) * 2020-04-16 2023-06-16 中南大学 RNN-ARX modeling method and RNN-ARX model of magnetic suspension system
CN112529684A (en) * 2020-11-27 2021-03-19 百维金科(上海)信息科技有限公司 Customer credit assessment method and system based on FWA _ DBN
CN112733720A (en) * 2021-01-12 2021-04-30 上海理工大学 Face recognition method based on firework algorithm improved convolutional neural network
CN112765902B (en) * 2021-02-09 2024-02-20 嘉兴学院 A soft sensor modeling method for COD concentration in rural domestic sewage treatment process based on RBF neural network of TentFWA-GD
CN113408963A (en) * 2021-07-28 2021-09-17 上海致景信息科技有限公司 Textile yarn quality rating method and device, storage medium and processor
CN114065631B (en) * 2021-11-18 2024-06-28 福州大学 Energy consumption prediction method and system for plate laser cutting
CN113919601A (en) * 2021-12-09 2022-01-11 山东捷瑞数字科技股份有限公司 Resin process prediction method and device based on product performance and process data model
CN115017204B (en) * 2022-05-09 2024-12-24 国家石油天然气管网集团有限公司 A method for predicting oil pump characteristics based on improved neural network
CN115099490A (en) * 2022-06-24 2022-09-23 无锡物联网创新中心有限公司 Yarn quality prediction method and related device
CN115221791A (en) * 2022-07-27 2022-10-21 浙江大学 A method and system for online prediction of wall temperature of supercritical boiler
CN114994289B (en) * 2022-08-01 2022-10-28 江苏卓鹏智能机电有限公司 Spinning product quality detection method and system
CN116088453B (en) * 2023-02-17 2025-05-09 华中科技大学 Production quality prediction model training method and device, production quality monitoring method
CN118965926B (en) * 2024-10-17 2025-01-28 绍兴达伽马纺织有限公司 A method and system for optimizing antistatic properties of textiles
CN119203789A (en) * 2024-11-26 2024-12-27 诸暨今视针织有限公司 A knitted fabric weavability verification method and system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105652952A (en) * 2016-04-18 2016-06-08 中国矿业大学 Maximum power point tracking method for photovoltaic power generation system based on fireworks algorithm
CN205688082U (en) * 2016-04-26 2016-11-16 苏州精卫智能科技有限公司 Yarn qualities predictor
CN106503661A (en) * 2016-10-25 2017-03-15 陕西师范大学 Face gender identification method based on fireworks depth belief network

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105652952A (en) * 2016-04-18 2016-06-08 中国矿业大学 Maximum power point tracking method for photovoltaic power generation system based on fireworks algorithm
CN205688082U (en) * 2016-04-26 2016-11-16 苏州精卫智能科技有限公司 Yarn qualities predictor
CN106503661A (en) * 2016-10-25 2017-03-15 陕西师范大学 Face gender identification method based on fireworks depth belief network

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
《Artificial Neural Network Training using Fireworks》;Ram Kinkar Dutta等;《internationaljournal of computer applications》;20160430;1-4 *
《基于BP神经网络组合预测的纺纱产量预测研究》;刘有时等;《江苏纺织》;20121120;55-60 *
《烟花算法优化极限学习机的研究及应用》;苌康群;《中国秀硕士论文辑信息科技辑》;20170215;I140-108页 *

Also Published As

Publication number Publication date
CN107169565A (en) 2017-09-15

Similar Documents

Publication Publication Date Title
CN107169565B (en) Spinning quality prediction method for improving BP neural network based on firework algorithm
CN110544011B (en) Intelligent system combat effectiveness evaluation and optimization method
CN104636801B (en) A kind of prediction transmission line of electricity audible noise method based on Optimized BP Neural Network
CN109919356B (en) A method of interval water demand prediction based on BP neural network
CN106650022A (en) Method for predicting fault of complex electronic device
CN111310722A (en) Power equipment image fault identification method based on improved neural network
CN107832789B (en) Feature weighting K nearest neighbor fault diagnosis method based on average influence value data transformation
CN105184415B (en) A kind of Distribution Networks Reconfiguration design method
CN106549826A (en) Intelligent substation switch applied in network performance test appraisal procedure
CN109598381A (en) A kind of Short-time Traffic Flow Forecasting Methods based on state frequency Memory Neural Networks
CN118643891A (en) A big data optimization control method and system based on genetic algorithm
CN114202252A (en) A Multi-objective Optimization Method of Spinning Process Parameters
CN112101664B (en) Multi-parameter atmospheric environment data generation method based on stacked LSTM-GRU
CN115982141A (en) A Feature Optimization Method for Time Series Data Prediction
CN117874615A (en) A photovoltaic fault diagnosis method and system based on deep digital twin
Zhang et al. Hetero-dimensional multitask neuroevolution for chaotic time series prediction
CN116882097A (en) Analysis and optimization method of quality fluctuation of multi-related parameters in spinning process
CN117273080A (en) A neural network architecture based on evolutionary algorithms
CN113762591B (en) Short-term electric quantity prediction method and system based on GRU and multi-core SVM countermeasure learning
CN119228590A (en) A method and system for intelligent control of building water use
CN118114573B (en) A reconstruction and migration method for digital twin models in steel process flow
CN103983332A (en) Method for error compensation of sensor based on HGSA-BP algorithm
CN118395842A (en) Digital twin-driven heat treatment furnace temperature uniformity health status assessment method
CN115996135B (en) Industrial Internet malicious behavior real-time detection method based on feature combination optimization
CN112883633B (en) Power distribution network line loss calculation method based on combined weighting method and deep learning

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20200619

Termination date: 20210427

CF01 Termination of patent right due to non-payment of annual fee