Fault diagnosis model construction method, fault diagnosis method, computer equipment and storage medium

By constructing an adversarial training model based on autoencoder and discriminant neural networks, and utilizing audio data under normal operating conditions, the problem of scarce traction transformer fault acoustic fingerprint data was solved, and efficient fault diagnosis was achieved.

CN120877778APending Publication Date: 2025-10-31SHUOHUANG RAILWAY DEV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510924783.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-04
Publication Date
2025-10-31

AI Technical Summary

Technical Problem

In the existing technology, traction transformer fault acoustic fingerprint data is scarce and the collection cost is high, which limits the effectiveness of fault diagnosis.

Method used

By acquiring audio data of the traction transformer under normal operating conditions, performing time-frequency transformation, and inputting it into an autoencoder neural network for compression and reconstruction, and combining it with a discriminative neural network for adversarial training, a fault diagnosis model can be constructed without using fault acoustic data.

Benefits of technology

It reduces model training costs, enhances the ability to detect abnormal states, and improves the robustness of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120877778A_ABST
    Figure CN120877778A_ABST
Patent Text Reader

Abstract

The invention relates to a construction method of a fault diagnosis model, a fault diagnosis method, computer equipment and a storage medium. The construction method comprises the following steps: acquiring audio data of the traction transformer in a normal operation state; performing time-frequency transformation on the audio data to obtain an original time-frequency spectrogram; inputting the original time-frequency spectrogram into a self-encoding neural network for compression reconstruction to obtain a reconstructed time-frequency spectrogram; calculating a mean square error loss function based on the original time-frequency spectrogram and the reconstructed time-frequency spectrogram; inputting the original time-frequency spectrogram and the reconstructed time-frequency spectrogram into a discrimination neural network for classification discrimination, and calculating a classification loss function; and respectively carrying out adversarial training on the self-encoding neural network and the discriminant neural network based on a mean square error loss function and a classification loss function until Nash equilibrium is achieved. According to the method, the self-coding neural network can learn the characteristics of the normal voiceprint without using the fault voiceprint data of the traction transformer, so that the training cost of the model is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of traction transformer fault diagnosis technology, and in particular to a method for constructing a fault diagnosis model, a fault diagnosis method, a computer device, and a storage medium. Background Technology

[0002] Traction transformers are responsible for converting three-phase electrical energy from the power system into single-phase alternating current suitable for locomotive operation, directly affecting the safe operation of the traction power supply system. Therefore, condition monitoring of traction transformers plays a crucial role in ensuring the normal operation of electrified railway systems. Acoustic fingerprint monitoring, as an emerging equipment condition monitoring and fault diagnosis technology, has the advantages of high accuracy, real-time performance, and non-contact operation, which can compensate for the shortcomings of scheduled maintenance in detecting abnormal internal conditions of transformers in a timely manner.

[0003] In related technologies, supervised learning-based acoustic signature monitoring techniques are used to monitor the status of traction transformers. However, this method requires a large amount of fault acoustic signature data from traction transformers to train the model. In practical applications, however, fault acoustic signature data from traction transformers is extremely scarce and the collection cost is high, which greatly limits the fault diagnosis of traction transformers. Summary of the Invention

[0004] Therefore, it is necessary to provide a method for constructing a fault diagnosis model, a fault diagnosis method, a computer device, and a storage medium that do not require the use of fault voiceprint data to address the above-mentioned technical problems.

[0005] Firstly, this application provides a method for constructing a fault diagnosis model. The method includes: acquiring audio data of a traction transformer under normal operating conditions; performing time-frequency transformation on the audio data to obtain an original time-frequency spectrum; inputting the original time-frequency spectrum into an autoencoder neural network for compression and reconstruction to obtain a reconstructed time-frequency spectrum; calculating a mean squared error loss function based on the original time-frequency spectrum and the reconstructed time-frequency spectrum; inputting the original time-frequency spectrum and the reconstructed time-frequency spectrum into a discriminant neural network for classification and discrimination, and calculating a classification loss function; and performing adversarial training on the autoencoder neural network and the discriminant neural network based on the mean squared error loss function and the classification loss function, respectively, until a Nash equilibrium is reached.

