Flattened bamboo defect detection method and system based on convolutional neural network

Through the flattened bamboo defect detection method based on convolutional neural network, images are collected and preprocessed using high-definition cameras, combined with the improved ResNet-50 architecture, efficient and accurate detection of flattened bamboo surface defects is achieved, and the existing solutions are solved The problem of low detection accuracy and insufficient generalization ability in technology.

CN119444709APending Publication Date: 2025-02-14INT CENT FOR BAMBOO & RATTAN
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411523295.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-30
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

The prior art is difficult to achieve efficient, accurate and real-time detection of flattened bamboo defects, especially in the problems of unclean removal of bamboo green and bamboo yellow, surface cracks and uneven surfaces, the detection accuracy is not high and the generalization ability is insufficient.

Method used

Using a detection method based on convolutional neural network, high-resolution images are collected through high-definition cameras, and after preprocessing, input into the improved convolutional neural network of ResNet-50 architecture for feature extraction and defect recognition, including multi-scale feature extraction modules and features Fusion layer and classification layer.

Benefits of technology

It realizes efficient and accurate detection of various defects on flattened bamboo surface, improves detection efficiency and accuracy, enhances the robustness and real-timeness of detection, and supports real-time quality control on the production line.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119444709A_ABST
    Figure CN119444709A_ABST
Patent Text Reader

Abstract

The invention discloses an automatic flattened bamboo defect detection method and system based on a convolutional neural network, and relates to the field of image recognition and material detection, and the method comprises the steps: carrying out the high-resolution image collection of the surface of a flattened bamboo through a high-definition camera; the collected flattened bamboo wood image is preprocessed; the preprocessed image is input into a trained convolutional neural network, the convolutional neural network is based on an improved ResNet-50 architecture, and the improved ResNet-50 architecture comprises a multi-scale feature extraction module, a feature fusion layer and a classification layer; the surface defects of the flattened bamboo wood are automatically identified through a convolutional neural network; and positioning and classifying the identified defects, and outputting a result to an automatic detection system. Compared with the prior art, various defects on the surface of the flattened bamboo wood are automatically detected through the convolutional neural network, manual intervention is not needed, and the detection efficiency and accuracy are greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of image recognition and material detection, and in particular to a flattened bamboo material defect detection method and system based on a convolutional neural network. Background Art

[0002] As a renewable natural resource, bamboo is widely used in the fields of construction, furniture, and handicrafts due to its rapid growth, high strength, and environmental protection. As global environmental problems intensify, the application of bamboo has received more and more attention and has gradually become one of the substitutes for wood. In the processing of bamboo, flattened bamboo is widely used in the fields of flooring, wall panels, and structural panels due to its good mechanical properties, natural and beautiful texture, and environmental protection characteristics. Flattened bamboo is a round bamboo that undergoes a complex processing process to remove the green and yellow layers and flatten it into a flat structure, giving it greater utilization value and application range.

[0003] However, due to the structural complexity of bamboo itself and the technical limitations in the processing process, flattened bamboo is prone to problems such as incomplete removal of bamboo green and bamboo yellow, surface cracking, and surface unevenness. These defects not only affect the aesthetics of flattened bamboo, but are also directly related to its performance, durability, and market value.

[0004] 1. Removal of bamboo green and bamboo yellow Bamboo green is a hard, waxy outer layer of bamboo that is waterproof and insect-proof; bamboo yellow is a thin layer on the inside of bamboo. In order to improve the processing quality and performance of flattened bamboo, bamboo green and bamboo yellow must be removed during the production process. However, the removal of bamboo green and bamboo yellow is a complex and delicate task, especially in large-scale production, where it is difficult to completely remove bamboo green and bamboo yellow by mechanical processing. If the removal is incomplete, the surface of the flattened bamboo will retain uneven color and texture, affecting the appearance. In addition, the residual bamboo green may also increase the hygroscopicity of the bamboo, which in turn causes quality problems such as cracking.

[0005] 2. Surface cracking problem Due to the natural porous structure of bamboo and the change of moisture content, flattened bamboo is prone to cracking during processing, drying and use. Especially during the processing, if the moisture of bamboo is not properly controlled or the force is uneven, the stress inside the bamboo is released unevenly, resulting in surface cracking. This cracking not only affects the aesthetics of flattened bamboo, but also may reduce its mechanical properties and service life.

[0006] 3. Uneven surface problem Another common defect of flattened bamboo is the uneven surface, which is mainly caused by the natural internode structure of bamboo and the unevenness during processing. Bamboo needs to go through multiple steps such as cutting, flattening, and pressing during the flattening process. The operating accuracy and process control of each step will affect the final surface flatness. The uneven surface not only affects the visual effect of the flattened bamboo, but also brings problems in the subsequent painting and use process, such as uneven coating and material wear.

