



技术领域technical field
本发明涉及铁路货车图像识别与故障检测技术领域,特别涉及一种基于深度学习的铁路货车轴承甩油故障检测方法。The invention relates to the technical field of image recognition and fault detection of railway freight cars, in particular to a method for detecting oil rejection faults of railway freight cars based on deep learning.
背景技术Background technique
随着国民经济的发展与铁路运输需求的不断提高,铁路货运规模不断扩大,而铁路货车故障直接影响了列车运行安全。滚动轴承作为铁路货车侧架的重要组成部位,容易出现甩油、挡键丢失等故障,轻则影响列车行驶,重则造成行车事故。With the development of the national economy and the increasing demand for railway transportation, the scale of railway freight is expanding, and the failure of railway freight cars directly affects the safety of train operation. As an important part of the side frame of railway freight cars, rolling bearings are prone to failures such as oil rejection and loss of gear keys, which may affect the running of the train in light, and cause driving accidents in serious cases.
通常情况下,铁路货车的故障检测是通过动态检车员与高速摄像机抓拍系统相结合的方式来完成的。动态检车员通过检查高速摄像机抓拍后的图像,肉眼判断货车是否出现故障,对故障部位进行标记,从而对重点故障进行预报,保障货车的运行安全。此种情况下,动态检车员每天需要查看大量重复的整车图片,极其容易产生视觉疲惫从而导致人工漏判、误判。Usually, the fault detection of railway freight cars is completed by the combination of dynamic inspectors and high-speed camera capture systems. By checking the images captured by the high-speed camera, the dynamic inspector can visually judge whether the truck is faulty, and mark the fault location, so as to predict the key faults and ensure the safe operation of the truck. In this case, the dynamic vehicle inspector needs to view a large number of repeated pictures of the whole vehicle every day, which is extremely prone to visual fatigue, resulting in manual missed judgment and misjudgment.
因此需要设计一种准确度高、实时性高的自动化检测方法。Therefore, it is necessary to design an automatic detection method with high accuracy and high real-time performance.
发明内容SUMMARY OF THE INVENTION
发明目的:本发明的目的是为了解决现有的铁路货车轴承甩油故障识别只能由人工肉眼完成的问题,提出了一种基于深度学习的铁路货车轴承甩油故障检测方法,节省了人力物力,方便铁路动态检车员迅速进行故障排查。Purpose of the invention: The purpose of the present invention is to solve the problem that the identification of the oil rejection failure of the existing railway freight car bearing can only be completed by artificial eyes, and proposes a deep learning-based detection method for the oil rejection failure of the railway freight car bearing, which saves manpower and material resources. , which is convenient for railway dynamic inspectors to quickly troubleshoot faults.
技术方案:本发明为实现上述目的采用如下技术方案:一种基于深度学习的铁路货车轴承甩油故障检测方法,其特征在于,所述检测方法包括以下步骤:Technical scheme: The present invention adopts the following technical scheme to achieve the above-mentioned purpose: a deep learning-based method for detecting oil rejection failure of railway freight car bearings, characterized in that the detection method comprises the following steps:
S1:获取轴承区域图像,利用所述图像构建训练集;S1: Obtain an image of the bearing area, and use the image to construct a training set;
S2:搭建轴承甩油故障检测网络;S2: Build a bearing oil rejection fault detection network;
S3:对所述训练集进行预处理,分批送入所述故障检测网络进行训练,通过调整参数得到最终的故障检测模型;S3: Preprocess the training set, send it to the fault detection network in batches for training, and obtain a final fault detection model by adjusting parameters;
S4:获取待检测图像,处理后输入所述故障检测模型,计算异常分数,得到轴承甩油故障检测结果。S4: Obtain the image to be detected, input the fault detection model after processing, calculate the abnormal score, and obtain the bearing oil rejection fault detection result.
优选的,步骤S1中首先通过高速摄像机获取铁路货车运行时的整车图像,包括侧架、中间部、车钩钩缓部位,之后进行部位筛选,选取包含轴承的侧架部位的图像,对获取的侧架部位的图像使用霍夫圆变换进行圆检测,通过设置不同的半径阈值过滤干扰的圆形,定位到侧架部位的轴承区域,将轴承区域进行裁剪,剪裁后的多个轴承区域图像组成故障检测网络的训练集。Preferably, in step S1, firstly, a high-speed camera is used to obtain an image of the entire vehicle when the railway freight car is running, including the side frame, the middle part, and the coupler and coupler buffer part, and then the parts are screened, and the image of the part of the side frame including the bearing is selected. The image of the side frame is detected by Hough circle transformation, and the interfering circles are filtered by setting different radius thresholds, and the bearing area of the side frame is located, and the bearing area is cropped. The training set of the fault detection network.
优选的,步骤2中基于深度异常检测算法的研究搭建轴承甩油图像故障检测网络,其由编码器Encoder1、解码器Decoder、编码器Encoder2与判别器Discriminator组成;Preferably, in step 2, a bearing oil rejection image fault detection network is built based on the research of the deep anomaly detection algorithm, which is composed of an encoder Encoder1, a decoder Decoder, an encoder Encoder2 and a discriminator Discriminator;
其中:编码器Encoder1由4个卷积层与1个全连接层组成,输入图像通过编码器Encoder1编码为隐空间向量z1;Among them: the encoder Encoder1 is composed of 4 convolutional layers and 1 fully connected layer, and the input image is encoded into a latent space vector z1 by the encoder Encoder1;
解码器Decoder由1个全连接层与4个反卷积层组成,将隐空间向量z1输入解码器,解码成为重建图像;The decoder Decoder is composed of 1 fully connected layer and 4 deconvolution layers. The latent space vector z1 is input to the decoder and decoded into a reconstructed image;
编码器Encoder2:编码器Encoder2由4个卷积层与1个全连接层组成,步骤S32生成的重建图像输入编码器Encoder2中,编码为隐空间向量z2;Encoder Encoder2: Encoder Encoder2 consists of 4 convolutional layers and 1 fully connected layer, the reconstructed image generated in step S32 is input into encoder Encoder2, and encoded as a latent space vector z2 ;
判别器Discriminator:判别器Discriminator由4个卷积层与1个全连接层组成,其接收尺寸为64×64×3的输入图像,输出其真实性得分,该得分代表了该输入图像的真实概率。Discriminator Discriminator: The discriminator Discriminator consists of 4 convolutional layers and 1 fully connected layer. It receives an input image of
优选的,重建损失lr的获取:重建损失是由真实图像与重建图像的差距构成,其中真实图像为正常输入图像,重建图像为解码器Decoder的输出:Preferably, the acquisition of the reconstruction loss lr : the reconstruction loss is composed of the difference between the real image and the reconstructed image, where the real image is a normal input image, and the reconstructed image is the output of the decoder:
编码损失le的获取:编码损失是由隐空间向量z1与z2的差异构成,其中z1是编码器Encoder1的输出,z2是编码器Encoder2的输出:Acquisition of encoding loss le : The encoding loss is composed of the difference between the latent space vector z1 and z2 , where z1 is the output of the encoder Encoder1, and z2 is the output of the encoder Encoder2:
le=||z1-z2||2le =||z1 -z2 ||2
对抗损失ld的获取:对抗损失是常规的生成对抗网络中判别器的损失,其由输入图像和重建图像经过判别器Discriminator的特征输出差异构成,两者的差异通过二分类的交叉熵代价函数衡量:The acquisition of the adversarial loss ld: Theadversarial loss is the loss of the discriminator in the conventional generative adversarial network, which is composed of the difference of the feature output of the input image and the reconstructed image through the discriminator, and the difference between the two is passed through the two-class cross entropy cost function measure:
故障检测网络整体损失函数:The overall loss function of the fault detection network:
ltotal=lr+le+ld。ltotal = lr + le + ld .
优选的,步骤S4中首先对获取的侧架部位的图像使用霍夫圆变换进行圆检测,通过设置不同的半径阈值过滤干扰的圆形,定位到侧架部位的轴承区域,将轴承区域进行裁剪,将图像送至故障检测模型;计算异常分数的方法为:编码异常判别机制、重建异常判别机制或融合异常判别机制。Preferably, in step S4, the obtained image of the side frame is firstly detected by using Hough circle transform, and the disturbing circles are filtered by setting different radius thresholds, the bearing area of the side frame is located, and the bearing area is cropped , and send the image to the fault detection model; the method of calculating the abnormality score is: encoding the abnormality discrimination mechanism, reconstructing the abnormality discrimination mechanism or merging the abnormality discrimination mechanism.
优选的,所述编码异常判别机制计算异常分数表示为:Preferably, the abnormal score calculated by the coding abnormality discrimination mechanism is expressed as:
首先输入图像经过编码器Encoder1产生隐空间向量z1,其次z1经过解码器Decoder与编码器Encoder2得到对应的隐空间向量z2,计算得到z1与z2两者的差异,之后进行规范化即可得到异常分数,其中scoremin和scoremax分别是训练集图像提前输入检测模型得到的分数最小值与最大值;First, the input image passes through the encoder Encoder1 to generate the latent space vector z1 , and then the z1 passes through the decoder Decoder and the encoder Encoder2 to obtain the corresponding latent space vector z2 , and calculates the difference between z1 and z2 , and then normalizes it, i.e. The abnormal score can be obtained, where scoremin and scoremax are the minimum and maximum scores obtained by the training set image input to the detection model in advance;
对于重建异常判别机制,异常分数表示为:For the reconstruction anomaly discrimination mechanism, the anomaly score is expressed as:
重建判别机制代表输入图像与重建图像的差异:首先输入图像经过编码器Encoder1与解码器Decoder得到重建图像,计算得到输入图像与重建图像的差异,之后进行规范化即可得到异常分数。The reconstruction discrimination mechanism represents the difference between the input image and the reconstructed image: first, the input image is passed through the encoder Encoder1 and the decoder Decoder to obtain the reconstructed image, and the difference between the input image and the reconstructed image is calculated, and then normalized to obtain the abnormal score.
优选的,对于融合异常判别机制,异常分数表示为:Preferably, for the fusion anomaly discrimination mechanism, the anomaly score is expressed as:
At=Ar+αAe,其中α为待优化参数。At =A r+ αAe , where α is the parameter to be optimized.
有益效果:与现有技术相比,本发明的技术方案具有以下有益技术效果:Beneficial effects: compared with the prior art, the technical solution of the present invention has the following beneficial technical effects:
1.本发明设计了一种基于深度学习的铁路货车轴承甩油故障检测方法,该方法是准确率高、实时性高的自动化检测方法,其解决了现阶段只能通过动态检车员肉眼识别图像判断故障带来的视觉疲劳造成误检漏检的问题。1. The present invention designs a deep learning-based method for detecting oil rejection of railway freight car bearings. The method is an automatic detection method with high accuracy and high real-time performance, which solves the problem that the current stage can only be identified by the naked eye of dynamic vehicle inspectors. The visual fatigue caused by the image judgment failure causes the problem of false detection and missed detection.
2.相较于目前主流的故障检测算法,本方法以深度卷积神经网络为基础,采取了自编码器与生成对抗网络的结构,自编码器与生成对抗网络结合能够较为自然地重建特定分布的图片,这对于故障检测具有更为强大的特征提取能力。2. Compared with the current mainstream fault detection algorithms, this method is based on a deep convolutional neural network, and adopts the structure of an autoencoder and a generative adversarial network. The combination of the autoencoder and the generative adversarial network can more naturally reconstruct a specific distribution. , which has more powerful feature extraction capability for fault detection.
3.对比于目前大多数故障检测算法,本发明采用的数据集均无需标注,同时都是轴承正常数据,也即只采用正常的无标注图片即可训练出轴承甩油故障检测网络。本发明解决了故障数据难以获得、标注成本较大等难题。3. Compared with most current fault detection algorithms, the data sets used in the present invention do not need to be marked, and are all bearing normal data, that is, only normal unmarked pictures can be used to train a bearing oil rejection fault detection network. The present invention solves the problems such as difficulty in obtaining fault data and high labeling cost.
4.本发明设计了三种异常判别机制,其中融合异常判别机制既考虑到了图像重建差异又能够兼顾图像在高维空间的编码差异,能够提供更为可靠的故障检测结果。4. The present invention designs three anomaly discrimination mechanisms, among which the fusion anomaly discrimination mechanism takes into account both image reconstruction differences and image coding differences in high-dimensional space, and can provide more reliable fault detection results.
附图说明Description of drawings
图1是本发明的算法流程图。Fig. 1 is the algorithm flow chart of the present invention.
图2是本发明的网络结构图。Fig. 2 is a network structure diagram of the present invention.
图3是本发明的编码器Encoder结构示意图。FIG. 3 is a schematic structural diagram of the encoder Encoder of the present invention.
图4是本发明的解码器Decoder结构示意图。FIG. 4 is a schematic structural diagram of the decoder Decoder of the present invention.
具体实施方式Detailed ways
下面结合附图和具体的实施方式对本发明作进一步说明。The present invention will be further described below with reference to the accompanying drawings and specific embodiments.
如图1所示,本发明针对铁路货车轴承甩油故障识别只能由人工肉眼完成的问题,提出了一种基于深度学习的铁路货车轴承甩油故障检测方法,提高了检测准确率,节省了人力物力。As shown in Figure 1, the present invention aims at the problem that identification of oil rejection faults of railway freight car bearings can only be completed by artificial eyes, and proposes a deep learning-based method for detecting oil rejection failures of railway freight car bearings, which improves the detection accuracy and saves money. Human and material resources.
具体实施方式一Specific implementation one
一种基于深度学习的铁路货车轴承甩油故障检测方法,包括如下步骤:A deep learning-based method for detecting oil rejection faults in bearings of railway freight cars, comprising the following steps:
步骤S1:通过高速摄像机获取铁路货车运行时的整车图像,其中有侧架、中间部I、中间部II、车钩钩缓等多个部位,通过图像命名规则进行部位筛选,只选取包含轴承的侧架部位的图像,图像的尺寸为1400×1024×3。Step S1: Obtain the whole vehicle image of the railway freight car during operation through the high-speed camera, including multiple parts such as the side frame, the middle part I, the middle part II, the coupler and the coupler, and screen the parts according to the image naming rules, and only select the parts containing the bearing. The image of the side frame, the size of the image is 1400×1024×3.
步骤S2:对上述侧架部位的图像使用霍夫圆变换进行圆检测,通过设置不同的半径阈值过滤干扰的圆形,从而定位到侧架部位的轴承区域,将轴承区域进行裁剪,组成故障检测网络的训练集。本发明最终采取的半径阈值为150~180像素点。Step S2: Use Hough circle transformation to perform circle detection on the image of the above-mentioned side frame part, filter the interfering circles by setting different radius thresholds, so as to locate the bearing area of the side frame part, and cut the bearing area to form a fault detection The training set of the network. The radius threshold finally adopted by the present invention is 150-180 pixels.
步骤S3:基于深度异常检测算法的研究搭建轴承甩油图像故障检测网络,其由编码器Encoder1、解码器Decoder、编码器Encoder2与判别器Discriminator组成,之后根据不同网络组件的输出计算重建损失lr、编码损失le、对抗损失ld,用于后续训练帮助网络收敛。Step S3: Based on the research of deep anomaly detection algorithm, build a bearing oil rejection image fault detection network, which is composed of encoder Encoder1, decoder Decoder, encoder Encoder2 and discriminator Discriminator, and then calculate the reconstruction loss lr according to the output of different network components , encoding lossle , and adversarial lossld , which are used for subsequent training to help the network converge.
步骤S31:编码器Encoder1由4个卷积层与1个全连接层组成,输入图像通过编码器Encoder1编码为隐空间向量z1。具体来说:本发明采用的输入图像尺寸为64×64×3,经过4个卷积层(卷积核数量分别为64–128–256–512),其中激活函数为LeakReLU,再经过1个全连接层编码为尺寸1×128的隐空间向量z1,代表输入图像在高维隐空间的映射。Step S31 : the encoder Encoder1 is composed of four convolutional layers and one fully connected layer, and the input image is encoded into a latent space vector z1 by the encoder Encoder1 . Specifically: the size of the input image used in the present invention is 64×64×3, and after 4 convolution layers (the number of convolution kernels are 64–128–256–512 respectively), the activation function is LeakReLU, and then 1 The fully connected layer is encoded as a latent space vector z1 of
步骤S32:解码器Decoder由1个全连接层与4个反卷积层组成,将隐空间向量z1输入解码器,解码成为重建图像。具体来说:输入隐空间向量尺寸z1为1×128,经过1个全连接层进行预处理,之后经过4个卷积层(卷积核数量分别为512,256,128,64),其中每一层卷积层进行Batch Normalization操作,激活函数为ReLU,最终生成尺寸为64×64×3的重建图像。Step S32: The decoder Decoder consists of one fully connected layer and four deconvolution layers, and inputs the latent space vector z1 into the decoder, and decodes it into a reconstructed image. Specifically: the input latent space vector size z1 is 1×128, which is preprocessed by 1 fully connected layer, and then 4 convolutional layers (the number of convolution kernels are 512, 256, 128, 64 respectively), in which each layer volume The multi-layer performs Batch Normalization operation, the activation function is ReLU, and finally generates a reconstructed image with a size of 64×64×3.
步骤S33:编码器Encoder2与编码器Encoder1结构相同,由4个卷积层与1个全连接层组成,步骤S32生成的重建图像输入编码器Encoder2中,编码为隐空间向量z2。具体来说:重建图像的尺寸为64×64×3,经过4个卷积层(卷积核数量分别为64,128,256,512),其中激活函数为LeakReLU,再经过1个全连接层编码为尺寸1×128的隐空间向量z2,代表重建图像在高维隐空间的映射。Step S33: The encoder Encoder2 has the same structure as the encoder Encoder1, and is composed of four convolutional layers and one fully connected layer. The reconstructed image generated in step S32 is input into the encoder Encoder2 and encoded as a latent space vector z2 . Specifically: the size of the reconstructed image is 64 × 64 × 3, after 4 convolution layers (the number of convolution kernels are 64, 128, 256, 512), the activation function is LeakReLU, and then 1 fully connected layer is encoded to size 1 × 128 The latent space vector z2 , represents the mapping of the reconstructed image in the high-dimensional latent space.
步骤S34:判别器Discriminator由4个卷积层与1个全连接层组成,其接收尺寸为64×64×3的输入图像,输出其真实性得分。具体来说,输入图像经过4个卷积层的特征提取,激活函数为LeakReLU,最终通过全连接层降维为1个真实性得分,该得分代表了该输入图像的真实概率。Step S34: The Discriminator is composed of 4 convolutional layers and 1 fully connected layer, which receives an input image with a size of 64×64×3, and outputs its authenticity score. Specifically, the input image undergoes feature extraction through 4 convolutional layers, the activation function is LeakReLU, and finally the fully connected layer is reduced to 1 authenticity score, which represents the true probability of the input image.
步骤S35:搭建轴承甩油故障检测网络以后,根据不同部件的输出能够得到三个损失函数:重建损失lr、编码损失le、对抗损失ld,用于后续训练帮助网络收敛。Step S35: After building the bearing oil rejection fault detection network, three loss functions can be obtained according to the outputs of different components: reconstruction loss lr , coding lossle , and confrontation lossld , which are used for subsequent training to help the network converge.
步骤S351:重建损失是由真实图像与重建图像的差距构成,其中真实图像为正常输入图像,重建图像为解码器Decoder的输出,两者的差异通过L1距离衡量,而不是L2距离,因为根据L2距离生成的图像更为模糊。Step S351: The reconstruction loss is composed of the difference between the real image and the reconstructed image, where the real image is the normal input image, and the reconstructed image is the output of the decoder Decoder. The difference between the two is measured by the L1 distance, not the L2 distance, because according to L2 The distance produces a blurrier image.
步骤S352:编码损失是由隐空间向量z1与z2的差异构成,其中z1是编码器Encoder1的输出,z2是编码器Encoder2的输出,两者的差异代表输入图像和重建图像在高一层抽象空间中的差异,是由L2距离衡量。Step S352: The encoding loss is composed of the difference between the latent space vectors z1 and z2 , where z1 is the output of the encoder Encoder1, and z2 is the output of the encoder Encoder2, and the difference between the two represents the input image and the reconstructed image. The difference in one level of abstract space is measured by the L2 distance.
le=||z1-z2||2le =||z1 -z2 ||2
步骤S353:对抗损失是常规的生成对抗网络中判别器的损失,其由输入图像和重建图像经过判别器Discriminator的特征输出差异构成,两者的差异通过二分类的交叉熵代价函数衡量。Step S353: The adversarial loss is the loss of the discriminator in the conventional generative adversarial network, which is composed of the difference of the feature output of the input image and the reconstructed image through the discriminator Discriminator, and the difference between the two is measured by the cross-entropy cost function of the binary classification.
步骤S4:对训练集进行数据增强、归一化等预处理操作,之后将训练集分批送入故障检测网络进行训练,本发明模型在TESLA V100 16GB GPU上进行训练,通过多次训练,选取最优参数得到故障检测模型。Step S4: perform preprocessing operations such as data enhancement and normalization on the training set, and then send the training set to the fault detection network in batches for training. The model of the present invention is trained on the TESLA V100 16GB GPU. The optimal parameters get the fault detection model.
步骤S41:对训练集进行数据增强操作:水平翻转、垂直翻转、灰度变换等,通过数据增强能够将少量的训练集增广为大量可用训练集。同时在图像送入网络前进行预处理:尺寸resize、数值范围归一化,加快网络前向传播速度。实验中设置batch_size为16,输入图像尺寸为64×64×3,归一化到[-1,1]。Step S41 : perform data augmentation operations on the training set: horizontal flip, vertical flip, grayscale transformation, etc. A small amount of training sets can be expanded into a large number of available training sets through data augmentation. At the same time, preprocessing is performed before the image is sent to the network: the size is resized, the value range is normalized, and the forward propagation speed of the network is accelerated. In the experiment, the batch_size is set to 16, the input image size is 64×64×3, and it is normalized to [-1,1].
步骤S42:故障检测网络训练过程:初始化网络参数、数据集分批送入进行前向传播、计算损失函数并反向传播、迭代优化参数。Step S42: The fault detection network training process: initialize network parameters, send the data set in batches for forward propagation, calculate the loss function and backpropagate, and iteratively optimize the parameters.
步骤S421:网络训练的第一步:初始化网络参数,本发明的网络采用正态分布初始化的方式对参数进行初始化。具体来说:根据步骤S3搭建各个网络组件,对卷积层的权重参数进行权值为0、标准差为0.02的正态分布初始化。Step S421 : the first step of network training: initialize network parameters, the network of the present invention initializes the parameters by means of normal distribution initialization. Specifically, each network component is built according to step S3, and the weight parameters of the convolution layer are initialized with a normal distribution with a weight value of 0 and a standard deviation of 0.02.
步骤S422:将数据集按照batch_size为16的设置分批送入网络进行前向传播。具体来说:输入图像通过编码器Encoder1编码得到隐空间向量z1,之后解码得到重建图像,重建图像再经过编码器Encoder2编码得到隐空间向量z2。其中输入图像与重建图像都通过判别器Discriminator得到特征。Step S422: Send the data set to the network in batches according to the setting of batch_size of 16 for forward propagation. Specifically: the input image is encoded by the encoder Encoder1 to obtain the latent space vector z1 , then decoded to obtain the reconstructed image, and the reconstructed image is encoded by the encoder Encoder2 to obtain the latent space vector z2 . Both the input image and the reconstructed image are characterized by the discriminator.
步骤S423:计算损失函数并反向传播。本发明模型最终将重建损失、编码损失、对抗损失结合使用,作为网络的整体损失函数。之后在编码器、解码器、判别器上进行反向传播,同时更新网络参数。Step S423: Calculate the loss function and backpropagate. The model of the present invention finally uses a combination of reconstruction loss, coding loss and confrontation loss as the overall loss function of the network. Afterwards, backpropagation is performed on the encoder, decoder, and discriminator, and the network parameters are updated at the same time.
ltotal=lr+le+ldltotal = lr + le + ld
步骤S43:按照步骤S42对故障检测网络进行多次训练,调整不同超参数获得不同实验结果。通过对比可以得到不同超参数对于网络训练效果的影响。本发明最终采用参数如下:,输入图片尺寸为64×64×3,epoch=100,batch_size=16,隐空间向量尺寸为1×128,学习率为0.0002,训练过程采用Adam优化器,其中β1=0.5,β2=0.999。Step S43: Perform multiple training on the fault detection network according to Step S42, and adjust different hyperparameters to obtain different experimental results. By comparison, the influence of different hyperparameters on the network training effect can be obtained. The parameters finally adopted in the present invention are as follows: the input picture size is 64×64×3, epoch=100, batch_size=16, the latent space vector size is 1×128, the learning rate is 0.0002, and the Adam optimizer is used in the training process, where β1 =0.5, β2 =0.999.
步骤S5:对于新的待检测图像,经过步骤S2处理后送入训练好的故障检测模型,计算异常分数判断是否出现异常。Step S5: For the new image to be detected, after being processed in Step S2, it is sent to the trained fault detection model, and an abnormality score is calculated to determine whether an abnormality occurs.
步骤S51:对于给定新的待检测图像,首先判断图像部位是否为侧架部位,如果是则进行霍夫圆检测、裁剪出轴承区域。Step S51: For a given new image to be detected, first determine whether the image part is a side frame part, and if so, perform Hough circle detection and cut out the bearing area.
步骤S52:将待检测图像的轴承区域Resize为64×64×3,输入训练好的故障检测模型,之后计算异常分数来判断是否为轴承甩油故障。本发明主要设计了三种异常判别机制,分别为编码异常判别机制、重建异常判别机制与融合异常判别机制,在该实施方式中采取编码异常判别机制,异常分数表示为:Step S52 : Resize the bearing area of the image to be detected to 64×64×3, input the trained fault detection model, and then calculate the abnormal score to determine whether it is a bearing oil rejection fault. The present invention mainly designs three kinds of abnormality discrimination mechanisms, namely, the coding abnormality discrimination mechanism, the reconstruction abnormality discrimination mechanism and the fusion abnormality discrimination mechanism. In this embodiment, the coding abnormality discrimination mechanism is adopted, and the abnormality score is expressed as:
首先输入图像经过编码器Encoder1产生高维的隐空间向量z1,其次z1经过解码器Decoder与编码器Encoder2得到对应的高维的隐空间向量z2,计算得到z1与z2两者的差异,之后进行规范化即可得到异常分数,其中scoremin和scoremax分别是训练集图像提前输入检测模型得到的分数最小值与最大值。First, the input image passes through the encoder Encoder1 to generate a high-dimensional latent space vector z1 , and then z1 passes through the decoder Decoder and the encoder Encoder2 to obtain the corresponding high-dimensional latent space vector z2 , and calculates the difference between z1 and z2 The difference is then normalized to get the abnormal score, where scoremin and scoremax are the minimum and maximum scores obtained by the training set image input to the detection model in advance.
具体实施方式二:Specific implementation two:
本实施方式与具体实施方式一不同之处在于,步骤S5中采取的异常判别机制为重建异常判别机制,异常分数表示为:The difference between this embodiment and the first embodiment is that the abnormality discrimination mechanism adopted in step S5 is the reconstruction abnormality discrimination mechanism, and the abnormality score is expressed as:
重建判别机制代表输入图像与重建图像的差异。首先输入图像经过编码器Encoder1与解码器Decoder得到重建图像,计算得到输入图像与重建图像的差异,之后进行规范化即可得到异常分数。The reconstruction discrimination mechanism represents the difference between the input image and the reconstructed image. First, the input image passes through the encoder Encoder1 and the decoder Decoder to obtain the reconstructed image, and the difference between the input image and the reconstructed image is calculated, and then normalized to obtain the abnormal score.
具体实施方式三Specific embodiment three
本实施方式与具体实施方式一不同之处在于,步骤S5中采取的异常判别机制为融合异常判别机制,异常分数表示为:The difference between this embodiment and the
At=Ar+αAeAt =A r+ αAe
融合异常判别机制结合了编码异常判别机制与重建异常判别机制,通过调整参数α能够获得更高的故障检测性能,本发明最终采取α为0.5取得最优检测结果。The fusion anomaly discrimination mechanism combines the coding anomaly discrimination mechanism and the reconstruction anomaly discrimination mechanism. By adjusting the parameter α, higher fault detection performance can be obtained. The present invention finally adopts α as 0.5 to obtain the optimal detection result.
步骤S6:上述不同的具体实施方式采用了不同的异常判别机制,通过对三种机制的研究与对比实验,进一步优化故障检测模型。Step S6: The above-mentioned different specific implementations adopt different abnormality discrimination mechanisms, and the fault detection model is further optimized through research and comparative experiments on the three mechanisms.
步骤S61:对于二分类的模型评估指标定义如下:Step S61: The model evaluation index for the binary classification is defined as follows:
TP表示模型检测正确的故障的数量,FN表示模型预测错误的故障的数量,FP表示模型检测检测错误的正常的数量,TN表示模型预测正确的正常的数量。在这里假设故障代表正类,正常代表负类。TP represents the number of faults that the model detects correctly, FN represents the number of faults that the model predicts incorrectly, FP represents the number of normals that the model detects incorrectly, and TN represents the number of normals that the model predicts correctly. Here it is assumed that faults represent the positive class and normal represents the negative class.
TPR(True Positive Rate),真阳率,代表预测是故障实际也是故障的样本数,占实际总故障数的比例。其计算方式为:TPR (True Positive Rate), the true positive rate, represents the number of samples predicted to be faults that are actually faults, and the proportion of the actual total number of faults. It is calculated as:
FPR(False Positive Rate),假阳率,代表预测是故障但实际是正常的样本数,占实际正常总数的比例。其计算方式为:FPR (False Positive Rate), the false positive rate, represents the number of samples that are predicted to be faults but are actually normal, accounting for the proportion of the actual normal total. It is calculated as:
本发明使用AUC(Area Under Curve)对模型的故障检测能力进行评价,AUC为ROC(Receiver Operating Characteristic)曲线向下覆盖的面积值。ROC曲线的横轴是FPR,纵轴是TPR。AUC作为模型检测能力的量化值,能够客观评估模型的故障检测能力,该值越大,代表模型故障检测性能越高。The present invention uses AUC (Area Under Curve) to evaluate the fault detection capability of the model, where AUC is the area value covered downward by the ROC (Receiver Operating Characteristic) curve. The horizontal axis of the ROC curve is FPR, and the vertical axis is TPR. As a quantitative value of the model detection ability, AUC can objectively evaluate the fault detection ability of the model. The larger the value, the higher the fault detection performance of the model.
步骤S62:针对具体实施方式一、二、三采用的三种不同异常判别机制进行对比实验,结果如表1所示。Step S62: A comparative experiment is performed on the three different anomaly discrimination mechanisms adopted in the first, second, and third embodiments, and the results are shown in Table 1.
表1异常判别机制实验对比Table 1. Experimental comparison of abnormal discrimination mechanism
由表1对比结果发现采用融合异常判别机制能够获得更高的故障检测性能。From the comparison results in Table 1, it is found that the fusion anomaly discrimination mechanism can obtain higher fault detection performance.
本发明的上述算例仅为详细地说明本发明的计算模型和计算流程,而并非是对本发明的实施方式的限定。对于所属领域的普通技术人员来说,在上述说明的基础上还可以做出其它不同形式的变化或变动,这里无法对所有的实施方式予以穷举,凡是属于本发明的技术方案所引伸出的显而易见的变化或变动仍处于本发明的保护范围之列。The above calculation examples of the present invention are only to illustrate the calculation model and calculation process of the present invention in detail, but are not intended to limit the embodiments of the present invention. For those of ordinary skill in the art, on the basis of the above description, other different forms of changes or changes can also be made, and it is impossible to list all the embodiments here. Obvious changes or modifications are still within the scope of the present invention.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210049107.XACN114372976A (en) | 2022-01-17 | 2022-01-17 | Deep learning-based oil slinging fault detection method for bearing of rail wagon |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210049107.XACN114372976A (en) | 2022-01-17 | 2022-01-17 | Deep learning-based oil slinging fault detection method for bearing of rail wagon |
| Publication Number | Publication Date |
|---|---|
| CN114372976Atrue CN114372976A (en) | 2022-04-19 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202210049107.XAPendingCN114372976A (en) | 2022-01-17 | 2022-01-17 | Deep learning-based oil slinging fault detection method for bearing of rail wagon |
| Country | Link |
|---|---|
| CN (1) | CN114372976A (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111091555A (en)* | 2019-12-12 | 2020-05-01 | 哈尔滨市科佳通用机电股份有限公司 | Brake shoe breaking target detection method |
| CN112837295A (en)* | 2021-02-01 | 2021-05-25 | 北京工业大学 | A Generative Adversarial Network-Based Defect Detection Method for Rubber Gloves |
| CN113658115A (en)* | 2021-07-30 | 2021-11-16 | 华南理工大学 | Image anomaly detection method for generating countermeasure network based on deep convolution |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111091555A (en)* | 2019-12-12 | 2020-05-01 | 哈尔滨市科佳通用机电股份有限公司 | Brake shoe breaking target detection method |
| CN112837295A (en)* | 2021-02-01 | 2021-05-25 | 北京工业大学 | A Generative Adversarial Network-Based Defect Detection Method for Rubber Gloves |
| CN113658115A (en)* | 2021-07-30 | 2021-11-16 | 华南理工大学 | Image anomaly detection method for generating countermeasure network based on deep convolution |
| Publication | Publication Date | Title |
|---|---|---|
| CN109615019A (en) | Anomaly behavior detection method based on spatiotemporal autoencoder | |
| US10803573B2 (en) | Method for automated detection of defects in cast wheel products | |
| CN112287816A (en) | A deep learning-based automatic detection and alarm method for dangerous workplace accidents | |
| CN113569756A (en) | Abnormal behavior detection and positioning method, system, terminal equipment and readable storage medium | |
| CN103839085A (en) | Train carriage abnormal crowd density detection method | |
| CN111080601A (en) | Image recognition method for fault image of pull ring grinding shaft of railway freight car derailment braking device | |
| CN114202711A (en) | An intelligent monitoring method, device and monitoring system for abnormal behavior in a train compartment | |
| JP7459957B2 (en) | Inspection method, classification method, management method, steel manufacturing method, learning model generation method, learning model, inspection device, and steel manufacturing equipment | |
| CN106295474A (en) | The fatigue detection method of deck officer, system and server | |
| Lien et al. | Product surface defect detection based on deep learning | |
| CN112098997B (en) | Three-dimensional holographic imaging security inspection radar image foreign matter detection method | |
| CN117585553A (en) | Elevator abnormality detection method, elevator abnormality detection device, computer equipment and storage medium | |
| CN112800854A (en) | Automatic analysis system for locomotive crew operation based on image | |
| Yan et al. | Object detection oriented privacy-preserving frame-level video anomaly detection | |
| CN119887669A (en) | Intelligent diagnosis method for crimping quality of strain clamp based on infrared thermal imaging | |
| CN114372976A (en) | Deep learning-based oil slinging fault detection method for bearing of rail wagon | |
| Yatbaz et al. | Run-time introspection of 2d object detection in automated driving systems using learning representations | |
| CN118711145A (en) | Railway scene understanding method and system based on panoptic segmentation and relationship detection | |
| CN118366134A (en) | A driver fatigue detection method based on CT-Net model | |
| CN117636601A (en) | Intelligent early warning method based on surface scene deformation information | |
| CN117557937A (en) | A surveillance camera image anomaly detection method and system | |
| Hernández et al. | Neuro-fuzzy method for automated defect detection in aluminium castings | |
| CN116704290A (en) | Method, device, equipment and medium for generating training samples | |
| CN115631457A (en) | Man-machine cooperation abnormity detection method and system in building construction monitoring video | |
| WO2018105195A1 (en) | Video failure detection device, video failure detection method, and program |
| 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 | ||
| AD01 | Patent right deemed abandoned | Effective date of abandoning:20250214 | |
| AD01 | Patent right deemed abandoned |