[go: up one dir, main page]

WO2022193132A1 - Image detection method and apparatus, and electronic device - Google Patents

Image detection method and apparatus, and electronic device Download PDF

Info

Publication number
WO2022193132A1
WO2022193132A1 PCT/CN2021/081086 CN2021081086W WO2022193132A1 WO 2022193132 A1 WO2022193132 A1 WO 2022193132A1 CN 2021081086 W CN2021081086 W CN 2021081086W WO 2022193132 A1 WO2022193132 A1 WO 2022193132A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
parameter prediction
detection
parameters
parameter
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2021/081086
Other languages
French (fr)
Chinese (zh)
Inventor
邱珏沁
刘劲松
付星尧
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN202180094447.8A priority Critical patent/CN116917954A/en
Priority to PCT/CN2021/081086 priority patent/WO2022193132A1/en
Publication of WO2022193132A1 publication Critical patent/WO2022193132A1/en
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/776Validation; Performance evaluation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/82Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks

Definitions

  • the embodiments of the present application relate to the technical field of artificial intelligence, and in particular, to an image detection method, apparatus, and electronic device.
  • AI Artificial Intelligence
  • machine learning methods are usually used to construct initial models of various structures, such as neural network models, support vector machine models, and decision tree models. Then, the initial model is trained by training samples to realize functions such as image detection, speech recognition, etc.
  • a perception model is obtained by training an initial model such as a neural network to realize image detection tasks such as scene recognition, object detection or image segmentation.
  • the perceptual model extracts and detects the input image to output the detection result. Therefore, the perceptual model has specific requirements for the brightness, color, texture and other characteristics of the input image, such as clear image texture, moderate brightness, etc. .
  • the indicators used to form the brightness, color, texture and other characteristics of the image change, resulting in too dark image, unclear image texture, etc., resulting in detection results output by the perception model There is a large deviation from the real results. Therefore, for images collected in various scenes, how to enable the perception model to output relatively accurate detection results has become a problem to be solved.
  • the image detection method, device and electronic device provided by the present application can enable the image detection model to output relatively accurate detection results for images collected in various scenarios.
  • an embodiment of the present application provides an image detection method, the image detection method includes: acquiring an image to be detected; Predict the parameters of the image processing algorithm of the image to be detected, and generate a parameter prediction value; based on the parameter prediction value, adjust the parameters of the image processing algorithm; use the image processing algorithm after parameter adjustment to perform image processing on the image to be detected , generating a processed image; inputting the processed image into a pre-trained image detection model to generate a detection result.
  • a parameter prediction model is set to predict the parameters of the image processing algorithm, and the image processing algorithm uses the parameter prediction value to process the image to be detected, so that the dynamic range, noise, contrast and other parameters of the image input to the image detection model , which is the same or similar to the dynamic range, noise level, local contrast and other parameters of the sample image used to train the image detection model, which is beneficial to improve the accuracy of the detection result of the image detection model.
  • the parameter prediction model is obtained by comparing the annotation information of the sample image with the detection result of the sample image by the image detection model, and training based on the comparison result.
  • the parameter prediction model is obtained by training the following steps: comparing the detection result of the sample image with the annotation information of the sample image to obtain the comparison result; Iteratively adjusts the parameters of the parameter prediction model based on the comparison result; and saves the parameters of the parameter prediction model when a preset condition is satisfied.
  • the preset conditions here may include but are not limited to: the error is less than or equal to a preset threshold, or the number of iterations is greater than or equal to a preset threshold.
  • the comparison result is an error
  • the iteratively adjusting the parameters of the parameter prediction model based on the comparison result includes: based on the detection result of the sample image and the According to the error between the label information of the sample images, a target loss function is constructed, wherein the target loss function includes the parameters to be adjusted in the parameter prediction model; based on the target loss function, the back propagation algorithm and gradient A descent algorithm that iteratively adjusts the parameters of the image processing algorithm.
  • the parameters of the image processing algorithm for processing the to-be-detected image are performed using a pre-trained parameter prediction model based on the image features of the to-be-detected image.
  • Predicting, generating a parameter prediction value includes: performing feature extraction on the to-be-detected image to generate a feature tensor; inputting the feature tensor into the parameter prediction model to generate the parameter prediction value.
  • the parameters of the image processing algorithm for processing the to-be-detected image are performed using a pre-trained parameter prediction model based on the image features of the to-be-detected image.
  • Predicting, generating a parameter prediction value includes: inputting the to-be-detected image into the parameter prediction model to generate the parameter prediction value.
  • the image processing algorithm includes at least one of the following: a tone mapping algorithm, a contrast enhancement algorithm, an image edge enhancement algorithm, and an image noise reduction algorithm.
  • the image detection model is used to perform at least one of the following detection tasks: labeling of detection frames, recognition of target objects, prediction of confidence levels, and prediction of motion trajectories of target objects .
  • an embodiment of the present application provides an image detection device, the image detection device includes: an acquisition module configured to acquire an image to be detected; a generation module configured to use a pre- The trained parameter prediction model predicts the parameters of the image processing algorithm used to process the image to be detected, and generates parameter prediction values; an adjustment module is configured to adjust the parameters of the image processing algorithm based on the parameter prediction values.
  • a processing module configured to perform image processing on the image to be detected using an image processing algorithm after parameter adjustment, to generate a processed image;
  • a detection module configured to input the processed image to a pre-trained image Detect the model and generate detection results.
  • the parameter prediction model is obtained by comparing the annotation information of the sample image with the detection result of the sample image by the image detection model, and training based on the comparison result.
  • the image detection apparatus further includes a parameter prediction model training module
  • the parameter prediction model training module includes: a comparison sub-module configured to detect the sample image The result is compared with the annotation information of the sample image to obtain the comparison result adjustment sub-module, which is configured to iteratively adjust the parameters of the parameter prediction model based on the comparison result; the saving sub-module is configured to be in a preset condition. When satisfied, the parameters of the parameter prediction model are saved.
  • the comparison result is an error
  • the adjustment sub-module is further configured to: based on the difference between the detection result of the sample image and the annotation information of the sample image
  • a target loss function is constructed, wherein the target loss function includes the parameters to be adjusted in the parameter prediction model; based on the target loss function, the image processing is iteratively adjusted by using a back-propagation algorithm and a gradient descent algorithm parameters of the algorithm.
  • the generating module is configured to: perform feature extraction on the to-be-detected image to generate a feature tensor; input the feature tensor into the parameter prediction model , to generate the predicted value of the parameter.
  • the generating module is configured to: input the image to be detected into the parameter prediction model, and generate the parameter prediction value.
  • the image processing algorithm includes at least one of the following: a tone mapping algorithm, a contrast enhancement algorithm, an image edge enhancement algorithm, and an image noise reduction algorithm.
  • the image detection model is used to perform at least one of the following detection tasks: labeling a detection frame, identifying a target object, predicting a confidence level, and predicting a motion trajectory of the target object .
  • an embodiment of the present application provides a method for training a parameter prediction model, the method comprising: based on an image feature of a sample image, using the parameter prediction model, adjusting the parameters of an image processing algorithm used to process the sample image performing prediction to generate a parameter prediction value; adjusting the parameters of the image processing algorithm based on the parameter prediction value; performing image processing on the sample image by using the parameter-adjusted image processing algorithm to generate a processed image;
  • the processed image is input to a pre-trained image detection model to generate a detection result; the error between the detection result and the labeling information of the sample image is compared to obtain a comparison result; based on the comparison result, the parameter prediction is adjusted
  • the parameters of the model when the preset conditions are satisfied, the parameters of the parameter prediction model are saved.
  • the comparison result is an error
  • adjusting the parameters of the parameter prediction model based on the comparison result includes: based on the detection result and the sample image The error between the labeling information, constructs a target loss function, wherein the target loss function includes the parameters to be adjusted in the parameter prediction model; based on the target loss function, using the back-propagation algorithm and the gradient descent algorithm, Iteratively adjust the parameters of the parameter prediction model.
  • the comparison result is an error
  • adjusting the parameters of the parameter prediction model based on the comparison result includes: based on the detection result and the sample image The error between the labeling information, constructs a target loss function, wherein the target loss function includes the parameters to be adjusted in the parameter prediction model; based on the target loss function, using the back-propagation algorithm and the gradient descent algorithm, Iteratively adjust the parameters of the parameter prediction model.
  • the parameter prediction model to be trained is used to predict the parameters of the image processing algorithm for processing the sample image based on the image features of the sample image, and the parameters are generated.
  • the predicted value includes: performing feature extraction on the sample image to generate a feature tensor; inputting the feature tensor into the parameter prediction model to generate the parameter predicted value.
  • the parameter prediction model to be trained is used to predict the parameters of the image processing algorithm for processing the sample image based on the image features of the sample image, and the parameters are generated.
  • the predicted value includes: inputting the sample image into the parameter prediction model to generate the parameter predicted value.
  • the image processing algorithm includes at least one of the following: a tone mapping algorithm, a contrast enhancement algorithm, an image edge enhancement algorithm, and an image noise reduction algorithm.
  • the image detection model is used to perform at least one of the following detection tasks: labeling a detection frame, identifying a target object, predicting a confidence level, and predicting a motion trajectory of the target object .
  • an embodiment of the present application provides an electronic device, the electronic device includes: a camera device for acquiring an image to be detected; a parameter prediction device for using pre-trained parameters based on image features of the image to be detected a prediction model, for predicting parameters of an image processing algorithm used to process the image to be detected, and generating a parameter prediction value; an image signal processor for adjusting the parameters of the image processing algorithm based on the parameter prediction value, using The parameter-adjusted image processing algorithm performs image processing on the to-be-detected image to generate a processed image; an artificial intelligence processor is used to input the processed image into a pre-trained image detection model to generate a detection result.
  • an embodiment of the present application provides an image detection device, the image detection device includes one or more processors and a memory; the memory is coupled to the processor, and the memory is used to store one or more programs ; the one or more processors are configured to run the one or more programs to implement the method according to the first aspect.
  • an embodiment of the present application provides an apparatus for training a parameter prediction model
  • the apparatus for training a parameter prediction model includes one or more processors and a memory; the memory is coupled to the processor, and the The memory is used to store one or more programs; the one or more processors are used to execute the one or more programs to implement the method according to the third aspect.
  • an embodiment of the present application provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and the computer program is used to implement the method according to the first aspect when the computer program is executed by at least one processor. .
  • an embodiment of the present application provides a computer program product, which is used to implement the method according to the first aspect when the computer program product is executed by at least one processor.
  • FIG. 1 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • FIG. 2a is a schematic structural diagram of the parameter prediction apparatus shown in FIG. 1 provided by an embodiment of the present application;
  • FIG. 2b is another schematic structural diagram of the parameter prediction apparatus shown in FIG. 1 provided by an embodiment of the present application;
  • FIG. 3 is a schematic structural diagram of a vehicle provided by an embodiment of the present application.
  • FIG. 4 is an interaction flowchart between components in each electronic device as shown in FIG. 1 provided by an embodiment of the present application;
  • FIG. 5 is another schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • FIG. 6 is an interaction flowchart between components in the electronic device as shown in FIG. 5 provided by an embodiment of the present application;
  • FIG. 7 is a schematic diagram of a method for performing feature extraction on an image to be detected to generate a feature tensor provided by an embodiment of the present application;
  • FIG. 8 is a schematic diagram of parameters included in an image processing algorithm provided by an embodiment of the present application.
  • FIG. 9 is a schematic diagram of a system architecture including an electronic device for training an image prediction model provided by an embodiment of the present application.
  • FIG. 10 is a flowchart of a method for training a parameter prediction model provided by an embodiment of the present application.
  • FIG. 11 is a flowchart of an image detection method provided by an embodiment of the present application.
  • FIG. 12 is a schematic structural diagram of an image processing apparatus provided by an embodiment of the present application.
  • FIG. 13 is a schematic structural diagram of an apparatus for training a parameter prediction model provided by an embodiment of the present application.
  • the corresponding apparatus may include one or more units, such as functional units, to perform one or more of the described method steps (eg, one unit performs one or more steps) , or units, each of which performs one or more of the steps), even if such unit or units are not explicitly described or illustrated in the figures.
  • the corresponding method may contain a step to perform the functionality of the one or more units (eg, a step to perform the one or more units) functionality, or steps, each of which performs the functionality of one or more of the plurality of units), even if such one or more steps are not explicitly described or illustrated in the figures.
  • the image detection method described in the present application can be applied to the field of computer vision, where the image input into the image detection model needs to be processed to output a scene suitable for the image detection model to perform image detection.
  • the electronic device 100 may be a user equipment (User Equipment, UE), such as various types of devices such as a mobile phone, a tablet computer, a smart screen, or an image capturing device.
  • UE User Equipment
  • the electronic device 100 may also be a vehicle.
  • a camera 101 may be provided in the electronic device 100 for capturing image data.
  • the electronic device 100 may also include or be integrated into a module, chip, chip set, circuit board or component in the electronic device, and the chip or chip set or the circuit board equipped with the chip or chip set can be driven by necessary software Work.
  • the electronic device 100 includes one or more processors, such as a central processing unit (CPU, Central Processing Unit/Processor), an image signal processor (ISP, Image Signal Processor) 103, an AI processor 104, and the like.
  • processors such as a central processing unit (CPU, Central Processing Unit/Processor), an image signal processor (ISP, Image Signal Processor) 103, an AI processor 104, and the like.
  • the one or more processors can be integrated in one or more chips, and the one or more chips can be regarded as a chipset, when one or more processors are integrated in the same chip
  • the chip is also called a system on a chip (SOC).
  • SOC system on a chip
  • the electronic device 100 also includes one or more other necessary components, such as memory and the like.
  • the camera device 101 shown in FIG. 1 may be a monocular camera.
  • the camera device 101 may further include multi-camera cameras, and these cameras may be physically combined in one camera device, or may be physically separated into multiple camera devices. Multiple image data are collected at the same time by the multi-eye camera, and can be processed according to the image data to obtain an image.
  • the camera 101 can collect image data in real time, or collect image data periodically. The period is such as 3s, 5s, 10s and so on.
  • the camera device 101 may also collect images in other ways, which are not specifically limited in this embodiment of the present application.
  • the camera device 101 can preprocess the collected image data to generate images to be detected, and provide them to the parameter prediction device 102 and the ISP 103 respectively.
  • the generated image to be detected may be a color image, such as a red green blue (RGB, Red Green Blue) image.
  • the parameter prediction device 102 shown in FIG. 1 is configured to receive the image to be detected from the camera device 101 . Then, the parameter prediction device 102 predicts the parameters of the image processing algorithm used for processing the image to be detected in the ISP 103 based on the image features of the image to be detected, and generates a parameter prediction value.
  • the parameter prediction apparatus 102 will be introduced below through two possible implementation manners.
  • the parameter prediction apparatus 102 includes an application-specific integrated circuit 1021 and an AI processor 1022, as shown in FIG. 2a.
  • the application-specific integrated circuit 1021 may be dedicated to extracting image features of the image to be detected.
  • the image features may include, but are not limited to, at least one of the following: color features, brightness features, and edge features (for a specific method of feature extraction, refer to the relevant description of the embodiment shown in FIG. 7 ).
  • the application-specific integrated circuit 1021 can be used alone as a component or integrated in other digital logic devices including, but not limited to, a CPU.
  • the AI processor 1022 may include a neural network processor (NPU, Neural-network Processing Unit), a random forest processor, a support vector machine processor and other special purpose processors, including but not limited to a convolutional neural network processor, a tensor processor or neural processing engine.
  • the AI processor 1022 can be used alone as a component or integrated in other digital logic devices, including but not limited to: CPU, GPU (Graphics Processing Unit, Graphics Processing Unit) or DSP (Digital Signal Processor, Digital Signal Processor) ).
  • the CPU, GPU and DSP are all processors within a system-on-chip.
  • a pre-trained parameter prediction model can be run in the AI processor 1022 .
  • the ASIC 1021 extracts image features of the image to be detected, and based on the feature extraction result, generates a feature tensor and provides it to the AI processor 1022 .
  • the parameter prediction model running in the AI processor 1022 predicts the parameters of the image processing algorithm running in the ISP 103 based on the feature tensor, and generates a parameter prediction value and provides it to the ISP 103 .
  • the parameter prediction apparatus 102 may not be provided with an application-specific integrated circuit 1021, but only be provided with an AI processor 1022, as shown in FIG. 2b.
  • the hardware structure of the AI processor 1022 is the same as the hardware structure of the AI processor 1022 shown in FIG. 2a, and details are not repeated here.
  • the AI processor 1022 can also run a pre-trained parameter prediction model. Different from the implementation shown in FIG. 2 a , the parameter prediction model can directly input the image to be detected provided by the first camera device 101 .
  • the parameter prediction model can complete the image feature extraction process and the parameter prediction process of the image to be detected, and then generate the parameter prediction value and provide it to the ISP103.
  • the parameter prediction model run in the AI processor 1022 may be the detection result of the sample image S1 by comparing the annotation information of the sample image S1 and the image detection model, And based on the comparison results, the initial model is trained.
  • the initial model may include, but is not limited to, a neural network model, a support vector machine model, or a random forest model.
  • the parameter prediction model is deployed in the AI process 1022 shown in FIG. 2a or FIG. 2b after the offline-end training is completed.
  • the offline end here can be regarded as a server device or a device for model training.
  • the above-mentioned image detection model is an image detection model running in the AI processor 104 .
  • the method for generating the parameter prediction model may specifically refer to the embodiment shown in FIG. 8 .
  • the ISP 103 shown in FIG. 1 can set up multiple hardware modules or run necessary software programs to process the image data.
  • the ISP103 can be used alone as a component or integrated in other digital logic devices, including but not limited to: CPU, GPU or DSP.
  • the ISP 103 may perform a plurality of image processing processes, which may include, but are not limited to, tone mapping, contrast enhancement, edge enhancement, noise reduction, color correction, and the like.
  • the ISP 103 executes the above-mentioned multiple image processing processes by running the image processing algorithm.
  • the image processing algorithms may include, but are not limited to, tone mapping algorithms, contrast enhancement algorithms, edge enhancement algorithms, noise reduction algorithms, color correction algorithms, and the like.
  • Each image processing process in the above-mentioned multiple image processing processes can be regarded as an independent image processing process, and thus, the image processing algorithm for executing each image processing process can be regarded as independent.
  • the ISP 103 may include multiple logic modules. For example, it includes but is not limited to: tone mapping module, contrast enhancement module, edge enhancement module, color correction module, etc. Each logic module is used to perform an image processing procedure.
  • Each logic module may use its own specific hardware structure, and multiple logic modules may also share a set of hardware structures, which is not limited in this embodiment of the present application.
  • the one or more image processing procedures are typically performed sequentially. For example, after the image acquired by the camera 101 is provided to the ISP 103, processing processes such as tone mapping, contrast enhancement, edge enhancement, color correction, etc. may be sequentially performed. It should be noted that this embodiment of the present application does not limit the sequence of the image processing processes performed by the ISP 103 , for example, the contrast enhancement may be performed first, and then the tone mapping may be performed.
  • the values of some parameters are adjustable.
  • the Gamma function parameter ⁇ in the tone mapping algorithm the contrast threshold parameter in the contrast enhancement algorithm; the edge enhancement factor ⁇ in the edge enhancement algorithm; the spatial domain Gaussian kernel parameter ⁇ s and the pixel value domain Gaussian kernel parameter in the noise reduction algorithm ⁇ r.
  • the detailed description of each adjustable parameter in the image processing algorithm refers to the embodiment shown in FIG. 9 .
  • the parameter prediction values generated by the parameter prediction model are the values of these adjustable parameters in the image processing algorithm.
  • the parameter prediction value output by the parameter prediction model may include multiple values, such as target brightness parameter value, target saturation parameter value, filter kernel parameter value, edge enhancement factor ⁇ value, spatial domain Gaussian kernel parameter value and pixel value domain Gaussian kernel parameter value. That is to say, the ISP 103 can obtain the value of the adjustable parameter of the image processing algorithm executing each image processing flow from the parameter prediction model, and update the value of the corresponding adjustable parameter to the parameter prediction value generated by the parameter prediction model. Then, the ISP 103 performs image processing on the image input by the first camera 101 by using the image processing algorithm after parameter adjustment.
  • the AI processor 104 shown in FIG. 1 may include a special-purpose neural processor such as a Neural-network Processing Unit (NPU), including but not limited to a convolutional neural network processor, a tensor processor, or a neural processing unit. engine.
  • the AI processor can be used alone as a component or integrated in other digital logic devices, including but not limited to: CPU, GPU or DSP.
  • the AI processor 104 may run an image detection model, and the image detection model is obtained by training a deep neural network based on the sample image S2.
  • This image detection model can perform specific detection tasks.
  • the specific detection task may include, but is not limited to, labeling of detection frames, recognition of target objects, prediction of confidence levels, prediction of motion trajectories of target objects, or image segmentation, and the like.
  • the image detection model is deployed in the AI processor 104 shown in FIG. 1 after the offline-end training is completed.
  • the offline end here can be regarded as a server device or a device for model training.
  • the AI processor 1022 and the AI processor 104 in the parameter prediction apparatus 102 may be co-located in the same AI processor, and the AI processor may run both the parameter prediction model and the image detection model.
  • the AI processor 1022 and the AI processor 104 may also be independent processors.
  • the image detection model executed in the AI processor 104 usually performs image detection based on features such as brightness, color, and texture of the image.
  • features such as brightness, color, and texture are usually reflected by indicators such as the dynamic range, noise level, and contrast of the image.
  • the dynamic range, noise, contrast and other indicators of the multiple images are different, the characteristics such as brightness, color and texture of the multiple images are also different.
  • the image detection model is deployed in the terminal device after the offline training is completed, and the experts who train the image detection model are usually different from the users who use the image detection model.
  • a parameter prediction model is set, and the parameter prediction model is used to predict the dynamic range, noise level, local contrast and other indicators of the image based on the image characteristics of the image to be detected, and the parameter prediction value is provided to the ISP103, so that the ISP103 runs
  • the image processing algorithm processes the image to be detected based on the predicted value of the parameter, so that the dynamic range, noise level, local contrast and other indicators of the image input to the image detection model can be compared with the dynamic range of the sample image used for training the image detection model.
  • the noise level, local contrast and other indicators are the same or similar, thereby improving the accuracy of the detection results of the image detection model.
  • the generalization ability of the image detection model will lead to the degradation of the detection performance of the image detection model, so the accuracy of the detection results output by the image detection model is still not ideal.
  • the parameter prediction model in the embodiment of the present application, it is not necessary to make any changes to the parameters of the image detection model. Compared with the traditional technology, the time and computing power overhead required for training the image detection model can be saved, and the The image detection model can maintain a high detection accuracy; in addition, since the parameter prediction model predicts the parameters of the image processing algorithm, it does not need to perform the image detection process, so the image detection model does not need to prepare high-quality reference images during the training process. , the training can be completed with fewer training samples, which simplifies the training process of the parameter prediction model.
  • FIG. 3 shows a schematic structural diagram of a vehicle 300 provided by an embodiment of the present application.
  • Components coupled to or included in vehicle 300 may include control system 10 , propulsion system 20 , and sensor system 30 . It should be understood that the vehicle 300 may also include more systems, which will not be repeated here.
  • the control system 10 may be configured to control the operation of the vehicle 300 and its components.
  • the parameter prediction device 102, ISP 103 and AI processor 104 shown in FIG. 1 may be set in the control system 10.
  • the control system 10 may also include devices such as a central processing unit, a memory, etc., and the memory is used to store the operating conditions of each processor. required commands and data.
  • Propulsion system 20 may be used for vehicle 300 to provide powered motion, which may include, but is not limited to, an engine/motor, energy source, transmission, and wheels.
  • the sensor system 30 may include, but is not limited to, a global positioning system, an inertial measurement unit, a lidar sensor, or a millimeter-wave radar sensor.
  • the camera 101 shown in FIG. 1 may be disposed in the sensor system 30 .
  • the components and systems of vehicle 300 may be coupled together through a system bus, network, and/or other connection mechanism to operate in interconnection with other components within and/or outside of their respective systems. In specific work, various components in the vehicle 300 cooperate with each other to realize various automatic driving functions.
  • the automatic driving function may include, but is not limited to, blind spot detection, parking assist or lane change assist, and the like.
  • the camera device 101 may periodically collect and generate images to be detected, and provide the images to be detected to the parameter prediction device 102 .
  • the parameter prediction device 102 predicts the parameters of the image processing algorithm for processing the image to be detected based on the image features of the image to be detected, and generates a parameter prediction value and provides it to the ISP 103.
  • the ISP103 adjusts the size of the adjustable parameters in the image processing algorithm run by the ISP103 based on the parameter prediction value, and then uses the image processing algorithm after parameter adjustment to perform multiple image processing processes to process the image to be detected, and converts it into the image to be detected by the AI processor 104.
  • the images recognized or calculated by the running image detection model can be provided to the AI processor 104, so that the AI processor 104 can perform reasoning or detection of a specific task and generate detection results.
  • Other components in the control system 10 eg, a CPU that executes decisions) control other devices or components to perform autonomous driving functions based on the detection results of the AI processor 104 .
  • FIG. 4 schematically shows an interaction process 400 between components in each electronic device 100 as described in FIG. 1 provided by an embodiment of the present application.
  • the process 400 includes the following steps:
  • step 401 the camera 101 collects image data, processes the collected image data, and generates an image A.
  • step 402 the camera 101 provides the image A to the ASIC 1021 and the ISP 103, respectively.
  • Step 403 the ASIC 1021 performs feature extraction on the image A, and generates a feature tensor based on the feature extraction result.
  • Step 404 the ASIC 1021 provides the feature tensor to the AI processor 1022 .
  • Step 405 the parameter prediction model running in the AI processor 1022 predicts the parameters of the image processing algorithm running in the ISP 103 based on the feature tensor, and generates a parameter prediction value.
  • the AI processor 1022 provides the parameter prediction value to the ISP 103.
  • Step 407 the ISP 103 adjusts the parameters of the image processing algorithm based on the parameter prediction value, and uses the image processing algorithm after parameter adjustment to process the image A to generate the image B.
  • step 408 the ISP 103 provides the image B to the AI processor 104 .
  • Step 409 the image detection model running in the AI processor 104 detects the image B, and generates a detection result.
  • steps or operations of the interaction process 400 shown in FIG. 4 are only examples, and other operations or variations of the respective operations in FIG. 4 may also be performed in this embodiment of the present application.
  • the embodiments of the present application may further include more or less steps than those shown in FIG. 4 .
  • steps 403 and 404 may be omitted, and the camera device 101 directly provides the image A to the AI processor 1022 .
  • the image output by the imaging device 101 is a color image.
  • the image output by the camera device 101 may be an image in a raw image format (RAW Image Format). Since the parameter prediction device 102 cannot perform feature extraction and prediction based on the RAW image, when the image captured by the camera device 101 is a RAW image, the ISP 103 can also perform the process of converting the RAW image into a color image. At this time, the camera device 101 can provide the RAW image to the ISP 103 , and the ISP 103 processes the RAW image to generate a color image and then provide it to the parameter prediction device 102 , as shown in FIG. 5 .
  • RAW Image Format raw image format
  • Image processing algorithms for converting RAW images into color images in ISP 103 may include, but are not limited to, dark current correction algorithms, lens shading correction algorithms, and demosaicing algorithms.
  • the structures of the parameter prediction apparatus 102 and the AI processor 104 shown in FIG. 5 are the same as the structures of the parameter prediction apparatus 102 and the AI processor 104 shown in FIG. It is not repeated here.
  • FIG. 6 shows an interaction process 600 between components in each electronic device 100 as shown in FIG. 5 provided by an embodiment of the present application.
  • steps 403 to 409 are the same as steps 403 to 409 shown in FIG. 4 , and details are not repeated here.
  • steps 401-402 in the interaction process 400 shown in FIG. 4 are replaced by steps 4011-4013 shown in FIG. 6:
  • step 4011 the camera 101 collects image data to obtain a RAW image.
  • step 4012 the camera 101 provides the RAW image to the ISP 103.
  • step 4013 the image processing algorithm run by the ISP 103 processes the RAW image to generate an image A.
  • step 4014 the ISP 103 provides the image A to the ASIC 1021 .
  • the color feature may be represented by a red-blue (RB) chromaticity histogram
  • the luminance feature may be represented by a luminance-differential luminance histogram
  • the edge feature may be represented by a two-dimensional edge feature map.
  • the ASIC 1021 described in the above embodiments can sequentially construct the RB chromaticity histogram H C , the luminance-differential luminance histogram HL and the edge feature map IE of the image to be detected.
  • the resolutions of the RB chrominance histogram H C , the luminance-difference luminance histogram HL and the edge feature map IE are equal.
  • the ASIC 1021 can combine the RB chrominance histogram H C , the luminance-difference luminance histogram HL and the edge feature map IE to generate a K ⁇ K ⁇ 3 feature tensor TF , where K ⁇ K are the resolutions of the RB chrominance histogram H C , the luminance-difference luminance histogram HL and the edge feature map IE respectively, namely
  • ⁇ r and ⁇ b represent the widths of a single histogram in the r and b directions in the chromaticity histogram, respectively, and ⁇ represents the number of elements in the set.
  • the brightness value Y of each pixel in the image to be detected is defined as the weighted summation result of the three-channel pixel values of the red channel pixel value R, the green channel pixel value G, and the blue channel pixel value B at the pixel, that is
  • the differential luminance value D of each pixel is defined as the average absolute difference between the luminance value at this pixel and the luminance values of 8 pixels in its area, namely
  • (x, y) represents the pixel at a certain coordinate point in the image
  • Y(x, y) represents the brightness of the pixel at the coordinate point
  • (x+i, y+j) represents the difference between (x, y) in the image )
  • the pixel distance at this coordinate point is the pixel of (i, j) coordinate
  • Y(x+i, y+j) represents the pixel brightness of (x+i, y+j) this coordinate point.
  • the differential luminance value at a pixel usually reflects how different the pixel is from surrounding pixels.
  • the column height H L (Y 0 , D 0 ) at the position (Y 0 , D 0 ) in the luminance histogram indicates that the luminance of the input image and the differential luminance coordinates (Y, D) fall within (Y 0 , D 0 )
  • the number of pixels in the corresponding range that is
  • ⁇ Y and ⁇ D represent the widths of a single histogram in the luminance histogram in the direction of luminance value Y and differential luminance value D, respectively.
  • the brightness channel of the image to be detected is generated by the Canny edge detection operator, morphological closure operation and spatial downsampling, namely
  • Resize( ) represents the spatial downsampling operation
  • Canny( ) represents the Canny edge detection operator
  • B represents the structural element used for the closing operation, usually a disk structure can be selected.
  • the Canny edge detection operator is used to detect the edge regions of objects in the image
  • the morphological closure operation is used to eliminate narrow discontinuities and long thin gaps in the edge image, eliminate small holes, and Breaks in contour lines are filled
  • spatial downsampling is used to process the edge image resolution to be equal to the resolution of the chrominance histogram H C and the luminance histogram HL.
  • the following takes the image processing algorithm including the tone mapping algorithm, the contrast enhancement algorithm, the edge enhancement algorithm and the noise reduction algorithm as an example, combined with Fig. 8, the image processing algorithm running in the ISP103 parameters are described in detail.
  • Tone mapping is used to receive a linear image with high bit depth, convert the linear image into a nonlinear image, and complete the compression of the image bit depth, and output an 8-bit image.
  • the adjustable parameter in the tone mapping algorithm is the ⁇ parameter
  • the adjustable parameter in the tone mapping algorithm is The base of the logarithmic transformation
  • the adjustable parameters in the tone mapping algorithm are the target brightness parameter (key), target saturation parameters (saturation) and filter kernel parameters used to generate the low pass filtered image.
  • Contrast Enhancement is used to enhance the contrast of an image.
  • the CLAHE contrast limited adaptive histogram equalization, contrast limited adaptive histogram equalization
  • Adjustable parameters in the CLAHE algorithm include: contrast threshold parameter and sub-image block size for histogram statistics.
  • the size of the sub-image block may be fixed, and only the contrast threshold parameter may be adjusted. Further, the size of the sub-image block can be fixed to the size of the input image.
  • the Y-channel image in the received image is first subjected to Gaussian filtering to obtain a low-pass Y-channel image Y L ; the difference image between the original Y-channel image and the low-pass Y-channel image Y L
  • the high-frequency signal usually corresponds to the edge area in the image; by amplifying the intensity of the high-frequency signal and superimposing it into the low-pass Y-channel image Y L , it can be
  • the adjustable parameter in the edge enhancement algorithm is the edge enhancement factor ⁇ .
  • the bilateral filter noise reduction algorithm is usually used.
  • the adjustable parameters may include: a spatial Gaussian kernel parameter ⁇ s used to control the relationship between the noise reduction intensity and the spatial distance, and a pixel used to control the relationship between the noise reduction intensity and the response value difference Value domain Gaussian kernel parameter ⁇ r.
  • FIG. 9 shows a schematic diagram 900 of a system architecture including an electronic device for generating a parameter prediction model provided by an embodiment of the present application.
  • the system architecture 900 includes a model training device 901 , a storage device 902 and a display device 903 .
  • the storage device 902 may include, but is not limited to, read-only memory or random access memory, and the like.
  • the storage device 902 is used to store the sample image S1.
  • the storage device 902 may also store executable programs and data of image processing algorithms for performing image processing, executable programs and data for performing image feature extraction, executable programs and data of the parameter prediction model to be trained, and data, and executable programs and data for an image detection model used to perform image detection.
  • the model training device 901 can run the feature extraction algorithm, the executable program and data of the parameter prediction model to be trained, the image processing algorithm and the image detection model, and the model training device 901 can also call the sample image S1, the image processing algorithm from the storage device 902
  • the model training device 901 may also store the data generated by the operation and the debugging results after each parameter debugging of the parameter prediction model to the storage device 902 .
  • model training device 901 and the storage device 902 may also be provided with I/O ports for data interaction with the display device 903 .
  • the user equipment 903 may include a display device such as a screen to mark the sample image S1.
  • the model training device 901 may acquire the sample image S1 from the storage device 902 , perform image processing on the sample image S1 and provide the sample image S1 to the display device 903 for presentation in the display device 903 .
  • the user annotates the sample image S1 through the display device 903 , and stores the annotation information of the sample image S1 in the storage device 902 .
  • FIG. 10 shows a process 1000 of a method for generating a parameter prediction model provided by an embodiment of the present application.
  • the execution body of the method for generating a parameter prediction model described in the embodiments of the present application may be the model training device 901 shown in FIG. 9 .
  • the method for generating a parameter prediction model includes the following steps:
  • Step 1001 based on the sample image set, perform feature extraction on the sample image S1 in the sample image set to generate a feature tensor.
  • the sample image set includes multiple sample images S1 and label information of each sample image S1.
  • the annotation information of the sample image S1 is annotated based on the detection content performed by the image detection model.
  • the annotation information of the sample image S1 may include the target object and the position of the target object in the sample image S1; when the image detection model is used to perform pedestrian intent detection, the sample image S1
  • the annotation information may include the target object and the action information of the target object.
  • the process of performing feature extraction on the sample image S1 to generate a feature tensor is the same as the process of generating a feature tensor described in the embodiment shown in FIG. description, which will not be repeated here.
  • Step 1002 input the feature tensor into the parameter prediction model, and generate the parameters of the image processing algorithm for processing the sample image S1.
  • the image processing algorithm includes, but is not limited to, a tone mapping algorithm, a noise reduction algorithm, a contrast enhancement algorithm, or an edge enhancement algorithm, and the like.
  • the parameters of the image processing algorithm specifically include but are not limited to: the target brightness parameter (key), the target saturation parameter (saturation) in the tone mapping algorithm, and the filter kernel parameter used to generate the low-pass filtered image; in the contrast enhancement algorithm
  • the parameter prediction model described in the embodiments of the present application may include one of the following: a random forest model, a support vector machine model, or a neural network model.
  • the structure of the parameter prediction model is described in detail below by taking the parameter prediction model as the neural network model as an example.
  • the parameter prediction model can include multi-layer convolutional layers, multi-layer pooling layers and fully connected layers. Among them, the convolution layer is used for feature extraction and convolution operations on the image to generate feature maps; the pooling layer is used to downsample and reduce the dimension of the feature maps; the fully connected layer uses several levels of fully connected neural networks to The feature vector output by the convolutional layer is calculated, and finally the predicted value of the parameter is output.
  • each convolutional layer can use a 3 ⁇ 3 convolution kernel, and set the number of channels of the output feature map to twice the input feature map, without changing the spatial resolution of the feature map;
  • Each pooling layer uses a max pooling operator to reduce the spatial resolution of the input feature map to 1/2 the original resolution.
  • the feature tensor input to the parameter prediction network is K ⁇ K ⁇ 3
  • the feature vector of 1 ⁇ 1 ⁇ 3K is generated after the feature tensor is processed by multiple convolutional layers and pooling layers.
  • the fully connected layer calculates the 1 ⁇ 1 ⁇ 3K feature vector, and generates a 1 ⁇ 1 ⁇ n parameter prediction vector.
  • Each element in the parameter prediction vector corresponds to a configurable parameter in the image processing algorithm.
  • W is the weight
  • x is the input vector (ie the input neuron)
  • b is the bias data
  • y is the output vector (ie the output neuron)
  • a is a constant.
  • the work of each layer in the deep neural network can be understood as completing the transformation from the input space to the output space (that is, the row space of the matrix to the column space) through five operations on the input space (set of input vectors). These five operations include: 1. Dimension up/down; 2. Zoom in/out; 3. Rotate; 4. Translation; 5. "Bend".
  • W is the weight vector
  • each value in the vector represents the weight value of a neuron in the convolutional layer of this layer.
  • This vector W determines the space transformation from the input space to the output space described above, that is, the weight W of each layer controls how the space is transformed.
  • Step 1003 Based on the generated parameters of the image processing algorithm for processing the sample image S1, adjust the image processing algorithm, and use the image processing algorithm after parameter adjustment to process the sample image S1 to generate a processed image B.
  • step 1004 the image B is detected by using the image detection model, and a detection result is generated.
  • the image detection model may perform at least one of the following detections: object detection, lane line detection, or pedestrian intent detection, and the like.
  • the image detection model is obtained by training a deep neural network based on the image dataset S1. Among them, the image detection model can be obtained by training using the traditional model training method, which will not be repeated here.
  • Step 1005 construct a loss function based on the detection result and the labeling information of the sample image S1.
  • a loss function is constructed based on the error between the detection result of each sample image S1 in the sample image dataset and the annotation information of the sample image S1.
  • the loss function may include, but is not limited to, a mean absolute error (MAE) loss function, a mean square error (MSE) loss function, or a cross entropy function, and the like.
  • the constructed loss function includes parameters to be adjusted in the parameter prediction model.
  • the parameters of the parameter prediction model are the weight matrices of all convolutional layers forming the parameter prediction model (the weight matrix formed by the vectors W of many convolutional layers).
  • Step 1006 determine whether a preset condition is reached.
  • the preset conditions here include at least one of the following: the loss value of the preset loss function is less than or equal to the preset threshold; the number of times of iteratively adjusting the parameters of the parameter prediction model is greater than or equal to the preset threshold.
  • the preset condition is reached, the parameters of the parameter prediction model are saved; when the preset condition is not reached, step 1007 is executed.
  • Step 1007 Adjust the parameters of the parameter prediction model by using the back-propagation algorithm and the gradient descent algorithm.
  • the gradient descent algorithm may specifically include, but is not limited to, optimization algorithms such as SGD and Adam.
  • optimization algorithms such as SGD and Adam.
  • the chain rule can be used to calculate the gradient of the preset loss function with respect to each weight matrix in the parameter prediction model.
  • the parameters of the image processing algorithm are adjusted by the back-propagation algorithm based on the preset loss function, the parameters in the image detection model are kept unchanged.
  • the image detection algorithms described in the embodiments of the present application all have differentiability, so as to facilitate backpropagation based on the chain rule.
  • the parameter prediction model that makes the loss function reach a minimum value can be obtained. optimal parameter value.
  • Figure 11 is a flow chart 1100 of an image detection method provided by an embodiment of the present application, and as shown in Figure 11, the method may include the following steps:
  • Step 1101 acquiring an image to be detected.
  • Step 1102 based on the image features of the image to be detected, use a pre-trained parameter prediction model to predict the parameters of the image processing algorithm used to process the image to be detected, and generate a parameter prediction value.
  • Step 1103 Perform image processing on the image to be detected by using the image processing algorithm after parameter adjustment to generate a processed image.
  • Step 1104 Input the processed image into a pre-trained image detection model to generate a detection result.
  • the electronic device includes corresponding hardware and/or software modules for executing each function.
  • the present application can be implemented in hardware or in the form of a combination of hardware and computer software in conjunction with the algorithm steps of each example described in conjunction with the embodiments disclosed herein. Whether a function is performed by hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functionality for each particular application in conjunction with the embodiments, but such implementations should not be considered beyond the scope of this application.
  • the above one or more processors may be divided into functional modules according to the foregoing method examples.
  • each functional module may be divided corresponding to each function, or two or more functions may be integrated into one processing module.
  • the above-mentioned integrated modules can be implemented in the form of hardware. It should be noted that, the division of modules in this embodiment is schematic, and is only a logical function division, and there may be other division manners in actual implementation.
  • FIG. 12 shows a possible schematic diagram of the composition of the image detection apparatus 1200 involved in the above embodiment.
  • the image detection apparatus 1200 may include: An acquisition module 1201 , a prediction module 1202 , an adjustment module 1203 , a processing module 1204 and a detection module 1205 .
  • the acquisition module 1201 is configured to acquire the image to be detected;
  • the prediction module 1202 is configured to use a pre-trained parameter prediction model based on the image features of the image to be detected, to process the image for processing the image to be detected.
  • the parameters of the processing algorithm are predicted to generate parameter predicted values; the adjustment module 1203 is configured to adjust the parameters of the image processing algorithm based on the parameter predicted values; the processing module 1204 is configured to use the image processing algorithm adjusted by the parameters Image processing is performed on the to-be-detected image to generate a processed image; the detection module 1205 is configured to input the processed image into a pre-trained image detection model to generate a detection result.
  • the parameter prediction model is obtained by comparing the annotation information of the sample image with the detection result of the sample image by the image detection model, and training based on the comparison result.
  • the image detection apparatus further includes a parameter prediction model training module (not shown in the figure), and the parameter prediction model training module includes: a comparison sub-module configured to compare the sample image The detection result of the sample image is compared with the annotation information of the sample image to obtain the comparison result; the adjustment sub-module is configured to iteratively adjust the parameters of the parameter prediction model based on the comparison result; the saving sub-module is configured to When the preset condition is satisfied, the parameters of the parameter prediction model are saved.
  • a comparison sub-module configured to compare the sample image The detection result of the sample image is compared with the annotation information of the sample image to obtain the comparison result
  • the adjustment sub-module is configured to iteratively adjust the parameters of the parameter prediction model based on the comparison result
  • the saving sub-module is configured to When the preset condition is satisfied, the parameters of the parameter prediction model are saved.
  • the comparison result is an error
  • the adjustment sub-module is further configured to: based on the error between the detection result of the sample image and the annotation information of the sample image, construct A target loss function, wherein the target loss function includes parameters to be adjusted in the parameter prediction model; based on the target loss function, the parameters of the image processing algorithm are iteratively adjusted by using a back-propagation algorithm and a gradient descent algorithm.
  • the prediction module 1202 is configured to: perform feature extraction on the to-be-detected image to generate a feature tensor; input the feature tensor into the parameter prediction model to generate the feature tensor Parameter predictions.
  • the prediction module 1202 is configured to: input the image to be detected into the parameter prediction model to generate the parameter prediction value.
  • the image processing algorithm includes at least one of the following: a tone mapping algorithm, a contrast enhancement algorithm, an image edge enhancement algorithm, and an image noise reduction algorithm.
  • the image detection model is used to perform at least one of the following detection tasks: labeling of detection frames, recognition of target objects, prediction of confidence levels, and prediction of motion trajectories of target objects.
  • the image detection apparatus 1200 provided in this embodiment is configured to execute the image detection method executed by the electronic device 100, and can achieve the same effect as the above-mentioned implementation method.
  • Each module corresponding to FIG. 12 can be implemented by software, hardware or a combination of the two.
  • each module can be implemented in software to drive the parameter prediction device 102, ISP 103 and AI processing in the electronic device 100 shown in FIG. 1 .
  • device 104 can be implemented in software to drive the parameter prediction device 102, ISP 103 and AI processing in the electronic device 100 shown in FIG. 1 . device 104.
  • each module may include a corresponding processor and a corresponding driver software.
  • the image detection apparatus 1200 may include at least one processor and memory. Wherein, at least one processor can call all or part of the computer program stored in the memory to control and manage the actions of the electronic device 100, for example, it can be used to support the electronic device 100 to perform the steps performed by the above-mentioned modules.
  • the memory may be used to support the execution of the electronic device 100 by storing program codes and data, and the like.
  • the processor may implement or execute various exemplary logic modules described in conjunction with the present disclosure, which may be a combination of one or more microprocessors that implement computing functions, such as, but not limited to, the image signal shown in FIG. 1 . Processor 103 and AI Processor 104.
  • the microprocessor combination may also include a central processing unit, a controller, and the like.
  • the processor may include other programmable logic devices, transistor logic devices, or discrete hardware components in addition to the processors shown in FIG. 1 .
  • the memory may include random access memory (RAM) and read only memory (ROM), among others.
  • the random access memory can include volatile memory (such as SRAM, DRAM, DDR (Double Data Rate SDRAM, Double Data Rate SDRAM) or SDRAM, etc.) and non-volatile memory.
  • the RAM can store data (such as image processing algorithms, etc.) and parameters required for the operation of the parameter prediction device 102, ISP 103 and the AI processor 104, intermediate data generated by the operation of the parameter prediction device 102, ISP 103 and the AI processor 104, and the ISP 103
  • the processed image data, the output result after the AI processor 104 runs, and the like.
  • Executable programs of the parameter prediction device 102 , the ISP 103 and the AI processor 104 may be stored in the read-only memory ROM. Each of the above components can perform their own work by loading an executable program.
  • the executable program stored in the memory can execute the image detection method as described in FIG. 11 .
  • FIG. 13 shows a possible schematic diagram of the composition of the apparatus 1300 for training a parameter prediction model involved in the above embodiment.
  • the apparatus 1300 for training a parameter prediction model may include: a prediction module 1301 , a first adjustment module 1302 , a processing module 1303 , a detection module 1304 , a comparison module 1305 and a second adjustment module 1306 .
  • the prediction module 1301 is configured to use a parameter prediction model to predict the parameters of the image processing algorithm used to process the sample image based on the image features of the sample image, and generate a parameter prediction value;
  • the first adjustment module 1302 is configured by is configured to adjust the parameters of the image processing algorithm based on the parameter prediction value;
  • the processing module 1303 is configured to perform image processing on the sample image by using the image processing algorithm after parameter adjustment, and generate a processed image;
  • a comparison module 1305, is configured to compare the error between the detection result and the labeling information of the sample image, and obtain a comparison result ;
  • the second adjustment module 1306 is configured to adjust the parameters of the parameter prediction model based on the comparison result;
  • the saving module is configured to save the parameters of the parameter prediction model when a preset condition is satisfied.
  • the comparison result is an error
  • the second adjustment module 1306 is configured to: construct an objective loss function based on the error between the detection result and the annotation information of the sample image,
  • the target loss function includes parameters to be adjusted in the parameter prediction model; based on the target loss function, the parameters of the parameter prediction model are iteratively adjusted by using a back-propagation algorithm and a gradient descent algorithm.
  • the prediction module 1301 is configured to: perform feature extraction on the sample image to generate a feature tensor; input the feature tensor into the parameter prediction model to generate the parameter prediction value .
  • the prediction module 1301 is configured to: input the sample image into the parameter prediction model to generate the parameter prediction value.
  • the apparatus 1300 for training a parameter prediction model may include at least one processor and storage device.
  • at least one processor can call all or part of the computer program stored in the memory to control and manage the actions of the model training device 901 as shown in FIG. step.
  • the memory may be used to support the execution of the model training device 901 by storing program codes and data, and the like.
  • the processor can implement or execute various exemplary logic modules described in conjunction with the disclosure of the present application, which can be one or more microprocessor combinations that implement computing functions, including but not limited to a central processing unit and a controller, etc. .
  • the processor may also include other programmable logic devices, transistor logic devices, or discrete hardware components, or the like.
  • the memory may include random access memory (RAM), read only memory ROM, and the like.
  • the random access memory can include volatile memory (such as SRAM, DRAM, DDR (Double Data Rate SDRAM, Double Data Rate SDRAM) or SDRAM, etc.) and non-volatile memory.
  • the RAM may store data (such as image processing algorithms, etc.) and parameters required by the model training device 901 to run, intermediate data generated by the model training device 901 running, and output results after the model training device 901 runs.
  • An executable program of the model training apparatus 901 may be stored in the read-only memory ROM. Each of the above components can perform their own work by loading an executable program.
  • the executable program stored in the memory may perform the method for training a parameter prediction model as described in FIG. 10 .
  • This embodiment further provides a computer-readable storage medium, where computer instructions are stored in the computer-readable storage medium, and when the computer instructions are executed on the computer, the computer executes the above-mentioned related method steps to realize the image detection in the above-mentioned embodiment.
  • This embodiment also provides a computer program product, which, when the computer program product runs on a computer, causes the computer to execute the above-mentioned relevant steps, so as to realize the image detection method of the image detection apparatus 1100 in the above-mentioned embodiment, or to realize the above-mentioned embodiment.
  • the computer-readable storage medium or computer program product provided in this embodiment is used to execute the corresponding method provided above. Therefore, for the beneficial effect that can be achieved, reference may be made to the corresponding method provided above. The beneficial effects will not be repeated here.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.
  • the integrated unit if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a readable storage medium.
  • a readable storage medium includes several instructions to make a device (which may be a single chip microcomputer, a chip, etc.) or a processor (processor) to execute all or part of the steps of the methods in the various embodiments of the present application.
  • the aforementioned readable storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), magnetic disk or optical disk, etc. that can store program codes. medium.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Evolutionary Computation (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Computing Systems (AREA)
  • Databases & Information Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • Image Analysis (AREA)

Abstract

An image detection method and apparatus, and an electronic device. The image detection method comprises: acquiring an image to be subjected to detection; on the basis of an image feature of said image, predicting, by using a pre-trained parameter prediction model, a parameter of an image processing algorithm used for processing said image, so as to generate a parameter predicted value; adjusting the parameter of the image processing algorithm on the basis of the parameter predicted value; performing, by using the image processing algorithm that has been subjected to parameter adjustment, image processing on said image, so as to generate a processed image; and inputting the processed image into a pre-trained image detection model, so as to generate a detection result. By means of the method, the accuracy of a detection result of an image detection model can be improved.

Description

图像检测方法、装置和电子设备Image detection method, device and electronic device 技术领域technical field

本申请实施例涉及人工智能技术领域,尤其涉及一种图像检测方法、装置和电子设备。The embodiments of the present application relate to the technical field of artificial intelligence, and in particular, to an image detection method, apparatus, and electronic device.

背景技术Background technique

随着科学技术的发展,人工智能(AI,Artificial Intelligence)技术得到突飞猛进的提升。在一些人工智能技术中,通常采用机器学习的方法,构建各种结构的初始模型,例如神经网络模型、支持向量机模型、决策树模型等。然后,通过训练样本对初始模型进行训练,以实现图像检测、语音识别等功能。With the development of science and technology, artificial intelligence (AI, Artificial Intelligence) technology has been improved by leaps and bounds. In some artificial intelligence technologies, machine learning methods are usually used to construct initial models of various structures, such as neural network models, support vector machine models, and decision tree models. Then, the initial model is trained by training samples to realize functions such as image detection, speech recognition, etc.

基于图像检测的计算机视觉技术中,通过对诸如神经网络等初始模型训练得到感知模型,以实现场景识别、物体检测或者图像分割等图像检测任务。通常,感知模型是对所输入的图像进行特征提取和检测以输出检测结果的,因此,感知模型对所输入的图像的亮度、颜色、纹理等特征有特定需求,例如图像纹理清晰、亮度适中等。在诸如黑夜、起雾、眩光或者扬尘等场景中,用于形成图像的亮度、颜色、纹理等特征的指标发生改变,导致图像过暗、图像纹理不清晰等,从而导致感知模型输出的检测结果与真实结果之间存在较大的偏差。由此,针对各种场景采集的图像,如何使得感知模型均可以输出较为准确的检测结果,成为需要解决的问题。In the computer vision technology based on image detection, a perception model is obtained by training an initial model such as a neural network to realize image detection tasks such as scene recognition, object detection or image segmentation. Usually, the perceptual model extracts and detects the input image to output the detection result. Therefore, the perceptual model has specific requirements for the brightness, color, texture and other characteristics of the input image, such as clear image texture, moderate brightness, etc. . In scenes such as night, fog, glare or dust, the indicators used to form the brightness, color, texture and other characteristics of the image change, resulting in too dark image, unclear image texture, etc., resulting in detection results output by the perception model There is a large deviation from the real results. Therefore, for images collected in various scenes, how to enable the perception model to output relatively accurate detection results has become a problem to be solved.

发明内容SUMMARY OF THE INVENTION

本申请提供的图像检测方法、装置和电子设备,可以使得图像检测模型针对各种场景采集的图像均可以输出较为准确的检测结果。The image detection method, device and electronic device provided by the present application can enable the image detection model to output relatively accurate detection results for images collected in various scenarios.

为达到上述目的,本申请采用如下技术方案:To achieve the above object, the application adopts the following technical solutions:

第一方面,本申请实施例提供一种图像检测方法,该图像检测方法包括:获取待检测图像;基于所述待检测图像的图像特征,利用预先训练的参数预测模型,对用于处理所述待检测图像的图像处理算法的参数进行预测,生成参数预测值;基于所述参数预测值,调整所述图像处理算法的参数;利用参数调整后的图像处理算法对所述待检测图像进行图像处理,生成处理后的图像;将所述处理后的图像输入至预先训练的图像检测模型,生成检测结果。In a first aspect, an embodiment of the present application provides an image detection method, the image detection method includes: acquiring an image to be detected; Predict the parameters of the image processing algorithm of the image to be detected, and generate a parameter prediction value; based on the parameter prediction value, adjust the parameters of the image processing algorithm; use the image processing algorithm after parameter adjustment to perform image processing on the image to be detected , generating a processed image; inputting the processed image into a pre-trained image detection model to generate a detection result.

本申请实施例通过设置参数预测模型对图像处理算法的参数进行预测,并且图像处理算法利用该参数预测值对待检测图像进行处理,使得输入至图像检测模型的图像的动态范围、噪声、对比度等参数,与用于训练图像检测模型的样本图像的动态范围、噪声水平、局部对比度等参数相同或相似,有利于提高图像检测模型检测结果的准确性。In this embodiment of the present application, a parameter prediction model is set to predict the parameters of the image processing algorithm, and the image processing algorithm uses the parameter prediction value to process the image to be detected, so that the dynamic range, noise, contrast and other parameters of the image input to the image detection model , which is the same or similar to the dynamic range, noise level, local contrast and other parameters of the sample image used to train the image detection model, which is beneficial to improve the accuracy of the detection result of the image detection model.

基于第一方面,在一种可能的实现方式中,所述参数预测模型是通过比较样本图像的标注信息和图像检测模型对所述样本图像的检测结果、并且基于比较结果训练得到的。Based on the first aspect, in a possible implementation manner, the parameter prediction model is obtained by comparing the annotation information of the sample image with the detection result of the sample image by the image detection model, and training based on the comparison result.

基于第一方面,在一种可能的实现方式中,所述参数预测模型通过如下步骤训练得到:将所述样本图像的检测结果和所述样本图像的标注信息进行比较以得到所述比较结果;基于所述比较结果迭代调整所述参数预测模型的参数;在预设条件满足时,保存所述参数预测模型的参数。Based on the first aspect, in a possible implementation manner, the parameter prediction model is obtained by training the following steps: comparing the detection result of the sample image with the annotation information of the sample image to obtain the comparison result; Iteratively adjusts the parameters of the parameter prediction model based on the comparison result; and saves the parameters of the parameter prediction model when a preset condition is satisfied.

这里的预设条件可以包括但不限于:误差小于或等于预设阈值,或者迭代次数大于等于预设阈值。The preset conditions here may include but are not limited to: the error is less than or equal to a preset threshold, or the number of iterations is greater than or equal to a preset threshold.

基于第一方面,在一种可能的实现方式中,所述比较结果为误差,所述基于所述比较结果迭代调整所述参数预测模型的参数,包括:基于所述样本图像的检测结果和所述样本图像的标注信息之间的所述误差,构建目标损失函数,其中所述目标损失函数包括所述参数预测模型中待调整的参数;基于所述目标损失函数,利用反向传播算法和梯度下降算法,迭代调整所述图像处理算法的参数。Based on the first aspect, in a possible implementation manner, the comparison result is an error, and the iteratively adjusting the parameters of the parameter prediction model based on the comparison result includes: based on the detection result of the sample image and the According to the error between the label information of the sample images, a target loss function is constructed, wherein the target loss function includes the parameters to be adjusted in the parameter prediction model; based on the target loss function, the back propagation algorithm and gradient A descent algorithm that iteratively adjusts the parameters of the image processing algorithm.

基于第一方面,在一种可能的实现方式中,所述基于所述待检测图像的图像特征,利用预先训练的参数预测模型,对用于处理所述待检测图像的图像处理算法的参数进行预测,生成参数预测值,包括:对所述待检测图像进行特征提取,生成特征张量;将所述特征张量输入至所述参数预测模型,生成所述参数预测值。Based on the first aspect, in a possible implementation manner, the parameters of the image processing algorithm for processing the to-be-detected image are performed using a pre-trained parameter prediction model based on the image features of the to-be-detected image. Predicting, generating a parameter prediction value includes: performing feature extraction on the to-be-detected image to generate a feature tensor; inputting the feature tensor into the parameter prediction model to generate the parameter prediction value.

基于第一方面,在一种可能的实现方式中,所述基于所述待检测图像的图像特征,利用预先训练的参数预测模型,对用于处理所述待检测图像的图像处理算法的参数进行预测,生成参数预测值,包括:将所述待检测图像输入至所述参数预测模型,生成所述参数预测值。Based on the first aspect, in a possible implementation manner, the parameters of the image processing algorithm for processing the to-be-detected image are performed using a pre-trained parameter prediction model based on the image features of the to-be-detected image. Predicting, generating a parameter prediction value includes: inputting the to-be-detected image into the parameter prediction model to generate the parameter prediction value.

基于第一方面,在一种可能的实现方式中,所述图像处理算法包括以下至少一项:阶调映射算法、对比度增强算法、图像边缘增强算法和图像降噪算法。Based on the first aspect, in a possible implementation manner, the image processing algorithm includes at least one of the following: a tone mapping algorithm, a contrast enhancement algorithm, an image edge enhancement algorithm, and an image noise reduction algorithm.

基于第一方面,在一种可能的实现方式中,所述图像检测模型用于执行以下至少一项检测任务:检测框的标注、目标对象的识别、置信度的预测、目标对象运动轨迹的预测。Based on the first aspect, in a possible implementation manner, the image detection model is used to perform at least one of the following detection tasks: labeling of detection frames, recognition of target objects, prediction of confidence levels, and prediction of motion trajectories of target objects .

第二方面,本申请实施例提供一种图像检测装置,该图像检测装置包括:获取模块,被配置成获取待检测图像;生成模块,被配置成基于所述待检测图像的图像特征,利用预先训练的参数预测模型,对用于处理所述待检测图像的图像处理算法的参数进行预测,生成参数预测值;调整模块,被配置成基于所述参数预测值,调整所述图像处理算法的参数;处理模块,被配置成利用参数调整后的图像处理算法对所述待检测图像进行图像处理,生成处理后的图像;检测模块,被配置成将所述处理后的图像输入至预先训练的图像检测模型,生成检测结果。In a second aspect, an embodiment of the present application provides an image detection device, the image detection device includes: an acquisition module configured to acquire an image to be detected; a generation module configured to use a pre- The trained parameter prediction model predicts the parameters of the image processing algorithm used to process the image to be detected, and generates parameter prediction values; an adjustment module is configured to adjust the parameters of the image processing algorithm based on the parameter prediction values. a processing module, configured to perform image processing on the image to be detected using an image processing algorithm after parameter adjustment, to generate a processed image; a detection module, configured to input the processed image to a pre-trained image Detect the model and generate detection results.

基于第二方面,在一种可能的实现方式中,所述参数预测模型是通过比较样本图像的标注信息和图像检测模型对所述样本图像的检测结果、并且基于比较结果训练得到的。Based on the second aspect, in a possible implementation manner, the parameter prediction model is obtained by comparing the annotation information of the sample image with the detection result of the sample image by the image detection model, and training based on the comparison result.

基于第二方面,在一种可能的实现方式中,所述图像检测装置还包括参数预测模型训练模块,所述参数预测模型训练模块包括:比较子模块,被配置成将所述样本图像的检测结果和所述样本图像的标注信息进行比较以得到所述比较结果调整子模块,被配置成基于所述比较结果迭代调整所述参数预测模型的参数;保存子模块,被配置成在预设条件满足时,保存所述参数预测模型的参数。Based on the second aspect, in a possible implementation manner, the image detection apparatus further includes a parameter prediction model training module, and the parameter prediction model training module includes: a comparison sub-module configured to detect the sample image The result is compared with the annotation information of the sample image to obtain the comparison result adjustment sub-module, which is configured to iteratively adjust the parameters of the parameter prediction model based on the comparison result; the saving sub-module is configured to be in a preset condition. When satisfied, the parameters of the parameter prediction model are saved.

基于第二方面,在一种可能的实现方式中,所述比较结果为误差,所述调整子模块进一步被配置成:基于所述样本图像的检测结果和所述样本图像的标注信息之间的所述误 差,构建目标损失函数,其中所述目标损失函数包括所述参数预测模型中待调整的参数;基于所述目标损失函数,利用反向传播算法和梯度下降算法,迭代调整所述图像处理算法的参数。Based on the second aspect, in a possible implementation manner, the comparison result is an error, and the adjustment sub-module is further configured to: based on the difference between the detection result of the sample image and the annotation information of the sample image For the error, a target loss function is constructed, wherein the target loss function includes the parameters to be adjusted in the parameter prediction model; based on the target loss function, the image processing is iteratively adjusted by using a back-propagation algorithm and a gradient descent algorithm parameters of the algorithm.

基于第二方面,在一种可能的实现方式中,所述生成模块被配置成:对所述待检测图像进行特征提取,生成特征张量;将所述特征张量输入至所述参数预测模型,生成所述参数预测值。Based on the second aspect, in a possible implementation manner, the generating module is configured to: perform feature extraction on the to-be-detected image to generate a feature tensor; input the feature tensor into the parameter prediction model , to generate the predicted value of the parameter.

基于第二方面,在一种可能的实现方式中,所述生成模块被配置成:将所述待检测图像输入至所述参数预测模型,生成所述参数预测值。Based on the second aspect, in a possible implementation manner, the generating module is configured to: input the image to be detected into the parameter prediction model, and generate the parameter prediction value.

基于第二方面,在一种可能的实现方式中,所述图像处理算法包括以下至少一项:阶调映射算法、对比度增强算法、图像边缘增强算法和图像降噪算法。Based on the second aspect, in a possible implementation manner, the image processing algorithm includes at least one of the following: a tone mapping algorithm, a contrast enhancement algorithm, an image edge enhancement algorithm, and an image noise reduction algorithm.

基于第二方面,在一种可能的实现方式中,所述图像检测模型用于执行以下至少一项检测任务:检测框的标注、目标对象的识别、置信度的预测、目标对象运动轨迹的预测。Based on the second aspect, in a possible implementation manner, the image detection model is used to perform at least one of the following detection tasks: labeling a detection frame, identifying a target object, predicting a confidence level, and predicting a motion trajectory of the target object .

第三方面,本申请实施例提供一种用于训练参数预测模型的方法,该方法包括:基于样本图像的图像特征,利用参数预测模型,对用于处理所述样本图像的图像处理算法的参数进行预测,生成参数预测值;基于所述参数预测值,调整所述图像处理算法的参数;利用参数调整后的图像处理算法对所述样本图像进行图像处理,生成处理后的图像;将所述处理后的图像输入至预先训练的图像检测模型,生成检测结果;比较所述检测结果和所述样本图像的标注信息之间的误差,得到比较结果;基于所述比较结果,调整所述参数预测模型的参数;在预设条件满足时,保存所述参数预测模型的参数。In a third aspect, an embodiment of the present application provides a method for training a parameter prediction model, the method comprising: based on an image feature of a sample image, using the parameter prediction model, adjusting the parameters of an image processing algorithm used to process the sample image performing prediction to generate a parameter prediction value; adjusting the parameters of the image processing algorithm based on the parameter prediction value; performing image processing on the sample image by using the parameter-adjusted image processing algorithm to generate a processed image; The processed image is input to a pre-trained image detection model to generate a detection result; the error between the detection result and the labeling information of the sample image is compared to obtain a comparison result; based on the comparison result, the parameter prediction is adjusted The parameters of the model; when the preset conditions are satisfied, the parameters of the parameter prediction model are saved.

基于第三方面,在一种可能的实现方式中,所述比较结果为误差,所述基于所述比较结果,调整所述参数预测模型的参数,包括:基于所述检测结果和所述样本图像的标注信息之间的所述误差,构建目标损失函数,其中所述目标损失函数包括所述参数预测模型中待调整的参数;基于所述目标损失函数,利用反向传播算法和梯度下降算法,迭代调整所述参数预测模型的参数。Based on the third aspect, in a possible implementation manner, the comparison result is an error, and adjusting the parameters of the parameter prediction model based on the comparison result includes: based on the detection result and the sample image The error between the labeling information, constructs a target loss function, wherein the target loss function includes the parameters to be adjusted in the parameter prediction model; based on the target loss function, using the back-propagation algorithm and the gradient descent algorithm, Iteratively adjust the parameters of the parameter prediction model.

基于第三方面,在一种可能的实现方式中,所述比较结果为误差,所述基于所述比较结果,调整所述参数预测模型的参数,包括:基于所述检测结果和所述样本图像的标注信息之间的所述误差,构建目标损失函数,其中所述目标损失函数包括所述参数预测模型中待调整的参数;基于所述目标损失函数,利用反向传播算法和梯度下降算法,迭代调整所述参数预测模型的参数。Based on the third aspect, in a possible implementation manner, the comparison result is an error, and adjusting the parameters of the parameter prediction model based on the comparison result includes: based on the detection result and the sample image The error between the labeling information, constructs a target loss function, wherein the target loss function includes the parameters to be adjusted in the parameter prediction model; based on the target loss function, using the back-propagation algorithm and the gradient descent algorithm, Iteratively adjust the parameters of the parameter prediction model.

基于第三方面,在一种可能的实现方式中,所述基于样本图像的图像特征,利用待训练的参数预测模型,对用于处理所述样本图像的图像处理算法的参数进行预测,生成参数预测值;包括:对所述样本图像进行特征提取,生成特征张量;将所述特征张量输入至所述参数预测模型,生成所述参数预测值。Based on the third aspect, in a possible implementation manner, the parameter prediction model to be trained is used to predict the parameters of the image processing algorithm for processing the sample image based on the image features of the sample image, and the parameters are generated. The predicted value includes: performing feature extraction on the sample image to generate a feature tensor; inputting the feature tensor into the parameter prediction model to generate the parameter predicted value.

基于第三方面,在一种可能的实现方式中,所述基于样本图像的图像特征,利用待训练的参数预测模型,对用于处理所述样本图像的图像处理算法的参数进行预测,生成参数预测值,包括:将所述样本图像输入至所述参数预测模型,生成所述参数预测值。Based on the third aspect, in a possible implementation manner, the parameter prediction model to be trained is used to predict the parameters of the image processing algorithm for processing the sample image based on the image features of the sample image, and the parameters are generated. The predicted value includes: inputting the sample image into the parameter prediction model to generate the parameter predicted value.

基于第三方面,在一种可能的实现方式中,所述图像处理算法包括以下至少一项:阶调映射算法、对比度增强算法、图像边缘增强算法和图像降噪算法。Based on the third aspect, in a possible implementation manner, the image processing algorithm includes at least one of the following: a tone mapping algorithm, a contrast enhancement algorithm, an image edge enhancement algorithm, and an image noise reduction algorithm.

基于第三方面,在一种可能的实现方式中,所述图像检测模型用于执行以下至少一项 检测任务:检测框的标注、目标对象的识别、置信度的预测、目标对象运动轨迹的预测。Based on the third aspect, in a possible implementation manner, the image detection model is used to perform at least one of the following detection tasks: labeling a detection frame, identifying a target object, predicting a confidence level, and predicting a motion trajectory of the target object .

第四方面,本申请实施例提供一种电子设备,该电子设备包括:摄像装置,用于获取待检测图像;参数预测装置,用于基于所述待检测图像的图像特征,利用预先训练的参数预测模型,对用于处理所述待检测图像的图像处理算法的参数进行预测,生成参数预测值;图像信号处理器,用于基于所述参数预测值,调整所述图像处理算法的参数,利用参数调整后的图像处理算法对所述待检测图像进行图像处理,生成处理后的图像;人工智能处理器,用于将所述处理后的图像输入至预先训练的图像检测模型,生成检测结果。In a fourth aspect, an embodiment of the present application provides an electronic device, the electronic device includes: a camera device for acquiring an image to be detected; a parameter prediction device for using pre-trained parameters based on image features of the image to be detected a prediction model, for predicting parameters of an image processing algorithm used to process the image to be detected, and generating a parameter prediction value; an image signal processor for adjusting the parameters of the image processing algorithm based on the parameter prediction value, using The parameter-adjusted image processing algorithm performs image processing on the to-be-detected image to generate a processed image; an artificial intelligence processor is used to input the processed image into a pre-trained image detection model to generate a detection result.

第五方面,本申请实施例提供一种图像检测装置,该图像检测装置包括一个或多个处理器和存储器;所述存储器耦合至所述处理器,所述存储器用于存储一个或多个程序;所述一个或多个处理器用于运行所述一个或多个程序,以实现如第一方面所述的方法。In a fifth aspect, an embodiment of the present application provides an image detection device, the image detection device includes one or more processors and a memory; the memory is coupled to the processor, and the memory is used to store one or more programs ; the one or more processors are configured to run the one or more programs to implement the method according to the first aspect.

第六方面,本申请实施例提供一种用于训练参数预测模型的装置,该用于训练参数预测模型的装置包括一个或多个处理器和存储器;所述存储器耦合至所述处理器,所述存储器用于存储一个或多个程序;所述一个或多个处理器用于运行所述一个或多个程序,以实现如第三方面所述的方法。In a sixth aspect, an embodiment of the present application provides an apparatus for training a parameter prediction model, the apparatus for training a parameter prediction model includes one or more processors and a memory; the memory is coupled to the processor, and the The memory is used to store one or more programs; the one or more processors are used to execute the one or more programs to implement the method according to the third aspect.

第七方面,本申请实施例提供一种计算机可读存储介质,该计算机可读存储介质中存储有计算机程序,该计算机程序被至少一个处理器执行时用于实现如第一方面所述的方法。In a seventh aspect, an embodiment of the present application provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and the computer program is used to implement the method according to the first aspect when the computer program is executed by at least one processor. .

第八方面,本申请实施例提供一种计算机程序产品,该计算机程序产品被至少一个处理器执行时用于实现如第一方面所述的方法。In an eighth aspect, an embodiment of the present application provides a computer program product, which is used to implement the method according to the first aspect when the computer program product is executed by at least one processor.

应当理解的是,本申请的第二至八方面与本申请的第一方面的技术方案一致,各方面及对应的可行实施方式所取得的有益效果相似,不再赘述。It should be understood that the second to eighth aspects of the present application are consistent with the technical solutions of the first aspect of the present application, and the beneficial effects obtained by each aspect and the corresponding feasible implementation manner are similar, and will not be repeated here.

附图说明Description of drawings

为了更清楚地说明本申请实施例的技术方案,下面将对本申请实施例的描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions of the embodiments of the present application more clearly, the following briefly introduces the drawings that are used in the description of the embodiments of the present application. Obviously, the drawings in the following description are only some embodiments of the present application. , for those of ordinary skill in the art, other drawings can also be obtained from these drawings without creative labor.

图1是本申请实施例提供的电子设备的一个结构示意图;1 is a schematic structural diagram of an electronic device provided by an embodiment of the present application;

图2a是本申请实施例提供的如图1所示的参数预测装置的一个结构示意图;FIG. 2a is a schematic structural diagram of the parameter prediction apparatus shown in FIG. 1 provided by an embodiment of the present application;

图2b是本申请实施例提供的如图1所示的参数预测装置的又一个结构示意图;FIG. 2b is another schematic structural diagram of the parameter prediction apparatus shown in FIG. 1 provided by an embodiment of the present application;

图3是本申请实施例提供的车辆的一个结构示意图;3 is a schematic structural diagram of a vehicle provided by an embodiment of the present application;

图4是本申请实施例提供的如图1所述的各电子设备中各部件之间的一个交互流程图;FIG. 4 is an interaction flowchart between components in each electronic device as shown in FIG. 1 provided by an embodiment of the present application;

图5是本申请实施例提供的电子设备的又一个结构示意图;5 is another schematic structural diagram of an electronic device provided by an embodiment of the present application;

图6是本申请实施例提供的如图5所述的电子设备中各部件之间的一个交互流程图;FIG. 6 is an interaction flowchart between components in the electronic device as shown in FIG. 5 provided by an embodiment of the present application;

图7是本申请实施例提供的对待检测图像进行特征提取以生成特征张量的方法的一个示意图;7 is a schematic diagram of a method for performing feature extraction on an image to be detected to generate a feature tensor provided by an embodiment of the present application;

图8是本申请实施例提供的图像处理算法所包括的参数的一个示意图;8 is a schematic diagram of parameters included in an image processing algorithm provided by an embodiment of the present application;

图9是本申请实施例提供的包含用于对图像预测模型进行训练的电子设备的系统架构示意图;9 is a schematic diagram of a system architecture including an electronic device for training an image prediction model provided by an embodiment of the present application;

图10是本申请实施例提供的用于训练参数预测模型的方法的一个流程图;10 is a flowchart of a method for training a parameter prediction model provided by an embodiment of the present application;

图11是本申请实施例提供的图像检测方法的一个流程图;11 is a flowchart of an image detection method provided by an embodiment of the present application;

图12是本申请实施例提供的图像处理装置的一个结构示意图;12 is a schematic structural diagram of an image processing apparatus provided by an embodiment of the present application;

图13是本申请实施例提供的用于训练参数预测模型的装置的一个结构示意图。FIG. 13 is a schematic structural diagram of an apparatus for training a parameter prediction model provided by an embodiment of the present application.

具体实施方式Detailed ways

下面结合本申请实施例中的附图对本申请实施例进行描述。以下描述中,参考形成本申请一部分并以说明之方式示出本申请实施例的具体方面或可使用本申请实施例的具体方面的附图。应理解,本申请实施例可在其它方面中使用,并可包括附图中未描绘的结构或逻辑变化。因此,以下详细描述不应以限制性的意义来理解,且本申请的范围由所附权利要求书界定。例如,应理解,结合所描述方法的揭示内容可以同样适用于用于执行所述方法的对应设备或系统,且反之亦然。例如,如果描述一个或多个具体方法步骤,则对应的设备可以包含如功能单元等一个或多个单元,来执行所描述的一个或多个方法步骤(例如,一个单元执行一个或多个步骤,或多个单元,其中每个都执行多个步骤中的一个或多个),即使附图中未明确描述或说明这种一个或多个单元。另一方面,例如,如果基于如功能单元等一个或多个单元描述具体装置,则对应的方法可以包含一个步骤来执行一个或多个单元的功能性(例如,一个步骤执行一个或多个单元的功能性,或多个步骤,其中每个执行多个单元中一个或多个单元的功能性),即使附图中未明确描述或说明这种一个或多个步骤。进一步,应理解的是,除非另外明确提出,本文中所描述的各示例性实施例和/或方面的特征可以相互组合。The embodiments of the present application will be described below with reference to the accompanying drawings in the embodiments of the present application. In the following description, reference is made to the accompanying drawings which form a part of this application and which illustrate, by way of illustration, specific aspects of embodiments of the application, or specific aspects of which embodiments of the application may be used. It should be understood that the embodiments of the present application may be utilized in other aspects and may include structural or logical changes not depicted in the accompanying drawings. Therefore, the following detailed description is not to be taken in a limiting sense, and the scope of the application is defined by the appended claims. For example, it should be understood that disclosures in connection with a described method may equally apply to a corresponding apparatus or system for performing the described method, and vice versa. For example, if one or more specific method steps are described, the corresponding apparatus may include one or more units, such as functional units, to perform one or more of the described method steps (eg, one unit performs one or more steps) , or units, each of which performs one or more of the steps), even if such unit or units are not explicitly described or illustrated in the figures. On the other hand, if, for example, a specific apparatus is described based on one or more units, such as functional units, the corresponding method may contain a step to perform the functionality of the one or more units (eg, a step to perform the one or more units) functionality, or steps, each of which performs the functionality of one or more of the plurality of units), even if such one or more steps are not explicitly described or illustrated in the figures. Further, it is to be understood that the features of the various exemplary embodiments and/or aspects described herein may be combined with each other unless expressly stated otherwise.

