A transformer-cnn network-based fault diagnosis method and system for an electricity-hydrogen coupling system

By combining the Transformer-CNN network with multi-head self-attention and 3D convolutional kernels, efficient diagnosis of faults in electro-hydrogen coupling systems is achieved, solving the problems of poor generalization ability and insufficient feature extraction at multiple time scales in existing technologies, and improving the accuracy and robustness of diagnosis.

CN121188577BActive Publication Date: 2026-03-03SHANGHAI JIAOTONG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511725354.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-24
Publication Date
2026-03-03
Estimated Expiration
2045-11-24

AI Technical Summary

Technical Problem

Existing technologies for fault diagnosis of electro-hydrogen coupling systems suffer from poor generalization ability of mechanistic models, lack of physical interpretation in data-driven models, and insufficient extraction of fault features across multiple time scales, resulting in a high rate of missed diagnoses of complex faults.

Method used

A Transformer-CNN network is used to collect and preprocess the operating data of the electro-hydrogen coupling system. Long-term temporal dependency features are extracted by the multi-head self-attention mechanism in the Transformer, and local features are mined by the three-dimensional convolutional kernel in the CNN. Fault classification is achieved through joint pooling and fully connected layers, and a performance evaluation system is established.

Benefits of technology

It improves the accuracy and recall of fault diagnosis in electro-hydrogen coupling systems, reduces confusion, enhances the generalization ability of multi-scale operating data, and covers fault diagnosis under different conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121188577B_ABST
    Figure CN121188577B_ABST
Patent Text Reader

Abstract

This invention provides a fault diagnosis method and system for an electro-hydrogen coupling system based on a Transformer-CNN network. The method includes: collecting operating data of the electro-hydrogen coupling system and preprocessing the operating data, which includes dynamic parameters under normal and fault conditions. The preprocessing includes filtering and normalization. The preprocessed operating data is divided into a training set and a test set. The training set is input into a constructed Transformer-CNN hybrid neural network model for training. The multi-head self-attention mechanism layer in the Transformer extracts long-range temporal dependency features, and the three-dimensional convolutional kernel in the CNN mines local features. Fault classification is achieved through joint pooling and fully connected layers. An evaluation system is established between performance evaluation results and feature diagnosis results. The diagnostic capability of the Transformer-CNN hybrid neural network model for the electro-hydrogen coupling system is evaluated based on the test set. The evaluation system includes accuracy, recall, and confusion matrix dispersion.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of energy diagnostic technology, and in particular to a fault diagnosis method and system for an electro-hydrogen coupling system based on a Transformer-CNN network. Background Technology

[0002] As a critical infrastructure for energy transition, the accuracy of fault diagnosis in electro-hydrogen coupling systems directly impacts system safety and economic operation. Currently, the industry primarily relies on two technical approaches: physical modeling based on electrochemical mechanisms and machine learning methods based on monitoring data, both of which have significant limitations. Regarding mechanistic models, mainstream methods construct a set of differential equations including the Butler-Volmer electrode kinetics equation, the gas diffusion layer mass transfer equation, and the proton exchange membrane ion conduction equation, using voltage / current deviation thresholds to determine faults. These models are extremely sensitive to parameter accuracy—after the system has run for more than 500 hours, the model prediction error expands to over 25%. More seriously, existing physical models cannot characterize the effects of multiple fault coupling: experimental data shows that when hydrogen permeation and coolant leakage occur concurrently, the false diagnosis rate of traditional models reaches as high as 42.3% because their equations do not consider cross-interference terms.

[0003] In the data-driven field, traditional machine learning methods rely on manual feature engineering to extract time-domain statistics or frequency-domain wavelet coefficients. However, the fault characteristics of electro-hydrogen systems exhibit strong dynamics and multi-scale characteristics. For example, cathode faults manifest as voltage drops on a 0.1-second scale, while exhibiting abnormal temperature gradients on a 10-minute scale. Manually designed features are insufficient to cover fault patterns across all scales. In deep learning methods, CNNs are sensitive to sudden voltage drops due to their local perception characteristics, but fixed-scale convolutional kernels cannot simultaneously capture millisecond-level electrochemical transients and hourly-level aging trends. While LSTMs can model long sequences, the vanishing gradient problem causes them to forget more than 60% of slow fault features beyond 800 time steps. A more fundamental drawback is that a single model architecture struggles to coordinate the optimization of local feature sensitivity and global context awareness, resulting in a diagnostic confusion rate of over 0.38 for complex faults.

