Model training method and device, electronic equipment and storage medium

By using the EMD-CNN-GRU hybrid model, the features of ship mechanical fault signals are adaptively decomposed and extracted in parallel, which solves the problems of insufficient time series modeling capability and reliance on manual design for feature extraction in existing technologies, and realizes efficient processing of nonlinear signals and accurate identification of multiple faults.

CN121997052APending Publication Date: 2026-05-08NAT IND INFORMATION SECURITY DEV RES CENT
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NAT IND INFORMATION SECURITY DEV RES CENT
Filing Date
2026-03-02
Publication Date
2026-05-08

AI Technical Summary

Technical Problem

Existing machine learning-based fault detection methods have limited time-series modeling capabilities in marine machinery fault detection, feature extraction relies on manual design, have poor adaptability, are difficult to handle multiple types of faults, and have insufficient signal processing capabilities.

Method used

Empirical Mode Decomposition (EMD) is used to adaptively decompose the signal. Combined with the parallel structure of Convolutional Neural Network (CNN) and Gated Recurrent Unit Network (GRU), the spatial and temporal features of ship mechanical fault signals are extracted and feature fusion is performed to construct a ship fault detection model. The model performance is improved through iterative optimization training.

Benefits of technology

It significantly improves the ability to process nonlinear and non-stationary signals, enhances the capture of the time dependence of dynamic signals, improves the robustness of the model in noisy environments and the ability to identify multiple faults, and meets the fault diagnosis needs in complex environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121997052A_ABST
    Figure CN121997052A_ABST
Patent Text Reader

Abstract

The invention relates to a model training method and device, electronic equipment and a storage medium, and the method comprises the steps: obtaining a fault signal data set of ship machinery, carrying out the empirical mode decomposition of preprocessed original signal data, and constructing a training sample set; inputting the training sample set into a ship fault detection model to be trained; and based on the parallel feature extraction network architecture in the to-be-trained fault detection model, performing iterative optimization training on the to-be-trained ship fault detection model until the ship fault detection model converges, and obtaining a trained ship fault detection model. The processing capability of nonlinear and non-stationary signals can be improved; limitation of artificial feature design is avoided; enhancing time dependency capture of the dynamic signal; and through a parallel structure and a feature fusion mechanism, the robustness and the multi-fault identification capability of the model in a multi-noise environment are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a model training method, apparatus, electronic device and storage medium. Background Technology

[0002] With the increasing variety and complexity of ship machinery and equipment, fault detection has become crucial for ensuring the safe and efficient operation of ships. Traditional manual inspection and routine maintenance methods are inefficient and prone to errors. In recent years, fault detection methods based on sensor technology and machine learning have gradually become mainstream, but they still face challenges in areas such as signal processing, feature extraction, and time series modeling.

[0003] Existing machine learning-based fault detection methods have limited time-series modeling capabilities, feature extraction still relies on manual design and has poor adaptability, and the simultaneous detection of multiple types of faults is not ideal. Summary of the Invention

[0004] This application provides a model training method, apparatus, electronic device, and storage medium to solve the technical problems of existing fault detection methods that rely on manual labor and have poor signal processing and fault identification capabilities.

[0005] Firstly, this application provides a model training method, the method comprising: Acquire a fault signal dataset of the ship's machinery and preprocess the raw signal data in the fault signal dataset; Empirical mode decomposition is performed on the preprocessed raw signal data to obtain the intrinsic mode function component set corresponding to the raw signal data; A training sample set is constructed based on the intrinsic mode function component group corresponding to each original signal data in the fault signal dataset. The training sample set is input into the ship fault detection model to be trained; wherein, the ship fault detection model extracts spatial and temporal features of the training samples simultaneously through a parallel feature extraction network, and fuses the extracted spatial features with the temporal features to obtain fused features; and the fused features are input into the classification module of the ship fault detection model to obtain classification prediction results; Based on the difference between the classification prediction results and the true fault labels of the corresponding training samples, the ship fault detection model is iteratively optimized and trained until the ship fault detection model converges, thus obtaining a well-trained ship fault detection model.

[0006] In one possible implementation, the preprocessing of the raw signal data in the fault signal dataset includes: The original signal data in the fault signal dataset is subjected to at least one of the following preprocessing operations: resampling and normalization.

[0007] In one possible implementation, the resampling process of the original signal data in the fault signal dataset includes: The original signal data is segmented and sampled using a sliding window with a preset overlap rate to obtain multiple resampled signal segments; A sample data table is constructed based on the multiple resampled signal segments; wherein each row in the sample data table corresponds to one of the resampled signal segments, and each row is accompanied by a corresponding fault label.

[0008] In one possible implementation, the step of performing empirical mode decomposition on the preprocessed original signal data to obtain the intrinsic mode function component set corresponding to the original signal data includes: The original signal data is determined as the current processing signal; Determine the local maxima and local minima of the currently processed signal, and fit the upper and lower envelopes of the currently processed signal based on the local maxima and local minima using an interpolation method; Based on the upper envelope and the lower envelope, the mean envelope value of the current processed signal is determined, and the mean envelope value is subtracted from the original signal data to obtain the remaining signal of the current processed signal; Determine the standard deviation of the remaining signal; If the standard deviation of the remaining signal does not meet the preset threshold condition, the remaining signal is used as the new current processing signal, and the process returns to the above steps of determining the local maxima and local minima of the current processing signal and subsequent steps; if the standard deviation of the remaining signal meets the preset threshold condition, the remaining signal is determined as an intrinsic mode function component. The residual signal is obtained by subtracting the sum of all extracted intrinsic mode function components from the original signal data; If the residual signal is not a monotonic function or the amplitude is less than a set threshold, then the residual signal is used as the new current processing signal, and the above steps of determining the local maxima and local minima of the current processing signal and subsequent steps are returned. If the residual signal is a monotonic function or the amplitude is less than a set threshold, then the empirical mode decomposition of the original signal data is stopped, and all the extracted intrinsic mode function components are used to form the intrinsic mode function component group corresponding to the original signal data.

[0009] In one possible implementation, constructing a training sample set based on the intrinsic mode function component group corresponding to each of the original signal data in the fault signal dataset includes: For each set of intrinsic mode function components corresponding to the original signal data, the following processing is performed: Determine the correlation coefficient between each intrinsic mode function component in the intrinsic mode function component group and the original signal data; Based on the correlation coefficient, effective components of the intrinsic mode functions are selected from the intrinsic mode function component set to form an effective component set; Align the effective component groups from different raw signal data; Based on the aligned effective component groups, a training sample set is constructed.

[0010] In one possible implementation, the alignment process of effective component groups from different original signal data includes: For effective component groups with fewer effective components than the target number, a zero-filling strategy is used to fill in the missing components, so that the number of effective components in each effective component group is consistent. And / or, For effective component groups with more effective components than the target number, a component merging strategy is used for reduction to ensure that the number of effective components in each effective component group is consistent.

[0011] In one possible implementation, the parallel feature extraction network includes parallel convolutional neural network modules and gated recurrent unit network modules; The convolutional neural network module is used to extract the spatial features of the training samples, and the gated recurrent unit network module is used to extract the temporal features of the training samples.

[0012] In one possible implementation, fusing the extracted spatial features with the temporal features to obtain fused features includes: The output of the last time step of the spatial feature is concatenated with the output of the last time step of the temporal feature along the channel dimension to obtain the fused feature.

[0013] Secondly, this application provides a method for detecting ship faults, the method comprising: Acquire real-time operating signal data of the ship machinery to be detected, and preprocess the real-time operating signal data; Empirical mode decomposition is performed on the preprocessed real-time operation signal data to obtain the intrinsic mode function component set corresponding to the real-time operation signal data; Based on the intrinsic mode function component set, the data to be detected is constructed; The data to be detected is input into a trained ship fault detection model; wherein, the ship fault detection model extracts spatial and temporal features of training samples simultaneously through a parallel feature extraction network, and fuses the extracted spatial features with the temporal features to obtain fused features; and the fused features are input into the classification module of the ship fault detection model to obtain classification prediction results; Based on the classification and prediction results, the failure type of the ship machinery is determined.