[0007] Existing defect detection mostly relies on manual inspection, which is limited by factors such as operator visual fatigue and subjective judgment, and cannot meet the high efficiency and stability requirements of large-scale production. In order to improve the quality of flattened bamboo, an automated method that can achieve real-time, efficient and accurate detection on the production line is urgently needed.

[0008] At present, artificial intelligence, especially deep learning, has made significant progress in the field of wood defect detection. Convolutional neural networks (CNNs) can automatically extract image features through multi-layer networks, and are particularly suitable for defect detection of complex texture materials such as bamboo. However, defect recognition of flattened bamboo has its own particularity. For example, when bamboo green and bamboo yellow are not removed cleanly, the color difference is small, and problems such as cracking and surface unevenness are irregular and diverse, which puts high demands on defect detection algorithms. When facing these problems, existing bamboo defect detection systems often have problems such as low detection accuracy and insufficient generalization ability. Therefore, designing a convolutional neural network method suitable for flattened bamboo defect detection has important application value and innovation. Summary of the invention

[0009] The purpose of the present invention is to provide a method and system for automatic detection of flattened bamboo defects based on convolutional neural networks, which can efficiently and accurately identify defects such as unclean removal of bamboo green and bamboo yellow, surface cracks, and surface unevenness, and is suitable for real-time detection and quality control of production lines.

[0010] In order to solve the above problems, the technical solution adopted by the present invention is: the method for automatically detecting defects in flattened bamboo based on convolutional neural network includes the following steps: (1) Use a high-definition camera to collect high-resolution images of the flattened bamboo surface; (2) Preprocessing the collected flattened bamboo images; (3) Inputting the preprocessed image into a trained convolutional neural network, wherein the convolutional neural network is based on an improved ResNet-50 architecture, wherein the improved ResNet-50 architecture includes a multi-scale feature extraction module, a feature fusion layer module, and a classification layer module; (4) Automatically identifying surface defects of the flattened bamboo material by the convolutional neural network, wherein the surface defects of the flattened bamboo material include incomplete removal of green bamboo, incomplete removal of yellow bamboo, surface cracks and surface unevenness; (5) Locate and classify the identified defects and output the results to the automatic detection system.

[0011] In the above-mentioned technical solution of the automatic detection method for flattened bamboo defects based on convolutional neural network, a more specific technical solution can also be: the improved ResNet-50 architecture is first improved by introducing residual learning units, and then introducing Inception modules and deep separable convolutions for multi-scale feature extraction.

[0012] In some possible implementation schemes, in step (1), the image resolution is 1920×1080.

[0013] In some possible implementations, the preprocessing includes graying, contrast enhancement, Retinex algorithm enhancement of low brightness areas, noise removal, and edge detection; The pre-processing step comprises: (1) Grayscale: Convert a color image into a grayscale image. The grayscale formula is: in, Y Represents the gray value, R , G , B are the pixel values ​​of the red, green, and blue channels respectively; (2) Contrast enhancement: The contrast between different areas in the image is improved by adjusting the dynamic range. The contrast is calculated as follows: in, Y′ is the enhanced gray value, L is the gray level, min( Y ) and max( Y ) are the minimum and maximum grayscale values ​​in the original image respectively; (3) The Retinex algorithm enhances the low brightness area. The calculation formula of the Retinex algorithm is as follows: in, R ( x,y ) is the enhanced pixel value, I ( x,y ) is the pixel value of the original image, G ( k,l ) is the Gaussian filter kernel, m andn Respectively represent the size of the kernel; The unclean areas of bamboo green and bamboo yellow removal usually have small color differences and low brightness. The Retinex algorithm can effectively enhance the visibility of these low-brightness areas; (4) Noise removal: To avoid noise interfering with the feature extraction process of the convolutional neural network, a filtering algorithm is used to remove high-frequency noise that may exist in the image. The calculation formula of the filtering algorithm is as follows: in, F ( x,y ) is the pixel value after filtering, I ( i,j ) is the neighborhood pixel value in the original image, K is the total number of pixels in the neighborhood; (5) Edge detection: The edge features in the image are marked by the Canny edge detection algorithm, especially the boundaries of cracks on the flattened bamboo surface. The calculation formula of the Canny edge detection algorithm is as follows: 1) Gaussian filtering to smooth the image: in G ( x,y ) is the smoothed pixel value, I ( x,y ) is the original pixel value, G σ ( x,y ) is a Gaussian kernel function, which is used to control the degree of filtering; 2) Calculate gradients: Identify strong edges in the image: in, G x , G y Represent the gradients in the horizontal and vertical directions respectively; 3) Gradient strength and direction: in, M is the gradient strength of the pixel; θ is the gradient direction of the pixel.

