Next Article in Journal
Repair of Cracked Composites and Investigation of Their Performances Under Impact Load
Previous Article in Journal
‘Flexible’ Project Management: A Guideline to Forming, Managing and Leading Student Teams for Technical Projects
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Proceeding Paper

Thread Counter Using Alex Krizhevsky Convolutional Neural Network for Philippine Indigenous Textiles †

by
Cyris Ken M. Alipio
,
Paolo B. Sarmiento
* and
Jocelyn F. Villaverde
School of Electrical, Electronics and Computer Engineering Mapua University, Manila City 1002, Philippines
*
Author to whom correspondence should be addressed.
Presented at the 7th Eurasia Conference on IoT, Communication and Engineering 2025 (ECICE 2025), Yunlin, Taiwan, 14–16 November 2025.
Eng. Proc. 2026, 134(1), 84; https://doi.org/10.3390/engproc2026134084
Published: 27 April 2026

Abstract

Thread counting is used to assess the quality and cultural significance of Philippine indigenous textiles such as Kalinga and Piña. We developed a portable system that automates the process using a Raspberry Pi 4 and the Alex Krizhevsky Convolutional Neural Network. The system processes textile images, employing AlexNet to count warp and weft threads, and displays results for real-time fabric assessment. Initial tests yielded an accuracy rate of ninety-six percent. By integrating AI and portability, this work provides a technical solution while contributing to the sustainability of cultural heritage.

1. Introduction

The textile industry is significant in the global economy and is used in many diverse ways, including clothing/apparel, interior decorations and furnishings, industrial uses, and more. It is also imperative for the manufacturers to deliver good-quality textile products and achieve regulatory compliance. Plotting is another evaluating method that is used in textiles, counting the number of threads in a fabric per inch along lengthwise (warp) and widthwise (weft) direction [1]. The prototype algorithm is stored in a portable package, inside a Raspberry Pi 4, using the Alex Krizhevsky Convolutional Neural Network (AlexNet) framework. Accurate thread counting is essential for determining the fabric’s density and overall quality, which directly impacts its durability, appearance, and suitability for different applications.
As modernization progresses, there is a growing need to streamline the laborious task of manual thread counting in the weaving industry. However, there is no focus particularly concerning indigenous clothing from the Philippines, such as Kalinga and Piña fabrics. Currently, there is no research about this version on this topic that talks about traditional clothing, as it has been modernized cultural products, and heavily industrialized products [2,3,4,5], highlighting a significant gap in the field. This study proposes a method to automate thread counting using image processing technology with a Raspberry Pi 4 and an ArduCam 64MP Camera, specifically designed to analyze hand-woven textiles.
To address the limitations of traditional thread counting, which relies on bulky, specialized cameras and technical expertise, we developed a portable, AI-driven system for the textile industry. The compact device, using a Raspberry Pi 4 and a 64 megapixel ArduCam, captures fabric images and employs an AlexNet Convolutional Neural Network to count threads. The research will evaluate the system’s performance and reliability by testing its accuracy across various textiles using image processing [6]. It will also determine the classification and training the models [7,8]. Lastly, it will ensure that it is comparable with other models [9,10].
The results of this research help reduce the arduous task of manually counting threads, thereby streamlining quality control processes. This advancement will enable manufacturers to maintain high standards of consistency and product quality. Moreover, the insights derived from this study will support the broader adoption of artificial intelligence technologies in the textile industry, fostering further innovations in quality control and process optimization [11,12].

2. Methodology

A Raspberry Pi 4 and an ArduCam 64MP Auto Focus Camera were employed to develop a portable device for capturing images of traditional Filipino hand-woven textiles, specifically Kalinga and Piña fabrics. These images served as training data for the AlexNet framework, which will be utilized for thread counting.

2.1. System Workflow