[0014] Thirdly, this application provides a ship fault detection device, the device comprising: The data preprocessing module is used to acquire real-time operating signal data of the ship machinery to be detected and to preprocess the real-time operating signal data. The intrinsic mode function component group determination module is used to perform empirical mode decomposition on the preprocessed real-time running signal data to obtain the intrinsic mode function component group corresponding to the real-time running signal data. The fault dataset construction module is used to construct the fault dataset to be detected based on the intrinsic mode function component set. The data input module is used to input the data to be detected into a trained ship fault detection model; wherein, the ship fault detection model extracts spatial and temporal features of training samples simultaneously through a parallel feature extraction network, and fuses the extracted spatial features with the temporal features to obtain fused features; and the fused features are input into the classification module of the ship fault detection model to obtain classification prediction results; The fault type determination module is used to determine the fault type of the ship machinery based on the classification prediction results.

[0015] Fourthly, this application provides an electronic device, including a processor and a memory, wherein the processor is configured to execute a ship fault detection program stored in the memory to implement the ship fault detection method described in any one of the second aspects.

[0016] Fourthly, this application provides a storage medium storing one or more programs that can be executed by one or more processors to implement the ship fault detection method described in any one of the second aspects.

[0017] Compared with the prior art, the technical solution provided in this application has the following advantages: The method provided in this application acquires a fault signal dataset of ship machinery, performs empirical mode decomposition on the preprocessed original signal data, and constructs a training sample set; the training sample set is input into the ship fault detection model to be trained; based on the parallel feature extraction network architecture in the fault detection model to be trained, the ship fault detection model to be trained is iteratively optimized and trained until the ship fault detection model converges, resulting in a trained ship fault detection model. This method can improve the processing capability of nonlinear and non-stationary signals; avoid the limitations of manual feature design; enhance the capture of the time dependence of dynamic signals; and improve the robustness and multi-fault identification capability of the model in multi-noise environments through parallel structure and feature fusion mechanism. Attached Figure Description

[0018] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0019] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] One or more embodiments are illustrated by way of example with reference numerals in the accompanying drawings. These illustrations do not constitute a limitation on the embodiments. Elements with the same reference numerals in the drawings are denoted as similar elements. Unless otherwise stated, the figures in the drawings are not to be limited by scale.

[0021] Figure 1 A flowchart illustrating an embodiment of a model training method provided in this application; Figure 2 Flowchart of another model training method embodiment provided by this application; Figure 3 Flowchart of another embodiment of the model training method provided in this application; Figure 4 This application provides a structural block diagram of a ship fault detection device; Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0022] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0023] The following disclosure provides numerous different embodiments or examples for implementing various structures of this application. To simplify the disclosure, specific examples and arrangements are described below. These are merely examples and are not intended to limit the scope of this application. Furthermore, reference numerals and / or letters may be repeated in different examples. Such repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed.

[0024] To address the technical problems of existing fault detection methods that rely on manual labor and have poor signal processing and fault identification capabilities, this application provides a model training method, apparatus, electronic device, and storage medium that can improve the processing capability of nonlinear and non-stationary signals; avoid the limitations of manual feature design; enhance the capture of the time dependence of dynamic signals; and improve the robustness of the model and the ability to identify multiple faults in noisy environments through parallel structures and feature fusion mechanisms.

[0025] Fault detection in marine machinery is crucial for ensuring the safe operation of ships. However, traditional methods rely primarily on manual inspection, periodic maintenance, and experience-based judgment, resulting in low efficiency and susceptibility to misdiagnosis and missed diagnosis. While fault detection methods based on machine learning and deep learning are widely used, they still face the following technical challenges: Specifically, existing fault detection methods suffer from signal nonlinearity and non-stationarity: marine machinery signals are complex and variable, making accurate decomposition and modeling difficult. High-dimensional feature extraction is challenging: traditional methods struggle to automatically extract efficient, high-dimensional fault features. Temporal dependency modeling is insufficient: they cannot fully capture the dynamic temporal dependencies of fault signals. Noise robustness is poor: in complex environments, signals are easily affected by noise, impacting detection accuracy. Multimodal fault identification capability is weak: they struggle to process multiple types of fault signals simultaneously.

[0026] This application proposes a ship fault detection method based on the EMD-CNN-GRU (Empirical Mode Decomposition-Convolutional Neural Network-Gated Recurrent Unit Hybrid Model) model. By combining the adaptive signal processing of empirical mode decomposition, the efficient feature extraction of convolutional neural networks, and the temporal modeling capability of gated recurrent units, this method effectively addresses the shortcomings of existing technologies, significantly improves the accuracy, real-time performance, and robustness of fault detection, and meets the fault diagnosis needs of ship systems in complex environments.

[0027] Furthermore, this application effectively handles nonlinear and non-stationary ship machinery signals through EMD adaptive decomposition, improving decomposition accuracy and reliability while enhancing the model's signal processing capabilities. Combining a CNN and GRU parallel structure, it achieves efficient automatic extraction of spatial and temporal features, avoiding the limitations of manual feature design and automating feature extraction. The GRU layer effectively captures long-term temporal dependencies in the signal, enhancing dynamic modeling capabilities and improving the model's temporal modeling performance. The CNN-GRU parallel structure enables the model to maintain high detection accuracy even in noisy environments, adapting to complex working conditions. Through a feature fusion mechanism, it achieves simultaneous identification and classification of multiple mechanical faults.

[0028] Furthermore, existing ship fault detection methods struggle to acquire large amounts of ship fault data, especially data on severe faults. Fault sample categories are highly imbalanced (many normal data, few fault data), leading to suboptimal model training results. It is difficult to intentionally induce extreme faults in actual ships for testing. Data on rare faults (such as shafting fractures or hydraulic system pipe bursts) is virtually unavailable.

[0029] This application enables precise control of fault parameters (such as fault location, size, and load conditions) through simulation, generating data with a clear correspondence between "fault features and parameters." It supports fault mechanism research and feature interpretability analysis, providing a physically reliable training foundation for the model. Various fault types, severity levels, and combination patterns can be freely set, generating large-scale, multi-class, and balanced fault datasets. It can safely simulate various extreme, complex, and rare faults, building diagnostic capabilities in advance. For example, by simulating ship fault conditions through computer simulation, it can simulate the progressive process of propeller blade cracks from 1mm to 10mm, generating continuously labeled data to support the model in learning fault evolution patterns. In Ansys, it can extract cross-physics field data such as vibration response, heat distribution, and fluid pressure pulsation under the same fault scenario; moreover, the data is naturally time-synchronized and free of hardware noise, providing high-quality input for multimodal fusion diagnosis.

[0030] Specifically, in this embodiment, the ship's operating state is simulated using Ansys simulation software. Various mechanical faults (such as propeller faults, diesel engine faults, etc.) are set up, and a variety of signal datasets such as vibration, temperature, and pressure are collected. The collected signal datasets are subjected to empirical mode decomposition and preprocessing to construct a training sample set. A CNN-GRU parallel feature extraction network is used to train the ship fault detection model to be trained based on the training sample set to obtain a trained fault detection model.

[0031] Figure 1 A flowchart illustrating an embodiment of a model training method provided in this application includes the following steps: Step 101: Obtain the fault signal dataset of the ship's machinery and preprocess the raw signal data in the fault signal dataset.

[0032] Fault signal datasets can contain a collection of physical quantity data under ship machinery fault conditions. The data sources can be collected by sensors or generated through simulation. Core data types include vibration signals, temperature data, and pressure data.