本申请所述的图像检测方法,可以应用于计算机视觉领域、需要对输入至图像检测模型中的图像进行处理以输出适合于图像检测模型进行图像检测的场景中。The image detection method described in the present application can be applied to the field of computer vision, where the image input into the image detection model needs to be processed to output a scene suitable for the image detection model to perform image detection.

请参考图1,图1示出了本申请实施例提供的电子设备的一个结构示意图。如图1所示,电子设备100可以是一个用户设备(User Equipment,UE),如手机、平板电脑、智能屏幕或者图像拍摄设备等各种类型的设备。此外,电子设备100还可以是车辆。在电子设备100中可以设置有摄像装置101,以用于采集图像数据。此外,电子设备100还可以包括或集成于电子设备内的模组、芯片、芯片组、电路板或部件,该芯片或芯片组或搭载有芯片或芯片组的电路板可在必要的软件驱动下工作。电子设备100包括一个或多个处理器,例如中央处理器(CPU,Central Processing Unit/Processor)、图像信号处理器(ISP,Image Signal Processor)103、AI处理器104等。可选地,所述一个或多个处理器可以集成在一个或多个芯片内,该一个或多个芯片可以被视为是一个芯片组,当一个或多个处理器被集成在同一个芯片内时该芯片也叫片上系统(System on a Chip,SOC)。在所述一个或多个处理器之外,电子设备100还包括一个或多个其他必要部件,例如存储器等。Please refer to FIG. 1 , which shows a schematic structural diagram of an electronic device provided by an embodiment of the present application. As shown in FIG. 1 , the electronic device 100 may be a user equipment (User Equipment, UE), such as various types of devices such as a mobile phone, a tablet computer, a smart screen, or an image capturing device. In addition, the electronic device 100 may also be a vehicle. A camera 101 may be provided in the electronic device 100 for capturing image data. In addition, the electronic device 100 may also include or be integrated into a module, chip, chip set, circuit board or component in the electronic device, and the chip or chip set or the circuit board equipped with the chip or chip set can be driven by necessary software Work. The electronic device 100 includes one or more processors, such as a central processing unit (CPU, Central Processing Unit/Processor), an image signal processor (ISP, Image Signal Processor) 103, an AI processor 104, and the like. Optionally, the one or more processors can be integrated in one or more chips, and the one or more chips can be regarded as a chipset, when one or more processors are integrated in the same chip The chip is also called a system on a chip (SOC). In addition to the one or more processors, the electronic device 100 also includes one or more other necessary components, such as memory and the like.

