An adaptive control system for dynamic sensitivity adjustment of a photosensor

By constructing an adaptive control system that combines ambient light prediction and scene motion estimation, active look-ahead adjustment of the sensitivity of the photoelectric sensor is achieved, solving the problem of image quality degradation of the photoelectric sensor under rapid changes in ambient light and target motion, and improving detection accuracy and system stability.

CN122449952APending Publication Date: 2026-07-24YINGJIA TECHNOLOGY (WUXI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
YINGJIA TECHNOLOGY (WUXI) CO LTD
Filing Date
2026-06-09
Publication Date
2026-07-24

AI Technical Summary

Technical Problem

Existing photoelectric sensors suffer from sensitivity adjustment lag under conditions of rapid changes in ambient light and target motion, leading to overexposure, underexposure, or motion blur in images, which affects detection accuracy. Furthermore, they lack filtering mechanisms for minute changes and online model calibration, impacting the reliability and stability of the system.

Method used

An adaptive control system is constructed, including an ambient light sensing unit, a prediction model unit, a parameter solving unit, and a control unit. The optimal sensitivity parameters are solved through iterative optimization. By combining ambient light prediction, scene motion estimation, and motion fuzzy probability model, the sensitivity is actively adjusted in advance. An autoregressive time-series predictor and an online calibration mechanism are also introduced.

Benefits of technology

It effectively overcomes the transient image quality degradation problem of traditional feedback control, improves the image prediction accuracy and stability of photoelectric sensors in complex lighting scenarios, enhances the robustness of motion estimation, and ensures the accuracy of target detection and the long-term operational reliability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122449952A_ABST
    Figure CN122449952A_ABST
Patent Text Reader

Abstract

The application relates to an adaptive control system for dynamic sensitivity adjustment of a photoelectric sensor, comprising: a photoelectric sensor, the sensitivity parameter of which can be adjusted online, used for collecting and outputting an image sequence; a target detection and feedback unit, used for carrying out target detection on the image sequence output by the photoelectric sensor, obtaining a boundary box of the target, a detection confidence and a local signal-to-noise ratio expectation value of the target area; an ambient light sensing unit, used for acquiring an ambient light intensity and generating a predicted ambient light intensity; a prediction model unit, used for predicting a scene displacement amplitude of a next frame based on a motion vector of a current image frame; and a parameter solving unit, which is internally provided with a sensor response model and a motion blur probability model, and is used for constructing a cost function with the sensitivity parameter as a variable; the application can realize better adaptive control.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to, and more specifically to, an adaptive control system for adjusting the dynamic sensitivity of a photoelectric sensor. Background Technology

[0002] In production line inspection scenarios for electronic components, circuit boards, and other products, photoelectric sensors need to acquire clear images under conditions of high-speed conveyor belt operation, fluctuating ambient light, and rapid target movement to support subsequent target detection and defect identification.

[0003] Current common automatic exposure or sensitivity adjustment methods mostly rely on feedback control based on image statistics of the current frame. When ambient light changes rapidly or there is significant motion between the target and the background, the adjustment lag often leads to overexposure, underexposure, or motion blur in the next frame, worsening the signal-to-background ratio and reducing detection accuracy. While some solutions introduce simple feedforward or prediction mechanisms, they fail to correlate scene motion information with the blur risk of exposure parameters, nor do they take the specific signal-to-background ratio requirements of the target detection task as the adjustment target, resulting in a disconnect between sensitivity adjustment and the detection task. Furthermore, existing technologies lack filtering mechanisms for minor changes and online model calibration methods during parameter updates, causing sensitivity parameters to frequently jump around their optimal values ​​or drift after slow changes in scene characteristics, affecting the long-term reliability and stability of the system.

[0004] To address the aforementioned issues, an adaptive control system for dynamic sensitivity adjustment of photoelectric sensors is proposed. Summary of the Invention

[0005] To address the shortcomings of existing technologies, this invention provides an adaptive control system for dynamic sensitivity adjustment of a photoelectric sensor, comprising: a photoelectric sensor whose sensitivity parameters can be adjusted online, used to acquire and output image sequences; The target detection and feedback unit is used to perform target detection on the image sequence output by the photoelectric sensor, and obtain the target's bounding box, detection confidence, and expected local signal-to-background ratio of the target region. An ambient light sensing unit is used to acquire ambient light intensity and generate a predicted ambient light intensity. The prediction model unit predicts the scene displacement magnitude in the next frame based on the motion vector of the current image frame. The parameter solving unit incorporates a sensor response model and a motion fuzzy probability model, constructing a cost function with sensitivity parameters as variables. The cost function includes: The optimal sensitivity parameter is obtained by iteratively optimizing the solution based on the deviation term between the predicted signal-to-back ratio of the target area and the expected local signal-to-back ratio calculated using the sensor response model and predicted ambient light intensity, the penalty term for the change in sensitivity parameter, and the motion blur probability penalty term calculated based on the scene displacement amplitude and sensitivity parameter. The control unit applies the optimal sensitivity parameters to the photoelectric sensor to control the sensitivity when acquiring the next frame of image. The control unit applies the optimal sensitivity parameters to the photoelectric sensor to control the sensitivity when acquiring the next frame of image.

[0006] Furthermore, the ambient light sensing unit includes an ambient light sensor and an autoregressive time-series predictor, which constructs an autoregressive model based on the ambient light intensity values ​​of multiple historical frames to generate the predicted ambient light intensity for the next frame. The specific calculation process is as follows: First, the ambient light intensity sequence of the current moment and several previous moments is obtained through the ambient light sensor. Then, the sequence is decomposed into trend and periodic components to obtain the trend component. and periodic components ; Then, the trend components are extrapolated one step using an autoregressive model to obtain the extrapolated trend value. Finally, the extrapolated trend value is superimposed with the periodic component at the next moment to obtain the predicted ambient light intensity. ; in For periodic components The periodic component value at the next moment is obtained by extrapolating the periodic characteristics.

[0007] Furthermore, the process by which the prediction model unit calculates the scene displacement amplitude is as follows: The sparse optical flow motion vector field between the current image frame and the previous image frame is extracted; the amplitudes of all motion vectors in this motion vector field are statistically sorted; and a predetermined quantile of the amplitude distribution is taken as the initial value of the scene displacement amplitude, i.e.: ; in This indicates taking the p-th quantile. It is the set of motion vector magnitudes; If the motion vectors within the target bounding box exhibit directional consistency (i.e., the variance of the motion vector directions within the bounding box is less than a preset consistency threshold), then the average amplitude of all motion vectors within the target bounding box is further calculated. The initial value of the scene displacement amplitude is amplified and corrected using this average amplitude as a weighting factor. The corrected value is then used as the scene displacement amplitude v. The correction calculation method is as follows: ; Where k is a preset weighting coefficient; If the motion vectors within the target bounding box do not have consistent orientation, then directly... The displacement amplitude v of the scene.

[0008] Furthermore, the motion fuzziness probability model is used to calculate the motion fuzziness probability. ; The calculation process is as follows: Obtain sensitivity parameters Let T be the exposure time, i.e., T = θ. Combined with the scene displacement amplitude v and the preset pixel size p, calculate the normalized displacement of the image relative to the pixel size during the exposure period. ; Then the normalized displacement Inputting the data into a preset S-curve function yields the motion blur probability: ; Where parameters To control the steepness of the sigmoid function, parameter b is the normalized displacement threshold corresponding to a fuzzy probability of 50%.

[0009] Furthermore, the parameter solving unit iteratively optimizes the process of finding the optimal sensitivity parameters by first calling the sensor response model and combining it with the predicted ambient light intensity. Calculate at different sensitivity parameters Target area prediction signal-to-back ratio under the given value ; Then obtain the expected local signal-to-background ratio output from the target detection and feedback unit. and current sensitivity parameters ; Then, the motion blur probability model is invoked, utilizing the scene displacement amplitude v and the sensitivity parameter. Calculate motion fuzziness probability ; Based on the above results, a system is constructed using sensitivity parameters. The cost function for the variable is a weighted sum of three parts: the squared term of the signal-to-background ratio deviation, the squared term of the sensitivity change, and the motion fuzziness probability term. Its specific form is as follows: ; in , , These are the signal-to-background ratio deviation weight, sensitivity stability weight, and motion blur suppression weight, respectively. The parameter solving unit uses gradient descent to iterate over the cost function, calculating the cost function in each iteration. Sensitivity parameters The gradient is calculated, and the sensitivity parameters are updated along the negative gradient direction. Continue until the gradient magnitude is less than the preset convergence threshold, then set the sensitivity parameter at this point. As the optimal sensitivity parameter .

[0010] Furthermore, the sensor response model calculates the predicted signal-to-background ratio for the target area. The process is as follows: Sensitivity parameters The exposure time is given, and the gain G is a preset constant. Obtain the predicted ambient light intensity Calculate the predicted grayscale of the target area based on the preset target reflectivity R. ; Simultaneously, the predicted light intensity of the background area is calculated based on the predicted ambient light intensity and the preset background reflectivity. And calculate the predicted grayscale of the background area. Based on the standard deviation of sensor readout noise Based on the characteristics of photon shot noise, the standard deviation of background noise is calculated: : Finally, combining the grayscale difference between the target and the background, as well as the background noise, the predicted signal-to-background ratio is calculated: ; The prediction signal-to-background ratio is used as a substitute in the cost function for optimization.

[0011] Furthermore, the target detection and feedback unit generates the expected value of the local signal-to-background ratio. The process is as follows: Based on the bounding box obtained from the target detection in the current frame, the average gray level of the target pixels and the average gray level of the background pixels are statistically analyzed within the bounding box region. The absolute value of the difference between the two is calculated, and then divided by the standard deviation of the background pixel gray level to obtain the local signal-to-background ratio, denoted as . ; Obtain the optimal signal-to-background ratio interval for similar targets in the training set of the preset target detection algorithm. The upper and lower limits of the optimal signal-to-background ratio interval are scaled and adjusted using the target detection confidence C of the current frame. The scaling calculation method is as follows: ; ; in The preset interval contraction step size; Then the current local signal-to-background ratio With the adjusted range Comparison: like Then Set as ; like Then Set as ; Otherwise Set as itself.

[0012] Furthermore, it also includes an online model calibration unit, which calculates the actual signal-to-background ratio of the target region using actual image data after each frame is acquired. And together with the parameter solving unit, when solving for the optimal sensitivity parameters of this frame, the predicted signal-to-background ratio is calculated based on the sensor response model. Compare and obtain the deviation. ; Then, the recursive least squares estimation algorithm is used to update the preset background reflectivity parameters in the sensor response model by taking the deviation e as the error signal. The update process of the recursive least squares estimation is as follows: construct an information vector based on the current gain parameter and the observation data, calculate the Kalman gain at the current time using the parameter estimate value at the previous time, and then obtain the parameter correction amount by weighting the deviation e with the Kalman gain. The correction amount is then superimposed on the parameter estimate value at the previous time to complete the online update of the background reflectivity parameters.

[0013] Furthermore, before applying the optimal sensitivity parameters to the photoelectric sensor, the control unit also performs a sensitivity change rationality judgment: calculating the optimal sensitivity parameters. Compared with current sensitivity parameters The relative rate of change r between them is as follows: ; Obtain the target detection confidence C of the current frame from the target detection and feedback unit; When the relative rate of change r is less than the preset sensitivity adjustment dead zone threshold Furthermore, the detection confidence level C is higher than the preset high confidence threshold. If the current image quality is deemed sufficient for target detection, the current sensitivity parameter is maintained; otherwise, the optimal sensitivity parameter is set. Applied to photoelectric sensors.

[0014] The present invention has the following advantages over the prior art: By constructing an adaptive control architecture integrating ambient light prediction, scene motion estimation, and motion blur probability model, proactive look-ahead adjustment of the sensitivity parameters of the photoelectric sensor was achieved, effectively overcoming the transient image quality degradation problem caused by the hysteresis of traditional feedback control. An autoregressive time-series predictor was used to decompose and extrapolate the trend and periodic terms of ambient light intensity, improving the accuracy of ambient light intensity prediction in complex lighting scenarios and providing a reliable feedforward basis for sensitivity optimization. A scene displacement amplitude calculation method based on sparse optical flow quantile statistics and target region motion consistency weighted correction was adopted, which more robustly reflects the global scene motion state and highlights the impact of target motion on image quality, enhancing the robustness of motion estimation. By using exposure time as a sensitivity parameter and fusing the sensor response model and the S-shaped function fuzzy probability model, a cost function containing a signal-to-background ratio deviation term, a sensitivity change penalty term, and a motion blur penalty term was constructed, enabling optimization of the signal-to-background ratio and adjustment... The optimal sensitivity solution, which balances stability, motion blur suppression, and target detection, effectively suppresses motion blur and avoids frequent sensitivity jumps while ensuring the required signal-to-background ratio (SPR) for target detection. An optimal SPR interval adjustment mechanism based on dynamic scaling of detection confidence is introduced, allowing the expected local SPR value to adaptively shrink according to the reliability of the target detection results. This reduces the aggressiveness of sensitivity adjustment when detection confidence is high, improving image quality stability. An online model calibration unit is added, using the deviation between actual image data and predicted SPR to recursively update the background reflectivity parameter in the sensor response model using least squares estimation. This enables the system to adapt to slow changes in scene reflectivity characteristics, maintaining prediction accuracy stability over long-term operation. Furthermore, a sensitivity change rationality judgment is used to freeze sensitivity updates when the parameter change is less than the dead zone threshold and the detection confidence is higher than a set threshold, avoiding unnecessary adjustments caused by minor perturbations and effectively suppressing image transient effects. Attached Figure Description

[0015] Figure 1 This is a system structure block diagram of the present invention. Detailed Implementation

[0016] 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 below.

[0017] like Figure 1 As shown, an adaptive control system for dynamic sensitivity adjustment of a photoelectric sensor includes: a photoelectric sensor whose sensitivity parameters can be adjusted online, used to acquire and output image sequences; The target detection and feedback unit is used to perform target detection on the image sequence output by the photoelectric sensor, and obtain the target's bounding box, detection confidence, and expected local signal-to-background ratio of the target region. An ambient light sensing unit is used to acquire ambient light intensity and generate a predicted ambient light intensity. The prediction model unit predicts the scene displacement magnitude in the next frame based on the motion vector of the current image frame. The parameter solving unit incorporates a sensor response model and a motion fuzzy probability model, constructing a cost function with sensitivity parameters as variables. The cost function includes: The optimal sensitivity parameter is obtained by iteratively optimizing the solution based on the deviation term between the predicted signal-to-back ratio of the target area and the expected local signal-to-back ratio calculated using the sensor response model and predicted ambient light intensity, the penalty term for the change in sensitivity parameter, and the motion blur probability penalty term calculated based on the scene displacement amplitude and sensitivity parameter. The control unit applies the optimal sensitivity parameters to the photoelectric sensor to control the sensitivity when acquiring the next frame of image. The control unit applies the optimal sensitivity parameters to the photoelectric sensor to control the sensitivity when acquiring the next frame of image.

[0018] The ambient light sensing unit includes an ambient light sensor and an autoregressive time-series predictor. The autoregressive time-series predictor constructs an autoregressive model based on the ambient light intensity values ​​of multiple historical frames to generate the predicted ambient light intensity for the next frame. The specific calculation process is as follows: First, the ambient light intensity sequence of the current moment and several previous moments is obtained through the ambient light sensor. Then, the sequence is decomposed into trend and periodic components to obtain the trend component. and periodic components ; Then, the trend components are extrapolated one step using an autoregressive model to obtain the extrapolated trend value. Finally, the extrapolated trend value is superimposed with the periodic component at the next moment to obtain the predicted ambient light intensity. ; in For periodic components The periodic component value at the next moment is obtained by extrapolating the periodic characteristics; By decomposing the ambient light intensity sequence into trend and periodic components, and using an autoregressive model to extrapolate the trend component and obtain the periodic component based on the periodic characteristics, the two are superimposed to generate the predicted ambient light intensity. This effectively separates the slow changing trend and periodic fluctuations of illumination, making the prediction results closer to the real physical process in scenarios where ambient light exhibits regular changes (such as AC light source flicker, day-night cycle, rotating lights, etc.). Compared to simply using the original sequence for modeling or simple smoothing prediction, this significantly improves the prediction accuracy and the reliability of feedforward control, thereby providing accurate prior information on light intensity changes for subsequent sensitivity adjustment and avoiding overexposure, underexposure, or signal-to-background ratio deterioration caused by illumination prediction deviations.

[0019] Assume the ambient light sensor collects ambient light intensity at fixed time intervals (e.g., once per second), in lux. The resulting light intensity sequence (6 frames) for the current time t and the previous 5 times is: ; It is necessary to predict the ambient light intensity at the next time step t+1. .

[0020] Decomposition of trend and cycle terms.

[0021] The trend component T is extracted from the sequence using a centered moving average method, with a window length of 3. For times t, t-1, and t-2, the corresponding trend values ​​can be calculated (taking time t as an example): ; However, since t+1 is unknown, a one-sided moving average is used for the end of the sequence. In practice, the trend of all points with sufficient neighbors can be calculated first, and then extrapolated using the nearest neighbor trend. For simplicity, this example uses the first 3 points for calculation. Then, extrapolation is performed assuming the trend changes approximately linearly. A more practical approach is to directly decompose the existing sequence.

[0022] Suppose a trend sequence is obtained through moving average: ; The periodic component is obtained by subtracting the trend from the original sequence: ; ; Autoregressive model extrapolation of trends.

[0023] For trend component sequences Establish a first-order autoregressive model AR(1): ; parameter Least squares estimation is used. The three most recent trend values ​​are taken. Perform fitting: Solve the system of equations: ; ; Subtracting the two equations, we get: ; Substitution .

[0024] Therefore, the extrapolated trend value is: ; Step 3: Extrapolate periodic components.

[0025] The periodic component sequence exhibits a certain repetitive pattern. If the illumination change period is known to be 3 sampling intervals (e.g., the flickering or rotation cycle of a lamp), then... The value that is in phase with the previous cycle can be taken, that is... (Because t+1 and t-2 are in phase).

[0026] From what was obtained before, Therefore .

[0027] If there is no obvious period, the mean or most recent value of the periodic component can be taken, but this example assumes that the period is known.

[0028] The predicted values ​​are obtained by superimposing them.

[0029] ; The predicted value of 122 lux is slightly higher than the current value of 120 lux, which is consistent with the trend. Directly using simple extrapolation (such as linear fitting of the original sequence) might ignore periodic fluctuations, leading to prediction errors. This method improves prediction accuracy through trend period decomposition and separate prediction, providing a more reliable prior value of light intensity for sensitivity adjustment. This ensures that the sensor uses appropriate exposure parameters in the next frame, avoiding image quality degradation caused by inaccurate illumination prediction.

[0030] The process by which the prediction model unit calculates the scene displacement amplitude is as follows: The sparse optical flow motion vector field between the current image frame and the previous image frame is extracted; the amplitudes of all motion vectors in this motion vector field are statistically sorted; and a predetermined quantile of the amplitude distribution is taken as the initial value of the scene displacement amplitude, i.e.: ; in This indicates taking the p-th quantile. It is the set of motion vector magnitudes; If the motion vectors within the target bounding box exhibit directional consistency (i.e., the variance of the motion vector directions within the bounding box is less than a preset consistency threshold), then the average amplitude of all motion vectors within the target bounding box is further calculated. The initial value of the scene displacement amplitude is amplified and corrected using this average amplitude as a weighting factor. The corrected value is then used as the scene displacement amplitude v. The correction calculation method is as follows: ; Where k is a preset weighting coefficient; If the motion vectors within the target bounding box do not have consistent orientation, then directly... As the scene displacement amplitude v; An initial estimation method for scene displacement amplitude based on quantile statistics of sparse optical flow motion vector field is adopted. This method can effectively suppress the interference of local noise and isolated motion on the overall motion amplitude in industrial environments such as conveyor belt vibration and dust interference, and extract a robust metric value representing the global scene motion level. On this basis, the initial estimate is weighted and corrected by detecting the direction consistency of motion vectors within the target bounding box and the average amplitude. When the workpiece is rapidly conveyed and the motion direction is consistent, the scene displacement amplitude is adaptively amplified so that the amplitude more realistically reflects the contribution of the target workpiece image movement to the imaging blur, avoiding the underestimation of blur risk due to the relative stillness of the background area. The corrected scene displacement amplitude is used for subsequent motion blur probability calculation and sensitivity optimization, which can improve the safety of exposure parameter decision-making, significantly reduce the motion blur probability of the target workpiece while ensuring the signal-to-background ratio, and ensure the stability and accuracy of target detection and defect identification under high-speed production line operation.

[0031] Following the aforementioned ambient light prediction scenario, an electronic component production line uses photoelectric sensors to detect visual defects on circuit boards along a conveyor belt. The conveyor belt runs horizontally to the right. The photoelectric sensor's current and previous frame images both have a resolution of 1920×1080, with a pixel size (p=0.005mm) (i.e., 5 micrometers). A sparse optical flow algorithm is used to track 200 feature points between the two frames to obtain a set of motion vectors. Each vector represents the displacement of the corresponding feature point from the previous frame to the current frame, in pixels. The set of magnitudes of all vectors... After statistical sorting, its 90th percentile (i.e., p=0.9 percentile) is: ; At this point, the target detection and feedback unit has output the bounding box of the circuit board, which contains 20 optical flow vectors (concentrated in the circuit board area on the conveyor belt). The variance of the motion vector directions within the bounding box is calculated as follows: Less than the preset consistency threshold It is determined that there is directional consistency (consistent with the direction of movement of the conveyor belt).

[0032] Further calculate the average magnitude of all motion vectors within the frame. Using a weighting coefficient k=0.8, calculate the scene displacement amplitude according to the corrected formula: ; If the motion vectors within the frame are not aligned (e.g., the direction variance exceeds the threshold due to circuit board rotation or vibration), then directly take... .

[0033] The global motion quantile is 5 pixels (mainly from the conveyor belt background and stationary fixtures), while the average amplitude in the target circuit board area reaches 12 pixels. After correction, the scene displacement amplitude is increased to 14.6 pixels, more realistically reflecting the image shift caused by the rapid transport of the target workpiece. Subsequently, in calculating the motion blur probability, the corrected v is used in combination with the exposure time T and pixel size p to calculate the normalized displacement. This allows the fuzziness probability to more accurately reflect the motion fuzziness risk of the target workpiece, thereby applying appropriate penalties to excessive exposure in the cost function optimization, ensuring that sensitivity adjustment achieves a reasonable balance between improving the signal-to-background ratio and suppressing fuzziness, and guaranteeing the detection accuracy under high-speed operation of the production line.

[0034] Motion fuzzy probability model is used to calculate motion fuzzy probability. ; The calculation process is as follows: Obtain sensitivity parameters Let T be the exposure time, i.e., T = θ. Combined with the scene displacement amplitude v and the preset pixel size p, calculate the normalized displacement of the image relative to the pixel size during the exposure period. ; Then the normalized displacement Inputting the data into a preset S-curve function yields the motion blur probability: ; Where parameters To control the steepness of the sigmoid function, parameter b is the normalized displacement threshold corresponding to a fuzzy probability of 50%. By constructing a normalized displacement amount using sensitivity parameters (exposure time), scene displacement amplitude, and pixel size, and mapping this displacement amount to a continuously differentiable motion blur probability from 0 to 1 using a sigmoid function, a quantitative modeling of the blur risk caused by target image movement during exposure is achieved. This blur probability can be seamlessly embedded into the gradient descent optimization process as a penalty term in the cost function. At the same time, the steepness parameter and position threshold of the sigmoid function can be flexibly adjusted according to the production line inspection accuracy requirements, so that the blur probability rises rapidly when the exposure time is long or the target moves quickly, driving the optimization algorithm to automatically shorten the exposure time to suppress blur and ensure the clarity of industrial inspection images and the reliability of defect identification.

[0035] Assuming the visual inspection camera on the production line has a frame rate of 30fps, and the frame period is... s, preset pixel size =0.005mm (5 micrometers). The scene displacement amplitude has been corrected accordingly. The current sensitivity parameter, i.e., the exposure time, is T = 10 ms = 0.1 s.

[0036] Calculate the normalized displacement: First, convert the inter-frame pixel displacement into the number of pixels shifted during the exposure time. Since the pixel displacement of the target within the frame period is v, the equivalent pixel displacement within the exposure time T is... This is the normalized displacement (the number of pixels shifted during exposure).

[0037] Target physical speed mm / s, then .

[0038] Therefore, regardless of the method used, the result is... ; Calculate motion blur probability: Preset S-curve function parameters: steepness a=1, 50% fuzziness threshold b=3.

[0039] Substitute into the formula: ; Calculate the index ,but: ; Under the current exposure settings, the probability of motion blur on the circuit board is approximately 79.9%, indicating a high risk of blurring.

[0040] Comparing the probability of blurring under different exposure times: If the exposure time is shortened to Recalculate the normalized displacement: ; Or you can directly use the pixel displacement ratio: .

[0041] but ; The blur probability was reduced to 10.7%, and image sharpness was significantly improved. This quantization result was directly used as a blur penalty term in the cost function, driving the exposure time to be adjusted towards lower blur during the optimization process, thus achieving an automatic balance between signal-to-background ratio and sharpness.

[0042] The parameter solving unit iteratively optimizes and solves for the optimal sensitivity parameters by first calling the sensor response model and combining it with the predicted ambient light intensity. Calculate at different sensitivity parameters Target area prediction signal-to-back ratio under the given value ; Then obtain the expected local signal-to-background ratio output from the target detection and feedback unit. and current sensitivity parameters ; Then, the motion blur probability model is invoked, utilizing the scene displacement amplitude v and the sensitivity parameter. Calculate motion fuzziness probability ; Based on the above results, a system is constructed using sensitivity parameters. The cost function for the variable is a weighted sum of three parts: the squared term of the signal-to-background ratio deviation, the squared term of the sensitivity change, and the motion fuzziness probability term. Its specific form is as follows: ; in , , These are the signal-to-background ratio deviation weight, sensitivity stability weight, and motion blur suppression weight, respectively. The parameter solving unit uses gradient descent to iterate over the cost function, calculating the cost function in each iteration. Sensitivity parameters The gradient is calculated, and the sensitivity parameters are updated along the negative gradient direction. Continue until the gradient magnitude is less than the preset convergence threshold, then set the sensitivity parameter at this point. As the optimal sensitivity parameter ; By constructing a cost function that integrates a weighted sum of three parts—the signal-to-background ratio (SBR) deviation term, the squared term of sensitivity change, and the motion blur probability term—sensitivity adjustment is transformed into an analytically solvable multi-objective optimization problem. The SBR deviation term drives the sensitivity to converge towards meeting the target detection requirements; the squared term of sensitivity change suppresses large jumps in sensitivity between adjacent frames to avoid image brightness flicker; and the motion blur probability term assesses blur risk in real time based on scene displacement amplitude and applies an increasing penalty to excessive exposure. These three components work synergistically in the cost function, automatically seeking the optimal balance between ensuring the target SBR, maintaining adjustment stability, and suppressing motion blur. The gradient descent method is used to iteratively solve this cost function. The gradient information of the sensitivity parameters within the cost function guides the search direction and step size, ensuring that each sensitivity update has a clear optimization basis. This avoids the coarseness and parameter tuning difficulties of traditional threshold-based adjustment, significantly improving the system's adaptability under complex conditions and the accuracy of parameter adjustment.

[0043] The parameters for the production line vision inspection system are: frame rate 30fps (frame period) ), pixel size Gain Target reflectance R=0.8, background reflectance Read noise standard deviation .