[0006] The aforementioned method for constructing a fault diagnosis model involves acquiring audio data from a traction transformer under normal operating conditions, performing time-frequency transformation to obtain an original time-spectrum image, and then inputting this image into an autoencoder neural network (ANN). This ANN captures normal voiceprint features and reconstructs normal audio data. Simultaneously, the original and reconstructed time-spectrum images are input into a discriminant neural network (DNN) to enhance its ability to distinguish between normal and abnormal data. Through adversarial training, the two neural networks reach Nash equilibrium, thus completing the construction of the fault diagnosis model. This application eliminates the need for fault voiceprint data from the traction transformer, enabling the ANN to learn normal voiceprint features, thereby reducing the model's training cost. Furthermore, by setting up adversarial training for the discriminant neural network, the model's ability to distinguish abnormal states is enhanced, improving its robustness.

[0007] In one embodiment, the step of performing time-frequency transformation on the audio data to obtain the original time-frequency spectrum includes: truncating the audio data based on the Hanning window function to obtain multiple audio segment data; performing fast Fourier transform on the audio segment data respectively to obtain multiple spectrum segment data; and arranging and integrating the multiple spectrum segment data to obtain the original time-frequency spectrum.

[0008] In one embodiment, the step of performing adversarial training on the autoencoder neural network and the discriminant neural network based on the mean squared error loss function and the classification loss function respectively includes: updating the autoencoder neural network based on the first error gradient obtained by backpropagation of the mean squared error loss function; and updating the discriminant neural network based on the second error gradient obtained by backpropagation of the classification loss function and the gradient penalty coefficient of the WGANP loss.

[0009] Secondly, this application also provides a fault diagnosis method. Fault diagnosis is performed using a fault diagnosis model constructed using the construction method described in the first aspect embodiment. The fault diagnosis method includes: acquiring audio data to be tested from a traction transformer; performing time-frequency transformation on the audio data to be tested to obtain a time-frequency spectrum; inputting the time-frequency spectrum into a trained autoencoder neural network to obtain a reconstructed time-frequency spectrum; inputting the time-frequency spectrum into a trained discriminant neural network to obtain intermediate layer features to be tested; wherein the intermediate layer features to be tested are features output by the intermediate layer of the discriminant neural network; determining a reconstruction error based on the time-frequency spectrum and the reconstructed time-frequency spectrum; determining an anomaly score based on the intermediate layer features to be tested and a feature embedding library; wherein the feature embedding library consists of features output by the intermediate layer of the discriminant neural network during training; and determining whether the traction transformer is faulty based on the reconstruction error and the anomaly score.

[0010] The aforementioned fault diagnosis method acquires the audio data to be tested from the traction transformer, performs time-frequency transformation on it to obtain the time-frequency spectrum, and then inputs the time-frequency spectrum into a trained autoencoder neural network to obtain a reconstructed time-frequency spectrum, thereby determining the reconstruction error. Simultaneously, the time-frequency spectrum is input into a trained discriminative neural network to obtain the intermediate layer features output by the intermediate layer of the discriminative neural network, and anomaly scores are determined using a pre-built feature embedding library. Both the reconstruction error and the anomaly score are used to characterize the degree of difference between the time-frequency spectrum under test and the time-frequency spectrum under normal operating conditions. By comparing the degree of difference, it can be determined whether the traction transformer is faulty.

[0011] In one embodiment, the step of performing time-frequency transformation on the audio data to be tested to obtain the time-frequency spectrum diagram includes: truncating the audio data to be tested based on the Hanning window function to obtain multiple audio segment data to be tested; performing fast Fourier transform on the audio segment data to be tested respectively to obtain multiple spectrum segment data to be tested; and arranging and integrating the multiple spectrum segment data to be tested to obtain the time-frequency spectrum diagram to be tested.

[0012] In one embodiment, the step of determining the reconstruction error based on the spectrum diagram of the time under test and the reconstructed spectrum diagram of the time under test includes: calculating the mean square error between the spectrum diagram of the time under test and the reconstructed spectrum diagram of the time under test, and using it as the reconstruction error.

[0013] In one embodiment, the step of determining the anomaly score based on the intermediate layer feature to be tested and the feature embedding library includes: determining the feature in the feature embedding library that is most similar to the intermediate layer feature to be tested using the K-nearest neighbor algorithm, and using it as the neighbor feature; and using the distance between the intermediate layer feature to be tested and the neighbor feature as the anomaly score.

