Busbar power supply fault diagnosis method based on causal inference and knowledge distillation

By combining causal inference and knowledge distillation, and using variational autoencoders to reconstruct background features and generate fault feature maps, the deployment difficulties and background interference problems of deep learning fault diagnosis models on embedded platforms are solved, and high-precision fault diagnosis and model compression are achieved.

CN119418105BActive Publication Date: 2025-10-14BEIHANG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411460173.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-18
Publication Date
2025-10-14
Estimated Expiration
2044-10-18

AI Technical Summary

Technical Problem

Existing deep learning fault diagnosis models are difficult to deploy on embedded platforms with insufficient computing power, and knowledge distillation-based methods tend to misidentify background features as fault features, causing the model to fail when the background changes, affecting the safety and availability of automobile production lines.

Method used

Combining causal inference and knowledge distillation, a variational autoencoder is used to reconstruct background features. By calculating the reconstruction error, a feature map containing only fault features is generated, and a loss function training model is constructed to compress the model size and improve diagnostic accuracy.

Benefits of technology

While maintaining high diagnostic accuracy, the model can accurately capture fault characteristics, is suitable for edge devices, and maintains high accuracy when the environment changes, solving the problems of model deployment and background interference.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119418105B_ABST
    Figure CN119418105B_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of automobile production line fault diagnosis, and relates to a sliding contact line power supply fault diagnosis method based on causal inference and knowledge distillation, which comprises the following steps: S1, a first feature model based on a deep neural network is constructed, and a sliding contact line picture in an automobile production line is used for training of the first feature model; S2, a variational autoencoder and the first feature model are used to perform a de-mixing operation on the sliding contact line picture in the automobile production line, and an intermediate layer feature map is generated; S3, a second feature model based on a knowledge distillation technology is constructed, and the second feature model is trained; and S4, the second feature model is deployed in an edge device on the automobile production line, and carbon deposition fault diagnosis is performed. The application can compress the size of a training model while maintaining high diagnosis accuracy of the model, and enable the training model to capture correct fault features, improve the reliability of output results of a fault diagnosis network model, and meet actual needs of industrial production.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of automobile production line fault diagnosis, and in particular relates to a busbar power supply fault diagnosis method based on causal inference and knowledge distillation. Background Art

[0002] In the automotive manufacturing industry, mobile equipment in parts transport systems on production lines constantly relocates. At each new location, the equipment must have ready access to power. This creates unique requirements for the power supply system—"mobile power." Busbar power, with its wide power range, high current capacity, and stable mechanical properties, has become the preferred method for powering these systems. Busbar power generation utilizes a current collector that slides against the guide rail while maintaining contact, achieving mobile power. However, the carbon brushes on the current collector are relatively soft. Over time, carbon dust from the brushes can fall onto the busbar track. This accumulation can cause short circuits and serious damage. Therefore, timely and effective fault detection and identification of operational anomalies are crucial to ensuring the healthy operation of automotive production lines and improving system safety and availability.

[0003] Deep learning, a branch of machine learning (ML), utilizes a multi-layered network architecture to automatically extract abstract features from complex raw data, eliminating some reliance on experts. In recent years, with the increasing number of sensor types integrated into industrial production, such as automotive production lines, the data required for fault diagnosis has become increasingly complex. Acquiring the large amounts of data and expertise required to support mechanism-based fault diagnosis methods is expensive and time-consuming. Consequently, deep learning models, due to their powerful learning and feature extraction capabilities, have become increasingly popular in the automotive production line fault diagnosis field.

[0004] However, deep learning-based fault diagnosis methods suffer from large network sizes, large number of parameters, and high computing platform requirements. This makes it difficult to deploy fault diagnosis models on embedded platforms and mobile devices, which often have limited computing power. Currently, most deep learning models still rely on large servers for computation and generation. However, in actual industrial production, the computing platforms for equipment are primarily small embedded platforms with insufficient computing power and limited storage space. This makes it difficult to deploy large-scale fault diagnosis networks, while small-scale fault diagnosis networks struggle to extract accurate features. Therefore, lightweighting fault diagnosis networks is crucial.

[0005] Popular neural network lightweighting methods include pruning, quantization, knowledge distillation (KD), and neural network architecture search. Knowledge distillation, proposed by Geoffrey Hinton in 2015, involves transferring knowledge from a primary feature model to a secondary feature model. This allows the secondary feature model to extract powerful features from the primary feature model at the expense of accuracy, thus enabling smaller models to be deployed on hardware platforms with limited computing power. Currently, many deep learning-based fault diagnosis models incorporate knowledge distillation techniques to achieve lightweighting.

[0006] Knowledge distillation can be divided into three types: response-based, feature-based, and relationship-based. Currently, most fault diagnosis networks use a response-based knowledge distillation method, which only uses the output of the first feature model without the information in the hidden layer, resulting in a lack of interpretability. Although feature-based knowledge distillation can obtain information in the hidden layer, it is not necessarily a fault feature, especially in image-based knowledge distillation. Due to the poor background diversity of carbon deposit fault image data in automobile production lines, the fault diagnosis model easily misidentifies background features as fault features. The intermediate layer feature map transmitted from the first feature model to the second feature model tends to focus on background features rather than fault features. When the background features of the automobile production line change slightly, the lightweight fault diagnosis model may fail, seriously endangering the safety of automobile production. Summary of the Invention