如图1所示的摄像装置101,可以为单目摄像头。或者,摄像装置101还可以包括多目摄像头,这些摄像头可以在物理上合设于一个摄像装置中,还可以在物理上分设于多个摄像装置中。通过多目摄像头在同一时刻采集多张图像数据,并可以根据这些图像数据进行处理,得到一张图像。具体实现中,摄像装置101可以实时采集图像数据,或者周期性地采集图像数据。该周期如3s、5s、10s等。摄像装置101还可以通过其他方式采集图像,本申请实施例不做具体限定。摄像装置101可以对采集的图像数据预处理,生成待检测图 像,分别提供给参数预测装置102和ISP103。其中,所生成的待检测图像可以为彩色图像,例如红绿蓝(RGB,Red Green Blue)图像。The camera device 101 shown in FIG. 1 may be a monocular camera. Alternatively, the camera device 101 may further include multi-camera cameras, and these cameras may be physically combined in one camera device, or may be physically separated into multiple camera devices. Multiple image data are collected at the same time by the multi-eye camera, and can be processed according to the image data to obtain an image. In a specific implementation, the camera 101 can collect image data in real time, or collect image data periodically. The period is such as 3s, 5s, 10s and so on. The camera device 101 may also collect images in other ways, which are not specifically limited in this embodiment of the present application. The camera device 101 can preprocess the collected image data to generate images to be detected, and provide them to the parameter prediction device 102 and the ISP 103 respectively. The generated image to be detected may be a color image, such as a red green blue (RGB, Red Green Blue) image.