[0044] At the current moment, the ambient light sensing unit outputs a predicted ambient light intensity. The prediction model unit outputs the scene displacement amplitude. The target detection and feedback unit outputs the expected value of the local signal-to-background ratio. The current sensitivity parameter is the exposure time. .

[0045] The weighting coefficients of the cost function are set as follows: the weight of the signal-to-background ratio deviation is α=1, the weight of the sensitivity stability is β=1000, and the weight of the motion blur suppression is γ=50.

[0046] The motion fuzziness probability adopts an sigmoid function model with parameters a=1 and b=3, i.e. The normalized displacement .

[0047] Calculate the prediction signal-to-background ratio at the current sensitivity: Predicted background light intensity: .

[0048] Target prediction grayscale: .

[0049] Background prediction grayscale: .

[0050] Background noise standard deviation: ; Predicted confidence ratio: ; Calculate the motion blur probability at the current sensitivity: Normalized displacement: ; Fuzzy probability ; Calculate the cost function value at the current sensitivity: ; Gradient descent one iteration: Take the perturbation step size ,calculate The cost of time.

[0051] Predicted confidence ratio: ; ; ; .

[0052] Normalized displacement .

[0053] ; Similarly, calculate The cost of time.

[0054] ; ; ; .

[0055] ; .

[0056] ; Gradient approximation and parameter update: Approximate the gradient using the central difference: ; Set learning rate Update the sensitivity parameters along the negative gradient direction: ; This iterative process is repeated until the gradient magnitude is less than a preset convergence threshold, ultimately obtaining the optimal exposure time that minimizes the cost function. Under the updated sensitivity parameters, the signal-to-background ratio and blur probability achieve a better balance, which is output to the control unit and applied to the sensor to achieve adaptive sensitivity adjustment for production line inspection.

