An animal target detection method and system based on image adaptive enhancement
By using an image adaptive enhancement method to adjust image brightness and blur, and combining parameter prediction and enhancement modules, a target detection model is constructed. This solves the problem of decreased accuracy in animal target recognition under lighting and weather interference, and improves recognition performance and accuracy.
Patent Information
- Application Number
- CN202310175808.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-28
- Publication Date
- 2026-02-24
- Estimated Expiration
- 2043-02-28
AI Technical Summary
Existing technologies cannot effectively identify animal targets affected by lighting or weather conditions, leading to a decrease in recognition accuracy.
An animal target detection method based on image adaptive enhancement is adopted. The data processing module adjusts the image brightness and blur, the parameter prediction module performs image enhancement, and the image detection module performs target recognition to construct a target detection model.
It improves the performance of animal target recognition and the accuracy of image recognition, and enhances the adaptability and robustness of image recognition.
Smart Images

Figure CN116092126B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image detection technology, and in particular to an animal target detection method and apparatus based on image adaptive enhancement. Background Technology
[0002] With the development of animal tracking technology, animal target detection has received widespread attention from scholars and researchers. However, most tracking systems are rather mechanical in their target finding and require images with good lighting and environmental conditions.
[0003] Chinese Patent Publication No. CN115424249B discloses an adaptive detection method for weak aerial targets against complex backgrounds. First, it adaptively judges and segments the nearby man-made complex background structure. Then, it performs coarse detection of weak targets on the grayscale image of the background after removing the complex texture structure, obtaining multiple candidate regions for weak targets. Finally, it performs fine detection on the candidate regions using adaptive filtering based on local texture features, obtaining the weak targets to be detected. This adaptive detection method for weak aerial targets against complex backgrounds can detect weak targets in visible light. It not only effectively suppresses the interference of complex background structures and accurately detects and locates the position of weak targets in visible light images, but also has stronger anti-background interference capabilities and weak target detection capabilities.
[0004] Therefore, the above technical solution has the following problem: it cannot identify animal targets that are subject to light or weather interference. Summary of the Invention
[0005] To address this issue, the present invention provides an animal target detection method and apparatus based on image adaptive enhancement, which overcomes the problem in the prior art that it is unable to identify animal targets subject to light or weather interference, thereby leading to a decrease in recognition accuracy.
[0006] On one hand, the present invention provides an animal target detection method based on image adaptive enhancement, comprising:
[0007] Step S1: The original image is processed using the data processing module in a first preset processing method to form a data-processed image;
[0008] In step S2, the data processing module mixes the original image and the data-processed image in a preset mixing method to form a mixed training image, and downsamples the mixed training image and inputs it into the parameter prediction module to form parameter prediction values.
[0009] Step S3: The image enhancement module processes the hybrid training image according to the parameter prediction value using a second preset processing method to form an enhanced training image.
[0010] Step S4: The image detection module obtains the fusion features of the enhanced training image as training samples, and uses the target detection head to obtain the real results as training results. The training samples and training results are trained using a preset training method, and the image detection module and parameter prediction module are updated according to the task loss formed by training.
[0011] Step S5: The image detection module calculates the enhanced image of the input image based on the parameter prediction module and the image enhancement module, and outputs the target detection model based on the task loss.
[0012] Step S6: Under the condition that the training is completed, the image to be detected is input into the target detection model to obtain the final detection result;
[0013] The first preset processing method is to adjust the image by calculating the exposure function and the atmospheric scattering model; the second preset adjustment method is to adjust the enhancement attributes of the input image according to the predicted values of the parameters using a preset enhancement method; the preset training method is to input the enhanced image into a preset learning model for training; the preset mixing method is to mix the original image and the data processing image at a preset ratio; and the training condition is to complete the preset training to obtain the target detection model.
[0014] Further, in step S1, for a single original image, the data processing module adjusts the image brightness f(x) according to a preset exposure, where f(x) is determined by equation (1):
[0015] f(x) = x γ (1)
[0016] Where x is the pixel value of the original image, γ is the preset exposure in the data processing module, and γ∈[0.3,0.7]∪[1.5,5.5];
[0017] The data processing module adjusts the image blur I(x) based on atmospheric scattering, and I(x) is determined by equation (2):
[0018] I(x)=J(x)e -β d(x)+A(1-e -β d(x)) (2)
[0019] Where J(x) is the scene brightness of the original image, A is the global atmospheric brightness, β is the atmospheric scattering coefficient, and d(x) is the scene depth;
[0020] The pixel value, scene brightness, light intensity, atmospheric scattering coefficient, and scene depth are attributes of the original image and are fixed when the original image is captured.
[0021] Further, in step S2, the data processing module mixes the original number of images n and the number of data-processed images m in the preset mixing method to form a mixed training image;
[0022] Wherein, the original number of images n is the number of images that have not undergone step S1, the number of data-processed images m is the number of images that have completed step S1, and the preset mixing method is n:m = 1:2;
[0023] In step S2, the data processing module adjusts the pixels of each original image and each data-processed image to a preset pixel value using a preset pixel adjustment method.
[0024] The preset pixel adjustment method is downsampling, the preset pixel is a 256×256 pixel, and each image whose pixels are adjusted to the preset pixel is called the integrated image.
[0025] Further, in step S3, the parameter prediction module downsamples the mixed training image and processes it using a preset prediction method, wherein the parameter prediction module includes:
[0026] The first convolutional layer has a 3×3 kernel, a step size of 2, and an output channel value of 16.
[0027] The second convolutional layer has a 3×3 kernel, a step size of 2, and an output channel value of 32.
[0028] The third convolutional layer has a 3×3 kernel, a step size of 2, and an output channel value of 32.
[0029] The non-local block has 32 channels.
[0030] The max pooling layer has a 4×4 kernel, 4 steps, and 32 output channels.
[0031] The first fully connected layer has 64 output channels;
[0032] The second fully connected layer has 14 output channels;
[0033] For a single integrated image, the parameter prediction module sequentially passes it through the first convolutional layer, the second convolutional layer, the third convolutional layer, the nonlocal block, the max pooling layer, the first fully connected layer, and the second fully connected layer, and records the value output by the second fully connected layer as the parameter prediction value.
[0034] Furthermore, in step S3, when the parameter prediction module completes the output of the parameter prediction values for each of the integrated images, the image enhancement module adjusts the enhancement attributes of the corresponding hybrid training image according to the parameter prediction values using a preset enhancement method.
[0035] The enhancement attributes include white balance, gamma, contrast, hue, and sharpening. The preset enhancement method is to adjust the white balance, gamma, contrast, hue, and sharpening of the integrated image sequentially according to the preset values of the parameters.
[0036] The hybrid training image adjusted by the image enhancement module is designated as the enhanced image.
[0037] Furthermore, in step S4, the image detection module inputs the enhanced image into the image detection module to form several fusion features;
[0038] Each fusion feature comprises several sub-features, wherein the sub-features are detection results set in the image detection module based on a preset size.
[0039] Furthermore, in step S5, the image detection module captures the real result with the target detection head and makes a judgment based on the fusion features using a preset fusion judgment method;
[0040] The preset fusion determination method is to calculate the total detection task loss by comprehensively calculating the overlap area, center point distance, and aspect ratio of the fused image and the real image between the detection result and the real result.
[0041] The detection task loss includes the deviation values of the overlapping area, the center point distance, and the aspect ratio, which are used to update the parameters of the parameter prediction module and the image detection module.
[0042] Further, in step S6, the target detection model inputs the image to be detected into the image detection module and the image enhancement module. The image enhancement module obtains the enhanced image corresponding to the image to be detected based on the parameters given by the parameter prediction module, and inputs the enhanced image into the image detection module to obtain the image features of the image to be detected. The image detection module outputs the final detection result based on the image features.
[0043] On the other hand, the present invention provides an animal target detection system based on image adaptive enhancement, comprising:
[0044] The data processing module is used to process the original image, adjust the original image according to a first preset adjustment method to form a data-processed image, and mix the original image and the data-processed image to improve the diversity of images in the training set.
[0045] A parameter prediction module, which is connected to the data processing module, is used to calculate the predicted parameter values of the image;
[0046] An image enhancement module, connected to the parameter prediction module, is used to adjust the original image and the data-processed image using a second preset adjustment method to improve image quality.
[0047] An image detection module, which is connected to the parameter prediction module and the image enhancement module, is used to analyze the image to be detected, calculate the target loss, and give the final detection result;
[0048] The first preset processing method is to adjust the image using an exposure function and an atmospheric scattering model; the second preset adjustment method is to adjust the enhancement attributes of the input image according to the parameter prediction value using a preset enhancement method, wherein the enhanced image quality is to increase the parameter difference between different pixels in the image.
[0049] Furthermore, the image detection module includes:
[0050] A target detection head, used to capture real images;
[0051] The backbone network, which is connected to the target detection head, is composed of a preset network and is used to train the image to be detected based on the real image and extract image features based on the training results.
[0052] The preset network consists of a CSPDarknet53 network, a spatial pyramid pooling network, and a path aggregation network.
[0053] Compared with the prior art, the beneficial effect of the present invention is that by using image processing and mixing to train the enhanced image, the performance of animal target recognition is effectively improved while the accuracy of image recognition is also improved.
[0054] Furthermore, by adjusting image parameters, the number of samples in the image training set is increased, which not only effectively improves the reliability of training the image detection method, but also further improves the accuracy of image recognition.
[0055] Furthermore, by processing the image and calculating the prediction parameters for detection, the accuracy of image recognition is effectively improved, and the precision of image recognition is further enhanced.
[0056] Furthermore, by training with images and adjusting the parameters of image detection, and by verifying the results of image training based on actual conditions, the adaptability of image recognition is effectively improved, while the accuracy of image recognition is further enhanced.
[0057] Furthermore, by setting up a data processing module, a parameter prediction module, an image enhancement module, and an image detection module, an image learning network is constructed. This effectively improves the adaptive performance of the image and enhances the robustness of the learning system, thereby further improving the accuracy of image recognition. Attached Figure Description
[0058] Figure 1 This is a flowchart of the animal target detection method based on image adaptive enhancement according to the present invention;
[0059] Figure 2 This is an image recognition path diagram according to an embodiment of the present invention;
[0060] Figure 3 This is a schematic diagram of module connections according to an embodiment of the present invention. Detailed Implementation
[0061] To make the objectives and advantages of the present invention clearer, the present invention will be further described below with reference to embodiments; it should be understood that the specific embodiments described herein are merely for explaining the present invention and are not intended to limit the present invention.
[0062] Preferred embodiments of the present invention will now be described with reference to the accompanying drawings. Those skilled in the art should understand that these embodiments are merely illustrative of the technical principles of the present invention and are not intended to limit the scope of protection of the present invention.
[0063] It should be noted that in the description of this invention, the terms "upper", "lower", "left", "right", "inner", "outer", etc., which indicate directions or positional relationships, are based on the directions or positional relationships shown in the accompanying drawings. This is only for the convenience of description and is not intended to indicate or imply that the device or element must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, it should not be construed as a limitation of this invention.
[0064] Furthermore, it should be noted that, in the description of this invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.
[0065] Please see Figure 1 The diagram shows a flowchart of the animal target detection method based on image adaptive enhancement according to the present invention. The animal target detection method based on image adaptive enhancement includes:
[0066] Step S1: The original image is processed using the data processing module in a first preset processing method to form a data-processed image;
[0067] In step S2, the data processing module mixes the original image and the data-processed image in a preset mixing method to form a mixed training image, and then downsamples the mixed training image and inputs it into the parameter prediction module to form parameter prediction values.
[0068] Step S3: The image enhancement module processes the mixed training image according to the parameter prediction value using the second preset processing method to form an enhanced training image.
[0069] Step S4: The image detection module obtains the fusion features of the enhanced training image as training samples, and uses the target detection head to obtain the real results as training results. It then trains the training samples and training results using a preset training method, and updates the image detection module and parameter prediction module based on the task loss formed by the training.
[0070] Step S5: The image detection module calculates the enhanced image of the input image based on the parameter prediction module and the image enhancement module, and outputs the target detection model based on the task loss.
[0071] Step S6: Under the condition that the training is completed, input the image to be detected into the target detection model to obtain the final detection result;
[0072] The first preset processing method is to adjust the image by calculating the exposure function and the atmospheric scattering model; the second preset adjustment method is to adjust the enhancement attributes of the input image according to the parameter prediction value using a preset enhancement method; the preset training method is to input the enhanced image into a preset learning model for training; the preset mixing method is to mix the original image and the data processing image at a preset ratio; and the training condition is to obtain the target detection model after completing the preset training.
[0073] Please see Figure 2 As shown, it is an image recognition path diagram of an embodiment of the present invention.
[0074] Specifically, in step S1, for a single original image, the data processing module adjusts the image brightness f(x) according to a preset exposure, where f(x) is determined by equation (1):
[0075] f(x) = x γ (1)
[0076] Where x is the pixel value of the original image, γ is the preset exposure in the data processing module, and γ∈[0.3,0.7]∪[1.5,5.5];
[0077] The data processing module adjusts the image blur I(x) based on atmospheric scattering, and I(x) is determined by equation (2):
[0078] I(x)=J(x)e -β d(x)+A(1-e -β d(x)) (2)
[0079] Where J(x) is the scene brightness of the original image, A is the global atmospheric brightness, β is the atmospheric scattering coefficient, and d(x) is the scene depth;
[0080] Among them, pixel value, scene brightness, light intensity, atmospheric scattering coefficient, and scene depth are attributes of the original image, and are fixed when the original image is captured.
[0081] By adjusting image parameters, the number of samples in the image training set is increased, which effectively improves the reliability of training the image detection method and further enhances the accuracy of image recognition.
[0082] Specifically, in step S2, the data processing module mixes the original number of images n and the number of data processing images m in a preset mixing method to form a mixed training image;
[0083] Wherein, the number of original images n is the number of images that have not undergone step S1, the number of data-processed images m is the number of images that have completed step S1, and the preset mixing method is n:m = 1:2;
[0084] In step S2, the data processing module adjusts the pixels of each original image and each data-processed image to the preset pixels using a preset pixel adjustment method;
[0085] The preset pixel adjustment method is downsampling, the preset pixel size is 256×256 pixels, and each image whose pixels are adjusted to the preset pixel size is recorded as the integrated image.
[0086] Specifically, in step S3, the parameter prediction module downsamples the mixed training images and processes them using a preset prediction method. The parameter prediction module includes:
[0087] The first convolutional layer has a 3×3 kernel, a step size of 2, and an output channel value of 16.
[0088] The second convolutional layer has a 3×3 kernel, a step size of 2, and an output channel value of 32.
[0089] The third convolutional layer has a 3×3 kernel, a step size of 2, and an output channel value of 32.
[0090] The non-local block has 32 channels.
[0091] The max pooling layer has a 4×4 kernel, 4 steps, and 32 output channels.
[0092] The first fully connected layer has 64 output channels;
[0093] The second fully connected layer has 14 output channels;
[0094] For a single integrated image, the parameter prediction module sequentially passes it through the first convolutional layer, the second convolutional layer, the third convolutional layer, the nonlocal block, the max pooling layer, the first fully connected layer, and the second fully connected layer, and records the value output by the second fully connected layer as the parameter prediction value.
[0095] By processing images and calculating the predicted parameters for detection, the accuracy of image recognition is effectively improved, and the precision of image recognition is further enhanced.
[0096] Specifically, in step S3, when the parameter prediction module completes the output of the parameter prediction values for each integrated image, the image enhancement module adjusts the enhancement attributes of the corresponding mixed training image according to the parameter prediction values using a preset enhancement method.
[0097] The enhanced attributes include: white balance, gamma, contrast, hue, and sharpening. The default enhancement method is to adjust the white balance, gamma, contrast, hue, and sharpening of the integrated image sequentially according to the preset parameter values.
[0098] The image enhancement module is set to adjust the hybrid training image as the enhanced image.
[0099] Specifically, in step S4, the image detection module enhances the image input to the image detection module to form several fusion features;
[0100] A single fusion feature contains several sub-features, where the sub-features are the detection results set in the image detection module based on a preset size.
[0101] Specifically, in step S5, the image detection module captures the actual result of the target detection head and makes a judgment based on the fusion features using a preset fusion judgment method;
[0102] The preset fusion judgment method is to calculate the total detection task loss by comprehensively calculating the overlap area, center point distance and aspect ratio of the fused image and the real image.
[0103] The detection task loss includes deviations in the overlapping area, center point distance, and aspect ratio, which are used to update the parameters of the parameter prediction module and the image detection module.
[0104] Specifically, in step S6, the target detection model inputs the image to be detected into the image detection module and the image enhancement module. The image enhancement module obtains the enhanced image of the corresponding image to be detected based on the parameters given by the parameter prediction module, and inputs the enhanced image into the image detection module to obtain the image features of the corresponding image to be detected. The image detection module outputs the final detection result based on the image features.
[0105] By training with images and adjusting the parameters of image detection, and then verifying the training results based on actual conditions, the adaptability of image recognition is effectively improved, while further enhancing the accuracy of image recognition.
[0106] Please see Figure 3 As shown, it is a schematic diagram of module connection according to an embodiment of the present invention, including:
[0107] The data processing module is used to process the original image, adjust the original image according to a first preset adjustment method to form a data-processed image, and mix the original image and the data-processed image to improve the diversity of images in the training set.
[0108] The parameter prediction module, which is connected to the data processing module, is used to calculate the predicted parameter values of the image.
[0109] The image enhancement module, which is connected to the parameter prediction module, is used to adjust the original image and the data-processed image using a second preset adjustment method to improve image quality.
[0110] The image detection module, which is connected to the parameter prediction module and the image enhancement module, is used to analyze the image to be detected, calculate the target loss, and give the final detection result.
[0111] The first preset processing method is to adjust the image using an exposure function and an atmospheric scattering model; the second preset adjustment method is to adjust the enhancement attributes of the input image according to the parameter prediction value using a preset enhancement method, and the image quality enhancement method is to increase the parameter difference between different pixels in the image.
[0112] Specifically, the image detection module includes:
[0113] A target detection head, used to capture real images;
[0114] The backbone network, which is connected to the target detection head, is composed of a pre-set network and is used to train the image to be detected based on real images, and to extract image features based on the training results.
[0115] The preset network consists of a CSPDarknet53 network, a spatial pyramid pooling network, and a path aggregation network.
[0116] By setting up data processing, parameter prediction, image enhancement, and image detection modules, an image learning network is constructed. This effectively improves the adaptive performance of images and enhances the robustness of the learning system, thereby further improving the accuracy of image recognition.
[0117] The method of the present invention will be further described step by step, using the following embodiments as examples:
[0118] Please see Figure 2 as well as Figure 3 The specific steps for constructing the animal target detection system based on image adaptive enhancement of this invention are as follows:
[0119] Create a hybrid training set;
[0120] Under low-quality conditions, real-world datasets for object detection are insufficient for training and have limited data volume, making it impossible to train a stable CNN-based detector. To improve the robustness of the training model, this invention establishes a synthetic image dataset based on exposure changes and lens blur under low-quality conditions. The method is as follows:
[0121] Exposure conversion was used to simulate significantly different exposure conditions in different ecological regions;
[0122] Lens blurring is simulated using an atmospheric scattering model;
[0123] In constructing the synthetic image dataset, the data processing module operates offline to avoid the computational cost of generating low-quality images during training. For image x, the formation of the blurred image is determined by the following equation (2) based on the atmospheric scattering pattern:
[0124] I(x)=J(x)e -β d(x)+A(1-e -β d(x)) (2)
[0125] Where I(x) is the blurred image, J(x) represents the scene brightness of the real image, and A is the light in the global atmosphere.
[0126] To obtain the value of A, firstly, the dark channel map is calculated, and the top 1000 brightest pixels are selected. Then, A is estimated using the 1000 brightest pixels of the average blurred image I(x). Here, β represents the atmospheric scattering coefficient, and a value of β is set to simulate lens blur. d(x) is the scene depth, which is determined by equation (3):
[0127]
[0128] Where ρ is the Euclidean distance from the current pixel to the center pixel, row is the number of rows in image x, and column is the number of columns in image x.
[0129] 50% of all images are blurred.
[0130] The image brightness f(x) is adjusted according to the exposure of the original image, and f(x) is determined by equation (1):
[0131] f(x) = x γ (1)
[0132] Images under backlighting conditions are synthesized using equation (1), where x represents the input pixel value of image x, and the value of γ is randomly sampled within a uniform distribution range of [0.3, 0.7] ∪ [1.5, 5.5]. The original dataset will be modified by 10 different γ values, so the synthesized dataset is 10 times the size of the original dataset.
[0133] When the model is tested, all test images from the original dataset are randomly replaced with corresponding images from the synthetic dataset.
[0134] To achieve optimal detection performance under both normal and adverse conditions, a mixed data training scheme is employed.
[0135] Before each image is input into the network for training, it is randomly replaced by a corresponding synthetic dataset image with a probability of 2 / 3. The entire network model is trained end-to-end using object detection loss with both the original images and the synthetic low-quality training data to ensure that all modules in the overall model can adapt to each other.
[0136] Therefore, the parameter prediction module is weakly supervised and trained under the loss of object detection without labeled data.
[0137] When testing the model, a synthetic test dataset is created by replacing the original dataset with synthetic data; the mixed data training mode and the synthetic test dataset ensure that the overall model can adaptively enhance images based on the content of each image.
[0138] Construct parameter prediction module:
[0139] In the Image Signal Processing (ISP) pipeline, tunable filters are used for image enhancement, and a small nonlocal network is applied as a parameter predictor to estimate hyperparameters.
[0140] Taking a low-light scene as an example, the purpose of the parameter prediction module is to predict the parameters of the image enhancement module by understanding the global information of the image, including brightness, color, hue and light intensity.
[0141] Information estimation using estimated downsampled images:
[0142] Given an original image of any resolution, it is downsampled to 256×256 resolution using bilinear interpolation. The parameter prediction module consists of seven layers: a first convolutional layer, a second convolutional layer, a third convolutional layer, a nonlocal block, a max pooling layer, a first fully connected layer, and a second fully connected layer.
[0143] The nonlocal layer is a family of general building blocks used to capture long-term dependencies, and the second fully connected layer outputs the hyperparameters of the image enhancement module. When the output channels of these three convolutional layers are 16, 32, and 32, respectively, the parameter prediction module contains only 150K parameters.
[0144] Constructing an image enhancement module:
[0145] The image filter design adheres to the principles of differentiability and resolution independence. The image enhancement module consists of five differentiable filters with adjustable hyperparameters, including white balance, gamma, contrast, hue, and sharpness. Standard color and hue operation modules, including white balance, gamma, contrast, sharpening, and hue, can be represented as pixel-level filters.
[0146] For a single pixel, the pixel-level filter will take the input pixel value P i =(r i ,g i ,b i Mapped to output pixel value P o =(r o ,g o ,b o ), where (r, g, b) represent the values of the red, green, and blue channels, respectively, i is the input pixel, and o is the output pixel.
[0147] The white balance mapping function is determined by equation (4):
[0148] P o =(W r r i W g g i W b b i (4)
[0149] Among them, W r W g W b The value is given by the parameter suggestion network.
[0150] The mapping function of the gamma filter is determined by equation (5):
[0151]
[0152] The value of G is given by the parameter suggestion network.
[0153] Since different filters can all be used for backpropagation in neural networks, they can be seamlessly inserted into existing deep neural networks.
[0154] A differentiable contrast filter was designed to set the linear interpolation between the original image and the constant grayscale image, and its mapping function is given by equation (6):
[0155] P o =α·En(P i )+(1-α)·P i (6)
[0156] The value of α is given by the parameter proposal network, En(P i The value of ) is determined by the following formula:
[0157] Lum(P i ) = 0.27r i +0.67g i +0.06b i (7-1)
[0158]
[0159]
[0160] The tone filter is a monotonically piecewise linear function.
[0161] A tone filter with L parameters is represented as {t0, t1, ..., t...} L-1 The points of the hue curve are denoted as (k / L, T). k / T L ),in,
[0162] The mapping function is represented by differentiable parameters, such that the function is differentiable with respect to the original image and the parameters {t0, t1, ..., t...} L-1 All of them are differentiable, which is expressed by equation (8):
[0163]
[0164] Where L contains {t0,t1,...,t} L-1 The value of} is given by the parameter suggestion network.
[0165] Image sharpening can highlight the details of an image.
[0166] Using unsharpened masking techniques, the sharpening process is determined by equation (9):
[0167] F(x,λ)=I(x)+λ·(I(x)-Gau(I(x))) (9)
[0168] Where I(x) is the original image, Gau(I(x)) is a Gaussian filter, λ is a preset scaling factor, λ>0, and λ is given by the parameter proposal network.
[0169] The sharpening level can be adjusted by optimizing λ to achieve better object detection performance.
[0170] In this invention, the wildlife target detection method based on adaptive image enhancement adopts a common training protocol, and its backbone network is CSPdarknet-53. During training, the image size is randomly adjusted to (32N×32N), where N∈[9,19];
[0171] Data augmentation methods such as image flipping, cropping, and transformation are used to expand the training dataset.
[0172] The above model was trained using the Adam optimizer for 150 epochs, with an initial learning rate of 10. -4 With a batch size of 4, the object detection model predicts bounding boxes at three different scales and three anchor points at each scale.
[0173] The loss of the target detection model obtained using the above method is CIOU:
[0174] CIoU calculates the loss by using the overlap area, center point distance, and aspect ratio as comparison terms, which is determined by equation (10):
[0175]
[0176] Where, ρ 2 (b,b gt ) is the Euclidean distance between the center points of the predicted box and the ground truth box, and c is the diagonal distance of the smallest closed bounding region that can simultaneously contain the predicted box and the ground truth box;
[0177] Where α is determined by equation (11):
[0178]
[0179] Wherein, ν is determined by equation (12):
[0180]
[0181] The model is adjusted using the loss CIOU of the target detection model to achieve adaptive adjustment of the animal target detection system based on image adaptive enhancement.
[0182] The technical solution of the present invention has been described above with reference to the preferred embodiments shown in the accompanying drawings. However, it will be readily understood by those skilled in the art that the scope of protection of the present invention is obviously not limited to these specific embodiments. Without departing from the principles of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will all fall within the scope of protection of the present invention.
[0183] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. An animal target detection method based on image adaptive enhancement, characterized in that, include: Step S1: The original image is processed using the data processing module in a first preset processing method to form a data-processed image; In step S2, the data processing module mixes the original image and the data-processed image in a preset mixing method to form a mixed training image, and downsamples the mixed training image and inputs it into the parameter prediction module to form parameter prediction values. Step S3: The image enhancement module processes the hybrid training image according to the parameter prediction value using a second preset processing method to form an enhanced training image. Step S4: The image detection module obtains the fusion features of the enhanced training image, uses the target detection head to obtain the detection result, and trains the detection result and the real result in a preset training method, and updates the image detection module and the parameter prediction module according to the task loss formed by the training. Step S5: The image detection module calculates the enhanced image of the input image based on the parameter prediction module and the image enhancement module, and outputs the target detection model based on the task loss. Step S6: Under the condition that the training is completed, the image to be detected is input into the target detection model to obtain the final detection result; The first preset processing method involves adjusting the image by calculating an exposure function and an atmospheric scattering model; the second preset processing method involves adjusting the enhancement attributes of the input image according to the predicted parameter values using a preset enhancement method; the preset training method involves inputting the enhanced image into a preset learning model for training; the preset mixing method involves mixing the original image and the processed image at a preset ratio; and the training completion condition is obtaining the target detection model by completing the preset training. In step S3, the parameter prediction module downsamples the hybrid training image and processes it using a preset prediction method. The parameter prediction module includes: The first convolutional layer has a 3×3 kernel, a step size of 2, and an output channel value of 16. The second convolutional layer has a 3×3 kernel, a step size of 2, and an output channel value of 32. The third convolutional layer has a 3×3 kernel, a step size of 2, and an output channel value of 32. The non-local block has 32 channels. The max pooling layer has a 4×4 kernel, 4 steps, and 32 output channels. The first fully connected layer has 64 output channels; The second fully connected layer has 14 output channels; For a single integrated image, the parameter prediction module sequentially passes it through the first convolutional layer, the second convolutional layer, the third convolutional layer, the nonlocal block, the max pooling layer, the first fully connected layer, and the second fully connected layer, and records the value output by the second fully connected layer as the parameter prediction value; Nonlocal blocks are a family of general building blocks used to capture long-term dependencies. The second fully connected layer outputs the hyperparameters of the image enhancement module. When the output channels of the three convolutional layers are 16, 32 and 32 respectively, the parameter prediction module contains only 150K parameters.
2. The animal target detection method based on image adaptive enhancement according to claim 1, characterized in that, In step S1, for a single original image, the data processing module adjusts the image brightness according to a preset exposure. , Determined by equation (1): ; in, The pixel values of the original image. The preset exposure level in the data processing module. ; The data processing module adjusts the image blur based on atmospheric scattering. , Determined by equation (2): ; in, Let A be the scene brightness of the original image, β be the global atmospheric luminance, β be the atmospheric scattering coefficient, and d(x) be the scene depth. The pixel value, scene brightness, light intensity, atmospheric scattering coefficient, and scene depth are attributes of the original image and are fixed when the original image is captured.
3. The animal target detection method based on image adaptive enhancement according to claim 2, characterized in that, In step S2, the data processing module mixes the original number of images n and the number of data-processed images m in the preset mixing method to form a mixed training image; Wherein, the original number of images n is the number of images that have not undergone step S1, the number of data-processed images m is the number of images that have completed step S1, and the preset mixing method is n:m=1:2; In step S2, the data processing module adjusts the pixels of each original image and each data-processed image to a preset pixel value using a preset pixel adjustment method. The preset pixel adjustment method is downsampling, the preset pixel is a 256×256 pixel, and each image whose pixels are adjusted to the preset pixel is called the integrated image.
4. The animal target detection method based on image adaptive enhancement according to claim 3, characterized in that, In step S3, when the parameter prediction module completes the output of the parameter prediction values for each of the integrated images, the image enhancement module adjusts the enhancement attributes of the corresponding hybrid training image according to the parameter prediction values using a preset enhancement method. The enhancement attributes include white balance, gamma, contrast, hue, and sharpening. The preset enhancement method is to adjust the white balance, gamma, contrast, hue, and sharpening of the integrated image sequentially according to the preset values of the parameters. The hybrid training image adjusted by the image enhancement module is designated as the enhanced image.
5. The animal target detection method based on image adaptive enhancement according to claim 4, characterized in that, In step S4, the image detection module inputs the enhanced image into the image detection module to form several fusion features; Each fusion feature comprises several sub-features, wherein the sub-features are detection results set in the image detection module based on a preset size.
6. The animal target detection method based on image adaptive enhancement according to claim 5, characterized in that, In step S5, the image detection module captures the real result with the target detection head and makes a judgment based on the fusion features using a preset fusion judgment method. The preset fusion determination method involves calculating the overlap area, center point distance, and aspect ratio between the detection result and the real result to obtain the total detection task loss. The detection task loss includes the deviation values of the overlapping area, the center point distance, and the aspect ratio, which are used to update the parameters of the parameter prediction module and the image detection module.
7. The animal target detection method based on image adaptive enhancement according to claim 6, characterized in that, In step S6, the target detection model inputs the image to be detected into the image detection module and the image enhancement module. The image enhancement module obtains the enhanced image corresponding to the image to be detected based on the parameters given by the parameter prediction module, and inputs the enhanced image into the image detection module to obtain the image features of the image to be detected. The image detection module outputs the final detection result based on the image features.
8. An animal target detection system based on image adaptive enhancement using the method of any one of claims 1-7, characterized in that, include: The data processing module is used to process the original image, adjust the original image according to a first preset adjustment method to form a data-processed image, and mix the original image and the data-processed image to improve the diversity of images in the training set. A parameter prediction module, which is connected to the data processing module, is used to calculate the predicted parameter values of the image; An image enhancement module, connected to the parameter prediction module, is used to adjust the original image and the data-processed image using a second preset adjustment method to improve image quality. An image detection module, which is connected to the parameter prediction module and the image enhancement module, is used to analyze the image to be detected, calculate the target loss, and give the final detection result; The first preset processing method is to adjust the image using an exposure function and an atmospheric scattering model; the second preset adjustment method is to adjust the enhancement attributes of the input image according to the parameter prediction value using a preset enhancement method, wherein the enhanced image quality is to increase the parameter difference between different pixels in the image.
9. The animal target detection system based on image adaptive enhancement according to claim 8, characterized in that, The image detection module includes: A target detection head, used to capture real images; The backbone network, which is connected to the target detection head, is composed of a preset network and is used to train the image to be detected based on the real image and extract image features based on the training results. The preset network consists of a CSPDarknet53 network, a spatial pyramid pooling network, and a path aggregation network.
Citation Information
Patent Citations
An Adaptive Detection Method for Weak Targets in the Air under Complex Backgrounds
CN115424249B