Spark plug life detection method and system based on deep learning

The spark plug life detection method constructed through deep learning technology uses a dual-path spatial attention deep convolutional neural network and a transfer learning model to solve the problem of poor adaptability of single parameters and working conditions in spark plug life detection, and achieves high-precision spark plug status assessment and life prediction.

CN120632383APending Publication Date: 2025-09-12DONGGUAN CAMDA GENERATOR WORK
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202511149833.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-18
Publication Date
2025-09-12

AI Technical Summary

Technical Problem

Existing spark plug life detection methods have problems such as single parameter detection, poor adaptability to working conditions, and lack of adaptive learning capabilities, making it difficult to accurately evaluate the spark plug status and predict its life.

Method used

A deep learning-based spark plug life detection method is adopted. By acquiring the spark plug current waveform signal, voltage characteristics and engine operating condition data, a dual-path spatial attention deep convolutional neural network model is constructed. Combined with the transfer learning model for optimization, the model generates spark plug health status assessment and life prediction results.

Benefits of technology

It achieves comprehensive perception and accurate assessment of the spark plug status, improves the accuracy of spark plug life prediction to 95.9%, and has adaptive learning capabilities to adapt to different working conditions and environmental changes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120632383A_ABST
    Figure CN120632383A_ABST
Patent Text Reader

Abstract

The invention relates to the field of engine maintenance, in particular to a spark plug service life detection method and system based on deep learning, and the method comprises the steps: obtaining a spark plug current waveform signal, a voltage characteristic and engine working condition data, and carrying out the preprocessing of the data, and forming the preprocessing data; constructing a dual-path space attention deep convolutional neural network model, wherein the model comprises a convolution module, an attention module, a pooling module and an output module; and inputting the preprocessed data into the model to obtain a preliminary evaluation result of the health state of the spark plug. Optimizing the preliminary evaluation result by using a transfer learning model to obtain a more accurate spark plug health state evaluation result; generating a spark plug life prediction result based on the evaluation result; through a multi-dimensional sensing signal acquisition and processing mechanism, comprehensive perception of the working state of the spark plug is realized, the problem of insufficient information dimension in a traditional method is solved, and rich and comprehensive input characteristics are provided for a deep learning model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of engine maintenance, and in particular to a spark plug life detection method and system based on deep learning. Background Art

[0002] Spark plugs are critical components of the engine ignition system, and their operating condition directly impacts engine performance, fuel economy, and emissions. Over time, spark plugs experience gradual wear, gap expansion, and reduced insulation performance, ultimately leading to reduced ignition efficiency or even failure. Traditional spark plug life testing relies primarily on periodic maintenance or manual inspections, lacking real-time monitoring and accurate assessment of the spark plug's actual condition.

[0003] Currently, several spark plug condition monitoring methods exist, such as those based on voltage waveform analysis and ignition energy variation. However, these methods suffer from the following common issues: First, most focus solely on a single parameter, igniting the multidimensional nature of the spark plug's operating state. Second, traditional methods struggle to adapt to variations in spark plug performance under varying operating conditions, resulting in insufficient detection accuracy under complex conditions. Finally, existing methods typically employ fixed thresholds, lacking adaptive learning capabilities and unable to dynamically adjust to changing operating environments and conditions.

[0004] The development of deep learning technology has yielded remarkable results in fields such as image recognition and natural language processing. Applying deep learning to spark plug life detection promises to overcome the challenges faced by traditional methods, enabling accurate spark plug condition assessment and life prediction. Therefore, developing deep learning-based spark plug life detection methods and systems has significant theoretical and practical value. Summary of the Invention

[0005] The present invention aims to solve the problems existing in existing spark plug life detection methods, such as single parameter detection, poor adaptability to working conditions, and lack of adaptive learning capabilities. It provides a spark plug life detection method and system based on deep learning to achieve comprehensive perception, accurate evaluation and life prediction of the spark plug status.

[0006] The present invention proposes a spark plug life detection method based on deep learning, comprising:

[0007] Obtain spark plug current waveform signal, voltage characteristics and engine operating condition data;

[0008] Preprocessing the acquired spark plug current waveform signal, voltage characteristics, and engine operating condition data to form preprocessed data;

[0009] Constructing a dual-path spatial attention deep convolutional neural network model, wherein the dual-path spatial attention deep convolutional neural network model includes a convolution module, an attention module, a pooling module and an output module;

[0010] Inputting the preprocessed data into the dual-path spatial attention deep convolutional neural network model to obtain a preliminary assessment result of the spark plug health status;

[0011] Optimizing the preliminary spark plug health status assessment result using a transfer learning model to obtain a spark plug health status assessment result;

[0012] Based on the spark plug health status assessment result, a spark plug life prediction result is generated.

[0013] Preferably, obtaining spark plug current waveform signal, voltage characteristics and engine operating condition data includes:

[0014] The spark plug current waveform signal is obtained through the current sensor with a sampling frequency of 5Hz;

[0015] The spark plug voltage characteristics are obtained through a voltage sensor with a sampling frequency of 5Hz;

[0016] The engine speed, engine torque, and combustion stability state are obtained as engine operating condition data through the engine control unit.

[0017] Preferably, the preprocessing of the acquired spark plug current waveform signal, voltage characteristics and engine operating condition data includes:

[0018] Filtering the spark plug current waveform signal and converting it into a pulse number time waveform curve;

[0019] extracting a voltage average value and a voltage peak time series from the voltage characteristics;

