A program that uses artificial intelligence to identify defects such as stains, scratches, and tears in textile fabric dataset
AITEX FABRIC IMAGE DATABASE
The textile fabric database consists of 245 images of 7 different fabrics. There are 140 defect-free images, 20 for each type of fabric. With different types of defects, there are 105 images.
Images have a size of 4096×256 pixels. Defective images have been denominated as follows: nnnn_ddd_ff.png, where nnnn is the image number, ddd is the defect code, and ff is the fabric code.
-
There is a mask of defect, denominated as: nnnn_ddd_ff_mask.png, where white pixels represent the defect area of the defective image.
-
Defect free images have been denominated as follows: nnnn_000_ff.png, where defect code has been replaced by 0000 code.
-
Defect free images 15 and 08 of fabrics types 00 and 03 (only an area of 256×256 is shown).
-
Defect 19 on fabric 02 and its mask (only an area of 256×256 is shown).
- Good
- Defective
- Data Analysis
=> Similar types of defects appear in various directions and locations
link : https://www.aitex.es/afid/
-
Automation of process inspection
-
Model determines whether fabric fails and automatically saves to Excel
=> Learn the classifier to determine the failure of the fabric, automate Excel input
- Supporting environment
-
Test Environment
- Local, MacOS, 16RAM
- Limited program operation speed (batch behavior)
- Primary Tuned Test Algorithm Performance
-
Final Target
- real-time operational program : 256 x 256 based on image 1fps , GPU
- Tuned final algorithm performance
-
- Test Program
- Official Program
- Training program
- Transmission priority
- Utilization of CNN architectures suitable for multi-scale feature analysis (utilizing skip connections, Inception, etc.)
- Application of data augmentation to enhance algorithm accuracy (e.g., flip, rotation, translation)
- Data serialization for efficient training (using TFRecord)
- Performing oversampling to address data imbalance
TFRecord is a binary format for storing large amounts of data(dataset) efficiently.
The main advantages of using TFRecord include:
- Efficiency: TFRecord is a binary format, which makes it highly efficient for both reading and writing large datasets. It reduces the storage space required and accelerates data loading, which is crucial for training deep learning models on massive datasets.
- Serialization: It enables easy serialization of complex data structures, such as images, audio, and sequences of numerical data. This serialization process is crucial for preparing data for machine learning tasks.
- Parallelization: TFRecord files can be split into multiple shards, allowing for parallel processing and input pipeline optimization. This is beneficial when working with multi-core CPUs or distributed computing frameworks.
- Compression: TFRecord supports data compression, which can further reduce storage and speed up data loading, especially when dealing with large datasets. Random Access: It allows for efficient random access to data, making it suitable for tasks like shuffling and batching data during training.
- Flexibility: TFRecord can store data of varying data types, including images, audio, text, and numerical data, making it a versatile choice for machine learning applications.
This data augmentation technique helps increase the diversity of the training dataset and can improve the model's robustness and generalization.
- Flip: It randomly flips the image both left-right and up-down with a 50% probability.
- Rotate: It randomly rotates the image by a random angle between 0 and 360 degrees with a 50% probability. The interpolation method used is 'BILINEAR' for smoother rotation.
- Translation: It randomly applies translation to the image by shifting it horizontally and vertically within the range of -10 to 10 units. The decision to apply translation is determined with a 50% probability. It uses 'BILINEAR' interpolation for smoother transformation.
After these augmentation operations, the method returns the augmented image along with its label.
Ressource : https://cloud.google.com/tpu/docs/inception-v3-advanced?hl=fr
The Inception architecture, also known as GoogleNet, is known for its ability to capture multi-scale features efficiently.
- My model uses a series of inception blocks to capture multi-scale features in the input image, and it concludes with fully connected layers to make a binary classification prediction.
- My model is designed to handle images with a resolution of 256x256 pixels and three color channels.
- Test program results
- I initially set a threshold of 0.5 to classify defects in textile image data. However, the model training results showed that it sometimes incorrectly predicted "fail" as "true" in the range of 0.5 to 0.7.
- Therefore, I concluded that adjusting the threshold appropriately, considering the trade-off between false negatives and false positives, is the best way to fine-tune it for the application.
- So, tuning the threshold to better suit the application is the most effective approach.