[0014] In some possible implementation schemes, the multi-scale feature extraction module in the convolutional neural network is composed of a plurality of convolution kernels of different sizes, namely, a large-size convolution kernel of 7×7, a medium-size convolution kernel of 5×5, and a small-size convolution kernel of 3×3. Each convolution kernel is responsible for extracting features of different scales, specifically including: (1) Large-size convolution kernels are used to extract global texture information of bamboo green and bamboo yellow to remove unclean areas; (2) A medium-sized convolution kernel is used to extract the edge and crack features of the cracking area; (3) Small-sized convolution kernels are used to detect subtle fluctuations in the uneven surface of bamboo.

[0015] In some possible implementation schemes, the feature fusion layer module of the convolutional neural network fuses multi-scale features through global average pooling, thereby focusing on both the global features and local details of the flattened bamboo material, thereby improving the accuracy of defect recognition.

[0016] In some possible implementation schemes, the detection of unclean bamboo green and bamboo yellow removal is performed by combining color histogram matching and convolutional neural network intermediate layer feature extraction, and the steps include: (1) Use the color histogram to perform partition matching on the image and identify the color features of the bamboo green and bamboo yellow areas; (2) In the middle layer of the convolutional neural network, the residual area and distribution position of bamboo green and bamboo yellow are calculated through the feature map. The calculation formula is: 1) Calculation formula for the residual area of ​​the color region: in, A bq is the remaining area of ​​bamboo shoots, A bh is the residual area of ​​bamboo yellow, F ( x,y ) is the convolutional neural network feature map at position ( x,y ), R bq For Zhuqing area, R bh It is the Zhuhuang area; 2) Position distribution calculation formula: in,( X bq , Y bq ) is the centroid coordinate of the Zhuqing area, ( X bh , Y bh ) is the centroid coordinate of Zhuhuang area; 3) Comprehensive detection formula: in, w 1. w 2. w 3 is to adjust the parameters of each weight and set them according to the experimental conditions.

[0017] In some possible implementations, the detection of surface cracks is performed by combining edge detection algorithms with feature extraction of convolutional neural networks, specifically including: (1) Use the Canny edge detection algorithm to mark potential cracks in the image during the preprocessing stage; (2) Convolutional neural network extracts crack edge features and quantifies the length, width and density of the crack.

[0018] In some possible implementations, the detection of surface unevenness is performed by combining frequency domain analysis with a convolutional neural network, and the specific steps are as follows: (1) Perform discrete Fourier transform on the image to convert the spatial fluctuation characteristics of the surface unevenness into frequency information; (2) The convolutional neural network extracts high-frequency features and identifies surface fluctuation areas, outputting quantitative data of roughness.

[0019] According to another embodiment of the present invention, there is provided a flattened bamboo material defect automatic detection system based on a convolutional neural network, the system comprising an image acquisition module, an image preprocessing module, a convolutional neural network module, a defect recognition module and a result output module, wherein the image acquisition module is used to obtain a plurality of surface images of the flattened bamboo material; the image preprocessing module is used to perform image preprocessing on the plurality of surface images acquired by the image acquisition module to improve the recognizability and feature extraction quality of the image, and provide higher quality input data for the convolutional neural network; the convolutional neural network module is used to extract multi-scale features in the preprocessed image, identify and classify surface defects of the flattened bamboo material, including unclean removal of bamboo green, unclean removal of bamboo yellow, surface cracks and uneven areas, and enhance detection accuracy and robustness; the defect recognition module is used to further locate and classify the defect area identified by the convolutional neural network module, convert the output of the convolutional neural network into a specific defect type and position, and accurately identify the type of defect; the result output module is used to output the analysis result of the defect recognition module to the automatic detection system interface, and generate defect location data and statistical reports.

[0020] Due to the adoption of the above technical solution, the present invention has the following beneficial effects compared with the prior art: 1. Efficient and automated detection: The present invention uses a convolutional neural network to automatically detect various defects on the flattened bamboo surface without manual intervention, greatly improving detection efficiency and accuracy.

[0021] 2. Multi-scale feature extraction: The improved ResNet-50 architecture can adapt to the needs of defect detection at different scales on the bamboo surface, ensuring accurate detection of different types of defects.

[0022] 3. Comprehensive preprocessing: The image preprocessing step effectively improves the visibility of defect areas, reduces noise interference in the image, and further improves the accuracy of detection.

[0023] 4. Real-time feedback control: The present invention realizes real-time quality control during the flattened bamboo processing by feeding back the test results to the production control system, which helps to improve the consistency and stability of the flattened bamboo products. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 It is a flow chart of the flattened bamboo defect detection method based on convolutional neural network in the present invention.

