Skip to content

This project automates paper defect localization in industrial quality control using feature extraction and machine learning. Techniques include HOG, Gabor filters, Canny edge detection, and Wavelet Transform with SVMs, CNNs, and ensemble learning. It aims to reduce manual inspection, improving efficiency and reliability in defect detection.

Notifications You must be signed in to change notification settings

poetabdullah/Paper-Defect-Detection-and-Classification

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

10 Commits
ย 
ย 

Repository files navigation

๐Ÿงพ Paper Defect Detection & Classification

"Quality control is only as strong as its weakest inspection point โ€” letโ€™s make it smarter."

This project automates defect localization in paper manufacturing by combining classical feature extraction with modern machine learning models. It demonstrates how techniques like HOG, Gabor filters, Canny edge detection, and Wavelet transforms, when paired with models like SVMs, Logistic Regression, and CNNs, can transform defect detection in industrial pipelines.

๐Ÿ”— Pre-trained Models: Hugging Face Repository
๐Ÿ“ Articles:


โš™๏ธ Workflow Summary

The complete pipeline is available in the master branch along with the report. Hereโ€™s how the workflow was structured:

๐Ÿ” Data Exploration

  • โœ… Image Loading & Verification
  • ๐Ÿ“Š Class Distribution analysis (balanced dataset ensured)
  • ๐Ÿงน Preprocessing for consistent inputs

๐Ÿ–ผ๏ธ Feature Extraction

  • ๐ŸŽจ Color Histograms & Binning โ†’ minimal impact
  • ๐Ÿงญ HOG (Histogram of Oriented Gradients) โ†’ highly effective
  • ๐ŸŒŒ Gabor Filters โ†’ captured fine-grained patterns
  • โœ‚๏ธ Canny Edge Detection โ†’ sharp defect localization
  • ๐ŸŒŠ Wavelet Transform โ†’ insights across resolutions
  • โšช Local Binary Patterns โ†’ limited by blur

๐Ÿ“‰ Dimensionality Reduction

  • Built a feature set from HOG, Gabor, Canny, and Wavelets
  • Applied PCA โ†’ reduced dimensions while retaining 90% variance

๐Ÿค– Model Building & Results

  • Logistic Regression โ†’ 99% train | 79% test
  • Naive Bayes (Gaussian) โ†’ comparable to LR after tuning
  • SVM (Support Vector Machines) โ†’ 86% train | 80% test
  • CNNs โ†’ struggled (38% test accuracy, optimization needed)
  • Ensemble (SVM + LR + NB) โ†’ 90% train | 81% test

๐Ÿ“Œ Key takeaway โ†’ Classical + ensemble methods outperformed deep CNNs for this dataset.

๐Ÿ–ผ๏ธ Defect Localization

  • Generated visual heatmaps of detected defects on sample paper images
  • Enhanced interpretability of classification results

๐Ÿงฐ Tech Stack

  • Languages & Libraries: Python (NumPy, Pandas, Scikit-learn, TensorFlow/Keras)
  • Feature Extraction: OpenCV, skimage (HOG, Gabor, Canny, Wavelets, LBP)
  • Modeling: Logistic Regression, Naive Bayes, SVM, CNN, Ensemble Learning
  • Visualization: Matplotlib, Seaborn

โš ๏ธ Notes & Insights

  • ๐Ÿšซ Only optimized code sections included for clarity
  • ๐Ÿ› ๏ธ Redundant/less effective parts omitted
  • ๐Ÿ”ฎ Improvement Potential โ†’ CNN architectures & hyperparameter tuning
  • ๐Ÿ“Š Data visualizations available in full report, trimmed here for brevity

๐ŸŽฏ Future Work

  • ๐Ÿ”ง Improve CNN training with data augmentation & better architectures
  • ๐Ÿง  Integrate explainable AI (Grad-CAM, SHAP) for defect interpretability
  • ๐Ÿ“ˆ Deploy as an industrial quality-control dashboard

๐Ÿค Contribution

Your insights, feedback, and suggestions for model improvement are welcome! Feel free to fork, experiment, and share results.


๐Ÿ”ฅ With this pipeline, industrial paper defect detection becomes faster, more accurate, and more explainable.


About

This project automates paper defect localization in industrial quality control using feature extraction and machine learning. Techniques include HOG, Gabor filters, Canny edge detection, and Wavelet Transform with SVMs, CNNs, and ensemble learning. It aims to reduce manual inspection, improving efficiency and reliability in defect detection.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published