Hose tail appearance defect detection method based on deep learning

Through the deep learning-based hose tail appearance defect detection method, the data preprocessing and improved MobileNetSSD model are used to solve the problems of missed detection and missed generalization capabilities of existing detection methods, achieving high accuracy and reliance Rod-type hose tail defect detection, suitable for defect detection in hose packaging.

CN119205709APending Publication Date: 2024-12-27THE 41ST INST OF CHINA ELECTRONICS TECH GRP
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411368838.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-29
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

The existing hose tail defect detection methods have problems of missed detection and missed detection due to manual detection and poor generalization capabilities of traditional industrial image processing algorithms, which cannot meet the strict quality requirements of the hose filling industry.

Method used

Using deep learning-based hose tail appearance defect detection method, images are collected through industrial cameras, data preprocessing technology is used to augment data. Based on Pytorch and the improved MobileNetSSD convolutional neural network, the detection model is trained and the loss function is modified for weighted processing. Positive and negative samples are generated, deep learning detection models are used to identify hose tail defects in real time.

Benefits of technology

It improves the accuracy and robustness of detection, reduces costs, enhances production efficiency, and expands the application scenarios of deep learning models, suitable for defect detection of various hose packaging categories.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119205709A_ABST
    Figure CN119205709A_ABST
Patent Text Reader

Abstract

The invention discloses a hose tail appearance defect detection method based on deep learning, and belongs to the technical field of hose tail appearance defect detection. Online detection and classification of hose tail appearance defects are completed through the deep learning technology, and a hose tail appearance defect detection model is called locally; and collecting appearance images of the tails of the hoses to be detected in real time, and identifying and classifying appearance defects of the tails of the hoses. Compared with a traditional algorithm, the hose tail appearance defect online detection algorithm based on the deep learning technology is high in detection efficiency, excellent in accuracy, good in robustness and high in generalization; meanwhile, limited GPU hardware resources can be fully utilized, and various application scenes of the deep learning model are expanded.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of machine vision technology, and more specifically, to a method for detecting appearance defects at the tail of a hose based on deep learning. Background Art

[0002] As packaging hoses are easy to carry, easy to produce, and recyclable, they are used in the pharmaceutical, food, and daily chemical industries for product packaging. In addition, with the development of science and technology, the division of labor in society has become increasingly specialized, and packaging hoses have been processed and produced by specialized packaging companies and then distributed to various customers.

[0003] During the production process, packaging hoses often have wrinkles, deformation, indentations and other defects on the hose tail due to some external factors. This not only affects the product quality, but also damages the company's reputation. Therefore, the hose filling industry has increasingly stringent quality requirements for hose products. At present, there are two main ways to detect the quality of hose products on the market: one is to use manual sampling. This detection method has obvious defects. On the one hand, due to visual fatigue of the human eye after long-term work, there will inevitably be missed detection and false detection. On the other hand, the manual sampling method has the problems of limited detection quantity and low efficiency; the second is to use traditional industrial image defect detection algorithms. This detection method requires prior knowledge. On the one hand, it is necessary to manually debug the detection tool and set the upper and lower limit thresholds according to personal work experience. If the threshold is set too large, missed detection will occur, and if the threshold is set too small, false detection will occur. On the other hand, due to the poor generalization ability of traditional image processing algorithms, with the emergence of new defects in industrial products, the subsequent maintenance costs will increase significantly. Based on the above analysis: the quality detection method of hose packaging products on the existing market cannot meet the increasingly stringent quality requirements of the hose filling industry.

[0004] Currently, deep learning technology has become the mainstream in the field of computer vision. By applying deep learning technology to defect detection algorithms, it not only solves the limitations of current algorithms, but also solves related problems of industrial product defect detection and classification, improves the accuracy of industrial product detection, reduces costs, and improves production efficiency.

[0005] Therefore, a hose tail appearance defect detection method based on deep learning is desired. Summary of the invention

[0006] In order to solve the above technical problems, this application is proposed. The embodiment of this application provides a method for detecting appearance defects of hose tail based on deep learning, which is used to detect whether there are appearance defects such as wrinkles, tail cutting, indentation, and paste leakage at the tail of the packaging hose after filling the paste.

