Detection and Classification of Cotton Foreign Fibers Based on Polarization Imaging and Improved YOLOv5

Rui Wang, Zhi-Feng Zhang, Ben Yang, Hai-Qi Xi, Yu-Sheng Zhai, Rui-Liang Zhang, Li-Jie Geng, Zhi-Yong Chen, Kun Yang2023 · DOI

TL;DR

This paper introduces a novel system for detecting and classifying foreign fibers in cotton using polarization imaging and an enhanced YOLOv5 object detection model. The improved model achieves higher accuracy and speed, making it suitable for real-time production line applications, particularly for challenging small and transparent foreign fibers.

What Problem Does This Paper Address?

The textile industry relies heavily on cotton, but foreign fibers (like leaves, plastic, or paper) mixed into cotton can significantly degrade the quality of yarn and fabric, leading to defects and reduced product grade. Manual inspection is slow, inefficient, and prone to errors. Existing automated methods, such as photoelectric, ultrasonic, and traditional machine vision, have limitations: they may miss transparent fibers, are slow, or require expensive equipment. This paper aims to address the need for a fast, accurate, and cost-effective automated system for detecting and classifying a wide range of foreign fibers, especially small and difficult-to-see ones, in real-time production environments.

Methods

The core of this work lies in combining a specialized imaging technique with an improved deep learning model.

  • Polarization Imaging Device: The authors developed a polarization imaging device using a line laser and a polarized camera. This setup leverages the differing optical properties and polarization characteristics of cotton fibers versus foreign fibers to enhance their visibility. The device was optimized for a 45° incident angle of the line laser, which yielded the most prominent characteristic information.
  • Improved YOLOv5 Model (YOLOv5-CFD): The researchers adapted the YOLOv5 object detection architecture to better suit the foreign fiber detection task. Key modifications include:
  • Lightweight Backbone (ShuffleNetv2): Replacing the original YOLOv5 backbone with ShuffleNetv2, a more efficient network, reduces model size and increases detection speed without significantly sacrificing accuracy. The Hard-Swish activation function was also incorporated.
  • Enhanced Feature Fusion (Improved PANet): The PANet (Path Aggregation Network) structure in YOLOv5 was modified to better capture fine-grained features, crucial for detecting small foreign fibers. This involved discarding some larger feature maps that were less relevant for small targets.
  • Attention Mechanism (CA Module): A Coordinate Attention (CA) module was added to the detection heads. This module helps the network focus on relevant spatial and channel features, further improving detection accuracy, especially for challenging targets.

Datasets

The study utilized a dataset of cotton foreign fiber images collected using their polarization imaging system.

  • Dataset Composition: The dataset contains 3944 foreign fiber target images across 20 categories.
  • Data Augmentation: The dataset was enhanced through various augmentation techniques (gaussian blur, affine transformation, brightness transformation, dropping pixel transformation, and flip transformation), resulting in a total of 21,381 images for training and validation.
  • Splits: The data was divided into training, validation, and testing sets.

Key Insights and Ideas

  • Polarization Imaging Advantage: The difference in how cotton and foreign fibers reflect polarized light is a powerful cue for detection, especially for transparent or similarly colored fibers that are hard to spot with standard imaging.
  • Small Target Detection is Crucial: The paper highlights that foreign fibers in cotton are often broken into smaller pieces during processing, making the detection of small targets a significant challenge that many existing methods struggle with.
  • Balancing Speed and Accuracy: The core innovation is achieving a better trade-off between detection speed and accuracy. By using a lightweight backbone (ShuffleNetv2) and an efficient attention mechanism (CA), the model becomes faster and smaller while maintaining or improving detection performance.
  • PANet Refinement for Small Objects: Modifying the PANet structure to focus on finer-grained features and discarding less useful large-scale feature maps is key to improving the detection of small foreign fibers.

Key Results

The improved YOLOv5-CFD model demonstrated significant performance gains:

  • Model Size: Reduced from 13.82 MB (original YOLOv5) to 0.75 MB.
  • Detection Speed (FPS): Increased from 170 f/s (original YOLOv5) to 385 f/s.
  • Accuracy ([email protected]): Improved from 95.87% (original YOLOv5) to 96.90%.
  • Accuracy ([email protected]:0.95): Improved from 52.77% (original YOLOv5) to 59.90%.
  • Overall Performance: The YOLOv5-CFD model outperformed other advanced models like YOLOv4, SSD, and Faster-RCNN in terms of [email protected], model volume, and FPS.
  • Robustness: The model showed good robustness and anti-interference capabilities under various conditions, including different illumination, incidence angles, and fiber sizes.

Limitations and Future Work

  • Limitations:
    • The paper notes that environmental light intensity changes can influence classification, and strong light (like sunlight) can increase the misrecognition rate.
  • Detection and classification can be more challenging with small or large incidence angles (15° or 90°).
  • While the model is robust, the paper mentions that some foreign fibers were difficult to identify with very small sizes (<0.5 mm²).
  • Future Work: The paper suggests that the proposed method is suitable for actual production lines and has practical application value. Future work could focus on further optimizing the detection of extremely small foreign fibers and exploring more advanced attention mechanisms or network architectures to push performance boundaries even further.

Summary updated

BibTeX
@misc{wang2023detection,
  author = {Rui Wang and Zhi-Feng Zhang and Ben Yang and Hai-Qi Xi and Yu-Sheng Zhai and Rui-Liang Zhang and Li-Jie Geng and Zhi-Yong Chen and Kun Yang},
  title = {{Detection and Classification of Cotton Foreign Fibers Based on Polarization Imaging and Improved YOLOv5}},
  year = {2023},
  doi = {10.3390/s23094415},
}
Figure