Figure 1 presents the system workflow of this study. To conduct the experiments, we assembled a portable imaging device comprising a Raspberry Pi 4 and an ArduCam 64MP Auto Focus Camera. The device captures a target dataset of 300 images of hand-woven textiles. These images were preprocessed to enhance quality and extract thread features, which were analyzed using the AlexNet model. Following preprocessing, AlexNet classifies and counts the threads. The resulting counts were validated to ensure system reliability. Finally, the outcomes were displayed through a user interface, providing an accessible visualization of the thread count results.

2.2. Hardware Component

Figure 2 illustrates the system’s hardware architecture, which consists of a Raspberry Pi 4 microcontroller, a 64 MP ArduCam camera, a 64 GB micro-SD card, an OLED display module, and a power supply. The Raspberry Pi 4 manages all input and output signals, with the system’s program and captured textile images stored on the micro-SD card. The high-resolution camera, interfaced with the Pi, captures quality textile samples, while the touchscreen display shows the thread count results and serves as the user interface. The AI model was developed on a laptop and then uploaded to the Raspberry Pi via the micro-SD card.

2.3. Software Development

Figure 3 depicts the AI-powered textile analysis workflow, starting with the acquisition of high-resolution fabric images that are first stored on a secure digital (SD) Card. The core processing uses the AlexNet CNN for feature extraction, executing the ‘alex()’ function for neural network analysis and the ‘accuracy()’ function to validate the predictions. The results, such as textile type or pattern analysis, are then displayed on a screen for the user. Finally, for long-term data management, all results are archived in a database, completing an integrated cycle of capture, analysis, and recording.

2.4. AlexNet Module

Figure 4 shows the Convolutional Neural Network (CNN) module processing an input image, where convolutional layers extract key thread features like edges and patterns. A pooling stage then consolidates this data, retaining only the most essential information. This cycle of convolution and pooling repeats until sufficient data is gathered, after which the system generates its final output: a precise thread count. This process automates the work of a skilled technician with greater speed and accuracy.

2.5. Experimental Setup

Figure 5 illustrates the experimental setup. The procedure begins by placing the cloth on a flat and stable surface, such as a table. The apparatus is then positioned over the region of interest to allow the camera to capture the designated area. Located beneath the enclosure, the camera records the image, which is subsequently transmitted to the microcontroller situated above it. The microcontroller processes the image and determines the thread count using CNN implemented with the AlexNet architecture. The final output is displayed on the screen mounted at the top of the setup, presenting both the computed thread count and the corresponding captured image.
Figure 6 showcases what the captured image looks like when the image is being captured from the experimental setup.

3. Results and Discussion

3.1. Data Acquisition

Images of Pina and Kalinga were gathered for the AlexNet model training and for the system testing. Each fabric had 300 images for the data for training and validation, a total of 600 images in entirety. The split for the data had 260 images per fabric for training, and 40 images per fabric were used for the validation set as shown in Table 1.
Figure 7 then shows the AlexNet model that captures the images, which are compared with the actual dataset gathered before. This shows the user interface that displays the processed warp and weft counts of the textile that is being captured.

3.2. Statistical Treatment

The accuracy of the thread-counting model was evaluated using standard statistical measures. Accuracy was computed as the ratio of the total number of correct predictions to the total number of instances in the dataset. The model’s performance was assessed by comparing this overall accuracy rate against the ground-truth labels in the dataset.
C o r r e c t   P r e d i c t i o n s T o t a l   N u m b e r   o f   A c t u a l   D a t a × 100 % = A c c u r a c y
Table 2 indicates that the AlexNet model achieved an accuracy of 97% for the Kalinga textile, with only nine images misclassified. For the Piña textile, the model attained an accuracy of 96.33%, with eleven images incorrectly predicted. These results demonstrate that the model is highly effective in estimating the warp and weft counts across the tested textile samples.

4. Conclusions and Recommendation