[0007] According to one aspect of the present application, a method for detecting appearance defects of a hose tail based on deep learning is provided, which includes: S1, collecting hose tail images through an industrial camera; S2, using data preprocessing technology, using foreign matter enhancement software and a defect sample database to perform offline augmentation on the collected hose tail images, and expanding the amount of defect sample data; S3, using the enhanced defect sample data, based on the Pytorch deep learning framework and the improved MobileNetSSD convolutional neural network to train a hose tail appearance defect detection model, and generate a deep learning hose tail appearance defect detection model file; in step S3, by modifying the loss function, changing the label allocation method in the original loss function, and selecting different loss functions for different positive and negative samples, wherein the classification loss and regression loss of the positive sample are weighted summed as the training loss; and for the negative sample, only the classification loss is used as the training loss; S4, the inference software loads the deep learning hose tail defect detection model file and the preset defect category file, and performs real-time judgment on whether the hose tail appearance has defects on the hose tail image to be detected collected by the industrial camera.

[0008] In the above-mentioned hose tail appearance defect detection method based on deep learning, the step S2 includes: S21, adaptively selecting a pre-annotated defect xml format folder; S22, obtaining the corresponding defect foreground image annotated in the xml format folder; S23, adaptively selecting the background image that needs to enhance the defect; S24, selecting the acquired defect foreground image; S25, attaching the acquired defect data to the acquired background image by randomly enlarging, reducing, horizontally, vertically, and flipping it, and custom renaming it.

[0009] In the above-mentioned hose tail appearance defect detection method based on deep learning, in the step S3, the model construction process includes: S31, introducing the packages required for deep learning, building a MobileNetSSD convolutional neural network, loading the MobileNetSSD pre-trained model weights, introducing a label allocation loss function based on an optimization strategy, and allowing the network to learn the optimal label allocation method by minimizing the loss function; S32, automatically selecting the number of anchor boxes corresponding to each true label through the network; S33, using the SGD optimizer for fine-tuning, and then starting training by dynamically adjusting parameters such as the learning rate.

[0010] In the above-mentioned hose tail appearance defect detection method based on deep learning, the step S31, the label assignment loss function based on the optimization strategy, is used to define the positive and negative attributes of each anchor box anchor in the training process, and assign strategies to each learning objective. The true label GroundTruth is regarded as the label supplier, and the anchor is regarded as the label demander. For positive samples, the weighted sum of the classification loss and the regression loss is used as the transmission loss; and for negative samples, the classification loss is regarded as the transmission loss.

[0011] In the above-mentioned hose tail appearance defect detection method based on deep learning, the step S4 completes the local online detection of the deep learning hose tail appearance defect detection model, including: S411, converting the generated pt format model into an onnx format model supported by the inference software; S412, the inference software introduces the deep learning dynamic link library; S413, reading the defect category file, loading the onnx format model, converting the image into a tensor, executing network inference, and judging in real time whether there is a defect in the appearance of the hose tail.

[0012] In the above-mentioned hose tail appearance defect detection method based on deep learning, the step S4 completes the deep learning hose tail appearance defect detection, including: S421, the reasoning software reads the defect category file and the hose tail appearance defect detection model file, and judges whether the incoming hose tail appearance image has defects; S422, the user uploads the image data, the reasoning software performs reasoning, and judges in real time whether there are defects in the appearance of the hose tail.

[0013] In the above-mentioned method for detecting appearance defects of the hose tail based on deep learning, the step S1 is used to: collect a total of 400 sample image data of the hose tail, including 100 each of leakage, tail cutting, indentation, and wrinkle deformation.

[0014] According to one aspect of the present application, a hose tail appearance defect detection system based on deep learning is also provided, characterized in that it includes: an image acquisition module for acquiring hose tail images through an industrial camera; an image processing module for using data preprocessing technology to perform offline augmentation on the acquired hose tail images using foreign matter enhancement software and a defect sample database to expand the amount of defect sample data; a training image module for using the enhanced defect sample data to train a hose tail appearance defect detection model based on the Pytorch deep learning framework and an improved MobileNetSSD convolutional neural network to generate a deep learning hose tail appearance defect detection model file; the improved MobileNetSSD convolutional neural network is used to change the label allocation method in the original loss function by modifying the loss function. Different loss functions are selected for different positive and negative samples. Among them, the weighted sum of the classification loss and regression loss of the positive samples is used as the training loss; for the negative samples, only the classification loss is used as the training loss; the classification module is used to load the deep learning hose tail defect detection model file and the preset defect category file through the inference software, and to perform real-time judgment on whether there are defects in the appearance of the hose tail to be inspected collected by the industrial camera.

