AI dynamic focusing TGV deep hole AOI detection method and system

By acquiring multi-focal plane sequence images and using a dynamic focal plane prediction model for adaptive focal plane adjustment, the problems of focal plane positioning accuracy and response speed in TGV deep hole AOI detection are solved, achieving efficient and accurate detection results.

CN123160485APending Publication Date: 2026-11-24SCENARY IND (SUZHOU) INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611333338.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-31
Publication Date
2026-11-24

AI Technical Summary

Technical Problem

Existing TGV deep-hole AOI inspection technology suffers from insufficient focal plane positioning accuracy, slow dynamic focusing response speed, and limited adaptability to different inspection depths, making it difficult to meet the requirements for high-precision and high-efficiency inspection.

Method used

By acquiring multi-focal plane sequence images of the aperture of the glass substrate under test, the defocusing defect features are extracted. The dynamic focal plane prediction model is used to predict the focal plane position of the target detection depth, and the focus status is precisely adjusted in combination with real-time feedback to achieve adaptive focal plane adjustment.

Benefits of technology

It improves the imaging quality and efficiency in the inspection process, reduces image blurring and missed defects, and enhances the accuracy and reliability of inspection, meeting the automated and intelligent inspection needs of high-precision glass substrate manufacturing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123160485A_ABST
    Figure CN123160485A_ABST
Patent Text Reader

Abstract

The application relates to an AI dynamic focusing TGV deep hole AOI detection method and system, and belongs to the technical field of precise manufacturing detection. The method comprises the following steps: acquiring a multi-focal surface sequence image of a glass substrate aperture to be detected; extracting an out-of-focus defect feature of the multi-focal surface sequence image, and confirming a focusing control parameter corresponding to a target detection depth based on the out-of-focus defect feature; inputting the focusing control parameter into a dynamic focal surface prediction model to acquire focal surface position prediction data corresponding to the detection depth; confirming a current imaging focal surface offset value based on the focal surface position prediction data, and judging whether the imaging focal surface offset value meets a preset focusing accuracy threshold value; if yes, generating a focal surface locking parameter; if no, updating the focusing control parameter, and re-executing the step of acquiring the focal surface position prediction data; performing focusing locking based on the focal surface locking parameter, and calling a corresponding online optical deep hole detection scheme in combination with a locked focusing depth.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of precision manufacturing inspection technology, specifically relating to an AI dynamic focusing TGV deep hole AOI inspection method and system. Background Technology

[0002] With the rapid development of high-precision electronic devices, display panels, and advanced packaging technologies, the demand for deep hole processing and inspection in precision structural components such as glass substrates and carriers is constantly increasing. Especially in the manufacturing process of TGV (Through Glass Via), the hole diameter is small, the hole depth is large, and parameters such as hole wall quality, internal defects, and hole position consistency directly affect subsequent electrical connection performance and product reliability. Therefore, high-precision and high-efficiency automated optical inspection (AOI) of TGV deep holes has become a crucial step in improving manufacturing yield.

[0003] Existing TGV deep hole AOI inspection technology typically employs a fixed focal plane imaging method, acquiring images of the area to be inspected using a pre-set imaging focal length. However, due to factors such as variations in glass substrate thickness, changes in hole depth during processing, and complex internal hole structures, the optimal imaging focal plane for different inspection positions is not entirely consistent. During deep hole inspection, a fixed focal plane struggles to simultaneously meet the clear imaging requirements of different depth regions, easily leading to problems such as blurred imaging of the hole bottom area, weakened hole wall defect features, and difficulty in identifying minute anomalies, thereby reducing defect detection accuracy.

[0004] Some existing technologies employ multi-focal plane image acquisition, obtaining image sequences at different focal plane positions and selecting the optimal focal plane using image sharpness evaluation methods. However, these methods typically rely on a traversal focal plane search process, requiring step-by-step adjustment of the imaging focal length and image analysis, resulting in a lengthy detection process that is difficult to meet the demands of high-speed online detection. Furthermore, due to the lack of an effective prediction mechanism for focal plane changes, large-scale focal plane adjustments still need to be repeated when the depth of the detected object changes, leading to reduced detection efficiency.

[0005] Furthermore, existing dynamic focusing technologies are mainly applied to the inspection of ordinary surface targets, and are insufficiently adaptable to the inspection of objects such as TGV deep holes, which have significant depth-of-field changes and complex optical response characteristics. During deep hole imaging, there is a non-linear correlation between the change in focal plane position and the image sharpness response. Traditional autofocus methods based on a single sharpness evaluation index are easily affected by factors such as hole wall reflection, changes in illumination, and structural occlusion, resulting in focal plane judgment deviations and thus affecting the stability of defect identification.

[0006] Therefore, existing TGV deep hole AOI detection technology still suffers from problems such as insufficient focal plane positioning accuracy, slow dynamic focusing response speed, and limited adaptability to different detection depths. How to establish the correlation between detection depth and focal plane position based on multi-focal plane sequence image information, achieve dynamic focal plane prediction of the target detection depth, and combine this with real-time feedback focusing status for precise adjustment, thereby improving imaging quality and detection efficiency in the deep hole detection process, has become an urgent technical problem to be solved. Summary of the Invention

[0007] To address the aforementioned problems in the existing technology, this invention provides an AI dynamic focusing TGV deep hole AOI detection method. The objective of this invention can be achieved through the following technical solutions: Acquire multifocal plane sequence images of the aperture of the glass substrate under test; Extract the defocus defect features of the multi-focal plane sequence images, and confirm the focus control parameters corresponding to the target detection depth based on the defocus defect features; The focusing control parameters are input into the dynamic focal plane prediction model to obtain focal plane position prediction data corresponding to the detection depth; based on the focal plane position prediction data, the current imaging focal plane offset value is confirmed, and it is determined whether the imaging focal plane offset value meets the preset focusing accuracy threshold. Yes, then generate focal plane locking parameters; If not, update the focus control parameters and re-execute the step of obtaining the focal plane position prediction data; Focus locking is performed based on the focal plane locking parameters, and the corresponding online optical deep hole detection scheme is invoked in conjunction with the locked focus depth.

[0008] Specifically, the process for extracting the features of the defocusing defect is as follows: Obtain the focal plane depth parameters corresponding to each image sequence; The focal plane depth parameters include: focal plane position coordinate parameters, focal plane depth value parameters, focal plane movement step size parameters, focal plane sequence number parameters, focal plane relative offset parameters, and focal plane depth of field range parameters. Based on the focal plane depth parameter, the differences in image sharpness response corresponding to different focal plane positions are matched to confirm the effective focal plane response range; Frequency domain mapping is performed within the effective focal plane response range to obtain the high-frequency information loss degree at different focal plane depths. Based on the high-frequency information loss degree, the defocus state of the sequence image at the corresponding focal plane depth is obtained to obtain the defocus defect features of the multi-focal plane sequence image.

[0009] Specifically, the process of confirming the target detection depth corresponds to the focus control parameters includes the following steps: Based on the defocusing defect features, the offset state between the current imaging focal plane and the optimal focal plane for target detection depth is identified, and the initial defocusing state parameters are obtained. The initial defocus state parameters include: defocus degree parameters, focal plane offset direction parameters, focal plane offset distance parameters, sharpness response difference parameters, high-frequency information loss parameters, and focal plane adjustment requirement parameters. The focus adjustment direction and range are determined based on the initial defocus state parameters; dynamic focusing is performed step by step within the adjustment range to obtain the corresponding image sharpness evaluation value, and the optimal focus position and focus adjustment amount for the target detection depth are determined in combination with the image sharpness evaluation value to generate the corresponding focus control parameters.

[0010] Specifically, the process of confirming the current imaging focal plane offset value based on the focal plane position prediction data includes the following steps: Obtain the current imaging focal plane position data; The current imaging focal plane position data is used as the actual focal plane position reference data. The position difference is compared with the predicted focal plane position corresponding to the predicted focal plane position data. The focal depth tolerance range is constrained by the position difference comparison result, and the imaging focal plane offset value between the predicted focal plane position and the current imaging focal plane position is determined.

[0011] Specifically, the process of confirming the current imaging focal plane offset value using the focal plane position prediction data is as follows: The focal plane prediction error value is matched based on the focal plane position prediction data; Determine whether the focal plane prediction error value meets the preset focal plane stability threshold: If yes, the predicted focal plane position data is retained and used as the reference data for matching the current imaging focal plane offset; otherwise, focal plane position compensation parameters are generated to update the predicted focal plane position data, and the current imaging focal plane offset value is confirmed based on the predicted focal plane position data.

