Target detection method and device based on artificial intelligence

By acquiring the optical characteristics of image data in object detection, pixel enhancement and Gaussian pyramid decomposition, combining attention mechanism and convolutional neural network, dynamically adjusting the weight of multi-scale and multi-direction components, the problems of changes in light conditions and low target detection rate in the existing technology are solved, and higher detection stability and accuracy are achieved.

CN119832214AInactive Publication Date: 2025-04-15SHANXI HONG AN XIANG TECH DEV CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411899803.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-23
Publication Date
2025-04-15
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The prior art has a great impact on object detection when dealing with scenes of changing light conditions. The detection rate of small targets in multi-scale feature extraction is relatively low. There is a problem of information redundancy or feature loss in multi-scale feature extraction. It fails to fully utilize the interactive characteristics between components for dynamic fusion, which makes it difficult to balance the detection model between details capture and global feature optimization, and reduces the flexible adaptability of object detection.

Method used

By acquiring image data and determining its optical characteristics, pixel enhancement and Gaussian pyramid decomposition are performed to generate image components of different scales. Use attention mechanism to dynamically adjust the weights of multi-scale and multi-directional components, and output three-dimensional feature maps based on convolutional neural networks. Build a regression header network and a classification header network to determine the candidate boxes, and perform filtering and security records.

Benefits of technology

The distinction between target and background is improved, the details of the image are enhanced, the image quality is effectively improved, and the goal distinction ability in complex environments is improved. The dynamic weighted computer system ensures the balance between high-frequency and low-frequency features, optimizes the integration of target details and background information, and improves the stability and accuracy of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119832214A_ABST
    Figure CN119832214A_ABST
Patent Text Reader

Abstract

The invention discloses a target detection method and device based on artificial intelligence, and relates to the technical field of artificial intelligence detection, and the method comprises the steps: collecting image data, determining the optical characteristics of the image data, and carrying out the quality screening according to the contrast; pixel enhancement is carried out based on the optical characteristics of the image data, Gaussian pyramid decomposition is carried out, and image components of different scales are generated; a feature map of a corresponding scale is determined based on the image components. According to the method, the distinction degree of the target and the background is improved through the characteristic difference between the brightness component and the background light, the details of the image are enhanced by combining the background light and the brightness component, the image quality in a complex environment is effectively improved, and the image quality is improved through the combination of the Gaussian pyramid and the wavelet decomposition. The multi-scale and multi-direction features of the target are effectively extracted, the target distinguishing capability in a complex scene is enhanced, and the balance of high-frequency and low-frequency features is ensured by a dynamic weight calculation mechanism.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence detection technology, and in particular to an artificial intelligence-based target detection method and device. Background Art

[0002] Object detection technology is an important research direction in the field of computer vision. Its core task is to identify the location and category of objects in images or videos through algorithms. With the rise of deep learning technology, object detection methods based on convolutional neural networks (CNNs) have been widely used and have significantly improved detection accuracy and speed.

[0003] However, the existing technology has a poor impact on target detection when dealing with scenes with changing lighting conditions, and the detection rate of small targets in multi-scale feature extraction is relatively low. Although improvements based on multi-scale feature extraction and directional enhancement have improved the detection effect to a certain extent, multi-scale feature extraction still has problems of information redundancy or feature loss, and fails to fully utilize the interaction characteristics between components for dynamic fusion, resulting in difficulty in balancing the detection model between detail capture and global feature optimization, reducing the flexible adaptation capability of target detection. Summary of the invention

[0004] In view of the above existing problems, the present invention is proposed.

[0005] Therefore, the present invention provides an artificial intelligence-based target detection method to solve the problems of the prior art in affecting target detection when dealing with scenes with changing lighting conditions and the low detection rate of small targets in multi-scale feature extraction. Although improvements based on multi-scale feature extraction and directional enhancement have improved the detection effect to a certain extent, multi-scale feature extraction still has problems of information redundancy or feature loss, and fails to fully utilize the interaction characteristics between components for dynamic fusion, resulting in difficulty in balancing the detection model between detail capture and global feature optimization, reducing the flexible adaptability of target detection.

[0006] In order to solve the above technical problems, the present invention provides the following technical solutions:

[0007] In a first aspect, the present invention provides a target detection method based on artificial intelligence, which comprises:

[0008] Collect image data and determine the optical characteristics of the image data, and perform quality screening based on contrast;

[0009] Perform pixel enhancement based on the optical properties of image data and perform Gaussian pyramid decomposition to generate image components of different scales;

[0010] Determine the feature map of the corresponding scale based on the image components, use the attention mechanism to dynamically adjust the weights of the multi-scale and multi-directional components, and output the three-dimensional feature map based on the convolutional neural network;

[0011] Build a regression head network and a classification head network to determine the candidate boxes, and output a set of filtered candidate boxes;

[0012] The target frame of the image is restored based on the candidate frame, and the target frame set data is securely recorded.

[0013] As a preferred solution of the target detection method based on artificial intelligence of the present invention, the step of collecting image data and determining the optical characteristics of the image data and performing quality screening according to contrast comprises:

[0014] The camera collects image data based on different light intensities, including high light, low light and backlight fiber environments, and different natural light adjustments at different times, including daytime, dusk and night;

[0015] Based on the collected image data, a multi-spectral camera is used to collect the spectral information of the target, which is decomposed into three parts: infrared, visible light and ultraviolet light;