[0015] In the above-mentioned hose tail appearance defect detection system based on deep learning, the image processing module includes: a file selection unit, which is used to adaptively select a pre-marked defect XML format folder; a foreground image unit, which is used to obtain the corresponding defect foreground image marked in the XML format folder; a background image unit, which is used to adaptively select the background image that needs to enhance the defect; an image acquisition unit, which is used to select the acquired defect foreground image; a renaming unit, which is used to attach the acquired defect data to the acquired background image and customize the renaming by randomly enlarging, reducing, horizontally, vertically, and flipping the acquired defect data.

[0016] In the above-mentioned hose tail appearance defect detection system based on deep learning, the training image module includes: building a weight unit, which is used to introduce the packages required for deep learning, build a MobileNetSSD convolutional neural network, load the MobileNetSSD pre-trained model weights, introduce a label allocation loss function based on an optimization strategy, and let the network learn the optimal label allocation method by minimizing the loss function; a unit for selecting the number of anchor frames, which is used to automatically select the number of anchor frames corresponding to each real label through the network; a unit for dynamically adjusting the learning rate, which is used to use the SGD optimizer for fine-tuning, and then start training by dynamically adjusting parameters such as the learning rate.

[0017] Beneficial technical effects brought by the present invention:

[0018] By adopting data preprocessing technology, the collected hose tail appearance images are augmented with foreign body defect offline enhancement software and defect sample database, the sample data volume is expanded, and model iterative training is performed to solve the overfitting phenomenon caused by insufficient data volume; a hose tail appearance defect detection algorithm based on deep learning technology is adopted, which has good robustness, high accuracy and strong generalization compared with traditional algorithms; at the same time, it can make full use of limited GPU hardware resources and expand various application scenarios of deep learning models; based on the present invention, a defect detection device suitable for various hose packaging types can be developed, which has good portability and broad application scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] By describing the embodiments of the present application in more detail in conjunction with the accompanying drawings, the above and other purposes, features and advantages of the present application will become more apparent. The accompanying drawings are used to provide a further understanding of the embodiments of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the present application and do not constitute a limitation of the present application. In the accompanying drawings, the same reference numerals generally represent the same components or steps.

[0020] Figure 1 This is a flow chart of a method for detecting appearance defects at the tail of a hose based on deep learning according to an embodiment of the present application.

[0021] Figure 2 Schematic diagram of a convolutional neural network used in deep learning in a method for detecting appearance defects at the tail of a hose based on deep learning according to an embodiment of the present application.

[0022] Figure 3 The present invention is a schematic diagram of the process of creating a deep learning model in the hose tail appearance defect detection method based on deep learning according to an embodiment of the present application.

[0023] Figure 4 This is a curve chart of the accuracy of the deep learning training process in the hose tail appearance defect detection method based on deep learning according to an embodiment of the present application.

[0024] Figure 5 This is a loss function curve diagram of the deep learning training process in the hose tail appearance defect detection method based on deep learning according to an embodiment of the present application.

[0025] Figure 6 Schematic diagram of the local online detection steps of the deep learning model in the hose tail appearance defect detection method based on deep learning according to an embodiment of the present application.

[0026] Figure 7 This is a graph of local online detection results of the deep learning model in the hose tail appearance defect detection method based on deep learning according to an embodiment of the present application.

[0027] Figure 8 It is a block diagram of a hose tail appearance defect detection system based on deep learning according to an embodiment of the present application. DETAILED DESCRIPTION

[0028] Various exemplary embodiments, features and aspects of the present application will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise specified.

[0029] The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.

[0030] In addition, in order to better illustrate the present application, numerous specific details are given in the following specific embodiments. It should be understood by those skilled in the art that the present application can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present application.

[0031] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this application, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.

[0032] The present invention is further described in detail below with reference to the accompanying drawings and specific implementation methods:

[0033] In the technical solution of the present application, a method for detecting appearance defects at the tail of a hose based on deep learning is proposed, and the detection and classification of appearance defects at the tail of the hose are completed through deep learning technology. Figure 1 FIG. 1 is a flow chart of a method for detecting appearance defects of a hose tail based on deep learning according to an embodiment of the present application. Figure 1As shown, according to the embodiment of the present application, the hose tail appearance defect detection method based on deep learning includes the following steps: S1, collecting hose tail images through an industrial camera; S2, using data preprocessing technology, the collected hose tail images are offline augmented using foreign matter enhancement software and defect sample database to expand the defect sample data volume; S3, using the enhanced defect sample data, based on the Pytorch deep learning framework and the improved MobileNetSSD convolutional neural network to train the hose tail appearance defect detection model, and generate a deep learning hose tail appearance defect detection model file; the step S3, by modifying the loss function, changing the label allocation method in the original loss function, and selecting different loss functions for different positive and negative samples, wherein the classification loss and regression loss of the positive sample are weighted summed as the training loss; and for the negative sample, only the classification loss is used as the training loss; S4, the inference software loads the deep learning hose tail defect detection model file and the preset defect category file, and performs real-time judgment on whether the hose tail appearance has defects for the hose tail image to be detected collected by the industrial camera.

[0034] In the embodiment of the present application, the step S1 is to collect the image of the tail of the hose by an industrial camera. It should be understood that industrial cameras usually have the characteristics of high definition and high resolution, and can capture the tiny details and potential defects of the tail of the hose, which is crucial for subsequent image analysis and defect detection. At the same time, the industrial camera can repeatedly take images under the same conditions to ensure the consistency of image acquisition, which is necessary for establishing a reliable detection model and accurate defect identification. Specifically, a total of 400 sample data of appearance defects of the tail of the hose were collected (including 100 each of leakage, tail cutting, indentation, and wrinkle deformation).

[0035] In the embodiment of the present application, the step S2 adopts data preprocessing technology to perform offline augmentation on the collected hose tail image using foreign body enhancement software and defect sample database to expand the defect sample data volume. It should be understood that through data augmentation, more possible defects of the hose tail can be simulated, which helps to improve the generalization ability of the model in practical applications, so that it can identify various defects. Data augmentation can enhance the adaptability of the model to these changes by simulating different conditions such as lighting, angles and backgrounds, thereby improving the robustness of the model. Accordingly, using foreign body enhancement software and defect sample database, using digital image preprocessing technology, the collected hose tail appearance image is offline augmented. The basic principle of the foreign body enhancement software is: target extraction is performed on the target box xml file annotated by LabelImg, the defects are randomly scaled, rotated, offset, etc., attached to the positive sample, and the enhanced simulated defects are batch renamed to achieve the purpose of expanding the defect data set. The main function of the foreign body enhancement software is: for the imbalance of positive and negative samples, especially the situation where there are few negative samples of foreign body defects on site, the foreign body enhancement software can quickly complete the training, testing and deployment of defect detection models by simulating defect negative samples, thereby improving work efficiency and reducing working time.

[0036] After the enhancement, the sample data volume is divided into a training set and a test set in a ratio of 8:2, and then the hose tail appearance defect detection model is trained. Through this offline data enhancement method, the accuracy and generalization of the hose tail appearance defect detection model can be improved.

[0037] Specifically, in one embodiment of the present application, the step S2 includes: S21, adaptively selecting a pre-annotated defect xml format folder; S22, obtaining the corresponding defect foreground image annotated in the xml format folder; S23, adaptively selecting the background image that needs to enhance the defect; S24, selecting the acquired defect foreground image; S25, attaching the acquired defect data to the acquired background image by randomly enlarging, reducing, horizontally, vertically, and flipping it, and custom renaming it.

[0038] In the embodiment of the present application, the step S3 uses the enhanced defect sample data to train the hose tail appearance defect detection model based on the Pytorch deep learning framework and the improved MobileNetSSD convolutional neural network to generate a deep learning hose tail appearance defect detection model file. By modifying the loss function, changing the label allocation method in the original loss function, different loss functions are selected for different positive and negative samples, where the classification loss and regression loss of the positive sample are weighted summed as the training loss; and for negative samples, only the classification loss is used as the training loss;

[0039] Specifically, in one embodiment of the present application, in step S3, the model building process includes: S31, introducing the packages required for deep learning, building a MobileNetSSD convolutional neural network, loading the MobileNetSSD pre-trained model weights, introducing a label assignment loss function based on an optimization strategy, and allowing the network to learn the optimal label assignment method by minimizing the loss function; S32, automatically selecting the number of anchor boxes corresponding to each true label through the network; S33, using the SGD optimizer for fine-tuning, and then starting training by dynamically adjusting parameters such as the learning rate.