[0012] Specifically, the dynamic focal plane prediction model includes: The associated feature extraction layer is used to extract image sharpness response features and focal plane position change features at different detection depths to obtain focal plane associated feature data. The focal plane associated feature data includes at least one of the following: image sharpness response features, focal plane position change features, detection depth features, and focal plane offset feedback features; The focal plane position prediction layer establishes a focal plane trajectory mapping relationship corresponding to the target detection depth based on the focal plane associated feature data, and calibrates the imaging focal plane offset state in combination with the focus feedback parameters, and outputs the focal plane position prediction data corresponding to the detection depth.

[0013] Specifically, the process of updating the focus control parameters is as follows: Extract focal plane offset feature parameters based on the imaging focal plane offset value; The focal plane offset characteristic parameters include at least one of the following: focal plane position offset, focal plane offset direction parameter, and focal plane offset compensation parameter; Based on the focal plane offset feature parameters, the matching degree between the current focus state and the target detection depth is determined, a focus parameter adjustment amount is generated, and the focus parameter adjustment amount is used as a parameter correction factor to update the focus control parameters.

[0014] Specifically, the process of re-executing the step of obtaining the focal plane position prediction data is as follows: Determine whether the updated dynamic focal plane prediction model meets the preset model convergence criteria: The preset model convergence conditions include at least one of the following: the focal plane position prediction error is less than a preset error threshold, the focal plane prediction result is stable within a continuous detection period, and the model parameter update magnitude is less than a preset adjustment threshold. If yes, then the focal plane prediction distribution characteristics are obtained, and the focus locking parameters are adjusted according to the focal plane prediction distribution characteristics; otherwise, the focus control parameters are revised based on the model verification results, and the revised focus control parameters are fed back to the dynamic focal plane prediction model for iterative updates.

[0015] Specifically, the process of generating the focal plane locking parameters is as follows: Obtain the focal plane prediction error value in the previous detection cycle; The convergence state of the dynamic focal plane prediction model is determined based on the focal plane prediction error value. The focal plane locking parameter is output only when the focal plane convergence state meets the preset convergence condition and the current imaging focal plane offset value meets the preset focus accuracy threshold. The focal plane locking parameters include at least one of the following: target locking focal plane position parameters, focal plane stabilization parameters, and focal plane compensation parameters.

[0016] Specifically, the process for determining whether the imaging focal plane offset value meets the preset focusing accuracy threshold is as follows: The offset distance between the predicted focal plane position data and the current actual imaging focal plane position meets the imaging focusing requirements; The imaging focusing requirements include focal plane position matching requirements, image sharpness requirements, focal plane stability requirements, and detection depth adaptation requirements.

[0017] Specifically, the execution process after calling the corresponding online optical deep hole detection solution is as follows: The online optical deep hole detection scheme is used as a standard detection template, and the focal plane locking parameters for subsequent online optical deep hole detection tasks are configured simultaneously.

[0018] Specifically, an AI dynamic focusing TGV deep hole AOI inspection system includes: A multifocal plane image acquisition unit is used to acquire multifocal plane sequence images of the aperture of the glass substrate under test. The defocus feature analysis unit is used to extract the defocus defect features of the multi-focal plane sequence image and confirm the focus control parameters corresponding to the target detection depth based on the defocus defect features. The dynamic focal plane prediction unit is used to input the focus control parameters into the dynamic focal plane prediction model to obtain focal plane position prediction data corresponding to the detection depth; based on the focal plane position prediction data, it confirms the current imaging focal plane offset value and determines whether the imaging focal plane offset value meets the preset focus accuracy threshold. Yes, then generate focal plane locking parameters; If not, update the focus control parameters and re-execute the step of obtaining the focal plane position prediction data; The focal plane locking detection unit performs focus locking based on the focal plane locking parameters, and calls the corresponding online optical deep hole detection scheme in combination with the locked focus depth.

[0019] The beneficial effects of this invention are as follows: This invention provides an AI dynamic focusing TGV deep hole AOI detection method, which acquires multi-focal plane sequence images of the hole in the glass substrate under test and analyzes the image information under different focal plane states. It can extract defocus defect features, determine the focusing control parameters corresponding to the target detection depth, realize adaptive focal plane adjustment for different deep hole structures, and improve the accuracy of focal plane positioning during the detection process.

[0020] A dynamic focal plane prediction model is constructed, which utilizes the correlation between image sharpness response features and focal plane position change features to predict the focal plane position corresponding to the target detection depth. This avoids the efficiency reduction problem caused by relying on multiple traversals for focusing in traditional detection methods, achieving fast and accurate focal plane switching. Furthermore, by combining the offset between the current actual imaging focal plane position and the predicted focal plane position for feedback adjustment, the focal plane prediction error can be effectively reduced, improving the stability of the dynamic focusing process.

[0021] Furthermore, a comprehensive judgment is made on the focal plane prediction error, the imaging focal plane offset value, and the model convergence state. After meeting the preset focusing accuracy conditions, focal plane locking parameters are generated, and the corresponding online optical deep hole detection scheme is called based on the locked focal depth. This enables the detection process to adapt to the imaging needs of different hole depths and different structural regions, and improves the identifiability of deep hole defect features.

[0022] By adopting the technical solution of this invention, problems such as image blurring and missed defect detection caused by focal plane offset can be reduced, thereby improving the accuracy and reliability of TGV deep hole detection. At the same time, it reduces the need for manual focusing and repeated scanning, improves online detection efficiency, and helps to meet the application requirements of automated and intelligent detection in the manufacturing process of high-precision glass substrates. Attached Figure Description

[0023] To facilitate understanding by those skilled in the art, the present invention will be further described below with reference to the accompanying drawings.

[0024] Figure 1 This is a schematic diagram of the framework of an AI dynamic focusing TGV deep hole AOI detection system according to the present invention.

[0025] Figure 2 This is a schematic diagram illustrating how the updated dynamic focal plane prediction model in the AI ​​dynamic focusing TGV deep hole AOI detection system of the present invention determines whether the model convergence condition is met by a preset model. Detailed Implementation

[0026] To further illustrate the technical means and effects of the present invention in achieving its intended purpose, the following detailed description of the specific implementation methods, structures, features, and effects of the present invention, in conjunction with the accompanying drawings and preferred embodiments, is provided.

[0027] Please see Figure 1 This invention also provides an AI dynamic focusing TGV deep hole AOI inspection system, specifically including: A multifocal plane image acquisition unit is used to acquire multifocal plane sequence images of the aperture of the glass substrate under test. The defocus feature analysis unit is used to extract the defocus defect features of the multi-focal plane sequence image and confirm the focus control parameters corresponding to the target detection depth based on the defocus defect features. A dynamic focal plane prediction unit is used to input the focus control parameters into a dynamic focal plane prediction model to obtain focal plane position prediction data corresponding to the detection depth; based on the focal plane position prediction data, it matches the current imaging focal plane offset value and determines whether the imaging focal plane offset value meets a preset focus accuracy threshold. Yes, then generate focal plane locking parameters; If not, update the focus control parameters and re-execute the step of obtaining the focal plane position prediction data; The focal plane locking detection unit performs focus locking based on the focal plane locking parameters, and calls the corresponding online optical deep hole detection scheme in combination with the locked focus depth.

[0028] Furthermore, the process of frequency domain mapping is as follows: The multi-focal plane sequence images within the effective focal plane response interval are processed by image block segmentation, and the sequence images corresponding to each focal plane depth are divided into multiple image units to be analyzed. Each of the image units to be analyzed is subjected to frequency domain transformation processing to convert spatial domain image data into corresponding frequency domain response data, thereby obtaining frequency distribution characteristics at different focal plane depths. Based on the frequency domain response data, high-frequency feature components within a preset high-frequency band are extracted, and high-frequency energy response values ​​corresponding to different focal plane depths are statistically analyzed. The difference between the high-frequency energy response value at different focal plane depths and the high-frequency energy response value under standard clear focal plane conditions is calculated to obtain the high-frequency information loss degree at the corresponding focal plane depth. A defocus response mapping relationship is established based on the relationship between the high-frequency information loss degree and the focal plane depth change, and the defocus defect features of the multi-focal plane sequence image are extracted based on the defocus response mapping relationship.