[0004] Therefore, in summary, the industry has long faced three technical dilemmas in the existing technology: First, the mechanism model has poor generalization ability under complex working conditions and requires frequent recalibration of parameters; second, the data-driven model has "black box" characteristics and lacks physical explanation for fault attribution; third, the existing methods are insufficient in extracting fault features at multiple time scales, especially for composite faults with a false negative rate of over 30%. Summary of the Invention

[0005] To address the problems existing in the prior art, embodiments of the present invention provide a method and system for fault diagnosis of an electro-hydrogen coupling system based on a Transformer-CNN network.

[0006] This invention provides a fault diagnosis method for an electro-hydrogen coupling system based on a Transformer-CNN network, the method comprising:

[0007] The system collects operating data of the electro-hydrogen coupling system and preprocesses the operating data, which includes dynamic parameters under normal and fault conditions. The preprocessing includes filtering and normalization.

[0008] The preprocessed operating data is divided into a training set and a test set. The training set is input into the constructed Transformer-CNN hybrid neural network model for training. The multi-head self-attention mechanism layer in the Transformer extracts long-term temporal dependency features, the three-dimensional convolutional kernel in the CNN mines local features, and fault classification is achieved through joint pooling and fully connected layers.

[0009] An evaluation system is established between performance evaluation results and feature diagnosis results. Based on the test set, the diagnostic capability of the Transformer-CNN hybrid neural network model for the electro-hydrogen coupling system is evaluated. The evaluation system includes accuracy, recall, and confusion matrix dispersion.

[0010] In one embodiment, the filtering is achieved by performing statistical processing on a certain number of continuous data points using a sliding window filtering algorithm to smooth the original signal. The algorithm includes:

[0011]

[0012] in, The filtered output at time k. Let N be the original signal at time k, and N be the sliding window size.

[0013] In one embodiment, the normalized calculation formula includes:

[0014]

[0015] Where x is the original data, The minimum value of the data in the original data sequence. The maximum value of the data in the original data sequence. This is the new data after normalization.

[0016] In one embodiment, the convolutional layer of the Transformer-CNN hybrid neural network model includes:

[0017]

[0018] in, Let K be the convolution kernel tensor, K be the kernel width, F be the number of filters, D be the dimension of the convolutional layer, f be the nonlinear activation function, b be the bias matrix, and H be the output of the convolutional layer. This is the input for the convolutional layer.

[0019] In one embodiment, during the training of the Transformer-CNN hybrid neural network model, the relationship between different positions in the working condition operation data sequence is captured by scaling dot product attention. The scaling dot product attention includes: generating attention weights by calculating the similarity between the query and the key, performing a weighted summation dot product on the values, and normalizing the variance of the dot product by a scaling factor. The query, key, and value are matrices obtained by linear transformation of the working condition operation data sequence.

[0020] The formula for calculating the scaled dot product attention includes:

[0021]

[0022] Where Q represents the query, K represents the key, and V represents the value. is the scaling factor, and softmax is the normalized probability distribution.

[0023] In one embodiment, the computation formula in the multi-head self-attention mechanism layer of the Transformer, when processed in parallel by 8 heads, includes:

[0024]

[0025]

[0026]

[0027] Where W is the weight matrix, Q is the query, K is the key, V is the value, and i is the i-th header. , , Independent linear transformation weight matrix for each head, head i Let be the output matrix of the i-th head, Attention() be the scaling dot product attention function, MultiHead be the final output of multi-head attention, and Concat() be the function to concatenate the outputs of the 8 heads. This is the output weight matrix.

[0028] In one embodiment, the raw signal corresponding to the operating condition data is received and random disturbances are injected through a Gaussian noise layer.

[0029] The original signal is injected into a feature extraction backbone network consisting of three multi-scale convolutional blocks. After each branch is convolved, batch normalization and Swish activation are performed, followed by max pooling to compress the time dimension and applying Dropout regularization.

[0030] A Transformer module with an 8-head self-attention mechanism is introduced to establish global temporal correlations, and the training process is carried out through layer normalization and residual connections.

[0031] By combining global average pooling and global max pooling, dual statistical features are extracted. After interaction through a 512-dimensional fully connected layer, the results are output by a three-class fully connected layer with high-intensity Dropout.