如图1所示的参数预测装置102,用于从摄像装置101接收待检测图像。然后,参数预测装置102基于待检测图像的图像特征,对ISP103中、用于处理待检测图像的图像处理算法的参数进行预测,生成参数预测值。下面通过两种可能的实现方式对参数预测装置102进行介绍。The parameter prediction device 102 shown in FIG. 1 is configured to receive the image to be detected from the camera device 101 . Then, the parameter prediction device 102 predicts the parameters of the image processing algorithm used for processing the image to be detected in the ISP 103 based on the image features of the image to be detected, and generates a parameter prediction value. The parameter prediction apparatus 102 will be introduced below through two possible implementation manners.

在第一种可能的实现方式中,参数预测装置102包括专用集成电路1021和AI处理器1022,如图2a所示。专用集成电路1021可以专用于提取待检测图像的图像特征。该图像特征可以包括但不限于以下至少一项:颜色特征、亮度特征和边缘特征(特征提取的具体方法参考图7所示的实施例的相关描述)。专用集成电路1021可以单独作为一个部件或集成于其他数字逻辑器件中,该数字逻辑器件包括但不限于CPU。AI处理器1022可以包括神经网络处理器(NPU,Neural-network Processing Unit)、随机森林处理器、支持向量机处理器等专用处理器,包括但不限于卷积神经网络处理器、张量处理器或神经处理引擎。AI处理器1022可以单独作为一个部件或集成于其他数字逻辑器件中,该数字逻辑器件包括但不限于:CPU、GPU(图形处理器,Graphics Processing Unit)或者DSP(数字信号处理器,Digital Signal Processor)。示例性地,该CPU、GPU和DSP都是片上系统内的处理器。AI处理器1022中可以运行预先训练的参数预测模型。该可能的实现方式中,专用集成电路1021提取待检测图像的图像特征,基于特征提取结果,生成特征张量提供至AI处理器1022。AI处理器1022中运行的参数预测模型,基于特征张量对ISP103中所运行的图像处理算法的参数进行预测,生成参数预测值提供至ISP103。In a first possible implementation manner, the parameter prediction apparatus 102 includes an application-specific integrated circuit 1021 and an AI processor 1022, as shown in FIG. 2a. The application-specific integrated circuit 1021 may be dedicated to extracting image features of the image to be detected. The image features may include, but are not limited to, at least one of the following: color features, brightness features, and edge features (for a specific method of feature extraction, refer to the relevant description of the embodiment shown in FIG. 7 ). The application-specific integrated circuit 1021 can be used alone as a component or integrated in other digital logic devices including, but not limited to, a CPU. The AI processor 1022 may include a neural network processor (NPU, Neural-network Processing Unit), a random forest processor, a support vector machine processor and other special purpose processors, including but not limited to a convolutional neural network processor, a tensor processor or neural processing engine. The AI processor 1022 can be used alone as a component or integrated in other digital logic devices, including but not limited to: CPU, GPU (Graphics Processing Unit, Graphics Processing Unit) or DSP (Digital Signal Processor, Digital Signal Processor) ). Illustratively, the CPU, GPU and DSP are all processors within a system-on-chip. A pre-trained parameter prediction model can be run in the AI processor 1022 . In this possible implementation manner, the ASIC 1021 extracts image features of the image to be detected, and based on the feature extraction result, generates a feature tensor and provides it to the AI processor 1022 . The parameter prediction model running in the AI processor 1022 predicts the parameters of the image processing algorithm running in the ISP 103 based on the feature tensor, and generates a parameter prediction value and provides it to the ISP 103 .

在第二种可能的实现方式中,参数预测装置102可以不设置专用集成电路1021,仅设置AI处理器1022,如图2b所示。其中,AI处理器1022的硬件结构与图2a所示的AI处理器1022的硬件结构相同,在此不再赘述。在该实现方式中,AI处理器1022中同样可以运行预先训练的参数预测模型。与图2a所示的实现方式不同的是,该参数预测模型可以直接输入第一摄像装置101提供的待检测图像。参数预测模型可以完成待检测图像的图像特征提取过程以及参数预测过程,然后生成参数预测值提供至ISP103。In a second possible implementation manner, the parameter prediction apparatus 102 may not be provided with an application-specific integrated circuit 1021, but only be provided with an AI processor 1022, as shown in FIG. 2b. The hardware structure of the AI processor 1022 is the same as the hardware structure of the AI processor 1022 shown in FIG. 2a, and details are not repeated here. In this implementation, the AI processor 1022 can also run a pre-trained parameter prediction model. Different from the implementation shown in FIG. 2 a , the parameter prediction model can directly input the image to be detected provided by the first camera device 101 . The parameter prediction model can complete the image feature extraction process and the parameter prediction process of the image to be detected, and then generate the parameter prediction value and provide it to the ISP103.

如图2a和图2b所示的AI处理器1022,该AI处理器1022中所运行的参数预测模型,均可以是通过比较样本图像S1的标注信息和图像检测模型对样本图像S1的检测结果、并且基于比较结果对初始模型训练得到的。该初始模型可以包括但不限于:神经网络模型、支持向量机模型或者随机森林模型。需要说明的是,参数预测模型是在离线端训练完成后部署在图2a或者图2b所示的AI处理1022中的。这里的离线端可以看作是服务器设备或者用于进行模型训练的设备。上述图像检测模型为运行在AI处理器104中的图像检测模型。其中,用于生成参数预测模型的方法具体参考图8所示的实施例。As shown in the AI processor 1022 shown in FIG. 2a and FIG. 2b, the parameter prediction model run in the AI processor 1022 may be the detection result of the sample image S1 by comparing the annotation information of the sample image S1 and the image detection model, And based on the comparison results, the initial model is trained. The initial model may include, but is not limited to, a neural network model, a support vector machine model, or a random forest model. It should be noted that the parameter prediction model is deployed in the AI process 1022 shown in FIG. 2a or FIG. 2b after the offline-end training is completed. The offline end here can be regarded as a server device or a device for model training. The above-mentioned image detection model is an image detection model running in the AI processor 104 . The method for generating the parameter prediction model may specifically refer to the embodiment shown in FIG. 8 .

如图1所示的ISP103,可以设置多个硬件模块或者运行必要的软件程序以对图像数据进行处理。ISP103可以单独作为一个部件或集成于其他数字逻辑器件中,该数字逻辑器件包括但不限于:CPU、GPU或者DSP。ISP103可以执行多个图像处理过程,该多个图像处理过程可以包括但不限于:阶调映射、对比度增强、边缘增强、降噪、颜色校正等。The ISP 103 shown in FIG. 1 can set up multiple hardware modules or run necessary software programs to process the image data. The ISP103 can be used alone as a component or integrated in other digital logic devices, including but not limited to: CPU, GPU or DSP. The ISP 103 may perform a plurality of image processing processes, which may include, but are not limited to, tone mapping, contrast enhancement, edge enhancement, noise reduction, color correction, and the like.

