A fabric classification method based on intelligent near-infrared spectrum system and neural network
By combining an intelligent near-infrared spectroscopy system and the ZYNQ processing platform with deep learning algorithms, the problems of complex equipment and high power consumption in fabric classification have been solved, achieving efficient, portable, and real-time fabric classification and improving collection efficiency and accuracy.
Patent Information
- Application Number
- CN202510103192.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-22
- Publication Date
- 2026-01-13
- Estimated Expiration
- 2045-01-22
AI Technical Summary
Existing technologies for fabric classification suffer from problems such as complex equipment, high power consumption, inconvenience, and difficulty in meeting the requirements of embedded systems for real-time performance, miniaturization, and low power consumption. Traditional image data-dependent methods are inefficient and inaccurate, while automated spectral analysis schemes are complex to operate and difficult to apply to portable and real-time detection.
A fabric classification method based on an intelligent near-infrared spectroscopy system and the ZYNQ processing platform is adopted. Combined with deep learning algorithms, data is collected by a near-infrared spectrometer and fabric classification is performed using a Zy-Net neural network, including one-dimensional convolutional blocks and fully connected modules, to achieve efficient and portable fabric classification.
It enables efficient, convenient, and real-time fabric classification, improves collection efficiency and portability, enhances classification accuracy, and meets the needs of embedded systems.
Smart Images

