A method and system for heartwood region segmentation of exotic wood flooring images
By employing an unsupervised learning framework between teachers and students and histogram style alignment technology, the problems of low efficiency and poor adaptability in the segmentation of heartwood and sapwood regions in images of different wood species were solved, achieving high-precision cross-species segmentation results and reducing annotation costs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NANJING FORESTRY UNIV
- Filing Date
- 2025-06-04
- Publication Date
- 2026-07-14
AI Technical Summary
Existing technologies suffer from problems such as low recognition efficiency, high cost of manual annotation, poor model adaptability, and poor generalization performance in the segmentation of heartwood and sapwood regions in images of different wood species, especially when applied to different tree species.
We employ a teacher-student unsupervised learning framework that combines histogram style alignment and sapwood spatial distribution prior. By introducing histogram style alignment before training the target domain image and combining it with sapwood spatial distribution prior, we design a pseudo-label confidence filtering mechanism and a consistency loss function to optimize the core-sapwood region segmentation model.
It improves the model's adaptability and generalization performance for cross-material segmentation tasks, reduces annotation costs, and enhances boundary segmentation accuracy and morphological consistency, making it suitable for practical applications with low annotation and high variability.
Smart Images

Figure CN120747127B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image segmentation, and in particular to a method and system for segmenting the heartwood and sapwood regions of images of dissimilar wood flooring. Background Technology
[0002] Wood flooring, a natural material widely used in interior decoration and construction, is favored by the market for its natural color and warm texture. Different tree species exhibit varying hues and textures due to differences in their growth environment, physical properties, and internal structure. In particular, the heartwood and sapwood regions within the wood differ significantly in color, density, and durability, directly impacting the appearance quality and grading of the wood flooring. Heartwood, located in the center of the wood, is darker in color, denser, and more resistant to corrosion; sapwood, distributed on the periphery, is relatively lighter in color, more reactive, but less durable. Therefore, accurately identifying and separating the heartwood and sapwood regions is crucial for precise classification, appropriate board arrangement, and quality control of wood flooring.
[0003] Currently, the identification of heartwood and sapwood areas mainly relies on manual visual inspection, with experienced inspectors classifying and screening the wood. This manual identification method suffers from low efficiency, reliance on subjective experience, and poor consistency, especially when there are significant differences in texture and color between tree species, leading to a substantial increase in the error rate. Furthermore, the manual visual inspection process is difficult to integrate effectively with standardized and automated production lines, hindering the development of intelligent and large-scale wood flooring manufacturing processes.
[0004] With the rapid development of deep learning technology in image recognition, semantic segmentation methods based on convolutional neural networks have begun to be applied to the task of identifying heartwood and sapwood regions in wood images. These methods can automatically extract image features for region localization, offering advantages in recognition efficiency and consistency compared to manual visual inspection. However, existing deep learning-based segmentation methods generally rely on a large number of labeled samples for supervised training, and the training data is often concentrated on the same tree species or the same shooting environment. Since different tree species exhibit significant differences in texture, color, and other stylistic features, the segmentation performance tends to decline when the model is applied to images of dissimilar wood species. Furthermore, the pixel-by-pixel annotation process for heartwood and sapwood regions is complex and costly, limiting the large-scale application of fully supervised segmentation technology in actual production. Moreover, in actual factory environments, differences in shooting equipment and lighting conditions can easily lead to shifts in image data distribution, causing model performance to degrade or even fail in new environments. This often necessitates re-labeling new data and retraining, resulting in a significant increase in labor and time costs. Summary of the Invention
[0005] Purpose of the invention: The purpose of this invention is to provide a method and system for segmenting the heartwood and sapwood regions of images of wood flooring of different species.
[0006] Technical solution: The heartwood and sapwood region segmentation method for dissimilar wood flooring images according to the present invention includes the following steps:
[0007] Images of source wood flooring were collected to construct a source domain dataset, and a heartwood and sapwood region segmentation model based on DeepLabV3+ was trained.
[0008] Images of target wood flooring species are collected to construct an initial dataset for the target domain, which includes labeled and unlabeled subsets. Pixel distributions are calculated for each image in the source domain dataset, and style alignment is achieved by mapping each image in the target domain dataset according to the pixel distributions to obtain the target domain dataset.
[0009] Using the source domain dataset and the target domain dataset, the heartwood and sapwood region segmentation model is optimized using a teacher-student unsupervised learning framework to obtain the optimized heartwood and sapwood region segmentation model.
[0010] An optimized heartwood and sapwood region segmentation model was used to segment the heartwood and sapwood regions of wood flooring images.
[0011] Furthermore, the step of establishing a calculated pixel distribution for each image in the source domain dataset and mapping each image in the target domain dataset according to the pixel distribution to achieve style alignment and obtain the target domain dataset includes:
[0012] Calculate the pixel intensity distribution for each image in the source domain dataset, and calculate the mean of the pixel intensity distribution for all images. ;
[0013] The pixel intensity of each image in the target domain dataset is normalized, and the pixel intensity distribution is calculated for all images. ;
[0014] By minimizing and The distance between the images is used to match and map each image in the target domain dataset, and the pixel intensity is normalized again to obtain the target domain dataset.
[0015] Furthermore, the parameters of the heartwood-sapwood region segmentation model are used as the initial parameters of the student model and the teacher model. During the optimization of the heartwood-sapwood region segmentation model using the teacher-student unsupervised learning framework, the teacher model parameters are updated by performing an exponential moving average on the student model.
[0016] Furthermore, in the process of optimizing the heartwood / sapwood region segmentation model using a teacher-student unsupervised learning framework, each location in the unlabeled target wood species wood flooring image is... The relationship between confidence level and confidence threshold is determined, and pseudo-labels with high confidence levels are retained. The determination process is expressed as follows:
[0017] ;
[0018] in, These are filtered pseudo-tags. Indicates position Pseudo-label prediction category Indicates position The logits vector, It is a location confidence level For the first Category in the next training round The confidence threshold , The momentum coefficient is updated for the threshold. For category No. The confidence threshold for each training round. This refers to images of unlabeled target wood flooring species. Pseudo-labels for categories The predicted probabilities of the pixels are sorted and then averaged by the top-k% of the highest values.
[0019] Furthermore, in optimizing the heartwood and sapwood region segmentation model using a teacher-student unsupervised learning framework, the loss function of the student model includes the sapwood region spatial prior guidance loss. :
[0020] ;
[0021] in, The weighted hyperparameter for the prior loss of sapwood. For position Edge masking of timber area This is an indicator function that takes the value 1 if the condition is true and 0 otherwise. Indicates the student model at position The predicted category at the location, The label number indicating the type of sapwood.
[0022] Furthermore, in optimizing the heartwood / sapwood region segmentation model using a teacher-student unsupervised learning framework, the loss function of the student model also includes:
[0023] Supervised segmentation loss is calculated for labeled target wood flooring images. There is supervision to divide the losses. This is the sum of cross-entropy loss and Dice loss;
[0024] Calculate consistency loss for unlabeled target wood species wood flooring images ;
[0025] The overall loss function of the student model , , For weight hyperparameters.
[0026] Furthermore, the method for calculating the edge mask of the wood region is as follows:
[0027] Extract the wood region mask from each target wood species wood flooring image. The edge mask of the wood region is constructed using erosion operation. :
[0028] ;
[0029] in, Indicated by radius right The wood area is etched to generate a shrunken mask.
[0030] The heartwood and sapwood region segmentation system for dissimilar wood flooring images of the present invention includes:
[0031] The source domain dataset and basic model building unit is used to collect images of source wood flooring to construct the source domain dataset and train a heartwood and sapwood region segmentation model based on DeepLabV3+.
[0032] The target domain dataset establishment unit is used to collect images of target wood flooring species to construct an initial target domain dataset, which includes labeled and unlabeled subsets; the pixel distribution of each image in the source domain dataset is calculated, and the target domain dataset is obtained by mapping each image according to the pixel distribution to achieve style alignment;
[0033] An unsupervised learning unit is used to optimize the heartwood and sapwood region segmentation model using the source domain dataset and the target domain dataset, and to obtain the optimized heartwood and sapwood region segmentation model.
[0034] The heartwood and sapwood region segmentation unit is used to segment the heartwood and sapwood regions of wood flooring images using an optimized heartwood and sapwood region segmentation model.
[0035] The electronic device of the present invention includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is loaded onto the processor, it implements the heartwood and sapwood region segmentation method for the image of dissimilar wood flooring.
[0036] The computer-readable storage medium of the present invention stores a computer program, which, when executed by a processor, implements the heartwood and sapwood region segmentation method for images of dissimilar wood flooring.
[0037] Beneficial effects: Compared with the prior art, the advantages of the present invention are as follows:
[0038] 1) This invention alleviates the domain offset problem caused by differences in image acquisition conditions, brightness, and contrast among different wood species by introducing histogram style alignment operation before training the target domain image, thereby improving the model adaptability and generalization performance in cross-wood species segmentation tasks.
[0039] 2) This invention designs a guiding mechanism that combines prior knowledge of sapwood spatial distribution. By extracting the effective area of the wood and applying corrosion operation to generate an edge mask, the sapwood category prediction is strengthened for the edge area, and penalties are imposed on misjudged sapwood in the non-edge area. This guides the model to learn the spatial distribution characteristics of the core and sapwood more accurately, thereby improving the boundary segmentation accuracy and morphological consistency.
[0040] 3) This invention constructs a semi-supervised learning framework based on a teacher-student model, combines a dynamic confidence filtering mechanism to screen highly reliable pseudo-label regions, and introduces a consistency loss function to achieve collaborative optimization using a small amount of labeled data and a large amount of unlabeled data. This further reduces the labeling cost and improves the segmentation performance and stability of the model under label-constrained conditions. It is especially suitable for practical applications with low labeling and high-difference image quality. Attached Figure Description
[0041] Figure 1 This is a flowchart of the heartwood and sapwood region segmentation method according to an embodiment of the present invention.
[0042] Figure 2 This is a schematic diagram of semi-supervised learning according to an embodiment of the present invention.
[0043] Figure 3 This is a comparison chart of the segmentation results of the method of the present invention and under different training strategies. Detailed Implementation
[0044] The technical solution of the present invention will be further described below with reference to the accompanying drawings.
[0045] like Figure 1 The flowchart shown below illustrates the heartwood / sapwood region segmentation method, which includes the following steps.
[0046] S1: Collect source material images and perform full annotation to construct a source domain dataset; train an improved DeepLabV3+ segmentation model based on this dataset as the initial parameters of the student model, and construct a unified template by statistically analyzing the source domain pixel histogram.
[0047] The method for establishing the source domain dataset is as follows: collect source material image datasets. The heartwood and sapwood regions in the image were manually labeled pixel by pixel. This forms a complete semantic segmentation label map.
[0048] The improved DeepLabV3+ segmentation model optimizes the DeepLabV3+ network structure, specifically including:
[0049] a. Replace the backbone network with MobileNetV2;
[0050] b. Set of dilatation rates for parallel convolution branches in ASPP Combining directional attention weights For feature maps Weighted: ,in It is Sigmoid. void ratio of convolution;
[0051] c. Press at the decoding end Defined direction-aware convolution enhances edge material connectivity.
[0052] During the training of the improved DeepLabV3+ segmentation model, pixel value statistics were performed on all source material images, and the pixel intensity distribution of each source domain image was calculated separately. And take the average to form a unified source domain histogram distribution template:
[0053] ;
[0054] in, The total number of source domain images. The number of gray levels is used. After training converges, the parameters of the improved DeepLabV3+ segmentation model are used as the initialization parameters for the student model. The teacher model then uses these parameters as a starting point and dynamically updates them using an exponential moving average method to stabilize the pseudo-label generation process.
[0055] S2: Collect images of the target species, construct labeled and unlabeled subsets; calculate the target domain histogram, and map its distribution to a style close to the source domain through a matching function.
[0056] Before training the target domain images, the target domain dataset is... Perform a normalization operation to distribute the pixel intensity within the range [0, 255], and then calculate its histogram distribution. Call the source domain histogram distribution template from step one. And construct the mapping function By minimizing the distance metric between the two distributions To achieve style alignment, the specific mapping definition is:
[0057] ;
[0058] ;
[0059] in, Source domain histogram distribution template The distribution after transformation by the skimage.exposure.match_histograms operator;
[0060] Target domain image for histogram matching Then, normalization is performed to ensure the consistency of image style before inputting it into the model, thereby alleviating the problem of domain distribution offset between different material species.
[0061] S3: Introduce a pseudo-label confidence filtering mechanism to retain only high-confidence regions for training.
[0062] The teacher model generates pseudo-labels. A pseudo-label confidence filtering mechanism is used to filter pseudo-labels generated by the teacher model for unlabeled target domain images. An instance-level threshold update strategy is introduced, and the probability distribution of pseudo-label categories in each target image is sorted and statistically analyzed. A specific quantile is selected as the local confidence threshold for the current image. This local threshold is weighted and fused with historical thresholds from the training process to form the final category-adaptive pseudo-label confidence filtering threshold. The dynamic confidence filtering formula is:
[0063] ;
[0064] ;
[0065] in, These are filtered pseudo-tags. Indicates position Pseudo-label prediction category Indicates position The logits vector, It is a location Confidence level; For category Based on the confidence threshold dynamically and adaptively determined during the current training phase, The momentum coefficient is updated for the threshold. Let this be the confidence threshold for class c in the previous training round. This means that after sorting the predicted probabilities of the current image category c, the average of the top-k% maximum values is taken and used as the basis for local threshold updates in this round.
[0066] S4: The retained pseudo-labels are used together with the labeled samples in the target domain for training, and the student model is optimized by jointly using supervised loss and consistency loss.
[0067] a. For labeled samples, the supervised segmentation loss is calculated using the composite loss function. Weighted cross-entropy loss and Dice loss:
[0068] ;
[0069] in: The segmentation prediction results output by the student model. For real labels, This represents the cross-entropy loss. Represents the Dice loss function;
[0070] b. For unlabeled samples, use the pseudo-labels generated by the teacher model to calculate the consistency loss. :
[0071] ;
[0072] in: For the student model to predict the target domain samples, For the teacher model to predict pseudo-labels for samples in the target domain;
[0073] c. Calculate the spatial prior guided loss of the sapwood region. Based on each input image Mark the effective area of the timber and extract the timber area mask. ,in These represent the height and width of the image, respectively. In the mask, a value of 1 corresponds to the wood region, and a value of 0 corresponds to the background region. An erosion operation is used to construct the edge mask for the wood region. ;in, Indicated by radius right The wood area is etched to generate a shrunken mask. It precisely locates a ring of areas near the edge inside the wood, effectively excluding the background and the central area of the wood.
[0074] During training, a spatial prior guided loss for the sapwood region is defined to address the pseudo-labels and real labels generated by the teacher model. :
[0075] ;
[0076] in, Indicates the student model at position The predicted category at the location; Label number indicating the type of sapwood; This is an indicator function that takes the value 1 if the condition is true, and 0 otherwise. is the weighted hyperparameter for the prior loss of sapwood.
[0077] d. Final total training loss Defined as:
[0078] ;
[0079] in, , These are the weight hyperparameters for consistency loss and edge guidance loss, respectively.
[0080] During training, the teacher model parameters are updated by applying an exponential moving average to the student model, specifically in the following form:
[0081] ;
[0082] in, As a smoothing factor, it controls the update rate of the teacher model, ensuring its stability and enhancing the reliability of pseudo-labels.
[0083] S5: Iterate through steps two to four until the model converges, and finally obtain a high-precision heartwood and sapwood segmentation model suitable for the target domain wood image. Use this heartwood and sapwood segmentation model to continue segmenting the heartwood and sapwood regions of the target domain wood image.
[0084] The method described in this invention will be verified through specific experiments below.
[0085] I. Source Domain Data Acquisition and Basic Model Training
[0086] In this embodiment, a large amount of white oak flooring image data is first collected as the source domain, and the heartwood and sapwood regions in the images are manually annotated pixel by pixel to construct a source domain dataset with high-quality semantic segmentation labels. This dataset contains rich texture features and structural information, which can support deep models to learn fully in the source domain.
[0087] Specifically, let the source domain dataset be... ,in For image data, and These are the height and width of the image, respectively. The number of channels in an image (for RGB images) Each image After detailed annotation, corresponding ,in The image categories are background, core, and sapwood.
[0088] The image segmentation model employs an improved DeepLabV3+ network structure, with an overall encoder-decoder design framework. The encoder uses a lightweight MobileNetV2 backbone to reduce model complexity and improve inference efficiency. After feature extraction, a dilated spatial pyramid pooling module is used to obtain rich contextual information through multi-scale dilated convolution. The dilated convolution uses a 3×3 kernel with a stride of 1, and dilation rates of 6, 12, 18, and 24, with the padding size dynamically adjusted based on the dilation rate to ensure consistent feature map size. To further enhance feature representation capabilities, this invention introduces a directional attention mechanism into the dilated convolution module. Specifically, this includes:
[0089] Specifically, firstly, global average pooling operations are performed on the input feature map in both horizontal and vertical directions to compress spatial dimensional information, resulting in... and vector, where and Then through Convolution enhances the channels of compressed information in these two directions:
[0090] ;
[0091] Then, the outputs of these two factors are summed element-wise to obtain the directional attention coefficient:
[0092] ;
[0093] This attention weight coefficient The original feature map will be multiplied channel-by-channel to achieve weighting. The final output feature map will enhance the feature representation capability for each direction.
[0094] The decoder section fuses shallow and deep features and introduces direction-aware convolution to enhance its ability to model strip-shaped regions such as edge material. Finally, it restores the image spatial resolution through upsampling and outputs the segmentation result. Directional convolution is specifically defined as:
[0095] ;
[0096] ;
[0097] ;
[0098] in, The length of the convolution kernel is the size of the long side. To capture elongated spatial relationships.
[0099] During the model training process, pixel-level brightness statistics are simultaneously performed on all source domain images to construct a unified source domain pixel histogram distribution template. The specific operations are as follows:
[0100] Let the source domain image set be ,in Let be the total number of source region images. After normalization, the grayscale range of the images is uniformly [0, 255]. For the nth image, calculate its pixel value histogram distribution. , where k is the number of gray levels (usually 256).
[0101] Then, all histograms are averaged to obtain a unified histogram distribution template for the source domain. This histogram template will serve as a reference distribution for subsequent style alignment of the target domain images. After the model is trained to convergence on the source domain dataset, its network weights are saved and used as initialization parameters for the student model in the teacher-student architecture, providing high-quality basic feature representation capabilities for subsequent cross-domain segmentation.
[0102] II. Target Domain Image Preprocessing and Construction of a Teacher-Student Semi-Supervised Framework
[0103] like Figure 2 As shown, in this experiment, to achieve consistent alignment of image styles across different material species and efficient utilization of unlabeled data, a preprocessing workflow and a semi-supervised training framework were constructed for the target domain image data, specifically including:
[0104] Black walnut wood image data was collected as the target domain data. The image dataset is as follows:
[0105] ;
[0106] in This represents the number of images in the target domain. A subset of these images is then constructed as a labeled subset. Its corresponding pixel-level label is The rest are constructed as unlabeled subsets. ,satisfy:
[0107] ;
[0108] For each image Normalize the pixel intensity so that it is distributed in the range [0, 255], calculate its histogram distribution, and construct the optimal matching mapping function. By minimizing the distance metric between the two distributions To achieve style alignment and complete histogram matching of the target domain image. Then, normalization is performed to ensure the consistency of image style before inputting it into the model, thereby alleviating the problem of domain distribution offset between different material species.
[0109] III. Training and Validation of Image Segmentation Models
[0110] To verify the effectiveness of this method, white oak flooring images were used as source domain samples, and black walnut flooring images were used as target domain samples. The segmentation model was trained within the aforementioned source-target domain training framework. The trained model was then applied to the target domain image data, yielding the segmentation results shown in the figure below.
[0111] like Figure 3 As shown, the method of this invention exhibits higher accuracy and continuity in edge regions, the segmented contours are closer to the true labels, and the false detection rate is better than that of the source domain model and the model without domain alignment processing. These experimental results further verify the robustness and effectiveness of the histogram template matching and multiple loss proposed in this invention in cross-domain image segmentation tasks.
[0112] The heartwood and sapwood region segmentation system for dissimilar wood flooring images of the present invention includes:
[0113] The source domain dataset and basic model building unit is used to collect images of source wood flooring to construct the source domain dataset and train a heartwood and sapwood region segmentation model based on DeepLabV3+.
[0114] The target domain dataset establishment unit is used to collect images of target wood flooring species to construct an initial target domain dataset, which includes labeled and unlabeled subsets; the pixel distribution of each image in the source domain dataset is calculated, and the target domain dataset is obtained by mapping each image according to the pixel distribution to achieve style alignment;
[0115] An unsupervised learning unit is used to optimize the heartwood and sapwood region segmentation model using the source domain dataset and the target domain dataset, and to obtain the optimized heartwood and sapwood region segmentation model.
[0116] The heartwood and sapwood region segmentation unit is used to segment the heartwood and sapwood regions of wood flooring images using an optimized heartwood and sapwood region segmentation model.
[0117] The electronic device of the present invention includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is loaded onto the processor, it implements the heartwood and sapwood region segmentation method for the image of dissimilar wood flooring.
[0118] The computer-readable storage medium of the present invention stores a computer program, which, when executed by a processor, implements the heartwood and sapwood region segmentation method for images of dissimilar wood flooring.
[0119] The computer-readable storage medium may include RAM, ROM, EEPROM, CD-ROM or other optical disc storage devices, magnetic disk storage devices or other magnetic storage devices, flash memory or any other medium that can be used to store program code in the form of instructions or data structures and is accessible by a computer.
[0120] The processor is used to execute a computer program stored in memory to implement the various steps in the methods described in the above embodiments.
Claims
1. A method for segmenting the heartwood and sapwood regions of an image of dissimilar wood flooring, characterized in that, Includes the following steps: Images of source wood flooring were collected to construct a source domain dataset, and a heartwood and sapwood region segmentation model based on DeepLabV3+ was trained. Images of target wood flooring species are collected to construct an initial dataset for the target domain, which includes labeled and unlabeled subsets. Pixel distributions are calculated for each image in the source domain dataset, and style alignment is achieved by mapping each image in the target domain dataset according to the pixel distributions to obtain the target domain dataset. Using the source domain dataset and the target domain dataset, the heartwood and sapwood region segmentation model is optimized using a teacher-student unsupervised learning framework to obtain the optimized heartwood and sapwood region segmentation model. An optimized heartwood and sapwood region segmentation model was used to segment the heartwood and sapwood regions of wood flooring images. The parameters of the heartwood and sapwood region segmentation model are used as the initial parameters of the student model and the teacher model. In the process of optimizing the heartwood and sapwood region segmentation model using the teacher-student unsupervised learning framework, the teacher model parameters are updated by performing an exponential moving average on the student model. In optimizing the heartwood / sapwood region segmentation model using a teacher-student unsupervised learning framework, each location in the unlabeled target wood species wood flooring image... The relationship between confidence level and confidence threshold is determined, and pseudo-labels with high confidence levels are retained. The determination process is expressed as follows: ; in, These are filtered pseudo-tags. Indicates position Pseudo-label prediction category Indicates position The logits vector, It is a location confidence level For the first Category in the next training round The confidence threshold , The momentum coefficient is updated for the threshold. For category No. The confidence threshold for each training round. This refers to images of unlabeled target wood flooring species. The pseudo-label is a category. The predicted probabilities of the pixels are sorted and then averaged by the top-k% of the highest values.
2. The method for segmenting the heartwood and sapwood regions of a dissimilar wood flooring image according to claim 1, characterized in that, The process of calculating the pixel distribution for each image in the source domain dataset and mapping each image in the target domain dataset according to the pixel distribution to achieve style alignment results in the target domain dataset, including: Calculate the pixel intensity distribution for each image in the source domain dataset, and calculate the mean of the pixel intensity distribution for all images. ; The pixel intensity of each image in the target domain dataset is normalized, and the pixel intensity distribution is calculated for all images. ; By minimizing and The distance between the images is used to match and map each image in the target domain dataset, and the pixel intensity is normalized again to obtain the target domain dataset.
3. The method for segmenting the heartwood and sapwood regions of a dissimilar wood flooring image according to claim 1, characterized in that, In optimizing the sapwood region segmentation model using a teacher-student unsupervised learning framework, the loss function of the student model includes the sapwood region spatial prior guidance loss. : ; in, The weighted hyperparameter for the prior loss of sapwood. For position Edge masking of timber area This is an indicator function that takes the value 1 if the condition is true and 0 otherwise. Indicates the student model at position The predicted category at the location, The label number indicating the type of sapwood.
4. The method for segmenting the heartwood and sapwood regions of a dissimilar wood flooring image according to claim 3, characterized in that, In optimizing the heartwood / sapwood region segmentation model using a teacher-student unsupervised learning framework, the loss function for the student model also includes: Supervised segmentation loss is calculated for labeled target wood flooring images. There is supervision to divide the losses. This is the sum of cross-entropy loss and Dice loss; Calculate consistency loss for unlabeled target wood species wood flooring images ; The overall loss function of the student model , , For weight hyperparameters.
5. The method for segmenting the heartwood and sapwood regions of a dissimilar wood flooring image according to claim 3, characterized in that, The method for calculating the edge mask of the timber region is as follows: Extract the wood region mask from each target wood species wood flooring image. The edge mask of the wood region is constructed using erosion operation. : ; in, Indicated by radius right The wood area is etched to generate a shrunken mask.
6. A heartwood / sapwood region segmentation system for images of dissimilar wood flooring species, characterized in that, include: The source domain dataset and basic model building unit is used to collect images of source wood flooring to construct the source domain dataset and train a heartwood and sapwood region segmentation model based on DeepLabV3+. The target domain dataset establishment unit is used to collect images of target wood flooring species to construct an initial target domain dataset, which includes labeled and unlabeled subsets; the pixel distribution of each image in the source domain dataset is calculated, and the target domain dataset is obtained by mapping each image according to the pixel distribution to achieve style alignment; An unsupervised learning unit is used to optimize the heartwood and sapwood region segmentation model using the source domain dataset and the target domain dataset, and to obtain the optimized heartwood and sapwood region segmentation model. The heartwood and sapwood region segmentation unit is used to segment the heartwood and sapwood regions of wood flooring images using an optimized heartwood and sapwood region segmentation model. The parameters of the heartwood and sapwood region segmentation model are used as the initial parameters of the student model and the teacher model. In the process of optimizing the heartwood and sapwood region segmentation model using the teacher-student unsupervised learning framework, the teacher model parameters are updated by performing an exponential moving average on the student model. In optimizing the heartwood / sapwood region segmentation model using a teacher-student unsupervised learning framework, each location in the unlabeled target wood species wood flooring image... The relationship between confidence level and confidence threshold is determined, and pseudo-labels with high confidence levels are retained. The determination process is expressed as follows: ; in, These are filtered pseudo-tags. Indicates position Pseudo-label prediction category Indicates position The logits vector, It is a location confidence level For the first Category in the next training round The confidence threshold , The momentum coefficient is updated for the threshold. For category No. The confidence threshold for each training round. This refers to images of unlabeled target wood flooring species. The pseudo-label is a category. The predicted probabilities of the pixels are sorted and then averaged by the top-k% of the highest values.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the computer program is loaded into the processor, it implements the heartwood and sapwood region segmentation method for images of dissimilar wood flooring as described in any one of claims 1-5.
8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the heartwood and sapwood region segmentation method for images of dissimilar wood flooring as described in any one of claims 1-5.
Citation Information
Patent Citations
High-resolution SAR (Synthetic Aperture Radar) image ground feature element extraction method based on depth unsupervised multi-step adversarial domain self-adaption
CN115049841A
Unsupervised domain adaptation method, device, system and storage medium of semantic segmentation based on uniform clustering
US20220383052A1