[go: up one dir, main page]

CN117312783B - Ship heave compensation prediction method, device and storage medium based on neural network - Google Patents

Ship heave compensation prediction method, device and storage medium based on neural network Download PDF

Info

Publication number
CN117312783B
CN117312783B CN202311616443.9A CN202311616443A CN117312783B CN 117312783 B CN117312783 B CN 117312783B CN 202311616443 A CN202311616443 A CN 202311616443A CN 117312783 B CN117312783 B CN 117312783B
Authority
CN
China
Prior art keywords
beetle
neural network
longhorned
value
formula
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.)
Active
Application number
CN202311616443.9A
Other languages
Chinese (zh)
Other versions
CN117312783A (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.)
Shandong University
Original Assignee
Shandong 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 Shandong University filed Critical Shandong University
Priority to CN202311616443.9A priority Critical patent/CN117312783B/en
Publication of CN117312783A publication Critical patent/CN117312783A/en
Application granted granted Critical
Publication of CN117312783B publication Critical patent/CN117312783B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/10Pre-processing; Data cleansing
    • G06F18/15Statistical pre-processing, e.g. techniques for normalisation or restoring missing data
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/217Validation; Performance evaluation; Active pattern learning techniques
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/25Fusion techniques
    • G06F18/253Fusion techniques of extracted features
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/004Artificial life, i.e. computing arrangements simulating life
    • G06N3/006Artificial life, i.e. computing arrangements simulating life based on simulated virtual individual or collective life forms, e.g. social simulations or particle swarm optimisation [PSO]
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2123/00Data types
    • G06F2123/02Data types in the time domain, e.g. time-series data
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T90/00Enabling technologies or technologies with a potential or indirect contribution to GHG emissions mitigation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Molecular Biology (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Probability & Statistics with Applications (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention relates to a ship heave compensation prediction method and device based on a neural network and a storage medium, belonging to the field of ship heave compensation prediction. Comprising the following steps: acquiring historical heave data of a ship, reducing noise, and dividing a data set into a training set and a testing set according to a proportion at random; performing outlier processing on the historical heave data; performing time delay processing on the data processed by the abnormal value, converting the data into a vector form suitable for the neural network through a plurality of time delay modules and a Mux module, and taking the vector form as a series of inputs of the neural network; acquiring time characteristics through a neural network, then fusing the time characteristics with the characteristics of a longicorn group algorithm and a cosine annealing algorithm of the wall-up, constructing a characteristic learning model based on the neural network and training the model; and carrying out differential filtering processing on the output signal of the neural network to output a result, so as to reduce the shake problem of the output signal of the network, wherein the result is used as a prediction result of heave displacement. The invention solves the problems that the algorithm is easy to fall into a local extremum and the convergence speed is low.

Description

基于神经网络的船舶升沉补偿预测方法、装置及存储介质Ship heave compensation prediction method, device and storage medium based on neural network

技术领域Technical field

本发明涉及一种基于神经网络的船舶升沉补偿预测方法、装置及存储介质,属于船舶升沉补偿预测技术领域。The invention relates to a neural network-based ship heave compensation prediction method, device and storage medium, and belongs to the technical field of ship heave compensation prediction.

背景技术Background technique

海底钻探、救生艇收放、海上吊装、水下拖曳等海洋工程作业中,均需要使用母船。然而受海浪、洋流等环境扰动,母船将产生六个自由度复杂的摇荡运动,带动负载随母船运动,其中升沉方向对海上作业安全影响最大。因此,有必要对作业系统增加升沉补偿系统。Mother ships are required for ocean engineering operations such as seabed drilling, lifeboat retracting and releasing, offshore hoisting, and underwater towing. However, due to environmental disturbances such as waves and ocean currents, the mother ship will produce complex rocking motions with six degrees of freedom, driving the load to move with the mother ship. The heave direction has the greatest impact on the safety of offshore operations. Therefore, it is necessary to add a heave compensation system to the operating system.

升沉补偿系统内的传感器测量与控制器执行之间的时间延迟会导致补偿效果不佳,而利用船舶升沉历史运动数据进行船舶升沉补偿预测技术可以有效弥补系统延迟造成的影响。The time delay between sensor measurement and controller execution in the heave compensation system will lead to poor compensation results. The use of ship heave historical motion data for ship heave compensation prediction technology can effectively compensate for the impact of system delays.

目前已有一些算法能够利用机器学习、神经网络技术对船舶升沉补偿进行预测。如中国专利CN116307273A提出一种基于XGboost机器学习算法的船舶运动实时预报方法及系统。机器学习算法相比神经网络模型训练时间和预测时间大幅缩短,但预测准确度差距较大。同时XGboost算法根本无法直接识别特征之间的交互关系,只是机械的使用数据分裂规则对每一个特征进行分裂。因升沉补偿系统内传感器输出信号为一列单变量基于时序的船舶升沉位移历史数据,所以综合来看采取时序神经网络预测船舶升沉补偿运动更为合适。There are currently some algorithms that can use machine learning and neural network technology to predict ship heave compensation. For example, Chinese patent CN116307273A proposes a real-time ship movement prediction method and system based on XGboost machine learning algorithm. Compared with the neural network model, the training time and prediction time of the machine learning algorithm are greatly shortened, but the prediction accuracy gap is large. At the same time, the XGboost algorithm cannot directly identify the interactive relationship between features. It only mechanically uses data splitting rules to split each feature. Since the output signal of the sensor in the heave compensation system is a series of univariate time-series-based historical data of ship heave displacement, it is more appropriate to use a time-series neural network to predict ship heave compensation motion.

时序神经网络包括单一时序神经网络、卷积时序神经网络、组合时序神经网络。时序神经网络中单一时序神经网络包括但不限于全连接神经网络(DNN,如BP)、循环神经网络(RNN,如NARX、Transformer、LSTM、GRU、以及改进的Bi-LSTM、Bi-GRU)、时间卷积神经网络(TCN);卷积时序神经网络即在单一时序神经网络基础上增添传统单维卷积层CNN,如中国专利CN116280094A提出的Conv-Bi-LSTM模型。组合神经网络即将任两种或多种单一时序神经网络组合使用,如BP-LSTM。RNN以善于挖掘时序特征著称,但是无法提取时间序列的单维单向空间特征,而CNN、TCN能够提取时序的单维单向空间特征,却不擅长提取时序元素的顺序特征。一般来说,组合时序神经网络具备比单一模型更为全面的能力,能够自适应多种复杂海况,显著提高预测准确性。Sequential neural networks include single sequential neural networks, convolutional sequential neural networks, and combined sequential neural networks. Single sequential neural networks in sequential neural networks include but are not limited to fully connected neural networks (DNN, such as BP), recurrent neural networks (RNN, such as NARX, Transformer, LSTM, GRU, and improved Bi-LSTM, Bi-GRU), Temporal convolutional neural network (TCN); convolutional temporal neural network adds a traditional single-dimensional convolutional layer CNN based on a single temporal neural network, such as the Conv-Bi-LSTM model proposed by Chinese patent CN116280094A. A combined neural network is a combination of any two or more single sequential neural networks, such as BP-LSTM. RNN is famous for being good at mining time series features, but it is unable to extract single-dimensional and one-way spatial features of time series, while CNN and TCN can extract single-dimensional and one-way spatial features of time series, but are not good at extracting sequential features of time series elements. Generally speaking, the combined time series neural network has more comprehensive capabilities than a single model, can adapt to a variety of complex sea conditions, and significantly improves prediction accuracy.

当前船舶升沉预测研究主要针对于时序神经网络的自由组合与实验,但当前研究往往忽略优化算法对于时序神经网络的整体性能提升。时序神经网络通过负梯度下降思想来对权值和阈值进行修正,容易陷入局部极值问题。而群智能优化算法相比较传统生物启发算法代替梯度下降算法有更好的效果,如使用天牛群算法、中国专利CN116861617A提出的鲸鱼优化算法,其中天牛群算法易于实现、运算量小、仅需小规模天牛个体来完成算法的寻优。优化算法的学习速度主要由两个方面决定:一是学习率参数η,另一个是激活函数导数的大小。而学习率参数η过大导致网络训练过程出现振荡甚至发散现象,过小又会影响权值和阈值的更新速度。目前船舶升沉预测领域多集中在固定学习率、分段常数衰减、指数衰减,导致收敛速度慢,不能自适应迭代进程。Current research on ship heave prediction mainly focuses on the free combination and experiment of sequential neural networks, but current research often ignores the overall performance improvement of sequential neural networks by optimization algorithms. Sequential neural networks use the idea of negative gradient descent to correct weights and thresholds, which can easily fall into local extreme values. The swarm intelligence optimization algorithm has better results than the traditional biologically inspired algorithm instead of the gradient descent algorithm, such as the longhorned beetle swarm algorithm and the whale optimization algorithm proposed by Chinese patent CN116861617A. The longhorned beetle swarm algorithm is easy to implement, has a small amount of calculation, and only needs A small number of beetle individuals are needed to complete the optimization of the algorithm. The learning speed of the optimization algorithm is mainly determined by two aspects: one is the learning rate parameter η , and the other is the size of the activation function derivative. If the learning rate parameter η is too large, it will cause oscillation or even divergence in the network training process, and if it is too small, it will affect the update speed of weights and thresholds. At present, the field of ship heave prediction focuses on fixed learning rate, piecewise constant decay, and exponential decay, resulting in slow convergence speed and inability to adapt the iterative process.

因此,亟待一种基于神经网络的船舶升沉补偿预测方法及装置来解决现有技术存在的问题。Therefore, there is an urgent need for a neural network-based ship heave compensation prediction method and device to solve the problems existing in the existing technology.

发明内容Contents of the invention

针对现有技术的不足,本发明提供了一种基于神经网络的船舶升沉补偿预测方法、装置及存储介质,以解决算法易陷入局部极值、收敛速度慢的问题。In view of the shortcomings of the existing technology, the present invention provides a neural network-based ship heave compensation prediction method, device and storage medium to solve the problem that the algorithm is easy to fall into local extreme values and the convergence speed is slow.

本发明核心技术是对历史升沉数据进行升沉信息异常值检测、时延处理、构建特征学习模型及微分滤波处理,其中特征学习模型主要是在对神经网络的参数寻优方法过程中采用天牛群算法替代传统的梯度下降算法,从而避免传统梯度下降算法容易产生的局部极值现象。本发明引入warm-up的余弦退火算法替换固定学习率参数η,使误差函数能够可以更快地收敛到最优值;引入自适应T分布增强了全局搜索和局部搜索能力。The core technology of the present invention is to perform heave information outlier detection, time delay processing, construction of feature learning models and differential filtering processing on historical heaving data. The feature learning model mainly uses natural gas in the process of optimizing the parameters of the neural network. The herd algorithm replaces the traditional gradient descent algorithm, thus avoiding the local extreme value phenomenon that is easily produced by the traditional gradient descent algorithm. The present invention introduces the warm-up cosine annealing algorithm to replace the fixed learning rate parameter eta , so that the error function can converge to the optimal value faster; the adaptive T distribution is introduced to enhance the global search and local search capabilities.

本发明采用以下技术方案:The present invention adopts the following technical solutions:

第一方面,本发明提供一种基于神经网络的船舶升沉补偿预测方法,包括如下步骤:In a first aspect, the present invention provides a neural network-based ship heave compensation prediction method, which includes the following steps:

(1)获取船舶的一维时序历史升沉数据并进行降噪处理,将数据集按比例随机拆分为训练集和测试集;(1) Obtain the ship's one-dimensional time series historical heave data and perform noise reduction processing, and randomly split the data set into a training set and a test set in proportion;

(2)对平台位移一维时序历史升沉数据进行异常值检测并对异常值进行处理;(2) Detect outliers on the one-dimensional time series historical heave data of the platform displacement and process the outliers;

(3)将异常值处理后的一维时序数据进行时延处理,通过多个延时模块后经Mux模块转换为适用神经网络的向量形式,一同作为神经网络的一系列输入;延时模块的数量与采样时间点、预测时间点的数量有关;(3) Perform delay processing on the one-dimensional time series data after outlier processing, pass through multiple delay modules and then convert it into a vector form suitable for neural networks through the Mux module, and together serve as a series of inputs to the neural network; the delay module The number is related to the number of sampling time points and prediction time points;

(4)通过神经网络获取时间特征,然后与天牛群算法、warm-up的余弦退火算法特征融合,构建基于神经网络的特征学习模型并训练模型;(4) Acquire temporal features through the neural network, and then fuse them with the features of the beetle swarm algorithm and warm-up cosine annealing algorithm to build a feature learning model based on the neural network and train the model;

(5)对神经网络输出信号进行微分滤波处理输出结果,降低网络输出信号抖震问题,该结果作为升沉位移的预测结果。(5) Perform differential filtering on the neural network output signal to output the result to reduce the jitter problem of the network output signal. The result is used as the prediction result of the heave displacement.

优选的,步骤(1)还包括:对数据进行最大最小归一化,使数据映射到区间[-1,1]之间。Preferably, step (1) also includes: performing maximum and minimum normalization on the data to map the data to the interval [-1,1].

优选的,步骤(2)中,通过拉伊达准则检测异常值,设数据集X服从正态分布,则根据以下公式对异常值进行判断:Preferably, in step (2), outliers are detected through the Raida criterion. Assuming that the data set X obeys a normal distribution, the outliers are judged according to the following formula:

;

;

;

其中,x表示为数据集数据,x i 表示第i个数据,μ表示均值,δ表示标准差,n为样本数,拉伊达准则表明,如果x的值超过了(μ-3δμ+3δ)区间,将数据当作异常数据处理,并采用均值填充拉依达法则检测到的异常值。 Where , _ _ _ _ _ _ _ _ _ +3 δ ) interval, the data is treated as abnormal data, and the mean value is used to fill the outliers detected by Laida's rule.

优选的,神经网络为BP神经网络,步骤(4)包括如下步骤:Preferably, the neural network is a BP neural network, and step (4) includes the following steps:

对天牛种群算法进行参数初始化,随机设置天牛位置,以该天牛位置作为BP神经网络的初始化参数;Initialize the parameters of the beetle population algorithm, randomly set the beetle position, and use the beetle position as the initialization parameter of the BP neural network;

对天牛的须的朝向作随机向量并做归一化处理;Make a random vector and normalize the direction of the beetle's whiskers;

基于归一化处理结果创建天牛左右须与质心之间的坐标关系;Based on the normalization processing results, the coordinate relationship between the left and right whiskers and the center of mass of the beetle is created;

根据适应度函数确定天牛左右须的气味强度,该适应度函数基于输入的样本特征向量与神经元权值向量值之间的距离建立,计算天牛个体位置估计值;Determine the odor intensity of the beetle's left and right whiskers according to the fitness function. The fitness function is established based on the distance between the input sample feature vector and the neuron weight vector value, and calculates the individual position estimate of the beetle;

根据天牛种群中天牛个体的位置坐标,计算出天牛个体适应度和天牛种群平均适应度并进行比较;Based on the position coordinates of individual longhorned beetles in the longhorned beetle population, calculate the individual fitness of longhorned longhorned beetles and the average fitness of longhorned longhorned beetles and compare them;

建立天牛位置迭代更新方法,使用衰减策略更新最优天牛空间位置,利用warm-up的余弦退火算法并更新学习率;Establish an iterative update method for the beetle position, use the attenuation strategy to update the optimal spatial position of the beetle, and use the warm-up cosine annealing algorithm to update the learning rate;

根据最优解的位置形成符合自适应T分布的新解,更新最优天牛空间位置;Form a new solution that conforms to the adaptive T distribution based on the position of the optimal solution, and update the optimal spatial position of the beetle;

当适应度函数值达到设定精度或迭代到最大次数时,将天牛当前位置作为BP神经网络的参数取值。When the fitness function value reaches the set accuracy or the maximum number of iterations is reached, the current position of the beetle is used as the parameter value of the BP neural network.

优选的,BP神经网络包括输入层、隐含层和输出层,首先确定天牛群算法的搜索空间的维度DPreferably, the BP neural network includes an input layer, a hidden layer and an output layer. First, the dimension D of the search space of the longhorned swarm algorithm is determined:

;

式中,M为输入层的神经元个数,L为隐含层的神经元个数,O为输出层的神经元个数。本实例拓扑结构确定为M-L-O形式,其中M、L、O分别代表BP神经网络的输入层、隐含层、输出层的神经元个数与节点数。In the formula, M is the number of neurons in the input layer, L is the number of neurons in the hidden layer, and O is the number of neurons in the output layer. The topological structure of this example is determined to be in the form of MLO, where M, L, and O represent the number of neurons and nodes in the input layer, hidden layer, and output layer of the BP neural network respectively.

优选的,运用初始化后的BP神经网络进行升沉位移的拟合,得到船舶升沉位移的拟合值;将测试集升沉位移的拟合值和期望值的均方误差MSE作为天牛群算法的适应度函数推进算法的空间搜索,此值越小表明预测模型具有更好的准确度,公式表示为:Preferably, the initialized BP neural network is used to fit the heave displacement to obtain the fitted value of the ship's heave displacement; the mean square error MSE of the fitted value of the heave displacement of the test set and the expected value is used as the beetle swarm algorithm fitness function of Promote the spatial search of the algorithm. The smaller this value indicates that the prediction model has better accuracy. The formula is expressed as:

;

式中,y i 为升沉位移的拟合值,为升沉位移的期望值,在整个空间区域迭代寻优,使适应度函数值最小处即为空间最优解。In the formula, y i is the fitted value of heave displacement, is the expected value of heave displacement, and iterative optimization is performed in the entire space area, so that the place where the fitness function value is minimum is the space optimal solution.

优选的,设输入层M个节点的输入为x 1,x 2,…,x m ,则第L个隐含层节点输出为gLPreferably, assuming that the inputs of M nodes in the input layer are x 1 , x 2 ,..., x m , then the output of the L -th hidden layer node is g L :

;

式中:为隐含层权重,a L 为隐含层偏置,f 1为隐含层激活函数,设置f 1激活函数为Tanh函数,即/>In the formula: is the hidden layer weight, a L is the hidden layer bias, f 1 is the hidden layer activation function, and the f 1 activation function is set to be the Tanh function, that is, /> ;

输出层输出h为:The output layer output h is:

;

式中,为输出层权重,/>为输出层偏置;f 2为输出层激活函数,设置f 2激活函数为线性函数,即/>In the formula, is the output layer weight,/> is the output layer bias; f 2 is the output layer activation function, and the f 2 activation function is set to be a linear function, that is/> ;

根据测试集实际输出h与期望输出H,BP神经网络的误差确定为:According to the actual output h of the test set and the expected output H, the error of the BP neural network is determined as:

;

经BP神经网络的误差反向传播,权值阈值更新,根据误差E,从隐含层第L个神经元到输出层之间连接权值变化增量有如下公式:After the error back propagation of the BP neural network, the weight threshold is updated. According to the error E , the increment of the connection weight from the Lth neuron of the hidden layer to the output layer has the following formula:

;

式中:η为神经网络的学习率参数,以调节神经网络搜索最优权值的速度和振荡程度;In the formula: η is the learning rate parameter of the neural network to adjust the speed and degree of oscillation of the neural network in searching for optimal weights;

从隐含层第L个神经元到输出层之间阈值增量更新公式如下:The threshold incremental update formula from the Lth neuron of the hidden layer to the output layer is as follows:

;

根据误差E,从输入层第m个神经元到隐含层第L个神经元之间连接权值变化增量有如下公式:According to the error E , the increment of the connection weight from the m-th neuron in the input layer to the L -th neuron in the hidden layer has the following formula:

;

从输入层第m个神经元到隐含层第L神经元之间阈值增量更新公式如下:The threshold incremental update formula from the m-th neuron in the input layer to the L- th neuron in the hidden layer is as follows:

.

优选的,天牛群算法通过不断迭代寻找适应度函数最小时的最优天牛空间位置best X的过程如下:Preferably, the process of the beetle swarm algorithm to find the optimal beetle spatial position best X when the fitness function is minimized through continuous iteration is as follows:

S1:定义第k只天牛朝向的随机方向向量并作归一化处理:S1: Define the random direction vector of the k-th longhorned beetle. And perform normalization processing:

;

式中:D为搜索空间的维数,rands为随机数,为第k只天牛左右须探索随机单位向量,k∈1,2,3,…k,k为天牛种群规模;In the formula: D is the dimension of the search space, rands is a random number, Random unit vectors must be explored for the k-th longhorned beetle, k∈1, 2, 3,...k, k is the longhorned beetle population size;

S2:创建天牛左右须空间位置:S2: Create the spatial positions of the left and right beetles:

;

;

式中:为第k只天牛右须的空间位置,/>为第k只天牛左须的空间位置,分别表示第k只天牛第t次迭代天牛左、右须空间位置,/>为t次迭代时两须之间的距离;In the formula: is the spatial position of the kth beetle’s right whisker,/> is the spatial position of the left whisker of the k-th beetle, Respectively represent the spatial positions of the left and right whiskers of the k-th beetle in the t-th iteration,/> is the distance between the two whiskers at t iterations;

S3:计算左右两须适应度函数值和/>,并判断两者大小,更新天牛的空间位置为:S3: Calculate the fitness function values of the left and right whiskers and/> , and determine the size of the two, and update the spatial position of the beetle as:

;

式中:sign()为符号函数,c为学习因子,即运动步长和探索步长/>之间的比例系数,引入学习因子以增强天牛群和历史个体的记忆学习能力,/>为第k只天牛质心第t+1次迭代中位置估计值,该估计值由探索得到的两须适应度计算得到;In the formula: sign() is the sign function, c is the learning factor, that is, the movement step size and exploration step/> The proportional coefficient between them, and the learning factor is introduced to enhance the memory learning ability of longamis groups and historical individuals,/> is the position estimate of the k-th beetle centroid in the t+1 iteration, which is calculated from the fitness of the two whiskers obtained through exploration;

根据天牛群中天牛个体的坐标位置,利用适应度函数定义公式分别求得天牛个体适应度f与天牛群体平均适应度fag,比较两者的强度大小,并更新天牛个体的位置并计算在当前坐标位置下的适应度函数值;According to the coordinate position of individual longhorned beetles in the longhorned beetle group, the fitness function definition formula is used to calculate the individual longhorned beetle fitness f and the average fitness fag of the longhorned beetle group, compare the intensity of the two, and update the position of longhorned longhorned individuals. And calculate the fitness function value at the current coordinate position;

每个天牛的质心当且仅当种群最优值产生变化时进行更新,此时天牛探索步长保持不变;反之,天牛会将当前当种群最优值作为质心位置,使用衰减策略进行更新,当种群内所有天牛的质心完成估计之后,其群体最优值和步长由如下策略进行更新:The centroid of each beetle is updated when and only when the optimal value of the population changes. At this time, the beetle exploration step remains unchanged; otherwise, the beetle will use the current optimal value of the population as the center of mass position, using the attenuation strategy. Update, when the centroids of all beetles in the population are estimated, their group optimal values and step sizes are updated according to the following strategy:

;

;

式中:为天牛考虑群体极值之后更新的质心位置,该位置在无法取得比上次迭代更好的种群最优适应度时,维持自身个体的估计值不变,xg为最优位置状态,fg为最优适应度值;In the formula: The centroid position updated after considering the group extreme value for longhorn beetles. When this position cannot obtain a better optimal fitness of the population than the last iteration, the estimated value of its own individual remains unchanged. x g is the optimal position state, f g is the optimal fitness value;

S4:更新两须之间的步长和距离:S4: Update the step size and distance between the two whiskers:

;

;

;

式中,为初始步长,/>为规定t次搜索步长,/>为学习率最大值,/>为学习率最小值,/>是总迭代次数,/>为当前迭代次数,/>表示随机数;/>为概率阈值;In the formula, is the initial step size,/> To specify t search steps,/> is the maximum value of the learning rate,/> is the minimum value of the learning rate,/> is the total number of iterations,/> is the current number of iterations,/> Represents a random number;/> is the probability threshold;

通过warm-up的余弦退火算法并更新学习率,公式为:Through the warm-up cosine annealing algorithm and update the learning rate, the formula is:

;

式中,为初始学习率,/>表示为设置Warmup的迭代次数;In the formula, is the initial learning rate,/> Represented as setting the number of iterations of Warmup;

通过自适应T分布计算质心位置的新解:New solution for calculating center of mass position via adaptive T-distribution:

;

;

式中:为符合自适应分布的质心位置的新解,Max(t)为最大迭代次数,y(t)为自由度参数为迭代次数t的T分布,z、v为参数,根据具体情况取值;In the formula: It is a new solution that conforms to the centroid position of the adaptive distribution, Max(t) is the maximum number of iterations, y(t) is the T distribution with the degree of freedom parameter being the number of iterations t, z and v are parameters, and their values are taken according to the specific situation;

最后判断天牛群算法的适应度函数值是否达到设定的精度fbest或者迭代次数t是否超过最大迭代次数Max(t);Finally, it is judged whether the fitness function value of the beetle swarm algorithm reaches the set accuracy fbest or whether the number of iterations t exceeds the maximum number of iterations Max(t);

若满足条件,则停止迭代,将此时的天牛空间位置best X作为BP神经网络的最优初始权重,否则按S1-S4继续迭代;If the conditions are met, stop the iteration and use the best X of the beetle space position at this time as the optimal initial weight of the BP neural network. Otherwise, continue the iteration according to S1-S4;

S5:搜索结束,搜索得到的最佳质心坐标即为神经网络中神经元的权值和阈值,将其赋予BP神经网络,即S5: The search is over. The best centroid coordinates obtained by the search are the weights and thresholds of the neurons in the neural network, which are assigned to the BP neural network, that is

;

.

第二方面,本发明提供一种基于神经网络的船舶升沉补偿预测装置,包括:In a second aspect, the present invention provides a neural network-based ship heave compensation prediction device, including:

采集模块,用于获取船舶升沉位移数据并进行降噪处理;Acquisition module, used to obtain ship heave displacement data and perform noise reduction processing;

异常值处理模块,用于对船舶升沉位移数据进行异常值检测并对异常值进行处理;The outlier processing module is used to detect and process outliers in ship heave and displacement data;

延时模块,用于对船舶升沉位移数据作时延处理并与Mux模块转换为适用神经网络的向量形式;The delay module is used to perform delay processing on the ship's heave displacement data and convert it with the Mux module into a vector form suitable for neural networks;

特征学习模型构建模块,通过BP神经网络获取时间特征,然后与天牛群算法和warm-up的余弦退火算法进行特征融合,从而完成特征学习模型的构建;The feature learning model building module obtains temporal features through the BP neural network, and then performs feature fusion with the beetle swarm algorithm and warm-up cosine annealing algorithm to complete the construction of the feature learning model;

输出模块,对神经网络输出信号进行微分滤波处理并输出,该结果作为升沉位移的预测结果。The output module performs differential filtering on the neural network output signal and outputs it, and the result is used as the prediction result of the heave displacement.

第三方面,本发明提供一种可读存储介质,可读存储介质中存储有计算机程序,计算机程序包括用于控制过程以执行过程的程序代码,过程包括上述基于神经网络的船舶升沉补偿预测方法。In a third aspect, the present invention provides a readable storage medium. A computer program is stored in the readable storage medium. The computer program includes a program code for controlling a process to execute the process. The process includes the above-mentioned neural network-based ship heave compensation prediction. method.

本发明未详尽之处,均可采用现有技术。Where the present invention is not detailed, existing technologies can be used.

本发明的有益效果为:The beneficial effects of the present invention are:

1、与现有技术相比,本申请能够有效提高船舶升沉补偿的预测精度,同时在特征学习阶段提出的时序神经网络采取单隐含层,在不损失预测精度的同时避免多隐含层造成的梯度消失、梯度爆炸、过拟合现象。此外,本发明的算法模型具有较高的鲁棒性和泛化能力。1. Compared with the existing technology, this application can effectively improve the prediction accuracy of ship heave compensation. At the same time, the temporal neural network proposed in the feature learning stage uses a single hidden layer to avoid multiple hidden layers without losing prediction accuracy. The resulting gradient disappearance, gradient explosion, and overfitting phenomena. In addition, the algorithm model of the present invention has high robustness and generalization ability.

2、在面对海量数据集的情况下,采用人工处理的方式势必会造成工作量过大。因此,本发明选用拉依达准则检测异常值,该方法具有简单易行、相对精确以及适用性广泛的优点。2. In the face of massive data sets, manual processing will inevitably cause excessive workload. Therefore, the present invention uses the Laida criterion to detect outliers. This method has the advantages of being simple, relatively accurate, and widely applicable.

3、本发明通过时延处理,通过比较多种时延进行预测,选择适合算法模型的时长。3. The present invention uses delay processing to predict by comparing multiple delays, and selects a duration suitable for the algorithm model.

4、本发明利用时序神经网络获取时间特征,然后与天牛群算法、warm-up的余弦退火算法进行特征融合。在特征融合阶段,本发明中对神经网络的参数寻优方法采用天牛群算法替代传统的梯度下降算法,从而避免传统梯度下降算法容易产生的局部极值现象。引入warm-up的余弦退火算法替换固定学习率参数η,使误差函数能够可以更快地收敛到最优值。引入自适应T分布增强全局搜索和局部搜索能力。4. The present invention uses the sequential neural network to obtain time features, and then performs feature fusion with the beetle swarm algorithm and the warm-up cosine annealing algorithm. In the feature fusion stage, the present invention uses the beetle swarm algorithm to replace the traditional gradient descent algorithm as the parameter optimization method of the neural network, thereby avoiding the local extreme value phenomenon that is easily produced by the traditional gradient descent algorithm. The warm-up cosine annealing algorithm is introduced to replace the fixed learning rate parameter eta , so that the error function can converge to the optimal value faster. The adaptive T distribution is introduced to enhance global search and local search capabilities.

5、本发明在输出模块引入微分滤波处理,选择合适的滤波因子和速度因子等参数,避免出现较大的相位延迟和幅值缩减。5. The present invention introduces differential filtering processing into the output module, and selects appropriate parameters such as filter factors and speed factors to avoid large phase delays and amplitude reductions.

附图说明Description of drawings

图1为本发明船舶升沉补偿预测方法总体流程图;Figure 1 is an overall flow chart of the ship heave compensation prediction method of the present invention;

图2为本发明某一实施例的船舶升沉补偿预测方法流程图;Figure 2 is a flow chart of a ship heave compensation prediction method according to an embodiment of the present invention;

图3为本发明某一实施例的电子装置的硬件结构示意图;Figure 3 is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present invention;

图中,1-存储器,2-处理器,3-传输设备,4-输入输出设备。In the figure, 1-memory, 2-processor, 3-transmission device, 4-input and output device.

具体实施方式Detailed ways

为使本发明要解决的技术问题、技术方案和优点更加清楚,下面将结合附图及具体实施例进行详细描述,但不仅限于此,本发明未详尽说明的,均按本领域常规技术。In order to make the technical problems, technical solutions and advantages to be solved by the present invention clearer, a detailed description will be given below with reference to the accompanying drawings and specific embodiments, but it is not limited thereto. Anything that is not described in detail in the present invention is in accordance with conventional techniques in the art.

本发明的BP神经网络的输入为一列单变量基于时序的船舶升沉位移历史数据,本发明选取5个采样时间点对应1个预测时间点,因此需要4个延时模块,输出为一维的时间序列。The input of the BP neural network of the present invention is a sequence of univariate historical ship heave and displacement data based on time series. The present invention selects 5 sampling time points to correspond to 1 prediction time point, so 4 delay modules are required, and the output is one-dimensional. sequentially.

实施例1Example 1

一种基于神经网络的船舶升沉补偿预测方法,如图1所示,包括如下步骤:A neural network-based ship heave compensation prediction method, as shown in Figure 1, includes the following steps:

(1)获取船舶的一维时序历史升沉数据并进行降噪处理,将数据集按比例随机拆分为训练集和测试集;(1) Obtain the ship's one-dimensional time series historical heave data and perform noise reduction processing, and randomly split the data set into a training set and a test set in proportion;

在本实施例中,经传感器直接测量的船舶升沉信号由于含有大量的噪声,在进入控制器之前使用带通滤波器对所采集的传感器信号进行处理。但带通滤波器引起相位滞后,可将这部分一并进行时延处理。数据预处理可以减小噪音数据对实验结果的影响,便于实验效果的测量。因此,本申请将所用到的数据进行最大最小归一化,使数据映射到区间[-1,1]之间,如下式所示:In this embodiment, since the ship heave signal directly measured by the sensor contains a large amount of noise, a band-pass filter is used to process the collected sensor signal before entering the controller. However, the bandpass filter causes phase lag, and this part can be processed with time delay. Data preprocessing can reduce the impact of noise data on experimental results and facilitate the measurement of experimental effects. Therefore, this application performs maximum and minimum normalization on the data used so that the data is mapped to the interval [-1,1], as shown in the following formula:

;

其中,x是输入数据xmax是取最大输入数据值,xmin是取最小输入数据值,是归一化输出值。Among them, x is the input data, x max is the maximum input data value, x min is the minimum input data value, is the normalized output value.

(2)对平台位移一维时序历史升沉数据进行异常值检测并对异常值进行处理;(2) Detect outliers on the one-dimensional time series historical heave data of the platform displacement and process the outliers;

在本实施例中,采集到的数据有的要素值或大或小,明显偏离了实际情况,即所谓的异常值。但是,在面对海量数据集的情况下,采用人工处理的方式势必会造成工作量 过大。因此,本申请选用拉依达准则检测异常值,设数据集X服从正态分布,则根据以下公式对异常值进行判断:In this embodiment, some elements of the collected data have large or small values, which obviously deviate from the actual situation, which are so-called outliers. However, in the face of massive data sets, manual processing will inevitably cause excessive workload. Therefore, this application uses the Laida criterion to detect outliers. Assuming that the data set X obeys a normal distribution, the outliers are judged according to the following formula:

;

;

;

其中,x表示为数据集数据,x i 表示第i个数据,μ表示均值,δ表示标准差,n为样本数,拉伊达准则表明,如果x的值超过了(μ-3δμ+3δ)区间,将数据当作异常数据处理,并采用均值填充拉依达法则检测到的异常值。 Where , _ _ _ _ _ _ _ _ _ +3 δ ) interval, the data is treated as abnormal data, and the mean value is used to fill the outliers detected by Laida's rule.

