This project is a Streamlit web application for detecting surface defects in hot-rolled steel strips using a Convolutional Neural Network (CNN). It provides features such as user login, prediction history with SQLite, and PDF report export functionality.
Steel_Defect_Streamlit_final/
│
├── app.py # Main Streamlit app
├── model.py # CNN model definition
├── database.py # SQLite DB functions (users, history)
├── auth.py # User authentication logic
├── pdf_export.py # PDF report generation utility
├── utils.py # Preprocessing & helper functions
├── requirements.txt # Required Python libraries
├── users.db # SQLite database for users and history
├── data/
│ └── sample_images/ # Test images for prediction
- 🔍 Surface Defect Detection using deep learning (PyTorch CNN)
- 🔐 User Authentication (Sign up and log in)
- 🧠 Real-time Predictions on uploaded images
- 🗂️ Prediction History stored per user in SQLite
- 📄 Export to PDF: Generate downloadable reports
If you're using the zip file:
unzip Steel_Defect_Streamlit.zip
cd Steel_Defect_Streamlitpython -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activatepip install -r requirements.txtUse the following command to launch the Streamlit web application:
streamlit run app.pyThe app will open in your browser at http://localhost:8501.
- Login or Sign Up with your credentials.
- Upload an image OR zip file of a steel strip.
- The model will detect and classify the defect (if any).
- You can view your prediction history from the sidebar.
- Export results as a PDF for record-keeping.
- CNN implemented with PyTorch
- Input: Steel surface image (PNG/JPG/JPEG/BMP)
- Output: Defect class label with prediction probability
Major dependencies include:
tensorflowprotobufnumpypandasopencv-pythonscikit-learnmatplotlibplotlyPillowstreamlitvalidatorsgitpythonaltairtyping-extensionsrequestswatchdogblinkertornadofpdf
See requirements.txt for the complete list.
- The model weights should be loaded within
model.py. Ensuremodel.pthis placed correctly if loading external weights. - The
users.dbSQLite database stores user credentials and prediction history.
Developed by Shesh Kanade Harsh Prajapati Yashkumar Desai Rutvik Sindhav For academic purposes and AI-based defect detection research.
This project is licensed for educational and research use only.