[0014] In one embodiment, the step of determining whether the traction transformer is faulty based on the reconstruction error and the anomaly score includes: calculating the average of the reconstruction error and the anomaly score to obtain a target anomaly score; and determining that the traction transformer is faulty if the target anomaly score is greater than a preset threshold.

[0015] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of the above-described method.

[0016] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements the steps of the above-described method. Attached Figure Description

[0017] Figure 1 This is a flowchart illustrating the construction method in one embodiment;

[0018] Figure 2 This is a schematic diagram of the process for obtaining the original time-frequency spectrum in one embodiment;

[0019] Figure 3 This is a schematic diagram of the adversarial training process in one embodiment;

[0020] Figure 4 This is a flowchart illustrating a fault diagnosis method in one embodiment;

[0021] Figure 5 This is a schematic diagram of the process for obtaining the spectrum of the time under test in one embodiment;

[0022] Figure 6 This is a flowchart illustrating the process of determining anomaly scores in one embodiment;

[0023] Figure 7 This is a flowchart illustrating the process of determining a traction transformer fault in one embodiment;

[0024] Figure 8 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0025] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0026] The fault diagnosis model construction method and fault diagnosis method provided in this application can be applied to terminal devices. Terminal devices can be, but are not limited to, various personal computers, laptops, tablets, IoT devices, etc.

[0027] In one embodiment, such as Figure 1 As shown, a method for constructing a fault diagnosis model is provided. Taking the application of this method to a terminal device as an example, the method includes the following steps:

[0028] Step S110: Obtain audio data of the traction transformer under normal operating conditions.

[0029] Specifically, the terminal equipment first acquires audio data from the traction transformer under normal operating conditions. When the traction transformer is running without faults, the corresponding audio data can be collected using a high-sensitivity sound acquisition device (microphone or vibration sensor). It is understood that when collecting audio data, it is advisable to cover the traction transformer's operating conditions under different loads and ambient temperatures to ensure data diversity.

[0030] Step S120: Perform time-frequency transformation on the audio data to obtain the original time-frequency spectrum.

[0031] Specifically, the audio data acquired by the terminal device is a one-dimensional time-domain signal. By performing a time-frequency transformation, it can be converted into a two-dimensional time-spectrum graph, thus obtaining the original time-spectrum graph. The original time-spectrum graph is used to characterize the frequency components of the signal as it changes over time, providing feature-rich input for neural networks. Short-time Fourier transform (STFT), wavelet transform, and other techniques can be used for time-frequency transformation.

[0032] Step S130: Input the original time-spectrum image into the autoencoder neural network for compression and reconstruction to obtain the reconstructed time-spectrum image.

[0033] Specifically, after obtaining the original time-spectrum image, the terminal device inputs it into an autoencoder neural network for compression and reconstruction, thereby obtaining a reconstructed time-spectrum image. The autoencoder neural network includes an encoder and a decoder. The encoder compresses the time-spectrum image layer by layer through convolutional layers and pooling layers to generate a low-dimensional latent representation. The decoder reconstructs the time-spectrum image from the latent representation through deconvolutional layers and upsampling layers, thereby obtaining a reconstructed time-spectrum image of the same size as the input original time-spectrum image.

[0034] Step S140: Calculate the mean squared error loss function based on the original time spectrum and the reconstructed time spectrum.

[0035] Specifically, after obtaining the reconstructed time-of-flight spectrum, the terminal device calculates the mean squared error loss function (MSE Loss) using the original time-of-flight spectrum and the reconstructed time-of-flight spectrum to quantify the reconstruction quality. The smaller the error, the closer the reconstructed time-of-flight spectrum is to the original time-of-flight spectrum, indicating that the autoencoder neural network has learned the normal voiceprint features more fully.

[0036] Step S150: Input the original time-spectrum image and the reconstructed time-spectrum image into the discriminant neural network for classification and discrimination, and calculate the classification loss function.

