Wood dyeing concentration prediction system and method based on absorption spectrum and deep learning

By combining absorption spectroscopy technology and deep learning models, real-time monitoring and intelligent prediction of wood stain concentrations is solved, and the problem of difficult to accurately control the stain concentration in the existing technology and spectral data is susceptible to environmental interference, achieving an efficient and accurate dyeing process manage.

CN119479872APending Publication Date: 2025-02-18NORTHEAST FORESTRY UNIV
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411300598.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-18
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

The existing wood staining industry lacks automated and intelligent dye concentration monitoring methods, which makes it difficult to accurately control the dye concentration, and the spectral data are easily disturbed by the environment, making it difficult to meet the real-time requirements.

Method used

Using a wood stain concentration prediction system based on absorption spectrum and deep learning, data is collected through the absorption spectrum measurement module, the data preprocessing module performs Gaussian filtering and min-max normalization, and the deep learning model prediction module uses preprocessed data for training. , the concentration ratio of the dye is output.

Benefits of technology

It significantly reduces noise and environmental interference in the spectral data, improves the applicability of the data, realizes real-time monitoring and intelligent prediction of the wood staining process, improves the efficiency and product quality of the dyeing process, and reduces dye waste and environmental pollution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119479872A_ABST
    Figure CN119479872A_ABST
Patent Text Reader

Abstract

The invention provides a wood dyeing concentration prediction system and method based on an absorption spectrum and deep learning. The system comprises an absorption spectrum measurement module, a data preprocessing module, a deep learning model prediction module and a mechanical device capable of automatically controlling the distance. According to the method, the absorption spectrum technology and the deep learning model are combined, Gaussian filtering and min-max normalization are carried out on the spectral data, noise and environmental interference in the data are remarkably reduced, the spectral data are more suitable for training of the deep learning model, real-time monitoring and intelligent prediction of the wood dyeing process are achieved, and the quality of the wood dyeing process is improved. According to the method, error elimination processing is carried out on the predicted dye concentration, the prediction precision of the wood dyeing concentration is improved, meanwhile, the advantages of high precision, real-time performance and automatic control of the deep learning model are utilized, the efficiency of the dyeing process and the product quality are remarkably improved, and dye waste and environmental pollution are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a wood dyeing concentration prediction system and method based on absorption spectrum and deep learning, and belongs to the technical field of wood processing. Background Art

[0002] In the traditional wood dyeing industry, wood dyeing concentration monitoring mostly relies on manual operation and empirical judgment, lacking automated and intelligent monitoring methods, which makes it difficult to accurately control the dyeing concentration. In addition, although some studies have tried to use spectral analysis for dyeing concentration monitoring, most of them have failed to effectively combine deep learning technology, resulting in insufficient prediction accuracy and stability when the system handles complex and changeable actual environments. This not only affects the quality consistency of the final product, but may also lead to waste of resources and environmental pollution.

[0003] In the prior art, spectral analysis is usually used for offline single-point measurement, with large data volume and complex processing. However, deep learning models require a large amount of high-quality data for training, and have high requirements for data pre-processing. Since spectral data is complex and susceptible to environmental interference, it is difficult to ensure the accuracy and stability of the model by directly using it for deep learning model training. The present invention uses a data preprocessing module, Gaussian filtering and min-max normalization methods to significantly reduce noise and environmental interference, making spectral data more suitable for deep learning model training. At the same time, by decomposing spectral data into absorbance values ​​of multiple bands, the accuracy and consistency of the data are improved, thereby realizing the effective combination of spectral analysis and deep learning.

[0004] Although existing spectrophotometers can measure color, they can only perform offline single-point measurements, which limits production efficiency. Although hyperspectral imaging systems can achieve imageable detection, the equipment is expensive and complicated to operate, and has not yet been widely popularized. Absorption spectroscopy is a technology that analyzes the composition of a substance by measuring its ability to absorb light of a specific wavelength. In the dyeing process, absorption spectroscopy can be used to detect the absorbance of the dye solution, thereby indirectly calculating the concentration of the dye. However, to this day, the use of absorption spectroscopy to determine the amount of dye solution to be added to the wood tank dyeing has not been popularized. The main reason is that obtaining absorption spectrum images often requires large-scale experimental equipment and certain professional knowledge, and time-consuming and labor-intensive operations have become the main obstacles to the development of this technology. In addition, in practical applications, the complexity of data acquisition and processing and environmental interference also need to be solved. Summary of the invention

[0005] The present invention aims to solve the technical problem that spectral data in the existing wood continuous tank dyeing process is easily interfered by factors such as ambient light and uneven dye concentration, resulting in low data quality and difficulty in meeting the real-time requirements in actual production. A wood dyeing concentration prediction system and method based on absorption spectroscopy and deep learning are proposed.

[0006] The technical solution adopted by the present invention to solve the above problems is: the present invention proposes a wood dyeing concentration prediction system based on absorption spectrum and deep learning, comprising:

[0007] Absorption spectrum measurement module, data preprocessing module, deep learning model prediction module and mechanical device for automatically controlling distance (4);

[0008] The absorption spectrum measurement module is used to collect the absorption spectrum data of the dye solution sample to be tested;

