Two-dimensional pore structure extraction method of engineered wood materials based on autoencoder
Through the unsupervised learning method based on the automatic encoder, a specific network model and loss function is designed, the noise and pseudo-pore problems in the extraction of pore structures of engineered wood materials are solved, and efficient and accurate pore structure segmentation is achieved, suitable for different materials and cross-sectional directions.
Patent Information
- Application Number
- CN202310598692.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-25
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2043-05-25
AI Technical Summary
The existing binarization method is difficult to effectively extract the pore structure of engineered wood materials, especially in SEM images with noise sensitivity, small differences in grayscale values or overlapping, there is a problem of poor connection between pseudo pores and targets.
An unsupervised learning method based on an automatic encoder is adopted to design a network model including encoder and decoder, and combined with specific loss functions and activation functions, the image is binarized, including image enhancement, encoder and decoder training, to achieve the extraction of the pore structure of engineered wood materials.
It realizes clear segmentation of the pore structure of engineered wood materials, avoids noise interference, adapts to pore structure extraction in different materials and cross-sectional directions, and improves robustness and accuracy.
Smart Images

Figure CN116664646B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of building thermal engineering, and particularly to a method for extracting two-dimensional pore structures of engineered wood materials based on an autoencoder. Background Art
[0002] Engineered wood materials are the main materials of a relatively new modern wood structure building. The pore structure information thereof is a necessary prerequisite for studying building thermal parameters (such as thermal conductivity, water vapor diffusion coefficient, etc.), and can provide a bridge between material structure and performance. The pore structure information can usually be obtained by acquiring a background image through a scanning electron microscope (SEM) image and obtaining it through some binarization methods.
[0003] Common binarization methods in the field include global threshold methods and local threshold methods, etc. Global threshold methods include the Otsu algorithm, IsoData algorithm, MaxEntropy algorithm, etc. These algorithms perform binarization processing using a single threshold, but they all have the disadvantages of being sensitive to noise, being unable to clearly segment SEM images with small gray value differences or overlaps, and being difficult to adapt to the extraction of pore structures of SEM images of different engineered wood materials. The local threshold method can perform average threshold processing according to the pixels around the image, which can avoid the influence of image gray non-uniformity, but its target connectivity is poor and it contains noise. For the pore structure of engineered wood materials, excessive noise will cause more artifacts in the pore structure and introduce small pores that actually do not exist. The invention patent CN110021030A, "A method for determining the segmentation threshold of digital images of rock and soil materials", is a binarization method applicable to rock and soil materials, and it has the characteristic of being widely applicable to SEM images of various rock and soil materials, but its essence is still a global threshold method, so it still has the above-mentioned defects of global threshold methods. Summary of the Invention
[0004] Based on the defects of the prior art mentioned in the above background art, and there is no binarization extraction method for the pore structure of SEM images of engineered wood materials, the present invention provides a method for extracting two-dimensional pore structures of engineered wood materials based on an autoencoder. This method can quickly obtain a complete and clear pore structure of engineered wood materials in an unsupervised learning manner, can avoid noise, can completely segment the pore structure of SEM images of engineered wood materials with small gray value differences, and is widely applicable to the extraction of pore structures of SEM images of various engineered wood materials.
[0005] The present invention specifically adopts the following technical solutions:
[0006] A method for extracting two-dimensional pore structures of engineered wood materials based on an autoencoder specifically includes the following steps:
[0007] S1: Obtain the SEM image of the engineered wood material;
[0008] S2: Crop and enhance the SEM image;
[0009] S3: Design an autoencoder network model including an encoder and a decoder, and input the image processed in step S2 into the autoencoder network model for training; the objective function of the autoencoder network model is:
[0010]
[0011] z = f(x)
[0012]
[0013] where f and g are the encoder and decoder respectively, Loss() is the loss function, x, z, and are the input image matrix of the encoder, the input hidden vector of the decoder, and the image matrix reconstructed by the decoder respectively. In the loss function, the input image matrix x of the encoder needs to be converted to x0 according to the following formula:
[0014]
[0015] where x0 is the normalized true value of the input image matrix x in the loss function, x flatten is the flattened vector of the encoder input image matrix, and max(x flatten ) is the maximum pixel gray value of x flatten ;
[0016] S4: Use the autoencoder network model obtained after training in step S3 to perform binary extraction on the image processed in steps S1 and S2, and the two-dimensional pore structure of the engineered wood material can be obtained.
[0017] Furthermore, in step S1, obtaining the SEM image of the engineered wood material needs to be carried out according to the following steps:
[0018] S1-1: Perform preliminary cutting on the entire engineered wood material, select the cross-section and the central cross-section in the length direction where the distance from all end faces is greater than or equal to 50 mm as the reference cross-section, and avoid defects on the cross-section at the same time. Then cut out a square engineered wood material with a cross-section of less than 20×20 mm, and then continue to polish to obtain an engineered wood material with complete three cut surfaces;
[0019] S1-2: Air convection dry the engineered wood material processed in step S1-1 at 103±1°C until the mass change is less than 0.1%, and then perform sputter coating;
[0020] S1-3: Perform SEM characterization on the engineered wood material processed in step S1-2 to obtain a characterization image, and magnify the characterization image to obtain the microscopic surface images of the engineered wood material on two planes, namely the plane of the board surface and the plane of the thickness surface.
[0021] Furthermore, in step S1-1, the small specimens with a distance of 50 mm from the end face and a size of 20×20 mm are the values preferably obtained based on considering the mechanical properties and defect sizes of the engineered wood material, with the principle of being easy to cut and avoid the disassembly of basic units such as wood chips and veneers.
[0022] Furthermore, in step S2, the image enhancement processing is specifically as follows:
[0023] Obtain the original image input image matrix x from the cropped image input , for the original image input image matrix x input of each pixel x i,input perform the following processing:
[0024]
[0025] where, x i,input and x i ' are respectively the gray value of the i-th pixel in the original SEM image and the gray value of the i-th pixel in the processed SEM image, and α and β are respectively the contrast coefficient and the brightness coefficient.
[0026] Furthermore, considering the characteristics of the SEM image of the engineered wood material and the binarization extraction effect of the pore structure, the contrast coefficient and the brightness coefficient can be selected as 1.5 and 40 respectively.
[0027] Furthermore, in step S3, both the encoder and the decoder of the autoencoder are four-layer, and each layer in the encoder and decoder structures includes the following sub-layers connected in sequence: a fully connected sub-layer, a Normal sub-layer, and a B-Sigmoid binarization activation function sub-layer.
[0028] Furthermore, in each sub-layer in step S3, the number of input nodes of the fully connected sub-layer in the four-layer encoder is N, 90, 10, 9 respectively; the number of nodes of the input hidden vector z of the four-layer decoder is 4, and the number of input nodes of the fully connected sub-layer in the four-layer decoder is 4, 9, 10, 90 respectively, where N is the total number of pixels of the image processed in step S2.
[0029] Furthermore, the Normal sub-layer in step S3 is an autoencoder network layer dedicated to the binarization extraction of the pore structure of the engineered wood material, and it processes the image as follows:
[0030]
[0031] Among them, ζ i m is the gray value of the i-th pixel in the m-th layer of the image after Normal sub-layer processing, and y i m is the gray value of the i-th pixel in the m-th layer of the image after fully connected sub-layer processing. The subscripts max and min are the maximum and minimum gray values of all pixels in the m-th layer respectively. m ∈ {1, 2, 3, 4, 5, 6, 7, 8}, where m = 1, 2, 3, 4 correspond to the four layers in the encoder, and m = 5, 6, 7, 8 correspond to the four layers in the decoder.
[0032] Furthermore, in step S3, the B-Sigmoid binary activation function sub-layer can enable the autoencoder to achieve the binary function of the SEM image. The B-Sigmoid binary activation function and its first derivative expression are respectively:
[0033]
[0034]
[0035] Among them, φ() is the B-Sigmoid binary activation function, and φ′() is the first derivative of the B-Sigmoid binary activation function.
[0036] Furthermore, in the said step S3, the loss function is defined as a weighted combination form of two specific loss functions. The weighted weights are obtained based on the homoscedastic aleatoric uncertainty in Bayesian theory, and this is a loss function applicable to the specific task of binary extraction of the pore structure of the SEM image of engineered wood materials:
[0037]
[0038] Among them, is the mean square error loss function, is the weighted classification loss function, lnσ MSE and are respectively and the natural logarithm of the standard deviation of the loss function result; MSE and The expressions of the loss functions are as follows:
[0039]
[0040]
[0041] Among them, x 0i is the true value of the i-th pixel in x0; The image matrix reconstructed by the decoder and the predicted value of the i-th pixel in; γ = 1, which is a weighting factor.
[0042] Furthermore, lnσ in the loss function in step S3 MSE and are training parameters that participate in the model training process and are automatically learned and updated during the model training process, and the initial values of both are 1.
[0043] Furthermore, the autoencoder training in step S3 uses the Adam optimizer, with an initial learning rate of 0.01. The learning rate is reduced to 10% of the original value every 15 iteration steps, and the total number of iteration steps is 200.
[0044] The present invention has the following advantages compared with the prior art:
[0045] The present invention uses an autoencoder network model for pore structure extraction, which can significantly avoid noise and accurately identify the pore structure characteristics of engineered wood materials; it can clearly segment SEM images with small gray value differences or overlaps; it can adapt to the pore structure extraction of SEM images of different engineered wood materials in different cross-sectional directions; the designed Normal sublayer and B-Sigmoid binary activation function match the characteristics of binary extraction of the pore structure of SEM images, enabling the autoencoder network model to perform automated and unsupervised learning on images; the designed weighted combined loss function based on homoscedastic aleatoric uncertainty can automatically obtain the weights of the loss function through training, improving the robustness of the autoencoder network model for pore structure extraction performance of different engineered wood materials. Compared with the background technology of pore structure extraction in the field of building thermal engineering, such as the method based on global threshold and the method based on local threshold, etc., the present invention has better robustness and accuracy and precision in pore structure extraction. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 is a flowchart of a method for extracting two-dimensional pore structure of engineered wood materials based on an autoencoder according to the present invention;
[0047] Figure 2 are SEM images of engineered wood materials: (a) original image, (b) cropped image, (c) image after enhancement processing;
[0048] Figure 3 is a schematic structural diagram of an unsupervised autoencoder network model;
[0049] Figure 4Effect diagram of binarization extraction of pore structure in SEM image of engineered wood materials: (a) True labeled pore structure image, (b) Pore structure image obtained by the method of the present invention, (c) Pore structure image obtained by Ostu algorithm, (d) Pore structure image obtained by MaxEntropy algorithm, (e) Pore structure image obtained by Yen algorithm, (f) Pore structure image obtained by IsoData algorithm, (g) Pore structure image obtained by Liu-Cao algorithm, (h) Pore structure image obtained by Zhou algorithm, and (i) Pore structure image obtained by local threshold algorithm. Detailed implementation manners
[0050] The present invention will be further described below in conjunction with the accompanying drawings and specific examples.
[0051] As Figure 1 shown, a method for extracting two-dimensional pore structure of engineered wood materials based on autoencoder includes the following main steps:
[0052] S1: Obtain the SEM image of the engineered wood material.
[0053] For the whole engineered wood material, perform preliminary cutting and processing. Select the cross-section with a distance of not less than 50 mm from all end faces and the central cross-section in the length direction as the reference cross-section, while avoiding defects on the cross-section. Then cut out a square engineered wood material with a cross-section size less than 20×20 mm, and then continue to polish to obtain an engineered wood material with complete three cut surfaces;
[0054] Perform air convection drying treatment on the engineered wood material with complete three cut surfaces at 103±1°C until the mass change is less than 0.1%, and then perform sputtering coating treatment;
[0055] Perform SEM characterization on the sputtering-coated engineered wood material to obtain a characterization image, and magnify the characterization image to obtain the microscopic surface images of the engineered wood material on two main planes, namely the board surface plane and the thickness plane.
[0056] S2: Crop and enhance the SEM image.
[0057] First, crop the SEM image obtained in step S1 ( Figure 2 (a)) to obtain the cropped SEM image ( Figure 2 (b)), and obtain the original image input image matrix x input .
[0058] Set the contrast coefficient and brightness coefficient to 1.5 and 40 respectively, and perform the following conversion on each pixel x input of the original image input image matrix x i,input :
[0059]
[0060] Among them, x i,input and x i are the gray values of the i-th pixel in the original SEM image and the gray value of the i-th pixel in the SEM image after image enhancement processing respectively, and α and β are the contrast coefficient and the brightness coefficient respectively.
[0061] After image enhancement processing, the obtained SEM image is as shown in Figure 2 (c), and the image input image matrix x is obtained from the image processed in step S2.
[0062] S3: Design an autoencoder network model including an encoder and a decoder, and input the image processed in step S2 into the autoencoder network model for training; the objective function of the autoencoder network model is:
[0063]
[0064] z = f(x)
[0065]
[0066] Among them, f and g are the encoder and the decoder respectively, Loss() is the loss function, x, z, and are the input image matrix of the encoder, the input hidden vector of the decoder, and the image matrix reconstructed by the decoder respectively. In the loss function, the input image matrix x of the encoder needs to be converted to x0 according to the following formula:
[0067]
[0068] Among them, x0 is the normalized true value of the input image matrix x in the loss function, x flatten is the flattened vector of the encoder input image matrix, and max(x flatten ) is the maximum pixel gray value of x flatten .
[0069] Both the encoder and the decoder of the autoencoder have four layers, and each layer in the structures of the encoder and the decoder includes the following successively connected sub-layers: a fully connected sub-layer, a Normal sub-layer, and a B-Sigmoid binary activation function sub-layer.
[0070] The number of input nodes of the fully connected sub-layers in the four-layer encoder is N, 90, 10, and 9 respectively; the number of nodes of the input hidden vector z of the four-layer decoder is 4, and the number of input nodes of the fully connected sub-layers in the four-layer decoder is 4, 9, 10, and 90 respectively, where N is the total number of pixels of the image processed in step S2.
[0071] The Normal sub - layer is an auto - encoder network layer dedicated to the binary extraction of the pore structure of engineered wood materials. It processes images as follows:
[0072]
[0073] Among them, ζ i m is the gray - scale value of the i - th pixel in the m - th layer of the image after being processed by the Normal sub - layer, y i m is the gray - scale value of the i - th pixel in the m - th layer of the image after being processed by the fully - connected sub - layer. The subscripts max and min are respectively the maximum and minimum gray - scale values of all pixels in the m - th layer. m ∈ {1, 2, 3, 4, 5, 6, 7, 8}, where m = 1, 2, 3, 4 correspond to the four layers in the encoder, and m = 5, 6, 7, 8 correspond to the four layers in the decoder.
[0074] The B - Sigmoid binary activation function sub - layer can enable the auto - encoder to achieve the binary function of SEM images. The B - Sigmoid binary activation function and its first - order derivative expressions are respectively:
[0075]
[0076]
[0077] Among them, φ() is the B - Sigmoid binary activation function, and φ′() is the first - order derivative of the B - Sigmoid binary activation function.
[0078] In the loss function of the above - mentioned auto - encoder, the loss function is defined as a weighted combination form of two specific loss functions. Its weights are obtained based on the homoscedastic aleatoric uncertainty in Bayesian theory, and this is a loss function applicable to the specific task of binary extraction of the pore structure of SEM images of engineered wood materials:
[0079]
[0080] Among them, is the mean - squared error loss function, is the weighted classification loss function, lnσ MSE and are respectively and the natural logarithm of the standard deviation of the loss function results; MSE and The expressions of the loss functions are as follows:
[0081]
[0082]
[0083] where x 0i is the gray-scale normalized true value of the i-th pixel in the original SEM image; is the predicted value of the i-th pixel in the image matrix reconstructed by the decoder; γ = 1, which is the weighting factor.
[0084] lnσ in the above loss function MSE and are training parameters that participate in the training process of the autoencoder and are automatically learned and updated during the model training process, and their initial values are both 1. The autoencoder is trained using the Adam optimizer with an initial learning rate of 0.01. The learning rate is reduced to 10% of the original value every 15 iteration steps, and the total number of iteration steps is 200.
[0085] S4: Use the trained autoencoder network model to perform binary extraction on the image processed in steps S1 and S2, and the two-dimensional pore structure of the engineered wood material can be obtained.
[0086] Figure 4 shows the binary image of the pore structure of the engineered wood material obtained by the present invention, where Figure 4 (a) is the true labeled pore structure, Figure 4 (b) is the pore structure of the engineered wood material extracted by the method of the present invention, Figure 4 (c) to Figure 4 (i) are the pore structures of the engineered wood material obtained by various global threshold methods and local threshold methods mentioned in the technical background (Otsu algorithm, Max Entropy algorithm, Yen algorithm, IsoData algorithm, Liu-Cao algorithm, Zhou algorithm, and local threshold algorithm respectively. The Liu-Cao algorithm is the algorithm of the invention patent CN110021030A "A method for determining the segmentation threshold of digital images of geotechnical materials"), and the Zhou algorithm is the algorithm in the literature "A new parametric segmentation method based on sandy mudstone SEM images". Table 1 shows the comparison of the image quality index parameters related to the binary images of the pore structures of the engineered wood material obtained by the present invention and various methods in the technical background. It can be seen from Figure 4 and the following table that the method of the present invention can extract the pore structure of the engineered wood material completely and clearly, and has relatively prominent performance compared with various methods in the technical background.
[0087] Table 1
[0088]
[0089] *NRM and MPM represent Negative Rate Metric (misclassification rate) and Misclassification Penalty Metric respectively, and their definitions are from the literature "Binarization techniques for degraded document images - A review". The specific calculation formulas are as follows:
[0090]
[0091]
[0092] Among them, TP, TN, FP, and FN are the number of pixels of positive samples (pores) correctly identified, the number of pixels of negative samples (non-pores) correctly identified, the number of pixels of positive samples (pores) misidentified, and the number of pixels of negative samples (non-pores) misidentified respectively. N FN and N FP are the number of pixels of FN and FP respectively, D is the normalization coefficient, d i,FN and d j,FP are the pixel values of the i-th FN and the j-th FP respectively, MP FN and MP FP are the misclassification penalty rates of FN and FP respectively.
[0093] The above description shows and describes several preferred embodiments of the present application. However, as mentioned before, it should be understood that the present application is not limited to the form disclosed herein, should not be regarded as excluding other embodiments, but can be used in various other combinations, modifications, and environments, and can be changed within the scope of the application concept described herein through the above teachings or the technology or knowledge in related fields. And the changes and alterations made by those skilled in the art that do not depart from the spirit and scope of the present application shall all be within the protection scope of the appended claims of the present application.
Claims
1. A method for extracting two-dimensional pore structures of engineered wood materials based on autoencoders, characterized in that, Specifically, it includes the following steps: S1: Obtain the SEM image of the engineered wood material; S2: Crop and enhance the SEM image; S3: Design an autoencoder network model including an encoder and a decoder, and input the image processed in step S2 into the autoencoder network model for training; the objective function of the autoencoder network model is: Among them, f and g are the encoder and decoder respectively, Loss() is the loss function, x, z, and are the input image matrix of the encoder, the input latent vector of the decoder, and the image matrix reconstructed by the decoder respectively. In the loss function, the input image matrix x of the encoder needs to be converted to x0 according to the following formula: Among them, x0 is the normalized true value of the input image matrix x in the loss function, and x flatten is the flattened vector of the encoder input image matrix, max(x flatten ) is the maximum pixel gray value of x flatten ; S4: Use the autoencoder network model obtained after training in step S3 to perform binary extraction on the image processed in steps S1 and S2, and the two-dimensional pore structure of the engineered wood material can be obtained; Both the encoder and decoder of the autoencoder network model are four-layer, and each layer in the encoder and decoder structures includes the following successively connected sub-layers: a fully connected sub-layer, a Normal sub-layer, and a B-Sigmoid binary activation function sub-layer; The Normal sub-layer processes the image as follows: Among them, is the gray value of the i-th pixel in the m-th layer of the image after the Normal sub-layer processing, y i m is the gray value of the i-th pixel in the m-th layer of the image after the fully connected sub-layer processing. The subscripts max and min are the maximum and minimum gray values of all pixels in the m-th layer respectively. m ∈ {1, 2, 3, 4, 5, 6, 7, 8}, where m = 1, 2, 3, 4 correspond to the four layers in the encoder, and m = 5, 6, 7, 8 correspond to the four layers in the decoder; In the B-Sigmoid binary activation function sub-layer, the expressions of the B-Sigmoid binary activation function and its first derivative are respectively: Among them, φ() is the B-Sigmoid binary activation function, and φ′() is the first derivative of the B-Sigmoid binary activation function; In step S3, the loss function is defined as a weighted combination form of two specific loss functions, and the weighted weights are obtained based on the homoscedastic aleatoric uncertainty in Bayesian theory: Among them, is the mean square error loss function, is the weighted classification loss function, lnσ MSE and are respectively and the natural logarithm of the standard deviation of the loss function results; MSE and The expressions of the loss functions are as follows: where x 0i is the true value of the i-th pixel in x0; is the predicted value of the i-th pixel in the image matrix reconstructed by the decoder; γ = 1 is the weighting factor, where N is the total number of pixels of the SEM image after the processing in step S2.
2. The two-dimensional pore structure extraction method of engineered wood materials based on an autoencoder according to claim 1, wherein, In step S1, obtaining the SEM image of the engineered wood material needs to be carried out according to the following steps: S1-1: Conduct preliminary cutting and processing on the entire engineered wood material. Select the cross-section and the central cross-section in the length direction of the specimen that are more than or equal to 50 mm away from all end faces as the reference cross-section, and avoid defects on the cross-section at the same time. Then cut out a square engineered wood material with a square cross-section and a cross-sectional size less than 20×20 mm, and then continue to polish to obtain an engineered wood material with complete three cut surfaces; S1-2: Air convection dry the engineered wood material processed in step S1-1 at 103±1°C until the mass change is less than 0.1%, and then perform sputter coating treatment; S1-3: Perform SEM characterization on the engineered wood material processed in step S1-2 to obtain a characterization image, and magnify the characterization image to obtain the microscopic surface images of the engineered wood material on two planes, namely the board plane and the thickness plane; 3. A method for extracting the two-dimensional pore structure of engineered wood materials based on an autoencoder according to claim 1, characterized in that, In step S2, the image enhancement processing is specifically: Obtain the original image from the cropped image, and input the image matrix x input , for each pixel x input of the original image input image matrix x i,input perform the following processing: where x i,input and x i are the gray values of the i-th pixel in the original SEM image and the gray values of the i-th pixel in the processed SEM image, respectively. α and β are the contrast coefficient and the brightness coefficient, respectively.
4. The method for extracting the two-dimensional pore structure of engineered wood materials based on an autoencoder according to claim 1, wherein The input node numbers of the fully connected sub-layers in the four-layer encoder are N, 90, 10, and 9 respectively; the node number of the input hidden vector z of the four-layer decoder is 4, and the input node numbers of the fully connected sub-layers in the four-layer decoder are 4, 9, 10, and 90 respectively.
5. A method for extracting the two-dimensional pore structure of engineered wood materials based on an autoencoder according to claim 1, characterized in that, A method for extracting two-dimensional pore structures of engineered wood materials based on an autoencoder according to claim 1, wherein lnσ MSE and are training parameters that are automatically learned and updated during model training, and the initial values of both are 1.
6. A method for extracting two-dimensional pore structures of engineered wood materials based on an autoencoder according to claim 1, characterized in that, In step S3, the Adam optimizer is used in the model training process, the initial learning rate is 0.01, the learning rate is reduced to 10% of the original value every 15 iteration steps, and the total number of iteration steps is 200.
Citation Information
Patent Citations
Segmentation threshold determination method for rock-soil body material digital image
CN110021030A
Hyperspectral image change detection method based on weighted support vector machine
CN109753973A
Rock core FIB-SEM image segmentation method based on convolutional neural network
CN112927253A