[0029] Furthermore, the process of responding to the defocus state of the sequence of images at the corresponding focal plane depth includes: Based on the high-frequency information loss corresponding to different focal plane depths, the degree of sharpness attenuation of the sequence images at each focal plane depth is quantitatively analyzed to obtain the defocus response value at the corresponding focal plane depth. The defocus response value is matched with the image response features under a preset standard focal plane state to determine the degree of defocus corresponding to each focal plane depth; Based on the relationship between the degree of defocusing of sequential images at different focal plane depths, the direction and trend of focal plane position shift are analyzed, and the response mapping relationship between focal plane depth and defocusing state is established. Based on the response mapping relationship, the defocus state features of the sequence images at the corresponding focal plane depth are extracted, including the degree of defocus, the trend of defocus change, and the focal plane offset correlation features, and the defocus state features are used as the defocus defect features of the multi-focal plane sequence images.

[0030] The process of identifying the initial defocusing degree of the current glass substrate based on the defocusing defect characteristics is as follows: Obtain the defocusing defect features corresponding to the multi-focal plane sequence images. The defocusing defect features include the high-frequency information loss degree at different focal plane depths, the change in image sharpness response, and the focal plane position offset correlation features. The defocusing defect features are normalized, and the defocusing response value of the current glass substrate detection area is calculated based on the defocusing feature change relationship corresponding to different focal plane depths. The defocus response value is matched with a preset defocus degree evaluation model, and the initial defocus degree corresponding to the current glass substrate is determined according to the evaluation interval in which the defocus response value is located. Based on the initial defocusing degree, the positional deviation between the current imaging focal plane and the optimal focal plane for target detection depth is analyzed to determine the initial focal plane adjustment direction and focal plane adjustment requirements, and the initial defocusing degree is used as the feature basis for the generation of subsequent focus control parameters.

[0031] Furthermore, the process of identifying the offset state between the current imaging focal plane and the optimal focal plane for target detection depth based on the defocus defect features is as follows: Obtain the defocusing defect features corresponding to the multi-focal plane sequence images. The defocusing defect features include the high-frequency information loss degree at different focal plane depths, image sharpness response change features, and focal plane depth change correlation features. Based on the analysis of the defocusing defect characteristics, the changing trend of the image sharpness response curve under different focal plane depths is determined to identify the defocusing response state corresponding to the current imaging focal plane. The current out-of-focus response state corresponding to the current imaging focal plane is matched with the standard sharp focal plane response feature corresponding to the target detection depth to obtain the offset direction of the current imaging focal plane relative to the optimal focal plane position. Based on the changes in high-frequency information loss and the differences in image sharpness response at different focal plane depths, the focal plane offset distance between the current imaging focal plane and the optimal focal plane for target detection depth is calculated to obtain the focal plane offset state parameters. The degree of offset of the current imaging focal plane relative to the optimal focal plane for target detection depth is determined based on the focal plane offset state parameter, and the degree of offset is used as the basis for calculating the subsequent focal plane adjustment direction and focal plane adjustment amount.

[0032] Furthermore, the step-by-step dynamic focusing process is as follows: determine the initial focusing range corresponding to the target detection depth according to the focal plane offset state parameter, and obtain the preset focal plane adjustment step size; Based on the initial focus range, and taking the current imaging focal plane position as the initial adjustment reference, the focal plane is moved step by step along the target focal plane adjustment direction according to the preset focal plane adjustment step size. After each focal plane movement, the detection image at the corresponding focal plane position is acquired, and the sharpness evaluation value of the corresponding image is calculated to obtain the sharpness response data corresponding to different focal plane positions. Based on the sharpness response data corresponding to multiple consecutive focal plane positions, the trend of image sharpness change is analyzed. When the sharpness evaluation value continues to improve, the focal plane position is adjusted towards the target direction according to the preset adjustment step size. When the sharpness evaluation value reaches the peak or meets the preset sharpness threshold, the corresponding focal plane position is determined as the candidate best focal plane position. Based on the candidate optimal focal plane position, further fine focal plane adjustment is performed, the focal plane adjustment step size is reduced, a local search is performed on the candidate focal plane position, the optimal focal plane position that meets the preset focusing accuracy requirements is obtained, and the corresponding focal plane adjustment amount is output.

[0033] Furthermore, the relative depth step size is used to characterize the change in the corresponding detection depth between adjacent focal plane images and to determine the depth sampling interval in the subsequent focal plane response process.

[0034] Furthermore, the process of matching image sharpness response differences is as follows: Based on the relative depth-of-field step size, the multi-focal plane sequence image is indexed by focal plane depth, and the detection area images acquired at different focal plane depths are mapped to the standard focal plane layer corresponding to the preset standard focal plane image sequence. By calculating the feature similarity between the detection area image and the standard focal plane layer image, the matching evaluation value corresponding to each focal plane layer is obtained, and the sharpness response change trend under different focal plane depths is determined based on the matching evaluation value. Based on the trend of sharpness response change, the focal depth range corresponding to the sharpness response peak is selected as the effective focal response range of the target defect area.

[0035] Furthermore, the process of obtaining the image sharpness evaluation value corresponding to each focus position is as follows: The original image acquired at the current focus position is subjected to bilateral filtering for noise reduction, which smooths the background noise of the image while maintaining the edge sharpness of the deep hole in the glass substrate under test.

[0036] The physical boundary of the deep hole is located, and a pixel width is set outward from this physical boundary to establish a ring-shaped target detection area. Subsequent steps are performed only within this target detection area to eliminate background interference from non-target areas.

[0037] Edge detection is performed on each pixel within the target detection region. The gradient values ​​in the horizontal and vertical directions of each pixel within the target detection region are calculated respectively. The grayscale values ​​of the current pixel and its neighboring pixels are convolved with preset horizontal and vertical convolution templates to obtain the gradient representation values ​​of the pixel in both the horizontal and vertical dimensions.

[0038] First, calculate the absolute values ​​of the horizontal and vertical gradients respectively. Then, sum these two absolute values ​​and use the sum as the overall gradient magnitude of the pixel in the current image.

[0039] Set a preset gradient threshold. Compare the comprehensive gradient magnitude of each pixel calculated in step three with this threshold one by one: If the overall gradient magnitude of a pixel is less than or equal to the threshold, the gradient contribution of that pixel is recorded as zero and will not be included in subsequent calculations. If the overall gradient magnitude of a pixel is greater than the threshold, the overall gradient magnitude is squared and the squared value is added to the global sharpness accumulator.

[0040] After traversing all pixels within the target detection area, the value recorded in the global sharpness accumulator is the image sharpness evaluation value corresponding to the current focus position.

[0041] By sequentially performing the above steps on images at all different focus positions in the initial focus step sequence, a set of image sharpness evaluation values ​​corresponding to each focus position can be obtained, which can be used to determine the optimal focus position in the future.

[0042] Example 1: Application in online AOI inspection of TGV through-holes in advanced packaging glass substrates; Taking a high-density advanced packaging glass substrate production line as an example, the inspection target is the defects in the TGV (Through Glass Via) structure formed by laser processing, including defects such as abnormal aperture, hole wall cracks, residue at the bottom of the hole, uneven metal filling, and micropore blockage. The object to be tested is a glass substrate with a thickness of 0.8 mm and a size of 300 mm × 250 mm. The TGV aperture ranges from 20 μm to 100 μm, and the hole depth ranges from 300 μm to 800 μm.

[0043] The production line is located at the AOI inspection station before glass substrate electroplating. Due to the characteristics of TGV hole structures, such as high depth-to-diameter ratio, complex hole wall reflections, and insufficient illumination at the hole bottom, traditional fixed focal plane inspection methods easily result in clear hole openings but blurred hole bottoms, leading to missed detection of deep defects. Therefore, it is necessary to achieve 24 / 7 continuous online inspection and automatically adjust the imaging focal plane according to different hole depths to improve the accuracy of deep hole defect identification.

[0044] Parameter settings: Configure core parameters based on the characteristics of TGV deep hole detection: Focal plane acquisition mode: Multi-focal plane sequence acquisition mode; Focal plane adjustment step size: 5μm / level, automatically adjusted according to the aperture depth range; Effective focal plane response range: ±100μm; Focusing accuracy threshold: The offset between the predicted focal plane position and the actual imaging position is ≤2μm; Image sharpness evaluation metrics: based on a comprehensive evaluation of edge gradient values, texture response values, and local contrast. Detection area: Full board TGV array coverage, with a focus on the hole walls and bottom areas; Optical configuration: high magnification telecentric lens + coaxial light source + ring compensation light source; Detection template: Control logic is matched according to the glass substrate model. After receiving the detection task parameters, the main control module sends initialization commands to the precision motion platform, optical imaging module, and dynamic focal plane prediction module, and loads the standard focal plane database corresponding to the current glass substrate model.

