CN111105399A - Switch surface defect detection method and system - Google Patents
Switch surface defect detection method and system Download PDFInfo
- Publication number
- CN111105399A CN111105399A CN201911321193.XA CN201911321193A CN111105399A CN 111105399 A CN111105399 A CN 111105399A CN 201911321193 A CN201911321193 A CN 201911321193A CN 111105399 A CN111105399 A CN 111105399A
- Authority
- CN
- China
- Prior art keywords
- image
- switch
- initial
- detection model
- data set
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000001514 detection method Methods 0.000 title claims abstract description 65
- 230000007547 defect Effects 0.000 title claims abstract description 51
- 238000000034 method Methods 0.000 claims abstract description 22
- 238000007781 pre-processing Methods 0.000 claims abstract description 10
- 238000012549 training Methods 0.000 claims description 30
- 238000013527 convolutional neural network Methods 0.000 claims description 6
- 230000006870 function Effects 0.000 description 4
- 238000012360 testing method Methods 0.000 description 3
- 238000010586 diagram Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000007613 environmental effect Effects 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 238000007689 inspection Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000013507 mapping Methods 0.000 description 1
- 238000013508 migration Methods 0.000 description 1
- 230000005012 migration Effects 0.000 description 1
- 238000013526 transfer learning Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
- G06T7/0004—Industrial image inspection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/21—Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
- G06F18/214—Generating training patterns; Bootstrap methods, e.g. bagging or boosting
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/24—Classification techniques
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20081—Training; Learning
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20084—Artificial neural networks [ANN]
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- General Physics & Mathematics (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Bioinformatics & Computational Biology (AREA)
- Evolutionary Biology (AREA)
- Evolutionary Computation (AREA)
- Artificial Intelligence (AREA)
- General Engineering & Computer Science (AREA)
- Life Sciences & Earth Sciences (AREA)
- Quality & Reliability (AREA)
- Image Analysis (AREA)
Abstract
The invention provides a switch surface defect detection method and a system, comprising the following steps: acquiring an initial image of the surface of a switch to be detected; preprocessing the initial image to obtain a preprocessed image; extracting the features of the preprocessed image to obtain image feature data; and inputting the image characteristic data into a target detection model, and outputting the defect type of the switch to be detected by the target detection model. The method can automatically identify the defects on the surface of the switch through the target detection model, and greatly improves the identification efficiency and the identification precision.
Description
Technical Field
The invention relates to the technical field of image detection, in particular to a switch surface defect detection method and system.
Background
With the rapid development of economic life, the detection of surface defects of small household electrical appliances plays a more important role in the aspect of automatic production. The existing method for detecting the surface defects of the small household appliance switch is easily influenced by environmental change factors, and has low identification precision and poor anti-interference capability.
Disclosure of Invention
Aiming at the defects in the prior art, the invention aims to provide a switch surface defect detection method and system.
The invention provides a switch surface defect detection method, which comprises the following steps:
acquiring an initial image of the surface of a switch to be detected;
preprocessing the initial image to obtain a preprocessed image;
extracting the features of the preprocessed image to obtain image feature data;
and inputting the image characteristic data into a target detection model, and outputting the defect type of the switch to be detected by the target detection model.
Optionally, before acquiring the initial image of the surface of the switch to be detected, the method further includes:
constructing an initial detection model;
constructing a training data set, the training data set comprising: marking a switch surface image with a defect type;
and performing iterative training on the initial detection model through the training data set to obtain the target detection model.
Optionally, the constructing an initial model includes:
and constructing an 11-layer convolutional neural network classification regression model as an initial detection model.
Optionally, the constructing a training data set includes:
acquiring a sample image containing a switch surface by a camera;
preprocessing the sample image to obtain a candidate image;
marking the positions with the defects in the candidate images through a rectangular frame, and setting corresponding defect type labels to obtain training images; the set of training images constitutes the training data set.
Optionally, the rectangular frame includes: a total of 49 prediction boxes, 7 rows and 7 columns, each predicting a target box of 5 different sizes, including: 24 × 24 pixels, 24 × 48 pixels, 48 × 48 pixels, 72 × 72 pixels, and 72 × 144 pixels.
Optionally, before iteratively training the initial detection model through the training data set, the method further includes:
the initial detection model is pre-trained with known open source data.
Optionally, preprocessing the initial image to obtain a preprocessed image, including:
and carrying out any one or more operations of brightness adjustment, cutting and rotation on the initial image to obtain a preprocessed image.
The invention also provides a switch surface defect detection system, which comprises a memory and a processor, wherein the memory stores computer instructions, and the processor retrieves the computer instructions from the memory for executing the switch surface defect detection method.
Compared with the prior art, the invention has the following beneficial effects:
according to the switch surface defect detection method and system provided by the invention, the initial image of the surface of the switch to be detected is obtained; preprocessing the initial image to obtain a preprocessed image; extracting the features of the preprocessed image to obtain image feature data; and inputting the image characteristic data into a target detection model, and outputting the defect type of the switch to be detected by the target detection model. Therefore, the defects on the surface of the switch can be automatically identified through the target detection model, and the identification efficiency and the identification precision are greatly improved.
Drawings
Other features, objects and advantages of the invention will become more apparent upon reading of the detailed description of non-limiting embodiments with reference to the following drawings:
FIG. 1 is a flow chart of a method for detecting defects on a switch surface according to the present invention;
FIG. 2 is a schematic diagram illustrating the principle of the method for detecting defects on the surface of a switch according to the present invention.
Detailed Description
The present invention will be described in detail with reference to specific examples. The following examples will assist those skilled in the art in further understanding the invention, but are not intended to limit the invention in any way. It should be noted that it would be obvious to those skilled in the art that various changes and modifications can be made without departing from the spirit of the invention. All falling within the scope of the present invention.
Fig. 1 is a flowchart of a switch surface defect detection method provided by the present invention, and as shown in fig. 1, the method of the present invention may include:
s101, acquiring an initial image of the surface of the switch to be detected.
And S102, preprocessing the initial image to obtain a preprocessed image.
And S103, performing feature extraction on the preprocessed image to obtain image feature data.
And S104, inputting the image characteristic data into the target detection model, and outputting the defect type of the switch to be detected by the target detection model.
In this embodiment, an initial image of the surface of the small household appliance switch may be acquired by a camera or other devices, and then the initial image may be preprocessed in a manner of brightness adjustment, clipping, rotation, or the like. And finally, inputting the image characteristic data into a target detection model, and outputting the defect type of the switch to be detected by the target detection model.
The target detection model used in this embodiment may be an 11-layer convolutional neural network classification regression model, and before use, a training data set is constructed, where the training data set includes: marking a switch surface image with a defect type; and performing iterative training on the initial detection model through the training data set to obtain a target detection model.
Illustratively, a sample image containing the switch surface is acquired by a camera; preprocessing a sample image to obtain a candidate image; marking positions with defects in the candidate images through the rectangular frame, and setting corresponding defect type labels to obtain training images; the set of training images constitutes a training data set.
Specifically, the switch surface detection of a small household appliance will be described in detail as an example. The detection image of the surface defect of the small household appliance switch can be acquired by equipment such as a camera and the like, and a data set is expanded by adopting a brightness adjustment, rotation, random cutting and other classical data enhancement methods; and marking the small household appliance switch surface defect detection image data set to construct a training sample set. Optionally, the label is a rectangular frame containing coordinates of the size and the position of the surface defect of the small household appliance switch in the whole image, and the label is a category of the surface defect of the small household appliance switch labeled in the image; designing a customized 11-layer convolutional neural network classification regression model M, pre-training the model M by using an open-source surface defect detection target detection database by adopting a migration learning method, and designing a target detection network model based on the model; training the model M by using the labeled data set to obtain a final target detection and identification model; and detecting and identifying the surface defects of the small household electrical appliance switches in the image by using a target detection and identification model.
TABLE 1 test platform parameters
An industrial PC and camera platform can be selected for testing, and parameters of the testing platform are shown in table 1.
TABLE 2 object detection recognition model
The structural parameters of the 11-layer convolutional neural network classification regression model are shown in table 2.
Specifically, y ═ m (x) represents a mapping function of the target inspection model input to output, where x is the input image and y is the surface defect classification and its location coordinates.
In this embodiment, a "transfer learning" method is used to pre-train the customized 9-layer convolutional neural network (as shown in table 2) classification regression model M using the universal open-source surface defect detection target detection database, and the model M is further optimized using the labeled small appliance switch surface defect detection image data. Based on the model design, a single-step target detection network model is adopted, so that the detection speed of the surface defects of the small household appliance switch can be effectively improved.
For example, fig. 2 is a schematic diagram illustrating a principle of the method for detecting defects on a switch surface according to the present invention, and as shown in fig. 2, the rectangular frame may include: a total of 49 prediction boxes, 7 rows and 7 columns, each predicting a target box of 5 different sizes, including: 24 × 24 pixels, 24 × 48 pixels, 48 × 48 pixels, 72 × 72 pixels, and 72 × 144 pixels. And identifying the defect types and positions of the images through a convolution network.
The method in the embodiment solves the problems of low detection speed and low positioning accuracy in the existing small household appliance switch surface defect target detection method, has the advantages of high detection speed and high detection accuracy, and can be used for automatic identification and detection of small household appliance switch surface defects.
It should be noted that, the steps in the switch surface defect detection method provided by the present invention may be implemented by using corresponding modules, devices, units, and the like in the switch surface defect detection system, and those skilled in the art may refer to the technical scheme of the system to implement the step flow of the method, that is, the embodiment in the system may be understood as a preferred example of the implementation method, and details are not repeated herein.
Those skilled in the art will appreciate that, in addition to implementing the system and its various devices provided by the present invention in purely computer readable program code means, the method steps can be fully programmed to implement the same functions by implementing the system and its various devices in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Therefore, the system and various devices thereof provided by the present invention can be regarded as a hardware component, and the devices included in the system and various devices thereof for realizing various functions can also be regarded as structures in the hardware component; means for performing the functions may also be regarded as structures within both software modules and hardware components for performing the methods.
The foregoing description of specific embodiments of the present invention has been presented. It is to be understood that the present invention is not limited to the specific embodiments described above, and that various changes or modifications may be made by one skilled in the art within the scope of the appended claims without departing from the spirit of the invention. The embodiments and features of the embodiments of the present application may be combined with each other arbitrarily without conflict.
Claims (8)
1. A switch surface defect detection method is characterized by comprising the following steps:
acquiring an initial image of the surface of a switch to be detected;
preprocessing the initial image to obtain a preprocessed image;
extracting the features of the preprocessed image to obtain image feature data;
and inputting the image characteristic data into a target detection model, and outputting the defect type of the switch to be detected by the target detection model.
2. The method of claim 1, further comprising, prior to acquiring the initial image of the surface of the switch to be inspected:
constructing an initial detection model;
constructing a training data set, the training data set comprising: marking a switch surface image with a defect type;
and performing iterative training on the initial detection model through the training data set to obtain the target detection model.
3. The method of claim 2, wherein the constructing an initial model comprises:
and constructing an 11-layer convolutional neural network classification regression model as an initial detection model.
4. The method of claim 2, wherein the constructing a training data set comprises:
acquiring a sample image containing a switch surface by a camera;
preprocessing the sample image to obtain a candidate image;
marking the positions with the defects in the candidate images through a rectangular frame, and setting corresponding defect type labels to obtain training images; the set of training images constitutes the training data set.
5. The method of claim 4, wherein the rectangular frame comprises: a total of 49 prediction boxes, 7 rows and 7 columns, each predicting a target box of 5 different sizes, including: 24 × 24 pixels, 24 × 48 pixels, 48 × 48 pixels, 72 × 72 pixels, and 72 × 144 pixels.
6. The method of claim 2, further comprising, prior to iteratively training the initial detection model with the training data set:
the initial detection model is pre-trained with known open source data.
7. The method of claim 1, wherein preprocessing the initial image to obtain a preprocessed image comprises:
and carrying out any one or more operations of brightness adjustment, cutting and rotation on the initial image to obtain a preprocessed image.
8. A switch surface defect detection system comprising a memory having stored therein computer instructions and a processor retrieving the computer instructions from the memory for performing the switch surface defect detection method of any of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911321193.XA CN111105399A (en) | 2019-12-19 | 2019-12-19 | Switch surface defect detection method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911321193.XA CN111105399A (en) | 2019-12-19 | 2019-12-19 | Switch surface defect detection method and system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111105399A true CN111105399A (en) | 2020-05-05 |
Family
ID=70423117
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911321193.XA Pending CN111105399A (en) | 2019-12-19 | 2019-12-19 | Switch surface defect detection method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111105399A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111640089A (en) * | 2020-05-09 | 2020-09-08 | 武汉精立电子技术有限公司 | Defect detection method and device based on feature map center point |
CN115984268A (en) * | 2023-03-20 | 2023-04-18 | 杭州百子尖科技股份有限公司 | Target detection method and device based on machine vision, electronic equipment and medium |
CN117218097A (en) * | 2023-09-23 | 2023-12-12 | 宁波江北骏欣密封件有限公司 | Method and device for detecting surface defects of shaft sleeve type silk screen gasket part |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20170177997A1 (en) * | 2015-12-22 | 2017-06-22 | Applied Materials Israel Ltd. | Method of deep learining-based examination of a semiconductor specimen and system thereof |
CN108520274A (en) * | 2018-03-27 | 2018-09-11 | 天津大学 | High reflecting surface defect inspection method based on image procossing and neural network classification |
CN109064454A (en) * | 2018-07-12 | 2018-12-21 | 上海蝶鱼智能科技有限公司 | Product defects detection method and system |
CN110148130A (en) * | 2019-05-27 | 2019-08-20 | 北京百度网讯科技有限公司 | Method and apparatus for detecting part defect |
-
2019
- 2019-12-19 CN CN201911321193.XA patent/CN111105399A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20170177997A1 (en) * | 2015-12-22 | 2017-06-22 | Applied Materials Israel Ltd. | Method of deep learining-based examination of a semiconductor specimen and system thereof |
CN108520274A (en) * | 2018-03-27 | 2018-09-11 | 天津大学 | High reflecting surface defect inspection method based on image procossing and neural network classification |
CN109064454A (en) * | 2018-07-12 | 2018-12-21 | 上海蝶鱼智能科技有限公司 | Product defects detection method and system |
CN110148130A (en) * | 2019-05-27 | 2019-08-20 | 北京百度网讯科技有限公司 | Method and apparatus for detecting part defect |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111640089A (en) * | 2020-05-09 | 2020-09-08 | 武汉精立电子技术有限公司 | Defect detection method and device based on feature map center point |
CN111640089B (en) * | 2020-05-09 | 2023-08-15 | 武汉精立电子技术有限公司 | Defect detection method and device based on feature map center point |
CN115984268A (en) * | 2023-03-20 | 2023-04-18 | 杭州百子尖科技股份有限公司 | Target detection method and device based on machine vision, electronic equipment and medium |
CN117218097A (en) * | 2023-09-23 | 2023-12-12 | 宁波江北骏欣密封件有限公司 | Method and device for detecting surface defects of shaft sleeve type silk screen gasket part |
CN117218097B (en) * | 2023-09-23 | 2024-04-12 | 宁波江北骏欣密封件有限公司 | Method and device for detecting surface defects of shaft sleeve type silk screen gasket part |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Lei et al. | Intelligent fault detection of high voltage line based on the Faster R-CNN | |
CN111179251B (en) | Defect detection system and method based on twin neural network and by utilizing template comparison | |
US11132787B2 (en) | Method for monitoring manufacture of assembly units | |
EP3502966A1 (en) | Data generation apparatus, data generation method, and data generation program | |
CN111105399A (en) | Switch surface defect detection method and system | |
CN106846362B (en) | Target detection tracking method and device | |
CN110413786B (en) | Data processing method based on webpage text classification, intelligent terminal and storage medium | |
KR20210008352A (en) | System and method for detecting defects in imaged items | |
CN109034121B (en) | Commodity identification processing method, device, equipment and computer storage medium | |
CN110969600A (en) | Product defect detection method and device, electronic equipment and storage medium | |
CN108830850B (en) | Automatic optical detection picture analysis method and equipment | |
CN117372424B (en) | Defect detection method, device, equipment and storage medium | |
CN114787831B (en) | Improving accuracy of classification models | |
Bugayong et al. | Google tesseract: optical character recognition (OCR) on HDD/SSD labels using machine vision | |
CN115587989B (en) | Workpiece CT image defect detection segmentation method and system | |
CN113592859B (en) | Deep learning-based classification method for defects of display panel | |
CN113743434A (en) | Training method of target detection network, image augmentation method and device | |
CN115240031A (en) | Method and system for generating plate surface defects based on generation countermeasure network | |
CN115661542A (en) | Small sample target detection method based on feature relation migration | |
CN115601547A (en) | Sample image acquisition method, sample image acquisition device, cargo management method, cargo management device, cargo management equipment and storage medium | |
CN114742988A (en) | Method for converting point labeling to frame labeling by multi-stage detector | |
CN113419951A (en) | Artificial intelligence model optimization method and device, electronic equipment and storage medium | |
CN113591645A (en) | Power equipment infrared image identification method based on regional convolutional neural network | |
CN113902890A (en) | Self-supervision data enhancement method, system and equipment for visual concept detection | |
CN116935168B (en) | Method, device, computer equipment and storage medium for target detection |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20200505 |