Figure CN119810670B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the field of embedded systems, and particularly relates to an intelligent near-infrared spectroscopy system based on a ZYNQ platform and a method for fabric classification combining deep learning technology. BACKGROUND
[0002] Fabric classification is a key task in the textile industry, playing an important role in material research, quality detection, and production management. Traditional methods mainly rely on manual detection or computer-based algorithms for classification. Manual detection relies on the experience of operators, which is highly subjective and easily affected by factors such as light conditions and fatigue, resulting in low efficiency and insufficient accuracy. In addition, manual methods are difficult to meet the demand for efficient detection when faced with a large number of samples.
[0003] Currently, fabric classification methods based on convolutional neural networks (CNN) have gradually attracted attention. For example, Ru Xin et al. collected multiple fabric sample images to establish a data set and used a neural network model to achieve fabric classification on a computer. Pang Bo et al. constructed a data set by normalizing fabric images and built a neural network model to complete the classification task. These methods rely on image data and use computers for feature extraction and classification, improving the automation level and accuracy of classification. However, such methods usually require large computing devices for image capture, preprocessing, and feature extraction, which not only have complex equipment and high power consumption but also lack portability, making it difficult to meet the requirements of real-time, miniaturization, and low power consumption of embedded systems. Therefore, there is an urgent need for an efficient, portable, and embedded solution for fabric classification tasks.
[0004] Near-infrared spectroscopy technology has gradually become an important tool in the field of fabric classification due to its non-contact and rapid detection advantages. By analyzing the spectral data of fabrics, this technology can reveal the composition and structure information of fabrics, providing a scientific basis for classification tasks. Although some automated solutions based on spectral analysis use computers to process spectral data, achieving a certain degree of automation, their large size, high power consumption, and complex operation make them difficult to apply to portable and real-time detection embedded scenarios. SUMMARY
[0005] To solve the problems existing in the prior art, the present application provides a fabric classification method based on an intelligent near-infrared spectroscopy system and a neural network, which aims to efficiently collect and analyze near-infrared spectral data of fabrics and use deep learning algorithms to quickly classify fabric types, thereby realizing real-time, accurate, and convenient detection processes.
[0006] To achieve the above-mentioned application purposes, the present application adopts the following technical solutions:
[0007] The present invention discloses a fabric classification method based on an intelligent near-infrared spectroscopy system and a neural network. The method is characterized by its application within an intelligent near-infrared spectroscopy system comprised of a near-infrared spectrometer, a capacitive touchscreen serial port display, a ZYNQ processing platform, and a control baseboard. The near-infrared spectrometer is connected to a UART header on the control baseboard via a UART interface to collect near-infrared spectral reflectance data of the fabric. The ZYNQ processing platform includes a Zy-Net module. The control baseboard includes an STM32 module. The qualitative classification method for the fabric is performed according to the following steps:
[0008] Step 1: Constructing the sample fabric reflectance spectrum dataset and preprocessing the data;
[0009] Step 1.1: Align the near-infrared spectrometer with the reference whiteboard. The capacitive touch serial port screen sends a whiteboard correction command to the STM32 module on the control board. After recognizing the whiteboard correction command, the STM32 module drives the near-infrared spectrometer to acquire and obtain the reference spectrum. ={ , ,..., ,..., }, This represents the m-th spectral data point, where M represents the total number of spectral data points; m = 1, 2, ..., M;
[0010] Step 1.2: Point the near-infrared spectrometer at the q-th fabric sample to be tested. The capacitive touch serial port screen sends a data acquisition control command to the STM32 module on the control base plate. After recognizing the data acquisition control command, the STM32 module drives the near-infrared spectrometer to acquire and obtain the reflectance spectral data of the q-th type of fabric. = ;in, This represents the m-th reflectance spectral data of the q-th type of fabric; q∈Q; Q represents the number of fabric samples.
[0011] In step 1.3, the STM32 module calculates the spectral reflectance of the q-th fabric sample using equation (1). And transmit spectral reflectance via UART serial port Transmitted to the ZYNQ processing platform;
[0012] (1)
[0013] Step 2: Construct the Zy-Net classification network for fabric classification, including: a fabric spectral feature extraction module, a data transformation module, and a fabric classification module;
[0014] Step 2.1: The fabric spectral feature extraction module... performing processing to obtain the final significant reflection spectrum feature of the qth kind of fabric sample ;
[0015] Step 2.2, the data conversion module performs flattening processing on to obtain the u-th one-dimensional reflection spectrum feature ;
[0016] Step 2.3, the fabric classification module performs processing on to obtain the predicted category probability of the qth kind of fabric sample ;
[0017] Step 2.4, the loss function of the Zy-Net neural network model is established by using formula (5) :
[0018] (5)
[0019] In formula (5), is the true category label of ;
[0020] Step 2.5, the Zy-Net classification network is trained by the gradient descent method, and the loss function is calculated When the network training reaches the set number of times, the training is stopped, thereby obtaining the fabric classification model with optimal parameters and deploying it on the ZYNQ processing platform for realizing the classification of different kinds of fabrics.
[0021] The fabric classification method based on the intelligent near-infrared spectrum system and the neural network has the characteristics that the fabric spectrum feature extraction module in step 2.1 is composed of U one-dimensional convolution blocks in series, each one-dimensional convolution block is composed of a one-dimensional convolution layer, a BN layer, a ReLU activation layer and a maximum pooling layer in series; u=1, 2,..., U;
[0022] Step 2.1.1, when u=1, the spectral reflectivity of the qth kind of fabric sample is input into the one-dimensional convolution layer of the u-th one-dimensional convolution block of the fabric spectrum feature extraction module, and the u-th reflection spectrum feature of the qth kind of fabric sample is obtained by using formula (2) :
[0023] + (2)
[0024] In formula (2), denotes the bias value of the u-th one-dimensional convolution layer, denotes the weight of the u-th one-dimensional convolution layer, and * denotes one-dimensional convolution operation;
[0025] Step 2.1.2, the BN layer in the u-th one-dimensional convolution block performs batch normalization processing on using formula (3) to obtain the u-th normalized reflectance spectrum feature of the q-th kind of fabric sample
[0026] (3)
[0027] In formula (3), and respectively represent the mean parameter and the standard deviation parameter of the u-th convolution block, represents a constant to prevent division by zero; and respectively represent the scaling parameter and the offset parameter of the u-th convolution block;
[0028] Step 2.1.3, the ReLU activation layer in the u-th one-dimensional convolution block performs nonlinear transformation on using formula (4) to obtain the u-th transformed reflectance spectrum feature of the q-th kind of fabric sample
[0029] (4)
[0030] Step 2.1.4, the max-pooling layer in the u-th one-dimensional convolution block extracts features from to obtain the u-th significant reflectance spectrum feature of the q-th kind of fabric sample
[0031] Step 2.1.5, when u=2,3,...,U, the u-1-th significant reflectance spectrum feature of the q-th kind of fabric sample is input into the u-th one-dimensional convolution block for processing, so that the final significant reflectance spectrum feature is output from the U-th one-dimensional convolution block
[0032] Further, the fabric classification module in step 2.3 is composed of J fully connected modules and a Softmax function in series, the first J-1 fully connected modules include a fully connected layer and a ReLU activation layer, and the Jth fully connected module includes a fully connected layer and a Softmax function, wherein j=1,2,...,J;
[0033] When j=1, is input into the jth fully connected module for processing to obtain the jth intermediate reflectance spectrum feature of the q-th kind of fabric sample ;
[0034] when j = 2, 3,..., J-1, the (j-1)-th intermediate reflectance spectral feature of the q-th kind of fabric sample input into the j-th full connection module for processing, so that the (J-1)-th intermediate reflectance spectral feature is output from the (J-1)-th full connection module
[0035] input into the J-th full connection module for processing, to obtain the predicted class probability of the q-th kind of fabric sample
[0036] The electronic device comprises a memory and a processor, and the memory is used to store a program supporting the processor to execute the fabric classification method, and the processor is configured to execute the program stored in the memory.
[0037] The computer readable storage medium stores a computer program, and when the computer program is run by a processor, the steps of the fabric classification method are executed.
[0038] Compared with the prior art, the present application has the following advantages:
[0039] 1. The intelligent near-infrared spectroscopy system designed in the present application integrates portable near-infrared spectrometers, ZYNQ processing platforms and other hardware components, controls the data acquisition of the spectrometer through an STM32 module, and supports a capacitive touch serial screen for acquisition operation and result display. In addition, the system uses a near-infrared spectrometer based on digital micromirror technology, which greatly improves the acquisition efficiency and portability. Through this collaborative hardware architecture, the present application realizes a near-infrared spectrum acquisition system with high efficiency, high integration and high intelligence.
[0040] 2. The present application designs a Zy-Net convolutional neural network for fabric classification, which uses multiple convolutional layers instead of traditional convolutional layers in each module. The traditional convolutional layer only contains a fixed convolutional kernel, and its receptive field is limited, which easily causes feature information loss. The multi-convolutional layer integrates multiple convolutional layers, batch normalization layers and activation function layers, and has significant advantages. On the one hand, it can expand the receptive field range and extract more rich features; on the other hand, compared with a single convolutional layer with the same feature extraction capability, the multi-convolutional layer significantly reduces the parameter quantity and calculation amount. In addition, the multi-convolutional layer integrates multiple activation function layers, which further improves the feature mapping capability compared with a single activation function layer, thereby enhancing the classification performance of the fabric classification model.
[0041] 3. This invention is based on the ZYNQ processing platform, namely the SoC+FPGA architecture, which efficiently processes the reflectance spectral data of various fabrics, meets the requirements of high-accuracy identification, and significantly improves the working efficiency of the system. Attached Figure Description
[0042] Figure 1 This is a schematic diagram of the intelligent near-infrared spectroscopy system of the present invention;
[0043] Figure 2 This is a graph showing the average spectral reflectance of different fabrics in the range of 900nm to 1200nm in an example of the present invention.
[0044] Figure 3 This is a diagram of the Zy-Net classification network framework of the present invention. Detailed Implementation
[0045] In this embodiment, as Figure 1 As shown, a fabric classification method based on an intelligent near-infrared spectroscopy system and neural network is applied to an embedded system consisting of a NIR-M-R2 near-infrared spectrometer, a capacitive touch serial port screen, a ZYNQ processing platform, and a control baseboard. The NIR-M-R2 near-infrared spectrometer is connected to the UART header on the control baseboard via a UART interface to collect near-infrared spectral reflectance data of the fabric. The ZYNQ processing platform includes a Zy-Net module; the control baseboard includes an STM32 module. The ZYNQ processing platform and the STM32 module communicate via RS485, and the capacitive touch serial port screen communicates with the I / O interface of the control baseboard. The specific steps of this qualitative fabric classification method are as follows:
[0046] Step 1: Constructing the sample fabric reflectance spectrum dataset and preprocessing the data;
[0047] Step 1.1: Align the NIR-M-R2 near-infrared spectrometer with the reference whiteboard. The capacitive touch serial port screen sends a whiteboard correction command to the STM32 module on the control board. After recognizing the whiteboard correction command, the STM32 module drives the NIR-M-R2 near-infrared spectrometer to acquire and obtain the reference spectrum in the wavelength range of 900nm~1700nm. ={ , ,..., ,..., }; m=1,2,...,M, indicating that M spectral data are collected at one time; in this example, the total number of spectral data is M=228.
[0048] Step 1.2, the NIR-M-R2 near infrared spectrometer is aimed at the qth fabric sample to be measured, a data acquisition control instruction is sent from the capacitive touch serial port screen to the STM32 module of the control board, after the STM32 module recognizes the data acquisition control instruction, the NIR-M-R2 near infrared spectrometer is driven to collect and obtain the reflectance spectrum data of the qth kind of fabric in the wavelength range of 900 nm to 1700 nm = ; wherein, represents the mth reflectance spectrum data of the qth kind of fabric; q e Q; Q represents the number of fabric sample categories; in this example, the number of fabric categories selected Q = 7.
[0049] Step 1.3, the STM32 module calculates the spectral reflectance of the qth fabric sample by formula (1) , and transmits the spectral reflectance to the ZYNQ processing platform through the UART serial port; as shown in Figure 2 , it is a fabric average reflectance spectrum data curve graph, the abscissa represents the spectral range of the collected spectral data, i.e. 900 nm to 1700 nm, and the ordinate represents the reflectance;
[0050] (1).
[0051] Step 2, construct a Zy-Net classification network for fabric classification, as shown in Figure 3 , including: fabric spectral feature extraction module, data conversion module and fabric classification module;
[0052] Step 2.1, the fabric spectral feature extraction module is composed of U one-dimensional convolution blocks in series, each one-dimensional convolution block is composed of a one-dimensional convolution layer, a BN layer, a ReLU activation layer and a maximum pooling layer in series; u = 1, 2,..., U; in this example, the number of one-dimensional convolution blocks U = 4.
[0053] Step 2.1.1, when u = 1, the spectral reflectance of the qth kind of fabric sample is input into the one-dimensional convolution layer of the uth one-dimensional convolution block of the fabric spectral feature extraction module, and the uth reflectance spectrum feature of the qth kind of fabric sample is obtained by formula (2) :
[0054] + (2)
[0055] In formula (2), represents the bias value of the uth one-dimensional convolution layer, represents the weight of the uth one-dimensional convolution layer, and * represents one-dimensional convolution operation;
[0056] Step 2.1.2, the BN layer in the u-th one-dimensional convolution block utilizes formula (3) to perform batch normalization processing on to obtain the u-th normalized reflectance spectrum feature of the q-th kind of fabric sample :
[0057] = · + (3)
[0058] In formula (3), and respectively represent the mean parameter and the standard deviation parameter of the u-th convolution block, represents a constant to prevent division by zero; and respectively represent the scaling parameter and the offset parameter of the u-th convolution block.
[0059] Step 2.1.3, the ReLU activation layer in the u-th one-dimensional convolution block utilizes formula (4) to perform nonlinear transformation on to obtain the u-th transformed reflectance spectrum feature of the q-th kind of fabric sample :
[0060] (4)
[0061] Step 2.1.4, the max-pooling layer in the u-th one-dimensional convolution block performs feature extraction on to obtain the u-th significant reflectance spectrum feature of the q-th kind of fabric sample .
[0062] Step 2.1.5, when u=2, 3,..., U, the u-1-th significant reflectance spectrum feature of the q-th kind of fabric sample is input into the u-th one-dimensional convolution block for processing, so that the final significant reflectance spectrum feature is output from the U-th one-dimensional convolution block;
[0063] Step 2.2, the data conversion module performs flattening processing on to obtain the u-th one-dimensional reflectance spectrum feature ;
[0064] Step 2.3, the fabric classification module is composed of J fully connected modules and a Softmax function in series, the first J-1 fully connected modules include a fully connected layer and a ReLU activation layer, and the J-th fully connected module includes a fully connected layer and a Softmax function, where j=1, 2,..., J; in this example, the number of fully connected modules J=3.
[0065] When j = 1, The jth intermediate reflectance spectral feature of the qth fabric sample is obtained by inputting into the jth full connection module for processing ;
[0066] When j = 2, 3,..., J-1, the j-1th intermediate reflectance spectral feature of the qth fabric sample is obtained by inputting into the jth full connection module for processing The J-1th intermediate reflectance spectral feature is output from the J-1th full connection module by inputting into the Jth full connection module for processing ;
[0067] The predicted category probability of the qth fabric sample is obtained by inputting into the Jth full connection module for processing .
[0068] Step 2.4, the loss function of the Zy-Net neural network model is established by using formula (5) :
[0069] (5)
[0070] In formula (5), is the true category label of .
[0071] Step 2.5, the Zy-Net classification network is trained offline by gradient descent method, and the loss function is calculated When the training reaches the preset number of iterations, the training is stopped, and the optimal fabric classification network model is obtained. In this embodiment, the Adam optimizer is used for parameter updating, the initial learning rate is 1x , and the learning rate is dynamically adjusted combined with the cosine annealing strategy, so as to realize efficient convergence in the training process. The training process is completed after 300 iterations, and the weight and bias parameters of the network are fixed.
[0072] Step 3, hardware deployment of Zy-Net classification network;
[0073] Step 3.1, the weight and bias parameters of the Zy-Net classification network obtained by offline training are converted into fixed point format (ap_fixed<32, 16>) to balance the calculation accuracy and hardware resource utilization. During the conversion process, the parameters are quantized by shifting 16 bits to the left to obtain the weight and bias parameters in the form of fixed point numbers. Subsequently, the converted fixed point weight is exported in the format of.h and stored in the ROM of the programmable logic (PL) part of the ZYNQ processing platform. These parameters serve as initialization data in the hardware deployment stage, which are efficiently loaded through the PL part to realize fast startup and high-performance classification inference;
[0074] Step 3.2, ZYNQ processing platform for spectral reflectance from the spectrometer Quantization processing, generating fixed-point form of reflectance And transmitted to the DDR of the processing system (PS) part of the ZYNQ processing platform. In the DDR, the quantized data is used as the input of the network, and interacts with the hardware modules of the PL part to complete the subsequent inference calculation;
[0075] Step 3.3, according to the structure of Zy-Net classification network, the acceleration of Zy-Net classification network is realized in the programmable logic (PL) part of ZYNQ processing platform.
[0076] Step 3.3.1, in the one-dimensional convolution block part, in order to improve the speed, the convolution kernel, the bias and the input / output data are blocked according to the specific dimension, and the parallel processing capability of FPGA is used to perform multi-core calculation. The input, output data, weight and bias parameters are blocked by #pragma HLS ARRAY PARTITION instruction according to the dimension, which allows each core to process multiple input channels at the same time. Pipeline calculation is performed through #pragma HLS PIPELINE instruction to reduce data delay. The pooling layer adopts the window sliding method to complete the maximum value selection, and the parallel calculation is realized in hardware by using full block. Through #pragma HLS PIPELINE II=1 instruction, the pooling calculation is performed in pipeline with 1 start interval.
[0077] Step 3.3.2, in the full connection module, FPGA parallelizes the multiplication and addition operations through multi-level addition tree, groups the multiple row vectors of weight matrix, calculates the weighted sum of each group, and then merges. Through the instructions of #pragma HLS UNROLL and #pragma HLS PIPELINE, pipeline calculation is performed. Through the #pragma HLS bind_op instruction, multiplication is bound to DSP resources to reduce calculation delay. This hierarchical method utilizes more DSP resources to realize efficient acceleration of matrix multiplication.
[0078] Step 4, the input and output interfaces of Zy-Net module are mapped to the processing system (PS) part of ZYNQ processing platform, and efficient communication between programmable logic (PL) part and PS part is realized through AXI bus. The fabric reflectance spectrum features calculated by Zy-Net module are transmitted to the processing system (PS) part to complete the final fabric classification, and the classification result is transmitted to the capacitive touch serial screen for displaying the type of fabric.
[0079] In this embodiment, an electronic device includes a memory for storing a program supporting a processor to execute the above method, and the processor configured to execute the program stored in the memory.
[0080] In this embodiment, a computer readable storage medium has a computer program stored thereon, and the computer program is run by a processor to perform the steps of the above method.
Claims
1. A fabric classification method based on intelligent near infrared spectroscopy system and neural network, characterized in that, The application is applied to an intelligent near-infrared spectroscopy system composed of a near-infrared spectrometer, a capacitive touch serial port screen, a ZYNQ processing platform and a control board, wherein the near-infrared spectrometer is connected with a UART pin on the control board through a UART interface and is used for collecting near-infrared spectral reflection data of a fabric; the ZYNQ processing platform comprises a Zy-Net module; the control board comprises an STM32 module; and the fabric qualitative classification method is performed according to the following steps: Step 1, constructing a sample fabric reflection spectral data set and data preprocessing; Step 1.1, the near infrared spectrometer is aligned to the reference white board, the white board correction instruction is sent from the capacitive touch serial screen to the STM32 module of the control backplane, after the STM32 module recognizes the white board correction instruction, the near infrared spectrometer is driven to collect and obtain the reference spectrum ={ , ,..., ,..., }, represents the mth spectrum data, M represents the total number of spectrum data, m=1, 2,..., M; Step 1.2, the near infrared spectrometer is aligned to the qth fabric sample to be measured, a data acquisition control instruction is sent from the capacitive touch serial screen to the STM32 module of the control backboard, and after the STM32 module recognizes the data acquisition control instruction, the near infrared spectrometer is driven to acquire and obtain the reflection spectrum data of the qth kind of fabric = ; wherein, represents the mth reflection spectrum data of the qth kind of fabric; q∈Q; Q represents the number of kinds of fabric samples; Step 1.3, the STM32 module calculates the spectral reflectance of the qth fabric sample by formula (1) and transmits the spectral reflectance to the ZYNQ processing platform through the UART serial port (1) Step 2, constructing a Zy-Net classification network for fabric classification, comprising a fabric spectral feature extraction module, a data conversion module and a fabric classification module; Step 2.1: The fabric spectral feature extraction module... The processing was performed to obtain the final significant reflectance spectral characteristics of the q-th type of fabric sample. The fabric spectral feature extraction module consists of U one-dimensional convolutional blocks connected in series. Each one-dimensional convolutional block is composed of a one-dimensional convolutional layer, a BN layer, a ReLU activation layer, and a max pooling layer connected in series; u=1,2,...,U; Step 2.1.1, when u = 1, the spectral reflectance of the qth kind of fabric sample The u-th one-dimensional convolution layer of the input fabric spectral feature extraction module is input into the one-dimensional convolution layer of the u-th one-dimensional convolution block, and the u-th reflection spectral feature of the qth kind of fabric sample is obtained by using formula (2) : + (2) In formula (2), denotes a bias value of the u-th one-dimensional convolution layer, denotes a weight of the u-th one-dimensional convolution layer, and * denotes a one-dimensional convolution operation; The BN layer in the u-th one-dimensional convolution block of step 2.1.2 performs batch normalization processing on the q-th normalized reflectance spectrum feature of the u-th one-dimensional convolution block of the q-th fabric sample according to formula (3) : Rq,u= BN (Rq,u-1) (3) : = · + (3) In formula (3), and respectively represent the mean parameter and the standard deviation parameter of the u-th convolution block, represents a constant for preventing division by zero; and respectively represent the scaling parameter and the offset parameter of the u-th convolution block. Step 2.1.3, the ReLU activation layer in the u-th one-dimensional convolution block utilizes formula (4) to perform a nonlinear transformation on to obtain the u-th transformed reflectance spectrum feature of the q-th fabric sample : (4) Step 2.1.4, the maximum pooling layer in the u-th one-dimensional convolution block extracts features to obtain the u-th significant reflection spectrum feature of the q-th fabric sample ; Step 2.1.5, when u = 2, 3,..., U, the (u-1)th dominant reflectance spectral feature of the qth fabric sample is input into the u-th one-dimensional convolution block for processing, so that the final dominant reflectance spectral feature is output from the U-th one-dimensional convolution block ; Step 2.2, the data conversion module performs flattening processing on to obtain the u-th one-dimensional reflection spectrum feature ; Step 2.
3. The fabric classification module processes the fabric feature vector to obtain the predicted class probability of the qth fabric sample Step 2.
3. The fabric classification module processes the fabric feature vector to obtain the predicted class probability of the qth fabric sample Step 2.
3. The fabric classification module processes the fabric feature vector to obtain the predicted class probability of the qth fabric sample Step 2.4, establishing a loss function for the Zy-Net neural network model with formula (5) : (5) In formula (5), is a true class label; Step 2.5, training the Zy-Net classification network by gradient descent method and calculating the loss function When the network training reaches the set number of times, the training is stopped, thereby obtaining the fabric classification model with optimal parameters and deploying it on the ZYNQ processing platform for realizing classification of different kinds of fabrics.
2. The fabric classification method based on intelligent near-infrared spectroscopy system and neural network according to claim 1, characterized in that, The fabric classification module in the step 2.3 is composed of J full connection modules and a Softmax function in series, the first J-1 full connection modules comprise a full connection layer and a ReLU activation layer, the Jth full connection module comprises a full connection layer and a Softmax function, wherein j = 1, 2,..., J; When j = 1, Input the jth full connection module for processing to obtain the jth intermediate reflectance spectrum feature of the qth fabric sample ; when j = 2, 3,..., J-1, the (j-1)-th intermediate reflectance spectral feature of the q-th kind fabric sample is input into the j-th full connection module for processing, so that the (J-1)-th intermediate reflectance spectral feature is output by the (J-1)-th full connection module ; The input is processed in the Jth fully connected module to obtain the predicted class probability of the qth fabric sample .
3. An electronic device comprising a memory and a processor, characterized in that The memory is used for storing a program supporting the processor to execute the fabric classification method in any one of claims 1-2, and the processor is configured to execute the program stored in the memory.
4. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to perform the steps of the fabric classification method in any one of claims 1-2.
Citation Information
Patent Citations
Intelligent textile detection system based on ZYNQ development board
CN116202989A
Method and system for learning spectral features of hyperspectral data using dcnn
EP3992848A1