[0057] Sensor response model calculates the predicted signal-to-background ratio for the target area. The process is as follows: Sensitivity parameters The exposure time is given, and the gain G is a preset constant. Obtain the predicted ambient light intensity Calculate the predicted grayscale of the target area based on the preset target reflectivity R. ; Simultaneously, the predicted light intensity of the background area is calculated based on the predicted ambient light intensity and the preset background reflectivity. And calculate the predicted grayscale of the background area. Based on the standard deviation of sensor readout noise Based on the characteristics of photon shot noise, the standard deviation of background noise is calculated: : Finally, combining the grayscale difference between the target and the background, as well as the background noise, the predicted signal-to-background ratio is calculated: ; The predicted signal-to-back ratio is used as a substitute in the cost function for optimization. By organically combining sensitivity parameters (exposure time), preset gain, predicted ambient light intensity, and the reflectivity of the target and background, a mapping relationship from exposure parameters to the grayscale of the target and background is established. Simultaneously, a background noise standard deviation model is constructed based on the characteristics of sensor readout noise and photon shot noise, forming a complete predictive signal-to-background ratio (SNR) calculation process. This model can quantitatively evaluate the grayscale difference and noise level between the target and background under different exposure times, providing accurate SNR predictions for the cost function, thus supporting accurate optimization of sensitivity by the cost function. The photon shot noise term in the model adaptively changes with exposure time and background light intensity, ensuring that the noise impact under low exposure or weak light conditions is realistically reflected. This avoids the optimization algorithm selecting excessively low exposure times due to insufficient noise estimation, thereby protecting the reliability of the SNR and the usability of the image. All parameters have clear physical meanings, facilitating correction through calibration or online calibration units, ensuring the prediction accuracy and robustness of the system during long-term operation.

