Explanatable wood identification method and device
By constructing the feature detection model and Bayesian classification model, combined with the fusion technology of IAWA feature code, the shortcomings of existing wood classification technology in generalization performance and similar tree species are solved, and higher classification accuracy and credibility are achieved.
Patent Information
- Application Number
- CN202510031212.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-09
- Publication Date
- 2025-05-06
AI Technical Summary
The existing wood classification technology has shortcomings in generalization performance and the distinction between similar tree species, which limits its application in complex wood classification tasks.
The structural structure of wood images is detected by the structural feature detection model, the characteristic values of tube holes, wood rays and parenchymal tissue are quantified, the IAWA signature code is generated, and the signature codes of multiple images are fused and input into the Bayesian classification model for classification.
It realizes a more comprehensive reflection of the interrelationship and classification basis between the characteristics of the material species, and improves the credibility and accuracy of the classification results, especially in complex wood classification tasks.
Smart Images

Figure BDA0005234231930000031 
Figure BDA0005234231930000091 
Figure BDA0005234231930000101
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of wood classification, and in particular to an explainable wood identification method and device. Background Art
[0002] Illegal logging of forest resources is rampant, and the number of some tree species has dropped sharply or even become endangered, seriously affecting the balance of the forest ecosystem. In order to protect endangered plants, the international convention "CITES" requires the identification of imported and exported timber.
[0003] Traditional computer vision methods mainly distinguish wood species by wood texture features. For example, the local binary pattern (LBP) texture features were used to classify 112 types of wood with an accuracy of 86%. Filho et al. used the Gabor filter to extract wood texture features and ultimately achieved an accuracy of 97.77% in the classification task of 41 Brazilian tree species. RosadaSilva et al. used local phase quantization (PQ) technology to classify 77 types of wood microscopic images with an accuracy of 88%. However, these methods have weak generalization performance and low discrimination between similar tree species, which limits their application in complex wood classification tasks. Summary of the invention
[0004] The present invention provides an explainable wood identification method and device.
[0005] An explainable wood identification method, comprising:
[0006] Using a structural feature detection model to detect the structural structure of the wood image; the structural structure includes: pores, wood rays and parenchyma;
[0007] Quantifying the pores, rays and parenchyma to obtain the IAWA characteristic code corresponding to the structural tissue;
[0008] The IAWA feature codes of multiple wood images of the same wood are fused to obtain a fused feature vector;
[0009] The fused feature vector is input into a Bayesian classification model, and the Bayesian classification model is used for reasoning and classification to obtain a classification result of the wood.
[0010] Furthermore, in the above-described explainable wood identification method, the construction of the structural feature detection model includes:
[0011] Construct a dataset of anatomical images of wood cross sections and chord sections;
[0012] annotating the anatomical image data set, marking the positions and contours of the pores, the parenchyma, and the xylem rays, and obtaining an annotated data set;
[0013] Based on the instance segmentation algorithm, the data set is used to train a structural feature detection model to obtain a trained structural feature detection model.
[0014] Furthermore, in the above-explained wood identification method, the quantification of the pores, wood rays and parenchyma to obtain the IAWA characteristic code corresponding to the structural tissue includes:
[0015] Calculating the characteristic values corresponding to the detected pores, wood rays and parenchyma tissues; the characteristic values include: size characteristic values, density characteristic values and distribution characteristic values;
[0016] The calculated characteristic value is matched with the characteristic index in the IAWA standard to obtain the IAWA characteristic code corresponding to the structural organization.
[0017] Furthermore, in the above-explained wood identification method, the IAWA feature codes of multiple wood images of the same wood are fused to obtain a fused feature vector, including:
[0018] Extract the IAWA feature code of each wood image;
[0019] The IAWA feature codes of all wood images are fused to obtain the fused feature vector.
[0020] Further, in the above-described explainable wood identification method, the Bayesian classification model classifies wood using the following formula:
[0021]
[0022] Among them, x represents the code matrix IAC of the IAWA feature code, Y represents the wood type; c represents the wood type, and Y represents the probability.
[0023] Furthermore, in the wood identification method that can be explained as described above, the IAWA characteristic indicators include: quantity, length, width, arrangement and combination.
[0024] An explainable wood identification device, comprising:
[0025] A detection unit, used for detecting the structural structure of the wood image using a structural feature detection model; the structural structure includes: pores, wood rays and parenchyma;
[0026] A quantification unit, used for quantifying the pores, rays and parenchyma to obtain an IAWA characteristic code corresponding to the structural tissue;
[0027] A fusion unit is used to fuse the IAWA feature codes of multiple wood images of the same wood to obtain a fused feature vector;
[0028] The classification unit is used to input the fused feature vector into a Bayesian classification model, and use the Bayesian classification model to perform reasoning and classification to obtain a classification result of the wood.
[0029] The method provided by the present invention classifies wood by utilizing the pore characteristics, ray characteristics and parenchyma characteristics of wood, which can more comprehensively reflect the relationship between wood species characteristics and the classification basis, realize interpretable classification of wood, and improve the credibility of classification results in wood science research and practical applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0031] Figure 1 This is an example of a wood section image dataset collected by the present invention;
[0032] Figure 2 One of the flow charts of the wood identification method that can be explained is provided for the present invention;
[0033] Figure 3 The present invention provides an explainable wood identification method flow chart No. 2;
[0034] Figure 4 It is a schematic diagram of the cross section and chord section of wood;
[0035] Figure 5(a) is one of the schematic diagrams of the wood ray calculation principle;
[0036] Figure 5(b) is the second schematic diagram of the wood ray calculation principle;
[0037] Figure 6 Schematic diagram of feature fusion for multi-image construction. DETAILED DESCRIPTION
[0038] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0039] In recent years, deep learning technology has developed rapidly. Deep learning models such as convolutional neural networks (CNN) have made significant progress in the field of image classification. This technology is also widely used in wood image classification. Compared with traditional texture feature extraction methods, deep learning models can learn and extract deeper image features, significantly improving classification accuracy and generalization ability. Ravindran et al. formed a data set of 2303 macro images of 10 species of sweet leaf family, extracted image features and classified them using convolutional neural networks, and obtained an accuracy of 87.4%. Oktaria et al. obtained AlexNet as the best model in the wood species classification system using CNN, with an accuracy of 96.7%, a recall rate of 98.4%, and an F1 score of 98.3%. Zhishuai et al. combined CNN and transformer and proposed a real-time multi-scale pyramid network called WoodGLNet for wood image classification. In the real-time recognition task of 20 precious woods, the accuracy rate reached 99.60%, significantly improving the efficiency of wood recognition. Compared with the traditional recognition method based on texture features, the deep learning method not only has a significant improvement in classification accuracy, but also shows stronger generalization ability and the ability to handle complex samples. However, although the wood recognition method based on computer vision is efficient. However, the essence of the currently available extracted features is the computer's understanding of the wood section image, while the wood species classification features used in wood science are people's understanding of the anatomical structure of wood. There is a lack of mapping relationship between the two, and it is impossible to interpret the recognition results in wood science. The size, shape and arrangement of vessels, wood rays, parenchyma and growth rings in the wood section defined in IAWA are the main basis for distinguishing wood species. A single image usually only contains some anatomical structural features required for wood species identification, and the number of features is small. Therefore, there is a large uncertainty in judging tree species through a single image. Using multiple images of different parts can obtain more image features, which is conducive to improving the accuracy of wood species recognition. Therefore, the present invention uses a deep learning method to detect pores, wood rays and parenchyma in wood microscopic images, and measures and quantifies these structural features to provide a basis for wood classification that meets the wood science classification standards in the IAWA manual. The IAWA wood classification features in multiple images are integrated and Bayesian network is used for reasoning analysis. Bayesian network can use the probabilistic reasoning method to integrate the anatomical features in different images and generate joint classification probabilities based on multiple features, thereby more comprehensively reflecting the relationship between wood species features and the basis for classification, achieving interpretable classification of wood, and improving the credibility of classification results in wood research and practical applications.
[0040] Figure 1 An anatomical image dataset of wood cross sections and tangential sections is constructed for the present invention.
[0041] Figure 2Provide an explainable wood identification method flow chart for the present invention, such as Figure 2 As shown, the method comprises the following steps:
[0042] Step 1: Use the structural feature detection model to detect the structural structure of the wood image; the structural structure includes: pores, wood rays and parenchyma, providing image evidence for the recognition result;
[0043] Step 2: quantify the pores, wood rays and parenchyma to obtain the IAWA characteristic code corresponding to the structural tissue, providing anatomical evidence for the identification result;
[0044] Step 3: Fuse the IAWA feature codes of multiple wood images of the same wood to obtain a fused feature vector;
[0045] Step 4: Input the fused feature vector into the Bayesian classification model, use the Bayesian classification model to perform reasoning and classification, and obtain the classification result of the wood.
[0046] In the embodiment of the present invention, the Figure 3 The process shown in the figure realizes wood species classification. First, the tree species section images are input into the trained vessel pores, wood rays and parenchyma structure detection models respectively, and the vessel pores, wood rays and parenchyma features in the wood cross-section and tangential section images are identified to quantify the three structural features, such as quantity, length, width, arrangement and combination mode, etc. The quantified structural features are matched with the IAWA feature standard to obtain the IAWA feature code. Finally, the IAWA feature codes extracted from multiple wood cross-section and tangential section microscopic images are fused and input into the Bayesian network to finally realize wood species classification.
[0047] YOLOv8-seg algorithm YOLOv8-seg is a deep learning model that combines target detection and instance segmentation, which can accurately locate and segment different tissues in wood microstructure. The YOLOv8-seg model uses an improved CSP (CrossStage Partial) network structure in the feature extraction backbone network, which can effectively capture features of different scales in the image. The Neck part of YOLOv8-seg further fuses the features, combines feature information from different levels, and enhances the model's ability to express multi-scale features. The feature fusion of the Neck part is critical for capturing a large range of thin-walled tissues and tiny pores or wood rays at the same time. After the feature fusion is completed in the Neck part, the YOLOv8seg model performs target detection and segmentation through its detection head. The detection head uses multi-layer feature maps for prediction, including coordinate positioning, category classification, and mask. For each feature area in the wood image, the model simultaneously outputs the location of its bounding box, category label, and Mask mask.
[0048] The output of the model detection includes three parts: category label, mask, Bbox, and image evidence. The category has four labels: pores, banded parenchyma, pinnate parenchyma, confluent parenchyma, and wood rays. The mask is a binary matrix that represents the location of anatomical features. Bbox is the bounding box of the feature. Image evidence is a composite image of the mask drawn in different colors on the original image.
[0049] The present invention provides an explainable wood identification method, which classifies wood by utilizing the pore characteristics, ray characteristics and parenchyma characteristics of wood, and can more comprehensively reflect the relationship between wood species characteristics and the basis for classification, thereby achieving explainable classification of wood and improving the credibility of classification results in wood science research and practical applications.
[0050] Furthermore, the construction of the structural feature detection model includes: constructing an anatomical image dataset of wood cross sections and tangential sections; annotating the anatomical image dataset to mark the positions and contours of pores, parenchyma and wood rays; dividing the annotated image dataset into a training set, a validation set and a test set; based on an instance segmentation algorithm, using the dataset to train the structural feature detection model to obtain a trained structural feature detection model.
[0051] Specifically, the wood image data used in the embodiments of the present invention comes from the public wood section microscopic image database on the Inside Wood website and the wood microscopic images provided by the Southwest Forestry University Herbarium, such as Figure 1 As shown, the image is in 24-bit JPG format with a resolution of 1205x1536 and is accompanied by scale information. These images are from different tree species and are taken at different magnifications, which helps to improve the generalization ability of the model. Among them, 500 cross-section images and 500 tangential section images are annotated for training pores, wood rays and parenchyma detection models. The Bayesian network classification dataset contains 33 tree species, 604 cross-sections, 822 tangential sections, and a total of 1426 images. A wood chip specimen can generate images of three sections, namely, a cross section, a radial section, and a tangential section. In the embodiment of the present invention, cross-section and tangential section images are used as the main research objects, such as Figure 4 As shown, cross section ( Figure 4 The left picture in the middle is a section perpendicular to the growth direction of the wood (trunk axis). This section shows the parenchyma, pores and arrangement of pores. Figure 4 The middle right picture is a section that is not sawed through the pith and is parallel to the longitudinal direction of the trunk. The wood rays are the main structural feature of this section. The pores, wood rays, and parenchyma contained in these two sections can provide a basis for wood species identification.
[0052] Furthermore, quantifying the pores, xylem rays and parenchyma tissue to obtain the IAWA characteristic code corresponding to the structural tissue includes: calculating the characteristic values corresponding to the detected pores, xylem rays and parenchyma tissue; the characteristic values include: size characteristic values, density characteristic values and distribution characteristic values; matching the calculated characteristic values with the characteristic indicators in the IAWA standard to obtain the IAWA characteristic code corresponding to the structural tissue.
[0053] Specifically, according to the IAWA features of the tree species to be identified, structural features with high discrimination and quantifiable properties are selected as detection objects, as shown in Table 1, and the image detection algorithms of these features are studied. After the model detects the pores, the DBSCAN algorithm is used to cluster the pores. By analyzing the shape and arrangement direction of the clustered pore clusters, the arrangement features of the pores (IAWA feature codes 6, 10, 11) can be judged. For the grouping features of pores (IAWA feature code 9), it is only necessary to calculate whether the overlap between two pores is greater than 90%.
[0054]
[0055] For the features related to pores and diameter, density, and xylem and density (IAWA feature codes 40-41, 46-50, 114-116), given the known image scale and resolution information, the density of pores and xylem and the actual diameter of pores can be calculated by simply counting the number of detected pores and xylem and the pixel width of the pores. Then, according to the corresponding range of these values and the IAWA standard, the corresponding IAWA feature code can be determined. For parenchyma-related features (IAWA feature codes 79-83), the parenchyma detection model has already detected parenchyma targets and distinguished between banded, pinnate, and confluent parenchyma, so these features can be directly judged based on the detection results.
[0056] For the wood ray width feature (IAWA feature code 96-99), since IAWA uses the number of cells in the wood ray to represent the wood ray width, the wood ray detected by the model needs to be segmented and converted into a binary image, where the pixel value of the cell outline is 1 and the pixel value inside the cell is 0. Re-orthogonal projection is performed along the direction of the wood ray to generate a projection histogram. In the projection histogram, each peak corresponds to a cell, and the number of peaks represents the number of cells in the wood ray. From this, the width of the wood ray can be estimated and its corresponding IAWA feature code can be determined.
[0057] Furthermore, fusing the IAWA feature codes of multiple wood images of the same wood to obtain a fused feature vector includes: extracting the IAWA feature code of each wood image; and fusing the IAWA feature codes of all wood images to obtain the fused feature vector.
[0058] Specifically, the purpose of IAWA mapping is to obtain the IAWA signature code. Define the center point of the pore as p = (x1, y1), (x2, y2), ..., (x n ,y n ). The DBSCAN algorithm is used to cluster the pore center points, with the parameters of the minimum number k and minimum distance d for each cluster. A linear function is used to regress each cluster, with the gradient of the regression line as y1, the ratio of width to height as y2, and the count of each cluster as y3. Then the function f is used to n Calculate the IAWA feature code n. The calculation formula for IAWA features 6, 10, and 11 is (1). Where, t n is the threshold value.
[0059]
[0060] Define the number of pores in a cluster as m, and the intersection area of every two pores in the same cluster as s = s1, s2, ..., s k Then, the IAWA characteristic 9 is calculated using formula (2).
[0061]
[0062] f(p)=9if(1*r)≥0.9else 0(2)
[0063] The width of the pore is equal to the width of the bounding box. The actual width of the pore is calculated from the pixel width and the scaling factor. The average pore width is defined as x μm, and the IAWA code calculates it using formula (3).
[0064]
[0065] The number of pores per square millimeter is calculated based on the number of pores and the actual image size. The number of pores per square millimeter is defined as n, and the calculation formula for IAWA features 46-50 is (4).
[0066]
[0067] IAWA features 79 and 83 are predicted by the YOL0 classification. Features 80 and 81 are determined by the ratio of the height to the width of the parenchyma. This ratio is defined as x, and the IAWA features are then calculated using formula (5), where t4 represents the threshold.
[0068] f(x)=80ifx>t4else 81 (5)
[0069] IAWA characteristics 96-99 are related to wood rays and are determined by the average wood ray width. Defining the average wood ray width as x, these characteristics can be calculated using formula (6):
[0070]
[0071] According to IAWA, the ray width is the number of cells at the widest part of the ray. The ray image detected by the YOLO model is divided into three regions, and the middle region is used for further calculation. As shown in Figure 5(a), the middle region is divided into n=10 parts. The white block count in the histogram of each binary image part is taken as the ray width.
[0072] The calculation formula of IAWA 114-115 feature is (7). Wherein, variable x is the average value of rays per millimeter. The image is divided into n=10 parts by lines. The rays passing through the lines are counted and their average value is used to calculate the IAWA feature. The principle of segmentation and counting is shown in Figure 5(b).
[0073]
[0074] The IAWA feature of each image is defined as A=a1, a2, .., an. The IAWA feature fusion vector D contains all the features of the sample, and its calculation formula is (8).
[0075] D=A1∪A2U…∪A n . (8)
[0076] Define a binary IAWA signature matrix IAC, whose length is the same as the number of IAWA signatures selected in Table 1. A binary value of 1 indicates that the sample contains the corresponding IAWA feature, and a value of 0 indicates that the sample does not have the corresponding IAWA feature. Among them, IAWA feature A1 is detected from image 1, A2 is detected from image 2, and A n Detected from image n. The joint vector D contains all the features in the image. The IAWA feature code matrix IAC is generated from D.
[0077] Furthermore, the fused feature vector is input into the Bayesian classification model, and the Bayesian classification model is used for reasoning and classification to obtain the classification result of the wood, including: using the following formula to calculate the probability that x belongs to Y, that is, classifying the wood:
[0078]
[0079] Among them, x represents the code matrix IAC of the IAWA feature code, Y represents the wood type; c represents the wood type, and Y represents the probability.
[0080] The method provided by the present invention has a model input of 6 cross-sections and 4 tangential section images, and an output including wood species identification results and basis. The specific classification process is: by constructing a feature detection model, the 6 cross-sections and 4 tangential section images are detected to obtain the detection results, namely, pores, wood rays and parenchyma. Then, the pores, wood rays and parenchyma are quantified, that is, the number, size and density of pores and wood rays, the shape of parenchyma and other information are counted, and the IAWA classification basis is obtained by using the mapping relationship between the statistical results and the IAWA features. Finally, the classification results are output using the Bayesian classification model.
[0081] In order to comprehensively evaluate the performance of the constructed feature detection model and the Bayesian classification model, the present invention uses the evaluation indicators Accuracy, Precision, Recall and F1-Score as the evaluation indicators of the model. TP is the number of positive samples that the model correctly predicts as positive when it is actually a positive class. It indicates that the model successfully identifies the number of positive samples. FP is the number of negative samples that the model incorrectly predicts as positive when it is actually a negative class. It indicates that the model misclassifies negative samples as positive. FN is the number of positive samples that the model incorrectly predicts as negative when it is actually a positive class. It indicates that the model fails to identify positive samples. Therefore, Accuracy, Precision and Recall can be calculated by formula (10), formula (11) and formula (12):
[0082]
[0083]
[0084] F1-Score is the harmonic mean of Precision and Recall, and is used to achieve a balance between Precision and Recall. The value range of F1-Score is [0,1]. The closer it is to 1, the more balanced the Precision and Recall of the model. Its formula is (13).
[0085]
[0086] AP is the area under the Precision and Recall curves. By calculating Precision and Recall at different thresholds, AP provides the overall performance of the model at different decision thresholds. Its calculation formula is 7, r represents the Recall value. The higher the AP value, the better the Precision and Recall performance of the model can be maintained at different thresholds.
[0087]
[0088] The method provided by the present invention can not only give the classification results of wood, but also give the structural detection image basis, structural index and IAWA classification basis. In the classification experiment of 32 kinds of wood, the average accuracy of wood recognition of the method proposed by the present invention reached about 94.1%, the average precision was 91.8%, the average recall was 96.3%, and the average f1-score was 95.7%.
[0089] Compared with traditional deep learning-based wood identification methods, the method provided by the present invention provides interpretable evidence rooted in wood science, which has significant advantages. The evidence provided by the model provided by the present invention can be traced back to specific wood anatomical features and IAWA features, rather than simply outputting classification results. By combining IAWA features and visual evidence, the classification results become easier to understand.
[0090] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. An explainable wood identification method, characterized in that: include: Detect the structural structure of wood images using a structural feature detection model; The structural structure includes: pores, wood rays and parenchyma; Quantifying the pores, rays and parenchyma to obtain the IAWA characteristic code corresponding to the structural tissue; The IAWA feature codes of multiple wood images of the same wood are fused to obtain a fused feature vector; The fused feature vector is input into a Bayesian classification model, and the Bayesian classification model is used for reasoning and classification to obtain a classification result of the wood.
2. The interpretable wood identification method according to claim 1, characterized in that: The construction of the structural feature detection model includes: Construct a dataset of anatomical images of wood cross sections and chord sections; annotating the anatomical image data set, marking the positions and contours of the pores, the parenchyma, and the xylem rays, and obtaining an annotated data set; Based on the instance segmentation algorithm, the data set is used to train a structural feature detection model to obtain a trained structural feature detection model.
3. The explainable wood identification method according to claim 1, characterized in that: The quantification of the pores, rays and parenchyma to obtain the IAWA characteristic code corresponding to the structural tissue includes: Calculating the characteristic values corresponding to the detected pores, wood rays and parenchyma tissues; the characteristic values include: size characteristic values, density characteristic values and distribution characteristic values; The calculated characteristic value is matched with the characteristic index in the IAWA standard to obtain the IAWA characteristic code corresponding to the structural organization.
4. The explainable wood identification method according to claim 1, characterized in that: The IAWA feature codes of multiple wood images of the same wood are fused to obtain a fused feature vector including: Extract the IAWA feature code of each wood image; The IAWA feature codes of all wood images are fused to obtain the fused feature vector.
5. The interpretable wood identification method according to claim 4, characterized in that: The Bayesian classification model uses the following formula to classify wood: Among them, x represents the code matrix IAC of the IAWA feature code, Y represents the wood type; c represents the wood type, and Y represents the probability.
6. The explainable wood identification method according to claim 3, characterized in that: The IAWA characteristic indicators include: quantity, length, width, arrangement and combination.
7. An interpretable wood identification device, characterized in that: include: a detection unit, for detecting a structural structure of the wood image using a structural feature detection model; The structural structure includes: pores, wood rays and parenchyma; A quantification unit, used for quantifying the pores, rays and parenchyma to obtain an IAWA characteristic code corresponding to the structural tissue; A fusion unit is used to fuse the IAWA feature codes of multiple wood images of the same wood to obtain a fused feature vector; The classification unit is used to input the fused feature vector into a Bayesian classification model, and use the Bayesian classification model to perform reasoning and classification to obtain a classification result of the wood.
Citation Information
Patent Citations
Method for identifying dalbergia cochinchinensis and dalbergia oliveri tree species by fluorescence spectrum
CN108519361A
A method and system for wood identification
CN109145955A
Wood identification method and system based on image feature fusion
CN114186625A
Wood microscopic feature retrieval method accurate to tree species
CN115203266A
Methods for measuring and classifying mixed-species timber
DE102013010773A1
Cited By
Deep learning-based woody plant vascular tissue cell attribute statistical method
CN120544192A