(3)将异常值处理后的一维时序数据进行时延处理,通过多个延时模块后经Mux模块转换为适用神经网络的向量形式,一同作为神经网络的一系列输入;延时模块的数量与采样时间点、预测时间点的数量有关;(3) Perform delay processing on the one-dimensional time series data after outlier processing, pass through multiple delay modules and then convert it into a vector form suitable for neural networks through the Mux module, and together serve as a series of inputs to the neural network; the delay module The number is related to the number of sampling time points and prediction time points;

(4)通过神经网络获取时间特征,然后与天牛群算法、warm-up的余弦退火算法特征融合,构建基于神经网络的特征学习模型并训练模型,如图2所示;(4) Obtain time features through the neural network, and then fuse them with the features of the beetle swarm algorithm and warm-up cosine annealing algorithm to build a feature learning model based on the neural network and train the model, as shown in Figure 2;

神经网络为BP神经网络,步骤(4)包括如下步骤:The neural network is a BP neural network, and step (4) includes the following steps:

对天牛种群算法进行参数初始化,随机设置天牛位置,以该天牛位置作为BP神经网络的初始化参数;Initialize the parameters of the beetle population algorithm, randomly set the beetle position, and use the beetle position as the initialization parameter of the BP neural network;

对天牛的须的朝向作随机向量并做归一化处理;Make a random vector and normalize the direction of the beetle's whiskers;

