Summary
The worldwide penetration of electric bicycles has caused numerous charging accidents; however, online diagnosing charging faults remains challenging because of non-standard chargers, non-uniform communication manners and inaccessible battery inner status. The development of Internet of Things enables to acquire the input current information of chargers in the cloud platform, thereby supplying an alternative perspective to excavate underlying charge abnormalities. Through analyzing 181,282 charge records collected from the power-grid side, we establish an update-to-date deep neural network algorithm, which can automatically capture these charge feature variables, determine their dependencies and identify abnormal charge behaviors. Based on the only input current sequences, the algorithm can effectively diagnose the charging fault with the average accuracy of 85%, efficiently ensuring the charging safety of more than 20 million E-bicycles after substantial validations. Besides, this diagnosis framework can be extended to the real-time charge safety detection of electric vehicles and other similar energy storage systems.
Subject areas: Energy systems, Machine learning
Graphical abstract

Highlights
-
•
Alternating inputs are leveraged to facilitate abnormal charging diagnosis
-
•
Abnormal charging scenarios are defined with consideration of different batteries
-
•
Up-to-date machine learning is exploited to efficiently diagnose the charging fault
-
•
The non-invasive detection scheme ensures charging safety of 20 million bicycles
Energy systems; Machine learning
Introduction
As a supplemental and substantial transportation tool for commuting and short-distance trip, electric bicycles (E-bicycles) have been progressively developed, and the global market is valued at more than $40 billion in 2019.1 Owing to the convenience, mobility, maneuverability, operation economy and eco-friendliness,2 more than 300 million E-bicycles in China3 and more than 3.7 million in Europe4 have emerged. In particular, the COVID-19 pandemic further promotes E-bicycles sales by up to 145% during 2019 to 2020 under government guidance and supervised social-distance.4 An intrinsic challenge is that wide operation of E-bicycles around the world has brought numerous charge safety problems, including thermal runaway, explosion and even fire disaster.3,5,6 From 2015 to 2021, the annual safety accidents during charging reach up to 10,000 cases in China.5 Hence, online monitoring and diagnosing charging behavior and prognosing occurrence of accidents has become an urgent task waiting to be tackled.7 In E-bicycles, lead acid batteries and lithium-ion batteries are usually deployed as the main energy storage sources.8 For lead acid battery packs, a battery management unit (BMU) is usually not imperative because of their safe operation capacity and inherent passive balance functionality.9 However, for lithium-ion batteries, because of its high-demanding operation environment, a BMU is usually indispensable to monitor and safeguard the operation status, thereby ensuring its normal operation and promoting the lifetime extension.
The batteries inside E-bicycles are usually charged at home or on public charging facilities by converting alternating current (AC) into direct current (DC) signal through a converter, referred to as battery charger.5 The compressed price of E-bicycles, especially in China, compels the manufacturers to pursue low-cost charger. To the best of the authors’ knowledge, non-standard chargers, non-uniform battery management communication protocols and inaccessible battery inner status information make it intractable to oversee the charging state via a uniform manner. However, various electrochemical reactions and excessive abuses of batteries will lead to failures and driving risks. For instance, deciduous positive active substances,10 dried separators, dehydration, plate gate corrosion,11 anodes irreversible vulcanization and high rate charging12 can deteriorate the safety of lead-acid batteries. For lithium-ion batteries, mechanical collision, internal short circuit, overcharge, over-discharge and overheating can easily lead to thermal runaway, fire combustion, and even explosion.13,14,15,16 Although a variety of research has been attempted to design different controlling schemes for E-bicycles to monitor and oversee the battery operation state,7,8,9 the all-functional BMU and temperature monitoring unit furnished in electric vehicles (EVs) are seldom deployed on commercial E-bicycles.13,17 Commercial E-bicycle developers usually adopt simple control strategies inside charger and battery to implement charging and coarse safety control, such as overcurrent, overvoltage and overheating protection. In the whole charging process, all the information cannot be acquired externally, and the system looks like a “black-box”, and end-users are tricky to conduct safe charging control. What is more, it is intractable for users and charging piles to know the charging mode, remaining capacity and internal temperature, much less identifying state of health (SOH) and the internal failures of batteries.
As above discussed, the charging current, voltage and internal temperature of batteries are critical input to facilitate the operation safety evaluation, wherein the charging current is directly determined by the charging mode. To improve the utilization efficiency and prolong service life of batteries, various charging modes are employed in practice based on various batteries’ chemistries, capacity and charging rate,8,18,19 such as constant-current (CC),20 constant-voltage (CV),21 multistage constant-current,21 pulse current,22 trickle constant current (TCC),20 etc. Such multiple charging modes and their combinations lead to the characteristic diversification of charging current, augmenting the difficulty of detecting charging safety. How to ensure the charging safety from complicated charging protocols, different batteries and inaccessible charging measures deserves to be further investigated from different perspectives. Because the charging operation is accomplished through converting AC to DC occurring in the charger, and it is intractable to access the information from the DC side, some necessary information for the AC side may possibly be explored to find abnormal charging operations. With the development of Internet of Things (IOT), intelligent charging piles progressively appear, and the input voltage and the output current (even both are the alternating variables) can be processed to find some inherent relationships with respect to abnormal charging operations. Motivated by this, we collected 181,282 charging records, which last more than 6 months and occur in 15k charging piles located in more than 300 cities, China, as shown in Figure 1A. It can be found that the measured voltages are generally stabilized at 220 ± 20 (V) because of the stability capability of power grid, and the currents (effective values) are characterized by various amplitude, duration and dynamic changes, as shown in Figure 1B. These informative current features are far more than standard current protocols, as sketched in Figure 1C, which, nonetheless, can highlight the internal operation state of batteries, charging modes and possible user behaviors. On the other hand, the current profiles shown in Figure 1B still include some useful information that can be leveraged to identify abnormal charging scenarios. However, such rich and uncertain features contained in the current time series data also raise significant difficulties in manual charge mode definition, feature extraction as well as feature dependency determination. To tackle this problem, we seek for the support of machine learning technologies, which can excavate the hidden variation rules of charging current modes. In addition, machine learning algorithms enable to overcome the shortcomings of deterministic rules that can be incapable of identifying the complicated abnormal operations in these massive charging data. On this account, this study innovatively introduces an update-to-date algorithm, i.e., one dimensional convolutional neural network (1D-CNN)23 and long-short term memory network (LSTM),24 to automatically capture these features and their dependencies, and successfully evaluate the charging safety. The trained CNN-LSTM model can be deployed on charging piles to perform real-time detection of the charging process and provide early warnings for unsafe charging. The proposed machine learning based fault diagnosis algorithm can supply precise charging fault with the accuracy of 85%, and efficiently promotes the charging safety of more than 20 million E-bicycles. This non-invasive detection method does not need to acquire the operation mechanisms of E-bicycles, batteries and chargers, supplying a convenient and efficient solution to charge safety supervision. In addition, the designed algorithm enables incremental training in the cloud sever, and facilitates the deployment on charging piles through transfer learning without complementing extra hardware on existing batteries, circuits and chargers. These efficient supervisions can advance the development of IOT in E-bicycles, efficiently mitigate the charging safety concern and promote the acceptance of E-bicycles. Furthermore, the designed detection method on charging piles can also be extended to the real-time charging safety detection of four-wheeled EVs and other similar energy storage systems.
Figure 1.
E-bicycle charging operation on charging pile and corresponding scenarios
(A) The locations of charging piles, E-bicycle charging implementation process on the pile and the charging monitoring system on the cloud monitoring system are described. As can be found, the charging piles are widely distributed in China.
(B) Various charging AC currents and voltages collected from charging piles are sketched. The X-axis and left and right Y-axes represent the interval, current (A) and voltage (V), where the blue line and light blue part and the orange-red line correspond to the AC current and voltage, respectively. Note that in the following current related figures, the X-axis and Y-axis denote the same meaning.
(C) the classical charging DC current and voltage of lithium-ion and lead-acid batteries are elucidated.
Results
We tracked the charging services of more than 3,000 charging piles for 6 months and randomly selected 181,282 original charging records. To identify the charging faults, the abnormal and normal charging scenarios are firstly defined, and then the designed advanced algorithms are leveraged to distinguish the abnormal ones.
Current characteristics and classification
According to the operation mechanism of battery, the traditional charging modes usually involve CC, CV, TCC and pulse current,20,21,22 and appear according to a specific sequence. For instance, CV charging does not emerge before CC mode, and for the same E-bicycle, multiple CC modes with different charging currents seldom appear. Moreover, some modes, such as continuously rising charging current,11 mere TCC or CV mode usually indicate thermal runaway or battery failure.25 According to the normal charging manners, current characteristics and possible multi-mode combinations, we define four abnormal charging scenarios (referred to Classes 1 to 4) related to charging safety, and five normal charging manners (Classes 5 to 9).
Class 1
Continuous rising of current (CRC) after CV mode, as show in Figure 2A. Normally, after CC-CV or CV charge, the whole charging process will end or enter into the TCC mode. However, because of loss of water or internal high temperature in lead-acid batteries, the current may continue to rise, thus resulting in possible thermal runaway.11
Figure 2.
Abnormal charging classes
(A) Class 1, charging current continuously rises after the CV sub-process, and CC-CV-CRC or CC-CV-CRC-CC charging appears.
(B) Class 2, less than 15% power is charged in the battery only in TCC, SCC-TCC, SCC-CV-TCC or CV mode.
(C) Class 3, multiple E-bicycles are charged in the same order, in which only multiple CC modes emerge, as shown in subfigures (1) and (2), and more charging modes including multiply CC-CV appear in subfigures (5) to (15).
(D) Class 4, intermediate charging current of less than 0.6 A exists. In addition, the current difference of less than 0.3 A before and after temperature control is classified as this class.
Class 2
Limited charged capacity (Less than 15% power).25 Usually, the charging process contains the CV and TCC mode, whereas short CC (SCC) and CV-TCC (SCC-CV-TCC), SCC and TCC (SCC-TCC) may appear, as depicted in Figure 2B. This could be caused by the degradation or failure of battery as well as the fault of charger.
Class 3
Multiple E-bicycles or other devices are charged in turn or simultaneously, as shown in Figure 2C. From the AC side, we do not allow the multi-charging because it may exceed the maximum allowed charging power. Charging multiple E-bicycles or other devices in the sequential charging order through external wires and sockets may result in overheating or other unsafe events. In this case, the charging modes, such as several different CC (subfigures (1) and (2)), CC-CV and another CC (subfigures (3), (4) and (5)), and multiple different CC-CV modes (subfigures (6) to (9)) may appear. The modes that multiple E-bicycles are charged simultaneously involve the combination of CC (CC1) and CC-CV (CC2-CV2) (as shown in subfigures (10) and (11)), CC1-CC2-CV2-CC1-CV1 (subfigures (12) and (13)), and CC1-CC2-CV2-CC1 (subfigures (14) and (15)).
Class 4
Intermediate charging current of less than 0.6 A, as shown in Figure 2D. Too high ambient temperature may trigger the protection of charger, and loose contacts will interrupt the charging. When the current difference before and after temperature control is less than 0.3 A, the same E-bicycle charging will be considered. The interruption of charging will induce that less expected power is charged to battery, and charging at higher external temperature will be prone to thermal runaway and accelerate the deterioration of battery.
Classes 5 to 9
Normal charging process, including CC-CV-TCC charge (Class 5, Figure 3A), CC charge (Class 6, Figure 3B), CC-CV charge (Class 7, Figure 3C), TCC-CC, TCC-CC-CV and TCC-CC-CV-TCC charge (Class 8, Figure 3D), as well as pulse charge (Class 9, Figure 3E). Generally, these charging manners are designed to satisfy the charging requirements of various E-bicycles according to the statistical analysis. As can be found, most of normal scenarios include CC modes.
Figure 3.
Normal charging process
(A) Class 5, CC-CV-TCC represents a typical lead-acid battery charging mode.
(B) Class 6 only contains the CC mode.
(C) Class 7, CC-CV describes a classical lithium-ion battery charging mode.
(D) Class 8. A TCC charging mode emerges before the normal charging modes CC, CC-CV and CC-CV-TCC, and is usually employed to preheat the battery.
(E) Class 9 demonstrates various pulse charging models with different duty cycles and pulse amplitudes.
Recognition result
In this article, the built CNN-LSTM model, constituted with 1-dimensional convolutional neural network (1D-CNN),23 long-short term memory network (LSTM)24 and one full connection (FC) layer with the Softmax function,26 is employed to achieve the recognition of these normal and abnormal charging scenarios. To avoid the disappearance of back-propagation gradient caused by excessive CNN layers and the difficulty of obtaining features with long duration because of the limited CNN layers, the 1D-CNN stacks 3 pooling layers to capture various features with different durations in the current sequence. Meanwhile, the diversity of features also requires a certain number of convolution kernels for detection. Therefore, the number of CNN kernels in each layer is respectively set to 16, 32, 48 and 64 to prevent redundancy of kernels and determine the optimal number of kernels and training iterations. Then, the LSTM and FC layer further discover the dependencies of features and conduct classification, and the training procedure is demonstrated in Figure 4. During model training, the losses of objective functions of CNN-LSTMs with different kernels continue to decrease with the increase of iteration, and the classification accuracies increase steadily. However, in the validation set, the loss function undergoes the convergence and the consequent rising, which correlate with the procedure of CNN-LSTM from under-fitting to stability and following over-fitting. During this period, the loss during the validation fluctuates more obviously than that during training, and then it gradually reduces to a steady range. Based on the analysis of the convergent loss and accuracy on the validation set, the optimal iterations can be determined, that is, 70, 50, 40 and 40 correspond to 16, 32, 48 and 64 CNN kernels, respectively.
Figure 4.
The training and validation process with 16, 32, 48 and 64 kernels under 100 iterations
(A–D) The loss and accuracy of training and validation with different kernels are described. The X-axis and Y-axis represent the number of iterations and loss/accuracy, respectively, wherein the accuracy ranges from 0 and 1. The blue solid line and the orange dashed line denote the loss and accuracy of the training dataset, the red and green dashed lines correspond to the loss and accuracy on the test dataset, and the light red and light green parts are related to the fluctuation range of the loss and accuracy. The losses of CNN-LSTMs with 16, 32, 48, and 64 convolution kernels during training continue to decline and the accuracies gradually increase. However during validation, the loss initially decreases with fluctuation to a certain threshold, and then it starts to converge to a stable range and increases again. Meanwhile, the precision increases to a steady value. Once the loss on the validation dataset converges steadily, redundant training will contribute less to the accuracy promotion and may cause over-fitting. Finally, 70, 50, 40 and 40 are selected as the optimal iterations for CNN-LSTM with 16, 32, 48 and 64 kernels.
The identification of features and feature dependencies is shown in Figure 5A. For the input current sequence, the stacked CNN layer firstly extracts the features with different lengths, and then LSTM further recognizes the dependency among features. For instance, when the CNN recognizes the characteristics of CV and CRC, the LSTM further identifies their dependency relationships, and the Softmax function determines the sequence with CV-CRC characteristics as Class 1 with higher probability. Based on the optimal iterations, the recognition performances with different kernels on the test set are depicted in Figure 5B, where the precision, recall and F1-score denote the recognition precision, coverage and harmonic mean value. It can be seen the average precisions (recalls) of CNN-LSTMs with 16, 32, 48 and 64 kernels are 0.80 (0.81), 0.82 (0.83), 0.83 (0.82) and 0.86 (0.85), respectively, and the F1-scores reach 0.80, 0.82, 0.82 and 0.85. Overall, the losses of CNN-LSTMs with different kernels highlight convergence on the validation set, and the recognition performances of various classes are relatively stable and balanced on the test dataset. The results indicate that even though the number of convolution kernels is different, the proposed CNN-LSTM can still automatically acquire and identify various features in the current sequence, and evaluate the dependencies between features. In addition, it is critical to address the classification of the current sequences when various uncertain features emerge. Furthermore, more kernels contribute to more data feature acquisition and more subtle changes and dependencies between features, thus promoting better performance with less training iterations. Through sufficient comparisons between identification precision and computation intensity, the CNN-LSTM with 64 kernels achieves the optimal performance and a preferable trade-off on recall and precision on most of categories, except Classes 4 and 8. This superior performance in average recognition accuracy of over 80% is mainly raised by the stacked CNN-pooling layers, which enable the tailored CNN-LSTM to capture the inherent relationships with short and far distances and extract them into features. The acquisition of such features and feature dependencies avoids the labor intensity and inaccurate manual definition, and the exploitation of LSTM further discovers the dependencies among features, which are all conducive to the accurate classification of the FC layer.
Figure 5.
Feature identification and their dependencies of different classes, Precision, Recall, F1-score, and confusion matrixes on test dataset with 16, 32, 48 and 64 CNN kernels and other optimal parameters
(A) Feature identification and their dependencies of different classes.
(B) The precision, recall and F1-score. The X-axes describe Classes 1 to 9 and Y-axes correspond to their detection Precision, Recall and F1-score, which are in the range of 0 to 1. CNN-LSTMs with 16, 32, 48 and 64 CNN kernels are depicted with green, blue, lavender and orange-yellow bars, respectively.
(C) The confusion matrixes with 16, 32, 48 and 64 CNN kernels on each convolution layer. The X-axis and Y-axis of each confusion matrix describe the real classes and the detection results of CNN-LSTM, and the diagonal elements are true positives.
To observe the misidentification, the confusion matrixes of CNN-LSTMs with different parameters are constructed, as shown Figure 5C. We can find that the CNN-LSTM under different parameters achieve outstanding performances. However, it is prone to misclassification of Classes 4 and 3, whereas Class 8 may be mistakenly classified into Classes 3 and 4, especially when the number of kernels is lower than 48. Meanwhile, because Classes 5 and 6 involve CC-CV-TCC and CC modes, and when the charging time of TCC, CC-TCC, or CV is short, Classes 5 and 6 may be mistakenly classified into Classes 7 and 8 in the case of 48 kernels. By referring to definitions and the descriptions of Classes 4 and 3 in Figure 5A, if the current values before and after temperature control (Class 4) are different, Class 4 may be misrecognized into multiple charging processes (Class 3). Moreover, when the concave shape of Class 1 is not obvious, the features of CC-CRC may be considered as normal CC charge (Class 6) or CC-CV charge operation (Class 5). Instead, if the concave shape is obvious, this process may be considered as two charge processes (Class 3). Similarly, Class 8 contains a TCC stage with the current of less than 0.6 A, which is prone to be mistakenly classified as Classes 3 and 4. Despite the listed possible false identifications, CNN-LSTM still performances well, especially when identifying abnormal charging operations.
Discussion
Based on the proposed machine learning algorithm, efficient diagnosis of abnormal charging operations of E-bicycles can be efficiently attained. Through in-depth analyzing the current profiles of more than 180k charging records, four abnormal charging patterns and five normal patterns are clearly defined. Based on only the input of charge current, a well-designed machine learning algorithm with the incorporation of multiple neural networks is implemented to effectively identify the abnormal charging operations. In the proposed framework, a 1D-CNN with 4 layers, a LSTM and a FC layer are stacked together to attain the recognition of classes. Because the number of convolution kernels and stack depth are strongly correlated with the features in the charging data, the more complex features and dependences, the more convolution kernels and deeper stacks are required. In the case of uncertain characteristics and dependences, we gradually increase the number of convolution kernels to observe the performance of the model. In terms of convolution and pooling layers, the LSTM and one full connection layer is stacked to generate the detection model, and the precision, recall and F1-score are applied to evaluate the recognition performance. The proposed method enables preferable charge fault identification with the average accuracy of 85%. Through this innovative manner, some hidden hazardous charging faults can be diagnosed in time. Compared with our similar study results based on the longest similar substring and dynamic time warping model,27 the model is more robust and does not need to manually define charge abnormal features. In particular, the designed method does not entail the detailed state of battery from the DC measure, resulting in easy online implementation potential. In addition, the proposed manner does not need to extract some characteristic features, thereby simplifying the application complexity. Thanks to these obvious merits, the method can be easily extended to the similar application scenarios, such as four-wheeled EVs and energy storage systems of power grid.
Conclusion
In this study, a non-invasive active diagnosis strategy to supervise the charge safety of E-bicycles is developed based on machine learning technologies. By means of analyzing the 181,282 charging records acquired from the AC side, and their inherent informative features are in-depth addressed. Because of the characteristics of uncertain features and unequal lengths of the current data, an update-to-date machine learning algorithm based on CNN-LSTM is introduced to automatically capture these features and quantify their dependencies. All of these functionalities avoid the problems of manually selecting features and the weights as well as aligning features. This non-invasive detection scheme can be simply deployed on cloud monitor center, effectively diagnose the charging fault with the accuracy of 85%, and ensure the charging safety of more than 20 million E-bicycles after substantial validations. These IOT based effective supervision can efficiently mitigate the concern of charging safety and promote the prevalence of E-bicycles. In addition, it enables incremental training in the cloud server, and facilitates the deployment on the charging piles through transfer learning without complementing extra hardware on the existing batteries, circuits and chargers. In the premise of sufficient data, the autonomous learning and fault diagnosis capability in CNN-LSTM can be easily applied in charging protection of four-wheeled EVs and energy storage systems of power grid.
Limitations of the study
Even though the proposed scheme showcases many advantages, some limitations are indispensable to be brought: (1) Limited accuracy, even it is relatively high (0.85), can be achieved based on the algorithm. Because of the limited information and a mass of uncertainties, it is difficult to reach higher identification efficiency without the support of the DC side input. With more input from the direct measure of batteries, the proposed method can further contribute to fault diagnosis and prognostics during the charge operation. (2) The calculation expense is relatively high for the embedded terminal with limited computation and storage resources (charging pile). The algorithm needs to be installed on the cloud monitoring center. For each pile undergoing the charge operation, the algorithm will be executed for one time. When we monitor the charging process for more than 20 million E-bicycles, some unnecessary calculation will be resulted. (3) Because the state and temperature of the battery cannot be collected, some unsafe charging scenarios cannot be fully recognized, based on only the current and voltage measure from the charging piles. For instance, the fast increase of charge voltage on the battery may not immediately lead to the current or voltage variation in the charging pile side. Hence, how to identify the immediate thermal failure in a timely manner needs to be further investigated. Indeed, those limitations are certainly the focus of our next-step research.
STAR★Methods
Key resources table
| RESOURCE | SOURCE | IDENTIFIER |
|---|---|---|
| Deposited data | ||
| GitHub repository with experimental data and code (https://github.com/KUST-traffic/Chunyan-Shuai) | This paper | https://doi.org/10.5281/zenodo.7370196 |
| Software and algorithms | ||
| Python 3.7 | Python Software Foundation | https://www.python.org/ |
| Pycharm 2019 | JetBrains | https://www.jetbrains.com/pycharm/ |
Resource availability
Lead contact
Further information and requests for resources should be directed to and will be fulfilled by the lead contact, Zheng Chen (chen@kust.edu.cn)
Materials availability
This study did not generate new materials.
Method details
Model input and output
The whole identification process is shown in Figure S1 in the supplemental information. As can be found, the current sequences are firstly normalized. Then, together with the corresponding charging mode classification results, the normalized current data are divided into small batches and inputted into the CNN-LSTM algorithm for model training and cross validation. When the training termination condition is reached, the optimal model parameters can be obtained, and the model is determined. The model output is the charge classification result numbered from 1 to 9.
Data and evaluation indicators
We analyzed 181,282 original charging records, and after initial analysis, the incredible data, such as abnormal voltage measure and current of exceeding 4 A, are eliminated. In the remaining data records, the normal charging data accounts for 84%. In order to make each category well-balanced and prevent the normaldata from drowning other types of data, we screened the data and kept 12,309 records for model training and performance validation. Since the time interval of the acquired pile data is 90 seconds and the time length of different orders is different, 12.5 hours are enough for most charging orders. On this account, we unified the length of charging current to 500 by filling in zero at the end. Meanwhile, the maximum and minimum standardization is applied in the dataset to avoid prediction accuracy incurred by different scale value, as:
| (Equation 1) |
where l represents the length of the ith current data, and is the jth current values. To evaluate the accuracy, coverage performance and their recognition, three indexes, including precision, recall and F1-score are employed evaluate the performance of the proposed model, as:
| (Equation 2) |
| (Equation 3) |
and
| (Equation 4) |
Objective function
Given the charging current time serials , feature sequence and category tag sequence (s is the number of classes), where the lengths of the current and feature sequences may be different, the first characteristic sequence X needs to be learned from the original current sequence C. The purpose of feature sequence classification is to categorize a given length sequence into a most likely specific class according to the maximum logarithmic likelihood method. The objective function is defined as:
| (Equation 5) |
where , is the length of the feature sequence, is the number of the train dataset, and is the set of super-parameters for the model learned from the data.
Overall structure of detection
With the objective function (5), the overall structure of detection based on CNN-LSTM is established, as described in Figure S2A in the supplemental information. The filtered and cleaned current sequence is input into the CNN-LSTM to make diagnosis, and the algorithm contains three 1D convolution and max pooling layers, two LSTMs and one full connection layer with the “Softmax” and “Cross-Entropy” loss function.26 The stacked three convolution-pooling layers with multiple kernels gradually obtain inherent temporal features of the current sequence, and then the two LSTMs further capture such feature associations with different time tags. Finally, the outputs of the last LSTM are identified in the full connection layer with the “Softmax” function to achieve multiple classification. Figures S2B and S2C in the supplemental information describe the 1D convolution and max-pooling operation and the structures of LSTM in detail.
One dimensional convolution and pooling
Thanks to its strong ability in capturing the spatial correlation between natural language semantics and image pixels, CNN has been successfully applied to natural language processing and image recognition.28,29 In the 1D time series, the temporal relation of data before and after processing is equivalent to the spatial relation. In order to efficiently capture numerous unknown abstract features of the charging current, the 1D-CNN30 is employed, which contains 3 convolution layers and each layer has multiple kernels. Given a convolution kernel , for , the 1D-CNN can be formulated, as:
| (Equation 6) |
where denotes the bias vector, and is the activation function, which is usually a rectified linear unit (ReLU) or parameter ReLU. denotes the dot product of the corresponding positions of and , and can be formulated as . For the convolution kernel of the layer with and , the output of the convolution operation equals
| (Equation 7) |
where is the output of the previous layer. After the convolution layer, a pooling layer is implemented to reduce the dimension of output and obtain more abstract features. In the proposed method, the maximum pooling scheme with four steps is applied on the output of convolution layer,31 as:
| (Equation 8) |
In addition, three convolution pooling layers are stacked to capture more abstract features and their dependencies.
LSTM
To avoid gradient disappearance or gradient explosion caused by excessive convolution pooling layers, LSTM is stacked after the last convolution pooling layer to obtain the linear and nonlinear dependency relationships between features.24,32,33 LSTM learns long- and short-term dependent relationships of the data by recurrent structure and multiply gates, involving input gate (in), output gate (o), forget gate (f), memory unit (h) and state gate (c). For the input xt, the outputs of all gates and units are expressed as:
| (Equation 9) |
where is sigmoid function, and , are the weight and bias of the corresponding gate or unit, and and are the output of the memory unit and state gate of . Considering LSTM exists the inaccessible problem of the long-term lags,34 two LSTMs are stacked to capture the dependencies with long terms.
Full connection layer
A full connection layer with “Softmax” and “Cross-entropy” loss function is added to the last LSTM to achieve multiple classification.26 During model training, back propagation and batch gradient descent algorithm are adopted to update the weights of CNN, LSTM and the full connection layer, and the optimal parameters are obtained through multiple iterations, as:
| (Equation 10) |
Framework and training process
In the proposed 1D-CNN with 4 layers, LSTM and a full connection layer are stacked to attain the recognition of classes. Since the number of convolution kernels and stack depth are strongly correlated with the features in the charging current data, the more complex features and dependences, the more convolution kernels and deeper stacks are required. In the case of uncertain characteristics and dependences, we gradually increase the number of convolution kernels to observe the performance of the model. In terms of convolution and pooling layers, an LSTM and a full connection layer are stacked to form the detection model, and the precision, recall and F1-score are applied to evaluate the recognition performance.
Acknowledgments
This work was supported by the National Natural Science Foundation of China (No. 52267022). In addition, the authors would like to thank the support from Shenzhen Mamotor LLC. for data availability and algorithm validation.
Author contributions
Conceptualization, C.S. and Z.C.; Methodology, C.S. and F. Y.; Investigation, F.Y., W.W., J.S., and X.O.; Writing – Original Draft, C.S. and Z.C.; Resources, C.S. and Z.C.; Supervision, Z. C. and X. O.
Declaration of interests
The authors declare no competing interests.
Published: January 20, 2023
Footnotes
Supplemental information can be found online at https://doi.org/10.1016/j.isci.2022.105786.
Contributor Information
Zheng Chen, Email: chen@kust.edu.cn.
Xin Ouyang, Email: oyx@kust.edu.cn.
Supplemental information
Data and code availability
-
•
The experimental data (charging current data) have been deposited on our GitHub repository (https://github.com/KUST-traffic/Chunyan-Shuai) and are publicly available.
-
•
All original code has been deposited on our GitHub repository (https://github.com/KUST-traffic/Chunyan-Shuai) and is publicly available as of the date of publication. DOIs are listed in the key resources table.
-
•
Any additional information required to reanalyze the data reported in this work paper is available from the lead contact upon request.
References
- 1.Jadhav A., Mutreja S. 2021. Electric Bike Market.https://www.alliedmarketresearch.com/electric-bikes-market [Google Scholar]
- 2.Zuev D., Tyfield D., Urry J. Where is the politics? E-bike mobility in urban China and civilizational government. Environ. Innov. Soc. Transit. 2019;30:19–32. [Google Scholar]
- 3.Xu Q. GB 17761-2018 Safety technical specifications for electric bicycles. China quality and technical supervision. 2019;364:63–65. [Google Scholar]
- 4.Fleming S. World Economic Forum; 2021. Electric Bike Sales Grew by 145% in the US Last Year - Here’s Why that Matters.https://www.weforum.org/agenda/2021/03/electric-bicycles-sales-growth/ [Google Scholar]
- 5.Liu L.P. Ministry of Emergency Management of the People's Republic of China. Since the beginning of this year, more than 10,000 electric bicycle fires have occurred nationwide and caused casualties. 2021. https://www.mem.gov.cn/xw/xwfbh/20211y08rxwfbh_4309/mtbd_4262/202111/t20211108_402293.shtml
- 6.Carkhuff B.G., Demirev P.A., Srinivasan R. Impedance-based battery management system for safety monitoring of lithium-ion batteries. IEEE Trans. Ind. Electron. 2018;65:6497–6504. doi: 10.1109/TIE.2017.2786199. [DOI] [Google Scholar]
- 7.Salmeron-Manzano E., Manzano-Agugliaro F. The electric bicycle: worldwide research trends. Energies. 2018;11:1894. doi: 10.3390/En11071894. [DOI] [Google Scholar]
- 8.Hung N.B., Lim O. A review of history, development, design and research of electric bicycles. Appl. Energy. 2020;260:114323. doi: 10.1016/j.apenergy.2019.114323. [DOI] [Google Scholar]
- 9.Song C., Shao Y., Song S., Peng S., Xiao F. A novel electric bicycle battery monitoring system based on android client. J. Eng. 2017;2017:1–11. doi: 10.1155/2017/2579084. [DOI] [Google Scholar]
- 10.Guo Y., Tang S., Meng G., Yang S. Failure modes of valve-regulated lead-acid batteries for electric bicycle applications in deep discharge. J. Power Sources. 2009;191:127–133. doi: 10.1016/j.jpowsour.2008.08.059. [DOI] [Google Scholar]
- 11.Culpin B. Thermal runaway in valve-regulated lead-acid cells and the effect of separator structure. J. Power Sources. 2004;133:79–86. doi: 10.1016/j.jpowsour.2003.09.078. [DOI] [Google Scholar]
- 12.Ball R.J., Kurian R., Evans R., Stevens R. Failure mechanisms in valve regulated lead/acid batteries for cyclic applications. J. Power Sources. 2002;109:189–202. doi: 10.1016/S0378-7753(02)00071-X. [DOI] [Google Scholar]
- 13.Lu L., Han X., Li J., Hua J., Ouyang M. A review on the key issues for lithium-ion battery management in electric vehicles. J. Power Sources. 2013;226:272–288. doi: 10.1016/j.jpowsour.2012.10.060. [DOI] [Google Scholar]
- 14.Wang Q., Mao B., Stoliarov S.I., Sun J. A review of lithium ion battery failure mechanisms and fire prevention strategies. Prog. Energy Combust. Sci. 2019;73:95–131. doi: 10.1016/j.jpowsour.2012.10.060. [DOI] [Google Scholar]
- 15.Dong-mei M., Cheng X.-Q., Chang-liang S.U.N., Chang-bo W. Effects of overcharging on safety performance of Li-ion battery for electric bicycle. Battery. 2009;39:77–79. doi: 10.1002/smr.397. [DOI] [Google Scholar]
- 16.Feng X., Ouyang M., Liu X., Lu L., Xia Y., He X. Thermal runaway mechanism of lithium ion battery for electric vehicles: a review. Energy Storage Mater. 2018;10:246–267. doi: 10.1016/j.ensm.2017.05.013. [DOI] [Google Scholar]
- 17.Tran M.K., Fowler M. A review of lithium-ion battery fault diagnostic algorithms: current progress and future challenges. Algorithms. 2020;13:62. doi: 10.3390/a13030062. [DOI] [Google Scholar]
- 18.Joseph P.K., Elangovan D., Arunkumar G. Linear control of wireless charging for electric bicycles. Appl. Energy. 2019;255:113898. doi: 10.1016/j.apenergy.2019.113898. [DOI] [Google Scholar]
- 19.Mai R., Chen Y., Li Y., Zhang Y., Cao G., He Z. Inductive power transfer for massive electric bicycles charging based on hybrid topology switching with a single inverter. IEEE Trans. Power Electron. 2017;32:5897–5906. doi: 10.1109/TPEL.2017.2654360. [DOI] [Google Scholar]
- 20.Ke W., Zhang N. 1–2. 2007. Charging models & the performance of battery packs for electric bicycles; p. 106. (2007 Australasian Universities Power Engineering). [Google Scholar]
- 21.Weixiang S., Thanh Tu V., Kapoor A. 2012. Charging algorithms of lithium-ion batteries: an overview; pp. 1567–1572. [DOI] [Google Scholar]
- 22.Liu Z., Lin T. The charging mode of extending the life of electric bicycle battery. Battery. 2005;35:285–287. [Google Scholar]
- 23.Xu Y., Cheng J., Wang L., Xia H., Liu F., Tao D. Ensemble one-dimensional convolution neural networks for skeleton-based action recognition. IEEE Signal Process. Lett. 2018;25:1044–1048. doi: 10.1109/LSP.2018.2841649. [DOI] [Google Scholar]
- 24.Palangi H., Deng L., Shen Y., Gao J., He X., Chen J., Song X., Ward R. Deep sentence embedding using long short-term memory networks: analysis and application to information retrieval. IEEE/ACM Trans. Audio Speech Lang. Process. 2016;24:694–707. doi: 10.1109/taslp.2016.2520371. [DOI] [Google Scholar]
- 25.Li Y., Li K., Xie Y., Liu J., Fu C., Liu B. Optimized charging of lithium-ion battery for electric vehicles: adaptive multistage constant current–constant voltage charging strategy. Renew. Energy. 2020;146:2688–2699. doi: 10.1016/j.renene.2019.08.077. [DOI] [Google Scholar]
- 26.Li X., Wang W. Learning discriminative features via weights-biased Softmax loss. Pattern Recogn. 2020;107:107405. doi: 10.1016/J.PATCOG.2020.107405. [DOI] [Google Scholar]
- 27.Shuai C., Sun Y., Zhang X., Yang F., Ouyang X., Chen Z. Intelligent diagnosis of abnormal charging for electric bicycles based on improved dynamic time warping. IEEE Trans. Ind. Electron. 2022;1:1–10. doi: 10.1109/TIE.2022.3206702. [DOI] [Google Scholar]
- 28.Simonyan K., Zisserman A. Very deep convolutional networks for large-scale image recognition. Comput. Sci. 2014 doi: 10.48550/arXiv.1409.1556. [DOI] [Google Scholar]
- 29.Hu B., Lu Z., Li H., Chen Q. Convolutional neural network architectures for matching natural language sentences. arXiv. 2015 doi: 10.48550/arXiv.1503.03244. Preprint at. Computation and Language. [DOI] [Google Scholar]
- 30.Izzuddin T.A., Safri N.M., Othman M.A. Mental imagery classification using 1-dimensional convolutional neural network for target selection in single channel BCI controlled mobile robot. Neural Comput. Applic. 2021;33:6233–6246. doi: 10.1007/s00521-020-05393-6. [DOI] [Google Scholar]
- 31.Zheng Y., Iwana B.K., Malik M.I., Ahmed S., Ohyama W., Uchida S. Learning the micro deformations by max-pooling for offline signature verification. Pattern Recogn. 2021;118:108008. doi: 10.1016/j.patcog.2021.108008. [DOI] [Google Scholar]
- 32.Greff K., Srivastava R.K., Koutnik J., Steunebrink B.R., Schmidhuber J. LSTM: a search space odyssey. IEEE Transact. Neural Networks Learn. Syst. 2017;28:2222–2232. doi: 10.1109/TNNLS.2016.2582924. [DOI] [PubMed] [Google Scholar]
- 33.Ma L., Hu C., Cheng F. State of charge and state of energy estimation for lithium-ion batteries based on a long short-term memory neural network. J. Energy Storage. 2021;37:102440. doi: 10.1016/j.est.2021.102440. [DOI] [Google Scholar]
- 34.Zhou P., Shi W., Tian J., Qi Z., Li B., Hao H., Xu B. Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers) Association for Computational Linguistics; 2016. Attention-based bidirectional long short-term memory networks for relation classification; pp. 207–212. [DOI] [Google Scholar]
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.
Supplementary Materials
Data Availability Statement
-
•
The experimental data (charging current data) have been deposited on our GitHub repository (https://github.com/KUST-traffic/Chunyan-Shuai) and are publicly available.
-
•
All original code has been deposited on our GitHub repository (https://github.com/KUST-traffic/Chunyan-Shuai) and is publicly available as of the date of publication. DOIs are listed in the key resources table.
-
•
Any additional information required to reanalyze the data reported in this work paper is available from the lead contact upon request.