[0009] The data preprocessing module is used to preprocess the absorption spectrum data;

[0010] The deep learning model prediction module is used to train the model based on the preprocessed absorption spectrum data and output the concentration ratio of the dye;

[0011] The automatic distance control mechanical device (4) is used to control the distance between the halogen lamp (3) and the dye solution sample, ensuring that the halogen lamp (3) is always in the best measurement position.

[0012] Optionally, the absorption spectrum measurement module includes a halogen lamp (3), a CMOS camera (1), a diffraction grating (2), a borosilicate glass container (5), a first optical isolation cover (6) and a second optical isolation cover (7);

[0013] The halogen lamp (3) is used to provide a stable light source;

[0014] The high borosilicate glass container (5) is used to hold the dye solution;

[0015] The first optical isolation cover (6) and the second optical isolation cover (7) are used to limit and guide light;

[0016] The diffraction grating (2) is used to decompose the light into a spectrum of different wavelengths;

[0017] The CMOS camera (1) is used to receive the light beam passing through the dye solution sample to be tested and transmit the absorption spectrum data to the data preprocessing module.

[0018] Optionally, the data preprocessing module includes a data filtering unit, a data normalization unit and a data storage unit;

[0019] The data filtering unit is used to perform denoising on the collected spectral data;

[0020] The data normalization unit is used to normalize the denoised spectral data to the same range and complete the preprocessing of the spectral data;

[0021] The data storage unit is used to store the preprocessed spectral data and store it in a local storage device through a file system.

[0022] Optionally, the deep learning model prediction module includes an input layer, a CNN layer, an LSTM layer, a fully connected layer, and an output layer;

[0023] The input layer is used to receive spectral data and pass the spectrum to the CNN layer;

[0024] The CNN layer is used to extract local features in spectral data;

[0025] The CNN layer includes a one-dimensional convolution layer and a maximum pooling layer;

[0026] The one-dimensional convolution layer has an input channel of 1, an output channel of 32, a convolution kernel size of 3, and a maximum pooling layer with a pooling kernel size of 2, which is used to downsample feature maps, reduce feature dimensions, and retain important information;

[0027] The input dimension of the LSTM layer is 32, and the number of hidden units is 64, which is used to process the sequence data of the convolution output to capture the time series dependency of the spectral data during the dyeing process;

[0028] The LSTM layer includes input gate, forget gate, output gate, cell state update layer and hidden state update layer;

[0029] The forget gate is used to determine whether the current moment forgets the information of the previous moment. The input gate is used to control how the input information of the current moment affects the cell state. The cell state update layer combines the input gate and the forget gate to update the current cell state. The output gate is used to determine the output information of the current moment. The hidden state update layer determines the hidden state of the next moment based on the output gate and the current cell state.

[0030] The fully connected layer is used to convert the output of LSTM into dye concentration ratio prediction;

[0031] The fully connected layer includes the first fully connected layer and the Dropout layer;

[0032] The number of neurons in the first fully connected layer is 128, which is used to flatten the output of the LSTM layer into two-dimensional data and connect it to the fully connected layer. The Dropout rate of the Dropout layer is set to 0.5 to prevent data overfitting;

[0033] The output layer converts the predicted results of the concentration ratios of the three dyes into probability distributions.

[0034] Wood stain concentration prediction method based on absorption spectroscopy and deep learning, including:

[0035] Step 1: Place a dye solution sample in a high borosilicate glass container (5), and mix red, yellow and blue dyes in different proportions for each dye solution sample;

[0036] Step 2: using the absorption spectrum measurement module to collect the absorption spectrum data of the dye solution sample to be tested;

[0037] Step 3: The absorption spectrum data is transmitted to the data preprocessing module to obtain the preprocessed absorption spectrum data, the absorbance value is extracted every 20 nanometers from the range of 400-680 nanometers with the processed absorption spectrum data, and the preprocessed absorbance data is stored in the local storage device of the Raspberry Pi;

[0038] Step 4: Use the preprocessed absorbance data to construct a training data set, and use the training data set to train the deep learning model for absorbance values ​​every 20 nm in the range of 400-680 nm;

[0039] Step 5: Input the absorbance data in the format of absorbance values ​​every 20 nanometers in the range of 400-680 nanometers, use the trained deep learning model to predict the dye concentration of the input absorption spectrum data, and output the concentration ratio of the dye;

[0040] Step 6: Calculate the mean square error and the average error between the output dye concentration ratio and the true dye concentration ratio until the error between the dye concentration ratio and the true dye concentration ratio is less than 5%.

[0041] Optionally, collecting the absorption spectrum data of the dye solution sample in step 2 specifically includes:

[0042] A halogen lamp (3) is used as a light source to emit light in a second optical isolation cover (7). The light passes through a borosilicate glass vessel (5) containing a dye solution, passes through a slit in the second optical isolation cover (7), is decomposed into spectra of different wavelengths by a diffraction grating (2), and finally irradiates a CMOS camera (1). The CMOS camera (1) records transmission spectrum data of the dye solution sample to be measured. A borosilicate glass vessel (5) not containing a dye solution sample is used as a blank sample to record transmission spectrum data of the dye solution sample to be measured. The absorbance of the dye solution sample is calculated based on the transmission spectrum data to obtain absorption spectrum data.