[0025] Figure 2 This is a structural diagram of the multi-scale feature extraction module of the convolutional neural network of the present invention.

[0026] Figure 3 This is a workflow diagram of the real-time defect detection system of the present invention.

[0027] Figure 4 It is a schematic diagram of module connection of the control system of the present invention. DETAILED DESCRIPTION

[0028] In order to make the above-mentioned purposes, features and advantages of the present invention easier to understand, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. In the following description, many specific details are set forth in order to fully understand the present invention, but the present invention can be implemented in many other ways different from those described herein, and those skilled in the art can make similar improvements without violating the connotation of the present invention, so the present invention is not limited by the specific embodiments disclosed below.

[0029] like Figure 1 As shown, the present invention provides a method for automatically detecting defects in flattened bamboo based on a convolutional neural network, the method comprising the following steps: (1) Use a high-definition camera to collect high-resolution images of the flattened bamboo surface; (2) Preprocessing the collected flattened bamboo images; (3) Inputting the preprocessed image into a trained convolutional neural network, wherein the convolutional neural network is based on an improved ResNet-50 architecture, and the improved ResNet-50 architecture includes a multi-scale feature extraction module, a feature fusion layer, and a classification layer; (4) Automatically identifying surface defects of the flattened bamboo material by the convolutional neural network, wherein the surface defects of the flattened bamboo material include incomplete removal of green bamboo, incomplete removal of yellow bamboo, surface cracks and surface unevenness; (5) Locate and classify the identified defects and output the results to the automatic detection system.

[0030] like Figure 4 As shown, the flattened bamboo material defect automatic detection system based on convolutional neural network provided by the present invention includes an image acquisition module 1, an image preprocessing module 2, a convolutional neural network module 3, a defect recognition module 4 and a result output module 5, wherein the image acquisition module is used to obtain a plurality of surface images of the flattened bamboo material; the image preprocessing module is used to perform image preprocessing on the plurality of surface images acquired by the image acquisition module to improve the recognizability and feature extraction quality of the image, and provide higher quality input data for the convolutional neural network; the convolutional neural network module is used to extract multi-scale features in the preprocessed image, identify and classify the surface defects of the flattened bamboo material, including unclean removal of bamboo green, unclean removal of bamboo yellow, surface cracks and uneven areas, and enhance the detection accuracy and robustness; the defect recognition module is used to further locate and classify the defect area identified by the convolutional neural network module, convert the output of the convolutional neural network into a specific defect type and position, and accurately identify the type of defect; the result output module is used to output the analysis result of the defect recognition module to the automatic detection system interface, and generate defect location data and statistical reports.

[0031] In this embodiment, the image acquisition and preprocessing method is as follows: 1. Image acquisition: During the flattening process, the bamboo undergoes a series of mechanical treatments, including cutting off the green and yellow parts of the bamboo and processing them into flattened bamboo. In order to ensure the surface quality of the flattened bamboo, a high-definition camera is installed on the processing line to collect real-time images of the bamboo surface. The camera resolution used is 1920×1080, which can capture the details of the bamboo surface. Adjust the installation position of the camera to ensure that the surface information of the bamboo board can be fully captured when it flows under the camera.

[0032] 2. Image preprocessing: In order to improve the ability of convolutional neural network to recognize bamboo surface defects, the original collected images need to be preprocessed. The specific steps of preprocessing include: (1) Grayscale: Convert the color image into a grayscale image to reduce the computational complexity while retaining the surface detail information of the bamboo. The grayscale formula is: in, Y Represents the gray value, R , G , B are the pixel values ​​of the red, green, and blue channels respectively.

[0033] (2) Contrast enhancement: The contrast between different areas in the image is improved by adjusting the dynamic range, so that the residual areas and cracks of bamboo green and bamboo yellow are easier to identify. The calculation formula of the contrast is as follows: in, Y′ is the enhanced gray value, L is the gray level, min( Y ) and max( Y ) are the minimum and maximum grayscale values ​​in the original image, respectively.

[0034] (3) Retinex algorithm enhances low-brightness areas: The areas where bamboo green and bamboo yellow are removed have small color differences and low brightness. Ordinary preprocessing methods may not be able to highlight the details, while the Retinex algorithm can enhance the visibility of these low-brightness areas, thereby helping the convolutional neural network to identify defects more accurately. The calculation formula of the Retinex algorithm is as follows: in, R ( x,y ) is the enhanced pixel value, I ( x,y ) is the pixel value of the original image, G ( k,l ) is the Gaussian filter kernel, m and n Represent the size of the kernel respectively.