[0040] Correspondingly, in step S31, the label assignment loss function based on the optimization strategy is used to define the positive and negative attributes of each anchor box (anchor) in the training process, assign strategies to each learning objective, regard the true label (GroundTruth) as the label supplier, and the anchor as the label demander, and perform corresponding processing on the losses of different samples. For positive samples, the weighted sum of classification loss and regression loss is used as the transmission loss, and for negative samples, the classification loss is regarded as the transmission loss.

[0041] It should be understood that the necessary modules in deep learning frameworks such as PyTorch, such as torch, torchvision, etc. are imported, which contain the basic tools required for building networks, data processing and training. Use frameworks such as PyTorch to build a MobileNetSSD network. MobileNetSSD is a lightweight deep learning model that combines the characteristics of MobileNet and SSD (Single Shot MultiBox Detector) and is suitable for efficient object detection on resource-constrained devices. Load the weights of the MobileNetSSD model pre-trained on large datasets such as ImageNet. This can help the model leverage features learned on other visual tasks, speed up the training process and improve the initial performance of the model. Develop or introduce a new loss function for optimizing the label assignment of the model during training. This loss function can help the model learn more effectively how to assign the correct labels to different anchor boxes, thereby improving detection accuracy. In traditional object detection models, the matching between anchor boxes and true boxes usually requires manual setting of thresholds. In this step, the model is designed to automatically select the number of anchor boxes corresponding to each true label, reducing manual intervention and improving the automation of training. This method can also better handle those anchor boxes that are difficult to clearly assign to a specific category, that is, ambiguous anchor boxes, thereby improving the model's processing effect on these anchor boxes. Stochastic gradient descent (SGD) is selected as the optimizer to fine-tune the model. SGD is a commonly used optimization algorithm that trains the model by adjusting weights to minimize the loss function. During the training process, the learning rate and other hyperparameters are dynamically adjusted according to the performance of the model. This strategy can help the model learn at different speeds at different stages of training. Usually, a higher learning rate is used in the early stage of training to converge quickly, and the learning rate is reduced in the later stage to refine the model weights and avoid overfitting.

[0042] Accordingly, based on the Pytorch deep learning framework and the improved MobileNetSSD convolutional neural network, after loading the dataset, the MobileNetSSD network automatically extracts the hose tail appearance image features and learns through transfer learning. Figure 2 As shown in Figure 1, it includes input layer, hidden layer, output layer, etc. The training model process is as follows: Figure 3 As shown in the figure: Introduce the packages required for deep learning, build the MobileNetSSD lightweight convolutional neural network, load the MobileNetSSD pre-trained weights, add the confidence loss function, label assignment loss function, etc., use the SGD optimizer for fine-tuning, and then start training by dynamically adjusting parameters such as the learning rate. After the training is completed, generate a curve chart of the accuracy and loss rate of the data set, as shown in the figure below: Figure 4 , Figure 5 As shown. Among them, Figure 4 The horizontal axis represents the model confidence, and the vertical axis represents the model accuracy. As the number of iterations increases, the model accuracy gradually increases until it approaches 1. Figure 5 The horizontal axis of the loss curve (6 pictures on the left) represents the number of iterations during model training, and the vertical axis represents the model loss rate. As the number of iterations increases, the model loss rate gradually decreases until it reaches 0. Figure 5 The horizontal axis of the accuracy curve (the four figures on the right) represents the number of iterations during model training, and the vertical axis represents the model accuracy. As the number of iterations increases, the model accuracy gradually increases until it approaches 1.

[0043] In the embodiment of the present application, in step S4, the reasoning software loads the deep learning hose tail defect detection model file and the preset defect category file, and performs real-time judgment on whether there is a defect in the appearance of the hose tail for the image of the hose tail to be detected collected by the industrial camera. It should be understood that by loading the model file, the reasoning software can perform real-time analysis on the collected image, quickly judge whether there is a defect at the hose tail, and the type and location of the defect. The real-time judgment result can be immediately fed back to the production process, helping to timely discover and eliminate defective products, thereby ensuring product quality and reducing the risk of defective products entering the market.

[0044] Specifically, in one embodiment of the present application, the step S4 completes the local online detection of the deep learning hose tail appearance defect detection model, including: S411, converting the generated pt format model into an onnx format model supported by the inference software; S412, the inference software introduces the necessary deep learning dynamic link library; S413, reading the defect category file, loading the onnx format model, converting the image into a tensor, executing network inference, and judging in real time whether there is a defect in the appearance of the hose tail.

