A visual bottle silk screen arrangement anomaly detection method
By training a model and introducing data augmentation and sequence verification techniques, the problems of uncertainty in the feed angle of the line scan camera and the scarcity of samples were solved, enabling efficient and accurate detection of logical anomalies in the silkscreen printing on wine bottles. This method is applicable to different bottle types and detection locations.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SICHUAN SHUJU INTELLIGENT MFG TECH CO LTD
- Filing Date
- 2025-06-11
- Publication Date
- 2026-08-04
AI Technical Summary
Existing technologies suffer from inconsistent silkscreen printing order due to different entry angles when acquiring images using line-scan cameras, and there are insufficient actual production defect samples, resulting in low accuracy in detecting logical anomalies in wine bottle silkscreen printing.
By training a silkscreen pattern detection model, employing data augmentation techniques such as target position swapping, and combining horizontal and vertical sequence verification, standard sequence groups are generated and matched. An adaptive center point coordinate sorting algorithm is used to process the annular arrangement characteristics of line scan camera imaging, thus constructing an unsupervised sequence verification framework to accurately locate abnormal positions.
It solves the problems of uncertain feed angle and sample scarcity in line scanning cameras, improves the versatility and accuracy of detection, can adapt to different bottle types and detection sites, requires no hardware modification, and achieves pixel-level anomaly localization.
Smart Images

