AI-powered industrial quality assurance system for fancy yarn using computer vision and 3D visualization.
Analyze & explore related research in Conceptio
Connect this record directly into your research workflow or AI agent. Explore citations across open repositories, query full text, and export structured proof bundles.
AI-powered industrial quality assurance system for fancy yarn using computer vision and 3D visualization - PMC Skip to main content An official website of the United States government Here's how you know Here's how you know Search Log in Primary site navigation Search Log in Search PMC Full-Text Archive Search in PMC Journal List User Guide As a library, NLM provides access to scientific literature. Inclusion in an NLM database does not imply endorsement of, or agreement with, the contents by NLM or the National Institutes of Health. Learn more: PMC Disclaimer | PMC Copyright Notice Sci Rep . 2026 Apr 28;16:19019. doi: 10.1038/s41598-026-49947-5 AI-powered industrial quality assurance system for fancy yarn using computer vision and 3D visualization Shaymaa E Sorour 1, ✉ , A E Amin 2 Author information Article notes Copyright and License information 1 Department of Management Information Systems, School of Business, King Faisal University, 31982 Al-Ahsa, Saudi Arabia 2 Department of Computer Science, Mansoura University, Mansoura, 35516 Egypt ✉ Corresponding author. Received 2026 Feb 24; Accepted 2026 Apr 17; Collection date 2026. © The Author(s) 2026 Open Access This article is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License, which permits any non-commercial use, sharing, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if you modified the licensed material. You do not have permission under this licence to share adapted material derived from this article or parts of it. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by-nc-nd/4.0/ . PMC Copyright notice PMCID: PMC13279795 PMID: 42045271 Abstract One of the problematic issues in textile production is quality control in fancy yarn because of the complicated structure and aesthetic needs of these goods. This paper presents a novel integrated system that combines artificial intelligence and computer vision algorithms for quality assurance of fancy yarns. The proposed system has been designed, implemented as a laboratory prototype, and experimentally validated under controlled conditions. The implemented prototype demonstrates capabilities for defect detection, thickness measurement, pattern analysis, and 3D visualization using a combination of 2D image processing and laser profilometry data. Under controlled laboratory conditions (22 ± 2 °C, 65 ± 5% RH), the suggested system demonstrates a defect detection accuracy of 94.7% (95%, Confidence Interval (CI) [94.1%, 95.3%]), thickness uniformity precision of 96.2%, and pattern regularity reliability of 92.5% (95% CI [91.2%, 93.8%]). The system operates on the plane yarn images in 8 states that comprise image acquisition, pre-processing, feature extraction, thickness checking, defect detection, pattern checking, quality checking and reporting. In accordance with the outcomes of the experiment, the suggested system demonstrates the accuracy of 94.7% in the defect detection, the precision of 96.2% in the thickness uniformity and the reliability of 92.5% in the pattern regularity. The integration of 3D visualization provides manufacturers with enhanced spatial understanding of yarn properties, enabling proactive quality management and reducing non-conformance to quality standards. The complete MATLAB R2024b implementation, including network architectures, training protocols, and evaluation routines, is provided in Appendix A to ensure reproducibility. Keywords: Industrial computer vision, Interactive 3D visualization, AI-based textile defect detection, Smart manufacturing Subject terms: Engineering, Mathematics and computing Introduction With the increasing global demand for high-value fancy yarns, which are used in high-end fashion applications as well as technically advanced textile products, the textile manufacturing industry is changing rapidly. Yarns that are irregular in structure and thickness and have beautiful attractive patterns. As these features make them expensive, it becomes hard to dimension or quality assure them. As competition and specification of materials become a biggest problem, manufacturers have changed their focus from preference to necessity for achieving quality 1 . Yarn quality inspections continue to rely on manual visual evaluation, despite advancements in yarn manufacturing technologies. Operators must have skill and experience 2 , 3 . Processes that prioritize people and human subjects have inherent limitations subjectivity 4 , 5 , The inspection speeds are slow, along with considerable labor costs. The current automated systems only deal with individual parameters of the yarn but fail to provide the multi-dimensional nature of the fancy yarn properties that require quantitative and qualitative evaluation 6 . This gap has led to consistent problems such as leakage of defects, wastage of raw materials, and change in the quality of the products. These challenges have a direct bearing on the performance in the industry that increases the chances of defect leakage, rejections, and raw material waste, causing ineffectiveness and less competitiveness of this vital sector 7 . The Fourth Industrial Revolution has offered promising avenues via artificial intelligence (AI), computer vision and deep learning (specifically convolutional neural networks) 8 , 9 . These technologies outperform traditional visual inspection in accuracy and can complete defect detection, classification and morphological analysis with high accuracy. Nonetheless, existing implementations are not very widespread as they deal primarily with standard yarn types and hardly ever with fancy yarns. Recent reviews indicate the serious lack of literature that integrates computer vision systems and 3D imaging techniques for fine-grained analysis of yarn. Hence, clear and timely research opportunity 10 – 12 . The aim of this study is to fill that gap by developing an integrated quality assurance system based on the complementary strengths of AI-based computer vision and interactive 3D visualization 13 . The proposed system can automate defect detection and provide intelligent diagnosis and multilayered structural analysis 14 , 15 . By combining high-speed imaging, deep learning based classification and 3D reconstruction, the system aims to deliver a holistic and objective understanding of yarn quality, capturing both surface irregularities and internal variations overlooked by 2D systems 14 , 16 . The primary objectives of this research are threefold: (1) to design and implement an AI-powered industrial system for fancy yarn quality assurance that integrates computerized vision with 3D imaging and interactive visualization; (2) to validate the system’s performance through comprehensive laboratory experimentation; and (3) to provide complete implementation details ensuring reproducibility. This integration targets industrial appraisal procedures requiring accuracy, speed, and consistency in quality assessment 17 . The proposed framework aims to enhance operational efficiency, reduce material waste, and provide quantitative data for informed production management. This research contributes both to academic knowledge and industrial practice by offering a methodology that balances sophisticated algorithmic capabilities with practical manufacturing constraints. The ultimate objective is to facilitate a paradigm shift in how textile manufacturers monitor and assure fancy yarn quality 18 , 19 . The remainder of this paper is structured as follows: The section “ Literature review ” presents a comprehensive review of relevant literature and theoretical foundations. Section “ System architecture and methodology ” details the system architecture and methodological approach. The section “ Algorithm development ” describes implementation and prototype development. The section “ 3D Visualization and Interactive Analysis Module ” presents experimental results and validation. The section “ Quality assessment framework ” discusses findings, limitations, and future directions. The section “ Experimental results and validation ” presents experimental results and validation. The section “ Discussion ” discusses the findings, limitations, and future directions. The section “ Conclusion ” concludes the research with recommendations for industrial adoption. Literature review Traditional quality control methods in textile manufacturing The textile manufacturing processes have traditionally relied on manual inspection methods established during the industrial revolution. Empirical studies indicate that human inspection accuracy ranges between 75% and 85%, with performance degradation correlated directly with examiner fatigue and cognitive load 20 – 22 . Conventional approaches involve visual observation under standardized lighting conditions (D65 illuminant), tactile assessment by experienced technicians, and basic measurement instruments including micrometers for diameter measurement and gravimetric methods for linear density determination 23 – 25 . These subjective methodologies suffer from inherent limitations: inter-operator variability, low throughput rates (typically 2–5 m/min), and inability to generate quantitative, reproducible data essential for statistical process control 26 . For fancy yarns specifically, these constraints are amplified due to their complex three-dimensional structures and intentional irregularities that resist conventional pass/fail classification paradigms. Evolution of computer vision in textile inspection The integration of computer vision in textile inspection represents a fundamental transition from human-dependent to machine-based quality assessment 27 . Early implementations in the 1990 s employed basic image processing algorithms including thresholding, edge detection (Sobel, Canny operators) 28 , and morphological operations for defect identification in woven fabrics 29 . Contemporary approaches have evolved substantially: Defect Detection and Classification : Multiscale CNN architectures for yarn inspection have achieved 91.3% accuracy in identifying fifteen common fabric defects, demonstrating superior performance compared to traditional feature-extraction models 30 . Real-time detection systems based on YOLOv5 architecture now process 30 frames per second on industrial production lines 31 . Dimensional Metrology : Non-contact measurement techniques have advanced considerably 32 , 33 . Laser triangulation systems achieve ± 0.1 mm accuracy for yarn diameter measurement 34 , 35 , with subsequent machine learning implementations correcting measurement drift under varying ambient conditions 36 , 37 . Texture and Structural Analysis : Fourier transform and Gabor filter banks have been employed to evaluate pattern regularity in Jacquard fabrics 38 – 40 . While these methods prove effective for conventional two-dimensional patterns with regular periodicity, they become inadequate when applied to fancy yarns such as bouclé, gimp, and chenille, which exhibit stochastic three-dimensional structures. Artificial intelligence integration in industrial quality assurance The incorporation of machine learning mechanisms into industrial inspection systems has transformed quality control from reactive error detection to intelligent, predictive functionality 41 – 43 . This change reflects subsequent waves of advancement that have changed the field. This evolution reflects successive technological waves: First Generation: Conventional Machine Learning - Early models employed feature engineering with Support Vector Machines (SVMs) and Random Forests 44 , 45 . Multi-layer perceptions achieved 86% accuracy for basic yarn classification, though these systems required extensive manual feature specification 46 . Second Generation: Deep Learning Revolution - Deep learning, particularly CNNs, enabled automatic feature learning directly from raw image data 47 , 48 . Contemporary architectures incorporating attention mechanisms within CNN layers achieved 94.7% accuracy by emphasizing salient regions in input images 49 – 51 . Third Generation: Hybrid and Adaptive Systems - Recent research explores ensemble techniques and adaptive learning 52 . Hybrid systems combining CNN feature extraction with XGBoost classification achieve 96.2% accuracy on heterogeneous defect datasets 53 . Emerging strategies incorporate few-shot learning and transfer learning to address limited labeled data availability for novel defect types. 3D visualization and analysis in textile applications While three-dimensional imaging techniques including structured light scanning, photogrammetry, and laser profilometry are well-established in automotive and aerospace sectors, their application to textile quality assurance remains nascent 54 , 55 . ISO 20685:2018 provides standardization for 3D scanning methodologies 56 , though specific adaptations for textile materials are limited. Recent exploration work includes: Surface Topography Analysis : Structured light scanning creates digital twins of technical textiles, enabling virtual measurement of surface roughness and geometric characteristics 57 . Volumetric Assessment : Preliminary investigations employing multi-view stereo reconstruction have demonstrated potential for quantifying bulk and loft properties of fancy yarns, though computational requirements precluded real-time implementation 58 . The convergence of AI analytics with 3D data represents an emerging area of significant promise for fancy yarn evaluation, where three-dimensionality fundamentally determines quality and functionality 59 . Research gap analysis Despite substantial advances in computer vision and AI for industrial inspection, a significant gap persists between applications for conventional textiles and those addressing fancy yarn complexities. Four primary limitations constrain comprehensive analysis: Fragmented Parameter Analysis : Current technological solutions operate as standalone systems addressing individual parameters—defect detection, diameter measurement, or pattern analysis—without integrated assessment of interdependent quality characteristics (dimensional stability, effect consistency, defect density, structural integrity) that collectively determine fancy yarn quality. Dimensional Limitation : The preponderance of research remains focused on two-dimensional image analysis, neglecting the third dimension essential for evaluating fancy yarn characteristics including loop height, spiral depth, and volumetric profile. This represents a fundamental methodological constraint in the field. Static Learning Architectures : Deployed systems typically employ fixed model’s incapable of adapting to emerging defect types or evolving production conditions. The absence of continuous learning mechanisms compromises long-term sustainability in dynamic manufacturing environments. Domain-Specific Optimization Gap : Algorithms designed to detect unintended defects in uniform fabrics fail to distinguish between desirable fancy effects (intentional irregularities) and actual defects in specialty yarns. This necessitates domain-specific architectural innovations and training strategies. This study addresses these limitations through an integrated AI-based approach combining multi-modal computer vision, three-dimensional visualization, and adaptive learning mechanisms specifically optimized for fancy yarn quality assurance. System architecture and methodology System overview The proposed AI-Powered Industrial Quality Assurance System provides holistic inspection of fancy yarns through integrated processing of visual data in a modular, end-to-end framework. The system encompasses data acquisition, processing, analysis, and three-dimensional visualization within a unified architecture. The system comprises eight interconnected modules operating through sequential and parallel processes to ensure both efficiency and comprehensiveness. The architecture enables independent analysis of two-dimensional and three-dimensional data streams, with results optimally fused to generate comprehensive quality assessments. Figure 1 illustrates the core data flow, with dashed lines indicating feedback loops enabling continuous adaptation and learning. Fig. 1. Open in a new tab The core data flow. Hardware configuration System functionality relies upon a precisely calibrated hardware configuration for high-resolution, stable data acquisition: Image Acquisition System: Primary Sensor: 20-megapixel industrial color camera (Basler ace 2) with global shutter for motion artifact elimination and telecentric lens for perspective distortion minimization. 3D Profile Sensor: Laser line scanner (Keyence LJ-V7000 series) for real-time cross-sectional profile and height map acquisition. Lighting: Multi-angle programmable LED strobe system (ring and dark-field configurations) to enhance surface texture and three-dimensional topography visualization while maintaining illumination consistency regardless of ambient conditions. Processing Unit: Development and Training Hardware: Workstation with Intel Core i9-10900 K CPU, NVIDIA RTX 3080 GPU (10GB VRAM), 32GB DDR4 RAM, Ubuntu 20.04 OS. Algorithm Development Platform: Consumer-grade laptop with Intel Core i5-3210 M CPU, Intel HD Graphics 4000, 12GB DDR3 RAM, Windows 10 Pro (used for code development and testing only). Laboratory Prototype Deployment: Industrial PC with Intel Core i7-11700 K CPU, NVIDIA RTX 3060 GPU (12GB VRAM), 32GB DDR4 RAM, Windows 10 IoT Enterprise. Material Handling: Conveyor with precision servo motor and integrated tension control, operating at 0.1 to 5.0 m/min (laboratory prototype limitation). Guide mechanisms ensuring consistent focal distance and field of view. Note: Throughput projections of 75 m/min represent theoretical maxima based on per-image processing time (0.8 s per 1-meter segment), requiring scaled industrial implementation with upgraded conveyor systems and parallel processing architecture. Environmental Control: Integrated sensors monitoring temperature (± 0.5 °C) and relative humidity (± 3%). Controlled conditions: °C, RH. Environmental effects on yarn properties are recorded for subsequent analysis compensation. Software architecture The software ecosystem employs a hybrid platform balancing rapid prototyping capabilities with production deployment requirements: Core Development Platform (MATLAB R2024b): Image Processing and Computer Vision Toolbox: Geometric transformations, filtering, feature extraction. Deep Learning Toolbox: CNN design, training, validation, and deployment. Statistics and Machine Learning Toolbox: Predictive modeling and statistical process control. Parallel Computing Toolbox: GPU-accelerated training and inference. App Designer: Proof-of-concept user interface development. Complete MATLAB Implementation. All code for network architecture definition, training protocols, cross-validation, and deployment is provided in Appendix A to ensure full reproducibility of experimental results. Deployment & Integration Platform (Production): Libraries: Libraries: OpenCV, scikit-image, TensorFlow/PyTorch, scikit-learn, XGBoost, Plotly Dash, Open3D/Trimesh. GPU-accelerated pipeline: CUDA 11.8 and OpenGL 4.6 for real-time 3D rendering (60 + FPS on deployment hardware). Data Management: SQLite/PostgreSQL database for inspection outcomes, defect images, quality measurements, and system logs enabling traceability and trend analysis. Image acquisition and preprocessing Raw sensor data undergoes systematic standardization to enhance relevant characteristics while suppressing noise: Noise Reduction: Adaptive median filter ( or kernel) removing salt-and-pepper noise while preserving edge information. Contrast Enhancement: Contrast Limited Adaptive Histogram Equalization (CLAHE) applied at image tile level to improve local contrast while minimizing background noise amplification. Edge and Texture Enhancement: Sobel operator for primary edge detection, modified using Difference of Gaussians (DoG) filter optimized for fancy yarn effect characterization, enabling multi-scale texture detection. Color Space Conversion: Standard defect detection: RGB to grayscale conversion (Luminosity method: 0.299R + 0.587G + 0.114B). Fancy effect analysis (e.g., mélange yarns): Transformation to CIELAB color space for perceptually uniform color segmentation. The preprocessing function for 2D image streams is mathematically represented as: Where: is the original image. is the contrast enhancement function. is the Difference of Gaussians band-pass filter for multi-scale texture enhancement. is a weighting factor controlling enhancement strength. denotes the adaptive noise filtering operation. Concurrently, 3D point cloud data from the profiler undergoes separate preprocessing including Statistical Outlier Removal filtering, noise elimination, and coordinate system alignment with the 2D camera view. Algorithm development The system interface (Fig. 2 ) presents eight sequential analysis stages from image loading through final report generation. The process initiates with yarn image selection (Fig. 3 ), followed by preprocessing (Fig. 4 ) encompassing quality enhancement, noise removal, and image standardization. Fig. 2. Open in a new tab Fancy Yarn Analysis System Interface (Complete Version). Fig. 3. Open in a new tab Fancy Yarn Analysis System Interface (Image load). Fig. 4. Open in a new tab Fancy Yarn Analysis System Interface (Image processing). The process starts with loading the image of yarn to be examined whereby the user is expected to select the image using the interactive interface as indicated in Fig. 3 that shows the system interface when loading an image. This is then succeeded by the image preprocessing phase (Fig. 4 ), which entails image quality improvement, noise removal and preparing the image to make the correct analysis. Image preprocessing The first stage of preprocessing forms the backbone of the precision of analysis. The process stage is a series of specific computational operations performed on the input image. It focuses on improving the quality of the image. The operations include applying filters for noise removal, improving the local contrast using methods such as CLAHE. Also, finding basic edges using an operator such as Sobel. These operations help show the structure of the yarn and create cleaned up and standardized image data for later analytical stages. According to Fig. 4 , yarn image is being preprocessed through some operations in the interphase of the system. Feature extraction algorithm The multi-scale hierarchical feature extractor characterizes complex fancy yarn structures through a multi-component feature vector. Figure 5 displays the feature extraction interface, showing statistical, textural, and geometric features extracted following successful preprocessing. Fig. 5. Open in a new tab Fancy Yarn Analysis System Interface (Feature Extraction). Level 1 - Statistical Features: Capture global intensity distribution. Mean intensity: Standard deviation: Skewness and Kurtosis: Measure intensity distribution asymmetry and tailedness, indicating material density variations or subtle shading defects. Level 2 - Textural Features: Characterize surface texture and local spatial relationships. Gray Level Co-occurrence Matrix (GLCM): Computed across multiple directions and distances. Haralick Features: Fourteen statistical measures including: Contrast: Local intensity variations. Correlation: Linear dependency of gray levels. Energy (Angular Second Moment): Image uniformity. Homogeneity: GLCM element distribution closeness to diagonal. Local Binary Patterns (LBP): Micro-texture pattern characterization invariant to monotonic gray-scale variations. Level 3 - Geometric Features: Quantify physical shape and dimensions. Yarn Diameter: Profile along yarn length via morphological operations on binarized images. Eccentricity: , where are semi-major and semi-minor axes of ellipse fitted to yarn cross-section, indicating circularity. Area and Perimeter: Extracted via contour detection; area-to-perimeter ratio indicates surface roughness or fiber protrusions. Thickness analysis algorithm Thickness uniformity quantification employs the Coefficient of Variation (CV) along predefined sample lengths (Fig. 6 ): Fig. 6. Open in a new tab Fancy Yarn Analysis System Interface (Thickness Analysis). Where is the standard deviation and is the mean thickness. Quality Grading based on industry-relevant thresholds: Excellent (Grade ): – Highly uniform, suitable for premium applications. Good (Grade A): – Meets standard quality requirements. Acceptable (Grade B): – Functional but with noticeable variation. Poor (Reject Grade): – non-uniform, likely to cause downstream processing or final product issues. Defect detection using convolutional neural networks The CNN architecture for defect detection and classification (Fig. 7 ) was implemented and trained using MATLAB R2024b Deep Learning Toolbox. Complete implementation code is provided in Appendix A. Fig. 7. Open in a new tab Fancy Yarn Analysis System Interface (Defect Detection). Network Architecture: The CNN model was implemented and trained using MATLAB R2024b Deep Learning Toolbox. The architecture was designed using the Deep Network Designer app and trained using custom training loops with automatic differentiation: Input Layer: Size: 256 × 256 × 3 (RGB images normalized to [0,1] using MATLAB’s “normalize” function) Data augmentation applied online using MATLAB’s ` ` with the following transformations: Random rotations: ±15° . Random scaling: 90–110% . Random brightness adjustment: ±20% . Random horizontal reflection: 50% probability. Feature Learning Backbone (5 convolutional blocks): Block Layers Output Size Learnable Block 1 imageInputLayer + convolution2dLayer(3,32,‘Padding’,‘same’) + batchNormalizationLayer + reluLayer + maxPooling2dLayer(2,‘Stride’,2) 128 × 128 × 32 896 Block 2 convolution2dLayer(3,64,‘Padding’,‘same’) + batchNormalizationLayer + reluLayer + maxPooling2dLayer(2,‘Stride’,2) 64 × 64 × 64 18,496 Block 3 convolution2dLayer (3,128,‘Padding’,‘same’) + batchNormalizationLayer + reluLayer + maxPooling2dLayer(2,‘Stride’,2) 32 × 32 × 128 73,856 Block 4 convolution2dLayer (3,256,‘Padding’,‘same’) + batchNormalizationLayer + reluLayer + maxPooling2dLayer(2,‘Stride’,2) 16 × 16 × 256 295,168 Block 5 convolution2dLayer (3,512,‘Padding’,‘same’) + batchNormalizationLayer + reluLayer + maxPooling2dLayer(2,‘Stride’,2) 8 × 8 × 512 1,180,160 Open in a new tab Classifier Head: globalAveragePooling2dLayer (replaces fully connected layers to reduce parameters). fullyConnectedLayer(256) + reluLayer + dropoutLayer(0.5). fullyConnectedLayer(128) + reluLayer + dropoutLayer(0.3). fullyConnectedLayer(13) + softmaxLayer (12 defect classes + 1 defect-free class). classificationLayer. Total learnable parameters: 1,682,253. Training Protocol: Transfer Learning Approach: Two-stage strategy: Stage 1 - Feature Extractor Pre-training Convolutional backbone pretrained on ImageNet using MATLAB’s imagePretrainedNetwork(‘squeezenet’). Stage 2 - Fine-tuning on Fancy Yarn Dataset Pretrained backbone fine-tuned on our dataset with reduced learning rate (0.0001). Optimizer: Adam optimizer (MATLAB’s solver) with: Initial learning rate: 0.001. Gradient decay factor: 0.9. Squared gradient decay factor: 0.999. Epsilon: 1e-8. Learning Rate Schedule: Piecewise drop with factor 0.5 every 5 epochs if validation loss plateaus. Regularization: L2 regularization: 0.0001. Dropout: 0.5 and 0.3 in fully connected layers. Batch normalization after each convolutional layer. Batch Size: 32. Epochs: Maximum 100, with early stopping use (patience = 15 epochs). Hardware Configuration for Training: CPU: Intel Core i9-10900 K (10 cores, 20 threads). GPU: NVIDIA RTX 3080 (10GB VRAM) with CUDA 11.8 support. RAM: 32GB DDR4. Training time: 4.5 h for 100 epochs (GPU-accelerated using MATLAB’s Parallel Computing Toolbox). Cross-Validation: 5-fold stratified cross-validation implemented using MATLAB’s function. Pattern recognition algorithm Pattern regularity assessment (Fig. 8 ) employs 2D Discrete Fourier Transform (DFT) for spectral analysis of fancy yarn effects. The complete processing pipeline consists of five sequential steps 60 : Fig. 8. Open in a new tab Fancy Yarn Analysis System Interface (Pattern Analysis). Step 1 – Region of Interest (ROI) Extraction: The yarn-containing region is segmented from the background using adaptive thresholding, isolating the patterned area for analysis. Step 2–2D DFT Computation: The Fourier transform is applied to the ROI: Where are the image dimensions. are the pixel coordinates in the spatial domain. are the frequency coordinates in the frequency domain. Step 3 – Magnitude Spectrum Analysis: The magnitude spectrum is computed and shifted to center the zero frequency. Regular patterns produce high-magnitude sharp peaks at fundamental frequencies and harmonics, while irregular patterns yield diffuse spectra without dominant peaks. Step 4 – Peak Detection: Dominant frequency peaks are identified using a local maxima detection algorithm with adaptive thresholding (minimum peak height = 10% of maximum magnitude). Step 5 – Regularity Index (R) Calculation: The Regularity Index quantifies pattern consistency: Where represents energy in strongest frequency peaks, and E =total is total spectral energy in the. Higher values indicate more regular, repeatable patterns: R ≥ 80%: Regular pattern. 50% ≤ R < 80%: Moderately irregular. R < 50%: Highly irregular/random pattern. 3D visualization and interactive analysis module 3D surface reconstruction and model generation Integration of laser profilometry with 2D imagery generates high-fidelity, interactive 3D yarn models (Fig. 9 ): Fig. 9. Open in a new tab Fancy Yarn Analysis System Interface (3D Visualization). Where is the normalized image intensity, is the direct depth measurement, represents enhanced textural details, and α, β, γ are calibrated scaling and blending factors. Surface reconstruction employs Poisson Surface Reconstruction or Marching Cubes algorithms applied to point cloud data, generating watertight triangulated meshes. High-resolution color images are accurately projected onto 3D mesh surfaces, with Phong shading and multiple dynamic light sources enhancing depth perception and structural detail visualization. Interactive 3D visualization features The module features an easy-to-use graphical interface that allows engaging in the interaction with the yarn model in a more immersive and real-time, making it easier to analyze it in both qualitative and quantitative terms. Dynamic View Manipulation: Rotation: Full 360° free rotation around X, Y, and Z axes. Zoom: Dynamic scaling from 10× overview to 1000× microscopic detail. Pan: Smooth surface translation for region-specific inspection. Analytical Visualization Tools: Virtual Cross-Sectioning: Real-time arbitrary plane slicing for internal volumetric analysis. Height/Thickness Contour Maps: Color-coded overlays indicating local height/thickness variations. Defect Annotation and Tagging: CNN-detected defects visually tagged in 3D space with classification, dimensions, and confidence scores. Integrated Measurement Suite: 3D Distance Measurement: Euclidean distance between user-selected points. Surface Area & Volume Calculation: Region-specific analysis for density and bulk characterization. Profile Extraction: Thickness/height profiles along user-defined paths. Real-time rendering and performance optimization GPU-accelerated pipeline (OpenGL/Vulkan/Open3D) offloads processing to NVIDIA RTX 3060 GPU: Frame Rate: 60 + FPS with detailed models. Model Complexity: Handles up to 1 million triangles without lag. Memory Management: Level-of-Detail (LOD) techniques and texture compression (BC7 format) reduce GPU RAM utilization by 50%. Real-Time Updates: 200 ms latency for continuous inline inspection feedback. Quality assessment framework Multi-criteria decision analysis The weighted Multi-Criteria Decision Analysis (MCDA) framework (Table 1 ) evaluates five primary criteria: Table 1. The final weighted score maps to quality grades. Criterion Weight Measurement Method Description Thickness Uniformity 25% CV analysis Measures the consistency of yarn diameter along its length using the Coefficient of Variation (CV). Lower CV indicates higher uniformity. Defect Presence 25% CNN detection Quantifies the severity and frequency of defects (e.g., neps, slubs, cuts). The score inversely correlates with the number and criticality of detected defects. Pattern Regularity 20% Fourier analysis Evaluates the consistency and repeatability of intentional fancy effects (e.g., loops, spirals) using the Regularity Index (R) derived from spectral analysis. Texture Quality 15% GLCM features Assesses surface texture consistency based on Haralick features (Contrast, Energy, Homogeneity) from the Gray Level Co-occurrence Matrix. Color Uniformity 15% Color histogram Analyzes color distribution and variation within the yarn segment using statistical measures (mean standard deviation) on the CIELAB color space channels, particularly the a* and b* components. Open in a new tab Overall quality score calculation: Where is the weight of the criterion (normalized to sum to 100%), and is its normalized score (scaled from 0 to 100). The normalization procedure for each criterion is as follows: For Thickness Uniformity: , where CV is the Coefficient of Variation. For Defect Presence: For Pattern Regularity: (the Regularity Index from the section “ Pattern recognition algorithm ”). For Texture Quality: (from GLCM features). For Color Uniformity: , where is the standard deviation in CIELAB color space. Adaptive learning mechanism The system incorporates an adaptive learning mechanism that has been implemented and tested in the laboratory prototype, enabling continuous improvement over time. This mechanism consists of four integrated components: Online Learning with Experience Replay: New labeled defect samples are stored in an experience replay buffer (capacity = 500 samples). During periodic retraining (every 200 batches), a random batch of 32 samples from the buffer is combined with the original training data to update model weights. This approach prevents catastrophic forgetting while enabling learning of new defect patterns. Human-in-the-Loop Feedback Integration: Operator corrections (e.g., false positives/negatives identified during validation) are recorded and stored. These feedback samples are prioritized in the experience replay buffer ( ples) and incorporated during the next retraining cycle. Performance Monitoring: A hold-out validation set (15% of data) continuously evaluates key metrics (Accuracy, Precision, Recall, F1-Score) after each epoch. An alert is triggered when any metric drops below 90% of its baseline value. Statistical Drift Detection: Two complementary methods are applied to detect distribution shifts in incoming features: Kolmogorov-Smirnov (K-S) Test: Applied every 500 sample to compare the feature distribution of recent samples (window size = 100) against the baseline distribution. A p-value < 0.05 triggers model retraining. EWMA (Exponentially Weighted Moving Average) Control Chart: Applied to the defect detection accuracy metric with smoothing parameter λ = 0.2 and control limits at ± 3σ. An out-of-control signal triggers an alert and scheduled retraining. Validation Note: All components of the adaptive learning mechanism have been experimentally validated in the laboratory prototype. The ablation study (Table 5 ) demonstrates that adaptive learning contributes a 2.6% improvement in defect detection accuracy without significant processing overhead. Table 5. Classification of results - Experimental vs. Projected. Metric Type Basis of Estimation Verification Status Defect detection accuracy (94.7%) Experimental Measured on held-out test set (683 samples) Verified Thickness measurement MAE (0.08 mm) Experimental Validated against reference laser micrometer (200 paired measurements) Verified Processing speed (0.8 s/image) Experimental Measured on the laboratory prototype Verified Throughput (75 m/min) Projected Extrapolated from per-image processing time; requires conveyor upgrade for validation Requires industrial validation Inspection time reduction (78%) Projected Time-motion studies under laboratory conditions Requires industrial validation First-pass yield improvement (23%) Projected Simulation model using experimental defect patterns Requires industrial validation Labor cost reduction Projected Financial modeling based on industry benchmarks Requires industrial validation ROI payback period (14 months) Projected Financial modeling assuming medium-to-large production volume Requires industrial validation Open in a new tab Quality classification Final weighted scores map to quality grades: Grade Score Range (Points) Description A+ (Excellent) 90–100 Superior quality meets the highest standards for premium applications. No significant flaws. A (Very Good) 80–89 High quality, well within specification limits, suitable for most demanding end-uses. B (Good) 70–79 Good quality meets all functional requirements with minor, acceptable variations. C (Average) 60–69 Acceptable quality for standard applications but may exhibit noticeable variations or minor defects. D (Acceptable) 50–59 Marginally acceptable. May require downgrading or be suitable for less critical applications. F (Poor/Reject) < 50 Fails to meet minimum quality standards. Recommended for rejection or recycling. Open in a new tab The Quality Assessment Unit generates summarized results after each analysis stage (Fig. 10 ). Fig. 10. Open in a new tab Fancy Yarn Analysis System Interface (Final Report). Experimental results and validation Dataset description Due to the proprietary nature and confidentiality of real industrial fancy yarn production lines, access to live production data was restricted. Therefore, to conduct this academic research, dedicated yarn bobbins were specially manufactured under controlled laboratory conditions that closely simulated industrial production parameters. Defect Determination Criteria: Defects in fancy yarn are determined based on the deviation of the produced yarn from the reference model fed to the machines. Specifically, a defect is identified by measuring three key aspects: Defect Dimensions: The length and width of the irregularity (e.g., Slub length and thickness). Defect Frequency: The number of repetitions of the irregularity per unit length. Root Causes: The source of deviation, which may include: Mechanical defects in the production machinery. Variations in the quality of incoming raw materials. Inconsistent machine settings or calibration drift. Laboratory Sample Preparation: Based on these criteria, bobbins were intentionally manufactured to contain the 12 most common defect classes found in fancy yarn production. These include thick places, thin places, neps, slubs, cuts, stains, foreign fibers, oil stains, missing effect, irregular twist, and hairiness/broken filaments. Defect-free samples were also produced as a control group. Figure 11 shows representative visual samples from this laboratory-prepared dataset. From these specially manufactured bobbins, a total of 4,550 high-resolution images (4096 × 2160 pixels) were captured using an industrial camera (Basler ace 2) with a telecentric lens under standardized D65 illumination on a non-reflective neutral background. Table 2 provides a detailed breakdown of the dataset composition. Fig. 11. Open in a new tab Representative samples from the fancy yarn dataset. Table 2. Distribution of images across defect classes and dataset splits. Defect Class Total Images Training (70%) Validation (15%) Test (15%) Defect-Free 500 350 75 75 Thick Places 350 245 52 53 Thin Places 350 245 52 53 Neps 400 280 60 60 Slubs 350 245 52 53 Cuts 300 210 45 45 Stains 300 210 45 45 Foreign Fibers 250 175 37 38 Oil Stains 250 175 37 38 Missing Effect 300 210 45 45 Irregular Twist 300 210 45 45 Hairiness 300 210 45 45 Total 4 , 550 3 , 185 682 683 Open in a new tab Acquisition Conditions: All images were captured under rigidly controlled conditions (D65 standard illuminant, non-reflective neutral backdrop) with the yarn moving at a constant speed of 5 m/min using a precision servo motor conveyor system. Ground Truth: Annotation of defect types and locations was performed by a three-member panel of certified textile inspectors with over 10 years of experience. The panel referenced the original machine feed model as the baseline for determining whether a deviation constituted a defect. Consensus was required for any ambiguous cases. Data Augmentation: To prevent overfitting and improve model generalization, real-time data augmentation was applied during training using PyTorch’s torchvision.transforms. This included random rotations (± 15°), random scaling (90–110%), random brightness/contrast adjustments (± 20%), and horizontal flipping. Performance metrics The performance of the system was measured quantitatively based on common statistical measures of classification and operational efficiency 61 : Accuracy: Measures overall correctness: Precision: Measures of the reliability of positive predictions: Recall (Sensitivity): Measures the ability to find all relevant defects: F1-Score: The harmonic mean of Precision and Recall, providing a single balanced metric: Processing Speed: Evaluates practical throughput, measured in images processed per minute and equivalent meters of yarn inspected per minute. Laboratory performance evaluation The proposed system was rigorously tested under controlled laboratory conditions to determine its baseline technical performance prior to industrial deployment. Defect Detection Performance: The convolutional neural network proved to be very effective in all the significant defects. The summary of results is presented below (average of 5-fold cross-validation): Defect Type Precision Recall F1-Score Thick places 96.2% 94.8% 95.5% Thin places 93.7% 91.2% 92.4% Neps 97.1% 95.3% 96.2% Slubs 94.9% 93.1% 94.0% Overall Macro-Average 95.5% 93.6% 94.5% Open in a new tab The system achieved an overall defect detection accuracy of 94.7% (95% CI [94.1%, 95.3%]) based on the held-out test set of 683 samples, confirming robust detection and classification of yarn defects under ideal laboratory conditions. Thickness Analysis Results: The dimensional measurements of the algorithm were validated against a high-precision laser micrometer (Keyence LS-9000 series) reference procedure): Mean Absolute Error (MAE): , (standard deviation σ = 0.03 mm, 95% CI [0.077, 0.083]). Correlation with Reference: Coefficient of determination (Pearson correlation r = 0.98, ) based on 200 paired measurements. Bland-Altman Analysis: 95% limits of agreement , ], with a mean difference of + 0.01 mm, indicating no systematic bias ( p = 0.34). Repeatability (Within-System Consistency): Coefficient of Variation (CV) of 1.2% observed for 50 repeated measurements of the same yarn sample. Reproducibility (Between-Operator Consistency): CV of 2.1% recorded when three different operators used the system independently, demonstrating low user-dependency. Pattern Regularity Assessment The pattern analysis module achieved 92.5% accuracy in distinguishing intentional fancy effects from natural structural irregularities. The Regularity Index (R) effectively quantified periodicity in bouclé and gimp yarns. Processing Speed: The system’s efficiency meets the demands of inline production inspection: Single Image Analysis (Full Pipeline): `0.8 s` (from acquisition to quality report). Simulated Continuous Inspection Throughput: 75 m per minute, suitable for standard production line speeds. 3D Visualization Rendering Time: 1.2 s` to generate an interactive 3D model from processed data. Comprehensive Report Generation: 2.5 s` to compile and export a detailed PDF quality report with all metrics and visualizations. Comparative Performance Analysis: To contextualize the performance of the proposed system, a comparison was made against existing approaches commonly used in textile defect detection, under identical evaluation conditions using the test dataset, as illustrated in Table 3 . Table 3. Performance comparison with baseline methods. Method Architecture Accuracy Precision Recall F1-Score Inference Time (ms) Traditional ML 46 SVM + HOG features 82.3% [81.1, 83.5] 81.7% 80.5% 81.1% 45 Baseline CNN 30 VGG-16 (fine-tuned) 89.6% [88.5, 90.7] 89.2% 88.4% 88.8% 38 Real-time detector 31 YOLOv5s 91.2% [90.2, 92.2] 90.8% 90.1% 90.4% 12 Attention-based 51 ResNet50 + Attention 93.1% [92.2, 94.0] 92.7% 92.3% 92.5% 42 Proposed method Custom CNN 94.7% [94.1, 95.3] 94.2% 93.8% 94.0% 35 Open in a new tab Statistical significance analysis: To statistically validate the improvement of the proposed method over existing approaches, McNemar’s test was conducted comparing our custom CNN against the attention-based ResNet50 baseline, which achieved the next-best performance (93.1%). The test was performed on the held-out test set comprising 683 samples. The contingency matrix revealed 632 samples correctly classified by both methods, 35 samples correctly classified only by the proposed method, 18 samples correctly classified only by the baseline, and 8 samples misclassified by both. The calculated chi-square statistic was (df = 1), corresponding to a p-value of 0.023. Since , we reject the null hypothesis of equal performance, confirming that the proposed method achieves a statistically significant improvement over the attention-based baseline at the significance level. Ablation Study: Component Contribution Analysis: To quantify the contribution of each system component to overall performance, we conducted an ablation study by systematically removing or deactivating modules and measuring the impact on key metrics, as shown in Table 4 : Table 4. Ablation study results - Impact of component removal. Configuration Defect Detection Accuracy Thickness MAE (mm) Pattern Regularity Accuracy Processing Time (sec/image) Full system 94.7% 0.08 92.5% 0.80 Without CLAHE preprocessing 91.3% (−3.4%) 0.12 (+ 0.04) 89.1% (−3.4%) 0.65 (−19%) Without CNN (SVM only) 86.2% (−8.5%) 0.09 (+ 0.01) 88.3% (−4.2%) 0.71 (−11%) Without 3D fusion 92.8% (−1.9%) 0.15 (+ 0.07) 90.4% (−2.1%) 0.58 (−28%) Without Fourier pattern analysis 93.5% (−1.2%) 0.08 (unchanged) 84.7% (−7.8%) 0.73 (−9%) Without adaptive learning 92.1% (−2.6%) 0.08 (unchanged) 90.2% (−2.3%) 0.78 (−2%) Open in a new tab Key findings: CLAHE preprocessing contributes significantly to detection (+ 3.4%) and thickness accuracy. CNN-based detection is crucial for defect classification (+ 8.5% over traditional ML). 3D fusion substantially improves thickness measurement accuracy (MAE reduced from 0.15 mm to 0.08 mm). Fourier pattern analysis is essential for pattern regularity assessment (+ 7.8%). Adaptive learning provides meaningful improvement (+ 2.6%) without significant processing overhead. Operational Efficiency Analysis (Experimental vs. Projected): It is important to distinguish between results obtained from actual laboratory experimentation and those derived from simulation-based projections. Table 5 summarizes this distinction: The projections are based on realistic assumptions derived from experimental data and validated industry cost models, but they require full-scale industrial deployment for definitive validation. Inspection Time Reduction : The system has an inspection time per sample of 0.8 s compared to an approximate time of 3.6 s for manual inspection by a trained operator, representing a 78% reduction in inspection time as indicated by controlled time and motion studies under laboratory conditions. First-Pass Yield Estimation : Analysis of defect patterns in the dataset indicates that early detection of major defects (neps, slubs, thick/thin places) may enable timely correction of production processes. Simulation models suggest a potential first-pass yield increase of 23%. Labor Cost Modeling : Based on traditional staffing approaches in quality control departments, the automated inspection feature of the system could potentially reduce the number of manual inspection personnel by 78%, resulting in significant operational cost savings. Return on Investment (ROI) Projection : The system is projected to recover its estimated initial capital cost of $45,000 through annual savings in labor and material waste/losses within 14 months. This financial model assumes medium-to-large scale textile mill production levels. These projections are modeled simulations based on real performance statistics and validated industry cost models, indicating significant potential operational and economic gains upon industrial implementation. Table 6 provides a consolidated summary of all key performance metrics with their corresponding 95% confidence intervals and sample sizes, ensuring complete statistical reporting. Table 6. Summary of key performance metrics with statistical indicators. Metric Value 95% Confidence Interval Sample Size ( n ) Defect Detection Accuracy 94.7% [94.1%, 95.3%] 683 Thickness MAE 0.08 mm [0.077, 0.083] mm 200 Pattern Regularity Accuracy 92.5% [91.2%, 93.8%] 200 Pearson Correlation (thickness) r = 0.98 [0.97, 0.99] 200 Repeatability (CV) 1.2% [0.9%, 1.5%] 50 Reproducibility (CV) 2.1% [1.7%, 2.5%] 3 Open in a new tab Discussion System advantages The proposed AI-based quality assurance system offers substantial improvements over conventional approaches: Comprehensive Multi-Parameter Analysis: Unlike traditional systems measuring isolated parameters, this system simultaneously evaluates five interacting quality dimensions (thickness uniformity, defect presence, pattern regularity, texture quality, color uniformity), generating holistic quality profiles reflecting the multi-attribute nature of fancy yarns. Objective and Consistent Assessment: Quantitative algorithmic evaluation eliminates subjectivity arising from inspector fatigue, bias, or shift-to-shift variations, ensuring consistent quality benchmarks across all batches. Real-time Inline Processing: Validated throughput of 75 m/min (projected) enables true inline quality control with immediate feedback for process corrections, reducing waste and preventing non-conforming material production. Predictive and Proactive Capability: By continuously recording and analyzing quality metrics over time, the system enables statistical trend analysis. Gradual increases in thickness CV or the frequency of specific defect types can trigger early warnings, allowing proactive intervention before quality falls below acceptable thresholds. Projected Cost-effectiveness: The system can potentially reduce costs in two ways. First, automated inspection may reduce manual labor requirements by 78% based on time-motion comparative studies. Second, early detection capability may significantly reduce material waste and rework expenses. Financial modeling projects a payback period of 14 months for a typical medium-to-large production volume. Full Digital Traceability: Each inspected meter generates a permanent digital record containing original images, 3D models, measurements, and final grade, enabling root-cause analysis and compliance with traceability requirements. Limitations and challenges Laboratory-Only Validation: The system presented in this paper has been validated exclusively under controlled laboratory conditions (temperature: , relative humidity: , standard D65 illumination, stationary or constant-speed yarn motion at 5 m/min). While these conditions closely simulate industrial parameters, they do not fully replicate real factory environments characterized by vibration, ambient light fluctuations, yarn speed variations, and dust accumulation on optical components. Therefore, the reported accuracy metrics (94.7% defect detection, 0.08 mm thickness MAE) represent baseline performance under ideal conditions. Deployment on an operational production line requires additional validation and may reveal performance degradation not captured in this study. Throughput Projection: The projected throughput of 75 m/min is a theoretical maximum extrapolated from per-image processing time (0.8 s per 1-meter segment). Achieving this throughput in practice requires an upgraded conveyor system and parallel processing architecture that were not implemented in the laboratory prototype. Environmental Sensitivity and Robustness Assessment: To quantitatively evaluate the system’s robustness to environmental variations, we conducted controlled experiments varying key parameters. Table 7 summarizes the results. Table 7. Robustness to environmental variations. Variation Type Range Tested Impact on Accuracy Mitigation Strategy Lighting intensity ± 30% from D65 standard −2.3% to −5.7% Adaptive exposure control + multi-angle LED strobe Color temperature 4000–7500 K −1.8% to −4.2% White balance calibration + CIELAB color space Yarn color (light) White, beige, light blue −0.5% to −2.1% Contrast enhancemen (dark) Black, dark brown, navy [−4.8% to −8.3% (accuracy drops to 86.4% for black yarns)] Significant challenge - requires specialized illumination Yarn material (specular) Polyester, metallic blends −3.9% to −7.2% Polarization filters (ongoing work) Ambient temperature 18–28 °C −0.3% to −0.8% Environmental sensors + compensation Humidity 45% − 75% RH −0.2% to −0.6% Enclosed Open in a new tab Key finding: Dark-colored yarns present the greatest challenge, with accuracy dropping to 86.4% for black yarns (compared to 94.7% overall). This limitation is explicitly acknowledged. Future research and directions To overcome current limitations and extend system capabilities, several promising avenues for development are envisioned: Multi-Spectral and Hyperspectral Imaging: Using cameras sensitive to infrared (IR) or ultraviolet (UV) wavelengths could enable detection of defects or material contaminations invisible to the naked eye (e.g., certain oils or moisture content). Advanced Deep Learning Architectures: Replacing the existing CNN classifier with next-generation vision transformers (ViTs) or lightweight YOLO-based architectures could further enhance complex defect detection accuracy and enable true real-time speeds (> 100 m/min. Edge Computing Deployment: Packaging trained AI models for deployment on edge computing devices or directly on smart cameras would reduce latency, decrease dependence on centralized industrial PCs, and enhance system robustness and scalability. Cloud Platform and Industrial Internet of Things (IIoT) Integration: Development of a cloud-based dashboard aggregating data from multiple systems across different factories would enable centrally coordinated performance benchmarking, enterprise-level predictive analytics, remote expert diagnostics, and a connected (IIoT) ecosystem. Augmented Reality (AR) Operator Support: Development of AR glasses or tablet applications that overlay real-time system analysis on the physical yarn as viewed by operators on the factory floor. This could include defect location markers, quality scores, etc., enabling hybrid human-AI decision-making for complex cases and serving as an effective training tool for new operators. Conclusion This paper has presented the design, implementation, and experimental validation of a comprehensive AI-based computer vision system for automated quality inspection of fancy yarns. The proposed system demonstrates significant technological advancement, achieving 94.7% overall defect detection accuracy while providing multi-parameter quality profiling capabilities absent in existing commercial systems. The integration of real-time 3D visualization enables qualitative structural assessment complementing quantitative measurements, providing spatial understanding previously achievable only through expert manual inspection. The principal contributions of this research are: 5. A Novel Integrated AI Architecture: A unified textile quality control system combining convolutional neural networks for defect detection, classical computer vision for feature extraction, and machine learning for predictive quality grading. 6. Domain-Specific Algorithmic Development: Algorithms specifically tuned to distinguish between desirable fancy effects (intentional irregularities) and actual defects—a critical requirement for fancy yarn applications. 7. Real-Time 3D Visualization Engine: GPU-accelerated interactive module translating 2D inspection data to 3D, enabling measurement of parameters (loop height, volumetric consistency) impossible with 2D analysis alone. 8. A Holistic Quality Assessment Framework: Weighted multi-criteria decision analysis model integrating diverse quality attributes into practical quality grades for production decision-making. 9. Reproducible Implementation: Complete MATLAB R2024b code provided in Appendix A, enabling verification and extension by the research community. The developed system addresses the textile industry’s requirement for reliable, automated, and objective quality inspection solutions. Experimental results, obtained under controlled laboratory conditions, demonstrate technical robustness and practical feasibility. However, the system has not yet been validated on an operational production line with variable lighting, vibration, and yarn speed variations. The projected throughput of 75 m/min and economic analyses (14-month payback period) require full-scale industrial deployment for definitive validation. Future work will focus on extending system applicability to additional textile products (technical fabrics, nonwovens) and incorporating emerging technologies including hyperspectral imaging for chemical/moisture defect detection and edge computing architectures for enhanced scalability in distributed manufacturing environments. Appendix A: Complete MATLAB implementation code This appendix provides the complete MATLAB R2024b implementation code for the CNN-based defect detection system described in Sect. 3.8. All code has been tested and verified using MATLAB R2024b with Deep Learning Toolbox version 24.1 and Parallel Computing Toolbox version 24.1. A.1 Main training script A.1.1 Complete network architecture definitio A.1.2 Data augmentation configuration A.1.3 Training options configuration A.1.4 5-fold cross-validation implementation A.2 Usage instructions Author contributions S.E.S. was responsible for further development of the methodology, software implementation, additional validation, resource management, visualization, and data curation. A.E. Amin contributed to the methodology, software implementation, validation, and provided key resources essential to the study. All authors have reviewed and approved the final version of the manuscript. Funding This work was supported by the Deanship of Scientific Research, Vice Presidency for Graduate Studies and Scientific Research, King Faisal University, Saudi Arabia, under Project Grant KFU261984. Data availability The datasets generated and/or analyzed during the current study are available from the corresponding author upon reasonable request. The dataset consists of high-resolution (4096 × 2160 pixels) fancy yarn images encompassing 12 defect classes, annotated by a panel of certified textile inspectors. Due to the proprietary nature of the textile samples and ongoing research, raw image data are not publicly available but can be obtained for academic collaboration purposes by contacting the corresponding author. Declarations Competing interests The authors declare no competing interests. Footnotes Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations. References 1. Sorrentino, G. Introduction to emerging industrial applications of cannabis ( Cannabis sativa L). Rend. Lincei Sci. Fis. Nat. 32 (2), 233–243 (2021). [ DOI ] [ PMC free article ] [ PubMed ] [ Google Scholar ] 2. Wei, W., Zhou, R., Shao, B., Zhang, Y. & Wang, J. Research on intelligent spinning inspection robot. Lect. Notes Comput. Sci. 10.1007/978-3-030-89095-7_39 (2021). [ Google Scholar ] 3. TNguyen, T., Nguyen, H. & Ngo, H. Toward a sustainable transition in automated production: Enabling the vision-based approach and synchronous control for textile surface inspection systems. Text. Res. J. 93 (23–24), 5391–5415. 10.1177/00405175231199257 (2023). [ Google Scholar ] 4. Kuttiyil Thomas, O. & Gopalan,. Pcb defects. Springer Tracts Electr. Electron. Eng. 10.1007/978-981-16-9824-8_3 (2022). [ Google Scholar ] 5. Tesema, G. B. Cotton Quality Requirements for Spinning. In Cotton Sector Development in Ethiopia: Challenges and Opportunities Vol. 15 241–284 (Springer Nature Singapore, 2024). [ Google Scholar ] 6. Caldas, P., Sousa, F., Pereira, F., Lopes, H. & Machado, J. Automatic system for yarn quality analysis by image processing. J. Braz. Soc. Mech. Sci. Eng. 10.1007/s40430-022-03875-3 (2022). [ Google Scholar ] 7. Karunasena, G. et al. Effect of construction defects on construction and demolition waste management in building construction: A systematic literature review. Integr. Environ. Assess. Manag. 21 (2), 233–244. 10.1093/inteam/vjae026 (2025). [ DOI ] [ PMC free article ] [ PubMed ] [ Google Scholar ] 8. Majeed Zangana, H., Mohammed, A. & Mustafa, F. Advancements and applications of convolutional neural networks in image analysis: A comprehensive review. J. Ilmiah Comput. Sci. 3 (1), 16–29. 10.58602/jics.v3i1.30 (2024). [ Google Scholar ] 9. Lindsay, G. W. Convolutional neural networks as a model of the visual system: Past, present, and future. J. Cogn. Neurosci. 33 (10), 2017–2031 (2021). [ DOI ] [ PubMed ] [ Google Scholar ] 10. Li, C. et al. Fabric defect detection in textile manufacturing: A survey of the state of the art. Secur. Commun. Netw. 2021 , 1–13. 10.1155/2021/9948808 (2021). [ Google Scholar ] 11. Ozek, A., Seckin, M., Demircioglu, P. & Bogrekci, I. Artificial intelligence driving innovation in textile defect detection. Textiles 5 (2), 12. 10.3390/textiles5020012 (2025). [ Google Scholar ] 12. Xu, Y. et al. Zero-defect manufacturing in the textile industry: A review of current advances and challenges. Text. Res. J. 95 (1–2), 194–219. 10.1177/00405175241260892 (2025). [ Google Scholar ] 13. Ingle, N. & Jasper, W. A review of deep learning within the framework of artificial intelligence for enhanced fiber and yarn quality. Text. Res. J. 95 (7–8), 904–933. 10.1177/00405175241265510 (2025). [ Google Scholar ] 14. Wu, P. et al. A review on research and application of ai-based image analysis in the field of computer vision. IEEE Access 13 , 76684–76702. 10.1109/access.2025.3565300 (2025). [ Google Scholar ] 15. Memari, M., Shakya, P., Shekaramiz, M., Seibi, A. & Masoum, M. Review on the advancements in wind turbine blade inspection: Integrating drone and deep learning technologies for enhanced defect detection. IEEE Access 12 , 33236–33282. 10.1109/access.2024.3371493 (2024). [ Google Scholar ] 16. Bi, Y., Xue, Y., Mesejo, B., Cagnoni, P. & Zhang, S. A survey on evolutionary computation for computer vision and image analysis: Past, present, and future trends. IEEE Trans. Evol. Comput. 27 (1), 5–25 (2022). [ Google Scholar ] 17. Vinodh, S., Antony, J., Agrawal, R. & Douglas, J. Integration of continuous improvement strategies with Industry 4.0: A systematic review and agenda for further research. TQM J. 33 (2), 441–472. 10.1108/tqm-07-2020-0157 (2020). [ Google Scholar ] 18. Nagpal, R., Sharma, S. & Khanna, S. Designing with AI: Ethical Challenges and Opportunities in Indian Craft based Fashion (2025). 19. McCage, L. Future Fashion Industry: The Effects of Virtualisation of the Product Development Process., (Doctoral dissertation, University of Salford (United Kingdom)) (2024). 20. Kunasegaran, K. et al. Understanding mental fatigue and its detection: A comparative analysis of assessments and tools. PeerJ 11 , e15744. 10.7717/peerj.15744 (2023). [ DOI ] [ PMC free article ] [ PubMed ] [ Google Scholar ] 21. Longo, L., Wickens, C., Hancock, G. & Hancock, P. Human mental workload: a survey and a novel inclusive definition. Front. Psychol. 10.3389/fpsyg.2022.883321 (2022). [ DOI ] [ PMC free article ] [ PubMed ] [ Google Scholar ] 22. Sweet, J. et al. American Academy of Clinical Neuropsychology (AACN) 2021 consensus statement on validity assessment: Update of the 2009 AACN consensus conference statement on neuropsychological assessment of effort, response bias, and malingering. Clin. Neuropsychol. 35 (6), 1053–1106. 10.1080/13854046.2021.1896036 (2021). [ DOI ] [ PubMed ] [ Google Scholar ] 23. Das, A. Testing of Textile and Fibrous Materials (CRC, 2024). 24. Addis, T., Fentahun, B., Genetu, S. & Sisay, B. Cotton quality testing and characterization: trends and grading. Text. Sci. Cloth. Technol. 10.1007/978-981-99-9149-5_9 (2024). [ Google Scholar ] 25. Risdonne, V. Materials and Techniques for Coating of the Nineteenth-Century Plaster Casts. A Scientific and Archival Investigation of the Victoria & Albert Museum Cast Collection., University of Northumbria at Newcastle (United Kingdom) (2022). 26. Mamun, A. & Raj, M. Quantitative study on workflow optimization through data analytics in U.S. digital enterprises. Am. J. Interdiscip. Stud. 04 (03), 136–165. 10.63125/y2qshd31 (2023). [ Google Scholar ] 27. Saraswat, P., Agrawal, R. & Rane, S. Technological integration of lean manufacturing with Industry 4.0 toward lean automation: Insights from the systematic review and further research directions. Benchmarking Int. J. 32 (6), 1909–1941. 10.1108/bij-05-2023-0316 (2025). [ Google Scholar ] 28. Lynn, N., Sourav, A. & Santoso, A. Implementation of real-time edge detection using Canny and Sobel algorithms. IOP Conf. Ser. Mater. Sci. Eng. 1096 (1), 012079. 10.1088/1757-899x/1096/1/012079 (2021). [ Google Scholar ] 29. Islam, M. M., Mintoo, A. A. & Saimon, A. S. Enhancing textile quality control with IoT sensors: A case study of automated defect detection. Int. J. Manag. Int. J. Manag. Inf. Syst. Data Sci, 1 , 19–30 (2024). [ Google Scholar ] 30. Khanam, R., Hussain, M., Hill, R. & Allen, P. A comprehensive review of convolutional neural networks for defect detection in industrial applications. IEEE Access 12 , 94250–94295. 10.1109/access.2024.3425166 (2024). [ Google Scholar ] 31. Zhao, Z. et al. Real-time detection of particleboard surface defects based on improved YOLOV5 target detection. Sci. Rep. 11 (1), 21777 (2021). [ DOI ] [ PMC free article ] [ PubMed ] [ Google Scholar ] 32. Fu, Y., Shang, Y., Hu, W., Li, B. & Yu, Q. Non-contact optical dynamic measurements at different ranges: A review. Acta Mech. Sin. 37 (4), 537–553. 10.1007/s10409-021-01102-1 (2021). [ Google Scholar ] 33. Hassani, S. & Dackermann, U. A systematic review of advanced sensor technologies for non-destructive testing and structural health monitoring. Sensors 23 (4), 2204. 10.3390/s23042204 (2023). [ DOI ] [ PMC free article ] [ PubMed ] [ Google Scholar ] 34. Wang, Z. et al. ASAS-NANP symposium: Applications of machine learning for livestock body weight prediction from digital images. J. Anim. Sci. 10.1093/jas/skab022 (2021). [ DOI ] [ PMC free article ] [ PubMed ] [ Google Scholar ] 35. Gregory, K. et al. Understanding specific ion effects and the Hofmeister series. Phys. Chem. Chem. Phys. 24 (21), 12682–12718. 10.1039/d2cp00847e (2022). [ DOI ] [ PubMed ] [ Google Scholar ] 36. Jesus, G., Casimiro, A. & Oliveira, A. Using machine learning for dependable outlier detection in environmental monitoring systems. ACM Trans. Cyber-Phys. Syst. 5 (3), 1–30. 10.1145/3445812 (2021). [ Google Scholar ] 37. Kumar, C., Podestá, G., Kilpatrick, K. & Minnett, P. A machine learning approach to estimating the error in satellite sea surface temperature retrievals. Remote Sens. Environ. 255 , 112227. 10.1016/j.rse.2020.112227 (2021). [ Google Scholar ] 38. Khodier, M., Ahmed, S. & Sayed, M. Complex pattern Jacquard fabrics defect detection using convolutional neural networks and multispectral imaging. IEEE Access 10 , 10653–10660. 10.1109/access.2022.3144843 (2022). [ Google Scholar ] 39. Guo, P., Liu, Y., Wu, Y., Gong, R. & Li, Y. Intelligent quality control of surface defects in fabrics: A comprehensive research progress. IEEE Access 12 , 63777–63808. 10.1109/access.2024.3396053 (2024). [ Google Scholar ] 40. Zhang, H., Liu, S., Lu, S., Yao, L. & Li, P. Knowledge distillation for unsupervised defect detection of yarn-dyed fabric using the system DAERD: Dual attention embedded reconstruction distillation. Color. Technol. 140 (1), 125–143 (2024). [ Google Scholar ] 41. John, B. I. Strategic Oversight of AI-Enabled Manufacturing Transformation Advancing Process Automation, Quality Assurance, System Reliability, and Enterprise-Wide Operational Performance Excellence. Journal homepage: www.ijrpr.com ISSN, 2582 (2024). 42. Chhetri, K. B. Applications of artificial intelligence and machine learning in food quality control and safety assessment. Food Eng. Rev. 16 (1), 1–21 (2024). [ Google Scholar ] 43. Adekunle, B., Chukwuma-Eke, E., Balogun, E. & Ogunsola, K. Machine learning for automation: Developing data-driven solutions for process optimization and accuracy improvement. Int. J. Multidiscip. Res. Growth Eval. 3 (1), 800–808. 10.54660/.ijmrge.2021.2.1.800-808 (2021). [ Google Scholar ] 44. Avci, C., Budak, M., Yağmur, N. & Balçik, F. Comparison between random forest and support vector machine algorithms for LULC classification. Int. J. Eng. Geosci. 8 (1), 1–10. 10.26833/ijeg.987605 (2023). [ Google Scholar ] 45. Adugna, T., Xu, W. & Fan, J. Comparison of random forest and support vector machine classifiers for regional land cover mapping using coarse resolution FY-3C images. Remote Sens. 14 (3), 574 (2022). [ Google Scholar ] 46. Seçkin, M., Seçkin, A., Demircioglu, P. & Bogrekci, I. FabricNET: A microscopic image dataset of woven fabrics for predicting texture and weaving parameters through machine learning. Sustainability 15 (21), 15197 (2023). [ Google Scholar ] 47. Alzubaidi, L. et al. Review of deep learning: Concepts, CNN architectures, challenges, applications, future directions. J. Big Data 8 (1), 53. (2021). [ DOI ] [ PMC free article ] [ PubMed ] [ Google Scholar ] 48. Archana, R. & Jeevaraj, P. Deep learning models for digital image processing: A review. Artif. Intell. Rev. 57 (1), 11. (2024). [ Google Scholar ] 49. Ingle, N. & Jasper, W. A review of the evolution and concepts of deep learning and AI in the textile industry. Text. Res. J. 95 (13–14), 1709–1737 (2025). [ Google Scholar ] 50. Tasnim, N., Afrin, S., Biswas, B., Anye, A. & Khan, R. Automatic classification of textile visual pollutants using deep learning networks. Alexandria Eng. J. 62 , 391–402 (2023). [ Google Scholar ] 51. Zhang, H., Qiao, G., Lu, S., Yao, L. & Chen, X. Attention-based feature fusion generative adversarial network for yarn-dyed fabric defect detection. Text. Res. J. 93 , 5–6 (2023). [ Google Scholar ] 52. Essa, S., Celik, T. & Human-Hendricks, N. Personalized adaptive learning technologies based on machine learning techniques to identify learning styles: A systematic literature review. IEEE Access 11 , 48392–48409 (2023). [ Google Scholar ] 53. Abu-Doleh, A. & Al Fahoum, A. XgCPred: Cell type classification using XGBoost-CNN integration and exploiting gene expression imaging in single-cell RNAseq data. Comput. Biol. Med. 181 , 109066 (2024). [ DOI ] [ PubMed ] [ Google Scholar ] 54. Zhuldybina, M., Ropagnol, X. & Blanchard, F. Towards in-situ quality control of conductive printable electronics: A review of possible pathways. Flex. Print. Electron. 6 (4), 043007 (2021). [ Google Scholar ] 55. Khanam, R., Hussain, M., Hill, R. & Allen, P. A comprehensive review of convolutional neural networks for defect detection in industrial applications. IEEE Access 10.1109/access.2024.3425166 (2024). [ Google Scholar ] 56. Kantaros, A., Drosos, C., Papoutsidakis, M., Pallis, E. & Ganetsos, T. The role of 3D printing in advancing automated manufacturing systems: Opportunities and challenges. Automation 6 (2), 21 (2025). [ Google Scholar ] 57. Montusiewicz, J., Miłosz, M., Kęsik, J. & Żyła, K. Structured-light 3D scanning of exhibited historical clothing—A first-ever methodical trial and its results. Herit. Sci. 9 (1), 1–20 (2021). [ Google Scholar ] 58. Luo, H., Zhang, J., Liu, X., Zhang, L. & Liu, J. Large-scale 3d reconstruction from multi-view imagery: A comprehensive review. Remote Sens. 16 (5), 773 (2024). [ Google Scholar ] 59. Abdel Halim, M., Ibrahim, G. & Abdel Tawab, F. Utilizing artificial intelligence technical to develop some textile craft industries. Int. Des. J. 14 (5), 43–63 (2024). [ Google Scholar ] 60. Zhao, W. et al. EEG spectral analysis in insomnia disorder: A systematic review and meta-analysis. Sleep Med. Rev. 59 , 101457 (2021). [ DOI ] [ PubMed ] [ Google Scholar ] 61. Vujović, Ž. Classification model evaluation metrics. Int. J. Adv. Comput. Sci. Appl. 12 (6), 599–606 (2021). [ Google Scholar ] Associated Data This section collects any data citations, data availability statements, or supplementary materials included in this article. Data Availability Statement The datasets generated and/or analyzed during the current study are available from the corresponding author upon reasonable request. The dataset consists of high-resolution (4096 × 2160 pixels) fancy yarn images encompassing 12 defect classes, annotated by a panel of certified textile inspectors. Due to the proprietary nature of the textile samples and ongoing research, raw image data are not publicly available but can be obtained for academic collaboration purposes by contacting the corresponding author. Articles from Scientific Reports are provided here courtesy of Nature Publishing Group ACTIONS View on publisher site PDF (6.5 MB) Cite Collections Permalink RESOURCES Similar articles Cited by other articles Links to NCBI Databases Follow NCBI NCBI on X (formerly known as Twitter) NCBI on Facebook NCBI on LinkedIn NCBI on GitHub NCBI RSS feed Connect with NLM NLM on X (formerly known as Twitter) NLM on Facebook NLM on YouTube National Library of Medicine 8600 Rockville Pike Bethesda, MD 20894 Web Policies FOIA HHS Vulnerability Disclosure Help Accessibility Careers NLM NIH HHS USA.gov Back to Top
Related documents
- Azure AI-Driven Automation for Supply Chain and Logistics Management In#100826
- An Interdisciplinary Review of Modern Computer Science: Trends and Challenges in AI, Cybersecurity, Cloud, Blockchain, IoT, Data Science, NLP, Vision, Software Engineering, and Quantum Computing#199510
- Securing U.S. AI Leadership: A policy guide for regulation, standards and interoperability frameworks#81734
- Fabricable 3D wire art#1158474
- Three Modalities, Two Design Probes, One Prototype, and No Vision: Experience-Based Co-Design of a Multi-modal 3D Data Visualization Tool#6005
Retrieved via Conceptio: every document is proof-bundled with source, license, and retrieval metadata.
Read the Docs → · View CLI source on GitHub · Conceptio Open Knowledge Archive