Method and device for identifying defects of single board and computer readable storage medium
By combining multispectral imaging with a lightweight Dual-Transformer network, the problems of insufficient utilization of multispectral information and real-time performance in wood defect detection are solved, achieving efficient and accurate defect identification.
Patent Information
- Application Number
- CN202511016278.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-23
- Publication Date
- 2025-12-12
AI Technical Summary
Existing technologies for defect detection in wood processing suffer from several drawbacks: insufficient utilization of multispectral information, difficulty in balancing accuracy and speed in detecting small targets against complex texture backgrounds, inability of traditional network architectures to simultaneously capture local details and global contextual relationships, and contradictions between real-time processing requirements and computational resource limitations in production line environments.
A multispectral imaging system was used to simultaneously acquire RGB, NIR, and UV images. Subpixel alignment was performed using the affine transformation-optical flow method. An enhanced image was generated by adaptive weighted fusion based on improved Retinex theory and then input into a lightweight Dual-Transformer network for processing. Feature fusion was performed by combining CNN and Transformer branches to output defect type and location information.
It improves the detection rate of minor defects in plywood veneers, reduces misjudgments against complex wood grain backgrounds, and achieves high-precision, low-computational-complexity real-time defect detection, meeting the needs of industrial scenarios.
Smart Images

Figure CN121120482A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of wood processing, and in particular to a method and device for identifying defects of veneer and a computer readable storage medium. BACKGROUND
[0002] In the production process of blockboard, the accurate identification of veneer surface defects directly affects the quality grade of the final product. The current mainstream defect detection techniques mainly fall into three categories: traditional image processing methods, deep learning methods and hybrid methods. Although traditional methods such as adaptive gamma correction and artificial multiple exposure fusion algorithm have a small amount of calculation, they are sensitive to lighting conditions and difficult to distinguish defects with similar colors. The scheme based on HOG and LBP feature extraction combined with SVM classifier is prone to false detection in complex texture background. Mathematical morphology and improved Otsu algorithm often lead to missed detection due to insufficient feature information when dealing with small-scale defects.
[0003] In deep learning methods, although the improved ResNet network realizes a high accuracy by increasing the spatial attention mechanism, its computational complexity limits the real-time application in industrial scenarios. The existing YOLO series network still has the problem of insufficient feature extraction in small defect detection, especially when multiple defect regions overlap, the detection performance decreases significantly. The hybrid method such as the scheme of KPCA combined with GSA-SVM improves the operation efficiency by feature dimension reduction, but it is difficult to adapt to the natural variation of wood texture.
[0004] The core challenges of current technology include: insufficient utilization of multispectral information leads to insufficient defect feature representation; the precision and speed of small target detection in complex texture background are difficult to balance; the traditional network architecture cannot capture both local details and global context relationships; and the contradiction between real-time processing demand and computational resource limitation in production line environment. The existence of these problems seriously restricts the popularization and application of blockboard automatic sorting. SUMMARY
[0005] The purpose of this section is to summarize some aspects of the embodiments of the present application and briefly introduce some preferred embodiments. Some simplifications or omissions may be made in this section and the abstract of the specification and the title of the invention to avoid obscuring the purpose of this section, the abstract of the specification and the title of the invention, and such simplifications or omissions cannot be used to limit the scope of the present application.
[0006] The purpose of the present application is to provide a method for identifying defects of veneer, thereby overcoming the problems in the background art.
[0007] To solve the above technical problems, the present application provides a method for identifying defects of veneer, comprising the following steps: The RGB, NIR, and UV band images of the single board are acquired simultaneously through a pre-set multispectral imaging system. The three-band images are aligned at the subpixel level using an affine transformation-optical flow joint registration algorithm. An enhanced image is generated based on adaptive weighted fusion using improved Retinex theory. The enhanced image is input into a preset lightweight Dual-Transformer network for processing. The lightweight Dual-Transformer network includes a CNN branch and a Transformer branch. The CNN branch uses the Ghost-CSP module to extract local features and embeds a coordinate attention mechanism. The Transformer branch uses an axial shift window mechanism for global modeling, decomposes 2D self-attention into row and column dual 1D operations, and dynamically fuses dual-path features through a gated feature exchange unit. Output defect type and location information, whereby the defect types include live joints, dead joints, cracks, and resin pockets.
[0008] Preferably, the step of generating the enhanced image based on the adaptive weighted fusion of improved Retinex theory includes: The V channel of each band of HSV space is decomposed into illumination component L and reflection component R; Calculate the significance weight of each band; The three-band reflection components are fused according to weights to generate an enhanced image.
[0009] Preferably, the step of using the axial shift window mechanism for global modeling includes: The input feature map is divided into an M×M window; Shift the window horizontally by M / 2 pixels in the i-th layer; Shift the window vertically by M / 2 pixels at the (i+1)th layer; Execute alternately until the end of the network.
[0010] Preferably, the process further includes the following steps before inputting the enhanced image into the CNN branch processing and the Transformer branch processing: Perform 1 / 8 downsampling preprocessing on the enhanced image; If the defective area accounts for less than 5%, then only the CNN branch is used for processing; If the defective area accounts for ≥5%, then both the CNN branch and the Transformer branch will be used for processing.
[0011] Preferably, the method further includes the process of initial training and periodic training of the Dual-Transformer network, wherein the training samples are obtained in the following manner: Acquire small samples during the training period; Wood substrate texture was synthesized using a small sample size based on the Perlin noise-orientation field coupling algorithm; Defects are embedded through a Physics-GAN generator, which contains a physical constraint layer.
[0012] Preferably, the step of outputting the location information includes: The defect category and rectangle coordinates (x, y, w, h) are output through the bounding box regression branch, and the CIoU loss function is used for optimization. Pixel-level defect contours are output by segmenting branches using a mask, and optimized using the Dice loss function. Add a location-type consistency constraint.
[0013] The present invention also provides an apparatus based on any of the methods described above, comprising: A sealed imaging chamber with a built-in multispectral imaging unit and an anti-interference light shield; The edge computing module, equipped with a data processor, can run the Dual-Transformer network; The robotic arm sorting module performs graded sorting based on the output location information and defect type.
[0014] Preferably, the multispectral imaging unit includes: Adjustable filter wheel industrial camera with a resolution of ≥20 million pixels; A separately controlled ring light source is used to provide visible light, point light source and ultraviolet light; An FPGA trigger controller is used to ensure that the acquisition time difference of the three bands is less than 100ms.
[0015] Preferably, it also includes: a cloud-based model optimization platform (103) for periodically receiving production line data and retraining the Dual-Transformer network.
[0016] The present invention also provides a computer-readable storage medium storing a computer program that can implement the steps of any of the methods described above.
[0017] In summary, the present invention has at least the following beneficial effects: This application provides a method and system for identifying defects in plywood veneers based on multispectral fusion and a lightweight dual-path network. By enhancing the defect feature representation capability through multispectral fusion and combining it with a lightweight dual-path network to achieve dynamic fusion of local details and global features, this method effectively solves the technical problems of low detection accuracy and poor real-time performance of traditional methods in complex texture backgrounds. It has the advantages of high detection accuracy, excellent computational efficiency, and adaptability to industrial scenarios. Attached Figure Description
[0018] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is a schematic diagram of a method for identifying single-board defects according to the present invention; Figure 2 This is a schematic diagram of the device for identifying single-board defects according to the present invention. Detailed Implementation
[0020] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0021] In current technologies, the wood processing industry has long relied on manual visual inspection for veneer defect identification, resulting in low efficiency and high false negative rates. Traditional image processing methods enhance images through gamma correction and morphological operations, but struggle to distinguish defect features against complex texture backgrounds. While deep learning-based detection models have improved accuracy, small-scale defects are easily affected by background interference, and insufficient multispectral information fusion limits feature representation capabilities. The stringent real-time requirements of industrial production lines further restrict the deployment and application of complex models. A wood processing plant uses conventional industrial cameras to acquire visible light images and combines them with a YOLOv3 network for defect detection, but the detection accuracy drops significantly when faced with problems such as confusion between live knots and wood grain, and missed detection of microcracks.
[0022] To address the aforementioned issues, this application first considers the complementary nature of multispectral information and the varying sensitivity of different spectral bands to wood defects. It proposes simultaneous acquisition of RGB, near-infrared, and ultraviolet images. To resolve fusion distortion caused by insufficient registration accuracy, a sub-pixel alignment method combining affine transformation and optical flow is developed. During the feature fusion stage, it is found that the traditional weighted averaging method fails to highlight defect areas; therefore, an adaptive fusion strategy based on the saliency of reflection components is adopted. To achieve a balance between real-time detection and feature extraction capabilities, a dual-path network architecture is designed, using a dynamic gating mechanism to coordinate the complementary relationship between local details and global features.
[0023] Therefore, as Figure 1As shown in the embodiments of this application, the technical solution includes the following steps: S1, through a multispectral imaging system, simultaneously acquires RGB, near-infrared NIR, and ultraviolet UV images of the single board; S2, uses an affine transformation-optical flow joint registration algorithm to perform sub-pixel level alignment of the three-band images; S3 generates enhanced images based on adaptive weighted fusion using improved Retinex theory; S4 enhances the image input with a lightweight Dual-Transformer network (dual-path network), extracts local features through the CNN branch, performs global modeling through the Transformer branch, and dynamically fuses the dual-path features; S5, finally output the defect type and location information, the defect types include live joints, dead joints, cracks and resin pockets.
[0024] In step S2, the affine transformation-optical flow joint registration algorithm refers to a registration method that first achieves rigid alignment between images through affine transformation, and then uses optical flow to compensate for non-rigid deformation, which can eliminate pixel offset caused by differences in shooting angle in multispectral imaging.
[0025] In step S3, the adaptive weighted fusion of the improved Retinex theory refers to decomposing the image into illumination and reflection components, and then calculating the weight of each band based on the standard deviation of the reflection component, thereby enhancing the contrast of the defect area.
[0026] In step S4, the Ghost-CSP module refers to introducing Ghost convolutions into the convolutional neural network to replace traditional convolutional layers, generating redundant feature maps through linear transformation to reduce computational cost. The axial shift window mechanism involves dividing the feature map into regular windows and then alternately shifting their positions horizontally and vertically in adjacent network layers, thereby expanding the perception range of the self-attention mechanism. The gated feature exchange unit refers to generating dynamic weights through convolutional layers to control the fusion ratio of dual-path features.
[0027] Specifically, the multispectral imaging system simultaneously captures image data in different bands. The near-infrared band can penetrate the surface of wood to reveal internal structural changes, while the ultraviolet band causes defects such as resin pockets to exhibit fluorescence effects. After ensuring spatial consistency of multi-source images through sub-pixel-level registration, the reflectance component reflecting material characteristics is separated in the HSV color space. Fusion weights are assigned based on the significant differences in reflectance components of each band, allowing for targeted enhancement of the features of cracks in the ultraviolet band and live knots in the near-infrared band. In the dual-path network, the CNN branch focuses on defect edge details through a coordinate attention mechanism, while the Transformer branch uses axial shifting to capture the long-range dependencies of wood texture. The dynamic gating mechanism automatically adjusts the contribution of the dual paths based on the current image features, emphasizing local feature extraction in simple defect scenarios and enhancing global modeling capabilities against complex texture backgrounds.
[0028] Compared to traditional methods that rely on single spectral information, resulting in incomplete feature representation, this application enhances the explicit expression of defects through multi-band synergy. Fixed-weight image fusion methods struggle to adapt to different defect types; this scheme, based on adaptive fusion of reflectance component standard deviation, significantly improves feature discriminative power. Conventional detection networks face a trade-off between local details and global features; this scheme's dual-path architecture integrates complementary features through dynamic gating. Lightweight networks commonly used in industrial inspection sacrifice model depth, impacting detection accuracy; this scheme employs Ghost convolution and axial shifting windows to reduce computational complexity while maintaining accuracy.
[0029] Through the above technical solutions, this application effectively improves the detection rate of minor defects in plywood veneers and reduces misjudgments caused by complex wood grain backgrounds. Adaptive fusion of multispectral information enhances the feature contrast of different defect types, and the dual-path network architecture balances local detail capture with global texture analysis capabilities. Sub-pixel-level registration ensures the accuracy of multi-source data fusion, and the lightweight design meets the stringent real-time detection requirements of production lines. The dynamic feature fusion mechanism automatically optimizes the detection strategy according to specific scenarios, reducing system resource consumption while ensuring detection accuracy.
[0030] Specifically, the steps for generating enhanced images based on adaptive weighted fusion using improved Retinex theory include: S31, decompose the V channel of each band HSV space into illumination component L and reflection component R; S32, calculate the significance weight of each band, specifically: , in, This represents the significance weight of the current band (range [0,1]). Let Ri be the standard deviation of the reflection component Ri in the current band i. ; represents the standard deviation of the reflection component Rk in the current band k. It is the sum of the standard deviations of the reflectance components across all bands (RGB + NIR + UV).
[0031] S33, weighted fusion of three-band reflection components to generate an enhanced image.
[0032] In step S4 of this embodiment, the specific implementation method of the axial shift window mechanism is as follows: The input feature map is divided into an M×M window; Shift the window horizontally by M / 2 pixels in the i-th layer; Shift the window vertically by M / 2 pixels at the (i+1)th layer; Execute alternately until the end of the network.
[0033] The axial shift window mechanism refers to the operation of cross-window information interaction by alternately changing the position of the window in the horizontal and vertical directions. Specifically, the shift step size can be calculated using integer division; for example, when the window size M is 8, the shift amount is 4 pixels. This mechanism breaks the fixed window boundary constraint through half-window displacement, promoting the fusion of features in adjacent regions. Horizontal shift is used to establish long-range horizontal dependencies, while vertical shift is used to capture vertical spatial relationships. The alternating execution strategy forms a cross-attention path, expanding the global perception range while maintaining local computational efficiency.
[0034] Specifically, the input feature map is divided into fixed-size local windows, with self-attention computation performed within each window to reduce computational complexity. Horizontal shifting creates overlapping regions between adjacent windows in the horizontal dimension, allowing the network to capture lateral feature associations across the original window boundaries. Vertical shifting aligns these overlapping regions in the next layer, establishing long-range dependencies in the vertical direction. By alternately performing horizontal and vertical shifts, spatial information from different directions is gradually fused across layers, forming a two-dimensional cross-attention mechanism. This axially alternating window partitioning method is particularly suitable for scenarios with anisotropic wood surface textures, effectively modeling the spatial relationship between fiber orientation and defect morphology while avoiding the computational burden of global self-attention.
[0035] Compared to existing technologies, traditional Transformer networks employ fixed window partitioning or global self-attention mechanisms. The former limits long-range dependency modeling due to fixed window boundaries, while the latter's computational complexity increases quadratically with image size. In contrast, the axial shift window mechanism establishes overlapping perceptual regions between adjacent layers through a half-window step displacement operation, achieving omnidirectional feature interaction in two-dimensional space with linear computational cost. Compared to single-direction shift strategies, the alternating shift pattern can balance the processing of horizontal and vertical texture features, avoiding feature capture bias caused by directional preferences.
[0036] Through the above technical solution, this application achieves a balance between computational efficiency and feature modeling capability in wood defect detection scenarios. The axial alternating shift strategy enables the network to effectively capture crack extension features along the fiber direction on the wood surface, the distribution morphology of resin pockets perpendicular to the fibers, and the multi-directional interwoven knot texture variations. Local window partitioning limits self-attention computation to a controllable range, while the overlapping shifts between layers gradually expand the receptive field, ultimately forming a global feature representation covering the entire image. This mechanism significantly reduces the false detection rate of defects against complex texture backgrounds while meeting the real-time requirements of industrial inspection systems.
[0037] In this embodiment, dynamic computation allocation is also included before the enhanced image is input into the CNN branch for processing and the Transformer branch for processing: Perform 1 / 8 downsampling preprocessing on the enhanced image; If the defective area accounts for less than 5%, only the CNN branch is enabled; If the defective region accounts for 5% or more, then both the CNN branch and the Transformer branch will be enabled.
[0038] Dynamic computational allocation refers to a computational resource allocation mechanism that dynamically adjusts the neural network's computational path based on the spatial distribution ratio of defect regions in the image. Specifically, this can be achieved using a dual-branch network architecture combined with a region proportion threshold judgment. This mechanism optimizes resources by establishing a dynamic mapping relationship between defect features and computational resources. 1 / 8 downsampling preprocessing refers to scaling down the original image resolution to 1 / 64 of its original size for rapid feature extraction. This can be implemented using bilinear interpolation or nearest neighbor sampling algorithms. This preprocessing reduces computational complexity to quickly estimate the distribution of defect regions. The defect region proportion refers to the ratio of the defect pixel area to the total pixel area of the image. This can be calculated using binarization segmentation combined with connected component analysis. This parameter serves as the decision-making basis for branch activation, balancing detection accuracy and computational efficiency.
[0039] Specifically, a preliminary defect region estimation is performed using a downsampled, preprocessed low-resolution image, and the defect size is determined based on a preset 5% area threshold. When a small-area defect is detected, only the CNN branch is activated to efficiently process it using its local feature extraction capabilities. When a large-area or complexly distributed defect is detected, both the CNN and Transformer branches are activated together, improving detection accuracy through the synergistic effect of local detail capture and global context modeling. This dynamic allocation mechanism constructs an adaptive mapping relationship between defect features and computing resources, ensuring detection accuracy while avoiding computational redundancy caused by running the hybrid network throughout the entire process.
[0040] Compared to existing technologies, traditional methods typically employ fixed network structures to handle all defect types, such as a single detection network based on YOLO or a hybrid architecture that operates continuously. This leads to wasted computational resources when detecting small defects, while being limited by network capacity when detecting complex defects. This solution establishes a dynamic correlation between the proportion of defect regions and the network architecture, achieving intelligent allocation of computational resources and overcoming the trade-off between real-time performance and detection accuracy inherent in fixed network structures.
[0041] Through the above technical solution, this application effectively solves the problem of computing resource allocation in defect detection scenarios of different sizes, ensuring the real-time performance of small defect detection while guaranteeing the identification accuracy of large-area complex defects. Furthermore, by dynamically adjusting the network computing path, the continuous high power consumption problem of traditional hybrid network architecture is avoided, significantly improving the practicality and adaptability of the system in industrial production line environments.
[0042] For training Dual-Transformer networks, this application proposes a few-shot training method with augmented physical information, including: Wood substrate texture synthesis based on Perlin noise-orientation field coupling algorithm; Defects are embedded using a Physics-GAN generator. The generator contains a physical constraint layer, with constraints including that the angle between the crack extension direction and the wood fiber direction does not exceed 15 degrees and that the live knot texture is distributed in a concentric gradient.
[0043] The Perlin noise-direction field coupling algorithm is a method for generating continuous texture fields by superimposing cosine functions of different frequencies and phases. Specifically, it can be implemented using multi-scale noise synthesis technology to simulate the natural orientation of wood fibers. The physical constraint layer refers to the network layer in the generative adversarial network that applies physical rules. Specifically, it can be implemented through the direction field constraint module to ensure that the generated defects conform to the mechanical properties of wood.
[0044] Specifically, the wood base texture is constructed by superimposing cosine functions to create a directional field, forming a texture structure with continuous fiber orientation. During the defect generation stage, crack generation directions are restricted to a 15-degree deviation from the fiber direction, and the generation path is corrected in real-time by the directional field constraint module. During knot generation, the texture gradient distribution module forces the generation of concentric circular growth rings, and the texture density decreases through the radial gradient calculation unit. The physical constraint layer performs rule verification during the generator's forward propagation, reparameterizing intermediate features that do not conform to physical laws.
[0045] Compared to existing technologies, traditional generative adversarial networks (GANs) rely solely on data distribution learning in wood defect synthesis, often resulting in illogical crack shapes perpendicular to the fiber direction and live knots lacking concentric circle texture features. This method, through explicit physical rule constraints, ensures that the generated data conforms to the mechanical properties and growth patterns of wood, thus solving the problem of mismatch between artificially synthesized data and real physical laws.
[0046] Through the above technical solution, this application effectively improves the physical rationality of defect data under small sample training conditions, and the generated training data can accurately reflect the morphological characteristics of real wood defects. During training, the model encounters more defect variants that conform to physical laws, enhancing its ability to identify complex defects in actual production scenarios and avoiding overfitting problems caused by data distortion.
[0047] In this embodiment, the step of outputting location information includes: The defect category and rectangle coordinates (x, y, w, h) are output through the bounding box regression branch, and the CIoU loss function is used for optimization. Pixel-level defect contours are output by segmenting branches using a mask, and optimized using the Dice loss function. Add a location-type consistency constraint.
[0048] Among these features, the lightweight design of the mask branch reduces the position output latency to 9ms, CIoU+Dice loss ensures that the bounding box positioning error is <2 pixels, and the mask IoU is >92%. In practical applications, the contour simplification algorithm reduces the amount of data transmitted by 90%. For example, the number of live node contour points is reduced from 358 to 32, and world coordinate mapping supports millimeter-level positioning and grasping by robotic arms.
[0049] Based on the above methods, this application further proposes a plywood veneer defect identification device 100, including a sealed imaging chamber 101, an edge computing module 102, and a robotic arm sorting module 104.
[0050] Among them, the sealed imaging chamber 101 refers to a closed acquisition environment with optical shielding function. Specifically, it can be realized by a combination structure of aluminum alloy frame and light-absorbing coating. The interior integrates a multispectral imaging unit and an anti-interference light shield, which physically isolates external stray light interference and ensures the stability of multispectral image acquisition.
[0051] The edge computing module refers to the embedded processing unit deployed on the production line side. Specifically, it can be implemented using a hardware platform equipped with an NVIDIA Jetson AGX Orin processor. It uses INT8 quantization technology to compress the size of the neural network model, thereby improving inference speed while maintaining computational accuracy.
[0052] The robotic arm sorting module refers to an actuator with coordinate positioning function, which can be implemented by a six-axis collaborative robot in conjunction with a vacuum suction cup device, performing graded grasping actions according to the defect type and location information.
[0053] Specifically, the sealed imaging chamber uses an anti-interference light shield to eliminate the impact of ambient light fluctuations on multispectral imaging, ensuring consistent image acquisition quality across the three bands. The edge computing module runs a quantized dual-path network model, enabling low-latency defect detection computations on an embedded processor.
[0054] Compared with existing technologies, traditional detection equipment relies on an open imaging environment and is easily affected by workshop lighting. In contrast, this system effectively suppresses ambient light interference by combining a sealed imaging chamber with a multispectral imaging unit.
[0055] Through the above technical solutions, this application solves the problem of unstable image acquisition caused by environmental interference and realizes reliable detection under complex lighting conditions; through the collaborative architecture of edge computing and cloud optimization, it continuously improves the model adaptability while ensuring real-time processing; through the precise coordinate positioning of the robotic arm, it realizes the automated graded processing of defective products; and through the system-level integration of multiple modules, it constructs a solution covering the entire process of detection, calculation, optimization, and execution.
[0056] Furthermore, this embodiment also includes a cloud-based model optimization platform 103, which refers to a remote server cluster that supports continuous model iteration. Specifically, it can be implemented using a distributed training framework, which periodically receives actual defect data collected from the production line to complete incremental updates of network parameters.
[0057] The cloud platform periodically receives new data from the production line and triggers model retraining, enabling the network parameters to adapt to seasonal changes in wood texture. The robotic arm sorting module receives the detection results and performs physical sorting operations according to preset grading rules. All modules are interconnected via a data bus, forming a closed-loop system of data acquisition, calculation, optimization, and execution.
[0058] Existing methods mostly employ classification models with fixed parameters, which cannot adapt to the natural variations in wood texture. This system achieves dynamic parameter updates through a cloud-based model optimization platform. Conventional edge computing devices struggle to meet real-time requirements due to their large model sizes. This system uses INT8 quantization technology to compress the model size, achieving the inference speed required for production lines on embedded processors.
[0059] Furthermore, in this embodiment, the multispectral imaging unit employs an adjustable filter wheel industrial camera, a separately controlled ring light source, and an FPGA trigger controller. The adjustable filter wheel industrial camera has a resolution of no less than 20 million pixels; the separately controlled ring light source includes a 6500K visible light LED array, an 850nm point light source, and a 365nm ultraviolet lamp; the FPGA trigger controller controls the acquisition time difference of the three bands to be less than 100 milliseconds.
[0060] Among them, the adjustable filter wheel industrial camera refers to an industrial-grade imaging device equipped with switchable filters. Specifically, it can be implemented using an electric filter wheel mounted on a global shutter CMOS sensor, achieving multispectral image acquisition by rapidly switching between different wavelength filters. The separately controlled ring light source refers to an independently controlled multi-band illumination device, specifically implemented using a regionally deployed visible light LED array, a near-infrared laser module, and an ultraviolet fluorescence excitation module. The visible light LED array has a color temperature of 6500K, the near-infrared point light source has a power of 30W, and the ultraviolet lamp is equipped with a diffraction grating homogenizer. The FPGA trigger controller refers to a synchronization control unit based on a field-programmable gate array. Specifically, it can be implemented using a hardware description language to write trigger logic circuits, achieving hardware-level synchronization of multispectral imaging through precise timing control.
[0061] Specifically, this multispectral imaging system achieves rapid switching and acquisition of RGB, NIR, and UV images through an adjustable filter wheel, while its 20-megapixel resolution ensures the capture of detailed wood surface textures. A visible light LED array in a separately controlled ring light source provides uniform surface illumination, an 850nm near-infrared light source penetrates the wood surface to enhance the reflectivity of internal defects, and a 365nm ultraviolet light source excites the fluorescence reaction of resins and other substances on the wood surface. An FPGA trigger controller uses hardware circuitry to synchronously control filter switching and light source activation / deactivation, compressing the time difference between the three-band image acquisition to within 100 milliseconds and avoiding image displacement deviations caused by continuous conveyor belt movement.
[0062] Compared to existing technologies, traditional methods using a single light source and software triggering mechanisms suffer from issues such as asynchronous multispectral image acquisition and poor light source band adaptability. For example, conventional industrial cameras use software to control filter switching, resulting in acquisition intervals exceeding 200 milliseconds, which can lead to significant image misalignment when the conveyor belt speed exceeds 0.5 m / s. This solution achieves precise spatiotemporal alignment of multispectral imaging through physical layer optimization of the separately controlled light source and FPGA hardware synchronization mechanisms.
[0063] Through the above technical solutions, this application effectively solves the problem of timing synchronization in multispectral image acquisition, ensuring the accuracy of subsequent image registration and fusion. The independently controlled light source system for each wavelength band adapts to the differences in optical characteristics of wood defects, and the FPGA hardware triggering mechanism overcomes the delay defects of traditional software control, providing a reliable hardware foundation for high-precision defect identification in continuous industrial production environments.
[0064] This application also provides a computer-readable storage medium storing a computer program that, when executed, can implement the method for identifying single-board defects described in the above embodiments.
[0065] The above description, in conjunction with specific preferred embodiments, provides a further detailed explanation of the present invention, enabling those skilled in the art to understand and apply the invention. However, it should not be construed that the specific implementation of the invention is limited to these descriptions.
Claims
1. A method for identifying defects in a single-board assembly, characterized in that, Includes the following steps: The RGB, NIR, and UV band images of the single board are acquired simultaneously through a pre-set multispectral imaging system. The three-band images are aligned at the subpixel level using an affine transformation-optical flow joint registration algorithm. An enhanced image is generated based on adaptive weighted fusion using improved Retinex theory. The enhanced image is input into a preset lightweight Dual-Transformer network for processing. The lightweight Dual-Transformer network includes a CNN branch and a Transformer branch. The CNN branch uses the Ghost-CSP module to extract local features and embeds a coordinate attention mechanism. The Transformer branch uses an axial shift window mechanism for global modeling, decomposes 2D self-attention into row and column dual 1D operations, and dynamically fuses dual-path features through a gated feature exchange unit. Output defect type and location information, whereby the defect types include live joints, dead joints, cracks, and resin pockets.
2. The method for identifying single-board defects according to claim 1, characterized in that, The steps for generating enhanced images using adaptive weighted fusion based on improved Retinex theory include: The V channel of each band of HSV space is decomposed into illumination component L and reflection component R; Calculate the significance weight of each band; The three-band reflection components are fused according to weights to generate an enhanced image.
3. The method for identifying single-board defects according to claim 1, characterized in that, The steps for global modeling using the axial shift window mechanism include: The input feature map is divided into an M×M window; Shift the window horizontally by M / 2 pixels in the i-th layer; Shift the window vertically by M / 2 pixels at the (i+1)th layer; Execute alternately until the end of the network.
4. The method for identifying single-board defects according to claim 1, characterized in that, The process includes the following steps before the enhanced image is input into the CNN branch for processing and the Transformer branch for further processing: Perform 1 / 8 downsampling preprocessing on the enhanced image; If the defective area accounts for less than 5%, then only the CNN branch is used for processing; If the defective area accounts for ≥5%, then both the CNN branch and the Transformer branch will be used for processing.
5. The method for identifying single-board defects according to claim 1, characterized in that, The method also includes the process of initial training and periodic training of the Dual-Transformer network, wherein the training samples are obtained in the following manner: Wood substrate texture synthesis based on Perlin noise-orientation field coupling algorithm; Defects are embedded through a Physics-GAN generator, which contains a physical constraint layer.
6. The method for identifying single-board defects according to claim 1, characterized in that, The step of outputting the location information includes: The defect category and rectangle coordinates (x, y, w, h) are output through the bounding box regression branch, and the CIoU loss function is used for optimization. Pixel-level defect contours are output by segmenting branches using a mask, and optimized using the Dice loss function. Add a location-type consistency constraint.
7. An apparatus based on the method of any one of claims 1-6, characterized in that, include: A sealed imaging chamber (101) with a built-in multispectral imaging unit and an anti-interference light shield; The edge computing module (102) is equipped with a data processor and can run the Dual-Transformer network; The robotic arm sorting module (104) performs graded sorting based on the output location information and defect type.
8. The apparatus according to claim 7, characterized in that, The multispectral imaging unit includes: Adjustable filter wheel industrial camera with a resolution of ≥20 million pixels; A separately controlled ring light source is used to provide visible light, point light source and ultraviolet light; An FPGA trigger controller is used to ensure that the acquisition time difference of the three bands is less than 100ms.
9. The apparatus according to claim 7, characterized in that, Also includes: A cloud-based model optimization platform (103) is used to periodically receive production line data and retrain the Dual-Transformer network.
10. A computer-readable storage medium, characterized in that, The device contains a computer program that can implement the steps of the method according to any one of claims 1-6.
Citation Information
Cited By
Multi-spectrogram lightweight acoustic scene classification method and device for auditory auxiliary equipment, equipment and storage medium
CN121959306A