[0007] To address the shortcomings of existing technologies, the present invention provides a busbar power supply fault diagnosis method based on causal inference and knowledge distillation. This method combines causal inference and knowledge distillation, introducing a variational autoencoder as a background generator to reconstruct the background of an input image and extract image features. The reconstruction error between the background and the input image is calculated to generate a feature map containing only fault features. A loss function is constructed based on the reconstruction error to train the model. While maintaining the high diagnostic accuracy of the trained model, the model size can be greatly reduced and the trained model can capture the correct fault features, improving the reliability of the output results of the fault diagnosis network model and meeting the practical needs of industrial production.

[0008] To achieve the above objectives, the present invention discloses the following technical solutions:

[0009] A busbar power supply fault diagnosis method based on causal inference and knowledge distillation, comprising:

[0010] S1: Build a first feature model based on a deep neural network and use busbar images from automobile production lines to train the first feature model.

[0011] S11: Collect busbar images from the automobile production system and pre-process them to eliminate image noise; classify busbar images into four fault levels based on the coverage area, thickness, and glossiness of carbon deposits; and construct a training set of images X train And the test set image X test ;

[0012] S12: Build the first feature model. The first feature model is built based on the deep neural network model and uses the divided training set image X train train them;

[0013] S2: Deobfuscate the busbar image using a variational autoencoder and the first feature model in step S1 to generate an intermediate layer feature map. The first feature model includes three submodules: the intermediate layer feature map generated by the first submodule of the first feature model includes the edge of the carbon deposit and the boundary features between the busbar and the carbon deposit; the second submodule of the first feature model can add the shape contour of the carbon deposit to the intermediate layer feature map; the intermediate layer feature map generated by the third submodule of the first feature model includes the distribution features of the carbon deposit on the busbar;

[0014] S21: The training set image X train Input into the trained first feature model and extract the intermediate layer feature map f output by the first feature model t (x);

[0015] S22: The training set image X train Input the variational self-encoder and extract the intermediate layer feature map f output by the variational self-encoder decoder VAE (x);

[0016] S23: Generate a feature map containing only background features using a variational autoencoder, specifically including: linear shape features of the busbar background, light intensity features of the working environment, and color features of the busbar surface; calculate the intermediate layer feature map f of the first feature model in step S21 t (x) and the intermediate layer feature map f of the variational autoencoder decoder in step S22 VAE (x) to obtain the carbon deposition feature map containing only the carbon deposition fault features; and then use kernel convolution and spatial bilinear interpolation to match the number of channels and spatial resolution for processing, and obtain the intermediate layer feature error map as follows:

[0017] ERROR intermediate =MSE(f t (x),Ψ VAE (f VAE (x)));

[0018] Among them, ERROR intermediateis the middle layer feature error map; MSE() is the mean square error function; f t (x) is the middle layer feature map of the first feature model; f VAE (x) is the feature map of the middle layer of the variational autoencoder; Ψ VAE () is a bilinear interpolation function used to match the feature map dimensions of the first feature model and the variational autoencoder; x is the input independent variable of the mean square error function:

[0019] S3: Construct a second feature model based on knowledge distillation technology, and use knowledge distillation technology to convert the intermediate layer feature map f output by the first feature model in step S2 t (x) and the training set image X in step S1 train Input the second feature model for training;

[0020] S31: Construct the first loss sub-function of the second feature model; convert the training set image X in step S1 into train Input the first feature model and use the feature label q generated by the first feature model soft (x) to design the training process of the second feature model; the output probability distribution q of the second feature model s (x) and the feature label q of the first feature model soft The loss between (x) as the first loss sub-function for training the second feature model is:

[0021]

[0022] Among them, loss soft is the first loss sub-function between the softmax function output of the second feature model and the feature label of the first feature model; H() is the function of cross entropy; q t (x) is the probability distribution of the feature label of the first feature model; q s (x) is the output probability distribution of the second feature model;

[0023] S32: Construct the second loss sub-function of the second feature model; in the process of training the second feature model, the intermediate layer feature map f of the second feature model is s (x) and S2 are generated by the first feature model and variational autoencoder, which only contain the error map of the intermediate layer features ERROR intermediate The difference is calculated as the second loss sub-function for training the second feature model:

[0024] loss feature =MSE(f s (x), ERROR intermediate );

[0025] Among them, lossfeature The second loss sub-function for obtaining the fault feature for the middle layer of the second feature model; f s (x) is the middle layer feature map of the second feature model;

[0026] S33: Construct the third loss sub-function of the second feature model; in the process of training the second feature model, the second feature model outputs the probability distribution q s (x) with one-hot encoded label p s The third loss sub-function between (x) is:

[0027]

[0028] Among them, loss h is the third loss sub-function between the softmax function output of the second feature model and the label of the real data set; s (x) is the one-hot encoded label;

[0029] S34: Integrate the above loss sub-functions to obtain the loss function Loss of the second feature model s for:

[0030] Loss s =α*loss h +β*loss soft +γ*loss feature ;