[0033] Preprocessing is the process of transforming raw ship mechanical signals (such as vibration, temperature, and pressure) acquired from sensors into standardized data that is regular, clean, and of uniform scale through techniques such as resampling and normalization. The necessity of preprocessing the collected dataset lies in the fact that raw signals often contain noise, have inconsistent dimensions, and random lengths, making them unsuitable for direct input to deep learning models. Preprocessing unifies sample lengths and enhances the data through sliding window resampling, and eliminates numerical differences between different physical quantities through normalization. This significantly improves the quality of subsequent Empirical Mode Decomposition (EMD) and the effectiveness of CNN-GRU feature extraction, ensuring that the fault detection model can stably, accurately, and efficiently learn fault features from complex signals. This is the foundation for the reliable operation of the entire intelligent diagnostic system.

[0034] In one embodiment, the original signal data in the fault signal dataset undergoes at least one of the following preprocessing operations: resampling and normalization.

[0035] Resampling refers to the process of segmenting the original signal into segments with a fixed signal length and sliding window overlap rate to unify the signal dimensions. Normalization refers to the operation of converting data at different scales (such as temperature in °C or vibration acceleration in m / s²) to the same numerical range to eliminate differences in magnitude.

[0036] Specifically, the original signal data in the fault signal dataset can be resampled and normalized in the following way: The original signal data is segmented using a sliding window with a preset overlap rate to obtain multiple resampled signal segments; a sample data table is constructed based on these resampled signal segments; each row in the sample data table corresponds to a resampled signal segment, and each row is accompanied by a corresponding fault label. Then, all signal data in the sample data table is normalized to unify the values ​​of different physical quantities to the same range (e.g., [0,1] or [-1,1]).

[0037] In addition, the sample data table can be divided into a training set (for model training), a validation set (for iterative optimization), and a test set (for final performance verification) according to a preset ratio (e.g., 7:2:1). This is merely an example, and the embodiments of this application do not limit the division ratio of the sample set.

[0038] A sliding window can refer to a data segmentation method where the window slides along the time axis, capturing a segment of the signal each time. A preset overlap rate refers to the proportion of the window length to the overlap between two adjacent windows, used to increase the number of samples and avoid information loss.

[0039] The sample data table can refer to a structured dataset, where each row represents a sample (resampled signal segment), each column represents a feature point, and a fault label is appended at the end. The fault label can refer to a marker used to identify the fault type corresponding to the sample (such as "propeller fault" or "diesel engine fault"), and corresponds one-to-one with the resampled signal segment.

[0040] For example, suppose vibration signals of a marine diesel engine malfunction are collected, with an original signal length of 5000 points and a temperature signal length of 4800 points (different scales and varying lengths). After resampling with a signal length of 1024 and an overlap rate of 0.5, the vibration signal can be resampled into 5 segments (1-1024, 513-1536, 1025-2048, 1537-2560, 2049-3072) and the temperature signal into 4 segments. Each resampled segment is labeled "Diesel Engine Malfunction". Then, the resampled model data is normalized. The original vibration signal values ​​range from 5 to 20 m / s², and the temperature signal values ​​range from 80 to 120°C. After normalization, both are converted to values ​​within the [0,1] interval, preventing the model from being biased towards the temperature signal due to magnitude differences.

[0041] Step 102: Perform empirical mode decomposition on the preprocessed original signal data to obtain the intrinsic mode function component set corresponding to the original signal data.

[0042] Empirical Mode Decomposition (EMD) can refer to an adaptive time-series signal analysis method that can decompose complex nonlinear and non-stationary signals into several intrinsic mode functions (IMFs) and a residual term without the need for preset basis functions.

[0043] The intrinsic mode function component set (IMF component set) can refer to the set of multiple effective IMF components obtained after EMD decomposition. Each IMF component represents the local features of different frequencies in the original signal, and the residual term represents the trend component of the signal.

[0044] In one embodiment, the preprocessed single original signal (such as a normalized diesel engine vibration signal segment) is analyzed to identify all local maxima and local minima. The upper envelope is obtained by fitting the maxima points using interpolation, and the lower envelope is obtained by fitting the minima. The average value of the upper and lower envelopes (envelope mean) is calculated. The original signal is subtracted from the envelope mean to obtain the remaining signal. The above steps are repeated until the standard deviation (SD) of the remaining signal is below a threshold of 0.2-0.3. At this point, the remaining signal is the first IMF component. The original signal is subtracted from the first IMF component to obtain the residual signal. This residual signal is used as the new original signal, and the above decomposition process is repeated. After n iterations, n IMF components and the final residual term are obtained. Invalid components are filtered out (based on correlation coefficients, components with high correlation to the original signal are retained), and the remaining components form the eigenmode function component set.

[0045] For example, the vibration signal segment (length 1024, after normalization) of the diesel engine fault obtained from the above preprocessing steps is subjected to EMD decomposition. The decomposition yields 8 IMF components and 1 residual term. The first 5 IMF components have higher frequencies (corresponding to high-frequency fluctuations in the vibration signal, possibly including fault impact characteristics), while the last 3 IMF components have lower frequencies (corresponding to stable fluctuations in the signal). The correlation coefficient between each IMF component and the original vibration signal is calculated, and two low-frequency IMF components with correlation coefficients below 0.3 are removed, ultimately resulting in an intrinsic mode function component set composed of 6 effective IMF components. This is merely an example; the specific method for performing empirical mode decomposition on the preprocessed data will be explained in detail in the relevant embodiments below.

[0046] Step 103: Construct a training sample set based on the intrinsic mode function component group corresponding to each original signal data in the fault signal dataset.

[0047] The training sample set can refer to the dataset consisting of the intrinsic mode function components corresponding to each original signal and the corresponding fault label, which is the core input for model training.

[0048] In one embodiment, for each original signal in the fault signal dataset, the effective intrinsic mode function (IMF) component group obtained by EMD decomposition is used as a sample feature. The fault label corresponding to each sample feature is retained (consistent with the fault label annotated in the resampling step above). All fault-labeled sample features are summarized to form a training sample set (including the training and validation sets divided in the above steps), ensuring that the sample feature dimensions are uniform (if the number of IMF components in a partial signal decomposition is insufficient, zero values ​​are used to fill in; if there are too many components, redundant components are merged).

[0049] For example, the fault signal dataset contains 100 raw signals (60 propeller faults and 40 diesel engine faults): each signal, after EMD decomposition, yields 6 effective IMF components (with dimensions uniformly set to [6, 1024]), and each component group corresponds to a label ("0" or "1"). After summarizing, 100 training samples are obtained. Each sample has the structure of [6 IMF components (1024 points each)] + fault label, meaning the shape of the training sample set is [100, 6, 1024] (number of samples × number of components × signal length), and the label set is

[100] (each element is 0 or 1).

[0050] Step 104: Input the training sample set into the ship fault detection model to be trained; wherein, the ship fault detection model extracts the spatial and temporal features of the training samples simultaneously through a parallel feature extraction network, and fuses the extracted spatial and temporal features to obtain fused features; and inputs the fused features into the classification module of the ship fault detection model to obtain the classification prediction results.

[0051] Ship fault detection models can refer to models built on parallel feature extraction networks and classification modules, with the core function of extracting sample features and determining the fault type. The parallel feature extraction network can contain a parallel structure of convolutional neural network (CNN) modules and gated recurrent unit (GRU) network modules, enabling the simultaneous extraction of different types of features.

[0052] Spatial features can refer to the local features of samples extracted by the CNN module (such as the spatial distribution features of signal peaks and waveform shapes). Temporal features can refer to the time-dependent features of samples extracted by the GRU module (such as the trend of signal changes over time and the correlation features between consecutive time points). Fusion features can refer to the comprehensive features resulting from combining spatial and temporal features in a specific way, combining the advantages of both types of features.

[0053] In one embodiment, the parallel feature extraction network includes a parallel convolutional neural network (CNN) module and a gated recurrent unit (GRU) network module. The CNN module extracts spatial features from the training samples, and the GRU module extracts temporal features from the training samples. Specifically, the training sample set is input into the model, with a sample shape of [32, 7, 1024] (32 being the batch size, 7 being the feature dimension, and 1024 being the sequence length). The CNN module performs convolution and pooling operations on the samples to extract spatial features, ultimately outputting a shape of [32, 256] (batch size × spatial feature dimension). The GRU module processes the samples synchronously, capturing temporal dependencies and extracting temporal features, ultimately outputting a shape of [32, 256] (batch size × temporal feature dimension).