[0043] Optionally, the step of obtaining the preprocessed spectral data in step 3 includes:

[0044] Step 3.1: Use Gaussian filtering technology to denoise the collected absorption spectrum data;

[0045] Step 3.2: Use the min-max normalization method to normalize the denoised absorption spectrum data to obtain the preprocessed absorption spectrum data;

[0046] The expression of filtering processing is:

[0047]

[0048] In formula (1), σ is the standard deviation of the Gaussian function, which is used to control the width of the filter, x and y are pixel coordinates, indicating the position in the image plane, and G(j) is the value after filtering;

[0049] The expression of the filtered value G(j) is:

[0050]

[0051] The normalized expression is:

[0052]

[0053] In formula (3), x′ is the normalized value, x is the original data value, and x min is the minimum value in the data set, x max is the maximum value in the data set.

[0054] Optionally, the training parameters of the deep learning model in step 4 include a learning rate of 0.001, a batch size of 32, 100 training rounds, a training data set containing 1000 sets of absorbance data, and a PyTorch framework is used during the training process.

[0055] Optionally, the step of using the trained deep learning model in step 5 to predict the dye concentration of the input absorption spectrum data includes:

[0056] Step 5.1: The absorbance values ​​at intervals of 20 nm in the range of 400-680 nm are used as the spectral data input and output layers. The spectral data is convolved through the one-dimensional convolution layer in the CNN layer. After the convolution operation, the spectral data is input into the maximum pooling layer for downsampling to complete local feature extraction and obtain the convolution features of the spectral data.

[0057] Step 5.2: Input the convolutional features of the spectral data into the LSTM layer to extract the sequence features of the spectral data;

[0058] Step 5.3: Based on the fully connected layer, the sequence features of the spectral data of the first fully connected layer are flattened into two-dimensional spectral data, connected to the fully connected layer, the two-dimensional spectral data is converted into dye concentration ratio prediction results, and the concentration ratio prediction results corresponding to the three dyes are converted into probability distributions through the Softmax activation function in the output layer;

[0059] The expression of the convolution operation is:

[0060] Conv1D(x)=x*ω+b (4);

[0061] In formula (4), x is the input data, ω is the convolution kernel, b is the bias term, and * is the convolution operation;

[0062] The expression for downsampling is:

[0063] MaxPooling(x)=max(x i ) (5);

[0064] In formula (5), x i is the element in the pooling area;

[0065] The calculation formula for the dye concentration ratio prediction result is:

[0066] y = ReLU(W·x+b) (6);

[0067] In formula (6), W is the weight matrix, x is the input feature, and b is the bias term;

[0068] The probability distribution is calculated as:

[0069]

[0070] In formula (7), z i is the output value, and n is the dimension of the output.

[0071] Optionally, the step of extracting sequence features of spectral data in step 5.2 includes:

[0072] Step 5.2.1: Input the result of the previous neuron output into the forget gate to obtain the retained value of the cell state from the previous moment to the current moment;

[0073] Step 5.2.2: Based on the retention value from the cell state at the previous moment to the cell state at the current moment and the spectral data input at the current moment output at the current moment, the current cell state is updated by transmitting it to the output gate;

[0074] Step 5.2.3: According to the updated current cell state and output gate, obtain the sequence features of the current moment output, and update the hidden state of the next moment according to the output gate and the current cell state;

[0075] The calculation formula for the retention value from the cell state at the previous moment to the cell state at the current moment is:

[0076] i t =σ(W i ·[h t-1 ,x t ]+b i ) (8);

[0077] In formula (8), σ is the activation function; W f Input weight for forget gate; b f is the bias term of the forget gate;

[0078] The expression for updating the current cell state is:

[0079] i t =σ(W i ·[h t-1 ,x t ]+b i ) (9);

[0080] C t =f t *C t-1 +i t *tanh(W c ·[h t-1 ,x t ]+b c ) (10);

[0081] In formulas (9) and (10), σ(*) is the sigmoid function, h t-1 is the hidden node output value at the previous moment, x t is the node input at the current moment, b i is the input gate bias term, b c is the unit state bias term, tanh is the activation function, C t Update the value for the cell state;

[0082] The calculation formula for the sequence features output at the current moment is:

[0083] o t =σ(W o ·[h t-1 ,x t ]+b o ) (11);

[0084] In formula (11), o t is the output value of the output gate, W o is the weight of the output gate, b o is the bias of the output gate;

[0085] The expression for updating the hidden state at the next moment is:

[0086] h t =o t *tanh(C t ) (12);

[0087] In formula (12), h t is the hidden node output at the current moment, tan(C t ) is the updated value of the current unit state after conversion by the tanh function.

[0088] The beneficial effects of the present invention are:

[0089] 1. The present invention combines absorption spectroscopy technology with a deep learning model, performs Gaussian filtering and min-max normalization on spectral data, significantly reduces noise and environmental interference in the data, makes spectral data more suitable for training deep learning models, and realizes real-time monitoring and intelligent prediction of the wood dyeing process.