[0045] Further, in one embodiment of the present application, the step S4 completes the deep learning hose tail appearance defect detection, including: S421, the reasoning software reads the defect category file and the hose tail appearance defect detection model file, and judges whether the incoming hose tail appearance image has defects; S422, the user uploads the image data, the reasoning software performs reasoning, and judges in real time whether there are defects in the appearance of the hose tail.

[0046] Accordingly, if Figure 6The figure shows a schematic diagram of the model detection application after deep learning training. First, the generated pt format model is converted into an onnx format model supported by the inference software; then the inference software introduces the necessary deep learning dynamic link library; then the defect category file is read, the onnx format model is loaded, the image is converted into a tensor, and network inference is performed to determine in real time whether there are defects such as wrinkles, deformation, indentation, tail cutting, and paste leakage on the appearance of the hose tail.

[0047] Through the above step 4, the appearance defect detection of the hose tail is realized, which expands the application scenario of the deep learning model. In addition, the specific contents of the defect category file include: leakage, strip, indentation, and wrinkle deformation. Figure 7 As shown: (a) and (b) are the results of paste leakage defect detection; (c) and (d) are the results of tail cutting defect detection; (e) and (f) are the results of indentation defect detection; (g) and (h) are the results of wrinkle deformation defect detection.

[0048] In summary, based on the deep learning-based hose tail appearance defect detection method of the embodiment of the present application, the method adopts data preprocessing technology to perform data augmentation on the collected hose tail appearance image, uses foreign body defect offline enhancement software and defect sample database, expands the sample data volume, and performs model iterative training to solve the overfitting phenomenon caused by insufficient data volume; the hose tail appearance defect detection algorithm based on deep learning technology has good robustness, high accuracy and strong generalization compared with traditional algorithms; at the same time, it can make full use of limited GPU hardware resources and expand various application scenarios of deep learning models; based on the present invention, a defect detection device suitable for various hose packaging types can be developed, which has good portability and broad application scenarios.

[0049] further, Figure 8 FIG. 1 is a block diagram of a hose tail appearance defect detection system based on deep learning according to an embodiment of the present application. Figure 8As shown, according to the embodiment of the present application, the hose tail appearance defect detection system 100 based on deep learning includes: an image acquisition module 110, which is used to acquire hose tail images through an industrial camera; an image processing module 120, which is used to adopt data preprocessing technology to perform offline augmentation on the acquired hose tail images using foreign matter enhancement software and a defect sample database to expand the amount of defect sample data; a training image module 130, which is used to use the enhanced defect sample data to train a hose tail appearance defect detection model based on the Pytorch deep learning framework and the improved MobileNetSSD convolutional neural network to generate a deep learning hose tail appearance defect detection model file; a classification module 140, which is used to load the deep learning hose tail defect detection model file and the preset defect category file through the inference software, and to perform real-time judgment on whether there is a defect in the appearance of the hose tail for the hose tail image to be detected acquired by the industrial camera.

[0050] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.

Claims

1. A hose tail appearance defect detection method based on deep learning, characterized in that: include: S1, collects the image of the hose tail through an industrial camera; S2, using data preprocessing technology, the collected hose tail image is augmented offline using foreign matter enhancement software and defect sample database to expand the defect sample data volume; S3, using the enhanced defect sample data, based on the Pytorch deep learning framework and the improved MobileNetSSD convolutional neural network, trains the hose tail appearance defect detection model to generate a deep learning hose tail appearance defect detection model file; In step S3, the loss function is modified to change the label allocation method in the original loss function, and different loss functions are selected for different positive and negative samples, wherein the classification loss and regression loss of the positive sample are weighted summed as the training loss; and for the negative sample, only the classification loss is used as the training loss; S4, the inference software loads the deep learning hose tail defect detection model file and the preset defect category file, and performs real-time judgment on whether there are defects in the appearance of the hose tail collected by the industrial camera.

2. The hose tail appearance defect detection method based on deep learning according to claim 1 is characterized in that: The step S2 comprises: S21, adaptively select a pre-annotated defect XML format folder; S22, obtaining the corresponding defect foreground image marked in the XML format folder; S23, adaptively select the background image that needs to enhance defects; S24, selecting the acquired defect foreground image; S25, randomly enlarging, reducing, horizontally, vertically, and flipping the acquired defect data, attaching them to the acquired background image, and renaming them by custom.