[0016] The spectral data is converted into brightness intensity component data and background light component data as the optical characteristic annotation information of the image data, which is expressed as:

[0017]

[0018] Lb(x,y)=I mean (x,y);

[0019] Where L s (x,y) represents the brightness intensity component of the pixel (x,y), I max (x,y) represents the maximum intensity value of the pixel (x,y), I mean (x,y) represents the average intensity value of the pixel (x,y), I std (x, y) represents the standard deviation intensity value of the pixel (x, y), L b (x,y) represents the background light component of the pixel (x,y);

[0020] Quality screening is performed based on the contrast of the image data. Based on the historical contrast threshold, if the contrast of the acquired image data is less than the contrast threshold, it is judged to be of low quality and the corresponding image data is discarded.

[0021] As a preferred solution of the target detection method based on artificial intelligence of the present invention, the pixel enhancement based on the optical characteristics of the image data and the Gaussian pyramid decomposition to generate image components of different scales include:

[0022] Based on the collected image data, each pixel is enhanced using an optical physics modeling formula, which is expressed as:

[0023]

[0024] Where I'(x,y) and I(x,y) represent the processed pixel data and pixel data of the pixel point (x,y) respectively, and ∈ represents a very small constant;

[0025] Determine the minimum feature size based on historical data, and decompose based on the resolution of the acquired image data to determine the maximum number of decomposition layers S;

[0026] The processed pixel data is decomposed into Gaussian pyramids to generate image components of different scales, which are expressed as:

[0027] I s (x,y)=G s *I'(x,y);

[0028] Among them I s (x, y) represents the image component of the processed pixel data of the pixel point (x, y) at the sth level scale, G s represents the Gaussian kernel function of the s-th layer scale;

[0029] Using Gaussian pyramid component I s (x, y), use two-dimensional discrete wavelet transform to perform wavelet decomposition on each layer, calculate the component data and residuals in the horizontal, vertical and diagonal directions respectively, and generate frequency domain characteristic components based on the components and residuals;

[0030] The directional weight is calculated based on the variance of the component, the low-frequency weight is calculated based on the global component strength, and the components W in different directions are calculated according to the corresponding directional weight and low-frequency weight. d (x,y) and R s (x, y) performs hierarchical feature enhancement, expressed as:

[0031] W' d (x,y)=a d ·W d (x,y);

[0032] R' s (x,y)=β s ·R s (x,y);

[0033]

[0034]

[0035] Where W' d (x,y) and R' s (x, y) represent the directional component of the dth direction of feature enhancement and the low-frequency component at scale s, respectively. Var(W d ) indicates W d The variance of (x,y), max(R s ) represents R s The maximum value of (x,y), sum(R s ) represents R s The sum of (x,y), a d and β s They represent the directional weight in the dth direction and the low-frequency weight at the current scale s respectively.

[0036] As a preferred solution of the target detection method based on artificial intelligence of the present invention, wherein: the feature map of corresponding scale is determined based on the image component, the weights of multi-scale and multi-directional components are dynamically adjusted using the attention mechanism, and the three-dimensional feature map is output based on the convolutional neural network, including:

[0037] Based on the high-frequency feature value of the local image of each pixel in different directional components in that direction as the feature map of the corresponding direction, global average pooling is performed to calculate the importance score, which is expressed as:

[0038]

[0039]

[0040] A s,d represents the importance score of the directional component at scale s, H·W represents the total number of pixels in the corresponding directional feature map, and B s represents the importance score of the low-frequency residual at scale s;

[0041] The attention mechanism is used to dynamically adjust the weights of multi-scale and multi-directional components and perform dynamic fusion, which can be expressed as:

[0042]

[0043] where F f (x, y) represents the fusion features of all scales and directions of the pixel point (x, y), S and D represent the maximum number of scales and directions respectively, r s,d represents the directional component weight, δ s represents the low-frequency residual weight;

[0044] Convolutional model based on convolutional neural network for F f (x, y) performs convolution calculation, including input layer, convolution layer and output layer;

[0045] Use the training set to train the model, select the cross entropy loss function to calculate the difference between the convolution model output and the actual label, use the Adam optimizer to perform gradient descent optimization, update the parameters of the convolution model, and stop iterating if the model loss no longer decreases significantly during continuous iterations;

[0046] The calculated F f (x,y) input convolution model, output 3D feature map

[0047] As a preferred solution of the artificial intelligence-based object detection method of the present invention, wherein: the step of constructing a regression head network and a classification head network to determine candidate boxes and outputting a screened candidate box set includes:

[0048] Based on 3D feature map Output the initial anchor point box for each pixel point;

[0049] Based on the object of image target monitoring, the size of the anchor box is preset according to historical data, and the anchor box is applied to each pixel of the feature map according to the scale k and aspect ratio r of the anchor box to generate the anchor box, which is expressed as:

[0050]

[0051]

[0052]

[0053] in represents the ath anchor box, x a and a Respectively represent the center coordinates of the ath anchor box, and represent the pixel points located in the feature map. and Respectively represent the width and height of the a-th anchor box, W in and H in Respectively represent the width and height of the input original image;

[0054] Traverse each pixel in the feature map and generate a set of anchor boxes of all combinations;