[0020] quantizing the engine operating condition data to form an operating condition feature vector;

[0021] The pulse number time waveform curve, the voltage average value and voltage peak time series, and the operating condition feature vector are fused to form a spark plug prediction data set, where the training set accounts for 85% of the total data and the test set accounts for 15% of the total data.

[0022] Preferably, the construction of the dual-path spatial attention deep convolutional neural network model includes:

[0023] Construct a convolution module, which extracts features from input data through a convolution layer, where the convolution layer contains 48 3×3 convolution kernels and the activation function is the ReLU function;

[0024] Constructing an attention module, the attention module includes a first path and a second path, the first path is composed of a global average pooling layer and a fully connected layer, and the second path is composed of a spatial embedding layer and a fully connected layer, and the output results of the first path and the second path are fused by the fusion layer as the output result of the attention module;

[0025] Constructing a pooling module, wherein the pooling module adopts one-dimensional convolution and maximum pooling operations;

[0026] An output module was constructed, which included two convolutional layers, each followed by a linear layer, and contained 300 neurons.

[0027] Preferably, the optimizing the preliminary spark plug health status evaluation result by using the transfer learning model includes:

[0028] The training parameters of the first transfer learning model are passed to the second model for pre-training, and the pre-training parameters are no longer updated;

[0029] Use the data of the second model for training. After the training is completed, add the pre-trained parameters to the updated parameters and perform comprehensive training again.

[0030] Repeatedly applying the pre-training method to the remaining multiple data sets;

[0031] The pre-trained parameters are used as part of the random initialization parameters and the training weights are added so that the random initialization parameters during the final deep convolutional neural network model training are not completely randomized.

[0032] Preferably, the training parameters of the transfer learning model are set as follows: batch size is 32, training cycle is 100, optimizer is Adam and weight decay is not calculated.

[0033] Preferably, generating a spark plug life prediction result based on the spark plug health status assessment result includes:

[0034] The collected input data is fed into a trained deep convolutional neural network model, which uses transfer learning and self-attention mechanisms to identify key operating condition features, extract and fuse features, and thus perform life estimation.

[0035] The accuracy of the prediction is evaluated through the life prediction module, and the prediction accuracy of the model is evaluated through the historical mean absolute percentage error (MAPE), precision1, and precision2.

[0036] The trained deep convolutional neural network model is applied to the training set calculation and verified by the test set. When the model prediction accuracy meets the requirements, the training is terminated, otherwise the training step is re-entered.

[0037] Preferably, the prediction accuracy of the model evaluated by historical mean absolute percentage error (MAPE), accuracy rate (Precision1), and accuracy rate (Precision2) includes:

[0038] Calculate the historical mean absolute percentage error MAPE1 and MAPE2, where MAPE1 represents the error of transfer learning and MAPE2 represents the error of training using only the self-attention mechanism;

[0039] Calculate the accuracy Precision1 and Precision2, where Precision1 represents the accuracy of samples trained using transfer learning, and Precision2 represents the accuracy of samples trained using only the self-attention mechanism;

[0040] Compare MAPE1 and MAPE2 as well as Precision1 and Precision2 to evaluate the relative contributions of transfer learning and self-attention mechanism.

[0041] Preferably, it also includes constructing a self-supervised comparative learning module, which sets a self-comparative memory bank for updating associated features according to the spark plug signal and outputting the final health status assessment result; wherein the capacity of the self-comparative memory bank is set to 15-25, corresponding to the spark plug signals collected at different times.

[0042] The spark plug life detection system based on deep learning is characterized by including:

[0043] Sensor acquisition unit, including current sensor, voltage sensor, speed sensor, torque sensor, and temperature sensor, used to collect spark plug signals and engine operating condition data;

[0044] A signal preprocessing module is used to perform filtering, normalization and differential processing on the collected spark plug signals and engine operating condition data to form preprocessed data;

[0045] A deep learning inference engine, comprising a convolution module, an attention module, a pooling module, and an output module. The attention module comprises a first path and a second path. The first path comprises a global average pooling layer and a fully connected layer, and the second path comprises a spatial embedding layer and a fully connected layer. The first path is used to process the preprocessed data to obtain a preliminary assessment result of the spark plug health status.

[0046] A transfer learning module is used to optimize the preliminary spark plug health status assessment result to obtain a spark plug health status assessment result;

[0047] A life prediction evaluator is used to generate a spark plug life prediction result based on the spark plug health status evaluation result.

[0048] The beneficial effects of the present invention are:

[0049] 1. Through the multi-dimensional sensor signal acquisition and processing mechanism, a comprehensive perception of the spark plug working status is achieved, which solves the problem of insufficient information dimension in traditional methods and provides rich and comprehensive input features for the deep learning model.

[0050] 2. The adaptive feature fusion preprocessing system is used to realize the intelligent fusion of features from different sources and with different physical meanings, solving the problem of multi-source heterogeneous data integration and improving the utilization efficiency of data information.

[0051] 3. An innovative dual-path spatial attention deep learning model was designed, which can simultaneously focus on the global change trend and local abnormal characteristics of the spark plug status, greatly improving the model's ability to perceive changes in the spark plug status under different working conditions.

[0052] 4. Through iterative transfer learning and knowledge accumulation system, the data imbalance problem is solved and a model evolution path is established, enabling the model to continuously learn from historical experience and adapt to new working conditions.