需要说明的是,ISP103通过运行图像处理算法以执行上述多个图像处理过程。该图像处理算法可以包括但不限于:阶调映射算法、对比度增强算法、边缘增强算法、降噪算法、 和颜色校正算法等。上述多个图像处理过程中的每一个图像处理过程可以看作是独立的图像处理过程,从而,用于执行每一个图像处理过程的图像处理算法可以看作是独立的。基于此,ISP103可以包括多个逻辑模块。例如包括但不限于:阶调映射模块、对比度增强模块、边缘增强模块、颜色校正模块等。每一个逻辑模块用于执行一种图像处理过程。每一个逻辑模块可以各自使用其特定的硬件结构,多个逻辑模块也可以共用一套硬件结构,本申请实施例对此不做限定。该一个或多个图像处理过程通常顺序执行。例如,摄像装置101获取的图像提供至ISP103后,可以依次执行阶调映射、对比度增强、边缘增强、颜色校正…等处理过程。需要说明的是,本申请实施例对ISP103所执行的图像处理过程的先后顺序不作限定,例如,可以先执行对比度增强,再执行阶调映射。It should be noted that the ISP 103 executes the above-mentioned multiple image processing processes by running the image processing algorithm. The image processing algorithms may include, but are not limited to, tone mapping algorithms, contrast enhancement algorithms, edge enhancement algorithms, noise reduction algorithms, color correction algorithms, and the like. Each image processing process in the above-mentioned multiple image processing processes can be regarded as an independent image processing process, and thus, the image processing algorithm for executing each image processing process can be regarded as independent. Based on this, the ISP 103 may include multiple logic modules. For example, it includes but is not limited to: tone mapping module, contrast enhancement module, edge enhancement module, color correction module, etc. Each logic module is used to perform an image processing procedure. Each logic module may use its own specific hardware structure, and multiple logic modules may also share a set of hardware structures, which is not limited in this embodiment of the present application. The one or more image processing procedures are typically performed sequentially. For example, after the image acquired by the camera 101 is provided to the ISP 103, processing processes such as tone mapping, contrast enhancement, edge enhancement, color correction, etc. may be sequentially performed. It should be noted that this embodiment of the present application does not limit the sequence of the image processing processes performed by the ISP 103 , for example, the contrast enhancement may be performed first, and then the tone mapping may be performed.

本申请实施例中,ISP103运行的图像处理算法中,某些参数的值是可调的。例如,阶调映射算法中的Gamma函数参数γ;对比度增强算法中的对比度阈值参数;边缘增强算法中的边缘增强因子α;降噪算法中的空间域高斯核参数σs以及像素值域高斯核参数σr。其中,关于图像处理算法中各可调参数的详细描述参考图9所示的实施例。参数预测模型所生成的参数预测值,即为图像处理算法中这些可调参数的值。参数预测模型所输出的参数预测值可以包括多个,例如目标亮度参数值、目标饱和度参数值、滤波核参数值、边缘增强因子α值、空间域高斯核参数值和像素值域高斯核参数值。也即是说,ISP103可以从参数预测模型获得执行每一个图像处理流程的图像处理算法的可调参数的值,将相应可调参数的值更新为参数预测模型所生成的参数预测值。然后,ISP103采用参数调整后的图像处理算法对第一摄像装置101输入的图像进行图像处理。In the embodiment of the present application, in the image processing algorithm run by the ISP 103, the values of some parameters are adjustable. For example, the Gamma function parameter γ in the tone mapping algorithm; the contrast threshold parameter in the contrast enhancement algorithm; the edge enhancement factor α in the edge enhancement algorithm; the spatial domain Gaussian kernel parameter σs and the pixel value domain Gaussian kernel parameter in the noise reduction algorithm σr. The detailed description of each adjustable parameter in the image processing algorithm refers to the embodiment shown in FIG. 9 . The parameter prediction values generated by the parameter prediction model are the values of these adjustable parameters in the image processing algorithm. The parameter prediction value output by the parameter prediction model may include multiple values, such as target brightness parameter value, target saturation parameter value, filter kernel parameter value, edge enhancement factor α value, spatial domain Gaussian kernel parameter value and pixel value domain Gaussian kernel parameter value. That is to say, the ISP 103 can obtain the value of the adjustable parameter of the image processing algorithm executing each image processing flow from the parameter prediction model, and update the value of the corresponding adjustable parameter to the parameter prediction value generated by the parameter prediction model. Then, the ISP 103 performs image processing on the image input by the first camera 101 by using the image processing algorithm after parameter adjustment.

如图1所示的AI处理器104,可以包括神经网络处理器(Neural-network Processing Unit,NPU)等专用神经处理器,包括但不限于卷积神经网络处理器、张量处理器或神经处理引擎。AI处理器可以单独作为一个部件或集成于其他数字逻辑器件中,该数字逻辑器件包括但不限于:CPU、GPU或者DSP。AI处理器104可以运行有图像检测模型,该图像检测模型是基于样本图像S2对深度神经网络训练得到的。该图像检测模型可以执行特定的检测任务。该特定的检测任务可以包括但不限于:检测框的标注、目标对象的识别、置信度的预测、目标对象运动轨迹的预测或者图像分割等。需要说明的是,图像检测模型是在离线端训练完成后部署在图1所示的AI处理器104中的。这里的离线端可以看作是服务器设备或者用于进行模型训练的设备。The AI processor 104 shown in FIG. 1 may include a special-purpose neural processor such as a Neural-network Processing Unit (NPU), including but not limited to a convolutional neural network processor, a tensor processor, or a neural processing unit. engine. The AI processor can be used alone as a component or integrated in other digital logic devices, including but not limited to: CPU, GPU or DSP. The AI processor 104 may run an image detection model, and the image detection model is obtained by training a deep neural network based on the sample image S2. This image detection model can perform specific detection tasks. The specific detection task may include, but is not limited to, labeling of detection frames, recognition of target objects, prediction of confidence levels, prediction of motion trajectories of target objects, or image segmentation, and the like. It should be noted that the image detection model is deployed in the AI processor 104 shown in FIG. 1 after the offline-end training is completed. The offline end here can be regarded as a server device or a device for model training.

需要说明的是,参数预测装置102中的AI处理器1022和AI处理器104可以合设于同一个AI处理器中,该AI处理器既可以运行参数预测模型,还可以运行图像检测模型。此外,AI处理器1022和AI处理器104也可以是相互独立的处理器。It should be noted that the AI processor 1022 and the AI processor 104 in the parameter prediction apparatus 102 may be co-located in the same AI processor, and the AI processor may run both the parameter prediction model and the image detection model. In addition, the AI processor 1022 and the AI processor 104 may also be independent processors.

通常,AI处理器104中所运行的图像检测模型,其通常基于图像的亮度、颜色和纹理等特征进行图像检测。其中,亮度、颜色和纹理等特征通常通过图像的动态范围、噪声水平和对比度等指标体现。对于呈现相同对象的多张图像,当该多张图像的动态范围、噪声、对比度等指标不同时,该多张图像的亮度、颜色和纹理等特征也不同。图像检测模型对该多张图像的检测结果也会存在差异。通常,图像检测模型是在离线端训练完成后部署在终端设备中的,训练图像检测模型的专家通常与使用图像检测模型的用户不同。也即用户在使用图像检测模型时,通常并不能获得用于训练图像检测模型的样本图像的指标(例如动态范围、噪声、对比度),这就导致在实际使用中,例如在如图3所示的自动驾驶场景中, 当外界环境发生变化时(例如黑夜、起雾、眩光、扬尘等),摄像装置所采集的图像在动态范围、对比度和噪声等指标上,与用于训练图像检测模型的样本图像相比,均会发生变化。这就导致图像检测模型输出的检测结果与真实结果之间偏差较大,降低了图像检测模型检测的准确性。本申请实施例通过设置参数预测模型,利用参数预测模型基于待检测图像的图像特征,对图像的动态范围、噪声水平和局部对比度等指标进行预测,将参数预测值提供给ISP103,使得ISP103运行的图像处理算法基于该参数预测值对待检测图像进行处理,从而可以使得输入至图像检测模型的图像的动态范围、噪声水平、局部对比度等指标,与用于训练图像检测模型的样本图像的动态范围、噪声水平、局部对比度等指标相同或相似,由此提高图像检测模型检测结果的准确性。Generally, the image detection model executed in the AI processor 104 usually performs image detection based on features such as brightness, color, and texture of the image. Among them, features such as brightness, color, and texture are usually reflected by indicators such as the dynamic range, noise level, and contrast of the image. For multiple images representing the same object, when the dynamic range, noise, contrast and other indicators of the multiple images are different, the characteristics such as brightness, color and texture of the multiple images are also different. There will also be differences in the detection results of the multiple images by the image detection model. Usually, the image detection model is deployed in the terminal device after the offline training is completed, and the experts who train the image detection model are usually different from the users who use the image detection model. That is to say, when users use the image detection model, they usually cannot obtain the indicators (such as dynamic range, noise, contrast) of the sample images used to train the image detection model, which leads to practical use, such as shown in Figure 3. In the autonomous driving scene of 2000, when the external environment changes (such as night, fog, glare, dust, etc.), the images collected by the camera device in terms of dynamic range, contrast, noise and other indicators are different from those used to train the image detection model. Compared with the sample image, it will change. This leads to a large deviation between the detection results output by the image detection model and the real results, which reduces the detection accuracy of the image detection model. In the embodiment of the present application, a parameter prediction model is set, and the parameter prediction model is used to predict the dynamic range, noise level, local contrast and other indicators of the image based on the image characteristics of the image to be detected, and the parameter prediction value is provided to the ISP103, so that the ISP103 runs The image processing algorithm processes the image to be detected based on the predicted value of the parameter, so that the dynamic range, noise level, local contrast and other indicators of the image input to the image detection model can be compared with the dynamic range of the sample image used for training the image detection model. The noise level, local contrast and other indicators are the same or similar, thereby improving the accuracy of the detection results of the image detection model.

传统计算机视觉技术中,实际使用中,为了提高图像检测模型的泛化能力,也即能够针对特殊环境(例如黑夜、起雾、眩光、扬尘等)采集的图像进行检测,通常在训练图像检测模型的样本中人为改变图像的移位、视角、尺寸、亮度、颜色等特征(或者以上变化的组合),以生成数量更多、样本分布更离散的训练数据集,对已经训练的图像检测模型进行重训练或者调整,这就增加了训练图像检测模型的开销;此外,在图像检测模型的容量有限且固定的情况下,图像检测模型的泛化能力与检测精度不可兼得,为了提高图像检测模型的泛化能力,会导致图像检测模型检测性能下降,因此图像检测模型输出的检测结果的准确性仍然不理想。本申请实施例中通过设置参数预测模型,可以不需要对图像检测模型的参数进行任何更改,与传统技术相比,可以节省了对图像检测模型进行训练所需的时间和算力开销,并且还可以使得图像检测模型维持较高的检测精度;此外,由于参数预测模型是对图像处理算法的参数进行预测,不需要执行图像检测过程,因此,图像检测模型在训练过程中无需准备高质量参考图像,采用较少的训练样本即可完成训练,简化了参数预测模型的训练过程。In traditional computer vision technology, in actual use, in order to improve the generalization ability of the image detection model, that is, it can detect images collected in special environments (such as night, fog, glare, dust, etc.), usually in training image detection models. Artificially change the image shift, viewing angle, size, brightness, color and other features (or a combination of the above changes) in the samples of the sample to generate a training data set with a larger number and a more discrete sample distribution. Re-training or adjustment, which increases the cost of training the image detection model; in addition, when the capacity of the image detection model is limited and fixed, the generalization ability and detection accuracy of the image detection model cannot be achieved at the same time. In order to improve the image detection model The generalization ability of the image detection model will lead to the degradation of the detection performance of the image detection model, so the accuracy of the detection results output by the image detection model is still not ideal. By setting the parameter prediction model in the embodiment of the present application, it is not necessary to make any changes to the parameters of the image detection model. Compared with the traditional technology, the time and computing power overhead required for training the image detection model can be saved, and the The image detection model can maintain a high detection accuracy; in addition, since the parameter prediction model predicts the parameters of the image processing algorithm, it does not need to perform the image detection process, so the image detection model does not need to prepare high-quality reference images during the training process. , the training can be completed with fewer training samples, which simplifies the training process of the parameter prediction model.

下面以自动驾驶场景为例,结合图1所示的电子设备100的结构示意图,对本申请实施例的应用场景进行更为具体的说明。请参考图3,图3示出了本申请实施例提供的车辆300的一个结构示意图。Taking an automatic driving scenario as an example, the following describes the application scenario of the embodiment of the present application in more detail in conjunction with the schematic structural diagram of the electronic device 100 shown in FIG. 1 . Please refer to FIG. 3 , which shows a schematic structural diagram of a vehicle 300 provided by an embodiment of the present application.

耦合到车辆300或包括在车辆300中的组件可以包括控制系统10、推进系统20和传感器系统30。应理解,车辆300还可以包括更多的系统,在此不再赘述。控制系统10可被配置为控制车辆300及其组件的操作。如图1所示的参数预测装置102、ISP103和AI处理器104可以设置于控制系统10中,此外,控制系统10还可以包括中央处理器、存储器等设备,存储器用于存储各处理器运行所需的指令和数据。推进系统20可以用于车辆300提供动力运动,其可以包括但不限于:引擎/发动机、能量源、传动装置和车轮。传感器系统30可以包括但不限于:全球定位系统、惯性测量单元、激光雷达传感器或者毫米波雷达传感器,如图1所示的摄像装置101可以设置于传感器系统30。车辆300的组件和系统可通过系统总线、网络和/或其它连接机制耦合在一起,以与在其各自的系统内部和/或外部的其它组件互连的方式工作。具体工作中,车辆300中的各组件之间相互配合,实现多种自动驾驶功能。该自动驾驶功能可以包括但不限于:盲点检测、泊车辅助或者变道辅助等。Components coupled to or included in vehicle 300 may include control system 10 , propulsion system 20 , and sensor system 30 . It should be understood that the vehicle 300 may also include more systems, which will not be repeated here. The control system 10 may be configured to control the operation of the vehicle 300 and its components. The parameter prediction device 102, ISP 103 and AI processor 104 shown in FIG. 1 may be set in the control system 10. In addition, the control system 10 may also include devices such as a central processing unit, a memory, etc., and the memory is used to store the operating conditions of each processor. required commands and data. Propulsion system 20 may be used for vehicle 300 to provide powered motion, which may include, but is not limited to, an engine/motor, energy source, transmission, and wheels. The sensor system 30 may include, but is not limited to, a global positioning system, an inertial measurement unit, a lidar sensor, or a millimeter-wave radar sensor. The camera 101 shown in FIG. 1 may be disposed in the sensor system 30 . The components and systems of vehicle 300 may be coupled together through a system bus, network, and/or other connection mechanism to operate in interconnection with other components within and/or outside of their respective systems. In specific work, various components in the vehicle 300 cooperate with each other to realize various automatic driving functions. The automatic driving function may include, but is not limited to, blind spot detection, parking assist or lane change assist, and the like.

在实现上述自动驾驶功能的过程中,摄像装置101可以周期性的采集并生成待检测图像,将待检测图像提供至参数预测装置102。参数预测装置102基于待检测图像的图像特 征,对用于处理待检测图像的图像处理算法的参数进行预测,生成参数预测值提供至ISP103。ISP103基于参数预测值,调整ISP103所运行的图像处理算法中的可调参数的大小,然后利用参数调整后的图像处理算法执行多个图像处理过程对待检测图像进行处理,转换成AI处理器104所运行的图像检测模型可以识别或计算的图像提供至AI处理器104,从而使得AI处理器104实现特定任务的推理或检测,生成检测结果。控制系统10中的其他组件(例如执行决策的CPU)基于AI处理器104的检测结果,控制其他设备或组件执行自动驾驶功能。In the process of implementing the above automatic driving function, the camera device 101 may periodically collect and generate images to be detected, and provide the images to be detected to the parameter prediction device 102 . The parameter prediction device 102 predicts the parameters of the image processing algorithm for processing the image to be detected based on the image features of the image to be detected, and generates a parameter prediction value and provides it to the ISP 103. The ISP103 adjusts the size of the adjustable parameters in the image processing algorithm run by the ISP103 based on the parameter prediction value, and then uses the image processing algorithm after parameter adjustment to perform multiple image processing processes to process the image to be detected, and converts it into the image to be detected by the AI processor 104. The images recognized or calculated by the running image detection model can be provided to the AI processor 104, so that the AI processor 104 can perform reasoning or detection of a specific task and generate detection results. Other components in the control system 10 (eg, a CPU that executes decisions) control other devices or components to perform autonomous driving functions based on the detection results of the AI processor 104 .

下面以图2a所示的参数预测装置102的结构为例,对如图1所述的电子设备100中各部件之间的交互流程进行描述。请参考图4,图4示意性的示出了本申请实施例提供的如图1所述的各电子设备100中的各部件之间的交互流程400。该流程400包括如下步骤:Taking the structure of the parameter prediction apparatus 102 shown in FIG. 2 a as an example, the interaction flow between the components in the electronic device 100 shown in FIG. 1 will be described below. Referring to FIG. 4 , FIG. 4 schematically shows an interaction process 400 between components in each electronic device 100 as described in FIG. 1 provided by an embodiment of the present application. The process 400 includes the following steps:

步骤401,摄像装置101采集图像数据,对所采集的图像数据进行处理,生成图像A。In step 401 , the camera 101 collects image data, processes the collected image data, and generates an image A.

步骤402,摄像装置101将图像A分别提供至专用集成电路1021和ISP103。In step 402, the camera 101 provides the image A to the ASIC 1021 and the ISP 103, respectively.

步骤403,专用集成电路1021对图像A进行特征提取,基于特征提取结果,生成特征张量。步骤404,专用集成电路1021将特征张量提供至AI处理器1022。Step 403, the ASIC 1021 performs feature extraction on the image A, and generates a feature tensor based on the feature extraction result. Step 404 , the ASIC 1021 provides the feature tensor to the AI processor 1022 .

步骤405,AI处理器1022中运行的参数预测模型基于特征张量,对ISP103中所运行的图像处理算法的参数进行预测,生成参数预测值。步骤406,AI处理器1022将参数预测值提供至ISP103。Step 405, the parameter prediction model running in the AI processor 1022 predicts the parameters of the image processing algorithm running in the ISP 103 based on the feature tensor, and generates a parameter prediction value. In step 406, the AI processor 1022 provides the parameter prediction value to the ISP 103.

步骤407,ISP103基于参数预测值,调整图像处理算法的参数,采用参数调整后的图像处理算法对图像A进行处理,生成图像B。步骤408,ISP103将图像B提供至AI处理器104。Step 407 , the ISP 103 adjusts the parameters of the image processing algorithm based on the parameter prediction value, and uses the image processing algorithm after parameter adjustment to process the image A to generate the image B. In step 408 , the ISP 103 provides the image B to the AI processor 104 .

步骤409,AI处理器104中运行的图像检测模型对图像B进行检测,生成检测结果。Step 409, the image detection model running in the AI processor 104 detects the image B, and generates a detection result.

应理解,图4所示的交互流程400的步骤或操作仅是示例,本申请实施例还可以执行其他操作或者图4中的各个操作的变形。此外,本申请实施例还可以包括比图4所示的步骤更多或更少的步骤。例如,当参数预测装置102为如图2b所示的结构时,可以省略步骤403和步骤404,摄像装置101将图像A直接提供至AI处理器1022。It should be understood that the steps or operations of the interaction process 400 shown in FIG. 4 are only examples, and other operations or variations of the respective operations in FIG. 4 may also be performed in this embodiment of the present application. In addition, the embodiments of the present application may further include more or less steps than those shown in FIG. 4 . For example, when the parameter prediction device 102 has the structure shown in FIG. 2 b , steps 403 and 404 may be omitted, and the camera device 101 directly provides the image A to the AI processor 1022 .

如图1所示的电子设备100中,摄像装置101所输出的图像为彩色图像。在其他可能的实现方式中,摄像装置101所输出的图像可以为原始图像格式(RAW Image Format)的图像。由于参数预测装置102无法基于RAW图像进行特征提取和预测,当摄像装置101所采集的图像为RAW图像时,ISP103还可以执行将RAW图像转换成彩色图像的过程。此时,摄像装置101可以将RAW图像提供至ISP103,ISP103对RAW图像进行处理,生成彩色图像后提供至参数预测装置102,如图5所示。ISP103中将RAW图像转换成彩色图像的图像处理算法可以包括但不限于:暗电流校正算法、镜头阴影校正算法和解马赛克算法等。如图5所示的参数预测装置102和AI处理器104的结构与图1所示的参数预测装置102和AI处理器104的结构相同,具体参考图1所示的实施例中的相关描述,在此不再赘述。In the electronic device 100 shown in FIG. 1 , the image output by the imaging device 101 is a color image. In other possible implementation manners, the image output by the camera device 101 may be an image in a raw image format (RAW Image Format). Since the parameter prediction device 102 cannot perform feature extraction and prediction based on the RAW image, when the image captured by the camera device 101 is a RAW image, the ISP 103 can also perform the process of converting the RAW image into a color image. At this time, the camera device 101 can provide the RAW image to the ISP 103 , and the ISP 103 processes the RAW image to generate a color image and then provide it to the parameter prediction device 102 , as shown in FIG. 5 . Image processing algorithms for converting RAW images into color images in ISP 103 may include, but are not limited to, dark current correction algorithms, lens shading correction algorithms, and demosaicing algorithms. The structures of the parameter prediction apparatus 102 and the AI processor 104 shown in FIG. 5 are the same as the structures of the parameter prediction apparatus 102 and the AI processor 104 shown in FIG. It is not repeated here.

基于图5所示的电子设备100的结构示意图,请参考图6,图6示出了本申请实施例提供的如图5所述的各电子设备100中的各部件之间的交互流程600。如图6所示的交互流程600中,步骤403-步骤409与图4中所示的步骤403-步骤409相同,在此不再赘述。其中,图4中所示的交互流程400中的步骤401-步骤402被替换为图6中所示的步骤4011- 步骤4013:Based on the schematic structural diagram of the electronic device 100 shown in FIG. 5 , please refer to FIG. 6 . FIG. 6 shows an interaction process 600 between components in each electronic device 100 as shown in FIG. 5 provided by an embodiment of the present application. In the interaction process 600 shown in FIG. 6 , steps 403 to 409 are the same as steps 403 to 409 shown in FIG. 4 , and details are not repeated here. Wherein, steps 401-402 in the interaction process 400 shown in FIG. 4 are replaced by steps 4011-4013 shown in FIG. 6:

步骤4011,摄像装置101采集图像数据,得到RAW图像。步骤4012,摄像装置101将RAW图像提供至ISP103。步骤4013,ISP103运行的图像处理算法对RAW图像进行处理,生成图像A。步骤4014,ISP103将图像A提供至专用集成电路1021。In step 4011, the camera 101 collects image data to obtain a RAW image. In step 4012, the camera 101 provides the RAW image to the ISP 103. Step 4013 , the image processing algorithm run by the ISP 103 processes the RAW image to generate an image A. In step 4014 , the ISP 103 provides the image A to the ASIC 1021 .

基于图1-图6所示的实施例,下面以所提取的图像特征为颜色特征、亮度特征和边缘特征为例,结合图7,对上述各实施例中所述的对待检测图像进行特征提取以生成特征张量的方法,进行详细描述。Based on the embodiments shown in FIG. 1 to FIG. 6 , taking the extracted image features as color features, brightness features, and edge features as an example, and in conjunction with FIG. 7 , the feature extraction of the images to be detected described in the above embodiments The method for generating feature tensors is described in detail.