[0055] The regression head network includes input layer, convolution layer and output layer. The input layer inputs the three-dimensional feature map. The convolution layer performs convolution operation through the ReLU activation function, and predicts the predicted offset of each pixel point for the center coordinates, width and height corresponding to the anchor box through the output layer;

[0056] Use the training data to train the regression head network, select the Smooth L1 loss function to calculate the difference between the offset predicted by the regression head network and the actual label, use the Adam optimizer to perform gradient descent optimization, update the parameters of the regression head network, and stop iterating if the loss of the model no longer decreases significantly during continuous iterations;

[0057] enter The predicted offset of each anchor box is output through the regression head network prediction;

[0058] The classification head network includes input layer, convolution layer and output layer. The input layer inputs the three-dimensional feature map. The convolution layer performs convolution operation through the Softmax activation function, and predicts the number of categories of the target corresponding to each pixel through the output layer;

[0059] Use the training data to train the classification head network, select the cross entropy loss function to calculate the difference between the category probability predicted by the classification head network and the actual label, use the Adam optimizer to perform gradient descent optimization, update the parameters of the classification head network, and stop iterating if the model loss no longer decreases significantly during continuous iterations;

[0060] Input-based The classification head network outputs the probability of each anchor box corresponding to the category, and selects the highest probability category as the output;

[0061] Use the verification data to record the candidate boxes for the image data in the verification set, including the candidate box coordinate information, category label and highest confidence, and draw a precision-recall PR curve chart, and select the inflection point as the final confidence threshold;

[0062] The anchor box corresponding to the category probability higher than the confidence threshold is taken as the candidate box, and the non-maximum suppression NMS calculation is performed. According to the candidate box set of each category, the intersection and union ratio Iou of each candidate box and other candidate boxes is calculated, and the sum of the historical mean and standard deviation is used as the suppression threshold. If the calculated intersection and union ratio is less than the suppression threshold, the corresponding candidate box is proposed, and the filtered candidate box set is output.

[0063] As a preferred solution of the target detection method based on artificial intelligence of the present invention, wherein: the target frame of the image restored based on the candidate frame includes:

[0064] Based on the candidate box set, restore according to the relative coordinates of the candidate box and restore the input to the original input image coordinate system as the target box;

[0065] Determine the coordinates of the four vertices of the target box according to the center point coordinates and width and height data, and combine all target boxes into an output set;

[0066] The target box set is sorted in descending order of confidence, and the number of target box outputs is limited based on detection requirements.

[0067] As a preferred solution of the target detection method based on artificial intelligence of the present invention, the step of securely recording the target frame set data includes:

[0068] The target frame set data is securely transmitted via the TLS protocol;

[0069] Generate a hash value of the target frame data and attach a signature, and verify the hash value at the receiving end to perform data verification;

[0070] The verified data is stored in the database and distributed and classified by timestamp and target category, and regular data backup is performed.

[0071] In a second aspect, the present invention provides an artificial intelligence-based target detection device, comprising:

[0072] The quality screening module is responsible for collecting image data and performing quality screening to provide high-quality input for subsequent processing;

[0073] The feature extraction module performs pixel enhancement, feature extraction and component processing on the collected high-quality image data to generate optimized multi-scale features;

[0074] The 3D feature generation module uses a convolutional neural network (CNN) to generate 3D feature maps based on dynamically fused multi-scale feature maps.

[0075] The candidate box screening module uses the regression head network and the classification head network to process the 3D feature map, generate candidate boxes and screen them;

[0076] The target box restoration module restores the filtered candidate box from relative coordinates to the original input image coordinates and calculates the vertex coordinates of the target box;

[0077] The secure transmission module performs secure transmission, verification and storage management of target frame data.

[0078] In a third aspect, the present invention provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: when the computer program is executed by the processor, any step of the artificial intelligence-based target detection method as described in the first aspect of the present invention is implemented.

[0079] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein: when the computer program is executed by a processor, it implements any step of the artificial intelligence-based target detection method as described in the first aspect of the present invention.

[0080] The beneficial effects of the present invention are as follows: by using the characteristic difference of the brightness component and the background light, the discrimination between the target and the background is improved; by combining the background light and the brightness intensity component, the details of the image are enhanced, and the image quality in a complex environment is effectively improved; by combining the Gaussian pyramid and the wavelet decomposition, the multi-scale and multi-directional features of the target are effectively extracted, and the target discrimination capability in complex scenes is enhanced; the dynamic weight calculation mechanism ensures the balance between high-frequency and low-frequency features, and optimizes the fusion of target details and background information; through the GAP, the attention mechanism and the dynamic fusion, the multi-scale and multi-directional feature information of the image is effectively optimized, and it adapts to complex light environments and multi-target size scenes, and improves the stability and accuracy of detection; from the dynamic fusion of the feature map to the feature enhancement of the convolution model, the performance of the detection task is comprehensively improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0081] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.

[0082] Figure 1 Schematic diagram of the process of the target detection method based on artificial intelligence in Example 1.

[0083] Figure 2 Schematic diagram of the structure of the target detection device based on artificial intelligence in Example 1. DETAILED DESCRIPTION

[0084] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the accompanying drawings.

[0085] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.

[0086] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The term "in one embodiment" that appears in different places in this specification does not necessarily refer to the same embodiment, nor does it refer to a separate or selective embodiment that is mutually exclusive with other embodiments.

