Models Keras¶
Here the different deep learning models included in the library are summarised. All of them are developed in Keras.
|
CNN+LSTM model for Arrythmia classification. |
CNN+GRU model for electricity forecasting |
|
CNN+LSTM network for arrythmia detection. |
|
|
Basic LSTM Autoencoder, where the encoded features were introduced in an SVM. |
|
References |
|
CNN+LSTM model for arrythmia classification. |
|
|
|
|
|
|
|
|
CNN model, employed for 2-D images of ECG data. This model is adapted for 1-D time series |
|
|
CNN+LSTM model |
|
LSTM network |
CNN+LSTM model employed for 2-D images of ECG data. This model is adapted for 1-D time series. |
|
CNN+LSTM |
|
CAE-LSTM |
|
DDNN network presented in: |
|
|
CNN ensemble model. |
Hybrid CNN+Bidirectional RNN |
|
|
A CNN+Bi-Directional GRU with a spatio-temporal attention mechanism. |
|
Attention-based time-incremental convolutional neural network (ATI-CNN) |
|
CNN using RTA blocks for end-to-end attrial fibrilation detection. |
|
A 1-layer CNN + LSTM model. |
|
Convolutional neural network model for emotion classification using a non-end-to-end training method that combines bottom-, middle-, and top-layer convolution features. |
- TSFEDL.models_keras.OhShuLih(include_top=True, weights=None, input_tensor=None, input_shape=None, classes=5, classifier_activation='softmax')[source]¶
CNN+LSTM model for Arrythmia classification.
- Parameters:
include_top (bool, default=True) – Whether to include the fully-connected layer at the top of the network.
weights (str, default=None) – The path to the weights file to be loaded.
input_tensor (keras.Tensor, defaults=None) – Optional Keras tensor (i.e. output of layers.Input()) to use as input for the model.
input_shape (Tuple, defaults=None) – If input_tensor=None, a tuple that defines the input shape for the model.
classes (int, defaults=5) – If include_top=True, the number of units in the top layer to classify data.
classifier_activation (str or callable, defaults='softmax') – The activation function to use on the “top” layer. Ignored unless include_top=True. Set classifier_activation=None to return the logits of the “top” layer.
- Returns:
A keras.Model instance.
- Return type:
keras.Model
References
Oh, Shu Lih, et al. “Automated diagnosis of arrhythmia using combination of CNN and LSTM techniques with variable length heart beats.” Computers in biology and medicine 102 (2018): 278-287.
- TSFEDL.models_keras.KhanZulfiqar(include_top=True, weights=None, input_tensor=None, input_shape=None, gru_units=(100, 50), return_sequences=False, classes=5, classifier_activation='softmax')[source]¶
CNN+GRU model for electricity forecasting
- Parameters:
include_top (bool, default=True) – Whether to include the fully-connected layer at the top of the network.
weights (str, default=None) – The path to the weights file to be loaded.
input_tensor (keras.Tensor, defaults=None) – Optional Keras tensor (i.e. output of layers.Input()) to use as input for the model.
input_shape (Tuple, defaults=None) – If input_tensor=None, a tuple that defines the input shape for the model.
gru_units (Tuple of length=2, defaults=(100, 50)) – The number of units within the 2 GRU layers.
return_sequences (bool, defaults=False) – If True, the last GRU layer and Top layer if include_top=True returns the whole sequence instead of the last value.
classes (int, defaults=5) – If include_top=True, the number of units in the top layer to classify data.
classifier_activation (str or callable, defaults='softmax') – The activation function to use on the “top” layer. Ignored unless include_top=True. Set classifier_activation=None to return the logits of the “top” layer.
- Returns:
model – A keras.Model instance with the Full CNN-LSTM Autoencoder
- Return type:
keras.Model
References
Sajjad, M., Khan, Z. A., Ullah, A., Hussain, T., Ullah, W., Lee, M. Y., & Baik, S. W. (2020). A novel CNN-GRU-based hybrid approach for short-term residential load forecasting. IEEE Access, 8, 143759-143768.
- TSFEDL.models_keras.ZhengZhenyu(include_top=True, weights=None, input_tensor=None, input_shape=None, classes=5, classifier_activation='softmax')[source]¶
CNN+LSTM network for arrythmia detection. This model initialy was designed to deal with 2D images. It was adapted to 1D time series.
- Parameters:
include_top (bool, default=True) – Whether to include the fully-connected layer at the top of the network.
weights (str, default=None) – The path to the weights file to be loaded.
input_tensor (keras.Tensor, defaults=None) – Optional Keras tensor (i.e. output of layers.Input()) to use as input for the model.
input_shape (Tuple, defaults=None) – If input_tensor=None, a tuple that defines the input shape for the model.
classes (int, defaults=5) – If include_top=True, the number of units in the top layer to classify data.
classifier_activation (str or callable, defaults='softmax') – The activation function to use on the “top” layer. Ignored unless include_top=True. Set classifier_activation=None to return the logits of the “top” layer.
- Returns:
model – A keras.Model instance.
- Return type:
keras.Model
References
Zheng, Z., Chen, Z., Hu, F., Zhu, J., Tang, Q., & Liang, Y. (2020). An automatic diagnosis of arrhythmias using a combination of CNN and LSTM technology. Electronics, 9(1), 121.
- TSFEDL.models_keras.HouBoroui(weights=None, input_tensor=None, input_shape=None, encoder_units=100)[source]¶
Basic LSTM Autoencoder, where the encoded features were introduced in an SVM.
- Parameters:
weights (str, default=None) – The path to the weights file to be loaded.
input_tensor (keras.Tensor, defaults=None) – Optional Keras tensor (i.e. output of layers.Input()) to use as input for the model.
input_shape (Tuple, defaults=None) – If input_tensor=None, a tuple that defines the input shape for the model.
encoder_units (int, defaults=100) – The number of encoding features.
- Returns:
autoencoder (keras.Model) – A keras.Model instance representing the full autoencoder.
encoder (keras.Model) – A keras.Model instance that representes the encoder.
References
Hou, Borui, et al. “LSTM based auto-encoder model for ECG arrhythmias classification.” IEEE Transactions on Instrumentation and Measurement (2019).
- TSFEDL.models_keras.WangKejun(include_top=True, weights=None, input_tensor=None, input_shape=None, classes=5, classifier_activation='softmax')[source]¶
References
Wang, Kejun, Xiaoxia Qi, and Hongda Liu. “Photovoltaic power forecasting based LSTM-Convolutional Network.” Energy 189 (2019): 116225.
- Parameters:
include_top (bool, default=True) – Whether to include the fully-connected layer at the top of the network.
weights (str, default=None) – The path to the weights file to be loaded.
input_tensor (keras.Tensor, defaults=None) – Optional Keras tensor (i.e. output of layers.Input()) to use as input for the model.
input_shape (Tuple, defaults=None) – If input_tensor=None, a tuple that defines the input shape for the model.
classes (int, defaults=5) – If include_top=True, the number of units in the top layer to classify data.
classifier_activation (str or callable, defaults='softmax') – The activation function to use on the “top” layer. Ignored unless include_top=True. Set classifier_activation=None to return the logits of the “top” layer.
- Returns:
model – A keras.Model instance.
- Return type:
keras.Model
- TSFEDL.models_keras.ChenChen(include_top=True, weights=None, input_tensor=None, input_shape=None, classes=5, classifier_activation='softmax')[source]¶
CNN+LSTM model for arrythmia classification.
- Parameters:
include_top (bool, default=True) – Whether to include the fully-connected layer at the top of the network.
weights (str, default=None) – The path to the weights file to be loaded.
input_tensor (keras.Tensor, defaults=None) – Optional Keras tensor (i.e. output of layers.Input()) to use as input for the model.
input_shape (Tuple, defaults=None) – If input_tensor=None, a tuple that defines the input shape for the model.
classes (int, defaults=5) – If include_top=True, the number of units in the top layer to classify data.
classifier_activation (str or callable, defaults='softmax') – The activation function to use on the “top” layer. Ignored unless include_top=True. Set classifier_activation=None to return the logits of the “top” layer.
- Returns:
model – A keras.Model instance.
- Return type:
keras.Model
References
Chen, Chen, et al. “Automated arrhythmia classification based on a combination network of CNN and LSTM.” Biomedical Signal Processing and Control 57 (2020): 101819.
- TSFEDL.models_keras.KimTaeYoung(include_top=True, weights=None, input_tensor=None, input_shape=None, classes=5, classifier_activation='softmax')[source]¶
- Parameters:
include_top (bool, default=True) – Whether to include the fully-connected layer at the top of the network.
weights (str, default=None) – The path to the weights file to be loaded.
input_tensor (keras.Tensor, defaults=None) – Optional Keras tensor (i.e. output of layers.Input()) to use as input for the model.
input_shape (Tuple, defaults=None) – If input_tensor=None, a tuple that defines the input shape for the model.
classes (int, defaults=5) – If include_top=True, the number of units in the top layer to classify data.
classifier_activation (str or callable, defaults='softmax') – The activation function to use on the “top” layer. Ignored unless include_top=True. Set classifier_activation=None to return the logits of the “top” layer.
- Returns:
model – A keras.Model instance.
- Return type:
keras.Model
References
Kim, Tae-Young, and Sung-Bae Cho. “Predicting residential energy consumption using CNN-LSTM neural networks.” Energy 182 (2019): 72-81.
Notes
In the original paper, the time-series is windowed. Therefore, a TimeDistributed layer is employed before the LSTM to traverse all the generated windows. Here, we do not implement this as it is problem-specific. Please note that if you need this layer then you should add it manually.
- TSFEDL.models_keras.GenMinxing(include_top=True, weights=None, input_tensor=None, input_shape=None, classes=5, classifier_activation='softmax')[source]¶
- Parameters:
include_top (bool, default=True) – Whether to include the fully-connected layer at the top of the network.
weights (str, default=None) – The path to the weights file to be loaded.
input_tensor (keras.Tensor, defaults=None) – Optional Keras tensor (i.e. output of layers.Input()) to use as input for the model.
input_shape (Tuple, defaults=None) – If input_tensor=None, a tuple that defines the input shape for the model.
classes (int, defaults=5) – If include_top=True, the number of units in the top layer to classify data.
classifier_activation (str or callable, defaults='softmax') – The activation function to use on the “top” layer. Ignored unless include_top=True. Set classifier_activation=None to return the logits of the “top” layer.
- Returns:
model – A keras.Model instance.
- Return type:
keras.Model
References
Geng, Minxing, et al. “Epileptic Seizure Detection Based on Stockwell Transform and Bidirectional Long Short-Term Memory.” IEEE Transactions on Neural Systems and Rehabilitation Engineering 28.3 (2020): 573-580.
- TSFEDL.models_keras.FuJiangmeng(include_top=True, weights=None, input_tensor=None, input_shape=None, classes=5, classifier_activation='softmax')[source]¶
- Parameters:
include_top (bool, default=True) – Whether to include the fully-connected layer at the top of the network.
weights (str, default=None) – The path to the weights file to be loaded.
input_tensor (keras.Tensor, defaults=None) – Optional Keras tensor (i.e. output of layers.Input()) to use as input for the model.
input_shape (Tuple, defaults=None) – If input_tensor=None, a tuple that defines the input shape for the model.
classes (int, defaults=5) – If include_top=True, the number of units in the top layer to classify data.
classifier_activation (str or callable, defaults='softmax') – The activation function to use on the “top” layer. Ignored unless include_top=True. Set classifier_activation=None to return the logits of the “top” layer.
- Returns:
model – A keras.Model instance.
- Return type:
keras.Model
References
Fu, Jiangmeng, et al. “A hybrid CNN-LSTM model based actuator fault diagnosis for six-rotor UAVs.” 2019 Chinese Control And Decision Conference (CCDC). IEEE, 2019.
- TSFEDL.models_keras.ShiHaotian(include_top=True, weights=None, input_tensor=None, input_shape=None, classes=5, classifier_activation='softmax')[source]¶
- Parameters:
include_top (bool, default=True) – Whether to include the fully-connected layer at the top of the network.
weights (str, default=None) – The path to the weights file to be loaded.
input_tensor (keras.Tensor, defaults=None) – Optional Keras tensor (i.e. output of layers.Input()) to use as input for the model.
input_shape (Tuple, defaults=None) – If input_tensor=None, a tuple that defines the input shape for the model.
classes (int, defaults=5) – If include_top=True, the number of units in the top layer to classify data.
classifier_activation (str or callable, defaults='softmax') – The activation function to use on the “top” layer. Ignored unless include_top=True. Set classifier_activation=None to return the logits of the “top” layer.
- Returns:
model – A keras.Model instance.
- Return type:
keras.Model
References
Shi, Haotian, et al. “Automated heartbeat classification based on deep neural network with multiple input layers.” Knowledge-Based Systems 188 (2020): 105036.
- TSFEDL.models_keras.HuangMeiLing(include_top=True, weights=None, input_tensor=None, input_shape=None, classes=5, classifier_activation='softmax', units_in_dense=(512, 256))[source]¶
CNN model, employed for 2-D images of ECG data. This model is adapted for 1-D time series
- Parameters:
include_top (bool, default=True) – Whether to include the fully-connected layer at the top of the network.
weights (str, default=None) – The path to the weights file to be loaded.
input_tensor (keras.Tensor, defaults=None) – Optional Keras tensor (i.e. output of layers.Input()) to use as input for the model.
input_shape (Tuple, defaults=None) – If input_tensor=None, a tuple that defines the input shape for the model.
classes (int, defaults=5) – If include_top=True, the number of units in the top layer to classify data.
classifier_activation (str or callable, defaults='softmax') – The activation function to use on the “top” layer. Ignored unless include_top=True. Set classifier_activation=None to return the logits of the “top” layer.
units_in_dense (Tuple[int, int], defaults=(512, 256)) – If include_top=True, the number of hidden units of the two dense layers before the softmax. Note: The default values are arbitrarely set. The number of units in these layers are not specified in the original paper.
- Returns:
model – A keras.Model instance.
- Return type:
keras.Model
References
Huang, Mei-Ling, and Yan-Sheng Wu. “Classification of atrial fibrillation and normal sinus rhythm based on convolutional neural network.” Biomedical Engineering Letters (2020): 1-11.
- TSFEDL.models_keras.LihOhShu(include_top=True, weights=None, input_tensor=None, input_shape=None, classes=5, classifier_activation='softmax')[source]¶
CNN+LSTM model
- Parameters:
include_top (bool, default=True) – Whether to include the fully-connected layer at the top of the network.
weights (str, default=None) – The path to the weights file to be loaded.
input_tensor (keras.Tensor, defaults=None) – Optional Keras tensor (i.e. output of layers.Input()) to use as input for the model.
input_shape (Tuple, defaults=None) – If input_tensor=None, a tuple that defines the input shape for the model.
classes (int, defaults=5) – If include_top=True, the number of units in the top layer to classify data.
classifier_activation (str or callable, defaults='softmax') – The activation function to use on the “top” layer. Ignored unless include_top=True. Set classifier_activation=None to return the logits of the “top” layer.
- Returns:
model – A keras.Model instance.
- Return type:
keras.Model
References
Lih, Oh Shu, et al. “Comprehensive electrocardiographic diagnosis based on deep learning.” Artificial Intelligence in Medicine 103 (2020): 101789.
- TSFEDL.models_keras.GaoJunLi(include_top=True, weights=None, input_tensor=None, input_shape=None, classes=5, classifier_activation='softmax')[source]¶
LSTM network
- Parameters:
include_top (bool, default=True) – Whether to include the fully-connected layer at the top of the network.
weights (str, default=None) – The path to the weights file to be loaded.
input_tensor (keras.Tensor, defaults=None) – Optional Keras tensor (i.e. output of layers.Input()) to use as input for the model.
input_shape (Tuple, defaults=None) – If input_tensor=None, a tuple that defines the input shape for the model.
classes (int, defaults=5) – If include_top=True, the number of units in the top layer to classify data.
classifier_activation (str or callable, defaults='softmax') – The activation function to use on the “top” layer. Ignored unless include_top=True. Set classifier_activation=None to return the logits of the “top” layer.
- Returns:
model – A keras.Model instance.
- Return type:
keras.Model
References
Gao, Junli, et al. “An Effective LSTM Recurrent Network to Detect Arrhythmia on Imbalanced ECG Dataset.” Journal of healthcare engineering 2019 (2019).
- TSFEDL.models_keras.WeiXiaoyan(include_top=True, weights=None, input_tensor=None, input_shape=None, classes=5, classifier_activation='softmax')[source]¶
CNN+LSTM model employed for 2-D images of ECG data. This model is adapted for 1-D time series.
- Parameters:
include_top (bool, default=True) – Whether to include the fully-connected layer at the top of the network.
weights (str, default=None) – The path to the weights file to be loaded.
input_tensor (keras.Tensor, defaults=None) – Optional Keras tensor (i.e. output of layers.Input()) to use as input for the model.
input_shape (Tuple, defaults=None) – If input_tensor=None, a tuple that defines the input shape for the model.
classes (int, defaults=5) – If include_top=True, the number of units in the top layer to classify data.
classifier_activation (str or callable, defaults='softmax') – The activation function to use on the “top” layer. Ignored unless include_top=True. Set classifier_activation=None to return the logits of the “top” layer.
- Returns:
model – A keras.Model instance.
- Return type:
keras.Model
References
Wei, Xiaoyan, et al. “Early prediction of epileptic seizures using a long-term recurrent convolutional network.” Journal of neuroscience methods 327 (2019): 108395.
- TSFEDL.models_keras.KongZhengmin(include_top=True, weights=None, input_tensor=None, input_shape=None, classes=5, classifier_activation='softmax', return_sequences=False)[source]¶
CNN+LSTM
- Parameters:
include_top (bool, default=True) – Whether to include the fully-connected layer at the top of the network.
weights (str, default=None) – The path to the weights file to be loaded.
input_tensor (keras.Tensor, defaults=None) – Optional Keras tensor (i.e. output of layers.Input()) to use as input for the model.
input_shape (Tuple, defaults=None) – If input_tensor=None, a tuple that defines the input shape for the model.
classes (int, defaults=5) – If include_top=True, the number of units in the top layer to classify data.
classifier_activation (str or callable, defaults='softmax') – The activation function to use on the “top” layer. Ignored unless include_top=True. Set classifier_activation=None to return the logits of the “top” layer.
return_sequences (bool, defaults=False) – If True, the last LSTM layer will return the whole sequence instead of the last value.
- Returns:
model – A keras.Model instance.
- Return type:
keras.Model
References
Kong, Zhengmin, et al. “Convolution and Long Short-Term Memory Hybrid Deep Neural Networks for Remaining Useful Life Prognostics.” Applied Sciences 9.19 (2019): 4156.
- TSFEDL.models_keras.YildirimOzal(include_top=True, autoencoder_weights=None, lstm_weights=None, input_tensor=None, input_shape=None, classes=5, classifier_activation='softmax')[source]¶
CAE-LSTM
- Parameters:
include_top (bool, default=True) – Whether to include the fully-connected layer at the top of the network.
autoencoder_weights (str, default=None) – The path to the weights file to be loaded for the autoencoder network
lstm_weights (str, defaults=None) – The path to the weights file to be loaded for the lstm classifier network.
input_tensor (keras.Tensor, defaults=None) – Optional Keras tensor (i.e. output of layers.Input()) to use as input for the model.
input_shape (Tuple, defaults=None) – If input_tensor=None, a tuple that defines the input shape for the model.
classes (int, defaults=5) – If include_top=True, the number of units in the top layer to classify data.
classifier_activation (str or callable, defaults='softmax') – The activation function to use on the “top” layer. Ignored unless include_top=True. Set classifier_activation=None to return the logits of the “top” layer.
- Returns:
autoenconder (keras.Model) – A keras.Model instance with the autoencoder.
encoder (keras.Model) – A keras.Model instance with only the encoder part
model (keras.Model) – A keras.Model instance representing the classification model which uses the encoder part.
References
Yildirim, Ozal, et al. “A new approach for arrhythmia classification using deep coded features and LSTM networks.” Computer methods and programs in biomedicine 176 (2019): 121-133.
- TSFEDL.models_keras.CaiWenjuan(include_top=True, weights=None, input_tensor=None, input_shape=None, classes=5, classifier_activation='softmax', reduction_ratio=0.6)[source]¶
DDNN network presented in:
- Parameters:
include_top (bool, default=True) – Whether to include the fully-connected layer at the top of the network.
weights (str, default=None) – The path to the weights file to be loaded.
input_tensor (keras.Tensor, defaults=None) – Optional Keras tensor (i.e. output of layers.Input()) to use as input for the model.
input_shape (Tuple, defaults=None) – If input_tensor=None, a tuple that defines the input shape for the model.
classes (int, defaults=5) – If include_top=True, the number of units in the top layer to classify data.
classifier_activation (str or callable, defaults='softmax') – The activation function to use on the “top” layer. Ignored unless include_top=True. Set classifier_activation=None to return the logits of the “top” layer.
reduction_ratio (float, defaults=0.5) – The reduction ratio in the transition block.
- Returns:
A keras.Model instance.
- Return type:
keras.Model
References
Cai, Wenjuan, et al. “Accurate detection of atrial fibrillation from 12-lead ECG using deep neural network.” Computers in biology and medicine 116 (2020): 103378.
- TSFEDL.models_keras.KimMinGu(include_top=True, weights=None, input_tensor=None, input_shape=None, classes=5, classifier_activation='softmax')[source]¶
CNN ensemble model. The same model is employed n-times in an ensemble. Then, the same model is employed retraining using the features extracted in the ensemble.
- Parameters:
include_top (bool, default=True) – Whether to include the fully-connected layer at the top of the network.
weights (array(str), default=None) – An array with the paths of the weights file for each model of the ensemble.
input_tensor (keras.Tensor, defaults=None) – Optional Keras tensor (i.e. output of layers.Input()) to use as input for the model.
input_shape (Tuple, defaults=None) – If input_tensor=None, a tuple that defines the input shape for the model.
classes (int, defaults=5) – If include_top=True, the number of units in the top layer to classify data.
classifier_activation (str or callable, defaults='softmax') – The activation function to use on the “top” layer. Ignored unless include_top=True. Set classifier_activation=None to return the logits of the “top” layer.
- Returns:
ensemble – A list with six keras.Model instances. One for each model of the ensemble.
- Return type:
list[keras.Model]
References
Kim, M. G., Choi, C., & Pan, S. B. (2020). Ensemble Networks for User Recognition in Various Situations Based on Electrocardiogram. IEEE Access, 8, 36527-36535.
- TSFEDL.models_keras.HtetMyetLynn(include_top=True, weights=None, input_tensor=None, input_shape=None, classes=5, classifier_activation='softmax', use_rnn='gru', rnn_units=40)[source]¶
Hybrid CNN+Bidirectional RNN
- Parameters:
include_top (bool, default=True) – Whether to include the fully-connected layer at the top of the network.
weights (str, default=None) – The path to the weights file to be loaded.
input_tensor (keras.Tensor, defaults=None) – Optional Keras tensor (i.e. output of layers.Input()) to use as input for the model.
input_shape (Tuple, defaults=None) – If input_tensor=None, a tuple that defines the input shape for the model.
classes (int, defaults=5) – If include_top=True, the number of units in the top layer to classify data.
classifier_activation (str or callable, defaults='softmax') – The activation function to use on the “top” layer. Ignored unless include_top=True. Set classifier_activation=None to return the logits of the “top” layer.
use_rnn (str, defaults='gru') – Whether to user a Bi-direccional RNN after the CNN. Options are ‘gru’ for a GRU, ‘lstm’ for an LSTM or None to not use the RNN.
rnn_units (int, defatuls=40) – If use_rnn is not None, the number of units in the chosen biderectional RNN.
- Returns:
model – A keras.Model instance.
- Return type:
keras.Model
References
Lynn, H. M., Pan, S. B., & Kim, P. (2019). A deep bidirectional GRU network model for biometric electrocardiogram classification based on recurrent neural networks. IEEE Access, 7, 145395-145405.
- TSFEDL.models_keras.ZhangJin(include_top=True, weights=None, input_tensor=None, input_shape=None, classes=5, classifier_activation='softmax', decrease_ratio=2)[source]¶
A CNN+Bi-Directional GRU with a spatio-temporal attention mechanism.
- Parameters:
include_top (bool, default=True) – Whether to include the fully-connected layer at the top of the network.
weights (str, default=None) – The path to the weights file to be loaded.
input_tensor (keras.Tensor, defaults=None) – Optional Keras tensor (i.e. output of layers.Input()) to use as input for the model.
input_shape (Tuple, defaults=None) – If input_tensor=None, a tuple that defines the input shape for the model.
classes (int, defaults=5) – If include_top=True, the number of units in the top layer to classify data.
classifier_activation (str or callable, defaults='softmax') – The activation function to use on the “top” layer. Ignored unless include_top=True. Set classifier_activation=None to return the logits of the “top” layer.
decrease_ratio (float, defaults=2) – The decrease ratio of the model.
- Returns:
model – A keras.Model instance.
- Return type:
keras.Model
References
Zhang, J., Liu, A., Gao, M., Chen, X., Zhang, X., & Chen, X. (2020). ECG-based multi-class arrhythmia detection using spatio-temporal attention-based convolutional recurrent neural network. Artificial Intelligence in Medicine, 106, 101856.
Notes
The time dimension must be at least 1000 as there is a huge reduction on each convolutional block.
- TSFEDL.models_keras.YaoQihang(include_top=True, weights=None, input_tensor=None, input_shape=None, classes=5, classifier_activation='softmax')[source]¶
Attention-based time-incremental convolutional neural network (ATI-CNN)
- Parameters:
include_top (bool, default=True) – Whether to include the fully-connected layer at the top of the network.
weights (str, default=None) – The path to the weights file to be loaded.
input_tensor (keras.Tensor, defaults=None) – Optional Keras tensor (i.e. output of layers.Input()) to use as input for the model.
input_shape (Tuple, defaults=None) – If input_tensor=None, a tuple that defines the input shape for the model.
classes (int, defaults=5) – If include_top=True, the number of units in the top layer to classify data.
classifier_activation (str or callable, defaults='softmax') – The activation function to use on the “top” layer. Ignored unless include_top=True. Set classifier_activation=None to return the logits of the “top” layer.
- Returns:
model – A keras.Model instance.
- Return type:
keras.Model
References
Yao, Q., Wang, R., Fan, X., Liu, J., & Li, Y. (2020). Multi-class Arrhythmia detection from 12-lead varied-length ECG using Attention-based Time-Incremental Convolutional Neural Network. Information Fusion, 53, 174-182.
- TSFEDL.models_keras.YiboGao(include_top=True, weights=None, input_tensor=None, input_shape=None, classes=5, classifier_activation='softmax', return_loss=False)[source]¶
CNN using RTA blocks for end-to-end attrial fibrilation detection.
- Parameters:
include_top (bool, default=True) – Whether to include the fully-connected layer at the top of the network.
weights (str, default=None) – The path to the weights file to be loaded.
input_tensor (keras.Tensor, defaults=None) – Optional Keras tensor (i.e. output of layers.Input()) to use as input for the model.
input_shape (Tuple, defaults=None) – If input_tensor=None, a tuple that defines the input shape for the model.
classes (int, defaults=5) – If include_top=True, the number of units in the top layer to classify data.
classifier_activation (str or callable, defaults='softmax') – The activation function to use on the “top” layer. Ignored unless include_top=True. Set classifier_activation=None to return the logits of the “top” layer.
return_loss (bool, defaults=False) – Whether to return the custom loss function (en_loss) employed for training this model.
- Returns:
model – A keras.Model instance.
- Return type:
keras.Model
References
Gao, Y., Wang, H., & Liu, Z. (2021). An end-to-end atrial fibrillation detection by a novel residual-based temporal attention convolutional neural network with exponential nonlinearity loss. Knowledge-Based Systems, 212, 106589.
Notes
- Code adapted from the original implementation available at:
- TSFEDL.models_keras.SharPar(include_top=True, weights=None, input_tensor=None, input_shape=None, classes=5, classifier_activation='softmax')[source]¶
A 1-layer CNN + LSTM model. Originally proposed for depression detection.
- Parameters:
include_top (bool, default=True) – Whether to include the fully-connected layer at the top of the network.
weights (str, default=None) – The path to the weights file to be loaded.
input_tensor (keras.Tensor, defaults=None) – Optional Keras tensor (i.e. output of layers.Input()) to use as input for the model.
input_shape (Tuple, defaults=None) – If input_tensor=None, a tuple that defines the input shape for the model.
classes (int, defaults=5) – If include_top=True, the number of units in the top layer to classify data.
classifier_activation (str or callable, defaults='softmax') – The activation function to use on the “top” layer. Ignored unless include_top=True. Set classifier_activation=None to return the logits of the “top” layer.
- Returns:
model – A keras.Model instance.
- Return type:
keras.Model
References
Sharma, G., Parashar, A., & Joshi, A. M. (2021). DepHNN: a novel hybrid neural network for electroencephalogram (EEG)-based screening of depression. Biomedical signal processing and control, 66, 102393.
Notes
- TSFEDL.models_keras.DaiXiLi(include_top=True, weights=None, input_tensor=None, input_shape=None, classes=5, classifier_activation='softmax')[source]¶
Convolutional neural network model for emotion classification using a non-end-to-end training method that combines bottom-, middle-, and top-layer convolution features.
- Parameters:
include_top (bool, default=True) – Whether to include the fully-connected layer at the top of the network.
weights (str, default=None) – The path to the weights file to be loaded.
input_tensor (keras.Tensor, defaults=None) – Optional Keras tensor (i.e. output of layers.Input()) to use as input for the model.
input_shape (Tuple, defaults=None) – If input_tensor=None, a tuple that defines the input shape for the model.
classes (int, defaults=5) – If include_top=True, the number of units in the top layer to classify data.
classifier_activation (str or callable, defaults='softmax') – The activation function to use on the “top” layer. Ignored unless include_top=True. Set classifier_activation=None to return the logits of the “top” layer.
- Returns:
model – A keras.Model instance.
- Return type:
keras.Model
References
Dai, J., Xi, X., Li, G., & Wang, T. (2022). EEG-Based Emotion Classification Using Improved Cross-Connected Convolutional Neural Network. Brain Sciences, 12(8), 977.
Notes