[0031] Among them, Loss s is the loss function of the second feature model; a is the first loss function loss h Weight coefficient; β is the second loss function loss soft Weight coefficient; γ is the third loss function loss feature Weight coefficient;

[0032] S4: Deploy the second feature model obtained in step S3 in the edge device on the automobile production line, collect and process the busbar images on the automobile production line, use the second feature model to diagnose carbon deposit faults, and issue an alarm in a timely manner.

[0033] Preferably, the busbar picture in step S1 is specifically a picture of the automobile production line guide rail and the bracket fixing system; the automobile production line guide rail is the core component of the busbar, responsible for conducting current; the collector obtains current by sliding contact with the guide rail through carbon brushes or metal contacts, and the carbon brushes on the collector drop carbon powder into the busbar rail during operation to form carbon marks, which are black carbon deposits in the busbar picture.

[0034] Preferably, the busbar image in step S11 is preprocessed, specifically:

[0035] S111: The collected busbar images include carbon deposition fault images and normal images. The busbar image dataset is divided into four levels according to the degree of carbon deposition fault: no carbon deposition fault, carbon deposition fault level 1, carbon deposition fault level 2, and carbon deposition fault level 3. The busbar with no carbon deposition fault has a carbon deposition coverage of less than 5%. The carbon deposition coverage of level 1 carbon deposition fault has a coverage of 5%-30%, excluding the 30% point, and has no effect on electrical and mechanical properties. The carbon deposition coverage of level 2 carbon deposition fault has a coverage of 30%-60%, which significantly increases the contact resistance of the busbar. The carbon deposition coverage of level 3 carbon deposition fault has a coverage of more than 60%, which reduces the electrical conductivity of the busbar and increases the contact resistance.

[0036] S112: Preprocess the collected busbar images. First, crop the busbar images. Second, grayscale the busbar images, converting the color busbar images into grayscale busbar images. Finally, use the preprocessed busbar images for training.

[0037] Preferably, in step S22, the training set image X train Input the variational self-encoder and extract the intermediate layer feature map f output by the variational self-encoder decoder VAE (x), specifically:

[0038] S221: The training set image X train The input is fed into the variational autoencoder, which decomposes the feature vector in the hidden layer into a mean vector and a variance vector, generating a hidden variable z containing the background information of the busbar image. train Follows an approximate distribution: in, is a parameter to be determined; x is the approximate distribution image output; is the approximate distribution function;

[0039] S222: To determine the approximate distribution function The variational autoencoder uses the joint probability distribution as Input training set image X train associated with the hidden variable z; the distribution of the hidden variable z is set to the standard normal distribution; then the approximate distribution function for:

[0040]

[0041] in, is the approximate distribution function; Using a joint probability distribution for the variational autoencoder; p(X train ) is the probability distribution;

[0042] S223: Due to the difficulty in obtaining an approximate distribution function Introducing normal distribution p ρ (z,X train ) to determine the approximate distribution function Specifically:

[0043]

[0044] Among them, p ρ (z,X train ) is a normal distribution;

[0045] The normal distribution p ρ (z,X train ) is calculated by neural network, and the input training set image X train An autoencoder that maps to a hidden variable z;

[0046] S224: In order to make the normal distribution p ρ (z,X train ) approximates the approximate distribution function The variational autoencoder uses KL divergence to evaluate the difference between the two distributions to constrain the output normal distribution q of the variational autoencoder. ρ (z|X train ) to determine the approximate distribution function Extract the background information of the busbar image as follows:

[0047]

[0048] Among them, D KL () is q p (z|x) and The KL divergence deviation between them; E() is the mathematical expectation.

[0049] Preferably, in step S23, kernel convolution and spatial bilinear interpolation are used to match the number of channels and spatial resolution for processing, specifically:

[0050] S231: Calculate the difference between the two feature maps and determine the scaling factors in the horizontal and vertical directions;

[0051] S232: For each target feature pixel (a, b) in the target feature map, map it back to the feature coordinates (a′, b′) in the source feature map according to the scaling factor;

[0052] S233: Find the four nearest neighboring pixel points of the feature coordinates (a′, b′), calculate their integer coordinates, use the bilinear interpolation method, calculate the second target feature pixel value by weighted average, assign it to the target feature pixel (a, b) in the target feature map, and complete the feature map matching.

[0053] Preferably, the feature labels in step S32 are generated by a softmax function, specifically:

[0054]

[0055] Among them, q i is the distribution of the output layer of the i-th network; z i is the logical value of the SoftMax function layer, is the distillation parameter of the loss function; T is the knowledge distillation temperature parameter; i is the network output layer number; j is the total number of network output layers.

[0056] Preferably, the edge device in step S4 is specifically an embedded device capable of performing neural network inference.

[0057] Compared with the prior art, the present invention has the following beneficial effects:

[0058] (1) The present invention combines causal inference with knowledge distillation. Causal inference is used to enable the model to acquire the ability to extract fault causal relationships, and knowledge distillation is used to transfer the extracted causal relationship capabilities to the training model, so that the training model can accurately capture the characteristics of carbon deposition on the busbar without being disturbed by background features, thereby improving the robustness, interpretability and generalization ability of the training model.

