WO2020156409A1 - Data processing method, defect detection method, computing apparatus, and storage medium - Google Patents

Data processing method, defect detection method, computing apparatus, and storage medium Download PDF

Info

Publication number
WO2020156409A1
WO2020156409A1 PCT/CN2020/073704 CN2020073704W WO2020156409A1 WO 2020156409 A1 WO2020156409 A1 WO 2020156409A1 CN 2020073704 W CN2020073704 W CN 2020073704W WO 2020156409 A1 WO2020156409 A1 WO 2020156409A1
Authority
WO
WIPO (PCT)
Prior art keywords
pixel
type
predicted
detection frame
prediction
Prior art date
Application number
PCT/CN2020/073704
Other languages
French (fr)
Chinese (zh)
Inventor
李虹杰
魏溪含
陈想
陈岩
Original Assignee
阿里巴巴集团控股有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 阿里巴巴集团控股有限公司 filed Critical 阿里巴巴集团控股有限公司
Publication of WO2020156409A1 publication Critical patent/WO2020156409A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection
    • G06T2207/30164Workpiece; Machine component

Definitions

  • This application relates to the field of computer technology, and in particular to a data processing method, a defect detection method, a computing device, and a storage medium.
  • Various aspects of the present application provide a data processing method, a defect detection method, a computing device, and a storage medium, which are used to detect defects more accurately in an all-round and automated manner and improve production efficiency.
  • An embodiment of the present application provides a data processing method, including: acquiring features of at least one picture, and determining a prediction type and a prediction detection frame of a pixel in the picture according to the feature, where the prediction type reflects whether the pixel is a defect,
  • the prediction target frame reflects the defect position of the pixel when it has a defect; determines the type loss between the predicted type and the true type of the pixel, and determines the detection frame loss between the predicted detection frame and the real detection frame of the pixel; according to Pixel type loss and detection frame loss, determine the total loss of pixels, and generate a defect detection model based on the total loss.
  • An embodiment of the present application also provides a defect detection method, including: acquiring features of at least one picture, and determining a prediction type and a prediction detection frame of pixels in the picture according to the features, the prediction type reflecting whether the pixel is a defect Situation, the prediction target frame reflects the defect position of the pixel when the pixel has a defect; the type loss between the predicted type and the true type of the pixel is determined, and the detection frame loss between the predicted detection frame and the real detection frame of the pixel is determined ; According to the pixel type loss and the detection frame loss, determine the total loss of the pixel, according to the total loss, generate a defect detection model; according to the generated defect detection model, determine the prediction type of the pixel in the picture to be predicted and the prediction detection frame For a picture to be predicted, the pixels are aggregated according to the prediction type to generate a pixel area, and the prediction detection frame of the pixel area is determined according to the prediction detection frame of the pixel; according to the prediction of the pixel area and/or pixel area Check the frame
  • An embodiment of the present application also provides a defect detection system, including: a first computing device and a second computing device; the first computing device acquires the characteristics of at least one picture, and determines the pixels in the picture according to the characteristics A prediction type and a prediction detection frame, the prediction type reflects whether the pixel is a defect, the prediction target frame reflects the location of the defect when the pixel has a defect; the type loss between the predicted type and the true type of the pixel is determined, And determine the detection frame loss between the predicted detection frame of the pixel and the real detection frame; determine the total loss of the pixel according to the pixel type loss and the detection frame loss, and generate a defect detection model based on the total loss; the second The computing device determines the prediction type and the prediction detection frame of the pixel in the picture to be predicted according to the detection model of the generated defect; for a picture to be predicted, the pixels are aggregated according to the prediction type to generate a pixel area, and the pixel is detected according to the prediction The frame determines the prediction detection frame of the
  • the embodiment of the present application also provides a computer-readable storage medium storing a computer program.
  • the computer program When the computer program is executed by one or more processors, the one or more processors will cause the one or more processors to implement the steps in the above-mentioned defect detection method.
  • FIG. 3 is a schematic flowchart of a defect detection method provided by an exemplary embodiment of the application.
  • Fig. 5 is a schematic diagram of a defect provided by an exemplary embodiment of the application.
  • FIG. 10 is a schematic structural diagram of a defect detection device provided by another exemplary embodiment of this application.
  • FIG. 12 is a schematic structural diagram of a computing device provided by another exemplary embodiment of this application.
  • the prediction type of the pixel and the prediction detection frame are determined according to the picture characteristics, the prediction type reflects whether the pixel is a defect, and the prediction target frame reflects the defect position of the pixel when it has a defect; the prediction type of the pixel is determined and true
  • the type loss between the types, and the detection frame loss between the predicted detection frame and the real detection frame to determine the pixel so as to determine the total loss of the pixel, based on the total loss, generate a defect detection model, and perform the predicted image according to the detection model
  • Defect detection can perform defect detection segmentation with high accuracy and high speed, and realize the segmentation of defect detection in an all-round way, thereby reducing labor costs, improving product production efficiency, and creating value for products.
  • Fig. 1 is a schematic structural diagram of a defect detection system provided by an exemplary embodiment of the application.
  • the detection system 100 includes: a first computing device 101 and a second computing device 102.
  • the detection system may also include a terminal 103.
  • the terminal 103 may be any device with a certain computing capability, for example, it may be a smart phone, a notebook, a personal computer (PC), etc.
  • the basic structure of the terminal 103 includes: at least one processor. The number of processors depends on the configuration and type of the terminal 103.
  • the terminal 103 may also include a memory.
  • the memory may be volatile, such as RAM, or non-volatile, such as read-only memory (ROM), flash memory, etc., or may include both Kind of type.
  • the memory usually stores an operating system (Operating System, OS), one or more application programs, and may also store program data.
  • OS operating system
  • application programs may also store program data.
  • the terminal 103 also includes some basic configurations, such as a network card chip, an IO bus, a camera, and audio and video components.
  • the terminal 103 may also include some peripheral devices, such as a keyboard, a mouse, a stylus, and a printer. Other peripheral devices are well known in the art and will not be described in detail here.
  • the embodiment of the present application can also use only one computing device to train the model and directly perform defect detection based on the generated model.
  • the computing device can be a stand-alone server or a server array, or a cloud-based service virtualization. ⁇ VM.
  • the second computing device 102 may also obtain the characteristics of at least one picture, and determine the prediction type and the prediction detection frame of the pixel in the picture according to the characteristics.
  • the prediction type reflects whether the pixel is a defect
  • the prediction target frame reflects the pixel.
  • the position of the flaw when there is a flaw determine the type loss between the predicted type and the true type of the pixel, and determine the detection frame loss between the predicted detection frame of the pixel and the real detection frame; according to the pixel type loss and the detection frame loss, Determine the total loss of pixels, and generate a defect detection model based on the total loss.
  • model generation process of the first computing device 101 or the second computing device 102 and the defect detection process of the first computing device 101 or the second computing device 102 can be described in detail.
  • the prediction type reflects whether the pixel is a defect
  • the prediction target frame reflects the defect position of the pixel when it has a defect.
  • the prediction target frame refers to the prediction rule frame where the defect of the pixel belongs on the picture, such as a rectangular frame.
  • the way to obtain the characteristics of the picture may be: obtaining the characteristics of the picture through a convolutional neural network. For example, input a picture into a convolutional neural network to obtain various features of the picture.
  • convolutional neural network refers to a type of feedforward neural network that includes convolutional calculations and has a deep structure. It includes a feature extractor composed of a convolutional layer, a pooling layer, and a fully connected layer.
  • a fully convolutional neural network (also called a fully convolutional neural network model) refers to a neural network improved on the basis of a convolutional neural network, which can convert the fully connected layer in the convolutional neural network into a convolutional layer Neural network.
  • the method for determining the relative real coordinates is the same as the method for determining the relative predicted coordinates, and will not be repeated here.
  • the relative real coordinates can be ((x-x1)/w, (y-y1)/h, (x2-x)/w, (y2-y)/h).
  • the positive sample refers to the pixel belonging to the defect.
  • the detection frame loss is determined by formula 2):
  • the generating module 803 is configured to determine the total loss of the sum of the type loss and the sum of the detection frame loss according to the weighted sum algorithm.
  • FIG. 9 is a schematic structural diagram of a defect detection device provided by another exemplary embodiment of the application.
  • the detection device 900 can be applied to a computing device.
  • the detection device 900 includes an acquisition module 901, a generation module 902, and a determination module 903. The functions of each module are described in detail below:
  • the obtaining module 901 is configured to obtain at least one picture to be predicted, and determine the prediction type and the prediction detection frame of the pixel in the picture to be predicted.
  • the generating module 902 is configured to aggregate pixels according to the prediction type for a picture to be predicted to generate a pixel area, and determine the predicted detection frame of the pixel area according to the predicted detection frame of the pixel.
  • the determining module 903 is configured to determine the defect of the picture to be predicted according to the pixel area and/or the predicted detection frame of the pixel area.
  • the generating module 902 includes: a determining unit for determining the defect type of each pixel according to the predicted probability of the prediction type; a generating unit for aggregating pixels according to the defect type to generate an aggregation of pixels of the same defect type Area, as the pixel area.
  • the device 900 further includes: a selection module for taking the same defect type as the defect type of the pixel area; wherein, the generating module 902 is used for selecting the pixel with the highest predicted probability of the defect type in the pixel area.
  • the prediction detection frame is used as the prediction detection frame of the pixel area.
  • the determining module 903 is configured to, when the defect type of the pixel area belongs to the second type, use the defect type of the pixel area as the defect type contained in the picture to be predicted, and the pixel area as the defect contained in the picture to be predicted In the pixel area of, the smallest bounding rectangular frame of the pixel area is used as the prediction detection frame of the defect contained in the picture to be predicted.
  • the determining module 1002 is used to determine the type loss between the predicted type and the true type of the pixel, and the detection frame loss between the predicted detection frame and the true detection frame of the pixel.
  • the generating module 1003 is used to determine the total loss of pixels according to the loss of the pixel type and the loss of the detection frame, and generate a defect detection model according to the total loss.
  • the structure of the data processing device 800 shown in FIG. 8 can be implemented as a computing device.
  • the computing device 1100 may include: a memory 1101 and a processor 1102;
  • the memory 1101 is used to store computer programs
  • the processor 1102 is used to execute computer programs for:
  • the processor 1102 is specifically configured to: for any picture, obtain difficult negative samples from normal pixels that are not defective in the picture, where the difficult negative samples refer to negative samples with predetermined quality; for any picture , And take the defective pixels in the picture as positive samples.
  • the processor 1102 is specifically configured to: determine the type loss sum of the difficult negative samples in at least one picture; determine the type loss sum of the positive samples in at least one picture, and compare the type loss sum of the difficult negative samples with the positive samples The type loss sum, as the type loss of the corresponding picture.
  • the processor 1102 is specifically configured to determine the type loss of the pixel under the true type according to the true type of the pixel and the predicted probability of the prediction type that matches the true type.
  • the type loss between the predicted type and the true type of the pixel is determined by the following formula 1):
  • the memory 1201 is used to store computer programs
  • the processor 1202 is used to execute computer programs for:
  • the processor 1102 is specifically configured to: when the defect type of the pixel area belongs to the second type, use the defect type of the pixel area as the defect type contained in the picture to be predicted, and use the pixel area as the picture to be predicted. In the pixel area of the defect, the smallest bounding rectangle of the pixel area is used as the prediction detection frame of the defect contained in the picture to be predicted.
  • the processor 1102 is specifically configured to: input at least one picture to be predicted into the generated defect detection model to obtain the prediction type and the prediction detection frame of the pixel in the picture to be predicted.
  • the structure of the apparatus 1000 shown in FIG. 10 may be implemented as a computing device.
  • the computing device 1300 may include : Memory 1301 and processor 1302;
  • the memory 1301 is used to store computer programs
  • the processor 1302 is used to execute a computer program for:
  • Memory used to store computer programs
  • an embodiment of the present invention provides a computer storage medium.
  • the one or more processors are caused to implement the steps of the defect detection method in the method embodiment in FIG. 4.
  • the device embodiments described above are merely illustrative.
  • the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, they may be located in One place, or it can be distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the objectives of the solutions of the embodiments. Those of ordinary skill in the art can understand and implement without creative work.
  • These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable multimedia data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device.
  • the instruction device realizes the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
  • Computer-readable media includes permanent and non-permanent, removable and non-removable media, and information storage can be realized by any method or technology.
  • the information can be computer-readable instructions, data structures, program modules, or other data.
  • Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, CD-ROM, digital versatile disc (DVD) or other optical storage, Magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media can be used to store information that can be accessed by computing devices. According to the definition in this article, computer-readable media does not include transitory media, such as modulated data signals and carrier waves.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Biomedical Technology (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Biophysics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Quality & Reliability (AREA)
  • Health & Medical Sciences (AREA)
  • Image Analysis (AREA)
  • Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)

Abstract

Embodiments of the present application provide a data processing method, a defect detection method, a computing apparatus, and a storage medium. The method in the embodiments of the present application comprises: determining a predicted type and a predicted detection box of a pixel according to an image feature, the predicted type indicating whether the pixel is a part of a defect, and the predicted target box indicating a defect position if the pixel is a part of a defect; determining a type loss between the predicted type of the pixel and an actual type, determining a detection box loss between the predicted detection box of the pixel and an actual detection box; and determining a total loss of the pixel accordingly, generating a defect detection model according to the total loss, and performing defect detection on an image awaiting prediction according to the detection model. The invention enables highly accurate and efficient segmentation for defect detection, and achieves comprehensive automated segmentation for defect detection, thereby reducing labor costs, improving product manufacturing efficiency, and adding product value.

Description