[0045] Dynamic relationships: After the parameters are configured, the AOI device reads the current product information and obtains the corresponding TGV hole depth range and focal plane change pattern based on historical inspection data. The dynamic focal plane prediction model then enters the standby state.

[0046] Once the glass substrate enters the detection position, the device first acquires a multi-focal plane sequence of images of the target area, and then calibrates the focal plane position of each focal plane image to obtain the focal plane depth parameters corresponding to different sequence images.

[0047] Corresponding to the TGV depth standard focal plane template.

[0048] Image acquisition and dynamic focus recognition: (1) Scenario Condition 1 (TGV hole depth changes are stable) The ambient temperature was 25℃, the optical system was stable, and the TGV hole depth on the glass substrate varied within a small range.

[0049] Dynamic relationships: The multi-focal plane imaging module acquires images of the same area at different depths according to a preset focal plane step size, and the image data is transmitted to the main control module in real time.

[0050] The main control module first performs image enhancement, noise filtering, and region localization processing on the multi-focal plane sequence images, and then extracts the sharpness response features of the aperture edge, aperture wall texture, and aperture bottom region.

[0051] The system determines the optimal focal plane response range corresponding to the current detection depth based on the image sharpness evaluation value at different focal plane positions, and inputs the extracted focal plane association features into the dynamic focal plane prediction model.

[0052] The correlation feature extraction layer in the dynamic focal plane prediction model extracts the relationship between the trend of image sharpness change and the change of focal plane position. The focal plane position prediction layer establishes the mapping relationship between target detection depth and focal plane trajectory, and outputs the predicted focal plane position data.

[0053] Recognition results: During the inspection of the first glass substrate, the system predicted the optimal focal plane position at the bottom of the TGV aperture to be -420μm, while the actual imaging focal plane position was -419μm, with a focal plane offset of 1μm, which is less than the preset focusing accuracy threshold.

[0054] The system generates focal plane locking parameters and calls the hole bottom defect detection scheme to detect hole wall cracks and hole bottom residues.

[0055] Test results: An abnormal brightness area was found in the bottom region of a certain TGV hole. The defect identification confidence level reached 0.93, and it was judged to be a level 2 defect.

[0056] Defect data includes: Defect type, hole coordinates, focal plane position, focal plane offset value, defect image, and detection time are automatically stored and simultaneously uploaded to the production management platform.

[0057] (2) Scenario Condition 2 (TGV hole depth changes significantly) During the testing process, due to differences in the processing technology of different batches of glass substrates, the TGV hole depth in some areas varied from 300μm to 800μm.

[0058] Dynamic relationships: The system detects an abnormal trend in the sharpness response in the current multi-focal plane sequence image, extracts the defocusing defect features, and recalculates the effective focal plane response range.

[0059] The main control module generates focusing parameter adjustment amounts based on focal plane offset characteristic parameters, and uses these adjustment amounts as parameter correction factors to update the focusing control parameters.

[0060] The updated focus control parameters are re-inputted into the dynamic focal plane prediction model, and the model outputs new focal plane position prediction data.

[0061] The system compares the offset distance between the predicted focal plane position and the current actual imaging focal plane position in real time.

[0062] When the offset value decreases from 8μm to 1.5μm, the preset stability threshold is met, and new focal plane locking parameters are generated.

[0063] Effects: By replacing the traditional layer-by-layer scanning focusing method with AI dynamic focal plane prediction, the focal plane adjustment time during TGV deep hole inspection is reduced, the imaging clarity of the bottom area of ​​the hole is improved, and the problem of missed detection caused by focal plane offset is reduced.

[0064] Furthermore, the process of comparing the positional differences with the predicted focal plane position data is as follows: After the dynamic focal plane prediction model outputs the predicted focal plane position data corresponding to the current detection depth, the system synchronously triggers the hardware-in-the-loop monitoring mechanism of the optical imaging system. Through the built-in encoder of the high-precision grating ruler and the Z-axis servo motor, the system collects the absolute mechanical position feedback value of the current optical lens in the physical Z-axis direction in real time, and uses this feedback value as the real-time position data.

[0065] The real-time position data and the focal plane position prediction data output by the dynamic focal plane prediction model are input into the difference comparison module for subtraction. Specifically, the real-time position symbol data is subtracted from the focal plane position prediction data to obtain an original position deviation value that characterizes the spatial span between the current theoretical ideal focal plane and the actual physical focal plane.

[0066] To eliminate the physical interference of thermal expansion and contraction of mechanical components and micro-vibration of the machine tool on focusing accuracy under high-frequency continuous motion, preset environmental dynamic correction parameters are introduced. These parameters include a thermal drift compensation coefficient calculated based on a real-time machine temperature sensor and a mechanical backlash compensation value calculated based on historical focusing trajectories. The original position deviation value is accumulated and superimposed with the thermal drift compensation coefficient and the mechanical backlash compensation value for correction, thereby accurately extracting the true physical deviation after eliminating environmental interference.

[0067] The actual physical deviation is mapped to the current imaging coordinate system, and the matching output is the current imaging focal plane offset value. This current imaging focal plane offset value not only includes the absolute magnitude sign of the positional deviation, but also includes a movement direction sign indicating whether the lens should be raised or lowered for adjustment, serving as the direct criterion input for the subsequent "determine whether the preset focus accuracy threshold is met" step.

[0068] Furthermore, the process of matching the focal plane position prediction data with the focal plane prediction error value is as follows: After obtaining the focal plane position prediction data corresponding to the target detection depth, the imaging focal plane position data under the actual acquisition state of the current optical imaging system is obtained; the actual imaging focal plane position data and the focal plane position prediction data are matched by position mapping, and the focal plane position difference between the two is calculated as the focal plane prediction error value between the predicted focal plane position and the actual imaging focal plane position.

[0069] In some embodiments, by comparing the degree of offset between the predicted focal plane position and the actual imaging focal plane position, the consistency between the output of the dynamic focal plane prediction model and the current actual imaging state can be reflected. When the focal plane prediction error value is within the preset focal plane stability threshold range, it indicates that the current focal plane position prediction result meets the detection accuracy requirements and can be directly used for subsequent imaging focal plane offset matching; when the focal plane prediction error value exceeds the preset focal plane stability threshold range, the focal plane position prediction data is compensated and corrected according to the focal plane prediction error value to reduce the focal plane prediction deviation caused by changes in the optical environment, differences in aperture wall reflection, and deep aperture structure.

[0070] Furthermore, the focal plane trajectory mapping relationship of the target detection depth is used to characterize the dynamic change law of the focal plane position during the change of detection depth. By establishing the correspondence between detection depth and focal plane position, the prediction and positioning of the imaging focal plane in different depth regions can be realized.

[0071] In some embodiments, the focal plane trajectory mapping relationship is constructed based on image sharpness response characteristics, focal plane position change characteristics, and historical focus feedback parameters obtained at different detection depths. This mapping relationship describes the changing trend of the focal plane position during the axial movement of the optical imaging system in the TGV deep aperture direction. When the target detection depth changes, the predicted focal plane position within the corresponding depth range can be quickly determined using the focal plane trajectory mapping relationship, providing data support for the dynamic focal plane prediction model to output predicted focal plane position data.

[0072] Furthermore, the process of calibrating the imaging focal plane offset state specifically includes: After obtaining the predicted focal plane position data corresponding to the target detection depth, the actual imaging focal plane position data of the current optical imaging system is obtained, and the actual imaging focal plane position data is matched with the predicted focal plane position data to determine the offset direction and offset amount of the current imaging focal plane relative to the predicted focal plane position.

[0073] The deviation between the current focusing state and the target detection depth is analyzed based on the imaging focal plane offset direction and offset amount, and the current focal plane offset state is judged to meet the detection accuracy requirements in combination with the preset focal depth tolerance range.

[0074] In some embodiments, when the imaging focal plane offset state does not meet the preset accuracy requirements, focal plane compensation parameters are generated according to the offset direction and offset amount, and the optical imaging component is controlled to adjust the focal plane position so that the actual imaging focal plane gradually approaches the target predicted focal plane position; when the adjusted imaging focal plane offset amount meets the preset focal depth tolerance range, the imaging focal plane offset state calibration is completed, and the calibrated focal plane position is used as the stable imaging focal plane in the subsequent deep hole detection process.

