CN117909818A - Arc fault identification method and system based on multi-cycle features and multi-scale convolution - Google Patents
Arc fault identification method and system based on multi-cycle features and multi-scale convolution Download PDFInfo
- Publication number
- CN117909818A CN117909818A CN202410025431.7A CN202410025431A CN117909818A CN 117909818 A CN117909818 A CN 117909818A CN 202410025431 A CN202410025431 A CN 202410025431A CN 117909818 A CN117909818 A CN 117909818A
- Authority
- CN
- China
- Prior art keywords
- feature
- data
- convolution
- attention
- scale
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 58
- 230000000737 periodic effect Effects 0.000 claims abstract description 20
- 238000000605 extraction Methods 0.000 claims abstract description 9
- 230000007246 mechanism Effects 0.000 claims abstract description 5
- 230000009466 transformation Effects 0.000 claims abstract 2
- 230000004927 fusion Effects 0.000 claims description 22
- 230000006870 function Effects 0.000 claims description 13
- 239000013598 vector Substances 0.000 claims description 13
- 238000011176 pooling Methods 0.000 claims description 12
- 230000004913 activation Effects 0.000 claims description 10
- 238000012545 processing Methods 0.000 claims description 10
- 238000004364 calculation method Methods 0.000 claims description 9
- 239000011159 matrix material Substances 0.000 claims description 9
- 238000013461 design Methods 0.000 claims description 5
- 238000007781 pre-processing Methods 0.000 claims description 4
- 238000012935 Averaging Methods 0.000 claims description 3
- 238000004590 computer program Methods 0.000 claims description 3
- 238000013507 mapping Methods 0.000 claims description 3
- 238000010606 normalization Methods 0.000 claims description 3
- 108010076504 Protein Sorting Signals Proteins 0.000 claims description 2
- 238000010891 electric arc Methods 0.000 claims 3
- 125000004122 cyclic group Chemical group 0.000 claims 1
- 239000004744 fabric Substances 0.000 claims 1
- 238000002474 experimental method Methods 0.000 abstract description 4
- 238000004458 analytical method Methods 0.000 abstract description 2
- 238000013527 convolutional neural network Methods 0.000 abstract description 2
- 238000005070 sampling Methods 0.000 abstract description 2
- 230000000052 comparative effect Effects 0.000 abstract 1
- 230000008447 perception Effects 0.000 abstract 1
- 230000008569 process Effects 0.000 description 10
- 230000003044 adaptive effect Effects 0.000 description 5
- 238000012549 training Methods 0.000 description 5
- 238000010586 diagram Methods 0.000 description 4
- 238000010200 validation analysis Methods 0.000 description 4
- 238000013528 artificial neural network Methods 0.000 description 3
- 230000008901 benefit Effects 0.000 description 3
- 238000001514 detection method Methods 0.000 description 3
- 230000000717 retained effect Effects 0.000 description 3
- 101100233916 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) KAR5 gene Proteins 0.000 description 2
- 238000002679 ablation Methods 0.000 description 2
- 230000008859 change Effects 0.000 description 2
- 238000004891 communication Methods 0.000 description 2
- 238000013135 deep learning Methods 0.000 description 2
- 238000013136 deep learning model Methods 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 230000018109 developmental process Effects 0.000 description 2
- 238000010801 machine learning Methods 0.000 description 2
- 239000000203 mixture Substances 0.000 description 2
- 238000005457 optimization Methods 0.000 description 2
- 238000011160 research Methods 0.000 description 2
- 206010000369 Accident Diseases 0.000 description 1
- ORILYTVJVMAKLC-UHFFFAOYSA-N Adamantane Natural products C1C(C2)CC3CC1CC2C3 ORILYTVJVMAKLC-UHFFFAOYSA-N 0.000 description 1
- 101000827703 Homo sapiens Polyphosphoinositide phosphatase Proteins 0.000 description 1
- 240000007594 Oryza sativa Species 0.000 description 1
- 235000007164 Oryza sativa Nutrition 0.000 description 1
- 102100023591 Polyphosphoinositide phosphatase Human genes 0.000 description 1
- 230000032683 aging Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000013145 classification model Methods 0.000 description 1
- 230000007812 deficiency Effects 0.000 description 1
- 230000005684 electric field Effects 0.000 description 1
- 230000005611 electricity Effects 0.000 description 1
- 238000000802 evaporation-induced self-assembly Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000006698 induction Effects 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 238000009413 insulation Methods 0.000 description 1
- 230000009916 joint effect Effects 0.000 description 1
- 239000003550 marker Substances 0.000 description 1
- 238000013508 migration Methods 0.000 description 1
- 230000005012 migration Effects 0.000 description 1
- 238000012821 model calculation Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 235000009566 rice Nutrition 0.000 description 1
- 230000035945 sensitivity Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/24—Classification techniques
- G06F18/241—Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/24—Classification techniques
- G06F18/245—Classification techniques relating to the decision surface
- G06F18/2451—Classification techniques relating to the decision surface linear, e.g. hyperplane
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/25—Fusion techniques
- G06F18/253—Fusion techniques of extracted features
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/0464—Convolutional networks [CNN, ConvNet]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- Evolutionary Computation (AREA)
- Artificial Intelligence (AREA)
- General Engineering & Computer Science (AREA)
- Life Sciences & Earth Sciences (AREA)
- General Physics & Mathematics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Bioinformatics & Computational Biology (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Evolutionary Biology (AREA)
- General Health & Medical Sciences (AREA)
- Computing Systems (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Molecular Biology (AREA)
- Computational Linguistics (AREA)
- Biophysics (AREA)
- Biomedical Technology (AREA)
- Health & Medical Sciences (AREA)
- Complex Calculations (AREA)
Abstract
本发明公开一种基于多周期特征和多尺度卷积的电弧故障识别方法及系统。本发明使用FFT变换获取频率及对应的幅值,实现周期特征的选择和对一维时序数据的二维表示。将常用时序数据扩展成可二维解释的数据并设计卷积块展开基于注意力机制和多尺度的分析,得到改进的故障电弧识别模型;在涵盖多种负载类型样本,不同采样分辨率的故障电弧数据集中进行对比实验。本发明设计合理,在预先不进行人工特征提取的情况下利用频域上的特征进行周期的选择,然后利用卷积神经网络的局部感知、权重共享和多层抽象完成特征提取,在满足故障识别准确率的前提下,尽可能减少模型参数以优化网络架构,可广泛用于家用设备安全领域。
The present invention discloses an arc fault identification method and system based on multi-periodic features and multi-scale convolution. The present invention uses FFT transformation to obtain frequency and corresponding amplitude, realizes the selection of periodic features and the two-dimensional representation of one-dimensional time series data. The commonly used time series data is expanded into data that can be interpreted in two dimensions and a convolution block is designed to expand the analysis based on the attention mechanism and multi-scale, so as to obtain an improved fault arc identification model; comparative experiments are carried out in a fault arc data set covering samples of various load types and different sampling resolutions. The present invention is reasonably designed, and the features in the frequency domain are used to select the period without artificial feature extraction in advance, and then the local perception, weight sharing and multi-layer abstraction of the convolutional neural network are used to complete the feature extraction. Under the premise of meeting the fault identification accuracy, the model parameters are reduced as much as possible to optimize the network architecture, and it can be widely used in the field of household appliance safety.
Description
技术领域Technical Field
本发明属于电弧故障识别技术领域,涉及基于多周期特征和多尺度卷积的电弧故障识别方法及系统。The present invention belongs to the technical field of arc fault identification, and relates to an arc fault identification method and system based on multi-cycle features and multi-scale convolution.
背景技术Background technique
随着社会的不断发展,电气化程度越来越高,因此近年来电气火灾频发。许多严重的火灾事故仅仅是由线路中低于额定电流或预期短路电流的故障电弧引起的。这些危险的电弧可能发生在设计不合理或者老化的供电线路、电器插头以及家用电器的电源线、内部线束或零部件绝缘。并且故障电弧发生时可能无法被线路上的漏电、过流和短路等保护装置迅速检测到难以及时切断电源,从而极易引发火灾。因此,作为电气火灾的直接原因之一,对故障电弧进行实时且准确的识别对各类安全用电场景都是十分重要的。With the continuous development of society, the degree of electrification is getting higher and higher, so electrical fires have occurred frequently in recent years. Many serious fire accidents are simply caused by fault arcs in the line that are lower than the rated current or expected short-circuit current. These dangerous arcs may occur in unreasonable or aging power supply lines, electrical plugs, and power cords of household appliances, internal wiring harnesses, or component insulation. And when a fault arc occurs, it may not be quickly detected by the leakage, overcurrent, and short-circuit protection devices on the line, making it difficult to cut off the power supply in time, which can easily cause a fire. Therefore, as one of the direct causes of electrical fires, real-time and accurate identification of fault arcs is very important for various safe electricity use scenarios.
家用负载种类多样,且不同类型的电气特征差异极大,给电弧故障识别带来了很大的挑战。研究人员对电弧的研究也从来没有停止过,弧光、热以及电磁等物理变化一般用于受限空间中的电弧识别,单一的探测传感器的识别精度不如多传感器的共同作用。但是这类采集对传感器、安装还有环境都有很高的要求,因此实际应用十分受限。基于此,电弧电压和电流的时频域特征提出的电弧故障检测方法逐渐发展起来,但是人工提取受到先验知识的影响,在适应性和泛化能力上还有有待提升,但是这种优化是困难且繁琐的。同时非线形负载的不断增多和存在多负载同时运行的情况,人工提取的特征在类似于这样的困难样本上经常会发生漏检或者误检,很难保证识别精度。There are many types of household loads, and the electrical characteristics of different types vary greatly, which brings great challenges to arc fault identification. Researchers have never stopped studying arcs. Physical changes such as arc light, heat, and electromagnetism are generally used for arc identification in confined spaces. The recognition accuracy of a single detection sensor is not as good as the joint action of multiple sensors. However, this type of acquisition has high requirements for sensors, installation, and environment, so its practical application is very limited. Based on this, arc fault detection methods proposed by the time-frequency domain characteristics of arc voltage and current have gradually developed, but manual extraction is affected by prior knowledge, and there is still room for improvement in adaptability and generalization ability, but this optimization is difficult and cumbersome. At the same time, with the continuous increase of nonlinear loads and the existence of multiple loads running at the same time, the manually extracted features often miss or misdetect on difficult samples like this, and it is difficult to ensure recognition accuracy.
近些年来,对电弧故障识别的研究主要有两类:1、电弧特征的提取方法:主要是对电弧的时频域特征进行分析,并利用数学形态提取出有效的特征。结合机器学习分类器或者人工神经网络得到最终输出。2、深度学习模型和算法的研究:大多数通过设计不同的卷积网络进行特征提取,还有部分方法将时序数据预处理成为图像后输入到后续的分类模型中进行处理。这些方法通过分析故障电弧对电流电压的影响,不同负载对故障电弧特征的影响,并应用启发式方法或者机器学习来进行决策,其中深度学习模型被多次证明在电弧故障识别中各项性能指标上均具有显著优势。In recent years, there are two main types of research on arc fault identification: 1. Arc feature extraction method: mainly analyze the time-frequency domain characteristics of the arc, and use mathematical morphology to extract effective features. Combine machine learning classifiers or artificial neural networks to obtain the final output. 2. Research on deep learning models and algorithms: Most of them extract features by designing different convolutional networks, and some methods preprocess the time series data into images and input them into subsequent classification models for processing. These methods analyze the impact of fault arcs on current and voltage, the impact of different loads on fault arc characteristics, and apply heuristic methods or machine learning to make decisions. Among them, deep learning models have been repeatedly proven to have significant advantages in various performance indicators in arc fault identification.
由于深度学习相比人工特征提取展现出来的优势,深度学习运用在电弧故障识别中仍然存在的一些挑战。首先,模型大小和性能之间没有很好的平衡,为了更好拟合故障电弧场景通常会使用较深的网络和很多不同尺度的卷积核,但是这样的模型通常参数量较大,不好满足实际应用的轻量化需求。其次,随着卷积神经网络的不断发展,但是大多数仍然在二维数据上适用,虽然有部分故障电弧的研究将一维的时序数据预处理成图像以方便实现模型的迁移,但是这样的处理通常会导致输入数据的大小的指数增长,从而影响后续处理和增加计算量。Despite the advantages of deep learning over manual feature extraction, there are still some challenges in the application of deep learning in arc fault identification. First, there is no good balance between model size and performance. In order to better fit the fault arc scenario, a deeper network and many convolution kernels of different scales are usually used. However, such models usually have a large number of parameters and are not easy to meet the lightweight requirements of practical applications. Secondly, with the continuous development of convolutional neural networks, most of them are still applicable to two-dimensional data. Although some studies on fault arcs preprocess one-dimensional time series data into images to facilitate model migration, such processing usually leads to an exponential increase in the size of the input data, which affects subsequent processing and increases the amount of calculation.
发明内容Summary of the invention
本发明的目的是针对现有技术的不足,提供基于多周期特征和多尺度卷积的电弧故障识别方法及系统,对时序数据进行二维解释扩展,在便于后续数据输入的同时保证多周期数据大小相比原始数据的增加是线性的,而非指数级。此方法融合多尺度卷积和多周期的自适应特征,配合卷积注意力模块提取有效的电弧特征。出于精简模型大小的目的,在保证识别精度上对卷积核大小上进行了限制,限制最大的卷积核大小为3,控制神经网络的深度在3层以内,最后利用全连接层实现电弧故障的识别。The purpose of the present invention is to address the deficiencies of the prior art and provide an arc fault identification method and system based on multi-cycle features and multi-scale convolution, which performs a two-dimensional interpretation and expansion of time series data, and ensures that the increase in the size of multi-cycle data compared to the original data is linear, rather than exponential, while facilitating subsequent data input. This method integrates the adaptive features of multi-scale convolution and multi-cycle, and cooperates with the convolution attention module to extract effective arc features. In order to streamline the model size, the convolution kernel size is limited to ensure recognition accuracy, and the maximum convolution kernel size is limited to 3, and the depth of the neural network is controlled within 3 layers. Finally, the fully connected layer is used to realize the recognition of arc faults.
第一方面,本发明提供基于多周期特征和多尺度卷积的电弧故障识别方法,所述方法包括以下步骤:In a first aspect, the present invention provides an arc fault identification method based on multi-cycle features and multi-scale convolution, the method comprising the following steps:
步骤(1)、采集电弧的电流、电压数据,对其以固定时间窗口进行滑动划分;Step (1), collecting arc current and voltage data, and slidingly dividing them into fixed time windows;
步骤(2)、二维解释扩展:Step (2), two-dimensional interpretation expansion:
首先,对步骤(1)处理后的电流、电压数据进行特征嵌入;其次,通过快速傅立叶变换选择出通道幅值均值最高的前k个不同频率对应周期;最后,将步骤(1)处理后的电流、电压数据转换成k个不同频率对应周期下的二维数据,k≥1,得到具有周期特征的二维数据;First, feature embedding is performed on the current and voltage data processed in step (1); second, the first k different frequency corresponding periods with the highest channel amplitude mean are selected by fast Fourier transform; finally, the current and voltage data processed in step (1) are converted into two-dimensional data under k different frequency corresponding periods, k ≥ 1, to obtain two-dimensional data with periodic characteristics;
步骤(3)、基于注意力机制的多尺度卷积:Step (3), multi-scale convolution based on attention mechanism:
将步骤(2)得到的具有周期特征的二维数据循环输入到多尺度卷积模块中得到多个具有注意力表现的多尺度特征的输出数据;其中所述多尺度卷积模块包括并行设置的两个多尺度卷积操作和一个卷积注意力模块,并且在每个多尺度卷积操作结束后应用GELU激活函数;每个输出对应一种被选择的周期;The two-dimensional data with periodic features obtained in step (2) is cyclically input into a multi-scale convolution module to obtain a plurality of output data with multi-scale features having attention performance; wherein the multi-scale convolution module includes two multi-scale convolution operations and a convolution attention module arranged in parallel, and a GELU activation function is applied after each multi-scale convolution operation; each output corresponds to a selected period;
步骤(4)、基于自适应权重的特征融合:基于频率对应周期的幅值均值,对多个具有注意力表现的多尺度特征进行多周期特征的融合;Step (4), feature fusion based on adaptive weights: based on the amplitude mean of the frequency corresponding period, multiple multi-scale features with attention performance are fused with multi-period features;
步骤(5)、线性分类:Step (5), linear classification:
对步骤(4)多周期特征的融合结果依次进行层归一化和GELU激活,最后展平输入到全连接层,得到分类结果。The fusion result of the multi-cycle features in step (4) is layer normalized and GELU activated in turn, and finally flattened and input into the fully connected layer to obtain the classification result.
作为优选,步骤(2)具体是:Preferably, step (2) is:
2-1对步骤(1)处理后的数据进行位置嵌入;2-1 Perform position embedding on the data processed in step (1);
2-2对步骤(1)处理后的数据进行标记嵌入;2-2 Mark and embed the data processed in step (1);
2-3将步骤2-1得到的位置嵌入结果和步骤2-2得到的标记嵌入结果进行相加;2-3 Add the position embedding result obtained in step 2-1 and the tag embedding result obtained in step 2-2;
2-4对步骤2-3的相加结果进行快速傅立叶变换,进而对比不同频率下信号在所有通道上的幅值均值,选出k个最高幅值均值对应的频率并形成频率列表,同时将对应的通道幅值均值存储在一个权重矩阵W中;2-4 Perform fast Fourier transform on the addition result of step 2-3, and then compare the amplitude mean of the signal on all channels at different frequencies, select the frequencies corresponding to the k highest amplitude mean values and form a frequency list, and store the corresponding channel amplitude mean values in a weight matrix W;
2-5根据步骤2-4中返回的频率列表依次对特征嵌入处理后的原始信号进行二维解释,以Tk=1/fk为周期长度重新排列原始信号;若N不可以被Tk整除,则需要对信号进行末尾零填充使得信号长度变成N'k,确保N'k可以被Tk整除,获取得到k个具有周期特征的二维数据其中每一列表示步骤2-4中划分出来的N'/Tk个周期间有相同相位的时间点,每一行/>表示Tk大小周期内的数据。2-5 Perform a two-dimensional interpretation of the original signal after feature embedding processing according to the frequency list returned in step 2-4, and rearrange the original signal with T k = 1/f k as the period length; if N is not divisible by T k , it is necessary to pad the signal with zeros at the end so that the signal length becomes N' k , ensuring that N' k is divisible by T k , and obtain k two-dimensional data with periodic features. Each column represents the time point with the same phase during the N'/T k cycles divided in steps 2-4, and each row/> Represents data within a period of T k .
作为优选,步骤2-1中所述位置嵌入采用正弦-余弦位置编码方法,为电流、电压数据中的每一个时间点生成一个连续的向量,此向量可以捕捉到位置之间的相对关系;Preferably, the position embedding in step 2-1 adopts a sine-cosine position encoding method to generate a continuous vector for each time point in the current and voltage data, and this vector can capture the relative relationship between the positions;
其中,pos表示数据的位置,d表示位置编码的维度,i表示维度的索引。Among them, pos represents the position of the data, d represents the dimension of the position encoding, and i represents the index of the dimension.
作为优选,步骤2-2中所述标记嵌入采用circular的填充方式进行卷积,实现将离散的采集值使用一组连续的向量进行表示。Preferably, the marker embedding in step 2-2 is convolved using a circular filling method to achieve the representation of discrete collection values using a set of continuous vectors.
作为优选,步骤2-4中具体是:Preferably, steps 2-4 are as follows:
首先,通过快速傅立叶变换计算原始信号通道i上的复数序列Xi上的第k个元素,得到复数振幅X[k]i:First, the kth element of the complex sequence Xi on the original signal channel i is calculated by fast Fourier transform to obtain the complex amplitude X[k] i :
其中N表示信号的长度,k表示转换后频率的索引,xi[n]表示特征嵌入处理后的原始信号序列在第i个信号通道上第n个元素,j表示虚数单位;Where N represents the length of the signal, k represents the index of the converted frequency, xi [n] represents the nth element of the original signal sequence on the i-th signal channel after feature embedding processing, and j represents the imaginary unit;
其次,利用复数振幅X[k]i计算频率fk对应的幅值并计算在所有通道上的幅值均值AMPk:Secondly, the complex amplitude X[k] i is used to calculate the amplitude corresponding to the frequency f k And calculate the amplitude mean AMP k on all channels:
其中Re(·)表示实部,Im(·)表示虚部;Where Re(·) represents the real part, Im(·) represents the imaginary part;
最后比较不同频率fk对应的通道幅值均值AMPk,挑选出最高的k个通道幅值均值对应的频率并以列表的形式返回,同时将对应的通道幅值均值存储在权重矩阵W={AMP1,AMP2,...,AMPk}中。Finally, the channel amplitude means AMP k corresponding to different frequencies f k are compared, the frequencies corresponding to the highest k channel amplitude means are selected and returned in the form of a list, and the corresponding channel amplitude means are stored in the weight matrix W = {AMP 1 , AMP 2 , ..., AMP k }.
作为优选,步骤(3)具体是:Preferably, step (3) is:
3-1将步骤(2)得到的具有周期特征的二维数据经过一个多尺度卷积模块,得到多个尺度特征向量{Feature1,Feature2,...,Featuren};3-1 The two-dimensional data with periodic features obtained in step (2) is passed through a multi-scale convolution module to obtain multiple scale feature vectors {Feature 1 , Feature 2 ,..., Feature n };
所述多尺度卷积模块包括并行设置的1×3卷积块,3×1卷积块,1×1卷积块;其中所述1×3卷积块,3×1卷积块的扩张率不同;The multi-scale convolution module includes a 1×3 convolution block, a 3×1 convolution block, and a 1×1 convolution block arranged in parallel; wherein the expansion rates of the 1×3 convolution block and the 3×1 convolution block are different;
3-2步骤3-1得到的多个尺度特征向量{Feature1,Feature2,...,Featuren}进行堆叠产生一个新的维度,然后在这个新维度上求均值,得到多尺度卷积的输出结果,并对输出结果使用GELU激活函数得到最终结果:3-2 The multiple scale feature vectors {Feature 1 , Feature 2 , ..., Feature n } obtained in step 3-1 are stacked to generate a new dimension, and then the average is calculated on this new dimension to obtain the output result of the multi-scale convolution, and the GELU activation function is used on the output result to obtain the final result:
XH*W*C=GELU(Avg(Stack(Feature1,Feature2,...,Featuren)) 式(6)X H*W*C = GELU(Avg(Stack(Feature 1 ,Feature 2 ,...,Feature n )) Formula (6)
其中Stack(·)表示堆叠操作,Avg(·)表示求平均;H、W、C表示XH*W*C特征图的长、宽、高维度;Stack(·) indicates stacking operation, Avg(·) indicates averaging; H, W, C indicate the length, width, and height dimensions of the X H*W*C feature map;
3-3对步骤3-2的最终结果XH*W*C分别进行通道注意力和空间注意力计算;3-3 Calculate channel attention and spatial attention for the final result X H*W*C of step 3-2 respectively;
所述通道注意力的计算方法是先将经过步骤3-2的最终结果XH*W*C沿着通道分别进行平均池化AvgPooling和最大池化MaxPooling,得到两个通道权重Ac和Mc,然后这两个通道权重经过一个共享的MLP得到各自新的注意力权重A'c和M'c,随后经过相加和sigmoid函数映射得到最终的通道注意力ChannelAttention(XH*W*C);The calculation method of the channel attention is to first perform average pooling AvgPooling and maximum pooling MaxPooling along the channel on the final result X H*W*C after step 3-2, and obtain two channel weights A c and Mc , and then these two channel weights are passed through a shared MLP to obtain their respective new attention weights A' c and Mc' c , and then the final channel attention ChannelAttention(X H*W*C ) is obtained by addition and sigmoid function mapping;
ChannelAttention(XH*W*C)=Sigmoid(A'c+M'c) 式(7)ChannelAttention(X H*W*C )=Sigmoid(A' c +M' c ) Formula (7)
所述空间注意力的计算方法是经过步骤3-2的最终结果XH*W*C沿着通道对空间特征图分别进行平均池化和最大池化,然后将两个特征输出进行堆叠,随后将堆叠后的数据经过一个点卷积并经过sigmoid得到最终的空间注意力;The calculation method of the spatial attention is to perform average pooling and maximum pooling on the spatial feature map along the channel according to the final result X H*W*C of step 3-2, and then stack the two feature outputs, and then pass the stacked data through a point convolution and sigmoid to obtain the final spatial attention;
3-4将步骤3-2得到的最终结果XH*W*C先乘以步骤3-3中计算的通道注意力ChannelAttention(XH*W*C),得到特征X1;然后特征X1再乘以步骤3-3中计算的空间注意力SpatialAttention(XH*W*C)得到最终基于注意力的特征输出X2;3-4 Multiply the final result X H*W*C obtained in step 3-2 by the channel attention ChannelAttention(X H*W*C ) calculated in step 3-3 to obtain feature X1; then multiply feature X1 by the spatial attention SpatialAttention(X H*W*C ) calculated in step 3-3 to obtain the final attention-based feature output X2;
X1=XH*W*C×ChannelAttention(XH*W*C) 式(8)X1=X H*W*C ×ChannelAttention(X H*W*C ) Formula (8)
X2=X1×SpatialAttention(XH*W*C) 式(9)X2=X1×SpatialAttention(X H*W*C ) Formula (9)
3-5将步骤3-4的基于注意力的特征输出X2作为多尺度卷积模块的输入,重复进行步骤3-1至3-2操作,得到最终的输出 3-5 Take the attention-based feature output X2 of step 3-4 as the input of the multi-scale convolution module, repeat steps 3-1 to 3-2, and get the final output
作为优选,步骤(4)具体是:Preferably, step (4) is specifically:
4-1将步骤(3)中获得的Tk对应输出的二维数据还原成一维数据Xk,然后将一维数据Xk的长度裁切到步骤(1)窗口长度,即超出原始信号长度的时间点上对应的数据被舍弃;4-1 Transform the T k obtained in step (3) into the two-dimensional data output Restore to one-dimensional data X k , and then cut the length of the one-dimensional data X k to the window length of step (1), that is, the data corresponding to the time point exceeding the length of the original signal is discarded;
4-2将每个Tk对应的一维数据沿着一个维度堆叠,然后乘以步骤2-4获得的权重矩阵W,最终形成一个基于多周期融合的特征输出;4-2 stack the one-dimensional data corresponding to each T k along one dimension, and then multiply it by the weight matrix W obtained in step 2-4, and finally form a feature output based on multi-cycle fusion;
4-3基于残差设计块的思想,将步骤4-2得到的输出与步骤2-5获得k个具有周期特征的二维数据相加,得到多周期特征的融合结果。4-3 Based on the idea of residual design block, the output obtained in step 4-2 is added to the k two-dimensional data with periodic features obtained in step 2-5 to obtain the fusion result of multi-periodic features.
第二方面,本发明提供实现上述方法的电弧故障识别系统,包括:In a second aspect, the present invention provides an arc fault identification system for implementing the above method, comprising:
数据采集模块,用于采集电弧的电流、电压数据;Data acquisition module, used to collect arc current and voltage data;
数据预处理模块,对电弧的电流、电压数据以固定时间窗口进行滑动划分;The data preprocessing module performs sliding division of the arc current and voltage data in fixed time windows;
二维解释扩展模块,对数据预处理模块处理后的电流、电压数据进行特征嵌入,然后将电流、电压数据转换成k个不同频率对应周期下的二维数据,得到具有周期特征的二维数据;The two-dimensional interpretation extension module embeds the features of the current and voltage data processed by the data preprocessing module, and then converts the current and voltage data into two-dimensional data corresponding to k different frequencies to obtain two-dimensional data with periodic features;
特征提取模块,将二维解释扩展模块输出的具有周期特征的二维数据循环输入到多尺度卷积模块中得到多个具有注意力表现的多尺度特征;The feature extraction module cyclically inputs the two-dimensional data with periodic features output by the two-dimensional interpretation and expansion module into the multi-scale convolution module to obtain multiple multi-scale features with attention representation;
基于自适应权重的特征融合模块,基于频率对应周期,将多个具有注意力表现的多尺度特征进行多周期特征的融合;The feature fusion module based on adaptive weights fuses multiple multi-scale features with attention performance into multi-period features based on the frequency corresponding period;
线性分类器,对多周期特征的融合结果依次进行层归一化和GELU激活,最后展平输入到全连接层,得到分类结果。The linear classifier performs layer normalization and GELU activation on the fusion results of multi-cycle features in sequence, and finally flattens them and inputs them to the fully connected layer to obtain the classification result.
第三方面,本发明提供一种计算机可读存储介质,其上存储有计算机程序,当所述计算机程序在计算机中执行时,令计算机执行所述的方法。In a third aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute the method described.
第四方面,本发明提供一种计算设备,包括存储器和处理器,所述存储器中存储有可执行代码,所述处理器执行所述可执行代码时,实现所述的方法。In a fourth aspect, the present invention provides a computing device, comprising a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the described method is implemented.
本发明的有益效果是:The beneficial effects of the present invention are:
1.本发明对原始信号数据进行位置嵌入和标记嵌入,避免在后续二维解释性扩展时失去时间点相对于整个时间样本的部分相位信息,提高了对于电流、电压数据在二维解释性扩展时关于周期变化的鲁棒性,从而实现了故障识别的精度。1. The present invention performs position embedding and label embedding on the original signal data to avoid losing partial phase information of the time point relative to the entire time sample during the subsequent two-dimensional explanatory expansion, thereby improving the robustness of the current and voltage data with respect to periodic changes during the two-dimensional explanatory expansion, thereby achieving the accuracy of fault identification.
2.本发明提出通过FFT对电流、电压的频域数据进行分析,提取出频域对应的周期来作为时序数据的二维解释性扩展。这是在电气领域中频域上的特征通常是被认为有效的,但是特征工程又是繁琐的。本发明在避免特征工程的同时从二维解释的角度引入了抽象的频域特征,体现在了周期的选择上和最终基于周期特征的融合。2. The present invention proposes to analyze the frequency domain data of current and voltage through FFT, and extract the corresponding period in the frequency domain as a two-dimensional explanatory extension of the time series data. This is because the features in the frequency domain are usually considered effective in the electrical field, but feature engineering is cumbersome. While avoiding feature engineering, the present invention introduces abstract frequency domain features from the perspective of two-dimensional interpretation, which is reflected in the selection of the period and the final fusion based on the periodic features.
3.本发明在并行卷积块的设计中选择了固定大小的卷积核,即1×3卷积块、3×1卷积块,通过使用扩张卷积的方式保证获取多尺度的特征。通过多尺度的特征可以让模型理解具有更大时间跨度的信号,得到更大局部更深层次的细节特征。为了进一步降低模型的参数,利用了空间上的可分离卷积,大大减少了参数计算量。同时在多尺度卷积模块中加入了卷积注意力模块,分别对空间还有通道进行了注意力的计算,不仅让模型可以更加专注在可疑的故障发生时段上时间点采样信息,而且增强了有效的电弧特征的敏感程度。3. The present invention selects a fixed-size convolution kernel in the design of the parallel convolution block, namely, a 1×3 convolution block and a 3×1 convolution block, and ensures the acquisition of multi-scale features by using dilated convolution. The multi-scale features allow the model to understand signals with a larger time span and obtain larger local and deeper detail features. In order to further reduce the parameters of the model, spatially separable convolution is used, which greatly reduces the amount of parameter calculation. At the same time, a convolution attention module is added to the multi-scale convolution module, and attention calculations are performed on the space and the channel respectively, which not only allows the model to focus more on the sampling information at the time point during the suspected fault period, but also enhances the sensitivity of the effective arc features.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1为本发明系统的结构示意图。FIG. 1 is a schematic diagram of the structure of the system of the present invention.
图2为空间可分离的扩张卷积方法(以r=2为例);Figure 2 shows a spatially separable dilated convolution method (taking r = 2 as an example);
图3为通道注意力模块的结构示意图;FIG3 is a schematic diagram of the structure of a channel attention module;
图4为空间注意力模块的结构示意图;FIG4 is a schematic diagram of the structure of a spatial attention module;
图5为本发明在高分辨率采集数据的验证集上训练过程的损失变化曲线;FIG5 is a loss variation curve of the present invention during the training process on a validation set of high-resolution collected data;
图6为本发明在高分辨率采集数据的验证集上的训练过程的准确率变化曲线;FIG6 is a curve showing the accuracy change of the training process of the present invention on the validation set of high-resolution collected data;
图7本发明对模型的周期选择部分和注意力卷积模块进行消融实验后绘制的ROC曲线。FIG7 is an ROC curve drawn after the present invention performs an ablation experiment on the cycle selection part and the attention convolution module of the model.
具体实施方式Detailed ways
下面结合具体实施例和附图做进一步的分析。Further analysis is given below in conjunction with specific embodiments and drawings.
为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合附图对本申请的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution of the present application will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present application.
本申请实施例中所提到的术语“包括”和“具有”以及它们的任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括其他没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其它步骤或单元。The terms "including" and "having" and any variations thereof mentioned in the embodiments of the present application are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but may optionally include other steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or devices.
在电弧故障检测过程中,由于非线形负载的不断增多和存在多负载同时运行的情况,电压和电流的特征提取很难保证识别精度。因此,为更好地提高电弧故障识别精度,亟待解决的问题有:如何避免丢失在提取特征过程中数据周期变化,尽可能的挖掘数据特征不受非线形和多负载影响。In the process of arc fault detection, due to the increasing number of nonlinear loads and the existence of multiple loads running at the same time, it is difficult to ensure the recognition accuracy of voltage and current feature extraction. Therefore, in order to better improve the accuracy of arc fault recognition, the following problems need to be solved: how to avoid losing data cycle changes during feature extraction, and how to mine data features that are not affected by nonlinearity and multiple loads as much as possible.
基于此,本申请实施例提供了一种基于多周期特征和多尺度卷积的电弧故障识别方法。本发明对时序数据进行二维解释扩展,在方便后续的数据输入同时保证了多周期数据大小相比原始数据的增加是线性的,而不是指数级的。通过基于多尺度卷积和多周期的自适应特征融合,配合基于注意力机制的多尺度卷积提取有效的电弧特征。出于精简模型大小的目的,在保证识别精度上对卷积核大小上进行了限制,最大的卷积核大小为3,同时将神经网络的深度控制在3层以内,最后利用全连接层实现电弧故障的识别。Based on this, an embodiment of the present application provides an arc fault identification method based on multi-cycle features and multi-scale convolution. The present invention performs a two-dimensional interpretation and expansion on the time series data, which facilitates the subsequent data input while ensuring that the increase in the size of the multi-cycle data is linear, rather than exponential, compared to the original data. Through adaptive feature fusion based on multi-scale convolution and multi-cycle, effective arc features are extracted in conjunction with multi-scale convolution based on the attention mechanism. For the purpose of streamlining the model size, the convolution kernel size is restricted to ensure recognition accuracy. The maximum convolution kernel size is 3. At the same time, the depth of the neural network is controlled within 3 layers. Finally, the fully connected layer is used to realize the recognition of arc faults.
基于多周期特征和多尺度卷积的电弧故障识别方法,如图1包括以下步骤:The arc fault recognition method based on multi-cycle features and multi-scale convolution, as shown in Figure 1, includes the following steps:
步骤(1)、二维解释扩展:原始采集的数据以窗口的形式输入,并进行一些特征嵌入,然后通过FFT选择出不同的频率周期并保留对应的幅值均值大小,将输入转换成不同频率周期下的二维数据,以便后续分别输入到后续的多尺度卷积层中。具体的步骤如下:Step (1), two-dimensional interpretation and expansion: The original collected data is input in the form of a window, and some features are embedded. Then, different frequency periods are selected through FFT and the corresponding amplitude mean values are retained. The input is converted into two-dimensional data at different frequency periods so that it can be input into the subsequent multi-scale convolution layer. The specific steps are as follows:
Step 1:通过传感器采集到的电流、电压数据以一定的时间窗口大小进行滑动划分,对于高分辨率采集的数据(10KHz)窗口大小设置为1000,即0.1s识别出是否有故障,对于低分辨率采集的数据(6400Hz)窗口大小设置为1024,即0.16s识别出是否有故障。Step 1: The current and voltage data collected by the sensor are divided into sliding windows with a certain time window size. For the data collected with high resolution (10KHz), the window size is set to 1000, that is, it takes 0.1s to identify whether there is a fault. For the data collected with low resolution (6400Hz), the window size is set to 1024, that is, it takes 0.16s to identify whether there is a fault.
Step 2:对Step 1数据进行位置嵌入,这是由于在二维解释的过程中会丢失部分在原始波形中的全局相位信息。这里位置嵌入采用的是正弦-余弦位置编码的方法,为序列中的每一个时间点生成一个连续的向量,这个向量可以捕捉到位置之间的相对关系。Step 2: Position embedding is performed on the data in Step 1. This is because some global phase information in the original waveform will be lost during the two-dimensional interpretation process. Here, the position embedding adopts the sine-cosine position encoding method to generate a continuous vector for each time point in the sequence. This vector can capture the relative relationship between positions.
其中,pos表示数据的位置,d表示位置编码的维度,i表示维度的索引。Among them, pos represents the position of the data, d represents the dimension of the position encoding, and i represents the index of the dimension.
Step 3:同样对Step 1数据进行标记嵌入,这是由于在窗口划分的时候可能会丢失重要信息,边缘上的数据可能无法被卷积核完全覆盖到,所以使用circular的填充方式进行卷积。同时可以将离散的采集值使用一组连续的向量进行表示。Step 3: Similarly, the data in Step 1 is labeled and embedded. This is because important information may be lost when dividing the window, and the data on the edge may not be completely covered by the convolution kernel, so the circular filling method is used for convolution. At the same time, the discrete collection values can be represented by a set of continuous vectors.
Step 4:将Step 2得到的位置嵌入后结果和Step 3得到的标记嵌入结果进行相加,然后输出用于后续的周期选择。Step 4: Add the position embedding result obtained in Step 2 and the tag embedding result obtained in Step 3, and then output them for subsequent cycle selection.
Step 5:对Step 4的输出结果进行快速傅立叶变换(FFT),然后比较不同频率下信号在所有通道上的幅值均值,选出最高的三个频率并形成频率列表。并将对应的幅值均值存储在一个权重矩阵中。具体是:Step 5: Perform a fast Fourier transform (FFT) on the output of Step 4, then compare the amplitude mean of the signal at different frequencies on all channels, select the three highest frequencies and form a frequency list. And store the corresponding amplitude mean in a weight matrix. Specifically:
首先,通过FFT计算原始信号通道i上的复数序列Xi上的第k个元素:First, the kth element of the complex sequence Xi on the original signal channel i is calculated by FFT:
其中N表示信号的长度,k表示转换后频率的索引,xi[n]表示Step 2与Step 3处理后原始序列在第i个信号通道上第n个元素,j表示虚数单位(j2=-1);Where N represents the length of the signal, k represents the index of the converted frequency, x i [n] represents the nth element of the original sequence on the i-th signal channel after processing in Step 2 and Step 3, and j represents the imaginary unit (j 2 = -1);
其次,利用复数振幅X[k]i计算fk对应的幅值并计算在所有通道上幅值绝对值的均值:Secondly, the complex amplitude X[k] i is used to calculate the amplitude corresponding to f k and the average of the absolute values of the amplitudes on all channels is calculated:
最后比较不同的fk对应的通道幅值均值AMPk,挑选出最高的k个均值对应的频率并以列表的形式返回,并将对应的幅值存储在权重矩阵W={AMP1,AMP2,...,AMPk}中。Finally, the channel amplitude means AMP k corresponding to different f k are compared, the frequencies corresponding to the highest k means are selected and returned in the form of a list, and the corresponding amplitudes are stored in the weight matrix W = {AMP 1 , AMP 2 , ..., AMP k }.
Step 6:根据Step 4中返回的频率列表依次对特征嵌入处理后的原始信号进行二维解释,以Tk=1/fk为周期长度重新排列原始信号;若N不可以被Tk整除,则需要对信号进行末尾零填充使得信号长度变成N'k,确保N'k可以被Tk整除,获取得到三个具有周期特征的二维数据 Step 6: Perform a two-dimensional interpretation of the original signal after feature embedding according to the frequency list returned in Step 4, and rearrange the original signal with T k = 1/f k as the period length; if N is not divisible by T k , it is necessary to pad the signal with zeros at the end so that the signal length becomes N' k , ensuring that N' k is divisible by T k , and obtain three two-dimensional data with periodic features.
步骤(2)、基于注意力机制的多尺度卷积:Step (2), multi-scale convolution based on attention mechanism:
将三个具有周期特征的二维数据循环输入到多尺度卷积模块中。每个多尺度卷积模块中包含两个多尺度卷积操作和一个卷积注意力模块,并且在每个多尺度卷积操作结束后应用GELU激活函数。最终得到多个具有注意力表现的多尺度特征的输出数据,每个输出对应一种被选择的周期。具体的步骤如下(以一个卷积块为例):Three two-dimensional data with periodic features are cyclically input into the multi-scale convolution module. Each multi-scale convolution module contains two multi-scale convolution operations and one convolution attention module, and the GELU activation function is applied after each multi-scale convolution operation. Finally, multiple output data with multi-scale features of attention performance are obtained, and each output corresponds to a selected period. The specific steps are as follows (taking a convolution block as an example):
Step 1:将当前循环的三个具有周期特征的二维数据进行输入,经过一个多尺度卷积模块,得到三个尺度特征Feature1,Feature2,Feature3;如图2所述多尺度卷积模块包括1×3,3×1,1×1大小的卷积核,将传统的3×3大小的卷积核拆分成1×3的卷积核和3×1的卷积核是为了减少模型计算量。同时为了捕获多尺度特征,引入不同的扩张率r={1,2,3}。在这个模块中一共有2×3+1=7个卷积操作并行进行。同时为了保证并行卷积输出的形状完全相同,需要在卷积时设计相应的填充。Step 1: Input the three two-dimensional data with periodic features of the current cycle, and pass through a multi-scale convolution module to obtain three scale features Feature 1 , Feature 2 , and Feature 3 ; as shown in Figure 2, the multi-scale convolution module includes convolution kernels of 1×3, 3×1, and 1×1. The traditional 3×3 convolution kernel is split into 1×3 convolution kernels and 3×1 convolution kernels to reduce the amount of model calculation. At the same time, in order to capture multi-scale features, different expansion rates r={1,2,3} are introduced. In this module, a total of 2×3+1=7 convolution operations are performed in parallel. At the same time, in order to ensure that the shapes of the parallel convolution outputs are exactly the same, it is necessary to design corresponding padding during convolution.
Step 2:Step 1中的并行卷积全部完成后,得到的多个输出沿着一个新的维度进行堆叠产生一个新的维度,然后在这个新维度上求均值,得到多尺度卷积的输出结果,并对输出结果使用GELU激活函数得到最终结果XH*W*C;这个维度表示的就是多尺度卷积模块中设计的卷积核的数量。Step 2: After all the parallel convolutions in Step 1 are completed, the multiple outputs are stacked along a new dimension to generate a new dimension, and then the average is calculated on this new dimension to obtain the output result of the multi-scale convolution, and the GELU activation function is used on the output result to obtain the final result X H*W*C ; this dimension represents the number of convolution kernels designed in the multi-scale convolution module.
XH*W*C=GELU(Avg(Stack(Feature1,Feature2,Feature3))X H*W*C =GELU(Avg(Stack(Feature 1 ,Feature 2 ,Feature 3 ))
Step 3:经过Step 1和Step 2的多尺度卷积模块以及激活函数后,对输出分别进行空间注意力和通道注意力的计算。Step 3: After the multi-scale convolution modules and activation functions of Step 1 and Step 2, the spatial attention and channel attention are calculated on the output respectively.
如图3所述通道注意力的计算方法是先将经过步骤3-2的最终结果XH*W*C沿着通道分别进行平均池化AvgPooling和最大池化MaxPooling,得到两个通道权重Ac和Mc,然后这两个通道权重经过一个共享的MLP得到各自新的注意力权重A'c和M'c,随后经过相加和sigmoid函数映射得到最终的通道注意力ChannelAttention(XH*W*C);As shown in FIG3 , the calculation method of channel attention is to first perform average pooling AvgPooling and maximum pooling MaxPooling along the channel on the final result X H*W*C after step 3-2, and obtain two channel weights A c and Mc . Then, these two channel weights are passed through a shared MLP to obtain their respective new attention weights A' c and Mc ' c , and then the final channel attention ChannelAttention(X H*W*C ) is obtained by addition and sigmoid function mapping.
ChannelAttention(XH*W*C)=Sigmoid(A'c+M'c)ChannelAttention(X H*W*C )=Sigmoid(A' c +M' c )
如图4空间注意力的计算方法是XH*W*C沿着通道对空间特征图上进行平均池化和最大池化,然后将两个特征输出沿着一个新的维度进行堆叠,将堆叠后的数据经过一个点卷积最后经过sigmoid得到最终的空间注意力。As shown in Figure 4, the calculation method of spatial attention is to perform average pooling and maximum pooling on the spatial feature map along the channel X H*W*C , then stack the two feature outputs along a new dimension, pass the stacked data through a point convolution and finally pass through sigmoid to obtain the final spatial attention.
Step 4:将Step 2得到的最终输出XH*W*C先乘以Step 3中计算的通道注意力ChannelAttention(XH*W*C),然后再乘以Step 3中计算的空间注意力SpatialAttention(XH*W*C)得到最终基于注意力的特征输出X2。Step 4: Multiply the final output X H*W*C obtained in Step 2 by the channel attention ChannelAttention(X H*W*C ) calculated in Step 3, and then multiply it by the spatial attention SpatialAttention(X H*W*C ) calculated in Step 3 to obtain the final attention-based feature output X2.
X1=XH*W*C×ChannelAttention(XH*W*C)X1=X H*W*C ×ChannelAttention(X H*W*C )
X2=X1×SpatialAttention(XH*W*C)X2=X1×SpatialAttention(X H*W*C )
Step 5:将Step 4的结果X2作为多尺度卷积模块的输入,重复进行步骤Step 1和Step 2操作,得到最终的输出 Step 5: Use the result X2 of Step 4 as the input of the multi-scale convolution module, repeat Step 1 and Step 2 to get the final output
步骤(3)、基于自适应权重的特征融合:基于二维解释扩展模块中FFT返回的对应周期的幅值大小来实现多周期特征的融合。Step (3), feature fusion based on adaptive weights: The fusion of multi-periodic features is achieved based on the amplitude of the corresponding period returned by FFT in the two-dimensional interpretation extension module.
Step 1:将每个选择周期Tk对应的基于周期的二维数据还原成一维数据Xk,并且裁切到原始窗口大小,超出窗口的时间点上对应的值被舍弃。Step 1: The cycle-based two-dimensional data corresponding to each selected cycle T k The data is restored to one-dimensional data X k and cut to the original window size. The corresponding values at time points beyond the window are discarded.
Step 2:将每个选择周期Tk对应的一维特征图Xk沿着一个维度堆叠,然后乘以先前工作中保留的权重矩阵W,最终形成一个基于多周期融合的特征输出。Step 2: The one-dimensional feature map Xk corresponding to each selection cycle Tk is stacked along one dimension and then multiplied by the weight matrix W retained in the previous work to finally form a feature output based on multi-cycle fusion.
Step 3:将Step 2得到的输出加上最原始的二维扩展模块中的Step 4得到多周期特征的融合结果,将其作为输出。这里是采用了一个残差设计块的思想。Step 3: Add the output of Step 2 to the original Step 4 in the two-dimensional expansion module to obtain the fusion result of multi-period features, which is used as the output. Here, the idea of a residual design block is adopted.
步骤(4)、线性分类:对多周期特征的融合结果依次进行层归一化和GELU激活。设置dropout参数为0.2防止模型过拟合,最后展平输入到全连接层,全连接层的输出维度为2,对应发生两种状态的分数,状态是该样本中是否存在故障电弧。Step (4), linear classification: The fusion results of multi-cycle features are layer normalized and GELU activated in turn. The dropout parameter is set to 0.2 to prevent the model from overfitting, and finally the flattened input is sent to the fully connected layer. The output dimension of the fully connected layer is 2, corresponding to the scores of the two states. The state is whether there is a fault arc in the sample.
对上述模型进行训练,本发明使用的损失函数是交叉熵损失函数,设计的优化方法是Adam优化器,批次大小为128,学习率的初始大小为0.001,同时设计了一个学习率调度器,以step_size=5来更新学习率,以设定的gamma=0.2来减小学习率。早停法来对训练过程进行监控,发现有5次epoch中验证集的损失值没有下降一定的阈值就终止训练,并保留最好的三次模型输出结果。实验所采用的数据集是以10kHZ分辨率进行采集,然后划分成了HR-single和HR-mix两个数据集,其中HR-single数据集中包含有六种不同的电器的独立采集数据,分别是电水壶、洗碗机、冰箱、微波炉、电饭煲和电磁炉,HR-mix是这些电器的九种不同组合情况。高分辨率采集数据的验证集上训练过程的损失率、准确率变化曲线,见图5、图6。为了证明模块有效性,分别对模型的周期选择部分还有注意力卷积模块进行了消融实验并绘制ROC曲线,见图7,其中w/a表示去除注意力卷积部分,w/p表示去除周期选择部分,w/a+p表示两者均去除。The above model is trained. The loss function used in the present invention is the cross entropy loss function. The optimization method designed is the Adam optimizer. The batch size is 128, the initial size of the learning rate is 0.001, and a learning rate scheduler is designed to update the learning rate with step_size=5 and reduce the learning rate with the set gamma=0.2. The early stopping method is used to monitor the training process. It is found that the loss value of the validation set in 5 epochs does not drop a certain threshold, so the training is terminated and the best three model output results are retained. The data set used in the experiment is collected at a resolution of 10kHZ, and then divided into two data sets, HR-single and HR-mix. The HR-single data set contains independent collection data of six different electrical appliances, namely electric kettles, dishwashers, refrigerators, microwave ovens, rice cookers and induction cookers, and HR-mix is nine different combinations of these appliances. The loss rate and accuracy change curves of the training process on the validation set of high-resolution collection data are shown in Figures 5 and 6. In order to prove the effectiveness of the module, ablation experiments were carried out on the cycle selection part and the attention convolution module of the model and the ROC curve was plotted, as shown in Figure 7, where w/a means removing the attention convolution part, w/p means removing the cycle selection part, and w/a+p means removing both.
本发明实施例提供了一种电子设备,具体的,该电子设备包括存储器和处理器,所述存储器中存储有可执行代码,所述处理器执行所述可执行代码时,实现所述实施方式的任一项所述的方法。An embodiment of the present invention provides an electronic device. Specifically, the electronic device includes a memory and a processor. The memory stores executable code. When the processor executes the executable code, the method described in any one of the implementation modes is implemented.
其中,存储器可能包含高速随机存取存储器(RAM,Random Access Memory),也可能还包括非不稳定的存储器(Non-volatile Memory),例如至少一个磁盘存储器。通过至少一个通信接口(可以是有线或者无线)实现该系统网元与至少一个其他网元之间的通信连接,可以使用互联网,广域网,本地网,城域网等。The memory may include high-speed random access memory (RAM), and may also include non-volatile memory (Non-volatile Memory), such as at least one disk memory. The communication connection between the system network element and at least one other network element is realized through at least one communication interface (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used.
总线可以是ISA总线、PCI总线或EISA总线等。所述总线可以分为地址总线、数据总线、控制总线等。The bus may be an ISA bus, a PCI bus or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc.
其中,存储器用于存储程序,所述处理器在接收到执行指令后,执行所述程序,前述本发明实施例任一实施例揭示的流过程定义的装置所执行的方法可以应用于处理器中,或者由处理器实现。The memory is used to store the program, and the processor executes the program after receiving the execution instruction. The method executed by the device for flow process definition disclosed in any of the embodiments of the present invention can be applied to the processor or implemented by the processor.
处理器可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器可以是通用处理器,包括中央处理器(Central Processing Unit,CPU)、网络处理器(Network Processor,NP)等;还可以是数字信号处理器(Digital Signal Processing,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable GateArray,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本发明实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本发明实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器,处理器读取存储器中的信息,结合其硬件完成上述方法的步骤。The processor may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor or an instruction in the form of software. The above processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present invention can be directly embodied as a hardware decoding processor to be executed, or a combination of hardware and software modules in the decoding processor to be executed. The software module may be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
本发明实施例所提供的可读存储介质的计算机程序产品,包括存储了程序代码的计算机可读存储介质,所述程序代码包括的指令可用于执行前面方法实施例中所述的方法,具体实现可参见前述方法实施例,在此不再赘述。The computer program product of the readable storage medium provided in the embodiment of the present invention includes a computer-readable storage medium storing program code, and the instructions included in the program code can be used to execute the method described in the previous method embodiment. The specific implementation can be referred to the previous method embodiment, which will not be repeated here.
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
最后应说明的是:以上所述实施例,仅为本发明的具体实施方式,用以说明本发明的技术方案,而非对其限制,本发明的保护范围并不局限于此,尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,其依然可以对前述实施例所记载的技术方案进行修改或可轻易想到变化,或者对其中部分技术特征进行等同替换;而这些修改、变化或者替换,并不使相应技术方案的本质脱离本发明实施例技术方案的精神和范围,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应所述以权利要求的保护范围为准。Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410025431.7A CN117909818A (en) | 2024-01-08 | 2024-01-08 | Arc fault identification method and system based on multi-cycle features and multi-scale convolution |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410025431.7A CN117909818A (en) | 2024-01-08 | 2024-01-08 | Arc fault identification method and system based on multi-cycle features and multi-scale convolution |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117909818A true CN117909818A (en) | 2024-04-19 |
Family
ID=90684919
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410025431.7A Pending CN117909818A (en) | 2024-01-08 | 2024-01-08 | Arc fault identification method and system based on multi-cycle features and multi-scale convolution |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117909818A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118707253A (en) * | 2024-08-28 | 2024-09-27 | 深圳市航天泰瑞捷电子有限公司 | Arc detection method, device, electronic equipment and storage medium |
-
2024
- 2024-01-08 CN CN202410025431.7A patent/CN117909818A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118707253A (en) * | 2024-08-28 | 2024-09-27 | 深圳市航天泰瑞捷电子有限公司 | Arc detection method, device, electronic equipment and storage medium |
CN118707253B (en) * | 2024-08-28 | 2025-01-03 | 深圳市航天泰瑞捷电子有限公司 | Arc detection method, device, electronic equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107101813B (en) | A kind of frame-type circuit breaker mechanical breakdown degree assessment method based on vibration signal | |
CN110048827B (en) | Class template attack method based on deep learning convolutional neural network | |
CN110174610B (en) | A method for obtaining the electrical life of AC contactors based on convolutional neural network | |
Zheng et al. | A fabric defect detection method based on improved yolov5 | |
CN111954250B (en) | A Lightweight Wi-Fi Behavior Awareness Method and System | |
Liu et al. | Multi-feature fusion for fault diagnosis of rotating machinery based on convolutional neural network | |
CN110726898A (en) | Power distribution network fault type identification method | |
Yang et al. | Fault classification in distribution systems using deep learning with data preprocessing methods based on fast dynamic time warping and short-time Fourier transform | |
CN117909818A (en) | Arc fault identification method and system based on multi-cycle features and multi-scale convolution | |
CN116973684B (en) | Fault diagnosis method and system for high-voltage direct-current transmission system based on DRN model | |
CN113239949A (en) | Data reconstruction method based on 1D packet convolutional neural network | |
CN116796275A (en) | Multi-mode time sequence anomaly detection method for industrial equipment | |
CN115792729A (en) | Transformer composite fault diagnosis method, device, equipment and storage medium | |
CN115015683A (en) | Cable production performance test method, device, equipment and storage medium | |
CN108764541B (en) | A wind energy prediction method combining spatiotemporal features and error processing | |
CN116227878A (en) | Power load decomposition analysis method, system, computer device and storage medium | |
CN117972701B (en) | Anti-confusion malicious code classification method and system based on multi-feature fusion | |
CN117404853B (en) | External circulating water cooling system and method for tunnel boring machine | |
Wang et al. | First-order differential filtering spectrum division method and information fusion multi-scale network for fault diagnosis of bearings under different loads | |
CN115828248B (en) | Malicious code detection method and device based on interpretive deep learning | |
CN118212417A (en) | Medical image segmentation model based on lightweight attention module and model training method | |
CN113468704B (en) | Intermittent arc fault detection method and related device | |
CN114372526B (en) | Data recovery method, system, computer equipment and storage medium | |
CN116338348A (en) | Adaptive detection method for variable DC fault arc based on similarity measure and transfer learning | |
CN115130520A (en) | Circuit fault diagnosis method and system based on multi-line association |
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 |