[0035] (4) Noise removal: To avoid noise interfering with the feature extraction process of the convolutional neural network, a filtering algorithm is used to remove high-frequency noise that may exist in the image. The calculation formula of the filtering algorithm is as follows: in, F ( x,y ) is the pixel value after filtering, I ( i,j ) is the neighborhood pixel value in the original image, K is the total number of pixels in the neighborhood.

[0036] (5) Edge detection: The Canny edge detection algorithm is used to mark the edge features in the image, especially the boundaries of cracks on the surface of bamboo, which is helpful for subsequent crack feature extraction. The calculation formula of the Canny edge detection algorithm is as follows: 1) Gaussian filtering to smooth the image: in G ( x,y ) is the smoothed pixel value, I( x,y ) is the original pixel value, G x ( x,y ) is a Gaussian kernel function, which is used to control the degree of filtering.

[0037] 2) Calculate gradients: Identify strong edges in the image: in, G x , G y Represent the gradients in the horizontal and vertical directions respectively.

[0038] 3) Gradient strength and direction: in, M is the gradient strength of the pixel; θ is the gradient direction of the pixel.

[0039] In some embodiments, the convolutional neural network model is constructed as follows: 1. Convolutional Neural Network Architecture The present invention is based on the improved ResNet-50 architecture as the basic model of the convolutional neural network. The ResNet-50 architecture is first improved by introducing the residual learning unit, so that it can effectively avoid the gradient vanishing problem in the deep network, while ensuring the training effect of the network. On this basis, by further introducing the Inception module and deep separable convolution, multi-scale defect features can be extracted from the flattened bamboo image to improve the detection efficiency and accuracy of the network. Figure 2 As shown, the network structure further improved by the present invention is divided into: (1) Input layer: accepts preprocessed images with an image size of 224×224. After normalization, the input image enters the convolutional neural network for feature extraction; (2) Multi-scale feature extraction module: Convolution kernels of different sizes are used for feature extraction to ensure the identification of defects of different scales. The size of the large-size convolution kernel is 7×7: it is used to extract the global texture information of the bamboo surface, especially suitable for detecting bamboo green and bamboo yellow to remove unclean areas; the size of the medium-size convolution kernel is 5×5: it is suitable for extracting the edge and crack features of the cracked area on the bamboo surface; the size of the small-size convolution kernel is 3×3: it is used to detect the subtle fluctuations of the uneven surface of the bamboo; (3) Feature fusion layer: The extracted multi-scale features are fused through global average pooling. Global average pooling can reduce noise interference in the feature map and effectively fuse global and local defect features to ensure accurate detection of various defects such as bamboo green, bamboo yellow, unclean removal, cracks and unevenness; (4) Classification layer: The Softmax classifier is used to classify the defects in detail, including incomplete removal of bamboo green, incomplete removal of bamboo yellow, surface cracks, and surface unevenness.

[0040] 2. Feature extraction and defect detection After training, the convolutional neural network can automatically extract different features in the flattened bamboo image, including color differences, edge features, and texture fluctuations. For the following defect types, the convolutional neural network detection process is as follows: (1) Detection of bamboo green and bamboo yellow removal: Through color histogram matching combined with the feature extraction of the middle layer of the convolutional neural network, the network can detect the residual areas of bamboo green and bamboo yellow; color histogram matching can partition and analyze the color characteristics of bamboo green and bamboo yellow, and the middle layer of the convolutional neural network calculates the residual area and distribution position through the feature map. The calculation formula is: 1) Calculation formula for the residual area of ​​the color region: in, A bq is the remaining area of ​​bamboo shoots, A bh is the residual area of ​​bamboo yellow, F ( x,y ) is the convolutional neural network feature map at position ( x,y ), R bq For Zhuqing area, R bh It is the Zhuhuang area; 2) Position distribution calculation formula: in,( X bq , Y bq ) is the centroid coordinate of the Zhuqing area, ( X bh , Y bh ) is the centroid coordinate of Zhuhuang area; 3) Comprehensive detection formula: in, w 1. w 2. w 3 is to adjust the parameters of each weight and set them according to the experimental conditions.

[0041] (2) Detection of surface cracks: During the preprocessing process, the Canny edge detection algorithm has marked the potential cracks in the image; the convolutional neural network further extracts the detailed features of the crack edge, including the length, width and density of the crack; the length and width of the crack can be quantified by the edge pixels in the feature map, while the crack density is calculated by counting the frequency of cracks in the local area; (3) Detection of surface unevenness: The fluctuation characteristics of surface unevenness are converted into frequency domain information through discrete Fourier transform; the convolutional neural network can extract the characteristics of the uneven area from the high-frequency characteristics and output the quantitative data of the unevenness based on these characteristics. The convolutional neural network gradually reduces the receptive field through the convolution layer and uses the pooling layer to reduce the amount of calculation, ensuring that the surface unevenness can be detected quickly and efficiently.