Figure CN120672709B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of industrial image processing, and provides a method for detecting abnormalities in the silkscreen printing arrangement on wine bottles based on visual perception. Background Technology
[0002] In the production of alcoholic beverages, the quality inspection of screen printing on the bottle surface is a crucial step. Screen-printed patterns are typically distributed across different parts of the bottle, including the bottom, body, and neck. During actual production, various factors can lead to problems with screen printing quality, affecting not only the product's aesthetics but also causing consumers to question its authenticity. Screen printing anomalies can generally be categorized into two main types: structural anomalies and logical anomalies. Structural anomalies refer to physical defects in the screen printing pattern itself, such as color differences, scratches, bubbles, dirt, and blurriness. Logical anomalies refer to errors in the arrangement of screen printing patterns or missing elements. Detecting both types of anomalies is equally important.
[0003] Traditional screen printing quality inspection relies primarily on manual inspection, which suffers from subjectivity, low efficiency, and susceptibility to fatigue and misjudgments. Automated vision inspection systems can improve both efficiency and accuracy. While there is considerable research on intelligent structural anomaly recognition technology in industrial defect detection, research on logical anomalies has also been gaining traction in recent years. Common methods include setting specific sorting logic rules, which are difficult to apply to bottle production lines using line-scan cameras, as different entry angles result in different order rules; template comparison for anomaly recognition, which is sensitive to rotation, scaling, and lighting changes; and the limited number of actual production defect samples makes it difficult to directly train end-to-end networks for defect detection. Other methods combine local and global branch networks to capture structural and logical anomalies, but fitting the normal sorting distribution to the global branch network becomes challenging when the normal distribution is complex. This patent proposes a vision-based method for detecting anomalies in bottle screen printing arrangement. This method is applicable to verifying screen printing image sequences with circular / linear arrangements based on line-scan acquisition and linear arrangements based on area array acquisition, and is thus suitable for different bottle types and different parts of the bottle. Summary of the Invention
[0004] The purpose of this invention is to solve the technical problems of inconsistent silkscreen printing order rules due to different entry angles when acquiring images based on line scan cameras, and low accuracy in detecting logical anomalies in wine bottle silkscreen printing caused by insufficient actual production defect samples making it difficult to train an end-to-end network.
[0005] To achieve the above objectives, the present invention employs the following technical means:
[0006] This invention provides a visual method for detecting abnormalities in the silkscreen printing arrangement on wine bottles, comprising the following steps:
[0007] Step 1: Train the silkscreen pattern detection model: By collecting normal bottle data and performing data augmentation that includes target position swapping, train the model based on the target detection algorithm;
[0008] Step 2: Construct the horizontal and vertical sequences of the image to be detected: After inputting the image into the model trained in Step 1 for element localization, construct the horizontal and vertical sequences respectively using the center point coordinates (cx, cy);
[0009] Step 3: Verify sequence for abnormalities: Generate a standard sequence set and compare it sequentially. If a match fails, trigger the localization module.
[0010] Step 4: Output anomaly location box: Based on the sequence length difference or element difference statistical results, return the minimum bounding rectangle or multi-element anomaly bounding box of the detection model.
[0011] In the above scheme, step 1 includes the following steps:
[0012] Step 1.1: Select a line scan camera or an area scan camera to image the silkscreen pattern on the bottle to be inspected, and collect a batch of silkscreen image data of normal bottles. The number of normal bottles N is greater than 200 to cover different glass bottle reflectivity and feeding angle.
[0013] Step 1.2: Manually annotate the silkscreen image data, assign category labels to each silkscreen element, and perform data augmentation operations on the annotated data; the data augmentation operations include: flipping, rotating, brightness variation, mosaic enhancement, and target position swapping enhancement;
[0014] Specifically, the target position swap enhancement involves randomly selecting two silkscreen elements from the labeled data, swapping their positions, adjusting their size to the size corresponding to the target position and covering the elements at the original target position, and simultaneously swapping their category labels to generate new training samples.
[0015] Step 1.3: Supervised training is performed on the enhanced data based on the target detection model. In the early stage of training, mosaic enhancement is enabled to improve generalization, and in the last 10 rounds, mosaic enhancement is turned off to improve the accuracy of target boundary localization.
[0016] In the above scheme, the steps of constructing the horizontal and vertical sequences of the image to be detected include:
[0017] Step 2.1: Input the image to be detected into the silkscreen pattern detection model and obtain the silkscreen element localization result. The localization result includes category, confidence level and target rectangle coordinate information, wherein the upper left corner coordinates of the target rectangle are (x1, y1) and the lower right corner coordinates are (x2, y2).
[0018] The following filtering strategy is applied to the location results:
[0019] (a) Filter low-confidence detection results based on a confidence threshold th = 0.5;
[0020] (b) Calculate the pixel width of each silkscreen element and remove abnormal elements according to the preset category standard width and error threshold;
[0021] (c) For overlapping areas imaged by the line scan camera, calculate the coordinates of the center point of the target bounding box. Sort and locate the leftmost target object O. a And remove any subsequent occurrences of the same target object O. b and the test results on its right side;
[0022] Step 2.2: Based on the center point coordinates c of the filtered target bounding box x and c y Apply c to the horizontal elements respectively x Sort to generate a horizontal sequence, and sort the vertical elements by... Sorting generates a vertical sequence; if the silkscreen pattern is distributed across multiple regions, then horizontal and vertical sequences are constructed separately for each region.
[0023] In the above scheme, the steps for verifying whether the horizontal and vertical sequences are abnormal include:
[0024] Step 3.1: Generate standard sequence groups: based on the coordinates of the center point of the horizontal target box. and the coordinates of the center point of the target box in the vertical direction Construct horizontal and vertical standard sequences;
[0025] For silkscreen elements arranged in a ring, generate all cyclic offset patterns as a standard sequence group in the original order;
[0026] For linearly arranged silkscreen elements, only one standard sequence pattern with a fixed order is generated;
[0027] Step 3.2: Perform anomaly verification: Compare the horizontal and vertical sequences of the image to be detected with all valid patterns in the standard sequence group one by one;
[0028] If any valid pattern is matched, it is determined that no permutation anomaly was found;
[0029] If no valid pattern can be matched, the location module is triggered to perform sequence length verification or element difference statistics to determine the location of the anomaly.
[0030] In the above scheme, the step of outputting the sequence anomaly localization box according to the sequence anomaly localization module includes:
[0031] Step 4.1: Length check to locate missing element status
[0032] When the length of the sequence to be detected is inconsistent with the length of any valid pattern in the standard sequence group, the minimum bounding rectangle of all target position information of the sequence to be detected is output.
[0033] The minimum bounding rectangle is calculated using the following formula:
[0034]
[0035] Where n is the number of target elements in the sequence to be detected; (x i1 y i1 Let (x) be the coordinates of the top-left corner of the i-th target rectangle, and (x) be the coordinates of the top-left corner of the rectangle. i2 y i2 (ox1, oy1) and (ox2, oy2) are the coordinates of the lower right corner of the i-th target rectangle; (ox1, oy1) and (ox2, oy2) are the coordinates of the upper left and lower right corners of the minimum bounding rectangle.
[0036] Step 4.2: Locating Abnormal Status of Differential Elements
[0037] When the length of the sequence to be detected matches the length of a pattern in the standard sequence group, iterate through all standard sequence patterns:
[0038] Record the element categories that differ between each standard sequence and the verification sequence; the element category refers to the silkscreen element category set when annotating the silkscreen pattern detection model, such as... Figure 2 The seven categories of silkscreen elements shown are as follows: bottom_s1 / bottom_s2 / sjf / bottom_s3 / bottom_s4 / bottom_s5 / bottom_s6;
[0039] Compare the lengths of the difference element arrays corresponding to all standard sequences, and select the standard sequence with the smallest difference as the closest matching pattern. Specifically, the sequence to be detected is compared with each standard sequence: at this time, the two sequences have the same length, and the element categories of the two sequences (the sequence to be detected and the standard sequence i) at each position are compared. If they are different, the element category is recorded in the anomaly array i (or difference element array i). There are a total of n standard sequences, which correspond to n anomaly arrays. The one with the smallest difference, i.e., the shortest length among the n anomaly arrays, is selected as the closest match to the standard sequence.
[0040] Return the target bounding boxes corresponding to all element categories that differ from the standard sequence output by the detection model, as anomaly localization information.
[0041] Because the present invention employs the above-mentioned technical means, it has the following beneficial effects:
[0042] 1. Resolve the universality deficiency caused by the uncertainty of the feed angle of the line scan camera.
[0043] Existing methods based on template matching or fixed sorting rules are sensitive to the feed angle of the images acquired by the line scan camera and cannot adapt to changes in the arrangement of screen-printed patterns under different rotation angles. This proposal introduces a cyclic offset mode to generate standard sequence groups (e.g., a horizontal sequence contains 7 combinations of rotational offsets) and combines it with an adaptive center point coordinate sorting algorithm, enabling the system to be compatible with the annular arrangement characteristics of line scan camera imaging. This design breaks through the limitation of traditional rules adapting to a single angle and is particularly suitable for scenarios requiring multiple rounds of acquisition, such as cylindrical bottles.
[0044] 2. Reduce the model's dependence on prior information about relative positions.
[0045] Existing object detection networks are susceptible to interference from element position distribution when handling logical anomalies, leading to an increased false positive rate. This proposal innovatively introduces a "target position swapping" method (e.g., ...) during the data augmentation stage. Figure 3 As shown, by manually constructing images with interchangeable elements, the model is forced to actively learn category features rather than location distribution during training.
[0046] 3. Construct an unsupervised sequence verification framework to avoid the problem of sample scarcity.
[0047] Existing end-to-end detection methods are limited by insufficient industrial defect samples, making it difficult to directly train anomaly recognition models. This proposal transforms the problem into a sequence verification task: first, an object detection network is used to obtain element location information, and then horizontal / vertical sequences are constructed based on the geometric center point coordinates. Comparison with standard sequence groups is completed through permutation and combination matching, without relying on anomaly sample labels. This scheme can be implemented even with only a normal sample dataset (N>200), solving the problem of high anomaly sample collection costs in industrial scenarios.
[0048] 4. Two-dimensional sequence verification enables precise positioning capabilities.
[0049] Traditional methods for detecting logical anomalies often only output the overall state, making it difficult to pinpoint the specific defect location. This proposal innovatively constructs a horizontal + vertical dual-sequence verification mechanism: when the lengths are consistent, a minimum difference matching algorithm is used to accurately locate the anomaly point by calculating the element deviation set of the standard sequence; when the lengths are inconsistent, the minimum bounding rectangle is used to quickly determine the missing region. This method improves the positioning accuracy from the component level of existing technologies to the pixel level, ensuring that every anomaly location is traceable.
[0050] 5. Compatible with multiple camera types and complex bottle shape inspection requirements
[0051] Existing solutions are typically designed for specific camera types (such as area scan cameras), making it difficult to adapt to different bottle shapes and inspection areas. This proposal achieves technical adaptability through a modular architecture: line scan cameras employ a circular sequence processing + duplicate element removal strategy (Equation 1 calculates the center point coordinates), while area scan cameras use linear sequence processing; for special areas such as the bottle bottom and neck, multi-area inspection is achieved through a detachable vertical sequence construction method (such as sjf->bottom s3 in the example). This design allows for seamless integration into existing production lines without hardware modifications. Attached Figure Description
[0052] Figure 1 Represent the algorithm flowchart;
[0053] Figure 2 Examples of line scan camera imaging and manual annotation;
[0054] Figure 3 An example of image enhancement by swapping the positions of the bottom s1 and bottom s3 elements. Detailed Implementation
[0055] The embodiments of the present invention will be described in detail below. Although the present invention will be described and illustrated in conjunction with some specific embodiments, it should be noted that the present invention is not limited to these embodiments. On the contrary, any modifications or equivalent substitutions made to the present invention should be covered within the scope of the claims of the present invention.
[0056] Furthermore, to better illustrate the present invention, numerous specific details are set forth in the following detailed embodiments. Those skilled in the art will understand that the present invention can be practiced without these specific details.
[0057] Example 1
[0058] The flowchart of this patented method is as follows: Figure 1 As shown, the image to be detected is first input into a pre-trained detection model to identify silkscreen pattern elements. Based on the detection results, the silkscreen pattern sequence of the image to be detected is extracted and the sequence is input into the sequence verification module for verification. If there is an anomaly, the specific abnormal element is located and the abnormal status and abnormal location box are reported; otherwise, the normal status is reported.
[0059] Step 1: Train the silkscreen pattern detection model
[0060] Step 1.1 Select the appropriate camera to image the screen-printed pattern to be inspected. Common image acquisition cameras used on wine bottle production lines can be divided into line scan cameras and area scan cameras. The camera selection depends on the bottle shape and screen-printing status. Line scan cameras are generally used to image screen-printed patterns on common cylindrical bottles. Using line scan cameras allows for compatibility with different feeding angles and avoids the distortion problems caused by area scan cameras capturing curved screen-printed images. Area scan cameras are commonly used for other bottle shapes due to their faster imaging response. Normal bottles are the most common type in production; therefore, a batch of data for N normal bottles is collected here, where N is greater than 200, to cover different glass bottle reflectivity and different feeding angles.
[0061] Step 1.2 involves manual annotation and data augmentation of the collected data. Silkscreen elements are annotated and given different labels, such as... Figure 2 As shown. Besides utilizing common data augmentation techniques such as flipping, rotation, brightness changes, and mosaic enhancement, this patent introduces a data augmentation method that swaps target positions. This reduces the target detection network's reliance on prior information about the relative positions of elements, improving the model's ability to learn distinguishing features for each category. For example... Figure 3 As shown, for the already labeled data pairs, any two silkscreen elements are selected and their positions are swapped: their sizes are adjusted to the size of the target location object and covered to form a new image, and the corresponding labels are swapped to form new labels.
[0062] Step 1.3 Train the silkscreen element localization model based on the object detection model. Select an object detection network (such as YOLO.RT-DETR, etc.) for supervised learning. During training, follow these steps: apply mosaic enhancement in the early stages to enrich the data and improve the model's generalization ability, and turn off mosaic enhancement in the last 10 rounds to improve the accuracy of the detection model in locating the target boundary.
[0063] Step 2: Construct the horizontal and vertical sequences of the image to be detected.
[0064] Step 2.1 Input the image to be detected into the silkscreen pattern detection model to locate silkscreen elements and perform post-processing with filtering strategies. The model output includes category, confidence score, and target bounding box location information.
[0065] (x1, y1) are the coordinates of the upper left corner of the target rectangle, and (x2, y2) are the coordinates of the lower right corner of the target rectangle. Filtering is performed based on the model output results. The filtering strategy is as follows: (1) Filtering is performed based on the confidence probability output by the model. Given a confidence threshold th = 0.5, results with high confidence are retained, and false alarms caused by incomplete silkscreen images on both sides of the line scan imaging and interference such as glass illumination are filtered out; (2) The pixel width of the silkscreen element is further calculated based on the detection results to filter out the incomplete elements on both sides of the line scan imaging. The positions of the camera and the wine bottle are relatively stable. Verification and elimination are performed by setting standard image widths and error thresholds for each category; (3) For line scan camera imaging, due to the uncertainty of the entry angle, in order to ensure that the image after imaging has a complete silkscreen element pattern, it will generally rotate 1.5 times or more. Therefore, it is necessary to eliminate the duplicate parts. Elimination method: All detection results are processed according to the center point c. x Sort the data, and calculate the center point coordinates (cx, cy) based on the vertex coordinates of the bounding box, as shown in Formula 1. Find the leftmost target object Oa, and query for the next occurrence of this category of target as target object Ob. Remove Ob and other detection results to its right, as shown in Formula 1. Figure 2 As shown, the rightmost target bottom_s6 was removed.
[0066]
[0067] Step 2.2 Construct the sequence relationship of the image to be detected. The sequence relationship can be divided into horizontal sequence and vertical sequence. Horizontal sequence extraction: Extract the elements to be sorted by using the coordinates of the center point of their target rectangle. c Sort x, such as Figure 2 The horizontal sequence is:
[0068] bottom_s6->bottom_s1->bottom_s2->sjf->bottom_s3->bottom_s4->bottom_s5;
[0069] Vertical sequence extraction: The elements to be sorted are sorted by analogy using the center point coordinates (cy) of the target rectangle. The example wine bottle consists of two parts: the bottom and the body silkscreen. The six silkscreen elements from bottom_s1 to bottom_s6 form a hexagonal well base image with the bottom concave upwards. Therefore, the vertical sequence is constructed by taking any one of the bottom pattern elements, resulting in the vertical sequence: sjf->bottom_s3. If the silkscreen pattern is complex, it can be split into multiple regions, and the horizontal and vertical sequences can be constructed sequentially.
[0070] Step 3: Check for anomalies in the horizontal and vertical sequences.
[0071] Step 3.1 Generate standard sequence groups in the horizontal and vertical directions. The rules for generating the standard sequences are the same as those for generating the image to be detected. Horizontal and vertical standard sequences are constructed based on the cx and cy coordinates of the center point of the silkscreen pattern elements, respectively. The generation of standard sequence groups needs to distinguish between circular and linear sequences. Linear sequence groups contain only one type of standard sequence, while for circular sequences, all cyclic offset patterns of the standard sequences need to be pre-generated. For example… Figure 2 The horizontal sequence shown in the line scan imaging is a circular sequence. An example of a standard horizontal sequence set for a wine bottle is as follows:
[0072] [[bottom_s1->bottom_s2->sjf->bottom_s3->bottom_s4->bottom_s5->bottom_s6],
[0073] [bottom_s2->sjf->bottom_s3->bottom_s4->bottom_s5->bottom_s6->bottom_s1],
[0074] [sjf->bottom_s3->bottom_s4->bottom_s5->bottom_s6->bottom_s1->bottom_s2],
[0075] [bottom_s3->bottom_s4->bottom_s5->bottom_s6->ottom_s1->bottom_s2->sjf],
[0076] [bottom_s4->bottom_s5->bottom_s6->botcom_s1->bottom_s2->sjf->bottom_s3],
[0077] [bottom_s5->bottom_s6->bottom_s1->bottom_s2->sjf->bottom_s3->bottom_s4],
[0078] [bottom_s6->bottom_s1->bottom_s2->sjf->bottom_s3->bottom_s4->bottom_s5]]. If the vertical sequence group is a linear sequence, it contains only one sequence pattern: [[sjf->bottom_s3]].
[0079] Step 3.2 Sequence Anomaly Detection. Check sequentially whether the horizontal and vertical sequences of the image to be detected match any valid pattern from the labeled sequence group. If they match, no anomaly was found; otherwise, anomaly localization and reporting are required.
[0080] Step 4: Output the sequence anomaly localization box based on the sequence anomaly localization module.
[0081] Step 4.1 Length verification to locate missing elements. When the length of the verification sequence is inconsistent with the length of any standard sequence, the minimum bounding rectangle position information (ox1, oy1, ox2, oy2) of the detection box contained in the sequence to be detected is directly output. The minimum bounding rectangle is obtained as shown in Formula 2: Traverse all target position information in the sequence to be detected, with a sequence length of n. ox1 and oy1 take the minimum values of all target positions x1 and y1, respectively, and ox2 and oy2 take the maximum values of all target positions x2 and y2, respectively.
[0082]
[0083] Where n is the number of target elements in the sequence to be detected; (x i1 y i1 Let (x) be the coordinates of the top-left corner of the i-th target rectangle, and (x) be the coordinates of the top-left corner of the rectangle. i2 y i2 (ox1, oy1) and (ox2, oy2) are the coordinates of the lower right corner of the i-th target rectangle; (ox1, oy1) and (ox2, oy2) are the coordinates of the upper left and lower right corners of the minimum bounding rectangle.
[0084] Step 4.2 When the length of the verification sequence matches the length of any standard sequence, iterate through each sequence in the standard sequence group, find the standard sequence with the smallest difference from the verification sequence, and count the categories of sequence elements that differ from it. Finally, return the target detection boxes of these differing element categories in the silkscreen pattern detection model, which are the sequence anomaly localization boxes. The method for finding the standard sequence with the smallest difference is as follows: iterate through all standard sequences, record the elements that differ from each standard sequence, and finally compare the lengths of the arrays of differing elements of all standard sequences. The one with the smallest length is the closest standard sequence, and the corresponding differing element is the specific location causing the arrangement anomaly.
[0085] In summary, the present invention has the following characteristics:
[0086] It is versatile: it introduces cyclic offset to adapt to the uncertain feed angle of the line scan camera; it supports anomaly detection of annular and linear arrangement, and supports common industrial line scan cameras and area scan cameras, thus supporting different bottle types and different parts of the wine bottle.
[0087] High-precision recognition: In addition to using common image augmentation methods, the model improves its recognition accuracy for silkscreen elements by introducing target swapping image enhancement, which reduces the model's learning of prior information about the relative positions of patterns.
[0088] By combining the positioning of silkscreen elements and the sequence verification scheme, the problem of difficulty in collecting abnormal samples in industrial applications can be avoided.
Claims
1. A method for detecting abnormal arrangement of silkscreen printing on wine bottles based on visual perception, characterized in that, Includes the following steps: Step 1: Train the silkscreen pattern detection model: By collecting normal bottle data and performing data augmentation that includes target position swapping, train the model based on the target detection algorithm; Step 2: Construct the horizontal and vertical sequences of the image to be detected: After inputting the image into the model trained in Step 1 for element localization, construct the horizontal and vertical sequences respectively using the center point coordinates (cx, cy); Step 3: Verify sequence for abnormalities: Generate a standard sequence set and compare it sequentially. If a match fails, trigger the localization module. Step 4: Output anomaly localization box: Based on the sequence length difference or element difference statistical results, return the minimum bounding rectangle or multi-element anomaly bounding box of the detection model; The steps for constructing the horizontal and vertical sequences of the image to be detected include: Step 2.1: Input the image to be detected into the silkscreen pattern detection model to obtain the silkscreen element localization result. The localization result includes category, confidence level, and target rectangle coordinate information, wherein the coordinates of the upper left corner of the target rectangle are... The coordinates of the lower right corner are ; The following filtering strategy is applied to the location results: (a) Based on confidence threshold Filter out low-confidence test results; (b) Calculate the pixel width of each silkscreen element and remove abnormal elements according to the preset category standard width and error threshold; (c) For the overlapping areas imaged by the line scan camera, according to the coordinates of the center point of the target box. Sort and locate the leftmost target object. And remove any subsequent occurrences of the same type of target object. and the test results on its right side; Step 2.2: Based on the center point coordinates of the filtered target bounding box and For each horizontal element, Sort to generate a horizontal sequence, and sort the vertical elements by... Sorting generates a vertical sequence; if the silkscreen pattern is distributed across multiple regions, then horizontal and vertical sequences are constructed separately for each region.
2. The method according to claim 1, characterized in that, The steps include the following: Step 1.1: Select a line scan camera or an area scan camera to image the silkscreen pattern on the bottle to be inspected, and collect a batch of silkscreen image data of normal bottles. The number of normal bottles N is greater than 200 to cover different glass bottle reflectivity and feeding angle. Step 1.2: Manually annotate the screen printing image data, assign category labels to each screen printing element, and perform data augmentation operations on the annotated data; The data augmentation operations include: flipping, rotating, brightness variation, mosaic enhancement, and target position swapping enhancement; Specifically, the target position swap enhancement involves randomly selecting two silkscreen elements from the labeled data, swapping their positions, adjusting their size to the size corresponding to the target position and covering the elements at the original target position, and simultaneously swapping their category labels to generate new training samples. Step 1.3: Supervised training is performed on the enhanced data based on the target detection model. In the early stage of training, mosaic enhancement is enabled to improve generalization, and in the last 10 rounds, mosaic enhancement is turned off to improve the accuracy of target boundary localization.
3. The method according to claim 1, characterized in that, The steps for verifying whether the horizontal and vertical sequences are abnormal include: Step 3.1: Generate standard sequence groups: based on the coordinates of the center point of the horizontal target box. and the coordinates of the center point of the target box in the vertical direction Construct horizontal and vertical standard sequences; For silkscreen elements arranged in a ring, generate all cyclic offset patterns as a standard sequence group in the original order; For linearly arranged silkscreen elements, only one standard sequence pattern with a fixed order is generated; Step 3.2: Perform anomaly verification: Compare the horizontal and vertical sequences of the image to be detected with all valid patterns in the standard sequence group one by one; If any valid pattern is matched, it is determined that no permutation anomaly was found; If no valid pattern can be matched, the location module is triggered to perform sequence length verification or element difference statistics to determine the location of the anomaly.
4. The method according to claim 1, characterized in that, The step of outputting the sequence anomaly localization box according to the sequence anomaly localization module includes: Step 4.1: Length check to locate missing element status When the length of the sequence to be detected is inconsistent with the length of any valid pattern in the standard sequence group, the minimum bounding rectangle of all target position information of the sequence to be detected is output. The minimum bounding rectangle is calculated using the following formula: in, The number of target elements in the sequence to be detected; For the first The coordinates of the top left corner of the target rectangle. For the first The coordinates of the bottom right corner of the target rectangle; and The coordinates of the top left and bottom right corners of the smallest bounding rectangle; Step 4.2: Locating Abnormal Status of Differential Elements When the length of the sequence to be detected matches the length of a pattern in the standard sequence group, iterate through all standard sequence patterns: Record the category of each element that differs between the standard sequence and the check sequence; Compare the lengths of the difference arrays corresponding to all standard sequences, and select the standard sequence with the smallest difference as the closest matching pattern; Return the target bounding boxes corresponding to all element categories that differ from the standard sequence output by the detection model, as anomaly localization information.