[0053] 5. A multi-dimensional evaluation and continuous optimization closed-loop system has been built to ensure that the model can continue to evolve, achieve self-improvement capabilities, and continuously improve prediction accuracy.

[0054] 6. After actual testing and verification, the spark plug life prediction accuracy of the method of the present invention is as high as 95.9%, which is significantly better than traditional methods and provides reliable technical support for engine health management and predictive maintenance. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] Figure 1 This is a flow chart of the spark plug life detection method based on deep learning of the present invention;

[0056] Figure 2 1 is a structural diagram of the adaptive feature fusion preprocessing system of the present invention;

[0057] Figure 3 This is a structural diagram of the dual-path spatial attention deep convolutional neural network model of the present invention;

[0058] Figure 4 This is a workflow diagram of the iterative transfer learning and knowledge accumulation system of the present invention;

[0059] Figure 5 Schematic diagram of the multi-dimensional evaluation and continuous optimization closed-loop system of the present invention;

[0060] Figure 6This is a structural block diagram of the spark plug life detection system based on deep learning of the present invention. DETAILED DESCRIPTION

[0061] Please refer to Figure 1 - Figure 6 The present invention will be further described in detail below with reference to the accompanying drawings and embodiments.

[0062] Reference Figure 1 The present invention provides a spark plug life detection method based on deep learning, comprising the following steps:

[0063] 1. Obtain spark plug current waveform signal, voltage characteristics and engine operating condition data:

[0064] In the embodiment of the present invention, firstly, the spark plug current waveform signal, voltage characteristics and engine operating condition data are acquired by the sensor acquisition unit 10 .

[0065] Preferably, the sensor acquisition unit 10 includes a current sensor, a voltage sensor, a speed sensor, a torque sensor and a temperature sensor, forming a multi-source sensor network to achieve comprehensive perception of the working status of the spark plug.

[0066] Specifically, the current sensor is used to acquire the spark plug current waveform signal at a sampling frequency of 5Hz. This 5Hz sampling frequency was chosen based on a comprehensive consideration of actual vehicle operating conditions and data processing capabilities. This frequency ensures that critical information about spark plug state changes is captured without incurring excessive data storage and processing burdens. For example, when a four-cylinder engine is running at 3000 rpm, there are approximately 1500 ignitions per minute. A 5Hz sampling frequency means that data is collected every 12 ignition events, which is sufficient to capture the gradual changes in spark plug performance.

[0067] The voltage sensor is used to acquire spark plug voltage signatures, also sampling at 5 Hz, synchronized with the current sensor to ensure temporal consistency of the data. Synchronous acquisition is crucial for subsequent feature fusion, ensuring temporal correspondence between data from different sources.

[0068] The engine control unit also collects engine speed, engine torque, and combustion stability data as engine operating condition data. This operating condition data is crucial for understanding the performance changes of spark plugs under different operating conditions. For example, the operating state of a spark plug at high speed and high load differs significantly from that at idle, requiring a comprehensive analysis based on the combined operating condition data.

[0069] 2. Preprocess the acquired data to form preprocessed data:

[0070] Reference Figure 2After obtaining the spark plug current waveform signal, voltage characteristics and engine operating condition data, these raw data need to be processed by the signal preprocessing module 20 and converted into feature data suitable for deep learning model input.

[0071] Specifically, the spark plug current waveform signal is filtered and converted into a pulse count-time waveform curve. The filtering process uses a wavelet filtering algorithm, which can effectively remove noise while retaining the key characteristics of the signal. The steps of pulsing the current waveform signal include:

[0072] (1) Original current signal acquisition;

[0073] (2) High-pass filtering eliminates low-frequency interference. The cutoff frequency is set to 50 Hz, which can effectively filter low-frequency interference such as engine vibration;

[0074] (3) Peak detection and threshold judgment: the threshold is set to 1.5 times the average current value, and pulses exceeding the threshold are considered valid pulses;

[0075] (4) Pulse counting and time series construction, with pulse counting performed in a time window of 200ms;

[0076] (5) Statistical analysis of the pulse number change trend within the time window.

[0077] Pulsing can transform complex current waveforms into easier-to-process pulse count sequences while preserving the waveform's key characteristics. For example, as spark plugs age, the electrode gap increases, raising the voltage required for ignition and causing changes in the current pulse characteristics. These changes can be effectively captured using a pulse count sequence.

[0078] Preferably, the voltage average value and voltage peak time series are extracted from the voltage characteristics. The processing of voltage characteristics includes:

[0079] (1) Extract the maximum voltage (VMAX), taking the maximum voltage value within each ignition cycle;

[0080] (2) Calculation of the minimum voltage (VMIN): take the minimum voltage value within each ignition cycle;

[0081] (3) Voltage peak ratio (P = VMAX / VMIN) is constructed, which can reflect the insulation performance of the spark plug;

[0082] (4) Calculation of mean voltage (MAVG): take the average voltage value within each ignition cycle;

[0083] (5) The mean value ratio (AC=MAVG / VMIN) is generated. This parameter can reflect the stability of the spark plug voltage waveform.

[0084] Voltage feature extraction is crucial for evaluating the insulation performance and electrode gap condition of spark plugs. For example, the VMAX / VMIN ratio of a new spark plug is typically between 1.5 and 2.0, but as the spark plug ages, this ratio may increase to 2.5-3.0 or higher.

[0085] For engine operating condition data, the operating condition feature vector is formed through quantization. The steps of operating condition parameterization include:

[0086] (1) Engine speed range (W): The speed range is usually divided into the idle range (800-1200 rpm), low speed range (1200-2500 rpm), medium speed range (2500-4000 rpm) and high speed range (above 4000 rpm);

[0087] (2) Numericalization of engine torque, normalizing torque data to the range of 0-1;

[0088] (3) Setting the ignition count threshold (Pd), based on engine type and operating conditions, with a typical value of 1000 to 5000 times;

[0089] (4) Combustion stability is usually determined by a coefficient of variation (COV) of less than 3% for 10 consecutive cycles;

[0090] (5) Construction of working condition characteristic vector: combining the parameters of each working condition into a characteristic vector.

[0091] Quantifying operating data enables the model to understand how spark plug performance varies under different operating conditions. For example, during a cold start, spark plugs require higher ignition energy, while under high-speed and high-load conditions, spark plugs face higher thermal loads and pressure, all of which affect spark plug life.

[0092] Finally, the pulse count-time waveform, the average voltage and peak voltage time series, and the operating condition feature vector are fused to form a spark plug prediction dataset. In this embodiment of the present invention, the training set accounts for 85% of the total data, and the test set accounts for 15%. This division ratio is an empirical value in the field of machine learning and ensures sufficient model training while providing sufficient test samples for model validation. Through feature fusion, the system can comprehensively evaluate the spark plug condition from multiple dimensions, improving prediction accuracy.

[0093] 3. Build a dual-path spatial attention deep convolutional neural network model:

[0094] Reference Figure 3The present invention constructs an innovative dual-path spatial attention deep convolutional neural network model 30 for intelligent perception and evaluation of spark plug status. The model includes a convolution module 31, an attention module 32, a pooling module 33, and an output module 34.

[0095] Specifically, the convolution module 31 extracts features from the input data through a convolution layer. In an embodiment of the present invention, the convolution layer includes 48 3×3 convolution kernels, and the activation function is the ReLU function. The mathematical expression of the convolution layer is:

[0096] ,

[0097] in: The output feature map is at position The value at For input data at location The value at The convolution kernel is at position The weight of the place; and are the height and width of the convolution kernel, respectively, and are both 3 in this embodiment.

[0098] Convolution effectively extracts local features from spark plug signals. For example, when spark plug electrodes wear, specific fluctuation patterns appear in the current waveform, which can be effectively identified using convolution. The use of 48 convolution kernels is based on experimental results and demonstrates a good balance between model complexity and feature extraction capabilities.

[0099] Attention module 32, the core innovation of this invention, comprises a first path 321 and a second path 322. First path 321, consisting of a global average pooling layer and a fully connected layer, captures the overall distribution of feature channels. Second path 322, consisting of a spatial embedding layer and a fully connected layer, captures local spatial relationships. The outputs of first and second paths 321 and 322 are fused via a fusion layer 323 to serve as the output of attention module 32.

[0100] The calculation formula for global average pooling is:

[0101] ,

[0102] in: For the Global average pooling result of the channel; The feature map is at position and channel The value at and are the height and width of the feature map, respectively.

[0103] Global average pooling captures global information across the entire feature map and is very effective in identifying trends in spark plug performance. For example, as a spark plug ages, the overall energy distribution of the current waveform changes, and global average pooling can effectively capture this change.

[0104] The calculation of the spatial embedding layer involves spatial position encoding, and its mathematical expression is:

[0105] ,

[0106] in: is the eigenvalue after spatial embedding; is the original eigenvalue; For position coding, a fixed coding mode generated by sine and cosine functions is usually used. The specific expression is:

[0107] ,

[0108] ,

[0109] in: is the position index; is the dimension index; is the model dimension.

[0110] Spatial embeddings help the model understand the spatial relationships between features, which is crucial for identifying position-dependent patterns in spark plug signals. For example, different phases of the ignition cycle (pre-ignition, main discharge, and burnout) have distinct characteristic patterns, and spatial embeddings help the model distinguish between these phases.

[0111] The calculation formula of attention weight is:

[0112] ,

[0113] in: is the attention weight matrix, with dimension , is the sequence length; is the ReLU activation function; and They are the query matrix and the key matrix, both of which are obtained by linear transformation of the feature map, and their dimensions are , is the matrix transpose, is the attention dimension; softmax is a normalization function that ensures that the sum of weights is 1, defined as:

[0114] ,

[0115] in: The first elements; is the vector dimension.

[0116] The final attention mechanism output is:

[0117] ,

[0118] in: is the output of the attention mechanism, with dimension ; is the attention weight matrix; Is a value matrix, obtained by linear transformation of the feature map, with a dimension of , is the dimension of the value vector.

[0119] The attention mechanism helps the model focus on key parts of the spark plug signal, improving feature extraction efficiency. For example, when a spark plug malfunctions, certain regions of the current waveform will show significant changes. The attention mechanism can automatically identify and focus on these regions.

[0120] The pooling module 33 uses one-dimensional convolution and maximum pooling operations to reduce the feature dimension and extract key features. The mathematical expression of maximum pooling is:

[0121] ,

[0122] in: The feature map after pooling is at position and channel The value at is the input feature map; and are the height and width of the pooling window, respectively, both of which are 2 in this embodiment; is the step size, which is 2 in this embodiment.

[0123] The max pooling operation can extract the most significant features in the signal while reducing computational complexity. For spark plug signals, max pooling can capture peak features in the waveform, which are often directly related to spark plug performance.