[0058] Assume the sensor gain is preset to 0. Read noise standard deviation Target reflectivity R=0.8, background reflectivity Predict the ambient light intensity at the current moment. Sensitivity parameter (exposure time) (i.e., 10ms).

[0059] Calculate the predicted light intensity in the background region: ; Calculate the predicted grayscale of the target area and the predicted grayscale of the background area: Target prediction grayscale: ; Background prediction grayscale: ; Calculate the standard deviation of background noise: The variance of photon shot noise is equal to the signal mean (number of electrons) and the square of the gain, which is then added to the variance of readout noise. ; Calculate the prediction signal-to-background ratio: ; Comparative verification under different exposure times: If the exposure time is shortened to The corresponding calculations are as follows: ; ; ; ; The signal-to-back ratio is low, mainly due to the reduced signal grayscale difference, while the noise is still dominated by readout noise.

[0060] If the exposure time is extended to : ; ; ; ; The signal-to-background ratio (SRR) improved, but the noise standard deviation increased slightly. This model accurately reflects the SRR's variation with exposure time, providing continuous and accurate predictions for cost function optimization and ensuring that the solution for optimal sensitivity is based on reliable physical principles.

[0061] The target detection and feedback unit generates the expected local signal-to-background ratio. The process is as follows: Based on the bounding box obtained from the target detection in the current frame, the average gray level of the target pixels and the average gray level of the background pixels are statistically analyzed within the bounding box region. The absolute value of the difference between the two is calculated, and then divided by the standard deviation of the background pixel gray level to obtain the local signal-to-background ratio, denoted as . ; Obtain the optimal signal-to-background ratio interval for similar targets in the training set of the preset target detection algorithm. The upper and lower limits of the optimal signal-to-background ratio interval are scaled and adjusted using the target detection confidence C of the current frame. The scaling calculation method is as follows: ; ; in The preset interval contraction step size; Then the current local signal-to-background ratio With the adjusted range Comparison: like Then Set as ; like Then Set as ; Otherwise Set as itself; By calculating the local signal-to-background ratio (SNR) based on the grayscale statistics of target pixels and background pixels within the target detection bounding box, and using the optimal SNR interval for similar targets in the preset target detection algorithm training set as a reference, the upper and lower limits of the interval are dynamically scaled and adjusted using the detection confidence of the current frame. This allows the setting of the expected local SNR value to adaptively change according to the reliability of the detection results. When the detection confidence is high, the upper and lower limits of the interval shrink towards the current local SNR, avoiding unnecessary demands on sensitivity. When the detection confidence is low, the interval widens, prompting the sensitivity to adjust in a direction more conducive to target detection. Finally, by comparing with the adjusted interval, the expected value is limited to a reasonable range, ensuring the lower limit of the SNR required for target detection while preventing problems such as excessive exposure time or excessive gain caused by excessively pursuing a high SNR. This provides an optimized target value for the cost function that is tightly coupled with the requirements of the detection task, achieving deep synergy between adaptive control and the performance of the detection algorithm.