[0075] Furthermore, the process of determining the degree of matching between the current focus state and the target detection depth based on the focal plane offset feature parameters is as follows: The positional deviation of the current imaging focal plane relative to the theoretical focal plane corresponding to the target detection depth is determined based on the focal plane offset feature parameters, and the corresponding offset direction, offset amplitude, and offset change rate are obtained. Then, the offset direction, offset amplitude, and offset change rate are matched with the preset focus evaluation rules to calculate the matching degree parameter between the current focus state and the target detection depth. Specifically, when the offset amplitude is small and the offset change rate is within a preset stable range, it is determined that the current focus state and the target detection depth have a high degree of matching; when the offset amplitude exceeds a preset offset threshold or the offset change rate exceeds a preset stable threshold, it is determined that the current focus state and the target detection depth have a matching deviation. Finally, the corresponding focus parameter adjustment amount is generated based on the matching degree parameter, which is used for subsequent updates of focus control parameters and correction of focal plane position.

[0076] Furthermore, the dynamic focal plane prediction model consists of two core modules: an associated feature extraction layer (composed of a one-dimensional convolutional network and a long short-term memory network), used to extract serialized historical focus control data and image sharpness response features; and a focal plane position prediction layer (composed of a multilayer perceptron), used to convert the fused hidden layer features into continuous focal plane depth space absolute coordinate prediction values.

[0077] The model's training dataset is constructed as a set of paired "feature-label" pairs, specifically including: Input features: Includes multi-dimensional cross-modal data, divided into image-level response features (image sharpness evaluation value sequence within the effective focal plane response range, corresponding high-frequency information loss degree) and physical control-level features (initial defocus state parameters, adjustment direction, adjustment step size range, and current probe physical coordinates).

[0078] Authentic Label: The actual optimal imaging focal plane position coordinates that maximize the contrast of defect features, determined by a high-precision interferometer or confocal microscope for a specific TGV (Through Glass Void) deep hole under standard offline calibration environment.

[0079] In the correlation feature extraction layer, input features of different dimensions are fused through nonlinear mapping and vector concatenation: Dimensional alignment: The image-level feature vector (denoted as X_img) and the physical control-level feature vector (denoted as X_ctrl) are linearly transformed through their respective matrix weights and bias parameters, and then activated by the ReLU activation function to obtain the normalized hidden layer feature vectors (denoted as H_img and H_ctrl).

[0080] Tensor concatenation and weighted summation: H_img and H_ctrl are concatenated end-to-end (symbolized as H_img ⊕ H_ctrl) to form a composite feature vector. Then, a channel attention mechanism is introduced, using a weight matrix and the sigmoid function to calculate a weight multiplier between 0 and 1. This multiplier is then used to perform element-wise multiplication of the composite vector (symbolized as ⊗), mathematically amplifying the proportion of features with high focus sensitivity, generating focal plane-related feature data.

[0081] Focal plane position mapping: The focal plane position prediction layer linearly projects the focal plane associated feature data to a one-dimensional scalar space through a fully connected layer, and directly outputs the predicted focal plane position value.

[0082] To improve the sensitivity of deep-hole AOI detection to small depth-of-focus deviations, this model uses a weighted mean square error with a dynamic error penalty factor combined with L2 regularization as the training loss function: Main error term: Calculate the square of the difference between the true focal plane position and the model predicted position for all training samples, and multiply it by the dynamic penalty factor.

[0083] Dynamic penalty mechanism: When the deviation between the predicted position and the actual position exceeds the preset focus accuracy tolerance range, the value of the dynamic penalty factor increases exponentially, so that the model will prioritize correcting the weights of large error samples during gradient backpropagation.

[0084] Regularization term: The sum of squares of all weight parameters in the model is multiplied by the regularization coefficient and added to the total loss. This is used to limit the model complexity and prevent overfitting.

[0085] The model training and online iteration process; Offline pre-training: A large amount of TGV sample data with known aperture and depth is collected, and the Adam optimizer is used to iteratively update the network parameters according to the principle of minimizing the total loss until the mean absolute error of the model on the validation set meets the preset focus accuracy threshold.

[0086] Online adaptive iteration: In actual detection, if the predicted value output by the model causes the focal plane offset to be substandard, the system will automatically trigger a refocusing action. The actual optimal focal plane parameters obtained after refocusing will be packaged into new incremental training samples.

[0087] Parameter correction factor fine-tuning: The adjustment amount of the focusing parameter is converted into a fine-tuning gradient, which is fed back to the fully connected network part of the dynamic focal plane prediction model. Only the local weight parameters of the fully connected layer at the end of the model are updated, thereby achieving rapid convergence of the model to the specific tolerance of the current batch of glass substrates.

[0088] Furthermore, the meaning and value range of the preset focus accuracy threshold and preset offset threshold are defined. Preset focus accuracy threshold (denoted as T_acc): Used to determine whether the current predicted or determined focal plane position has reached the high-definition imaging standard. The value range is usually set to 0.2 μm ~ 0.5 μm.

[0089] Preset offset threshold (denoted as T_offset): Used to limit the maximum allowable physical offset between the predicted focal plane coordinates and the current actual imaging focal plane coordinates. The value range is usually set to 0.1 μm ~ 0.3 μm.

[0090] Basis for value selection; The setting of the two threshold types mentioned above is strictly dependent on the depth of field (DOF) of the optical system. In TGV deep hole inspection, the numerical aperture (NA) of the optical system is relatively large, and the corresponding DOF is usually extremely narrow (e.g., about 0.8 μm ~ 1.2 μm). To ensure that high-frequency defect features are not blurred due to defocusing, the maximum allowable imaging offset of the system must not exceed half of the depth of field.

[0091] Mathematical correlation model; Assuming the incident light wavelength of the optical system is λ, the numerical aperture of the objective lens is NA, and the refractive index is n, then the formula for calculating the optical depth of field (DOF) of the system is: Depth of field (DOF) = λ * n / (NA * NA); The preset focus accuracy threshold T_acc satisfies the constraint: T_acc ≤ k1 * DOF, where k1 is the attenuation safety factor, with a value range of 0.2 ~ 0.4.

[0092] The preset offset threshold T_offset satisfies the constraint: |Z_pred - Z_curr| ≤ T_offset ≤ k2 * DOF, where Z_pred is the predicted focal plane position coordinate, Z_curr is the current actual focal plane coordinate, and k2 is 0.25. When the absolute offset is less than or equal to T_offset, the focusing accuracy requirement is met.

[0093] The meaning and range of the preset focal plane stability threshold and preset error threshold; Preset focal plane stability threshold (denoted as T_stab): Used to evaluate the statistical fluctuation of the model's output prediction values ​​over multiple consecutive detection cycles, with a value range of 0.05 μm ~ 0.15 μm.

[0094] Preset error threshold (denoted as T_err): Used to evaluate the single error limit between the model's predicted coordinates and the calibration reference position, with a value range of 0.3 μm ~ 0.8 μm.

[0095] Basis for value selection; Based on the repeatability of the mechanical motion stage (such as a piezoelectric ceramic PZT axis) and the substrate thickness deformation tolerance. If the variance or standard deviation of the model prediction results is too large, it indicates that the model has not converged at the current depth, and forced focusing will cause high-frequency oscillation of the mechanism; therefore, it is necessary to introduce a stable threshold for smoothing filtering or trigger compensation.

[0096] Mathematical correlation model; Suppose that the sequence of predicted focal plane positions output by the dynamic focal plane prediction model over the past M consecutive detection periods is Z_1, Z_2, ..., Z_M, and its arithmetic mean is Z_mean.

[0097] Focal surface stability assessment model: Calculate the standard deviation of the sequence S_pred = sqrt( (1 / M) * ∑ (Z_i -Z_mean)^2 ).

[0098] When S_pred ≤ T_stab, the focal plane prediction state is determined to be stable, and the current prediction data is retained; When S_pred > T_stab, the focal plane prediction is determined to be unstable, and focal plane position compensation parameters are generated to perform weighted smoothing correction on the prediction data.

[0099] Error-bound model: Let the historical single prediction error be E_i = |Z_i - Z_real| (Z_real is the confocal calibration ground truth). If E_i > T_err, the system automatically marks the sample as an outlier and removes it from the incremental training set to avoid compromising the stability of the model update.