[0090] 2. The present invention performs error elimination processing on the predicted dye concentration, thereby improving the accuracy of wood dyeing concentration prediction. At the same time, it utilizes the advantages of high precision, real-time and automated control of the deep learning model, significantly improves the efficiency of the dyeing process and product quality, and reduces dye waste and environmental pollution. BRIEF DESCRIPTION OF THE DRAWINGS

[0091] Figure 1 A structural block diagram of a wood dye concentration prediction system based on absorption spectroscopy and deep learning provided by the present invention;

[0092] Figure 1 In the figure, 1-CMOS camera, 2-diffraction grating, 3-halogen lamp, 4-mechanical device for automatically controlling distance, 5-borosilicate glassware, 6-first optical isolation cover, 7-second optical isolation cover;

[0093] Figure 2 A flow chart of the method for predicting wood dyeing concentration based on absorption spectroscopy and deep learning provided by the present invention. DETAILED DESCRIPTION

[0094] Specific implementation method 1: Combination Figure 1 This embodiment is described. The structure of the wood dyeing concentration prediction system based on absorption spectrum and deep learning described in this embodiment includes:

[0095] An absorption spectrum measurement module, a data preprocessing module, a deep learning model prediction module, a mechanical device for automatically controlling distance (4), and a second optical isolation cover (7);

[0096] The mechanical device (4) for automatically controlling the distance is a stepper motor, model HM556, brand KHMOS, used to control the rotation of the screw rod; a single-axis controller, model DKC-y110, brand KHMOS, used to control the movement of the stepper motor; a screw rod module, with an effective stroke of 1000 mm, used to adjust the distance between the spectrometer and the sample; the stepper motor and the single-axis controller are connected by wires; the auxiliary device is a photoelectric switch, used to detect the position and limit of the stepper motor;

[0097] The absorption spectrum measurement module is used to collect absorption spectrum data of the dye solution sample to be measured, and the absorption spectrum measurement module comprises a halogen lamp (3), a CMOS camera (1), a diffraction grating (2), a high borosilicate glass container (4), a first optical isolation cover (6) and a second optical isolation cover (7);

[0098] The first optical isolation cover (6) and the second optical isolation cover (7) are made of wooden material and have a size of 40cm x 40cm x 40cm; the inner wall is coated with black matte paint to reduce internal reflection and interference from ambient light; they contain a slit structure for limiting and guiding light, and the slit width is 1 mm; and they have multiple fixing holes for fixing and connecting with other components.

[0099] The halogen lamp (3) is used to provide a stable light source;

[0100] The high borosilicate glass container (5) is used to hold the dye solution;

[0101] The first optical isolation cover (6) and the second optical isolation cover (7) are used to limit and guide light;

[0102] The diffraction grating (2) is used to decompose the light into a spectrum of different wavelengths;

[0103] The CMOS camera (1) is used to receive the light beam passing through the dye solution sample to be tested and transmit the absorption spectrum data to the data preprocessing module.

[0104] The data preprocessing module is used to preprocess the absorption spectrum data, and the data preprocessing module includes a data filtering unit, a data normalization unit and a data storage unit;

[0105] The data filtering unit is used to perform denoising on the collected spectral data;

[0106] The data normalization unit is used to normalize the denoised spectral data to the same range and complete the preprocessing of the spectral data;

[0107] The data storage unit is used to store the preprocessed spectral data and store it in a local storage device through a file system.

[0108] The deep learning model prediction module is used to perform model training based on the preprocessed absorption spectrum data and output the concentration ratio of the dye. The deep learning model prediction module includes: input layer, CNN layer, LSTM layer, fully connected layer and output layer;

[0109] The input layer is used to receive spectral data and transmit the spectrum to the CNN layer;

[0110] The CNN layer is used to extract local features in spectral data;

[0111] The CNN layer includes a one-dimensional convolution layer and a maximum pooling layer;

[0112] The one-dimensional convolution layer has an input channel of 1, an output channel of 32, a convolution kernel size of 3, and a maximum pooling layer pooling kernel size of 2, which are used to downsample feature maps, reduce feature dimensions and retain important information;

[0113] The LSTM layer has an input dimension of 32 and a number of hidden units of 64, which is used to process the sequence data output by the convolution to capture the time series dependency of the spectral data during the dyeing process;

[0114] The LSTM layer includes an input gate, a forget gate, an output gate, a cell state update layer and a hidden state update layer;

[0115] The forget gate is used to determine whether the current moment forgets the information of the previous moment, the input gate is used to control how the input information of the current moment affects the cell state, the cell state update layer combines the input gate and the forget gate to update the current cell state, the output gate is used to determine the output information of the current moment, and the hidden state update layer determines the hidden state of the next moment according to the output gate and the current cell state;

[0116] The fully connected layer is used to convert the output of LSTM into a dye concentration ratio prediction;

[0117] The fully connected layer includes a first fully connected layer and a Dropout layer;

[0118] The number of neurons in the first fully connected layer of the Haloxylon ammodendron tree is 128, which is used to flatten the output of the LSTM layer into two-dimensional data and connect it to the fully connected layer. The Dropout rate of the Dropout layer is set to 0.5 to prevent overfitting of the data.

[0119] The output layer converts the predicted results of the concentration ratios of the three dyes into probability distributions.