[0042] In some embodiments, the convolutional neural network is trained as follows: 1. Construction of training data In order to ensure the high-precision recognition of convolutional neural networks in flattened bamboo defect detection, the present invention constructs a large-scale training data set and adopts a variety of data enhancement techniques to improve the generalization ability of the model. The data set contains more than 1,000 high-resolution images of flattened bamboo, which have been manually annotated, and the annotations include various defects such as incomplete removal of bamboo green, incomplete removal of bamboo yellow, cracks, and uneven surface. In order to cope with the complex situation of different defects in actual production, the defect types in the data set are widely distributed, including defects of various scales and shapes, ranging from small cracks to large-scale bamboo yellow residues.

[0043] In addition, a wide range of data enhancement methods are used, such as rotation, scaling, translation, brightness adjustment, color jitter, and random cropping. These enhancement operations not only increase the diversity of training data, but also enhance the robustness of the model under different lighting, angles, and noise environments, ensuring the stable performance of the model in the actual production line. In order to further improve the recognition effect in small sample scenarios, transfer learning technology is used to apply the pre-trained model to bamboo defect detection, reducing the dependence on large-scale labeled data and speeding up the model training process.

[0044] 2. Network training The convolutional neural network is trained using the above labeled data. The cross entropy loss function is used in the training process. The calculation formula of this function is as follows: Among them, N is the total number of samples, C is the total number of classification categories, and y ij Representation sample i In category jThe true label on the sample indicates that the model i In category j The predicted probability of .

[0045] During the training process, the convolutional neural network continuously adjusted its weight parameters to improve its accuracy in defect detection. After the training, after the validation set test, the convolutional neural network's detection accuracy for different defect types reached more than 95%, showing good generalization ability.

[0046] 3. Model Optimization In order to further improve the detection efficiency and accuracy of the network, the present invention introduces deep separable convolution and Inception modules. In deep separable convolution, the convolution kernel first performs convolution operations on the spatial dimension and then on the channel dimension, thereby reducing the amount of calculation. In addition, the Inception module further improves the network's ability to detect features of different scales by performing convolution operations of different sizes in parallel in the same layer.

[0047] like Figure 3 As shown in the figure, a specific example is used to demonstrate the application of the flattened bamboo defect detection system based on convolutional neural network in an actual production line, and the effectiveness of the system is verified through experimental data.

[0048] 1. Detection system configuration In this embodiment, the flattened bamboo production line is equipped with a high-definition camera and an image processing system for real-time detection of defects on the flattened bamboo surface.

[0049] (1) Camera parameters: Model: Basler acA4112-8gc; Resolution: 4096×3000 pixels; Frame rate: 30 frames per second; Acquisition rate: 10 images are taken on each bamboo surface; Lens focal length: 12mm; Light source: LED strip light source, angle 45 degrees, adjustable brightness, color temperature 5500K; (2) Computer configuration: CPU: Intel i7-11700K; GPU: NVIDIA RTX 3080; Memory: 32GB DDR4; Operating system: Ubuntu 20.04; Image processing software: Developed based on Python and OpenCV, the deep learning algorithm is implemented using the TensorFlow 2.6.0 framework.

[0050] (3) Convolutional neural network model: Network structure: ResNet-50; Initial learning rate: 0.001; Optimizer: Adam; Loss function: cross entropy loss function; Training data set: Contains 10,000 flattened bamboo defect images, which have been manually annotated. The defect types include cracks, bamboo green residues, bamboo yellow residues, and uneven areas. The training set and test set are divided in a ratio of 8:2.

[0051] 2. Testing process (1) Image acquisition: When the flattened bamboo passes through the conveyor belt, the camera continuously captures the bamboo surface at a speed of 30 frames per second. At least 10 images will be taken for each piece of bamboo to ensure that all surface areas are covered.

[0052] (2) Image preprocessing: The original image captured by the camera is first converted to grayscale, and a median filter is used to remove image noise.

[0053] (3) Edge detection: Use the Canny edge detection algorithm (thresholds of 50 and 150) to detect cracks on the bamboo surface.

[0054] (4) Defect classification: The preprocessed image is input into the improved ResNet-50 convolutional neural network model, which extracts image features and classifies the defect types in the image. The main defect categories detected include: 1) Crack: The crack width exceeds 1.5 mm.

[0055] 2) Bamboo green residue: The area of ​​bamboo green residue exceeds 0.5 cm².

[0056] 3) Bamboo yellow residue: The bamboo yellow residue area exceeds 0.3 cm².

