A comprehensive AI-powered battery analytics platform that provides intelligent insights for battery health monitoring, performance prediction, and lifecycle management. This solution combines advanced machine learning algorithms with real-time analytics to optimize battery usage and promote circular economy principles.
This platform offers:
- AI-Powered Battery Analytics: Advanced machine learning models for battery health assessment
- Predictive Maintenance: RUL (Remaining Useful Life) prediction with 99% accuracy
- Performance Optimization: Real-time monitoring and degradation analysis
- Circular Economy Integration: Smart recommendations for second-life applications
- Interactive Dashboard: Comprehensive visualization and reporting tools
The project consists of two main components:
- Framework: Next.js 14 with TypeScript
- UI Components: Custom dashboard with Tailwind CSS
- Key Features:
- Battery data upload and visualization
- Real-time analytics dashboard
- Predictive modeling interface
- Report generation and export
- Interactive charts and graphs
- Framework: Flask with CORS support
- ML Libraries: scikit-learn, pandas, numpy
- Key Features:
- Battery data processing (.pkl/.csv files)
- Statistical analysis and metrics calculation
- Health score assessment
- Capacity fade analysis
- Temperature analytics
TATA-Hackathon-main/
├── backend/ # Python backend, data processing and model utils
│ ├── HFDataPreProcess/ # Battery analytics API + preprocessing utilities
│ │ ├── analyze_calb_data.py
│ │ ├── battery_analytics_api.py
│ │ ├── battery_analytics_client.py
│ │ ├── convert_calb_data.py
│ │ ├── explore_calb_data.py
│ │ ├── README_API.md
│ │ ├── test_api.py
│ │ ├── test_battery_api.py
│ │ └── battery_data_export/ # exported sample data and test inputs
│ └── (other backend utilities)
├── models/ # Model code, training scripts, checkpoints and datasets
│ ├── assets/ # Documentation about data structure and training
│ │ ├── Data_structure_description.md
│ │ └── Model_training.md
│ ├── checkpoints/ # Saved model checkpoints
│ │ ├── CALB_CPTransformer/
│ │ └── CALB_CPTransformer_regularized/
│ ├── data_provider/ # Data loader / factory utilities
│ │ ├── data_factory.py
│ │ ├── data_loader.py
│ │ ├── data_split_recorder.py
│ │ └── life_classes.json
│ ├── dataset/ # Datasets used for training / evaluation
│ │ ├── CALB/
│ │ ├── "Life Labels"/
│ │ └── seen_unseen_labels/
│ ├── layers/ # Model layer implementations
│ │ ├── AutoCorrelation.py
│ │ ├── Autoformer_EncDec.py
│ │ ├── Conv_Blocks.py
│ │ ├── Embed.py
│ │ ├── fusion.py
│ │ ├── SelfAttention_Family.py
│ │ └── StandardNorm.py
│ ├── models/ # Model definitions
│ │ ├── CPBiGRU.py
│ │ ├── CPBiLSTM.py
│ │ ├── CPLSTM.py
│ │ ├── CPMLP.py
│ │ └── CPTransformer.py
│ ├── plot_scripts/ # Plotting utilities for analysis
│ │ └── plt_CALB.py
│ ├── process_scripts/ # Data preprocessing scripts
│ │ └── preprocess_CALB.py
│ ├── read_structure/ # Helpers to read data structure definitions
│ │ └── read_data_structure.py
│ ├── RUL/ # Remaining Useful Life analysis tools
│ │ ├── predict_rul_simple.py
│ │ └── test_rul_system.py
│ ├── train_eval_scripts/ # Shell scripts to train/evaluate models
│ │ ├── CALB_CPTransformer.sh
│ │ └── evaluate.sh
│ └── utils/ # Misc utilities (losses, metrics, masking)
│ ├── augmentation.py
│ ├── data_split_helper.py
│ ├── losses.py
│ ├── metrics.py
│ └── timefeatures.py
├── frontend/ # Next.js TypeScript frontend application
│ ├── app/
│ │ ├── dashboard/
│ │ └── page.tsx
│ ├── components/
│ ├── lib/
│ │ ├── api.ts
│ │ ├── constants.ts
│ │ └── utils.ts
│ ├── public/
│ ├── hooks/
│ └── types/
├── README.md # Project README (this file)
└── package.json (frontend) # Frontend package manifest
- Node.js 18+ and npm/yarn
- Python 3.8+
- Git
-
Navigate to the backend directory:
cd backend/HFDataPreProcess -
Install Python dependencies:
pip install flask flask-cors pandas numpy matplotlib scikit-learn
-
Start the Flask API server:
python battery_analytics_api.py
The API will start on
http://localhost:5000 -
Verify API is running:
python test_api.py
-
Navigate to the frontend directory:
cd frontend -
Install dependencies:
npm install # or yarn install -
Start the development server:
npm run dev # or yarn dev -
Open your browser: Navigate to
http://localhost:3000
- Support for
.pkland.csvfiles - Drag-and-drop interface or file browser
- Real-time upload progress tracking
- Battery Health Metrics: Capacity retention, degradation indicators
- Performance Analytics: Charge/discharge statistics, temperature analysis
- Cycle Life Analysis: Fade rates and projections
- CPTransformer - Charge-Patch Transformer (Best performer)
- CPBiLSTM - Charge-Patch Bidirectional LSTM
- CPLSTM - Charge-Patch LSTM
- CPBiGRU - Charge-Patch Bidirectional GRU
- CPMLP - Charge-Patch MLP
- Remaining Useful Life calculations
- Configurable EOL (End of Life) thresholds
- Confidence intervals and uncertainty quantification
- Automated report generation
- Multiple export formats (PDF, CSV, JSON)
- Customizable report templates
GET /- Health check and API informationPOST /api/upload- Upload battery data filesGET /api/analytics/{battery_id}- Get analytics resultsPOST /api/predictions- Run ML predictionsGET /api/rul/{battery_id}- Calculate remaining useful life
// Upload battery data
const formData = new FormData();
formData.append('file', batteryFile);
const response = await fetch('http://localhost:5000/api/upload', {
method: 'POST',
body: formData
});
const analytics = await response.json();- MAE (Mean Absolute Error): Model accuracy measurement
- RMSE (Root Mean Square Error): Prediction error quantification
- R² Score: Coefficient of determination for model fit
- Training Time: Model efficiency metrics
- Battery health assessment with scoring
- Capacity fade analysis and visualization
- Temperature impact evaluation
- Cycle life projection with confidence intervals
- Coulombic efficiency tracking
- Multi-model comparison and validation
- Real-time data processing
- Interactive visualization dashboards
- Automated report generation
- Export capabilities (JSON, CSV, PDF)
- Real-time IoT data integration
- Advanced anomaly detection
- Predictive maintenance scheduling
- Cloud deployment and scaling
- Mobile application support
# Test with sample data
python battery_analytics_client.py --file mock_battery_data.pkl
# Test with multiple files
python battery_analytics_client.py --files file1.csv file2.csv file3.csv
# Save results
python battery_analytics_client.py --file data.pkl --output results.jsonCreate a .env.local file in the frontend directory:
NEXT_PUBLIC_API_URL=http://localhost:5000
NODE_ENV=development- Prediction Accuracy: 99%+ for RUL estimation
- Processing Speed: Real-time analysis for datasets up to 100MB
- Model Training: Supports epoch configurations from 10-500
- Data Support: Handles both structured (.csv) and serialized (.pkl) formats
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is developed for the TATA Hackathon and follows the competition guidelines.
-
API Connection Failed
- Ensure Flask server is running on port 5000
- Check firewall settings
- Verify API endpoint URL in frontend configuration
-
File Upload Issues
- Supported formats:
.pkl,.csv - Maximum file size: 100MB
- Ensure proper file permissions
- Supported formats:
-
Model Training Errors
- Check data format and structure
- Ensure sufficient memory for large datasets
- Verify model parameters are within valid ranges
Enable debug information by setting NODE_ENV=development in the frontend.
For technical support or questions:
- Check the API documentation
- Review the troubleshooting section above
- Open an issue in the repository