[0087] Example 1, reference Figure 1 and Figure 2, which is the first embodiment of the present invention, and provides a target detection method based on artificial intelligence, comprising the following steps:

[0088] S1, collect image data and determine the optical characteristics of the image data, and perform quality screening based on contrast;

[0089] Preferably, collecting image data and determining optical characteristics of the image data, and performing quality screening based on contrast, comprises,

[0090] The camera collects image data based on different light intensities, including high light, low light and backlight fiber environments, and different natural light adjustments at different times, including daytime, dusk and night;

[0091] Based on the collected image data, a multi-spectral camera is used to collect the spectral information of the target, which is decomposed into three parts: infrared, visible light and ultraviolet light;

[0092] The spectral data is converted into brightness intensity component data and background light component data as the optical characteristic annotation information of the image data, which is expressed as:

[0093]

[0094] L b (x,y)=I mean (x,y);

[0095] Where L s (x, y) represents the brightness intensity component of the pixel (x, y), I max (x,y) represents the maximum intensity value of the pixel (x,y), I mean (x,y) represents the average intensity value of the pixel (x,y), I std (x, y) represents the standard deviation intensity value of the pixel (x, y), L b (x,y) represents the background light component of the pixel (x,y);

[0096] Quality screening is performed based on the contrast of the image data. Based on the historical contrast threshold, if the contrast of the acquired image data is less than the contrast threshold, it is judged to be of low quality and the corresponding image data is discarded.

[0097] By collecting images with different light intensities and natural light conditions at different times, the model's adaptability to diverse lighting environments can be significantly improved, and the accuracy and stability of target detection under complex lighting conditions can be improved. When visible light is limited, infrared and ultraviolet spectral data can supplement information to enhance target detection capabilities. The spectral data is converted into brightness intensity components and background light components, so that the brightness characteristics of each pixel are clearly quantified. The difference in the characteristics of the brightness component and the background light can improve the distinction between the target and the background. The contrast threshold is used to eliminate low-quality image data to ensure that the images used for training and reasoning have sufficient clarity and effective information.

[0098] S2, pixel enhancement based on the optical properties of the image data, Gaussian pyramid decomposition, and generation of image components of different scales;

[0099] Preferably, pixel enhancement is performed based on the optical characteristics of the image data, and Gaussian pyramid decomposition is performed to generate image components of different scales, including:

[0100] Based on the collected image data, each pixel is enhanced using an optical physics modeling formula, which is expressed as:

[0101]

[0102] Where I'(x,y) and I(x,y) represent the processed pixel data and pixel data of the pixel point (x,y) respectively, and ∈ represents a very small constant (to prevent division by 0);

[0103] The minimum feature size is determined based on historical data, and the maximum number of decomposition layers is determined based on the resolution of the acquired image data, expressed as:

[0104]

[0105] Where S represents the maximum number of decomposition layers, MD represents the minimum number of pixels in the vertical direction of the acquired image data (for a 1920×1080 image, MD is 1080), and MFS represents the minimum feature size;

[0106] The processed pixel data is decomposed into Gaussian pyramids to generate image components of different scales, which are expressed as:

[0107] I s (x,y)=G s *I'(x,y);

[0108] Among them I s (x, y) represents the image component of the processed pixel data of the pixel point (x, y) at the sth level scale, G s represents the Gaussian kernel function of the s-th layer scale;

[0109] Using Gaussian pyramid component I s (x, y), use two-dimensional discrete wavelet transform to perform wavelet decomposition on each layer, calculate the component data and residuals in the horizontal, vertical and diagonal directions respectively, and generate frequency domain characteristic components based on the components and residuals, expressed as:

[0110]

[0111]

[0112]

[0113] Among them I s (x, y) represents the input image component, D represents the total number of three directions, and W d (x,y) and R s (x, y) respectively represent the component data in the dth direction and the low-frequency component at the current scale s, I s (m,n) represents the pixel value of the input image component at the sth layer, ψ d (x,y) represents the Daubechies wavelet basis function, which is used to calculate the directional component in the dth direction. represents the wavelet scaling function;

[0114] The directional weight is calculated based on the variance of the component, the low-frequency weight is calculated based on the global component strength, and the components W in different directions are calculated according to the corresponding directional weight and low-frequency weight. d (x,y) and R s (x, y) performs hierarchical feature enhancement, expressed as:

[0115] W' d (x,y)=a d ·W d (x,y);

[0116] R' s (x,y)=β s ·R s (x,y);

[0117]

[0118]

[0119] Where W' d (x,y) and R' s (x, y) represent the directional component of the dth direction of feature enhancement and the low-frequency component at scale s, respectively. Var(W d ) indicates W d The variance of (x,y), max(Rs ) represents R s The maximum value of (x,y), sum(R s ) represents R s The sum of (x,y), a d and β s They represent the directional weight in the dth direction and the low-frequency weight at the current scale s respectively.