[0120] The automatic distance control mechanical device is used to control the distance between the halogen lamp (3) and the dye solution sample, ensuring that the halogen lamp (3) is always in the best measurement position.

[0121] This embodiment combines absorption spectroscopy technology with a deep learning model and performs Gaussian filtering and min-max normalization on the spectral data, which significantly reduces the noise and environmental interference in the data, making the spectral data more suitable for the training of the deep learning model and realizing real-time monitoring and intelligent prediction of the wood dyeing process.

[0122] Specific implementation method 2: Combination Figure 2 The present embodiment is described. The steps of the method for predicting wood dyeing concentration based on absorption spectrum and deep learning described in the present embodiment include:

[0123] S1: Experimental sample preparation;

[0124] S101: Select three basic dyes (reactive red, reactive yellow, and reactive blue), each with different absorbance characteristics: mix the three dyes in different proportions under the same concentration conditions and place them in a borosilicate glass container (4), and design 100 different ratios. Then set 10 different concentration gradients, a total of 1000 dye samples, and prepare 3 replicate samples for each ratio to ensure the reliability and statistical significance of the data.

[0125] S2: using the absorption spectrum measurement module to collect the absorption spectrum data of the dye solution sample to be tested;

[0126] S201: A halogen lamp (3) is used as a light source to emit light in a second optical isolation cover (7). The light passes through a borosilicate glass vessel (5) containing a dye solution, passes through a slit in the second optical isolation cover (7), and is decomposed into spectra of different wavelengths by a diffraction grating (2). The light is finally irradiated onto a CMOS camera (1). The CMOS camera (1) records transmission spectrum data of the dye solution sample to be measured. A borosilicate glass vessel (5) not containing a dye solution sample is used as a blank sample to record transmission spectrum data of the dye solution sample to be measured. The absorbance of the dye solution sample is calculated based on the transmission spectrum data to obtain absorption spectrum data.

[0127] S3: transmitting the absorption spectrum data to the data preprocessing module to obtain the preprocessed absorption spectrum data, extracting the absorbance value every 20 nanometers from the processed absorption spectrum data within the range of 400-680 nanometers, and storing the preprocessed absorbance data in the local storage device of the Raspberry Pi;

[0128] S301: using Gaussian filtering technology to perform denoising on the collected absorption spectrum data;

[0129] S302: normalizing the denoised absorption spectrum data using a min-max normalization method to obtain preprocessed absorption spectrum data;

[0130] The expression of filtering processing is:

[0131]

[0132] In formula (1), σ is the standard deviation of the Gaussian function, which is used to control the width of the filter, x and y are pixel coordinates, indicating the position in the image plane, and G(j) is the value after filtering;

[0133] The expression of the filtered value G(j) is:

[0134]

[0135] The normalized expression is:

[0136]

[0137] In formula (3), x′ is the normalized value, x is the original data value, and x min is the minimum value in the data set, x max is the maximum value in the data set.

[0138] S4: construct a training data set using the preprocessed absorbance data, and use the training data set to train the deep learning model with absorbance values ​​every 20 nm in the range of 400-680 nm;

[0139] S401: The training parameters of the deep learning model include learning rate 0.001, batch size 32, training rounds 100 times, the training data set contains 1000 sets of absorbance data, and the PyTorch framework is used in the training process.

[0140] S402: The absorbance values ​​at intervals of 20 nm in the range of 400-680 nm are input into the output layer as spectral data, and the ReLU activation function is introduced into the output layer to improve the expression ability of the model. The spectral data is convolved through the one-dimensional convolution layer in the CNN layer, and then input into the maximum pooling layer for downsampling to complete local feature extraction and obtain the convolution features of the spectral data;

[0141] The expression of the convolution operation is:

[0142] Conv1D(x)=x*ω+b (4);

[0143] In formula (4), x is the input data, ω is the convolution kernel, b is the bias term, and * is the convolution operation;

[0144] The expression for downsampling is:

[0145] ReLU(x)=max(0,x)

[0146] MaxPooling(x)=max(x i ) (5);

[0147] In formula (5), x i is the element in the pooling area;

[0148] S403: Input the result of the previous neuron output into the forget gate to obtain the retained value of the cell state from the previous moment to the current moment;

[0149] S404: Based on the retention value from the cell state at the previous moment to the cell state at the current moment and the spectrum data input at the current moment output at the current moment, the current cell state is updated by transmitting it to the output gate;

[0150] S405: According to the updated current cell state and output gate, the sequence features output at the current moment are obtained, and according to the output gate and the current cell state, the hidden state at the next moment is updated;

[0151] The calculation formula for the retention value from the cell state at the previous moment to the cell state at the current moment is:

[0152] i t =σ(W i ·[h t-1 ,x t ]+b i ) (6);

[0153] In formula (6), σ is the activation function; W f Input weight for forget gate; b f is the bias term of the forget gate;

[0154] The expression for updating the current cell state is:

[0155] i t =σ(W i ·[h t-1 ,x t ]+b i ) (7);

[0156] C t =f t *C t-1 +i t *tanh(W c ·[h t-1 ,x t ]+b c ) (8);

[0157] In formulas (7) and (8), σ(*) is the sigmoid function, h t-1 is the hidden node output value at the previous moment, x t is the node input at the current moment, b i is the input gate bias term, b c is the unit state bias term, tanh is the activation function, C t Update the value for the cell state;