[0059] (2) The present invention provides a knowledge distillation framework that combines a variational autoencoder with a training model, so that the feature-based knowledge distillation model can smoothly extract the fault features of the intermediate layer of the training model, and match it with the intermediate layer of the training model through a bilinear interpolation method, so that the training model can obtain not only information from the training set samples but also the fault feature learning ability of the deobfuscated training model, so that the training model can greatly compress the scale while maintaining high diagnostic accuracy.

[0060] (3) The present invention is applied to the carbon deposition fault of the busbar in the automobile parts production system, so that the edge devices in the automobile production system can also deploy a high-precision fault diagnosis model without generating excessive computing power consumption. When the production line environment, such as lighting and background, changes, the model can also maintain a high fault diagnosis accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] Figure 1A flow chart of the method for diagnosing the carbon deposition fault of the trolley line according to the present application based on causal inference and knowledge distillation;

[0062] Figure 2 A framework structure diagram of the method for diagnosing the carbon deposition fault of the automobile production line according to the present application;

[0063] Figure 3 A schematic diagram of the trolley line according to the present application;

[0064] Figures 4a-4d Schematic diagrams of the carbon deposition fault levels of the trolley line according to the present application;

[0065] Figure 5 A schematic diagram of the structure of the first feature model according to the present application;

[0066] Figure 6 A schematic diagram of the structure of the second feature model according to the present application;

[0067] Figures 7a-7f Input variational autoencoder (VAE) and original background image of the first feature model according to the present application;

[0068] Figures 8a-8f Variational autoencoder (VAE) generated background image according to the present application;

[0069] Figures 9a-9f Variational autoencoder (VAE) and heat map of the generated feature map of the first feature model according to the present application. DETAILED DESCRIPTION

[0070] The exemplary embodiments, features and aspects of the present application will be described in detail below with reference to the accompanying drawings. The same reference numbers in the drawings represent functionally identical or similar elements. Although various aspects of the embodiments are shown in the drawings, the drawings are not necessarily drawn to scale unless specifically indicated.

[0071] The embodiment of the present application provides a method for diagnosing the carbon deposition fault of the trolley line based on causal inference and knowledge distillation, as shown in Figure 1 A first feature model based on VGG16 deep neural network is constructed, and the trolley line pictures in the automobile production line are used for training the first feature model; the variational autoencoder and the first feature model are used to perform the de-mixing operation on the trolley line pictures in the automobile production line to generate the intermediate layer feature map; and the edge device deployed on the automobile production line is used to perform the carbon deposition fault diagnosis.

[0072] As shown in Figure 2The figure shows the framework structure of the carbon deposit fault diagnosis method for automobile production lines established by an embodiment of the present invention. First, the first feature model is trained using the original image dataset, and the soft label of the first feature model is transferred to the second feature model. Then, the VAE is trained using the normal image dataset to reconstruct the background. The reconstruction error between the first feature model and the decoder of the VAE is calculated to generate a feature map. The generated feature map is transferred to the second feature model and guides the training of the middle layer of the second feature model. Figure 2 It can be observed that the training input of the second feature model includes the hard labels of the original dataset, the soft labels of the first feature model, and the feature map generated by the reconstruction error.

[0073] Step S1: Construct a first feature model based on the VGG16 deep neural network, and use busbar images in the automobile production line for training the first feature model.

[0074] The busbar picture specifically shows the guide rails and bracket fixing system of an automobile production line. The guide rails of an automobile production line are the core components of the busbar and are responsible for conducting current. The current collector obtains current by sliding into contact with the rails through carbon brushes or metal contacts. The carbon brushes on the current collector drop carbon powder into the busbar rails during operation, forming carbon marks, which appear black in the busbar picture. The darker the area in the rails, the more serious the carbon deposit fault.

[0075] The following will further explain the fault diagnosis process of the present invention in detail by combining the image data collected from the busbar monitoring of a certain automobile production system. Figure 3 The figure shows a schematic diagram of the busbar in the automobile production system. The specific implementation steps are as follows:

[0076] Step S11: Collect busbar images from the automobile production system and pre-process the busbar images to eliminate image noise; divide the busbar images into four fault levels based on the coverage area, thickness and glossiness of carbon deposits in the busbar images; divide the images into training set images X train And the test set image X test The busbar image preprocessing operations are as follows:

[0077] Step S111: The collected busbar images include carbon deposit fault images and normal images. In this embodiment of the present invention, a total of 6,000 busbar monitoring images of a certain automobile production system are collected. Based on the production data, the busbar image data set is divided into four levels according to the degree of carbon deposit fault: Figure 4a The fault is no carbon deposit, which means the busbar is not covered with carbon deposits, and the proportion of carbon deposits on the busbar is less than 5%. Figure 4bThe first stage of carbon deposition fault is shown as a slight carbon deposition phenomenon, a small amount of carbon deposition occurs in a local area of the slide wire, the thickness of the carbon deposition is thin, the coverage area is small, and the influence on the electrical and mechanical properties is minimal. The carbon deposition coverage area accounts for 5%-30%, excluding the 30% point. For example Figure 4c The second stage of carbon deposition fault is shown as carbon deposition in multiple areas, forming a more obvious coverage layer, the carbon deposition layer is thick, and there is a local accumulation phenomenon. The carbon deposition coverage area accounts for 30%-60%, which significantly increases the contact resistance of the slide wire. For example Figure 4d The third stage of carbon deposition fault is shown as a wide carbon deposition coverage area, with a carbon deposition coverage area accounting for more than 60%. The carbon deposition layer is extremely thick, and the conductive performance of the slide wire is significantly reduced, with a greatly increased contact resistance.