[0037] Specifically, after obtaining the original and reconstructed time-spectrum maps, the terminal device inputs them into a discriminative neural network for classification, distinguishing between the original time-spectrum map and the reconstructed time-spectrum map. The structure of the discriminative neural network is similar to the encoder structure in an autoencoder neural network, but its last layer is replaced by a deep convolution to facilitate the extraction of semantic embeddings. Layer normalization can be employed to prevent statistical data from the target domain from being masked by statistical data from the source domain, thus preserving distinguishable features and improving the scalability of both domains. By capturing subtle differences, the discriminative neural network inversely drives the autoencoder neural network to eliminate redundant information, enhancing its ability to reconstruct key features.

[0038] Step S160: Perform adversarial training on the autoencoder neural network and the discriminator neural network based on the mean squared error loss function and the classification loss function, respectively, until Nash equilibrium is reached.

[0039] Specifically, when training two neural networks, the terminal device optimizes the discriminator neural network by fixing the parameters of the autoencoder neural network, and then optimizes the autoencoder neural network by fixing the parameters of the discriminator neural network again, iterating repeatedly until both reach Nash equilibrium. For example, when the discriminator neural network cannot distinguish between the original time-series spectrogram and the reconstructed time-series spectrogram (accuracy ≈ 50%), the model reaches a stable state.

[0040] The aforementioned method for constructing a fault diagnosis model involves acquiring audio data from a traction transformer under normal operating conditions, performing time-frequency transformation to obtain an original time-spectrum image, and then inputting this image into an autoencoder neural network (ANN). This ANN captures normal voiceprint features and reconstructs normal audio data. Simultaneously, the original and reconstructed time-spectrum images are input into a discriminant neural network (DNN) to enhance its ability to distinguish between normal and abnormal data. Through adversarial training, the two neural networks reach Nash equilibrium, thus completing the construction of the fault diagnosis model. This application eliminates the need for fault voiceprint data from the traction transformer, enabling the ANN to learn normal voiceprint features, thereby reducing the model's training cost. Furthermore, by setting up adversarial training for the discriminant neural network, the model's ability to distinguish abnormal states is enhanced, improving its robustness.

[0041] In one embodiment, such as Figure 2 As shown, step S120, which involves performing time-frequency transformation on the audio data to obtain the original time-frequency spectrum, includes:

[0042] Step S121: Extract audio data based on the Hanning window function to obtain multiple audio segment data.

[0043] Specifically, this embodiment uses Short-Time Fourier Transform (STFT) to perform time-frequency transformation on the audio data. First, the audio data is truncated using a Hanning window function to obtain multiple audio segments. For example, if the acquired audio data is a discrete digital signal x(n) with a signal length of L, and the window size of the Hanning window function is set to M with a window movement step of H, the signal truncation is completed by multiplying the audio data with the Hanning window function. The Hanning window function is shown in the following formula:

[0044]

[0045] Step S122: Perform Fast Fourier Transform on the audio segment data to obtain multiple spectral segment data.

[0046] Specifically, after truncating the audio data using the Hanning window function, a Fast Fourier Transform (FFT) is performed on the truncated signal to obtain the transformed spectral segment data X1(k):

[0047]

[0048] Where N is the number of transformation points in the Discrete Fourier Transform, and the length of the spectrum X1(k) is N. It can be understood that after capturing an audio segment, a Fast Fourier Transform can be immediately performed on it to obtain the corresponding spectrum segment data. Then, the process is repeated at position n+H until the entire audio data of length L has been transformed, thus obtaining multiple spectrum segment data.

[0049] Step S123: Arrange and integrate multiple spectral segment data to obtain the original time-spectrum diagram.

[0050] Specifically, after obtaining multiple spectral segments, they are arranged and integrated to obtain the original time-frequency spectrum. For example, the original time-frequency spectrum obtained after arrangement and integration is T(w,t), where w represents the frequency axis and t represents the time axis. The horizontal axis of the original time-frequency spectrum has a size of N, and the vertical axis has a size of N. .

[0051] In one embodiment, such as Figure 3 As shown, step S160, which involves adversarial training of the autoencoder neural network and the discriminator neural network based on the mean squared error loss function and the classification loss function, respectively, includes:

[0052] Step S161: Update the autoencoder neural network based on the first error gradient obtained by backpropagation of the mean square error loss function.

[0053] Step S162: Update the discriminative neural network based on the second error gradient obtained by backpropagation of the classification loss function and the gradient penalty coefficient of the WWGANGP loss.