基于归一化处理结果创建天牛左右须与质心之间的坐标关系;Based on the normalization processing results, the coordinate relationship between the left and right whiskers and the center of mass of the beetle is created;

根据适应度函数确定天牛左右须的气味强度,该适应度函数基于输入的样本特征向量与神经元权值向量值之间的距离建立,计算天牛个体位置估计值;Determine the odor intensity of the left and right beetles of the beetle according to the fitness function. The fitness function is established based on the distance between the input sample feature vector and the neuron weight vector value, and calculates the individual position estimate of the beetle;

根据天牛种群中天牛个体的位置坐标,计算出天牛个体适应度和天牛种群平均适应度并进行比较;According to the position coordinates of individual longhorned beetles in the longhorned beetle population, calculate the individual longhorned beetle fitness and the average fitness of the longhorned beetle population and compare them;

建立天牛位置迭代更新方法,使用衰减策略更新最优天牛空间位置,利用warm-up的余弦退火算法并更新学习率;Establish an iterative update method for the beetle position, use the attenuation strategy to update the optimal spatial position of the beetle, and use the warm-up cosine annealing algorithm to update the learning rate;

根据最优解的位置形成符合自适应T分布的新解,更新最优天牛空间位置;Form a new solution that conforms to the adaptive T distribution based on the position of the optimal solution, and update the optimal spatial position of the beetle;