[0054] In one embodiment, the extracted spatial features and temporal features are fused to obtain fused features, including: concatenating the output of the last time step of the spatial features with the output of the last time step of the temporal features along the channel dimension to obtain fused features. Specifically, the last time step features [32,256] output by the CNN and the last time step features [32,256] output by the GRU are concatenated along the channel dimension to obtain fused features [32,512] (batch size × fused feature dimension).

[0055] For example, assuming a batch size of 32 is input as training samples (32 samples, each [7, 1024]), the CNN module: the first convolutional layer transforms [32, 7, 1024] into [32, 64, 64]. After three convolutions and pooling, the Conv1d layer outputs spatial features of [32, 256] (capturing features such as signal peak distribution and waveform abrupt changes). The GRU module: three GRU layers process the samples sequentially, gradually transforming [32, 128, 56] into [32, 128, 256], finally outputting temporal features of [32, 256] (capturing the trend of signal changes at 1024 time points, such as the continuous increase in vibration amplitude when a fault occurs). Feature fusion: after concatenation, a fused feature of [32, 512] is obtained, which contains both spatial fault feature point information and temporal feature change patterns. Classification prediction: after processing by a fully connected layer, the fused features output the predicted labels for the 32 samples.

[0056] The core of the parallel CNN and GRU structure in this application embodiment is to simultaneously mine the spatial and temporal features of the fault signal, break through the limitations of a single network in modeling complex fault signals, and allow the model to simultaneously capture the local key features and temporal dependencies of the signal, forming complementary feature representations that are suitable for the nonlinear, non-stationary characteristics of ship fault signals and the combination of spatial abrupt changes (such as fault impact) and temporal evolution (such as fault propagation).

[0057] Specifically, ship fault signals are susceptible to interference from marine environmental noise and equipment operation fluctuations. In the parallel structure, the local feature extraction capability of CNN can filter out local noise, while the temporal modeling capability of GRU can ignore instantaneous interference and focus on long-term trends. The two work together to improve the model's robustness to noise and solve the problem of insufficient anti-interference capability of existing methods. The parallel structure does not require sequential waiting for a single network to process, and can complete the extraction of two types of features simultaneously, shortening the feature processing time and meeting the real-time requirements of ship fault detection. At the same time, the fused features contain both spatial key information and temporal evolution patterns, allowing the classification module to more accurately identify fault types (such as distinguishing between the instantaneous impact features of propeller faults and the continuous abnormal features of diesel engine faults), significantly improving the detection accuracy and outperforming the classification performance of traditional serial networks or single models.

[0058] Furthermore, ship fault data includes multimodal signals such as vibration, temperature, and pressure. The parallel structure can simultaneously process the spatial distribution differences and temporal variation patterns of different modal signals without the need for additional multimodal adaptation modules. This solves the problem of poor adaptability of existing technologies for multimodal data processing and broadens the scope of application for fault detection.

[0059] Step 105: Based on the difference between the classification prediction results and the real fault labels of the corresponding training samples, iteratively optimize and train the ship fault detection model until the ship fault detection model converges, and obtain the trained ship fault detection model.

[0060] The classification prediction result can refer to the predicted fault labels output by the model for the training samples. The true fault labels can refer to the actual fault labels pre-labeled in the training samples.

[0061] Iterative optimization training refers to the process of adjusting model parameters based on the difference between the predicted results and the true labels, gradually improving the prediction accuracy. Model convergence refers to the process when the model's prediction error (loss value) drops below a preset threshold, or when the loss value no longer decreases significantly in consecutive iterations, indicating that the model has reached a stable state.

[0062] In one embodiment, the difference between the classification prediction result and the true fault label is calculated: the cross-entropy loss function is used to calculate the loss value (measure the deviation between the predicted label and the true label). The model parameters are adjusted using the Adam optimizer (learning rate 0.003), and the loss value is fed back to each layer of the model through the backpropagation algorithm to adjust the convolutional kernel weights of the CNN, the gating parameters of the GRU, and the weights of the fully connected layers. Steps 104-105 are repeated, with training on the training set and validation on the validation set in each round, and the change of the loss value is monitored in real time. When the loss value of the validation set decreases by less than 0.001 for 5 consecutive rounds, or the loss value is lower than a preset threshold (e.g., 0.05), the iteration is stopped, and the trained ship fault detection model is obtained.

[0063] For example, the initial model's cross-entropy loss is 0.8 (prediction accuracy is only 60%): In the first iteration, after adjusting the parameters, the loss value drops to 0.65, and the accuracy increases to 70%; in the tenth iteration, the loss value drops to 0.12, and the accuracy increases to 92%; in the twentieth iteration, the loss value drops to 0.04, and the accuracy reaches 98%. In the subsequent three iterations, the loss value stabilizes between 0.03 and 0.04, the model converges, training stops, and the final ship fault detection model is obtained.

[0064] Furthermore, after model training is complete, test set data can be input into the trained ship fault detection model, and any parameters can be adjusted solely to evaluate the model's final performance. By comparing the prediction results on the test set with the true labels, metrics such as accuracy and recall are calculated to verify the model's accuracy and robustness in fault detection on unseen data, confirming whether it meets the fault diagnosis requirements in complex ship environments.

[0065] If the test results show that the trained model does not meet the fault diagnosis requirements in complex ship environments, the model training strategy can be optimized by increasing the number of samples, optimizing the data preprocessing process, verifying the accuracy of fault labels, and adjusting the CNN-GRU parallel architecture, thereby obtaining a model that meets the fault diagnosis requirements in complex ship environments.

[0066] The method provided in this application acquires a dataset of ship machinery fault signals, performs empirical mode decomposition on the preprocessed raw signal data to construct a training sample set, inputs the training sample set into a ship fault detection model to be trained, and iteratively optimizes and trains the model based on the parallel feature extraction network architecture in the fault detection model until it converges, thus obtaining a trained ship fault detection model. This method improves the processing capability for nonlinear and non-stationary signals; avoids the limitations of manual feature design; enhances the capture of the time dependencies of dynamic signals; and improves the robustness and multi-fault identification capability of the model in noisy environments through parallel structure and feature fusion mechanisms.

[0067] Figure 2 A flowchart illustrating another embodiment of the model training method provided in this application is shown. Figure 1 Based on the illustrated process, this section mainly describes how to perform empirical mode decomposition on the preprocessed raw signal data to obtain the intrinsic mode function component set corresponding to the raw signal data, including the following steps: Step 201: Determine the original signal data as the current processing signal.

[0068] The currently processed signal can refer to the target signal used to extract IMF components in the current round of the EMD decomposition process. The aforementioned currently processed signal is initially the preprocessed original signal, and will be iteratively updated to the remaining signal or residual signal in subsequent iterations.

[0069] The raw signal data can refer to the ship fault signals (such as vibration and temperature signal segments) after preprocessing steps (resampling, normalization, and data set partitioning), which is the initial input for EMD decomposition.

[0070] In one embodiment, a single fault signal segment completed in the preprocessing step (such as a normalized diesel engine vibration signal, length 1024, value range [0,1]) is directly set as the current processing signal for the first round of EMD decomposition.

[0071] For example, suppose that after preprocessing, a vibration signal segment of gearbox wear failure is obtained, with a data shape of [1,1024] (1 signal segment × 1024 time points) and a value of [0.2,0.23,0.18,...,0.35]. This signal is directly processed as the current signal.

[0072] Step 202: Determine the local maxima and local minima of the current processed signal, and fit the upper and lower envelopes of the current processed signal using interpolation based on the local maxima and local minima.

[0073] A local maximum refers to a point in the current processed signal where the value is greater than the values ​​of its two adjacent points in the time dimension (such as a "peak point" in a signal). A local minimum refers to a point in the current processed signal where the value is less than the values ​​of its two adjacent points in the time dimension (such as a "valley point" in a signal).