[0100] The meaning and value range of the preset sharpness threshold and gradient threshold; Preset sharpness threshold (denoted as T_sharp): Used to determine whether the acquired sequence of images is within the "effective focal plane response range", with a value range normalized to 0.75 ~ 0.88 (calculated with the highest sharpness baseline value of 1.0).

[0101] Gradient threshold (denoted as T_grad): Used to filter background noise in the frequency / spatial domain feature extraction, extracting only the high-frequency gradient changes of deep hole edges and defects. The value range is set to 15 ~ 35 (8-bit grayscale levels).

[0102] Basis for value selection; TGV glass substrates typically exhibit high light transmittance and surface reflectivity, resulting in lower imaging contrast at the walls and bottom of deep holes. The gradient threshold is determined based on the root mean square (RMS) noise of the image background; the sharpness threshold is calculated based on the peak value of the response curve of the Laplace energy function or the Brenner gradient function.

[0103] Mathematical correlation model; For the acquired grayscale image I(x, y): Gradient threshold calculation: First, calculate the gradient magnitude of each pixel G(x, y) = sqrt( (∂I / ∂x)^2 +(∂I / ∂y)^2 ).

[0104] Construct the mask matrix M(x, y): If G(x, y) ≥ T_grad, then M(x, y) = 1; otherwise, M(x, y) = 0. T_grad is set to 3 * σ_bg, where σ_bg is the grayscale standard deviation (background noise) of the image of the smooth, hole-free glass region.

[0105] Sharpness evaluation and threshold determination: Calculate the average gradient within the effective area as the sharpness evaluation value F_sharp = ( ∑ (G(x, y) * M(x, y)) ) / ( ∑ M(x, y) ).

[0106] Normalize F_sharp to the highest sharpness response peak F_max to obtain the relative sharpness Q = F_sharp / F_max.

[0107] When Q ≥ T_sharp, the focal plane depth image is determined to belong to the effective focal plane response range, and its high-frequency information loss is included in the defocus defect feature extraction calculation.

[0108] Furthermore, diffraction filtering based on frequency domain orientation angle decoupling; Physical characteristics of diffraction noise: The TGV aperture exhibits a highly regular circular or elliptical structure in cross-section, and the diffraction fringes caused by the deep aperture edge always oscillate periodically along the normal direction of the aperture boundary. Therefore, in the frequency domain spectrum, the high-frequency diffraction energy exhibits extremely strong directional concentration (radially distributed along the normal).

[0109] Physical characteristics of real defects: Real defects such as chipped edges, microcracks, and adhesion dirt have different shapes and random distribution. Their high-frequency signals exhibit isotropic or specific angular offset distribution in the frequency domain space, and do not satisfy the anisotropic normal symmetry of perfect through hole edges.

[0110] Differentiation and inhibition processes: Calculate the local normal angle of the deep hole edge in the image to be tested; An adaptive directional bandstop filter is constructed in the frequency domain to subtract the extremely high energy response of diffraction within a preset angle range; After directional filtering, the residual high-frequency energy is the true high-frequency energy response value after de-diffraction. If it is significantly higher than the safety threshold set based on the standard value, then a real defect is determined to exist.

[0111] Phase-energy continuity analysis based on multifocal plane sequence images; Focusing continuity of diffraction fringes: During the defocusing process, the pseudo-high-frequency signal formed by edge diffraction exhibits a strong physical regularity in the fringe spacing and bright / dark phase changes (following the wave optical diffraction propagation equation). In the axial (Z-axis) defocusing sequence, the attenuation and migration curves of high-frequency energy are extremely smooth and conform to a specific diffraction diffusion model.

[0112] Focusing continuity of real defects: Physical defects (such as surface deposits or hole wall cracks) have steep high-frequency energy peaks only within a narrow depth of focus close to their physical location. When they are far from the focal plane, the high-frequency information is rapidly defocused and lost, and the energy attenuation gradient is significantly greater than the diffusion gradient of the diffraction fringes.

[0113] Mathematical extraction and discrimination logic: Let Ereal(x) be the true high-frequency energy of the sequence image at different axial positions. Calculate the rate of change of the high-frequency energy with respect to axial position: If the rate of change of high-frequency energy between consecutive focal planes is less than the theoretical threshold of diffraction attenuation, and the phase coherence function satisfies the wave propagation equation, then the high-frequency signal is determined to be introduced by edge diffraction, and the system automatically removes it from the "defocus defect feature". If a certain region exhibits an extremely high local peak in high-frequency energy at the current focal plane, and the axial change rate shows extremely sensitive defocusing characteristics, then it is determined that the high-frequency energy is caused by a real defect, and the corresponding defocusing defect characteristic parameters are generated and input into the dynamic focal plane prediction model.

[0114] Furthermore, the mapping logic from defocus defect characteristics to focus control parameters; The defocusing defect characteristics are mainly composed of the high-frequency information loss L_hf(zk) at different focal plane depths zk and the true high-frequency energy response value E_real(zk) after de-diffraction. The system completes the initial explicit mapping from the defocusing characteristics to the target's optimal focal plane coordinates and focus control parameters by constructing a quadratic polynomial fitting and vertex solving model.

[0115] Local image sharpness / defocus response calculation; Within the effective focal plane response range, the image sharpness response value S(zk) of a certain detection depth section is defined as equal to the product of the true high-frequency energy response value E_real(zk) and "[1 - L_hf(zk)]", where L_hf(zk) is the high-frequency information loss degree.

[0116] Closed-form solution for focal plane offset and adjustment direction; Based on the physical optical imaging characteristics, the sharpness response S(z) exhibits a symmetrical parabolic distribution near the optimal focal plane coordinates z*. A least-squares parabolic fit is performed on the collected sampling points (zk, S(zk)) at 3 to 5 consecutive focal plane depths, expressed as: Fitting relationship: S(z) = a * z^2 + b * z + c (where the opening coefficient a < 0).

[0117] Optimal focal plane position coordinates (parabola vertex): z* = -b / (2 * a).

[0118] The current offset state and adjustment direction of the imaging focal plane z_curr: Offset Delta_z = z* - z_curr= [-b / (2 * a)] - z_curr.

[0119] If Delta_z>0, the focus adjustment direction is positive axial movement (deep hole moves downward); If Delta_z < 0, the focus adjustment direction is a negative axial movement (deep hole moves upward).

[0120] Generate focus control parameters: Combine the pulse equivalent coefficient gamma, multiply the offset Delta_z by gamma to convert it into motor drive control parameter U_ctrl.

[0121] Depth mapping relationship and network transmission logic of dynamic focal plane prediction model; Suppose the current input temporal feature vector sequence is X = [x1, x2, ..., xM], where each temporal node xk contains features in four dimensions: [S(zk), L_hf(zk), U_ctrl(k), zk].

[0122] 1D-CNN Local Spatial Feature Extraction: The one-dimensional convolutional layer uses the convolution kernel W_c to perform convolution operation with the local input xk and adds the bias b_c, and then outputs the intermediate feature vector H_k^(1) through the ReLU activation function.

[0123] Establishing the temporal dependency of LSTM axial trajectory: Input H_k^(1) into the Long Short-Term Memory (LSTM) network.

[0124] Forget gate calculation: The hidden state H_(k-1)^(2) of the previous time step is concatenated with the current input H_k^(1), multiplied by the forget gate weight matrix W_f and the bias b_f is added. The forget coefficient f_k is then output by mapping through the Sigmoid function.

[0125] Cell state update: The cell state C_(k-1) of the previous time step is forgotten using the forgetting coefficient f_k, and new information selected by the input gate is superimposed to generate the current cell state C_k.

[0126] Output gate and hidden state output: The output ratio of the current cell state C_k is controlled by the output gate to obtain the current hidden state H_k^(2).

[0127] The hidden state at the end, H_M^(2), contains the spatial variation characteristics of the deep hole in the current segment, and is used as the focal plane association feature data F_assoc.

[0128] Nonlinear continuous regression mapping of the focal plane position prediction layer; First hidden layer mapping: Multiply F_assoc by the weight matrix W1 and add the bias b1, then pass it through the ReLU activation function to obtain the first hidden layer output.

[0129] Second hidden layer mapping: Multiply the output of the first hidden layer by the weight matrix W2 and add the bias b2, then pass it through the ReLU activation function to obtain the output of the second hidden layer.

[0130] Linear projection of the output layer: Multiply the output of the second hidden layer by the output layer weight vector W3 and add the bias b3 to directly map the output scalar value, i.e. the focal plane position prediction data z_pred.