当适应度函数值达到设定精度或迭代到最大次数时,将天牛当前位置作为BP神经网络的参数取值。When the fitness function value reaches the set accuracy or the maximum number of iterations is reached, the current position of the beetle is used as the parameter value of the BP neural network.

BP神经网络包括输入层、隐含层和输出层,首先确定天牛群算法的搜索空间的维度DThe BP neural network includes an input layer, a hidden layer and an output layer. First, the dimension D of the search space of the longhorned swarm algorithm is determined:

;

式中,M为输入层的神经元个数,L为隐含层的神经元个数,O为输出层的神经元个数。本实例拓扑结构确定为M-L-O形式,其中M、L、O分别代表BP神经网络的输入层、隐含层、输出层的神经元个数与节点数。In the formula, M is the number of neurons in the input layer, L is the number of neurons in the hidden layer, and O is the number of neurons in the output layer. The topological structure of this example is determined to be in the form of MLO, where M, L, and O represent the number of neurons and nodes in the input layer, hidden layer, and output layer of the BP neural network respectively.

运用初始化后的BP神经网络进行升沉位移的拟合,得到船舶升沉位移的拟合值;将测试集升沉位移的拟合值和期望值的均方误差MSE作为天牛群算法的适应度函数推进算法的空间搜索,此值越小表明预测模型具有更好的准确度,公式表示为:The initialized BP neural network is used to fit the heave displacement, and the fitted value of the ship's heave displacement is obtained; the mean square error MSE of the fitted value of the heave displacement of the test set and the expected value is used as the fitness of the beetle swarm algorithm function Promote the spatial search of the algorithm. The smaller this value indicates that the prediction model has better accuracy. The formula is expressed as:

;

式中,y i 为升沉位移的拟合值,为升沉位移的期望值,在整个空间区域迭代寻优,使适应度函数值最小处即为空间最优解。In the formula, y i is the fitted value of heave displacement, is the expected value of heave displacement, and iterative optimization is performed in the entire space area, so that the place where the fitness function value is minimum is the space optimal solution.

设输入层M个节点的输入为x 1,x 2,…,x m ,则第L个隐含层节点输出为gLAssume that the inputs of M nodes in the input layer are x 1 , x 2 ,..., x m , then the output of the L -th hidden layer node is g L :

;

式中:为隐含层权重,a L 为隐含层偏置,f 1为隐含层激活函数,设置f 1激活函数为Tanh函数,即/>In the formula: is the hidden layer weight, a L is the hidden layer bias, f 1 is the hidden layer activation function, and the f 1 activation function is set to be the Tanh function, that is, /> ;

输出层输出h为:The output layer output h is:

;

式中,为输出层权重,/>为输出层偏置;f 2为输出层激活函数,设置f 2激活函数为线性函数,即/>In the formula, is the output layer weight,/> is the output layer bias; f 2 is the output layer activation function, and the f 2 activation function is set to be a linear function, that is/> ;

根据测试集实际输出h与期望输出H,BP神经网络的误差确定为:According to the actual output h of the test set and the expected output H, the error of the BP neural network is determined as:

;