[0074] Interpolation can be a mathematical method that fits a continuous envelope using known local extrema (cubic spline interpolation is commonly used to ensure a smooth envelope that closely matches the distribution of extrema). Upper envelope This can be understood as the curve obtained by interpolation through all local maxima points, representing the upper boundary of the currently processed signal. Lower envelope It can refer to the curve obtained by interpolation through all local minimum points, which is the lower boundary of the currently processed signal.

[0075] In one embodiment, the 1024 time points of the currently processed signal are traversed to identify all local maxima (e.g., values ​​corresponding to time points 10, 25, 42...) and local minima (e.g., values ​​corresponding to time points 18, 33, 50...). A continuous upper envelope (covering the entire 1024 time points) is fitted to the set of local maxima using cubic spline interpolation; similarly, a lower envelope is obtained by interpolating and fitting the set of local minima.

[0076] For example, 12 local maxima were identified, with coordinates (10, 0.58), (25, 0.62), (42, 0.59), ...; and 11 local minima were identified, with coordinates (18, 0.15), (33, 0.12), (50, 0.17), ... After fitting with cubic spline interpolation, the upper envelope showed a smooth upward trend (from 0.58 to 0.62) between time points 10 and 25, and the lower envelope showed a smooth downward trend (from 0.15 to 0.12) between time points 18 and 33. The two envelopes completely covered 1024 time points.

[0077] Step 203: Determine the mean envelope value of the current processed signal based on the upper and lower envelopes, and subtract the mean envelope value from the original signal data to obtain the remaining signal of the current processed signal.

[0078] The mean of the envelope can refer to the upper envelope line. and lower envelope The average value at each point in time reflects the trend baseline of the currently processed signal.

[0079] The remaining signal can refer to the signal obtained by subtracting the envelope mean from the current processed signal. This is equivalent to stripping the trend component from the current signal and retaining the high-frequency fluctuation component.

[0080] In one embodiment, the average value of the upper envelope and the lower envelope is calculated for each time point using the following formula (i); and the remaining signal is obtained by subtracting the average envelope value of the corresponding time point from the value of the current processed signal at each time point using the following formula (ii).

[0081] Formula (1); Where m(t) represents the mean of the envelope, The upper envelope value; This represents the value of the lower envelope.

[0082] Formula (II); Where x(t) is the current signal being processed, and d(t) is the remaining signal.

[0083] For example, at time point 20, the upper envelope value is 0.55, the lower envelope value is 0.14, and the envelope mean m(20) = (0.55 + 0.14) ÷ 2 = 0.345. The value of the currently processed signal at time point 20 is 0.32, and the remaining signal d(20) = 0.32. 0.345= 0.025. After traversing all time points, the remaining signal shape is still [1, 1024], the numerical range becomes [-0.08, 0.09], and the fluctuation amplitude is significantly smaller than the original signal (most of the trend components have been removed).

[0084] Step 204: Determine the standard deviation of the remaining signal; if the standard deviation of the remaining signal does not meet the preset threshold condition, proceed to step 205; if the standard deviation of the remaining signal meets the preset threshold condition, proceed to step 206 below.

[0085] Standard deviation (SD) is an indicator used to measure the dispersion of residual signal values, reflecting the severity of signal fluctuations. A preset threshold condition can be used to determine whether the residual signal is a valid IMF component. For example, a preset threshold of 0.3 can be set; if the standard deviation (SD) of the residual signal is less than or equal to the preset threshold, the condition is met; otherwise, it is not.

[0086] Intrinsic mode function components (IMFs) are the core products of EMD decomposition. They satisfy the characteristics of zero local mean and the number of local maxima and minima being equal or differing by no more than 1, and can reflect local fluctuations at a certain frequency in the original signal.

[0087] In one embodiment, the standard deviation SD value of the remaining signal is calculated by the following formula (iii), and then the SD value is compared with a preset threshold. If the SD value is greater than the preset threshold, step 206 is executed; if the SD value is less than or equal to the preset threshold, step 205 is executed.

[0088] Formula (3) Where T represents the number of sampling points; This is the remaining signal from the previous round; This represents the remaining signals for the current round.

[0089] For example, if the calculated SD value of the remaining signal is 0.32, which is greater than the preset threshold of 0.25, the condition is not met, and step 205 needs to be executed to continue the iterative processing; if after multiple rounds of iteration, the SD value of the remaining signal in a certain round is 0.23, which is less than 0.25, the condition is met, then step 206 is executed.

[0090] Step 205: Use the remaining signal as the new current processing signal and return to execute step 202 above.

[0091] In one embodiment, the remaining signal that does not meet the threshold condition is taken as the new current processing signal, and steps 202-204 are repeated to re-identify local extreme points, fit the envelope, calculate the new remaining signal and SD value, and iterate until the remaining signal meets the threshold condition (i.e., the next IMF component is extracted).

[0092] For example, assuming the remaining signal SD = 0.32 in the above steps (does not meet the threshold), the remaining signal is used as the new current processing signal, and the process returns to step 202; its local maxima (such as time points 15, 30...) and minima (such as time points 22, 38...) are re-identified; new upper and lower envelopes are fitted, and new envelope mean and remaining signal are calculated; the SD value is calculated again, and if it still does not meet the threshold, the iteration continues; if it does meet the threshold, step 206 is executed.

[0093] Step 206: Determine the remaining signal as an intrinsic mode function component; and subtract the sum of all extracted intrinsic mode function components from the original signal data to obtain the residual signal. If the residual signal is not a monotonic function or its amplitude is less than a set threshold, proceed to step 207; if the residual signal is a monotonic function or its amplitude is less than a set threshold, proceed to step 208.

[0094] The residual signal can refer to the signal obtained by subtracting the sum of all extracted IMF components from the original signal, reflecting the trend components (low-frequency or stationary components) in the original signal that were not captured by the IMF components.

[0095] In one embodiment, the residual signal of the currently processed signal determined in the above steps is identified as an intrinsic mode function (IMF) component; then, all the IMF components that have been extracted or determined are counted, and the sum of the IMF components at each time point of the original signal is subtracted from the value at each time point to obtain the residual signal. The residual signal can be calculated using the following formula (iv): Formula (IV); in, Represents the residual signal of the nth round. This represents the k-th IMF component.

[0096] For example, assuming the current remaining signal in the above steps is identified as an IMF component 3, then all the extracted IMF components are counted as IMF1, IMF2, and IMF3; at time point 50, IMF1 is 0.03, IMF2 is 0.02, and IMF3 is 0.01, totaling 0.06; the original signal at time point 50 is 0.42, and the residual signal... =0.42 0.06 = 0.36; the final residual signal shape is [1, 1024], the value range is [0.28, 0.39], and the fluctuation is smooth (only the trend component is retained).

[0097] Step 207: Use the residual signal as the new current processing signal and return to execute step 202 above.

[0098] A monotonic function can refer to a signal whose value increases or decreases monotonically with time, without local maxima or minima (e.g., a residual signal that increases continuously from 0.28 to 0.39 without peaks or valleys).

[0099] Amplitude can refer to the difference between the maximum and minimum values ​​in the residual signal, reflecting the fluctuation range of the trend component.

[0100] Setting a threshold can refer to the amplitude standard for determining whether the residual signal needs to be further decomposed (e.g., set to 0.1, which can be adjusted according to the signal type).

[0101] In one embodiment, it is determined whether the residual signal is a monotonic function: traversing the time points of the residual signal, if there is only an increasing or decreasing trend, without local maxima or minima, then it is a monotonic function; otherwise, it is not. The amplitude of the residual signal is calculated, and it is determined whether it is less than a set threshold. If the residual signal is not a monotonic function or the amplitude is greater than or equal to the set threshold, then the residual signal is used as the new current processing signal, and the process returns to step 202 to continue extracting the next IMF component; if it satisfies the monotonic function condition and the amplitude is less than the set threshold, then step 208 is executed.