[0131] The physical meaning of the mapping relationship: The weight parameters W1, W2, W3 and the biases b1, b2, b3 are determined through offline pre-training and online incremental fine-tuning. Mathematically, this mapping relationship represents the fitted surface from the "TGV deep hole deformation field / thickness tolerance field" to the "optimal imaging absolute coordinates of the physical focusing actuator".

[0132] Focal plane offset value confirmation and adaptive feedback correction logic; Absolute reference comparison: Obtain the actual absolute position coordinates z_curr_act of the focal plane fed back by the current hardware sensor (such as a grating ruler or laser interferometer).

[0133] Raw offset calculation: Raw offset Delta_raw = z_pred - z_curr_act.

[0134] Depth-of-field tolerance constraints and final offset value determination: Introduce a preset offset threshold T_offset (set to half the depth of field): When the absolute value of Delta_raw is less than or equal to 0.5 * T_offset, the final image focal plane offset value delta = 0 (considered as being within the optimal focus range); When the absolute value of Delta_raw is greater than 0.5 * T_offset, the final image focal plane offset value delta is the residual deviation value after subtracting 0.5 * T_offset from Delta_raw, and the direction is the same as Delta_raw.

[0135] Parameter correction factor update logic: When the determined offset value delta exceeds the preset focus accuracy threshold T_acc, a focus parameter adjustment amount Delta_P = eta * delta (where eta is the gain learning rate) is generated. Delta_P is used as the correction vector, combined with the gradient direction of the loss function, to fine-tune and update the output layer weight matrix W3. Update direction: The new weight W3_new is equal to the old weight W3_old minus "[learning rate eta * prediction error * associated feature vector F_assoc]".

[0136] Real-time online updates of focus control parameters and dynamic focal plane prediction model weights are achieved to ensure accurate positioning for subsequent detection tasks.

[0137] Furthermore, the process of matching the defocus response value with the image response features under the preset standard focal plane state: The image response characteristics (denoted as F_std) under the preset standard focal plane state are the reference data collected and extracted at the optimal imaging focal plane using a standard defect-free TGV substrate during the offline calibration stage. These data include the standard high-frequency energy response value E_ref, the standard image contrast C_std, and the standard frequency domain gradient distribution spectrum G_std.

[0138] Multi-dimensional response feature alignment: The defocus response features of the current focal plane depth section (including the real high-frequency energy response value E_real, the image sharpness response value S(zk), and the frequency domain gradient distribution G_curr) calculated in real time are combined to form the current response feature vector F_curr = [E_real, S(zk), G_curr].

[0139] Calculation of relative deviation and response difference: The ratio of real high-frequency energy to standard high-frequency energy is calculated and expressed as R_energy = E_real / E_ref. When R_energy is close to 1.0, it indicates that the current image is close to the standard sharp focal plane state; when R_energy is significantly less than 1.0, it indicates that high-frequency details are attenuated due to defocusing.

[0140] Calculate the cosine similarity Sim_freq between the current frequency domain gradient distribution G_curr and the standard image spectrum G_std. The cosine similarity reflects the degree of agreement between the high-frequency structure distribution of the image in the frequency domain and the state of the standard focal plane.

[0141] Confirmation of effective focal plane response range matching: The overall matching score M_score is calculated by combining the high-frequency energy deviation ratio R_energy and the cosine similarity Sim_freq: M_score = 0.6 * R_energy + 0.4 * Sim_freq.

[0142] When the overall matching score M_score is greater than or equal to the preset sharpness threshold T_sharp (e.g., 0.75 ~ 0.88), it is determined that the current out-of-focus response value successfully matches the standard focal plane state characteristics, and the current focal plane depth zk is classified into the "effective focal plane response interval" and used as effective sampling data for subsequent dynamic focus fitting.

[0143] The matching process between the defocus response value and the preset defocus degree evaluation model: The preset defocus level evaluation model is an explicit evaluation relationship established based on the physical optical model of defocus (such as the evolution law of point spread function PSF) and machine learning regression algorithm. It is used to quantify and map the abstract defocus response value into the specific "absolute value of defocus distance" and "defocus level".

[0144] Constructing a theoretical curve of defocus response versus physical defocus amount: Based on the principles of geometrical optics and wave optics, the high-frequency energy loss L_hf of the image and the axial physical defocusing amount Delta_z (i.e., the distance between the current focal plane and the optimal focal plane) satisfy a hyperbolic or Gaussian attenuation mapping relationship within the depth of focus range. The preset defocusing degree evaluation model embeds a prior fitting function relationship: Fitting relationship: L_hf(Delta_z) = 1 - exp( - alpha * (Delta_z)^2 ), where alpha is the system attenuation coefficient related to the objective lens numerical aperture NA and the light wavelength.

[0145] Defocus response characteristic input and equation inversion: The extracted high-frequency information loss value L_hf(zk) is input into the preset defocusing degree evaluation model. The model is then solved using a closed-form solution or a lookup table (LUT) interpolation, through the inverse function of the above fitting relationship, to calculate the initial defocusing distance estimate Delta_z_est for the current image. Inversion calculation: Delta_z_est = sqrt( - ln(1 - L_hf(zk)) / alpha ).

[0146] Directional sign confirmation and out-of-focus level classification: Combining the defocus response value change trend between the previous and subsequent detection depths in multifocal image sequences (i.e., the gradient change direction of the high-frequency loss L_hf): If L_hf gradually decreases as it moves downward along the axis, the matching determines the current defocus direction as "positive defocus from above"; otherwise, the matching determines it as "negative defocus from below", thus assigning a physical direction sign to the initial defocus distance estimate and obtaining the initial defocus state parameters.

[0147] The calculated signed defocus distance Delta_z_est is matched with the preset defocus level range (e.g., slight defocus: less than 0.5 μm; moderate defocus: 0.5 μm ~ 2.0 μm; severe defocus: greater than 2.0 μm) to generate the corresponding defocus evaluation result, which is used to guide the adjustment step size range and step-by-step focusing strategy of subsequent dynamic focusing.

[0148] In this embodiment, as Figure 2 As shown, after re-executing the step of obtaining the focal plane position prediction data, the following process is also included: Determine whether the updated dynamic focal plane prediction model meets the preset model convergence criteria: If yes, then the focal plane prediction distribution characteristics are obtained, and the focus locking parameters are adjusted according to the focal plane prediction distribution characteristics; otherwise, the focus control parameters are revised based on the model verification results, and the revised focus control parameters are fed back to the dynamic focal plane prediction model for iterative updates.

[0149] Example 2: Application in intelligent detection scenarios for multilayer interconnect TGV arrays on glass substrates; Taking the production line of ultra-thin glass interconnect substrate for chip packaging as an example, the inspection target is a large-scale TGV array structure, including continuous inspection tasks of vias of different depths in different regions.

[0150] The glass substrate under test is 1.2 mm thick and measures 500 mm × 400 mm, containing tens of thousands of micro-TGV apertures. Due to differences in processing depth and local warping deformation in different areas of the glass substrate, a fixed focal plane cannot meet the requirements for full-area high-definition imaging.

[0151] The system needs to automatically predict changes in the focal plane during high-speed scanning and achieve dynamic focus detection without stopping the machine.

[0152] Parameter settings: Detection scanning speed: 200mm / s; Focal plane prediction refresh cycle: 50ms; Focal plane adjustment range: ±500μm; Prediction error threshold: ≤3μm; Model update cycle: updated once every 1000 detection wells; Detection mode: Orifice detection mode; Hole wall detection mode; Bottom hole detection mode.

[0153] Data storage: Save the predicted focal plane data, actual focal plane position, offset value, defect results, and historical model parameters.

[0154] Control logic: After the detection system is started, the main control module reads the current glass substrate model and calls the corresponding TGV deep hole detection template.

[0155] The dynamic focal plane prediction model predicts the focal plane position of subsequent scanning areas based on the focal plane trajectory data formed during historical detection processes.

[0156] When the motion platform moves to the next detection area, the system adjusts the position of the optical components in advance so that the imaging focal plane can quickly match the target detection depth.

[0157] Image acquisition and continuous detection: (1) Scenario Condition 1 (Continuous Batch Detection) Dynamic relationships: The equipment continuously scans multiple TGV regions on the glass substrate.

[0158] The system predicts the focal plane position based on the current area and collects actual imaging focal plane data in real time.