[0032] This invention provides a fault diagnosis system for an electro-hydrogen coupling system based on a Transformer-CNN network, the system comprising:

[0033] The acquisition module is used to acquire the operating data of the electro-hydrogen coupling system and preprocess the operating data. The operating data includes dynamic parameters under normal operation and fault conditions. The preprocessing includes filtering and normalization.

[0034] The training module is used to divide the preprocessed operating data into training set and test set. The training set is input into the constructed Transformer-CNN hybrid neural network model for training. The multi-head self-attention mechanism layer in the Transformer extracts long-term temporal dependency features, the three-dimensional convolutional kernel in the CNN mines local features, and fault classification is achieved through joint pooling and fully connected layers.

[0035] The evaluation module is used to establish an evaluation system between performance evaluation results and feature diagnosis results. Based on the test set, it evaluates the diagnostic capability of the Transformer-CNN hybrid neural network model for the electro-hydrogen coupling system. The evaluation system includes accuracy, recall, and confusion matrix dispersion.

[0036] This invention provides an electronic device, including a processor and a memory;

[0037] The processor is connected to the memory;

[0038] The memory is used to store executable program code;

[0039] The processor runs a program corresponding to the executable program code stored in the memory to perform the methods described in one or more embodiments.

[0040] This invention provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the above-described fault diagnosis method for an electro-hydrogen coupling system based on a Transformer-CNN network.

[0041] In view of the above, in one or more embodiments of this specification, operating data of the electro-hydrogen coupling system is collected and preprocessed. The operating data includes dynamic parameters under normal and fault conditions. Preprocessing includes filtering and normalization. The preprocessed operating data is divided into a training set and a test set. The training set is input into a constructed Transformer-CNN hybrid neural network model for training. The multi-head self-attention mechanism layer in the Transformer extracts long-range temporal dependency features, while the three-dimensional convolutional kernel in the CNN mines local features. Fault classification is achieved through joint pooling and fully connected layers. An evaluation system is established between performance evaluation results and feature diagnosis results. The diagnostic capability of the Transformer-CNN hybrid neural network model for the electro-hydrogen coupling system is evaluated based on the test set. The evaluation system includes accuracy, recall, and confusion matrix dispersion. Thus, in time series classification tasks, it simultaneously possesses local feature sensitivity, global context understanding capability, and strong generalization performance, covering multi-scale operating data, improving generalization ability under different conditions, and also improving the diagnosis rate of various faults. Attached Figure Description

[0042] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0043] Figure 1 This is a flowchart of a fault diagnosis method for an electro-hydrogen coupling system based on a Transformer-CNN network, provided in one embodiment of this specification.

[0044] Figure 2 This is a schematic diagram of the structure of a fault diagnosis system for an electro-hydrogen coupling system based on a Transformer-CNN network, provided in one embodiment of this specification.

[0045] Figure 3 This is a schematic diagram of the structure of an electronic device provided in one embodiment of this specification. Detailed Implementation

[0046] The subject matter described herein will now be discussed with reference to exemplary embodiments. It should be understood that these embodiments are discussed merely to enable those skilled in the art to better understand and implement the subject matter described herein, and are not intended to limit the scope, applicability, or examples set forth in the claims. The function and arrangement of the elements discussed may be changed without departing from the scope of this specification. Various processes or components may be omitted, substituted, or added as needed in the various examples. For example, the described methods may be performed in a different order than described, and steps may be added, omitted, or combined. Furthermore, features described in some examples may be combined in other examples.

[0047] As used herein, the term "comprising" and its variations are open terms meaning "including but not limited to". The term "based on" means "at least partially based on". The terms "one embodiment" and "an embodiment" mean "at least one embodiment". The term "another embodiment" means "at least one other embodiment". The terms "first", "second", etc., may refer to different or the same objects. Other definitions, whether explicit or implicit, may be included below. Unless explicitly indicated by the context, the definition of a term shall remain consistent throughout the specification.

[0048] like Figure 1 As shown, this embodiment of the invention provides a fault diagnosis method for an electro-hydrogen coupling system based on a Transformer-CNN network, including:

[0049] Step S102: Collect the operating data of the electro-hydrogen coupling system and preprocess the operating data. The operating data includes dynamic parameters under normal operation and fault conditions. The preprocessing includes filtering and normalization.