[0102] For example, if the residual signal value is [0.28, 0.29, 0.31, ..., 0.39], and there are local fluctuations (e.g., 0.33 at time point 60, 0.32 at time point 61, and 0.34 at time point 62), it is not a monotonic function; the amplitude = 0.39 - 0.28 = 0.11, which is greater than the set threshold of 0.1. Therefore, this residual signal is used as the new current processing signal, and the process returns to step 202 to continue decomposition to extract the next IMF component (IMF4).

[0103] Step 208: Stop the empirical mode decomposition of the original signal data, and form the original signal data into an intrinsic mode function component group corresponding to all the extracted intrinsic mode function components.

[0104] Intrinsic mode function components refer to the set of all effective IMF components obtained from EMD decomposition. They are the core feature inputs for subsequent model training, with each component corresponding to local features of different frequencies of the original signal.

[0105] In one embodiment, if the residual signal satisfies a monotonic function and its amplitude is less than a set threshold, the EMD decomposition process is stopped. All extracted IMF components (such as IMF1, IMF2, IMF3, IMF4...) are collected to form the intrinsic mode function component set corresponding to the original signal.

[0106] For example, suppose the residual signal value is [0.30, 0.31, 0.32, ..., 0.38], which monotonically increases with time (without local maxima or minima), and the amplitude = 0.38 - 0.30 = 0.08, which is less than the set threshold of 0.1, thus satisfying the stopping condition. The four extracted IMF components (IMF1-IMF4) are collected to form the intrinsic mode function component set of the gearbox fault signal, with a shape of [4, 1024] (4 IMF components × 1024 time points). Each component corresponds to the fluctuation characteristics of different frequencies in the original signal (e.g., IMF1 corresponds to the highest frequency, and IMF4 corresponds to the lower frequency).

[0107] pass Figure 2 The description of the embodiments does not require a preset basis function. Through the process of iteratively fitting the envelope and stripping trend components, it can adaptively decompose different frequency fluctuations in ship fault signals (such as vibration and temperature signals). It retains the high-frequency IMF component corresponding to the fault impact and extracts the mid- and low-frequency IMF component corresponding to the fault propagation. It perfectly adapts to the nonlinear and non-stationary characteristics of ship signals and solves the problem that traditional fixed decomposition methods are difficult to adapt to complex signals.

[0108] Furthermore, the standardized iterative process (determining extreme points, fitting the envelope, calculating the residual signal, and determining the threshold) unifies the decomposition logic for different fault signals (such as propeller and diesel engine faults). Simultaneously, the interpolation method used to fit the envelope ensures the smoothness of the decomposition, avoiding discrepancies caused by manual intervention. This ensures consistency in the feature inputs received by the subsequent model, improving the stability of model training. Figure 3 A flowchart illustrating another embodiment of the model training method provided in this application is shown. Figure 1 Based on the illustrated process, this section mainly describes how to construct a training sample set based on the intrinsic mode function component group corresponding to each original signal data in the fault signal dataset, including the following steps: Step 301: Perform the following processing on each set of intrinsic mode function components corresponding to each original signal data: Iterate through all the component groups corresponding to the original signals in the fault signal dataset, and perform the processing steps 302-304 one by one for each component group (e.g., process the component group of the propeller fault signal first, and then process the component group of the diesel engine fault signal), to ensure that each component group is filtered and aligned.

[0109] Assume the fault signal dataset contains component groups corresponding to three original signals: component group A (propeller fault): containing IMF1-IMF4 (4 components); component group B (diesel engine fault): containing IMF1-IMF5 (5 components); component group C (gearbox fault): containing IMF1-IMF3 (3 components); perform subsequent processing on the three component groups A, B, and C in sequence.

[0110] Step 302: Determine the correlation coefficient between each intrinsic mode function component in the intrinsic mode function component group and the original signal data.

[0111] The correlation coefficient (ρ) is used to measure the degree of linear correlation between a single IMF component and the original signal. The value ranges from -1 to 1. The closer the absolute value is to 1, the more effective information the IMF component contains from the original signal; the closer it is to 0, the more likely the component is to be noise or invalid.

[0112] In one embodiment, for each IMF component in a single component group, its correlation coefficient with the corresponding original signal is calculated by substituting it into the following formula (v). The correlation coefficient value of each component is recorded as the basis for subsequent screening of effective components.

[0113] Formula (5) Where x(t) is the original signal; is the k-th IMF component; T is the number of signal sampling points.

[0114] For example, taking component group A (propeller failure, the original signal is a vibration signal) as an example: the correlation coefficients between IMF1 and the original signal are calculated as ρ1=0.85, ρ2=0.72 for IMF2, ρ3=0.21 for IMF3, and ρ4=0.18 for IMF4; the results show that IMF1 and IMF2 are strongly correlated with the original signal, while IMF3 and IMF4 are weakly correlated (possibly noise components).

[0115] Step 303: Based on the correlation coefficient, select the effective components of the intrinsic mode functions from the intrinsic mode function component set to form an effective component set.

[0116] The effective components of intrinsic mode functions (IMFs) refer to the IMF components whose correlation coefficients meet preset screening conditions (such as absolute value ≥ 0.3), and are key components that can reflect the core characteristics of the fault.

[0117] The effective component group can refer to the set of all effective components retained after screening, after eliminating noise or invalid components with low correlation coefficients.

[0118] In one embodiment, a correlation coefficient screening threshold is set (e.g., ≥0.3, which can be adjusted according to the signal type); the correlation coefficient of each IMF component is compared with the threshold, the components with a coefficient ≥ the threshold are retained, and the components with a coefficient < the threshold are removed; the remaining components form the effective component group corresponding to the original signal.

[0119] For example, assuming the screening threshold is set to 0.3, for two groups A: IMF1 (ρ1=0.85) and IMF2 (ρ2=0.72) ≥ 0.3, are retained; IMF3 (ρ3=0.21) and IMF4 (ρ4=0.18) < 0.3, are removed; then the effective component group A is {IMF1, IMF2} (2 components); similarly, after screening component group B (ρ1=0.88, ρ2=0.75, ρ3=0.63, ρ4=0.25, ρ5=0.19), IMF1-IMF3 are retained, and the effective component group is {IMF1, IMF2, IMF3} (3 components); component group C (ρ1=0.79, ρ2=0.68, ρ3=0.32) are all ≥ 0.3, and the effective component group is {IMF1, IMF2, IMF3} (3 components).

[0120] The above method filters effective IMF components by calculating correlation coefficients (removing noise components with low correlation to the original signal), allowing training samples to retain only core features directly related to the fault, avoiding irrelevant information from occupying model training resources, reducing noise interference with classification results, and solving the problem of invalid components that may remain in the original EMD decomposition.

[0121] Step 304: Align the effective component groups from different original signal data.

[0122] Step 305: Construct a training sample set based on the effective component groups after alignment processing.

[0123] The following is a unified explanation of steps 304-305 above: Alignment processing can refer to the processing operation that uses padding or merging strategies to ensure that all effective component groups of the original signal contain the same number of components, thereby ensuring that the input dimensions of the subsequent model are consistent.

[0124] The target number can refer to the preset number of effective components (e.g., 3, set according to data distribution and model requirements).

[0125] The zero-value filling strategy refers to supplementing valid component groups with fewer components than the target number with zero-value components (IMF component shape data with all values ​​of 0) to fill up to the target number.

[0126] The component merging strategy can refer to merging multiple components with the lowest correlation into one component (e.g., taking the average value) for effective component groups with more components than the target number, and reducing it to the target number.

[0127] The training sample set can refer to a dataset consisting of all aligned valid component groups and their corresponding fault labels. It is the direct input for training the CNN-GRU model, combining uniformity and effectiveness.

[0128] In one embodiment, aligning effective component groups from different original signal data includes: for effective component groups with fewer than a target number of effective components, using a zero-filling strategy to fill in the gaps so that the number of effective components in each effective component group is consistent; and / or for effective component groups with more than a target number of effective components, using a component merging strategy to reduce the number of effective components in each effective component group to consistent.