数据处理方法、瑕疵的检测方法、计算设备及存储介质Data processing method, defect detection method, computing device and storage medium
本申请要求2019年02月02日递交的申请号为201910107275.8、发明名称为“数据处理方法、瑕疵的检测方法、计算设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application filed on February 02, 2019 with the application number 201910107275.8 and the invention title "data processing method, defect detection method, computing device and storage medium", the entire content of which is incorporated by reference In this application.
技术领域Technical field
本申请涉及计算机技术领域,尤其涉及一种数据处理方法、瑕疵的检测方法、计算设备及存储介质。This application relates to the field of computer technology, and in particular to a data processing method, a defect detection method, a computing device, and a storage medium.
背景技术Background technique
随着现代化大工业的发展,高速的生产效率和低速的检测效率形成一个巨大的矛盾,然而在工业项目检测中,一个基本要求是定性的判断出产品是否存在瑕疵,避免不良产品走出车间或者走出下一个生产线。目前在一些工业生产中还有不少企业采用人工检测的方式对产品的质量进行检测,传统的人工目检是一种完全的主观评价方法,具有主观因素大、实时性差、效率低下等缺点,已经满足不了制造企业的检测需求。With the development of modern large-scale industry, high-speed production efficiency and low-speed inspection efficiency have formed a huge contradiction. However, in industrial project inspection, a basic requirement is to qualitatively determine whether the product has defects, and to prevent defective products from leaving the workshop or going out. The next production line. At present, in some industrial production, many companies use manual inspection to test the quality of products. Traditional manual visual inspection is a completely subjective evaluation method, which has disadvantages such as large subjective factors, poor real-time performance, and low efficiency. It can no longer meet the testing needs of manufacturing companies.
发明内容Summary of the invention
本申请的多个方面提供一种数据处理方法、瑕疵的检测方法、计算设备及存储介质,用以全方位自动化地较为准确地检测瑕疵,提高生产效率。Various aspects of the present application provide a data processing method, a defect detection method, a computing device, and a storage medium, which are used to detect defects more accurately in an all-round and automated manner and improve production efficiency.
本申请实施例提供一种数据处理方法,包括:获取至少一张图片的特征,根据所述特征确定该图片中像素的预测类型以及预测检测框,所述预测类型反映像素是否属于瑕疵的情况,所述预测目标框反映像素在具有瑕疵时的瑕疵位置;确定像素的所述预测类型与真实类型之间的类型损失,以及确定像素的预测检测框与真实检测框之间的检测框损失;根据像素的类型损失以及检测框损失,确定像素的总损失,根据所述总损失,生成瑕疵的检测模型。An embodiment of the present application provides a data processing method, including: acquiring features of at least one picture, and determining a prediction type and a prediction detection frame of a pixel in the picture according to the feature, where the prediction type reflects whether the pixel is a defect, The prediction target frame reflects the defect position of the pixel when it has a defect; determines the type loss between the predicted type and the true type of the pixel, and determines the detection frame loss between the predicted detection frame and the real detection frame of the pixel; according to Pixel type loss and detection frame loss, determine the total loss of pixels, and generate a defect detection model based on the total loss.
本申请实施例还提供一种瑕疵的检测方法,包括:获取至少一张待预测图片,确定待预测图片中的像素的预测类型以及预测检测框;针对一张待预测图片,根据所述预测类型聚合像素,生成像素区域,并根据像素的预测检测框,确定所述像素区域的预测检测框;根据所述像素区域和/或像素区域的预测检测框,确定待预测图片的瑕疵。An embodiment of the present application also provides a defect detection method, including: obtaining at least one picture to be predicted, determining the prediction type and the prediction detection frame of the pixel in the picture to be predicted; for a picture to be predicted, according to the prediction type The pixels are aggregated to generate a pixel area, and the predicted detection frame of the pixel area is determined according to the predicted detection frame of the pixel; the defect of the picture to be predicted is determined according to the predicted detection frame of the pixel area and/or the pixel area.
本申请实施例还提供一种瑕疵的检测方法,包括:获取至少一张图片的特征,根据 所述特征确定该图片中像素的预测类型以及预测检测框,所述预测类型反映像素是否属于瑕疵的情况,所述预测目标框反映像素在具有瑕疵时的瑕疵位置;确定像素的所述预测类型与真实类型之间的类型损失,以及确定像素的预测检测框与真实检测框之间的检测框损失;根据像素的类型损失以及检测框损失,确定像素的总损失,根据所述总损失,生成瑕疵的检测模型;根据生成瑕疵的检测模型,确定待预测图片中的像素的预测类型以及预测检测框;针对一张待预测图片,根据所述预测类型聚合像素,生成像素区域,并根据像素的预测检测框,确定所述像素区域的预测检测框;根据所述像素区域和/或像素区域的预测检测框,确定待预测图片的瑕疵。An embodiment of the present application also provides a defect detection method, including: acquiring features of at least one picture, and determining a prediction type and a prediction detection frame of pixels in the picture according to the features, the prediction type reflecting whether the pixel is a defect Situation, the prediction target frame reflects the defect position of the pixel when the pixel has a defect; the type loss between the predicted type and the true type of the pixel is determined, and the detection frame loss between the predicted detection frame and the real detection frame of the pixel is determined ; According to the pixel type loss and the detection frame loss, determine the total loss of the pixel, according to the total loss, generate a defect detection model; according to the generated defect detection model, determine the prediction type of the pixel in the picture to be predicted and the prediction detection frame For a picture to be predicted, the pixels are aggregated according to the prediction type to generate a pixel area, and the prediction detection frame of the pixel area is determined according to the prediction detection frame of the pixel; according to the prediction of the pixel area and/or pixel area Check the frame to determine the defects of the picture to be predicted.
本申请实施例还提供一种瑕疵的检测系统,包括:第一计算设备以及第二计算设备;所述第一计算设备,获取至少一张图片的特征,根据所述特征确定该图片中像素的预测类型以及预测检测框,所述预测类型反映像素是否属于瑕疵的情况,所述预测目标框反映像素在具有瑕疵时的瑕疵位置;确定像素的所述预测类型与真实类型之间的类型损失,以及确定像素的预测检测框与真实检测框之间的检测框损失;根据像素的类型损失以及检测框损失,确定像素的总损失,根据所述总损失,生成瑕疵的检测模型;所述第二计算设备,根据生成瑕疵的检测模型,确定待预测图片中的像素的预测类型以及预测检测框;针对一张待预测图片,根据所述预测类型聚合像素,生成像素区域,并根据像素的预测检测框,确定所述像素区域的预测检测框;根据所述像素区域和/或像素区域的预测检测框,确定待预测图片的瑕疵。An embodiment of the present application also provides a defect detection system, including: a first computing device and a second computing device; the first computing device acquires the characteristics of at least one picture, and determines the pixels in the picture according to the characteristics A prediction type and a prediction detection frame, the prediction type reflects whether the pixel is a defect, the prediction target frame reflects the location of the defect when the pixel has a defect; the type loss between the predicted type and the true type of the pixel is determined, And determine the detection frame loss between the predicted detection frame of the pixel and the real detection frame; determine the total loss of the pixel according to the pixel type loss and the detection frame loss, and generate a defect detection model based on the total loss; the second The computing device determines the prediction type and the prediction detection frame of the pixel in the picture to be predicted according to the detection model of the generated defect; for a picture to be predicted, the pixels are aggregated according to the prediction type to generate a pixel area, and the pixel is detected according to the prediction The frame determines the prediction detection frame of the pixel area; and determines the defect of the picture to be predicted according to the prediction detection frame of the pixel area and/or the pixel area.
本申请实施例还提供一种计算设备,包括存储器以及处理器;所述存储器,用于存储计算机程序;所述处理器,用于执行所述计算机程序,以用于:获取至少一张图片的特征,根据所述特征确定该图片中像素的预测类型以及预测检测框,所述预测类型反映像素是否属于瑕疵的情况,所述预测目标框反映像素在具有瑕疵时的瑕疵位置;确定像素的所述预测类型与真实类型之间的类型损失,以及确定像素的预测检测框与真实检测框之间的检测框损失;根据像素的类型损失以及检测框损失,确定像素的总损失,根据所述总损失,生成瑕疵的检测模型。An embodiment of the present application also provides a computing device, including a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program for: obtaining at least one picture Feature, determine the prediction type and prediction detection frame of the pixel in the picture according to the feature, the prediction type reflects whether the pixel is a defect, the prediction target frame reflects the location of the defect when the pixel has a defect; determining the location of the pixel The type loss between the prediction type and the real type, and the detection frame loss between the predicted detection frame and the real detection frame for determining the pixel; according to the pixel type loss and the detection frame loss, the total loss of the pixel is determined, according to the total Loss, generating a defect detection model.
本申请实施例还提供一种存储有计算机程序的计算机可读存储介质,计算机程序被一个或多个处理器执行时,致使所述一个或多个处理器实现上述瑕疵的检测方法中的步骤。The embodiment of the present application also provides a computer-readable storage medium storing a computer program. When the computer program is executed by one or more processors, the one or more processors will cause the one or more processors to implement the steps in the above-mentioned defect detection method.
本申请实施例还提供一种计算设备,包括存储器以及处理器;所述存储器,用于存储计算机程序;所述处理器,用于执行所述计算机程序,以用于:获取至少一张待预测 图片,确定待预测图片中的像素的预测类型以及预测检测框;针对一张待预测图片,根据所述预测类型聚合像素,生成像素区域,并根据像素的预测检测框,确定所述像素区域的预测检测框;根据所述像素区域和/或像素区域的预测检测框,确定待预测图片的瑕疵。An embodiment of the present application also provides a computing device, including a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program, and is used to: obtain at least one to be predicted Picture, determine the prediction type and prediction detection frame of the pixel in the picture to be predicted; for a picture to be predicted, the pixels are aggregated according to the prediction type to generate a pixel area, and the pixel area is determined according to the prediction detection frame of the pixel Predictive detection frame; according to the pixel area and/or the predicted detection frame of the pixel area, determine the defect of the picture to be predicted.
本申请实施例还提供一种存储有计算机程序的计算机可读存储介质,计算机程序被一个或多个处理器执行时,致使所述一个或多个处理器实现上述瑕疵的检测方法中的步骤。The embodiment of the present application also provides a computer-readable storage medium storing a computer program. When the computer program is executed by one or more processors, the one or more processors will cause the one or more processors to implement the steps in the above-mentioned defect detection method.
本申请实施例还提供一种计算设备,包括存储器以及处理器;所述存储器,用于存储计算机程序;所述处理器,用于执行所述计算机程序,以用于:获取至少一张图片的特征,根据所述特征确定该图片中像素的预测类型以及预测检测框,所述预测类型反映像素是否属于瑕疵的情况,所述预测目标框反映像素在具有瑕疵时的瑕疵位置;确定像素的所述预测类型与真实类型之间的类型损失,以及确定像素的预测检测框与真实检测框之间的检测框损失;根据像素的类型损失以及检测框损失,确定像素的总损失,根据所述总损失,生成瑕疵的检测模型;根据生成瑕疵的检测模型,确定待预测图片中的像素的预测类型以及预测检测框;针对一张待预测图片,根据所述预测类型聚合像素,生成像素区域,并根据像素的预测检测框,确定所述像素区域的预测检测框;根据所述像素区域和/或像素区域的预测检测框,确定待预测图片的瑕疵。An embodiment of the present application also provides a computing device, including a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program for: obtaining at least one picture Feature, determine the prediction type and prediction detection frame of the pixel in the picture according to the feature, the prediction type reflects whether the pixel is a defect, the prediction target frame reflects the location of the defect when the pixel has a defect; determining the location of the pixel The type loss between the prediction type and the real type, and the detection frame loss between the predicted detection frame and the real detection frame for determining the pixel; according to the pixel type loss and the detection frame loss, the total loss of the pixel is determined, according to the total Loss, generate a defect detection model; according to the generated defect detection model, determine the prediction type and prediction detection frame of the pixel in the picture to be predicted; for a picture to be predicted, aggregate pixels according to the prediction type to generate a pixel area, and According to the predicted detection frame of the pixel, the predicted detection frame of the pixel area is determined; and the defect of the picture to be predicted is determined according to the predicted detection frame of the pixel area and/or the pixel area.
本申请实施例还提供一种存储有计算机程序的计算机可读存储介质,计算机程序被一个或多个处理器执行时,致使所述一个或多个处理器实现上述瑕疵的检测方法中的步骤。The embodiment of the present application also provides a computer-readable storage medium storing a computer program. When the computer program is executed by one or more processors, the one or more processors will cause the one or more processors to implement the steps in the above-mentioned defect detection method.
在本申请实施例中,根据图片特征确定像素的预测类型以及预测检测框,预测类型反映像素是否属于瑕疵的情况,预测目标框反映像素在具有瑕疵时的瑕疵位置;确定像素的预测类型与真实类型之间的类型损失,以及确定像素的预测检测框与真实检测框之间的检测框损失,从而确定像素的总损失,根据总损失,生成瑕疵的检测模型,并根据检测模型对待预测图片进行瑕疵检测,能够以高准确率和高速度进行瑕疵检测的分割,且全方位自动化地实现瑕疵检测的分割,从而减少人力成本,提高产品生产效率,为产品创造价值。In the embodiment of the present application, the prediction type of the pixel and the prediction detection frame are determined according to the picture characteristics, the prediction type reflects whether the pixel is a defect, and the prediction target frame reflects the defect position of the pixel when it has a defect; the prediction type of the pixel is determined and true The type loss between the types, and the detection frame loss between the predicted detection frame and the real detection frame to determine the pixel, so as to determine the total loss of the pixel, based on the total loss, generate a defect detection model, and perform the predicted image according to the detection model Defect detection can perform defect detection segmentation with high accuracy and high speed, and realize the segmentation of defect detection in an all-round way, thereby reducing labor costs, improving product production efficiency, and creating value for products.
附图说明Description of the drawings
此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请 的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:The drawings described here are used to provide a further understanding of the application and constitute a part of the application. The exemplary embodiments and descriptions of the application are used to explain the application and do not constitute an undue limitation of the application. In the attached picture:
图1为本申请一示例性实施例的瑕疵的检测系统的结构示意图;FIG. 1 is a schematic structural diagram of a defect detection system according to an exemplary embodiment of the application;
图2为本申请一示例性实施例的数据处理方法的流程示意图;2 is a schematic flowchart of a data processing method according to an exemplary embodiment of this application;
图3为本申请一示例性实施例提供的瑕疵的检测方法的流程示意图;3 is a schematic flowchart of a defect detection method provided by an exemplary embodiment of the application;
图4为本申请又一示例性实施例提供的瑕疵的检测方法的流程示意图;4 is a schematic flowchart of a defect detection method provided by another exemplary embodiment of this application;
图5为本申请一示例性实施例提供的瑕疵的示意图;Fig. 5 is a schematic diagram of a defect provided by an exemplary embodiment of the application;
图6为本申请又一示例性实施例提供的瑕疵的示意图;FIG. 6 is a schematic diagram of a defect provided by another exemplary embodiment of the application;
图7为本申请又一示例性实施例提供的困难负样本的获取示意图;FIG. 7 is a schematic diagram of obtaining difficult negative samples according to another exemplary embodiment of this application;
图8为本申请一示例性实施例提供的数据处理装置的结构示意图;FIG. 8 is a schematic structural diagram of a data processing device provided by an exemplary embodiment of this application;
图9为本申请一示例性实施例提供的瑕疵的检测装置的结构示意图;FIG. 9 is a schematic structural diagram of a defect detection device provided by an exemplary embodiment of the application;
图10为本申请又一示例性实施例提供的瑕疵的检测装置的结构示意图;10 is a schematic structural diagram of a defect detection device provided by another exemplary embodiment of this application;
图11为本申请一示例性实施例提供的计算设备的结构示意图;FIG. 11 is a schematic structural diagram of a computing device provided by an exemplary embodiment of this application;
图12为本申请又一示例性实施例提供的计算设备的结构示意图;FIG. 12 is a schematic structural diagram of a computing device provided by another exemplary embodiment of this application;
图13为本申请又一示例性实施例提供的计算设备的结构示意图。FIG. 13 is a schematic structural diagram of a computing device provided by another exemplary embodiment of this application.
具体实施方式detailed description
为使本申请的目的、技术方案和优点更加清楚,下面将结合本申请具体实施例及相应的附图对本申请技术方案进行清楚、完整地描述。显然,所描述的实施例仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to make the objectives, technical solutions, and advantages of the present application clearer, the technical solutions of the present application will be described clearly and completely in conjunction with specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of this application.
在工业瑕疵检测中,一个基本要求是定性的判断出是否存在瑕疵,避免不良产品走出车间或者下一个生产线。近一步要求是,检测出瑕疵位置和类别,从而能够快速定位瑕疵,方便后续处理和修复。而在对瑕疵位置进行检测时,可以对瑕疵进行像素级分割,从而能够确定瑕疵面积,方便客户对瑕疵定级。In industrial defect detection, a basic requirement is to qualitatively determine whether there is a defect, and to prevent defective products from leaving the workshop or the next production line. The next step is to detect the location and category of the flaws, so that the flaws can be quickly located for subsequent processing and repair. When detecting the defect location, the defect can be segmented at the pixel level, so that the area of the defect can be determined and it is convenient for customers to grade the defect.
产品商通过对瑕疵进行检测,实现高召回率,避免有瑕疵的产品走出产线,造成更大的损失。同时需要高准确率(低误报率),否则会造成两个方面的影响:在产品生产过程中,造成很多不必要的复检、返工以及下游客户的投诉,造成客户生产成本上升;在产品交付工程中,因为错误的报告问题,导致产品定级偏低,按照低价销售,造成客户收入损失。Product manufacturers can achieve a high recall rate by detecting defects and avoid defective products from leaving the production line, causing greater losses. At the same time, a high accuracy rate (low false alarm rate) is required, otherwise it will cause two aspects: in the production process, it will cause a lot of unnecessary re-inspection, rework, and downstream customer complaints, which will cause customer production costs to rise; In the delivery project, due to the wrong report problem, the product rating is low, and the product is sold at a low price, causing loss of customer revenue.
本申请实施例通过直接在特征层上面进行像素分类和检测框的确定,获得瑕疵的检 测结果。The embodiment of the application obtains the detection result of the defect by directly performing the pixel classification and the determination of the detection frame on the feature layer.
在本申请实施例中,根据图片特征确定像素的预测类型以及预测检测框,预测类型反映像素是否属于瑕疵的情况,预测目标框反映像素在具有瑕疵时的瑕疵位置;确定像素的预测类型与真实类型之间的类型损失,以及确定像素的预测检测框与真实检测框之间的检测框损失,从而确定像素的总损失,根据总损失,生成瑕疵的检测模型,并根据检测模型对待预测图片进行瑕疵检测,能够以高准确率和高速度进行瑕疵检测的分割,且全方位自动化地实现瑕疵检测的分割,从而减少人力成本,提高产品生产效率,为产品创造价值。In the embodiment of the present application, the prediction type of the pixel and the prediction detection frame are determined according to the picture characteristics, the prediction type reflects whether the pixel is a defect, and the prediction target frame reflects the defect position of the pixel when it has a defect; the prediction type of the pixel is determined and true The type loss between the types, and the detection frame loss between the predicted detection frame and the real detection frame to determine the pixel, so as to determine the total loss of the pixel, based on the total loss, generate a defect detection model, and perform the predicted image according to the detection model Defect detection can perform defect detection segmentation with high accuracy and high speed, and realize the segmentation of defect detection in an all-round way, thereby reducing labor costs, improving product production efficiency, and creating value for products.
以下结合附图,详细说明本申请各实施例提供的技术方案。The following describes in detail the technical solutions provided by the embodiments of the present application with reference to the accompanying drawings.
图1为本申请一示例性实施例提供的一种瑕疵的检测系统的结构示意图。如图1所示,该检测系统100包括:第一计算设备101以及第二计算设备102。Fig. 1 is a schematic structural diagram of a defect detection system provided by an exemplary embodiment of the application. As shown in FIG. 1, the detection system 100 includes: a first computing device 101 and a second computing device 102.
其中,第一计算设备101可以为单机服务器或者服务器阵列,或者云化的服务虚拟机VM。Among them, the first computing device 101 may be a stand-alone server or a server array, or a cloudized service virtual machine VM.
第二计算设备102也可以为单机服务器或者服务器阵列,或者云化的服务虚拟机VM。The second computing device 102 may also be a stand-alone server or a server array, or a cloudized service virtual machine VM.
其中,第一计算设备101是指用于可以生成瑕疵的检测模型的计算设备,该计算设备是指可以在网络虚拟环境中提供模型训练服务的设备。在物理实现上,该计算设备可以是任何能够提供计算服务,响应服务请求,并进行处理的设备,例如可以是常规服务器、云服务器、云主机、虚拟中心等。该计算设备的构成主要包括处理器、硬盘、内存、系统总线等,和通用的计算机架构类似。Among them, the first computing device 101 refers to a computing device that can generate a defect detection model, and the computing device refers to a device that can provide model training services in a network virtual environment. In terms of physical implementation, the computing device can be any device that can provide computing services, respond to service requests, and perform processing, such as a conventional server, cloud server, cloud host, virtual center, and so on. The composition of the computing device mainly includes a processor, a hard disk, a memory, a system bus, etc., and is similar to a general computer architecture.
第二计算设备102是指用于可以对图片进行瑕疵检测的计算设备,该计算设备是指可以在网络虚拟环境中提供计算处理服务的设备。在物理实现上,该计算设备可以是任何能够提供计算服务,响应服务请求,并进行处理的设备,例如可以是常规服务器、云服务器、云主机、虚拟中心等。该计算设备的构成主要包括处理器、硬盘、内存、系统总线等,和通用的计算机架构类似。The second computing device 102 refers to a computing device that can perform defect detection on a picture, and the computing device refers to a device that can provide computing processing services in a network virtual environment. In terms of physical implementation, the computing device can be any device that can provide computing services, respond to service requests, and perform processing, such as a conventional server, cloud server, cloud host, virtual center, and so on. The composition of the computing device mainly includes a processor, a hard disk, a memory, a system bus, etc., and is similar to a general computer architecture.
在本申请实例中,第一计算设备101,获取至少一张图片的特征,根据特征确定该图片中像素的预测类型以及预测检测框,预测类型反映像素是否属于瑕疵的情况,预测目标框反映像素在具有瑕疵时的瑕疵位置;确定像素的预测类型与真实类型之间的类型损失,以及确定像素的预测检测框与真实检测框之间的检测框损失;根据像素的类型损 失以及检测框损失,确定像素的总损失,根据总损失,生成瑕疵的检测模型。In the example of this application, the first computing device 101 obtains the characteristics of at least one picture, and determines the prediction type and the prediction detection frame of the pixel in the picture according to the characteristics. The prediction type reflects whether the pixel is a defect, and the prediction target frame reflects the pixel The position of the flaw when there is a flaw; determine the type loss between the predicted type and the true type of the pixel, and determine the detection frame loss between the predicted detection frame of the pixel and the real detection frame; according to the pixel type loss and the detection frame loss, Determine the total loss of pixels, and generate a defect detection model based on the total loss.
第二计算设备102,接收第一计算设备101发送的检测模型,第二计算设备102获取至少一张待预测图片,输入至检测模型中,得到待预测图片中的像素的预测类型以及预测检测框;第二计算设备102针对一张待预测图片,根据预测类型聚合像素,生成像素区域,并根据像素的预测检测框,确定像素区域的预测检测框;根据像素区域和/或像素区域的预测检测框,确定待预测图片的瑕疵。The second computing device 102 receives the detection model sent by the first computing device 101, and the second computing device 102 obtains at least one picture to be predicted, inputs it into the detection model, and obtains the prediction type and the prediction detection frame of the pixel in the picture to be predicted ; For a picture to be predicted, the second computing device 102 aggregates pixels according to the prediction type to generate a pixel area, and determines the prediction detection frame of the pixel area according to the prediction detection frame of the pixel; according to the prediction detection of the pixel area and/or the pixel area Box to determine the defects of the picture to be predicted.
在一些实例中,检测系统还可以包括终端103。In some examples, the detection system may also include a terminal 103.
其中,终端103可以是任何具有一定计算能力的设备,例如,可以是智能手机、笔记本、PC(personal computer)电脑等。终端103的基本结构包括:至少一个处理器。处理器的数量取决于终端103的配置和类型。终端103也可以包括存储器,该存储器可以为易失性的,例如RAM,也可以为非易失性的,例如只读存储器(Read-Only Memory,ROM)、闪存等,或者也可以同时包括两种类型。存储器内通常存储有操作系统(Operating System,OS)、一个或多个应用程序,也可以存储有程序数据等。除了处理单元和存储器之外,终端103还包括一些基本配置,例如网卡芯片、IO总线、摄像头以及音视频组件等。可选地,终端103还可以包括一些外围设备,例如键盘、鼠标、输入笔、打印机等。其它外围设备在本领域中是众所周知的,在此不做赘述。The terminal 103 may be any device with a certain computing capability, for example, it may be a smart phone, a notebook, a personal computer (PC), etc. The basic structure of the terminal 103 includes: at least one processor. The number of processors depends on the configuration and type of the terminal 103. The terminal 103 may also include a memory. The memory may be volatile, such as RAM, or non-volatile, such as read-only memory (ROM), flash memory, etc., or may include both Kind of type. The memory usually stores an operating system (Operating System, OS), one or more application programs, and may also store program data. In addition to the processing unit and memory, the terminal 103 also includes some basic configurations, such as a network card chip, an IO bus, a camera, and audio and video components. Optionally, the terminal 103 may also include some peripheral devices, such as a keyboard, a mouse, a stylus, and a printer. Other peripheral devices are well known in the art and will not be described in detail here.
在一些实例中,终端103将待预测图片发送至第二计算设备102,并可以接收第二计算设备102返回的对待预测图片进行瑕疵的检测结果。In some examples, the terminal 103 sends the picture to be predicted to the second computing device 102, and may receive the detection result of the defect in the picture to be predicted returned by the second computing device 102.
在上述本实施例中,第一计算设备101可以与第二计算设备102进行网络连接,第二计算设备102可以与终端103进行网络连接,该网络连接可以是有线网络连接。In the foregoing embodiment, the first computing device 101 can be connected to the second computing device 102, and the second computing device 102 can be connected to the terminal 103, and the network connection can be a wired network connection.
需要说明的是,本申请的实施例也可以只通过一个计算设备进行模型的训练以及并直接根据生成的模型进行瑕疵的检测,该计算设备可以为单机服务器或者服务器阵列,或者云化的服务虚拟机VM。It should be noted that the embodiment of the present application can also use only one computing device to train the model and directly perform defect detection based on the generated model. The computing device can be a stand-alone server or a server array, or a cloud-based service virtualization.机VM.
在一些实例中,第一计算设备101还可以从终端103获取至少一张待预测图片,输入至检测模型中,得到待预测图片中的像素的预测类型以及预测检测框;第二计算设备102针对一张待预测图片,根据预测类型聚合像素,生成像素区域,并根据像素的预测检测框,确定像素区域的预测检测框;根据像素区域和/或像素区域的预测检测框,确定待预测图片的瑕疵。In some instances, the first computing device 101 may also obtain at least one picture to be predicted from the terminal 103 and input it into the detection model to obtain the prediction type and the prediction detection frame of the pixel in the picture to be predicted; For a picture to be predicted, the pixels are aggregated according to the prediction type to generate a pixel area, and the prediction detection frame of the pixel area is determined according to the prediction detection frame of the pixel; the prediction detection frame of the pixel area and/or the pixel area is determined defect.
在一些实例中,第二计算设备102也可以获取至少一张图片的特征,根据特征确定该图片中像素的预测类型以及预测检测框,预测类型反映像素是否属于瑕疵的情况,预 测目标框反映像素在具有瑕疵时的瑕疵位置;确定像素的预测类型与真实类型之间的类型损失,以及确定像素的预测检测框与真实检测框之间的检测框损失;根据像素的类型损失以及检测框损失,确定像素的总损失,根据总损失,生成瑕疵的检测模型。In some instances, the second computing device 102 may also obtain the characteristics of at least one picture, and determine the prediction type and the prediction detection frame of the pixel in the picture according to the characteristics. The prediction type reflects whether the pixel is a defect, and the prediction target frame reflects the pixel. The position of the flaw when there is a flaw; determine the type loss between the predicted type and the true type of the pixel, and determine the detection frame loss between the predicted detection frame of the pixel and the real detection frame; according to the pixel type loss and the detection frame loss, Determine the total loss of pixels, and generate a defect detection model based on the total loss.
下面结合方法实施例,可以针对第一计算设备101或第二计算设备102对模型的生成过程以及第一计算设备101或第二计算设备102对瑕疵的检测过程进行详细说明。In the following, in conjunction with the method embodiments, the model generation process of the first computing device 101 or the second computing device 102 and the defect detection process of the first computing device 101 or the second computing device 102 can be described in detail.
图2为本申请一示例性实施例的数据处理方法的流程示意图。本申请实施例提供的该方法200由计算设备执行,该方法200包括以下步骤:FIG. 2 is a schematic flowchart of a data processing method according to an exemplary embodiment of the application. The method 200 provided by the embodiment of the present application is executed by a computing device, and the method 200 includes the following steps:
201:获取至少一张图片的特征,根据特征确定该图片中像素的预测类型以及预测检测框,预测类型反映像素是否属于瑕疵的情况,预测目标框反映像素在具有瑕疵时的瑕疵位置。201: Obtain the feature of at least one picture, and determine the prediction type and the prediction detection frame of the pixel in the picture according to the feature, the prediction type reflects whether the pixel is a defect, and the prediction target frame reflects the defect position of the pixel when it has a defect.
202:确定像素的预测类型与真实类型之间的类型损失,以及确定像素的预测检测框与真实检测框之间的检测框损失。202: Determine the type loss between the predicted type and the true type of the pixel, and determine the detection frame loss between the predicted detection frame and the true detection frame of the pixel.
203:根据像素的类型损失以及检测框损失,确定像素的总损失,根据总损失,生成瑕疵的检测模型。203: Determine the total loss of pixels according to the type loss of pixels and the loss of detection frame, and generate a defect detection model according to the total loss.
以下针对上述步骤进行详细阐述:The following is a detailed description of the above steps:
201:获取至少一张图片的特征,根据特征确定该图片中像素的预测类型以及预测检测框,预测类型反映像素是否属于瑕疵的情况,预测目标框反映像素在具有瑕疵时的瑕疵位置。201: Obtain the feature of at least one picture, and determine the prediction type and the prediction detection frame of the pixel in the picture according to the feature, the prediction type reflects whether the pixel is a defect, and the prediction target frame reflects the defect position of the pixel when it has a defect.
其中,特征是指某一类对象区别于其他类对象的相应(本质)特点或特性,或是这些特点和特性的集合。特征是通过测量或处理能够抽取的数据。对于图像(或图片)而言,每一幅图像都具有能够区别于其他类图像的自身特征,例如,颜色特征、纹理特征、形状特征和空间关系特征等。Among them, characteristics refer to the corresponding (essential) characteristics or characteristics of a certain type of object that are different from other types of objects, or a collection of these characteristics and characteristics. Features are data that can be extracted through measurement or processing. For an image (or picture), each image has its own characteristics that can be distinguished from other types of images, such as color characteristics, texture characteristics, shape characteristics, and spatial relationship characteristics.
预测类型是指对像素是否属于瑕疵的预测分类,当像素属于瑕疵时,其瑕疵所属的类型。可以通过预测概率来确定该像素最终的预测类型。The prediction type refers to the prediction classification of whether a pixel is a defect. When the pixel is a defect, the type of the defect belongs to. The final prediction type of the pixel can be determined by the prediction probability.
预测目标框是指能像素所属瑕疵在图片上的位置所在的预测规则框,如矩形框等。The prediction target frame refers to the prediction rule frame where the defect of the pixel belongs on the picture, such as a rectangular frame.
在一些实例中,获取图片的特征的方式可以为:通过卷积神经网络,获得图片的特征。例如,将图片输入至卷积神经网络中,获取到该图片的各个特征。In some instances, the way to obtain the characteristics of the picture may be: obtaining the characteristics of the picture through a convolutional neural network. For example, input a picture into a convolutional neural network to obtain various features of the picture.
其中,卷积神经网路是指一类包含卷积计算且具有深度结构的前馈神经网络,包含了一个由卷积层、池化层和全连接层构成的特征抽取器。Among them, convolutional neural network refers to a type of feedforward neural network that includes convolutional calculations and has a deep structure. It includes a feature extractor composed of a convolutional layer, a pooling layer, and a fully connected layer.
在一些实例中,根据特征确定该图片中像素的预测类型以及预测检测框,包括:根 据全卷积神经网络模型,对特征进行处理,确定该图片中像素的预测类型以及预测检测框。In some examples, determining the prediction type and prediction detection frame of the pixel in the picture according to the feature includes: processing the feature according to the full convolutional neural network model to determine the prediction type and prediction detection frame of the pixel in the picture.
其中,全卷积神经网络(也可以称为全卷积神经网络模型)是指在卷积神经网络的基础上改进的神经网络,可将卷积神经网络中的全连接层转换为卷积层的神经网络。Among them, a fully convolutional neural network (also called a fully convolutional neural network model) refers to a neural network improved on the basis of a convolutional neural network, which can convert the fully connected layer in the convolutional neural network into a convolutional layer Neural network.
在一些实例中,根据全卷积神经网络模型,对特征进行处理,确定该图片中像素的预测类型以及预测检测框,包括:根据全卷积神经网络模型,对特征进行处理得到像素的至少一个预测类型的预测概率;选择预测概率最大的预测类型作为该像素的预测类型;将预测概率最大的预测类型对应的预测检测框作为该像素的预测检测框。In some instances, processing the features according to the fully convolutional neural network model to determine the prediction type and prediction detection frame of the pixels in the picture includes: processing the features according to the fully convolutional neural network model to obtain at least one of the pixels The prediction probability of the prediction type; the prediction type with the largest prediction probability is selected as the prediction type of the pixel; the prediction detection frame corresponding to the prediction type with the largest prediction probability is used as the prediction detection frame of the pixel.
例如,计算设备可以从其他计算设备节点获取到多个图片,并对多个图片进行归一化处理,将处理后的图片输入至卷积神经网络(也可以称为卷积神经网络模型)中,获取到处理后的图片的特征或特征层。计算设备在根据全卷积神经网络(也可以称为全卷积神经网络模型)对处理后的图片的特征或特征层进行处理,对对应图片上的每个像素进行分类,得到像素的预测类型的预测概率,同时根据全卷积神经网络确定每个预测类型对应的预测检测框,如A图片的a像素的不具有瑕疵的预测概率为0.2,具有a瑕疵的预测概率为0.6,具有b瑕疵的预测概率为0.3,选择预测概率最大的预测类型作为该像素的预测类型,即a像素的预测类型为a瑕疵,并获取该a瑕疵对应的预测检测框对应的矩形框坐标(predx1、predx2、predy1、predy2)作为像素a的预测检测框的坐标。For example, the computing device can obtain multiple pictures from other computing device nodes, normalize the multiple pictures, and input the processed pictures into a convolutional neural network (also called a convolutional neural network model) , Get the feature or feature layer of the processed picture. The computing device is processing the feature or feature layer of the processed picture according to the full convolutional neural network (also called the full convolutional neural network model), classifying each pixel on the corresponding picture, and obtaining the prediction type of the pixel At the same time, the prediction detection frame corresponding to each prediction type is determined according to the full convolutional neural network. For example, the prediction probability of a pixel of A picture without defect is 0.2, the prediction probability of a defect is 0.6, and the prediction probability of a defect is 0.6. The prediction probability of is 0.3, the prediction type with the highest prediction probability is selected as the prediction type of the pixel, that is, the prediction type of a pixel is a defect, and the rectangular frame coordinates (predx1, predx2, predy1, predy2) are used as the coordinates of the prediction detection frame of pixel a.
需要说明的是,对于预测检测框为矩形框而言,其坐标是具有相同横坐标的两个点和相同纵坐标的两个点组成,故为了简单示意可将矩形块坐标写成(pred x1、pred x2、pred y1、pred y2)的形式。It should be noted that for the prediction detection frame as a rectangular frame, its coordinates are composed of two points with the same abscissa and two points with the same ordinate, so for simple illustration, the coordinates of the rectangular block can be written as (pred x1, pred x2, pred y1, pred y2).
此外,在前文所涉及到的坐标均是在图片中的坐标。In addition, the coordinates mentioned above are all coordinates in the picture.
202:确定像素的预测类型与真实类型之间的类型损失,以及确定像素的预测检测框与真实检测框之间的检测框损失。202: Determine the type loss between the predicted type and the true type of the pixel, and determine the detection frame loss between the predicted detection frame and the true detection frame of the pixel.
其中,类型损失是指用来评价的预测类型和真实类型之间不一样的程度,如,类型不同的程度。其中,真实类型是指对像素是否属于瑕疵的真实分类,且每个像素只属于一种真实类型,该真实类型是已知数据。Among them, the type loss refers to the degree of difference between the predicted type used for evaluation and the true type, for example, the degree of different types. Among them, the true type refers to a true classification of whether a pixel belongs to a defect, and each pixel belongs to only one true type, and the true type is known data.
检测框损失是指用来评价的预测检测框与真实检测框之间不一样的程度,如,坐标位置不同的程度。其中,真实检测框是指能像素所属瑕疵在图片上的位置所在的真实规则框,如矩形框等,且每个像素只具有一种真实检测框,该真实检测框是已知数据。The detection frame loss refers to the degree of difference between the predicted detection frame used for evaluation and the real detection frame, for example, the degree of different coordinate positions. Among them, the real detection frame refers to a real regular frame where the defect of the pixel belongs on the picture, such as a rectangular frame, etc., and each pixel has only one real detection frame, and the real detection frame is known data.
在一些实例中,确定像素的预测类型与真实类型之间的类型损失,包括:根据像素 的真实类型以及与该真实类型相符的预测类型的预测概率,确定该真实类型下的像素的类型损失。In some instances, determining the type loss between the predicted type and the true type of the pixel includes: determining the type loss of the pixel under the true type according to the true type of the pixel and the predicted probability of the predicted type that matches the true type.
在一些实例中,可以通过下式1)确定像素的预测类型与真实类型之间的类型损失:In some instances, the type loss between the predicted type and the true type of the pixel can be determined by the following formula 1):
Figure PCTCN2020073704-appb-000001
Figure PCTCN2020073704-appb-000001
其中,Loss_per_pixel o为类型损失,M为真实类型的总数目,y o,c为像素o预测类型是否为真实类型c对应的数值,p o,c是像素o属于预测类型c的预测概率。 Among them, Loss_per_pixel o is the type loss, M is the total number of true types, y o,c is the value corresponding to whether the prediction type of the pixel o is the true type c, and p o,c is the predicted probability of the pixel o belonging to the prediction type c.
需要说明的是,真实类型的总数目是指多个图片的所有像素所涉及的真实类型的总数目,如共涉及7个类型,无瑕疵、a瑕疵、b瑕疵、c瑕疵、d瑕疵、e瑕疵以及f瑕疵。当像素o的预测类型与真实类型相同时,y o,c为1,当像素o的预测类型与真实类型不相同时,y o,c为0。c属于M,可以为1-7。 It should be noted that the total number of true types refers to the total number of true types involved in all pixels of multiple pictures. For example, there are 7 types involved, including no defect, a defect, b defect, c defect, d defect, e Flaws and f flaws. When the prediction type of the pixel o is the same as the true type, y o,c is 1, and when the prediction type of the pixel o is different from the true type, y o,c is 0. c belongs to M and can be 1-7.
例如,根据前文所述,以像素a为例进行说明,像素a的瑕疵类型为a瑕疵,即a瑕疵类型,对于a像素而言其类型损失=0(c=1)-1*log0.6(c=2)+0(c=3)+0(c=4)+0(c=5)+0(c=6)+0(c=7)=-log 0.6。For example, according to the above, taking pixel a as an example, the defect type of pixel a is a defect, that is, a defect type. For a pixel, its type loss=0 (c=1)-1*log0.6 (c=2)+0(c=3)+0(c=4)+0(c=5)+0(c=6)+0(c=7)=-log 0.6.
需要说明的是,c=1是指当真实类型为无瑕疵类型,c=2是指当真实类型为a瑕疵类型,以此类推直至c=7,不再赘述。It should be noted that c=1 means when the real type is a flawless type, c=2 means when the real type is a flawed type, and so on until c=7, which will not be repeated.
在一些实例中,确定像素的预测检测框与真实检测框之间的检测框损失,包括:根据预测检测框在对应图片中的预测坐标,确定该预测检测框对于对应像素的相对预测坐标;获取真实检测框对于对应像素的相对真实坐标;确定相对预测坐标与相对真实坐标之间的坐标距离;根据坐标距离确定检测框损失。In some instances, determining the detection frame loss between the predicted detection frame of the pixel and the real detection frame includes: determining the relative predicted coordinates of the predicted detection frame for the corresponding pixel according to the predicted coordinates of the predicted detection frame in the corresponding picture; The relative real coordinates of the real detection frame to the corresponding pixels; determine the coordinate distance between the relative predicted coordinates and the relative real coordinates; determine the loss of the detection frame according to the coordinate distance.
其中,预测坐标是指前文所述的通过全卷积神经网络得到的预测检测框对应的坐标位置,例如预测检测框对应的矩形框坐标(pred x1、pred x2、pred y1、pred y2)。Among them, the predicted coordinates refer to the coordinate positions corresponding to the predicted detection frame obtained through the full convolutional neural network described above, for example, the rectangular frame coordinates (pred x1, pred x2, pred y1, pred y2) corresponding to the predicted detection frame.
真实检测框在对应图片中的真实坐标是像素真实检测框对应的坐标位置,例如真实检测框对应的矩形框坐标(x1、x2、y1、y2),且该真实坐标位是已知的。The real coordinates of the real detection frame in the corresponding picture are the coordinate positions of the pixel real detection frame, for example, the rectangular frame coordinates (x1, x2, y1, y2) corresponding to the real detection frame, and the real coordinates are known.
相对预测坐标是指以该像素为基准,预测检测框所在的坐标位置。The relative prediction coordinate refers to the coordinate position where the detection frame is predicted based on the pixel.
相对真实坐标是指以该像素为基准,真实检测框所在的坐标位置。The relative real coordinate refers to the coordinate position of the real detection frame based on the pixel.
在一些实例中,相对预测坐标的确定方式可以为:设预测检测框位置为(pred x1、pred x2、pred y1、pred y2),当下像素坐标为(x,y),图片大小设为(w,h),w为图片宽度,h为图片高度,则相对预测坐标(也可以称为回归目标)为((x-pred x1)/w,(y- pred y1)/h,(pred x2-x)/w,(pred y2-y)/h)。In some instances, the relative prediction coordinates can be determined as follows: suppose the position of the prediction detection frame is (pred x1, pred x2, pred y1, pred y2), the current pixel coordinates are (x, y), and the picture size is set to (w ,h), w is the width of the picture, and h is the height of the picture. The relative prediction coordinates (also called regression target) are ((x-pred x1)/w,(y- pred y1)/h,(pred x2- x)/w,(pred y2-y)/h).
需要说明的是,相对真实坐标的确定方式与相对预测坐标的确定方式相同,此处就不再赘述。例如,相对真实坐标可以为((x-x1)/w,(y-y1)/h,(x2-x)/w,(y2-y)/h)。It should be noted that the method for determining the relative real coordinates is the same as the method for determining the relative predicted coordinates, and will not be repeated here. For example, the relative real coordinates can be ((x-x1)/w, (y-y1)/h, (x2-x)/w, (y2-y)/h).
此外,对于相对真实坐标是在对应的像素具有瑕疵的前提下才存在的,相对预测坐标是在对应的像素预测具有瑕疵的前提下才存在的。当像素存在相对预测坐标时,其可以不存在相对真实坐标,此时,相对真实坐标为0。In addition, the relative real coordinates only exist under the premise that the corresponding pixel has a defect, and the relative prediction coordinates only exist under the premise that the corresponding pixel prediction has a defect. When the pixel has a relative prediction coordinate, it may not have a relative real coordinate. At this time, the relative real coordinate is 0.
在一些实例中,可以通过公式2)确定检测框损失:In some instances, the detection frame loss can be determined by formula 2):
Figure PCTCN2020073704-appb-000002
Figure PCTCN2020073704-appb-000002
其中,Loss det为检测框损失,x为坐标距离。 Among them, Loss det is the loss of the detection frame, and x is the coordinate distance.
例如,根据前文所述,对于像素a而言,x为((x-pred x1)/w,(y-pred y1)/h,(pred x2-x)/w,(pred y2-y)/h)与((x-x1)/w,(y-y1)/h,(x2-x)/w,(y2-y)/h)的坐标距离。当|x|小于1时,则检测框损失为0.5x 2,否则当|x|大于或等于1时检测框损失为|x|-0.5。 For example, according to the above, for pixel a, x is ((x-pred x1)/w,(y-pred y1)/h,(pred x2-x)/w,(pred y2-y)/ h) Coordinate distance from ((x-x1)/w, (y-y1)/h, (x2-x)/w, (y2-y)/h). When |x| is less than 1, the detection frame loss is 0.5x 2 , otherwise when |x| is greater than or equal to 1, the detection frame loss is |x|-0.5.
203:根据像素的类型损失以及检测框损失,确定像素的总损失,根据总损失,生成瑕疵的检测模型。203: Determine the total loss of pixels according to the type loss of pixels and the loss of detection frame, and generate a defect detection model according to the total loss.
其中,总损失是指用来评价的预测瑕疵与真实瑕疵之间不一样的检测程度。Among them, the total loss refers to the detection degree of the difference between the predicted flaw and the real flaw used for evaluation.
在一些实例中,根据像素的类型损失以及检测框损失,确定像素的总损失,包括:根据像素的类型损失,确定像素的类型损失和;根据像素的检测框损失,确定像素的检测框损失和;根据类型损失和与检测框损失和,确定总损失。In some instances, determining the total loss of pixels according to the type loss of the pixel and the loss of the detection frame includes: determining the type loss sum of the pixel according to the type loss of the pixel; determining the detection frame loss sum of the pixel according to the loss of the detection frame of the pixel ; Determine the total loss based on the type loss sum and the detection frame loss sum.
在一些实例中,可以通过下式3)确定像素的类型损失和Loss clsIn some instances, the pixel type loss and Loss cls can be determined by the following equation 3):
Figure PCTCN2020073704-appb-000003
Figure PCTCN2020073704-appb-000003
其中,N为多个图片的像素的总数目。Among them, N is the total number of pixels in multiple pictures.
故,类型损失和Loss cls为多个图片中的所有像素的类型损失的总和。 Therefore, the type loss and Loss cls are the sum of the type loss of all pixels in multiple pictures.
在一些实例中,确定像素的检测框损失和的方式可以为:多个图片中的具有预测检测框的像素的检测框损失的总和。In some instances, the method of determining the sum of the detection frame losses of the pixels may be: the sum of the detection frame losses of the pixels with the predicted detection frame in multiple pictures.
在一些实例中,根据类型损失和与检测框损失和,确定总损失,包括:根据加权求和算法,确定类型损失和与检测框损失和的总损失。In some examples, determining the total loss according to the sum of the type loss and the sum of the detection frame loss includes: determining the total loss of the type loss and the sum of the detection frame loss according to a weighted sum algorithm.
在一些实例中,可以通过下式4)确定总损失Loss:In some instances, the total loss Loss can be determined by the following equation 4):
Figure PCTCN2020073704-appb-000004
Figure PCTCN2020073704-appb-000004
其中,
Figure PCTCN2020073704-appb-000005
为权重系数,总Loss det为检测框损失和。
among them,
Figure PCTCN2020073704-appb-000005
Is the weight coefficient, and the total Loss det is the sum of the loss of the detection frame.
为了降低误报率,需要对容易产生误报的负样本进行挖掘。而这样的样本可能存在于没有瑕疵的图片上,因此需要有选择性的筛选负样本。正样本由于一直参与训练,因此不会受影响。In order to reduce the false alarm rate, it is necessary to mine negative samples that are prone to false alarms. Such samples may exist in images without defects, so negative samples need to be selectively screened. Since positive samples have been participating in training, they will not be affected.
在一些实例中,该方法200还包括:针对任一图片,从该图片中不属于瑕疵的正常像素中获取困难负样本,困难负样本是指具有预定质量的负样本;针对任一图片,将该图片中属于瑕疵的像素作为正样本;其中,根据像素的类型损失,确定像素的类型损失和,包括:确定至少一张图片中的困难负样本的类型损失和;确定至少一张图片中的正样本的类型损失和,将困难负样本的类型损失和与正样本的类型损失和,作为对应图片的类型损失。In some examples, the method 200 further includes: for any picture, obtaining difficult negative samples from normal pixels that are not defective in the picture. The difficult negative samples refer to negative samples with predetermined quality; for any picture, Defective pixels in the picture are taken as positive samples; among them, determining the type loss sum of pixels according to the type loss of pixels includes: determining the type loss sum of difficult negative samples in at least one picture; determining the type loss sum of at least one picture The type loss sum of the positive sample, the type loss sum of the difficult negative sample and the type loss sum of the positive sample, are used as the type loss of the corresponding picture.
其中,正样本是指属于瑕疵的像素。Among them, the positive sample refers to the pixel belonging to the defect.
负样本是指不属于瑕疵的正常像素。Negative samples refer to normal pixels that are not blemishes.
困难负样本是指优质的负样本,容易将其检测为瑕疵的像素。Difficult negative samples refer to high-quality negative samples, which are easily detected as defective pixels.
在一些实例中,从该图片中不属于瑕疵的正常像素中获取困难负样本,包括:将每个图片中不属于瑕疵的正常像素作为负样本,并确定负样本的类型损失;将负样本的类型损失由大到小进行排序,并选择出相邻类型损失差距最大对应的两个负样本,将排序靠后的负样本作为临界点,将排序在临界点之前的负样本作为困难负样本。In some examples, obtaining difficult negative samples from normal pixels that are not defective in the picture includes: taking normal pixels that are not defective in each picture as negative samples, and determining the type loss of negative samples; The type loss is sorted from large to small, and two negative samples corresponding to the largest loss of adjacent types are selected, the negative sample that is sorted later is used as the critical point, and the negative sample sorted before the critical point is used as the difficult negative sample.
例如,根据前文所述,从多个图片中选择器任一图片为例进行说明,对于图片A中具有多个负样本,根据式1)分别计算每个负样本的类型损失,并将得到的多个像素的类型损失进行由大到小的排序,从该排序中选择出相邻损失差距最大对应的两个负样本,如图7所示,可知相邻损失差距最大是0.7与0.3之间的差距0.4,此时0.7对应的负样本为排序中的第200个负样本,0.3对应的负样本为排序中的第201个负样本,则将选择第201个负样本作为临界点,则0.3为对应的差距点gap point,选择前200个负样本作为困难负样本。For example, according to the foregoing, select any picture from multiple pictures as an example for description. For picture A with multiple negative samples, calculate the type loss of each negative sample according to formula 1), and obtain The type loss of multiple pixels is sorted from large to small, and the two negative samples corresponding to the largest adjacent loss gap are selected from this ranking. As shown in Figure 7, it can be seen that the maximum adjacent loss gap is between 0.7 and 0.3 The difference of 0.4, at this time, the negative sample corresponding to 0.7 is the 200th negative sample in the sorting, and the negative sample corresponding to 0.3 is the 201st negative sample in the sorting, then the 201st negative sample will be selected as the critical point, then 0.3 For the corresponding gap point, select the first 200 negative samples as difficult negative samples.
需要说明的是,对每个图片都进行困难负样本的选择,得到多个图片对应的多个困难负样本。It should be noted that the selection of difficult negative samples is performed for each picture, and multiple difficult negative samples corresponding to multiple pictures are obtained.
在一些实例中,可以通过下式5)和下式6)来确定困难负样本的类型损失和:In some instances, the type loss sum of difficult negative samples can be determined by the following formula 5) and formula 6):
Figure PCTCN2020073704-appb-000006
Figure PCTCN2020073704-appb-000006
其中,weight o为像素o的权重,gaploss为差距点gappoint。 Among them, weight o is the weight of pixel o, and gaploss is the gap point gappoint.
其中,负样本的类型损失和Loss 负样本计算如下式6): Among them, the type loss of the negative sample and Loss negative sample are calculated as the following formula 6):
Figure PCTCN2020073704-appb-000007
Figure PCTCN2020073704-appb-000007
其中,负样本Loss_per_pixel o为像素o的负样本的类型损失。 Among them, the negative sample Loss_per_pixel o is the type loss of the negative sample of pixel o.
需要说明的是,公式5)和公式6)是针对一张图片而言的。多个图片中的每个图片都可以根据公式5)和公式6)进行处理,获取到困难负样本的类型损失和。It should be noted that formula 5) and formula 6) are for a picture. Each of the multiple pictures can be processed according to formula 5) and formula 6), and the type loss sum of the difficult negative samples can be obtained.
将多个图片的Loss 负样本与多个图片的每个正样本的类型损失进行求和,得到多个图片对应的Loss clsThe Loss negative samples of multiple pictures and the type loss of each positive sample of the multiple pictures are summed to obtain Loss cls corresponding to the multiple pictures.
需要说明的是,为了保证算法训练收敛,对于包含瑕疵的图片,若瑕疵像素样本数目为N,则参与训练负样本数目至少为N,至多为5N。对于不含瑕疵的图像,可以根据上述方式进行困难负样本的数目确定,为了保证算法收敛,可以设置困难负样本的数目阈值,如任一图片的大小为(w,h),则选择困难负样本数目至多为(w*h)/r,其中,r为比例值。对于包含瑕疵的图片,也根据上述方式进行困难负样本的数目确定。It should be noted that, in order to ensure the convergence of algorithm training, if the number of defective pixel samples is N for images containing defects, the number of negative samples participating in training is at least N and at most 5N. For images without flaws, the number of difficult negative samples can be determined according to the above method. In order to ensure the convergence of the algorithm, the threshold of the number of difficult negative samples can be set. If the size of any picture is (w, h), select the difficult negative The number of samples is at most (w*h)/r, where r is the ratio value. For pictures containing defects, the number of difficult negative samples is also determined according to the above method.
在一些实例中,根据总损失,生成瑕疵的检测模型,包括:根据总损失,更新检测模型的检测参数,进行模型的迭代训练,直到满足迭代训练停止条件,生成检测模型。In some instances, generating a defect detection model based on the total loss includes: updating the detection parameters of the detection model according to the total loss, and performing iterative training of the model until the iterative training stop condition is met, and generating the detection model.
其中,检测参数是用于检测瑕疵的参数,例如卷积神经网络中的参数,可以用于获取图片的特征,或全卷积神经网络的参数,可以用于确定该图片中像素的预测类型以及预测检测框。Among them, the detection parameters are parameters used to detect defects, such as parameters in a convolutional neural network, which can be used to obtain features of a picture, or parameters of a fully convolutional neural network, which can be used to determine the prediction type of pixels in the picture and Predict the detection frame.
例如,根据前文所述,根据总损失,来调整全卷积神经网络的参数,在进行上述步骤继续确定新的总损失,并根据总损失继续调整全卷积神经网络的参数,持续进行全卷积神经网络的迭代,直到总损失维持在一个阈值范围内,或者训练次数达到了阈值,即可停止训练,得到一个训练好的检测模型,如全卷积神经网络模型。For example, according to the foregoing, the parameters of the fully convolutional neural network are adjusted according to the total loss, and the new total loss is continuously determined after the above steps, and the parameters of the fully convolutional neural network are adjusted according to the total loss, and the full volume is continuously performed Iteration of the product neural network, until the total loss is maintained within a threshold range, or the number of training times reaches the threshold, the training can be stopped and a trained detection model, such as a fully convolutional neural network model, can be obtained.
本申请实施例,通过全卷积神经网络,直接对像素值进行分割,同时对其预测检测框进行回归,从而能够避免瑕疵宽高比差距过大,无法覆盖的问题,实现多尺度、形变大瑕疵的检测;通过对负样本进行数目动态筛选,保证正样本参与训练以及困难负样本得到训练,同时针对工业瑕疵检测场景中,无瑕疵图片远多余有瑕疵图片的特性,充分利用没有瑕疵的图片进行负样本训练,其中容易引起误报的地方会参与训练,保持正负比例均衡,降低误报的同时不会降低模型召回率。In the embodiment of the present application, the pixel value is directly segmented through the fully convolutional neural network, and the prediction detection frame is regressed at the same time, so as to avoid the problem that the defect aspect ratio gap is too large and cannot be covered, and realizes multi-scale and large deformation Defect detection; by dynamically screening the number of negative samples, it ensures that positive samples participate in training and difficult negative samples are trained. At the same time, in the industrial defect detection scene, flawless pictures are far more than flawed pictures, making full use of pictures without flaws Negative sample training is carried out, and the areas that are likely to cause false alarms will participate in the training, maintaining a balance between positive and negative ratios, and reducing false alarms without reducing the model recall rate.
图3为本申请另一示例性实施例提供的一种瑕疵的检测方法的流程示意图。本申请实施例提供的该方法300由计算设备执行,该方法300包括以下步骤:FIG. 3 is a schematic flowchart of a defect detection method provided by another exemplary embodiment of the application. The method 300 provided in the embodiment of the present application is executed by a computing device, and the method 300 includes the following steps:
301:获取至少一张待预测图片,确定待预测图片中的像素的预测类型以及预测检测框。301: Obtain at least one picture to be predicted, and determine the prediction type and the prediction detection frame of the pixel in the picture to be predicted.
302:针对一张待预测图片,根据预测类型聚合像素,生成像素区域,并根据像素的预测检测框,确定像素区域的预测检测框。302: For a picture to be predicted, the pixels are aggregated according to the prediction type to generate a pixel area, and the prediction detection frame of the pixel area is determined according to the prediction detection frame of the pixel.
303:根据像素区域和/或像素区域的预测检测框,确定待预测图片的瑕疵。303: Determine the defect of the picture to be predicted according to the pixel area and/or the predicted detection frame of the pixel area.
以下针对上述步骤进行详细阐述:The following is a detailed description of the above steps:
301:获取至少一张待预测图片,确定待预测图片中的像素的预测类型以及预测检测框。301: Obtain at least one picture to be predicted, and determine the prediction type and the prediction detection frame of the pixel in the picture to be predicted.
在一些实例中,确定待预测图片中的像素的预测类型以及预测检测框,包括:将至少一张待预测图片输入至生成的瑕疵的检测模型,得到待预测图片中的像素的预测类型以及预测检测框。In some examples, determining the prediction type and prediction detection frame of the pixel in the picture to be predicted includes: inputting at least one picture to be predicted into the generated defect detection model to obtain the prediction type and prediction of the pixel in the picture to be predicted Check box.
例如,根据前文所述,计算设备可以从终端获取到多张待预测图片,并将多张待预测图片进行归一化处理,并将处理后的图片输入至生成的瑕疵的检测模型中,如,全卷积神经网络模型中,进行前向传播,得到待预测图片中的像素的预测类型以及预测检测框。For example, according to the foregoing, the computing device can obtain multiple to-be-predicted pictures from the terminal, normalize the multiple to-be-predicted pictures, and input the processed pictures into the generated defect detection model, such as In the fully convolutional neural network model, forward propagation is performed to obtain the prediction type and the prediction detection frame of the pixel in the picture to be predicted.
302:针对一张待预测图片,根据预测类型聚合像素,生成像素区域,并根据像素的预测检测框,确定像素区域的预测检测框。302: For a picture to be predicted, the pixels are aggregated according to the prediction type to generate a pixel area, and the prediction detection frame of the pixel area is determined according to the prediction detection frame of the pixel.
其中,像素区域是指由多个像素组成的区域。Among them, the pixel area refers to an area composed of multiple pixels.
在一些实例中,根据预测类型聚合像素,生成像素区域,包括:根据预测类型的预测概率,确定每个像素的瑕疵类型;根据瑕疵类型,聚合像素,生成相同瑕疵类型的像素的聚合区域,作为像素区域。In some instances, aggregating pixels according to the prediction type to generate a pixel area includes: determining the defect type of each pixel according to the predicted probability of the prediction type; aggregating pixels according to the defect type to generate an aggregate area of pixels of the same defect type, as Pixel area.
在一些实例中,该方法300还包括:将相同瑕疵类型作为该像素区域的瑕疵类型;其中,根据像素的预测检测框,确定像素区域的预测检测框,包括:选择像素区域中该瑕疵类型的预测概率最高的像素的预测检测框作为该像素区域的预测检测框。In some examples, the method 300 further includes: using the same defect type as the defect type of the pixel area; wherein, determining the predicted detection frame of the pixel area according to the predicted detection frame of the pixel includes: selecting the defect type of the pixel area The predicted detection frame of the pixel with the highest predicted probability is used as the predicted detection frame of the pixel area.
例如,根据前文所述,计算设备通过生成的瑕疵检测模型中的softmax函数(归一化指数函数)的方式,对像素的预测概率进行处理,获取每个像素的最大预测概率对应的预测类型,作为每个像素的瑕疵类型;根据每个像素的瑕疵类型进行区域的聚合,将同一个瑕疵类型的像素进行聚合,生成像素区域,若该像素区域中的像素的瑕疵类型为 瑕疵c,则该像素区域的瑕疵类型也为瑕疵c,从而获得瑕疵的语义分割结果,如图5所示,其中聚合区域为矩形框中的椭圆区域。选择该像素区域中瑕疵c的预测概率最高的像素,将该像素的预测检测框作为该像素区域的预测检测框。For example, according to the foregoing, the computing device processes the predicted probability of the pixel by means of the softmax function (normalized exponential function) in the generated flaw detection model to obtain the prediction type corresponding to the maximum predicted probability of each pixel. As the defect type of each pixel; the area is aggregated according to the defect type of each pixel, and the pixels of the same defect type are aggregated to generate a pixel area. If the defect type of the pixel in the pixel area is defect c, then The defect type of the pixel area is also defect c, so that the semantic segmentation result of the defect is obtained, as shown in Fig. 5, where the aggregation area is an elliptical area in a rectangular frame. The pixel with the highest predicted probability of defect c in the pixel area is selected, and the predicted detection frame of this pixel is used as the predicted detection frame of the pixel area.
需要说明的是,语义分割结果是指根据图像的语义来进行分割,如图像内容作为语义。It should be noted that the semantic segmentation result refers to segmentation according to the semantics of the image, such as image content as the semantics.
此外,还可以直接通过全卷积神经网络模型确定该像素区域的瑕疵类型,实现语义分割。In addition, the defect type of the pixel area can also be determined directly through the fully convolutional neural network model to realize semantic segmentation.
303:根据像素区域和/或像素区域的预测检测框,确定待预测图片的瑕疵。303: Determine the defect of the picture to be predicted according to the pixel area and/or the predicted detection frame of the pixel area.
在一些实例中,根据像素区域和/或像素区域的预测检测框,确定待预测图片的瑕疵,包括:当像素区域的瑕疵类型属于第一类型时,将像素区域的瑕疵类型作为该待预测图片包含的瑕疵类型,将像素区域的预测检测框作为该待预测图片包含的瑕疵的预测检测框;当像素区域中的部分像素超出预测检测框时,从像素区域中去除部分像素,将剩余像素组成的区域作为该待预测图片包含的瑕疵的像素区域。In some examples, determining the defect of the picture to be predicted according to the predicted detection frame of the pixel area and/or the pixel area includes: when the defect type of the pixel area belongs to the first type, taking the defect type of the pixel area as the picture to be predicted The type of flaw included, the prediction detection frame of the pixel area is used as the prediction detection frame of the flaw contained in the picture to be predicted; when some pixels in the pixel area exceed the prediction detection frame, some pixels are removed from the pixel area and the remaining pixels are composed The area of is used as the pixel area of the defect contained in the picture to be predicted.
其中,第一类型可以为块状瑕疵,如图5所示,椭圆形区域。Among them, the first type may be block defects, as shown in FIG. 5, an oval area.
例如,根据前文所述,当像素区域的瑕疵类型为瑕疵a,且瑕疵a属于块状瑕疵的一种,则对应的待预测图片中包含块状瑕疵,计算设备直接将该像素区域的预测检测框作为块状瑕疵的预测检测框,同时,将超出该预测检测框的像素区域中的像素去除,将像素区域中的剩余像素组成的区域作为该块状瑕疵的像素区域。For example, according to the foregoing, when the defect type of the pixel area is defect a, and the defect a is a type of block defect, then the corresponding picture to be predicted contains block defects, and the computing device directly detects the prediction of the pixel area The frame is used as the predictive detection frame of the blocky defect, and at the same time, the pixels in the pixel area beyond the predicted detection frame are removed, and the area composed of the remaining pixels in the pixel area is taken as the pixel area of the blocky defect.
在一些实例中,根据像素区域和/或像素区域的预测检测框,确定待预测图片的瑕疵,包括:当像素区域的瑕疵类型属于第二类型时,将像素区域的瑕疵类型作为该待预测图片包含的瑕疵类型,将像素区域作为该待预测图片包含的瑕疵的像素区域,将像素区域的最小外接矩形框作为该待预测图片包含的瑕疵的预测检测框。In some examples, determining the defect of the picture to be predicted according to the prediction detection frame of the pixel area and/or the pixel area includes: when the defect type of the pixel area belongs to the second type, using the defect type of the pixel area as the picture to be predicted The types of defects included are the pixel area as the pixel area of the defect contained in the picture to be predicted, and the smallest bounding rectangle of the pixel area is taken as the prediction detection frame of the defect contained in the picture to be predicted.
其中,第一类型可以为线状瑕疵,如图6所示,几条线状瑕疵。Among them, the first type may be linear defects, as shown in FIG. 6, several linear defects.
例如,根据前文所述,当像素区域的瑕疵类型为瑕疵d,且瑕疵d属于线状瑕疵的一种,则对应的待预测图片中包含线状瑕疵,计算设备采用openCV的minAreaRect函数的方法寻找线状瑕疵的最小外接矩形框,作为预测检测框的输出结果,同时直接将像素区域作为线状瑕疵的像素区域。For example, according to the foregoing, when the defect type of the pixel area is defect d, and the defect d is a type of linear defect, the corresponding image to be predicted contains linear defects, and the computing device uses the method of openCV's minAreaRect function to find The minimum circumscribed rectangular frame of the linear defect is used as the output result of the prediction detection frame, and the pixel area is directly used as the pixel area of the linear defect.
应理解,对于块状瑕疵以及线状瑕疵对应的瑕疵类型是已知的,故,可以根据不同的瑕疵类型,确定该瑕疵属于线状瑕疵还是块状瑕疵。It should be understood that the defect types corresponding to the block defects and the linear defects are known, so it can be determined whether the defect is a linear defect or a block defect according to different types of defects.
本申请的实施例,工业检测中常见的两类瑕疵,块状瑕疵和线状瑕疵,采用不同后 处理方式,块状瑕疵检测结果置信度更高,线状瑕疵语义分割结果置信度更高。In the embodiment of the present application, two types of common defects in industrial inspection, block defects and linear defects, adopt different post-processing methods, so that the confidence of the detection result of the block defect is higher, and the confidence of the semantic segmentation result of the linear defect is higher.
图4为本申请另一示例性实施例提供的又一种瑕疵的检测方法的流程示意图。本申请实施例提供的该方法400由计算设备执行,该方法400包括以下步骤:FIG. 4 is a schematic flowchart of yet another defect detection method provided by another exemplary embodiment of the application. The method 400 provided in the embodiment of the present application is executed by a computing device, and the method 400 includes the following steps:
401:获取至少一张图片的特征,根据特征确定该图片中像素的预测类型以及预测检测框,预测类型反映像素是否属于瑕疵的情况,预测目标框反映像素在具有瑕疵时的瑕疵位置。401: Obtain the feature of at least one picture, and determine the prediction type and the prediction detection frame of the pixel in the picture according to the feature, the prediction type reflects whether the pixel is a defect, and the prediction target frame reflects the defect position of the pixel when it has a defect.
402:确定像素的预测类型与真实类型之间的类型损失,以及确定像素的预测检测框与真实检测框之间的检测框损失。402: Determine the type loss between the predicted type and the true type of the pixel, and determine the detection frame loss between the predicted detection frame and the true detection frame of the pixel.
403:根据像素的类型损失以及检测框损失,确定像素的总损失,根据总损失,生成瑕疵的检测模型。403: Determine the total loss of pixels according to the loss of the pixel type and the loss of the detection frame, and generate a defect detection model based on the total loss.
404:根据生成瑕疵的检测模型,确定待预测图片中的像素的预测类型以及预测检测框。404: Determine the prediction type and the prediction detection frame of the pixel in the picture to be predicted according to the detection model of the generated defect.
405:针对一张待预测图片,根据预测类型聚合像素,生成像素区域,并根据像素的预测检测框,确定像素区域的预测检测框。405: For a picture to be predicted, the pixels are aggregated according to the prediction type to generate a pixel area, and the prediction detection frame of the pixel area is determined according to the prediction detection frame of the pixel.
406:根据像素区域和/或像素区域的预测检测框,确定待预测图片的瑕疵。406: Determine the defect of the picture to be predicted according to the pixel area and/or the predicted detection frame of the pixel area.
需要说明的是,上述实施例所提供方法400中的步骤的具体实施方式在前文已经详细阐述过了,此处就不再赘述。It should be noted that the specific implementation of the steps in the method 400 provided in the foregoing embodiment has been described in detail above, and will not be repeated here.
图8为本申请又一示例性实施例提供的数据处理装置的结构框架示意图。该数据处理800可以应用于计算设备中,该数据处理800包括获取模块801、确定模块802以及生成模块803,以下针对各个模块的功能进行详细的阐述:FIG. 8 is a schematic structural diagram of a data processing device provided by another exemplary embodiment of this application. The data processing 800 can be applied to a computing device. The data processing 800 includes an acquisition module 801, a determination module 802, and a generation module 803. The functions of each module are described in detail below:
获取模块801,用于获取至少一张图片的特征,根据特征确定该图片中像素的预测类型以及预测检测框,预测类型反映像素是否属于瑕疵的情况,预测目标框反映像素在具有瑕疵时的瑕疵位置。The obtaining module 801 is used to obtain the characteristics of at least one picture, and determine the prediction type and the prediction detection frame of the pixel in the picture according to the characteristics, the prediction type reflects whether the pixel is a defect, and the prediction target frame reflects the defect of the pixel when it has a defect position.
确定模块802,用于确定像素的预测类型与真实类型之间的类型损失,以及确定像素的预测检测框与真实检测框之间的检测框损失;The determining module 802 is used to determine the type loss between the predicted type and the true type of the pixel, and the detection frame loss between the predicted detection frame and the true detection frame of the pixel;
生成模块803,用于根据像素的类型损失以及检测框损失,确定像素的总损失,根据总损失,生成瑕疵的检测模型。The generating module 803 is used to determine the total loss of pixels according to the type loss of the pixels and the loss of the detection frame, and generate a defect detection model according to the total loss.
在一些实例中,生成模块803包括:第一确定单元,用于根据像素的类型损失,确定像素的类型损失和;第二确定单元,用于根据像素的检测框损失,确定像素的检测框 损失和;第三确定单元,用于根据类型损失和与检测框损失和,确定总损失。In some examples, the generating module 803 includes: a first determining unit for determining the type loss of the pixel according to the type loss of the pixel; and a second determining unit for determining the detection frame loss of the pixel according to the loss of the detection frame of the pixel和; The third determining unit is used to determine the total loss according to the type loss sum and the detection frame loss sum.
在一些实例中,获取模块801,用于针对任一图片,从该图片中不属于瑕疵的正常像素中获取困难负样本,困难负样本是指具有预定质量的负样本;针对任一图片,将该图片中属于瑕疵的像素作为正样本。In some examples, the obtaining module 801 is used to obtain difficult negative samples from normal pixels that are not defective in the picture for any picture. The difficult negative samples refer to negative samples with predetermined quality; for any picture, The pixels belonging to the defect in the picture are regarded as positive samples.
其中,第一确定单元,用于确定至少一张图片中的困难负样本的类型损失和;确定至少一张图片中的正样本的类型损失和,将困难负样本的类型损失和与正样本的类型损失和,作为对应图片的类型损失。The first determining unit is used to determine the type loss sum of the difficult negative samples in at least one picture; determine the type loss sum of the positive samples in at least one picture, and compare the type loss sum of the difficult negative samples with the positive sample The type loss sum is used as the type loss of the corresponding picture.
在一些实例中,获取模块801,包括:第四确定单元,用于将每个图片中不属于瑕疵的正常像素作为负样本,并确定负样本的类型损失;选择单元,用于将负样本的类型损失由大到小进行排序,并选择出相邻类型损失差距最大对应的两个负样本,将排序靠后的负样本作为临界点,将排序在临界点之前的负样本作为困难负样本。In some examples, the acquisition module 801 includes: a fourth determining unit, used to take normal pixels that are not defective in each picture as a negative sample, and determine the type loss of the negative sample; The type loss is sorted from large to small, and two negative samples corresponding to the largest loss of adjacent types are selected, the negative sample that is sorted later is used as the critical point, and the negative sample sorted before the critical point is used as the difficult negative sample.
在一些实例中,获取模块801,用于根据全卷积神经网络模型,对特征进行处理,确定该图片中像素的预测类型以及预测检测框。In some examples, the acquisition module 801 is configured to process the features according to the fully convolutional neural network model, and determine the prediction type and the prediction detection frame of the pixel in the picture.
在一些实例中,确定模块802,用于根据像素的真实类型以及与该真实类型相符的预测类型的预测概率,确定该真实类型下的像素的类型损失。In some examples, the determining module 802 is configured to determine the type loss of the pixel under the true type according to the true type of the pixel and the predicted probability of the predicted type that matches the true type.
在一些实例中,通过下式1)确定像素的预测类型与真实类型之间的类型损失:In some instances, the type loss between the predicted type and the true type of the pixel is determined by the following formula 1):
Figure PCTCN2020073704-appb-000008
Figure PCTCN2020073704-appb-000008
其中,Loss_per_pixel o为类型损失,M为真实类型的总数目,y o,c为像素o预测类型是否为真实类型c对应的数值,p o,c是像素o属于预测类型c的预测概率。 Among them, Loss_per_pixel o is the type loss, M is the total number of true types, y o,c is the value corresponding to whether the prediction type of the pixel o is the true type c, and p o,c is the predicted probability of the pixel o belonging to the prediction type c.
在一些实例中,确定模块802,包括:第五确定单元,用于根据预测检测框在对应图片中的预测坐标,确定该预测检测框对于对应像素的相对预测坐标;获取单元,用于获取真实检测框对于对应像素的相对真实坐标;第五确定单元,用于确定相对预测坐标与相对真实坐标之间的坐标距离;第五确定单元,用于根据坐标距离确定检测框损失。In some examples, the determining module 802 includes: a fifth determining unit, configured to determine the relative predicted coordinates of the predicted detection frame to the corresponding pixel according to the predicted coordinates of the predicted detection frame in the corresponding picture; an acquiring unit, configured to obtain the real The relative real coordinates of the detection frame to the corresponding pixels; the fifth determining unit is used to determine the coordinate distance between the relative predicted coordinates and the relative real coordinates; the fifth determining unit is used to determine the loss of the detection frame according to the coordinate distance.
在一些实例中,通过公式2)确定检测框损失:In some instances, the detection frame loss is determined by formula 2):
Figure PCTCN2020073704-appb-000009
Figure PCTCN2020073704-appb-000009
其中,Loss det为检测框损失,x为坐标距离。 Among them, Loss det is the loss of the detection frame, and x is the coordinate distance.
在一些实例中,生成模块803,用于根据总损失,更新检测模型的检测参数,进行 模型的迭代训练,直到满足迭代训练停止条件,生成检测模型。In some instances, the generation module 803 is used to update the detection parameters of the detection model according to the total loss, and perform iterative training of the model until the iterative training stop condition is met, and then the detection model is generated.
在一些实例中,生成模块803,用于根据加权求和算法,确定类型损失和与检测框损失和的总损失。In some examples, the generating module 803 is configured to determine the total loss of the sum of the type loss and the sum of the detection frame loss according to the weighted sum algorithm.
在一些实例中,获取模块801,用于根据全卷积神经网络模型,对特征进行处理得到像素的至少一个预测类型的预测概率;选择预测概率最大的预测类型作为该像素的预测类型;将预测概率最大的预测类型对应的预测检测框作为该像素的预测检测框。In some examples, the obtaining module 801 is configured to process features according to the fully convolutional neural network model to obtain the prediction probability of at least one prediction type of the pixel; select the prediction type with the largest prediction probability as the prediction type of the pixel; The prediction detection frame corresponding to the prediction type with the highest probability is used as the prediction detection frame of the pixel.
图9为本申请又一示例性实施例提供的一种瑕疵的检测装置的结构框架示意图。该检测装置900可以应用于计算设备中,该检测装置900包括:获取模块901、生成模块902以及确定模块903,以下针对各个模块的功能进行详细的阐述:FIG. 9 is a schematic structural diagram of a defect detection device provided by another exemplary embodiment of the application. The detection device 900 can be applied to a computing device. The detection device 900 includes an acquisition module 901, a generation module 902, and a determination module 903. The functions of each module are described in detail below:
获取模块901,用于获取至少一张待预测图片,确定待预测图片中的像素的预测类型以及预测检测框。The obtaining module 901 is configured to obtain at least one picture to be predicted, and determine the prediction type and the prediction detection frame of the pixel in the picture to be predicted.
生成模块902,用于针对一张待预测图片,根据预测类型聚合像素,生成像素区域,并根据像素的预测检测框,确定像素区域的预测检测框。The generating module 902 is configured to aggregate pixels according to the prediction type for a picture to be predicted to generate a pixel area, and determine the predicted detection frame of the pixel area according to the predicted detection frame of the pixel.
确定模块903,用于根据像素区域和/或像素区域的预测检测框,确定待预测图片的瑕疵。The determining module 903 is configured to determine the defect of the picture to be predicted according to the pixel area and/or the predicted detection frame of the pixel area.
在一些实例中,生成模块902包括:确定单元,用于根据预测类型的预测概率,确定每个像素的瑕疵类型;生成单元,用于根据瑕疵类型,聚合像素,生成相同瑕疵类型的像素的聚合区域,作为像素区域。In some examples, the generating module 902 includes: a determining unit for determining the defect type of each pixel according to the predicted probability of the prediction type; a generating unit for aggregating pixels according to the defect type to generate an aggregation of pixels of the same defect type Area, as the pixel area.
在一些实例中,该装置900还包括:选择模块,用于将相同瑕疵类型作为该像素区域的瑕疵类型;其中,生成模块902,用于选择像素区域中该瑕疵类型的预测概率最高的像素的预测检测框作为该像素区域的预测检测框。In some examples, the device 900 further includes: a selection module for taking the same defect type as the defect type of the pixel area; wherein, the generating module 902 is used for selecting the pixel with the highest predicted probability of the defect type in the pixel area. The prediction detection frame is used as the prediction detection frame of the pixel area.
在一些实例中,确定模块903,包括:选择单元,用于当像素区域的瑕疵类型属于第一类型时,将像素区域的瑕疵类型作为该待预测图片包含的瑕疵类型,将像素区域的预测检测框作为该待预测图片包含的瑕疵的预测检测框;去除单元,用于当像素区域中的部分像素超出预测检测框时,从像素区域中去除部分像素,将剩余像素组成的区域作为该待预测图片包含的瑕疵的像素区域。In some examples, the determining module 903 includes: a selection unit, configured to, when the defect type of the pixel area belongs to the first type, use the defect type of the pixel area as the defect type contained in the picture to be predicted, and detect the prediction of the pixel area The frame is used as the prediction detection frame of the defect contained in the picture to be predicted; the removal unit is used to remove some pixels from the pixel area when some pixels in the pixel area exceed the prediction detection frame, and use the area composed of the remaining pixels as the prediction detection frame The image contains the pixel area of the defect.
在一些实例中,确定模块903,用于当像素区域的瑕疵类型属于第二类型时,将像素区域的瑕疵类型作为该待预测图片包含的瑕疵类型,将像素区域作为该待预测图片包含的瑕疵的像素区域,将像素区域的最小外接矩形框作为该待预测图片包含的瑕疵的预测检测框。In some examples, the determining module 903 is configured to, when the defect type of the pixel area belongs to the second type, use the defect type of the pixel area as the defect type contained in the picture to be predicted, and the pixel area as the defect contained in the picture to be predicted In the pixel area of, the smallest bounding rectangular frame of the pixel area is used as the prediction detection frame of the defect contained in the picture to be predicted.
在一些实例中,获取模块901,用于将至少一张待预测图片输入至生成的瑕疵的检测模型,得到待预测图片中的像素的预测类型以及预测检测框。In some examples, the obtaining module 901 is configured to input at least one picture to be predicted into the generated defect detection model to obtain the prediction type and the prediction detection frame of the pixel in the picture to be predicted.
图10为本申请又一示例性实施例提供的又一种瑕疵的检测装置的结构框架示意图。该检测装置1000可以应用于计算设备中,该检测装置1000包括:获取模块1001、确定模块1002以及生成模块1003,以下针对各个模块的功能进行详细的阐述:FIG. 10 is a schematic structural frame diagram of another defect detection device provided by another exemplary embodiment of the application. The detection device 1000 can be applied to a computing device. The detection device 1000 includes: an acquisition module 1001, a determination module 1002, and a generation module 1003. The functions of each module are described in detail below:
获取模块1001,用于获取至少一张图片的特征,根据特征确定该图片中像素的预测类型以及预测检测框,预测类型反映像素是否属于瑕疵的情况,预测目标框反映像素在具有瑕疵时的瑕疵位置。The obtaining module 1001 is used to obtain the characteristics of at least one picture, and determine the prediction type and the prediction detection frame of the pixel in the picture according to the characteristics, the prediction type reflects whether the pixel is a defect, and the prediction target frame reflects the defect of the pixel when it has a defect position.
确定模块1002:用于确定像素的预测类型与真实类型之间的类型损失,以及确定像素的预测检测框与真实检测框之间的检测框损失。The determining module 1002 is used to determine the type loss between the predicted type and the true type of the pixel, and the detection frame loss between the predicted detection frame and the true detection frame of the pixel.
生成模块1003,用于根据像素的类型损失以及检测框损失,确定像素的总损失,根据总损失,生成瑕疵的检测模型。The generating module 1003 is used to determine the total loss of pixels according to the loss of the pixel type and the loss of the detection frame, and generate a defect detection model according to the total loss.
确定模块1002:用于根据生成瑕疵的检测模型,确定待预测图片中的像素的预测类型以及预测检测框。The determining module 1002 is used to determine the prediction type and the prediction detection frame of the pixel in the picture to be predicted according to the detection model of the generated defect.
生成模块1003,用于针对一张待预测图片,根据预测类型聚合像素,生成像素区域,并根据像素的预测检测框,确定像素区域的预测检测框;The generating module 1003 is configured to aggregate pixels according to the prediction type for a picture to be predicted to generate a pixel area, and determine the predicted detection frame of the pixel area according to the predicted detection frame of the pixel;
确定模块1002:用于根据像素区域和/或像素区域的预测检测框,确定待预测图片的瑕疵。The determining module 1002 is used to determine the defect of the picture to be predicted according to the pixel area and/or the predicted detection frame of the pixel area.
以上描述了图8所示的数据处理800的内部功能和结构,在一个可能的设计中,图8所示的数据处理装置800的结构可实现为计算设备,如图11所示,该计算设备1100可以包括:存储器1101以及处理器1102;The internal functions and structure of the data processing device 800 shown in FIG. 8 are described above. In a possible design, the structure of the data processing device 800 shown in FIG. 8 can be implemented as a computing device. As shown in FIG. 11, the computing device 1100 may include: a memory 1101 and a processor 1102;
存储器1101,用于存储计算机程序;The memory 1101 is used to store computer programs;
处理器1102,用于执行计算机程序,以用于:The processor 1102 is used to execute computer programs for:
获取至少一张图片的特征,根据特征确定该图片中像素的预测类型以及预测检测框,预测类型反映像素是否属于瑕疵的情况,预测目标框反映像素在具有瑕疵时的瑕疵位置;确定像素的预测类型与真实类型之间的类型损失,以及确定像素的预测检测框与真实检测框之间的检测框损失;根据像素的类型损失以及检测框损失,确定像素的总损失,根据总损失,生成瑕疵的检测模型。Obtain the characteristics of at least one picture, determine the prediction type of the pixel in the picture and the prediction detection frame according to the characteristics, the prediction type reflects whether the pixel is a defect, and the prediction target frame reflects the defect location of the pixel when it has a defect; determine the prediction of the pixel The type loss between the type and the real type, and the detection frame loss between the predicted detection frame and the real detection frame of the determined pixel; according to the type loss of the pixel and the detection frame loss, the total loss of the pixel is determined, and the defect is generated according to the total loss The detection model.
在一些实例中,处理器1102,具体用于:根据像素的类型损失,确定像素的类型损 失和;第二确定单元,用于根据像素的检测框损失,确定像素的检测框损失和;第三确定单元,用于根据类型损失和与检测框损失和,确定总损失。In some examples, the processor 1102 is specifically configured to: determine the type loss sum of the pixel according to the type loss of the pixel; the second determining unit is configured to determine the detection frame loss sum of the pixel according to the detection frame loss of the pixel; third The determination unit is used to determine the total loss according to the type loss sum and the detection frame loss sum.
在一些实例中,处理器1102,具体用于:针对任一图片,从该图片中不属于瑕疵的正常像素中获取困难负样本,困难负样本是指具有预定质量的负样本;针对任一图片,将该图片中属于瑕疵的像素作为正样本。In some examples, the processor 1102 is specifically configured to: for any picture, obtain difficult negative samples from normal pixels that are not defective in the picture, where the difficult negative samples refer to negative samples with predetermined quality; for any picture , And take the defective pixels in the picture as positive samples.
其中,处理器1102,具体用于:确定至少一张图片中的困难负样本的类型损失和;确定至少一张图片中的正样本的类型损失和,将困难负样本的类型损失和与正样本的类型损失和,作为对应图片的类型损失。The processor 1102 is specifically configured to: determine the type loss sum of the difficult negative samples in at least one picture; determine the type loss sum of the positive samples in at least one picture, and compare the type loss sum of the difficult negative samples with the positive samples The type loss sum, as the type loss of the corresponding picture.
在一些实例中,处理器1102,具体用于:将每个图片中不属于瑕疵的正常像素作为负样本,并确定负样本的类型损失;将负样本的类型损失由大到小进行排序,并选择出相邻类型损失差距最大对应的两个负样本,将排序靠后的负样本作为临界点,将排序在临界点之前的负样本作为困难负样本。In some examples, the processor 1102 is specifically configured to: take normal pixels that are not defective in each picture as negative samples, and determine the type loss of the negative samples; sort the type loss of the negative samples from large to small, and The two negative samples corresponding to the largest loss of adjacent types are selected, the negative sample that is sorted later is used as the critical point, and the negative sample that is sorted before the critical point is used as the difficult negative sample.
在一些实例中,处理器1102,具体用于:根据全卷积神经网络模型,对特征进行处理,确定该图片中像素的预测类型以及预测检测框。In some examples, the processor 1102 is specifically configured to process the features according to the fully convolutional neural network model, and determine the prediction type of the pixel in the picture and the prediction detection frame.
在一些实例中,处理器1102,具体用于:根据像素的真实类型以及与该真实类型相符的预测类型的预测概率,确定该真实类型下的像素的类型损失。In some examples, the processor 1102 is specifically configured to determine the type loss of the pixel under the true type according to the true type of the pixel and the predicted probability of the prediction type that matches the true type.
在一些实例中,通过下式1)确定像素的预测类型与真实类型之间的类型损失:In some instances, the type loss between the predicted type and the true type of the pixel is determined by the following formula 1):
Figure PCTCN2020073704-appb-000010
Figure PCTCN2020073704-appb-000010
其中,Loss_per_pixel o为类型损失,M为真实类型的总数目,y o,c为像素o预测类型是否为真实类型c对应的数值,p o,c是像素o属于预测类型c的预测概率。 Among them, Loss_per_pixel o is the type loss, M is the total number of true types, y o,c is the value corresponding to whether the prediction type of the pixel o is the true type c, and p o,c is the predicted probability of the pixel o belonging to the prediction type c.
在一些实例中,处理器1102,具体用于:根据预测检测框在对应图片中的预测坐标,确定该预测检测框对于对应像素的相对预测坐标;获取真实检测框对于对应像素的相对真实坐标;确定相对预测坐标与相对真实坐标之间的坐标距离;根据坐标距离确定检测框损失。In some examples, the processor 1102 is specifically configured to: determine the relative predicted coordinates of the predicted detection frame for the corresponding pixel according to the predicted coordinates of the predicted detection frame in the corresponding picture; obtain the relative real coordinates of the real detection frame for the corresponding pixel; Determine the coordinate distance between the relative predicted coordinate and the relative real coordinate; determine the detection frame loss according to the coordinate distance.
在一些实例中,通过公式2)确定检测框损失:In some instances, the detection frame loss is determined by formula 2):
Figure PCTCN2020073704-appb-000011
Figure PCTCN2020073704-appb-000011
其中,Loss det为检测框损失,x为坐标距离。 Among them, Loss det is the loss of the detection frame, and x is the coordinate distance.
在一些实例中,处理器1102,具体用于:根据总损失,更新检测模型的检测参数,进行模型的迭代训练,直到满足迭代训练停止条件,生成检测模型。In some examples, the processor 1102 is specifically configured to: update the detection parameters of the detection model according to the total loss, and perform iterative training of the model until the iterative training stop condition is met, and then generate the detection model.
在一些实例中,处理器1102,具体用于:根据加权求和算法,确定类型损失和与检测框损失和的总损失。In some examples, the processor 1102 is specifically configured to determine the type loss sum and the total loss of the detection frame loss sum according to the weighted sum algorithm.
在一些实例中,处理器1102,具体用于:根据全卷积神经网络模型,对特征进行处理得到像素的至少一个预测类型的预测概率;选择预测概率最大的预测类型作为该像素的预测类型;将预测概率最大的预测类型对应的预测检测框作为该像素的预测检测框。In some examples, the processor 1102 is specifically configured to: process features according to the full convolutional neural network model to obtain the prediction probability of at least one prediction type of the pixel; select the prediction type with the largest prediction probability as the prediction type of the pixel; The prediction detection frame corresponding to the prediction type with the largest prediction probability is used as the prediction detection frame of the pixel.
另外,本发明实施例提供了一种计算机存储介质,计算机程序被一个或多个处理器执行时,致使一个或多个处理器实现图2方法实施例中数据处理方法的步骤。In addition, the embodiment of the present invention provides a computer storage medium. When a computer program is executed by one or more processors, the one or more processors are caused to implement the steps of the data processing method in the method embodiment in FIG. 2.
以上描述了图9所示的检测装置900的内部功能和结构,在一个可能的设计中,图9所示的检测装置900的结构可实现为计算设备,如图12所示,该计算设备1200可以包括:存储器1201以及处理器1202;The internal functions and structure of the detection device 900 shown in FIG. 9 are described above. In a possible design, the structure of the detection device 900 shown in FIG. 9 can be implemented as a computing device. As shown in FIG. 12, the computing device 1200 It may include: a memory 1201 and a processor 1202;
存储器1201,用于存储计算机程序;The memory 1201 is used to store computer programs;
处理器1202,用于执行计算机程序,以用于:The processor 1202 is used to execute computer programs for:
获取至少一张待预测图片,确定待预测图片中的像素的预测类型以及预测检测框;针对一张待预测图片,根据预测类型聚合像素,生成像素区域,并根据像素的预测检测框,确定像素区域的预测检测框;根据像素区域和/或像素区域的预测检测框,确定待预测图片的瑕疵。Obtain at least one picture to be predicted, determine the prediction type of the pixel in the picture to be predicted and the prediction detection frame; for a picture to be predicted, aggregate pixels according to the prediction type to generate a pixel area, and determine the pixel according to the prediction detection frame of the pixel Predictive detection frame of the area: Determine the defect of the picture to be predicted according to the predicted detection frame of the pixel area and/or pixel area.
在一些实例中,处理器1102,具体用于:根据预测类型的预测概率,确定每个像素的瑕疵类型;根据瑕疵类型,聚合像素,生成相同瑕疵类型的像素的聚合区域,作为像素区域。In some examples, the processor 1102 is specifically configured to: determine the defect type of each pixel according to the predicted probability of the prediction type; aggregate pixels according to the defect type, and generate an aggregated area of pixels of the same defect type as the pixel area.
在一些实例中,处理器1102,还用于:将相同瑕疵类型作为该像素区域的瑕疵类型;其中,处理器1102,具体用于:选择像素区域中该瑕疵类型的预测概率最高的像素的预测检测框作为该像素区域的预测检测框。In some instances, the processor 1102 is further configured to: use the same defect type as the defect type of the pixel area; wherein, the processor 1102 is specifically configured to: select the prediction probability of the pixel with the highest prediction probability of the defect type in the pixel area The detection frame serves as the prediction detection frame of the pixel area.
在一些实例中,处理器1102,具体用于:当像素区域的瑕疵类型属于第一类型时,将像素区域的瑕疵类型作为该待预测图片包含的瑕疵类型,将像素区域的预测检测框作为该待预测图片包含的瑕疵的预测检测框;当像素区域中的部分像素超出预测检测框时,从像素区域中去除部分像素,将剩余像素组成的区域作为该待预测图片包含的瑕疵的像素区域。In some examples, the processor 1102 is specifically configured to: when the defect type of the pixel area belongs to the first type, use the defect type of the pixel area as the defect type contained in the picture to be predicted, and use the predicted detection frame of the pixel area as the defect type. The prediction detection frame of the defect contained in the picture to be predicted; when some pixels in the pixel area exceed the prediction detection frame, some pixels are removed from the pixel area, and the area composed of the remaining pixels is used as the pixel area of the defect contained in the picture to be predicted.
在一些实例中,处理器1102,具体用于:当像素区域的瑕疵类型属于第二类型时,将像素区域的瑕疵类型作为该待预测图片包含的瑕疵类型,将像素区域作为该待预测图片包含的瑕疵的像素区域,将像素区域的最小外接矩形框作为该待预测图片包含的瑕疵的预测检测框。In some examples, the processor 1102 is specifically configured to: when the defect type of the pixel area belongs to the second type, use the defect type of the pixel area as the defect type contained in the picture to be predicted, and use the pixel area as the picture to be predicted. In the pixel area of the defect, the smallest bounding rectangle of the pixel area is used as the prediction detection frame of the defect contained in the picture to be predicted.
在一些实例中,处理器1102,具体用于:将至少一张待预测图片输入至生成的瑕疵的检测模型,得到待预测图片中的像素的预测类型以及预测检测框。In some examples, the processor 1102 is specifically configured to: input at least one picture to be predicted into the generated defect detection model to obtain the prediction type and the prediction detection frame of the pixel in the picture to be predicted.
另外,本发明实施例提供了一种计算机存储介质,计算机程序被一个或多个处理器执行时,致使一个或多个处理器实现图3方法实施例中瑕疵的检测方法的步骤。In addition, the embodiment of the present invention provides a computer storage medium. When the computer program is executed by one or more processors, the one or more processors are caused to implement the steps of the defect detection method in the method embodiment in FIG. 3.
以上描述了图10所示的装置1000的内部功能和结构,在一个可能的设计中,图10所示的装置1000的结构可实现为计算设备,如图13所示,该计算设备1300可以包括:存储器1301以及处理器1302;The internal functions and structure of the apparatus 1000 shown in FIG. 10 are described above. In a possible design, the structure of the apparatus 1000 shown in FIG. 10 may be implemented as a computing device. As shown in FIG. 13, the computing device 1300 may include : Memory 1301 and processor 1302;
存储器1301,用于存储计算机程序;The memory 1301 is used to store computer programs;
处理器1302,用于执行计算机程序,以用于:The processor 1302 is used to execute a computer program for:
存储器,用于存储计算机程序;Memory, used to store computer programs;
处理器,用于执行计算机程序,以用于:The processor is used to execute computer programs for:
获取至少一张图片的特征,根据特征确定该图片中像素的预测类型以及预测检测框,预测类型反映像素是否属于瑕疵的情况,预测目标框反映像素在具有瑕疵时的瑕疵位置;确定像素的预测类型与真实类型之间的类型损失,以及确定像素的预测检测框与真实检测框之间的检测框损失;根据像素的类型损失以及检测框损失,确定像素的总损失,根据总损失,生成瑕疵的检测模型;根据生成瑕疵的检测模型,确定待预测图片中的像素的预测类型以及预测检测框;针对一张待预测图片,根据预测类型聚合像素,生成像素区域,并根据像素的预测检测框,确定像素区域的预测检测框;根据像素区域和/或像素区域的预测检测框,确定待预测图片的瑕疵。Obtain the characteristics of at least one picture, determine the prediction type of the pixel in the picture and the prediction detection frame according to the characteristics, the prediction type reflects whether the pixel is a defect, and the prediction target frame reflects the defect location of the pixel when it has a defect; determine the prediction of the pixel The type loss between the type and the real type, and the detection frame loss between the predicted detection frame and the real detection frame of the determined pixel; according to the type loss of the pixel and the detection frame loss, the total loss of the pixel is determined, and the defect is generated according to the total loss According to the detection model of the generated defect, determine the prediction type of the pixel in the picture to be predicted and the prediction detection frame; for a picture to be predicted, the pixels are aggregated according to the prediction type, and the pixel area is generated, and the detection frame is predicted according to the pixel , Determine the predicted detection frame of the pixel area; determine the defect of the picture to be predicted according to the predicted detection frame of the pixel area and/or the pixel area.
另外,本发明实施例提供了一种计算机存储介质,计算机程序被一个或多个处理器执行时,致使一个或多个处理器实现图4方法实施例中瑕疵的检测方法的步骤。In addition, an embodiment of the present invention provides a computer storage medium. When a computer program is executed by one or more processors, the one or more processors are caused to implement the steps of the defect detection method in the method embodiment in FIG. 4.
另外,在上述实施例及附图中的描述的一些流程中,包含了按照特定顺序出现的多个操作,但是应该清楚了解,这些操作可以不按照其在本文中出现的顺序来执行或并行执行,操作的序号如201、202、203等,仅仅是用于区分开各个不同的操作,序号本身 不代表任何的执行顺序。另外,这些流程可以包括更多或更少的操作,并且这些操作可以按顺序执行或并行执行。需要说明的是,本文中的“第一”、“第二”等描述,是用于区分不同的消息、设备、模块等,不代表先后顺序,也不限定“第一”和“第二”是不同的类型。In addition, in some of the processes described in the above-mentioned embodiments and drawings, multiple operations appearing in a specific order are included, but it should be clearly understood that these operations may be performed out of the order in which they appear in this document or performed in parallel The sequence numbers of operations, such as 201, 202, 203, etc., are only used to distinguish different operations, and the sequence numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed sequentially or in parallel. It should be noted that the descriptions of "first" and "second" in this article are used to distinguish different messages, devices, modules, etc., and do not represent a sequence, nor do they limit the "first" and "second" Are different types.
以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性的劳动的情况下,即可以理解并实施。The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, they may be located in One place, or it can be distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the objectives of the solutions of the embodiments. Those of ordinary skill in the art can understand and implement without creative work.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到各实施方式可借助加必需的通用硬件平台的方式来实现,当然也可以通过硬件和软件结合的方式来实现。基于这样的理解,上述技术方案本质上或者说对现有技术做出贡献的部分可以以计算机产品的形式体现出来,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by adding a necessary general hardware platform, and of course, it can also be implemented by a combination of hardware and software. Based on this understanding, the above technical solutions essentially or the part that contributes to the prior art can be embodied in the form of computer products, and the present invention can be used in one or more computer usable storage containing computer usable program codes. The form of a computer program product implemented on a medium (including but not limited to disk storage, CD-ROM, optical storage, etc.).
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程多媒体数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程多媒体数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention is described with reference to flowcharts and/or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and/or block in the flowchart and/or block diagram, and the combination of processes and/or blocks in the flowchart and/or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to the processors of general-purpose computers, special-purpose computers, embedded processors, or other programmable multimedia data processing equipment to generate a machine, so that the instructions are executed by the processor of the computer or other programmable multimedia data processing equipment A device for realizing the functions specified in one flow or multiple flows in the flowchart and/or one block or multiple blocks in the block diagram is generated.
这些计算机程序指令也可存储在能引导计算机或其他可编程多媒体数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable multimedia data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device. The instruction device realizes the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程多媒体数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded on a computer or other programmable multimedia data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, which can be executed on the computer or other programmable equipment. The instructions provide steps for implementing functions specified in a flow or multiple flows in a flowchart and/or a block or multiple blocks in a block diagram.
在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。In a typical configuration, the computing device includes one or more processors (CPU), input/output interfaces, network interfaces, and memory.
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。The memory may include non-permanent memory in a computer readable medium, random access memory (RAM) and/or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM). Memory is an example of computer readable media.
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。Computer-readable media includes permanent and non-permanent, removable and non-removable media, and information storage can be realized by any method or technology. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, CD-ROM, digital versatile disc (DVD) or other optical storage, Magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media can be used to store information that can be accessed by computing devices. According to the definition in this article, computer-readable media does not include transitory media, such as modulated data signals and carrier waves.
最后应说明的是:以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: The technical solutions recorded in the foregoing embodiments are modified, or some of the technical features are equivalently replaced; these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (24)

  1. 一种数据处理方法,其特征在于,包括:A data processing method, characterized by comprising:
    获取至少一张图片的特征,根据所述特征确定该图片中像素的预测类型以及预测检测框,所述预测类型反映像素是否属于瑕疵的情况,所述预测目标框反映像素在具有瑕疵时的瑕疵位置;Obtain the feature of at least one picture, determine the prediction type of the pixel in the picture and the prediction detection frame according to the feature, the prediction type reflects whether the pixel is a defect, and the prediction target frame reflects the defect of the pixel when it has a defect position;
    确定像素的所述预测类型与真实类型之间的类型损失,以及确定像素的预测检测框与真实检测框之间的检测框损失;Determine the type loss between the predicted type and the true type of the pixel, and determine the detection frame loss between the predicted detection frame and the true detection frame of the pixel;
    根据像素的类型损失以及检测框损失,确定像素的总损失,根据所述总损失,生成瑕疵的检测模型。According to the pixel type loss and the detection frame loss, the total loss of the pixel is determined, and the defect detection model is generated according to the total loss.
  2. 根据权利要求1所述的方法,其特征在于,根据像素的类型损失以及检测框损失,确定像素的总损失,包括:The method of claim 1, wherein determining the total loss of pixels according to the type loss of the pixels and the loss of the detection frame comprises:
    根据像素的类型损失,确定像素的类型损失和;According to the pixel type loss, determine the pixel type loss sum;
    根据像素的检测框损失,确定像素的检测框损失和;Determine the sum of the pixel detection frame loss according to the pixel detection frame loss;
    根据类型损失和与检测框损失和,确定所述总损失。According to the type loss sum and the detection frame loss sum, the total loss is determined.
  3. 根据权利要求2所述的方法,其特征在于,所述方法还包括:The method of claim 2, wherein the method further comprises:
    针对任一图片,从该图片中不属于瑕疵的正常像素中获取困难负样本,困难负样本是指具有预定质量的负样本;For any picture, obtain difficult negative samples from normal pixels that are not defective in the picture, and difficult negative samples refer to negative samples with predetermined quality;
    针对任一图片,将该图片中属于瑕疵的像素作为正样本;Regarding any picture, use the defective pixels in the picture as a positive sample;
    其中,所述根据像素的类型损失,确定像素的类型损失和,包括:Wherein, determining the type loss sum of the pixel according to the type loss of the pixel includes:
    确定至少一张图片中的所述困难负样本的类型损失和;Determine the type loss sum of the difficult negative samples in at least one picture;
    确定至少一张图片中的正样本的类型损失和,将所述困难负样本的类型损失和与正样本的类型损失和,作为对应图片的类型损失。Determine the type loss sum of the positive samples in at least one picture, and use the type loss sum of the difficult negative samples and the type loss sum of the positive samples as the type loss of the corresponding picture.
  4. 根据权利要求3所述的方法,其特征在于,所述从该图片中不属于瑕疵的正常像素中获取困难负样本,包括:The method according to claim 3, wherein the obtaining difficult negative samples from normal pixels that are not defective in the picture comprises:
    将每个图片中不属于瑕疵的正常像素作为负样本,并确定所述负样本的类型损失;Taking normal pixels that are not defective in each picture as a negative sample, and determining the type loss of the negative sample;
    将所述负样本的类型损失由大到小进行排序,并选择出相邻类型损失差距最大对应的两个负样本,将排序靠后的负样本作为临界点,将排序在临界点之前的负样本作为所述困难负样本。Sort the type loss of the negative samples from large to small, and select the two negative samples corresponding to the largest difference in loss between adjacent types, take the negative samples that are ranked later as the critical point, and sort the negative samples before the critical point. The sample serves as the difficult negative sample.
  5. 根据权利要求1所述的方法,其特征在于,所述根据所述特征确定该图片中像素的预测类型以及预测检测框,包括:The method according to claim 1, wherein the determining the prediction type and the prediction detection frame of the pixel in the picture according to the characteristic comprises:
    根据全卷积神经网络模型,对所述特征进行处理,确定该图片中像素的预测类型以及预测检测框。According to the fully convolutional neural network model, the feature is processed to determine the prediction type and the prediction detection frame of the pixel in the picture.
  6. 根据权利要求1所述的方法,其特征在于,所述确定像素的所述预测类型与真实类型之间的类型损失,包括:The method according to claim 1, wherein the determining the type loss between the predicted type and the true type of the pixel comprises:
    根据像素的真实类型以及与该真实类型相符的预测类型的预测概率,确定该真实类型下的像素的类型损失。According to the true type of the pixel and the predicted probability of the predicted type consistent with the true type, the type loss of the pixel under the true type is determined.
  7. 根据权利要求1所述的方法,其特征在于,所述确定像素的预测检测框与真实检测框之间的检测框损失,包括:The method according to claim 1, wherein the detection frame loss between the predicted detection frame and the real detection frame of the determined pixel comprises:
    根据预测检测框在对应图片中的预测坐标,确定该预测检测框对于对应像素的相对预测坐标;Determine the relative prediction coordinates of the prediction detection frame for the corresponding pixels according to the prediction coordinates of the prediction detection frame in the corresponding picture;
    获取真实检测框对于对应像素的相对真实坐标;Obtain the relative real coordinates of the real detection frame to the corresponding pixels;
    确定所述相对预测坐标与所述相对真实坐标之间的坐标距离;Determining the coordinate distance between the relative predicted coordinate and the relative real coordinate;
    根据所述坐标距离确定所述检测框损失。The loss of the detection frame is determined according to the coordinate distance.
  8. 根据权利要求1所述的方法,其特征在于,所述根据所述总损失,生成瑕疵的检测模型,包括:The method according to claim 1, wherein the generating a defect detection model according to the total loss comprises:
    根据所述总损失,更新所述检测模型的检测参数,进行模型的迭代训练,直到满足迭代训练停止条件,生成检测模型。According to the total loss, the detection parameters of the detection model are updated, and the iterative training of the model is performed until the iterative training stop condition is met, and the detection model is generated.
  9. 根据权利要求2所述的方法,其特征在于,所述根据类型损失和与检测框损失和,确定所述总损失,包括:The method according to claim 2, wherein the determining the total loss according to the type loss sum and the detection frame loss sum comprises:
    根据加权求和算法,确定所述类型损失和与所述检测框损失和的总损失。According to a weighted sum algorithm, the total loss of the sum of the type loss and the sum of the detection frame loss is determined.
  10. 根据权利要求5所述的方法,其特征在于,所述根据全卷积神经网络模型,对所述特征进行处理,确定该图片中像素的预测类型以及预测检测框,包括:The method according to claim 5, wherein the processing the feature according to the fully convolutional neural network model to determine the prediction type and the prediction detection frame of the pixel in the picture comprises:
    根据全卷积神经网络模型,对所述特征进行处理得到像素的至少一个预测类型的预测概率;According to the fully convolutional neural network model, processing the feature to obtain the prediction probability of at least one prediction type of the pixel;
    选择预测概率最大的预测类型作为该像素的预测类型;Select the prediction type with the largest prediction probability as the prediction type of the pixel;
    将预测概率最大的预测类型对应的预测检测框作为该像素的预测检测框。The prediction detection frame corresponding to the prediction type with the largest prediction probability is used as the prediction detection frame of the pixel.
  11. 一种瑕疵的检测方法,其特征在于,包括:A defect detection method, which is characterized in that it includes:
    获取至少一张待预测图片,确定待预测图片中的像素的预测类型以及预测检测框;Obtain at least one picture to be predicted, and determine the prediction type and the prediction detection frame of the pixel in the picture to be predicted;
    针对一张待预测图片,根据所述预测类型聚合像素,生成像素区域,并根据像素的预测检测框,确定所述像素区域的预测检测框;For a picture to be predicted, aggregate pixels according to the prediction type to generate a pixel area, and determine the predicted detection frame of the pixel area according to the predicted detection frame of the pixel;
    根据所述像素区域和/或像素区域的预测检测框,确定待预测图片的瑕疵。According to the pixel area and/or the predicted detection frame of the pixel area, the defect of the picture to be predicted is determined.
  12. 根据权利要求11所述的方法,其特征在于,所述根据所述预测类型聚合像素,生成像素区域,包括:The method according to claim 11, wherein the aggregating pixels according to the prediction type to generate a pixel area comprises:
    根据所述预测类型的预测概率,确定每个像素的瑕疵类型;Determine the defect type of each pixel according to the prediction probability of the prediction type;
    根据瑕疵类型,聚合像素,生成相同瑕疵类型的像素的聚合区域,作为像素区域。According to the defect type, the pixels are aggregated to generate an aggregated area of the pixels of the same defect type as the pixel area.
  13. 根据权利要求12所述的方法,其特征在于,所述方法还包括:The method of claim 12, wherein the method further comprises:
    将所述相同瑕疵类型作为该像素区域的瑕疵类型;Taking the same defect type as the defect type of the pixel area;
    其中,所述根据像素的预测检测框,确定所述像素区域的预测检测框,包括:Wherein, the determining the predicted detection frame of the pixel area according to the predicted detection frame of the pixel includes:
    选择所述像素区域中该瑕疵类型的预测概率最高的像素的预测检测框作为该像素区域的预测检测框。The predicted detection frame of the pixel with the highest predicted probability of the defect type in the pixel area is selected as the predicted detection frame of the pixel area.
  14. 根据权利要求11所述的方法,其特征在于,所述根据所述像素区域和/或像素区域的预测检测框,确定待预测图片的瑕疵,包括:The method according to claim 11, wherein the determining the defect of the picture to be predicted according to the pixel area and/or the prediction detection frame of the pixel area comprises:
    当像素区域的瑕疵类型属于第一类型时,将像素区域的瑕疵类型作为该待预测图片包含的瑕疵类型,将像素区域的预测检测框作为该待预测图片包含的瑕疵的预测检测框;When the defect type of the pixel area belongs to the first type, use the defect type of the pixel area as the defect type contained in the picture to be predicted, and use the prediction detection frame of the pixel area as the prediction detection frame of the defect contained in the picture to be predicted;
    当像素区域中的部分像素超出所述预测检测框时,从所述像素区域中去除所述部分像素,将剩余像素组成的区域作为该待预测图片包含的瑕疵的像素区域。When part of the pixels in the pixel area exceeds the prediction detection frame, the part of pixels is removed from the pixel area, and the area composed of the remaining pixels is taken as the pixel area of the defect contained in the picture to be predicted.
  15. 根据权利要求11所述的方法,其特征在于,所述根据所述像素区域和/或像素区域的预测检测框,确定待预测图片的瑕疵,包括:The method according to claim 11, wherein the determining the defect of the picture to be predicted according to the pixel area and/or the prediction detection frame of the pixel area comprises:
    当像素区域的瑕疵类型属于第二类型时,将像素区域的瑕疵类型作为该待预测图片包含的瑕疵类型,将像素区域作为该待预测图片包含的瑕疵的像素区域,将所述像素区域的最小外接矩形框作为该待预测图片包含的瑕疵的预测检测框。When the defect type of the pixel area belongs to the second type, the defect type of the pixel area is taken as the defect type contained in the picture to be predicted, the pixel area is taken as the pixel area of the defect contained in the picture to be predicted, and the smallest pixel area is The circumscribed rectangular frame is used as the prediction detection frame of the defect contained in the picture to be predicted.
  16. 根据权利要求11所述的方法,其特征在于,所述确定待预测图片中的像素的预测类型以及预测检测框,包括:The method according to claim 11, wherein the determining the prediction type and the prediction detection frame of the pixel in the picture to be predicted comprises:
    将至少一张待预测图片输入至生成的瑕疵的检测模型,得到待预测图片中的像素的预测类型以及预测检测框。Input at least one picture to be predicted into the generated defect detection model to obtain the prediction type and the prediction detection frame of the pixel in the picture to be predicted.
  17. 一种瑕疵的检测方法,其特征在于,包括:A defect detection method, which is characterized in that it includes:
    获取至少一张图片的特征,根据所述特征确定该图片中像素的预测类型以及预测检测框,所述预测类型反映像素是否属于瑕疵的情况,所述预测目标框反映像素在具有瑕疵时的瑕疵位置;Obtain the feature of at least one picture, determine the prediction type of the pixel in the picture and the prediction detection frame according to the feature, the prediction type reflects whether the pixel is a defect, and the prediction target frame reflects the defect of the pixel when it has a defect position;
    确定像素的所述预测类型与真实类型之间的类型损失,以及确定像素的预测检测框与真实检测框之间的检测框损失;Determine the type loss between the predicted type and the true type of the pixel, and determine the detection frame loss between the predicted detection frame and the true detection frame of the pixel;
    根据像素的类型损失以及检测框损失,确定像素的总损失,根据所述总损失,生成瑕疵的检测模型;Determine the total loss of pixels according to the type loss of the pixels and the loss of the detection frame, and generate a defect detection model according to the total loss;
    根据生成瑕疵的检测模型,确定待预测图片中的像素的预测类型以及预测检测框;According to the detection model of the generated defect, determine the prediction type of the pixel in the picture to be predicted and the prediction detection frame;
    针对一张待预测图片,根据所述预测类型聚合像素,生成像素区域,并根据像素的预测检测框,确定所述像素区域的预测检测框;For a picture to be predicted, aggregate pixels according to the prediction type to generate a pixel area, and determine the predicted detection frame of the pixel area according to the predicted detection frame of the pixel;
    根据所述像素区域和/或像素区域的预测检测框,确定待预测图片的瑕疵。According to the pixel area and/or the predicted detection frame of the pixel area, the defect of the picture to be predicted is determined.
  18. 一种瑕疵的检测系统,其特征在于,包括:第一计算设备以及第二计算设备;A defect detection system, characterized by comprising: a first computing device and a second computing device;
    所述第一计算设备,获取至少一张图片的特征,根据所述特征确定该图片中像素的预测类型以及预测检测框,所述预测类型反映像素是否属于瑕疵的情况,所述预测目标框反映像素在具有瑕疵时的瑕疵位置;The first computing device obtains the characteristics of at least one picture, and determines the prediction type and the prediction detection frame of the pixel in the picture according to the characteristics, the prediction type reflects whether the pixel is a defect, and the prediction target frame reflects The defect position of the pixel when there is a defect;
    确定像素的所述预测类型与真实类型之间的类型损失,以及确定像素的预测检测框与真实检测框之间的检测框损失;Determine the type loss between the predicted type and the true type of the pixel, and determine the detection frame loss between the predicted detection frame and the true detection frame of the pixel;
    根据像素的类型损失以及检测框损失,确定像素的总损失,根据所述总损失,生成瑕疵的检测模型;Determine the total loss of pixels according to the type loss of the pixels and the loss of the detection frame, and generate a defect detection model according to the total loss;
    所述第二计算设备,根据生成瑕疵的检测模型,确定待预测图片中的像素的预测类型以及预测检测框;The second computing device determines the prediction type and the prediction detection frame of the pixel in the picture to be predicted according to the detection model of the generated defect;
    针对一张待预测图片,根据所述预测类型聚合像素,生成像素区域,并根据像素的预测检测框,确定所述像素区域的预测检测框;For a picture to be predicted, aggregate pixels according to the prediction type to generate a pixel area, and determine the predicted detection frame of the pixel area according to the predicted detection frame of the pixel;
    根据所述像素区域和/或像素区域的预测检测框,确定待预测图片的瑕疵。According to the pixel area and/or the predicted detection frame of the pixel area, the defect of the picture to be predicted is determined.
  19. 一种计算设备,其特征在于,包括存储器以及处理器;A computing device, characterized by comprising a memory and a processor;
    所述存储器,用于存储计算机程序;The memory is used to store computer programs;
    所述处理器,用于执行所述计算机程序,以用于:The processor is configured to execute the computer program for:
    获取至少一张图片的特征,根据所述特征确定该图片中像素的预测类型以及预测检测框,所述预测类型反映像素是否属于瑕疵的情况,所述预测目标框反映像素在具有瑕疵时的瑕疵位置;Obtain the feature of at least one picture, determine the prediction type of the pixel in the picture and the prediction detection frame according to the feature, the prediction type reflects whether the pixel is a defect, and the prediction target frame reflects the defect of the pixel when it has a defect position;
    确定像素的所述预测类型与真实类型之间的类型损失,以及确定像素的预测检测框与真实检测框之间的检测框损失;Determine the type loss between the predicted type and the true type of the pixel, and determine the detection frame loss between the predicted detection frame and the true detection frame of the pixel;
    根据像素的类型损失以及检测框损失,确定像素的总损失,根据所述总损失,生成 瑕疵的检测模型。According to the pixel type loss and the detection frame loss, the total loss of the pixel is determined, and the defect detection model is generated according to the total loss.
  20. 一种存储有计算机程序的计算机可读存储介质,其特征在于,计算机程序被一个或多个处理器执行时,致使所述一个或多个处理器实现权利要求1-10任一项所述方法中的步骤。A computer-readable storage medium storing a computer program, wherein when the computer program is executed by one or more processors, it causes the one or more processors to implement the method of any one of claims 1-10 Steps in.
  21. 一种计算设备,其特征在于,包括存储器以及处理器;A computing device, characterized by comprising a memory and a processor;
    所述存储器,用于存储计算机程序;The memory is used to store computer programs;
    所述处理器,用于执行所述计算机程序,以用于:The processor is configured to execute the computer program for:
    获取至少一张待预测图片,确定待预测图片中的像素的预测类型以及预测检测框;Obtain at least one picture to be predicted, and determine the prediction type and the prediction detection frame of the pixel in the picture to be predicted;
    针对一张待预测图片,根据所述预测类型聚合像素,生成像素区域,并根据像素的预测检测框,确定所述像素区域的预测检测框;For a picture to be predicted, aggregate pixels according to the prediction type to generate a pixel area, and determine the predicted detection frame of the pixel area according to the predicted detection frame of the pixel;
    根据所述像素区域和/或像素区域的预测检测框,确定待预测图片的瑕疵。According to the pixel area and/or the predicted detection frame of the pixel area, the defect of the picture to be predicted is determined.
  22. 一种存储有计算机程序的计算机可读存储介质,其特征在于,计算机程序被一个或多个处理器执行时,致使所述一个或多个处理器实现权利要求11-16任一项所述方法中的步骤。A computer-readable storage medium storing a computer program, wherein when the computer program is executed by one or more processors, it causes the one or more processors to implement the method described in any one of claims 11-16 Steps in.
  23. 一种计算设备,其特征在于,包括存储器以及处理器;A computing device, characterized by comprising a memory and a processor;
    所述存储器,用于存储计算机程序;The memory is used to store computer programs;
    所述处理器,用于执行所述计算机程序,以用于:The processor is configured to execute the computer program for:
    获取至少一张图片的特征,根据所述特征确定该图片中像素的预测类型以及预测检测框,所述预测类型反映像素是否属于瑕疵的情况,所述预测目标框反映像素在具有瑕疵时的瑕疵位置;Obtain the feature of at least one picture, determine the prediction type of the pixel in the picture and the prediction detection frame according to the feature, the prediction type reflects whether the pixel is a defect, and the prediction target frame reflects the defect of the pixel when it has a defect position;
    确定像素的所述预测类型与真实类型之间的类型损失,以及确定像素的预测检测框与真实检测框之间的检测框损失;Determine the type loss between the predicted type and the true type of the pixel, and determine the detection frame loss between the predicted detection frame and the true detection frame of the pixel;
    根据像素的类型损失以及检测框损失,确定像素的总损失,根据所述总损失,生成瑕疵的检测模型;Determine the total loss of pixels according to the type loss of the pixels and the loss of the detection frame, and generate a defect detection model according to the total loss;
    根据生成瑕疵的检测模型,确定待预测图片中的像素的预测类型以及预测检测框;According to the detection model of the generated defect, determine the prediction type of the pixel in the picture to be predicted and the prediction detection frame;
    针对一张待预测图片,根据所述预测类型聚合像素,生成像素区域,并根据像素的预测检测框,确定所述像素区域的预测检测框;For a picture to be predicted, aggregate pixels according to the prediction type to generate a pixel area, and determine the predicted detection frame of the pixel area according to the predicted detection frame of the pixel;
    根据所述像素区域和/或像素区域的预测检测框,确定待预测图片的瑕疵。According to the pixel area and/or the predicted detection frame of the pixel area, the defect of the picture to be predicted is determined.
  24. 一种存储有计算机程序的计算机可读存储介质,其特征在于,计算机程序被一个或多个处理器执行时,致使所述一个或多个处理器实现权利要求17所述方法中的步骤。A computer-readable storage medium storing a computer program, wherein the computer program is executed by one or more processors to cause the one or more processors to implement the steps in the method of claim 17.