[0124] The output module 34 consists of two convolutional layers, each followed by a linear layer, containing 300 neurons. The mathematical expression of the linear layer is:

[0125] ,

[0126] in: is the output vector, with dimension ; is the weight matrix, with dimension ; is the input vector, with dimension ; is the bias vector, dimension is In this example, the first linear layer (number of convolution output channels), (number of neurons); the second linear layer (first layer output dimension), (Number of health status categories).

[0127] The output module maps the extracted features into a spark plug health status assessment result. In this example, the output is a binary classification result, indicating the healthy / abnormal status of the spark plug. The number of neurons in the linear layer is set to 300 based on experimental optimization results. This number provides sufficient model capacity while avoiding overfitting.

[0128] 4. Input the preprocessed data into the dual-path spatial attention deep convolutional neural network model to obtain the preliminary assessment results of the spark plug health status:

[0129] In an embodiment of the present invention, the preprocessed data is input into the constructed dual-path spatial attention deep convolutional neural network model 30, which automatically extracts and learns the key features of the data and outputs a preliminary assessment result of the spark plug health status.

[0130] The forward propagation process of the model can be expressed as:

[0131] ,

[0132] in: This is the preliminary evaluation result of the spark plug health status output by the model, with a dimension of 2, indicating the probabilities of healthy / abnormal states; It is the pre-processed input data, including current, voltage and working condition characteristics; 、 、 and They are the forward propagation functions of the convolution module, attention module, pooling module and output module respectively.

[0133] In practical applications, the model processes spark plug signal data under different operating conditions. For example, for spark plugs operating at idle speed, the model focuses on the stability of the current waveform and the consistency of the voltage peak. However, for high-speed and high-load conditions, the model pays more attention to the energy distribution of the current pulse and the changing trend of the voltage peak. Through a dual-path spatial attention mechanism, the model can automatically adjust the features it focuses on based on different operating conditions, improving prediction accuracy.

[0134] 5. Use the transfer learning model to optimize the initial spark plug health status assessment results:

[0135] Reference Figure 4 The present invention utilizes a transfer learning model 40 to optimize the initial spark plug health status assessment results and improve prediction accuracy. Transfer learning is a machine learning method that applies knowledge learned from one task to another related task, thereby improving learning efficiency and performance.

[0136] In this embodiment of the present invention, the training parameters of the first transfer learning model are first transferred to the second model for pre-training. The pre-trained parameters are then no longer updated. This is done to preserve the general knowledge learned by the first model, providing a good initial state for the second model. For example, the first model may have learned the normal performance characteristics of a spark plug under standard operating conditions. This knowledge can help the second model adapt to new operating conditions more quickly.

[0137] Next, the second model is trained using the data. After training is complete, the pre-trained parameters are combined with the updated parameters for further training. This approach adapts the model to the new data distribution while preserving general knowledge. For example, if the second model needs to process spark plug data from high-altitude operating conditions, it can learn the specific patterns of high-altitude environments while retaining basic knowledge of spark plug characteristics.

[0138] Preferably, the above pre-training method is repeatedly applied to the remaining datasets. In embodiments of the present invention, iterative training is typically performed using 10 different datasets, each representing a different operating condition or spark plug state. These datasets may include different engine types (e.g., inline-four, V6, turbocharged), different driving conditions (e.g., city driving, high-speed cruising, hill climbing), and different environmental conditions (e.g., high temperature, low temperature, high humidity, etc.).

[0139] Finally, the pretrained parameters are used as part of the random initialization parameters and are supplemented with training weights, ensuring that the randomly initialized parameters during final deep convolutional neural network model training are not completely randomized. This approach can improve the model's initial performance and training stability. Specifically, pretrained parameters typically account for 70% of the initial parameters, with the remaining 30% being random initialization parameters. This ratio preserves prior knowledge while ensuring the model's adaptability to new data.

[0140] The preferred training parameters for the transfer learning model are: a batch size of 32, a training epoch of 100, and the Adam optimizer with no weight decay. The batch size of 32 is chosen to strike a balance between computing resources and training efficiency; a smaller batch size helps the model escape local optima. The training epoch of 100 is based on experimental results, showing that the model generally converges to a satisfactory performance level. The Adam optimizer was chosen because it combines the advantages of momentum and adaptive learning rate methods, effectively handling non-stationary targets and noisy data.

[0141] The update rule of the Adam optimizer is:

[0142] ,

[0143] ,

[0144] ,

[0145] ,

[0146] ,

[0147] in: and They are first-order moment estimation and second-order moment estimation respectively; is the current gradient; and are exponential decay rates, with default values ​​of 0.9 and 0.999 respectively; and are bias-corrected estimates; Update the value for the parameter; is the learning rate, initially set to 0.001; is a numerical stability constant, the default is .

[0148] The loss function in the transfer learning process usually adopts cross entropy loss, and its mathematical expression is:

[0149] ,

[0150] in: is the loss value; is the number of samples, which is usually 256 in this embodiment (batch size or number of mini-batches); is the number of categories, which is 2 (healthy / abnormal) in this embodiment; For the The samples belong to The true label of the class (0 or 1); The model predicts The samples belong to The probability of the class.

[0151] In practical applications, transfer learning models can adapt to different spark plug types and engine operating conditions. For example, a model can learn from the performance characteristics of gasoline engine spark plugs and apply them to natural gas engine spark plug testing. Or, experience from passenger car spark plug testing can be transferred to commercial vehicle spark plug testing. This transfer capability greatly expands the model's application scope and reduces training costs for new application scenarios.

