Revista Tecnología y Ciencia - Universidad Tecnológica Nacional
Año 24 - Número 56 / May - Ago. 2026
DOI:https://doi.org/10.33414/rtyc.56.40-58.2026
Reconocimiento-NoComercial 4.0 Internacional
Presentado: 16/10/2025
Aprobado: 11/05/2026
Publicado: 10/06/2026
Marcelo Arcidiácono
Universidad Tecnológica Nacional, Facultad Regional Córdoba, Argentina.
marcidiacono@frc.utn.edu.ar
Dolores María Eugenia Álvarez
Universidad Tecnológica Nacional, Facultad Regional Córdoba, Córdoba, Argentina.
Centro de Investigación y Tecnología Química, Universidad Tecnológica Nacional, CONICET, FRC, Córdoba, Argentina.
dalvarez@frc.utn.edu.ar
The present study proposes a Hierarchical Temporal Memory (HTM) network for the automated classification of llama (Lama glama) fibers based on medullation patterns (non-medullary, continuous, fragmented, or interrupted). The framework is grounded in the neurobiological principles of the neocortex. It leverages Sparse Distributed Representations (SDR) and adaptive Hebbian learning to acquire complex morphological features from limited datasets. The evaluation demonstrated that the HTM network achieved a classification accuracy of 0.942 and an F1-score of 0.941, exceeding the performance of Convolutional Neural Network (0.903) and Support Vector Machine (0.877) models. The proposed model also exhibited generalization capacity and robustness to input perturbation (maintaining an F1-score >0.85 with 20% noise), alongside computational efficiency (15 ms per inference). These results validate the efficacy of the HTM architecture in mitigating critical constraints of data scarcity and limited scalability. Consequently, this work underscores the model's potential for deployment in field applications with suboptimal data acquisition conditions, representing a significant advancement in resource-efficient artificial intelligence for specialized textile analysis.
Keywords: Hierarchical Temporal Memory (HTM), llama fibers, Sparse Distributed Representations (SDR).
El presente estudio propone una red de Memoria Temporal Jerárquica (HTM - Hierarchical Temporal Memory) para la clasificación automatizada de fibras de llama (Lama glama) basada en patrones de medulación (no medulada, continua, fragmentada o interrumpida). El marco se fundamenta en los principios neurobiológicos de la neocorteza. Aprovecha las Representaciones Distribuidas Dispersas (SDR - Sparse Distributed Representations) y el aprendizaje hebbiano adaptativo para adquirir características morfológicas complejas a partir de conjuntos de datos limitados. La evaluación demostró que la red HTM alcanzó una precisión de clasificación de 0,942 y una puntuación F1 de 0,941, superando el rendimiento de los modelos de Red Neuronal Convolucional (0,903) y Máquina de Vectores de Soporte (0,877). El modelo propuesto también exhibió capacidad de generalización y robustez ante perturbaciones de entrada (manteniendo una puntuación F1 >0,85 con un 20 % de ruido), junto con eficiencia computacional (15 ms por inferencia). Estos resultados validan la eficacia de la arquitectura HTM para mitigar las limitaciones críticas de escasez de datos y escalabilidad limitada. En consecuencia, este trabajo subraya el potencial del modelo para su implementación en aplicaciones de campo con condiciones de adquisición de datos subóptimas, lo que representa un avance significativo en la inteligencia artificial eficiente en el uso de recursos para el análisis textil especializado.
Palabras Claves: Memoria Temporal Jerárquica (HTM), Fibras de Llama, Representaciones Distribuidas Dispersas (SDR)
Domestic and wild camelids are a highly valued productive resource for Andean subsistence (Vilá & Arzamendia, 2022). As the oldest major livestock group in the region, they exhibit remarkable physiological adaptations to extreme environmental conditions. Fiber and meat production represents a critical economic activity that generates essential employment and supports the pastoral livelihoods of rural communities (Kishore et al., 2024; Mueller et al., 2015). This productive centrality positions the sector as a primary target for development strategies aimed at fostering the adoption of sustainable technologies and practices, with a particular emphasis on enhancing fiber quality and yield (Barra Novoa, 2024). However, the potential for competitive integration into the international specialty fiber market, and thereby accessing high-value niches, is contingent upon overcoming a critical technological gap. This requires the integration of specialized knowledge and standardized protocols for the classification, grading, conditioning, and objective valuation of fiber based on international technological parameters (Lamas, 2007; Barra Novoa, 2023; Quispe et al., 2025). Consequently, the modernization of these practices is established as a sine qua non for ensuring the long-term sustainability and competitiveness of the camelid value chain.
Animal fibers share a fundamental morphological structure, with a key differentiating feature being the presence –or absence– of a central medulla (McGregor, 2018). The primary quantitative metrics for assessing textile fiber quality are mean fiber diameter (MFD) and curvature (CV). Qualitatively, the proportion, uniformity, and architectural type of the medulla are also critical diagnostic parameters (Condor et al., 2022). These factors are decisive in determining the suitability of these fibers for different applications (Zúñiga et al., 2022). Among these, MFD is the principal commercial criterion, as it is the foremost determinant of both market price and manufacturing performance, influencing factors such as softness and prickle (Amorena et al., 2021). CV, a property dictated by the crimp angle, is intrinsically linked to the loft and insulation capacity of the resulting yarns and fabrics (Quispe et al., 2024). Furthermore, the distribution of MFD, specifically its uniformity and the proportion of fibers under the 30 μm threshold, is a key indicator of superior quality, as it directly affects the visual appearance, tactile comfort, and processing behavior during spinning (Frank, 2017; Mamani-Cato et al., 2022). The characteristics of the medulla (proportion and uniformity) further influence these properties, impacting the final product's aesthetics and manufacturing efficiency (Frank, 2021).
The medulla type is one of the characteristics that determines fiber performance (McGregor, 2018). Greater rigidity in objectionable fibers is due not only to their larger diameter but also to the condition of the medulla: continuous or strongly medullated (Pinares & Quispe, 2024). The accurate identification of natural fibers based on medullation characteristics and their resultant biomechanical properties is, therefore, a crucial yet challenging endeavor in multiple fields (Azémard et al., 2021). In the textile industry, accurately identifying fibers is crucial for determining important product characteristics such as quality, functionality, and commercial value (Frank et al., 2021; Frank, 2017). Conventional identification methods rely on physicochemical techniques, which are often time-consuming and resource-intensive (Zoccola et al., 2023). Classical instrumentation for this purpose includes projection microscopes, airflow, Laserscan and Optical Fiber Diameter Analyzers (OFDA). However, some of these methods are polluting, slow, destructive to the sample, and require prior user training (Amorena et al., 2021).
Recently, image-processing algorithms have been utilized to identify animal fibers more precisely by analyzing their texture and morphology (Zoccola et al., 2023). There is extensive literature on fiber identification through image analysis. Some authors propose using pre-trained deep learning neural networks (convolutional networks), which take advantage of feature extraction modules and use transfer learning techniques (Luo et al., 2021; Wang & Jin, 2018; Xing et al., 2022; Yildiz, 2020; Zang et al., 2022a). In general, these models achieve an accuracy level of over 95%. Other authors have proposed an approach based on analyzing morphological characteristics to train different machine learning models (Xing et al., 2019a; Xing et al., 2020; Zhong et al., 2017). These techniques achieve an accuracy level of over 90%. Support Vector Machines (SVM) have also been successfully used as an alternative to neural networks for fiber identification, achieving accuracies exceeding 90% (Lu et al., 2019; Xing et al., 2019b; Zang et al., 2022b; Zhu et al., 2023a; Zhu et al., 2023b).
Artificial neural networks have demonstrated great potential for classifying complex patterns in various domains, such as image recognition, biomedical analysis, and pattern detection (Sarmiento-Ramos, 2020). However, llama fibers possess complex, sequential structural patterns (e.g., absence of medulla, continuous medulla, fragmented or interrupted medulla) that require models capable of learning spatiotemporal hierarchies for identification. Although traditional Convolutional Neural Networks (CNNs) achieve a high level of accuracy, they struggle with generalization in the presence of subtle morphological variations (Xing et al., 2022; Zhu et al., 2023a). Additionally, they only process static images, lacking temporal context (Hawkins et al., 2009).
Neural networks based on Hierarchical Temporal Memory (HTM), which are inspired by the memory-prediction theory of brain function (Hawkins & Blakeslee, 2004), offer significant advantages. Due to their ability to account for temporal dependencies, HTM can model the sequential morphological variations of llama fibers, such as fragmented medullary patterns in consecutive images (Hawkins et al., 2009). They are more robust and computationally efficient than Support Vector Machines and artificial neural networks (Fallas-Moya & Torres-Rojas, 2018; Zyarah & Kudithipudi, 2023). Theoretical aspects of HTM networks are described in Hawkins & George (2006) and Hawkins et al. (2009).
The objective of this work is to develop an HTM model for the automated classification of llama (Lama glama) fibers based on their medullation patterns (non-medullary, continuous, fragmented, or interrupted). This capability is important in resource-constrained and geographically dispersed operational environments.
The network was trained using a set of 126 images of longitudinal sections of llama (Lama glama) fibers exhibiting no medulla, continuous medulla, fragmented medulla, and interrupted medulla. The samples were prepared and conditioned to remove impurities and ensure clear observation of the medulla structure. The images were obtained in the Laboratory of Productive Sustainability of Small Ruminants in Disadvantaged Areas (SUPPRAD), Faculty of Agricultural Sciences, Catholic University of Córdoba. To achieve high-resolution images, specific preparation and fixation techniques were employed using Canada balsam (Delbón et al., 2024). The samples were characterized using an OLYMPUS x100 microscope coupled with a 5.1 MPx OPTIKA-C-B5 digital camera.
Fig 1. Microscopic images (40x) of the four llama fiber classes analyzed: (a) Non-medullated, (b) Continuous, (c) Fragmented, and (d) Interrupted. The morphological variations between (c) and (d) present the primary classification challenge.
To enhance visual contrast, lighting conditions were carefully adjusted. This enhancement was accomplished through the implementation of directional and polarized lighting, utilizing LED light sources with appropriate intensity and angle of incidence control. This approach minimized reflections and maximized edge differentiation. To reduce noise and highlight useful information, image enhancement techniques such as digital contrast adjustment (Bourne, 2010), contrast-limited adaptive histogram equalization (CLAHE) (Musa et al., 2018), Gaussian filtering (Ofir et al., 2019), and edge enhancement with a Canny filter (Rubiagatra, 2023) were applied.
To ensure the independence of the evaluation and prevent data leakage, the original dataset of 126 images was first partitioned into a training set (~70%, 90 images) and a hold-out test set (~30%, 36 images). Data augmentation techniques (mirror reflection, angle rotation, contrast modification, and random cropping) (Hao, 2023) were then applied exclusively to the training subset in order to mitigate data scarcity and improve model robustness. Consequently, the training set was expanded to 560 samples (distributed across 4 classes), while the test set remained composed entirely of original, non-augmented images. This protocol ensures that the reported metrics reflect the model's generalization capacity on unseen fiber samples.
The sequence for implementing the proposed HTM model is presented in Figure 2 and described below.
Fig. 2: Implementation sequence of the proposed Hierarchical Temporal Memory (HTM) model.
Fig. 3: Simplified encoding of an 8 x 8 patch to SDR. Detected edges (black) are encoded as 1 and the background as 0. Each active pixel is connected to random but fixed bits in the SDR, resulting in a high-dimensional vector (16 bits) with controlled sparsity (~19% in this example; ~2% in actual implementations). The active bits (red) preserve spatial relationships through controlled overlap (<15%)
The encoder is an essential component in this model, as it transforms the input image into a sparse distributed representation (SDR) (Figure 3). An SDR is defined as a high-dimensional binary vector wherein only a limited subset of bits is active, typically accounting for approximately 2%. This configuration simulates the sparse activation patterns characteristic of the neocortex (Hawkins & Ahmad, 2016). The input image is divided into 64 x 64 pixel patches. Each pixel activates (1) or inhibits (0) the neurons in the input layer of the HTM. Each patch is encoded in an SDR using fixed random projections (Ahmad & Hawkins, 2015) that preserve spatial relationships, assigning nearby pixels to overlapping bits (as shown in Figure 3).
Regional SDRs are merged using bitwise OR operations, preserving a global sparsity of 2% and controllable overlap (<15%) between patterns (Ahmad & Hawkins, 2015). This mitigates interference and facilitates generalization (Cui et al., 2017). The coding approach aims to minimize the loss of critical spatial information by preserving local patterns. This results in stable SDR representations (high SDR overlap) and provides immunity to noise (e.g., random noise, edge omission) at levels of up to 20% pixel disturbance. These properties directly improve generalization in downstream HTM layers (Cui et al., 2017).
The binary SDR generated by the encoder (x Є {0,1}2048) is processed by the Spatial Pooler (SP). The resulting output SDR is characterized by semantic preservation; similar inputs yield outputs with under 15% overlap (Cui et al., 2017). It is also robust to noise and minor disturbances (Pietroń et al., 2016). Furthermore, its efficiency is ensured by a fixed sparsity of 2% (41 out of 2048 active columns). This sparsity promotes generalization while minimizing computational cost (Hawkins & Ahmad, 2016).
Fig. 4: Proposed structure for the Spatial Pooler. Each column of the SP (size 2048) receives direct inputs from the input SDR bits
The SP generates an SDR output using a multi-stage process. Initially, synaptic connections are established by randomly linking each of the 2048 columns to 512 bits of the input SDR. Each synapse is assigned a permanence value p Є [0,1], where p>0.5 defines an active synapse.
During the overlap calculation, the activation of each column is computed based on the alignment between the active input bits and their connected synapses. This is expressed as:
(1)
where cij =1 if the synapse is active. Columns with overlap below the minimum threshold (i<θmin) are temporarily inhibited. In contrast, less active columns receive dynamic boosting to facilitate learning (Ibrayev et al., 2018).
While the initial merging of fragments via bitwise OR operations in the Encoder stage increases the activation density -from an average initial sparsity of approximately 3% per individual fragment to a fused density of 15–25%-the Spatial Pooler (SP) acts as a strict normalization filter. Through Global Inhibition, the SP enforces a k-winner-take-all rule, selecting only the top 41 columns (2% of the 2048-dimensional space) with the highest feedforward overlap. This mechanism ensures that, regardless of the temporary density surge from the encoder, the output SDR transmitted to the Temporal Memory (TM) is strictly re-sparsified to maintain a fixed 2% sparsity, preserving the mathematical properties required for robust sequence learning (Mnatzaganian et al., 2016).
Finally, Hebbian learning strengthens or weakens the synapses of the activated columns. If input bit xj is active, permanence increases as p→p+0.05(1-p). Otherwise, permanence decreases as p→p-0.05p. This process reinforces relevant connections and consolidates frequent patterns (Miconi, 2021). The resulting SDR is stable and semantically meaningful, preserving the 2% sparsity and robustness properties required for TM processing.
|
Parameter |
Value |
Justification |
|
Number of columns |
2048 |
Balance between capacity and efficiency. |
|
Output sparsity |
2% |
Aligned with neocortical biology (Hawkins & Ahmad, 2016) |
|
Learning rate |
0.05 |
Avoid overfitting. |
Table 1: Spatial Pooler configuration parameters and parameter values.
The TM algorithm extends the spatial processing capabilities of the SP into the temporal domain, enabling the learning of sequential patterns and context-based prediction of future activations. In the proposed architecture, the TM module processes the SDRs generated by the SP –which consist of 2048 columns with 2% sparsity– and transforms them into a dynamic representation that captures temporal dependencies inherent in the fiber structures. By interpreting the elongated morphology of the fibers as a spatial sequence, the model effectively learns and predicts transitions between morphological states, thereby incorporating temporal context into the representation learning process.
Fig. 5: Neural Activation Dynamics in Predictive State. Schematic illustrating the propagation of a new input stimulus. Neurons are activated via two pathways: (1) fulfillment of prior predictions (reactivating neurons in a predictive state), and (2) direct feedforward excitation from the input SDR. This dual mechanism enables temporal prediction and context-aware sequence learning.
The TM training process treats the static fiber image as a pseudo-temporal sequence. Fiber images are segmented along the longitudinal axis (8 segments), with each section encoded into an SDR to capture local medullary features. By scanning the fiber longitudinally, the model interprets spatial transitions (e.g., from a medullated section to an interruption) as temporal events. This allows the TM to learn the "grammar" of the fiber's morphology, predicting the likelihood of the next segment based on the context of previous segments (Streat et al., 2016). As shown in the fragmentation analysis in Figure 8, this segmentation strategy is critical; an optimal balance was selected to maximize the resolution of these transitions while maintaining computational efficiency. During prediction, TM activates cells based on current input overlap (>10 synapses) or prior predictive states from Hebbian associations. Synaptic permanences are reinforced (Δp=+0.1) for correct predictions and diminished (Δp=-0.05) for errors. Residual column activation persists to model structural state transitions, following established cortical learning principles (Hawkins & Ahmad, 2016).
|
Parameter |
Value |
Justification |
|
TM columns |
2048 |
Consistency with the SP. |
|
Cells per columns |
32 |
Balance between granularity and efficiency. (Ahmad & Hawkins 2015) |
|
(reinforcement) |
+0,1 |
Empirical adjustment for stable convergence. |
|
(inhibition) |
-0.05 |
Avoid catastrophic forgetfulness. (Miconi, 2021) |
Table 2: Temporal Memory configuration parameters and hyperparameter values.
The model's performance was evaluated using a confusion matrix. The F1-score (2), calculated as the harmonic mean of Precision (3) and Recall (4), was employed as the primary metric:
(2)
(3)
(4)
TP, FP, and FN represent the number of true positives, false positives, and false negatives, respectively.
The HTM model was implemented in Python 3.10 using Numenta's htm.core library (v1.2.0), along with auxiliary libraries such as NumPy (v1.22) and Numba (v0.56) for numerical optimization. The code was executed on a system with an Intel Core i7-4710MQ CPU (2.50 GHz) and 16 GB of RAM. Unlike traditional artificial neural networks that rely on batch processing, the HTM model operated under a continuous sequential processing paradigm (an effective batch size of 1), which is inherent to its online learning architecture. Under the 10-fold cross-validation protocol, each training fold processed 504 images, generating 32,256 one-dimensional Sparse Distributed Representation (SDR) vectors of 2048 components per epoch. Exploiting the fast-learning capabilities of the HTM algorithm, the model demonstrated rapid convergence, typically stabilizing within 10 to 15 epochs. The computational time required was approximately 15 seconds per epoch. Consequently, the total experimental time to complete the entire 10-fold cross-validation process—encompassing image fragmentation, binarization, SDR conversion, and model training—was approximately 45 minutes.
To evaluate tolerance to disturbances, test images were modified using additive Gaussian noise (σЄ[0,0.3]) and random occlusions (up to 20% of the area). At each noise level, the F1-score was calculated for all classes (non-medullated fibers–NMF, continuous fibers–CF, fragmented fibers–FF, and interrupted fibers–FI), using the same validation set.
To validate the stability of the model and mitigate the bias inherent in small datasets, a 10-fold cross-validation protocol was employed. The dataset was partitioned into 10 subsets; in each iteration, 9 subsets were used for training and 1 for testing. The reported metrics (Accuracy, F1-Score) represent the mean values across these 10 independent runs, with standard deviations calculated to quantify the variance and ensure the statistical reliability of the results. Additionally, to evaluate computational efficiency, the mean inference time was computed on a dataset of test images. This measurement was repeated across 10 independent trials under controlled computational conditions (i.e., no exogenous system load).
For performance comparison, a Convolutional Neural Network (CNN) based on a ResNet-18 architecture (pre-trained on ImageNet) was implemented. This specific architecture was selected as the baseline due to its proven stability in transfer learning for small datasets, avoiding the high risk of overfitting associated with deeper or transformer-based models in data-scarce regimes (Khobragade et al., 2022). The network comprised convolutional layers with 3×3 kernels, ReLU activation, max-pooling (2×2), and a fully connected output layer with 4 neurons and a softmax activation function. It was trained using the Adam optimizer (learning rate=0.001, 50 epochs, batch size=16), with data augmentation through rotations and flips. Additionally, a Support Vector Machine (SVM) with a radial basis function (RBF) kernel (C=1.0, gamma='scale') was implemented using feature vectors extracted via SIFT and Bag of Visual Words (BoVW) with a vocabulary of 500 words. Preprocessing steps (CLAHE and Canny edge detection) were identical to those applied to the HTM model.
The contrast in the original image (Figure 6a) was enhanced using the CLAHE technique, alongside adaptive Gaussian and Canny filters (Figures 6b and 6c). For CLAHE, the contrast limitation threshold was set to 3, and the tile grid was configured to 8×8 pixels. The adaptive Gaussian filter was applied with a kernel size of 5 and an adjustment rate of 0.4, based on the image's median. Similarly, the Canny filter used an adjustment rate of 0.33.
Fig. 6: Result of processing an input image. (a) Image of a disrupted medullary fiber measuring 512 x 512 pixels, (b) with CLAHE applied, and (c) with adaptive Gaussian Canny filters. Note: Residual artifacts or background noise (e.g., bottom-left corner) are naturally filtered during the SDR encoding process due to the sparsity constraints, which prioritize contiguous morphological patterns over isolated static noise.
Fig. 7: Sparse Distributed Representation (SDR) of three fragments, measuring 64 x 64 pixels, from the input image.
The input images (512×512 pixels) were segmented into 64 fragments. Subsequently, the data underwent conversion to binary format with a threshold of 128 on a grayscale. This was followed by an encoding projection into 64 one-dimensional Sparse Distributed Representation (SDR) vectors, each comprising 2048 components, characterized by values of 0 and 1. An illustrative representation of this process is depicted in Figure 7. Each generated SDR represents only a part of the image. To obtain a global SDR, the fragments were combined using an OR operation. In the absence of fiber content in a given fragment (e.g., fragment [B]), the SDR representation consists exclusively of 0s. Conversely, if the fragment contains a fiber (such as fragments [A or C]), the SDR representation will include both 0s and 1s.
As depicted in Figure 8, the employment of the OR operation influences the stability of the SDR and the precision of the HTM model. The accuracy of the fragmenting process is observed to improve significantly when the fragments are divided into 4 or 16 sub-fragments. To optimize the fragmentation parameter without compromising the final evaluation metrics, these measurements were conducted exclusively on a held-out validation set (derived from the training data). As shown in Figure 8, at 64 sub-fragments, the performance exhibits diminishing returns, indicating an optimal trade-off with computational cost rather than complete stabilization.
Fig. 8: Impact of fragment count on SDR stability (solid blue line) and HTM model accuracy (dashed red line). Metrics were computed on a distinct validation set split from the training data to prevent overfitting. Although the trend remains positive, 64 fragments were selected as the optimal trade-off between classification performance and encoding complexity.
The confusion matrix (Figure 9) demonstrates the model's overall efficacy, with an F1-score of 0.941, particularly notable for its adeptness in the classification of non-medullated fibers (NMF). Errors in classification are predominantly concentrated among morphologically similar classes, such as fragmented fibers (FF) and interrupted fibers (IF)
Fig. 9: confusion matrix for the HTM-based fiber classification model. NMF: non-medullated fibers, CF: continuous fibers, FF: fragmented fibers, IF: interrupted fibers.
The model demonstrates optimal accuracy in non-medullated fibers (NMF, F1=1.0), with progressively lower performance in continuous medullated fibers (CF, 0.976), fragmented fibers (FF, 0.905), and interrupted fibers (IF, 0.884). A considerable proportion of these errors occur between structurally analogous classes, such as FF and IF, coinciding with limitations outlined in the context of textile characterization (McGregor, 2018). The minimal variation in precision and sensitivity (less than 0.02) suggests balanced classifications among all categories.
A summary of the model's performance metrics are presented in Table 3:
|
Fiber |
Precision |
Recall |
F1-Score |
|
NMF |
1.000 |
1.000 |
1.000 |
|
CF |
1.000 |
0.952 |
0.976 |
|
FF |
0.905 |
0.905 |
0.905 |
|
IF |
0.864 |
0.905 |
0.884 |
Table 3: Performance metrics of the models, according to their classification. Non-medullary fiber (NMF), continuous medullary fiber (CMF), fragmented medullary fiber (FMF), interrupted medullary fiber (IMF).
Table 4 depicts a comparison of the different models.
|
Model |
Precision |
F1-Score |
Time Inference [ms] |
|
HTM |
0.942 ± 0.014 |
0.941 ± 0.018 |
15 ± 2 |
|
CNN |
0.903 ± 0.035 |
0.901 ± 0.041 |
50 ± 5 |
|
SVM |
0.877 ± 0.008 |
0.873 ± 0.009 |
10 ± 1 |
Table 4: Comparison of the performance metrics and inference times of the HTM, CNN, and SVM models.
In the comparative evaluation, the HTM approach demonstrated an optimal balance between accuracy, stability, and computational efficiency. As indicated in Table 4, the proposed model demonstrated superior performance in classification metrics when compared to both the CNN and SVM alternatives. Specifically, the HTM model achieved the highest levels of accuracy (0.942 ± 0.014) and F1-score (0.941 ± 0.018) in this evaluation. The low standard deviation observed across the validation folds confirms the model's robustness and consistent performance despite the limited dataset size. Although the SVM was approximately 33% faster (10 ms), its lower accuracy makes it unviable for applications requiring high reliability. Conversely, the CNN, despite its theoretical robustness, showed the highest latency (50 ms), limiting its utility in real-time environments.
Fig. 10: Correlation between the level of noise interference and the HTM F1-score
Figure 10 shows the robustness of the HTM model against incremental noise, maintaining an F1-score >0.85 even with 20% perturbation. The gradual degradation (∼0.05 of F1 for every +10% of noise) suggests that HTM replicates the resilience of cortical neural networks, where small perturbations do not compromise overall functionality.
The CNN demonstrated an accuracy of 0.930; however, it exhibited reduced robustness to subtle morphological variations, a consequence of its inability to adapt to dynamic changes in the fibers. These characteristics were also identified in the model developed by Zhu et al. (2023a). While a custom lightweight CNN might appear computationally suitable for this task, the selection of a Transfer Learning architecture (ResNet-18) was strategic. Training convolutional networks from scratch with an extremely limited dataset (126 original images) typically leads to severe overfitting and convergence instability due to the lack of sample variability (Khobragade et al., 2022). By employing a model pre-trained on ImageNet, we leveraged robust, generalized feature extractors (e.g., edge and texture detection) optimized on massive domains. This approach establishes a more rigorous and competitive baseline for "Small Data" scenarios than what is generally achievable with custom architectures without massive synthetic data augmentation (Malik & Bzdok, 2022). Although the SVM demonstrated speed (10 milliseconds per inference), representative of the classical computer vision algorithms currently embedded in commercial textile analyzers (Zhu et al., 2024), its accuracy (0.877) was constrained by its feature representation. This limitation hinders the ability to capture sequential dependencies, as observed in the model developed by Xing et al. (2022). Consequently, the proposed HTM model achieved superior performance, with an accuracy of 0.942 and an F1-score of 0.941, demonstrating the value of bio-inspired architectures over traditional industrial baselines. This advantage stems from its capacity to process spatiotemporal patterns in fibers exhibiting complex structures (FF/IF).
The errors were concentrated in morphologically similar classes (FF and IF), which corresponds with the challenges reported in the literature (McGregor, 2018). A thorough investigation revealed that these confusions tend to arise in regions where the stem exhibits ambiguous transitions, particularly in brief fragments that the encoder interprets as "interruptions". In this particular instance, the issue could be mitigated by incorporating an extended temporal context in TM by analyzing more than eight longitudinal segments, albeit with an increased computational cost.
The model demonstrated superior noise tolerance in comparison to the evaluated CNN/SVM models, exhibiting an F1-score >0.85 with 20% disturbance (see Figure 10). This property is critical for operation in unconstrained environments, where images could be flawed due to unsatisfactory capture conditions. The gradual degradation (0.05 loss in F1 for every 10% additional noise) reflects the resilience of cortical neural networks.
The high performance of the HTM model, achieved with only 126 original images, highlights its ability to learn robust patterns even with a small dataset. This computational efficiency can be attributed to a combination of three factors. First, the use of SDRs allows the model to encode images into high-dimensional binary vectors with minimal activations. This promotes the extraction of discriminative features while inherently mitigating overfitting and the need for extensive datasets. Second, the fragment fusion stage employs logical OR operations to aggregate local patterns into a stable global representation, maximizing the utility of information contained within limited samples. Finally, the model leverages Hebbian learning with a small adaptive synaptic reinforcement value (0.05). This learning rule prioritizes frequently observed features, facilitating robust generalization from few examples per class.
In contrast to classical approaches, the evaluated CNN required approximately 50 epochs and extensive datasets to achieve 0.930 accuracy. The proposed HTM model, however, attained a superior level of efficiency—reaching 0.942 accuracy in fewer than 15 epochs on average—due to its unique design based on sparse representations and Hebbian learning. This efficiency is especially beneficial in the presence of resource constraints. The HTM exhibits superior accuracy and robustness compared to conventional models. The model's underlying architecture confers high scalability, making it suitable for in-the-wild deployment under stringent requirements for computational efficiency and fault tolerance. This capability, coupled with its proficiency in learning from limited data, enables novel avenues for automated textile analysis in non-ideal conditions.
The Hierarchical Temporal Memory (HTM) model establishes a robust computational framework for the automated classification of medullary patterns in llama fibers. Its inherent capacity for generalization and the learning of complex morphological features from limited datasets has been demonstrated. Furthermore, the model exhibits notable noise tolerance and computational efficiency, rendering it particularly viable for operational environments with suboptimal data acquisition conditions. This capability effectively overcomes two critical constraints in practical applications: limited scalability and data scarcity. The findings substantiate the efficacy of HTM for specialized fiber classification and underscore its potential for extension to more extensive textile analysis challenges. This work signifies a substantial advancement in the development of adaptable and resource-efficient artificial intelligence systems for resource-constrained environments.
References
Ahmad, S., & Hawkins, J. (2015). Properties of sparse distributed representations and their application to hierarchical temporal memory. https://arxiv.org/abs/1503.07469
Amorena, J. I., Álvarez, D. M. E. & Fernández-Ahumada, E. (2021). Development of Calibration Models to Predict Mean Fibre Diameter in Llama (Lama glama) Fleeces with Near Infrared Spectroscopy. Animals 11(7), 1998. https://doi.org/10.3390/ani11071998
Azémard, C., Dufour, E., Zazzo, A., Wheeler, J. C., Goepfert, N., Marie, A., & Zirah, S. (2021). Untangling the fibre ball: Proteomic characterization of South American camelid hair fibres by untargeted multivariate analysis and molecular networking. Journal of proteomics, 231, 104040. https://doi.org/10.1016/j.jprot.2020.104040
Barra Novoa, R. (2023). Analysis of Competitiveness, Market and Consumer Trends for the Camelid Livestock Value Chain. Market and Consumer Trends for the Camelid Livestock Value Chain (July 31, 2023). https://hal.science/hal-04353403v1
Barra Novoa, R. (2024). Analysis of Market Trends and Competitiveness of the Camelid Livestock Value Chain in the North of Chile. https://doi.org/10.20944/preprints202410.0196.v1
Bourne, R. (2010). Contrast adjustment. In: Fundamentals of digital imaging in medicine. 109-135. Springer, London. https://doi.org/10.1007/978-1-84882-087-6_6
Condor, J. R., Paucar, Y., & Paucar, R. (2022). Caracterización morfológica, parámetros productivos y características textiles en llamas (Lama glama) K’ara en Huancavelica. Revista de investigación Agropecuaria Science and Biotechnology, 2(3), 21-31. https://doi.org/10.25127/riagrop.20223.846
Delbón, N., Machado, A. S., Cabrera, V. A., Wiemer, A. P., Matesevach Becerra, A. M., Chiarini, F. E., & Saur Palmieri, V. (2024). Técnicas de histología vegetal: Manual teórico-práctico. ISBN: 978-631-00-3158-3. https://ri.conicet.gov.ar/handle/11336/253125
Cui, Y., Ahmad, S., & Hawkins, J. (2017). The HTM spatial pooler—A neocortical algorithm for online sparse distributed coding. Frontiers in computational neuroscience, 11, 111 https://doi.org/10.3389/fncom.2017.00111
Fallas-Moya, F., & Torres-Rojas, F. (2018). Object recognition using hierarchical temporal memory. In Intelligent Computing Systems: Second International Symposium, ISICS 2018, Merida, Mexico, March 21-23, 2018, Proceedings 2 (pp. 1-14). Springer International Publishing. https://doi.org/10.1007/978-3-319-76261-6_1
Frank, E. (2017). Comercialización de Fibras de Camélidos Sudamericanos. Serie Documentos Internos SUPPRAD 5, Red SUPPRAD 2016. https://hdl.handle.net/20.500.12032/44260
Frank, E., Prieto, A., Castillo, M. F., Segueti Frondizi, D. G., Mamani-Cato, R. H. & Hick, M. V. H. (2021). The Prickle Effect Comes From Fabrics Made of South American Camelid (Alpaca and Lama) Fibers. Mechanical and/or Genetic Solutions. A Review. European Journal of Applied Sciences 9(3). https://doi.org/10.14738/aivp.93.10130
Hao, X., Liu, L., Yang, R., Yin, L., Zhang, L., & Li, X. (2023). A review of data augmentation methods of remote sensing image target recognition. Remote Sensing, 15(3), 827. https://doi.org/10.3390/rs15030827
Hawkins, J., & Ahmad, S. (2016). Why neurons have thousands of synapses, a theory of sequence memory in neocortex. Frontiers in neural circuits, 10, 23. https://doi.org/10.3389/fncir.2016.00023
Hawkins, J., & Blakeslee, S. (2004). On intelligence: how a new understanding of the brain will lead to the creation of truly intelligent machines. Macmillan. ISBN: 9780805074567 / 0805074562
Hawkins, J., George, D. (2006) Hierarchical temporal memory, concepts, theory, and terminology. Numenta, Tech. Rep.
Hawkins, J., George, D. & Niemasik, J. (2009). Sequence memory for prediction, inference and behaviour. Philosophical Transactions of the Royal Society B: Biological Sciences 364(1521). 1203–1209. https://doi.org/10.1098/rstb.2008.0322
Ibrayev, T., Myrzakhan, U., Krestinskaya, O., Irmanova, A., & James, A. P. (2018). On-chip face recognition system design with memristive hierarchical temporal memory. Journal of Intelligent & Fuzzy Systems: Applications in Engineering and Technology, 34(3), 1393-1402. https://doi.org/10.3233/JIFS-169434
Kishore, A., Pal, B., & Sarkar, P. (2024). Camelids for sustainability: a socio-economic perspective. Asian J. Environ. Ecol, 23(1), 53-72. https://doi.org/10.9734/AJEE/2024/v23i1521
Khobragade, V., Nirmal, J., & Chedda, S. (2022). Revaluating Pretraining in Small Size Training Sample Regime. International Journal of Electrical and Electronics Research, 10(3), 694–704. https://doi.org/10.37391/ijeer.100346
Lamas, H. (2007). Desarrollo del encadenamiento productivo de la llama en la provincia de Jujuy, República Argentina. Primer Borrador de Avance, proyecto “Desarrollo del encadenamiento productivo de la llama en la provincia de Jujuy, República Argentina”.
Lu, K., Luo, J., Zhong, Y., & Chai, X. (2019). Identification of wool and cashmere SEM images based on SURF features. Journal of engineered fibers and fabrics, 14, https://doi.org/10.1177/1558925019866121
Luo, J., Lu, K., Chen, Y., & Zhang, B. (2021). Automatic identification of cashmere and wool fibers based on microscopic visual features and residual network model. Micron, 143, 103023. https://doi.org/10.1016/j.micron.2021.103023
Malik, N., & Bzdok, D. (2022). From YouTube to the brain: Transfer learning can improve brain-imaging predictions with deep learning. Neural Networks, 153, 325–338. https://doi.org/10.1016/j.neunet.2022.06.014
Mamani-Cato, R. H., Frank, E. N., Prieto, A., Castillo, M. F., Condori-Rojas, N., & Hick, M. V. H. (2022). Effect of fibre diameter, prickle factor and coarse fibre bias on yarn surface hairiness in South American camelids (SAC) fibre. Fibers, 10(2), 18. https://doi.org/10.3390/fib10020018
McGregor, B. A. (2018). Physical, Chemical, and Tensile Properties of Cashmere, Mohair, Alpaca, and Other Rare Animal Fibers. In: Handbook of Properties of Textile and Technical Fibres, 2nd ed.; Bunsell, A.R., Ed.; Woodhead Publishing: Sawston, UK. pp. 105–136. ISBN 978-0-08-101272-7. https://doi.org/10.1016/B978-0-08-101272-7.00004-3
Miconi, T. (2021). Hebbian learning with gradients: Hebbian convolutional neural networks with modern deep learning frameworks. arXiv preprint arXiv:2107.01729. https://doi.org/10.48550/arXiv.2107.01729
Mnatzaganian, J., Fokoué, E., & Kudithipudi, D. (2016). A Mathematical Formalization of Hierarchical Temporal Memory’s Spatial Pooler. arXiv. https://doi.org/10.48550/arxiv.1601.06116
Mueller, J. P., Rigalt, F., Lamas, H., Sacchero, D. M., Cancino, A. K. & Wurzinger, M. (2015). Fibre quality of South American camelids in Argentina: a review. Animal Genetic Resources. 2015, 56, 97–109. https://doi.org/10.1017/S2078633614000496
Musa, P., Al Rafi, F., & Lamsani, M. (2018). A Review: Contrast-Limited Adaptive Histogram Equalization (CLAHE) methods to help the application of face recognition. In: 2018 third international conference on informatics and computing (ICIC) (pp. 1-6). IEEE. https://doi.org/10.1109/IAC.2018.8780492
Ofir, N., Galun, M., Alpert, S., Brandt, A., Nadler, B., & Basri, R. (2019). On detection of faint edges in noisy images. IEEE transactions on pattern analysis and machine intelligence, 42(4), 894-908. https://doi.org/10.1109/TPAMI.2019.2892134
Pietroń, M., Wielgosz, M., & Wiatr, K. (2016). Formal analysis of HTM spatial pooler performance under predefined operation conditions. In Rough Sets: International Joint Conference, IJCRS 2016, Santiago de Chile, Chile, October 7–11, 2016, Proceedings (pp. 396-405). Springer International Publishing. https://doi.org/10.1007/978-3-319-47160-0_36
Pinares, R., & Quispe, E. (2024). Características de las fibras meduladas en alpaca huacaya y suri de Perú. Chilean journal of agricultural & animal sciences, 40(2), 332-340. https://doi.org/10.29393/CHJAAS40-28CCPQ20028
Quispe, D., Castillo, P., Yana, W., Vilcanqui, H. & Apaza, E. (2024). Características Textiles de la Fibra de Alpacas Suri de la Feria Ganadera del Sur del Perú. Chilean journal of agricultural & animal sciences, 40(1), 178-189. https://dx.doi.org/10.29393/chjaas40-17ctde50017
Quispe, M., Trigo, J. D., Serrano-Arriezu, L., Huere, J., Quispe, E., & Beruete, M. (2025). Classification of South American Camelid and goat fiber samples based on fourier transform infrared spectroscopy and machine learning. The Journal of The Textile Institute, 116(2), 198-207. https://doi.org/10.1080/00405000.2024.2324209
Rubiagatra, D., Wibawa, A. D., Lejap, M. Y. L., Pratama, B. G., & Oktavian, R. (2023). Gabor filter and Canny edge detection for ear biometrics identification. In: 2023 International Seminar on Intelligent Technology and Its Applications (ISITIA) (pp. 564-569). IEEE. https://doi.org/10.1109/ISITIA59021.2023.10220442
Sarmiento-Ramos, J. L. (2020). Aplicaciones de las redes neuronales y el deep learning a la ingeniería biomédica. Revista UIS Ingenierías, 19(4), 1-18. https://doi.org/10.18273/revuin.v19n4-2020001
Streat, L., Kudithipudi, D., & Gomez, K. (2016). Non-volatile Hierarchical Temporal Memory: Hardware for Spatial Pooling. arXiv. https://doi.org/10.48550/arxiv.1611.02792
Vilá, B., & Arzamendia, Y. (2022). South American Camelids: their values and contributions to people. Sustainability Science, 17(3), 707-724. https://doi.org/10.1007/s11625-020-00874-y
Wang, F., & Jin, X. (2018). The application of mixed-level model in convolutional neural networks for cashmere and wool identification. International Journal of Clothing Science and Technology, 30(5), 710-725. https://doi.org/10.1108/IJCST-11-2017-0171
Xing, W., Deng, N., Xin, B., Liu, Y., Chen, Y., & Zhang, Z. (2019b). Identification of extremely similar animal fibers based on matched filter and HOG-SVM. IEEE Access, 7, 98603-98617. https://doi.org/10.1109/ACCESS.2019.2923225
Xing, W., Liu, Y., Deng, N., Xin, B., Wang, W., & Chen, Y. (2020). Automatic identification of cashmere and wool fibers based on the morphological features analysis. Micron, 128, 102768. https://doi.org/10.1016/j.micron.2019.102768
Xing, W., Liu, Y., Xin, B., Zang, L., & Deng, N. (2022). The application of deep and transfer learning for identifying cashmere and wool fibers. Journal of Natural Fibers, 19(1), 88-104 https://doi.org/10.1080/15440478.2020.1727817
Xing, W., Xin, B., Deng, N., Chen, Y., & Zhang, Z. (2019a). A novel digital analysis method for measuring and identifying of wool and cashmere fibers. Measurement, 132, 11-21. https://doi.org/10.1016/j.measurement.2018.09.032
Yildiz, K. (2020). Identification of wool and mohair fibres with texture feature extraction and deep learning. IET Image Processing, 14(2), 348-353. https://doi.org/10.1049/iet-ipr.2019.0907
Zang, L., Xin, B., & Deng, N. (2022a). Identification of overlapped wool/cashmere fibers based on multi-focus image fusion and convolutional neural network. Journal of Natural Fibers, 19(13), 6715-6726. https://doi.org/10.1080/15440478.2021.1932669
Zang, L., Xin, B., & Deng, N. (2022b). Identification of wool and cashmere fibers based on multiscale geometric analysis. The Journal of The Textile Institute, 113(6), 1001-1008. https://doi.org/10.1080/00405000.2021.1914399
Zhong, Y., Lu, K., Tian, J., & Zhu, H. (2017). Wool/cashmere identification based on projection curves. Textile Research Journal, 87(14), 1730-1741. https://doi.org/10.1177/0040517516658516
Zhu, Y., Zhao, L., Chen, X., Li, Y., & Wang, J. (2023a). Animal fiber recognition based on feature fusion of the maximum inter-class variance. AUTEX Research Journal, 23(4), 560-566. https://doi.org/10.2478/aut-2022-0031
Zhu, Y., Zhao, L., Chen, X., Li, Y., & Wang, J. (2023b). Identification of cashmere and wool based on LBP and GLCM texture feature selection. Journal of Engineered Fibers and Fabrics, 18. https://doi.org/10.1177/15589250221146548
Zhu, Y., Wang, X., Gu, M., Hu, G., & Li, W. (2024). Application of unsupervised feature selection in cashmere and wool fiber recognition. Journal of Natural Fibers, 21(1), Article 2311306. https://doi.org/10.1080/15440478.2024.2311306
Zoccola, M., Bhavsar, P, Anceschi, A. & Patrucco, A. (2023). Analytical Methods for the Identification and Quantitative Determination of Wool and Fine Animal Fibers: a review. Fibers 2023, 11, 67. https://doi.org/10.3390/fib11080067
Zúñiga, E. A., Olarte Daza, C. U., & Quispe Coaquira, J. E. (2022). Calidad textil de la fibra descerdada de llamas (Lama glama) en piso ecológico húmedo. RIIARn: Revista de Investigación e Innovación Agropecuaria y de Recursos Naturales, 9(3), 68-78. https://doi.org/10.53287/hfvl7514as10k
Zyarah, A. M., & Kudithipudi, D. (2023). An Overview of the Hierarchical Temporal Memory Accelerators. In: Artificial Intelligence Applications and Reconfigurable Architectures, A.D. Thakare and S.U. Bhandari (eds.), 63-94. https://doi.org/10.1002/9781119857891.ch4
|
Colaboración Académica |
||||||||||||||
|
Nombres y Apellidos del autor |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
|
Marcelo Arcidiácono |
x |
x |
x |
x |
x |
x |
x |
x |
x |
x |
x |
x |
x |
x |
|
Dolores María Eugenia Álvarez |
x |
x |
x |
x |
x |
x |
x |
x |
x |
x |
x |
|||
1-Administración del proyecto, 2-Adquisición de fondos, 3-Análisis formal, 4-Conceptualización, 5-Curaduría de datos, 6-Escritura - revisión y edición, 7-Investigación, 8-Metodología, 9-Recursos, 10-Redacción - borrador original, 11-Software, 12-Supervisión, 13-Validación, 14-Visualización.
|
El presente trabajo de investigación se realizo en el marco del Doctorado de Ingeniería Mención Sistemas de Información, Facultad Regional Córdoba, Universidad Tecnológica Nacional, Argentina. |
|
This research was conducted as part of a PhD in Engineering with a specialization in Information Systems at the Córdoba Regional Faculty of the National Technological University, Argentina. |