经BP神经网络的误差反向传播,权值阈值更新,根据误差E,从隐含层第L个神经元到输出层之间连接权值变化增量有如下公式:After the error back propagation of the BP neural network, the weight threshold is updated. According to the error E , the increment of the connection weight from the Lth neuron of the hidden layer to the output layer has the following formula:

;

式中:η为神经网络的学习率参数,以调节神经网络搜索最优权值的速度和振荡程度;In the formula: η is the learning rate parameter of the neural network to adjust the speed and degree of oscillation of the neural network in searching for optimal weights;

从隐含层第L个神经元到输出层之间阈值增量更新公式如下:The threshold incremental update formula from the Lth neuron of the hidden layer to the output layer is as follows:

;

根据误差E,从输入层第m个神经元到隐含层第L个神经元之间连接权值变化增量有如下公式:According to the error E , the increment of the connection weight from the m-th neuron in the input layer to the L -th neuron in the hidden layer has the following formula:

;

从输入层第m个神经元到隐含层第L神经元之间阈值增量更新公式如下:The threshold incremental update formula from the m-th neuron in the input layer to the L- th neuron in the hidden layer is as follows:

;

进一步的,天牛群算法通过不断迭代寻找适应度函数最小时的最优天牛空间位置best X的过程如下:Furthermore, the long-term beetle swarm algorithm uses continuous iterations to find the optimal long-term beetle spatial position best

S1:定义第k只天牛朝向的随机方向向量并作归一化处理:S1: Define the random direction vector of the k-th longhorned beetle. And perform normalization processing:

;

式中:D为搜索空间的维数,rands为随机数,为第k只天牛左右须探索随机单位向量,k∈1,2,3,…k,k为天牛种群规模;In the formula: D is the dimension of the search space, rands is a random number, Random unit vectors must be explored for the k-th longhorned beetle, k∈1, 2, 3,...k, k is the longhorned beetle population size;

S2:创建天牛左右须空间位置:S2: Create the spatial positions of the left and right beetles:

;

;

式中:为第k只天牛右须的空间位置,/>为第k只天牛左须的空间位置,分别表示第k只天牛第t次迭代天牛左、右须空间位置,/>为t次迭代时两须之间的距离;In the formula: is the spatial position of the kth beetle’s right whisker,/> is the spatial position of the left whisker of the k-th beetle, Respectively represent the spatial positions of the left and right whiskers of the k-th beetle in the t-th iteration,/> is the distance between the two whiskers at t iterations;

S3:计算左右两须适应度函数值和/>,并判断两者大小,更新天牛的空间位置为:S3: Calculate the fitness function values of the left and right whiskers and/> , and determine the size of the two, and update the spatial position of the beetle as:

;

式中:sign()为符号函数,c为学习因子,即运动步长和探索步长/>之间的比例系数,引入学习因子以增强天牛群和历史个体的记忆学习能力,/>为第k只天牛质心第t+1次迭代中位置估计值,该估计值由探索得到的两须适应度计算得到;In the formula: sign() is the sign function, c is the learning factor, that is, the movement step size and exploration step/> The proportional coefficient between them, and the learning factor is introduced to enhance the memory learning ability of longamis groups and historical individuals,/> is the position estimate of the k-th beetle centroid in the t+1 iteration, which is calculated from the fitness of the two whiskers obtained through exploration;

根据天牛群中天牛个体的坐标位置,利用适应度函数定义公式分别求得天牛个体适应度f与天牛群体平均适应度fag,比较两者的强度大小,并更新天牛个体的位置并计算在当前坐标位置下的适应度函数值;According to the coordinate position of individual longhorned beetles in the longhorned beetle group, the fitness function definition formula is used to calculate the individual longhorned beetle fitness f and the average fitness fag of the longhorned beetle group, compare the intensity of the two, and update the position of longhorned longhorned individuals. And calculate the fitness function value at the current coordinate position;

进一步的,每个天牛的质心当且仅当种群最优值产生变化时进行更新,此时天牛探索步长保持不变;反之,天牛会将当前当种群最优值作为质心位置,使用衰减策略进行更新,当种群内所有天牛的质心完成估计之后,其群体最优值和步长由如下策略进行更新:Furthermore, the centroid of each beetle is updated when and only when the optimal value of the population changes. At this time, the beetle exploration step remains unchanged; otherwise, the centroid will use the current optimal value of the population as the centroid position. Use the attenuation strategy to update. After the centroids of all beetles in the population are estimated, their group optimal values and step sizes are updated according to the following strategy:

;

;

式中:为天牛考虑群体极值之后更新的质心位置,该位置在无法取得比上次迭代更好的种群最优适应度时,维持自身个体的估计值不变,xg为最优位置状态,fg为最优适应度值;In the formula: The centroid position updated after considering the group extreme value for longhorn beetles. When this position cannot obtain a better optimal fitness of the population than the last iteration, the estimated value of its own individual remains unchanged. x g is the optimal position state, f g is the optimal fitness value;

S4:更新两须之间的步长和距离:S4: Update the step size and distance between the two whiskers:

;

;

;

式中,为初始步长,为/>规定t次搜索步长,/>为学习率最大值,/>为学习率最小值,/>是总迭代次数,/>为当前迭代次数,/>表示随机数;/>为概率阈值;本实施例提出了使用/>策略来产生一个概率阈值,当种群极值无法在当前探索中得到更新时,以概率阈值/>来进行步长衰减过程。/>不满足更新条件,天牛质心当前适应度函数值小于最优适应度时群体失去最优位置的概率。In the formula, is the initial step size, is/> Specify t search steps,/> is the maximum value of the learning rate,/> is the minimum value of the learning rate,/> is the total number of iterations,/> is the current number of iterations,/> Represents a random number;/> is the probability threshold; this embodiment proposes to use/> Strategy to generate a probability threshold. When the population extreme value cannot be updated in the current exploration, the probability threshold/> to perform the step decay process. /> The probability that the group loses its optimal position when the update condition is not met and the current fitness function value of the beetle centroid is less than the optimal fitness.

针对余弦退火算法初期变化剧烈问题,可以使模型先采用极小的学习率预热,学习率在预定的迭代次数下逐渐提高到退火阶段较大的初始学习率,使模型经历一个过渡训练过程,保证了模型训练的稳定性,通过warm-up的余弦退火算法并更新学习率,公式为:In order to solve the problem of drastic changes in the initial stage of the cosine annealing algorithm, the model can be preheated with a very small learning rate. The learning rate will gradually increase to a larger initial learning rate in the annealing stage under a predetermined number of iterations, allowing the model to undergo a transitional training process. The stability of model training is ensured, and the learning rate is updated through the warm-up cosine annealing algorithm. The formula is:

;

式中,为初始学习率,/>表示为设置Warmup的迭代次数;In the formula, is the initial learning rate,/> Represented as setting the number of iterations of Warmup;

自适应T分布是在T分布的基础上引入自适应参数,在最优解的位置附近形成符合自适应T分布 的新解可结合高斯分布和柯西分布的优点。在迭代前期取参数较大值,发挥柯西分布的优点,丰富种群多样性以提高全局搜索性能;在迭代中后期使用参数降低T分布对最优解的影响,显现高斯分布的优点,保留精英解以增强局部搜索的能力。通过自适应T分布计算质心位置的新解:The adaptive T distribution introduces adaptive parameters on the basis of the T distribution, and forms a new solution that conforms to the adaptive T distribution near the position of the optimal solution, which can combine the advantages of the Gaussian distribution and the Cauchy distribution. Use larger values for parameters in the early stages of the iteration to take advantage of the Cauchy distribution and enrich population diversity to improve global search performance; use parameters in the middle and later stages of the iteration to reduce the impact of the T distribution on the optimal solution, show the advantages of the Gaussian distribution, and retain the elite solution to enhance local search capabilities. New solution for calculating center of mass position via adaptive T-distribution:

;

;

式中:为符合自适应分布的质心位置的新解,Max(t)为最大迭代次数,y(t)为自由度参数为迭代次数t的T分布,z、v为参数,根据具体情况取值;In the formula: It is a new solution that conforms to the centroid position of the adaptive distribution, Max(t) is the maximum number of iterations, y(t) is the T distribution with the degree of freedom parameter being the number of iterations t, z and v are parameters, and their values are taken according to the specific situation;

最后判断天牛群算法的适应度函数值是否达到设定的精度fbest或者迭代次数t是否超过最大迭代次数Max(t);Finally, it is judged whether the fitness function value of the beetle swarm algorithm reaches the set accuracy fbest or whether the number of iterations t exceeds the maximum number of iterations Max(t);

若满足条件,则停止迭代,将此时的天牛空间位置best X作为BP神经网络的最优初始权重,否则按S1-S4继续迭代;If the conditions are met, stop the iteration and use the best X of the beetle space position at this time as the optimal initial weight of the BP neural network. Otherwise, continue the iteration according to S1-S4;

S5:搜索结束,搜索得到的最佳质心坐标即为神经网络中神经元的权值和阈值,将其赋予BP神经网络,即S5: The search is over. The best centroid coordinates obtained by the search are the weights and thresholds of the neurons in the neural network, which are assigned to the BP neural network, that is

;

;

本实施例得到的最佳质心坐标,作为BP神经网络中的初始权值和阈值进行训练。训练过程中,BP神经网络根据训练数据集不断调整权值和阈值,寻找最佳权值和阈值。The optimal centroid coordinates obtained in this embodiment are used as the initial weights and thresholds in the BP neural network for training. During the training process, the BP neural network continuously adjusts the weights and thresholds based on the training data set to find the best weights and thresholds.

(5)对神经网络输出信号进行微分滤波处理输出结果,降低网络输出信号抖震问题,该结果作为升沉位移的预测结果。(5) Perform differential filtering on the neural network output signal to output the result to reduce the jitter problem of the network output signal. The result is used as the prediction result of the heave displacement.

实施例2Example 2

一种基于神经网络的船舶升沉补偿预测装置,包括:A neural network-based ship heave compensation prediction device, including:

采集模块,用于获取船舶升沉位移数据并进行降噪处理;Acquisition module, used to obtain ship heave displacement data and perform noise reduction processing;

异常值处理模块,用于对船舶升沉位移数据进行异常值检测并对异常值进行处理;The outlier processing module is used to detect and process outliers in ship heave and displacement data;