[0152] 6. Generate spark plug life prediction results based on the spark plug health status assessment results:

[0153] Reference Figure 5 After obtaining the optimized spark plug health status evaluation result, the present invention generates a final spark plug life prediction result through the life prediction evaluator 50.

[0154] Specifically, the collected input data is fed into a trained deep convolutional neural network model, which uses transfer learning and self-attention mechanisms to identify key operating characteristics, extract and fuse features, and then perform lifespan estimation. For example, the system can monitor the status of a vehicle's spark plugs in real time while driving. Based on current health assessment results and historical data trends, it can predict the remaining service life of the spark plugs, providing a basis for maintenance decisions.

[0155] The lifespan prediction module evaluates the accuracy of predictions and uses a variety of evaluation metrics to comprehensively assess model performance, including historical mean absolute percentage error (MAPE), Precision1, and Precision2.

[0156] The calculation formula for the historical mean absolute percentage error MAPE is:

[0157] ,

[0158] in: is the mean absolute percentage error; is the number of samples, which in this embodiment is usually the number of test set samples (15% of the total data); For the The actual value of the sample represents the actual remaining life of the spark plug; For the The predicted value of samples represents the remaining life of the spark plug predicted by the model.

[0159] A smaller MAPE value indicates a more accurate prediction. In spark plug life prediction, a MAPE value below 5% is generally considered a good prediction result, while a value below 3% is considered excellent prediction performance.

[0160] The calculation formula for accuracy is:

[0161] ,

[0162] in: is the accuracy rate; is the number of true positives, which indicates the number of spark plug samples correctly predicted by the model as “need to be replaced”; is the number of false positives, which indicates the number of spark plug samples that the model incorrectly predicts as “needs to be replaced”.

[0163] The higher the accuracy value, the more reliable the model's predictions. In practice, an accuracy greater than 90% is generally considered an acceptable level of performance, while an accuracy greater than 95% is considered a high-precision prediction.

[0164] In this embodiment of the present invention, the historical mean absolute percentage errors (MAPE1) and MAPE2 are calculated, where MAPE1 represents the error from transfer learning and MAPE2 represents the error from training using only the self-attention mechanism. Precision1 and Precision2 are also calculated, where Precision1 represents the accuracy of samples trained using transfer learning and Precision2 represents the accuracy of samples trained using only the self-attention mechanism. By comparing MAPE1 and MAPE2, and Precision1 and Precision2, the relative contributions of transfer learning and the self-attention mechanism can be assessed.

[0165] Optimally, the MAPE1 value is approximately 2.35%, the accuracy1 is approximately 91.7%, the MAPE2 value is approximately 3.58%, the accuracy2 is approximately 95.9%, the precision1 is approximately 89.6%, and the precision2 is approximately 93%. These values ​​demonstrate that self-attention performs well in extracting and mining features for different operating conditions, and that prediction accuracy is further improved by optimizing the feature weights for different operating conditions through transfer learning. For example, the operating characteristics and degradation patterns of spark plugs differ between urban driving and highway driving. The self-attention mechanism can automatically identify key features under different operating conditions, while transfer learning can optimize the weights of these features and improve overall prediction accuracy.

[0166] The trained deep convolutional neural network model is applied to the training set and validated using the test set. When the model's prediction accuracy meets the required level (typically above 90%), training terminates; otherwise, the training phase begins again. This closed-loop optimization mechanism ensures continuous improvement in model performance. In practice, the system regularly collects new spark plug data for model updates to account for factors such as engine aging and changes in fuel quality.

[0167] 7. Self-supervised contrastive learning module

[0168] The present invention further includes constructing a self-supervised contrastive learning module 60, which sets a self-contrast memory library for updating associated features according to the spark plug signal and outputting a final health status assessment result.

[0169] The capacity of the self-comparison memory bank is set to 15-25, corresponding to spark plug signals collected at different times. The choice of memory bank capacity is based on experimental results. A capacity that is too small cannot capture sufficient historical information, while a capacity that is too large increases the computational burden and may introduce excessive noise. Experiments have shown that a capacity range of 15-25 can achieve a good balance between information capture and computational efficiency. For example, for urban driving conditions, 15 moments of data (approximately 3 minutes) are usually sufficient to capture the changing trends of the spark plug state. For relatively stable conditions such as highway driving, fewer moments of data, such as 15, can be used. For complex and changing conditions, such as mountain driving, more moments of data, such as 25, may be required to fully capture state changes.

[0170] The core idea of ​​self-supervised contrastive learning is to identify key change patterns of the spark plug signals by comparing them at different times, thereby more accurately evaluating the health status of the spark plug. Its mathematical expression is:

[0171] ,

[0172] in: is the contrast loss; is the eigenvector and The similarity between them is usually measured by cosine similarity, which is defined as:

[0173] ,

[0174] in, represents the vector inner product, Represents a vector The norm of is the temperature parameter, which controls the smoothness of the distribution and is usually set to 0.07-0.1; is the indicator function, when 1 when it is, otherwise 0; is the batch size, which is usually 32 in this embodiment.

[0175] By minimizing contrast loss, the model can learn the relationship between different spark plug signals, thereby better understanding the changing trends in the spark plug's health. For example, the model can learn the differences in the signal characteristics of a healthy spark plug under different operating conditions, as well as the differences in the signal characteristics of a healthy spark plug and an aged spark plug under the same operating conditions. This knowledge helps improve the model's discriminative ability.