PCT/CN2020/073704 2019-02-02 2020-01-22 Data processing method, defect detection method, computing apparatus, and storage medium WO2020156409A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910107275.8 2019-02-02
CN201910107275.8A CN111598825B (en) 2019-02-02 2019-02-02 Data processing method, flaw detection method, computing device and storage medium

Publications (1)

Publication Number Publication Date
WO2020156409A1 true WO2020156409A1 (en) 2020-08-06

Family

ID=71841973

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/073704 WO2020156409A1 (en) 2019-02-02 2020-01-22 Data processing method, defect detection method, computing apparatus, and storage medium

Country Status (3)

Country Link
CN (1) CN111598825B (en)
TW (1) TW202040511A (en)
WO (1) WO2020156409A1 (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112598591A (en) * 2020-12-18 2021-04-02 北京达佳互联信息技术有限公司 Image processing method, image processing device, electronic equipment and storage medium
CN113138198A (en) * 2021-04-27 2021-07-20 环旭(深圳)电子科创有限公司 System and method for generating defect image of electronic element
CN113160204A (en) * 2021-04-30 2021-07-23 聚时科技(上海)有限公司 Semantic segmentation network training method for generating defect area based on target detection information
CN113808035A (en) * 2021-08-25 2021-12-17 厦门微图软件科技有限公司 Flaw detection method based on semi-supervised learning
CN115358998A (en) * 2022-08-22 2022-11-18 法博思(宁波)半导体设备有限公司 Method and system for acquiring point coordinates in random array picture
CN117274249A (en) * 2023-11-20 2023-12-22 江西省中鼐科技服务有限公司 Ceramic tile appearance detection method and system based on artificial intelligent image technology
CN118154605A (en) * 2024-05-11 2024-06-07 江西智成飞桨科技有限公司 Textile AI flaw detection method, system and equipment

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113673488B (en) * 2021-10-21 2022-02-08 季华实验室 Target detection method and device based on few samples and intelligent object sorting system
TWI807854B (en) * 2022-06-09 2023-07-01 鴻海精密工業股份有限公司 Method for detecting defects, computer device and storage medium
TWI844873B (en) * 2022-06-22 2024-06-11 鴻海精密工業股份有限公司 Method for detecting product defects, electronic device and computer-readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7646908B2 (en) * 2004-09-29 2010-01-12 Dainippon Screen Mfg. Co., Ltd. Defect detection apparatus and defect detection method
CN107316295A (en) * 2017-07-02 2017-11-03 苏州大学 A kind of fabric defects detection method based on deep neural network
CN107341517A (en) * 2017-07-07 2017-11-10 哈尔滨工业大学 The multiple dimensioned wisp detection method of Fusion Features between a kind of level based on deep learning
CN109239102A (en) * 2018-08-21 2019-01-18 南京理工大学 A kind of flexible circuit board open defect detection method based on CNN
CN109300102A (en) * 2017-07-21 2019-02-01 凌云光技术集团有限责任公司 A kind of defect inspection method for PCB

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105282558B (en) * 2014-07-18 2018-06-15 清华大学 Pixel prediction method, coding method, coding/decoding method and its device in frame
CN108335313A (en) * 2018-02-26 2018-07-27 阿博茨德(北京)科技有限公司 Image partition method and device
CN108492291B (en) * 2018-03-12 2022-07-22 苏州天准科技股份有限公司 CNN segmentation-based solar photovoltaic silicon wafer defect detection system and method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7646908B2 (en) * 2004-09-29 2010-01-12 Dainippon Screen Mfg. Co., Ltd. Defect detection apparatus and defect detection method
CN107316295A (en) * 2017-07-02 2017-11-03 苏州大学 A kind of fabric defects detection method based on deep neural network
CN107341517A (en) * 2017-07-07 2017-11-10 哈尔滨工业大学 The multiple dimensioned wisp detection method of Fusion Features between a kind of level based on deep learning
CN109300102A (en) * 2017-07-21 2019-02-01 凌云光技术集团有限责任公司 A kind of defect inspection method for PCB
CN109239102A (en) * 2018-08-21 2019-01-18 南京理工大学 A kind of flexible circuit board open defect detection method based on CNN

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112598591A (en) * 2020-12-18 2021-04-02 北京达佳互联信息技术有限公司 Image processing method, image processing device, electronic equipment and storage medium
CN112598591B (en) * 2020-12-18 2024-06-07 北京达佳互联信息技术有限公司 Image processing method, device, electronic equipment and storage medium
CN113138198A (en) * 2021-04-27 2021-07-20 环旭(深圳)电子科创有限公司 System and method for generating defect image of electronic element
CN113160204A (en) * 2021-04-30 2021-07-23 聚时科技(上海)有限公司 Semantic segmentation network training method for generating defect area based on target detection information
CN113808035A (en) * 2021-08-25 2021-12-17 厦门微图软件科技有限公司 Flaw detection method based on semi-supervised learning
CN113808035B (en) * 2021-08-25 2024-04-26 厦门微图软件科技有限公司 Flaw detection method based on semi-supervised learning
CN115358998A (en) * 2022-08-22 2022-11-18 法博思(宁波)半导体设备有限公司 Method and system for acquiring point coordinates in random array picture
CN115358998B (en) * 2022-08-22 2023-06-16 法博思(宁波)半导体设备有限公司 Method and system for acquiring point coordinates in random array picture
CN117274249A (en) * 2023-11-20 2023-12-22 江西省中鼐科技服务有限公司 Ceramic tile appearance detection method and system based on artificial intelligent image technology
CN117274249B (en) * 2023-11-20 2024-03-01 江西省中鼐科技服务有限公司 Ceramic tile appearance detection method and system based on artificial intelligent image technology
CN118154605A (en) * 2024-05-11 2024-06-07 江西智成飞桨科技有限公司 Textile AI flaw detection method, system and equipment

Also Published As

Publication number Publication date
TW202040511A (en) 2020-11-01
CN111598825A (en) 2020-08-28
CN111598825B (en) 2023-04-18

Similar Documents

Publication Publication Date Title
WO2020156409A1 (en) Data processing method, defect detection method, computing apparatus, and storage medium
WO2023077404A1 (en) Defect detection method, apparatus and system
US20200167594A1 (en) Method and apparatus for vehicle damage identification
CN112669275B (en) YOLOv3 algorithm-based PCB surface defect detection method and device
CN111612784A (en) Steel plate surface defect detection method based on classification-first YOLO network
CN114240821A (en) Weld defect detection method based on improved YOLOX
CN115131283B (en) Defect detection and model training method, device, equipment and medium for target object
CN112613569B (en) Image recognition method, training method and device for image classification model
US20230281784A1 (en) Industrial Defect Recognition Method and System, Computing Device, and Storage Medium
WO2022116720A1 (en) Target detection method and apparatus, and electronic device
TW202127371A (en) Image-based defect detection method and computer readable medium thereof
CN110599453A (en) Panel defect detection method and device based on image fusion and equipment terminal
CN112465746A (en) Method for detecting small defects in radiographic film
CN112287884B (en) Examination abnormal behavior detection method and device and computer readable storage medium
CN115880298A (en) Glass surface defect detection method and system based on unsupervised pre-training
JP2021143884A (en) Inspection device, inspection method, program, learning device, learning method, and trained dataset
CN112668577A (en) Method, terminal and device for detecting target object in large-scale image
CN115908344A (en) Micro LED chip defect detection method based on MLCT-YOLO
CN114463603B (en) Training method and device for image detection model, electronic equipment and storage medium
Du Nguyen et al. Crack segmentation of imbalanced data: The role of loss functions
CN116912625A (en) Data enhancement method based on priori defect characteristics and SSPCAB attention mechanism
CN117372424B (en) Defect detection method, device, equipment and storage medium
CN114078127A (en) Object defect detection and counting method, device, equipment and storage medium
WO2024061309A1 (en) Defect identification method and apparatus, computer device, and storage medium
CN117495786A (en) Defect detection meta-model construction method, defect detection method, device and medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20749061

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20749061

Country of ref document: EP

Kind code of ref document: A1