3. The hose tail appearance defect detection method based on deep learning according to claim 1 or 2, characterized in that: In step S3, the model building process includes: S31, introduces the packages required for deep learning, builds the MobileNetSSD convolutional neural network, loads the MobileNetSSD pre-trained model weights, introduces the label assignment loss function based on the optimization strategy, and allows the network to learn the optimal label assignment method by minimizing the loss function; S32, automatically selects the number of anchor boxes corresponding to each true label through the network; S33, fine-tuning is performed using the SGD optimizer, and then training is started by dynamically adjusting parameters such as the learning rate.

4. The hose tail appearance defect detection method based on deep learning according to claim 3 is characterized in that: In step S31, the label assignment loss function based on the optimization strategy is used to define the positive and negative attributes of each anchor box anchor in the training process, assign strategies to each learning objective, regard the true label GroundTruth as the label supplier, and the anchor as the label demander. For positive samples, the weighted sum of the classification loss and the regression loss is used as the transmission loss; and for negative samples, the classification loss is regarded as the transmission loss.

5. The hose tail appearance defect detection method based on deep learning according to claim 4 is characterized in that: The step S4, completing the local online detection of the deep learning hose tail appearance defect detection model, includes: S411, converting the generated pt format model into an onnx format model supported by the inference software; S412, the inference software introduces the deep learning dynamic link library; S413, reads the defect category file, loads the onnx format model, converts the image into a tensor, performs network inference, and determines in real time whether there is a defect in the appearance of the hose tail.

6. The hose tail appearance defect detection method based on deep learning according to claim 5 is characterized in that: The step S4, completing the deep learning hose tail appearance defect detection, includes: S421, the reasoning software reads the defect category file and the hose tail appearance defect detection model file, and determines whether there are defects on the input hose tail appearance image; S422, the user uploads the image data, and the reasoning software performs reasoning to determine in real time whether there are defects in the appearance of the hose tail.

7. The hose tail appearance defect detection method based on deep learning according to claim 1 is characterized in that: The step S1 is used to collect 400 sample images of the hose tail, including 100 each of leakage, tail cutting, indentation and wrinkle deformation.

8. A hose tail appearance defect detection system based on deep learning, characterized in that: include: An image acquisition module is used to acquire an image of the hose tail through an industrial camera; The image processing module is used to adopt data preprocessing technology to perform offline augmentation on the collected hose tail image using foreign matter enhancement software and defect sample database to expand the defect sample data volume; The training image module is used to use the enhanced defect sample data to train the hose tail appearance defect detection model based on the Pytorch deep learning framework and the improved MobileNetSSD convolutional neural network, and generate a deep learning hose tail appearance defect detection model file; The improved MobileNetSSD convolutional neural network is used to change the label allocation method in the original loss function by modifying the loss function. Different loss functions are used for different positive and negative samples. The weighted sum of the classification loss and regression loss of the positive sample is used as the training loss; while for the negative sample, only the classification loss is used as the training loss; The classification module is used to load the deep learning hose tail defect detection model file and the preset defect category file through the inference software, and to judge in real time whether there are defects in the appearance of the hose tail to be inspected based on the image of the hose tail to be inspected captured by the industrial camera.

9. The hose tail appearance defect detection system based on deep learning according to claim 8 is characterized in that: The image processing module comprises: The file selection unit is used to adaptively select a pre-annotated defect XML format folder; The foreground image unit is used to obtain the corresponding defect foreground image marked in the XML format folder; A background image unit, used for adaptively selecting a background image whose defects need to be enhanced; An image acquisition unit, used for selecting and acquiring the defect foreground image; The renaming unit is used to randomly enlarge, reduce, horizontally, vertically, and flip the acquired defect data, attach them to the acquired background image, and rename them by custom.

10. The hose tail appearance defect detection system based on deep learning according to claim 8 or 9, characterized in that: The training image module comprises: Build a weight unit to introduce the packages required for deep learning, build a MobileNetSSD convolutional neural network, load the weights of the MobileNetSSD pre-trained model, introduce a label assignment loss function based on an optimization strategy, and let the network learn the optimal label assignment method by minimizing the loss function; The anchor box number selection unit is used to automatically select the number of anchor boxes corresponding to each true label through the network; The dynamic learning rate adjustment unit is used for fine-tuning using the SGD optimizer, and then training is started by dynamically adjusting parameters such as the learning rate.

Citation Information

Cited By

  • Real-time monitoring system for ultrahigh pressure hose joint assembly

    CN121686346A