# defect_detection **Repository Path**: summer_rain/defect_detection ## Basic Information - **Project Name**: defect_detection - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-12-14 - **Last Updated**: 2024-12-14 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README

project-image

GUI application that detects defects in sardine cans during production. The deep learning model used can detect defects in more than just my dataset.

Project Screenshots:

🧐 Features

Here're some of the project's best features: * Import or take a picture of cans from 7 sides * Classify the can (Good/Bad) * Detect defects if the can is bad * Display heatmap

💻 Built with

Technologies used in the project: * Python * PyQt5 * Pytorch * Opencv * Scikit-learn * Numpy * Matplotlib * Seaborn ## Architecture **Training.** VGG16 feature extractor pre-trained on ImageNet, classification head - Average Global Pooling and a Dense layer. Model outputs 2-dimensional vector that contains probabilities for class 'Good' and class 'Anomaly'. Finetuned only last 3 convolutional layers and a dense layer. Loss is Cross-Entropy; optimizer is Adam with a learning rate of 0.0001. *Model Training Pipeline:* **Inference.** During inference model outputs probabilities as well as the heatmap. Heatmap is the linear combination of feature maps from layer conv5-3 weighted by weights of the last dense layer, and upsampled to match image size. From the dense layer, we take only weights that were used to calculate the score for class 'defective'. *Model Inference:*