[0120] By combining the background light and brightness intensity components, the bright and dark details of the image are enhanced, while avoiding overexposure or overdarkness, effectively improving the image quality in complex environments. By dynamically adjusting the brightness component, the robustness of the model in low-light and high-light scenes is enhanced. The maximum number of decomposition layers is dynamically determined according to the minimum feature size and image resolution, and data sets of different resolutions are adapted. The components of the image at different scales are obtained through Gaussian pyramid decomposition, which facilitates the detection and feature extraction of multi-scale targets. The multi-scale component decomposition enhances the adaptability to different target sizes and complex scenes. The Daubechies wavelet basis function and scale function are used to calculate the directional component and low-frequency residual , convert the image to the frequency domain for processing, retain more detailed characteristics of the target, calculate the directional component weight based on the variance, enhance the local high-frequency texture and directional characteristics, and highlight the target details. The low-frequency weight adjustment based on the global intensity optimizes the retention of background information and the improvement of contrast. The combination of Gaussian pyramid and wavelet decomposition effectively extracts the multi-scale and multi-directional characteristics of the target and enhances the target distinction ability in complex scenes. The dynamic weight calculation mechanism ensures the balance between high-frequency and low-frequency features and optimizes the fusion of target details and background information. The dynamic decomposition layer and the calculation of the enhanced weight make the scheme adaptable to scenes with different resolutions and different target sizes.

[0121] S3, determines the feature map of the corresponding scale based on the image component, uses the attention mechanism to dynamically adjust the weights of the multi-scale and multi-directional components, and outputs the three-dimensional feature map based on the convolutional neural network;

[0122] Preferably, a feature map of corresponding scale is determined based on image components, the weights of multi-scale and multi-directional components are dynamically adjusted using an attention mechanism, and a three-dimensional feature map is output based on a convolutional neural network, including:

[0123] Based on the high-frequency feature value of the local image of each pixel in different directional components in that direction as the feature map of the corresponding direction, global average pooling is performed to calculate the importance score, which is expressed as:

[0124]

[0125]

[0126] A s,drepresents the importance score of the directional component at scale s, H·W represents the total number of pixels in the corresponding directional feature map, and B s represents the importance score of the low-frequency residual at scale s;

[0127] The attention mechanism is used to dynamically adjust the weights of multi-scale and multi-directional components and perform dynamic fusion, which can be expressed as:

[0128]

[0129]

[0130]

[0131] where F f (x, y) represents the fusion features of all scales and directions of the pixel point (x, y), S and D represent the maximum number of scales and directions respectively, r s,d represents the directional component weight, δ s represents the low-frequency residual weight, ∑ s,d exp(A s,d ) represents the score exp(A) for all scales s and directions d s,d ) to sum, ∑ s exp(B s ) represents the score exp(B s ) to perform summation;

[0132] Convolutional model based on convolutional neural network for F f (x, y) performs convolution calculation, including input layer, convolution layer and output layer;

[0133] The input layer input F f (x, y), use the convolution layer to perform convolution operation on the input features, perform two layers of convolution through the ReLU activation function to enhance the features, output the number of channels C respectively, and output the three-dimensional feature map through the output layer

[0134] Use the training set to train the model, select the cross entropy loss function to calculate the difference between the convolution model output and the actual label, use the Adam optimizer to perform gradient descent optimization, update the parameters of the convolution model, and stop iterating if the model loss no longer decreases significantly during continuous iterations;

[0135] The calculated F f (x,y) input convolution model, output 3D feature map

[0136] The global feature information of each direction and scale is aggregated through the global average pooling calculation method, which avoids the randomness of single pixel values ​​and provides quantitative indicators of the importance of components in different directions, which is convenient for subsequent weight allocation. The extraction of local high-frequency features highlights the detailed texture characteristics of the image and can better retain the target features in scenes with noise interference or complex backgrounds. The dynamic weight allocation mechanism automatically adjusts the proportion of each directional component and low-frequency residual in the fused feature according to its contribution. The multi-scale features capture the information of targets of different sizes, and the multi-directional components highlight different edge and texture directions. Through GAP, attention mechanism and dynamic fusion, the multi-scale and multi-directional feature information of the image is effectively optimized to adapt to complex lighting environments and multi-target size scenes, improve the stability and accuracy of detection, and comprehensively improve the performance of detection tasks from dynamic fusion of feature maps to feature enhancement of convolutional models.

[0137] S4, build a regression head network and a classification head network to determine the candidate boxes, and output the screened candidate box set;

[0138] Preferably, a regression head network and a classification head network are constructed to determine candidate boxes, and a set of screened candidate boxes is output, including:

[0139] Based on 3D feature map Output the initial anchor point box for each pixel point;

[0140] Based on the object of image target monitoring, the size of the anchor box is preset according to historical data, and the anchor box is applied to each pixel of the feature map according to the scale k and aspect ratio r of the anchor box to generate the anchor box, which is expressed as:

[0141]

[0142]

[0143]

[0144] in represents the ath anchor box, x a and a Respectively represent the center coordinates of the ath anchor box, and represent the pixel points located in the feature map. and Respectively represent the width and height of the a-th anchor box, W in and H in Respectively represent the width and height of the input original image;

[0145] Traverse each pixel in the feature map and generate a set of anchor boxes of all combinations;

[0146] The regression head network includes input layer, convolution layer and output layer. The input layer inputs the three-dimensional feature map. The convolution layer performs convolution operation through the ReLU activation function, and predicts the predicted offset of each pixel point for the center coordinates and width and height corresponding to the anchor box through the output layer;

[0147] Use the training data to train the regression head network, select the Smooth L1 loss function to calculate the difference between the offset predicted by the regression head network and the actual label, use the Adam optimizer to perform gradient descent optimization, update the parameters of the regression head network, and stop iterating if the loss of the model no longer decreases significantly during continuous iterations;