[0129] Furthermore, add a corresponding fault label to each aligned effective component group (consistent with the label marked in step 101, such as "propeller fault" marked as 0 and "diesel engine fault" marked as 1); summarize all labeled aligned effective component groups to form a training sample set (including training set, validation set and test set, with the ratio still 7:2:1); finally, the shape of the training sample set is uniform (such as number of samples × number of target components × signal length, for example [100,3,1024]).

[0130] For example, assuming the target number is set to 3, process the 3 effective component groups obtained from the above steps respectively: Component group A (2 effective components: IMF1, IMF2): number of components < 3, add 1 zero-value component (denoted as IMF0), after alignment it is {IMF1, IMF2, IMF0} (3 components); Component group B (3 effective components: IMF1, IMF2, IMF3): number of components = 3, no processing is needed, after alignment it is still {IMF1, IMF2, IMF3} (3 components). Components); Component group C (3 effective components: IMF1, IMF2, IMF3): Number of components = 3, no processing required, after alignment still {IMF1, IMF2, IMF3} (3 components); if a component group has 4 effective components (IMF1-IMF4, with correlation coefficients of 0.8, 0.7, 0.6, and 0.5 respectively), then merge the IMF4 and IMF3 with the lowest correlation (take the average of the two), retain IMF1, IMF2, and the merged component, and align to 3 components. Add corresponding fault labels to the 3 effective component groups that have not been aligned, and determine the dataset composed of the above 3 effective component groups as the final training sample set.

[0131] The above steps align the number of all effective component groups through zero-value padding and component merging strategies, ensuring that the feature dimensions of each training sample are completely consistent (e.g., unified as 3 effective components × 1024 time points), perfectly adapting to the fixed input dimension requirement of the CNN-GRU model, avoiding model training errors or feature weight imbalances caused by inconsistent dimensions, and improving training stability.

[0132] pass Figure 3 The description of the illustrated embodiment, through a screening process for effective components, ensures that the screened effective component groups focus on key fault features (such as IMF components with high correlation coefficients corresponding to fault impact and trend changes). Compared to the original data containing redundant components, the feature representation is more accurate and the information density is higher, allowing the model to quickly learn the correspondence between fault features and labels, shortening the training cycle and improving classification accuracy. Furthermore, the standardized screening and alignment process unifies the sample feature structure of different fault types and different original signals, avoiding model overfitting due to individual data differences (such as only adapting to the specific component structure of a certain type of fault). Simultaneously, it makes the feature distribution of the training set, validation set, and test set more uniform, improving the model's generalization ability on unseen data and ensuring the reliability of fault diagnosis results.

[0133] Furthermore, this application also provides an embodiment of a ship fault detection method, comprising: acquiring real-time operating signal data of the ship's machinery to be detected, and preprocessing the real-time operating signal data; performing empirical mode decomposition on the preprocessed real-time operating signal data to obtain the intrinsic mode function component set corresponding to the real-time operating signal data; constructing the data to be detected based on the intrinsic mode function component set; and inputting the data to be detected into a trained ship fault detection model.

[0134] The ship fault detection model uses a parallel feature extraction network to simultaneously extract spatial and temporal features from training samples, and then fuses the extracted spatial and temporal features to obtain fused features. The fused features are then input into the classification module of the ship fault detection model to obtain classification prediction results.

[0135] Finally, based on the classification prediction results output by the fault detection model, the fault type of the ship machinery is determined.

[0136] For example, during ship navigation, temperature, vibration, and pressure sensors on the diesel engine are used to collect 5 minutes of real-time operating signal data (sampling frequency 100Hz, totaling 30,000 data points). The data includes diesel engine cylinder block vibration signal (unit: m / s²), lubricating oil temperature signal (unit: ℃), and cylinder pressure signal (unit: MPa). The acquired real-time operating signal data is then preprocessed, and finally 160 valid signal segments (containing three types of signals) are retained.

[0137] Then, EMD decomposition was performed on each of the 160 preprocessed valid signal segments to obtain IMFs in two groups. Specifically, one vibration signal segment (normalized value [0.23, 0.25, ..., 0.31]) was taken as the current processed signal, local maxima / minimum values ​​were identified, and upper and lower envelopes were fitted using cubic spline interpolation; the envelope mean was calculated and trend components were removed, and the standard deviation of the remaining signal was iteratively calculated until SD=0.22 (satisfying the threshold of 0.2-0.3), at which point the first IMF component was extracted; the decomposition process was repeated, and finally 6 IMF components and 1 residual signal were obtained (the residual signal was monotonic and the amplitude = 0.07 < the set threshold of 0.1, at which point the decomposition stopped); all temperature and pressure signal segments were decomposed according to the same logic, and each signal segment obtained a component group consisting of 4-6 IMF components.

[0138] Then, the data to be detected is constructed based on the IMF component groups. The correlation coefficient between each IMF component and the corresponding real-time signal is calculated, and a threshold of 0.3 is set to filter out the effective components (e.g., among the 6 IMF components of the vibration signal segment, 3 effective components with correlation coefficients of 0.82, 0.75, and 0.63 are retained); alignment is performed according to the target number of 3 (the effective component groups of all signal segments are unified to 3 components, and zero values ​​are filled if there are insufficient ones); all aligned effective component groups are summarized to construct the data to be detected, with the shape [160, 3, 1024] (160 samples to be detected × 3 effective components × 1024 time points).

[0139] The data to be detected [160,3,1024] was input into the trained CNN-GRU parallel model. The model output predicted labels for 160 samples, of which 12 samples were judged as "diesel engine lubricating oil leakage fault" (label 1), and the remaining 148 samples were "normal operation" (label 0). The predicted probability of the fault samples was higher than 0.85 (confidence level met).

[0140] Finally, based on the classification and prediction results output by the model, it was determined that the ship's diesel engine had a "lubricating oil leakage fault", and the signal acquisition time period corresponding to 12 fault samples was located (concentrated in the 3rd-4th minute), providing the crew with specific fault troubleshooting time range and fault type guidance.

[0141] The ship fault detection method described in the above embodiments adopts standardized and lightweight processing (such as resampling to unify signal length and parallel feature extraction) throughout the entire process from real-time signal acquisition to preprocessing, EMD decomposition, and model inference. It requires no complex manual intervention, can quickly respond to dynamic operational data during ship navigation, has strong real-time performance, adapts to dynamic ship operation scenarios, and meets the core requirements of "real-time monitoring and timely early warning" for ships, preventing fault escalation. Furthermore, based on the model output, a clear fault type (such as lubricating oil leakage) and corresponding signal acquisition time period are provided, making it highly practical and enabling rapid fault diagnosis. It provides precise troubleshooting guidance for crew members, eliminating blind repairs, shortening fault location and handling time, reducing ship downtime losses, and reducing reliance on crew members' professional experience, thereby improving ship operation and maintenance efficiency and safety.

[0142] Figure 4 This application provides a structural block diagram of a ship fault detection device, the device comprising: The data preprocessing module 41 is used to acquire real-time operating signal data of the ship machinery to be detected and to preprocess the real-time operating signal data. The intrinsic mode function component group determination module 42 is used to perform empirical mode decomposition on the preprocessed real-time running signal data to obtain the intrinsic mode function component group corresponding to the real-time running signal data. The fault dataset construction module 43 is used to construct the fault dataset to be detected based on the intrinsic mode function component set; The data input module 44 is used to input the data to be detected into the trained ship fault detection model; wherein, the ship fault detection model extracts the spatial and temporal features of the training samples simultaneously through a parallel feature extraction network, and fuses the extracted spatial features with the temporal features to obtain fused features; and, the fused features are input into the classification module of the ship fault detection model to obtain classification prediction results; The fault type determination module 45 is used to determine the fault type of the ship machinery based on the classification prediction results.