[0159] Predicted focal plane position: Region A: -250μm; Actual focal plane position: -251μm.

[0160] Focal plane offset: 1μm.

[0161] Judgment result: It meets the focusing accuracy requirements.

[0162] The system locks onto the focal plane and executes the corresponding detection scheme.

[0163] Test results: Two hole wall defects were found in region A, with defect confidence levels of 0.91 and 0.87, respectively.

[0164] The system generates defect records and uploads them to the system.

[0165] (2) Scene condition 2 (local warping causes changes in the focal plane) During the testing process, slight warping occurs in localized areas of the glass substrate, causing a change in the actual testing depth.

[0166] Dynamic relationships: The system detected that the offset between the predicted focal plane position and the actual imaging focal plane position increased to 6 μm.

[0167] The main control module extracts focal plane offset feature parameters and determines the degree of matching between the current focus state and the target detection depth.

[0168] The system generates focal plane compensation parameters and updates the dynamic focal plane prediction model accordingly.

[0169] The model recalculates the focal plane trajectory mapping relationship and outputs the compensated predicted focal plane position.

[0170] After the update: The deviation between the predicted focal plane position and the actual focal plane position was reduced to 2 μm.

[0171] The system regenerates the focal plane locking parameters and continues online detection.

[0172] Grading and Response: During continuous testing: If the focal plane prediction error continues to meet the stable threshold, the system will automatically output the optimized focal plane control parameters and update them synchronously to the same type of AOI equipment.

[0173] If an abnormal offset is detected, the focus correction process will be initiated automatically.

[0174] The test results are fed back synchronously through the system, enabling tracking of the production process.

[0175] Effects: This embodiment combines an AI dynamic focal plane prediction model with an online AOI inspection system to achieve rapid automatic focusing and deep hole defect detection in complex glass substrate environments.

[0176] Compared to fixed focal plane detection methods, this method can effectively improve the imaging consistency of TGV regions at different depths, reduce refocusing time, increase the detection efficiency of large-scale TGV arrays, and enhance the system's adaptability to different product models and hole depth structures, thus meeting the intelligent online detection requirements of advanced packaging manufacturing processes.

[0177] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the present invention. Any simple modifications, equivalent changes and alterations made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the scope of the present invention.

Claims

1. A method for AI dynamic focusing TGV deep hole AOI inspection, characterized in that, Includes the following steps: Acquire multifocal plane sequence images of the aperture of the glass substrate under test; Extract the defocus defect features of the multi-focal plane sequence images, and confirm the focus control parameters corresponding to the target detection depth based on the defocus defect features; The focusing control parameters are input into the dynamic focal plane prediction model to obtain focal plane position prediction data corresponding to the detection depth; based on the focal plane position prediction data, the current imaging focal plane offset value is confirmed, and it is determined whether the imaging focal plane offset value meets the preset focusing accuracy threshold. Yes, then generate focal plane locking parameters; If not, update the focus control parameters and re-execute the step of obtaining the focal plane position prediction data; Focus locking is performed based on the focal plane locking parameters, and the corresponding online optical deep hole detection scheme is invoked in conjunction with the locked focus depth.

2. The method according to claim 1, characterized in that, The specific process for extracting the features of the defocusing defect is as follows: Obtain the focal plane depth parameters corresponding to each image sequence; Based on the focal plane depth parameter, the differences in image sharpness response corresponding to different focal plane positions are matched to confirm the effective focal plane response range; Frequency domain mapping is performed within the effective focal plane response range to obtain the high-frequency information loss degree at different focal plane depths. Based on the high-frequency information loss degree, the defocus state of the sequence image at the corresponding focal plane depth is obtained to obtain the defocus defect features of the multi-focal plane sequence image.

3. The method according to claim 1, characterized in that, The process of confirming the target detection depth corresponds to the focus control parameters includes the following steps: Based on the defocusing defect features, the offset state between the current imaging focal plane and the optimal focal plane for target detection depth is identified, and the initial defocusing state parameters are obtained. The focus adjustment direction and range are determined based on the initial defocus state parameters; dynamic focusing is performed step by step within the adjustment range to obtain the corresponding image sharpness evaluation value, and the optimal focus position and focus adjustment amount for the target detection depth are determined in combination with the image sharpness evaluation value to generate the corresponding focus control parameters.

4. The method according to claim 1, characterized in that, The process of confirming the current imaging focal plane offset value based on the focal plane position prediction data includes the following steps: Obtain the current imaging focal plane position data; The current imaging focal plane position data is used as the actual focal plane position reference data. The position difference is compared with the predicted focal plane position corresponding to the predicted focal plane position data. The focal depth tolerance range is constrained by the position difference comparison result, and the imaging focal plane offset value between the predicted focal plane position and the current imaging focal plane position is determined.

5. The method according to claim 4, characterized in that, The specific process by which the predicted focal plane position data confirms the current imaging focal plane offset value is as follows: The focal plane prediction error value is matched based on the focal plane position prediction data; Determine whether the focal plane prediction error value meets the preset focal plane stability threshold: If yes, the predicted focal plane position data is retained and used as the reference data for matching the current imaging focal plane offset; otherwise, focal plane position compensation parameters are generated to update the predicted focal plane position data, and the current imaging focal plane offset value is confirmed based on the predicted focal plane position data.

6. The method according to claim 1, characterized in that, The dynamic focal plane prediction model includes: The associated feature extraction layer is used to extract image sharpness response features and focal plane position change features at different detection depths to obtain focal plane associated feature data. The focal plane position prediction layer establishes a focal plane trajectory mapping relationship corresponding to the target detection depth based on the focal plane associated feature data, and calibrates the imaging focal plane offset state in combination with the focus feedback parameters, and outputs the focal plane position prediction data corresponding to the detection depth.

7. The method according to claim 1, characterized in that, The specific process for updating the focus control parameters is as follows: Extract focal plane offset feature parameters based on the imaging focal plane offset value; Based on the focal plane offset feature parameters, the matching degree between the current focus state and the target detection depth is determined, a focus parameter adjustment amount is generated, and the focus parameter adjustment amount is used as a parameter correction factor to update the focus control parameters.

8. The method according to claim 1, characterized in that, The specific process of re-executing the step of obtaining the focal plane position prediction data is as follows: Determine whether the updated dynamic focal plane prediction model meets the preset model convergence criteria: If so, the focal plane prediction distribution characteristics are obtained, and the focus locking parameters are adjusted according to the focal plane prediction distribution characteristics; If not, the focus control parameters are revised based on the model validation results, and the revised focus control parameters are fed back to the dynamic focal plane prediction model for iterative updates.

9. The method according to claim 1, characterized in that, The specific process for generating the focal plane locking parameters is as follows: Obtain the focal plane prediction error value in the previous detection cycle; The convergence state of the dynamic focal plane prediction model is determined based on the focal plane prediction error value. The focal plane locking parameter is output only when the focal plane convergence state meets the preset convergence condition and the current imaging focal plane offset value meets the preset focus accuracy threshold.

10. The method according to claim 1, characterized in that, The specific process for determining whether the imaging focal plane offset value meets the preset focusing accuracy threshold is as follows: The offset distance between the predicted focal plane position data and the current actual imaging focal plane position meets the imaging focusing requirements.

11. The method according to claim 1, characterized in that, The execution process after calling the corresponding online optical deep hole detection solution is as follows: The online optical deep hole detection scheme is used as a standard detection template, and the focal plane locking parameters for subsequent online optical deep hole detection tasks are configured simultaneously.

12. An AI dynamic focusing TGV deep hole AOI inspection system, used to perform the method as described in any one of claims 1-11, comprising: A multifocal plane image acquisition unit is used to acquire multifocal plane sequence images of the aperture of the glass substrate under test. The defocus feature analysis unit is used to extract the defocus defect features of the multi-focal plane sequence image and confirm the focus control parameters corresponding to the target detection depth based on the defocus defect features. The dynamic focal plane prediction unit is used to input the focus control parameters into the dynamic focal plane prediction model to obtain focal plane position prediction data corresponding to the detection depth; based on the focal plane position prediction data, it confirms the current imaging focal plane offset value and determines whether the imaging focal plane offset value meets the preset focus accuracy threshold. Yes, then generate focal plane locking parameters; If not, update the focus control parameters and re-execute the step of obtaining the focal plane position prediction data; The focal plane locking detection unit performs focus locking based on the focal plane locking parameters, and calls the corresponding online optical deep hole detection scheme in combination with the locked focus depth.