延时模块,用于对船舶升沉位移数据作时延处理并与Mux模块转换为适用神经网络的向量形式;The delay module is used to perform delay processing on the ship's heave displacement data and convert it with the Mux module into a vector form suitable for neural networks;

特征学习模型构建模块,通过BP神经网络获取时间特征,然后与天牛群算法和warm-up的余弦退火算法进行特征融合,从而完成特征学习模型的构建;The feature learning model building module obtains temporal features through the BP neural network, and then performs feature fusion with the beetle swarm algorithm and warm-up cosine annealing algorithm to complete the construction of the feature learning model;

输出模块,对神经网络输出信号进行微分滤波处理并输出,该结果作为升沉位移的预测结果。The output module performs differential filtering on the neural network output signal and outputs it, and the result is used as the prediction result of the heave displacement.

实施例3Example 3

一种电子装置,包括存储器1和处理器2,存储器1中存储有计算机程序,处理器2被设置为运行计算机程序以执行上述基于神经网络的船舶升沉补偿预测方法。An electronic device includes a memory 1 and a processor 2. A computer program is stored in the memory 1, and the processor 2 is configured to run the computer program to execute the above-mentioned neural network-based ship heave compensation prediction method.

具体地,上述处理器2可以是一种集成电路芯片,具有信号处理能力。在实现过程中,实施例1的各步骤可以通过处理器中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器可以是通用处理器、数字信号处理器DSP、专用集成电路ASIC、现场可编程门阵列FPGA或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例1中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。或者可以被配置成实施本申请实施例的一个或多个集成电路。Specifically, the above-mentioned processor 2 may be an integrated circuit chip with signal processing capabilities. During the implementation process, each step of Embodiment 1 can be completed by instructions in the form of hardware integrated logic circuits or software in the processor. The above-mentioned processor may be a general-purpose processor, a digital signal processor DSP, an application-specific integrated circuit ASIC, a field programmable gate array FPGA or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. Each method, step and logical block diagram disclosed in Embodiment 1 of this application can be implemented or executed. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc. Or one or more integrated circuits may be configured to implement embodiments of the present application.

其中,存储器1可以包括用于数据或指令的大容量存储器。举例来说而非限制,存储器1可包括硬盘驱动器(HDD)、软盘驱动器、固态驱动器(SSD)、闪存、光盘、磁光盘、磁带或通用串行总线(USB)驱动器或者两个或更多个以上这些的组合。在合适的情况下,存储器1可包括可移除或不可移除(或固定)的介质。在合适的情况下,存储器1可在数据处理装置的内部或外部。在特定实施例中,存储器1是非易失性存储器。在特定实施例中,存储器1包括只读存储器(ROM)和随机存取存储器(RAM)。在合适的情况下,该ROM可以是掩模编程的ROM、可编程ROM(PROM)、可擦除PROM (EPROM)、电可擦除PROM(EEPROM)、电可改写ROM (EAROM)或闪存(FLASH)或者两个或更多个以上这些的组合。在合适的情况下,该RAM可以是静态随机存取存储器(SRAM)或动态随机存取存储器(DRAM),其中,DRAM可以是快速页模式动态随机存取存储器(FPMDRAM)、扩展数据输出动态随机存取存储器(EDOD RAM)、同步动态随机存取内存(SDRAM)等。Among them, the memory 1 may include large-capacity memory for data or instructions. By way of example and not limitation, the memory 1 may include a hard disk drive (HDD), a floppy disk drive, a solid state drive (SSD), flash memory, an optical disk, a magneto-optical disk, a magnetic tape or a universal serial bus (USB) drive, or two or more A combination of the above. Where appropriate, memory 1 may comprise removable or non-removable (or fixed) media. Where appropriate, the memory 1 may be internal or external to the data processing device. In a particular embodiment, memory 1 is a non-volatile memory. In a particular embodiment, memory 1 includes read only memory (ROM) and random access memory (RAM). Where appropriate, the ROM may be a mask-programmed ROM, programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), electrically rewritable ROM (EAROM) or flash memory ( FLASH) or a combination of two or more of these. Where appropriate, the RAM can be static random access memory (SRAM) or dynamic random access memory (DRAM), where DRAM can be fast page mode dynamic random access memory (FPMDRAM), extended data output dynamic random access memory (FPMDRAM), or extended data output dynamic random access memory (DRAM). access memory (EDOD RAM), synchronous dynamic random access memory (SDRAM), etc.

存储器1可以用来存储或者缓存需要处理和/或通信使用的各种数据文件,以及处理器2所执行的可能的计算机程序指令。The memory 1 may be used to store or cache various data files required for processing and/or communication, as well as possible computer program instructions executed by the processor 2 .

处理器2通过读取并执行存储器1中存储的计算机程序指令,以实现上述实施例中的任意基于神经网络的船舶升沉补偿预测方法。The processor 2 reads and executes the computer program instructions stored in the memory 1 to implement any neural network-based ship heave compensation prediction method in the above embodiments.

可选地,上述电子装置还可以包括传输设备3以及输入输出设备4,其中,该传输设备3和处理器2连接,该输入输出设备4和处理器2连接。Optionally, the above-mentioned electronic device may also include a transmission device 3 and an input-output device 4, wherein the transmission device 3 is connected to the processor 2, and the input-output device 4 is connected to the processor 2.

传输设备3可以用来经由一个网络接收或者发送数据。上述的网络具体实例可包括电子装置的通信供应商提供的有线或无线网络。在一个实例中,传输设备包括一个网络适配器(NIC),其可通过基站与其他网络设备相连从而可与互联网进行通讯。在一个实例中,传输设备3可以为射频(RF)模块,其用于通过无线方式与互联网进行通讯。The transmission device 3 can be used to receive or send data via a network. Specific examples of the above-mentioned network may include a wired or wireless network provided by a communication provider of the electronic device. In one example, the transmission device includes a network adapter (NIC), which is connected to other network devices through a base station to communicate with the Internet. In one example, the transmission device 3 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

输入输出设备4用于输入或输出信息。在本实施例中,输入的信息可以是船舶升沉位移数据等,输出的信息可以是船舶升沉位移预测结果等。The input and output device 4 is used to input or output information. In this embodiment, the input information may be ship heave displacement data, etc., and the output information may be ship heave displacement prediction results, etc.

实施例4Example 4

一种可读存储介质,可读存储介质中存储有计算机程序,计算机程序包括用于控制过程以执行过程的程序代码,过程包括上述基于神经网络的船舶升沉补偿预测方法。A readable storage medium. A computer program is stored in the readable storage medium. The computer program includes a program code for controlling a process to execute a process. The process includes the above-mentioned neural network-based ship heave compensation prediction method.

以上所述是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明所述原理的前提下,还可以作出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。The above is the preferred embodiment of the present invention. It should be pointed out that for those of ordinary skill in the art, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications can also be made. should be regarded as the protection scope of the present invention.

Claims (8)

