Intelligent grading judgment method for wooden furniture boards
High-precision grading of wood furniture panels is achieved on edge devices by using lightweight convolutional neural networks and dynamic feature reweighting networks (DFRN). This solves the problems of reduced feature representation ability and real-time bottleneck caused by model compression, and improves the adaptability and accuracy of the grading system.
Patent Information
- Application Number
- CN202511669002.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-14
- Publication Date
- 2026-01-02
AI Technical Summary
Existing intelligent grading systems suffer from reduced key feature channel representation capabilities after model compression, especially in capturing wood texture details and minor defects, resulting in insufficient grading accuracy. Furthermore, real-time performance bottlenecks are evident in environments with limited computing power on edge devices.
A lightweight convolutional neural network is used to extract multi-scale texture feature maps. The student model is trained through a dynamic feature reweighting network (DFRN) and a knowledge distillation strategy to guide it to approximate the output distribution of the teacher model. Dynamic reweighting is performed on edge devices, and combined with weight drift monitoring and local recalibration techniques, the model achieves adaptive and efficient operation.
In the context of model compression and edge computing, it significantly improves the discrimination performance of key features of wood texture recognition, achieves high-precision output, adapts to the texture distribution changes of different materials, improves the real-time performance and maintenance convenience of the production site, and ensures the reliability and accuracy of grading.
Smart Images