[0143] like Figure 5 As shown in the figure, this application provides an electronic device, including a processor 111, a communication interface 112, a memory 113, and a communication bus 114, wherein the processor 111, the communication interface 112, and the memory 113 communicate with each other through the communication bus 114. Memory 113 is used to store computer programs; In one embodiment of this application, when the processor 111 executes the program stored in the memory 113, it implements the model training method provided in any of the foregoing method embodiments, including: Acquire a fault signal dataset of the ship's machinery and preprocess the raw signal data in the fault signal dataset; Empirical mode decomposition is performed on the preprocessed raw signal data to obtain the intrinsic mode function component set corresponding to the raw signal data; A training sample set is constructed based on the intrinsic mode function component group corresponding to each original signal data in the fault signal dataset. The training sample set is input into the ship fault detection model to be trained; wherein, the ship fault detection model extracts spatial and temporal features of the training samples simultaneously through a parallel feature extraction network, and fuses the extracted spatial features with the temporal features to obtain fused features; and the fused features are input into the classification module of the ship fault detection model to obtain classification prediction results; Based on the difference between the classification prediction results and the true fault labels of the corresponding training samples, the ship fault detection model is iteratively optimized and trained until the ship fault detection model converges, thus obtaining a well-trained ship fault detection model.

[0144] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the model training method provided in any of the foregoing method embodiments.

[0145] The device embodiments described above are merely illustrative. 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 modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0146] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented using software plus a general-purpose hardware platform, or of course, using hardware. Based on this understanding, the above technical solutions, in essence or the parts that contribute to the related technology, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0147] It should be understood that the terminology used herein is for the purpose of describing particular exemplary embodiments only and is not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms “a,” “an,” and “described” as used herein may also mean including the plural forms. The terms “comprising,” “including,” “containing,” and “having” are inclusive and therefore indicate the presence of the stated features, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, elements, components, and / or combinations thereof. The method steps, processes, and operations described herein are not construed as requiring them to be performed in a particular order described or illustrated unless the order of performance is explicitly indicated. It should also be understood that additional or alternative steps may be used.

[0148] The above description is merely a specific embodiment of this application, enabling those skilled in the art to understand or implement this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A model training method, characterized in that, The method includes: Acquire a fault signal dataset of the ship's machinery and preprocess the raw signal data in the fault signal dataset; Empirical mode decomposition is performed on the preprocessed raw signal data to obtain the intrinsic mode function component set corresponding to the raw signal data; A training sample set is constructed based on the intrinsic mode function component group corresponding to each original signal data in the fault signal dataset. The training sample set is input into the ship fault detection model to be trained; wherein, the ship fault detection model extracts spatial and temporal features of the training samples simultaneously through a parallel feature extraction network, and fuses the extracted spatial features with the temporal features to obtain fused features; and the fused features are input into the classification module of the ship fault detection model to obtain classification prediction results; Based on the difference between the classification prediction results and the true fault labels of the corresponding training samples, the ship fault detection model is iteratively optimized and trained until the ship fault detection model converges, thus obtaining a well-trained ship fault detection model.

2. The method according to claim 1, characterized in that, The preprocessing of the raw signal data in the fault signal dataset includes: The original signal data in the fault signal dataset is subjected to at least one of the following preprocessing operations: resampling and normalization.

3. The method according to claim 2, characterized in that, The resampling process for the original signal data in the fault signal dataset includes: The original signal data is segmented and sampled using a sliding window with a preset overlap rate to obtain multiple resampled signal segments; A sample data table is constructed based on the multiple resampled signal segments; wherein each row in the sample data table corresponds to one of the resampled signal segments, and each row is accompanied by a corresponding fault label.

4. The method according to claim 1, characterized in that, The step of performing empirical mode decomposition on the preprocessed original signal data to obtain the intrinsic mode function component set corresponding to the original signal data includes: The original signal data is determined as the current processing signal; Determine the local maxima and local minima of the currently processed signal, and fit the upper and lower envelopes of the currently processed signal based on the local maxima and local minima using an interpolation method; Based on the upper envelope and the lower envelope, the mean envelope value of the current processed signal is determined, and the mean envelope value is subtracted from the original signal data to obtain the remaining signal of the current processed signal; Determine the standard deviation of the remaining signal; If the standard deviation of the remaining signal does not meet the preset threshold condition, the remaining signal is used as the new current processing signal, and the process returns to the above steps of determining the local maxima and local minima of the current processing signal and subsequent steps; if the standard deviation of the remaining signal meets the preset threshold condition, the remaining signal is determined as an intrinsic mode function component. The residual signal is obtained by subtracting the sum of all extracted intrinsic mode function components from the original signal data; If the residual signal is not a monotonic function or the amplitude is less than a set threshold, then the residual signal is used as the new current processing signal, and the above steps of determining the local maxima and local minima of the current processing signal and subsequent steps are returned. If the residual signal is a monotonic function or the amplitude is less than a set threshold, then the empirical mode decomposition of the original signal data is stopped, and all the extracted intrinsic mode function components are used to form the intrinsic mode function component group corresponding to the original signal data.

5. The method according to claim 1, characterized in that, The step of constructing a training sample set based on the intrinsic mode function component group corresponding to each original signal data in the fault signal dataset includes: For each set of intrinsic mode function components corresponding to the original signal data, the following processing is performed: Determine the correlation coefficient between each intrinsic mode function component in the intrinsic mode function component group and the original signal data; Based on the correlation coefficient, effective components of the intrinsic mode functions are selected from the intrinsic mode function component set to form an effective component set; Align the effective component groups from different raw signal data; Based on the aligned effective component groups, a training sample set is constructed.

6. The method according to claim 5, characterized in that, The process of aligning the effective component groups from different original signal data includes: For effective component groups with fewer effective components than the target number, a zero-filling strategy is used to fill in the missing components, so that the number of effective components in each effective component group is consistent. And / or, For effective component groups with more effective components than the target number, a component merging strategy is used for reduction to ensure that the number of effective components in each effective component group is consistent.

7. The method according to claim 1, characterized in that, The parallel feature extraction network includes a parallel convolutional neural network module and a gated recurrent unit network module; The convolutional neural network module is used to extract the spatial features of the training samples, and the gated recurrent unit network module is used to extract the temporal features of the training samples.

8. The method according to claim 1, characterized in that, The step of fusing the extracted spatial features with the temporal features to obtain fused features includes: The output of the last time step of the spatial feature is concatenated with the output of the last time step of the temporal feature along the channel dimension to obtain the fused feature.

9. A method for detecting ship faults, characterized in that, The method includes: Acquire real-time operating signal data of the ship machinery to be detected, and preprocess the real-time operating signal data; Empirical mode decomposition is performed on the preprocessed real-time operation signal data to obtain the intrinsic mode function component set corresponding to the real-time operation signal data; Based on the intrinsic mode function component set, the data to be detected is constructed; The data to be detected is input into a trained ship fault detection model; wherein, the ship fault detection model extracts spatial and temporal features of training samples simultaneously through a parallel feature extraction network, and fuses the extracted spatial features with the temporal features to obtain fused features; and the fused features are input into the classification module of the ship fault detection model to obtain classification prediction results; Based on the classification and prediction results, the failure type of the ship machinery is determined.

10. A ship fault detection device, characterized in that, The device includes: The data preprocessing module is used to acquire real-time operating signal data of the ship machinery to be detected and to preprocess the real-time operating signal data. The intrinsic mode function component group determination module is used to perform empirical mode decomposition on the preprocessed real-time running signal data to obtain the intrinsic mode function component group corresponding to the real-time running signal data. The fault dataset construction module is used to construct the fault dataset to be detected based on the intrinsic mode function component set. The data input module is used to input the data to be detected into a trained ship fault detection model; wherein, the ship fault detection model extracts spatial and temporal features of training samples simultaneously through a parallel feature extraction network, and fuses the extracted spatial features with the temporal features to obtain fused features; and the fused features are input into the classification module of the ship fault detection model to obtain classification prediction results; The fault type determination module is used to determine the fault type of the ship machinery based on the classification prediction results.

11. An electronic device, characterized in that, include: A processor and a memory, the processor being configured to execute a ship fault detection control program stored in the memory to implement the ship fault detection method of claim 9.

12. A storage medium, characterized in that, The storage medium stores one or more programs, which can be executed by one or more processors to implement the ship fault detection method as described in claim 9.