A target positioning method based on machine vision and deep learning
By constructing parallel semantic features and geometric gradient paths, combined with mask matrix and dynamic weight adjustment, the problems of semantic feature loss and geometric gradient loss in target localization are solved, and high-precision target localization is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- XIAMEN BOSHIYUAN MASCH VISION TECH CO LTD
- Filing Date
- 2026-04-24
- Publication Date
- 2026-07-07
AI Technical Summary
Existing technologies suffer from problems such as semantic feature abstraction and loss of underlying geometric gradients in target localization, resulting in insufficient localization accuracy, especially in dynamic blurring and complex backgrounds where it is difficult to achieve sub-pixel level accurate localization.
We construct a semantic feature extraction path and a geometric gradient extraction path to process image data in parallel. By combining the semantic feature tensor and the gradient feature tensor, we generate a reconstructed feature tensor. We use a mask matrix to filter out non-target texture interference and dynamically adjust the fusion weights through a global sparsity index to ensure the combination of high-dimensional semantic information and sub-pixel level spatial accuracy.
Under complex backgrounds and dynamic ambiguity conditions, high accuracy and stability of target positioning were achieved, positioning drift was reduced, and the real-time response efficiency of the system was improved.
Smart Images

Figure CN122115578B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a target localization method based on machine vision and deep learning, belonging to the field of image data processing technology. Background Technology
[0002] Currently, extracting deep semantic features using cascaded convolutional architectures is a common approach for target localization tasks. These methods enrich abstract information representing target categories by applying multi-level convolutional operations to image pixel tensors. However, existing solutions suffer from loss of low-level spatial geometric information during feature transformation. When the network expands its receptive field and acquires high-order semantic features through downsampling, high-frequency gradient features containing edges and corners in the image collapse. This dimensionality reduction processing targeting pixel information causes deep feature tensors to lose their geometric anchors in physical dimensions. In situations involving dynamic blur, strong lighting fluctuations, or complex background texture interference, the regression network relies solely on semantic tensors with low spatial resolution to determine coordinates, resulting in pixel-level localization drift.
[0003] To address positioning errors, linear improvement approaches such as increasing network depth or stacking residual modules can enhance feature representation capabilities, but they cannot reverse the loss of geometric information caused by downsampling. Furthermore, these methods significantly increase computational complexity and reduce the system's real-time response efficiency. Existing technologies cannot simultaneously extract high-dimensional semantic information and maintain sub-pixel spatial accuracy without altering the computational architecture. For example, Chinese invention patent CN120510391B discloses a deep learning-based image semantic segmentation optimization method and system. This method constructs a dual-path network including a boundary enhancement branch and combines Hausdorff distance loss to optimize image boundary segmentation. However, when dealing with high-speed motion or severely blurred conditions in industrial settings, the underlying logic relies on static feature probability prediction and distance measurement, lacking quantitative monitoring and real-time adaptation of the true sparse state of the image's pixel-level geometric gradient. The feature fusion weights also lack a dynamic compensation mechanism for physical signal attenuation, leading to structural misjudgments of boundary guidance information during feature loss. This fails to meet the stringent requirements for geometric anchor robustness in industrial-grade sub-pixel accurate positioning.
[0004] Therefore, how to reconstruct the data flow path of image feature extraction so that the regression network can obtain category semantic guidance while using high-fidelity spatial gradient tensors to achieve physical boundary constraints is the technical problem to be solved by this invention. Summary of the Invention
[0005] To address the problems mentioned in the background art, the technical solution of the present invention is as follows: A target localization method based on machine vision and deep learning, comprising:
[0006] Step 101: Obtain the tensor of the image to be processed and the historical coordinate vector of the target;
[0007] Step 102: Construct a feature extraction unit containing a semantic feature extraction path and a geometric gradient extraction path. The process of the feature extraction unit includes: Step 1021: Establish a semantic feature extraction path, which is used to extract abstract contextual information of the tensor of the image to be processed through hierarchical convolution operations to generate a first-scale semantic feature tensor representing the target category; Step 1022: Establish a geometric gradient extraction path, which is used to extract pixel-level geometric boundary information through a first-order gradient operator while maintaining the original resolution of the tensor of the image to be processed, to generate a second-scale gradient feature tensor representing the edge features of the target.
[0008] Step 103: Input the tensor of the image to be processed into the semantic feature extraction path and the geometric gradient extraction path in parallel, and calculate the semantic feature tensor at the first scale and the gradient feature tensor at the second scale respectively, wherein the spatial resolution of the first scale is smaller than the spatial resolution of the second scale.
[0009] Step 104: Determine the response regions in the semantic feature tensor where the channel values are greater than the feature response threshold, and calculate the time-series heatmap vector based on the target historical coordinate vector; the process of calculating the time-series heatmap vector includes: Step 1041: Using the historical centroid determined by the target historical coordinate vector as a reference, construct a probability density distribution map that follows a Gaussian distribution in the two-dimensional coordinate space; Step 1042: Map the probability density distribution map to a pixel coordinate system consistent with the gradient feature tensor to obtain a time-series heatmap vector that reflects the prior distribution of the target position;
[0010] Step 105: Calculate the pixel product of the response region and the temporal heatmap vector, and perform binarization to generate a mask matrix for filtering non-target texture interference.
[0011] Step 106: Filter the gradient feature tensor using the mask matrix to generate target edge features;
[0012] Step 107: Calculate the non-zero element density of the gradient feature tensor to determine the global sparsity index, and dynamically adjust the fusion weight of the target edge features based on the global sparsity index.
[0013] Step 108: After weighting the target edge features, align them with the semantic feature tensor at multiple scales to generate a reconstructed feature tensor;
[0014] Step 109: Map the reconstructed feature tensor to the coordinate regression space and output the target's location coordinates; after outputting the target's location coordinates, feed the location coordinates back to step 101 as the target's historical coordinate vector for the next time step, and complete the continuous tracking and positioning of the moving target in the video stream.
[0015] Preferably, the process of generating the mask matrix in step 105 includes: step 1051, performing bilinear interpolation on the response region to make its spatial dimension consistent with the temporal heatmap vector; step 1052, calculating the product of the interpolated response region and the temporal heatmap vector at the corresponding pixel position, and generating the mask matrix using a preset discrimination criterion.
[0016] Preferably, the process of generating target edge features in step 106 includes: clearing the values at the positions corresponding to the zero elements of the mask matrix in the gradient feature tensor to retain the gradient information in the target candidate region indicated by the mask matrix and masking the high-frequency texture of the background.
[0017] Preferably, the process of generating the reconstructed feature tensor in step 108 includes: step 1081, upsampling the semantic feature tensor to restore its spatial resolution to be consistent with the target edge features; step 1082, concatenating the upsampled semantic feature tensor with the weighted target edge features in the channel dimension, and generating the fused reconstructed feature tensor by pixel-by-pixel convolution.
[0018] Preferably, for dynamic blur present in the tensor of the image to be processed, when the global sparsity index... When the quality degradation threshold is greater than the preset threshold, the fusion weight of the target edge features is reduced, and the information proportion of the semantic feature tensor in the reconstructed feature tensor is increased simultaneously.
[0019] Preferably, step 109 includes: step 1091, using pooling units to compress the spatial dimension of the reconstructed feature tensor and extracting the global feature vector; step 1092, inputting the global feature vector into the fully connected layer and outputting the positioning coordinates representing the center position coordinates and bounding box size of the target.
[0020] Compared with the prior art, the beneficial effects of the present invention are:
[0021] 1. In the target localization of machine vision and deep learning, a separation architecture of semantic encoding path and gradient preservation path is constructed to solve the physical contradiction between semantic feature abstraction and low-level geometric gradient preservation in the image processing process of deep learning models. When traditional hierarchical convolutional networks enrich high-order semantics, the sampling and dimensionality reduction operation inevitably leads to the irreversible loss of original high-frequency spatial geometric information. This invention, through concurrent path setting, intercepts and preserves edge gradient tensors with complete spatial resolution from the structural level of data flow without relying on additional optical sensing hardware, providing deterministic geometric anchors for subsequent accurate coordinate regression.
[0022] 2. This invention employs a comprehensive gating mask mechanism based on the semantic confidence of the current frame and historical temporal priors to achieve accurate purification of high-frequency edge features. In image data processing in industrial manufacturing or complex background environments, pseudo-gradients generated by background textures can severely interfere with the boundary recognition of targets. This invention extracts the peak activation region in the high-dimensional semantic tensor and performs intersection operations with the target coordinate heatmap of the previous frame to generate a pixel-level comprehensive gating mask matrix. This forcibly removes pseudo-edge interference from non-target regions, ensuring that the information sources participating in feature reconstruction have high geometric purity.
[0023] 3. The dynamic weight adjustment mechanism driven by the global sparsity index introduced in this invention constructs a low-level protection scheme for the system to deal with the degradation of the intrinsic quality of the image. For the blurring caused by high dynamic motion, when the image edge gradient collapses at the pixel level due to physical characteristics, the system dynamically adjusts the weight ratio of the fused feature tensor by quantizing and purifying the proportion of non-zero elements in the gradient tensor. When the extreme state of detecting the loss of gradient information is detected, the algorithm logic automatically degenerates to the strong semantic dependency mode smoothly, sacrificing extreme value accuracy to obtain the continuity of target coordinate tracking, effectively avoiding the risk of systemic collapse of positioning coordinates under extreme perturbations. Attached Figure Description
[0024] Figure 1 This is a flowchart illustrating the entire process of the target localization method based on dual-path feature extraction in this invention.
[0025] Figure 2 This is a block diagram of the mask matrix generation architecture that integrates semantic activation and temporal prior in this invention.
[0026] The objectives, features, and advantages of this invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0027] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.
[0028] A target localization method based on machine vision and deep learning includes:
[0029] Step 101: Obtain the tensor of the image to be processed and the historical coordinate vector of the target;
[0030] Step 102: Construct a feature extraction unit containing a semantic feature extraction path and a geometric gradient extraction path. The process of the feature extraction unit includes: Step 1021: Establish a semantic feature extraction path, which is used to extract abstract contextual information of the tensor of the image to be processed through hierarchical convolution operations to generate a first-scale semantic feature tensor representing the target category; Step 1022: Establish a geometric gradient extraction path, which is used to extract pixel-level geometric boundary information through a first-order gradient operator while maintaining the original resolution of the tensor of the image to be processed, to generate a second-scale gradient feature tensor representing the edge features of the target.
[0031] Step 103: Input the tensor of the image to be processed into the semantic feature extraction path and the geometric gradient extraction path in parallel, and calculate the semantic feature tensor at the first scale and the gradient feature tensor at the second scale respectively, wherein the spatial resolution of the first scale is smaller than the spatial resolution of the second scale.
[0032] Step 104: Determine the response regions in the semantic feature tensor where the channel values are greater than the feature response threshold, and calculate the time-series heatmap vector based on the target historical coordinate vector; the process of calculating the time-series heatmap vector includes: Step 1041: Using the historical centroid determined by the target historical coordinate vector as a reference, construct a probability density distribution map that follows a Gaussian distribution in the two-dimensional coordinate space; Step 1042: Map the probability density distribution map to a pixel coordinate system consistent with the gradient feature tensor to obtain a time-series heatmap vector that reflects the prior distribution of the target position;
[0033] Step 105: Calculate the pixel product of the response region and the temporal heatmap vector, and perform binarization to generate a mask matrix for filtering non-target texture interference.
[0034] Step 106: Filter the gradient feature tensor using the mask matrix to generate target edge features;
[0035] Step 107: Calculate the non-zero element density of the gradient feature tensor to determine the global sparsity index, and dynamically adjust the fusion weight of the target edge features based on the global sparsity index.
[0036] Step 108: After weighting the target edge features, align them with the semantic feature tensor at multiple scales to generate a reconstructed feature tensor;
[0037] Step 109: Map the reconstructed feature tensor to the coordinate regression space and output the target's location coordinates; after outputting the target's location coordinates, feed the location coordinates back to step 101 as the target's historical coordinate vector for the next time step, and complete the continuous tracking and positioning of the moving target in the video stream.
[0038] Preferably, the process of generating the mask matrix in step 105 includes: step 1051, performing bilinear interpolation on the response region to make its spatial dimension consistent with the temporal heatmap vector; step 1052, calculating the product of the interpolated response region and the temporal heatmap vector at the corresponding pixel position, and generating the mask matrix using a preset discrimination criterion.
[0039] Preferably, the process of generating target edge features in step 106 includes: clearing the values at the positions corresponding to the zero elements of the mask matrix in the gradient feature tensor to retain the gradient information in the target candidate region indicated by the mask matrix and masking the high-frequency texture of the background.
[0040] Preferably, the process of generating the reconstructed feature tensor in step 108 includes: step 1081, upsampling the semantic feature tensor to restore its spatial resolution to be consistent with the target edge features; step 1082, concatenating the upsampled semantic feature tensor with the weighted target edge features in the channel dimension, and generating the fused reconstructed feature tensor by pixel-by-pixel convolution.
[0041] Preferably, for dynamic blur present in the tensor of the image to be processed, when the global sparsity index... When the quality degradation threshold is greater than the preset threshold, the fusion weight of the target edge features is reduced, and the information proportion of the semantic feature tensor in the reconstructed feature tensor is increased simultaneously.
[0042] Preferably, step 109 includes: step 1091, using pooling units to compress the spatial dimension of the reconstructed feature tensor and extracting the global feature vector; step 1092, inputting the global feature vector into the fully connected layer and outputting the positioning coordinates representing the center position coordinates and bounding box size of the target.
[0043] Example 1: When running a target localization method in an industrial continuous manufacturing visual quality inspection environment with high-frequency dynamic occlusion and background noise, the system continuously receives the tensor of the image to be processed captured by the industrial camera and the target historical coordinate vector generated in the previous time step. Deep learning models typically use cross-stride sampling or pooling dimensionality reduction operations when extracting the semantic representation of the target category. This data processing path causes the original spatial geometric gradient features of the image to collapse. When encountering local target occlusion or background texture interference, the regression subnetwork experiences localization coordinate drift due to the lack of pixel-level geometric anchor points. The feature extraction unit includes a semantic feature extraction path and a geometric gradient extraction path. The system inputs the tensor of the image to be processed into the semantic feature extraction path and the geometric gradient extraction path in parallel. The semantic feature extraction path extracts the contextual information of the tensor of the image to be processed through hierarchical convolution, generating a first-scale semantic feature tensor representing the target category. The geometric gradient extraction path extracts pixel-level geometric boundary information through a first-order gradient operator while maintaining the original resolution of the tensor of the image to be processed, generating a second-scale gradient feature tensor representing the target edge features. The first-scale spatial... For spatial resolutions smaller than the second scale, the system identifies response regions where the channel values in the semantic feature tensor exceed the feature response threshold. Using the historical centroid determined by the target's historical coordinate vector as a reference, a probability density distribution map following a Gaussian distribution is constructed in the two-dimensional coordinate space. This map is then mapped to the pixel coordinate system corresponding to the gradient feature tensor to obtain a temporal heatmap vector reflecting the prior distribution of the target location. The system performs bilinear interpolation on the response region to ensure its spatial dimension matches the temporal heatmap vector. The product of the interpolated response region and the temporal heatmap vector at the corresponding pixel position is calculated, generating a binary mask matrix. This mask matrix extracts the intersection of the semantic activation state and the temporal prior in the spatial dimension. The system clears the values at the positions corresponding to the zero elements of the mask matrix in the gradient feature tensor, retaining the gradient information within the target candidate region and generating target edge features. In this data flow path, the semantic feature tensor provides the spatial constraint region for the gradient feature tensor, and the purified target edge features provide the physical boundary features for feature fusion. When dynamic blurring in the manufacturing environment leads to image quality degradation, the system statistically analyzes the density of non-zero elements in the gradient feature tensor to determine the global sparsity index.
[0044] The system adjusts the fusion weights of target edge features based on a global sparsity index. When dynamic blurring in the tensor of the image to be processed causes the global sparsity index to exceed a preset quality degradation threshold, the system reduces the fusion weights of the target edge features and increases the fusion weights of the semantic feature tensor. The system upsamples the semantic feature tensor to make its spatial resolution consistent with that of the target edge features. The upsampled semantic feature tensor and the weighted target edge features are concatenated in the channel dimension. A reconstructed feature tensor is generated through pixel-wise convolution. During the above channel-dimensional concatenation operation, the system initiates a spatial cross-attention mapping process. The high spatial resolution target edge features are used as the query vector to perform linear projection. The key matrix generated by projecting the target edge features onto the semantic feature tensor is then multiplied in the spatial dimension to obtain the attention distribution weights. Subsequently, the weight matrix is used to perform pixel-level feature aggregation on the value matrix of the semantic feature tensor. The aggregated feature tensors are then fed into subsequent cascaded concatenation and convolution operations. The system calculates fusion parameters based on the global sparsity index, increasing the fusion dependence on semantic feature tensors in the state of sparse gradient features, and maintaining the continuity of coordinate tracking calculation. The system uses pooling units to compress and reconstruct the spatial dimension of the feature tensors, extracts global feature vectors, and inputs the global feature vectors into the fully connected layer to calculate and output positioning coordinates representing the target center position coordinates and bounding box size. These coordinates are then used as the target historical coordinate vectors for the next time step and fed back to the step of obtaining the image tensor to be processed, continuously outputting the position of moving targets in the video stream. The entire image data processing flow, through the decoupling extraction, gated purification, and dynamic weighted fusion of feature tensors, utilizes the deployed computing resources to transform coordinate regression calculation into a geometric feature matching process that includes gradient priors, providing a processing method that combines semantic category information and physical spatial gradient information.
[0045] Example 2: In an industrial surface defect visual inspection environment, the optical imaging system is subject to dynamic blur interference caused by mechanical vibration and material displacement. An experimental process is set up to measure the spatial coordinate tracking deviation of the target localization method under physical disturbance. A defect tracking dataset is used as the test source. Video frames with a resolution of 1920 x 1080 pixels are extracted. Gaussian white noise with a signal-to-noise ratio of 20.5 dB and motion blur kernels with lengths increasing from 3 to 15 pixels are superimposed on the video frame sequence to generate a verification image tensor sequence containing interference gradients. A quality degradation threshold is set. This method is used to establish a balance between gradient information fidelity and semantic coordinate drift tolerance, statistically verify the non-zero element density of the gradient feature tensor after superimposing blur kernels of different intensities on the image tensor, and obtain the global sparsity index under different perturbation conditions. The sequence processing unit parses the gradient feature tensor, counts the number of pixels whose absolute value exceeds the preset background noise tolerance, calculates the ratio of the number of pixels exceeding the preset background noise tolerance to the total number of pixels in the tensor, and outputs a global sparsity index with a value between 0 and 1. The preset background noise tolerance is determined by the system during the no-load calibration phase before the detection task starts. This is achieved by acquiring static pipeline background images without target occlusion, extracting the mean high-frequency response of the original texture, and superimposing a safety margin of three standard deviations to generate a fixed threshold parameter. Based on this, false edge pixels caused by mechanical vibration are accurately filtered out from the gradient feature tensor. The global sparsity index... Monotonically decreasing objectively represents the gradual loss of physical edge features of the target; the processing unit calculates and compares the global sparsity index in real time. When the value is below a preset quality degradation threshold, a state switching command is triggered, and a control signal is output to adjust the channel operator weights of the feature fusion module. Data shows that when the global sparsity index... When the value is less than 0.150, the root mean square error of the target center coordinates output by the regression network increases from 2.34 pixels to 7.85 pixels, exhibiting a non-linear degradation trend, indicating structural collapse of the geometric gradient. Based on this, a quality degradation threshold is set. The global sparsity index is 0.150. When the value is less than 0.150, a weight adjustment mechanism is triggered to reduce the coordinate calculation deviation caused by the lack of gradient information.
[0046] The verification image tensor sequences were input into three test architectures. The comparison group used a single cylindrical convolutional dimensionality reduction feature extraction network. The first control group used feature extraction units that included semantic feature extraction paths and geometric gradient extraction paths, cascaded in a fixed ratio, forming a partially missing control group. The present invention's sample group used a network based on global sparsity index. The feature extraction unit with dynamically adjusted weights inputs the initial target coordinates into each test architecture and initiates 100 frames of tracking and localization computation. It extracts the intermediate data and localization coordinates from each group's output. Under the condition that the blur kernel length is 3 pixels, the global sparsity index extracted by the sample group of this invention and the first control group is... The value is 0.285, which is greater than the quality degradation threshold of 0.150. After the target edge features of the sample group of the present invention and the first control group are filtered by the mask matrix, 86.5% of the target geometric contour pixels are retained. The center position error of the sample group is 3.12 pixels, the center position error of the first control group is 1.25 pixels, and the center position error of the sample group of the present invention is 1.18 pixels. This indicates that the dual-path extraction and mask matrix gating logic suppresses background noise and provides spatial geometric anchor points.
[0047] When the motion blur kernel length increases to 7 pixels and 11 pixels, the geometric texture of the verification image tensor is aliased. The global sparsity index measured in the sample group of this invention is... The values decreased to 0.124 and 0.076 respectively, both less than the quality degradation threshold of 0.150. The present invention's sample group reduced the fusion weight of target edge features and increased the fusion weight of semantic feature tensors. With a blur kernel length of 11 pixels, the center position error of the comparison sample group increased to 14.56 pixels. The first control group, due to maintaining a fixed fusion ratio of collapsed gradient features, had a center position error of 9.82 pixels. The center position error of the present invention's sample group converged to 4.21 pixels. When the blur kernel length increased to 15 pixels, the center position error of the present invention's sample group rose to 12.15 pixels, exhibiting a saturation degradation effect. Data comparison confirms that the present invention's sample group achieves better global sparsity index. A dynamic weighting mechanism is triggered when the value is less than 0.150 to reduce coordinate drift; experimental data validation is based on the global sparsity index. The mechanism of dynamically adjusting the feature fusion weights increases the proportion of semantic feature tensors in the state of sparse gradient features, suppressing the coordinate calculation deviation caused by dynamic blurring. This data processing mechanism adjusts the feature reconstruction path based on the prior geometric gradient of the image space and outputs the target positioning coordinates.
[0048] Example 3: This example combines Figures 1 to 2 This section describes a target localization method based on machine vision and deep learning, such as... Figure 1 As shown, step 101 obtains the tensor of the image to be processed and the historical coordinate vector of the target. Step 102 constructs a feature extraction unit containing a semantic feature extraction path and a geometric gradient extraction path. Step 103 inputs the tensor of the image to be processed into the semantic feature extraction path and the geometric gradient extraction path in parallel, and calculates the semantic feature tensor at the first scale and the gradient feature tensor at the second scale, respectively. The spatial resolution of the first scale is smaller than that of the second scale. Step 104 determines the response region in the semantic feature tensor where the value of each channel is greater than the feature response threshold, and calculates the time-series heatmap vector based on the historical coordinate vector of the target. Step 105 calculates... The product of the response region and the temporal heatmap vector is calculated and binarized to generate a mask matrix for filtering non-target texture interference. In step 106, the gradient feature tensor is filtered using the mask matrix to generate target edge features. In step 107, the density of non-zero elements of the gradient feature tensor is calculated to determine the global sparsity index. Based on the global sparsity index, the fusion weight of the target edge features is dynamically adjusted. In step 108, the target edge features are weighted and then aligned with the semantic feature tensor at multiple scales to generate a reconstructed feature tensor. Finally, in step 109, the reconstructed feature tensor is mapped to the coordinate regression space to output the target's location coordinates.
[0049] like Figure 2As shown, the generation process of the mask matrix is jointly completed by the semantic activation feature processing domain, the temporal prior processing domain, and the collaborative gating generation kernel. In the semantic activation feature processing domain, the semantic feature tensor, which serves as the first-scale abstract information, is input into the response region and a feature response threshold is determined. Spatial dimension consistency alignment is performed through bilinear interpolation. In the temporal prior processing domain, the target historical coordinate vector, which serves as the input quantity of the feedback loop, is used as the historical centroid to construct a Gaussian probability density distribution map. The map is then mapped to the pixel coordinate system to produce a temporal heatmap vector. In the collaborative gating generation kernel, the response region and the heatmap vector are multiplied at pixel points. The product judgment threshold is used to perform binarization processing and mapping, and finally, the mask matrix is output.
[0050] Example 4: In a continuous industrial manufacturing environment, fluctuations in ambient light and changes in target scale cause detection biases in semantic activation regions. The system extracts the mean pixel activation value of the semantic feature tensor at the first scale in the global spatial dimension. Standard deviation of pixel activation The system acquires the output voltage of the light intensity sensor. In actual hardware interaction, the sensor is connected to the main control hardware trigger bus via a high-speed analog-to-digital converter circuit. Its voltage sampling timing is hard-wired synchronized with the inter-frame gating shutter pulse of the industrial camera, so that the tensor of each captured image to be processed is physically bound to an effective voltage scalar reflecting the ambient light intensity level at the instantaneous exposure. The system then outputs the voltage... Calculate feature weight coefficients The calculation formula is: ,in, It is a dimensionless reference constant. The voltage adjustment coefficient is determined by the system based on the average pixel activation value. Pixel activation standard deviation With feature weight coefficients Determine the characteristic response threshold The calculation formula is: The system iterates through the semantic feature tensor and obtains channels whose values are greater than the feature response threshold. The set of pixel coordinates defines the response region. This feature extraction step updates the judgment benchmark synchronously with the external sensing signal based on the statistical distribution parameters of the current frame image data.
[0051] The system analyzes the target's historical coordinate vector, extracts the target's geometric centroid coordinates from the previous time step, constructs a two-dimensional zero matrix with spatial dimensions consistent with the semantic feature tensor of the first scale, and calculates a scaling factor based on the ratio of the spatial resolution of the first scale to the second scale. The system utilizes the scaling factor Mapping the target's geometric centroid coordinates determines the anchor pixel position in the two-dimensional zero matrix. The system uses the anchor pixel position as the desired center and the feature weight coefficients... The reciprocal of the product is used as the spatial variance to calculate the Gaussian probability density value at each pixel position in the two-dimensional zero matrix. The system establishes the two-dimensional zero matrix containing the Gaussian probability density values as the temporal heatmap vector. The system calculates the product of the feature value within the response region and the temporal heatmap vector at the corresponding pixel position. The system maps product values greater than the product judgment threshold to one, and product values less than or equal to the product judgment threshold to zero, and outputs the mask matrix; feature response threshold. The computational structure and the scaling factor-based The temporal heatmap vector construction model combines image statistical distribution with prior spatial coordinates to generate a mask matrix. This data processing flow converts the gating conditions of semantic feature tensors into tensor product and threshold comparison operations, maintaining the continuity of tensor data flow generated by target edge features.
[0052] Example 5: When deploying the target localization method in a new industrial vision inspection environment, the system initiates an offline calibration process to establish the linkage parameters between illumination intensity and the feature extraction network. A CNC guide rail drives a standard calibration board to move at a preset speed. A strobe light source is manipulated to generate an optical environment with illuminance increasing from 1000 lux to 5000 lux in 500 lux increments. The output voltage of the illumination intensity sensor at each gradient is then obtained. Simultaneously, a standard image tensor is captured, and the baseline pixel activation mean of the standard image tensor in the spatial dimension is extracted. Standard deviation of reference pixels Calculate the target edge feature localization deviation generated by the standard image tensor under different illumination gradients, and calibrate the critical output voltage when the root mean square error exceeds the preset tolerance boundary. The photoelectric effect linear response principle determines that the amplitude of the sensor's output electrical signal maintains a direct proportional mapping relationship with the received ambient photon flux within the effective dynamic range. The processing unit initiates the reference constant pre-calibration procedure to control the stroboscopic light source to output a standard test illuminance of 1000 lux, and the light intensity sensor at this time outputs a reference voltage. The processing unit simultaneously extracts the target edge features generated by the standard image tensor under the aforementioned standard test illumination, calculates the intersection-union ratio (IU / U) of the features with the pre-stored standard physical boundary, and extracts the dimensionless IU / U and performs scalar multiplication with the compensation factor 1.1 to obtain the dimensionless reference constant. The initial state of the external optical environment is transformed into a definite numerical reference point, based on the critical output voltage. Determine the voltage regulation coefficient The calculation formula is: ,in, It is a dimensionless reference constant. This is the preset minimum feature weight constant.
[0053] The processing unit will adjust the voltage regulation coefficient. The system writes a constant to a solid-state register as the initial constant for online computation, initiates the dynamic calculation of the characteristic response threshold and the mask matrix extraction process, and continuously monitors the real-time output voltage during operation. In conjunction with pixel activation features, the voltage adjustment coefficient in the solid-state register is used in each processing cycle. Calculate the current feature weight coefficients Synchronously update feature response threshold The calibration and parameter writing steps, while maintaining the network topology of the feature extraction unit, use the physical correspondence determined by offline testing to limit the floating range of the online feature tensor gating, so that the image data processing flow can output positioning coordinates based on the initial electrical parameters of the field sensing hardware when deployed across environments.
[0054] Example 6: In the case of the visual quality inspection system being adapted to manufacturing materials for the first time, changes in the reflectivity of the target material and the contrast of the background cause the mask matrix to over-segment the contours due to the product judgment threshold set based on empirical values. The processing unit introduces an offline parameter optimization process to establish a benchmark reference model for binarized boundary judgment, and obtains a benchmark image sequence containing 500 frames labeled with real target contours. A candidate threshold set is constructed in the dimensionless value range of 0.10 to 0.90 with a step size of 0.05. Feature values and time-series heatmap vectors in the response area of each benchmark image are extracted, and the product of the two at the corresponding pixel positions is calculated and a scalar product matrix is output. For each candidate threshold in the candidate threshold set... The processing unit will select candidates from the scalar product matrix whose values are greater than the candidate threshold. The element mapping is one, and synchronization will be less than or equal to the candidate threshold. If the element-mapping of a variable is zero, output the corresponding test mask matrix, where... The value is a dimensionless floating-point number. The processing unit calculates the intersection-union ratio (IUR) between each test mask matrix and the corresponding real target contour. The specific calculation logic is obtained by dividing the intersection pixel area by the union pixel area of the two. The processing unit traverses all intersection-union ratio indices according to the maximum value solution logic. Extract the specific candidate threshold corresponding to the highest mean, and write this specific candidate threshold into non-volatile memory as the product judgment threshold for the current material batch. The offline parameter optimization process reconstructs the gating decision boundary based on the quantitative test results of the offline dataset, and uses the maximization process of the intersection-union ratio index to eliminate the empirical dependence on the value, so that the system can output the mask matrix by relying on the mathematical optimization path when facing changes in the visual features of new materials.
[0055] When the system performs the step of generating reconstructed feature tensors, the processing unit bases its work on the global sparsity index. The fusion weights of the target edge features are established using a piecewise function. Fusion weights with semantic feature tensors The specific calculation logic is as follows: when the global sparsity index... Greater than or equal to the quality degradation threshold Set fusion weights at time Set the fusion weight to 0.8 synchronously The global sparsity index is 0.2. Less than the quality degradation threshold Set fusion weights at time With global sparsity index The reduction of linear decrease in synchronous setting of fusion weights Accordingly, the processing unit multiplies the target edge features and semantic feature tensors by their respective fusion weights and performs pixel-by-pixel addition to output the reconstructed feature tensor. The pooling unit performs global average pooling on the reconstructed feature tensor to extract the global feature vector of the channel dimension. The fully connected layer receives the global feature vector and uses the linear transformation relationship fixed in the neuron weight matrix to map the feature space to the four-dimensional coordinate space, outputting the positioning coordinates containing the x-coordinate of the target center point, the y-coordinate of the center point, the width of the bounding box, and the height of the bounding box. This process establishes a mapping path from the high-dimensional feature tensor to the low-dimensional geometric coordinates through quantized weight allocation and global pooling compression.
[0056] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.
[0057] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.
Claims
1. A target localization method based on machine vision and deep learning, characterized in that, include: Step 101: Obtain the tensor of the image to be processed and the historical coordinate vector of the target; Step 102: Construct a feature extraction unit that includes a semantic feature extraction path and a geometric gradient extraction path; The feature extraction unit process includes: step 1021, establishing a semantic feature extraction path, which is used to extract abstract context information of the tensor of the image to be processed through hierarchical convolution operations to generate a semantic feature tensor of the first scale representing the target category; step 1022, establishing a geometric gradient extraction path, which is used to extract pixel-level geometric boundary information through a first-order gradient operator while maintaining the original resolution of the tensor of the image to be processed, to generate a gradient feature tensor of the second scale representing the edge features of the target. Step 103: Input the tensor of the image to be processed into the semantic feature extraction path and the geometric gradient extraction path in parallel, and calculate the semantic feature tensor at the first scale and the gradient feature tensor at the second scale respectively, wherein the spatial resolution of the first scale is smaller than the spatial resolution of the second scale. Step 104: Determine the response regions in the semantic feature tensor where the channel values are greater than the feature response threshold, and calculate the time-series heatmap vector based on the target historical coordinate vector; the process of calculating the time-series heatmap vector includes: Step 1041: Using the historical centroid determined by the target historical coordinate vector as a reference, construct a probability density distribution map that follows a Gaussian distribution in the two-dimensional coordinate space; Step 1042: Map the probability density distribution map to a pixel coordinate system consistent with the gradient feature tensor to obtain a time-series heatmap vector that reflects the prior distribution of the target position; Step 105: Calculate the pixel product of the response region and the temporal heatmap vector, and perform binarization to generate a mask matrix for filtering non-target texture interference. Step 106: Filter the gradient feature tensor using the mask matrix to generate target edge features; Step 107: Calculate the non-zero element density of the gradient feature tensor to determine the global sparsity index, and dynamically adjust the fusion weight of the target edge features based on the global sparsity index. Step 108: After weighting the target edge features, align them with the semantic feature tensor at multiple scales to generate a reconstructed feature tensor; Step 109: Map the reconstructed feature tensor to the coordinate regression space and output the target's location coordinates; after outputting the target's location coordinates, feed the location coordinates back to step 101 as the target's historical coordinate vector for the next time step, and complete the continuous tracking and positioning of the moving target in the video stream.
2. The target localization method based on machine vision and deep learning according to claim 1, characterized in that, The process of generating the mask matrix in step 105 includes: step 1051, performing bilinear interpolation on the response region to make its spatial dimension consistent with the temporal heatmap vector; step 1052, calculating the product of the interpolated response region and the temporal heatmap vector at the corresponding pixel position, and generating the mask matrix using a preset discrimination criterion.
3. The target localization method based on machine vision and deep learning according to claim 1, characterized in that, The process of generating target edge features in step 106 includes: clearing the values at the positions corresponding to the zero elements of the mask matrix in the gradient feature tensor to retain the gradient information in the target candidate region indicated by the mask matrix and masking the high-frequency texture of the background.
4. The target localization method based on machine vision and deep learning according to claim 1, characterized in that, The process of generating the reconstructed feature tensor in step 108 includes: step 1081, upsampling the semantic feature tensor to restore its spatial resolution to be consistent with the target edge features; step 1082, concatenating the upsampled semantic feature tensor with the weighted target edge features in the channel dimension, and generating the fused reconstructed feature tensor by pixel-wise convolution.
5. The target localization method based on machine vision and deep learning according to claim 1, characterized in that, For dynamic blurring in the tensor of the image to be processed, when the global sparsity index When the quality degradation threshold is greater than the preset threshold, the fusion weight of the target edge features is reduced, and the information proportion of the semantic feature tensor in the reconstructed feature tensor is increased simultaneously.
6. The target localization method based on machine vision and deep learning according to claim 1, characterized in that, Step 109 includes: Step 1091, using pooling units to compress the spatial dimension of the reconstructed feature tensor and extract the global feature vector; Step 1092, inputting the global feature vector into the fully connected layer and outputting the positioning coordinates representing the center position coordinates and bounding box size of the target.