[0062] Assuming the object detection algorithm is based on a deep learning model, the optimal signal-to-background ratio range for similar targets (a certain model of circuit board on a production line) under ideal imaging conditions in the training set is: This means that within this range, the detection algorithm maintains a stable recognition accuracy of over 99% for this type of circuit board, with the range shrinkage step size preset to [value missing]. .

[0063] The target detection and feedback unit of the current frame has output the bounding box of the circuit board. The division between the target area and the background area within the bounding box is obtained by expanding the bounding box outward by 1.2 times and then subtracting the area inside the bounding box.

[0064] Calculate the local signal-to-background ratio of the current frame: Statistical analysis of the average gray level of target pixels inside the bounding box (Consistent with the target prediction grayscale in the previous example), the average grayscale of background pixels within the background annular region. Standard deviation of background pixel grayscale Calculate the local signal-to-background ratio: ; Obtain the detection confidence level: The target detection and feedback unit outputs a current frame detection confidence level C=0.95 (indicating that the detector is 95% confident in the current target recognition result).

[0065] The upper and lower limits of the optimal signal-to-background ratio range are scaled using the detection confidence level.

[0066] Calculate the adjusted upper and lower limits of the interval using the scaling formula: ; ; The adjusted interval is [6.15, 11.85], which is slightly smaller than the original interval. This is because the detection confidence is high, indicating that the current target has been detected well, and there is no need to require an extreme confidence-to-background ratio.