[0054] Specifically, during adversarial training, the original time-spectrum graph T(w,t) is first input into the autoencoder neural network. Where θ represents the parameters of the autoencoder neural network, and the reconstructed spectrum T is obtained after compression and reconstruction by the autoencoder neural network. * (w,t). Then, based on the original time-frequency spectrum T(w,t) and the reconstructed time-frequency spectrum T... * (w,t) Calculate the mean squared error loss function L M The calculation formula is as follows:

[0055]

[0056] At this point, the first error gradient obtained by backpropagation through the mean squared error loss function updates the parameters θ of the autoencoder neural network.

[0057] Then, the original time-frequency spectrum T(w,t) and the reconstructed time-frequency spectrum T are compared. * (w,t) Input discriminative neural network The classification is performed, and the classification loss function L is calculated. C The calculation formula is as follows:

[0058]

[0059] Among them, when input into the discriminative neural network In the time-spectrum graph, y=1 when it is the original time-spectrum graph; otherwise, y=0. ^ λ represents the discrimination probability of the discriminative neural network output, that is, the probability that the discriminative neural network considers both input time-spectrum graphs to be the original time-spectrum graphs. λ is the gradient penalty coefficient of the WGANP loss, and T... ^ This is the time-frequency spectrum of the input to the discriminative neural network. The discriminative neural network is updated using the second error gradient obtained through backpropagation of the classification loss function and the gradient penalty coefficient of the WGANP loss. This completes the training of both neural networks, resulting in a trained autoencoder neural network and a discriminative neural network.

[0060] In one embodiment, such as Figure 4 As shown, this application also proposes a fault diagnosis method, which uses the fault diagnosis model constructed by the construction method in the above embodiments to perform fault diagnosis. Taking the application of this method to a terminal device as an example, the method includes the following steps:

[0061] Step S210: Obtain the audio data to be tested from the traction transformer.

[0062] Specifically, when the terminal device in this embodiment performs fault diagnosis on the traction transformer, it first acquires the audio data to be tested of the traction transformer during operation. At this time, the operating status of the traction transformer may be normal or abnormal.

[0063] Step S220: Perform time-frequency transformation on the audio data to be tested to obtain the time-frequency spectrum diagram.

[0064] Specifically, the audio data acquired by the terminal device is a one-dimensional time-domain signal. By performing a time-frequency transformation, it can be converted into a two-dimensional time-spectrum, thus obtaining the time-spectrum to be tested. The format of the time-spectrum to be tested is aligned with that of the original time-spectrum during training to ensure consistency in the feature space. Short-time Fourier transform (STFT), wavelet transform, and other techniques can be used for time-frequency transformation.

[0065] Step S230: Input the spectrum of the time to be tested into the trained autoencoder neural network to obtain the reconstructed spectrum of the time to be tested.

[0066] Specifically, after obtaining the time-to-test spectrum, the terminal device inputs it into a trained autoencoder neural network to obtain a reconstructed time-to-test spectrum, which is used to detect anomalies through the reconstruction capability of the autoencoder neural network. If the time-to-test spectrum was collected when the traction transformer was operating normally, the reconstruction error of the resulting reconstructed time-to-test spectrum will be small; otherwise, the error will be large.

[0067] Step S240: Input the spectrum of the time to be tested into the trained discriminative neural network to obtain the intermediate layer features to be tested.

[0068] Specifically, after obtaining the spectrum of the time to be tested, the terminal device inputs it into the trained discriminative neural network to obtain the features output by the intermediate layers of the discriminative neural network, and uses these features as the intermediate layer features to be tested. These intermediate layer features contain high-level information such as spectral structure and harmonic distribution. In some embodiments, the penultimate fully connected layer of the discriminative neural network can be used as the intermediate layer outputting the intermediate layer features to be tested.

[0069] Step S250: Determine the reconstruction error based on the spectrum diagram of the time under test and the reconstructed spectrum diagram of the time under test.

[0070] Specifically, after the terminal device obtains the reconstructed spectrum of the time to be tested, it determines the reconstruction error by combining the spectrum of the time to be tested. The reconstruction error is used to quantify the reconstruction quality of the input data by the autoencoder neural network, and it can be obtained by the mean squared error loss function when training the autoencoder neural network.

[0071] Step S260: Determine the anomaly score based on the features of the intermediate layer to be tested and the feature embedding library.