本申请实施例中,颜色特征可以通过红-蓝(R-B)色度直方图体现、亮度特征可以通过亮度-差分亮度直方图体现、边缘特征可以通过二维的边缘特征图体现。如上各实施例中所述的专用集成电路1021可以依次构建待检测图像的R-B色度直方图H C、亮度-差分亮度直方图H L以及边缘特征图I E。其中,R-B色度直方图H C、亮度-差分亮度直方图H L以及边缘特征图I E的分辨率相等。然后,专用集成电路1021可以将R-B色度直方图H C、亮度-差分亮度直方图H L以及边缘特征图I E联结,生成K×K×3的特征张量T F,其中,K×K分别为R-B色度直方图H C、亮度-差分亮度直方图H L以及边缘特征图I E的分辨率,即 In this embodiment of the present application, the color feature may be represented by a red-blue (RB) chromaticity histogram, the luminance feature may be represented by a luminance-differential luminance histogram, and the edge feature may be represented by a two-dimensional edge feature map. The ASIC 1021 described in the above embodiments can sequentially construct the RB chromaticity histogram H C , the luminance-differential luminance histogram HL and the edge feature map IE of the image to be detected. The resolutions of the RB chrominance histogram H C , the luminance-difference luminance histogram HL and the edge feature map IE are equal. Then, the ASIC 1021 can combine the RB chrominance histogram H C , the luminance-difference luminance histogram HL and the edge feature map IE to generate a K×K×3 feature tensor TF , where K×K are the resolutions of the RB chrominance histogram H C , the luminance-difference luminance histogram HL and the edge feature map IE respectively, namely

T F=concatenate axis=channel(H C,H L,I E)        公式(1) T F =concatenate axis=channel (H C ,H L ,I E ) Formula (1)

下面对R-B色度直方图H C、亮度-差分亮度直方图H L以及边缘特征图I E的构建方法进行详细描述。 The construction method of the RB chrominance histogram H C , the luminance-difference luminance histogram HL and the edge feature map IE will be described in detail below.

R-B色度直方图H C的构建: Construction of RB chromaticity histogram H C :

对于待检测图像中的每个像素,计算其绿色通道像素值与红色通道像素值之比(G/R),记为r,同理,计算绿色通道像素值与蓝色通道像素值之比(G/B),记为b。色度直方图中(r 0,b 0)位置处的直方柱高度H C(r 0,b 0)表示输入图像中色度坐标(r,b)落在(r 0,b 0)所对应的色度范围内的像素个数,即 For each pixel in the image to be detected, calculate the ratio of the pixel value of the green channel to the pixel value of the red channel (G/R), denoted as r, and in the same way, calculate the ratio of the pixel value of the green channel to the pixel value of the blue channel ( G/B), denoted as b. The column height H C (r 0 , b 0 ) at the position (r 0 , b 0 ) in the chromaticity histogram indicates that the chromaticity coordinates (r, b) in the input image correspond to (r 0 , b 0 ) The number of pixels in the chromaticity range of

Figure PCTCN2021081086-appb-000001
Figure PCTCN2021081086-appb-000001

其中Δr和Δb分别表示色度直方图中单个直方柱在r和b方向上的宽度,‖·‖表示集合内的元素个数。通过对输入图像中每个像素进行遍历并计算其在r-b平面中的坐标,即可完成R-B色度直方图H C的构建。R-B色度直方图H C的分辨率取决于r-b平面的统计区间大小以及直方柱的宽度,通常设为128×128即可。 where Δr and Δb represent the widths of a single histogram in the r and b directions in the chromaticity histogram, respectively, and ‖·‖ represents the number of elements in the set. By traversing each pixel in the input image and calculating its coordinates in the rb plane, the construction of the RB chromaticity histogram H C can be completed. The resolution of the RB chromaticity histogram H C depends on the size of the statistical interval of the rb plane and the width of the histogram, and is usually set to 128×128.

亮度-差分亮度直方图H L的构建: Construction of luminance-differential luminance histogram HL :

对于待检测图像中每个像素的亮度值Y定义为该像素处红色通道像素值R、绿色通道像素值G、蓝色通道像素值B三通道像素值的加权求和结果,即The brightness value Y of each pixel in the image to be detected is defined as the weighted summation result of the three-channel pixel values of the red channel pixel value R, the green channel pixel value G, and the blue channel pixel value B at the pixel, that is

Y=0.299R+0.587G+0.114B公式(3)Y=0.299R+0.587G+0.114B Formula (3)

每个像素的差分亮度值D定义为该像素处的亮度值与其领域8个像素的亮度值的平均绝对差异,即The differential luminance value D of each pixel is defined as the average absolute difference between the luminance value at this pixel and the luminance values of 8 pixels in its area, namely

Figure PCTCN2021081086-appb-000002
Figure PCTCN2021081086-appb-000002

其中,(x,y)表示图像中某一坐标点处的像素,Y(x,y)表示该坐标点处像素的亮度,(x+i,y+j)表示图像中与(x,y)该坐标点处的像素距离为(i,j)坐标的像素,Y(x+i,y+j)表示(x+i,y+j)该坐标点的像素亮度。某一像素处的差分亮度值通常可以反映该像素与周围像素的差异程度。亮度直方图中(Y 0,D 0)位置处的直方柱高度H L(Y 0,D 0)表示输入图 像的亮度及差分亮度坐标(Y,D)落在(Y 0,D 0)所对应的范围内的像素个数,即 Among them, (x, y) represents the pixel at a certain coordinate point in the image, Y(x, y) represents the brightness of the pixel at the coordinate point, (x+i, y+j) represents the difference between (x, y) in the image ) The pixel distance at this coordinate point is the pixel of (i, j) coordinate, and Y(x+i, y+j) represents the pixel brightness of (x+i, y+j) this coordinate point. The differential luminance value at a pixel usually reflects how different the pixel is from surrounding pixels. The column height H L (Y 0 , D 0 ) at the position (Y 0 , D 0 ) in the luminance histogram indicates that the luminance of the input image and the differential luminance coordinates (Y, D) fall within (Y 0 , D 0 ) The number of pixels in the corresponding range, that is

Figure PCTCN2021081086-appb-000003
Figure PCTCN2021081086-appb-000003

其中ΔY和ΔD分别表示亮度直方图中单个直方柱在亮度值Y和差分亮度值D方向上的宽度。通过对输入图像中每个像素进行遍历并计算其在Y-D平面中的坐标,即可完成亮度-差分亮度直方图的H L构建。亮度-差分亮度直方图H L的分辨率取决于Y-D平面的统计区间大小以及直方柱的宽度。其中,亮度-差分亮度直方图H L的分辨率需设置为与R-B色度直方图H C的分辨率相等。 where ΔY and ΔD represent the widths of a single histogram in the luminance histogram in the direction of luminance value Y and differential luminance value D, respectively. By traversing each pixel in the input image and calculating its coordinates in the YD plane, the HL construction of the luminance-difference luminance histogram can be completed. The resolution of the luminance-difference luminance histogram HL depends on the size of the statistical interval of the YD plane and the width of the histogram. The resolution of the luminance-differential luminance histogram HL needs to be set to be equal to the resolution of the RB chrominance histogram H C.

边缘特征图I E的构建: Construction of edge feature map IE :

待检测图像的亮度通道经Canny边缘检测算子、形态学闭合操作以及空间下采样后的生成,即The brightness channel of the image to be detected is generated by the Canny edge detection operator, morphological closure operation and spatial downsampling, namely

Figure PCTCN2021081086-appb-000004
Figure PCTCN2021081086-appb-000004

其中Resize(·)表示空间下采样操作,Canny(·)表示Canny边缘检测算子,

Figure PCTCN2021081086-appb-000005
表示形态学中的膨胀操作,
Figure PCTCN2021081086-appb-000006
表示腐蚀操作,B表示用于闭合操作的结构元素,通常选用圆盘结构(disk structure)即可。在构建图像边缘特征的过程中,Canny边缘检测算子用于检测出图像中的物体边缘区域;形态学闭合操作用于消除边缘图像中狭窄的间断和长细的鸿沟,消除小的空洞,并填补轮廓线中的断裂;空间下采样用于将边缘图像的分辨率处理至与色度直方图H C的分辨率及亮度直方图H L的分辨率相等。 where Resize( ) represents the spatial downsampling operation, Canny( ) represents the Canny edge detection operator,
Figure PCTCN2021081086-appb-000005
represents the dilation operation in morphology,
Figure PCTCN2021081086-appb-000006
Indicates the corrosion operation, and B represents the structural element used for the closing operation, usually a disk structure can be selected. In the process of constructing image edge features, the Canny edge detection operator is used to detect the edge regions of objects in the image; the morphological closure operation is used to eliminate narrow discontinuities and long thin gaps in the edge image, eliminate small holes, and Breaks in contour lines are filled; spatial downsampling is used to process the edge image resolution to be equal to the resolution of the chrominance histogram H C and the luminance histogram HL.

基于图1-图5所示的实施例,下面以图像处理算法包括阶调映射算法、对比度增强算法、边缘增强算法以及降噪算法为例,结合图8,对ISP103中所运行的图像处理算法的参数进行详细描述。Based on the embodiment shown in Fig. 1-Fig. 5, the following takes the image processing algorithm including the tone mapping algorithm, the contrast enhancement algorithm, the edge enhancement algorithm and the noise reduction algorithm as an example, combined with Fig. 8, the image processing algorithm running in the ISP103 parameters are described in detail.

阶调映射用于接收高位深的线性图像,将该线性图像转换为非线性图像,同时完成图像位深的压缩,输出8比特图像。当使用全局gamma函数作为阶调映射函数时,阶调映射算法中可调节的参数为γ参数;当使用对数变换算法对线性图像进行动态范围压缩时,阶调映射算法中可调节的参数为对数变换的底数;当使用更加复杂的阶调映射模型,例如基于人眼动态范围响应的retinex模型时,阶调映射算法中可调节的参数为其中的目标亮度参数(key)、目标饱和度参数(saturation)以及用于生成低通滤波图像的滤波核参数。Tone mapping is used to receive a linear image with high bit depth, convert the linear image into a nonlinear image, and complete the compression of the image bit depth, and output an 8-bit image. When the global gamma function is used as the tone mapping function, the adjustable parameter in the tone mapping algorithm is the γ parameter; when the logarithmic transformation algorithm is used to compress the dynamic range of the linear image, the adjustable parameter in the tone mapping algorithm is The base of the logarithmic transformation; when using a more complex tone mapping model, such as the retinex model based on the dynamic range response of the human eye, the adjustable parameters in the tone mapping algorithm are the target brightness parameter (key), target saturation parameters (saturation) and filter kernel parameters used to generate the low pass filtered image.

对比度增强用于增强图像的对比度。具体的,可以使用CLAHE(contrast limited adaptive histogram equalization,对比度限制的自适应直方图均衡化)算法对图像的对比度进行局部调节。CLAHE算法中可调节的参数包括:对比度阈值参数以及用于直方图统计的子图像块大小。本申请实施例一种可能的实现方式中,可以固定子图像块的大小,仅调整对比度阈值参数。更进一步的,可以将子图像块的大小固定为输入图像的大小。Contrast Enhancement is used to enhance the contrast of an image. Specifically, the CLAHE (contrast limited adaptive histogram equalization, contrast limited adaptive histogram equalization) algorithm can be used to locally adjust the contrast of the image. Adjustable parameters in the CLAHE algorithm include: contrast threshold parameter and sub-image block size for histogram statistics. In a possible implementation manner of the embodiment of the present application, the size of the sub-image block may be fixed, and only the contrast threshold parameter may be adjusted. Further, the size of the sub-image block can be fixed to the size of the input image.

图像的边缘增强中,首先对接收到的图像中的Y通道图像进行高斯滤波,得到低通Y通道图像Y L;将原始的Y通道图像与低通Y通道图像Y L之间的差值图像作为图像中的高频信号,即Y HF=Y-Y L,该高频信号通常对应于图像中的边缘区域;通过对高频信号的强度进行放大并叠加至低通Y通道图像Y L中,可以得到边缘增强后的图像Y E,即Y E=Y L+α·(Y-Y L),其中α为边缘增强因子,图像边缘增强程度随α增大而增大。边缘增强算法中可调节的参数为边缘增强因子α。 In the edge enhancement of the image, the Y-channel image in the received image is first subjected to Gaussian filtering to obtain a low-pass Y-channel image Y L ; the difference image between the original Y-channel image and the low-pass Y-channel image Y L As the high-frequency signal in the image, that is, Y HF =YY L , the high-frequency signal usually corresponds to the edge area in the image; by amplifying the intensity of the high-frequency signal and superimposing it into the low-pass Y-channel image Y L , it can be The image Y E after edge enhancement is obtained, that is, Y E =Y L +α·(YY L ), where α is an edge enhancement factor, and the degree of image edge enhancement increases with the increase of α. The adjustable parameter in the edge enhancement algorithm is the edge enhancement factor α.

图像降噪中,通常采用双边滤波(bilateral filter)降噪算法。双边滤波降噪算法中,可调节的参数可以包括:用于控制降噪强度与空间距离之间关系的空间域高斯核参数σs, 以及用于控制降噪强度与响应值差异之间关系的像素值域高斯核参数σr。In image noise reduction, the bilateral filter noise reduction algorithm is usually used. In the bilateral filtering noise reduction algorithm, the adjustable parameters may include: a spatial Gaussian kernel parameter σs used to control the relationship between the noise reduction intensity and the spatial distance, and a pixel used to control the relationship between the noise reduction intensity and the response value difference Value domain Gaussian kernel parameter σr.

请继续参考图9,其示出了本申请实施例提供的包含用于生成参数预测模型的电子设备的系统架构示意图900。Please continue to refer to FIG. 9 , which shows a schematic diagram 900 of a system architecture including an electronic device for generating a parameter prediction model provided by an embodiment of the present application.

在图9中,系统架构900包括模型训练设备901、存储设备902和显示设备903。存储设备902可以包括但不限于:只读存储器或者随机存取存储器等。存储设备902用于存储样本图像S1。此外,存储设备902中还可以存储有用于执行图像处理过程的图像处理算法的可执行程序和数据、用于执行图像特征提取的可执行程序和数据、待训练的参数预测模型的可执行程序和数据、以及用于执行图像检测的图像检测模型的可执行程序和数据。模型训练设备901可以运行特征提取算法、待训练的参数预测模型的可执行程序和数据、图像处理算法和图像检测模型,模型训练设备901还可以从存储设备902中调用样本图像S1、图像处理算法的可执行程序和数据、用于执行图像特征提取的可执行程序和数据、待训练的参数预测模型的可执行程序和数据、以及用于执行图像检测的图像检测模型的可执行程序和数据,以对参数预测模型的参数进行调试。另外,模型训练设备901还可以将运行产生的数据以及每次对参数预测模型的参数调试后的调试结果存储至存储设备902。此外,模型训练设备901和存储设备902还可以设置有I/O端口,以与显示设备903进行数据交互。用户设备903中可以包括屏幕等显示装置,以对样本图像S1进行标注。具体来说,模型训练设备901可以从存储设备902中获取样本图像S1,对样本图像S1进行图像处理后提供至显示设备903,以在显示设备903中呈现。用户通过显示设备903对样本图像S1进行标注,将样本图像S1的标注信息存储至存储设备902。In FIG. 9 , the system architecture 900 includes a model training device 901 , a storage device 902 and a display device 903 . The storage device 902 may include, but is not limited to, read-only memory or random access memory, and the like. The storage device 902 is used to store the sample image S1. In addition, the storage device 902 may also store executable programs and data of image processing algorithms for performing image processing, executable programs and data for performing image feature extraction, executable programs and data of the parameter prediction model to be trained, and data, and executable programs and data for an image detection model used to perform image detection. The model training device 901 can run the feature extraction algorithm, the executable program and data of the parameter prediction model to be trained, the image processing algorithm and the image detection model, and the model training device 901 can also call the sample image S1, the image processing algorithm from the storage device 902 The executable program and data, the executable program and data for performing image feature extraction, the executable program and data for the parameter prediction model to be trained, and the executable program and data for performing the image detection model for image detection, To debug the parameters of the parameter prediction model. In addition, the model training device 901 may also store the data generated by the operation and the debugging results after each parameter debugging of the parameter prediction model to the storage device 902 . In addition, the model training device 901 and the storage device 902 may also be provided with I/O ports for data interaction with the display device 903 . The user equipment 903 may include a display device such as a screen to mark the sample image S1. Specifically, the model training device 901 may acquire the sample image S1 from the storage device 902 , perform image processing on the sample image S1 and provide the sample image S1 to the display device 903 for presentation in the display device 903 . The user annotates the sample image S1 through the display device 903 , and stores the annotation information of the sample image S1 in the storage device 902 .

基于图1、图4所示的电子设备100的结构示意图、以及图9所示的系统架构900,下面结合图10,对用于生成参数预测模型的方法进行详细介绍。请参考图10,其示出了本申请实施例提供的用于生成参数预测模型的方法的流程1000。需要说明的是,本申请实施例中所述的用于生成参数预测模型的方法的执行主体可以为图9所示的模型训练设备901。如图10所示,用于生成参数预测模型的方法包括如下步骤:Based on the schematic structural diagrams of the electronic device 100 shown in FIGS. 1 and 4 , and the system architecture 900 shown in FIG. 9 , a method for generating a parameter prediction model will be described in detail below with reference to FIG. 10 . Please refer to FIG. 10 , which shows a process 1000 of a method for generating a parameter prediction model provided by an embodiment of the present application. It should be noted that, the execution body of the method for generating a parameter prediction model described in the embodiments of the present application may be the model training device 901 shown in FIG. 9 . As shown in Figure 10, the method for generating a parameter prediction model includes the following steps:

步骤1001,基于样本图像集,对样本图像集中的样本图像S1进行特征提取,生成特征张量。Step 1001 , based on the sample image set, perform feature extraction on the sample image S1 in the sample image set to generate a feature tensor.

样本图像集中包括多个样本图像S1和每一个样本图像S1的标注信息。样本图像S1的标注信息是基于图像检测模型所执行的检测内容标注的。例如,当图像检测模型用于执行目标检测时,样本图像S1的标注信息可以包括目标对象和目标对象在样本图像S1中的位置;当图像检测模型用于执行行人意图检测时,样本图像S1的标注信息可以包括目标对象和目标对象的动作信息。The sample image set includes multiple sample images S1 and label information of each sample image S1. The annotation information of the sample image S1 is annotated based on the detection content performed by the image detection model. For example, when the image detection model is used to perform target detection, the annotation information of the sample image S1 may include the target object and the position of the target object in the sample image S1; when the image detection model is used to perform pedestrian intent detection, the sample image S1 The annotation information may include the target object and the action information of the target object.

本申请实施例中,对样本图像S1进行特征提取生成特征张量的过程,与图7所示实施例中所述的生成特征张量的过程相同,具体参考图7所示的实施例的相关描述,在此不再赘述。In this embodiment of the present application, the process of performing feature extraction on the sample image S1 to generate a feature tensor is the same as the process of generating a feature tensor described in the embodiment shown in FIG. description, which will not be repeated here.

步骤1002,将特征张量输入至参数预测模型,生成用于处理样本图像S1的图像处理算法的参数。Step 1002 , input the feature tensor into the parameter prediction model, and generate the parameters of the image processing algorithm for processing the sample image S1.

本申请实施例中,图像处理算法包括但不限于:阶调映射算法、降噪算法、对比度增强算法或者边缘增强算法等。其中,图像处理算法的参数具体包括但不限于:阶调映射算法中的目标亮度参数(key)、目标饱和度参数(saturation)以及用于生成低通滤波图像的 滤波核参数;对比度增强算法中的对比度阈值参数;边缘增强算法中的边缘增强因子α;降噪算法中的空间域高斯核参数σs以及像素值域高斯核参数σr。In the embodiment of the present application, the image processing algorithm includes, but is not limited to, a tone mapping algorithm, a noise reduction algorithm, a contrast enhancement algorithm, or an edge enhancement algorithm, and the like. Wherein, the parameters of the image processing algorithm specifically include but are not limited to: the target brightness parameter (key), the target saturation parameter (saturation) in the tone mapping algorithm, and the filter kernel parameter used to generate the low-pass filtered image; in the contrast enhancement algorithm The contrast threshold parameter of ; the edge enhancement factor α in the edge enhancement algorithm; the spatial domain Gaussian kernel parameter σs and the pixel value domain Gaussian kernel parameter σr in the noise reduction algorithm.

本申请实施例中所述的参数预测模型,可以包括以下之一:随机森林模型、支持向量机模型或者神经网络模型。下面以参数预测模型为神经网络模型为例,对参数预测模型的结构进行详细描述。参数预测模可以包括多层卷积层、多层池化层以及全连接层。其中,卷积层用于对图像进行特征提取以及卷积运算,生成特征图;池化层用于对特征图进行下采样和降维;全连接层使用若干级全连接神经网络,对最后一级卷积层输出的特征向量进行计算,最终输出参数预测值。在一种可能的实现方式中,每一个卷积层可以使用3×3卷积核,并将输出特征图的通道数设定为输入特征图的两倍,不改变特征图的空间分辨率;每一个池化层使用最大值池化(max pooling)算子将输入特征图的空间分辨率降为原有分辨率的1/2。假设输入至参数预测网络中的特征张量为K×K×3,则经过多个卷积层和池化层对特征张量的处理,生成1×1×3K的特征向量。全连接层对该1×1×3K的特征向量进行计算,生成1×1×n的参数预测向量,参数预测向量中的每一个元素分别对应图像处理算法中的可配置参数。The parameter prediction model described in the embodiments of the present application may include one of the following: a random forest model, a support vector machine model, or a neural network model. The structure of the parameter prediction model is described in detail below by taking the parameter prediction model as the neural network model as an example. The parameter prediction model can include multi-layer convolutional layers, multi-layer pooling layers and fully connected layers. Among them, the convolution layer is used for feature extraction and convolution operations on the image to generate feature maps; the pooling layer is used to downsample and reduce the dimension of the feature maps; the fully connected layer uses several levels of fully connected neural networks to The feature vector output by the convolutional layer is calculated, and finally the predicted value of the parameter is output. In a possible implementation, each convolutional layer can use a 3×3 convolution kernel, and set the number of channels of the output feature map to twice the input feature map, without changing the spatial resolution of the feature map; Each pooling layer uses a max pooling operator to reduce the spatial resolution of the input feature map to 1/2 the original resolution. Assuming that the feature tensor input to the parameter prediction network is K×K×3, the feature vector of 1×1×3K is generated after the feature tensor is processed by multiple convolutional layers and pooling layers. The fully connected layer calculates the 1×1×3K feature vector, and generates a 1×1×n parameter prediction vector. Each element in the parameter prediction vector corresponds to a configurable parameter in the image processing algorithm.