[0078] Step S112: The collected slide wire pictures are preprocessed. First, the slide wire pictures are cropped to obtain pictures with a pixel size of 224*224. Second, the slide wire pictures are processed to grayscale, converting color slide wire pictures to grayscale slide wire pictures. Finally, the preprocessed slide wire pictures are used for training.

[0079] The 6000 pictures are cropped to pictures with a size of 224*224 and preprocessed, and then randomly divided into training set pictures X train and test set pictures X test .

[0080] Step S12: A first feature model is constructed. The first feature model is constructed based on a VGG16 deep neural network model and trained using the divided training set pictures X train . The VGG16 deep neural network model is used as a prototype. The model consists of 13 convolutional layers and 2 fully connected layers. In order to accelerate network training, the last fully connected layer is replaced by a global average pooling layer, and its structure is shown in Figure 5 . The divided training set pictures X train are used for training.

[0081] Step S2: The slide wire pictures in the automobile production line are deconfused using a variational autoencoder (VAE) and the first feature model in step S1 to generate intermediate layer features containing carbon deposition fault features. The first feature model includes three sub-modules: the first sub-module of the first feature model generates an intermediate layer feature map containing the edges of the carbon deposition, the boundary features of the slide wire and the carbon deposition; the second sub-module of the first feature model can increase the intermediate layer feature map containing the shape profile of the carbon deposition; and the third sub-module of the first feature model generates an intermediate layer feature map containing the distribution features of the carbon deposition on the slide wire.

[0082] Step S21: The training set pictures X trainThe input is input into the trained first feature model, and an intermediate layer feature map f output by the first feature model is extracted t (x).

[0083] Step S22: inputting the training set picture X train into a variational autoencoder (VAE), and extracting an intermediate layer feature map f output by a decoder of the variational autoencoder (VAE) VAE (x), specifically:

[0084] Step S221: inputting the training set picture X train into the variational autoencoder (VAE), and the variational autoencoder (VAE) decomposes a feature vector in a hidden layer into a mean vector and a variance vector to generate a hidden variable z containing background information of the sliding contact line picture; since the input training set picture X train follows an approximate distribution: wherein, is a to-be-determined parameter; x is an approximate distribution picture output; is an approximate distribution function.

[0085] Step S222: in order to determine the approximate distribution function The variational autoencoder (VAE) uses a joint probability distribution as The input training set picture X train is associated with the hidden variable z; a distribution of the hidden variable z is set as a standard normal distribution; and the approximate distribution function is:

[0086]

[0087] wherein, is the approximate distribution function; is the joint probability distribution used by the variational autoencoder (VAE); and p(X train ) is a probability distribution.

[0088] Step S223: since it is difficult to obtain the approximate distribution function A normal distribution p ρ (z, X train ) is introduced to determine the approximate distribution function Specifically:

[0089]

[0090] wherein, p ρ (z, X train ) is the normal distribution.

[0091] The normal distribution p ρ (z, X train) is calculated by neural network, and the input training set image X train An autoencoder that maps to hidden variables z.

[0092] Step S224: To make the normal distribution p ρ (z,X train ) approximates the approximate distribution function The variational autoencoder (VAE) uses KL divergence to evaluate the difference between the two distributions to constrain the output normal distribution q of the variational autoencoder (VAE) ρ (z|X train ) to determine the approximate distribution function Extract the background information of the busbar image as follows:

[0093]

[0094] Among them, D KL () is q ρ (z|x) and The KL divergence deviation between them; E() is the mathematical expectation.

[0095] Step S23: Generate a feature map containing only background features using a variational autoencoder (VAE) and calculate the intermediate layer feature map f of the first feature model t (x) and the intermediate layer feature map f of the variational autoencoder (VAE) decoder VAE (x) to obtain a carbon deposition feature map containing only carbon deposition fault features; and then use kernel convolution and spatial bilinear interpolation to match the number of channels and spatial resolution for processing, specifically:

[0096] Step S231: Calculate the difference between the two feature maps and determine the scaling factors in the horizontal and vertical directions.

[0097] Step S232: For each target feature pixel (a, b) in the target feature map, map it back to the feature coordinates (a′, b′) in the source feature map according to the scaling factor.

[0098] Step S233: Find the four nearest neighboring pixel points of the feature coordinates (a′, b′), calculate their integer coordinates, use the bilinear interpolation method, calculate the second target feature pixel value by weighted average, assign it to the target feature pixel (a, b) in the target feature map, and complete the feature map matching; obtain the intermediate layer feature error map as follows:

[0099] ERROR intermediate =MSE(f t (x),Ψ VAE (f VAE (x)));

