Defect judgment method and device, electronic equipment and storage medium
By using dynamic calibration technology to convert the pixel information of defects into physical size information in an industrial vision inspection system, and using a logic tree for nonlinear judgment, the problem of low accuracy in defect judgment in existing technologies is solved. This achieves high-precision, interpretable defect detection and flexible nonlinear decision-making, thereby improving production efficiency and system stability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-23
- Publication Date
- 2026-03-10
AI Technical Summary
Existing industrial vision inspection systems suffer from low decision-making accuracy in defect identification. Traditional methods are difficult to adapt to complex and nonlinear process judgment logic. Furthermore, the system's threshold management system is crude, the permission division is unclear, and the configuration and update process is cumbersome, which affects production efficiency.
The system captures images of the target product using a camera, analyzes the images to identify defective areas, and then uses dynamic calibration technology to convert the pixel information of the defects into precise physical size information. This information is then input into a preset logic tree for judgment. The logic tree uses the defect judgment conditions set by process experts as nodes and achieves non-linear decision-making through arbitrary nested combinations of logical operators such as AND, OR, and NOT.
It achieves high-precision, interpretable defect detection, reduces measurement errors, improves detection accuracy and transparency, supports flexible nonlinear decision-making, simplifies the threshold configuration update process, and ensures production continuity and operational efficiency.
Smart Images