[0067] If the detection confidence level is low, for example, C=0.6: ; ; The range is narrowed to [7.2, 10.8], and the lower limit is raised to encourage sensitivity to be adjusted towards improving the signal-to-background ratio, thereby enhancing detection capability.

[0068] Compare the current local signal-to-background ratio with the adjusted interval, and set the expected value.

[0069] current Compared with the adjusted interval [6.15, 11.85], Since the value is below the lower limit of the interval, the expected value of the local signal-to-background ratio is set to this lower limit. ; The expected value of 6.15 reflects the system's minimum requirement for the signal-to-background ratio and will be used as a factor in the cost function. The value of this parameter participates in sensitivity optimization, driving the exposure time to be adjusted in the direction of improving the signal-to-background ratio. If the image quality of subsequent frames improves... If it falls within the adjusted range, then Pick This mechanism itself avoids over-adjustment. It ensures that the sensitivity adjustment target remains dynamically consistent with the performance requirements of the detection algorithm, guaranteeing detection accuracy while avoiding unnecessary changes in exposure parameters, thus ensuring the stability and efficiency of the production line's visual inspection system.

[0070] It also includes an online model calibration unit, which calculates the actual signal-to-background ratio of the target region using actual image data after each frame is acquired. And together with the parameter solving unit, when solving for the optimal sensitivity parameters of this frame, the predicted signal-to-background ratio is calculated based on the sensor response model. Compare and obtain the deviation. ; Then, the recursive least squares estimation algorithm is used to update the preset background reflectivity parameters in the sensor response model by taking the deviation e as the error signal. The update process of the recursive least squares estimation is as follows: construct an information vector based on the current gain parameter and the observation data, calculate the Kalman gain at the current time using the parameter estimate value at the previous time, and then obtain the parameter correction amount by weighting the deviation e with the Kalman gain. The correction amount is then superimposed on the parameter estimate value at the previous time to complete the online update of the background reflectivity parameters. After each frame is acquired, the actual signal-to-background ratio (SNR) of the target area is calculated using real image data. This SNR is then compared with the predicted SNR obtained by the parameter solving unit based on the sensor response model when solving for the optimal sensitivity parameters of that frame. The deviation is obtained as a quantitative representation of model mismatch. Then, an online calibration algorithm in the form of recursive least squares estimation or Kalman filtering is adopted. An information vector is constructed based on the current gain parameter and observation data. The Kalman gain is calculated using the parameter estimate from the previous moment. The background reflectivity parameter is recursively updated by weighting the Kalman gain deviation. This allows the preset background reflectivity in the sensor response model to adaptively follow the slow changes in the production line scene (such as oil accumulation on the conveyor belt surface, changes in the color of the background workpiece, etc.), eliminating the long-term drift of the predicted SNR caused by the solidification of model parameters. This ensures the optimization accuracy of the cost function in long-term operation, thereby maintaining a continuous balance between the system's SNR and fuzziness suppression. At the same time, the recursive calculation only needs to retain the estimate and covariance matrix from the previous moment, resulting in extremely low real-time computational overhead, making it suitable for deployment in embedded vision systems.

[0071] Assume sensor gain Reading out noise The target reflectivity R=0.8.

[0072] Initial preset background reflectivity .

[0073] Extended Kalman filtering is used to estimate the background reflectance online. The system state is the background reflectance. The state equation is set as random walk. The process noise variance Q = 0.0001 and the observation noise variance R = 0.001.

