Special foam surface defect classification detection method based on machine vision
By improving the GoogLeNet neural network model, the problems of high manual subjectivity and high model complexity in the existing PI foam surface defect identification methods are solved, fast and accurate foam surface defect detection is achieved, and detection efficiency and accuracy are improved.
Patent Information
- Application Number
- CN202411061340.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-05
- Publication Date
- 2024-08-30
AI Technical Summary
The existing surface defect identification methods of PI foam products require manual participation and are highly subjective, making it difficult to achieve rapid and accurate detection and classification. Moreover, the existing neural network model has a large number of parameters, high complexity, and poor real-time performance, making it difficult to meet the requirements in production. Fast and accurate detection requirements.
Improve the GoogLeNet neural network model by streamlining the convolutional layer, reducing the number of Inception blocks, introducing the efficient channel attention mechanism ECA-Net and Dropout layers, optimizing the model structure and parameter volume, improving calculation speed and robustness, and achieving fast and accurate Foam surface defect detection.
It achieves fast and accurate detection of foam surface defects, with detection accuracy reaching 98.24% and 98.25%, significantly reducing the number of model parameters, improving training and detection speed, and reducing over-fitting phenomena.
Smart Images

Figure CN118570571A
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of visual detection, and in particular to a special foam surface defect classification detection method based on machine vision. Background Art
[0002] Polyimide (PI) foam is a special foam material generated by the polymerization and foaming reaction of polyimide resin raw materials with foaming agents, foam stabilizers, etc. It belongs to aromatic heterocyclic polymers in synthetic polymer materials. This material has good heat resistance. In addition to high temperature resistance of 200~300℃, it also has good thermal oxidation resistance, insulation, flame retardancy, chemical stability, radiation resistance and low temperature resistance, etc., and is widely used in advanced manufacturing fields.
[0003] In actual production, the surface defects remaining in foam products are mainly pits and cracks. During the foaming process, the amide groups, imide bonds and other impurities in the raw materials are thermally decomposed and evaporated to produce bubbles, resulting in pore pits remaining on the finished foam; during the baking and curing process, due to the natural loss of heating equipment such as ovens and improper selection of heat treatment parameters, the temperature rises too fast or too slow during the baking and curing process, which can easily cause linear cracks in the foam and eventually lead to material failure.
[0004] At present, the existing methods for identifying surface defects of PI foam products mainly include manual visual inspection, image comparison and photography. The above methods require human participation in decision-making, and the classification judgment is highly subjective, and it is easy to have problems of missed detection and false detection in long-term detection tasks. At present, machine vision and neural network related technologies and methods have been widely used in the field of industrial inspection, but the existing neural network model has a large number of parameters, high model complexity, and poor real-time performance, which makes it difficult to achieve fast and accurate detection and classification requirements in production. For this reason, providing a foam surface defect classification detection method based on machine vision and neural network has become a technical problem that needs to be solved urgently in the relevant technical field. Summary of the invention
[0005] The purpose of the present invention is to propose a special foam surface defect classification detection method and system based on machine vision, by improving the existing traditional convolutional neural network model to achieve fast and accurate extraction of image texture features, so as to meet the requirements of classification, identification and detection of foam products with surface defects in production.
[0006] To achieve the above purpose, the technical solution adopted by the present invention is as follows: A method for classifying and detecting surface defects of special foams based on machine vision comprises the following steps: S1, collect original images of surface defects of special foams and construct training data sets; S2, preprocessing the original images in the training data set; S3, build an improved GoogLeNet neural network model, use the training data set to train the improved GoogLeNet neural network model, and generate a weight file; S4. Collect the image to be detected and input it into the trained improved GoogLeNet neural network model, and obtain the detection result based on the weight file.
[0007] Furthermore, in S1, an industrial camera is used as an image acquisition device to photograph the surface of the foam product to obtain an original image of the pit defect and an original image of the crack defect.
[0008] Furthermore, in S2, the preprocessing includes data augmentation and image size reduction.
[0009] Furthermore, the data augmentation and expansion includes flipping, translating, and contrast enhancement of the original image.
[0010] Furthermore, the image size is reduced by reducing the width and height of the image to one quarter of the original image.
[0011] Furthermore, the improved GoogLeNet neural network model includes an input layer, a 7×7 convolutional layer and a 3×3 maximum pooling layer, two Inception blocks, a 3×3 maximum pooling layer and ECA-Net1, an Inception block, a 3×3 maximum pooling layer and ECA-Net2, two Inception blocks and a global average pooling layer, a fully connected layer, a Dropout layer, and a classification layer.
[0012] The surface defects in the images involved in the present invention are small in size, so the traditional GoogLeNet neural network model is improved and its structure and parameters are optimized to achieve rapid and accurate detection and identification of foam surface defects. The specific improvements are as follows: The first three convolutional layers in the traditional GoogLeNet neural network model are simplified to a 7×7 convolutional layer, which reduces the number of parameters and improves the calculation speed of the model.
[0013] The number of Inception blocks in the traditional GoogLeNet neural network model was reduced from 9 to 5, and the number of input channels was regularized, doubling it from 64 to 512, reducing the redundancy of the model code and improving the calculation speed.
[0014] A Dropout layer is added before the classification layer. Through the Dropout operation, a random portion of neurons in the network are inactivated to improve the robustness of the model, reduce overfitting, and enhance its generalization ability.
[0015] Aiming at the problem that the defective texture information in the image is not obvious, based on the existing GoogLeNet neural network model, the present invention introduces an efficient channel attention mechanism ECA-Net, which can focus more on detecting important texture features in the image, suppress unimportant characteristic information, and improve the representation ability of the network.
[0016] Furthermore, both ECA-Net1 and ECA-Net2 include: a global average pooling layer, a one-dimensional convolutional layer of size k, and a Sigmoid function.
[0017] The working mechanism of ECA-Net1 and ECA-Net2 is as follows: the input feature map is globally averaged pooled to obtain a two-dimensional tensor, which contains information about the channel dimension; secondly, the two-dimensional tensor is processed through a one-dimensional convolutional layer of size k; then, the Sigmoid function is used as the activation function for normalization; finally, the channel weights in the training-generated weight file are applied to each channel of the original feature map in the training data set to enhance the extraction of important features.
[0018] Furthermore, the parameter of the Dropout layer is set to 0.5.
[0019] Compared with the prior art, the present invention has the following beneficial effects: (1) The present invention uses a training data set of pre-collected foam surface defect images to train on an improved GoogLeNet neural network model. The improved model is used for two types of surface defects, namely pits with an area share of more than 3% and cracks with an overall length of more than 70 mm. The detection accuracy rates are 98.24% and 98.25%, respectively, which meet the detection accuracy requirements of manufacturers.
[0020] (2) The number of parameters of the improved GoogLeNet neural network model in this invention is reduced from the original 5.9×10 6 reduced to 2.2×10 6 The number of parameters is reduced by nearly half, which significantly improves the training and detection speed of the model.
[0021] (3) The training results of the GoogLeNet neural network model improved by the present invention have little difference in the accuracy and loss value between training and verification. The verification accuracy and loss curve are better than those of other comparison models, and the overfitting phenomenon is significantly improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 The figure is a flow chart of the method of the present invention.
[0023] Figure 2This is a structural diagram of the improved GoogLeNet neural network model of the present invention.
[0024] Figure 3 This is a structural diagram of ECA-Net1 and ECA-Net2 of the present invention. DETAILED DESCRIPTION
[0025] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0026] like Figure 1 As shown, the present invention provides a special foam surface defect classification detection method based on machine vision, comprising the following steps: S1, collect original images of surface defects of special foams and construct training data sets; S2, preprocessing the original images in the training data set; S3, build an improved GoogLeNet neural network model, use the training data set to train the improved GoogLeNet neural network model, and generate a weight file; S4. Collect the image to be detected and input it into the trained improved GoogLeNet neural network model, and obtain the detection result based on the weight file.
[0027] The surface defects in the images involved in the present invention are small in size, so the traditional GoogLeNet neural network model is improved and its structure and parameters are optimized to achieve rapid and accurate detection and identification of foam surface defects. Figure 2 As shown, the improved GoogLeNet neural network model includes an input layer, a 7×7 convolutional layer and a 3×3 maximum pooling layer, two Inception blocks, a 3×3 maximum pooling layer and ECA-Net1, an Inception block, a 3×3 maximum pooling layer and ECA-Net2, two Inception blocks and a global average pooling layer, a fully connected layer, a Dropout layer, and a classification layer.
[0028] The present invention simplifies the first three convolutional layers in the traditional GoogLeNet neural network model into a 7×7 convolutional layer, reduces the number of parameters, and improves the calculation speed of the model; reduces the number of Inception blocks in the traditional GoogLeNet neural network model from 9 to 5, and regularizes the number of input channels therein, doubling it from 64 to 512 in sequence, reducing the redundancy of the model code and improving the calculation speed; adds a Dropout layer before the classification layer, and inactivates a random part of neurons in the network through the Dropout operation, thereby improving the robustness of the model, reducing overfitting, and enhancing its generalization ability.
[0029] Aiming at the problem that the defective texture information in the image is not obvious, based on the existing GoogLeNet neural network model, the present invention introduces an efficient channel attention mechanism ECA-Net, which can focus more on the important texture features in the detected image, suppress unimportant characteristic information, and improve the representation ability of the network. Figure 3 As shown, both ECA-Net1 and ECA-Net2 include: a global average pooling layer, a one-dimensional convolutional layer of size k, and a Sigmoid function.
[0030] The working mechanism of ECA-Net1 and ECA-Net2 is as follows: the input feature map is globally averaged pooled to obtain a two-dimensional tensor, which contains information about the channel dimension; secondly, the two-dimensional tensor is processed through a one-dimensional convolutional layer of size k; then, the Sigmoid function is used as the activation function for normalization; finally, the channel weights in the training-generated weight file are applied to each channel of the original feature map in the training data set to enhance the extraction of important features.
[0031] The improved GoogLeNet neural network model of the present invention is compared with VGG16, AlexNet, and traditional GoogLeNet neural network models. The results are shown in Table 1 below. Table 1 is a data comparison table of the present invention and existing neural networks.
[0032] Table 1 Data comparison table of the present invention and existing neural network
[0033] The training results of the GoogLeNet neural network model improved by the present invention have a small difference in accuracy and loss value between the training set and the validation set, the accuracy and loss curve of the validation set are better than those of other comparison models, and the overfitting phenomenon is significantly improved.
[0034] In this example, a part of samples with surface defects were extracted from the same batch of products of a special foam production enterprise, and the surface of the foam products was photographed using an industrial camera as an image acquisition device to obtain original images of surface defects of the special foam and construct a data set. Among them, 142 original images of pit defects and 143 original images of crack defects were obtained, for a total of 285 images.
[0035] Then, the original images captured are preprocessed. Since the original images that can be obtained are limited, in order to ensure that the neural network model obtains a good training effect, the original images need to be augmented and expanded first. Specifically, the original image data set is expanded to 10 times the original size, totaling 2850 images, through data augmentation methods such as flipping, translation, and contrast enhancement. At the same time, since the size of the original image directly captured by the industrial camera is 3072×2048 pixels, the original size of the image is too large. Directly transmitting it to the model for training will cause the amount of calculation in the training process to become very large, and the training speed is too slow. Therefore, the width and height of the original image size are first reduced to one-fourth of the original, that is, the image size is reduced to 768×512 pixels. Using the reduced image data for training can ensure that the feature information loss is small, while greatly improving the speed of model training and reducing the time cost of detection.
[0036] Secondly, the improved GoogLeNet neural network model is used to train the preprocessed images and generate the corresponding detection weight files.
[0037] Finally, the image to be detected is captured by the detection image acquisition device, and the image to be detected is preprocessed and then input into the trained improved GoogLeNet neural network model. The corresponding calculation is performed according to the channel weights in the weight file obtained by previous training, and the image to be detected is predicted. According to whether the detected image belongs to the category of pits or cracks, its detection classification result is output.
[0038] The present invention applies machine vision technology to the task of classifying and detecting surface defects of special foams, eliminating the need for human involvement in decision-making and significantly improving detection efficiency and accuracy. The detection method of the present invention can classify and identify two types of surface defects, pits and cracks, at the same time, without the need to develop a detection algorithm for a single type of defect, thereby reducing the workload of defect detection classification and improving the efficiency of classification detection. The detection method of the present invention has certain scalability, and can be based on products of different sizes and specifications with defects in subsequent actual production, and new defect sample images can be captured to further enrich the defect image data set, and the detection model can be trained and strengthened to adapt to defect detection tasks for different types of products.
[0039] Finally, it should be noted that the above embodiments are only preferred embodiments of the present invention to illustrate the technical solutions of the present invention, rather than limiting them, and certainly not limiting the patent scope of the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. These modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present invention. In other words, any changes or modifications made to the main design concept and spirit of the present invention that have no substantive significance, and the technical problems they solve are still consistent with the present invention, should be included in the protection scope of the present invention. In addition, the direct or indirect application of the technical solutions of the present invention in other related technical fields is also included in the patent protection scope of the present invention.
Claims
1. A method for classifying and detecting surface defects of special foams based on machine vision, characterized in that: The following steps are involved: S1, collect original images of surface defects of special foams and construct training data sets; S2, preprocessing the original images in the training data set; S3, build an improved GoogLeNet neural network model, use the training data set to train the improved GoogLeNet neural network model, and generate a weight file; S4. Collect the image to be detected and input it into the trained improved GoogLeNet neural network model, and obtain the detection result based on the weight file.
2. The method for classifying and detecting surface defects of special foams based on machine vision according to claim 1, characterized in that: In S1, an industrial camera is used as an image acquisition device to photograph the surface of the foam product to obtain an original image of the pit defect and an original image of the crack defect.
3. The method for classifying and detecting surface defects of special foams based on machine vision according to claim 1, characterized in that: In S2, the preprocessing includes data augmentation and image size reduction.
4. The method for classifying and detecting surface defects of special foams based on machine vision according to claim 3, characterized in that: The data augmentation and expansion includes flipping, translating, and contrast enhancement of the original image.
5. The method for classifying and detecting surface defects of special foams based on machine vision according to claim 3, characterized in that: The image size is reduced by reducing the width and height of the image to one quarter of the original image.
6. The method for classifying and detecting surface defects of special foams based on machine vision according to claim 1, characterized in that: The improved GoogLeNet neural network model includes an input layer, a 7×7 convolutional layer and a 3×3 maximum pooling layer, two Inception blocks, a 3×3 maximum pooling layer and ECA-Net1, an Inception block, a 3×3 maximum pooling layer and ECA-Net2, two Inception blocks and a global average pooling layer, a fully connected layer, a Dropout layer, and a classification layer.
7. The method for classifying and detecting surface defects of special foams based on machine vision according to claim 6, characterized in that: The ECA-Net1 and ECA-Net2 both include: a global average pooling layer, a one-dimensional convolutional layer with a size of k, and a Sigmoid function.
8. The method for classifying and detecting surface defects of special foams based on machine vision according to claim 6, characterized in that: The parameter of the Dropout layer is set to 0.5.
Citation Information
Patent Citations
A fruit image classification method and device based on a neural network and transfer learning
CN109272045A
Cited By
Macromolecular foam product defect detection method and system based on machine vision
CN121032957A
A method and system for detecting defects in a polymer foam product based on machine vision
CN121032957B