[0148] enter The predicted offset of each anchor box is output through the regression head network prediction;

[0149] The classification head network includes input layer, convolution layer and output layer. The input layer inputs the three-dimensional feature map. The convolution layer performs convolution operation through the Softmax activation function, and predicts the number of categories of the target corresponding to each pixel through the output layer;

[0150] Use the training data to train the classification head network, select the cross entropy loss function to calculate the difference between the category probability predicted by the classification head network and the actual label, use the Adam optimizer to perform gradient descent optimization, update the parameters of the classification head network, and stop iterating if the model loss no longer decreases significantly during continuous iterations;

[0151] Input-based The classification head network outputs the probability of each anchor box corresponding to the category, and selects the highest probability category as the output;

[0152] Use the verification data to record the candidate boxes for the image data in the verification set, including the candidate box coordinate information, category label and highest confidence, and draw a precision-recall PR curve chart, and select the inflection point as the final confidence threshold;

[0153] The anchor box corresponding to the category probability higher than the confidence threshold is taken as the candidate box, and the non-maximum suppression NMS calculation is performed. According to the candidate box set of each category, the intersection and union ratio Iou of each candidate box and other candidate boxes is calculated, and the sum of the historical mean and standard deviation is used as the suppression threshold. If the calculated intersection and union ratio is less than the suppression threshold, the corresponding candidate box is proposed, and the filtered candidate box set is output.

[0154] Through the combination of anchor boxes with multi-scale k and multi-aspect ratio r, the initial box is ensured to cover all possible target sizes and shapes. The center of each anchor box is aligned with the pixel point of the feature map to ensure that the feature map information can effectively support the regression and classification of the box. The size and proportion of the anchor box are optimized in combination with historical data, which improves the adaptability to different scenes and targets. Through confidence threshold screening, the reliability of candidate boxes is improved and the interference of irrelevant boxes is reduced. The regression head combines the semantic and spatial information of the three-dimensional feature map to adapt to targets of different sizes, shapes and positions. The classification head learns the semantic features of the target through the three-dimensional feature map and can accurately predict the category of the target. The center of the anchor box is aligned with the pixel point of the feature map to ensure that the optimization effect of the feature map information on the box is maximized. The synergy of the regression head and the classification head further optimizes the positioning and classification of target detection. The combination of multi-light and multi-spectral information and dynamic weight adjustment improves the adaptability of the model to complex environments (such as low light, backlight, and occlusion). From data collection to candidate box screening, the process design logic is clear, the modules are efficiently connected, redundant calculations are reduced, and the overall detection efficiency is improved.

[0155] S5, restoring the target frame of the image based on the candidate frame, and securely recording the target frame set data;

[0156] Preferably, restoring the target frame of the image based on the candidate frame includes:

[0157] Based on the candidate box set, restore according to the relative coordinates of the candidate box and restore the input to the original input image coordinate system as the target box;

[0158] Determine the coordinates of the four vertices of the target box according to the center point coordinates and width and height data, and combine all target boxes into an output set;

[0159] The target box set is sorted in descending order of confidence, and the number of target box outputs is limited based on detection requirements.

[0160] By restoring the candidate box to the original image coordinates, the consistency of the detection result with the input image space is ensured, laying the foundation for visualization and subsequent processing (such as instance segmentation). The relative coordinates of the candidate box on the feature map are restored and mapped to the original image coordinates to accurately reflect the actual position of the target in the original image. Through proportional mapping, it adapts to input images of different resolutions to ensure the versatility of the solution. The four boundaries of the target box are accurately calculated using the center point and width and height data to reduce the positioning error caused by coordinate deviation. Through confidence sorting and output quantity limitation, high-quality target boxes are ensured to be output first, while reducing useless information.

[0161] Furthermore, the target frame set data is securely recorded, including:

[0162] The target frame set data is securely transmitted via the TLS protocol;

[0163] Generate a hash value of the target frame data and attach a signature, and verify the hash value at the receiving end to perform data verification;

[0164] The verified data is stored in the database and distributed and classified by timestamp and target category, and regular data backup is performed.

[0165] TLS provides encryption protection for data to prevent sensitive target detection information during transmission. The TLS protocol uses message authentication codes and stores data by timestamp and category, allowing users to quickly locate detection data for a specific time period or target category, improving query efficiency. Regular data backup effectively prevents data loss due to hardware failure or system crash, improves the system's disaster recovery capabilities, and classified storage facilitates fast query and efficient management, providing a reliable foundation for the analysis and utilization of large-scale data.

[0166] This embodiment also provides an artificial intelligence-based target detection device, including:

[0167] The quality screening module is responsible for collecting image data and performing quality screening to provide high-quality input for subsequent processing;

[0168] The feature extraction module performs pixel enhancement, feature extraction and component processing on the collected high-quality image data to generate optimized multi-scale features;

[0169] The 3D feature generation module uses a convolutional neural network (CNN) to generate 3D feature maps based on dynamically fused multi-scale feature maps.

[0170] The candidate box screening module uses the regression head network and the classification head network to process the 3D feature map, generate candidate boxes and screen them;

[0171] The target box restoration module restores the filtered candidate box from relative coordinates to the original input image coordinates and calculates the vertex coordinates of the target box;

[0172] The secure transmission module performs secure transmission, verification and storage management of target frame data.