The system developed in this study achieved high accuracy in estimating warp and weft counts across 600 labeled images, 97% for Kalinga (291/300) and 96.33% for Piña (289/300), yielding an overall accuracy of 96.67% (580/600) with 20 misclassifications. These results demonstrate an effective and reliable approach for the automated analysis of indigenous textiles, while also highlighting opportunities to further strengthen performance and real-world robustness. There are several areas for improvement. Expanding the dataset to include additional textiles and varied imaging conditions, coupled with enhanced ground-truth quality through double annotation, is necessary to improve the model’s reliability. Benchmarking against newer and lightweight architectures, combined with systematic hyperparameter tuning, texture-aware augmentations, and multi-scale or patch-based inference, yields superior results beyond the baseline established by AlexNet. Furthermore, by incorporating richer evaluation metrics, such as mean absolute error, root mean square error, and ±1 thread accuracy, more comprehensive assessment of model performance can be performed. Finally, diversifying the textile samples is required to ensure authenticity aligns with the broader objective of preserving and analyzing traditional fabrics.

Author Contributions

Conceptualization, C.K.M.A. and P.B.S.; methodology, P.B.S.; software, C.K.M.A.; validation, C.K.M.A., P.B.S. and J.F.V.; formal analysis, P.B.S.; investigation, C.K.M.A.; resources, P.B.S.; data curation, C.K.M.A.; writing—original draft preparation, P.B.S.; writing—review and editing, C.K.M.A., P.B.S. and J.F.V.; visualization, C.K.M.A. and P.B.S.; supervision, J.F.V. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The raw data contained in the article will be made available by the authors if requested.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. De Las Peñas, M.L.A.N.; Garciano, A.; Verzosa, D.M.; Taganap, E. Crystallographic patterns in Philippine indigenous textiles. J. Appl. Crys. 2018, 51, 456–469. [Google Scholar] [CrossRef]
  2. Hu, Y.; Long, Z.; AlRegib, G. A High-Speed, Real-Time vision system for texture tracking and thread counting. IEEE Signal Process. Lett. 2018, 25, 758–762. [Google Scholar] [CrossRef]
  3. Novelero, J.; Mallari, R.; dela Cruz, J.; Gomez, D.; Banal, R. Color Retention Assessment of Duhat Dye to Cotton Fabric Using Color Fastness Test and Digital Image Processing. In Proceedings of the 2023 IEEE International Conference on Computing (ICOCO 2023), Langkawi Island, Malaysia, 9–12 October 2023. [Google Scholar] [CrossRef]
  4. Abdallah, M.Y.; Alqahtani, T. Research in Medical Imaging Using Image Processing Techniques. In Medical Imaging-Principles and Applications; Zhou, Y., Ed.; IntechOpen: London, UK, 2019. [Google Scholar] [CrossRef]
  5. Raut, V.; Singh, I. Digital Image Processing Based Automatic Fabric Defect Detection Techniques: A Survey. In Electronic Systems and Intelligent Computing; Mallick, P.K., Meher, P., Majumder, A., Das, S.K., Eds.; Springer: Dordrecht, The Netherlands, 2020; Volume 686, pp. 1029–1038. [Google Scholar] [CrossRef]
  6. Ramos, R.A.; Villaverde, J.F. Dried Water Lily Stem Validation for Weaving Fiber Production using K-Nearest Neighbors (K-NN) Classification Algorithm. In Proceedings of the 2024 7th International Conference on Information and Computer Technologies (ICICT); IEEE: New York, NY, USA, 2024; pp. 211–215. [Google Scholar] [CrossRef]
  7. Al Gallenero, J.; Villaverde, J.F. Identification of Durian Leaf Disease Using Convolutional Neural Network. In Proceedings of the 2023 15th International Conference on Computer and Automation Engineering (ICCAE); IEEE: New York, NY, USA, 2023; pp. 72–177. [Google Scholar] [CrossRef]
  8. Dumaliang, D.M.; Rigor, J.M.Q.; Garcia, R.G.; Villaverde, J.F.; Cuñado, J.R. Coin Identification and Conversion System using Image Processing. In Proceedings of the 2021 IEEE 13th International Conference on Humanoid, Nanotechnology, Information Technology, Communication and Control, Environment, and Management (HNICEM); IEEE: New York, NY, USA, 2021; pp. 1–6. [Google Scholar] [CrossRef]
  9. Javierto, D.P.P.; Martin, J.D.Z.; Villaverde, J.F. Robusta Coffee Leaf Detection based on YOLOv3- MobileNetv2 model. In Proceedings of the 2021 IEEE 13th International Conference on Humanoid, Nanotechnology, Information Technology, Communication and Control, Environment, and Management (HNICEM); IEEE: New York, NY, USA, 2021; pp. 1–6. [Google Scholar] [CrossRef]
  10. Luis, V.A.M.; Quiñones, M.V.T.; Yumang, A.N. Classification of Defects in Robusta Green Coffee Beans Using YOLO. In Proceedings of the 2022 IEEE International Conference on Artificial Intelligence in Engineering and Technology (IICAIET); IEEE: New York, NY, USA, 2022; pp. 1–6. [Google Scholar] [CrossRef]
  11. Thalagala, S.; Walgampaya, C. Application of AlexNet convolutional neural network architecture-based transfer learning for automated recognition of casting surface defects. In Proceedings of the 2021 International Research Conference on Smart Computing and Systems Engineering (SCSE), Colombo, Sri Lanka, 16 September 2021. [Google Scholar] [CrossRef]
  12. Macatol, Y.B.L.; Geronimo, S.V.S.; Hortinela, C.C.; Gomez, M.C.; Tongol, R.P.; Fausto, J.C. Detection of Chronic Myelogenous Leukemia Applying Support Vector Machine and Feature Extraction. In Proceedings of the 2023 Seventh International Conference on Advances in Biomedical Engineering (ICABME), Beirut, Lebanon, 12–13 October 2023. [Google Scholar] [CrossRef]