[0074] Initial estimation error covariance .

[0075] Current frame (frame k): Predict ambient light intensity The parameter solving unit has obtained the optimal sensitivity parameters. .

[0076] Based on the current background reflectance estimate The predicted signal-to-background ratio calculated by the sensor response model is: ; ; ; ; ; After actual image acquisition: the photoelectric sensor uses Exposure acquires the image, the target detection and feedback unit outputs the circuit board bounding box, and the average gray level of the target area is statistically calculated within the bounding box. The average gray level of the background was statistically obtained in the annular region of the background. Background grayscale standard deviation .

[0077] Calculate the actual credit-to-back ratio: ; Deviation calculation: ; Extended Kalman filter updates background reflectivity: Observation model right The partial derivative is (ignoring the effect of noise variation on) Indirect effects (considering only signal grayscale difference): ; Prediction error covariance: .

[0078] Kalman gain: ; Updated state estimate: ; Update error covariance: ; At this point, the estimated background reflectance has been updated from 0.4 to 0.325, which is closer to the decrease in background reflectance caused by the darkening of the conveyor belt surface in a real scene. This updated value will be used in the sensor response model in the next frame, making the predicted signal-to-background ratio more realistic, eliminating accumulated bias, and ensuring long-term stable operation of adaptive control.

[0079] Before applying the optimal sensitivity parameters to the photoelectric sensor, the control unit also performs a sensitivity change rationality judgment: calculating the optimal sensitivity parameters. Compared with current sensitivity parameters The relative rate of change r between them is as follows: ; Obtain the target detection confidence C of the current frame from the target detection and feedback unit; When the relative rate of change r is less than the preset sensitivity adjustment dead zone threshold Furthermore, the detection confidence level C is higher than the preset high confidence threshold. If the current image quality is deemed sufficient for target detection, the current sensitivity parameter is maintained; otherwise, the optimal sensitivity parameter is set. Applied to photoelectric sensors; By introducing a sensitivity change rationality judgment mechanism before actually applying the optimal sensitivity parameter to the photoelectric sensor, the relative change rate between the optimal sensitivity parameter and the current sensitivity parameter is calculated, and the target detection confidence is obtained simultaneously. When the relative change rate is less than the preset dead zone threshold and the detection confidence is higher than the preset high confidence threshold, the current parameter is kept unchanged. This can effectively filter sensitivity fine-tuning instructions caused by factors such as small fluctuations in ambient light and scene displacement estimation noise, avoid the phenomenon of image brightness fluctuating due to frequent small oscillations of the sensitivity parameter near the optimal value, and eliminate unnecessary parameter switching interference with the stability of the production line detection algorithm. At the same time, the sensitivity adjustment authority is linked to the target detection confidence. When the detector is highly confident in the current target recognition result, the sensitivity update is frozen to ensure the consistency of image quality between consecutive frames and reduce the risk of missed detection or misjudgment caused by sensitivity jumps. When the detection confidence is insufficient or the sensitivity change requirement is significant, the update is allowed to ensure the system responds to real environmental changes in a timely manner, realizing an intelligent trade-off between adjusting sensitivity and maintaining stability.

[0080] Let the current sensitivity parameter be the exposure time. (6.8ms, which is the optimal value obtained from the previous iteration convergence).

[0081] The optimal sensitivity parameters output by the current frame parameter solving unit after iterative optimization. .

[0082] Preset sensitivity adjustment dead zone threshold (That is, a relative rate of change of less than 5% is considered a small change), with a pre-set high reliability threshold. .

[0083] The target detection confidence level C of the target detection and feedback unit output for the current frame is 0.96.

[0084] Calculate the relative rate of change: ; Enforcement of the reasonable judgment: Comparison condition one: The relative rate of change is less than the dead zone threshold, which satisfies the condition.

[0085] Comparison condition two: The detection confidence level is higher than the high confidence threshold, which satisfies the requirement.

[0086] If both conditions are met, the decision is: the current image quality meets the target detection requirements, and the current sensitivity parameter remains unchanged; that is, the next frame will still use the same sensitivity parameter. To expose it.

[0087] Compare the situations where updates need to be approved: If the detection confidence of the current frame drops to C=0.75, although the relative rate of change r=0.0147 is still less than 0.05, C=0.75<0.9, which does not meet the confidence condition. The decision is to allow the update. This is applied to the sensor. The reason is that insufficient detection confidence may indicate that the current image signal-to-background ratio or blur level is causing difficulties in detection, so it is performed even if the sensitivity change is small in an attempt to improve image quality.

[0088] For example, if the optimal sensitivity parameter changes significantly, such as : ; At this point, regardless of the confidence level, the relative rate of change has exceeded the dead zone threshold. The system determines that there is a real need for environmental change and directly allows the update, adjusting the exposure time to 10ms to cope with changes in lighting or motion.

[0089] This mechanism ensures that the production line inspection system avoids unnecessary parameter fluctuations when the lighting and motion conditions are relatively stable, maintains the consistency of the image sequence, and thus guarantees the continuous and stable operation of the defect detection algorithm.

[0090] The above are merely preferred embodiments of the present invention and are 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. An adaptive control system for dynamic sensitivity adjustment of a photoelectric sensor, characterized in that, include: A photoelectric sensor, whose sensitivity parameters can be adjusted online, is used to acquire and output image sequences; The target detection and feedback unit is used to perform target detection on the image sequence output by the photoelectric sensor, and obtain the target's bounding box, detection confidence, and expected local signal-to-background ratio of the target region. An ambient light sensing unit is used to acquire ambient light intensity and generate a predicted ambient light intensity. The prediction model unit predicts the scene displacement magnitude in the next frame based on the motion vector of the current image frame. The parameter solving unit incorporates a sensor response model and a motion fuzzy probability model, constructing a cost function with sensitivity parameters as variables. The cost function includes: The optimal sensitivity parameter is obtained by iteratively optimizing the solution based on the deviation term between the predicted signal-to-back ratio of the target area and the expected local signal-to-back ratio calculated using the sensor response model and predicted ambient light intensity, the penalty term for the change in sensitivity parameter, and the motion blur probability penalty term calculated based on the scene displacement amplitude and sensitivity parameter. The control unit applies the optimal sensitivity parameters to the photoelectric sensor to control the sensitivity when acquiring the next frame of image. The control unit applies the optimal sensitivity parameters to the photoelectric sensor to control the sensitivity when acquiring the next frame of image.