[0050] Specifically, the physical state of an electro-hydrogen coupling system (such as a fuel cell stack) is monitored by sensor arrays deployed on key physical nodes. These arrays are connected to the system's electrochemical unit to acquire the electrochemical state of the electro-hydrogen coupling system. The collected full-condition operating data covers the core operational dimensions of the system, forming a multimodal dataset. This dataset can include dynamic parameters under normal and fault conditions. In this example, parameter types include, but are not limited to, current density, output voltage waveform, cathode humidity, cathode pressure, anode humidity, and anode pressure. These parameters include not only normal conditions (including stable operating data under different loads, temperatures, and humidity levels) but also parameters under fault conditions. Fault conditions include various single faults introduced artificially or naturally (such as injecting air alone, reducing coolant flow alone, etc.) and compound faults (such as simultaneously injecting air and increasing anode humidity), and their dynamic evolution process is fully recorded. Data covering all operating conditions effectively addresses the problem of poor generalization ability of mechanistic models.

[0051] Furthermore, after collecting the operating data, a preprocessing step is performed on the operating data, which includes, but is not limited to, filtering and normalization.

[0052] The filtering process includes: performing statistical processing on a certain number of continuous data points using a sliding window filtering algorithm to smooth the original signal and reduce the impact of random noise. Specifically, for each point K in the sequence, its filtered value... It is the original value of the current point and the N-1 points before it. The algorithm's average value. This window slides forward as K slides.

[0053]

[0054] in, The filtered output at time k. Let N be the original signal at time k, and N be the sliding window size. The window size N determines the smoothness and response speed of the filter: a larger N results in better filtering but a slower response and increased latency; a smaller N results in a faster response but a weaker filtering effect. In this example, a window size N of 5 is chosen. A smaller N can respond more quickly to rapid changes in the signal, thereby preserving these key transient fault characteristics to the greatest extent and avoiding them from being over-smoothed out.

[0055] The normalization process includes mapping the entire original data to a specified interval [0, 1] to ensure that all samples are transformed to the same numerical reference system.

[0056]

[0057] Where x is the original data, The minimum value of the data in the original data sequence. The maximum value of the data in the original data sequence. For the new data after normalization, the Min-Max method is used for normalization in this example, but the normalization method is not subject to specific restrictions in practical applications.

[0058] Step S104: The preprocessed operating data is divided into a training set and a test set. The training set is input into the constructed Transformer-CNN hybrid neural network model for training. The multi-head self-attention mechanism layer in the Transformer extracts long-term temporal dependency features, the three-dimensional convolutional kernel in the CNN mines local features, and fault classification is achieved through joint pooling and fully connected layers.

[0059] Specifically, the preprocessed operating data can be divided into a training set and a test set. The training set is used to train the Transformer-CNN hybrid neural network model in subsequent steps, while the test set is used to evaluate the performance of the trained Transformer-CNN hybrid neural network model. The ratio of the training set to the test set can be 8:2 or 9:1.

[0060] Furthermore, in the Transformer-CNN hybrid neural network model, CNN is used to extract local spatiotemporal patterns of data, while Transformer's multi-head self-attention mechanism (MHSA) is used to model global context and long-range dependencies.

[0061] The Convolutional Neural Network (CNN) in Transformer-CNN is a feedforward neural network that includes convolutional computations. It extracts image features and performs classification or regression through structures such as convolutional layers, activation functions, pooling layers, and fully connected layers. It is widely used in computer vision. Its convolutional layer can be described as follows:

[0062]

[0063] in, Let K be the convolution kernel tensor, K be the kernel width, F be the number of filters, D be the dimension of the convolutional layer, f be the nonlinear activation function, b be the bias matrix, and H be the output of the convolutional layer. This is the input for the convolutional layer.

[0064] In training the Transformer-CNN hybrid neural network model, scaled dot product attention is a core mechanism in the Transformer model, used to dynamically capture dependencies between different positions in a sequence. Its core idea is to generate attention weights by calculating the similarity between the query and the key, and then summing the values ​​using weighted averages. When the similarity is large, the result of the dot product can be very large, causing the input to the softmax function to enter the gradient saturation region (close to 0 or 1). The scaling factor normalizes the variance of the dot product to 1, alleviating the vanishing gradient problem.

[0065] The formula for calculating scaled dot product attention includes:

[0066]

[0067] Where Q represents the query, K represents the key, and V represents the value. is the scaling factor, and softmax is the normalized probability distribution.

[0068] Multi-head parallel computation is a core innovation of the Transformer model, aiming to capture different types of dependencies in data through multiple independent attention subspaces in parallel. The computational formula for parallel computation using eight heads in the multi-head self-attention mechanism layer of the Transformer includes:

[0069]

[0070]

[0071]

[0072] Where W is the weight matrix, , , Each head undergoes an independent linear transformation weight matrix, projecting the input onto different sub-controls. For example, one head might focus on the long-term relationship between temperature and pressure, while another head might focus on the short-term inverse relationship between voltage and humidity. i Let be the output matrix of the i-th head, Attention() be the scaling dot product attention function, MultiHead be the final output of multi-head attention, and Concat() be the concatenation of the outputs of the 8 heads using a learnable output weight matrix. Perform a linear transformation to fuse the information from all the heads.

[0073] Furthermore, the Transformer-CNN neural network employs a hierarchical architecture, first receiving raw signals with 6 channels and 1800 time steps through the input layer. The 6 channels correspond to the 6 types of parameters (current density, voltage waveform, cathode / anode humidity, and pressure) acquired in step S102. The 1800 time steps define the length of a sample sequence, the specific time span of which is determined by the sampling frequency. A Gaussian noise layer injects random perturbations to enhance robustness, effectively preventing overfitting and improving generalization ability.

[0074] The network then enters a feature extraction backbone consisting of three multi-scale convolutional blocks—each block deploys convolutional kernels of three scales (15, 7, and 3) in parallel (corresponding to time windows of approximately 1.5 seconds, 0.7 seconds, and 0.3 seconds, respectively). The 15-kernel block captures macroscopic, slowly changing trends (such as slow aging and temperature drift); the 7-kernel block captures mesoscopic fluctuations (such as periodic fluctuations and medium-frequency oscillations); and the 3-kernel block is sensitive to microscopic, rapid transients (such as sharp voltage drops). This allows for adaptive and comprehensive learning of fault features at different scales from the data, which are then concatenated and fused along the channel dimension to form rich multi-resolution feature representations. After each branch convolution, batch normalization and Swish activation are performed, multi-resolution features are fused through channel concatenation, followed by max pooling to compress the time dimension and applying Dropout regularization. The smooth and non-monotonic nature of the Swish activation function provides better gradient flow. Then, max pooling is used to reduce sequence length, decrease computation, increase the receptive field of subsequent layers, and make the features more abstract and translation-invariant. Dropout randomly discards a portion of the neuron's output. This forces the network to be independent of any single neuron, thus learning more redundant and robust features, and is a method to prevent overfitting.

[0075] After three convolutional blocks output multiple channel maps in sequence, such as feature maps with 192, 384, and 768 channels, a Transformer module with an 8-head self-attention mechanism is introduced to establish global temporal correlations. The training process is stabilized through layer normalization and residual connections.

[0076] The subsequent feature processing stage combines global average pooling and global max pooling to extract dual statistical features, thereby capturing the overall trend and the most significant trend. After interaction through a 512-dimensional fully connected layer, the data is randomly discarded again using high-intensity Dropout (0.6), resulting in the output of the three-class fully connected layer. The entire network achieves the organic unity of local feature capture and global semantic modeling through a multi-layered defense system consisting of multi-scale convolution-attention collaboration, progressive dimensionality compression (time steps 1800→900→450→1) and channel expansion (6→768), as well as Gaussian noise injection, L1 / L2 weight regularization, and dynamic data augmentation.

[0077] Step S106: Establish an evaluation system between performance evaluation results and feature diagnosis results. Based on the test set, evaluate the diagnostic capability of the Transformer-CNN hybrid neural network model for the electro-hydrogen coupling system. The evaluation system includes accuracy, recall, and confusion matrix dispersion.