[0158] The calculation formula for the sequence features output at the current moment is:

[0159] o t =σ(W o·[h t-1 ,x t ]+b o ) (9);

[0160] In formula (9), o t is the output value of the output gate, W o is the weight of the output gate, b o is the bias of the output gate;

[0161] The expression for updating the hidden state at the next moment is:

[0162] h t =o t *tanh(C t ) (10);

[0163] In formula (10), h t is the hidden node output at the current moment, tan(C t ) is the updated value of the current unit state after conversion by the tanh function.

[0164] S406: Flatten the sequence features of the spectral data in the first fully connected layer into two-dimensional spectral data based on the fully connected layer, connect the data to the fully connected layer, prevent data overfitting through the Dropout layer, convert the two-dimensional spectral data into dye concentration ratio prediction results, and convert the concentration ratio prediction results corresponding to the three dyes into probability distribution through the Softmax activation function in the output layer;

[0165] The calculation formula for the dye concentration ratio prediction result is:

[0166] y = ReLU(W·x+b) (11);

[0167] In formula (11), W is the weight matrix, x is the input feature, and b is the bias term;

[0168] The expression of the Dropout layer is:

[0169] Dropout(x) = x·mask (12);

[0170] In formula (12), mask is a binary mask generated according to the set Dropout probability;

[0171] The probability distribution is calculated as:

[0172]

[0173] In formula (13), z i is the output value, and n is the dimension of the output.

[0174] S5: Input absorbance data in the format of absorbance values ​​every 20 nanometers in the range of 400-680 nanometers, use the trained deep learning model to predict the dye concentration of the input absorption spectrum data, and output the concentration ratio of the dye;

[0175] S6: Calculate the mean square error and the average error between the output dye concentration ratio and the true dye concentration ratio until the error between the dye concentration ratio and the true dye concentration ratio is less than 5%.

[0176] This implementation method performs error elimination processing on the predicted dye concentration, thereby improving the accuracy of wood dyeing concentration prediction. At the same time, it utilizes the advantages of high precision, real-time and automated control of the deep learning model, significantly improving the efficiency of the dyeing process and product quality, and reducing dye waste and environmental pollution.

[0177] Example

[0178] In order to verify the technical effect of the present invention, this embodiment adopts the following experiment:

[0179] The spectral data of each sample was in the range of 400-680 nm, and the absorbance value was recorded every 20 nm, for a total of 15 data points.

[0180] Sample design: The experiment generated 1000 sets of data, and the actual test process included 3000 samples (including duplicate samples);

[0181] Model training and validation: The experimental dataset is randomly divided into training set (70%), validation set (15%) and test set (15%).

[0182] During the model training process, the loss function (MSE) is monitored and hyperparameters such as learning rate and batch size are adjusted to improve the prediction accuracy of the model.

[0183] Model prediction and evaluation: The comparison between the predicted results and the actual dye concentration showed that when the training rounds reached 100 times, the mean average error (MAE) of the model was less than 5%, which met the requirements of practical applications.

[0184] The stability and consistency of the model were verified by repeated experiments.

[0185] Error elimination: During the prediction process, further error elimination was performed, including adjusting the data preprocessing method and optimizing the model architecture to ensure that the error between the predicted value and the actual value output by the model was within an acceptable range.

[0186] The specific experimental data are shown in Table 1:

[0187] Table 1

[0188]

[0189] Data analysis: Average error: As can be seen from the table, the average error between the model's predicted results and the actual concentration ratio ranges from 1.2% to 2.4%, and the average error of most samples is less than 2%, showing that the model has a high prediction accuracy.

[0190] Data distribution: The data covers various combinations of different concentrations, including uniform distribution (such as sample 002: 0.50 / 0.25 / 0.25) and uneven distribution (such as sample 013: 0.55 / 0.30 / 0.15). The model performs stably under these different combinations and can accurately predict the proportion of each dye.

[0191] Through the above experiments, it can be concluded that the present invention eliminates errors in the predicted dye concentration, thereby improving the accuracy of wood dyeing concentration prediction. At the same time, it utilizes the advantages of high precision, real-time and automated control of the deep learning model, significantly improving the efficiency of the dyeing process and product quality, and reducing dye waste and environmental pollution.

[0192] The above description is only a preferred embodiment of the present invention and does not constitute any form of limitation to the present invention. Although the present invention has been disclosed as a preferred embodiment as above, it is not intended to limit the present invention. Any technician familiar with the profession can make some changes or modifications to equivalent embodiments of the technical contents disclosed above without departing from the scope of the technical solution of the present invention. However, any simple modification, equivalent replacement and improvement of the above embodiments made according to the technical essence of the present invention, within the spirit and principles of the present invention, still fall within the protection scope of the technical solution of the present invention.

Claims