2. The adaptive control system for dynamic sensitivity adjustment of a photoelectric sensor according to claim 1, characterized in that: The ambient light sensing unit includes an ambient light sensor and an autoregressive time-series predictor. The autoregressive time-series predictor constructs an autoregressive model based on the ambient light intensity values ​​of multiple historical frames to generate the predicted ambient light intensity for the next frame. The specific calculation process is as follows: First, the ambient light intensity sequence of the current moment and several previous moments is obtained through the ambient light sensor. Then, the sequence is decomposed into trend and periodic components to obtain the trend component. and periodic components ; Then, the trend components are extrapolated one step using an autoregressive model to obtain the extrapolated trend value. Finally, the extrapolated trend value is superimposed with the periodic component at the next moment to obtain the predicted ambient light intensity.

3. The adaptive control system for dynamic sensitivity adjustment of a photoelectric sensor according to claim 2, characterized in that: The process by which the prediction model unit calculates the scene displacement amplitude is as follows: The sparse optical flow motion vector field between the current image frame and the previous image frame is extracted; the amplitudes of all motion vectors in this motion vector field are statistically sorted; and a predetermined quantile of the amplitude distribution is taken as the initial value of the scene displacement amplitude. ; If the motion vectors within the target bounding box exhibit directional consistency (i.e., the variance of the motion vector directions within the bounding box is less than a preset consistency threshold), then the average amplitude of all motion vectors within the target bounding box is further calculated. The average amplitude is used as a weighting factor to amplify and correct the initial value of the scene displacement amplitude, and the corrected value is used as the scene displacement amplitude v. If the motion vectors within the target bounding box do not have consistent orientation, then directly... The displacement amplitude v of the scene.

4. The adaptive control system for dynamic sensitivity adjustment of a photoelectric sensor according to claim 3, characterized in that: Motion fuzzy probability model is used to calculate motion fuzzy probability. ; The calculation process is as follows: Obtain sensitivity parameters Let T be the exposure time, i.e., T = θ. Combined with the scene displacement amplitude v and the preset pixel size p, calculate the normalized displacement of the image relative to the pixel size during the exposure period. ; Then the normalized displacement The input is fed into a preset S-curve function to obtain the motion blur probability. .

5. The adaptive control system for dynamic sensitivity adjustment of a photoelectric sensor according to claim 4, characterized in that: The parameter solving unit iteratively optimizes and solves for the optimal sensitivity parameters by first calling the sensor response model and combining it with the predicted ambient light intensity. Calculate at different sensitivity parameters Target area prediction signal-to-back ratio under the given value ; Then obtain the expected local signal-to-background ratio output from the target detection and feedback unit. and current sensitivity parameters ; Then, the motion blur probability model is invoked, utilizing the scene displacement amplitude v and the sensitivity parameter. Calculate motion fuzziness probability ; Based on the above results, a system is constructed using sensitivity parameters. Cost function for variables The cost function is a weighted sum of three parts: the squared term of the signal-to-background ratio deviation, the squared term of the sensitivity change, and the motion fuzziness probability term. The parameter solving unit uses gradient descent to iterate over the cost function, calculating the cost function in each iteration. Sensitivity parameters The gradient is calculated, and the sensitivity parameters are updated along the negative gradient direction. Continue until the gradient magnitude is less than the preset convergence threshold, then set the sensitivity parameter at this point. As the optimal sensitivity parameter .

6. The adaptive control system for dynamic sensitivity adjustment of a photoelectric sensor according to claim 5, characterized in that: Sensor response model calculates the predicted signal-to-background ratio for the target area. The process is as follows: Sensitivity parameters The exposure time is given, and the gain G is a preset constant. Obtain the predicted ambient light intensity Calculate the predicted grayscale of the target area based on the preset target reflectivity R. ; Simultaneously, the predicted light intensity of the background area is calculated based on the predicted ambient light intensity and the preset background reflectivity. And calculate the predicted grayscale of the background area. ; Based on the standard deviation of sensor readout noise Combine photon shot noise characteristics and calculate the standard deviation of background noise. : Finally, the predicted signal-to-background ratio is calculated by combining the grayscale difference between the target and the background, as well as the background noise. ; The prediction confidence ratio Used to substitute into the cost function for optimization solutions.

7. The adaptive control system for dynamic sensitivity adjustment of a photoelectric sensor according to claim 6, characterized in that: The target detection and feedback unit generates the expected local signal-to-background ratio. The process is as follows: Based on the bounding box obtained from the target detection in the current frame, the average gray level of the target pixels and the average gray level of the background pixels are statistically analyzed within the bounding box region. The absolute value of the difference between the two is calculated, and then divided by the standard deviation of the background pixel gray level to obtain the local signal-to-background ratio, denoted as . ; Obtain the optimal signal-to-background ratio interval for similar targets in the training set of the preset target detection algorithm. The upper and lower limits of the optimal signal-to-background ratio interval are scaled and adjusted using the target detection confidence C of the current frame. The scaling calculation method is as follows: ; ; in The preset interval contraction step size; Then the current local signal-to-background ratio With the adjusted range Comparison: like Then Set as ; like Then Set as ; Otherwise Set as itself.

8. The adaptive control system for dynamic sensitivity adjustment of a photoelectric sensor according to claim 7, characterized in that: It also includes an online model calibration unit, which calculates the actual signal-to-background ratio of the target region using actual image data after each frame is acquired. And together with the parameter solving unit, when solving for the optimal sensitivity parameters of this frame, the predicted signal-to-background ratio is calculated based on the sensor response model. Compare and obtain the deviation. ; Then, the recursive least squares estimation algorithm is used to update the preset background reflectivity parameters in the sensor response model by taking the deviation e as the error signal. The update process of the recursive least squares estimation is as follows: construct an information vector based on the current gain parameter and the observation data, calculate the Kalman gain at the current time using the parameter estimate value at the previous time, and then obtain the parameter correction amount by weighting the deviation e with the Kalman gain. The correction amount is then superimposed on the parameter estimate value at the previous time to complete the online update of the background reflectivity parameters.

9. The adaptive control system for dynamic sensitivity adjustment of a photoelectric sensor according to claim 8, characterized in that: Before applying the optimal sensitivity parameters to the photoelectric sensor, the control unit also performs a sensitivity change rationality judgment: calculating the optimal sensitivity parameters. Compared with current sensitivity parameters The relative rate of change r between them; Obtain the target detection confidence C of the current frame from the target detection and feedback unit; When the relative rate of change r is less than the preset sensitivity adjustment dead zone threshold Furthermore, the detection confidence level C is higher than the preset high confidence threshold. If the current image quality is deemed sufficient for target detection, the current sensitivity parameter is maintained unchanged. Otherwise, the optimal sensitivity parameter will be used. Applied to photoelectric sensors.