Figure 1. System workflow.
Figure 1. System workflow.
Engproc 134 00084 g001
Figure 2. Hardware component.
Figure 2. Hardware component.
Engproc 134 00084 g002
Figure 3. AI-powered textile analysis work.
Figure 3. AI-powered textile analysis work.
Engproc 134 00084 g003
Figure 4. AlexNet module.
Figure 4. AlexNet module.
Engproc 134 00084 g004
Figure 5. Experimental setup.
Figure 5. Experimental setup.
Engproc 134 00084 g005
Figure 6. Sample Kalinga textile.
Figure 6. Sample Kalinga textile.
Engproc 134 00084 g006
Figure 7. Deployed experiment apparatus.
Figure 7. Deployed experiment apparatus.
Engproc 134 00084 g007
Table 1. Data gathered in this study.
Table 1. Data gathered in this study.
FabricNumber of ImagesTrainingValidation
Kalinga30026040
Piña30026040
Table 2. Accuracy in this study.
Table 2. Accuracy in this study.
Indigenous TextileNumber of ImagesCorrect PredictionsAccuracy
Kalinga30029197%
Piña30028996.33%
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Alipio, C.K.M.; Sarmiento, P.B.; Villaverde, J.F. Thread Counter Using Alex Krizhevsky Convolutional Neural Network for Philippine Indigenous Textiles. Eng. Proc. 2026, 134, 84. https://doi.org/10.3390/engproc2026134084

AMA Style

Alipio CKM, Sarmiento PB, Villaverde JF. Thread Counter Using Alex Krizhevsky Convolutional Neural Network for Philippine Indigenous Textiles. Engineering Proceedings. 2026; 134(1):84. https://doi.org/10.3390/engproc2026134084

Chicago/Turabian Style

Alipio, Cyris Ken M., Paolo B. Sarmiento, and Jocelyn F. Villaverde. 2026. "Thread Counter Using Alex Krizhevsky Convolutional Neural Network for Philippine Indigenous Textiles" Engineering Proceedings 134, no. 1: 84. https://doi.org/10.3390/engproc2026134084

APA Style

Alipio, C. K. M., Sarmiento, P. B., & Villaverde, J. F. (2026). Thread Counter Using Alex Krizhevsky Convolutional Neural Network for Philippine Indigenous Textiles. Engineering Proceedings, 134(1), 84. https://doi.org/10.3390/engproc2026134084

Article Metrics

Back to TopTop