[0057] 4) Uneven surface: height difference exceeds 0.3 mm.

[0058] (5) Test result output: The system outputs a test report for each piece of bamboo based on the classification results, including information such as defect type, defect location and area. If the defects of a piece of bamboo exceed the preset standard, the system will automatically mark the bamboo and notify the workers to handle it.

[0059] 3. Experimental data and effect verification In order to verify the effectiveness of the detection system, 1,000 flattened bamboo samples were selected for the experiment, of which 500 contained known defects and 500 were defect-free samples. The detection system was verified through the following three steps: (1) Detection accuracy: The test results on the test set show that the system's detection accuracy for cracks, green bamboo residues, yellow bamboo residues and surface unevenness is 95.3%, 93.8%, 92.6% and 90.1% respectively. The overall detection accuracy is 93.0%.

[0060] (2) False positive rate and false negative rate: Among the 1,000 samples, the number of false alarms, i.e. samples detected as defective but actually not defective, was 40, with a false alarm rate of 4%; the number of missed alarms, i.e. samples with defects but not detected, was 30, with a missed alarm rate of 3%.

[0061] (3) Detection sensitivity: When detecting cracks, the detection system can accurately identify cracks with a width of more than 1.5 mm and a length of more than 10 mm, with a detection sensitivity of 91.2%. For smaller cracks, such as those with a width of less than 1.5 mm, the detection system has a detection sensitivity of 85.6%.

[0062] (4) Detection speed: During the actual operation of the production line, the inspection time for each piece of flattened bamboo is about 0.35 seconds, and the flattened bamboo inspection task on the production line can be processed in real time to ensure that production efficiency is not affected.

[0063] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited by the above embodiments. The above embodiments and descriptions are only preferred examples of the present invention and are not intended to limit the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention. The scope of protection of the present invention is defined by the attached claims and their equivalents.

Claims

1. A method for automatic detection of flattened bamboo defects based on convolutional neural network, characterized in that: The method comprises the following steps: (1) Use a high-definition camera to collect high-resolution images of the flattened bamboo surface; (2) Preprocessing the collected flattened bamboo images; (3) Inputting the preprocessed image into a trained convolutional neural network, wherein the convolutional neural network is based on an improved ResNet-50 architecture, and the improved ResNet-50 architecture includes a multi-scale feature extraction module, a feature fusion layer, and a classification layer; (4) Automatically identifying surface defects of the flattened bamboo material by the convolutional neural network, wherein the surface defects of the flattened bamboo material include incomplete removal of green bamboo, incomplete removal of yellow bamboo, surface cracks and surface unevenness; (5) Locate and classify the identified defects and output the results to the automatic detection system.

2. The method for automatic flattened bamboo material defect detection based on convolutional neural network according to claim 1, characterized in that: The improved ResNet-50 architecture is first improved by introducing a residual learning unit, and then introducing an Inception module and a deep separable convolution for multi-scale feature extraction.

3. The method for automatically detecting flattened bamboo defects based on a convolutional neural network according to claim 1 or 2, characterized in that: In step (1), the image resolution is 1920×1080.

4. The method for automatically detecting flattened bamboo defects based on a convolutional neural network according to claim 1 or 2, characterized in that: The preprocessing includes graying, contrast enhancement, Retinex algorithm to enhance low brightness areas, noise removal and edge detection; The pre-processing step comprises: (1) Grayscale: Convert a color image into a grayscale image. The grayscale formula is: in, Y Represents the gray value, R , G , B are the pixel values ​​of the red, green, and blue channels respectively; (2) Contrast enhancement: The contrast between different areas in the image is improved by adjusting the dynamic range. The contrast is calculated as follows: in, Y′ is the enhanced gray value, L is the gray level, min( Y ) and max( Y ) are the minimum and maximum grayscale values ​​in the original image respectively; (3) The Retinex algorithm enhances the low brightness area. The calculation formula of the Retinex algorithm is as follows: in, R ( x,y ) is the enhanced pixel value, I ( x,y ) is the pixel value of the original image, G ( k,l ) is the Gaussian filter kernel, m and n Respectively represent the size of the kernel; The unclean areas of bamboo green and bamboo yellow removal usually have small color differences and low brightness. The Retinex algorithm can effectively enhance the visibility of these low-brightness areas; (4) Noise removal: To avoid noise interfering with the feature extraction process of the convolutional neural network, a filtering algorithm is used to remove high-frequency noise that may exist in the image. The calculation formula of the filtering algorithm is as follows: in, F ( x,y ) is the pixel value after filtering, I ( i,j ) is the neighborhood pixel value in the original image, K is the total number of pixels in the neighborhood; (5) Edge detection: The edge features in the image are marked by the Canny edge detection algorithm, especially the boundaries of cracks on the flattened bamboo surface. The calculation formula of the Canny edge detection algorithm is as follows: 1) Gaussian filtering to smooth the image: in G ( x,y ) is the smoothed pixel value, I ( x,y ) is the original pixel value, G σ ( x,y ) is a Gaussian kernel function, which is used to control the degree of filtering; 2) Calculate gradients: Identify strong edges in the image: in, G x , G y Represent the gradients in the horizontal and vertical directions respectively; 3) Gradient strength and direction: in, M is the gradient strength of the pixel; θ is the gradient direction of the pixel.