参数预测模型中的每一层卷积层的工作可以用数学表达式y=a(W*x十b)来描述。其中,W为权重,x为输入向量(即输入神经元),b为偏置数据,y为输出向量(即输出神经元),a为常数。从物理层面深度神经网络中的每一层的工作可以理解为通过五种对输入空间(输入向量的集合)的操作,完成输入空间到输出空间的变换(即矩阵的行空间到列空间),这五种操作包括:1、升维/降维;2、放大/缩小;3、旋转;4、平移;5、"弯曲"。其中1、2、3的操作由W*x完成,4的操作由+b完成,5的操作则由a()来实现。这里之所以用"空间"二字来表述是因为被处理的图像并不是单个事物,而是一类事物,空间是指这类事物所有个体的集合。其中,W是权重向量,该向量中的每一个值表示该层卷积层中的一个神经元的权重值。该向量W决定着上文所述的输入空间到输出空间的空间变换,即每一层的权重W控制着如何变换空间。The work of each convolutional layer in the parameter prediction model can be described by the mathematical expression y=a(W*x+b). Among them, W is the weight, x is the input vector (ie the input neuron), b is the bias data, y is the output vector (ie the output neuron), and a is a constant. From the physical level, the work of each layer in the deep neural network can be understood as completing the transformation from the input space to the output space (that is, the row space of the matrix to the column space) through five operations on the input space (set of input vectors). These five operations include: 1. Dimension up/down; 2. Zoom in/out; 3. Rotate; 4. Translation; 5. "Bend". Among them, the operations of 1, 2, and 3 are completed by W*x, the operation of 4 is completed by +b, and the operation of 5 is implemented by a(). The reason why the word "space" is used here is because the image to be processed is not a single thing, but a type of thing, and space refers to the collection of all individuals of this type of thing. where W is the weight vector, and each value in the vector represents the weight value of a neuron in the convolutional layer of this layer. This vector W determines the space transformation from the input space to the output space described above, that is, the weight W of each layer controls how the space is transformed.

步骤1003,基于所生成的用于处理样本图像S1的图像处理算法的参数,调整图像处理算法,采用参数调整后的图像处理算法对样本图像S1进行处理,生成处理后的图像B。Step 1003: Based on the generated parameters of the image processing algorithm for processing the sample image S1, adjust the image processing algorithm, and use the image processing algorithm after parameter adjustment to process the sample image S1 to generate a processed image B.

步骤1004,利用图像检测模型对图像B进行检测,生成检测结果。In step 1004, the image B is detected by using the image detection model, and a detection result is generated.

这里,图像检测模型可以执行以下至少一项检测:目标检测、车道线检测或者行人意图检测等。图像检测模型是基于图像数据集S1对深度神经网络训练得到的。其中,图像检测模型可以采用传统模型训练方法训练得到,在此不再赘述。Here, the image detection model may perform at least one of the following detections: object detection, lane line detection, or pedestrian intent detection, and the like. The image detection model is obtained by training a deep neural network based on the image dataset S1. Among them, the image detection model can be obtained by training using the traditional model training method, which will not be repeated here.

步骤1005,基于检测结果和样本图像S1的标注信息,构建损失函数。Step 1005, construct a loss function based on the detection result and the labeling information of the sample image S1.

基于样本图像数据集中每一个样本图像S1的检测结果和样本图像S1的标注信息之间的误差,构建损失函数。该损失函数可以包括但不限于:平均绝对误差(MAE)损失函数、均方误差(MSE)损失函数或者交叉熵函数等。其中,所构建的损失函数中包括参数预测模型中待调整的参数。其中,参数预测模型的参数,即为形成参数预测模型的所有卷积层的权重矩阵(由很多卷积层的向量W形成的权重矩阵)。A loss function is constructed based on the error between the detection result of each sample image S1 in the sample image dataset and the annotation information of the sample image S1. The loss function may include, but is not limited to, a mean absolute error (MAE) loss function, a mean square error (MSE) loss function, or a cross entropy function, and the like. The constructed loss function includes parameters to be adjusted in the parameter prediction model. The parameters of the parameter prediction model are the weight matrices of all convolutional layers forming the parameter prediction model (the weight matrix formed by the vectors W of many convolutional layers).

步骤1006,确定是否达到预设条件。Step 1006, determine whether a preset condition is reached.

这里的预设条件包括以下至少一项:预设损失函数的损失值小于等于预设阈值;迭代调整参数预测模型的参数的次数大于等于预设阈值。当达到预设条件时,保存参数预测模 型的参数;当未达到预设条件时,则执行步骤1007。The preset conditions here include at least one of the following: the loss value of the preset loss function is less than or equal to the preset threshold; the number of times of iteratively adjusting the parameters of the parameter prediction model is greater than or equal to the preset threshold. When the preset condition is reached, the parameters of the parameter prediction model are saved; when the preset condition is not reached, step 1007 is executed.

步骤1007,利用反向传播算法和梯度下降算法调整参数预测模型的参数。Step 1007: Adjust the parameters of the parameter prediction model by using the back-propagation algorithm and the gradient descent algorithm.

梯度下降算法具体可以包括但不限于:SGD、Adam等最优化算法。在基于预设损失函数进行反向传播时,可利用链式法则计算预设损失函数关于参数预测模型中各权重矩阵的梯度。The gradient descent algorithm may specifically include, but is not limited to, optimization algorithms such as SGD and Adam. When performing backpropagation based on the preset loss function, the chain rule can be used to calculate the gradient of the preset loss function with respect to each weight matrix in the parameter prediction model.

需要说明的是,基于预设损失函数采用反向传播算法调整图像处理算法的参数时,保持图像检测模型中的各参数均不变。此外,当采用机器学习的方法调整参数预测模型的参数时,本申请实施例所述的图像检测算法均具有可微分性,以便于基于链式法则进行反向传播。It should be noted that when the parameters of the image processing algorithm are adjusted by the back-propagation algorithm based on the preset loss function, the parameters in the image detection model are kept unchanged. In addition, when using the machine learning method to adjust the parameters of the parameter prediction model, the image detection algorithms described in the embodiments of the present application all have differentiability, so as to facilitate backpropagation based on the chain rule.

如图10所示的参数预测模型的训练方法,通过重复执行步骤1002-步骤1007,也即对参数预测模型的参数进行多次迭代调整,可以得到参数预测模型中令损失函数达到极小值的最佳参数值。For the training method of the parameter prediction model shown in FIG. 10 , by repeatedly performing steps 1002 to 1007, that is, performing multiple iterative adjustments to the parameters of the parameter prediction model, the parameter prediction model that makes the loss function reach a minimum value can be obtained. optimal parameter value.

结合上述实施例及相关附图,本申请实施例提供了一种图像检测方法,该图像检测方法可以在如图l、图5所示的电子设备中实现。图11是本申请实施例提供的图像检测方法的流程1100,如图11所示,该方法可以包括以下步骤:With reference to the above embodiments and the related drawings, the embodiments of the present application provide an image detection method, which can be implemented in the electronic device shown in FIG. 1 and FIG. 5 . Figure 11 is a flow chart 1100 of an image detection method provided by an embodiment of the present application, and as shown in Figure 11, the method may include the following steps:

步骤1101,获取待检测图像。Step 1101, acquiring an image to be detected.

步骤1102,基于待检测图像的图像特征,利用预先训练的参数预测模型,对用于处理待检测图像的图像处理算法的参数进行预测,生成参数预测值。Step 1102 , based on the image features of the image to be detected, use a pre-trained parameter prediction model to predict the parameters of the image processing algorithm used to process the image to be detected, and generate a parameter prediction value.

步骤1103,利用参数调整后的图像处理算法对待检测图像进行图像处理,生成处理后的图像。Step 1103: Perform image processing on the image to be detected by using the image processing algorithm after parameter adjustment to generate a processed image.

步骤1104,将处理后的图像输入至预先训练的图像检测模型,生成检测结果。Step 1104: Input the processed image into a pre-trained image detection model to generate a detection result.

可以理解的是,电子装置为了实现上述功能,其包含了执行各个功能相应的硬件和/或软件模块。结合本文中所公开的实施例描述的各示例的算法步骤,本申请能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。本领域技术人员可以结合实施例对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。It can be understood that, in order to realize the above-mentioned functions, the electronic device includes corresponding hardware and/or software modules for executing each function. The present application can be implemented in hardware or in the form of a combination of hardware and computer software in conjunction with the algorithm steps of each example described in conjunction with the embodiments disclosed herein. Whether a function is performed by hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functionality for each particular application in conjunction with the embodiments, but such implementations should not be considered beyond the scope of this application.

本实施例可以根据上述方法示例对以上一个或多个处理器进行功能模块的划分,例如,可以对应各个功能划分各个功能模块,也可以将两个或两个以上的功能集成在一个处理模块中。上述集成的模块可以采用硬件的形式实现。需要说明的是,本实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。In this embodiment, the above one or more processors may be divided into functional modules according to the foregoing method examples. For example, each functional module may be divided corresponding to each function, or two or more functions may be integrated into one processing module. . The above-mentioned integrated modules can be implemented in the form of hardware. It should be noted that, the division of modules in this embodiment is schematic, and is only a logical function division, and there may be other division manners in actual implementation.

在采用对应各个功能划分各个功能模块的情况下,图12示出了上述实施例中涉及的图像检测装置1200的一种可能的组成示意图,如图12所示,该图像检测装置1200可以包括:获取模块1201、预测模块1202、调整模块1203、处理模块1204和检测模块1205。其中,获取模块1201,被配置成获取待检测图像;预测模块1202,被配置成基于所述待检测图像的图像特征,利用预先训练的参数预测模型,对用于处理所述待检测图像的图像处理算法的参数进行预测,生成参数预测值;调整模块1203,被配置成基于所述参数预测值,调整所述图像处理算法的参数;处理模块1204,被配置成利用参数调整后的图像处理算法对所述待检测图像进行图像处理,生成处理后的图像;检测模块1205,被配置成将所 述处理后的图像输入至预先训练的图像检测模型,生成检测结果。In the case where each functional module is divided according to each function, FIG. 12 shows a possible schematic diagram of the composition of the image detection apparatus 1200 involved in the above embodiment. As shown in FIG. 12 , the image detection apparatus 1200 may include: An acquisition module 1201 , a prediction module 1202 , an adjustment module 1203 , a processing module 1204 and a detection module 1205 . The acquisition module 1201 is configured to acquire the image to be detected; the prediction module 1202 is configured to use a pre-trained parameter prediction model based on the image features of the image to be detected, to process the image for processing the image to be detected. The parameters of the processing algorithm are predicted to generate parameter predicted values; the adjustment module 1203 is configured to adjust the parameters of the image processing algorithm based on the parameter predicted values; the processing module 1204 is configured to use the image processing algorithm adjusted by the parameters Image processing is performed on the to-be-detected image to generate a processed image; the detection module 1205 is configured to input the processed image into a pre-trained image detection model to generate a detection result.

在一种可能的实现方式中,所述参数预测模型是通过比较样本图像的标注信息和图像检测模型对所述样本图像的检测结果、并且基于比较结果训练得到的。In a possible implementation manner, the parameter prediction model is obtained by comparing the annotation information of the sample image with the detection result of the sample image by the image detection model, and training based on the comparison result.

在一种可能的实现方式中,所述图像检测装置还包括参数预测模型训练模块(图中未示出),所述参数预测模型训练模块包括:比较子模块,被配置成将所述样本图像的检测结果和所述样本图像的标注信息进行比较以得到所述比较结果;调整子模块,被配置成基于所述比较结果迭代调整所述参数预测模型的参数;保存子模块,被配置成在预设条件满足时,保存所述参数预测模型的参数。In a possible implementation manner, the image detection apparatus further includes a parameter prediction model training module (not shown in the figure), and the parameter prediction model training module includes: a comparison sub-module configured to compare the sample image The detection result of the sample image is compared with the annotation information of the sample image to obtain the comparison result; the adjustment sub-module is configured to iteratively adjust the parameters of the parameter prediction model based on the comparison result; the saving sub-module is configured to When the preset condition is satisfied, the parameters of the parameter prediction model are saved.

在一种可能的实现方式中,所述比较结果为误差,所述调整子模块进一步被配置成:基于所述样本图像的检测结果和所述样本图像的标注信息之间的所述误差,构建目标损失函数,其中所述目标损失函数包括所述参数预测模型中待调整的参数;基于所述目标损失函数,利用反向传播算法和梯度下降算法,迭代调整所述图像处理算法的参数。In a possible implementation manner, the comparison result is an error, and the adjustment sub-module is further configured to: based on the error between the detection result of the sample image and the annotation information of the sample image, construct A target loss function, wherein the target loss function includes parameters to be adjusted in the parameter prediction model; based on the target loss function, the parameters of the image processing algorithm are iteratively adjusted by using a back-propagation algorithm and a gradient descent algorithm.

在一种可能的实现方式中,所述预测模块1202被配置成:对所述待检测图像进行特征提取,生成特征张量;将所述特征张量输入至所述参数预测模型,生成所述参数预测值。In a possible implementation manner, the prediction module 1202 is configured to: perform feature extraction on the to-be-detected image to generate a feature tensor; input the feature tensor into the parameter prediction model to generate the feature tensor Parameter predictions.

在一种可能的实现方式中,所述预测模块1202被配置成:将所述待检测图像输入至所述参数预测模型,生成所述参数预测值。In a possible implementation manner, the prediction module 1202 is configured to: input the image to be detected into the parameter prediction model to generate the parameter prediction value.

在一种可能的实现方式中,所述图像处理算法包括以下至少一项:阶调映射算法、对比度增强算法、图像边缘增强算法和图像降噪算法。In a possible implementation manner, the image processing algorithm includes at least one of the following: a tone mapping algorithm, a contrast enhancement algorithm, an image edge enhancement algorithm, and an image noise reduction algorithm.

在一种可能的实现方式中,所述图像检测模型用于执行以下至少一项检测任务:检测框的标注、目标对象的识别、置信度的预测、目标对象运动轨迹的预测。In a possible implementation manner, the image detection model is used to perform at least one of the following detection tasks: labeling of detection frames, recognition of target objects, prediction of confidence levels, and prediction of motion trajectories of target objects.

本实施例提供的图像检测装置1200,用于执行电子设备100所执行的图像检测方法,可以达到与上述实现方法相同的效果。以上图12对应的各个模块可以通过软件、硬件或二者结合实现例如,每个模块可以以软件形式实现,以驱动如图1所示的电子设备100中的参数预测装置102、ISP103和AI处理器104。或者,每个模块可包括对应处理器和相应的驱动软件两部分。The image detection apparatus 1200 provided in this embodiment is configured to execute the image detection method executed by the electronic device 100, and can achieve the same effect as the above-mentioned implementation method. Each module corresponding to FIG. 12 can be implemented by software, hardware or a combination of the two. For example, each module can be implemented in software to drive the parameter prediction device 102, ISP 103 and AI processing in the electronic device 100 shown in FIG. 1 . device 104. Alternatively, each module may include a corresponding processor and a corresponding driver software.

在采用集成的单元的情况下,图像检测装置1200可以包括至少一个处理器和存储器。其中,至少一个处理器可以调用存储器存储的全部或部分计算机程序,对电子设备100的动作进行控制管理,例如,可以用于支持电子设备100执行上述各个模块执行的步骤。存储器可以用于支持电子设备100执行存储程序代码和数据等。处理器可以实现或执行结合本申请公开内容所描述的各种示例性的逻辑模块,其可以是实现计算功能的一个或多个微处理器组合,例如包括但不限于图1所示的图像信号处理器103和AI处理器104。此外,该微处理器组合还可以包括中央处理器和控制器等。此外,处理器除了包括图1所示的各处理器外,还可以包括其他可编程逻辑器件、晶体管逻辑器件、或者分立硬件组件等。存储器可以包括随机存取存储器(RAM)和只读存储器(ROM)等。该随机存取存储器可以包括易失性存储器(如SRAM、DRAM、DDR(双倍数据速率SDRAM,Double Data Rate SDRAM)或SDRAM等)和非易失性存储器。RAM中可以存储有参数预测装置102、ISP103和AI处理器104运行所需要的数据(诸如图像处理算法等)和参数、参数预测装置102、ISP103和AI处理器104运行所产生的中间数据、ISP103处理后的图像数据、AI处理器104运行后的输出结果等。只读存储器ROM中可以存储有参数预测装置102、 ISP103和AI处理器104的可执行程序。上述各部件可以通过加载可执行程序以执行各自的工作。存储器存储的可执行程序可以执行如图11所述的图像检测方法。Where an integrated unit is employed, the image detection apparatus 1200 may include at least one processor and memory. Wherein, at least one processor can call all or part of the computer program stored in the memory to control and manage the actions of the electronic device 100, for example, it can be used to support the electronic device 100 to perform the steps performed by the above-mentioned modules. The memory may be used to support the execution of the electronic device 100 by storing program codes and data, and the like. The processor may implement or execute various exemplary logic modules described in conjunction with the present disclosure, which may be a combination of one or more microprocessors that implement computing functions, such as, but not limited to, the image signal shown in FIG. 1 . Processor 103 and AI Processor 104. In addition, the microprocessor combination may also include a central processing unit, a controller, and the like. In addition, the processor may include other programmable logic devices, transistor logic devices, or discrete hardware components in addition to the processors shown in FIG. 1 . The memory may include random access memory (RAM) and read only memory (ROM), among others. The random access memory can include volatile memory (such as SRAM, DRAM, DDR (Double Data Rate SDRAM, Double Data Rate SDRAM) or SDRAM, etc.) and non-volatile memory. The RAM can store data (such as image processing algorithms, etc.) and parameters required for the operation of the parameter prediction device 102, ISP 103 and the AI processor 104, intermediate data generated by the operation of the parameter prediction device 102, ISP 103 and the AI processor 104, and the ISP 103 The processed image data, the output result after the AI processor 104 runs, and the like. Executable programs of the parameter prediction device 102 , the ISP 103 and the AI processor 104 may be stored in the read-only memory ROM. Each of the above components can perform their own work by loading an executable program. The executable program stored in the memory can execute the image detection method as described in FIG. 11 .

在采用对应各个功能划分各个功能模块的情况下,图13示出了上述实施例中涉及的用于训练参数预测模型的装置1300的一种可能的组成示意图,如图13所示,该用于训练参数预测模型的装置1300可以包括:预测模块1301、第一调整模块1302、处理模块1303、检测模块1304、比较模块1305和第二调整模块1306。其中,预测模块1301,被配置成基于样本图像的图像特征,利用参数预测模型,对用于处理所述样本图像的图像处理算法的参数进行预测,生成参数预测值;第一调整模块1302,被配置成基于所述参数预测值,调整所述图像处理算法的参数;处理模块1303,被配置成利用参数调整后的图像处理算法对所述样本图像进行图像处理,生成处理后的图像;检测模块1304,将所述处理后的图像输入至预先训练的图像检测模型,生成检测结果;比较模块1305,被配置成比较所述检测结果和所述样本图像的标注信息之间的误差,得到比较结果;第二调整模块1306,被配置成基于所述比较结果,调整所述参数预测模型的参数;保存模块,被配置成在预设条件满足时,保存所述参数预测模型的参数。In the case where each functional module is divided according to each function, FIG. 13 shows a possible schematic diagram of the composition of the apparatus 1300 for training a parameter prediction model involved in the above embodiment. As shown in FIG. The apparatus 1300 for training a parameter prediction model may include: a prediction module 1301 , a first adjustment module 1302 , a processing module 1303 , a detection module 1304 , a comparison module 1305 and a second adjustment module 1306 . The prediction module 1301 is configured to use a parameter prediction model to predict the parameters of the image processing algorithm used to process the sample image based on the image features of the sample image, and generate a parameter prediction value; the first adjustment module 1302 is configured by is configured to adjust the parameters of the image processing algorithm based on the parameter prediction value; the processing module 1303 is configured to perform image processing on the sample image by using the image processing algorithm after parameter adjustment, and generate a processed image; the detection module 1304, input the processed image into a pre-trained image detection model, and generate a detection result; a comparison module 1305, is configured to compare the error between the detection result and the labeling information of the sample image, and obtain a comparison result ; The second adjustment module 1306 is configured to adjust the parameters of the parameter prediction model based on the comparison result; the saving module is configured to save the parameters of the parameter prediction model when a preset condition is satisfied.

在一种可能的实现方式中,所述比较结果为误差,第二调整模块1306被配置成:基于所述检测结果和所述样本图像的标注信息之间的所述误差,构建目标损失函数,其中所述目标损失函数包括所述参数预测模型中待调整的参数;基于所述目标损失函数,利用反向传播算法和梯度下降算法,迭代调整所述参数预测模型的参数。In a possible implementation manner, the comparison result is an error, and the second adjustment module 1306 is configured to: construct an objective loss function based on the error between the detection result and the annotation information of the sample image, The target loss function includes parameters to be adjusted in the parameter prediction model; based on the target loss function, the parameters of the parameter prediction model are iteratively adjusted by using a back-propagation algorithm and a gradient descent algorithm.

在一种可能的实现方式中,预测模块1301被配置成:对所述样本图像进行特征提取,生成特征张量;将所述特征张量输入至所述参数预测模型,生成所述参数预测值。In a possible implementation manner, the prediction module 1301 is configured to: perform feature extraction on the sample image to generate a feature tensor; input the feature tensor into the parameter prediction model to generate the parameter prediction value .

在一种可能的实现方式中,预测模块1301被配置成:将所述样本图像输入至所述参数预测模型,生成所述参数预测值。In a possible implementation, the prediction module 1301 is configured to: input the sample image into the parameter prediction model to generate the parameter prediction value.