[0078] Specifically, the performance data of the Transformer-CNN neural network model in the training results are examined, including but not limited to accuracy, recall, and confusion matrix dispersion. Accuracy refers to the classification accuracy of the data, serving as a macro-level overall performance indicator. Fault recall is the proportion of all real fault data that are successfully predicted as faults by the model. High recall directly implies a low false negative rate, making it one of the most critical indicators in the evaluation system, directly related to the safe operation of the system. Confusion matrix dispersion refers to data obtained through in-depth analysis of the confusion matrix to quantify its clarity. Specifically, this involves drawing an NxN matrix (N being the number of classes), where rows represent true labels and columns represent predicted labels. Values ​​on the diagonal represent correctly classified samples. Ideally, high dispersion means that all off-diagonal elements are close to 0, indicating almost no false positives. Therefore, the core purpose of confusion matrix dispersion is to verify the model's ability to distinguish between complex faults.

[0079] Furthermore, if some metrics in the evaluation results are unsatisfactory, the dispersion of the confusion matrix can pinpoint precisely which specific categories the model is performing poorly. For example, if the recall rate for hydrogen permeation + leakage is low, it is necessary to return to step S102 to supplement data for such combined faults, or return to S104 to adjust the model's sensitivity to such features.

[0080] In this embodiment, the Transformer-CNN network model achieves its advantages through multi-scale feature fusion: breaking through the limitations of traditional single-scale convolution, it simultaneously captures features at different temporal granularities through parallel multi-kernel convolution (15 / 7 / 3), enhancing feature diversity; a hybrid regularization system: combining Gaussian noise injection, L1 / L2 weight regularization, progressive Dropout (0.4→0.6), and dynamic data augmentation to form a multi-layered anti-overfitting defense; attention-convolution collaboration: introducing the global attention mechanism of Transformer on the basis of CNN local feature extraction, solving the problem of insufficient long-range dependency modeling in traditional CNN; dual statistical pooling: employing cosine annealing learning rate scheduling and adaptive learning rate decay, improving convergence stability compared to a fixed learning rate strategy; dual statistical pooling: improving upon traditional single pooling methods by combining average pooling and max pooling to enhance feature representation capabilities. These improvements enable the model to simultaneously possess local feature sensitivity, global contextual understanding, and strong generalization performance in time series classification tasks.

[0081] This invention provides a fault diagnosis method for an electro-hydrogen coupling system based on a Transformer-CNN network. The method collects operational data of the electro-hydrogen coupling system and preprocesses this data, including dynamic parameters under normal and fault conditions. The preprocessing includes filtering and normalization. The preprocessed operational data is divided into training and testing sets. The training set is input into a constructed Transformer-CNN hybrid neural network model for training. The Transformer uses a multi-head self-attention layer to extract long-range temporal dependency features, while the CNN uses 3D convolutional kernels to mine local features. Fault classification is achieved through joint pooling and fully connected layers. An evaluation system is established between performance evaluation results and feature diagnosis results. The diagnostic capability of the Transformer-CNN hybrid neural network model for the electro-hydrogen coupling system is evaluated based on the testing set. The evaluation system includes accuracy, recall, and confusion matrix dispersion. Therefore, this method simultaneously possesses local feature sensitivity, global context understanding, and strong generalization performance in time series classification tasks, covering multi-scale operational data, improving generalization ability under different conditions, and increasing the diagnosis rate of various faults.

[0082] Please see Figure 2 , Figure 2 This is a schematic diagram of the structure of a fault diagnosis system for an electro-hydrogen coupling system based on a Transformer-CNN network, provided in an embodiment of this application. Figure 2 As shown, the system includes:

[0083] The acquisition module 202 is used to acquire the operating data of the electro-hydrogen coupling system and preprocess the operating data. The operating data includes dynamic parameters under normal operation and fault conditions. The preprocessing includes filtering and normalization.

[0084] Training module 204 is used to divide the preprocessed operating data into training set and test set, input the training set into the constructed Transformer-CNN hybrid neural network model for training, in which the multi-head self-attention mechanism layer of the Transformer extracts long-term temporal dependency features, the three-dimensional convolutional kernel of the CNN mines local features, and fault classification is achieved through joint pooling and fully connected layers.

[0085] Evaluation module 206 is used to establish an evaluation system between performance evaluation results and feature diagnosis results. Based on the test set, the evaluation system evaluates the diagnostic capability of the Transformer-CNN hybrid neural network model for the electro-hydrogen coupling system. The evaluation system includes accuracy, recall, and confusion matrix dispersion.

[0086] Those skilled in the art will clearly understand that the technical solutions of the embodiments of this application can be implemented by means of software and / or hardware. In this specification, "unit" and "module" refer to software and / or hardware that can independently complete or cooperate with other components to complete a specific function, wherein the hardware may be, for example, a field-programmable gate array (FPGA), an integrated circuit (IC), etc.