[0176] In practical applications, the self-supervised comparative learning module continuously learns from newly acquired data to continuously optimize model performance. For example, when a vehicle is driven in different seasons and regions, the operating environment and conditions of the spark plugs will change. Self-supervised learning can help the model adapt to these changes and maintain prediction accuracy.

[0177] Reference Figure 6 The present invention also provides a spark plug life detection system based on deep learning, including a sensor acquisition unit 10, a signal preprocessing module 20, a deep learning inference engine 30, a transfer learning module 40 and a life prediction evaluator 50.

[0178] The sensor acquisition unit 10 includes a current sensor, a voltage sensor, a speed sensor, a torque sensor, and a temperature sensor, which are used to collect spark plug signals and engine operating condition data. The current and voltage sensors both have a sampling frequency of 5 Hz, enabling accurate capture of the spark plug's electrical characteristics. In practical applications, the current sensor is typically installed on the spark plug's high-voltage circuit, the voltage sensor is connected in parallel across the spark plug, the speed sensor is connected to the engine's crankshaft position sensor, the torque sensor is mounted on the engine's output shaft, and the temperature sensor monitors the engine's cylinder head temperature.

[0179] The signal preprocessing module 20 performs filtering, normalization, and differentiation on the collected spark plug signals and engine operating condition data to generate preprocessed data. Filtering utilizes a wavelet filtering algorithm to effectively remove noise. Normalization unifies data of varying scales into the same range for ease of subsequent processing. Differentiation enhances signal variation and improves feature recognition. For example, for current signals, a high-pass filter with a cutoff frequency of 50Hz effectively removes low-frequency interference such as engine vibration. Normalization maps all signals to a range of 0-1, ensuring comparability between different physical quantities. Differentiation emphasizes signal variation trends by calculating the difference between adjacent sampling points.

[0180] The deep learning inference engine 30 includes a convolution module 31, an attention module 32, a pooling module 33 and an output module 34. The attention module 32 is the core innovation of this system. It includes a first path 321 and a second path 322. The first path 321 is composed of a global average pooling layer and a fully connected layer, and the second path 322 is composed of a spatial embedding layer and a fully connected layer. It is used to process the preprocessed data to obtain a preliminary assessment result of the spark plug health status. In actual deployment, the deep learning inference engine can be integrated into the on-board ECU or installed on the vehicle as an independent monitoring unit. For scenarios with limited computing resources, model compression technologies such as weight quantization and model pruning can be used to reduce the model size and increase the inference speed.

[0181] The transfer learning module 40 is used to optimize the initial spark plug health assessment results to obtain the spark plug health assessment results. This module enables efficient knowledge transfer between different data sets, improving the model's generalization and prediction accuracy. For example, model knowledge trained on a four-cylinder engine can be transferred to a six-cylinder engine, or experience learned on a gasoline engine can be transferred to a hybrid engine, significantly reducing data collection and training costs in new scenarios.

[0182] The life prediction evaluator 50 generates a spark plug life prediction based on the spark plug health status assessment results. This evaluator comprehensively evaluates the prediction results using multiple metrics and continuously optimizes model performance based on the results. In practical applications, the life prediction results can be displayed directly to the driver via the onboard display or transmitted to a fleet management center or repair station via a remote diagnostic system to inform maintenance decisions. For example, the system can predict the remaining life percentage or remaining mileage of a spark plug and issue a warning to replace it in advance when its life is about to end.

[0183] The system of this invention achieves comprehensive perception, precise assessment, and lifespan prediction of spark plugs, providing reliable technical support for engine health management and predictive maintenance. Compared with traditional methods, this system offers higher prediction accuracy, greater adaptability to operating conditions, and greater self-optimization capabilities. For example, in complex and changing urban driving environments, traditional methods typically have a prediction accuracy of around 80%, while this system achieves over 95%. Traditional methods may require parameter recalibration under different seasons and climate conditions, while this system, through its adaptive learning capabilities, can automatically adjust the model to adapt to environmental changes.

[0184] Those skilled in the art will appreciate that the above embodiments are merely preferred embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Various modifications and improvements made by those skilled in the art to the technical solutions of the present invention without departing from the design principles of the present invention should all fall within the scope of protection of the present invention.

Claims

1. A spark plug life detection method based on deep learning, characterized in that: include: Obtain spark plug current waveform signal, voltage characteristics and engine operating condition data; Preprocessing the acquired spark plug current waveform signal, voltage characteristics, and engine operating condition data to form preprocessed data; Constructing a dual-path spatial attention deep convolutional neural network model, wherein the dual-path spatial attention deep convolutional neural network model includes a convolution module, an attention module, a pooling module and an output module; Inputting the preprocessed data into the dual-path spatial attention deep convolutional neural network model to obtain a preliminary assessment result of the spark plug health status; Optimizing the preliminary spark plug health status assessment result using a transfer learning model to obtain a spark plug health status assessment result; Based on the spark plug health status assessment result, a spark plug life prediction result is generated.

2. The spark plug life detection method based on deep learning according to claim 1, characterized in that: The obtaining of spark plug current waveform signal, voltage characteristics and engine operating condition data includes: The spark plug current waveform signal is obtained through the current sensor with a sampling frequency of 5Hz; The spark plug voltage characteristics are obtained through a voltage sensor with a sampling frequency of 5Hz; The engine speed, engine torque, and combustion stability state are obtained as engine operating condition data through the engine control unit.

