A multi-terminal fine-grained quality detection method based on topological slot and adaptive re-inspection
Patent Information
- Application Number
- CN202610750687.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-28
- Publication Date
- 2026-08-18
AI Technical Summary
[0006]本发明的目的在于提供一种基于拓扑槽位与自适应复检的多端子细粒度质量检测方法,解决现有AI检测结果无物理槽位编号、检测项归属不稳定、低置信结果缺乏复检和整件质量判定不够可靠的问题
[0008]与现有技术相比,本发明具有以下有益效果:(1)利用拓扑槽位模型将无序检测框转换为具有物理编号的槽位级状态,提高异常定位稳定性;(2)通过细粒度检测项归属实现端子头、线芯压脚、露线芯、露胶皮、胶皮压脚和飞丝等质量项的统一判定;(3)通过自适应复检降低低置信、漏检和错检导致的误判;(4)底层质量检测模型可采用YOLO、DETR、RT-DETR、分割、关键点或多任务视觉模型,具有良好的算法替换性。
Smart Images

Figure CN122598082A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of machine vision, artificial intelligence inspection, and industrial assembly quality control, and in particular to a multi-terminal fine-grained quality inspection method based on topological slots and adaptive re-inspection. Background Technology
[0002] Multi-terminal wire harnesses, terminal blocks, connector terminals, and crimp terminals are widely used in electrical connection scenarios. The condition of their terminal heads, wire core clamps, exposed wires, exposed insulation, insulation clamps, and loose wires directly affects the reliability of electrical connections. Because terminals usually have a fixed number, regular arrangement, and similar appearance, manual inspection is easily affected by visual fatigue, metallic reflection, and partial obstruction, resulting in the risk of missed or false inspections.
[0003] Existing AI inspection methods often treat terminals, pressure feet, or defective areas as independent targets, resulting in a set of disordered detection boxes. For multi-terminal arrays, relying solely on detection boxes makes it difficult to reliably determine which terminal has an anomaly, and it is also difficult to ensure the correct attribution of detection items when there are missed detections, duplicate detections, or adjacent terminals are close together.
[0004] Existing methods still have shortcomings in handling low-confidence detection results. When there is localized reflection at the terminal, the defect area is small, or the detection item is obscured, the master inspection model may give low-confidence results or miss detection results. If there is no adaptive re-inspection mechanism, it is easy to produce incorrect OK judgments.
[0005] Therefore, there is a need for a multi-terminal fine-grained quality inspection method that can utilize the terminal array topology, assign inspection items to fixed physical slots, and re-inspect low-confidence or conflicting slots. Summary of the Invention
[0006] The purpose of this invention is to provide a multi-terminal fine-grained quality inspection method based on topological slots and adaptive re-inspection, which solves the problems of existing AI inspection results lacking physical slot numbers, unstable inspection item attribution, lack of re-inspection for low-confidence results, and unreliable overall quality judgment.
[0007] This invention establishes a terminal topology slot model by reading the product testing formula, and completes the main inspection using a quality inspection model. It assigns inspection items such as the entire terminal, terminal head, wire core pressing foot, exposed wire core, exposed rubber, rubber pressing foot, and fly filament to the corresponding slot. Then, it triggers adaptive re-inspection based on missing items, low confidence, repeated inspection, position conflict, and slot quality score. Finally, it integrates the main inspection and re-inspection results to output the slot-level and overall component quality status.
[0008] Compared with the prior art, the present invention has the following beneficial effects: (1) It uses the topological slot model to convert the disordered detection box into a slot-level state with physical number, thereby improving the stability of abnormal location; (2) It achieves unified judgment of quality items such as terminal head, wire core pressing foot, exposed wire core, exposed rubber, rubber pressing foot and flying wire through fine-grained detection item classification; (3) It reduces misjudgment caused by low confidence, missed detection and wrong detection through adaptive re-inspection; (4) The underlying quality detection model can adopt YOLO, DETR, RT-DETR, segmentation, key point or multi-task vision model, which has good algorithm replacement. Attached Figure Description
[0009] Figure 1 This is a flowchart of a multi-terminal fine-grained quality inspection process provided in an embodiment of the present invention;
[0010] Figure 2 This is a schematic diagram of the terminal topology slot model provided in an embodiment of the present invention;
[0011] Figure 3 This is a schematic diagram illustrating the attribution of AI main inspection and inspection items provided in an embodiment of the present invention;
[0012] Figure 4 This is a schematic diagram of a single-slot fine-grained detection item provided in an embodiment of the present invention;
[0013] Figure 5 This is a schematic diagram of the adaptive re-inspection triggering conditions provided in an embodiment of the present invention;
[0014] Figure 6 This is a schematic diagram illustrating the fusion of primary inspection and re-inspection results provided in an embodiment of the present invention;
[0015] Figure 7 This is a schematic diagram illustrating the implementation of the replaceable master inspection model provided in an embodiment of the present invention;
[0016] Figure 8 This is a schematic diagram of the multi-terminal detection system provided in an embodiment of the present invention; Detailed Implementation
[0017] The present invention will be further described below with reference to the accompanying drawings and specific embodiments. It should be understood that the embodiments described are only for explaining the present invention and are not intended to limit the scope of protection of the present invention.
[0018] like Figure 1 As shown, this invention first acquires images of multi-terminal workpieces, which can be terminal blocks, wire harness crimp terminals, connector terminals, or other regular terminal arrays. The system reads the product inspection formula, which includes the number of terminals, slot arrangement direction, terminal spacing, slot width and height, inspection items for each slot, quality judgment threshold, and re-inspection threshold.
[0019] like Figure 2As shown, a topology slot model is established based on the detection formula or terminal array positioning results. The i-th slot can be represented as Si={xi,yi,wi,hi,Ni,Pi}, where xi and yi are the center coordinates of the slot, wi and hi are the slot dimensions, Ni is the set of adjacent slots, and Pi is the prior location of the key detection item within the slot. Multiple slots and their adjacent relationships constitute the topology graph G=(V,E).
[0020] The terminal array area can be determined through fixed ROI, target detection, edge localization, template matching, or manual teaching. When there are slight offsets, scaling, or rotations in the image, the slot model can be geometrically corrected using the array outline, terminal centerline, or reference points.
[0021] like Figure 3 As shown, the system uses a quality inspection model to perform main inspection on the terminal array area. The quality inspection model is not limited to a specific network structure and can be a one-stage target detection model, a two-stage target detection model, an end-to-end target detection model, a Transformer query mechanism detection model, an instance segmentation model, a semantic segmentation model, a key point detection model, or a multi-task visual recognition model.
[0022] The main inspection model outputs the inspection results for the overall terminal, terminal head, wire core pressing foot, exposed wire core, exposed rubber, rubber pressing foot, fly filament, and other defect areas. For the j-th inspection result Bj and the ith slot Si, the system calculates the attribution cost: Aij=α1·Dij+α2·(1-Gij)+α3·Kij+α4·(1-Pij).
[0023] Where Dij is the normalized distance between the detection result and the slot, Gij is the overlap or projection consistency, Kij is the category prior penalty, Pij is the detection confidence, and α1 to α4 are weight coefficients. The system can use minimum cost matching, Hungarian matching, or rule-based filtering to assign detection items to corresponding slots.
[0024] like Figure 4 As shown, a single terminal slot can include detection items such as terminal head, wire core clamping foot, exposed wire core, exposed insulation, insulation clamping foot, and fly filament. Based on the assigned detection items, the system generates a slot-level state vector: Vi={Ti,Hi,Ci,Ei,Ri,Ii,Fi,Di,Pi,Mi}.
[0025] Where Ti represents the terminal presence state, Hi represents the terminal head state, Ci represents the wire core pressing foot state, Ei represents the exposed wire core state, Ri represents the exposed insulation state, Ii represents the insulation pressing foot state, Fi represents the fly wire state, Di represents the position or size deviation, Pi represents the main inspection confidence level, and Mi represents the slot matching confidence level.
[0026] like Figure 5As shown, the system determines whether to trigger adaptive re-inspection based on the slot-level state vector. Re-inspection triggering conditions include: detection confidence level below a threshold, multiple similar detection results in the same slot, missing expected detection items in the slot, conflict between the detection item position and prior knowledge, abnormal deviation of results from adjacent slots, inconsistency between sub-item quality judgment and overall quality judgment, or slot quality score below a threshold.
[0027] For slots that trigger re-inspection, the system performs high-resolution local cropping, brightness equalization, reflection suppression, scale magnification, secondary target detection, local segmentation, keypoint regression, fine-grained classification, or dimensional tolerance measurement. The re-inspection model can be the same as the main inspection model, or it can use an independent lightweight classification model, segmentation model, keypoint model, or rule-based measurement model.
[0028] like Figure 6 As shown, the quality score of the slot is obtained by merging the main inspection result and the re-inspection result. The quality score of the i-th slot can be expressed as: Qi = β1·Pi + β2·Ri + β3·Mi - β4·Ei.
[0029] Where Pi is the primary detection confidence level, Ri is the re-detection confidence level, Mi is the slot matching confidence level, Ei is the anomaly penalty term, and β1 to β4 are weighting coefficients. When any key detection item is abnormal or Qi is below the threshold, the corresponding slot is judged as NG.
[0030] like Figure 7 As shown, the master detection model of this invention can be replaced according to actual deployment requirements. For example, in scenarios with high real-time requirements, a YOLO-like one-stage detection model can be used; in end-to-end detection or dense target scenarios, an RT-DETR or DETR-like model can be used; in scenarios with high boundary measurement requirements, a segmentation model or a key point model can be used. Different models uniformly output detection boxes, categories, confidence scores, key points or masks, which are then fed into the slot assignment and re-inspection module.
[0031] like Figure 8 As shown, this invention can be deployed as a multi-terminal inspection system, including a camera light source module, a recipe management module, a master inspection inference module, a slot topology module, an adaptive re-inspection module, a quality judgment module, and a traceability output module. The system outputs the inspection item status, defect category, re-inspection mark, confidence level, and overall OK / NG result for each slot.
[0032] In one exemplary embodiment, the terminal array to be tested includes six terminal slots, each slot including a terminal head, a wire core clamping foot, an exposed wire core, an exposed insulating layer, and an insulating layer clamping foot. After the main inspection model performs the inspection, if the fourth slot lacks an insulating layer clamping foot inspection item and the slot matching confidence level is lower than a set threshold, the system triggers a re-inspection of the fourth slot; if the re-inspection result still shows a missing insulating layer clamping foot, the system outputs "NG" for the fourth slot and classifies the entire component as "NG".
[0033] In another embodiment, the primary inspection model uses a YOLO-like detection network, and the secondary inspection model uses a local classification network; in yet another embodiment, the primary inspection model uses an RT-DETR-like detection network, and the secondary inspection model uses a keypoint measurement model. These model substitutions do not affect the core process of this invention based on topology slot assignment and adaptive secondary inspection.
[0034] In one master inspection embodiment, the master inspection model outputs six types of inspection items: terminal head, wire core pressing foot, exposed wire core, exposed insulation, insulation pressing foot, and fly filament. When multiple candidate results appear for the same inspection item in the same slot, the system filters them based on confidence level, prior knowledge of slot position, and prior knowledge of inspection frame size; when the difference between candidate results exceeds a threshold, a re-inspection is triggered.
[0035] In one embodiment of slot alignment, the system first detects the overall terminal frame, and then fits the terminal array direction and adjacent spacing based on the center of the overall frame. When a terminal frame is missed, the system can still complete the slot position based on the spacing between the slots on both sides, and perform a local re-inspection of the slot, thereby reducing slot numbering errors caused by missed detections.
[0036] In a fine-grained quality assessment embodiment, the terminal head condition is used to determine whether the terminal head is missing, offset, or deformed; the wire core pressing foot condition is used to determine whether the crimping area is missing, offset, or insufficient; the exposed wire core condition is used to determine the position and length of the exposed conductor; the exposed rubber and rubber pressing foot condition is used to determine whether the insulation crimping area is missing or offset; and the burr condition is used to determine whether the wire core has loose strands or burrs.
[0037] In an adaptive re-inspection embodiment, the re-inspection trigger function can be expressed as: Ri = I(Pi<τp) ∨ I(Mi<τm) ∨ I(Ei>τe) ∨ I(Ni=0) ∨ I(Ci=1).
[0038] Where Ri is the marker for whether the i-th slot triggers a re-inspection, Pi is the main inspection confidence level, Mi is the slot matching confidence level, Ei is the position deviation, Ni is the number of key detection items, Ci is the conflict state marker, and τp, τm and τe are thresholds.
[0039] In one re-inspection embodiment, the system locally clips the slots that trigger the re-inspection. The clipping frame can be obtained by proportionally expanding the slot frame. After image enhancement, the clipped area is input into the re-inspection model, which outputs fine-grained defect categories or key point locations. If the re-inspection result is consistent with the main inspection result, the confidence level of the corresponding slot result is increased; if the results are inconsistent, they are fused based on the re-inspection confidence level and the importance of quality items.
[0040] In one output embodiment, the system generates an inspection report based on the slot as the basic unit. Each slot report includes the slot number, terminal presence status, terminal head status, wire core clamping foot status, exposed wire core status, exposed insulation status, insulation clamping foot status, fly filament status, re-inspection mark, defect category, defect coordinates, slot quality score, and OK / NG result.
[0041] In one model replacement embodiment, if the production line has high speed requirements, a lightweight YOLO-type master inspection model can be used; if terminals are densely packed and end-to-end inspection is required, an RT-DETR or DETR-type master inspection model can be used; if stripping or presser foot boundary measurement requirements are high, a segmentation model or a key point model can be used. All of the above models enter the slot assignment, re-inspection, and quality fusion process through a unified output interface.
[0042] In an exemplary effect verification, compared with the method of directly outputting detection results using only the master detection model, adding topology slot assignment can reduce the misclassification rate; adding adaptive re-inspection can reduce false positives caused by low-confidence missed detections and missing key detection items. The effects described are related to the specific model, data scale, and process thresholds, and are not intended to limit the scope of protection of this invention.
[0043] In one embodiment of terminal array positioning, the system can first detect the overall terminal frame, or it can detect the outer frame of the terminal array, fixture positioning points, or connector reference edges. Based on the positioning results, the system fits the terminal array direction vector and vertical direction vector, and generates a slot sequence according to the number and spacing of terminals given in the recipe.
[0044] In one slot completion embodiment, when the master inspection model fails to detect the overall frame of a certain terminal, the system does not directly delete the slot. Instead, it predicts the position of the slot based on the coordinates of adjacent slots and the terminal spacing. If a key inspection item is predicted to be missing within the slot, a re-inspection is triggered, and a missing or suspected missing item status is output.
[0045] In one embodiment of item assignment, terminal head inspection items are preferentially assigned to the upper area of the slot, wire core pressing foot and exposed wire core inspection items are preferentially assigned to the middle area of the slot, and exposed rubber and rubber pressing foot inspection items are preferentially assigned to the lower area of the slot. If the center of an inspection item is located in the boundary area of adjacent slots, the determination is made by combining the overlap ratio of the inspection frames and the prior category.
[0046] In one implementation of quality item weighting, missing terminal heads, missing wire core clips, missing rubber clips, and abnormal wire splinters are designated as critical anomalies; minor positional misalignments and low-confidence items caused by localized glare are designated as review items. Once a critical anomaly is confirmed, the corresponding slot will be directly NG (Not Acceptable Quality).
[0047] In one embodiment of slot feature enhancement, the system can generate a slot query vector for each slot. The slot query vector is encoded by the slot number, slot coordinates, slot size, and slot adjacency relationship. After fusing the slot query vector with local image features of the slot, it can be used for slot-level classification, re-inspection triggering, or quality score calculation. Qi_slot = Emb(i) + MLP(xi,yi,wi,hi,Ni).
[0048] In one topology interaction embodiment, adjacent slots can interact based on their features. If the detection result of a certain slot is abnormal but the adjacent slots are stable, the system can increase the re-inspection priority of that slot; if multiple consecutive slots show positional shifts, the system can determine that it is an overall positioning shift and recalibrate the slot model.
[0049] In one embodiment of re-inspection priority, the system determines the re-inspection order based on the slot quality score, the type of anomaly, and the importance of the detection item. Critical anomalies, low-confidence high-risk items, and slot ownership conflicts are re-inspected first; ordinary minor deviations can be re-inspected later or only a warning can be output if the cycle time is not affected.
[0050] In one embodiment of re-inspection fusion, if the confidence level of the re-inspection result is higher than that of the main inspection result, the re-inspection result is used as the final result; if both the main inspection and the re-inspection are of low confidence, the result is output as pending manual confirmation; if the main inspection and the re-inspection are of different categories but both point to NG, the result is output as a composite anomaly and both detection results are retained for traceability.
[0051] In one system deployment embodiment, the master inspection model can be deployed on an industrial control computer, edge computing device, or server; the re-inspection model can be started as needed. For production lines with high cycle time requirements, the system only performs re-inspection on slots that meet the trigger conditions, avoiding the extra time consumption caused by repeatedly inspecting all slots.
[0052] In one example test result, all test items in slot 1 are normal, the quality score is 0.96, and the output is OK; the core clamping foot test in slot 2 is missing, and it is still missing after triggering a retest, so the output is poor core clamping foot; the confidence level of the fly filament area in slot 5 is low, and after retesting, it is confirmed that there is no fly filament, so the output is OK and marked as retested.
[0053] In one visualization output embodiment, the system labels the inspection results on the original image with slot numbers, displaying not only the inspection frame but also the terminal head, pressure foot, fly wire, and overall quality status of each slot. For NG slots, the system can output a magnified view of the defect area, the confidence level of the inspection item, and a comparison of the results before and after re-inspection.
[0054] In one traceability implementation, the system stores the image number, product model, slot result, re-inspection record, model version, formula version, and overall product judgment result for each product in a database. Subsequently, the system can use the slot number to statistically analyze frequently occurring anomaly locations, providing a basis for process debugging and equipment maintenance.
[0055] In one model training embodiment, the primary inspection model can be trained using detection bounding boxes for both the overall terminal and fine-grained inspection items, while the secondary inspection model can be trained using cropped slot images and slot-level quality labels. The two types of models can be used together, or trained and deployed separately depending on the actual amount of data.
[0056] In one embodiment of production line error prevention, the system can count the number of anomalies in the same slot across multiple consecutive products. When a slot experiences the same type of anomaly repeatedly within a short period, the system outputs a process warning to indicate that the crimping equipment, wire stripping equipment, terminal feeding mechanism, or vision acquisition mechanism may require maintenance.
[0057] In one embodiment of cycle control, the system can set a maximum number of slots to be re-inspected. If the number of slots triggering re-inspection in the same image exceeds the set value, the system can prioritize re-inspecting the slots corresponding to critical anomalies and mark the remaining slots as pending confirmation, so as to avoid the re-inspection process affecting the production line cycle time.
[0058] In one model update embodiment, the system uses the re-inspection confirmation results and the manual confirmation results as sample return data for subsequent supplementary training of the master inspection model or the re-inspection model. The sample return data includes at least the slot number, local image, detection item category, re-inspection result, and final confirmation result.
[0059] This invention is not limited to the above-described embodiments. For those skilled in the art, without departing from the concept of this invention, equivalent substitutions or improvements can be made to the detection model, re-inspection model, slot establishment method, and quality fusion rules. All such substitutions and improvements should fall within the protection scope of this invention.
Claims
1. A multi-terminal fine-grained quality inspection method based on topological slots and adaptive re-inspection, characterized in that, Includes the following steps: S1. Acquire an image to be inspected containing a multi-terminal array, terminal crimping area, or terminal connector area, and read the inspection formula corresponding to the product model; S2. Locate the terminal array area in the image to be inspected, and establish a terminal topology slot model based on the number of terminals, arrangement direction, adjacent spacing, reference edge, or teaching point, generating the 1st to Nth terminal slots with physical numbers; S3. Perform a main inspection on the terminal array area using a quality inspection model, obtaining inspection results for the overall terminal, terminal head, wire core pressing foot, exposed wire core, exposed rubber, rubber pressing foot, fly wire, or defective areas; S4. Assign the main inspection results to [specific categories / regions] based on the center of the inspection frame, area overlap, relative position of the slots, category prior, and inspection confidence level. S5. Generate a slot-level state vector for each terminal slot. The slot-level state vector includes one or more of the following: terminal presence state, terminal head state, wire core presser foot state, exposed wire core state, exposed insulation state, insulation presser foot state, fly wire state, position offset, detection confidence, and slot matching confidence. S6. Determine whether to trigger adaptive re-inspection based on the slot-level state vector, and perform local trimming, enhancement, secondary inspection, fine-grained classification, size measurement, or manual confirmation prompts on the slots that trigger re-inspection. S7. Merge the main inspection results and re-inspection results, and output the fine-grained quality status, defect category, defect location, re-inspection mark, confidence, and overall OK / NG result for each terminal slot.
2. The method according to claim 1, characterized in that, The terminal topology slot model includes slot number, slot center coordinates, slot width, slot height, slot adjacency relationship, relative position prior of key detection items in the slot, and slot quality judgment rules; the slot adjacency relationship can be represented as a topology graph composed of terminal slot nodes and their adjacent edges.
3. The method according to claim 1, characterized in that, The quality detection model includes at least one of the following: a one-stage target detection model, a two-stage target detection model, an end-to-end target detection model, a Transformer query mechanism detection model, an instance segmentation model, a semantic segmentation model, a key point detection model, or a multi-task visual recognition model; the model can be implemented using convolutional neural networks, YOLO series networks, DETR series networks, RT-DETR series networks, lightweight networks, or improved structures thereof.
4. The method according to claim 1, characterized in that, The detection results are assigned using a slot-based matching cost function, which can be expressed as Aij=α1·Dij+α2·(1-Gij)+α3·Kij+α4·(1-Pij), where Dij is the normalized distance between the j-th detection result and the ith slot, Gij is the overlap or projection consistency, Kij is the class prior penalty term, Pij is the detection confidence, and α1 to α4 are weight coefficients.
5. The method according to claim 1, characterized in that, The slot-level state vector can be represented as Vi={Ti,Hi,Ci,Ei,Ri,Ii,Fi,Di,Pi,Mi}, where Ti is the terminal presence state, Hi is the terminal head state, Ci is the wire core pressing foot state, Ei is the exposed wire core state, Ri is the exposed insulation state, Ii is the insulation pressing foot state, Fi is the fly wire state, Di is the position or size deviation, Pi is the main inspection confidence level, and Mi is the slot matching confidence level.
6. The method according to claim 1, characterized in that, The triggering conditions for the adaptive re-inspection include at least one of the following: the detection confidence is lower than the threshold, there are multiple similar detection results in the same slot, the expected detection item is missing in the slot, the detection result conflicts with the prior knowledge of the slot position, the results of adjacent slots deviate abnormally, the sub-item quality judgment is inconsistent with the comprehensive quality judgment, or the slot quality score is lower than the threshold.
7. The method according to claim 1, characterized in that, The re-inspection includes performing high-resolution local cropping, brightness equalization, reflection suppression, scale magnification, secondary target detection, key point regression, local segmentation, fine-grained classification, or dimensional tolerance measurement on the slots that trigger the re-inspection. The re-inspection model can be the same as the main inspection model, or it can be an independent lightweight classification model, segmentation model, key point model, or rule measurement model.
8. The method according to claim 1, characterized in that, The fusion of the main inspection result and the re-inspection result includes weighted fusion based on the re-inspection confidence, the main inspection confidence, the slot matching confidence, and the importance of quality items, to obtain the slot quality score Qi = β1·Pi + β2·Ri + β3·Mi - β4·Ei; when any key inspection item is abnormal or Qi is lower than the threshold, the corresponding slot is judged as NG.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the multi-terminal fine-grained quality inspection method based on topology slots and adaptive re-inspection as described in any one of claims 1 to 8.
10. A multi-terminal fine-grained quality inspection system, characterized in that, include: The image acquisition module is used to acquire images to be detected from multiple terminals; The recipe management module is used to read the number of terminals, slot topology, and quality judgment rules; The main inspection inference module is used to output the test results of the terminals and their fine-grained test items; The slot assignment module is used to assign the test results to the corresponding terminal slot; The adaptive re-inspection module is used to perform re-inspections on slots with low confidence, missing items, or conflicting items. The quality assessment module is used to output the slot-level defect category, re-inspection mark, confidence level, and overall OK / NG result.