[0087] Each processing unit and / or module in the embodiments of this application can be implemented by an analog circuit that implements the functions described in the embodiments of this application, or by software that executes the functions described in the embodiments of this application.

[0088] See Figure 3 It shows a schematic diagram of the structure of an electronic device according to an embodiment of this application, which can be used to implement... Figure 1 The method in the illustrated embodiment. (As shown) Figure 3 As shown, the electronic device 300 may include: at least one processor 301, at least one network interface 304, user interface 303, memory 305, and at least one communication bus 302.

[0089] The communication bus 302 is used to enable communication between these components.

[0090] The user interface 303 may include a display screen and a camera. Optionally, the user interface 303 may also include a standard wired interface and a wireless interface.

[0091] The network interface 304 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface).

[0092] The processor 301 may include one or more processing cores. The processor 301 connects to various parts within the electronic device 300 using various interfaces and lines, and performs various functions and processes data by running or executing instructions, programs, code sets, or instruction sets stored in the memory 305, and by calling data stored in the memory 305. Optionally, the processor 301 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 301 may integrate one or a combination of several of the following: a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), and a modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the content required for display on the screen; and the modem handles wireless communication. It is understood that the modem may also not be integrated into the processor 301 and may be implemented as a separate chip.

[0093] The memory 305 may include random access memory (RAM) or read-only memory. Optionally, the memory 305 may include a non-transitory computer-readable storage medium. The memory 305 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 305 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as touch function, sound playback function, image playback function, etc.), instructions for implementing the above-described method embodiments, etc.; the data storage area may store data involved in the above-described method embodiments, etc. Optionally, the memory 305 may also be at least one storage device located remotely from the aforementioned processor 301. Figure 3 As shown, the memory 305, which serves as a computer storage medium, may include an operating system, a network communication module, a user interface module, and program instructions.

[0094] exist Figure 3In the illustrated electronic device 300, the user interface 303 is mainly used to provide an input interface for the user and acquire user input data; while the processor 301 can be used to call the image-based interactive application stored in the memory 305 and specifically perform the following operations: collect the operating condition data of the electro-hydrogen coupling system and preprocess the operating condition data, which includes dynamic parameters under normal operation and fault conditions. The preprocessing includes filtering and normalization; divide the preprocessed operating condition data into a training set and a test set, input the training set into the constructed Transformer-CNN hybrid neural network model for training, in which the multi-head self-attention mechanism layer in the Transformer extracts long-range temporal dependency features, the three-dimensional convolutional kernel in the CNN mines local features, and fault classification is achieved through joint pooling and fully connected layers; establish an evaluation system between performance evaluation results and feature diagnosis results, and evaluate the diagnostic capability of the Transformer-CNN hybrid neural network model for the electro-hydrogen coupling system based on the test set. The evaluation system includes accuracy, recall, and confusion matrix dispersion.

[0095] This application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described method. The computer-readable storage medium may include, but is not limited to, any type of disk, including floppy disks, optical disks, DVDs, CD-ROMs, microdrives, as well as magneto-optical disks, ROMs, RAMs, EPROMs, EEPROMs, DRAMs, VRAMs, flash memory devices, magnetic cards or optical cards, nanosystems (including molecular memory ICs), or any type of medium or device suitable for storing instructions and / or data.

[0096] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0097] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0098] In the several embodiments provided in this application, it should be understood that the disclosed apparatus can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some service interface; the indirect coupling or communication connection between devices or units may be electrical or other forms.

[0099] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0100] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0101] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage device (CMD). Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned memory includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0102] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, which may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc.

[0103] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.

Claims

1. A fault diagnosis method for an electro-hydrogen coupling system based on a Transformer-CNN network, the method comprising: The system collects operating data of the electro-hydrogen coupling system and preprocesses the operating data, which includes dynamic parameters under normal and fault conditions. The preprocessing includes filtering and normalization. The preprocessed operating data is divided into a training set and a test set. The training set is input into the constructed Transformer-CNN hybrid neural network model for training. The multi-head self-attention mechanism layer in the Transformer extracts long-term temporal dependency features, the three-dimensional convolutional kernel in the CNN mines local features, and fault classification is achieved through joint pooling and fully connected layers. An evaluation system is established between performance evaluation results and feature diagnosis results. Based on the test set, the diagnostic capability of the Transformer-CNN hybrid neural network model for the electro-hydrogen coupling system is evaluated. The evaluation system includes accuracy, recall, and confusion matrix dispersion.

