242 Habiba Halepoto1 2, Tao Gong', 2, Kashif Kaleem2 1 Donghua University, Engineering Research Center of Digitized Textile and Fashion Technology, Shanghai 201620, China 2 Donghua University, College of Information Science and Technology, Shanghai 201620, China Real-Time Quality Assessment of Neppy Mélange Yarn Manufacturing Using Macropixel Analysis Ocenjevanje kakovosti proizvodnje nopkaste melanžne preje v realnem času z analizo makrotočk Original Scientific Article/Izvirniznanstveni članek Received/Prispelo 6-2019 • Accepted/Sprejeto 8-2019 Abstract The aim of this paper is to provide a simple MATLAB-based model to determine the real-time homogeneity of neppy mélange yarn fabrics. Currently, the mélange yarn industry relies solely on visual assessment and experience. This algorithm, however, proposes a solution for the mélange yarn industry. The designed algorithm presented in this paper, which is based on kernel density function and macropixel analysis, was implemented for the real-time nep detection of neppy mélange yarns and calculated an inhomogeneity of neps of around 91%. This strategy would be useful for the mélange yarn industry and can also be used in other types of fashion yarns. Keywords: computer vision, neppy yarn, macropixel analysis, real-time Izvleček V članku je predstavljen preprost model, zasnovan v programu MATLAB, za določitev homogenosti pletiv iz melanžne preje v realnem času. Danes se v industriji pri izdelavi melanžne preje opirajo le na vizualne ocene in izkušnje, zato je predlagani algoritem rešitev za industrijsko proizvodnjo melanžne preje. Zasnovani algoritem temelji na oceni gostote jedra in analizi makrotočk za sprotno zaznavanje nopkov v melanžni preji. Izračunana nehomogenost efektne preje je bila približno 91-odstotna. Ta strategija je uporabna v proizvodnji melanžne preje in tudi drugih tipov modnih prej. Ključne besede: računalniški vid, nopkasta preja, analiza makrotočk, realni čas 1 Introduction Blending different fibres yields different types of fancy yarns [1]. There is still strong market potential for fancy yarns, which remain more eye-catching than conventional yarns [2]. Mélange yarns is one type of fancy yarn [3]. Mélange yarns come in a wide variety of looks and colours [4]. This class of yarns is produced by either mixing different coloured fibres in a blow room, or by mixing or blending in draw frames [5]. One of the major classes of these mélange yarn is neppy mélange yarn, in which Corresponding author/Korespondencni avtor: Tao Gong E-mail: taogong@dhu.edu.cn ORCID: 0000-0003-0248-9404 a certain number of neps are introduced to achieve unique aesthetics. Textile image processing has gained a great deal of attention recently. To date, several researchers have focused on various aspects of textile image processing, including defect detection in woven fabrics [6-7], fabric weave pattern recognition and yarn colour recognition [8-9]. To the best of our knowledge, however, none of the researchers have focused on textile image processing for the mélange yarn industry. Quality assurance and textile testing constitute one of the central departments of any yarn spinning Tekstilec, 2019, 62(4), 242-247 DOI: 10.14502/Tekstilec2019.62.242-247 Real-Time Quality Assessment of Neppy Mélange Yarn Manufacturing Using Macropixel Analysis 243 operation. Some quality tests, including yarn count, evenness, tenacity, elongation at break, shade matching, variation and the visual appearance of finished goods, are performed before shipment in order to avoid the cancelation of orders. A couple of decades ago, shade matching and variation were one of the main reasons for the cancelation of orders. Thus, in past decades, too much research was performed on shade matching and minimising variation. As a result, various technologies have been developed to avoid the rejections of orders. Despite a great deal of research regarding other quality parameters, less attention has been given to assessing the visual appearance of finished goods. Even today, neppy yarn texture recognition relies on human skills and experience, and is thus performed manually by visual inspection. The method of visual inspection is, of course, inadequate, laborious and time-consuming, and leads to problems of subjective human factors, monotony and fatigue, physical and mental overload, and low efficiency. In order to fully understand the aesthetics of mélange yarn, however, full image feature extraction or image segmentation is necessary to understand the different spatial/lattice positions and range/colour domain of a single element in an image (simply matching the shade of yarn is insufficient). This might be understood easily by two related features, i.e. tone and texture, in terms of greyscale in which each pixel in an image has its own intensity value [10]. In this paper, tone is defined as the variation in the grey level of an image, while texture is defined as the dimensional distribution of tone as a cluster of pixel intensities that repeats itself in a specific region of an image [11]. To date, the mélange yarn industry has relied solely on spectrophotometry which, despite being very expensive, fails to determine the homogeneity or inhomogeneity of the yarn texture generated by neps in mélange yarn. Two images would have a similar greyscale tone histogram if both images have similar elements, but a different dimensional distribution due to the same number of pixels and pixel resolution from the same elements. Thus, the tone level characterisation in itself is insufficient to fully understand an image, as it might only be good for analysing colour distribution. Consequently, texture must also be considered to match the requirement of similar aesthetics and appearance, which vary from fully disorganised to highly systematic in terms of dimensional distribution. This dimensional distribution might be analysed in terms of regularity in a histogram (statistically), in parallel lines (structurally) with empiric prototypical (model-based) and post-wavelet transformation (transform-based) [12]. Haralick et al proposed a grey-level co-occurrence matrix by generating a matrix through clustering and correlating those clusters with their neighbouring clusters [10]. In the grey-level co-occurrence matrix, the scale of scrutiny is a critical step for ensuring all important information is present [13]. In this paper, we have proposed a simple MATLAB-based algorithm to determine the homogeneity of neppy mélange yarn, which might be useful for the textile mélange yarn industry for determining the textural effect, together with shade matching and other quality parameters. 2 Experimental 2.1 Materials Xinjiang medium-grade cotton from the Wuxi No. 1 cotton-spinning mill for routine production was used for this study. Basic fibre and yarn properties are presented in Table 1. Table 1: Basic properties of fibre and yarn Property Value Fibre staple length 28.7 mm Fibre finenessa) 4.38 |g/inch Yarn count 295.25 dtexb) Nep content 3% a) Micronaire value, b) 20 Ne 2.2 Methods We made a real-time video of the manufacturing of neppy mélange yarn fabric using a digital camera (Canon EOS 6D S, 20.2 megapixels with pixel dimensions of 5472 x 3648 and pixel size of 6.54 ^m). Simulations of all images and the analysis of the continuous-level moving block algorithm were performed using MATLAB v2017b (Mathworks, MA, USA). The aim of this paper was to define real-time monitoring for final neppy yarn. Initially, we monitored and studied a real-time analysis of neppy mélange fabric during the manufacturing process (see, Figure 1). For the first time, we have proposed a Tekstilec, 2019, 62(4), 242-247 244 Real-Time Quality Assessment of Neppy Mélange Yarn Manufacturing Using Macropixel Analysis strategy for the real-time monitoring of neps and the homogeneity thereof in neppy yarn fabrics by installing a digital camera adjacent to the production line. In this study, the rotation speed of the sock sampling machine was set at 80 rpm during the production of single-jersey fabric from cotton yarn of 295.25 dtex (20 Ne). Figure 1: Test image of neppy mélange yarn fabric 2.2.1 Kernel density function Kernel density function is one of the most popular non-parametric density functions. The multivariate kernel density function, with the points xi, I = 1, 2, 3 ... n, characterises the population and unknown density functions f(x) [14-15] and which is mathematically expressed as equation 1: = nhd 1K nhd x - x¡ (1), where K is the kernel (a non-negative function) and h is the bandwidth smoothing parameter, which is greater than 0. 2.2.2 Macropixel analysis Macropixel analysis scrutinises the self-information contained in an image at different sublevels (macropixels) to generate a homogeneity curve using the collective standard deviation of all sublevels [16]. Macropixel analysis works through the collaborative scanning of discrete level tiling and the continuo us-level moving block, which uses non-coinciding tiles and all possible sublevels of an image, respectively. Moreover, it should be assumed that the elements that form an image are indivisible and that images are binary, i.e. they only contain object values of either 0 or 1. Consider the images shown in Figure 2: if, these images have dimensions I x J which are divided into sublevels Sj and each square is indivisible with the dimensions I' x J', the total number of possible sublevels of an image can be calculated using equation 2, while the shift of sub-windows is illustrated in Figure 2. TOTALsIT= [I - (I' - 1)] x [J - (J' - 1)] (2) Figure 2: Three examples of sub-windows, i.e. 2, 3 and 4 squared pixels The standard deviation (SD)for each sublevel can be determined using equation 3. SDsrr = D l!=i IJ,=i(totalsit --) PIX Sit -1 (3) Consequently, the mean standard deviation (Sw) for each sublevel can be determined using equation 4. Their corresponding values are plotted in Figure 3. ISTDsij. TOTALsij, Swj = (4) Figure 3: Corresponding value of the mean standard deviation of all the sub-windows Because the image size plays a vital role, the calculated standard values should be comparable between images. This comparison might be done using the relative size of macropixels (r) in the image, which can be determined using equation 5: r = IX J (5). Tekstilec, 2019, 62(4), 242-247 Real-Time Quality Assessment of Neppy Mélange Yarn Manufacturing Using Macropixel Analysis 245 3 Results and discussion 3.1 Nep detection We first obtained results from the application of an algorithm. This algorithm was applied to segmented images of the dataset of neppy mélange yarn fabric. Segmentation was performed according to the pixels of images. The performance of the proposed method was tested. The kernel density estimation plots of neppy yarn fabric are illustrated in Figure 4. This kernel function helped to determine the neps in real-time during the manufacturing of neppy mélange yarn fabric. A total of 388 frames were analysed for the neppy yarns, and their corresponding coloured images transformed into binary images, as shown in Figure 5. a) This binary conversion of images would result in the better analysis of homogeneity in order to avoid the surficial and textural effects of the neppy mélange fabric. 3.2 Homogeneity analysis Analysing the homogeneity of neppy mélange yarn fabric is very beneficial for this segment of the textile industry in terms of discussing the homogeneity parameter, together with other parameters to meet the relevant standards and avoid the cancelation of orders. Actual homogeneity, and modelled homogenous and inhomogeneous nep-py mélange yarn fabric are illustrated in Figure 6a. The matching sample was less homogenous and 20 40 60 80 100 120 140 160 b) Figure 4: Kernel density estimation plots of neppy mélange yarn fabric: a) 3D view, b) top view a) b) Figure 5: Nep detection of neppy mélange yarn fabric (a); and neps detection using 388 frames (b) - original frame from 388frames Tekstilec, 2019, 62(4), 242-247 246 Real-Time Quality Assessment of Neppy Mélange Yarn Manufacturing Using Macropixel Analysis Actual Homo Inhomo 50 100 150 a) 100 150 1500 1000 500 0.05 •Actual 'Homo ► Inhomo %IH = 91% 02 04 0.6 08 b) c) Figure 6: Homogeneity analysis of neppy mélange yarn fabric (a), actual homogeneity and modelled homogenous and inhomogeneous neppy mélange yarn fabric; (b) histogram of actual neppy mélange yarn fabric; and (c) homogeneity curve showing a homogeneity of 9% was thus more similar to the inhomogeneous sample. It is also useful to see the distribution of homogeneity, which is shown in the histogram of actual neppy mélange yarn fabric (see Figure 6b). In addition, a homogeneity curve showing a homogeneity of neps over the fabric of 9% is presented in Figure 6c. Because homogeneity was only 9%, the curve of neppy fabric is close to the inhomogeneous curve. The inhomogeneity of the image can be calculated using equation 6. This means that the fabric was more inhomogeneous, i.e. 91%. This inhomogeneity is desired for aesthetic functionality and for attracting the observer's attention to the design of neppy mélange yarn. IH = 100 - H% (%) (6) 4 Conclusion In this study, a simple MATLAB-based model was proposed for determining the real-time homogeneity of neppy mélange yarn fabrics. This might serve as a helpful tool for quality assessment in the textile mélange yarn industry with the aim of replacing the current inconsistent visual assessment based solely on experience. The neps from neppy mélange yarn fabric production were identified using kernel density algorithm. We determined that the inhomoge-neity determined using the MATLAB code was as high as 91%, which is, of course, impossible to determine using only the bare eye. It is therefore very helpful for the textile industry and can also be used in other different types of fashion yarns. This research may be expanded in several ways, i.e. by Tekstilec, 2019, 62(4), 242-247 studying the effect of homogeneity on mechanical properties using an image processing technique. The surficial effect of a fabric, which requires a 3D model and thus pixel analysis in three dimensions, can also be analysed. Moreover, multi-coloured neps might also be analysed directly without converting them to greyscale. References 1. BEHERA, B. K., HARI, P. K., BANSAL, S., SINGH, R. Effect of different blending methods and blending stages on properties of mélange yarn. Indian Journal of Fibre and Textile Research, 1997, 22, 84-88. 2. GONG, R. H., WRIGHT, R. M. Structures and formation of fancy yarns. In Fancy yarns: their manufacture and application. Boca Raton, FL: CRC Press, Cambridge : Woodhead Publishing, 2002, pp. 33-59, doi: 10.1533/9781855737525. 33. 3. MOGHASSEM, Abdolrasool. Damaging of dyed cotton fibers with direct dye in spinning processes and its effect on the properties of cotton mélange yarn. International Journal of Engineering - Transactions B: Applications, 2007, 20(2), 203-210. 4. KAN, Chi-Wai, WONG, Wai-Yin. Color properties of cellulase-treated cotton denim fabric manufactured by torque-free ring spun yarn. Textile Research Journal, 2011, 81(9), 875-882, doi: 10.1177/0040517510391699. 5. GHAREHAGHAJI, Ali Akbar, TAVANAIE, H., KARIM, S. Study on the interactions between mélange yarn properties and fiber damage. Arabian Journal of Geosciences, 2011, 4(7-8), 11171130. 6. ZHANG, Kaibing, YAN, Yadi, LI, Pengfei, JING, Junfeng, LIU, Xiuping, WANG, Zhen. Fabric defect detection using salience metric for color dissimilarity and positional aggregation. IEEE Access, 2018, 6(1), 49170-49181, doi: 10.1109/ access.2018.2868059. 7. LI, Yundong, ZHAO, Weigang, PAN, Jiahao. Deformable patterned fabric defect detection with fisher criterion-based deep learning. IEEE Transactions on Automation Science & Engineering, 2017, 14(2), 1256-1264, doi: 10.1109/TASE. 2016.2520955. Real-Time Quality Assessment of Neppy Mélange Yarn 247 Manufacturing Using MacropixelAnalysis 8. KHAN, Babar, WANG, Zhijie, HAN, Fang, IQ-BAL, Ather, MASOOD, Rana Javed. Fabric weave pattern and yarn color recognition and classification using a deep ELM network. Algorithms, 2017, 10(4), 117-129, doi: 10.3390/ al0040117. 9. KHAN, Babar, FANG, Han, WANG, Zhijie, MASOOD, Rana J. Bio-inspired approach to invariant recognition and classification of fabric weave patterns and yarn color. Assembly Automation, 2016, 36(2), 152-158, doi: 10.1108/AA-11-2015-100. 10. HARALICK, Robert Martin, SHANMUGAM, K., DINSTEIN, Its'Hak. Textural features for image classification. IEEE Transactions on Systems, Man, and Cybernetics, 1973, SMC-3(6), 610-621, doi: 10.1109/TSMC.1973.4309314. 11. BHARATI, Manish H., MACGREGOR, John F. Texture analysis of images using principal component analysis. In SPIE/Photonics Conference on Process Imaging for Automatic Control: proceedings. Boston : The International Society for Optical Engineering, 2001, pp. 27-37, doi: 10. 1117/12.417179. 12. BHARATI, Manish H., LIU, Jay, MACGREGOR, John F. Image texture analysis: methods and comparisons. Chemometrics & Intelligent Laboratory Systems, 2004, 72(1), 57-71, doi: 10. 1016/j.chemolab.2004.02.005. 13. MISSIAEN, J. M., THOMAS, G. Homogeneity characterization of binary grain mixtures using a variance analysis of two-dimensional numerical fractions. Journal of Physics Condensed Matter, 1995, 7(15), 2937-2948, doi: 10.1088/09538984/7/15/002. 14. FUKUNAGA, Keinosuke, HOSTETLER, Larry D. The estimation of the gradient of a density function, with applications in pattern recognition. IEEE Transactions on Information Theory, 1975, 21(1), 32-40, doi: 10.1109/TIT.1975.1055330. 15. COMANICIU, Dorin I. Nonparametric robust methods for computer vision : thesis. New Brunswick : Rutgers The State University of New Jersey, 2000. 16. HAMAD, Mazen L., ELLISON, Christopher D., KHAN, Mansoor, LYON, Robbe C. Drug product characterization by macropixel analysis of chemical images. Journal of Pharmaceutical Sciences, 2007, 96(12), 3390-3401, doi: 10.1002/ jps.20971. Tekstilec, 2019, 62(4), 242-247