[0072] Specifically, after obtaining the intermediate layer features to be tested, the terminal device determines the anomaly score by combining them with a feature embedding library. The feature embedding library consists of features output by the intermediate layers of the discriminative neural network during training, and these features can highlight key information from the training samples.

[0073] Step S270: Determine whether the traction transformer is faulty based on the reconstruction error and the anomaly score.

[0074] Specifically, when determining whether a traction transformer is faulty, the terminal equipment can comprehensively judge whether the traction transformer is faulty by fusing the reconstruction error and the anomaly score. For example, it can be determined by a threshold-based joint judgment: if the reconstruction error is greater than threshold A and the anomaly score is greater than threshold B, a fault is determined; or by a weighted fusion method: a weight is assigned to the reconstruction error and the anomaly score respectively, and a fault is determined when the calculated weighted sum is greater than threshold C. In some embodiments, the threshold value for judgment can also be dynamically adjusted according to the operating conditions of the traction transformer.

[0075] In one embodiment, such as Figure 5 As shown, step S220, which involves performing time-frequency transformation on the audio data to be tested to obtain the time-frequency spectrum, includes:

[0076] Step S221: Based on the Hanning window function, the audio data to be tested is truncated to obtain multiple audio segment data to be tested;

[0077] Step S222: Perform Fast Fourier Transform on the audio segment data to be tested respectively to obtain multiple spectrum segment data to be tested;

[0078] Step S223: Arrange and integrate multiple spectrum segments to be tested to obtain the spectrum diagram of the time to be tested.

[0079] Specifically, in this embodiment, the method for performing time-frequency transformation on the audio data under test is the same as the method for performing time-frequency transformation on audio data, both being Short-Time Fourier Transform (STFT). After the STFT, the audio data under test can be converted into a time-frequency spectrum. The specific method is the same as described above and will not be repeated here.

[0080] In one embodiment, step S250, the step of determining the reconstruction error based on the spectrum image of the time under test and the reconstructed spectrum image of the time under test, includes: calculating the mean square error (MSE) between the spectrum image of the time under test and the reconstructed spectrum image of the time under test, and using it as the reconstruction error. Specifically, in this embodiment, the reconstruction error is obtained by calculating the mean square error (MSE) between the spectrum image of the time under test and the reconstructed spectrum image of the time under test pixel by pixel.

[0081] In one embodiment, such as Figure 6As shown, step S260, which involves determining the anomaly score based on the features of the intermediate layer to be tested and the feature embedding library, includes:

[0082] Step S261: Use the K-nearest neighbor algorithm to determine the feature in the feature embedding library that is most similar to the intermediate layer feature to be tested, and use it as the neighbor feature;

[0083] Step S262: The distance between the intermediate layer feature to be tested and the neighboring features is used as the anomaly score.

[0084] Specifically, in this embodiment, the K-Nearest Neighbors (KNN) algorithm is used to calculate the distance between the intermediate layer feature to be tested and each feature in the feature embedding library. The feature with the closest distance, i.e., the most similar feature, is taken as the neighbor feature, and then the distance between the intermediate layer feature to be tested and the neighbor feature is directly used as the anomaly score. When calculating the distance between two features, cosine distance, Mahalanobis distance, etc. can be used.

[0085] In one embodiment, such as Figure 7 As shown, step S270, which involves determining whether the traction transformer is faulty based on the reconfiguration error and anomaly score, includes:

[0086] Step S271: Calculate the mean of the reconstruction error and the anomaly score to obtain the target anomaly score;

[0087] Step S272: If the target anomaly score is greater than a preset threshold, it is determined that the traction transformer has a fault.

[0088] Specifically, in this embodiment, when determining whether the traction transformer is faulty based on the reconstruction error and the anomaly score, the average of the reconstruction error and the anomaly score is first calculated to obtain the target anomaly score. Then, the target anomaly score is compared with a preset threshold. If the target anomaly score is less than or equal to the preset threshold, it indicates that the audio data to be tested is similar to the audio data under normal conditions, and the traction transformer is not faulty. If the target anomaly score is greater than the preset threshold, it indicates that the audio data to be tested is significantly different from the audio data under normal conditions, and the traction transformer is faulty.

[0089] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0090] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 8 As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a method for constructing a fault diagnosis model or a fault diagnosis method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.