1. Wood dye concentration prediction system based on absorption spectrum and deep learning, characterized in that: The structure of the wood staining concentration prediction system based on absorption spectrum and deep learning includes: Absorption spectrum measurement module, data preprocessing module, deep learning model prediction module and mechanical device for automatically controlling distance (4); The absorption spectrum measurement module is used to collect the absorption spectrum data of the dye solution sample to be measured; The data preprocessing module is used to preprocess the absorption spectrum data; The deep learning model prediction module is used to perform model training based on the preprocessed absorption spectrum data and output the concentration ratio of the dye; The automatic distance control mechanical device (4) is used to control the distance between the halogen lamp (3) and the dye solution sample, ensuring that the halogen lamp (3) is always in the best measurement position.

2. The wood staining concentration prediction system based on absorption spectrum and deep learning according to claim 1, characterized in that, The absorption spectrum measurement module comprises a halogen lamp (3), a CMOS camera (1), a diffraction grating (2), a borosilicate glass container (5), a first optical isolation cover (6) and a second optical isolation cover (7); The halogen lamp (3) is used to provide a stable light source; The high borosilicate glass container (5) is used to hold the dye solution; The first optical isolation cover (6) and the second optical isolation cover (7) are used to limit and guide light; The diffraction grating (2) is used to decompose light into spectra of different wavelengths; The CMOS camera (1) is used to receive a light beam passing through a dye solution sample to be tested and transmit the absorption spectrum data to a data preprocessing module.

3. The wood staining concentration prediction system based on absorption spectrum and deep learning according to claim 1, characterized in that, The data preprocessing module includes a data filtering unit, a data normalization unit and a data storage unit; The data filtering unit is used to perform denoising on the collected spectral data; The data normalization unit is used to normalize the denoised spectral data to the same range to complete the preprocessing of the spectral data; The data storage unit is used to store the preprocessed spectral data, and stores the data in a local storage device through a file system.

4. The wood staining concentration prediction system based on absorption spectrum and deep learning according to claim 1, characterized in that, The deep learning model prediction module includes an input layer, a CNN layer, an LSTM layer, a fully connected layer and an output layer; The input layer is used to receive spectral data and transmit the spectrum to the CNN layer; The CNN layer is used to extract local features in spectral data; The CNN layer includes a one-dimensional convolution layer and a maximum pooling layer; The one-dimensional convolution layer has an input channel of 1, an output channel of 32, a convolution kernel size of 3, and a maximum pooling layer pooling kernel size of 2, which are used to downsample feature maps, reduce feature dimensions and retain important information; The LSTM layer has an input dimension of 32 and a number of hidden units of 64, which is used to process the sequence data output by the convolution to capture the time series dependency of the spectral data during the dyeing process; The LSTM layer includes an input gate, a forget gate, an output gate, a cell state update layer and a hidden state update layer; The forget gate is used to determine whether the current moment forgets the information of the previous moment, the input gate is used to control how the input information of the current moment affects the cell state, the cell state update layer combines the input gate and the forget gate to update the current cell state, the output gate is used to determine the output information of the current moment, and the hidden state update layer determines the hidden state of the next moment according to the output gate and the current cell state; The fully connected layer includes a first fully connected layer and a Dropout layer, which is used to convert the output of the LSTM into a dye concentration ratio prediction result; The number of neurons in the first fully connected layer is 128, which is used to flatten the output of the LSTM layer into two-dimensional data and connect it to the fully connected layer. The Dropout rate of the Dropout layer is set to 0.5 to prevent overfitting of the data; The output layer converts the predicted results of the concentration ratios of the three dyes into probability distributions.

5. A method for predicting wood staining concentration based on absorption spectrum and deep learning, applied to a system for predicting wood staining concentration based on absorption spectrum and deep learning as described in any one of claims 1 to 4, characterized in that: include: Step 1: Place a dye solution sample in a high borosilicate glass container (5), and mix red, yellow and blue dyes in different proportions for each dye solution sample; Step 2: using the absorption spectrum measurement module to collect the absorption spectrum data of the dye solution sample to be tested; Step 3: The absorption spectrum data is transmitted to a data preprocessing module to obtain preprocessed absorption spectrum data, and absorbance values ​​are extracted every 20 nanometers from the processed absorption spectrum data within the range of 400-680 nanometers, and the preprocessed absorbance data is stored in a local storage device of the Raspberry Pi; Step 4: Use the preprocessed absorbance data to construct a training data set, and use the training data set to train the deep learning model for absorbance values ​​every 20 nm in the range of 400-680 nm; Step 5: Input the absorbance data in the format of absorbance values ​​every 20 nanometers in the range of 400-680 nanometers, use the trained deep learning model to predict the dye concentration of the input absorption spectrum data, and output the concentration ratio of the dye; Step 6: Calculate the mean square error and the average error between the output dye concentration ratio and the true dye concentration ratio until the error between the dye concentration ratio and the true dye concentration ratio is less than 5%.

6. The method for predicting wood staining concentration based on absorption spectrum and deep learning according to claim 5, characterized in that: The absorption spectrum data of the dye solution sample to be tested collected in step 2 specifically includes: A halogen lamp (3) is used as a light source to emit light in a second optical isolation cover (7). The light passes through a borosilicate glass vessel (5) containing a dye solution, passes through a slit in the second optical isolation cover (7), is decomposed into spectra of different wavelengths by a diffraction grating (2), and finally irradiates a CMOS camera (1). The CMOS camera (1) records transmission spectrum data of the dye solution sample to be measured. A borosilicate glass vessel (5) not containing a dye solution sample is used as a blank sample to record transmission spectrum data of the dye solution sample to be measured. The absorbance of the dye solution sample is calculated based on the transmission spectrum data to obtain absorption spectrum data.

