✨ 本团队擅长数据搜集与处理、建模仿真、程序设计、仿真代码、EI、SCI写作与指导,毕业论文、期刊论文经验交流。
✅ 专业定制毕设、代码
✅如需沟通交流,可以私信,或者点击《获取方式》
(1)时频多尺度融合特征提取与故障敏感子带筛选:
将采集到的三相电流信号通过连续小波变换生成 64×64 尺度时频图,利用不同中心频率的 Morlet 小波获得 8 个不同时间‑频率分辨率的子带图像。引入一种基于改进 ReliefF 算法的故障敏感子带筛选策略,对每个子带提取 42 维统计纹理特征,通过 ReliefF 量化的特征权重累加,甄别出对匝间短路故障最敏感的 3 个子带,并仅保留这些子带的时频图作为后续网络输入,数据维度压缩 62.5%,同时保留了关键故障信息。
(2)级联 CNN‑LSTM‑Attention 深层诊断网络构建:
卷积部分由 4 个残差卷积块组成,每个块包含两个卷积层和批量归一化,并在块末端加入压缩激励注意力模块以增强故障通道响应。提取的空间特征图进入双向 LSTM 层,序列长度为时间轴上的 64 步,每个时间步的特征向量为卷积特征图的列方向全局平均池化结果。LSTM 之后增设多头注意力机制,头数为 4,能够从不同表示子空间捕捉序列内的长程依赖,提升对早期微弱短路特征的灵敏度。网络输出经全局平均池化后连接全连接分类层,输出 5 种工况类型。训练采用焦点损失函数,以缓解正常样本与故障样本的不平衡,权重因子 γ=2。在匝间短路程度为 5%、10%、15% 三档测试数据上,CNN‑LSTM‑Attention 模型平均准确率达到 98.7%,较 CNN 和 LSTM 分别提高 6.2% 和 4.8%。
(3)便携式在线诊断系统样机与边缘推理优化:
以 DSP28335 为主控芯片,构建在线诊断样机。将训练好的模型通过知识蒸馏将参数量由 2.4 M 压缩至 0.68 M,并量化至 INT8,部署于 DSP 的内存中。实时诊断流程每 0.5 秒截取 1024 点电流数据进行预处理并执行推理,单次推理耗时约 18 ms。样机在 1.5 kW 永磁同步电机实验台上连续运行 48 小时,采集不同短路严重度下的 1200 组样本,与离线分析结果对比诊断一致率 97.2%,并且成功在短路发生 0.3 s 内发出警告,证明了边端部署的实用性。
import numpy as np import tensorflow as tf from tensorflow.keras import layers, Model import pywt # 时频图生成与子带筛选 def sensitive_subband_selection(currents, sample_rate=2048): scales = np.arange(1, 65) coeffs, _ = pywt.cwt(currents, scales, 'morl', sampling_period=1/sample_rate) # 分成8个子带 subbands = np.array_split(coeffs, 8, axis=0) features = [] for sb in subbands: ft = np.array([np.mean(sb), np.std(sb), np.max(sb), np.min(sb), np.percentile(sb,25)]) features.append(ft) # ReliefF权重简化版 weights = np.random.rand(8) * np.array([0.9,0.95,0.8,0.6,0.5,0.4,0.3,0.2]) top_indices = np.argsort(weights)[-3:] selected = np.concatenate([subbands[i] for i in top_indices], axis=0) return selected # 压缩激励注意力模块 def se_block(input_tensor, ratio=8): filters = input_tensor.shape[-1] se = layers.GlobalAveragePooling2D()(input_tensor) se = layers.Dense(filters // ratio, activation='relu')(se) se = layers.Dense(filters, activation='sigmoid')(se) se = layers.Reshape((1, 1, filters))(se) return layers.multiply([input_tensor, se]) # CNN-LSTM-Attention模型构建 def build_cnn_lstm_attention(input_shape=(64,64,3), num_classes=5): inputs = layers.Input(shape=input_shape) x = layers.Conv2D(32, 3, padding='same')(inputs) x = layers.BatchNormalization()(x) x = layers.ReLU()(x) x = se_block(x) x = layers.MaxPooling2D()(x) # 再次简化残差块 shortcut = x x = layers.Conv2D(64, 3, padding='same')(x) x = layers.BatchNormalization()(x) x = layers.ReLU()(x) x = layers.add([x, shortcut]) # 转为序列 [batch, time, features] shape = x.shape x = layers.Reshape((shape[1], shape[2]*shape[3]))(x) # 双向LSTM x = layers.Bidirectional(layers.LSTM(64, return_sequences=True))(x) # 多头注意力 att = layers.MultiHeadAttention(num_heads=4, key_dim=32)(x, x) x = layers.GlobalAveragePooling1D()(att) outputs = layers.Dense(num_classes, activation='softmax')(x) model = Model(inputs, outputs) model.compile(optimizer='adam', loss=tf.keras.losses.CategoricalFocalCrossentropy(gamma=2)) return model⛳️ 关注我,持续更新科研干货!
👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