[0091] Those skilled in the art will understand that Figure 8 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0092] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.

[0093] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above-described method embodiments.

[0094] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0095] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0096] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A method for constructing a fault diagnosis model, characterized in that, The construction method includes: Acquire audio data of the traction transformer under normal operating conditions; Perform time-frequency transformation on the audio data to obtain the original time-frequency spectrum. The original time-spectrum image is input into an autoencoder neural network for compression and reconstruction to obtain the reconstructed time-spectrum image. The mean squared error loss function is calculated based on the original time-frequency spectrum and the reconstructed time-frequency spectrum. The original time-frequency spectrum and the reconstructed time-frequency spectrum are input into a discriminative neural network for classification and discrimination, and the classification loss function is calculated. The autoencoder neural network and the discriminator neural network are subjected to adversarial training based on the mean squared error loss function and the classification loss function, respectively, until Nash equilibrium is reached.

2. The construction method according to claim 1, characterized in that, The step of performing time-frequency transformation on the audio data to obtain the original time-frequency spectrum includes: The audio data is truncated using the Hanning window function to obtain multiple audio segment data; The audio segment data is subjected to Fast Fourier Transform to obtain multiple spectral segment data. The original time-spectrum diagram is obtained by arranging and integrating multiple spectral segment data.

3. The construction method according to claim 1, characterized in that, The step of performing adversarial training on the autoencoder neural network and the discriminator neural network based on the mean squared error loss function and the classification loss function, respectively, includes: The autoencoder neural network is updated based on the first error gradient obtained by backpropagation of the mean squared error loss function. The discriminative neural network is updated based on the second error gradient obtained by backpropagation of the classification loss function and the gradient penalty coefficient of the WGNGP loss.

4. A fault diagnosis method, characterized in that, Fault diagnosis is performed using a fault diagnosis model constructed by the construction method according to any one of claims 1 to 3, wherein the fault diagnosis method includes: Acquire the audio data to be tested from the traction transformer; The audio data to be tested is subjected to time-frequency transformation to obtain the time-frequency spectrum of the test data; The spectrum of the time to be tested is input into the trained autoencoder neural network to obtain the reconstructed spectrum of the time to be tested; The spectrum of the time to be tested is input into the trained discriminative neural network to obtain the intermediate layer features to be tested; wherein, the intermediate layer features to be tested are the features output by the intermediate layer of the discriminative neural network; The reconstruction error is determined based on the spectrum diagram of the time under test and the reconstructed spectrum diagram of the time under test. Anomaly scores are determined based on the features of the intermediate layer to be tested and the feature embedding library; wherein, the feature embedding library is composed of features output by the intermediate layer of the discriminative neural network during training; The traction transformer is determined to be faulty based on the reconstruction error and the anomaly score.

5. The fault diagnosis method according to claim 4, characterized in that, The step of performing time-frequency transformation on the audio data to be tested to obtain the time-frequency spectrum includes: The audio data to be tested is truncated using the Hanning window function to obtain multiple audio segment data. The audio segment data to be tested is subjected to Fast Fourier Transform to obtain multiple spectrum segment data to be tested; The multiple spectrum segments to be tested are arranged and integrated to obtain the spectrum diagram to be tested.

6. The fault diagnosis method according to claim 4, characterized in that, The step of determining the reconstruction error based on the spectrum of the time under test and the reconstructed spectrum of the time under test includes: The mean square error between the spectrum diagram of the time under test and the reconstructed spectrum diagram of the time under test is calculated and used as the reconstruction error.

7. The fault diagnosis method according to claim 4, characterized in that, The step of determining the anomaly score based on the intermediate layer features to be tested and the feature embedding library includes: The K-nearest neighbor algorithm is used to determine the feature in the feature embedding library that is most similar to the intermediate layer feature to be tested, and this feature is used as the neighbor feature. The distance between the intermediate layer feature to be tested and the neighboring features is used as the anomaly score.

8. The fault diagnosis method according to claim 4, characterized in that, The step of determining whether the traction transformer is faulty based on the reconstruction error and the anomaly score includes: The target anomaly score is obtained by calculating the mean of the reconstruction error and the anomaly score. If the target anomaly score is greater than a preset threshold, it is determined that the traction transformer has a fault.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 8.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 8.