Textile-Defect / README.md
shahkeyush2002's picture
First
e50e42a

Textile Defect Detection


Introduction:

Fabric defect detection is a necessary and essential step of quality control in the textile manufacturing industry. It is the determination process of the location, type and size of the defects found on the fabric surface. Traditional fabric inspections are usually performed by manual visual methods, which are low in efficiency and poor in precision for long-term industrial. Lack of concentration, human fatigue, and time consumption are the main drawbacks associated with the manual fabric defect detection process. Applications based on computer vision and digital image processing can address the abovementioned limitations and drawbacks. Here we have used machine learning and deep learning approach to identify/categorize defects.

Youtube Link : https://youtu.be/Vw78gLfCQ44

Instructions For Running WebApp on local server:

  1. Go to terminal.
  2. Create a directory tex-detection using mkdir tex-detection
  3. cd tex-detection
  4. clone the repository using the command https://github.com/Rajvardhan7/Textile-Detection.git
  5. Install all the requirements using command pip install -r requirements.txt
  6. Run the commmand streamlit run app.py YOUR APP IS READY!!

1) Defect Detection

Technology/Framework Used : Numpy, Pandas, Matplotlib, CV2, Skimage, Scipy

Hole Detection - circular boundary using Hough Transformation:

The Hough transform is a feature extraction technique used in image analysis, computer vision, and digital image processing. The purpose of the technique is to find imperfect instances of objects within a certain class of shapes by a voting procedure. The algorithm converts RGB image to Grayscale for improved detection. By optimizing its parameters, we were able to get clear accurate bounding circle around the holes.


Gabor & GrayScale Filter Masks

In image processing, a Gabor filter, named after Dennis Gabor, is a linear filter used for texture analysis, which essentially means that it analyzes whether there is any specific frequency content in the image in specific directions in a localized region around the point or region of analysis. In the third image, reduced frequency/light/brightness of overall image shows a distinctive dark patch indicating a defect.


Masking or Image Segmentation

The defect is clearly visible after masking the image.

Normal Fabric Image
Masked Image


2) Defect Classification

Technology/Framework Used : Numpy, Pandas, Matplotlib, Sklearn, Keras

Using CNN Layers : Predicting Color Blending Image Correctly

The images in the data set were categorised into 'Color','Cut','No Defect','Hole','Metal_Contamination'&'Thread'. Developed a Convolutional Neural Network Model(below figure for reference) to train the large image dataset(about 90,000 samples) in order to get high validation accuracy. Able to get good accuracy(about 90%) in few 50 epochs only.