[0100] wherein, ERROR intermediate is the intermediate layer feature error map; MSE() is the mean square error function; f t (x) is the intermediate layer feature map of the first feature model; f VAE (x) is the intermediate layer feature map of the variational autoencoder; Ψ VAE () is a bilinear interpolation function used to match the feature map dimensions of the first feature model and the variational autoencoder; x is the input variable of the mean square error function.

[0101] Step S3: Constructing a second feature model based on the knowledge distillation technology, using the knowledge distillation technology to input the intermediate layer feature map f t (x) output by the first feature model in step S2 and the training set picture X train in step S1 into the second feature model for training. The second feature model based on the knowledge distillation technology is composed of 4 convolutional layers, 4 pooling layers and 1 global average pooling layer, as shown in Figure 6 The second feature model structure diagram of the present application; the parameter is 1554948, and the size of the first feature model is 14716740. The scale of the first feature model network is compressed by about 9.46 times.

[0102] Step S31: Constructing a first loss sub-function of the second feature model; inputting the training set picture X train in step S1 into the first feature model, and using the feature label q soft (x) generated by the first feature model to design the training process of the second feature model; the loss between the output probability distribution q s (x) of the second feature model and the feature label q soft (x) of the first feature model is taken as the first loss sub-function for training the second feature model:

[0103]

[0104] wherein, loss soft is the first loss sub-function between the softmax function output of the second feature model and the feature label of the first feature model; H() is the function of cross-entropy; q t (x) is the probability distribution of the feature label of the first feature model; q s (x) is the output probability distribution of the second feature model.

[0105] The feature label is generated by the softmax function, specifically:

[0106]

[0107] wherein, q i is the distribution of the output layer of the i-th network; zi is the logical value of the SoftMax function layer, and is the distillation parameter of the loss function; T is the knowledge distillation temperature parameter; i is the network output layer number; and j is the total number of network output layers.

[0108] Step S32: constructing a second loss sub-function of the second feature model; in the process of training the second feature model, the difference between the intermediate layer feature map f s (x) of the second feature model and the intermediate layer feature error map ERROR intermediate containing only fault features generated by the first feature model and the variational autoencoder (VAE) in S2 is taken as the second loss sub-function for training the second feature model, and is:

[0109] loss feature= MSE(f s (x), ERROR intermediate );

[0110] wherein loss feature is the second loss sub-function of the second feature model for obtaining fault features in the intermediate layer; and f s (x) is the intermediate layer feature map of the second feature model.

[0111] Step S33: constructing a third loss sub-function of the second feature model; in the process of training the second feature model, the third loss sub-function between the output probability distribution q s (x) of the second feature model and the one-hot encoded label p s (x) is:

[0112]

[0113] wherein loss h is the third loss sub-function between the softmax function output of the second feature model and the label of the real data set; and p s (x) is the one-hot encoded label.

[0114] Step S34: integrating the above loss sub-functions to obtain the loss function Loss s of the second feature model, and is:

[0115] Loss s = a*loss h + β*loss soft + γ*loss feature :

[0116] wherein Loss s is the loss function of the second feature model; α is the weight coefficient of the first loss function loss h ; β is the weight coefficient of the second loss function losssoft Weight coefficient; γ is the third loss function loss feature Weight coefficient.

[0117] Loss function of the second feature model s The training parameters are: the batch size is set to 32, and the stochastic gradient descent algorithm (SGD) is used as the optimizer with a learning rate of 0.00001 and 50 iterations.

[0118] Step S4: Deploy the second feature model obtained in step S3 to an edge device on the automotive production line. Images of the busbars on the production line are collected and processed. The second feature model is used to diagnose carbon deposit faults and issue a timely alarm. The edge device is specifically an embedded device capable of neural network inference.

[0119] like Figures 7a-7f They are respectively the input variational autoencoder (VAE) of the present invention and the original background image of the first feature model; a total of 6 groups of actual data images collected on-site are used to input the model for training; the 6 groups of images are used to represent faults of different carbon deposit levels.

[0120] like Figures 8a-8f According to Figures 7a-7f The 6 sets of data images are generated by the variational autoencoder (VAE) and the corresponding 6 sets of background images are generated.

[0121] The training accuracy of the second feature model trained based on the deobfuscation knowledge distillation method is compared with the baseline model (the same structural model without this method) and the first feature model, as shown in Table 1. It can be found that the accuracy of the second feature model using this method is better than that without this method.

[0122] Table 1 Comparison results of feature model output accuracy

[0123]

[0124] like Figures 9a-9f Figure 8 shows a heat map of the feature maps generated by the variational autoencoder (VAE) and the first feature model of the present invention. The intermediate-layer feature maps generated by the variational autoencoder (VAE) and the first feature model and passed to the second feature model correspond to the six data graphs in Figure 8. As can be seen from the figure, the generated feature maps are able to capture the characteristics of carbon deposit faults on busbars. After passing these intermediate-layer feature maps to the second feature model, the second feature model is able to better learn to capture the characteristics of carbon deposit faults, improving its accuracy and interpretability—indicating that the model learns causal features related to the fault mode, rather than background features.