[0173] This embodiment also provides a computer device, which is suitable for the case of an artificial intelligence-based target detection method, including: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute computer-executable instructions to implement the artificial intelligence-based target detection method proposed in the above embodiment.

[0174] The computer device may be a terminal, and the computer device includes a processor, a memory, a communication interface, a display screen and an input device connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. The display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device may be a touch layer covering the display screen, or a key, trackball or touchpad provided on the housing of the computer device, or an external keyboard, touchpad or mouse, etc.

[0175] This embodiment also provides a storage medium on which a computer program is stored. When the program is executed by a processor, the target detection method based on artificial intelligence as proposed in the above embodiment is implemented; the storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (Static Random Access Memory, referred to as SRAM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, referred to as EEPROM), erasable programmable read-only memory (Erasable Programmable Read Only Memory, referred to as EPROM), programmable read-only memory (Programmable Red-Only Memory, referred to as PROM), read-only memory (Read-Only Memory, referred to as ROM), magnetic storage, flash memory, disk or optical disk.

[0176] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.

Claims

1. An artificial intelligence-based target detection method, characterized in that: include: Collect image data and determine the optical characteristics of the image data, and perform quality screening based on contrast; Perform pixel enhancement based on the optical properties of image data and perform Gaussian pyramid decomposition to generate image components of different scales; Determine the feature map of the corresponding scale based on the image components, use the attention mechanism to dynamically adjust the weights of the multi-scale and multi-directional components, and output the three-dimensional feature map based on the convolutional neural network; Build a regression head network and a classification head network to determine the candidate boxes, and output a set of filtered candidate boxes; The target frame of the image is restored based on the candidate frame, and the target frame set data is securely recorded.

2. The target detection method based on artificial intelligence according to claim 1, characterized in that: The collecting of image data and determining the optical characteristics of the image data, and performing quality screening according to contrast, comprises: The camera collects image data based on different light intensities, including high light, low light and backlight fiber environments, and different natural light adjustments at different times, including daytime, dusk and night; Based on the collected image data, a multi-spectral camera is used to collect the spectral information of the target, which is decomposed into three parts: infrared, visible light and ultraviolet light; The spectral data is converted into brightness intensity component data and background light component data as the optical characteristic annotation information of the image data, which is expressed as: Lb(x,y)=Imean(x,y); Where Ls(x,y) represents the brightness intensity component of the pixel (x,y), Imax(x,y) represents the maximum intensity value of the pixel (x,y), Imean(x,y) represents the average intensity value of the pixel (x,y), Istd(x,y) represents the standard deviation intensity value of the pixel (x,y), and Lb(x,y) represents the background light component of the pixel (x,y); Quality screening is performed based on the contrast of the image data. Based on the historical contrast threshold, if the contrast of the acquired image data is less than the contrast threshold, it is judged to be of low quality and the corresponding image data is discarded.

3. The target detection method based on artificial intelligence as claimed in claim 2, characterized in that: The pixel enhancement based on the optical characteristics of the image data and the Gaussian pyramid decomposition are performed to generate image components of different scales, including: Based on the collected image data, each pixel is enhanced using an optical physics modeling formula, which is expressed as: Where I'(x,y) and I(x,y) represent the processed pixel data and pixel data of the pixel point (x,y) respectively, and ∈ represents a very small constant; Determine the minimum feature size based on historical data, and decompose based on the resolution of the acquired image data to determine the maximum number of decomposition layers S; The processed pixel data is decomposed into Gaussian pyramids to generate image components of different scales, which are expressed as: Is(x,y)=Gs*I'(x,y); Where Is(x,y) represents the image component of the processed pixel data of the pixel point (x,y) at the s-th scale, and Gs represents the Gaussian kernel function at the s-th scale; Using the Gaussian pyramid component Is(x,y), two-dimensional discrete wavelet transform is used to perform wavelet decomposition on each layer, and the component data and residuals in the horizontal, vertical and diagonal directions are calculated respectively, and the frequency domain characteristic components are generated based on the components and residuals; The directional weight is calculated based on the variance of the component, the low-frequency weight is calculated based on the global component strength, and the hierarchical feature enhancement is performed on the components Wd(x, y) and Rs(x, y) in different directions according to the corresponding directional weight and low-frequency weight, which is expressed as: W'd(x,y)=ad·Wd(x,y); R's(x,y)=βs·Rs(x,y); Where W'd(x,y) and R's(x,y) represent the directional component of the d-th direction of feature enhancement and the low-frequency component at scale s, respectively. Var(Wd) represents the variance of Wd(x,y). max(Rs) represents the maximum value of Rs(x,y). sum(Rs) represents the sum of Rs(x,y). ad and βs represent the directional weight in the d-th direction and the low-frequency weight at the current scale s, respectively.