Figure CN121258968A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of intelligent grading of plate materials, and particularly relates to a method for intelligent grading and determination of wooden furniture plate materials. BACKGROUND
[0002] The intelligent grading and determination method of wooden furniture plate materials is an important means for improving quality grading automation and production efficiency in the furniture manufacturing and plate processing industries. At present, plate grading methods based on computer vision and deep learning have become common. These methods mainly extract and learn multi-dimensional features such as texture, defects, and color differences of plate surface images through models such as convolutional neural networks (CNN), to realize automatic grade determination of furniture plate materials. With the advancement of industrial intelligent manufacturing, more and more grading systems are gradually deployed on the edge, that is, a reasoning terminal is built locally on the plate production line to realize high-speed and real-time grading determination, reduce data transmission delay, and improve production linkage capability. However, the existing intelligent grading system and the above compression optimization scheme still have significant deficiencies in the actual plate grading pipeline. Although the model compression link reduces the computational burden, it inevitably leads to a decrease in the representation ability of some key feature channels, especially in the capture process of sensitive features such as wooden texture details and minor defects. The feature response that is crucial for grading is discarded or weakened, reducing the accuracy of the final grading determination. Traditional knowledge distillation methods focus on fitting the overall prediction output space, lack targeted compensation for the differences in "key feature channels", and result in insufficient adaptation and generalization in complex material backgrounds. At the same time, existing model fine-tuning or retraining strategies involve local or global updates of a large number of parameters, which can cause real-time bottlenecks in environments with limited edge device computing power or fast production rhythm. SUMMARY
[0003] The present application provides a method for intelligent grading and determination of wooden furniture plate materials to solve the above technical problems.
[0004] The technical solution of the present application is as follows: a method for intelligent grading and determination of wooden furniture plate materials, comprising: S1: collecting wooden furniture plate surface image data and recording plate type, texture direction, and moisture content information as material background labels; S2: performing denoising and normalization preprocessing on the collected image data to eliminate the influence of uneven illumination and background interference on subsequent feature extraction; S3: based on the preprocessed image, extracting a multi-scale texture feature map using a lightweight convolutional neural network to generate a feature channel set; S4: for the feature channel set, calculating the correlation between the gradient amplitude of each channel and the wooden defect grade to identify key feature channels with high discriminative power for grade determination tasks; S5: generating a channel importance prior weight according to a statistical correlation result of the key feature channel, and initializing a dynamic feature reweighting network DFRN; S6: pruning and quantizing the backbone feature extraction network to generate a lightweight student model, and training the student model using a knowledge distillation strategy to guide it to approximate the output distribution of the teacher model; S7: deploying the DFRN between the feature extraction layer and the classification head of the student model, and dynamically reweighting the feature channels using the prior weight to compensate for the decline in discriminative ability caused by model compression; S8: collecting a small amount of samples and updating the channel weight parameters in the DFRN based on the error feedback between the local inference result of the edge device and the manual review label when each batch of new boards enters the detection process; S9: using a lightweight gradient ascent algorithm to optimize the DFRN parameters online, while freezing the backbone network parameters to avoid additional computational overhead caused by retraining; S10: setting a weight drift monitoring module, when detecting that the current channel weight distribution deviates from the initial prior by more than a set threshold, automatically triggering a local recalibration process, recalculating the average importance distribution based on the last N batches of data and updating the DFRN parameters; S11: inputting the dynamically reweighted feature map into the lightweight classification head to complete the grade determination of the wooden furniture board and output the grading result.
[0005] The wood furniture board intelligent grading method provided by the application has the following beneficial effects: (1) In the model compression and edge computing scene, the decline in feature expression ability effectively alleviates the loss of grade determination accuracy, significantly improves the discriminative performance of the model in wood texture key feature recognition, and realizes high-precision output; (2) By introducing a dynamic feature reweighting mechanism, without significantly increasing the computing resources and model parameter quantity, the method can quickly adapt to the changes in texture distribution of different batches and different material furniture boards, greatly expanding the universality and robustness of the grading method in diversified production line environments; (3) The prior initialization and online fine-tuning of the channel weight realize the self-adaptive ability of the model to new environments and data distribution, which can efficiently operate without relying on the cloud and large-scale retraining, significantly improving the real-time performance and maintenance convenience of the production site deployment; (4) The knowledge distillation and channel gradient sensitivity joint optimization strategy effectively preserves the discriminative ability of the model before compression for important defect features, greatly improves the practical performance of the compressed model, and overcomes the deficiency of traditional lightweight models that easily miss fine-grained texture features; (5) Weight drift monitoring and local recalibration technology ensures long-term stability of channel reweighting parameters, prevents model from declining in generalization performance due to long-term operation of production line or change of raw materials, effectively prolongs the online continuous working period of the equipment and ensures the reliability of grading; (6) The final grading determination has the characteristics of low delay and high accuracy, and can be widely used in the grading of wooden furniture boards with high variation in materials on high-speed production lines, improving the efficiency of automatic detection, reducing manual grading errors, and maximizing resource utilization and production quality consistency. BRIEF DESCRIPTION OF DRAWINGS
[0006] Figure 1 A flowchart of a wooden furniture board intelligent grading determination method of the present application; Figure 2 A sub-flowchart of a wooden furniture board intelligent grading determination method of the present application; Figure 3 Another sub-flowchart of a wooden furniture board intelligent grading determination method of the present application. DETAILED DESCRIPTION
[0007] The embodiments of the present application will be described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals represent the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by referring to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be understood as limiting the present application.
[0008] The following disclosure provides many different embodiments or examples for implementing different structures of the present application. In order to simplify the disclosure of the present application, the components and settings of specific examples are described below. Of course, they are only examples and the purpose is not to limit the present application. In addition, the present application can repeatedly refer to numerals and or letters in different examples, and such repetition is for the purpose of simplification and clarity, which itself does not indicate the relationship between the various embodiments and or settings discussed.
[0009] As Figure 1 shown, the present application provides a wooden furniture board intelligent grading determination method, specifically comprising: S1: Collecting wooden furniture board surface image data and recording board type, texture direction and moisture content information as material background label; S2: Denoising and normalizing the collected image data for preprocessing to eliminate the influence of uneven illumination and background interference on subsequent feature extraction; S3: Based on the preprocessed image, a lightweight convolutional neural network is used to extract a multi-scale texture feature map to generate a feature channel set; S4: For the set of feature channels, calculate the correlation between the gradient magnitude of each channel and the wood defect level, and identify the key feature channels with high discriminative power for the level determination task. S5: Based on the statistical correlation results of the key feature channels, generate prior weights for channel importance and initialize the dynamic feature reweighting network DFRN; S6: Prune and quantize the backbone feature extraction network to generate a lightweight student model, and train the student model using a knowledge distillation strategy to guide it to approximate the output distribution of the teacher model. S7: Deploy the DFRN between the feature extraction layer and the classification head in the student model, and use prior weights to dynamically reweight the feature channels to compensate for the decrease in discriminative ability caused by model compression. S8: When each batch of new boards enters the testing process, a small number of samples are collected and the channel weight parameters in DFRN are dynamically updated based on the error feedback between the local inference results of the edge device and the manually verified labels. S9: Lightweight gradient ascent algorithm is used to optimize DFRN parameters online, while freezing backbone network parameters to avoid additional computing power overhead caused by retraining; S10: Set up a weight drift monitoring module. When the deviation between the current channel weight distribution and the initial prior is detected to exceed the set threshold, the local recalibration process is automatically triggered. The average importance distribution is recalculated and the DFRN parameters are updated based on the data from the most recent N batches. S11: Input the dynamically reweighted feature map into the lightweight classification head to complete the grade determination of the wooden furniture board and output the grading result.
[0010] Step S1: Acquire image data of the wooden furniture board surface and record the board type, grain direction, and moisture content information as material background labels. Specifically, this includes: S1.1: Multi-angle image acquisition of the surface of wooden furniture boards based on an industrial camera system to obtain high-resolution image data containing texture details and defect areas; For the sub-step of acquiring images of the surface of wooden furniture boards, the acquisition object is the wooden board at the inspection station of the production line, and the input conditions include the positioning information of the board on the conveyor track and the real-time trigger signal of the industrial camera system. An industrial camera array control method based on the GigE Vision protocol (parameters: resolution 4096×2160 pixels, frame rate 60fps, exposure time 2ms) is adopted to achieve synchronous acquisition of the board surface from multiple spatial orientations, so as to ensure complete recording of texture details and possible defect areas. Furthermore, through a multi-camera geometric calibration algorithm (parameters: Zhang Zhengyou calibration method, calibration board size 20×20mm checkerboard, number of acquired poses ≥25), the extrinsic and intrinsic parameters of each acquired viewpoint are fitted, and the camera pose matrix set is obtained, ensuring that subsequent images from each viewpoint can be accurately aligned in the same world coordinate system. Furthermore, through a three-dimensional attitude planning algorithm (parameter: range of orbital acquisition angles) (60° to +60°, angle step 10°) to achieve sequential control of camera acquisition from different perspectives and generate multi-angle image data sets, covering texture details and defect morphology of all areas on the board surface; Furthermore, by using a high dynamic range (HDR) synthesis algorithm (parameters: exposure gain step size 1.5, and the synthesis weight curve adopts a weighted average model), multi-exposure fusion is performed on single-frame data collected from various viewpoints to generate a high-resolution image set that maintains stable brightness and contrast in texture areas under changing lighting conditions. Through the above image acquisition link, the original images of the board surface from multiple angles and high resolution are transformed into an image dataset with accurate geometric alignment and complete texture fidelity, thus providing a reliable visual foundation for subsequent color correction, image fusion and material feature annotation. For example, three Basler industrial cameras, model acA4096-60um, are configured in an arc array at a workstation on a high-speed production line in a furniture factory, with horizontal angles of [missing information]. At 45°, 0°, and +45°, all cameras are connected to the edge computing gateway via GigE Vision interfaces. Each camera's resolution is set to 4096×2160 pixels, with a frame rate of 60fps and an exposure time of 2ms to accommodate the high-speed transport of the sheet material. Zhang Zhengyou's calibration method is used for array geometric calibration, employing a 20mm×20mm checkerboard calibration board. Thirty different pose samples are collected to fit the camera's intrinsic and extrinsic parameter matrices. A 3D pose planning algorithm controls the acquisition sequence, with an angle step of 15° to ensure complementary coverage of images from each viewpoint. Three frames with different exposures (exposure gain 0dB, 1.5dB, and 3dB) are acquired for each viewpoint. HDR weighted average fusion is used to obtain high-resolution images with stable brightness and contrast; the single-view fusion output image size is approximately 8MB. Finally, the multi-angle combined image set is geometrically aligned to form a panoramic image of the sheet material surface. The image shows complete texture details and easily segmented defect areas, providing stable input for subsequent automatic exposure adjustment and image stitching. S1.2: The acquired raw image is color corrected using an automatic exposure and white balance adjustment algorithm to eliminate the impact of uneven lighting on image quality and obtain standardized RGB image data. S1.3: Align and fuse multi-angle images using an image stitching algorithm to generate a complete surface image of the board material, thereby avoiding texture breakage caused by image segmentation and obtaining continuous texture image data; S1.4: Obtain board type identification information based on barcode recognition and RFID reading technology, and bind and store this information with image data to generate image metadata containing wood species; S1.5: Estimate the texture direction in the image using a rotation detection algorithm, calculate the angle value of the main texture direction, and record this angle information as a texture direction feature parameter; S1.6: Obtain the moisture content measurement value of the board material based on the infrared moisture sensor, and align the measurement value with the corresponding image data with the timestamp to generate an image metadata dataset containing humidity information; S1.7: Combine image data with information on board type, texture direction, and moisture content into structured input samples for subsequent feature extraction and training and inference processes of the dynamically reweighted network.
[0011] Step S2: The acquired image data undergoes denoising and normalization preprocessing to eliminate the influence of uneven illumination and background interference on subsequent feature extraction. Specifically, this includes: S2.1: Perform Gaussian denoising processing based on bilateral filtering on the acquired raw board image to suppress high-frequency interference caused by image sensor noise and surface reflection, and obtain the denoised image matrix; S2.2: Based on the denoised image matrix, an adaptive histogram equalization algorithm is used to locally enhance the gray-level distribution of the image to compensate for the decrease in texture contrast caused by uneven illumination, thereby generating an enhanced image matrix. S2.3: Perform global threshold segmentation based on the Otsu algorithm on the enhanced image matrix to separate the defective and non-defective regions on the board surface and generate a binary mask image. S2.4: Based on the binarized mask image, the original image is cropped to extract the effective detection area image of the board surface and remove background interference information; S2.5: Perform pixel value standardization processing based on the max-min normalization method on the effective detection area image to unify the grayscale dynamic range of different batches of images, and generate normalized board surface image data as input for the subsequent feature extraction module.
[0012] like Figure 2 As shown, step S3 involves extracting multi-scale texture feature maps from the preprocessed image using a lightweight convolutional neural network to generate a feature channel set. Specifically, this includes: S3.1: Perform multi-scale convolution operation on the preprocessed board surface image. Use a lightweight depthwise separable convolution (DSC) module to extract local texture features from the image to generate a multi-scale feature map pyramid. For the S2.5 normalized board surface image data, a lightweight depth separable convolution algorithm (parameters: convolution kernel size {3×3,5×5,7×7}, stride set to 1, padding method set to same) is used to calculate the feature response of local texture information at different spatial scales and obtain the feature map set of the corresponding scale. Furthermore, by deploying multi-scale convolutional kernels in parallel (parameters: the channel separation mode adopts Depthwise convolution, the weights of each channel convolutional kernel are updated independently, and the size of the Pointwise convolutional kernel is set to 1×1), the independent extraction and cross-channel fusion of features at each scale are achieved, and preliminary multi-scale feature map pyramid structure data are obtained, in which the total number of channels in the pyramid structure is 16-128. Furthermore, a cross-scale response value normalization method is adopted (parameters: the normalization coefficients are the local mean and standard deviation of the feature maps at each scale) to achieve unified adjustment of feature amplitudes at different convolution scales and generate a multi-scale feature map combination after amplitude difference suppression. Furthermore, the spatial pyramid pooling method (parameter: pooling window size sequence {1×1, 2×2, 4×4}) is used to encode the spatial distribution pattern of texture features at each scale and generate a spatial-scale joint feature representation with multi-resolution adaptability. By using depthwise separable convolution and multi-scale parallel processing, the normalized image data from the previous step is transformed into a feature map pyramid containing different spatial receptive fields and reflecting multi-level texture details, thus achieving efficient multi-scale local texture feature extraction under lightweight model conditions. For example, in the board grading task of a furniture production line, for a highly normalized 512×512 pixel input image, depthwise convolution is performed using 3×3, 5×5, and 7×7 convolution kernels, respectively. Each convolution kernel has 64 channels, generating low, medium, and high-scale feature maps of sizes 512×512×64, 512×512×64, and 512×512×64, respectively. Subsequently, in the pointwise convolution stage, the features at these three scales are reduced to 32 channels each, and a preliminary 96-channel pyramid structure is formed through channel-level stitching. Mean-standard deviation normalization is performed on the feature maps at each scale, where the mean μ and standard deviation σ are calculated using the following formulas: For pixels at location indices, the overall standard deviation is calculated as follows: in and These are the feature map height and width, respectively. The values are pixel values. After normalization, spatial pyramid pooling is performed with the pooling window set to {1×1, 2×2, 4×4}. The features at each scale are encoded into a spatial-scale joint feature vector with a length of (32×1)+(32×4)+(32×16)=672. It has been verified that the inference time of this processing method on edge devices is kept within 15ms, while the response capability to micro-cracks and color difference areas in wood texture is significantly improved, meeting the judgment accuracy requirements of high-speed production lines. S3.2: Based on the multi-scale feature map pyramid, perform feature map channel splicing and normalization processing to eliminate amplitude differences between features of different scales and generate a feature tensor of uniform scale as the input object for subsequent feature channel analysis. S3.3: Apply the Channel Attention Module (CAM) to the feature tensor of the uniform scale to calculate the response intensity of each channel in the texture recognition task, so as to obtain the channel importance score vector; For the unified-scale feature tensor after multi-scale convolution and channel concatenation normalization, a channel attention module (CAM) (parameters: number of channels C, tensor size H×W×C) is used to quantitatively evaluate the response intensity of each feature channel in the wood texture recognition task. Furthermore, by using the global average pooling method (parameter: the pooling kernel covers the entire feature map size H×W), the response values of all pixels in the spatial dimension of each channel are converted into a single statistical value, resulting in a C-dimensional channel global average vector, which represents the average response intensity of each channel in the overall texture representation. Furthermore, a channel weight generation network (structure: two fully connected layers, the first layer has a parameter dimension of C×(C / r), the second layer has a parameter dimension of (C / r)×C, and r is the compression ratio coefficient) is used to achieve nonlinear mapping of the global average vector and generate a preliminary channel weight coefficient vector to characterize the importance level of each channel in the task objective. Furthermore, the initial channel weight coefficient vector is normalized based on the Sigmoid activation function to compress the weight coefficient range to the [0,1] interval, so as to ensure the numerical stability of subsequent feature channel weighting operations. By performing element-wise multiplication of channels, the uniform-scale feature tensor is multiplied with the normalized channel weight coefficient vector to generate a weighted feature tensor. This weighted feature tensor is then used as the direct mapping result of the channel importance score vector during the feature evaluation stage, thereby realizing the weighted expression of the response intensity of texture feature channels. For example, given a feature tensor with a surface image size of 128×128×64, the global average pooling operation of the channel attention mechanism transforms it into a 64-dimensional vector. The compression coefficient r of the first fully connected layer is set to 4, with a mapping dimension of 64×16. The mapping dimension of the second fully connected layer is 16×64, and ReLU activation is used to enhance the nonlinear representation capability. Sigmoid normalization yields 64-dimensional channel weight coefficients, each ranging from 0 to 1. The pixel values of each channel in the original feature tensor are multiplied by their corresponding coefficients. For example, if the weight of the 10th channel is 0.85, then the intensity value of each pixel in the original channel feature matrix is multiplied by 0.85 to generate a weighted feature matrix, forming a channel importance score vector. The mean of this vector is concentrated above 0.6, indicating that the overall high-response channels are significantly enhanced in this sample. In performance verification, the feature tensor processed by this CAM is fed into the subsequent classification module, achieving significantly improved defect recognition accuracy and stability under the same edge device computing power. S3.4: Based on the channel importance score vector, perform channel sorting and cluster analysis to identify high-response channel groups and low-response channel groups, so as to divide key texture feature channels and redundant feature channels. Based on the channel importance score vector obtained in step S3.3, a descending sorting algorithm (parameter: sorting is based on the numerical value in the score vector) is used to arrange the response intensity of the feature channels from high to low. Furthermore, the K-means clustering algorithm (parameters: number of clusters k=2; initialization method uses the maximum and minimum values of the score vector as the initial centroids) is used to achieve grouping and clustering of feature channels in the two-dimensional distribution space, and obtain the cluster category index to which each channel belongs; Furthermore, by using the intra-cluster mean response calculation method (parameter: arithmetic mean formula), the channel mean intensity of high-response clusters and low-response clusters is compared, and a cluster mean intensity vector is generated as a quantitative indicator for feature channel classification. Furthermore, a threshold-based channel filtering algorithm (parameter: the threshold is set to the global mean of the scoring vector) is adopted to achieve secondary filtering of channels within the cluster, so as to remove abnormally high response channels within low response clusters and ensure the discrimination purity of the grouping results; Furthermore, a feature channel identifier mapping table construction method is adopted to map the channel numbers of high response clusters to a set of key texture feature channels, and the channel numbers of low response clusters to a set of redundant feature channels, and output a group index mapping table; By combining descending sorting and clustering grouping algorithms, the channel importance score vector calculated in the previous step is transformed into a stable set of key texture feature channels and a set of redundant channels, thereby realizing the priority division of feature channels and the feature enhancement goal in the subsequent lightweight model. For example, the feature extraction layer of a lightweight convolutional neural network deployed at the edge outputs 64 channels. An importance score vector is calculated using a channel attention mechanism, with values ranging from 0.15 to 0.93. This score vector is then sorted in descending order to obtain a sorted channel index sequence. A K-means clustering algorithm (cluster number k=2) is used, with the maximum value of the score vector (0.93) and the minimum value (0.15) as the initial centroids. The centroids are iteratively updated until convergence, resulting in a cluster index matrix. The mean response intensity of each cluster is calculated, forming a cluster mean intensity vector. The formula is: in The score value of the i-th channel within the cluster. The number of channels within a cluster is defined. Using the global mean of the score vector (e.g., 0.54) as a threshold, intra-cluster filtering is performed, removing channel numbers above 0.54 from low-response clusters. A final grouping index mapping table is generated, with high-response clusters containing 25 channels and low-response clusters containing 39 channels. This mapping table is output to the initialization module of the Dynamic Feature Reweighting Network (DFRN). Verification shows that in subsequent inference, the response strength of key channels is significantly improved, and the stability of the rating determination is also enhanced. S3.5: Perform feature map weighted fusion processing on the key texture feature channels, and generate enhanced texture feature maps using a weighted average fusion strategy. These enhanced texture feature maps are used as the output of the feature channel set for subsequent use by the dynamic feature reweighting network. For the set of key texture feature channels obtained through step S3.4, a weighted average fusion strategy (with weight parameters based on channel importance scores) is adopted to achieve comprehensive information processing of feature maps from different key channels. Furthermore, by using a weight normalization algorithm (parameter: total weight sum is 1), the proportion of weights in each channel is standardized, and a normalized weight vector is obtained, ensuring the numerical stability of the fusion result; Furthermore, a pixel-wise weighted accumulation method (as shown in the formula below) is used to achieve a linear combination of cross-channel feature responses and generate a fused enhanced texture feature map: in, This represents the total number of critical channels. The normalized weights for the c-th channel are... This is the feature map of channel c. This is the fused enhanced texture feature map; Furthermore, by using a local contrast stretching algorithm (parameter: stretching coefficient is calculated statistically from the histogram of the fusion map), the dynamic range of the enhanced texture feature map is improved, and a high-contrast texture representation is generated; Furthermore, a joint processing strategy of smoothing filtering and edge-preserving filtering is adopted to suppress noise and preserve texture structure in the enhanced texture feature map, and the final feature channel set output result is obtained. By using a weighted fusion strategy and contrast enhancement processing, the key channel features from the previous step are integrated into an enhanced texture feature set that is highly discriminative, has good continuity, and is adaptable to various material backgrounds, thereby optimizing the subsequent DFRN input features. For example, a set of key channels selected in step S3.4, comprising C=8 channels, is obtained from an industrial production line. The channel importance scores {0.25, 0.15, 0.10, 0.12, 0.08, 0.11, 0.09, 0.10} are calculated for each channel, and after normalization, a weight vector {0.23, 0.14, 0.09, 0.11, 0.07, 0.10, 0.08, 0.09} is obtained. A pixel-wise weighted accumulation method is used to calculate the fusion value for each pixel position (p, q). The fused image matrix is obtained. The histogram of the fused image is linearly stretched at the [0.05, 0.95] quantile with a stretching coefficient of 1.2 to enhance high-frequency details. Finally, after processing with smoothing filtering (3×3 mean kernel) and edge-preserving filtering (bilateral filtering, spatial sigma=2.0, intensity sigma=0.1), the output enhanced texture feature set significantly improves the response to fine crack features in subsequent grade determination tests. The model maintains low latency while achieving high-precision determination performance during edge device inference.
[0013] like Figure 3 As shown, step S4 involves calculating the correlation between the gradient magnitude of each channel and the wood defect level for the feature channel set, identifying key feature channels with high discriminative power for the level determination task. Specifically, this includes: S4.1: Perform gradient backpropagation operation on each channel in the feature channel set to obtain the gradient response map of the corresponding channel in the wood defect level determination task; For each channel in the feature channel set, a feature importance analysis method based on gradient backpropagation is used (parameters: loss function type is cross-entropy, target category is wood defect level label, backpropagation depth is feature extraction layer) to realize the function of tracing the gradient signal from the classification head to the key feature channel layer; Furthermore, by using a gradient signal truncation method (parameters: the truncation position is the output layer of the uniform-scale feature tensor, and the channel index corresponds to the current analysis channel), the gradient tensor of the feature map of a single channel is extracted, and the gradient response value matrix of each pixel position under that channel is obtained. Furthermore, by using the gradient zeroing mask method (parameter: all gradient values of channels other than the current analysis channel are set to zero), single-channel isolation control of the gradient backpropagation path is achieved, and a feature map containing only the gradient response of the target channel is generated to avoid interference from multi-channel mixed gradients on importance analysis; Furthermore, by using a gradient response normalization method (parameter: normalization method is standard deviation normalization, calculating the gradient values of all pixels based on the current channel), the numerical range of the gradient response amplitude is standardized, and a gradient response map that can be compared across samples is generated. Through the gradient backpropagation and normalization process described above, the uniform scale feature tensor of the previous step is transformed into a single-channel gradient response map, thereby achieving the expected technical effect of accurately characterizing the response patterns of each feature channel in the level determination task. For example, in the edge computing nodes of an industrial production line, the input is a uniform-scale feature tensor processed by S3, with a size of... Channels, resolution Pixels. Selected channel index is The loss function is cross-entropy, and the target category label is "Level 3" defect category. During gradient backpropagation, the loss gradient is calculated at the classification head. ,in For feature tensors; use the channel mask matrix to transform the inequality from the first to the second. All gradients outside the channel are set to zero, forming an isolated gradient tensor; the first gradient is captured. channel Gradient response matrix, normalized using the standard deviation formula: in, The pixel gradient value. This is the mean of the gradients of all pixels in the current channel. This represents the standard deviation of the gradients of all pixels in the current channel. The normalized gradient values are distributed as follows: Within the specified range, the distribution of high-response areas for "Level 3" defects in this channel is clearly reflected. Verification shows that this method can generate stable single-channel gradient response maps in different batches of boards (such as birch and oak), significantly improving the reliability of subsequent correlation statistics. S4.2: Perform global average pooling on the gradient response map of each channel to obtain the channel-level gradient magnitude vector, which is used to characterize the response intensity of each channel under the current sample. S4.3: Based on the channel-level gradient magnitude vector and the corresponding sample's wood defect level label, the Pearson correlation coefficient is used to calculate the linear correlation between each channel and the defect level, so as to quantify the discriminative contribution of the channel to the level determination. Based on the channel-level gradient magnitude vector and the corresponding sample wood defect level label, the Pearson correlation coefficient is used to calculate the linear correlation between each channel and the defect level, so as to quantify the discriminative contribution of the channel to the level determination. A tag encoding method (parameters: set of grade tags, one-hot encoding mode) is used to convert wood defect grade tags into numerical vectors so that numerical correlation analysis can be performed with channel-level gradient magnitude vectors. Furthermore, the Pearson correlation coefficient calculation method (parameters: channel gradient magnitude vector x, rank label encoding vector y) is used to measure the linear dependence between channel responses and rank labels, and the correlation coefficient data for each channel is obtained. The Pearson correlation coefficient calculation formula is: in, The Pearson correlation coefficient is used. Let be the channel gradient magnitude of the i-th sample. Let be the rank label value of the i-th sample. Let x be the mean. Let y be the mean; Furthermore, by using a standardized processing method (parameters: correlation coefficient set, Z-score normalization mode), the correlation coefficients of different channels are normalized to a unified dimension to eliminate the influence of channel response amplitude differences on correlation comparison and generate a normalized correlation index. Furthermore, by using a threshold filtering algorithm (parameter: correlation threshold τ), the normalized correlation index is filtered for discriminative contribution, and a set of discriminative channels above the threshold is obtained. Through the above correlation calculation and screening methods, the gradient amplitude data from the previous step is transformed into a quantitative indicator of channel discrimination contribution, thereby achieving accurate identification of key feature channels. For example, on a wooden furniture board production line, 100 sample channel-level gradient magnitude vectors are input, each vector being 64 in length, corresponding to 64 feature channels. The grade labels include three categories: A, B, and C. These are converted into numerical vectors of length 3 using one-hot encoding. For each channel, the Pearson correlation coefficient between its gradient magnitude and the encoded label is calculated. For instance, the correlation coefficient for channel 12 in the A-grade samples is 0.82, while in the B-grade and C-grade samples it is... 0.74 and 0.65. Perform Z-score normalization on the correlation coefficient set of all channels; the resulting normalized value is within... The value varied between 1.5 and 1.6. A threshold τ of 0.75 was set, and the normalized values were filtered to obtain a set of high-discrimination channels containing channels 12, 23, 41, and 55. In the subsequent DFRN initialization stage, this set was directly used to generate the initial activated channel set. Verification results showed that the aforementioned high-discrimination channels maintained stable discrimination performance in the grade determination of multiple batches of board materials, the model's response strength in defect identification was significantly improved, and the inference latency did not increase significantly. S4.4: Statistically summarize the channel-rank correlation of all samples to generate a channel importance score matrix, which reflects the stability discrimination ability of each channel under different material backgrounds; For sub-step S4.4, the input object is the set of channel-rank correlation values for each sample calculated by S4.3, which includes the discrimination contribution parameters of different feature channels under different material backgrounds; A sample aggregation statistical method (parameters: channel number, material background label, correlation value set) is used to classify and organize the correlation values of the same channel under different samples according to material background. Furthermore, by using a weighted average calculation method (parameter: weight is determined by the proportion of material background samples), the average correlation strength of each channel under each material background is realized, and a channel-material background correlation statistics table is obtained; Furthermore, by using the variance calculation method (parameter: average correlation strength set), a quantitative assessment of the correlation fluctuation of the same channel under different material backgrounds is achieved, generating a channel stability index vector; Furthermore, by using a normalization algorithm (parameter: the normalization range of the maximum and minimum values is set to 0 to 1), the numerical scale of the stability index vector across channels is unified, and a normalized stability index matrix is generated. Furthermore, matrix merging operations are used to concatenate the normalized stability index matrix and the average correlation statistics table in the column direction according to the channel number to generate a multi-dimensional channel importance score matrix. Each row of this matrix corresponds to a channel, and the columns contain the comprehensive discrimination ability score and stability index of that channel. This statistical merging process transforms the channel correlation results from the previous step into technical indicators that reflect the trade-off between the discriminative power and stability of each channel, thereby enabling the optimal screening of key characteristic channels. For example, in a real furniture board production line scenario, three material backgrounds are selected: pine, oak, and walnut. 200 images of the board surface are collected for each material background as analysis samples. The correlation value set output by S4.3 is grouped by channel number, and the average correlation value of each channel under the three material backgrounds is calculated. For example, the correlation values of channel C12 under pine, oak, and walnut are 0.82, 0.77, and 0.80, respectively. The weighted average calculation formula is as follows: in, The weight of the number of samples with the k-th material background is given. The weighted average correlation value for the C12 channel is calculated to be 0.796, corresponding to the average correlation value. Subsequently, the correlation variance for each channel under the three material backgrounds is calculated; for example, the variance for the C12 channel is: in, The value is the weighted average correlation value, where n is the number of material categories. The variance results are normalized to the range of 0 to 1, resulting in a stability index of 0.94 for the C12 channel. This stability index is then combined with the comprehensive discrimination score to form one row of the channel importance scoring matrix. The final output scoring matrix, after sorting, shows that channels such as C12 possess both high discriminative power and high stability across various material backgrounds. Prioritizing the activation of these channels during subsequent DFRN initialization can significantly improve the robustness and accuracy of grade determination. S4.5: Perform cluster analysis based on the channel importance scoring matrix to identify key feature channel clusters with high discriminative power under various material backgrounds, which serve as the initial activation channel set for the dynamic feature reweighting network.
[0014] Step S5: Based on the statistical correlation results of the key feature channels, generate prior weights for channel importance and initialize the dynamic feature reweighting network. Specifically, this includes: S5.1: Perform channel importance score calculation on the key feature channels identified in S4. Based on the Pearson correlation coefficient between the gradient magnitude of each channel and the wood defect level, generate an initial channel importance score vector to quantify the discriminative contribution of different feature channels to the level determination task. S5.2: Perform Softmax normalization on the channel importance score vector to obtain the normalized importance weight distribution of each feature channel, which serves as the initial channel weighting parameter for the dynamic feature reweighting network, ensuring that high-discriminative features obtain higher response gain in subsequent inference processes; S5.3: Construct the initial parameter matrix of the dynamic feature reweighting network based on the normalized importance weight distribution, where each feature channel corresponds to a learnable scaling factor, and the total number of parameters is controlled within 500 to adapt to the lightweight deployment requirements of edge devices. Based on the normalized importance weight distribution output from step S5.2 as input conditions, a weight mapping assembly algorithm (parameters: total number of channels C, weight precision 32-bit floating point, initial value range of scaling factor 0.1~2.0) is used to convert the normalized weights corresponding to each feature channel into an initial numerical matrix of learnable scaling factors. Furthermore, by using a parameter compression constraint method (parameters: total parameter limit of 500, channel dimension C, precision constraint floating-point number), the size of the initial numerical matrix is adjusted to ensure that the size of the scaling factor matrix matches the storage limit of the edge device, and a parameter matrix version that meets the lightweight requirements is obtained. Furthermore, a matrix quantization merging algorithm (parameters: quantization level 8-32, merging threshold 0.05) is adopted to aggregate and merge scaling factors whose differences between adjacent weight values are less than the merging threshold, so as to reduce the number of redundant parameters and generate an optimized matrix structure. Furthermore, by initializing regularization (parameters: L2 regularization coefficient 0.01, weight mean 0, variance 0.1), the scaling factor matrix is constrained to prevent the initial weight distribution from being too high or too low, and an initial parameter matrix of the dynamically reweighted feature network with numerical balance is generated. By constructing the above parameters, the normalized importance weight distribution is transformed into the initial parameter matrix of the dynamic feature reweighting network, which is lightweight, learnable, and hardware adaptable, enabling rapid deployment without performance bottlenecks in edge devices. For example, in a real-time detection scenario of a wooden furniture production line, the total number of feature channels is set to 60, and the normalized weight distribution ranges from 0.12 to 1.85. A weight mapping assembly algorithm is used to directly assign the normalized weights as the initial values of the scaling factors. The parameter compression constraint method optimizes storage for a 60×1 matrix dimension based on a total parameter limit of 500, requiring only 240 bytes of memory. The matrix quantization merging algorithm sets the quantization level to 8, aggregating scaling factors with weight differences less than 0.05 between adjacent channels into the same quantization value, reducing the total number of parameters to 48 effective weights. Initialization regularization ensures that the weights have a mean of 0 and a variance of 0.1, calculated using a regularization formula. After this processing, the initial parameter matrix of the generated dynamic feature reweighting network loads in less than 3 milliseconds on an edge CPU (1.5GHz clock speed, 512MB memory), and the inference channel weighting latency is less than 0.2 milliseconds, significantly improving the overall response speed of real-time level determination. S5.4: The dynamic feature reweighting network parameter matrix is embedded between the feature extraction layer and the classification head of the student model in a broadcast multiplication manner, so that DFRN can perform dynamic weighting operations on the feature maps of each channel during inference, thereby enhancing the representation strength of key defect features. S5.5: Perform forward propagation tests based on the initial parameters of the dynamic feature reweighting network to verify its response enhancement effect on typical defect samples in the student model, and compare it with the output of the teacher model to ensure that the initialization strategy of the dynamic feature reweighting network can effectively compensate for the decrease in feature representation ability caused by model compression. Based on the initial parameter matrix of the constructed Dynamic Feature Reweighting Network (DFRN), it is embedded between the feature extraction layer and the classification head of the lightweight student model to form a complete inference structure input condition with channel weighting function. The forward propagation calculation method (parameters: batch size of 32, step size of 1) is adopted to perform layer-by-layer weighted processing of the feature channels of the plate sample image set containing typical defect areas, and generate an enhanced feature map set after being scaled by the DFRN factor. Furthermore, by using a feature response measurement algorithm (parameter: the response measurement function uses the absolute value of the channel mean), the response intensity of each channel before and after enhancement is compared, and a feature enhancement ratio vector is obtained to quantify the enhancement effect of DFRN. Furthermore, a feature similarity calculation method aligned with the teacher model output is adopted (parameter: the similarity calculation function is cosine similarity) to evaluate the spatial angular proximity between the feature representation of the student model enhanced by the dynamic feature reweighting network and the corresponding features of the teacher model, and to generate a similarity index matrix; Furthermore, using the KL divergence calculation method for the output probability distribution, the KL divergence between the student model and the teacher model on sample i is calculated using the following formula. : in, Let be the predicted probability of the teacher model on sample i. Let be the predicted probability of the student model on sample i. The total number of samples, The true category label for sample i; By using the KL divergence evaluation method, the feature alignment effect of the previous step is transformed into quantified probability distribution difference data, thereby achieving a comprehensive judgment on the DFRN initialization compensation performance. For example, in a furniture production line environment, 50 samples of each type of board material, including three typical defects: cracks, wormholes, and color differences, are selected. The DFRN samples, initialized in steps S4 and S5.4, are embedded into the pruned and quantized student model. The batch size is set to 32, the convolutional layer stride is 1, and the channel weight initialization range is set to [0.85, 1.15]. During forward propagation, the enhancement ratio of key channels for crack samples is concentrated above 1.20, for wormhole samples above 1.15, and for color difference samples above 1.18. The cosine similarity between the enhanced features and the teacher model features is calculated. The mean similarity is 0.93 for crack samples, 0.91 for wormhole samples, and 0.92 for color difference samples. In the probability distribution comparison, the mean KL divergence of the three types of defect samples is less than 0.05, which shows that the dynamic feature reweighting network initialization strategy can significantly improve the key feature performance of the compressed model under multiple defect categories, and maintain a high degree of similarity to the discrimination performance of the uncompressed teacher model.
[0015] Step S6: Pruning and quantizing the backbone feature extraction network to generate a lightweight student model, and training the student model using a knowledge distillation strategy to guide it to approximate the output distribution of the teacher model. Specifically, this includes: S6.1: Perform structured channel pruning on the convolutional and fully connected layers in the backbone feature extraction network. Based on the L1 norm ranking of each channel, remove low-response channels to reduce the number of model parameters and computational complexity, and obtain a lightweight network structure after pruning. S6.2: Perform 8-bit fixed-point quantization on the pruned network structure, and map floating-point weights and activation values to integer numerical space based on the dynamic range of activation values of each layer according to the training set statistics, so as to further reduce the memory usage and computational overhead during model inference and generate the quantized student model. The pruned lightweight network structure is input into the quantization processing unit, and the dynamic range statistical method of activation value by layer (parameters: training set sample distribution, batch size 32) is used to accurately estimate the numerical range of feature maps of each layer. Furthermore, by using the min-max normalization method (parameters: minimum and maximum activation values of each layer), the range mapping of floating-point activation values is achieved, and the quantization scaling factor is obtained. Furthermore, a symmetric 8-bit fixed-point quantization algorithm (parameters: quantization scale, zero offset) is employed to implement the weight of each floating-point number. Mapping to corresponding integer weights and generating an integer weight matrix; Furthermore, the activation values are quantized using the following mapping formula: in, For the first One activation value, This is the lower limit of the activation interval for this layer. To quantify the proportionality coefficient, These are the quantized fixed-point values; Furthermore, by using the truncation overflow detection and saturation processing method (parameters: upper and lower limits are -128 and 127), the legality constraint of the quantization result is realized, and a weight and activation set adapted to the 8-bit representation range is generated. By using 8-bit fixed-point quantization, the floating-point weights and activation features from the previous step are mapped to a set of integer values, resulting in a significant reduction in memory usage and an improvement in computational efficiency during model inference. For example, in a task to determine the grade of a batch of wooden furniture boards, the total number of parameters in the pruned lightweight network structure is 1.5 million, the number of samples in the input training set is 5000, the batch size is set to 32, and when performing layer-by-layer dynamic range statistics, the maximum value of the activation value of a certain convolutional layer is 2.35, and the minimum value is -2.15. The quantization scaling factor is calculated as follows: The zero-point offset is 128. Using the mapping formula, the activation value 1.20 is mapped to... The weight value -0.85 is mapped to During the truncation overflow detection process, all quantization results were within the range of [-128, 127], requiring no additional saturation correction. The quantized student model reduced its memory usage on edge devices from the original 22MB to approximately 5.8MB, and its inference latency from 84ms to approximately 25ms, while maintaining stable performance and high accuracy in classifying wood texture defects. S6.3: Based on the original uncompressed model as the teacher model, construct a knowledge distillation loss function. This function includes the KL divergence loss term between the output probability distributions of the student model and the teacher model, which is used to guide the student model to approximate the discriminative ability of the teacher model. S6.4: Introduce a feature map distillation mechanism during the training of the student model to calculate the feature map similarity loss between the teacher model and the student model on key feature channels, so as to preserve the discriminative texture representation ability in the compressed model and improve the robustness of the feature representation after model compression. S6.5: A multi-stage training strategy is adopted to fine-tune the quantized pruned student model. In the first stage, the dynamic feature reweighting network parameters are frozen and the backbone network weights are optimized. In the second stage, the DFRN parameters are unfrozen and the channel reweighting factor is jointly optimized to achieve a balance between high accuracy and high efficiency under limited computing power.
[0016] Step S7: Deploy the dynamic feature reweighting network between the feature extraction layer and the classification head in the student model, and dynamically reweight the feature channels using prior weights to compensate for the decrease in discriminative ability caused by model compression. Specifically, this includes: S7.1: The prior weights of channel importance generated in step S5 are used as input conditions and loaded into the lightweight dynamic feature reweighting network. These prior weights are used as the initialization parameters of the scaling factors of each channel in the dynamic feature reweighting network. Based on the channel importance prior weight vector generated in step S5, an input condition dictionary is constructed and mapped to the parameter initialization interface of the dynamic feature reweighting network; A parameter mapping algorithm (parameter source: prior weight normalization distribution) is adopted to achieve a one-to-one correspondence between the internal scaling factor table and the external weight vector of the dynamic feature reweighting network, and to ensure that the parameter index and the feature channel number are completely consistent. Furthermore, by using a batch assignment method (parameter format: matrix form), the initialization of all scaling factors is achieved, generating an initial parameter matrix. ,in As channel importance weight, For feature channel index; Furthermore, through a parameter constraint algorithm (constraint condition: total number of parameters ≤ 500), parameter dimension pruning and data type optimization are achieved within the dynamic feature reweighting network structure to ensure that the model meets the lightweight deployment requirements of edge devices; Furthermore, a parameter consistency verification algorithm (verification method: mean square error matching) is employed to verify the error between the initial scaling factor and the prior weight vector distribution. The calculation formula is as follows: in To initialize the scaling factor, For prior weights, Total number of channels; Through the above initialization and verification processes, the prior weights are accurately loaded into the scaling factors of each feature channel in the dynamic feature reweighting network, achieving the technical effect of optimal matching between the initialization parameters and the task relevance. For example, in the deployment of a wood furniture board grading system, the prior weight distribution vector is set to a length of 128, corresponding to 128 feature channels C. Each weight value originates from the Softmax normalization result in step S5, with a value range of 0.015 to 0.025. This weight vector is directly mapped to the scaling factor table of the dynamic feature reweighting network, generating an initial parameter matrix with a dimension of 1×128 and data type set to float16, resulting in a total of 128 parameters, far below the 500 limit. A mean squared error verification algorithm is used to calculate the error difference between the initial parameters and the prior weight distribution, yielding an initialization error value E = 1.2×10⁻⁶. -6 The system requirement of E < 1 × 10 is met. -5 The accuracy threshold is set. Loading is completed in the ARM Cortex-A53 processor environment of the edge device, and the initialization process takes 46ms. This ensures that the feature channel weight distribution of the lightweight network is fully aligned with the response capability of key defect features, effectively improving the accuracy and stability of the level determination in the subsequent inference stage. S7.2: Based on the feature channel set output by the pruned and quantized student model of the backbone feature extraction network, perform feature channel reweighting operation, that is, multiply each channel feature map by its corresponding scaling factor to enhance the response intensity of key channels. S7.3: Perform normalization on the reweighted feature channel set to eliminate the numerical distribution offset introduced by the channel scaling factor and obtain the normalized enhanced feature map as the input data for the classification head in the next stage. S7.4: Based on the normalized enhanced feature map, a lightweight fully connected classification head is used to perform level determination inference and generate a preliminary level prediction probability distribution, which serves as the feedback output of the reweighting effect of the dynamic feature reweighting network. Based on the normalized enhanced feature map, a lightweight fully connected classification head is used to perform matrix-vector multiplication on the input vector (the parameter matrix is processed by 8-bit fixed-point quantization) to achieve linear combination mapping of different level categories; Furthermore, by introducing the nonlinear activation function ReLU, element-level thresholding is performed on the above linear mapping results to enhance the nonlinear discrimination ability of the classification head and obtain the class score vector before normalization. Furthermore, the batch normalization algorithm (parameters: dynamic mean, variance statistic) is used to center and scale the distribution of the class score vector, eliminate the distribution differences between sample batches, and generate a numerically stable normalized class score vector. Furthermore, based on the Softmax function, an exponential normalization transformation is performed to convert the normalized category score vector into a preliminary grade prediction probability distribution; Furthermore, by using probability value sorting and maximum probability selection strategies, the most likely level category is extracted from the predicted probability distribution and used as the feedback output of the DFRN reweighting effect; By combining matrix operations, nonlinear activation, batch normalization and Softmax normalization, the normalized enhancement features from the previous step are converted into a probability distribution that can be directly used for grade determination, thereby enabling real-time grade prediction of the compressed model on edge devices. For example, on a furniture production line, the edge detection device receives a normalized enhanced feature map with a dimension of 128×1. The lightweight fully connected classification head parameter matrix is 4×128 in size, and after 8-bit fixed-point quantization, the weight range is mapped to the integer interval [-127, 127]. After performing matrix multiplication, a 4-dimensional original score vector is obtained, which is processed by ReLU to [0, 15, 0, 7]. The batch normalization parameters are set to a mean of 5.5 and a variance of 20.25, resulting in approximately [-0.275, 0.675, -0.275, 0.225] after normalization. In the Softmax normalization calculation, an exponential operation is performed on each dimension and the result is divided by the sum of the exponents of each dimension, resulting in a predicted probability distribution of approximately [0.196, 0.354, 0.196, 0.254]. The second category corresponding to the highest probability is the preliminary grade judgment output. The process takes about 12ms for a single batch inference at the edge. The verification results show that the predicted probability distribution remains stable under material changes, which greatly improves the accuracy and real-time performance of the grade determination. S7.5: By calculating the KL divergence between the predicted probability distribution of the student model output and the teacher model output, the feature enhancement effect of the dynamic feature reweighting network under the current batch of data is evaluated, and the evaluation result is used as the input basis for the subsequent online fine-tuning module.
[0017] Step S8: When each batch of new boards enters the testing process, a small number of samples are collected, and the channel weight parameters in the dynamic feature reweighting network are dynamically updated based on the error feedback between the local inference results of the edge device and the manually verified labels. Specifically, this includes: S8.1: When a new batch of wooden furniture boards enters the testing process, a small number of representative sample image data are collected based on the image acquisition module, and the corresponding board type, texture direction and moisture content information are recorded as material background feature input. S8.2: Input the sample image data into the lightweight student model deployed on the edge device, perform forward inference to obtain the level judgment result output by the model, and use it as the prediction output of local edge inference; S8.3: Compare the level determination results output by the edge device with the manually reviewed labels sample by sample, calculate the model prediction error, and generate an error feedback signal as the optimization basis for updating the channel weights of the dynamic feature reweighting network. S8.4: Based on the error feedback signal, a lightweight gradient ascent algorithm is used to locally optimize the scaling factor parameters of each feature channel in the dynamic feature reweighting network, so as to improve the discrimination contribution of key feature channels to the current batch of board material grade determination. S8.5: After updating the channel weight parameters, the updated dynamic feature reweighting network parameters are synchronously fused with the backbone network parameters to generate a dynamic reweighting feature representation suitable for the current batch of board material feature distribution, which is used for subsequent board material grade determination tasks.
[0018] Step S9: A lightweight gradient ascent algorithm is used to optimize the parameters of the dynamically reweighted network online, while simultaneously freezing the backbone network parameters to avoid the additional computational overhead of retraining. Specifically, this includes: S9.1: Based on the error feedback between the edge device local inference results and the manual verification labels of the current batch of board samples, calculate the gradient direction corresponding to the channel weights in the dynamic feature reweighting network to obtain the channel weight update gradient vector; S9.2: The channel weight update gradient vector is normalized using a lightweight gradient ascent algorithm to generate a channel weight update factor, which serves as the input for subsequent channel weight parameter adjustments. S9.3: Adaptively adjust the learning rate of the channel weight update factor, calculate the dynamic learning rate factor based on historical weight update records, and generate adaptive channel weight update amount to avoid weight oscillation and improve convergence stability. S9.4: The adaptive channel weight update amount is superimposed on the channel weight parameters in the current dynamic feature reweighting network, and the online channel weight update operation is performed to generate the updated dynamic feature channel reweighting parameter set; S9.5: After the channel weights are updated online, freeze the backbone network parameters and only retain the update status of the dynamic feature reweighting network and the classification head to ensure that the model inference efficiency is not affected. At the same time, output the updated feature reweighting results for subsequent level determination.
[0019] Step S10: Set up a weight drift monitoring module. When the deviation between the current channel weight distribution and the initial prior is detected to exceed a set threshold, automatically trigger a local recalibration process, recalculate the average importance distribution based on the most recent N batches of data, and update the DFRN parameters. Specifically, this includes: S10.1: Periodically sample the scaling factors of each channel in the dynamic feature reweighting network to obtain the current weight distribution sequence; S10.2: Calculate the channel weight drift based on the KL divergence between the current weight distribution sequence and the initial prior weight distribution to quantify the degree to which the weight changes deviate from the original prior. S10.3: Compare the calculated weight drift with the preset drift threshold. If the drift exceeds the threshold, it is determined that the weight drift exceeds the acceptable range, triggering the local recalibration process. Based on the channel weight drift value output in step S10.2, a threshold comparison method is used (parameter: drift degree). Drift threshold This enables the determination of whether changes in channel weights exceed an acceptable range. Furthermore, through the absolute difference calculation method (parameter: and This enables Boolean determination of drift degree exceeding the limit and obtains a drift state indication signal; Furthermore, a logical threshold discrimination algorithm (parameter: drift degree) is used. threshold (The value is dimensionless) to realize the quantitative expression of the drift determination condition and generate the control signal that triggers the local recalibration process; Furthermore, the drift determination condition is calculated by comparing the calculation formulas, as follows: in, Channel weight drift, To preset the drift threshold, This refers to the deviation exceeding the limit. Furthermore, the drift triggering logic is implemented through a conditional discrimination function, as shown in the following formula: Where f(δ) is the drift trigger signal, a value of 1 indicates that the local recalibration process is triggered, and a value of 0 indicates that the current weight parameters remain unchanged; Through the above logical discrimination algorithm, the drift index calculated in the previous step is converted into a trigger signal that can directly drive the recalibration module, so as to achieve the expected technical effect of online monitoring and automatic adjustment of channel weight stability. For example, in a batch of wood furniture board grading task, the DFRN channel scaling factor distribution is obtained through periodic sampling, and the KL divergence calculation result between it and the initial prior weight distribution is as follows: Set drift threshold for The excess deviation is calculated using the above formula: δ is obtained If the condition δ>0 is met, the corresponding drift trigger signal f(δ) output value is... At this point, the system automatically sends a recalibration control signal, entering the statistical and weighted average processing flow of the most recent N batches of data described in S10.4. In another scenario, drift... for The deviation exceeding the limit is calculated as follows: If δ is negative, the condition δ>0 is not met, and the output value of the drift trigger signal f(δ) is... If the current weight parameters remain unchanged, the system determines that the DFRN maintains an effective channel weight distribution and continues to be used for the grade determination task. In both cases, the weight drift monitoring results are ensured to be consistent with the process requirements. S10.4: In the local recalibration process, the images of the most recent N batches of board material and their corresponding DFRN feature outputs are collected to construct a feature channel response statistical matrix to reflect the importance distribution of each channel under different batches; S10.5: Perform weighted averaging on the characteristic channel response statistics matrix to generate an updated channel importance distribution, and load this distribution as a new prior weight into the DFRN module to complete the reinitialization of channel weights.
[0020] Step S11: Input the dynamically reweighted feature map into the lightweight classification head to complete the grade determination of the wood furniture board and output the grading result. Specifically, this includes: S11.1: Channel-weighted fusion is performed on the feature map after processing by the Dynamic Feature Reweighting Network (DFRN) to generate an enhanced texture feature representation, which serves as the input feature vector for the grade determination module. S11.2: Based on the input feature vector, a lightweight fully connected classification head is used to perform multi-class probability distribution calculation to obtain the confidence output of each level of class; S11.3: Apply the Softmax normalization function to the multi-category confidence output to generate a standardized level probability distribution vector, which serves as the preliminary decision basis for level determination; S11.4: Execute the maximum probability discrimination strategy based on the grade probability distribution vector to determine the final grade classification result of the current wooden furniture board; Based on the rank probability distribution vector after Softmax normalization, the maximum probability discrimination method (parameter: probability distribution vector length = number of rank categories) is used to select the optimal rank label; Furthermore, by using an index search algorithm (parameter: sorted in descending order of probability values), the maximum element in the probability distribution vector and its corresponding category index are accurately located, and the maximum probability value and the corresponding category code are obtained. Furthermore, a threshold filtering mechanism (parameter: level confidence threshold = 0.65) is used to determine whether the maximum probability value meets the minimum confidence condition and generate candidate level labels that meet the conditions. Furthermore, by using a category mapping table lookup method (parameter: category code and grade label mapping dictionary), the category codes of candidate grades are converted into readable grade label text, and the final grade determination label of the current board material is obtained. The probability vector results from the previous step are transformed into final grade classification data through the maximum probability discrimination algorithm, thereby enabling a deterministic decision output on the grade of wood furniture boards. For example, during a production line inspection process, the probability distribution vector output by the Dynamic Feature Reweighting Network (DFRN) after Softmax normalization is: The vector has a length of 4 and corresponds to the level category code {0, 1, 2, 3}. The maximum probability value is... The corresponding category code is located by index search. When implementing the threshold filtering mechanism, the minimum confidence level is set to... Since the current maximum probability value is lower than the threshold, the system implements a compensation strategy, which involves simultaneously introducing a second high-probability code into the candidate level set. The corresponding labels ensure multiple candidate outputs even with low confidence. The encoding in the category mapping table... Mapped to level "B", encoded The mapping is assigned to level "C", and the final output is a set of candidate level labels {B,C}. After manual review, level "B" is selected as the final judgment result, which significantly improves the reliability of the judgment under complex texture conditions. S11.5: The final classification result is output to the production line control system through the industrial communication interface to achieve real-time linkage with the production process and closed-loop quality feedback.
[0021] The technical solution of the present invention has been described above with reference to the preferred embodiments shown in the accompanying drawings. However, it will be readily understood by those skilled in the art that the scope of protection of the present invention is obviously not limited to these specific embodiments. Without departing from the principles of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will all fall within the scope of protection of the present invention.
[0022] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and rules of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for intelligent grading and determining the grade of wood-based furniture boards, characterized in that, Includes the following steps: S1: Collect image data of the surface of wooden furniture boards and record the board type, texture direction and moisture content information as material background labels; S2: Perform noise reduction and normalization preprocessing on the image data of the wooden furniture board surface to generate a preprocessed image; S3: Based on the preprocessed image, a lightweight convolutional neural network is used to extract multi-scale texture feature maps and generate a feature channel set; S4: For the set of feature channels, calculate the correlation between the gradient magnitude of each channel and the wood defect level, and identify the key feature channels with high discriminative power for the level determination task. S5: Based on the statistical correlation results of the key feature channels, generate prior weights for channel importance and initialize the dynamic feature reweighting network; S6: Prune and quantize the backbone feature extraction network to generate a student model, and train the student model using a knowledge distillation strategy; S7: Deploy the dynamic feature reweighting network between the feature extraction layer and the classification head in the student model, and use prior weights to dynamically reweight the feature channels; S8: When each batch of new boards enters the testing process, a small number of samples are collected and the channel weight parameters in the dynamic feature reweighting network are dynamically updated based on the error feedback between the local inference results of the edge device and the manually verified labels. S9: The parameters of the dynamically reweighted feature network are optimized online using a lightweight gradient ascent algorithm, while the parameters of the backbone network are frozen.
2. The intelligent grading and determination method for wooden furniture boards according to claim 1, characterized in that, Following step S9, the following is also included: S10: Set up a weight drift monitoring module. When the deviation between the current channel weight distribution and the initial prior exceeds the set threshold, the local recalibration process is automatically triggered. The average importance distribution is recalculated in combination with the most recent batch data, and the dynamic feature reweighting network parameters are updated. S11: Input the dynamically reweighted feature map into the fully connected classification head to complete the grade determination of the wood furniture board and output the grading result.
3. The intelligent grading and determination method for wooden furniture boards according to claim 1, characterized in that, Step S1 specifically includes: The industrial camera system is used to acquire multi-angle images of the surface of wooden furniture boards, and high-resolution raw image data containing texture details and defect areas are obtained. The original image data is color-corrected using an automatic exposure and white balance adjustment algorithm to obtain standardized RGB image data. The multi-angle images are aligned and fused using an image stitching algorithm to generate a complete surface image of the board material, thereby obtaining continuous texture image data. Based on barcode recognition and RFID reading technology, the board type identification information is obtained, and the board type identification information is bound and stored with the continuous texture image data to generate image metadata containing wood species; The texture direction in the image is estimated by a rotation detection algorithm, and the angle value of the main texture direction is calculated. The moisture content of the board material is obtained by using an infrared moisture sensor, and the moisture content of the board material is time-stamped and aligned with the corresponding image data to generate an image metadata dataset containing humidity information. The continuous texture image data, along with the board type identification information, the texture direction, and the measured moisture content of the board, are combined to form a structured input sample.
4. The intelligent grading and determination method for wooden furniture boards according to claim 3, characterized in that, The industrial camera system adopts the GigE Vision protocol, and multiple array-type industrial cameras are configured as follows: Simultaneous acquisition from multiple angles within a range of 60° to +60°, with a frame rate of 60fps and a resolution of 4096×2160 pixels. Geometric alignment is performed using the Zhang Zhengyou calibration method, and the HDR exposure gain step size is 1.
5.
5. The intelligent grading and determination method for wooden furniture boards according to claim 1, characterized in that, Step S2 specifically includes: The original board image was subjected to Gaussian denoising based on bilateral filtering to obtain the denoised image matrix; Based on the denoised image matrix, an adaptive histogram equalization algorithm is used to locally enhance the grayscale distribution of the image, generating an enhanced image matrix. The enhanced image matrix is subjected to global threshold segmentation based on the Otsu algorithm to separate the defective and non-defective regions on the board surface and generate a binary mask image. Based on the binarized mask image, the original image is cropped to extract the effective detection area image on the surface of the board. The effective detection area image is subjected to pixel value standardization processing based on the maximum-minimum normalization method to unify the grayscale dynamic range of different batches of images and generate normalized plate surface image data.
6. The intelligent grading and determination method for wooden furniture boards according to claim 1, characterized in that, Step S3 specifically includes: Multi-scale convolution operations are performed on the preprocessed board surface image. A lightweight depthwise separable convolution module is used to extract local texture features from the image and generate a multi-scale feature map pyramid. Based on the multi-scale feature map pyramid, feature map channel splicing and normalization are performed to generate a feature tensor of uniform scale. The channel attention mechanism is applied to the feature tensor of the uniform scale to calculate the response intensity of each channel in the texture recognition task and obtain the channel importance score vector. Based on the channel importance score vector, channel sorting and clustering analysis are performed to identify high-response channel groups and low-response channel groups, and to divide key texture feature channels and redundant feature channels. The key texture feature channels are subjected to feature map weighted fusion processing, and an enhanced texture feature map is generated using a weighted average fusion strategy, which serves as the output result of the feature channel set.
7. The intelligent grading and determination method for wooden furniture boards according to claim 6, characterized in that, Step S3 further includes deploying depthwise separable convolutions in parallel using 3×3, 5×5, and 7×7 convolution kernels, stitching together after dimensionality reduction in the Pointwise convolution stage, having a total of 16-128 channels in the pyramid structure, dynamically calculating the normalization coefficients from the local mean and standard deviation, and then encoding them using spatial pyramid pooling to ensure the effective fusion of multi-layer texture information.
8. The intelligent grading and determination method for wooden furniture boards according to claim 1, characterized in that, Step S4 specifically includes: Perform gradient backpropagation on each channel in the feature channel set to obtain the gradient response map of the corresponding channel in the wood defect level determination task; Global average pooling is performed on the gradient response map of each channel to obtain the channel-level gradient magnitude vector; Based on the channel-level gradient magnitude vector and the corresponding sample wood defect level label, the Pearson correlation coefficient is used to calculate the linear correlation between each channel and the defect level. The channel-rank correlation of all samples is statistically summarized to generate a channel importance score matrix; Cluster analysis was performed based on the channel importance scoring matrix to identify key feature channel clusters that have high discriminative power in various material backgrounds.
9. The intelligent grading and determination method for wooden furniture boards according to claim 1, characterized in that, Step S5 specifically includes: Channel importance scores are calculated for the identified key feature channels. Based on the Pearson correlation coefficient between the gradient magnitude of each channel and the wood defect level, an initial channel importance score vector is generated. The initial channel importance score vector is subjected to Softmax normalization to obtain the normalized importance weight distribution of each feature channel; Based on the normalized importance weight distribution, the initial parameter matrix of the dynamic feature reweighting network is constructed. The dynamic feature reweighting network parameter matrix is embedded between the feature extraction layer and the classification head of the student model in a broadcast multiplication manner. The forward propagation test was performed based on the initial parameters of the dynamic feature reweighting network to verify its response enhancement effect on typical defect samples in the student model, and the result was compared with the output of the teacher model.
10. The intelligent grading and determination method for wooden furniture boards according to claim 9, characterized in that, The dynamic feature reweighting network has no more than 500 initial parameters, and the initial value of the single-channel scaling factor ranges from 0.1 to 2.
0. It supports 8-32 levels of quantization grouping, and the parameter matrix is balanced by L2 regularization.