2. The method according to claim 1, characterized in that, The filtering is achieved by statistically processing a certain number of continuous data points using a sliding window filtering algorithm to smooth the original signal. The algorithm includes: , in, The filtered output at time k. Let N be the original signal at time k, and N be the sliding window size.

3. The method according to claim 1, characterized in that, The normalized calculation formula includes: , Where x is the original data, The minimum value of the data in the original data sequence. The maximum value of the data in the original data sequence. This is the new data after normalization.

4. The method according to claim 1, characterized in that, The convolutional layers of the Transformer-CNN hybrid neural network model include: , in, Let K be the convolution kernel tensor, K be the kernel width, F be the number of filters, D be the dimension of the convolutional layer, f be the nonlinear activation function, b be the bias matrix, and H be the output of the convolutional layer. This is the input for the convolutional layer.

5. The method according to claim 1, characterized in that, The method further includes: During the training of the Transformer-CNN hybrid neural network model, the relationship between different positions in the working condition operation data sequence is captured by scaling dot product attention. The scaling dot product attention includes: generating attention weights by calculating the similarity between the query and the key, performing a weighted summation dot product on the values, and normalizing the variance of the dot product by a scaling factor. The query, key, and value are matrices obtained by linear transformation of the working condition operation data sequence. The formula for calculating the scaled dot product attention includes: , Where Q represents the query, K represents the key, and V represents the value. is the scaling factor, and softmax is the normalized probability distribution.

6. The method according to claim 1, characterized in that, The computation formula in the multi-head self-attention mechanism layer of the Transformer, when processed by 8 heads in parallel, includes: , , , Where W is the weight matrix, Q is the query, K is the key, V is the value, and i is the i-th header. , , Independent linear transformation weight matrix for each head, head i Let be the output matrix of the i-th head, Attention() be the scaling dot product attention function, MultiHead be the final output of multi-head attention, and Concat() be the function to concatenate the outputs of the 8 heads. This is the output weight matrix.

7. The method according to claim 6, characterized in that, The 3D convolutional kernels in the CNN mine local features, including: Receive the raw signal corresponding to the operating condition data and inject random disturbances through a Gaussian noise layer; The original signal is injected into a feature extraction backbone network consisting of three multi-scale convolutional blocks. After each branch is convolved, batch normalization and Swish activation are performed, followed by max pooling to compress the time dimension and applying Dropout regularization. A Transformer module with an 8-head self-attention mechanism is introduced to establish global temporal correlations, and the training process is carried out through layer normalization and residual connections. By combining global average pooling and global max pooling, dual statistical features are extracted. After interaction through a 512-dimensional fully connected layer, the results are output by a three-class fully connected layer with high-intensity Dropout.

8. A fault diagnosis system for an electro-hydrogen coupling system based on a Transformer-CNN network, characterized in that, The system includes; The acquisition module is used to acquire the operating data of the electro-hydrogen coupling system and preprocess the operating data. The operating data includes dynamic parameters under normal operation and fault conditions. The preprocessing includes filtering and normalization. The training module is used to divide the preprocessed operating data into training set and test set. The training set is input into the constructed Transformer-CNN hybrid neural network model for training. The multi-head self-attention mechanism layer in the Transformer extracts long-term temporal dependency features, the three-dimensional convolutional kernel in the CNN mines local features, and fault classification is achieved through joint pooling and fully connected layers. The evaluation module is used to establish an evaluation system between performance evaluation results and feature diagnosis results. Based on the test set, it evaluates the diagnostic capability of the Transformer-CNN hybrid neural network model for the electro-hydrogen coupling system. The evaluation system includes accuracy, recall, and confusion matrix dispersion.

9. An electronic device, comprising a processor and a memory; The processor is connected to the memory; The memory is used to store executable program code; The processor runs a program corresponding to the executable program code stored in the memory to perform the method as described in any one of claims 1-7.

10. A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Multi-element load prediction method and system for electric-thermal-hydrogen multi-energy coupling system

    CN119476545A

  • CNN-LSTM hybrid network-based small pressurized water reactor fault diagnosis method

    CN120296509A