5. The method for automatic flattened bamboo material defect detection based on convolutional neural network according to claim 4, characterized in that: The multi-scale feature extraction module in the convolutional neural network is composed of multiple convolution kernels of different sizes, namely a large-size convolution kernel of 7×7, a medium-size convolution kernel of 5×5, and a small-size convolution kernel of 3×3. Each convolution kernel is responsible for extracting features of different scales, including: (1) Large-size convolution kernels are used to extract global texture information of bamboo green and bamboo yellow to remove unclean areas; (2) A medium-sized convolution kernel is used to extract the edge and crack features of the cracked area; (3) Small-sized convolution kernels are used to detect subtle fluctuations in the uneven surface of bamboo.

6. The method for automatic flattened bamboo material defect detection based on convolutional neural network according to claim 5, characterized in that: The feature fusion layer module of the convolutional neural network fuses multi-scale features through global average pooling, thereby focusing on both the global features and local details of the flattened bamboo and improving the accuracy of defect recognition.

7. The method for automatically detecting flattened bamboo defects based on a convolutional neural network according to claim 6, characterized in that: The detection of bamboo green and bamboo yellow removal is carried out by combining color histogram matching and convolutional neural network intermediate layer feature extraction. The steps include: (1) Use the color histogram to perform partition matching on the image and identify the color features of the bamboo green and bamboo yellow areas; (2) In the middle layer of the convolutional neural network, the residual area and distribution position of bamboo green and bamboo yellow are calculated through the feature map. The calculation formula is: 1) Calculation formula for the residual area of ​​the color region: in, A bq is the remaining area of ​​bamboo shoots, A bh is the residual area of ​​bamboo yellow, F ( x,y ) is the convolutional neural network feature map at position ( x,y ), R bq For Zhuqing area, R bh It is the Zhuhuang area; 2) Position distribution calculation formula: in,( X bq , Y bq ) is the centroid coordinate of the Zhuqing area, ( X bh , Y bh ) is the centroid coordinate of Zhuhuang area; 3) Comprehensive detection formula: in, w 1. w 2. w 3 is to adjust the parameters of each weight, which is set according to the experimental situation.

8. The method for automatic flattened bamboo material defect detection based on convolutional neural network according to claim 7, characterized in that: The detection of surface cracks is achieved by combining edge detection algorithm with feature extraction of convolutional neural network, specifically including: (1) Use the Canny edge detection algorithm to mark potential cracks in the image during the preprocessing stage; (2) Convolutional neural network extracts crack edge features and quantifies the length, width and density of the crack.

9. The method for automatic flattened bamboo material defect detection based on convolutional neural network according to claim 8, characterized in that: The surface unevenness detection is achieved by combining frequency domain analysis with convolutional neural network, and the specific steps are as follows: (1) Perform discrete Fourier transform on the image to convert the spatial fluctuation characteristics of the surface unevenness into frequency information; (2) The convolutional neural network extracts high-frequency features and identifies surface fluctuation areas, outputting quantitative data of roughness.

10. An automatic flattened bamboo defect detection system based on convolutional neural network, characterized in that: Used to perform the flattened bamboo material defect automatic detection method based on convolutional neural network according to any one of claims 1 to 9, the system comprising: An image acquisition module, used for acquiring a plurality of surface images of the flattened bamboo material; An image preprocessing module, used for performing image preprocessing on the plurality of surface images acquired by the image acquisition module, so as to improve the recognizability and feature extraction quality of the images, and provide higher quality input data for the convolutional neural network; Convolutional neural network module, used to extract multi-scale features from pre-processed images, identify and classify surface defects of flattened bamboo, including incomplete removal of green bamboo, incomplete removal of yellow bamboo, surface cracks and uneven areas, to enhance detection accuracy and robustness; The defect recognition module is used to further locate and classify the defect areas identified by the convolutional neural network module, convert the output of the convolutional neural network into specific defect types and locations, and accurately identify the types of defects; The result output module is used to output the analysis results of the defect identification module to the automatic detection system interface and generate defect location data and statistical reports.