Flarenet is a web-based system designed to manage and automate transformer inspections using thermal images. Users can record transformer details, upload baseline and maintenance thermal images, and tag images by environmental conditions such as sunny, cloudy, or rainy. The system includes automated anomaly detection using machine learning models to analyze thermal images and generate digital maintenance records.
Current Stage: Milestone 02 - Full-stack application with integrated ML inference for anomaly detection.
Flarenet is a full-stack web application with a React frontend, Spring Boot backend, Python ML backend, and PostgreSQL database.
- Frontend: Built with React, Vite, and Material UI for fast and responsive UI.
- Backend: Spring Boot handles business logic, CRUD operations, and provides REST APIs.
- ML Backend: Python FastAPI server for automated anomaly detection on thermal images using PyTorch models.
- Database: PostgreSQL via Docker Compose stores transformers, inspections, thermal images, and analysis results.
This system demonstrates modern full-stack development with AI integration, including user authentication, CRUD operations, image upload/management, and ML-powered analysis.
- React, Vite, Material UI
- Axios or fetch for API requests
- Node.js and npm to run scripts
- Java 17+, Spring Boot 3+
- Spring Data JPA for database interactions
- PostgreSQL via Docker Compose
- Maven for dependency management
- Python 3.8+
- FastAPI, PyTorch
- OpenCV, Pillow for image processing
- Uvicorn for server
git clone https://github.com/RavijaDul/FlareNet.git
cd FlareNetWe use Docker to run Postgres with schema and seed data automatically.
docker compose down -v
docker compose up -d- Database:
flarenet - User:
flarenet - Password:
flarenet - Port:
5432
Images will be available inside flarenet-backend/uploads/.
Note: The first time you run this, Postgres will execute
init.sqland create all tables and seed data.
To explore the database(Optional)
docker exec -it flarenet-db psql -U flarenet -d flarenetNavigate to the backend folder and start the Spring Boot server:
cd flarenet-backend
mvn spring-boot:runThis repository provides an endβtoβend workflow for detecting thermal anomalies (loose joints, wire overloads, localized hot spots) in transformer / electrical component images using a pretrained PatchCore model (Wide ResNet50 backbone) plus deterministic OpenCV postβprocessing and ruleβbased classification.
Transformer thermal anomaly detection system achieving strong precision/recall tradeoff while maintaining complete explainability of postβprocessing logic.
| Metric | Value | Description |
|---|---|---|
| AUROC | 88.7% | Area under ROC curve (image/region level) |
| F1-Score | 91.6% | Harmonic mean of precision & recall (fault classification) |
| Inference Accuracy | 100% | All faulty images flagged (no false negatives) |
| Processing Speed | 1.77 FPS | Average endβtoβend throughput (Python, single GPU/CPU mix) |
Expected (reference environment):
- Training (1 epoch) β 20 minutes
- Test batch run β 40 seconds
- Reported stats (single validation set) β above table
Average performance baseline used: percentage threshold calibration anchored at 40% (see Calibration section) for internal acceptance testing
The backend API will be available at http://localhost:8080/api.
cd python-backend
python -m venv venv
venv\Scripts\activate # Windows:
source venv/bin/activate # macOS/Linux:
pip install -r requirements.txt
python model_weight.py
uvicorn app:app --host 0.0.0.0 --port 5000 --reloadNavigate to the frontend folder, install dependencies, and start the dev server:
cd frontend
npm install
npm run devThe frontend will be available at http://localhost:5173.
FlareNet/
βββ docker-compose.yml # Docker Compose for Postgres DB
βββ flarenet-backend/
β βββ db/
β β βββ init.sql # Database schema + seed data
β βββ uploads/ # Images folder (mounted in Docker)
β βββ src/ # Java backend code
β βββ pom.xml # Maven build file
βββ frontend/
β βββ src/ # React frontend code
β βββ package.json
β βββ package-lock.json
βββ python-backend/
β βββ app.py # FastAPI server for ML inference
β βββ model_core.py # ML model loading and inference logic
β βββ model_weight.py # Script to download model weights
β βββ requirements.txt # Python dependencies
β βββ test_request.py # Test script for API
βββ README.md
-
Images:
All thermal images are stored inflarenet-backend/uploads/. This folder is mounted in Docker, so images are accessible to the backend. -
Database:
- Tables:
users,transformers,inspections,thermal_image,analysis_result - The database will be automatically created on first Docker run.
- Tables:
-
Environment variables (optional): Customize DB credentials in
docker-compose.yml. Backendapplication.ymlshould matches these credentials. -
Model Training and Inference: For Milestone 02, the Python backend includes inference capabilities. Model training and detailed inference testing are available in a separate repository (link to be provided later). The current setup uses pre-trained models for anomaly detection.
# Start database
docker compose down -v
docker compose up -d
# Start backend
cd flarenet-backend
mvn spring-boot:run
# Start frontend
cd frontend
npm install
npm run dev
# Start python backend
# Go to backend folder
cd python-backend
# Create and activate virtual environment
python -m venv venv
# Windows:
venv\Scripts\activate
# macOS/Linux:
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Optional: download model weights first
python model_weight.py
# Run the FastAPI server
uvicorn app:app --host 0.0.0.0 --port 5000 --reload- To stop the DB:
docker compose down - To reset the DB: delete
pgdatavolume or rundocker compose down -vanddocker compose up -d - Use Postgres GUI tools (like pgAdmin or DBeaver) to inspect the database if needed
- Authentication & user roles missing β At this stage, the system does not include authentication, authorization, or multi-user role management. These features will be added in future phases.
- Deployment not yet available β FlareNet currently runs only in a local development environment (Docker + local servers). A cloud deployment setup is not yet provided.