Figure CN121639670A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of industrial automation and machine vision, and particularly relates to a defect determination method and device, an electronic device and a storage medium. BACKGROUND
[0002] An industrial visual inspection system is a key link for ensuring product quality in modern manufacturing, and is widely used in defect detection and quality control in fields such as electronic components, automobile parts, precision instruments, etc. The detection accuracy, decision efficiency and running stability of the system directly affect the production quality and economic benefits of the production line. With the increasing requirements of the industrial field for detection accuracy, efficiency and system flexibility, the existing detection system architecture and decision method exposes many limitations.
[0003] Traditional visual inspection schemes mostly rely on fixed thresholds or end-to-end models based on deep learning to realize the recognition and classification of defects. Since the defect determination rules usually exist in the form of hard coding or simple threshold comparison, when facing complex determination logic that needs to integrate multiple defect features, the traditional threshold judgment and deep learning model are difficult to embed the determination rules defined by process engineers in a structured and interpretable manner into the detection process. The system decision cannot be flexibly matched with the actual production specifications, thereby affecting the accuracy of the system decision. SUMMARY
[0004] The main purpose of the embodiments of the present application is to provide a defect determination method, device, electronic device and storage medium, which can solve the problem of low decision accuracy of the existing industrial visual inspection system and improve the accuracy of industrial visual defect decision.
[0005] To achieve the above purpose, a first aspect of the embodiments of the present application provides a defect determination method applied to an industrial visual inspection system, wherein the industrial visual inspection system comprises a camera, and the method comprises the following steps. capturing a target product on an industrial production line by using the camera to obtain a first image; performing image analysis on the first image to obtain a defect area of the target product in the first image in a case where it is determined that the target product has a defect; converting pixel information of the defect area into physical size information, wherein the physical size information comprises an actual physical size of the defect area; inputting the physical size information into a preset logic tree to determine a classification of the target product, wherein the logic tree takes a preset defect determination condition as a node, each node is connected through a logic operator, and the logic operator comprises any nested combination of AND, OR and NOT.
[0006] In some embodiments, the converting the pixel information of the defect area into physical size information comprises: obtaining configuration information of the industrial production line and calibration parameters of the camera, the configuration information of the industrial production line comprising a model of a product produced by the industrial production line, a model of the camera, a lens focal length of the camera, an installation height and an installation angle of the camera, the calibration parameters of the camera comprising camera intrinsic parameters, camera extrinsic parameters and distortion coefficients; constructing a dynamic mapping model according to the configuration information of the industrial production line and the calibration parameters of the camera, the dynamic mapping model being used for mapping coordinates in a pixel coordinate system to a physical coordinate system; converting the pixel information of the defect area into physical size information according to the dynamic mapping model.
[0007] In some embodiments, the inputting the physical size information into a preset logical tree for judgment to obtain a classification of the target product comprises: obtaining defect judgment conditions and constructing the logical tree based on the defect judgment conditions, the defect judgment conditions comprising a first judgment condition for a single target product and a second judgment condition for a single defect, the first judgment condition comprising an upper limit of the number of defects and an upper limit of the total area of defects of a single target product, and the second judgment condition comprising a length threshold, a width threshold, an area threshold and a position coordinate range of a single defect; inputting the physical size information into the logical tree for judgment to obtain a classification of the target product.
[0008] In some embodiments, the obtaining defect judgment conditions and constructing the logical tree based on the defect judgment conditions comprises: obtaining historical qualified defect data and historical unqualified defect data; generating an initial structure of the logical tree through a decision tree algorithm according to the historical qualified defect data and the historical unqualified defect data; sending the initial structure of the logical tree to a client; receiving an optimization scheme or a confirmation instruction of the initial structure of the logical tree from the client; obtaining the logical tree according to the optimization scheme or the confirmation instruction.
[0009] In some embodiments, before the obtaining the defect judgment conditions, the method further comprises: performing permission management on a threshold configuration file, the threshold configuration file containing the defect judgment conditions and threshold values corresponding to the defect judgment conditions; When a new version of the threshold configuration file is released, the new version of the threshold configuration file is synchronized to the industrial visual inspection system through a hot deployment mechanism.
[0010] In some embodiments, the permission management of the threshold configuration file comprises: allocating operation permissions on the threshold configuration file to different users, the operation permissions including viewing, editing, and auditing; encrypting and storing user credentials; version marking and storing modification operations of the threshold configuration file.
[0011] In some embodiments, after the above-mentioned when a new version of the threshold configuration file is released, the new version of the threshold configuration file is synchronized to the industrial visual inspection system through a hot deployment mechanism, the method further comprises: after applying the new version of the threshold configuration file, obtaining a misjudgment rate of the industrial production line in real time; if the misjudgment rate exceeds a preset threshold, rolling back the threshold configuration file to the previous version.
[0012] To achieve the above-mentioned purpose, a second aspect of the embodiments of the present application proposes a defect determination device applied to an industrial visual inspection system, the industrial visual inspection system comprising a camera, and the device comprising: a shooting module configured to shoot a target product on an industrial production line through the camera to obtain a first image; an acquisition module configured to, in a case where it is determined that the target product has a defect, acquire a defect area of the target product in the first image by performing image analysis on the first image; a conversion module configured to convert pixel information of the defect area into physical size information, the physical size information comprising an actual physical size of the defect area; a determination module configured to input the physical size information into a preset logical tree to determine a classification of the target product, the logical tree taking preset defect determination conditions as nodes, and each node being connected through a logical operator, the logical operator comprising any nested combination of AND, OR, and NOT.
[0013] To achieve the above-mentioned purpose, a third aspect of the embodiments of the present application proposes an electronic device, the electronic device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the method of the first aspect when executing the computer program.
[0014] To achieve the above object, a fourth aspect of the embodiment of the present application provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the method in the first aspect.
[0015] The defect determination method, device, electronic device and storage medium provided by the present application obtain an image by shooting a target product through a camera, analyze the image to identify a defect area, convert pixel information of the defect into accurate physical size information (such as actual size) by using dynamic calibration technology, input the physical size information into a preset composite logic tree for determination, the logic tree takes defect determination conditions (such as length, area or global threshold) set by a process expert as nodes, and realizes nonlinear decision through any nested combination of logical operators such as and, or and not, and finally outputs a classification result (such as qualified, unqualified or critical) of the target product, so as to realize high-precision and interpretable defect detection. BRIEF DESCRIPTION OF DRAWINGS
[0016] Figure 1 is a flowchart of the defect determination method provided by the embodiment of the present application; Figure 2 is a structural schematic diagram of the defect determination device provided by the embodiment of the present application; Figure 3 is a hardware structural schematic diagram of the electronic device provided by the embodiment of the present application. DETAILED DESCRIPTION
[0017] In order to make the purpose, technical scheme and advantages of the present application clearer, the present application will be further described in detail below in combination with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, and are not used to limit the present application.
[0018] It should be noted that although the functional modules are divided in the device schematic diagram, and the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a manner different from the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification and claims and the above drawings are used to distinguish similar objects, and do not necessarily describe a specific order or sequence.
[0019] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the present application belongs. The terms used herein are only for the purpose of describing the embodiments of the present application, and are not intended to limit the present application.
[0020] Industrial visual inspection is the core link of product quality guarantee in the field of industrial automation and precision manufacturing, and is widely used in online defect screening scenes of electronic components, precision mechanical parts and other production lines. Such scenes not only require the detection system to realize micron-level high-precision defect parameter measurement, but also need to have interpretable defect judgment logic to match specific process specifications, while ensuring that the threshold configuration update process does not interrupt the production line production, so as to balance detection accuracy, decision transparency and production continuity.
[0021] The current existing technology has many key technical bottlenecks: first, the mainstream deep learning-based defect decision scheme relies on massive labeled data to train the model, which consumes a lot of computing resources and the decision-making process is in a "black box" state, which cannot meet the process requirements of traceable and adjustable judgment logic in precision manufacturing, and does not solve the measurement error problem caused by camera distortion; second, traditional detection schemes mostly use fixed thresholds or simple linear combinations to determine defects, which are difficult to adapt to complex nonlinear process determination logic; third, the system threshold management system is extensive, the authority division is not clear, the configuration update process is cumbersome and easy to cause production line downtime, which cannot realize safe operation and maintenance without disturbance, and is difficult to meet the efficient detection needs of modern industrial production lines.
[0022] Based on this, the embodiment of the present application provides a defect judgment method, device, electronic equipment and storage medium, aiming to provide an industrial visual defect intelligent decision scheme which does not rely on complex deep learning model, can realize micron-level dynamic calibration, support interpretable and flexible nonlinear decision, and has high security and operation efficiency.
[0023] The defect judgment method, device, electronic equipment and storage medium provided by the embodiment of the present application are specifically explained by the following embodiments. First, the defect judgment method in the embodiment of the present application is described.
[0024] The defect judgment method provided by the embodiment of the present application relates to the field of industrial automation and machine vision technology. The defect judgment method provided by the embodiment of the present application can be applied in a terminal, can be applied in a server, and can also be software running in a terminal or a server. In some embodiments, the terminal can be a smart phone, a tablet computer, a notebook computer, a desktop computer, etc.; the server can be configured as a separate physical server, or can be configured as a server cluster or a distributed system composed of multiple physical servers, or can be configured as a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and basic cloud computing services such as big data and artificial intelligence platforms; the software can be an application that implements the defect judgment method, but is not limited to the above forms.
[0025] The application is operable in a multitude of generic or specific computer system environments or configurations. Examples of well known computing systems, environments, and / or configurations that can be suitable for use with the application include personal computers, server computers, handheld or laptop devices, tablet devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like. The application can be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, and the like, that perform particular tasks or implement particular abstract data types. The application can also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules can be located in local and remote computer storage media including memory storage devices.
[0026] It should be noted that in each specific embodiment of the present application, when it is necessary to perform relevant processing according to user information, user behavior data, user history data, and user location information and other data related to the identity or characteristics of the user, the user's permission or consent will be obtained first, and the collection, use and processing of these data will comply with relevant laws, regulations and standards. In addition, when the embodiments of the present application need to obtain sensitive personal information of the user, the separate permission or separate consent of the user will be obtained through a pop-up window or by jumping to a confirmation page, and after obtaining the separate permission or separate consent of the user, the necessary user-related data for enabling the embodiments of the present application to normally operate will be obtained.
[0027] Figure 1 is an optional flowchart of the defect determination method provided by the embodiments of the present application. The embodiments of the present application can be applied to an industrial vision detection system, wherein the industrial vision detection system comprises a camera, Figure 1 The method in the camera can include but is not limited to steps S100 to S400.
[0028] Step S100, capturing a target product on an industrial production line by the camera to obtain a first image.
[0029] In the present embodiment, the camera in the industrial vision detection system is controlled to capture the target product on the production line, and a first image containing complete appearance information of the target product is obtained. The camera parameters (such as shooting angle, exposure time, resolution, etc.) can be pre-configured according to the model of the target product, the production environment and other actual scenes, so as to ensure that the first image can clearly present the surface features of the target product and possible defects.
[0030] Step S200, in the case that the target product is determined to have defects, the defect area of the target product in the first image is obtained by image analysis on the first image.
[0031] In the embodiment, the first image is analyzed by image preprocessing (such as noise reduction and enhancement), feature extraction (such as gray value difference and edge feature), and defect recognition algorithm (such as threshold segmentation, template matching, and edge detection), to determine whether the target product has defects. In the case that the target product is determined to have defects, the specific position and range of the defect in the first image are further extracted by image segmentation technology, i.e., the defect area is obtained. The information of the defect area includes but is not limited to pixel information such as pixel coordinates, pixel contour, and pixel area in the first image.
[0032] Step S300, the pixel information of the defect area is converted into physical size information, and the physical size information includes the actual physical size of the defect area.
[0033] In the embodiment, the pixel information of the defect area obtained is converted into physical size information, and the physical size information includes the actual physical size (such as actual length, actual area, and actual depth) of the defect area. Specifically, the camera and the matching lens in the industrial vision detection system are calibrated in advance, and a camera pixel-physical size mapping model (i.e., a dynamic mapping model) is established. The model includes parameters such as the intrinsic matrix (such as focal length and pixel pitch) of the camera, the distortion coefficient (such as radial distortion and tangential distortion), and the extrinsic matrix (such as camera installation height and shooting distance). When converting, the mapping model is called, and the pixel coordinates and pixel size of the defect area are used to convert the pixel dimension parameters into accurate size parameters in the physical world in real time through coordinate conversion and distortion correction algorithm, effectively eliminating the influence of camera distortion and perspective error on the measurement accuracy, and ensuring the accuracy of the defect physical size information.
[0034] Step S400, the physical size information is input into a preset logical tree for determination, to obtain the classification of the target product. The logical tree takes preset defect determination conditions as nodes, and each node is connected by a logical operator. The logical operator includes any nested combination of AND, OR, and NOT.
[0035] In the embodiment, the obtained physical size information is input into a preset logical tree for determination, and finally the classification result of the target product is obtained. The logical tree is a tree-shaped decision structure preset based on process requirements, and its core feature is that the preset defect determination conditions are used as nodes, the defect determination conditions include global preset conditions (such as the upper limit of the total number of defects allowed on a single target product, the upper limit of the total area of defects, etc.) and attribute conditions for a single defect (such as the actual length threshold, the actual area threshold, the actual position coordinate range, etc. of a single defect); each node is connected through a logical operator, the logical operator includes "and (AND)", "or (OR)", "not (NOT)", and supports any nested combination, forming a nonlinear determination logic path.
[0036] In the determination process, the system executes the determination process of the logical tree according to the preset traversal order, matches the actual physical size information of the defect with the determination conditions of each node of the logical tree one by one, performs logical operation according to the logical operators between the nodes, and finally outputs the classification result of the target product, which includes OK, NG, LIMIT, etc. The specific classification dimension can be pre-configured according to the process requirements.
[0037] The embodiment fundamentally reduces the misjudgment caused by measurement error by dynamically calibrating and converting the image analysis result from the pixel level affected by camera distortion to the stable real physical size (micron level); the determination engine based on rules and logical trees replaces the unexplainable deep learning "black box", process experts can directly configure or adjust the determination rules and logical relationships according to the knowledge, so that the decision-making process is completely transparent, facilitating process optimization, problem tracing and standard upgrading; it does not rely on large-scale labeled data to train complex deep learning models, has small computing overhead and fast response speed; the rule configuration of the logical tree is intuitive, and through the arbitrary nested combination of the logical operators, a complex nonlinear determination logic can be constructed, overcoming the shortcomings of the traditional fixed threshold or simple linear weighting method, better matching the complex quality requirements of multi-factor coupling in actual production, easy to understand and maintain, and having good industrial practicability.
[0038] In some embodiments, step S300 can include but is not limited to steps S310 to S330: Step S310, obtaining the configuration information of the industrial production line and the calibration parameters of the camera, the configuration information of the industrial production line including the model of the product produced by the industrial production line, the model of the camera, the focal length of the lens of the camera, the installation height and the installation angle of the camera, and the calibration parameters of the camera including the camera intrinsic parameter, the camera extrinsic parameter and the distortion coefficient; Step S320, constructing a dynamic mapping model according to the configuration information of the industrial production line and the calibration parameters of the camera, the dynamic mapping model being used for mapping coordinates in a pixel coordinate system to a physical coordinate system; Step S330, converting pixel information of the defect area into physical size information according to the dynamic mapping model.
[0039] In the embodiment, the system acquires, through a production line data acquisition module of an industrial visual inspection system, configuration information of a current industrial production line and calibration parameters of a supporting camera in real time, ensures real-time and accuracy of data, and provides basic data support for subsequent construction of a dynamic mapping model.
[0040] Specifically, the configuration information of the industrial production line covers core parameters of the current production line, and specifically includes: a model of a product produced by the production line (different models of products have different size specifications and detection standards, and need to be adaptively mapped); a model of the camera (different models of cameras have different basic parameters such as imaging chips and pixel pitches, which directly affect the mapping relationship between pixels and physical sizes); a focal length of the camera (the focal length determines the imaging range and magnification, and is a key parameter of the mapping model); an installation height of the camera (a vertical distance between the camera and the target product, which affects the perspective effect and size measurement accuracy); an installation angle of the camera (an angle between the camera and the target product surface, which needs to be corrected by parameters to eliminate projection errors caused by inclined shooting). The above configuration information can be automatically synchronized through a production line PLC control system and a device management module, or manually input by an operator through a system interface, and the system performs format checking and legality verification on the input data (for example, the installation height needs to be within the effective range allowed by the device).
[0041] Specifically, the calibration parameters of the camera are core optical parameters obtained by pre-calibrating the camera and the supporting lens, and are used to describe the imaging characteristics of the camera, and specifically include: camera intrinsic parameters (including focal length, pixel principal point coordinates, pixel pitch, distortion center and other parameters, constituting an intrinsic parameter matrix, reflecting the optical characteristics of the camera itself); camera extrinsic parameters (including position and attitude parameters of the camera in the world coordinate system, constituting an extrinsic parameter matrix, reflecting the spatial position relationship between the camera and the target product); distortion coefficients (including radial distortion coefficients, tangential distortion coefficients and the like, used to correct image distortion caused by lens optical characteristics, such as edge stretching and distortion). The above calibration parameters are pre-acquired through mature calibration methods in the industry such as Zhang's calibration method and self-calibration method, and are stored in a calibration parameter library of the system according to camera models and lens models, and can be called and updated at any time.
[0042] In this embodiment, the system constructs a dynamic mapping model according to the obtained industrial production line configuration information and camera calibration parameters. The core function of the dynamic mapping model is to establish an accurate mapping relationship between the pixel coordinate system and the physical coordinate system, and to realize real-time conversion from the pixel dimension to the physical dimension.
[0043] Specifically, the system first matches and retrieves the corresponding camera intrinsic matrix, extrinsic matrix and distortion coefficient from the calibration parameter library according to the camera model and lens focal length in the production line configuration information; combines the installation height and installation angle in the production line configuration information to real-time correct the retrieved extrinsic matrix (for example, when the installation height is adjusted from 50 cm to 60 cm, the translation vector and rotation matrix in the extrinsic matrix are updated through spatial geometric operation to ensure that the extrinsic matrix can accurately reflect the spatial position relationship between the current camera and the target product); and fuses the corrected intrinsic matrix, extrinsic matrix and distortion coefficient to obtain the dynamic mapping model through instantiation. The model has built-in coordinate conversion algorithm and distortion correction algorithm, which can first correct the pixel coordinates of the defect area (eliminate radial and tangential distortion through the distortion coefficient), and then map the corrected pixel coordinates to the physical coordinate system through the intrinsic matrix and the extrinsic matrix, and finally output the actual physical coordinates and size parameters of the defect area. When the production line configuration information (such as product model, installation height, lens focal length) changes, the system will capture the changed configuration information in real time, repeat the above steps to rebuild or update the dynamic mapping model, and complete the adaptation without manual intervention.
[0044] In this embodiment, after the dynamic mapping model is constructed, the system inputs the obtained pixel information of the defect area (including pixel coordinates, pixel length, pixel width, pixel area, pixel outline, etc.) into the model to complete the conversion through the built-in algorithm process of the model.
[0045] Specifically, first, the pixel coordinates of the defect area are corrected for distortion. The model calls the distortion coefficient to correct the coordinates of each pixel point through the radial distortion correction formula and the tangential distortion correction formula, and eliminates the coordinate deviation caused by lens optical distortion. Second, the corrected pixel coordinates are mapped to the physical coordinate system. The model converts the pixel coordinates to three-dimensional coordinates in the camera coordinate system using the intrinsic matrix, and then converts the three-dimensional coordinates in the camera coordinate system to three-dimensional coordinates in the physical world coordinate system (i.e. the actual space coordinate system of the target product) through the extrinsic matrix. Finally, the physical size information of the defect area is calculated. According to the defect area outline coordinates in the physical coordinate system, the actual physical size of the defect is calculated through spatial geometric operation, including actual length, actual width, actual area, actual depth (if it is a three-dimensional detection scene) and other parameters, to realize accurate measurement from pixel level to micrometer level.
[0046] The embodiment realizes high customization and precision of the conversion process from pixels to physical size by introducing a dynamic mapping model dependent on specific production line configuration and camera calibration parameters; not only solves the scale difference problem caused by different cameras and different installation poses, but more importantly, fundamentally eliminates the influence of inherent lens distortion on measurement accuracy by actively applying distortion correction, thereby ensuring stable, reliable and accurate micron-level defect physical size information at different production lines and different stations, laying a solid foundation for subsequent intelligent judgment based on accurate size.
[0047] In some embodiments, step S400 can include but is not limited to steps S410 to S420: Step S410, obtaining the defect judgment condition, and constructing the logic tree based on the defect judgment condition, the defect judgment condition including a first judgment condition for a single piece of the target product and a second judgment condition for a single defect, the first judgment condition including a defect quantity upper limit and a defect total area upper limit of a single piece of the target product, and the second judgment condition including a length threshold, a width threshold, an area threshold and a position coordinate range of a single defect; Step S420, inputting the physical size information into the logic tree for judgment to obtain the classification of the target product.
[0048] In the embodiment, the system first obtains the defect judgment condition predefined for the current product model from the stored process knowledge base or configuration file before performing the judgment. These conditions constitute the basic rule unit of the logic tree decision, and are systematically divided into two categories according to their judgment objects and ranges: the first judgment condition (product-level global condition) and the second judgment condition (defect-level individual condition). Among them, the first judgment condition constrains the overall defect condition of a single product, and specifies the upper limit of the number of defects allowed to exist in a single product, for example, the total number of defects ≤ 3; also specifies the upper limit of the total defect area of all defects on a single product, for example, the total defect area ≤ 5.0 mm 2 . The second judgment condition constrains the specific attributes of each single defect, and specifies the size threshold condition, including the length threshold (such as defect length > 1.5 mm), the width threshold (such as defect width > 0.5 mm), the area threshold (such as defect area > 0.8 mm 2 ); also specifies the position coordinate range condition, i.e. the coordinate range of the defect in the specific functional area or forbidden area of the product surface. For example, the center point X coordinate of the defect is located in the interval (10mm, 30mm) and the Y coordinate is located in the interval (5mm, 15mm), which is used to judge whether the defect appears in the key area.
[0049] The above determination conditions can be manually input into the system by process experts according to product models and process standards, or can be generated by the system based on historical detection data of qualified / unqualified products through statistical analysis algorithm, and then confirmed by experts to be fixed as formal determination conditions. After obtaining the above determination conditions, the system takes these conditions as basic nodes, and constructs or loads an executable logic tree in the memory according to the logical relationship (connected by “AND”, “OR”, “NOT” and the like) defined by the process experts in advance. The tree structure of the logic tree clearly defines the complete decision path from the single defect attribute judgment to the overall conclusion of the product.
[0050] Specifically, the first determination condition and the second determination condition can be taken as different level nodes of the logic tree, wherein the first determination condition can be taken as a top node (global determination layer), and the second determination condition can be taken as a lower node (local determination layer), or the node level order can be flexibly adjusted according to the process logic; the nodes are connected by logical operators such as “AND”, “OR” and “NOT”, support arbitrary nested combination, and form a nonlinear determination path. For example, a complex logical relationship of “(first determination condition is met) AND [(second determination conditions of single defects are all met) OR (single defect length ≤ 15 mm and not in the key position area)]” can be constructed, which not only ensures that the overall defect state of the product is qualified, but also provides flexible determination rules for single defects. The logic tree can be directly constructed by process experts through manual dragging of condition nodes and configuration of logical operators through the visual interface of the system; or an initial logic tree framework can be automatically generated by the system according to historical detection data and process requirements through a decision tree algorithm, and then optimized and confirmed by experts to ensure that the logic tree is highly adapted to the actual production requirements.
[0051] The system takes the physical size information as input and traverses the constructed logic tree. The physical size information includes the accurate physical size (such as length, width, area) and position coordinates of each defect, as well as the total number and total area of defects detected in the current product. The execution process follows the topology structure of the logic tree, and the True / False output results of all nodes are comprehensively calculated according to the logical operators connecting them, and are transmitted along the branches to the root node, and finally a comprehensive determination conclusion is obtained at the root node or the output node of the logic tree, that is, the classification of the target product is output. Typical classifications include OK (qualified, none of the determination conditions is triggered), NG (unqualified, any combination condition leading to direct rejection is triggered), and LIMIT (limit to be judged, some warning conditions are triggered but do not reach the direct rejection standard, which needs manual intervention for review).
[0052] The embodiment realizes global control of the overall defect state of the product, covers multi-dimensional attribute characteristics of the single defect, avoids one-sidedness caused by single-dimensional judgment, improves the scientificity of the judgment, and effectively reduces the risk of misjudgment and omission by combining global conditions and local conditions for judgment, thereby improving the reliability of product quality control.
[0053] In some embodiments, step S410 can include, but is not limited to, steps S411 to S415: Step S411, obtaining historical qualified defect data and historical unqualified defect data; Step S412, generating an initial structure of the logic tree by a decision tree algorithm according to the historical qualified defect data and the historical unqualified defect data; Step S413, sending the initial structure of the logic tree to a client; Step S414, receiving an optimization scheme or a confirmation instruction of the initial structure of the logic tree from the client; Step S415, obtaining the logic tree according to the optimization scheme or the confirmation instruction.
[0054] In the embodiment, the system obtains a historical defect data set with labeled classification results related to the current product model and detection station from a historical detection database. The data set includes a large amount of historical qualified defect data and historical unqualified defect data with clear classification. Each piece of data includes at least one or more physical parameters (such as length, area, and position) of a defect and the final classification (qualified / unqualified) of the product to which the defect belongs.
[0055] The system takes historical defect data as training samples, takes the features of each detection instance (the aggregated features of a product and all its defects, such as the maximum defect length, total defect area, whether there is a critical area defect, etc.) as input, and takes the final quality classification (pass / fail) as the target label. Subsequently, the system learns the training data using a decision tree algorithm (such as C4.5, CART, or ID3 algorithm). The algorithm automatically analyzes the internal relationship between different defect features and the determination result, and recursively selects the optimal determination feature (i.e., the defect determination condition, such as "whether the maximum length > threshold A" or "whether the total area > threshold B") and its split threshold by calculating indicators such as information gain and Gini coefficient, thereby generating an initial structure of a logic tree. This initial structure already has a tree framework, with nodes being the determination conditions that the algorithm considers to have a distinguishing degree, and branch paths of the nodes being based on whether the conditions are met, and the final leaf nodes corresponding to preliminary "pass" or "fail" classifications.
[0056] The system sends the automatically generated initial structure of the logic tree to the client. The client can be a computer, tablet, or other device used by engineers or process experts that has a graphical interface. The client receives and visually displays the initial structure of the logic tree. Experts or engineers can review the structure of the tree, the node conditions (thresholds), and the logical relationships, and perform interactive operations, including but not limited to: optimization schemes and issuing confirmation instructions. Optimization schemes include modifying the determination thresholds of nodes, adjusting the logical operators between nodes (such as changing AND to OR), pruning unreasonable branches, adding special conditions based on process experience, etc. If the expert believes that the initial structure meets the process requirements, the confirmation instruction is issued directly. The client returns the above optimization schemes or confirmation instructions to the system. The system modifies the initial structure according to the received optimization schemes, or directly determines the initial structure as the final version according to the confirmation instruction, thereby obtaining a logic tree that can be used for online detection and has been verified by experts.
[0057] This embodiment can quickly generate a basic and reasonable determination logic framework by analyzing massive historical data using a decision tree algorithm, which is particularly helpful in discovering complex feature combination relationships that people may not easily summarize, greatly reducing the workload of experts starting from scratch. The final review and optimization are given to process experts, ensuring that the determination logic is completely consistent with strict process standards, product design requirements, and actual production experience, and avoiding the risk of inconsistency with physical rules or safety boundaries that may occur in purely data-driven models.
[0058] In some embodiments, step S410 can include but is not limited to the following steps: Permission management is performed on the threshold configuration file, which contains the defect determination conditions and the thresholds corresponding to the defect determination conditions. When a new version of the threshold configuration file is released, the new version of the threshold configuration file is synchronized to the industrial visual inspection system through a hot deployment mechanism.
[0059] In this embodiment, the threshold configuration file is a core data file containing all defect judgment conditions and their corresponding thresholds, and is the basis for the execution of the logical tree. The system can use a Role-Based Access Control (RBAC) model and enhance it. For threshold operations (such as modification, review, release, etc.), different roles (such as process engineers, line supervisors, system administrators) are assigned fine-grained operation permissions. For example, process engineers can propose modifications, line supervisors are responsible for reviewing and releasing, and any changes are authorized and verified. User credentials are encrypted and stored through key derivation functions and other methods to ensure account security.
[0060] When a new version of the threshold configuration file is released, the new version of the threshold configuration file is synchronized to all online inspection devices in the industrial visual inspection system through a hot deployment mechanism. The system uses version control tools (such as Git) to manage each change to the configuration file, record modification history and responsible persons. After the new version is authorized and released, the system uses message queue technology (such as RabbitMQ, Kafka) or RESTful API-based configuration distribution methods to push the new configuration file to all online inspection devices in seconds. After receiving the new file, the device can load and apply the new judgment rules without restarting, and the entire process has no disturbance to production.
[0061] This embodiment uses RBAC-enhanced fine-grained permission management and operation log auditing to effectively prevent unauthorized modifications and malicious tampering of thresholds; encrypted storage and abnormal alarm mechanisms further improve the security of the configuration file and ensure the reliability of the judgment basis; the hot deployment mechanism enables "second-level updates without downtime", greatly improving production efficiency and system operation efficiency.
[0062] In some embodiments, permission management of the threshold configuration file can include, but is not limited to, the following steps: Assigning different users operation permissions on the threshold configuration file, including viewing, editing, and reviewing; Encrypting user credentials for storage; Version marking and storage of modification operations on the threshold configuration file.
[0063] In this embodiment, the system pre-defines a series of roles related to production quality management, and assigns each role a fine-grained operation permission on the threshold configuration file. These permissions strictly distinguish the type and scope of operations, which usually include but are not limited to: view permission, edit permission, review permission and release permission. Among them, the view permission refers to allowing users to read the content of the current effective or historical version of the threshold configuration file, but cannot modify it, and the view permission is usually assigned to production line operators, maintenance personnel, etc. The edit permission refers to allowing users with process background (such as process engineers) to create new threshold configuration drafts or modify the decision conditions and their thresholds on existing drafts, and the edit operation is usually performed in "sandbox" or draft mode, which does not affect online production. The review permission refers to allowing quality supervisors or higher-privileged administrators to perform technical review and compliance verification on the threshold modification drafts submitted by process engineers, and the review permission is a necessary prerequisite process for the configuration file to be released and effective. The release permission is the core permission, which is only granted to a few system administrators or authorized persons, and the release permission allows the configuration draft that has passed the review to be officially released as a new version effective online. The system provides a visual permission configuration interface, which is uniformly assigned and adjusted by system administrators, and the assignment record is automatically retained; it supports batch authorization of roles and fine-tuning of individual user permissions, and when the user's position changes, the system can quickly recover or adjust the user's permissions to avoid security risks caused by redundant permissions.
[0064] To protect user identity security and prevent illegal login and unauthorized operation, the system encrypts all user login credentials. User credentials include login account, password, identity (such as employee number), and other core information, among which the password is the core object of encrypted storage. When a user registers or modifies a password, the password is salted and hashed using a key derivation function (such as PBKDF2, bcrypt or Argon2) before the hash value is stored in the database. When a user logs in, the system compares the hashed password entered by the user with the hash value stored in the database after the same salted and hashed processing, thereby verifying the user's identity. This ensures that even if the database is physically obtained, attackers cannot easily reverse the user's original password, greatly enhancing the security of user accounts and the permission system.
[0065] To achieve the full traceability of the modified trajectory and the reuse of the historical version, the system performs version marking and complete storage for each modification operation of the threshold configuration file. Whenever a user creates a modification draft based on a certain version of the configuration file, or when the draft is audited and published, the system will automatically generate and assign a unique version identifier to record the iterative relationship of the configuration. The complete configuration file content, its corresponding version number, modification time, modifier, and modification reason, etc. (recorded through the submission log) are stored together in the version control system or the database with version management function. The system permanently saves all historical versions of the configuration file. This means that at any time, the differences between any two versions can be viewed and compared, and the configuration can be accurately rolled back to any historical version, providing a complete data foundation for problem traceability, audit investigation, and strategy review.
[0066] The present embodiment realizes permission isolation through RBAC, ensures identity authentication security through encrypted storage, and realizes operation traceability through version control. The combination of the three realizes a full-range security protection system for the threshold configuration file, which realizes prevention in advance, control in the middle, and audit in the rear.
[0067] In some embodiments, after the new version of the threshold configuration file is published and synchronized to the industrial visual inspection system through the hot deployment mechanism, the following steps can be included, but are not limited to: After applying the new version of the threshold configuration file, the misjudgment rate of the industrial production line is obtained in real time. If the misjudgment rate exceeds the preset threshold, the threshold configuration file is rolled back to the previous version.
[0068] In the present embodiment, after applying the new version of the threshold configuration file, the system continuously obtains and analyzes the misjudgment rate of the industrial production line in real time. The misjudgment rate can be defined as the sum of the ratio of "misjudging qualified products as unqualified (false positives)" and "misjudging unqualified products as qualified (false negatives)" within a short period of time (such as 1 hour), or the specific type of misjudgment rate defined according to the process focus. The misjudgment rate is calculated and refreshed in real time by the system monitoring module and compared with the preset monitoring threshold.
[0069] The system presets a safety threshold for the misjudgment rate. If the actual misjudgment rate exceeds the preset threshold, the protection mechanism is automatically triggered. At this time, the system will automatically trigger the rollback mechanism to restore the threshold configuration file of all detection devices to the previous stable version, and immediately send an alarm notification to the relevant management personnel. The entire process is automatically executed without human intervention, which maximizes the reduction of production losses caused by configuration errors.
[0070] The embodiment can quickly capture the quality risk caused by the new threshold strategy, and automatically restore to the safe state immediately, so as to minimize the production quality fluctuation or interruption risk caused by the new configuration, and realize controllable management of change risk.
[0071] The embodiment of the application realizes accurate measurement at the micron level through dynamic calibration, fundamentally overcomes the error caused by device distortion; uses a configurable composite logic tree to convert expert knowledge into transparent and interpretable nonlinear decision rules, realizes more flexible and more reliable judgment than a "black box" model; combines RBAC permission control and hot deployment mechanism to establish a safe and undisturbed threshold management system, greatly improves the operation and maintenance efficiency and system stability; the whole scheme does not need a large amount of data training and has small calculation overhead, has high industrial practicability, and is especially suitable for deployment at the edge of a resource-limited production line.
[0072] Please refer to Figure 2 The embodiment of the application also provides a defect judgment device 500, which can realize the defect judgment method, and the device comprises: A shooting module 10 is configured to shoot a target product on an industrial production line through the camera to obtain a first image; An acquisition module 20 is configured to acquire a defect area of the target product in the first image by performing image analysis on the first image in a case where it is determined that the target product has defects; A conversion module 30 is configured to convert pixel information of the defect area into physical size information, wherein the physical size information comprises an actual physical size of the defect area; A judgment module 40 is configured to input the physical size information into a preset logic tree for judgment to obtain a classification of the target product, wherein the logic tree takes preset defect judgment conditions as nodes, and each node is connected through a logic operator, and the logic operator comprises any nested combination of AND, OR and NOT.
[0073] In some embodiments, the conversion module 30 can comprise: A first acquisition sub-module is configured to acquire configuration information of the industrial production line and calibration parameters of the camera, wherein the configuration information of the industrial production line comprises a model of a product produced by the industrial production line, a model of the camera, a lens focal length of the camera, an installation height and an installation angle of the camera, and the calibration parameters of the camera comprise camera intrinsic parameters, camera extrinsic parameters and distortion coefficients; A construction sub-module is configured to construct a dynamic mapping model according to the configuration information of the industrial production line and the calibration parameters of the camera, wherein the dynamic mapping model is used to map coordinates in a pixel coordinate system to a physical coordinate system; The conversion submodule is configured to convert the pixel information of the defect area into physical size information according to the dynamic mapping model.
[0074] In some embodiments, the determination module 40 can include: The second acquisition submodule is configured to acquire the defect determination conditions and construct the logic tree based on the defect determination conditions, wherein the defect determination conditions include a first determination condition for a single piece of the target product and a second determination condition for a single defect, the first determination condition includes an upper limit of the number of defects and an upper limit of the total area of defects of a single piece of the target product, and the second determination condition includes a length threshold, a width threshold, an area threshold, and a position coordinate range of a single defect. The determination submodule is configured to input the physical size information into the logic tree for determination to obtain the classification of the target product.
[0075] In some embodiments, the second acquisition submodule can include: The acquisition unit is configured to acquire historical qualified defect data and historical unqualified defect data. The generation unit is configured to generate an initial structure of the logic tree by a decision tree algorithm according to the historical qualified defect data and the historical unqualified defect data. The sending unit is configured to send the initial structure of the logic tree to a client. The receiving unit is configured to receive an optimization scheme or a confirmation instruction of the initial structure of the logic tree from the client. The optimization unit is configured to obtain the logic tree according to the optimization scheme or the confirmation instruction.
[0076] In some embodiments, the determination module 40 can further include: The management submodule is configured to perform permission management on a threshold configuration file, wherein the threshold configuration file contains the defect determination conditions and thresholds corresponding to the defect determination conditions. The synchronization submodule is configured to synchronize a new version of the threshold configuration file to the industrial visual inspection system through a hot deployment mechanism when the new version of the threshold configuration file is released.
[0077] In some embodiments, the management submodule can include: The allocation unit is configured to allocate operation permissions related to the threshold configuration file to different users, wherein the operation permissions include viewing, editing, and auditing. The encryption unit is configured to encrypt and store user credentials. The storage unit is configured to mark and store modification operations of the threshold configuration file by version.
[0078] In some embodiments, the determining module 40 can further include: a third obtaining sub-module, configured to obtain a misjudgment rate of the industrial production line in real time after the new version threshold configuration file is applied; a rollback sub-module, configured to rollback the threshold configuration file to a previous version if the misjudgment rate exceeds a preset threshold.
[0079] The detailed implementation of the defect determining apparatus is basically the same as the above-mentioned defect determining method, and thus will not be repeated here.
[0080] The embodiments of the present application further provide an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor implements the above-mentioned defect determining method when executing the computer program. The electronic device can be any intelligent terminal, such as a tablet computer or a vehicle-mounted computer.
[0081] Please refer to Figure 3 , Figure 3 a hardware structure of an electronic device of another embodiment is shown, which includes: The processor 801 can be implemented in a general-purpose central processing unit (CPU), a microprocessor, an application specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute related programs to implement the technical solutions provided by the embodiments of the present application. The memory 802 can be implemented in a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 802 can store an operating system and other application programs. When the technical solutions provided by the embodiments of the present application are implemented by software or firmware, the related program codes are stored in the memory 802 and are called and executed by the processor 801 to implement the defect determining method of the embodiments of the present application. The input / output interface 803 is used to realize information input and output. The communication interface 804 is used to realize the communication interaction between the device and other devices. The communication can be realized by a wired manner (such as a USB, a network cable, etc.) or a wireless manner (such as a mobile network, WIFI, Bluetooth, etc.). The bus 805 transmits information between various components (such as the processor 801, the memory 802, the input / output interface 803, and the communication interface 804) of the device. The processor 801, the memory 802, the input / output interface 803, and the communication interface 804 are communicatively connected to each other within the device through the bus 805.
[0082] The embodiment of the present application further provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the defect determination method.
[0083] The memory is a non-transitory computer readable storage medium, and can be used to store a non-transitory software program and a non-transitory computer executable program. In addition, the memory can include a high-speed random access memory, and can further include a non-transitory memory, for example, at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state memory device. In some embodiments, the memory can optionally include a memory remotely arranged relative to the processor, and the remote memory can be connected to the processor through a network. Examples of the network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.
[0084] The defect determination method, the defect determination device, the electronic device, and the storage medium provided by the embodiment of the present application can obtain an image by shooting a target product through a camera, analyze the image to identify a defect area, convert pixel information of the defect into accurate physical size information (such as an actual size) by using a dynamic calibration technology, input the physical size information into a preset composite logic tree for determination, take the defect determination conditions (such as length, area, or global threshold) set by a process expert as nodes of the logic tree, and realize nonlinear decision making through any nested combination of logical operators such as and, or, and not, and finally output a classification result (such as qualified, unqualified, or critical) of the target product, so that high-precision and interpretable defect detection is realized.
[0085] The embodiments described in the embodiments of the present application are used to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. Those skilled in the art can know that, with the evolution of technology and the appearance of new application scenarios, the technical solutions provided by the embodiments of the present application are also applicable to similar technical problems.
[0086] Those skilled in the art can understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and can include more or fewer steps than those shown in the figures, or combine certain steps or different steps.
[0087] The device embodiments described above are only schematic, and units described as separate components can or can not be physically separate, that is, can be located in one place, or can be distributed on multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the embodiments.
[0088] Those skilled in the art can understand that all or some of the steps in the method disclosed above, the function modules / units in the system and the device can be implemented as software, firmware, hardware or appropriate combination thereof.
[0089] The terms "first", "second", "third", "fourth" and the like in the description of the application and in the claims hereof, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the use of these terms herein is to be construed to cover a changeable order, arrangement, grouping, numbering, and / or sequence. Also, the term "comprises" and variations thereof, such as "comprising" and "including", are intended to cover a non-exclusive inclusion, such that any process, method, article, or apparatus that includes a list of elements is not necessarily limited to those elements, but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. Further, the term "coupled" and variations thereof, are intended to cover a direct or indirect coupling or connection.
[0090] It should be understood that, in the present application, "at least one" means one or more, "multiple" means two or more. "And / or", used to describe the relationship between associated objects, means that there can be three relationships, for example, "A and / or B" can mean: only A, only B, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally represents an "or" relationship between the associated objects. "At least one of the following" or similar expressions means any combination of these items, including single or multiple combinations of any combination. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be singular or plural.
[0091] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above-mentioned units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be omitted or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed objects can be indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0092] The units described as separate components above can or can not be physically separate, and the components shown as units can or can not be physical units, that is, can be located in one place, or can be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment scheme.
[0093] In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.
[0094] If the integrated unit is realized in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on such understanding, the technical scheme of the present application or the part that contributes to the prior art or the whole or part of the technical scheme can be embodied in the form of a software product. The computer software product is stored in a storage medium, including multiple instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method of each embodiment of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various program storage media.
[0095] The preferred embodiments of the embodiments of the present application are described above with reference to the accompanying drawings, but this does not limit the scope of the rights of the embodiments of the present application. Any modifications, equivalent replacements and improvements made by those skilled in the art without departing from the scope and essence of the embodiments of the present application shall be within the scope of the rights of the embodiments of the present application.
Claims
1. A defect judgment method characterized by comprising: The method is applied to an industrial visual inspection system comprising a camera, and comprises: capturing a target product on an industrial production line by the camera to obtain a first image; performing image analysis on the first image to obtain a defect area of the target product in the first image if the target product has a defect; converting pixel information of the defect area into physical size information, the physical size information comprising actual physical size of the defect area; inputting the physical size information into a preset logical tree to determine a classification of the target product, the logical tree having preset defect determination conditions as nodes, and each node being connected by a logical operator, the logical operator comprising any nested combination of AND, OR and NOT.
2. The method of claim 1, wherein, The conversion of the pixel information of the defect area into the physical size information comprises: obtaining configuration information of the industrial production line and calibration parameters of the camera, the configuration information of the industrial production line comprising a model of a product produced by the industrial production line, a model of the camera, a lens focal length of the camera, an installation height and an installation angle of the camera, and the calibration parameters of the camera comprising camera intrinsic parameters, camera extrinsic parameters and distortion coefficients; constructing a dynamic mapping model according to the configuration information of the industrial production line and the calibration parameters of the camera, the dynamic mapping model being used to map coordinates in a pixel coordinate system to a physical coordinate system; converting the pixel information of the defect area into the physical size information according to the dynamic mapping model.
3. The method of claim 1, wherein, The inputting of the physical size information into the preset logical tree to determine the classification of the target product comprises: obtaining the defect determination conditions and constructing the logical tree based on the defect determination conditions, the defect determination conditions comprising a first determination condition for a single target product and a second determination condition for a single defect, the first determination condition comprising an upper limit of the number of defects of a single target product and an upper limit of the total area of defects, and the second determination condition comprising a length threshold, a width threshold, an area threshold and a position coordinate range of a single defect; inputting the physical size information into the logical tree to determine the classification of the target product.
4. The method of claim 3, wherein, The obtaining of the defect determination conditions and the construction of the logical tree based on the defect determination conditions comprise: obtaining historical qualified defect data and historical unqualified defect data; generating an initial structure of the logical tree by a decision tree algorithm according to the historical qualified defect data and the historical unqualified defect data; sending the initial structure of the logical tree to a client; receiving an optimization scheme or a confirmation instruction of the initial structure of the logical tree from the client; obtaining the logical tree according to the optimization scheme or the confirmation instruction.
5. The method of claim 3, wherein, Before the obtaining of the defect determination conditions, the method further comprises: performing permission management on a threshold configuration file, the threshold configuration file comprising the defect determination conditions and thresholds corresponding to the defect determination conditions. When a new version of the threshold configuration file is released, the new version of the threshold configuration file is synchronized to the industrial visual inspection system through a hot deployment mechanism.
6. The method of claim 5, wherein, The permission management of the threshold configuration file includes: allocating operation permissions on the threshold configuration file to different users, the operation permissions including viewing, editing, and auditing; encrypting the user credentials for storage; version marking and storage of modification operations on the threshold configuration file.
7. The method of claim 5, wherein, After the above-mentioned step, the method further includes: after applying the new version of the threshold configuration file, obtaining the misjudgment rate of the industrial production line in real time; if the misjudgment rate exceeds a preset threshold, rolling back the threshold configuration file to the previous version.
8. A defect determination device, characterized by comprising: The device is applied to an industrial visual inspection system, and the industrial visual inspection system includes a camera, and the device includes: a shooting module configured to shoot a target product on an industrial production line through the camera to obtain a first image; an obtaining module configured to, in a case where it is determined that the target product has a defect, obtain a defect area of the target product in the first image by performing image analysis on the first image; a conversion module configured to convert pixel information of the defect area into physical size information, the physical size information including an actual physical size of the defect area; a determination module configured to input the physical size information into a preset logic tree to determine a classification of the target product, the logic tree having preset defect determination conditions as nodes, and each node being connected by a logic operator, the logic operator including any nested combination of AND, OR, and NOT.
9. An electronic device, comprising: The electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the defect determination method of any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium storing a computer program, the computer program comprising instructions that, when executed by a computer, cause the computer to perform the method of any one of claims 1 to 9. The computer program is executed by the processor to implement the defect determination method of any one of claims 1 to 7.
Citation Information
Patent Citations
POY product detection method and device, electronic equipment and storage medium
CN115931905A
Defect filtering method, electronic equipment and storage medium
CN118212477A
Automatic test performance benchmark construction method and device and storage medium
CN120388255A
Outer wall visual inspection method and system based on deep learning
CN120495942A
Fault analysis method and device of storage battery pack, electronic equipment and storage medium
CN120507652A