在采用集成的单元的情况下,用于训练参数预测模型的装置1300可以包括至少一个处理器和存储设备。其中,至少一个处理器可以调用存储器存储的全部或部分计算机程序,对如图9所示的模型训练设备901的动作进行控制管理,例如,可以用于支持模型训练设备901执行上述各个模块执行的步骤。存储器可以用于支持模型训练设备901执行存储程序代码和数据等。处理器可以实现或执行结合本申请公开内容所描述的各种示例性的逻辑模块,其可以是实现计算功能的一个或多个微处理器组合,例如包括但不限于中央处理器和控制器等。此外,处理器还可以包括其他可编程逻辑器件、晶体管逻辑器件、或者分立硬件组件等。存储器可以包括随机存取存储器(RAM)和只读存储器ROM等。该随机存取存储器可以包括易失性存储器(如SRAM、DRAM、DDR(双倍数据速率SDRAM,Double Data Rate SDRAM)或SDRAM等)和非易失性存储器。RAM中可以存储有模型训练设备901运行所需要的数据(诸如图像处理算法等)和参数、模型训练设备901运行所产生的中间数据、模型训练设备901运行后的输出结果等。只读存储器ROM中可以存储有模型训练设备901的可执行程序。上述各部件可以通过加载可执行程序以执行各自的工作。存储器存储的可执行程序可以执行如图10所述的用于训练参数预测模型的方法。Where an integrated unit is employed, the apparatus 1300 for training a parameter prediction model may include at least one processor and storage device. Wherein, at least one processor can call all or part of the computer program stored in the memory to control and manage the actions of the model training device 901 as shown in FIG. step. The memory may be used to support the execution of the model training device 901 by storing program codes and data, and the like. The processor can implement or execute various exemplary logic modules described in conjunction with the disclosure of the present application, which can be one or more microprocessor combinations that implement computing functions, including but not limited to a central processing unit and a controller, etc. . In addition, the processor may also include other programmable logic devices, transistor logic devices, or discrete hardware components, or the like. The memory may include random access memory (RAM), read only memory ROM, and the like. The random access memory can include volatile memory (such as SRAM, DRAM, DDR (Double Data Rate SDRAM, Double Data Rate SDRAM) or SDRAM, etc.) and non-volatile memory. The RAM may store data (such as image processing algorithms, etc.) and parameters required by the model training device 901 to run, intermediate data generated by the model training device 901 running, and output results after the model training device 901 runs. An executable program of the model training apparatus 901 may be stored in the read-only memory ROM. Each of the above components can perform their own work by loading an executable program. The executable program stored in the memory may perform the method for training a parameter prediction model as described in FIG. 10 .

本实施例还提供一种计算机可读存储介质,该计算机可读存储介质中存储有计算机指令,当该计算机指令在计算机上运行时,使得计算机执行上述相关方法步骤实现上述实施例中的图像检测装置1100的图像检测方法,或者实现上述实施例中的用于训练参数预测 模型的装置1300的参数预测模型的训练方法。This embodiment further provides a computer-readable storage medium, where computer instructions are stored in the computer-readable storage medium, and when the computer instructions are executed on the computer, the computer executes the above-mentioned related method steps to realize the image detection in the above-mentioned embodiment. The image detection method of the apparatus 1100, or the training method of the parameter prediction model of the apparatus 1300 for training the parameter prediction model in the above-mentioned embodiment.

本实施例还提供了一种计算机程序产品,当该计算机程序产品在计算机上运行时,使得计算机执行上述相关步骤,以实现上述实施例中图像检测装置1100的图像检测方法,或者实现上述实施例中的用于训练参数预测模型的装置1300的参数预测模型的训练方法。This embodiment also provides a computer program product, which, when the computer program product runs on a computer, causes the computer to execute the above-mentioned relevant steps, so as to realize the image detection method of the image detection apparatus 1100 in the above-mentioned embodiment, or to realize the above-mentioned embodiment. A training method of a parameter prediction model of the apparatus 1300 for training a parameter prediction model in .

其中,本实施例提供的计算机可读存储介质或者计算机程序产品均用于执行上文所提供的对应的方法,因此,其所能达到的有益效果可参考上文所提供的对应的方法中的有益效果,此处不再赘述。Wherein, the computer-readable storage medium or computer program product provided in this embodiment is used to execute the corresponding method provided above. Therefore, for the beneficial effect that can be achieved, reference may be made to the corresponding method provided above. The beneficial effects will not be repeated here.

通过以上实施方式的描述,所属领域的技术人员可以了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。From the description of the above embodiments, those skilled in the art can understand that for the convenience and brevity of the description, only the division of the above functional modules is used as an example for illustration. In practical applications, the above functions can be allocated by different The function module is completed, that is, the internal structure of the device is divided into different function modules, so as to complete all or part of the functions described above.

另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.

集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例方法的全部或部分步骤。而前述的可读存储介质包括:U盘、移动硬盘、只读存储器(read only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application can be embodied in the form of software products in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, which are stored in a storage medium , including several instructions to make a device (which may be a single chip microcomputer, a chip, etc.) or a processor (processor) to execute all or part of the steps of the methods in the various embodiments of the present application. The aforementioned readable storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), magnetic disk or optical disk, etc. that can store program codes. medium.

以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above are only specific embodiments of the present application, but the protection scope of the present application is not limited to this. should be covered within the scope of protection of this application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

最后应说明的是:以上各实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述各实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, but not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: The technical solutions described in the foregoing embodiments can still be modified, or some or all of the technical features thereof can be equivalently replaced; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the technical solutions of the embodiments of the present application. scope.

Claims (20)

一种图像检测方法,其特征在于,包括:An image detection method, comprising: 获取待检测图像;Obtain the image to be detected; 基于所述待检测图像的图像特征,利用预先训练的参数预测模型,对用于处理所述待检测图像的图像处理算法的参数进行预测,生成参数预测值;Based on the image features of the to-be-detected image, using a pre-trained parameter prediction model, predict the parameters of the image processing algorithm used to process the to-be-detected image, and generate a parameter prediction value; 基于所述参数预测值,调整所述图像处理算法的参数;based on the parameter prediction value, adjusting the parameters of the image processing algorithm; 利用参数调整后的图像处理算法对所述待检测图像进行图像处理,生成处理后的图像;Image processing is performed on the to-be-detected image by using the image processing algorithm after parameter adjustment to generate a processed image; 将所述处理后的图像输入至预先训练的图像检测模型,生成检测结果。The processed images are input into a pre-trained image detection model to generate detection results. 根据权利要求1所述的图像检测方法,其特征在于,所述参数预测模型是通过比较样本图像的标注信息和图像检测模型对所述样本图像的检测结果、并且基于比较结果训练得到的。The image detection method according to claim 1, wherein the parameter prediction model is obtained by comparing the annotation information of the sample image with the detection result of the sample image by the image detection model, and is trained based on the comparison result. 根据权利要求2所述的图像检测方法,其特征在于,所述参数预测模型通过如下步骤训练得到:The image detection method according to claim 2, wherein the parameter prediction model is obtained by training the following steps: 将所述样本图像的检测结果和所述样本图像的标注信息进行比较以得到所述比较结果;comparing the detection result of the sample image with the annotation information of the sample image to obtain the comparison result; 基于所述比较结果迭代调整所述参数预测模型的参数;Iteratively adjust the parameters of the parameter prediction model based on the comparison results; 在预设条件满足时,保存所述参数预测模型的参数。When the preset condition is satisfied, the parameters of the parameter prediction model are saved. 根据权利要求3所述的图像检测方法,其特征在于,所述比较结果为误差,所述基于所述比较结果迭代调整所述参数预测模型的参数,包括:The image detection method according to claim 3, wherein the comparison result is an error, and the iteratively adjusting the parameters of the parameter prediction model based on the comparison result comprises: 基于所述样本图像的检测结果和所述样本图像的标注信息之间的所述误差,构建目标损失函数,其中所述目标损失函数包括所述参数预测模型中待调整的参数;constructing a target loss function based on the error between the detection result of the sample image and the annotation information of the sample image, wherein the target loss function includes parameters to be adjusted in the parameter prediction model; 基于所述目标损失函数,利用反向传播算法和梯度下降算法,迭代调整所述图像处理算法的参数。Based on the objective loss function, the parameters of the image processing algorithm are iteratively adjusted using a back-propagation algorithm and a gradient descent algorithm. 根据权利要求1-4任一项所述的图像检测方法,其特征在于,所述基于所述待检测图像的图像特征,利用预先训练的参数预测模型,对用于处理所述待检测图像的图像处理算法的参数进行预测,生成参数预测值,包括:The image detection method according to any one of claims 1-4, characterized in that, based on the image features of the to-be-detected image, a pre-trained parameter prediction model is used to process the image-to-be-detected image. The parameters of the image processing algorithm are predicted, and the predicted values of the parameters are generated, including: 对所述待检测图像进行特征提取,生成特征张量;performing feature extraction on the to-be-detected image to generate a feature tensor; 将所述特征张量输入至所述参数预测模型,生成所述参数预测值。The feature tensor is input to the parameter prediction model, and the parameter prediction value is generated. 根据权利要求1-4任一项所述的图像检测方法,其特征在于,所述基于所述待检测图像的图像特征,利用预先训练的参数预测模型,对用于处理所述待检测图像的图像处理算法的参数进行预测,生成参数预测值,包括:The image detection method according to any one of claims 1-4, characterized in that, based on the image features of the to-be-detected image, a pre-trained parameter prediction model is used to process the image-to-be-detected image. The parameters of the image processing algorithm are predicted, and the predicted values of the parameters are generated, including: 将所述待检测图像输入至所述参数预测模型,生成所述参数预测值。The to-be-detected image is input into the parameter prediction model, and the parameter prediction value is generated. 根据权利要求1-6任一项所述的图像检测方法,其特征在于,所述图像处理算法包括以下至少一项:阶调映射算法、对比度增强算法、图像边缘增强算法和图像降噪算法。The image detection method according to any one of claims 1-6, wherein the image processing algorithm comprises at least one of the following: a tone mapping algorithm, a contrast enhancement algorithm, an image edge enhancement algorithm and an image noise reduction algorithm. 根据权利要求1-7任一项所述的图像检测方法,其特征在于,所述图像检测模型用于执行以下至少一项检测任务:检测框的标注、目标对象的识别、置信度的预测、目标对象运动轨迹的预测。The image detection method according to any one of claims 1-7, wherein the image detection model is used to perform at least one of the following detection tasks: labeling of detection frames, recognition of target objects, prediction of confidence, Prediction of the motion trajectory of the target object. 一种图像检测装置,其特征在于,包括:An image detection device, characterized in that it includes: 获取模块,被配置成获取待检测图像;an acquisition module, configured to acquire the image to be detected; 生成模块,被配置成基于所述待检测图像的图像特征,利用预先训练的参数预测模型,对用于处理所述待检测图像的图像处理算法的参数进行预测,生成参数预测值;A generation module, configured to predict the parameters of the image processing algorithm for processing the image to be detected by using a pre-trained parameter prediction model based on the image features of the image to be detected, and generate a parameter prediction value; 调整模块,被配置成基于所述参数预测值,调整所述图像处理算法的参数;an adjustment module configured to adjust a parameter of the image processing algorithm based on the parameter predicted value; 处理模块,被配置成利用参数调整后的图像处理算法对所述待检测图像进行图像处理,生成处理后的图像;a processing module, configured to perform image processing on the to-be-detected image by using an image processing algorithm after parameter adjustment, to generate a processed image; 检测模块,被配置成将所述处理后的图像输入至预先训练的图像检测模型,生成检测结果。A detection module configured to input the processed image to a pre-trained image detection model to generate a detection result. 根据权利要求9所述的图像检测装置,其特征在于,所述参数预测模型是通过比较样本图像的标注信息和图像检测模型对所述样本图像的检测结果、并且基于比较结果训练得到的。The image detection device according to claim 9, wherein the parameter prediction model is obtained by comparing the annotation information of the sample image with the detection result of the sample image by the image detection model, and is trained based on the comparison result. 根据权利要求10所述的图像检测装置,其特征在于,所述图像检测装置还包括参数预测模型训练模块,所述参数预测模型训练模块包括:The image detection device according to claim 10, wherein the image detection device further comprises a parameter prediction model training module, the parameter prediction model training module comprising: 比较子模块,被配置成将所述样本图像的检测结果和所述样本图像的标注信息进行比较以得到所述比较结果;a comparison submodule, configured to compare the detection result of the sample image with the annotation information of the sample image to obtain the comparison result; 调整子模块,被配置成基于所述比较结果迭代调整所述参数预测模型的参数;an adjustment submodule configured to iteratively adjust parameters of the parameter prediction model based on the comparison results; 保存子模块,被配置成在预设条件满足时,保存所述参数预测模型的参数。The saving sub-module is configured to save the parameters of the parameter prediction model when the preset condition is satisfied. 根据权利要求11所述的图像检测装置,其特征在于,所述比较结果为误差,所述调整子模块进一步被配置成:The image detection device according to claim 11, wherein the comparison result is an error, and the adjustment sub-module is further configured to: 基于所述样本图像的检测结果和所述样本图像的标注信息之间的所述误差,构建目标损失函数,其中所述目标损失函数包括所述参数预测模型中待调整的参数;constructing a target loss function based on the error between the detection result of the sample image and the annotation information of the sample image, wherein the target loss function includes parameters to be adjusted in the parameter prediction model; 基于所述目标损失函数,利用反向传播算法和梯度下降算法,迭代调整所述图像处理算法的参数。Based on the objective loss function, the parameters of the image processing algorithm are iteratively adjusted using a back-propagation algorithm and a gradient descent algorithm. 根据权利要求9-12任一项所述的图像检测装置,其特征在于,所述生成模块被配置成:The image detection device according to any one of claims 9-12, wherein the generation module is configured to: 对所述待检测图像进行特征提取,生成特征张量;performing feature extraction on the to-be-detected image to generate a feature tensor; 将所述特征张量输入至所述参数预测模型,生成所述参数预测值。The feature tensor is input to the parameter prediction model, and the parameter prediction value is generated. 根据权利要求9-12任一项所述的图像检测装置,其特征在于,所述生成模块被配置成:The image detection device according to any one of claims 9-12, wherein the generation module is configured to: 将所述待检测图像输入至所述参数预测模型,生成所述参数预测值。The to-be-detected image is input into the parameter prediction model, and the parameter prediction value is generated. 根据权利要求9-14任一项所述的图像检测装置,其特征在于,所述图像处理算法包括以下至少一项:阶调映射算法、对比度增强算法、图像边缘增强算法和图像降噪算法。The image detection device according to any one of claims 9-14, wherein the image processing algorithm comprises at least one of the following: a tone mapping algorithm, a contrast enhancement algorithm, an image edge enhancement algorithm and an image noise reduction algorithm. 根据权利要求9-14任一项所述的图像检测装置,其特征在于,所述图像检测模型用于执行以下至少一项检测任务:检测框的标注、目标对象的识别、置信度的预测、目标对象运动轨迹的预测。The image detection device according to any one of claims 9-14, wherein the image detection model is used to perform at least one of the following detection tasks: labeling of detection frames, recognition of target objects, prediction of confidence, Prediction of the motion trajectory of the target object. 一种电子设备,其特征在于,包括:An electronic device, comprising: 摄像装置,用于获取待检测图像;a camera device for acquiring an image to be detected; 参数预测装置,用于基于所述待检测图像的图像特征,利用预先训练的参数预测模型,对用于处理所述待检测图像的图像处理算法的参数进行预测,生成参数预测值;A parameter prediction device, configured to predict parameters of an image processing algorithm used to process the image to be detected by using a pre-trained parameter prediction model based on the image features of the image to be detected, and generate a parameter prediction value; 图像信号处理器,用于基于所述参数预测值,调整所述图像处理算法的参数,利用参数调整后的图像处理算法对所述待检测图像进行图像处理,生成处理后的图像;an image signal processor, configured to adjust the parameters of the image processing algorithm based on the parameter prediction value, and perform image processing on the to-be-detected image by using the image processing algorithm after parameter adjustment to generate a processed image; 人工智能处理器,用于将所述处理后的图像输入至预先训练的图像检测模型,生成检测结果。The artificial intelligence processor is used for inputting the processed image to a pre-trained image detection model to generate a detection result. 一种图像检测装置,其特征在于,包括:An image detection device, characterized in that it includes: 一个或多个处理器和存储器;one or more processors and memories; 所述存储器耦合至所述处理器,所述存储器用于存储一个或多个程序;the memory is coupled to the processor, the memory for storing one or more programs; 所述一个或多个处理器用于运行所述一个或多个程序,以实现如权利要求1-8任一项所述的方法。The one or more processors are configured to run the one or more programs to implement the method of any one of claims 1-8. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有计算机程序,该计算机程序被至少一个处理器执行时用于实现如权利要求1-8任一项所述的方法。A computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by at least one processor, is used to implement the method according to any one of claims 1-8. method. 一种计算机程序产品,其特征在于,当所述计算机程序产品被至少一个处理器执行时用于实现如权利要求1-8任一项所述的方法。A computer program product, characterized in that, when the computer program product is executed by at least one processor, it is used to implement the method according to any one of claims 1-8.
PCT/CN2021/081086 2021-03-16 2021-03-16 Image detection method and apparatus, and electronic device Ceased WO2022193132A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202180094447.8A CN116917954A (en) 2021-03-16 2021-03-16 Image detection method, device and electronic equipment
PCT/CN2021/081086 WO2022193132A1 (en) 2021-03-16 2021-03-16 Image detection method and apparatus, and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2021/081086 WO2022193132A1 (en) 2021-03-16 2021-03-16 Image detection method and apparatus, and electronic device

Publications (1)

Publication Number Publication Date
WO2022193132A1 true WO2022193132A1 (en) 2022-09-22

Family

ID=83321791

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/081086 Ceased WO2022193132A1 (en) 2021-03-16 2021-03-16 Image detection method and apparatus, and electronic device

Country Status (2)

Country Link
CN (1) CN116917954A (en)
WO (1) WO2022193132A1 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20230186439A1 (en) * 2021-06-28 2023-06-15 Zhejiang Gongshang University Lane detection method integratedly using image enhancement and deep convolutional neural network
CN116342421A (en) * 2023-03-23 2023-06-27 平安科技(深圳)有限公司 Image processing method, device, computer equipment and medium
CN116953486A (en) * 2023-09-18 2023-10-27 深圳华海达科技有限公司 Chip testing jig and chip detection method
CN119579488A (en) * 2024-10-09 2025-03-07 沈阳化工大学 A thermal wave detection method for hole defects inside plates in complex environments
CN119887737A (en) * 2025-02-06 2025-04-25 无锡日联科技股份有限公司 Image quality feedback-based key parameter self-adaptive optimization method for X-ray detection equipment and related equipment

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118505519B (en) * 2024-07-22 2024-10-01 爱芯元智半导体股份有限公司 Acceleration method and system of corrosion operator and electronic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103413286A (en) * 2013-08-02 2013-11-27 北京工业大学 United reestablishing method of high dynamic range and high-definition pictures based on learning
CN108968811A (en) * 2018-06-20 2018-12-11 四川斐讯信息技术有限公司 A kind of object identification method and system of sweeping robot
CN109410129A (en) * 2018-09-28 2019-03-01 大连理工大学 A kind of method of low light image scene understanding
WO2020102988A1 (en) * 2018-11-20 2020-05-28 西安电子科技大学 Feature fusion and dense connection based infrared plane target detection method
CN111460964A (en) * 2020-03-27 2020-07-28 浙江广播电视集团 Moving target detection method under low-illumination condition of radio and television transmission machine room

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103413286A (en) * 2013-08-02 2013-11-27 北京工业大学 United reestablishing method of high dynamic range and high-definition pictures based on learning
CN108968811A (en) * 2018-06-20 2018-12-11 四川斐讯信息技术有限公司 A kind of object identification method and system of sweeping robot
CN109410129A (en) * 2018-09-28 2019-03-01 大连理工大学 A kind of method of low light image scene understanding
WO2020102988A1 (en) * 2018-11-20 2020-05-28 西安电子科技大学 Feature fusion and dense connection based infrared plane target detection method
CN111460964A (en) * 2020-03-27 2020-07-28 浙江广播电视集团 Moving target detection method under low-illumination condition of radio and television transmission machine room

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20230186439A1 (en) * 2021-06-28 2023-06-15 Zhejiang Gongshang University Lane detection method integratedly using image enhancement and deep convolutional neural network
US12380544B2 (en) * 2021-06-28 2025-08-05 Zhejiang Gongshang University Lane detection method integratedly using image enhancement and deep convolutional neural network
CN116342421A (en) * 2023-03-23 2023-06-27 平安科技(深圳)有限公司 Image processing method, device, computer equipment and medium
CN116953486A (en) * 2023-09-18 2023-10-27 深圳华海达科技有限公司 Chip testing jig and chip detection method
CN116953486B (en) * 2023-09-18 2023-12-05 深圳华海达科技有限公司 Chip testing jig and chip detection method
CN119579488A (en) * 2024-10-09 2025-03-07 沈阳化工大学 A thermal wave detection method for hole defects inside plates in complex environments
CN119887737A (en) * 2025-02-06 2025-04-25 无锡日联科技股份有限公司 Image quality feedback-based key parameter self-adaptive optimization method for X-ray detection equipment and related equipment

Also Published As

Publication number Publication date
CN116917954A (en) 2023-10-20

Similar Documents

Publication Publication Date Title
US11882357B2 (en) Image display method and device
US20220188999A1 (en) Image enhancement method and apparatus
US20230214976A1 (en) Image fusion method and apparatus and training method and apparatus for image fusion model
CN112581379B (en) Image enhancement method and device
CN111402146B (en) Image processing method and image processing device
US11037278B2 (en) Systems and methods for transforming raw sensor data captured in low-light conditions to well-exposed images using neural network architectures
US20220270215A1 (en) Method for applying bokeh effect to video image and recording medium
WO2022193132A1 (en) Image detection method and apparatus, and electronic device
CN107274445B (en) An image depth estimation method and system
CN113284054A (en) Image enhancement method and image enhancement device
US20220189029A1 (en) Semantic refinement of image regions
CN114730456A (en) Training method of neural network model, image processing method and device thereof
CN115063301B (en) Video denoising method and device
CN116888621B (en) Image detection methods, apparatus and electronic equipment
US12015835B2 (en) Multi-sensor imaging color correction
CN115239581A (en) An image processing method and related device
WO2022041506A1 (en) Image depth estimation method, terminal device, and computer readable storage medium
CN115984133A (en) Image enhancement method, vehicle capture method, equipment and medium
WO2022141265A1 (en) Image processing method and device
US10878592B2 (en) Video data processing
JP7760702B2 (en) Image processing method and device, and vehicle
CN119991804B (en) Displacement detection method, device, equipment and program product

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 202180094447.8

Country of ref document: CN

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21930728

Country of ref document: EP

Kind code of ref document: A1