7. The method for predicting wood staining concentration based on absorption spectrum and deep learning according to claim 5, characterized in that: The steps of obtaining the pre-processed spectral data in step 3 include: Step 3.1: Use Gaussian filtering technology to denoise the collected absorption spectrum data; Step 3.2: Use the min-max normalization method to normalize the denoised absorption spectrum data to obtain the preprocessed absorption spectrum data; The expression of filtering processing is: In formula (1), σ is the standard deviation of the Gaussian function, which is used to control the width of the filter, x and y are pixel coordinates, indicating the position in the image plane, and G(j) is the value after filtering; The expression of the filtered value G(j) is: The normalized expression is: In formula (3), x′ is the normalized value, x is the original data value, and x min is the minimum value in the data set, x max is the maximum value in the data set.

8. The method for predicting wood staining concentration based on absorption spectrum and deep learning according to claim 5, characterized in that: The training parameters of the deep learning model in step 4 include learning rate 0.001, batch size 32, training rounds 100 times, the training data set contains 1000 sets of absorbance data, and the PyTorch framework is used in the training process.

9. The method for predicting wood staining concentration based on absorption spectrum and deep learning according to claim 5, characterized in that: Step 5: The steps of using the trained deep learning model to predict the dye concentration of the input absorption spectrum data include: Step 5.1: The absorbance values ​​at intervals of 20 nm within the range of 400-680 nm are used as the spectral data input and output layers, and the spectral data are convolved through the one-dimensional convolution layer in the CNN layer. After the convolution operation, the spectral data is input into the maximum pooling layer for downsampling to complete local feature extraction and obtain the convolution features of the spectral data; Step 5.2: Input the convolutional features of the spectral data into the LSTM layer to extract the sequence features of the spectral data; Step 5.3: Based on the fully connected layer, the sequence features of the spectral data in the first fully connected layer are flattened into two-dimensional spectral data, connected to the fully connected layer, the two-dimensional spectral data is converted into dye concentration ratio prediction results, and the concentration ratio prediction results corresponding to the three dyes are converted into probability distributions through the Softmax activation function in the output layer; The expression of the convolution operation is: Conv1D(x)=x*ω+b (4); In formula (4), x is the input data, ω is the convolution kernel, b is the bias term, and * is the convolution operation; The expression for downsampling is: MaxPooling(x)=max(x i ) (5); In formula (5), x i is the element in the pooling area; The calculation formula for the dye concentration ratio prediction result is: y = ReLU(W·x+b) (6); In formula (6), W is the weight matrix, x is the input feature, and b is the bias term; The probability distribution is calculated as: In formula (7), z i is the output value, and n is the dimension of the output.

10. The method for predicting wood staining concentration based on absorption spectrum and deep learning according to claim 9, characterized in that: The steps of extracting sequence features of spectral data in step 5.2 include: Step 5.2.1: Input the result of the previous neuron output into the forget gate to obtain the retained value of the cell state from the previous moment to the current moment; Step 5.2.2: Based on the retention value from the cell state at the previous moment to the cell state at the current moment and the spectral data input at the current moment output at the current moment, the current cell state is updated by transmitting it to the output gate; Step 5.2.3: According to the updated current cell state and output gate, obtain the sequence features of the current moment output, and update the hidden state of the next moment according to the output gate and the current cell state; The calculation formula for the retention value from the cell state at the previous moment to the cell state at the current moment is: i t =σ(W i ·[h t-1 ,x t ]+b i ) (8); In formula (8), σ is the activation function; W f Input weight for forget gate; b f is the bias term of the forget gate; The expression for updating the current cell state is: i t =σ(W i ·[h t-1 ,x t ]+b i ) (9); C t =f t *C t-1 +i t *tanh(W c ·[h t-1 ,x t ]+b c ) (10); In formulas (9) and (10), σ(*) is the sigmoid function, h t-1 is the hidden node output value at the previous moment, x t is the node input at the current moment, b i is the input gate bias term, b c is the unit state bias term, tanh is the activation function, C t Update the value for the cell state; The calculation formula for the sequence features output at the current moment is: the t =σ(W o ·[h t-1 ,x t ]+b o ) (11); In formula (11), o t is the output value of the output gate, W o is the weight of the output gate, b o is the bias of the output gate; The expression for updating the hidden state at the next moment is: h t =o t *tanh(C t ) (12); In formula (12), h t is the hidden node output at the current moment, tan(C t ) is the updated value of the current unit state after conversion by the tanh function.

Citation Information

Patent Citations

  • Skin high-spectral image acquisition unit and calibration method

    CN107402070A

  • Mixed dye liquor concentration spectrum detection method based on long short-term memory neural network

    CN114092784A

  • Composite fixed star spectrum classification method based on CNN and LSTM

    CN116342939A

  • Wood dyeing color difference detection method and system based on deep learning and medium

    CN116559119A

  • Dye liquor concentration monitoring method based on mixed spectrum classification

    CN117990625A