[0125] The beneficial effects of the present invention are as follows: the present invention provides a busbar power supply fault diagnosis method based on causal inference and knowledge distillation, which uses causal inference to enable the model to obtain the ability to extract fault causal relationships, and uses knowledge distillation to transfer the extracted causal relationship capabilities to the second feature model, so that the second feature model can accurately capture the characteristics of carbon deposition on the busbar without being interfered with by background features, so that the second feature model can maintain high diagnostic accuracy while greatly compressing its size. This method is applied to busbar carbon deposition faults in automotive parts production systems, so that edge devices in automotive production systems can also deploy high-precision fault diagnosis models without generating excessive computing power consumption. When the production line environment, such as lighting and background, changes, the model can also maintain a high fault diagnosis accuracy.

[0126] The embodiments described above are merely descriptions of preferred implementations of the present invention and are not intended to limit the scope of the present invention. Without departing from the spirit of the present invention, various modifications and improvements made to the technical solutions of the present invention by ordinary technicians in this field should fall within the scope of protection determined by the claims of the present invention.

Claims

1. A busbar power supply fault diagnosis method based on causal inference and knowledge distillation, characterized in that: It includes: S1: Build a first feature model based on a deep neural network and use busbar images from automobile production lines to train the first feature model. S11: Collect busbar images from the automobile production system and pre-process them to eliminate image noise; classify busbar images into four fault levels based on the coverage area, thickness, and glossiness of carbon deposits; and construct a training set of images X train And the test set image X test ; S12: Construct the first feature model. The first feature model is constructed based on the deep neural network model and uses the divided training set image X train train them; S2: Deobfuscate the busbar image using a variational autoencoder and the first feature model in step S1 to generate an intermediate feature map. The first feature model includes three submodules: The intermediate feature map generated by the first submodule of the first feature model includes features of the edge of the carbon deposit and the boundary between the busbar and the carbon deposit. The second submodule of the first feature model can add an intermediate layer feature map including the shape contour of the carbon deposit; The intermediate layer feature map generated by the third submodule of the first feature model includes the distribution characteristics of carbon deposits on the busbar; S21: The training set image X train Input into the trained first feature model and extract the intermediate layer feature map f output by the first feature model t (x); S22: The training set image X train Input the variational self-encoder and extract the intermediate layer feature map f output by the variational self-encoder decoder VAE (x); S23: Generate a feature map containing only background features using a variational autoencoder, specifically including: linear shape features of the busbar background, light intensity features of the working environment, and color features of the busbar surface; calculate the intermediate layer feature map f of the first feature model in step S21 t (x) and the intermediate layer feature map f of the variational autoencoder decoder in step S22 VAE (x) to obtain the carbon deposition feature map containing only the carbon deposition fault features; and then use kernel convolution and spatial bilinear interpolation to match the number of channels and spatial resolution for processing, and obtain the intermediate layer feature error map as follows: ERROR intermediate =MSE(f t (x),τ VAE (f VAE (x))) Among them, ERROR intermediate is the middle layer feature error map; MSE() is the mean square error function; f t (x) is the middle layer feature map of the first feature model; f VAE (x) is the feature map of the middle layer of the variational autoencoder; Ψ VAE () is a bilinear interpolation function used to match the feature map dimensions of the first feature model and the variational autoencoder; x is the input independent variable of the mean square error function; S3: Construct a second feature model based on knowledge distillation technology, and use knowledge distillation technology to convert the intermediate layer feature map f output by the first feature model in step S2 t (x) and the training set image X in step S1 train Input the second feature model for training; S31: Construct the first loss sub-function of the second feature model; convert the training set image X in step S1 into train Input the first feature model and use the feature label q generated by the first feature model soft (x) to design the training process of the second feature model; the output probability distribution q of the second feature model s (x) and the feature label q of the first feature model soft The loss between (x) as the first loss sub-function for training the second feature model is: Among them, loss soft is the first loss sub-function between the softmax function output of the second feature model and the feature label of the first feature model; H() is the function of cross entropy; q t (x) is the probability distribution of the feature label of the first feature model; q s (x) is the output probability distribution of the second feature model; S32: Construct the second loss sub-function of the second feature model; in the process of training the second feature model, the intermediate layer feature map f of the second feature model is s (x) and S2 are generated by the first feature model and variational autoencoder, which only contain the error map of the intermediate layer features ERROR intermediate The difference is calculated as the second loss sub-function for training the second feature model: loss feature =MSE(f s (x),ERROR intermediate ) Among them, loss feature The second loss sub-function for obtaining the fault feature for the middle layer of the second feature model; f s (x) is the middle layer feature map of the second feature model; S33: Construct the third loss sub-function of the second feature model; in the process of training the second feature model, the second feature model outputs the probability distribution q s (x) with one-hot encoded label p s The third loss sub-function between (x) is: Among them, loss h is the third loss sub-function between the softmax function output of the second feature model and the label of the real data set; s (x) is the one-hot encoded label; S34: Integrate the above loss sub-functions to obtain the loss function Loss of the second feature model s for: Los s =α*loss h +β*loss soft +γ*loss feature Among them, Loss s is the loss function of the second feature model; α is the first loss function loss h Weight coefficient; β is the second loss function loss soft Weight coefficient; γ is the third loss function loss feature Weight coefficient; S4: Deploy the second feature model obtained in step S3 in the edge device on the automobile production line, collect and process the busbar images on the automobile production line, use the second feature model to diagnose carbon deposit faults, and issue an alarm in a timely manner.

