GithubHelp home page GithubHelp logo

tl-uestc / tatn Goto Github PK

View Code? Open in Web Editor NEW
16.0 1.0 1.0 47.11 MB

The PyTorch implementation of Temperature Adaptive Transfer Network for Cross-Domain State of Charge Estimation of Li-ion Batteries at Different Ambient Temperatures.

License: GNU General Public License v2.0

Python 100.00%

tatn's Introduction

Liyuan Shen, Jingjing Li, Jieyan Liu, Lei Zhu, Heng Tao Shen

Abstract:State of charge (SOC) estimation plays an important role in battery management system (BMS), which serves to ensure the safety of batteries. Existing data-driven methods for SOC estimation of Li-ion batteries (LIBs) rely on massive labelled data and the assumption that training and testing data share the same distribution. However, in real-world, there is only unlabelled target data and these exists distribution discrepancy caused by external or internal factors such as varying ambient temperatures and battery aging, which makes existing methods invalid. Thus, it is necessary to develop effective unsupervised methods. To address the challenges, temperature adaptive transfer network (TATN) is proposed, which can mitigate domain shift adaptively by mapping data to high-dimensional feature spaces. TATN consists of pre-training stage and transfer stage. At pretraining stage, two-dimensional convolutional neural network (2D-CNN) and bidirectional long short-term memory (BiLSTM) are used for temporal feature extraction. At transfer stage, adversarial adaptation and maximum mean discrepancy (MMD) are utilized to minimize domain divergence. Furthermore, a novel label-selection method is proposed to select reliable pseudo labels. Extensive transfer experiments are performed. In pre-training stage, TATN achieves mean absolute error (MAE) and root mean square error (RMSE) of 0.294% and 0.366% for training and average errors of 1.09% and 1.44% for testing. In transfer stage, compared with other methods, TATN reduces average MAE and RMSE by 66% and 78% under semi-supervised scenario, 71% and 68% under unsupervised scenario, 52% and 42% at online testing. The results indicate TATN can achieve state-of-the-art performance in practical applications.

Usage

  • conda environment
conda env create -f env.yaml
  • Dataset

more dataset for LIBs can be downloaded from HERE

  • Data processing

put your data fold in normalized_data/ and run this code

python normalized_data/dataprocess.py
  • To pretrain a source model
python run.py --mode pretrain --mkdir [your folder] --source_data_path [] --source_temp [] --epochs --batch_size

(check run.py for more arguments)
The model is saved in run/'your folder'/saved_model/best.pt

  • Pseudo label

Use pre-trained source model to generate pseudo labels for target data:

python pseudo.py --temp --model --file
  • To transfer a model
python run.py --mode train --mkdir [] --source_data_path --source_temp --target_data_path --target_temp --epochs --batch_size

(check run.py for more arguments)

  • To test a model
python run.py --mode test --mkdir [] --test_set [] --target_temp []

tatn's People

Contributors

sly932 avatar

Stargazers

 avatar  avatar ZiFeng Xu avatar  avatar  avatar  avatar  avatar qwemnb avatar  avatar  avatar  avatar  avatar  avatar He Jiabei avatar Dongyang Zhang avatar  avatar

Watchers

Kostas Georgiou avatar

Forkers

sly932

tatn's Issues

When I reproduce this code with Panasonic battery data, he has the following error.

H:\anaconda3\python.exe "G:\研究生论文\OneDrive - stu.hebut.edu.cn\TATN-main\normalized_data\process.py"
Traceback (most recent call last):
File "H:\anaconda3\lib\site-packages\scipy\io\matlab_mio.py", line 39, in _open_file
return open(file_like, mode), True
PermissionError: [Errno 13] Permission denied: 'G:\研究生论文\OneDrive - stu.hebut.edu.cn\TATN-main\normalized_data\Panasonic 18650PF Data/-10degC'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "G:\研究生论文\OneDrive - stu.hebut.edu.cn\TATN-main\normalized_data\process.py", line 154, in
read_and_save(path)
File "G:\研究生论文\OneDrive - stu.hebut.edu.cn\TATN-main\normalized_data\process.py", line 15, in read_and_save
data = sio.loadmat(file)
File "H:\anaconda3\lib\site-packages\scipy\io\matlab_mio.py", line 225, in loadmat
with _open_file_context(file_name, appendmat) as f:
File "H:\anaconda3\lib\contextlib.py", line 135, in enter
return next(self.gen)
File "H:\anaconda3\lib\site-packages\scipy\io\matlab_mio.py", line 17, in _open_file_context
f, opened = _open_file(file_like, appendmat, mode)
File "H:\anaconda3\lib\site-packages\scipy\io\matlab_mio.py", line 45, in _open_file
return open(file_like, mode), True
FileNotFoundError: [Errno 2] No such file or directory: 'G:\研究生论文\OneDrive - stu.hebut.edu.cn\TATN-main\normalized_data\Panasonic 18650PF Data/-10degC.mat'
G:\研究生论文\OneDrive - stu.hebut.edu.cn\TATN-main\normalized_data\Panasonic 18650PF Data/-10degC

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.