4. The method for target detection based on artificial intelligence as claimed in claim 3, characterized in that: The method of determining a feature map of a corresponding scale based on image components, dynamically adjusting weights of multi-scale and multi-directional components using an attention mechanism, and outputting a three-dimensional feature map based on a convolutional neural network includes: Based on the high-frequency feature value of the local image of each pixel in different directional components in that direction as the feature map of the corresponding direction, global average pooling is performed to calculate the importance score, which is expressed as: As,d represents the importance score of the directional component at scale s, H·W represents the total number of pixels in the corresponding directional feature map, and Bs represents the importance score of the low-frequency residual at scale s; The attention mechanism is used to dynamically adjust the weights of multi-scale and multi-directional components and perform dynamic fusion, which can be expressed as: Where Ff(x,y) represents the fusion features of all scales and directions of the pixel point (x,y), S and D represent the maximum number of scales and the maximum number of directions respectively, rs,d represent the directional component weights, and δs represents the low-frequency residual weight; The convolution model based on the convolutional neural network performs convolution calculation on Ff(x,y), including input layer, convolution layer and output layer; Use the training set to train the model, select the cross entropy loss function to calculate the difference between the convolution model output and the actual label, use the Adam optimizer to perform gradient descent optimization, update the parameters of the convolution model, and stop iterating if the model loss no longer decreases significantly during continuous iterations; Input the calculated Ff(x,y) into the convolution model and output a three-dimensional feature map 5. The method for target detection based on artificial intelligence as claimed in claim 4, characterized in that: The step of constructing a regression head network and a classification head network to determine candidate boxes and outputting a set of screened candidate boxes includes: Based on 3D feature map Output the initial anchor point box for each pixel point; Based on the object of image target monitoring, the size of the anchor box is preset according to historical data, and the anchor box is applied to each pixel of the feature map according to the scale k and aspect ratio r of the anchor box to generate the anchor box, which is expressed as: in represents the ath anchor box, xa and ya represent the center coordinates of the ath anchor box, and represent the pixel points located in the feature map. and Respectively represent the width and height of the ath anchor box, Win and Hin represent the width and height of the input original image; Traverse each pixel in the feature map and generate a set of anchor boxes of all combinations; The regression head network includes input layer, convolution layer and output layer. The input layer inputs the three-dimensional feature map. The convolution layer performs convolution operation through the ReLU activation function, and predicts the predicted offset of each pixel point for the center coordinates, width and height corresponding to the anchor box through the output layer; Use the training data to train the regression head network, select the Smooth L1 loss function to calculate the difference between the offset predicted by the regression head network and the actual label, use the Adam optimizer to perform gradient descent optimization, update the parameters of the regression head network, and stop iterating if the loss of the model no longer decreases significantly during continuous iterations; enter The predicted offset of each anchor box is output through the regression head network prediction; The classification head network includes input layer, convolution layer and output layer. The input layer inputs the three-dimensional feature map. The convolution layer performs convolution operation through the Softmax activation function, and predicts the number of categories of the target corresponding to each pixel through the output layer; Use the training data to train the classification head network, select the cross entropy loss function to calculate the difference between the category probability predicted by the classification head network and the actual label, use the Adam optimizer to perform gradient descent optimization, update the parameters of the classification head network, and stop iterating if the model loss no longer decreases significantly during continuous iterations; Based on the input Ffc(x,y,c), the classification head network outputs the probability of the category corresponding to each anchor box, and selects the highest probability category as the output; Use the verification data to record the candidate boxes for the image data in the verification set, including the candidate box coordinate information, category label and highest confidence, and draw a precision-recall PR curve chart, and select the inflection point as the final confidence threshold; The anchor box corresponding to the category probability higher than the confidence threshold is taken as the candidate box, and the non-maximum suppression NMS calculation is performed. According to the candidate box set of each category, the intersection and union ratio Iou of each candidate box and other candidate boxes is calculated, and the sum of the historical mean and standard deviation is used as the suppression threshold. If the calculated intersection and union ratio is less than the suppression threshold, the corresponding candidate box is proposed, and the filtered candidate box set is output.

6. The method for target detection based on artificial intelligence as claimed in claim 5, characterized in that: The method of restoring the target frame of the image based on the candidate frame includes: Based on the candidate box set, restore according to the relative coordinates of the candidate box and restore the input to the original input image coordinate system as the target box; Determine the coordinates of the four vertices of the target box according to the center point coordinates and width and height data, and combine all target boxes into an output set; The target box set is sorted in descending order of confidence, and the number of target box outputs is limited based on detection requirements.

7. The method for target detection based on artificial intelligence according to claim 6, characterized in that: The securely recording the target frame set data includes: The target frame set data is securely transmitted via the TLS protocol; Generate a hash value of the target frame data and attach a signature, and verify the hash value at the receiving end to perform data verification; The verified data is stored in the database and distributed and classified by timestamp and target category, and regular data backup is performed.

8. An artificial intelligence-based target detection device, based on the artificial intelligence-based target detection method according to any one of claims 1 to 7, characterized in that: include: The quality screening module is responsible for collecting image data and performing quality screening to provide high-quality input for subsequent processing; The feature extraction module performs pixel enhancement, feature extraction and component processing on the collected high-quality image data to generate optimized multi-scale features; The 3D feature generation module uses a convolutional neural network (CNN) to generate 3D feature maps based on dynamically fused multi-scale feature maps. The candidate box screening module uses the regression head network and the classification head network to process the 3D feature map, generate candidate boxes and screen them; The target box restoration module restores the filtered candidate box from relative coordinates to the original input image coordinates and calculates the vertex coordinates of the target box; The secure transmission module performs secure transmission, verification and storage management of target frame data.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the artificial intelligence-based target detection method described in any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the target detection method based on artificial intelligence described in any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Detection method and system for enhancing detection of small target foreign matters in tobacco leaves

    CN121459076A