1.一种基于神经网络的船舶升沉补偿预测方法,其特征在于,包括如下步骤:1. A neural network-based prediction method for ship heave compensation, which is characterized by including the following steps: (1)获取船舶的一维时序历史升沉数据并进行降噪处理,将数据集按比例随机拆分为训练集和测试集;(1) Obtain the one-dimensional time series historical heave data of the ship and perform noise reduction processing, and randomly split the data set into a training set and a test set in proportion; (2)对平台位移一维时序历史升沉数据进行异常值检测并对异常值进行处理;(2) Detect outliers on the one-dimensional time series historical heave data of the platform displacement and process the outliers; (3)将异常值处理后的一维时序数据进行时延处理,通过多个延时模块后经Mux模块转换为适用神经网络的向量形式,一同作为神经网络的一系列输入;(3) Perform delay processing on the one-dimensional time series data after outlier processing, pass through multiple delay modules and then convert it into a vector form suitable for neural networks through the Mux module, and together serve as a series of inputs to the neural network; (4)通过神经网络获取时间特征,然后与天牛群算法、warm-up的余弦退火算法特征融合,构建基于神经网络的特征学习模型并训练模型;(4) Acquire temporal features through the neural network, and then fuse them with the features of the beetle swarm algorithm and warm-up cosine annealing algorithm to build a feature learning model based on the neural network and train the model; 神经网络为BP神经网络,步骤(4)包括如下步骤:The neural network is a BP neural network, and step (4) includes the following steps: 对天牛种群算法进行参数初始化,随机设置天牛位置,以该天牛位置作为BP神经网络的初始化参数;Initialize the parameters of the beetle population algorithm, randomly set the beetle position, and use the beetle position as the initialization parameter of the BP neural network; 对天牛的须的朝向作随机向量并做归一化处理;Make a random vector and normalize the direction of the beetle's whiskers; 基于归一化处理结果创建天牛左右须与质心之间的坐标关系;Based on the normalization processing results, the coordinate relationship between the left and right whiskers and the center of mass of the beetle is created; 根据适应度函数确定天牛左右须的气味强度,该适应度函数基于输入的样本特征向量与神经元权值向量值之间的距离建立,计算天牛个体位置估计值;Determine the odor intensity of the beetle's left and right whiskers according to the fitness function. The fitness function is established based on the distance between the input sample feature vector and the neuron weight vector value, and calculates the individual position estimate of the beetle; 根据天牛种群中天牛个体的位置坐标,计算出天牛个体适应度和天牛种群平均适应度并进行比较;Based on the position coordinates of individual longhorned beetles in the longhorned beetle population, calculate the individual fitness of longhorned longhorned beetles and the average fitness of longhorned longhorned beetles and compare them; 建立天牛位置迭代更新方法,使用衰减策略更新最优天牛空间位置,利用warm-up的余弦退火算法并更新学习率;Establish an iterative update method for the beetle position, use the attenuation strategy to update the optimal spatial position of the beetle, and use the warm-up cosine annealing algorithm to update the learning rate; 根据最优解的位置形成符合自适应T分布的新解,更新最优天牛空间位置;Form a new solution that conforms to the adaptive T distribution based on the position of the optimal solution, and update the optimal spatial position of the beetle; 当适应度函数值达到设定精度或迭代到最大次数时,将天牛当前位置作为BP神经网络的参数取值;When the fitness function value reaches the set accuracy or the maximum number of iterations is reached, the current position of the beetle is used as the parameter value of the BP neural network; (5)对神经网络输出信号进行微分滤波处理输出结果,该结果作为升沉位移的预测结果。(5) Perform differential filtering on the neural network output signal to output the result, which is used as the prediction result of heave displacement. 2.根据权利要求1所述的基于神经网络的船舶升沉补偿预测方法,其特征在于,步骤(1)还包括:对数据进行最大最小归一化,使数据映射到区间[-1,1]之间。2. The neural network-based ship heave compensation prediction method according to claim 1, characterized in that step (1) also includes: performing maximum and minimum normalization on the data to map the data to the interval [-1,1 ]between. 3.根据权利要求2所述的基于神经网络的船舶升沉补偿预测方法,其特征在于,步骤(2)中,通过拉伊达准则检测异常值,设数据集X服从正态分布,则根据以下公式对异常值进行判断:3. The neural network-based ship heave compensation prediction method according to claim 2, characterized in that in step (2), abnormal values are detected through the Raida criterion. Assuming that the data set X obeys the normal distribution, then according to The following formula determines outliers: ; ; ; 其中,x表示为数据集数据,x i 表示第i个数据,μ表示均值,δ表示标准差,n为样本数,如果x的值超过了(μ-3δμ+3δ)区间,将数据当作异常数据处理,并采用均值填充拉依达法则检测到的异常值。Among them, x represents the data set data, x i represents the i- th data, μ represents the mean, δ represents the standard deviation, and n is the number of samples. If the value of x exceeds the ( μ -3 δ , μ +3 δ ) interval, Treat the data as outliers and use the mean to fill in the outliers detected by Laida's rule. 4.根据权利要求3所述的基于神经网络的船舶升沉补偿预测方法,其特征在于,BP神经网络包括输入层、隐含层和输出层,首先确定天牛群算法的搜索空间的维度D4. The neural network-based ship heave compensation prediction method according to claim 3, characterized in that the BP neural network includes an input layer, a hidden layer and an output layer, and first determines the dimension D of the search space of the beetle swarm algorithm. : ; 式中,M为输入层的神经元个数,L为隐含层的神经元个数,O为输出层的神经元个数;In the formula, M is the number of neurons in the input layer, L is the number of neurons in the hidden layer, and O is the number of neurons in the output layer; 运用初始化后的BP神经网络进行升沉位移的拟合,得到船舶升沉位移的拟合值;将测试集升沉位移的拟合值和期望值的均方误差MSE作为天牛群算法的适应度函数推进算法的空间搜索,公式表示为:The initialized BP neural network is used to fit the heave displacement, and the fitted value of the ship's heave displacement is obtained; the mean square error MSE of the fitted value of the heave displacement of the test set and the expected value is used as the fitness of the beetle swarm algorithm function The spatial search of the advancement algorithm is expressed as: ; 式中,y i 为升沉位移的拟合值,为升沉位移的期望值,在整个空间区域迭代寻优,使适应度函数值最小处即为空间最优解。In the formula, y i is the fitting value of heave displacement, is the expected value of heave displacement, and iterative optimization is performed in the entire space area, so that the place where the fitness function value is minimum is the space optimal solution. 5.根据权利要求4所述的基于神经网络的船舶升沉补偿预测方法,其特征在于,设输入层M个节点的输入为x 1,x 2,…,x m ,则第L个隐含层节点输出为gL5. The neural network-based ship heave compensation prediction method according to claim 4, characterized in that assuming that the inputs of M nodes in the input layer are x 1 , x 2 ,..., x m , then the Lth implicit The layer node output is g L : ; 式中:为隐含层权重,a L 为隐含层偏置,f 1为隐含层激活函数,设置f 1激活函数为Tanh函数,即/>In the formula: is the hidden layer weight, a L is the hidden layer bias, f 1 is the hidden layer activation function, and the f 1 activation function is set to be the Tanh function, that is, /> ; 输出层输出h为:The output layer output h is: ; 式中,为输出层权重,/>为输出层偏置;f 2为输出层激活函数,设置f 2激活函数为线性函数,即/>In the formula, is the output layer weight,/> is the output layer bias; f 2 is the output layer activation function, and the f 2 activation function is set to be a linear function, that is/> ; 根据测试集实际输出h与期望输出H,BP神经网络的误差确定为:According to the actual output h of the test set and the expected output H, the error of the BP neural network is determined as: ; 经BP神经网络的误差反向传播,权值阈值更新,根据误差E,从隐含层第L个神经元到输出层之间连接权值变化增量有如下公式:After the error back propagation of the BP neural network, the weight threshold is updated. According to the error E , the increment of the connection weight from the Lth neuron of the hidden layer to the output layer has the following formula: ; 式中:为神经网络的学习率参数;In the formula: is the learning rate parameter of the neural network; 从隐含层第L个神经元到输出层之间阈值增量更新公式如下:The threshold incremental update formula from the Lth neuron of the hidden layer to the output layer is as follows: ; 根据误差E,从输入层第m个神经元到隐含层第L个神经元之间连接权值变化增量有如下公式:According to the error E , the increment of the connection weight from the m-th neuron in the input layer to the L -th neuron in the hidden layer has the following formula: ; 从输入层第m个神经元到隐含层第L神经元之间阈值增量更新公式如下:The threshold incremental update formula from the m-th neuron in the input layer to the L- th neuron in the hidden layer is as follows: . 6.根据权利要求5所述的基于神经网络的船舶升沉补偿预测方法,其特征在于,天牛群算法通过不断迭代寻找适应度函数最小时的最优天牛空间位置best X的过程如下:6. The neural network-based ship heave compensation prediction method according to claim 5, characterized in that the process of the beetle swarm algorithm to find the optimal beetle spatial position best X when the fitness function is minimized through continuous iteration is as follows: S1:定义第k只天牛朝向的随机方向向量并作归一化处理:S1: Define the random direction vector of the k-th longhorned beetle. And perform normalization processing: ; 式中:D为搜索空间的维数,rands为随机数,为第k只天牛左右须探索随机单位向量,k∈1,2,3,…k,k为天牛种群规模;In the formula: D is the dimension of the search space, rands is a random number, Random unit vectors must be explored for the k-th longhorned beetle, k∈1, 2, 3,...k, k is the longhorned beetle population size; S2:创建天牛左右须空间位置:S2: Create the spatial positions of the left and right beetles: ; ; 式中:为第k只天牛右须的空间位置,/>为第k只天牛左须的空间位置,/>分别表示第k只天牛第t次迭代天牛左、右须空间位置,/>为t次迭代时两须之间的距离;In the formula: is the spatial position of the kth beetle’s right whisker,/> is the spatial position of the left whisker of the k-th beetle,/> Respectively represent the spatial positions of the left and right whiskers of the k-th beetle in the t-th iteration,/> is the distance between the two whiskers at t iterations; S3:计算左右两须适应度函数值和/>,并判断两者大小,更新天牛的空间位置为:S3: Calculate the fitness function values of the left and right whiskers and/> , and determine the size of the two, and update the spatial position of the beetle as: ; 式中:sign()为符号函数,c为学习因子,即运动步长和探索步长/>之间的比例系数,为第k只天牛质心第t+1次迭代中位置估计值;In the formula: sign() is the sign function, c is the learning factor, that is, the movement step size and exploration step/> the proportional coefficient between is the position estimate of the kth beetle centroid in the t+1 iteration; 根据天牛群中天牛个体的坐标位置,利用适应度函数定义公式分别求得天牛个体适应度f与天牛群体平均适应度fag,比较两者的强度大小,并更新天牛个体的位置并计算在当前坐标位置下的适应度函数值;According to the coordinate position of individual longhorned beetles in the longhorned beetle group, the fitness function definition formula is used to calculate the individual longhorned beetle fitness f and the average fitness fag of the longhorned beetle group, compare the intensity of the two, and update the position of longhorned longhorned individuals. And calculate the fitness function value at the current coordinate position; 每个天牛的质心当且仅当种群最优值产生变化时进行更新,此时天牛探索步长保持不变;反之,天牛会将当前当种群最优值作为质心位置,使用衰减策略进行更新,当种群内所有天牛的质心完成估计之后,其群体最优值和步长由如下策略进行更新:The centroid of each beetle is updated when and only when the optimal value of the population changes. At this time, the beetle exploration step remains unchanged; otherwise, the beetle will use the current optimal value of the population as the center of mass position, using the attenuation strategy. Update, when the centroids of all beetles in the population are estimated, their group optimal values and step sizes are updated according to the following strategy: ; ; 式中:为天牛考虑群体极值之后更新的质心位置,该位置在无法取得比上次迭代更好的种群最优适应度时,维持自身个体的估计值不变,xg为最优位置状态,fg为最优适应度值;In the formula: The centroid position updated after considering the group extreme value for longhorn beetles. When this position cannot obtain a better optimal fitness of the population than the last iteration, the estimated value of its own individual remains unchanged. x g is the optimal position state, f g is the optimal fitness value; S4:更新两须之间的步长和距离:S4: Update the step length and distance between the two whiskers: ; ; ; 式中,为初始步长,/>为规定t次搜索步长,/>为学习率最大值,/>为学习率最小值,/>是总迭代次数,/>为当前迭代次数,/>表示随机数;/>为概率阈值;In the formula, is the initial step size,/> To specify t search steps,/> is the maximum value of the learning rate,/> is the minimum value of the learning rate,/> is the total number of iterations,/> is the current number of iterations,/> Represents a random number;/> is the probability threshold; 通过warm-up的余弦退火算法并更新学习率,公式为:Through the warm-up cosine annealing algorithm and update the learning rate, the formula is: ; 式中,为初始学习率,/>表示为设置Warmup的迭代次数;In the formula, is the initial learning rate,/> Represented as setting the number of iterations of Warmup; 通过自适应T分布计算质心位置的新解:New solution for calculating center of mass position via adaptive T-distribution: ; ; 式中:为符合自适应分布的质心位置的新解,Max(t)为最大迭代次数,y(t)为自由度参数为迭代次数t的T分布,z、v为参数;In the formula: It is a new solution that conforms to the centroid position of the adaptive distribution, Max(t) is the maximum number of iterations, y(t) is the T distribution whose degree of freedom parameter is the number of iterations t, z, v are parameters; 最后判断天牛群算法的适应度函数值是否达到设定的精度fbest或者迭代次数t是否超过最大迭代次数Max(t);Finally, it is judged whether the fitness function value of the beetle swarm algorithm reaches the set accuracy fbest or whether the number of iterations t exceeds the maximum number of iterations Max(t); 若满足条件,则停止迭代,将此时的天牛空间位置best X作为BP神经网络的最优初始权重,否则按S1-S4继续迭代;If the conditions are met, stop the iteration and use the best X of the beetle space position at this time as the optimal initial weight of the BP neural network. Otherwise, continue the iteration according to S1-S4; S5:搜索结束,搜索得到的最佳质心坐标即为神经网络中神经元的权值和阈值,将其赋予BP神经网络,即S5: The search is over. The best centroid coordinates obtained by the search are the weights and thresholds of the neurons in the neural network, which are assigned to the BP neural network, that is ; . 7.一种基于神经网络的船舶升沉补偿预测装置,其特征在于,包括:7. A neural network-based ship heave compensation prediction device, characterized by including: 采集模块,用于获取船舶升沉位移数据并进行降噪处理;Acquisition module, used to obtain ship heave displacement data and perform noise reduction processing; 异常值处理模块,用于对船舶升沉位移数据进行异常值检测并对异常值进行处理;The outlier processing module is used to detect and process outliers in ship heave and displacement data; 延时模块,用于对船舶升沉位移数据作时延处理并与Mux模块转换为适用神经网络的向量形式;The delay module is used to perform delay processing on the ship's heave displacement data and convert it with the Mux module into a vector form suitable for neural networks; 特征学习模型构建模块,通过BP神经网络获取时间特征,然后与天牛群算法和warm-up的余弦退火算法进行特征融合,从而完成特征学习模型的构建;神经网络为BP神经网络,特征融合过程为:The feature learning model building module obtains temporal features through the BP neural network, and then performs feature fusion with the beetle swarm algorithm and warm-up cosine annealing algorithm to complete the construction of the feature learning model; the neural network is a BP neural network, and the feature fusion process for: 对天牛种群算法进行参数初始化,随机设置天牛位置,以该天牛位置作为BP神经网络的初始化参数;Initialize the parameters of the beetle population algorithm, randomly set the beetle position, and use the beetle position as the initialization parameter of the BP neural network; 对天牛的须的朝向作随机向量并做归一化处理;Make a random vector and normalize the direction of the beetle's whiskers; 基于归一化处理结果创建天牛左右须与质心之间的坐标关系;Based on the normalization processing results, the coordinate relationship between the left and right whiskers and the center of mass of the beetle is created; 根据适应度函数确定天牛左右须的气味强度,该适应度函数基于输入的样本特征向量与神经元权值向量值之间的距离建立,计算天牛个体位置估计值;Determine the odor intensity of the beetle's left and right whiskers according to the fitness function. The fitness function is established based on the distance between the input sample feature vector and the neuron weight vector value, and calculates the individual position estimate of the beetle; 根据天牛种群中天牛个体的位置坐标,计算出天牛个体适应度和天牛种群平均适应度并进行比较;Based on the position coordinates of individual longhorned beetles in the longhorned beetle population, calculate the individual fitness of longhorned longhorned beetles and the average fitness of longhorned longhorned beetles and compare them; 建立天牛位置迭代更新方法,使用衰减策略更新最优天牛空间位置,利用warm-up的余弦退火算法并更新学习率;Establish an iterative update method for the beetle position, use the attenuation strategy to update the optimal spatial position of the beetle, and use the warm-up cosine annealing algorithm to update the learning rate; 根据最优解的位置形成符合自适应T分布的新解,更新最优天牛空间位置;Form a new solution that conforms to the adaptive T distribution based on the position of the optimal solution, and update the optimal spatial position of the beetle; 当适应度函数值达到设定精度或迭代到最大次数时,将天牛当前位置作为BP神经网络的参数取值;When the fitness function value reaches the set accuracy or the maximum number of iterations is reached, the current position of the beetle is used as the parameter value of the BP neural network; 输出模块,对神经网络输出信号进行微分滤波处理并输出,该结果作为升沉位移的预测结果。The output module performs differential filtering on the neural network output signal and outputs it, and the result is used as the prediction result of the heave displacement. 8.一种可读存储介质,其特征在于,可读存储介质中存储有计算机程序,计算机程序包括用于控制过程以执行过程的程序代码,过程包括根据权利要求1~6任一所述的基于神经网络的船舶升沉补偿预测方法。8. A readable storage medium, characterized in that a computer program is stored in the readable storage medium, and the computer program includes a program code for controlling a process to execute the process, and the process includes a method according to any one of claims 1 to 6. Ship heave compensation prediction method based on neural network.
CN202311616443.9A 2023-11-30 2023-11-30 Ship heave compensation prediction method, device and storage medium based on neural network Active CN117312783B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311616443.9A CN117312783B (en) 2023-11-30 2023-11-30 Ship heave compensation prediction method, device and storage medium based on neural network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311616443.9A CN117312783B (en) 2023-11-30 2023-11-30 Ship heave compensation prediction method, device and storage medium based on neural network