2. The busbar power supply fault diagnosis method based on causal inference and knowledge distillation according to claim 1 is characterized by: The busbar picture in step S1 is specifically a photo of the automobile production line guide rail and bracket fixing system; the automobile production line guide rail is the core component of the busbar and is responsible for conducting current; the collector obtains current by sliding contact with the guide rail through carbon brushes or metal contacts, and the carbon brushes on the collector drop carbon powder into the busbar rail during operation to form carbon marks, which appear as black carbon deposits in the busbar picture.

3. The busbar power supply fault diagnosis method based on causal inference and knowledge distillation according to claim 1 is characterized by: The busbar image in step S11 is pre-processed as follows: S111: The collected busbar images include images of carbon deposition faults and normal images. The busbar image dataset is divided into four levels according to the degree of carbon deposition faults: no carbon deposition fault, carbon deposition fault level 1, carbon deposition fault level 2, and carbon deposition fault level 3. The busbars with no carbon deposition faults have a carbon deposition coverage ratio of less than 5%. The first-level carbon deposit fault has a carbon deposit coverage area of ​​5%-30%, excluding the 30% point, and has no effect on electrical and mechanical properties; the second-level carbon deposit fault has a carbon deposit coverage area of ​​30%-60%, which significantly increases the contact resistance of the busbar; The carbon deposit coverage area of ​​the third-level carbon deposit fault is greater than 60%, the conductivity of the busbar decreases, and the contact resistance increases; S112: Preprocess the collected busbar images. First, crop the busbar images. Second, grayscale the busbar images, converting the color busbar images into grayscale busbar images. Finally, use the preprocessed busbar images for training.

4. The busbar power supply fault diagnosis method based on causal inference and knowledge distillation according to claim 1 is characterized by: In step S22, the training set image X train Input the variational self-encoder and extract the intermediate layer feature map f output by the variational self-encoder decoder VAE (x), specifically: S221: The training set image X train The input is fed into the variational autoencoder, which decomposes the feature vector in the hidden layer into a mean vector and a variance vector, generating a hidden variable z containing the background information of the busbar image. train Follows an approximate distribution: in, is a parameter to be determined; x is the approximate distribution image output; is the approximate distribution function; S222: To determine the approximate distribution function The variational autoencoder uses the joint probability distribution as Input training set image X train associated with the hidden variable z; the distribution of the hidden variable z is set to the standard normal distribution; then the approximate distribution function for: in, is the approximate distribution function; Using a joint probability distribution for the variational autoencoder; p(X train ) is the probability distribution; S223: Due to the difficulty in obtaining an approximate distribution function Introducing normal distribution p ρ (z,X train ) to determine the approximate distribution function Specifically: Among them, p ρ (z,X train ) is a normal distribution; The normal distribution p ρ (z,X train ) is calculated by neural network, and the input training set image X train An autoencoder that maps to a hidden variable z; S224: In order to make the normal distribution p ρ (z,X train ) approximates the approximate distribution function The variational autoencoder uses KL divergence to evaluate the difference between the two distributions to constrain the output normal distribution q of the variational autoencoder. ρ (z|X train ) to determine the approximate distribution function Extract the background information of the busbar image as follows: Among them, D KL ( ) is q ρ (z|x) and The KL divergence deviation between them; E() is the mathematical expectation.

5. The busbar power supply fault diagnosis method based on causal inference and knowledge distillation according to claim 1 is characterized in that: In step S23, kernel convolution and spatial bilinear interpolation are used to match the number of channels and spatial resolution for processing, specifically: S231: Calculate the difference between the two feature maps and determine the scaling factors in the horizontal and vertical directions; S232: For each target feature pixel (a, b) in the target feature map, map it back to the feature coordinates (a′, b′) in the source feature map according to the scaling factor; S233: Find the four nearest neighboring pixel points of the feature coordinates (a′, b′), calculate their integer coordinates, use the bilinear interpolation method, calculate the second target feature pixel value by weighted average, assign it to the target feature pixel (a, b) in the target feature map, and complete the feature map matching.

6. The busbar power supply fault diagnosis method based on causal inference and knowledge distillation according to claim 1 is characterized by: The feature labels in step S32 are generated by the softmax function, specifically: Among them, q i is the distribution of the output layer of the i-th network; z i is the logical value of the SoftMax function layer, is the distillation parameter of the loss function; T is the knowledge distillation temperature parameter; i is the network output layer number; j is the total number of network output layers.

7. The busbar power supply fault diagnosis method based on causal inference and knowledge distillation according to claim 1 is characterized by: The edge device in step S4 is specifically an embedded device capable of performing neural network inference.

Citation Information

Patent Citations

  • Bearing fault new class identification and diagnosis method based on hybrid depth self-coding

    CN116578940A

  • Intelligent photovoltaic hot spot fault detection method and system, medium, equipment and terminal

    CN117095311A