3. The spark plug life detection method based on deep learning according to claim 1, characterized in that: The preprocessing of the obtained spark plug current waveform signal, voltage characteristics and engine operating condition data includes: Filtering the spark plug current waveform signal and converting it into a pulse number time waveform curve; extracting a voltage average value and a voltage peak time series from the voltage characteristics; quantizing the engine operating condition data to form an operating condition feature vector; The pulse number time waveform curve, the voltage average value and voltage peak time series, and the operating condition feature vector are fused to form a spark plug prediction data set, where the training set accounts for 85% of the total data and the test set accounts for 15% of the total data.

4. The spark plug life detection method based on deep learning according to claim 1, characterized in that: The construction of the dual-path spatial attention deep convolutional neural network model includes: Construct a convolution module, which extracts features from input data through a convolution layer, where the convolution layer contains 48 3×3 convolution kernels and the activation function is the ReLU function; Constructing an attention module, the attention module includes a first path and a second path, the first path is composed of a global average pooling layer and a fully connected layer, and the second path is composed of a spatial embedding layer and a fully connected layer, and the output results of the first path and the second path are fused by the fusion layer as the output result of the attention module; Constructing a pooling module, wherein the pooling module adopts one-dimensional convolution and maximum pooling operations; An output module was constructed, which included two convolutional layers, each followed by a linear layer, and contained 300 neurons.

5. The spark plug life detection method based on deep learning according to claim 1, characterized in that: The optimizing the preliminary evaluation result of the spark plug health status by using the transfer learning model includes: The training parameters of the first transfer learning model are passed to the second model for pre-training, and the pre-training parameters are no longer updated; Use the data of the second model for training. After the training is completed, add the pre-trained parameters to the updated parameters and perform comprehensive training again. Repeatedly applying the pre-training method to the remaining multiple data sets; The pre-trained parameters are used as part of the random initialization parameters and the training weights are added so that the random initialization parameters during the final deep convolutional neural network model training are not completely randomized.

6. The spark plug life detection method based on deep learning according to claim 5, characterized in that: The training parameters of the transfer learning model are set as follows: batch size is 32, training cycle is 100, optimizer is Adam and weight decay is not calculated.

7. The spark plug life detection method based on deep learning according to claim 1, characterized in that: Generating a spark plug life prediction result based on the spark plug health status assessment result includes: The collected input data is fed into a trained deep convolutional neural network model, which uses transfer learning and self-attention mechanisms to identify key operating condition features, extract and fuse features, and thus perform life estimation. The accuracy of the prediction is evaluated through the life prediction module, and the prediction accuracy of the model is evaluated through the historical mean absolute percentage error (MAPE), precision1, and precision2. The trained deep convolutional neural network model is applied to the training set calculation and verified by the test set. When the model prediction accuracy meets the requirements, the training is terminated, otherwise the training step is re-entered.

8. The spark plug life detection method based on deep learning according to claim 7, characterized in that: The prediction accuracy of the model evaluated by the historical mean absolute percentage error (MAPE), accuracy rate (Precision1), and accuracy rate (Precision2) includes: Calculate the historical mean absolute percentage error MAPE1 and MAPE2, where MAPE1 represents the error of transfer learning and MAPE2 represents the error of training using only the self-attention mechanism; Calculate the accuracy Precision1 and Precision2, where Precision1 represents the accuracy of samples trained using transfer learning, and Precision2 represents the accuracy of samples trained using only the self-attention mechanism; Compare MAPE1 and MAPE2 as well as Precision1 and Precision2 to evaluate the relative contributions of transfer learning and self-attention mechanism.

9. The spark plug life detection method based on deep learning according to claim 1, characterized in that: It also includes constructing a self-supervised comparative learning module, which sets a self-comparative memory bank for updating associated features according to the spark plug signal and outputting the final health status assessment result; wherein the capacity of the self-comparative memory bank is set to 15-25, corresponding to the spark plug signals collected at different times.

10. A deep learning-based spark plug life detection system for executing the method according to any one of claims 1 to 9, characterized in that: include: Sensor acquisition unit, including current sensor, voltage sensor, speed sensor, torque sensor, and temperature sensor, used to collect spark plug signals and engine operating condition data; A signal preprocessing module is used to perform filtering, normalization and differential processing on the collected spark plug signals and engine operating condition data to form preprocessed data; A deep learning inference engine, comprising a convolution module, an attention module, a pooling module, and an output module. The attention module comprises a first path and a second path. The first path comprises a global average pooling layer and a fully connected layer, and the second path comprises a spatial embedding layer and a fully connected layer. The first path is used to process the preprocessed data to obtain a preliminary assessment result of the spark plug health status. A transfer learning module is used to optimize the preliminary spark plug health status assessment result to obtain a spark plug health status assessment result; A life prediction evaluator is used to generate a spark plug life prediction result based on the spark plug health status evaluation result.

Citation Information

Patent Citations

  • Aero-engine life prediction and health assessment method based on transfer learning

    CN114997051A

  • Engine residual life prediction method based on multi-modal deep learning

    CN116662743A

  • Engine spark plug life prediction method and device, readable medium and electronic equipment

    CN116882065A

  • Automobile spark plug aging detection early warning system based on data analysis

    CN118549734A

  • Battery remaining life prediction system and method based on transfer learning, storage medium and computer program product

    CN120085175A