Publications (2)

Publication Number Publication Date
CN117312783A CN117312783A (en) 2023-12-29
CN117312783B true CN117312783B (en) 2024-02-06

Family

ID=89285202

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311616443.9A Active CN117312783B (en) 2023-11-30 2023-11-30 Ship heave compensation prediction method, device and storage medium based on neural network

Country Status (1)

Country Link
CN (1) CN117312783B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116170348A (en) * 2023-03-09 2023-05-26 上海奥朋医疗科技有限公司 Method, system, medium and equipment for predicting communication delay of remote surgical robot
CN119001458A (en) * 2024-08-09 2024-11-22 山东东达机电有限责任公司 Method for predicting battery SOC based on BP neural network algorithm
CN119717511B (en) * 2024-12-11 2025-09-12 哈尔滨工业大学(深圳)(哈尔滨工业大学深圳科技创新研究院) Disturbance estimation and compensation method for Mars powered descent based on deep operator neural network

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2002073475A1 (en) * 2001-03-08 2002-09-19 California Institute Of Technology Exception analysis for multimissions
EP1752898A2 (en) * 2001-03-08 2007-02-14 California Institute Of Technology Exception analysis for multimissions
CN116110234A (en) * 2023-04-11 2023-05-12 城云科技(中国)有限公司 Traffic flow prediction method and device based on artificial intelligence and application of traffic flow prediction method and device
WO2023168916A1 (en) * 2022-03-08 2023-09-14 太原理工大学 Neural network model optimization method based on stainless steel ultra-thin strip annealing process

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10637788B2 (en) * 2018-06-26 2020-04-28 International Business Machines Corporation Stability of delay-based congestion control in a computer network using an alpha-beta filter and round-trip-time predictor

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2002073475A1 (en) * 2001-03-08 2002-09-19 California Institute Of Technology Exception analysis for multimissions
EP1752898A2 (en) * 2001-03-08 2007-02-14 California Institute Of Technology Exception analysis for multimissions
WO2023168916A1 (en) * 2022-03-08 2023-09-14 太原理工大学 Neural network model optimization method based on stainless steel ultra-thin strip annealing process
CN116110234A (en) * 2023-04-11 2023-05-12 城云科技(中国)有限公司 Traffic flow prediction method and device based on artificial intelligence and application of traffic flow prediction method and device

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
基于改进天牛群算法的微电网优化调度;王怡云;吴雷;;电子测量技术(16);全文 *
基于改进天牛须搜索算法优化LSSVM短期电力负荷预测方法研究;闫重熙;陈皓;;电测与仪表(06);全文 *
智能电力设备关键技术及运维探讨;赵仕策;赵洪山;寿佩瑶;;电力系统自动化(20);全文 *

Also Published As

Publication number Publication date
CN117312783A (en) 2023-12-29

Similar Documents

Publication Publication Date Title
CN117312783B (en) Ship heave compensation prediction method, device and storage medium based on neural network
CN116822381B (en) An artificial intelligence-based ocean temperature and salt structure inversion method
CN107253195B (en) A kind of carrying machine human arm manipulation ADAPTIVE MIXED study mapping intelligent control method and system
CN107121679A (en) Recognition with Recurrent Neural Network predicted method and memory unit structure for Radar Echo Extrapolation
CN110826195A (en) Wave compensation control algorithm based on ant colony optimization BP neural network
TW201835788A (en) Method and apparatus for multidimensional sequence prediction
CN110222387B (en) Multi-element drilling time sequence prediction method based on mixed leaky integration CRJ network
CN114548591A (en) A time series data prediction method and system based on hybrid deep learning model and stacking
CN114492217B (en) Typhoon and wave height prediction method based on mixed time series perceptron model
CN115035336B (en) Fault diagnosis method for three-level T-type inverter based on GASF and CNN
CN116781346A (en) Convolution two-way long-term and short-term memory network intrusion detection method based on data enhancement
CN114859899A (en) Actor-critic stability reinforcement learning method for navigation obstacle avoidance of mobile robot
CN111105442B (en) Switching type target tracking method
CN109800517B (en) Improved reverse modeling method for magnetorheological damper
CN112784140A (en) Search method of high-energy-efficiency neural network architecture
CN118227448B (en) Large language model system load prediction method based on deep learning
CN115860056A (en) A Sensor Array Neural Network Method for Concentration Prediction of Mixed Gases
CN114819053A (en) Average wave direction forecast deviation correction method based on space-time convolution LSTM
CN116432832A (en) Water quality prediction method based on XGBoost-LSTM prediction model
CN114781692A (en) Short-term power load forecasting method, device and electronic equipment
CN113283183A (en) Waste slag dam deformation prediction method based on DPSO-ANFIS
CN120234763A (en) A wind speed and direction prediction method based on improved TCN-LSTM
CN111401515A (en) A method for building incremental LSTMs using training process compression and memory consolidation
CN114995106A (en) PID self-tuning method, device and equipment based on improved wavelet neural network
CN118503834A (en) A networked radar intelligent track interconnection method with robust system errors

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