Python环境下基于门控双注意力机制的滚动轴承剩余使用寿命RUL预测(Tensorflow模块)

机械设备的寿命是其从开始工作持续运行直至故障出现的整个时间段,以滚动轴承为例,其寿命为开始转动直到滚动体或是内外圈等元件出现首次出现故障前。目前主流的滚动轴承RUL预测分类方法包含两种:一是基于物理模型的RUL预测方法,二是基于数据驱动的RUL预测方法。

基于物理模型的RUL预测方法是利用物理学模型来描述基于失效机制的物理现象,并在一定的假设条件下建立滚动轴承RUL预测的公式模型。但要想建立精确的滚动轴承退化物理学模型,需要对复杂的轴承结构有深入的了解,需要相关人员有较深厚的知识背景,费时费力,且模型泛化能力弱。数学模型表达退化趋势的前提是构建合理的健康指数。

基于数据驱动的RUL预测方法可分为三个步骤:一是数据获取,在数据采集的过程中通常采用的是振动信号或是声学信号;二是健康指标构建,构建健康指标来监测旋转机械的退化,主要包括均方根、变分模态分解、数学形态谱熵和主成分分析等方法;三是剩余使用寿命预测方法,基于数据驱动的轴承剩余使用寿命预测方法又可分为基于统计模型的轴承剩余使用寿命预测方法和基于人工智能模型的轴承剩余使用寿命预测方法。

该代码为Python环境下基于门控双注意力机制的滚动轴承剩余使用寿命RUL预测(采用Tensorflow模块),所用模块如下:

复制代码
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
import numpy as np
import matplotlib.pyplot as plt
import scipy.io as scio

Tensorflow模块版本如下:

复制代码
tensorflow=2.8.0

所使用的数据为公开数据,试验台如下:

部分代码如下:

复制代码
# Builds GDAU cell structure
def gdaumodel(gdau_input,gdau_state,n_input, n_hidden, n_output):
    weights = initialize_weights(n_input, n_hidden, n_output)
    r = tf.sigmoid(tf.matmul(weights['ur'], gdau_input) + tf.matmul(weights['wr'], gdau_state) + weights['br']) # The output of the reset gate
    z = tf.sigmoid(tf.matmul(weights['uz'], gdau_input) + tf.matmul(weights['wz'], gdau_state) + weights['bz']) # The output of the update gate
    candidate = tf.tanh(tf.matmul(weights['uh'], gdau_input) + tf.matmul(weights['wh'], tf.multiply(r,gdau_state)) + weights['bh']) # The output of the candidate state
    at = tf.matmul(weights['v'],tf.tanh(tf.matmul(weights['ua1'],gdau_input) + tf.matmul(weights['wa1'],gdau_state)))
    ut = tf.nn.softmax(at, axis=0)
    h = tf.tanh(tf.multiply(ut,(tf.matmul(weights['ua2'],gdau_input) + tf.matmul(weights['wa2'],gdau_state)))) # The output of the attention gate 1
    a1 = tf.sigmoid(tf.matmul(weights['uaa1'],r) + tf.matmul(weights['waa1'],z) + weights['baa1'])
    a2 = tf.tanh(tf.matmul(weights['uaa2'], r) + tf.matmul(weights['waa2'], z) + weights['baa2'])
    a = tf.multiply(a1, a2) # The output of the attention gate 2
    ht = tf.multiply((1-z), gdau_state) + tf.multiply(z ,candidate)/2 + tf.multiply(z, h)/2 + a # The output of hidden layer
    output = tf.matmul(weights['w'], ht) + weights['b'] # The output of output layer
    return output, ht

出图如下:

工学博士,担任《Mechanical System and Signal Processing》审稿专家,担任
《中国电机工程学报》优秀审稿专家,《控制与决策》,《系统工程与电子技术》,《电力系统保护与控制》,《宇航学报》等EI期刊审稿专家。擅长领域:现代信号处理,机器学习,深度学习,数字孪生,时间序列分析,设备缺陷检测、设备异常检测、设备智能故障诊断与健康管理PHM等。

相关推荐
会飞的老朱2 小时前
医药集团数智化转型,智能综合管理平台激活集团管理新效能
大数据·人工智能·oa协同办公
聆风吟º3 小时前
CANN runtime 实战指南:异构计算场景中运行时组件的部署、调优与扩展技巧
人工智能·神经网络·cann·异构计算
寻星探路4 小时前
【深度长文】万字攻克网络原理:从 HTTP 报文解构到 HTTPS 终极加密逻辑
java·开发语言·网络·python·http·ai·https
Codebee5 小时前
能力中心 (Agent SkillCenter):开启AI技能管理新时代
人工智能
lly2024065 小时前
Bootstrap 警告框
开发语言
2601_949146536 小时前
C语言语音通知接口接入教程:如何使用C语言直接调用语音预警API
c语言·开发语言
曹牧6 小时前
Spring Boot:如何测试Java Controller中的POST请求?
java·开发语言
聆风吟º6 小时前
CANN runtime 全链路拆解:AI 异构计算运行时的任务管理与功能适配技术路径
人工智能·深度学习·神经网络·cann
KYGALYX6 小时前
服务异步通信
开发语言·后端·微服务·ruby
uesowys6 小时前
Apache Spark算法开发指导-One-vs-Rest classifier
人工智能·算法·spark