WO2019119919A1 - Image recognition method and electronic device - Google Patents

Image recognition method and electronic device Download PDF

Info

Publication number
WO2019119919A1
WO2019119919A1 PCT/CN2018/108229 CN2018108229W WO2019119919A1 WO 2019119919 A1 WO2019119919 A1 WO 2019119919A1 CN 2018108229 W CN2018108229 W CN 2018108229W WO 2019119919 A1 WO2019119919 A1 WO 2019119919A1
Authority
WO
WIPO (PCT)
Prior art keywords
attribute
image
category
objects
cpu
Prior art date
Application number
PCT/CN2018/108229
Other languages
French (fr)
Chinese (zh)
Inventor
张子敬
颜奉丽
王星晨
朱涛
Original Assignee
杭州海康威视数字技术股份有限公司
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 杭州海康威视数字技术股份有限公司 filed Critical 杭州海康威视数字技术股份有限公司
Publication of WO2019119919A1 publication Critical patent/WO2019119919A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/06Physical realisation, i.e. hardware implementation of neural networks, neurons or parts of neurons
    • G06N3/063Physical realisation, i.e. hardware implementation of neural networks, neurons or parts of neurons using electronic means
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/20Processor architectures; Processor configuration, e.g. pipelining
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/10Image acquisition

Definitions

  • the present application relates to the field of image processing technologies, and in particular, to an image recognition method and an electronic device.
  • the category of an object included in a road monitoring image is a car, and the vehicle type, color, and the like of the vehicle are identified.
  • An object of the embodiments of the present application is to provide an image recognition method and an electronic device to accurately identify categories and attributes of objects included in an image, and reduce the calculation pressure of the CPU.
  • an embodiment of the present application provides an image recognition method, which is applied to a coprocessor in an electronic device, where the electronic device further includes a central processing unit CPU, and the method may include:
  • the image blocks corresponding to each location area are input to a pre-built attribute recognition neural network to obtain attributes of each object; the obtained category and attributes of each object are sent to the CPU, so that the CPU will receive the type of the object and Attribute as the result of image recognition of the image to be recognized.
  • the step of inputting the image block corresponding to each location area to the pre-built attribute recognition neural network to obtain the attribute of each object may include:
  • the obtained image block corresponding to each location area is input to: the attribute corresponding to the object identifies the neural network, and the step of obtaining the attribute of each object may include:
  • the objects included in the image to be identified are divided into two groups to obtain a first group of objects and a second group of objects; and an object corresponding to a location area of each object in the first group of objects is input to: an attribute recognition neural network corresponding to the object Obtaining an attribute of each object in the first group of objects; sending a location area of each object in the second group of objects to the CPU, so that the CPU inputs the image block corresponding to the location area of each object in the second group of objects To: the attribute corresponding to the object identifies the neural network, and obtains the attribute of each object in the second group of objects;
  • the step of sending the obtained category and attribute of each object to the CPU may include:
  • the step of dividing the objects included in the image to be identified into two groups, and obtaining the first group of objects and the second group of objects may include:
  • the object is an object that is not the first preset category in the image to be identified as the second group of objects.
  • the obtained image block corresponding to each location area is input to: the attribute corresponding to the object identifies the neural network, and the step of obtaining the attribute of each object may include:
  • the step of sending the obtained category and attribute of each object to the CPU may include:
  • the step of sending the obtained category and the attribute of each object to the CPU, so that the CPU uses the category and the attribute of the received object as the image recognition result of the image to be identified may include:
  • the obtained location area, category, and attribute of each object are sent to the CPU, so that the CPU determines the location area, category, and attribute of the received object as the image recognition result of the image to be recognized.
  • the content recognition neural network is further configured to identify a confidence level corresponding to a category of the object included in the image; and the content recognition result further includes: a confidence level corresponding to the category of the object included in the image;
  • the method may further include:
  • the step of inputting the image block corresponding to each location area to the pre-built attribute recognition neural network to obtain the attribute of each object may include:
  • the step of sending the obtained category and attribute of each object to the CPU may include:
  • the coprocessor includes at least one of a graphics processor GPU, a digital signal processor DSP, and a field programmable gate array processor FPGA.
  • the step of inputting the image block corresponding to each location area to the pre-built attribute recognition neural network to obtain the attribute of each object may include:
  • Each image block obtained after the scaling process is input to a pre-built attribute recognition neural network to obtain attributes of each object.
  • the image to be identified is obtained by the CPU performing image format conversion and scaling processing on the original image.
  • an embodiment of the present application further provides an electronic device, where the electronic device may include a coprocessor and a central processing unit CPU;
  • the CPU is configured to send the image to be recognized to the coprocessor
  • the coprocessor is configured to receive an image to be recognized sent by the CPU;
  • the coprocessor is further configured to: input the image to be recognized into the pre-constructed content recognition neural network, and obtain a content recognition result, where the content recognition result includes: a category and a location area of the object included in the image to be identified;
  • the coprocessor is further configured to: input the obtained image block corresponding to each location area to a pre-built attribute recognition neural network, and obtain an attribute of each object;
  • the coprocessor is further configured to: send the obtained category and attribute of each object to the CPU;
  • the CPU is further configured to: receive a category and an attribute of each object sent by the coprocessor, and use the category and attribute of the received object as an image recognition result of the image to be identified.
  • the coprocessor may be specifically configured to:
  • the coprocessor may be specifically configured to:
  • the objects included in the image to be identified are divided into two groups to obtain a first group of objects and a second group of objects; the image blocks corresponding to the position regions of each object in the first group of objects are input to: the attribute recognition nerve corresponding to the object
  • the network obtains the attributes of each object in the first group of objects; sends the location area of each object in the second group of objects to the CPU; the categories and attributes of each object in the first group of objects, each of the second group of objects The category of the object is sent to the CPU;
  • the CPU is specifically configured to: input an image block corresponding to a location area of each object in the second group of objects to: an attribute corresponding to the object identifies the neural network, and obtain an attribute of each object in the second group of objects; and the first group of objects The category and attribute of each object in the object, and the category and attribute of each object in the second group of objects, as the image recognition result of the image to be recognized.
  • the coprocessor may be specifically configured to:
  • the object is an object that is not the first preset category in the image to be identified as the second group of objects.
  • the coprocessor may be specifically configured to:
  • the CPU is specifically configured to: input an image block corresponding to the location area of each first object to: the first type of attribute recognition neural network in the attribute recognition neural network corresponding to the first object, and obtain the first of each first object
  • the class attribute; the first type attribute, the second type attribute and the category of each first object, and the second type attribute and category of each second object are used as image recognition results of the image to be recognized.
  • the coprocessor may be specifically configured to: send the obtained location area, category, and attribute of each object to the CPU;
  • the CPU may be specifically configured to: use the location area, the category, and the attribute of the received object as the image recognition result of the image to be identified.
  • the content recognition neural network is further configured to identify a confidence level corresponding to a category of the object included in the image; and the content recognition result further includes: a confidence level corresponding to the category of the object included in the image;
  • the coprocessor can be further configured to: input the image block corresponding to each location area obtained to the pre-built attribute recognition neural network, and determine whether the obtained confidence is greater than a preset before obtaining the attribute of each object. a threshold value; if yes, an object corresponding to a confidence level greater than a preset threshold is used as a filtered object; and the image block corresponding to the selected location area of each object is sent to a pre-built attribute recognition neural network for attribute recognition, The attributes of each object after filtering; the categories and attributes of each object after filtering are sent to the CPU.
  • the coprocessor may include at least one of a graphics processor GPU, a digital signal processor DSP, and a field programmable gate array processor FPGA.
  • the coprocessor may be specifically configured to:
  • the obtained image blocks corresponding to each location area are subjected to scaling processing; each image block obtained after the scaling processing is input to a pre-built attribute recognition neural network to obtain attributes of each object.
  • the CPU is further configured to:
  • Image format conversion and scaling processing is performed on the original image to obtain an image to be recognized.
  • the embodiment of the present application further provides a readable storage medium, which is a storage medium in an electronic device including a coprocessor and a central processing unit CPU, where the readable storage medium stores a computer
  • the program when the computer program is executed by the coprocessor, implements the following steps:
  • the image blocks corresponding to each location area are input to a pre-built attribute recognition neural network to obtain attributes of each object; the obtained category and attributes of each object are sent to the CPU, so that the CPU will receive the type of the object and Attribute as the result of image recognition of the image to be recognized.
  • the step of inputting the image block corresponding to each location area to the pre-built attribute recognition neural network to obtain the attribute of each object may include:
  • the obtained image block corresponding to each location area is input to: the attribute corresponding to the object identifies the neural network, and the step of obtaining the attribute of each object may include:
  • the objects included in the image to be identified are divided into two groups to obtain a first group of objects and a second group of objects; and an object corresponding to a location area of each object in the first group of objects is input to: an attribute recognition neural network corresponding to the object Obtaining an attribute of each object in the first group of objects; sending a location area of each object in the second group of objects to the CPU, so that the CPU inputs the image block corresponding to the location area of each object in the second group of objects To: the attribute corresponding to the object identifies the neural network, and obtains the attribute of each object in the second group of objects;
  • the step of sending the obtained category and attribute of each object to the CPU may include:
  • the step of dividing the objects included in the image to be identified into two groups, and obtaining the first group of objects and the second group of objects may include:
  • the object is an object that is not the first preset category in the image to be identified as the second group of objects.
  • the obtained image block corresponding to each location area is input to: the attribute corresponding to the object identifies the neural network, and the step of obtaining the attribute of each object may include:
  • the step of sending the obtained category and attribute of each object to the CPU may include:
  • the step of sending the obtained category and the attribute of each object to the CPU, so that the CPU uses the category and the attribute of the received object as the image recognition result of the image to be identified may include:
  • the obtained location area, category, and attribute of each object are sent to the CPU, so that the CPU determines the location area, category, and attribute of the received object as the image recognition result of the image to be recognized.
  • the content recognition neural network is further configured to identify a confidence level corresponding to a category of the object included in the image; and the content recognition result further includes: a confidence level corresponding to the category of the object included in the image;
  • the method may further include:
  • the step of inputting the image block corresponding to each location area to the pre-built attribute recognition neural network to obtain the attribute of each object may include:
  • the step of sending the obtained category and attribute of each object to the CPU may include:
  • the coprocessor includes at least one of a graphics processor GPU, a digital signal processor DSP, and a field programmable gate array processor FPGA.
  • the step of inputting the image block corresponding to each location area to the pre-built attribute recognition neural network to obtain the attribute of each object may include:
  • the obtained image blocks corresponding to each location area are subjected to scaling processing; each image block obtained after the scaling processing is input to a pre-built attribute recognition neural network to obtain attributes of each object.
  • the image to be identified is obtained by the CPU performing image format conversion and scaling processing on the original image.
  • an embodiment of the present application further provides an application that, when running on an electronic device including a coprocessor and a central processing unit CPU, causes the coprocessor to execute:
  • the image blocks corresponding to each location area are input to a pre-built attribute recognition neural network to obtain attributes of each object; the obtained category and attributes of each object are sent to the CPU, so that the CPU will receive the type of the object and Attribute as the result of image recognition of the image to be recognized.
  • the step of inputting the image block corresponding to each location area to the pre-built attribute recognition neural network to obtain the attribute of each object may include:
  • the obtained image block corresponding to each location area is input to: the attribute corresponding to the object identifies the neural network, and the step of obtaining the attribute of each object may include:
  • the objects included in the image to be identified are divided into two groups to obtain a first group of objects and a second group of objects; and an object corresponding to a location area of each object in the first group of objects is input to: an attribute recognition neural network corresponding to the object Obtaining an attribute of each object in the first group of objects; sending a location area of each object in the second group of objects to the CPU, so that the CPU inputs the image block corresponding to the location area of each object in the second group of objects To: the attribute corresponding to the object identifies the neural network, and obtains the attribute of each object in the second group of objects;
  • the step of sending the obtained category and attribute of each object to the CPU may include:
  • the step of dividing the objects included in the image to be identified into two groups, and obtaining the first group of objects and the second group of objects may include:
  • the object is an object that is not the first preset category in the image to be identified as the second group of objects.
  • the obtained image block corresponding to each location area is input to: the attribute corresponding to the object identifies the neural network, and the step of obtaining the attribute of each object may include:
  • the step of sending the obtained category and attribute of each object to the CPU may include:
  • the step of sending the obtained category and the attribute of each object to the CPU, so that the CPU uses the category and the attribute of the received object as the image recognition result of the image to be identified may include:
  • the obtained location area, category, and attribute of each object are sent to the CPU, so that the CPU determines the location area, category, and attribute of the received object as the image recognition result of the image to be recognized.
  • the content recognition neural network is further configured to identify a confidence level corresponding to a category of the object included in the image; and the content recognition result further includes: a confidence level corresponding to the category of the object included in the image;
  • the method may further include:
  • the step of inputting the image block corresponding to each location area to the pre-built attribute recognition neural network to obtain the attribute of each object may include:
  • the step of sending the obtained category and attribute of each object to the CPU may include:
  • the coprocessor includes at least one of a graphics processor GPU, a digital signal processor DSP, and a field programmable gate array processor FPGA.
  • the step of inputting the image block corresponding to each location area to the pre-built attribute recognition neural network to obtain the attribute of each object may include:
  • the obtained image blocks corresponding to each location area are subjected to scaling processing; each image block obtained after the scaling processing is input to a pre-built attribute recognition neural network to obtain attributes of each object.
  • the image to be identified is obtained by the CPU performing image format conversion and scaling processing on the original image.
  • the coprocessor in the electronic device may receive the image to be recognized sent by the CPU in the electronic device, and input the image to be recognized into the pre-built content recognition neural network, thereby obtaining the to-be-identified image. Identify the category and location area of the object contained in the image. Then, the coprocessor inputs the obtained image blocks corresponding to each location area into the pre-built attribute recognition neural network, so that the attributes of each object can be obtained. Further, the coprocessor can send the obtained category and attribute of each object to the CPU, so that the CPU can use the type and attribute of the received object as the image recognition result of the image to be recognized.
  • the coprocessor can identify the type and attribute of the object included in the image to be identified by means of the content recognition neural network and the attribute recognition neural network, and share the calculation pressure of the CPU to recognize the image. , which reduces the computational pressure on the CPU.
  • FIG. 1 is a flowchart of an image recognition method according to an embodiment of the present application
  • FIG. 2 is a schematic diagram of an image recognition method according to an embodiment of the present application.
  • FIG. 3 is a schematic diagram of another image recognition method according to an embodiment of the present application.
  • FIG. 4 is a schematic diagram of still another image recognition method according to an embodiment of the present application.
  • FIG. 5 is a schematic diagram of still another image recognition method according to an embodiment of the present application.
  • FIG. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
  • the embodiment of the present application provides an image recognition method and an electronic device.
  • the image recognition method provided by the embodiment of the present application is applied to a coprocessor in an electronic device, and the coprocessor may be a GPU (Graphics Processing Unit) or a DSP (Digital Signal Processing). It can also be an FPGA (Field-Programmable Gate Array). Of course, it can also be any combination of GPU, DSP and FPGA, which is reasonable.
  • the electronic device further includes a CPU (Central Processing Unit).
  • the electronic device may be a front-end device, such as a video camera, or a back-end device, such as a server.
  • the coprocessor can select a low-power DSP and/or an FPGA; when the electronic device is a back-end device, the coprocessor can select a higher power consumption but more
  • the GPU that is easy to develop is certainly not limited to this.
  • the coprocessor can support complex floating point calculation.
  • an image recognition method provided by an embodiment of the present application includes the following steps:
  • S102 input the image to be identified to the pre-constructed content recognition neural network, and obtain a content recognition result, where the content recognition result includes: a category and a location area of the object included in the image to be identified;
  • S103 input the obtained image block corresponding to each location area to a pre-built attribute recognition neural network, and obtain an attribute of each object;
  • S104 Send the obtained category and attribute of each object to the CPU, so that the CPU uses the category and attribute of the received object as the image recognition result of the image to be recognized.
  • the coprocessor in the electronic device can receive the image to be recognized sent by the CPU in the electronic device, and can input the image to be recognized into the pre-constructed content recognition neural network, thereby obtaining the image to be recognized.
  • the category and location area of the object contained in it Then, the coprocessor inputs the obtained image blocks corresponding to each location area into the pre-built attribute recognition neural network, so that the attributes of each object can be obtained. Further, the coprocessor can send the obtained category and attribute of each object to the CPU, so that the CPU can use the type and attribute of the received object as the image recognition result of the image to be recognized.
  • the coprocessor can identify the type and attribute of the object included in the image to be identified by using the content recognition neural network and the attribute recognition neural network, and share the calculation pressure of the CPU to recognize the image, thereby Reduced the computational pressure of the CPU.
  • the image to be identified may be a road monitoring image that includes a person and a car. Then, the coprocessor can recognize that the category of one object included in the road monitoring image is a person, and the category of another object included is a vehicle. And it can be identified that the gender attribute of the person is female, the color attribute of the clothing is blue, and the like, and the color attribute of the vehicle is black, the vehicle attribute is a car, and the like.
  • the image to be identified may be obtained by the CPU preprocessing the original image.
  • the image to be recognized may also be the original image itself to be recognized by the CPU, which is reasonable.
  • the operation corresponding to the preprocessing may include: image format conversion, image scaling, and the like.
  • the original image can be converted into an image format recognizable by the content recognition neural network by image format conversion, and the original image can be converted into a resolution recognizable by the content recognition neural network by image scaling, so that the obtained image to be recognized is satisfied.
  • Content recognition neural network image format and resolution requirements are examples of images to be recognized.
  • the operation corresponding to the pre-processing may further include: performing region extraction on the region of interest in the original image to obtain the region of interest; performing denoising processing on the original image to improve image quality, etc., thereby improving subsequent pairs.
  • the recognition effect of the image for recognition may further include: performing region extraction on the region of interest in the original image to obtain the region of interest; performing denoising processing on the original image to improve image quality, etc., thereby improving subsequent pairs.
  • the original image can be preprocessed by the CPU to obtain an image to be identified.
  • the co-processor recognizes the image to be recognized, and obtains the category and attribute of the object included in the image to be recognized.
  • the CPU can send the pre-processed image to be recognized to the coprocessor for processing after pre-processing the image.
  • the idle CPU can start preprocessing the next frame image, so that the CPU and the coprocessor can realize parallel computing, which avoids the image that needs to be queued for the CPU to perform image recognition: the image recognition result is slower. The problem.
  • the pre-built content recognition neural network may be based on Faster Region-based Convolutional Network Method (Faster Region-based Convolutional Network Method), YOLO (You Only Look Once) algorithm or SSD (Single) Shot MultiBox Detector) algorithm and other artificial neural network algorithm training.
  • Faster Region-based Convolutional Network Method YOLO (You Only Look Once) algorithm
  • SSD Single
  • Shot MultiBox Detector other artificial neural network algorithm training.
  • a large number of image samples are used in the training process, and the content recognition neural network is trained by the category and location area of the objects included in each image sample. Therefore, the content recognition neural network obtained by the training can identify the category and location area of the object included in the image.
  • the inventors have found through a large number of experiments that the content recognition neural network based on neural network training can be compared with the traditional SVM (Support Vector Machine) algorithm for identifying the categories of objects contained in the image. Get more accurate category and location area recognition results.
  • SVM Small Region-based Convolutional
  • the attribute of an object included in an image is determined by using an attribute feature that is artificially set.
  • the color value range corresponding to the red color is artificially set, that is, the color feature of the red color is artificially set.
  • the color attribute of the object is determined to be red.
  • the judgment result of the color attribute is not accurate. Therefore, it can be known that the accuracy of the method for determining the attribute is greatly influenced by the human factor, and the attribute recognition effect is not stable.
  • the attribute recognition neural network can be trained based on a convolutional neural network algorithm such as LeNet, AlexNet, or GoogleNet. And, since the attribute recognition neural network is trained through a large number of object samples, and the attributes of each object sample. Therefore, the attribute-recognition neural network obtained by the training can identify the attributes of the objects contained in the image without depending on the experience setting characteristics of the person. And with the increase of the training samples, the recognition accuracy of the attribute recognition neural network is higher, and the recognition effect is more stable.
  • a convolutional neural network algorithm such as LeNet, AlexNet, or GoogleNet.
  • the object may be scaled, and then the object obtained by the scaling process is input to the attribute recognition neural network for recognition.
  • the object when the object is reduced (ie, subjected to downsampling processing), the amount of data processing of the object by the attribute recognition neural network can be reduced, thereby improving the processing speed.
  • it is also possible to enlarge the object so that the size of the enlarged object matches the size of the object sample used to train the attribute recognition neural network, thereby obtaining a better attribute recognition result.
  • the image to be identified can be obtained. Thereafter, the CPU can send the image to be identified to the coprocessor. After receiving the image to be identified, the coprocessor may input the image to be recognized into a pre-built content recognition neural network.
  • the content recognition neural network can calculate the confidence level corresponding to the category of each object obtained by the image in addition to the category and location area of the object included in the image
  • the content recognition neural network can output: the to-be-identified The object 1, the object 2, the object 3, ..., the object N-1 and the category of the object N included in the image, the position area of the N objects in the image to be recognized, and each of the N objects
  • the confidence level corresponding to the category refers to the credibility of the identified category.
  • the coprocessor can filter each object according to the confidence level.
  • the specific filtering method can be: determining whether the confidence level corresponding to the object category is greater than a preset threshold. If it is greater than the preset threshold, it indicates that the identified category of the object has high credibility. At this time, the object may continue to be input to the pre-built attribute recognition neural network to identify the attribute of the object; if less than the preset The threshold indicates that the credibility of the identified category of the object is not high, and the object is not input to the attribute identifying neural network for subsequent attribute recognition. In this manner, the coprocessor may not continue to identify the attributes of the objects corresponding to the identified and less reliable categories, that is, some untrusted objects may be deleted, thereby improving the accuracy of the image recognition result. Sexuality, and can reduce the recognition pressure of the coprocessor to identify the attributes of the object.
  • the attribute recognition neural network shown in FIG. 2 may be the same attribute recognition neural network, and the attribute recognition neural network is used to identify the same attribute feature (eg, color feature). There may also be a plurality of different attribute recognition neural networks, and each attribute recognition neural network is used to identify attributes of an object of a category. For example, when the category of the object 1 in FIG. 2 is a vehicle, the attribute recognition neural network corresponding to the object 1 may be an attribute recognition neural network for identifying the color characteristics of the vehicle. When the category of the object 2 is a person, the attribute recognition neural network corresponding to the object 2 may be an attribute recognition neural network for identifying the gender feature of the person.
  • the attribute identification network corresponding to the object 1 and the object 2 may also be multiple.
  • the attribute recognition neural network corresponding to the object 1 may be an attribute recognition neural network that recognizes the color characteristics of the vehicle, and an attribute recognition neural network that identifies the vehicle type characteristics of the vehicle, and is of course not limited thereto.
  • each object can be set to have multiple attribute recognition networks, so that multiple attributes of the object can be identified, so that richer attribute information can be obtained.
  • the method for determining the attribute corresponding to the object 1 to identify the neural network is: after determining that the category of the object 1 is a vehicle, the neural network is identified based on the attribute of the color characteristic of the category car and the identification vehicle recorded in the preset relationship, and The attribute identifying the vehicle type feature of the vehicle identifies the correspondence relationship of the neural network, and determines the attribute recognition neural network corresponding to the object 1.
  • the attribute recognition neural network can be set by a person skilled in the art according to actual needs, and is not illustrated here.
  • the camera continuously transmits an image frame to be identified to the CPU in the electronic device.
  • the CPU can obtain an image to be recognized corresponding to the image of the N-1th frame.
  • the CPU transmits the image to be identified to the coprocessor, and the coprocessor identifies the image to be identified corresponding to the image of the N-1th frame, and identifies the location area and the category of the object included in the image to be recognized. And an attribute, and returning the identified location area, category, and attribute of the object to the CPU, so that the CPU uses the location area, category, and attribute of the received object as the image recognition result of the image to be recognized.
  • the CPU may continue to preprocess the received image of the Nth frame, and send the image to be identified corresponding to the obtained image of the Nth frame to the coprocessor, so that The coprocessor identifies the image to be identified corresponding to the image of the Nth frame. According to this method, the CPU and the coprocessor can perform asynchronous cooperative processing on the image, thereby improving the recognition speed of the image by the electronic device.
  • the image recognition method as shown in FIG. 4 can be used to improve the speed of image recognition.
  • the coprocessor receives the image to be recognized corresponding to the image of the N-1th frame transmitted by the CPU.
  • the coprocessor can input the image to be recognized corresponding to the image of the N-1th frame into the pre-constructed content recognition neural network, and identify the category and the location area of the object included in the image to be recognized.
  • the coprocessor recognizes the category and location area of the object included in the image to be identified, it also needs to identify the attributes of more objects in the identified object.
  • the objects included in the image to be identified may be divided into two groups, and the first group of objects and the second group of objects are obtained.
  • the coprocessor can identify the attributes of the first group of objects that are more computationally intensive. Specifically, the coprocessor can input the image blocks corresponding to the location area of each object in the first group of objects to: the object The corresponding attribute identifies the neural network, and the attributes of each object in the first set of objects are obtained.
  • the coprocessor can migrate the attribute recognition task of the second group of objects with less computational load to the CPU for calculation. Specifically, the coprocessor sends a location area of each object in the second group of objects to the CPU, so that the CPU inputs the image block corresponding to the location area of each object in the second group of objects to: attribute recognition corresponding to the object
  • the neural network gets the properties of each object in the second set of objects.
  • the computing power of the CPU and the coprocessor can be fully utilized, and the attribute recognition speed is high.
  • the attribute recognition pressure of the coprocessor is large, a part of the attribute recognition task can be sent to the CPU for processing, which avoids the situation that the coprocessor calculation pressure is large and the CPU waits.
  • the coprocessor can send the calculated category and attribute of each object in the first group of objects, and the category of each object in the second group of objects to the CPU, so that the CPU will each object in the first group of objects
  • the category and the attribute are summarized with the category and attribute of each object in the second group of objects to obtain an image recognition result of the image to be recognized.
  • the grouping manner of dividing the object included in the image to be identified into two groups may be: selecting a preset number of objects from the objects included in the image to be identified, as the first group of objects, and remaining objects as the second group.
  • a group object; or, the object included in the image to be recognized is a first preset category (for example, a category car), as the first group of objects, and the object included in the image to be recognized is not the first object It is reasonable to preset the object of the category as the second group of objects.
  • an image recognition method as shown in FIG. 5 can also be used to improve the speed of image recognition.
  • the identified object of the second preset category is also needed. Multiple attributes are identified.
  • the second preset category is a car
  • various attributes such as the color and the model of the object of the category.
  • the color attributes need to be identified. Then, you can use the car type attribute as the first type attribute and the color attribute as the second type attribute.
  • each object whose category is a car ie, an object whose category is the second preset category
  • the identified location area of each first object of the second preset category is sent to the CPU, so that the CPU inputs the image block corresponding to the location area of each first object to: the first
  • the attribute corresponding to the object identifies the first type of attribute recognition neural network in the neural network (ie, the attribute recognition neural network for identifying the vehicle type of the vehicle), and obtains the first type of attribute of each first object.
  • the coprocessor may further input the image block corresponding to the location area of each first object of the second preset category to: the attribute of the first object corresponding to the identifier in the neural network
  • the second type of attribute identifies the neural network (ie, the attribute recognition neural network used to identify the color of the car) to obtain a second type of attribute for each first object.
  • the coprocessor may also treat each object whose category is not the vehicle (ie, the object whose category is not the second preset category) as a second object, and the second object whose category is not the second preset category.
  • the image block corresponding to the location area of the object (for example, the object of the category) is input to: the second type of attribute recognition neural network in the attribute recognition neural network corresponding to the second object (ie, the attribute recognition nerve for identifying the color of the human hair) Network), get the second type of property for each second object.
  • the second type of attribute recognition neural network in the attribute recognition neural network corresponding to the second object ie, the attribute recognition nerve for identifying the color of the human hair
  • the coprocessor can send the identified second type of attributes and categories of each first object, and the second type of attributes and categories of each second object to the CPU, so that the CPU will each of the first objects
  • the first type attribute, the second type attribute and the category, and the second type attribute and category of each second object are summarized to obtain an image recognition result of the image to be recognized.
  • the first type of attribute recognition neural network and the second type of attribute recognition neural network can be trained according to actual needs.
  • the first type of attribute recognition neural network may include a first number of attribute recognition neural networks, each of the first number of attribute recognition neural network identifiers used to identify different attributes of the same category object .
  • the second type of attribute recognition neural network may include a second number of attribute recognition neural networks that identify each attribute in the neural network to identify different attributes of the same category object.
  • the attribute identified by the first type of attribute recognition neural network is not the same as the attribute identified by the second type of attribute recognition neural network.
  • the second preset category may also be set according to actual conditions, and is not limited herein.
  • the embodiment of the present application can identify the location area, category, and attributes of the object included in the image, and can reduce the calculation pressure of the CPU, and can improve the image recognition effect and the image recognition speed.
  • the embodiment of the present application further provides an electronic device, as shown in FIG. 6, the electronic device 600 includes a coprocessor 601 and a central processing unit CPU 602;
  • the CPU 602 is configured to send the image to be identified to the coprocessor 601.
  • the coprocessor 601 is configured to receive an image to be identified sent by the CPU 602.
  • the coprocessor 601 is further configured to input the image to be recognized to the pre-constructed content recognition neural network to obtain a content recognition result, where the content recognition result includes: a category and a location area of the object included in the image to be identified;
  • the coprocessor 601 is further configured to input the obtained image block corresponding to each location area to a pre-built attribute recognition neural network to obtain an attribute of each object;
  • the coprocessor 601 is further configured to send the obtained category and attribute of each object to the CPU 602;
  • the CPU 602 is further configured to receive the category and attribute of each object sent by the coprocessor 601, and use the category and attribute of the received object as the image recognition result of the image to be identified.
  • the coprocessor in the electronic device may receive the image to be recognized sent by the CPU in the electronic device, and input the image to be recognized into the pre-built content recognition neural network, thereby obtaining the to-be-identified image. Identify the category and location area of the object contained in the image. Then, the coprocessor inputs the obtained image blocks corresponding to each location area into the pre-built attribute recognition neural network, so that the attributes of each object can be obtained. Further, the coprocessor can send the obtained category and attribute of each object to the CPU, so that the CPU can use the type and attribute of the received object as the image recognition result of the image to be recognized. In this manner, the coprocessor can identify the type and attribute of the object included in the image to be identified by using the content recognition neural network and the attribute recognition neural network, and share the calculation pressure of the CPU to recognize the image, thereby Reduced the computational pressure of the CPU.
  • the coprocessor 601 can be specifically configured to:
  • the coprocessor 601 can be specifically used to:
  • the image block is input to: the attribute corresponding to the object identifies the neural network, and obtains the attribute of each object in the first group of objects; and sends the location area of each object in the second group of objects to the CPU;
  • the CPU 602 may be configured to: input an image block corresponding to a location area of each object in the second group of objects to: an attribute identifying the neural network corresponding to the object, and obtain an attribute of each object in the second group of objects; The category and attribute of each object in the first group of objects, and the category and attribute of each object in the second group of objects, as the image recognition result of the image to be recognized.
  • the coprocessor 601 can be specifically configured to:
  • the object is an object that is not the first preset category in the image to be identified as the second group of objects.
  • the coprocessor 601 can be specifically configured to:
  • the second type of attribute identifies the neural network, and obtains a second type of attribute of each of the first objects; and inputs an image block corresponding to the position area of each second object that is not the second preset category among the objects included in the image to be identified.
  • the second object of the second object identifies the second type of attribute in the neural network to identify the neural network, and obtains the second type of attribute of each second object; the second type of attribute and category of each first object, and each The second attribute and category of the second object are sent to the CPU;
  • the CPU 602 is specifically configured to: input an image block corresponding to the location area of each first object to: the first type of attribute recognition neural network in the attribute recognition neural network corresponding to the first object, and obtain each first The first type of attributes of the object; the first type attribute, the second type attribute and the category of each first object, and the second type attribute and category of each second object are used as image recognition results of the image to be recognized.
  • the coprocessor 601 can be specifically configured to:
  • the CPU 602 may be specifically configured to: use the location area, the category, and the attribute of the received object as the image recognition result of the image to be identified.
  • the content recognition neural network is further configured to identify a confidence level corresponding to a category of the object included in the image; and the content recognition result further includes: a confidence level corresponding to the category of the object included in the image;
  • the coprocessor 601 is further configured to: input the image block corresponding to each of the obtained location areas to the pre-built attribute recognition neural network, and determine whether the obtained confidence level is greater than a preset threshold before obtaining the attribute of each object; If yes, the object corresponding to the confidence level greater than the preset threshold is used as the filtered object; the image block corresponding to the selected location area of each object is sent to the pre-built attribute recognition neural network for attribute recognition, and after screening The properties of each object; the selected categories and attributes of each object after filtering are sent to the CPU.
  • the coprocessor 601 includes at least one of a graphics processor GPU, a digital signal processor DSP, and a field programmable gate array processor FPGA.
  • the coprocessor 601 may be specifically configured to:
  • the obtained image blocks corresponding to each location area are subjected to scaling processing; each image block obtained after the scaling processing is input to a pre-built attribute recognition neural network to obtain attributes of each object.
  • the CPU 602 is further configured to:
  • Image format conversion and scaling processing is performed on the original image to obtain an image to be recognized.
  • the embodiment of the present application further provides a readable storage medium, which is a storage medium in an electronic device including a coprocessor and a central processing unit CPU, and the readable storage medium A computer program is stored, and when the computer program is executed by the coprocessor, the following steps are implemented:
  • the image blocks corresponding to each location area are input to a pre-built attribute recognition neural network to obtain attributes of each object; the obtained category and attributes of each object are sent to the CPU, so that the CPU will receive the type of the object and Attribute as the result of image recognition of the image to be recognized.
  • the step of inputting the image block corresponding to each location area to the pre-built attribute recognition neural network to obtain the attribute of each object may include:
  • the obtained image block corresponding to each location area is input to: the attribute corresponding to the object identifies the neural network, and the step of obtaining the attribute of each object may include:
  • the objects included in the image to be identified are divided into two groups to obtain a first group of objects and a second group of objects; and an object corresponding to a location area of each object in the first group of objects is input to: an attribute recognition neural network corresponding to the object Obtaining an attribute of each object in the first group of objects; sending a location area of each object in the second group of objects to the CPU, so that the CPU inputs the image block corresponding to the location area of each object in the second group of objects To: the attribute corresponding to the object identifies the neural network, and obtains the attribute of each object in the second group of objects;
  • the step of sending the obtained category and attribute of each object to the CPU may include:
  • the step of dividing the objects included in the image to be identified into two groups, and obtaining the first group of objects and the second group of objects may include:
  • the object is an object that is not the first preset category in the image to be identified as the second group of objects.
  • the obtained image block corresponding to each location area is input to: the attribute corresponding to the object identifies the neural network, and the step of obtaining the attribute of each object may include:
  • the step of sending the obtained category and attribute of each object to the CPU may include:
  • the step of sending the obtained category and the attribute of each object to the CPU, so that the CPU uses the category and the attribute of the received object as the image recognition result of the image to be identified may include:
  • the obtained location area, category, and attribute of each object are sent to the CPU, so that the CPU determines the location area, category, and attribute of the received object as the image recognition result of the image to be recognized.
  • the content recognition neural network is further configured to identify a confidence level corresponding to a category of the object included in the image; and the content recognition result further includes: a confidence level corresponding to the category of the object included in the image;
  • the method may further include:
  • the step of inputting the image block corresponding to each location area to the pre-built attribute recognition neural network to obtain the attribute of each object may include:
  • the step of sending the obtained category and attribute of each object to the CPU may include:
  • the coprocessor includes at least one of a graphics processor GPU, a digital signal processor DSP, and a field programmable gate array processor FPGA.
  • the step of inputting the image block corresponding to each location area to the pre-built attribute recognition neural network to obtain the attribute of each object may include:
  • the obtained image blocks corresponding to each location area are subjected to scaling processing; each image block obtained after the scaling processing is input to a pre-built attribute recognition neural network to obtain attributes of each object.
  • the image to be identified is obtained by the CPU performing image format conversion and scaling processing on the original image.
  • the categories and attributes of the objects included in the image can be accurately identified, and the calculation pressure of the CPU can be reduced, and the image recognition effect and the image recognition speed are improved.
  • the embodiment of the present application further provides an application that, when running on an electronic device including a coprocessor and a central processing unit CPU, causes the coprocessor to execute:
  • the image blocks corresponding to each location area are input to a pre-built attribute recognition neural network to obtain attributes of each object; the obtained category and attributes of each object are sent to the CPU, so that the CPU will receive the type of the object and Attribute as the result of image recognition of the image to be recognized.
  • the step of inputting the image block corresponding to each location area to the pre-built attribute recognition neural network to obtain the attribute of each object may include:
  • the obtained image block corresponding to each location area is input to: the attribute corresponding to the object identifies the neural network, and the step of obtaining the attribute of each object may include:
  • the objects included in the image to be identified are divided into two groups to obtain a first group of objects and a second group of objects; and an object corresponding to a location area of each object in the first group of objects is input to: an attribute recognition neural network corresponding to the object Obtaining an attribute of each object in the first group of objects; sending a location area of each object in the second group of objects to the CPU, so that the CPU inputs the image block corresponding to the location area of each object in the second group of objects To: the attribute corresponding to the object identifies the neural network, and obtains the attribute of each object in the second group of objects;
  • the step of sending the obtained category and attribute of each object to the CPU may include:
  • the step of dividing the objects included in the image to be identified into two groups, and obtaining the first group of objects and the second group of objects may include:
  • the object is an object that is not the first preset category in the image to be identified as the second group of objects.
  • the obtained image block corresponding to each location area is input to: the attribute corresponding to the object identifies the neural network, and the step of obtaining the attribute of each object may include:
  • the step of sending the obtained category and attribute of each object to the CPU may include:
  • the step of sending the obtained category and the attribute of each object to the CPU, so that the CPU uses the category and the attribute of the received object as the image recognition result of the image to be identified may include:
  • the obtained location area, category, and attribute of each object are sent to the CPU, so that the CPU determines the location area, category, and attribute of the received object as the image recognition result of the image to be recognized.
  • the content recognition neural network is further configured to identify a confidence level corresponding to a category of the object included in the image; and the content recognition result further includes: a confidence level corresponding to the category of the object included in the image;
  • the method may further include:
  • the step of inputting the image block corresponding to each location area to the pre-built attribute recognition neural network to obtain the attribute of each object may include:
  • the step of sending the obtained category and attribute of each object to the CPU may include:
  • the coprocessor includes at least one of a graphics processor GPU, a digital signal processor DSP, and a field programmable gate array processor FPGA.
  • the step of inputting the image block corresponding to each location area to the pre-built attribute recognition neural network to obtain the attribute of each object may include:
  • the obtained image blocks corresponding to each location area are subjected to scaling processing; each image block obtained after the scaling processing is input to a pre-built attribute recognition neural network to obtain attributes of each object.
  • the image to be identified is obtained by the CPU performing image format conversion and scaling processing on the original image.
  • the categories and attributes of the objects included in the image can be accurately identified, and the calculation pressure of the CPU can be reduced, and the image recognition effect and the image recognition speed are improved.

Abstract

Disclosed are an image recognition method and an electronic device. The method is applied to a co-processor in an electronic device, and the electronic device further comprises a CPU. The method comprises: receiving an image to be recognized sent by a CPU; inputting the image to be recognized into a pre-built content recognition neural network to obtain a content recognition result, wherein the content recognition result comprises: the category and position area of an object contained in the image to be recognized; inputting an image block corresponding to each obtained position area into a pre-built attribute recognition neural network, to obtain an attribute of each object; and sending the obtained category and attribute of each object to the CPU, so that the CPU takes the received category and attribute of the object as an image recognition result of the image to be recognized. Applying the embodiments of the present application, the category and attribute of an object contained in an image can be accurately recognized via a content recognition neural network and an attribute recognition neural network, and the pressure of computation of a CPU can be reduced.

Description

一种图像识别方法和电子设备Image recognition method and electronic device
本申请要求于2017年12月19日提交中国专利局、申请号为201711378700.4发明名称为“一种图像识别方法和电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。The present application claims priority to Chinese Patent Application No. JP-A No. No. No. No. No. No. No. No. No. No. No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No .
技术领域Technical field
本申请涉及图像处理技术领域,特别是涉及一种图像识别方法和电子设备。The present application relates to the field of image processing technologies, and in particular, to an image recognition method and an electronic device.
背景技术Background technique
目前,常常需要对摄像机监测得到的图像进行识别,以识别该图像中包含的各个对象的类别,以及各个对象的属性。例如,识别一张道路监测图像中包含的一个对象的类别为车,并识别该车的车型、颜色等属性。Currently, it is often necessary to identify images that are monitored by the camera to identify the categories of individual objects contained in the image, as well as the properties of the individual objects. For example, it is recognized that the category of an object included in a road monitoring image is a car, and the vehicle type, color, and the like of the vehicle are identified.
其中,由于摄像机会源源不断的采集图像数据,因而需要进行识别的图像的数量是非常巨大的。而在相关技术中,常常通过中央处理器CPU来处理这些大量的图像,以识别这些图像中包含的对象的类别,以及这些对象的属性。Among them, since the camera continuously collects image data, the number of images that need to be recognized is very large. In the related art, these large numbers of images are often processed by the central processing unit CPU to identify the categories of objects contained in these images, as well as the attributes of these objects.
但是,当需要识别的图像较多时,采用该种通过CPU来对图像进行识别的方式,会给CPU造成较大的计算压力。However, when there are many images to be recognized, the way of using the CPU to recognize the image will cause a large calculation pressure on the CPU.
发明内容Summary of the invention
本申请实施例的目的在于提供一种图像识别方法和电子设备,以准确识别图像所包含对象的类别及属性,并降低CPU的计算压力。An object of the embodiments of the present application is to provide an image recognition method and an electronic device to accurately identify categories and attributes of objects included in an image, and reduce the calculation pressure of the CPU.
第一方面,本申请实施例提供了一种图像识别方法,该方法应用于电子设备中的协处理器,该电子设备中还包括中央处理器CPU,该方法可以包括:In a first aspect, an embodiment of the present application provides an image recognition method, which is applied to a coprocessor in an electronic device, where the electronic device further includes a central processing unit CPU, and the method may include:
接收由CPU发送的待识别图像;将待识别图像输入至预先构建的内容识别神经网络,获得内容识别结果,内容识别结果中包括:待识别图像所包含的对象的类别及位置区域;将得到的每个位置区域对应的图像块输入至预先构建的属性识别神经网络,获得每个对象的属性;将得到的每个对象的类别及属性发送给CPU,以使CPU将接收到的对象的类别及属性,作为待识别图 像的图像识别结果。Receiving an image to be recognized sent by the CPU; inputting the image to be recognized into a pre-constructed content recognition neural network, and obtaining a content recognition result, where the content recognition result includes: a category and a location area of the object included in the image to be recognized; The image blocks corresponding to each location area are input to a pre-built attribute recognition neural network to obtain attributes of each object; the obtained category and attributes of each object are sent to the CPU, so that the CPU will receive the type of the object and Attribute as the result of image recognition of the image to be recognized.
可选地,将得到的每个位置区域对应的图像块输入至预先构建的属性识别神经网络,获得每个对象的属性的步骤,可以包括:Optionally, the step of inputting the image block corresponding to each location area to the pre-built attribute recognition neural network to obtain the attribute of each object may include:
基于预设映射关系和待识别图像所包含的每个对象的类别,确定每个对象对应的属性识别神经网络;其中,预设映射关系包括:预设的类别和预先构建的属性识别神经网络之间的对应关系;将得到的每个位置区域对应的图像块输入至:该对象对应的属性识别神经网络,得到每个对象的属性。Determining an attribute recognition neural network corresponding to each object based on a preset mapping relationship and a category of each object included in the image to be identified; wherein the preset mapping relationship comprises: a preset category and a pre-built attribute recognition neural network Correspondence between the two; input the image block corresponding to each location area to: the attribute corresponding to the object identifies the neural network, and obtains the attribute of each object.
可选地,将得到的每个位置区域对应的图像块输入至:该对象对应的属性识别神经网络,得到每个对象的属性的步骤,可以包括:Optionally, the obtained image block corresponding to each location area is input to: the attribute corresponding to the object identifies the neural network, and the step of obtaining the attribute of each object may include:
将待识别图像所包含的对象分为两组,得到第一组对象和第二组对象;将第一组对象中每个对象的位置区域对应的对象输入至:该对象对应的属性识别神经网络,得到第一组对象中每个对象的属性;将第二组对象中每个对象的位置区域发送至CPU,以使CPU将第二组对象中每个对象的位置区域对应的图像块,输入至:该对象对应的属性识别神经网络,得到第二组对象中每个对象的属性;The objects included in the image to be identified are divided into two groups to obtain a first group of objects and a second group of objects; and an object corresponding to a location area of each object in the first group of objects is input to: an attribute recognition neural network corresponding to the object Obtaining an attribute of each object in the first group of objects; sending a location area of each object in the second group of objects to the CPU, so that the CPU inputs the image block corresponding to the location area of each object in the second group of objects To: the attribute corresponding to the object identifies the neural network, and obtains the attribute of each object in the second group of objects;
相应地,将得到的每个对象的类别及属性发送给CPU的步骤,可以包括:Correspondingly, the step of sending the obtained category and attribute of each object to the CPU may include:
将第一组对象中每个对象的类别及属性,第二组对象中每个对象的类别发送至CPU,以使CPU将第一组对象中每个对象的类别及属性,和第二组对象中每个对象的类别及属性,作为待识别图像的图像识别结果。Sending the category and attribute of each object in the first group of objects, the category of each object in the second group of objects to the CPU, so that the CPU will classify the category and attribute of each object in the first group of objects, and the second group of objects The category and attribute of each object in the image as the result of image recognition of the image to be recognized.
可选地,将待识别图像所包含的对象分为两组,得到第一组对象和第二组对象的步骤,可以包括:Optionally, the step of dividing the objects included in the image to be identified into two groups, and obtaining the first group of objects and the second group of objects may include:
从待识别图像所包含的对象中选择出预设数量个对象,作为第一组对象,剩余对象作为第二组对象;或者,将待识别图像中第一预设类别的对象,作为第一组对象,将待识别图像中不为第一预设类别的对象,作为第二组对象。Selecting a preset number of objects from the objects included in the image to be identified, as the first group of objects, and the remaining objects as the second group of objects; or, as the first group, the objects of the first preset category in the image to be identified The object is an object that is not the first preset category in the image to be identified as the second group of objects.
可选地,将得到的每个位置区域对应的图像块输入至:该对象对应的属性识别神经网络,得到每个对象的属性的步骤,可以包括:Optionally, the obtained image block corresponding to each location area is input to: the attribute corresponding to the object identifies the neural network, and the step of obtaining the attribute of each object may include:
将待识别图像所包含的对象中为第二预设类别的每个第一对象的位置区 域发送至CPU,以使CPU将每个第一对象的位置区域对应的图像块输入至:该第一对象对应的属性识别神经网络中的第一类属性识别神经网络,得到每个第一对象的第一类属性;将每个第一对象的位置区域对应的图像块输入至:该第一对象对应的属性识别神经网络中的第二类属性识别神经网络,得到每个第一对象的第二类属性;将待识别图像所包含的对象中不为第二预设类别的每个第二对象的位置区域对应的图像块,输入至:该第二对象对应的属性识别神经网络中的第二类属性识别神经网络,得到每个第二对象的第二类属性;Sending, to the CPU, a location area of each of the objects of the second preset category among the objects included in the image to be identified, so that the CPU inputs the image block corresponding to the location area of each first object to: the first The attribute corresponding to the object identifies the first type of attribute recognition neural network in the neural network, and obtains the first type attribute of each first object; the image block corresponding to the position area of each first object is input to: the first object corresponds to The second type of attribute recognition neural network in the attribute recognition neural network obtains the second type attribute of each first object; the second object of the second preset category is not included in the object to be recognized An image block corresponding to the location area is input to: a second type of attribute recognition neural network in the attribute recognition neural network corresponding to the second object, to obtain a second type attribute of each second object;
相应地,将得到的每个对象的类别和属性发送给CPU的步骤,可以包括:Correspondingly, the step of sending the obtained category and attribute of each object to the CPU may include:
将每个第一对象的第二类属性和类别,及每个第二对象的第二属性和类别发送至CPU,以使CPU将每个第一对象的第一类属性、第二类属性和类别,以及每个第二对象的第二类属性及类别,作为待识别图像的图像识别结果。Sending a second type of attribute and category of each first object, and a second attribute and category of each second object to the CPU, so that the CPU will first class attribute, second type attribute, and The category, and the second type of attribute and category of each second object, are the image recognition results of the image to be recognized.
可选地,将得到的每个对象的类别及属性发送给CPU,以使CPU将接收到的对象的类别及属性,作为待识别图像的图像识别结果的步骤,可以包括:Optionally, the step of sending the obtained category and the attribute of each object to the CPU, so that the CPU uses the category and the attribute of the received object as the image recognition result of the image to be identified, may include:
将得到的每个对象的位置区域、类别及属性发送给CPU,以使CPU将接收到的对象的位置区域、类别及属性,作为待识别图像的图像识别结果。The obtained location area, category, and attribute of each object are sent to the CPU, so that the CPU determines the location area, category, and attribute of the received object as the image recognition result of the image to be recognized.
可选地,内容识别神经网络还用于识别图像所包含的对象的类别对应的置信度;内容识别结果中还包括:图像所包含的对象的类别对应的置信度;Optionally, the content recognition neural network is further configured to identify a confidence level corresponding to a category of the object included in the image; and the content recognition result further includes: a confidence level corresponding to the category of the object included in the image;
在将得到的每个位置区域对应的图像块输入至预先构建的属性识别神经网络,获得每个对象的属性之前,该方法还可以包括:Before the image blocks corresponding to each of the obtained location areas are input to the pre-built attribute recognition neural network to obtain the attributes of each object, the method may further include:
判断得到的置信度是否大于预设阈值;若是,将大于预设阈值的置信度对应的对象,作为筛选后的对象;Determining whether the obtained confidence is greater than a preset threshold; if yes, the object corresponding to the confidence level greater than the preset threshold is used as the filtered object;
相应地,将得到的每个位置区域对应的图像块输入至预先构建的属性识别神经网络,获得每个对象的属性的步骤,可以包括:Correspondingly, the step of inputting the image block corresponding to each location area to the pre-built attribute recognition neural network to obtain the attribute of each object may include:
将筛选后的每个对象的位置区域对应的图像块发送至预先构建的属性识别神经网络进行属性识别,得到筛选后的每个对象的属性;Sending the image block corresponding to the selected location area of each object to the pre-built attribute recognition neural network for attribute recognition, and obtaining the attribute of each object after the screening;
相应地,将得到的每个对象的类别及属性发送给CPU的步骤,可以包括:Correspondingly, the step of sending the obtained category and attribute of each object to the CPU may include:
将得到的筛选后的每个对象的类别及属性发送给CPU。Send the obtained categories and attributes of each object after filtering to the CPU.
可选地,协处理器包括图形处理器GPU、数字信号处理器DSP和现场可编程门阵列处理器FPGA中的至少一种。Optionally, the coprocessor includes at least one of a graphics processor GPU, a digital signal processor DSP, and a field programmable gate array processor FPGA.
可选地,将得到的每个位置区域对应的图像块输入至预先构建的属性识别神经网络,获得每个对象的属性的步骤,可以包括:Optionally, the step of inputting the image block corresponding to each location area to the pre-built attribute recognition neural network to obtain the attribute of each object may include:
将得到的每个位置区域对应的图像块进行缩放处理;And scaling the image block corresponding to each of the obtained location areas;
将缩放处理后得到的每个图像块输入至预先构建的属性识别神经网络,获得每个对象的属性。Each image block obtained after the scaling process is input to a pre-built attribute recognition neural network to obtain attributes of each object.
可选地,待识别图像为:CPU对原始图像进行图像格式转换和缩放处理后得到的。Optionally, the image to be identified is obtained by the CPU performing image format conversion and scaling processing on the original image.
第二方面,本申请实施例还提供了一种电子设备,该电子设备可以包括协处理器和中央处理器CPU;In a second aspect, an embodiment of the present application further provides an electronic device, where the electronic device may include a coprocessor and a central processing unit CPU;
CPU用于向协处理器发送待识别图像;The CPU is configured to send the image to be recognized to the coprocessor;
协处理器用于接收CPU发送的待识别图像;The coprocessor is configured to receive an image to be recognized sent by the CPU;
协处理器还用于:将待识别图像输入至预先构建的内容识别神经网络,获得内容识别结果,内容识别结果中包括:待识别图像所包含的对象的类别及位置区域;The coprocessor is further configured to: input the image to be recognized into the pre-constructed content recognition neural network, and obtain a content recognition result, where the content recognition result includes: a category and a location area of the object included in the image to be identified;
协处理器还用于:将得到的每个位置区域对应的图像块输入至预先构建的属性识别神经网络,获得每个对象的属性;The coprocessor is further configured to: input the obtained image block corresponding to each location area to a pre-built attribute recognition neural network, and obtain an attribute of each object;
协处理器还用于:将得到的每个对象的类别及属性发送给CPU;The coprocessor is further configured to: send the obtained category and attribute of each object to the CPU;
CPU还用于:接收协处理器发送的每个对象的类别及属性,并将接收到的对象的类别及属性,作为待识别图像的图像识别结果。The CPU is further configured to: receive a category and an attribute of each object sent by the coprocessor, and use the category and attribute of the received object as an image recognition result of the image to be identified.
可选地,在本申请实施例中,该协处理器具体可以用于:Optionally, in the embodiment of the present application, the coprocessor may be specifically configured to:
基于预设映射关系和待识别图像所包含的每个对象的类别,确定每个对象对应的属性识别神经网络;其中,预设映射关系包括:预设的类别和预先构建的属性识别神经网络之间的对应关系;将得到的每个位置区域对应的图 像块输入至:该对象对应的属性识别神经网络,得到每个对象的属性。Determining an attribute recognition neural network corresponding to each object based on a preset mapping relationship and a category of each object included in the image to be identified; wherein the preset mapping relationship comprises: a preset category and a pre-built attribute recognition neural network Correspondence between the two; input the image block corresponding to each location area to: the attribute corresponding to the object identifies the neural network, and obtains the attribute of each object.
可选地,在本申请实施例中,协处理器具体可以用于:Optionally, in the embodiment of the present application, the coprocessor may be specifically configured to:
将待识别图像所包含的对象分为两组,得到第一组对象和第二组对象;将第一组对象中每个对象的位置区域对应的图像块输入至:该对象对应的属性识别神经网络,得到第一组对象中每个对象的属性;将第二组对象中每个对象的位置区域发送至CPU;将第一组对象中每个对象的类别及属性,第二组对象中每个对象的类别发送至CPU;The objects included in the image to be identified are divided into two groups to obtain a first group of objects and a second group of objects; the image blocks corresponding to the position regions of each object in the first group of objects are input to: the attribute recognition nerve corresponding to the object The network obtains the attributes of each object in the first group of objects; sends the location area of each object in the second group of objects to the CPU; the categories and attributes of each object in the first group of objects, each of the second group of objects The category of the object is sent to the CPU;
CPU具体用于:将第二组对象中每个对象的位置区域对应的图像块输入至:该对象对应的属性识别神经网络,得到第二组对象中每个对象的属性;将第一组对象中每个对象的类别及属性,和第二组对象中每个对象的类别及属性,作为待识别图像的图像识别结果。The CPU is specifically configured to: input an image block corresponding to a location area of each object in the second group of objects to: an attribute corresponding to the object identifies the neural network, and obtain an attribute of each object in the second group of objects; and the first group of objects The category and attribute of each object in the object, and the category and attribute of each object in the second group of objects, as the image recognition result of the image to be recognized.
可选地,在本申请实施例中,该协处理器具体可以用于:Optionally, in the embodiment of the present application, the coprocessor may be specifically configured to:
从待识别图像所包含的对象中选择出预设数量个对象,作为第一组对象,剩余对象作为第二组对象;或者,将待识别图像中第一预设类别的对象,作为第一组对象,将待识别图像中不为第一预设类别的对象,作为第二组对象。Selecting a preset number of objects from the objects included in the image to be identified, as the first group of objects, and the remaining objects as the second group of objects; or, as the first group, the objects of the first preset category in the image to be identified The object is an object that is not the first preset category in the image to be identified as the second group of objects.
可选地,在本申请实施例中,协处理器具体可以用于:Optionally, in the embodiment of the present application, the coprocessor may be specifically configured to:
将待识别图像所包含的对象中为第二预设类别的每个第一对象的位置区域发送至CPU;Sending, to the CPU, a location area of each of the objects of the second preset category among the objects included in the image to be identified;
将每个第一对象的位置区域对应的图像块输入至:该第一对象对应的属性识别神经网络中的第二类属性识别神经网络,得到每个第一对象的第二类属性;将待识别图像所包含的对象中不为第二预设类别的每个第二对象的位置区域对应的图像块,输入至:该第二对象对应的属性识别神经网络中的第二类属性识别神经网络,得到每个第二对象的第二类属性;将每个第一对象的第二类属性和类别,及每个第二对象的第二属性和类别发送至CPU;Inputting an image block corresponding to the location area of each first object to: a second type of attribute recognition neural network in the attribute recognition neural network corresponding to the first object, obtaining a second type attribute of each first object; Identifying, in the object included in the image, an image block corresponding to a location area of each second object of the second preset category, inputting to: a second type of attribute recognition neural network in the attribute recognition neural network corresponding to the second object Obtaining a second type of attribute of each second object; sending a second type of attribute and category of each first object, and a second attribute and category of each second object to the CPU;
CPU具体用于:将每个第一对象的位置区域对应的图像块输入至:该第一对象对应的属性识别神经网络中的第一类属性识别神经网络,得到每个第一对象的第一类属性;将每个第一对象的第一类属性、第二类属性和类别, 以及每个第二对象的第二类属性及类别,作为待识别图像的图像识别结果。The CPU is specifically configured to: input an image block corresponding to the location area of each first object to: the first type of attribute recognition neural network in the attribute recognition neural network corresponding to the first object, and obtain the first of each first object The class attribute; the first type attribute, the second type attribute and the category of each first object, and the second type attribute and category of each second object are used as image recognition results of the image to be recognized.
可选地,在本申请实施例中,协处理器具体可以用于:将得到的每个对象的位置区域、类别及属性发送给CPU;Optionally, in the embodiment of the present application, the coprocessor may be specifically configured to: send the obtained location area, category, and attribute of each object to the CPU;
CPU具体可以用于:将接收到的对象的位置区域、类别及属性,作为待识别图像的图像识别结果。The CPU may be specifically configured to: use the location area, the category, and the attribute of the received object as the image recognition result of the image to be identified.
可选地,内容识别神经网络还用于识别图像所包含的对象的类别对应的置信度;内容识别结果中还包括:图像所包含的对象的类别对应的置信度;Optionally, the content recognition neural network is further configured to identify a confidence level corresponding to a category of the object included in the image; and the content recognition result further includes: a confidence level corresponding to the category of the object included in the image;
相应地,协处理器还可以用于:在将得到的每个位置区域对应的图像块输入至预先构建的属性识别神经网络,获得每个对象的属性之前,判断得到的置信度是否大于预设阈值;若是,将大于预设阈值的置信度对应的对象,作为筛选后的对象;将筛选后的每个对象的位置区域对应的图像块发送至预先构建的属性识别神经网络进行属性识别,得到筛选后的每个对象的属性;将得到的筛选后的每个对象的类别及属性发送给CPU。Correspondingly, the coprocessor can be further configured to: input the image block corresponding to each location area obtained to the pre-built attribute recognition neural network, and determine whether the obtained confidence is greater than a preset before obtaining the attribute of each object. a threshold value; if yes, an object corresponding to a confidence level greater than a preset threshold is used as a filtered object; and the image block corresponding to the selected location area of each object is sent to a pre-built attribute recognition neural network for attribute recognition, The attributes of each object after filtering; the categories and attributes of each object after filtering are sent to the CPU.
可选地,协处理器可以包括图形处理器GPU、数字信号处理器DSP和现场可编程门阵列处理器FPGA中的至少一种。Optionally, the coprocessor may include at least one of a graphics processor GPU, a digital signal processor DSP, and a field programmable gate array processor FPGA.
可选地,在本申请实施例中,该协处理器具体可以用于:Optionally, in the embodiment of the present application, the coprocessor may be specifically configured to:
将得到的每个位置区域对应的图像块进行缩放处理;将缩放处理后得到的每个图像块输入至预先构建的属性识别神经网络,获得每个对象的属性。The obtained image blocks corresponding to each location area are subjected to scaling processing; each image block obtained after the scaling processing is input to a pre-built attribute recognition neural network to obtain attributes of each object.
可选地,在本申请实施例中,CPU还可以用于:Optionally, in the embodiment of the present application, the CPU is further configured to:
对原始图像进行图像格式转换和缩放处理,获得待识别图像。Image format conversion and scaling processing is performed on the original image to obtain an image to be recognized.
第三方面,本申请实施例还提供了一种可读存储介质,该可读存储介质为包括协处理器和中央处理器CPU的电子设备中的存储介质,该可读存储介质内存储有计算机程序,计算机程序被协处理器执行时实现如下步骤:In a third aspect, the embodiment of the present application further provides a readable storage medium, which is a storage medium in an electronic device including a coprocessor and a central processing unit CPU, where the readable storage medium stores a computer The program, when the computer program is executed by the coprocessor, implements the following steps:
接收由CPU发送的待识别图像;将待识别图像输入至预先构建的内容识别神经网络,获得内容识别结果,内容识别结果中包括:待识别图像所包含的对象的类别及位置区域;将得到的每个位置区域对应的图像块输入至预先构建的属性识别神经网络,获得每个对象的属性;将得到的每个对象的类别 及属性发送给CPU,以使CPU将接收到的对象的类别及属性,作为待识别图像的图像识别结果。Receiving an image to be recognized sent by the CPU; inputting the image to be recognized into a pre-constructed content recognition neural network, and obtaining a content recognition result, where the content recognition result includes: a category and a location area of the object included in the image to be recognized; The image blocks corresponding to each location area are input to a pre-built attribute recognition neural network to obtain attributes of each object; the obtained category and attributes of each object are sent to the CPU, so that the CPU will receive the type of the object and Attribute as the result of image recognition of the image to be recognized.
可选地,将得到的每个位置区域对应的图像块输入至预先构建的属性识别神经网络,获得每个对象的属性的步骤,可以包括:Optionally, the step of inputting the image block corresponding to each location area to the pre-built attribute recognition neural network to obtain the attribute of each object may include:
基于预设映射关系和待识别图像所包含的每个对象的类别,确定每个对象对应的属性识别神经网络;其中,预设映射关系包括:预设的类别和预先构建的属性识别神经网络之间的对应关系;将得到的每个位置区域对应的图像块输入至:该对象对应的属性识别神经网络,得到每个对象的属性。Determining an attribute recognition neural network corresponding to each object based on a preset mapping relationship and a category of each object included in the image to be identified; wherein the preset mapping relationship comprises: a preset category and a pre-built attribute recognition neural network Correspondence between the two; input the image block corresponding to each location area to: the attribute corresponding to the object identifies the neural network, and obtains the attribute of each object.
可选地,将得到的每个位置区域对应的图像块输入至:该对象对应的属性识别神经网络,得到每个对象的属性的步骤,可以包括:Optionally, the obtained image block corresponding to each location area is input to: the attribute corresponding to the object identifies the neural network, and the step of obtaining the attribute of each object may include:
将待识别图像所包含的对象分为两组,得到第一组对象和第二组对象;将第一组对象中每个对象的位置区域对应的对象输入至:该对象对应的属性识别神经网络,得到第一组对象中每个对象的属性;将第二组对象中每个对象的位置区域发送至CPU,以使CPU将第二组对象中每个对象的位置区域对应的图像块,输入至:该对象对应的属性识别神经网络,得到第二组对象中每个对象的属性;The objects included in the image to be identified are divided into two groups to obtain a first group of objects and a second group of objects; and an object corresponding to a location area of each object in the first group of objects is input to: an attribute recognition neural network corresponding to the object Obtaining an attribute of each object in the first group of objects; sending a location area of each object in the second group of objects to the CPU, so that the CPU inputs the image block corresponding to the location area of each object in the second group of objects To: the attribute corresponding to the object identifies the neural network, and obtains the attribute of each object in the second group of objects;
相应地,将得到的每个对象的类别及属性发送给CPU的步骤,可以包括:Correspondingly, the step of sending the obtained category and attribute of each object to the CPU may include:
将第一组对象中每个对象的类别及属性,第二组对象中每个对象的类别发送至CPU,以使CPU将第一组对象中每个对象的类别及属性,和第二组对象中每个对象的类别及属性,作为待识别图像的图像识别结果。Sending the category and attribute of each object in the first group of objects, the category of each object in the second group of objects to the CPU, so that the CPU will classify the category and attribute of each object in the first group of objects, and the second group of objects The category and attribute of each object in the image as the result of image recognition of the image to be recognized.
可选地,将待识别图像所包含的对象分为两组,得到第一组对象和第二组对象的步骤,可以包括:Optionally, the step of dividing the objects included in the image to be identified into two groups, and obtaining the first group of objects and the second group of objects may include:
从待识别图像所包含的对象中选择出预设数量个对象,作为第一组对象,剩余对象作为第二组对象;或者,将待识别图像中第一预设类别的对象,作为第一组对象,将待识别图像中不为第一预设类别的对象,作为第二组对象。Selecting a preset number of objects from the objects included in the image to be identified, as the first group of objects, and the remaining objects as the second group of objects; or, as the first group, the objects of the first preset category in the image to be identified The object is an object that is not the first preset category in the image to be identified as the second group of objects.
可选地,将得到的每个位置区域对应的图像块输入至:该对象对应的属性识别神经网络,得到每个对象的属性的步骤,可以包括:Optionally, the obtained image block corresponding to each location area is input to: the attribute corresponding to the object identifies the neural network, and the step of obtaining the attribute of each object may include:
将待识别图像所包含的对象中为第二预设类别的每个第一对象的位置区域发送至CPU,以使CPU将每个第一对象的位置区域对应的图像块输入至:该第一对象对应的属性识别神经网络中的第一类属性识别神经网络,得到每个第一对象的第一类属性;将每个第一对象的位置区域对应的图像块输入至:该第一对象对应的属性识别神经网络中的第二类属性识别神经网络,得到每个第一对象的第二类属性;将待识别图像所包含的对象中不为第二预设类别的每个第二对象的位置区域对应的图像块,输入至:该第二对象对应的属性识别神经网络中的第二类属性识别神经网络,得到每个第二对象的第二类属性;Sending, to the CPU, a location area of each of the objects of the second preset category among the objects included in the image to be identified, so that the CPU inputs the image block corresponding to the location area of each first object to: the first The attribute corresponding to the object identifies the first type of attribute recognition neural network in the neural network, and obtains the first type attribute of each first object; the image block corresponding to the position area of each first object is input to: the first object corresponds to The second type of attribute recognition neural network in the attribute recognition neural network obtains the second type attribute of each first object; the second object of the second preset category is not included in the object to be recognized An image block corresponding to the location area is input to: a second type of attribute recognition neural network in the attribute recognition neural network corresponding to the second object, to obtain a second type attribute of each second object;
相应地,将得到的每个对象的类别和属性发送给CPU的步骤,可以包括:Correspondingly, the step of sending the obtained category and attribute of each object to the CPU may include:
将每个第一对象的第二类属性和类别,及每个第二对象的第二属性和类别发送至CPU,以使CPU将每个第一对象的第一类属性、第二类属性和类别,以及每个第二对象的第二类属性及类别,作为待识别图像的图像识别结果。Sending a second type of attribute and category of each first object, and a second attribute and category of each second object to the CPU, so that the CPU will first class attribute, second type attribute, and The category, and the second type of attribute and category of each second object, are the image recognition results of the image to be recognized.
可选地,将得到的每个对象的类别及属性发送给CPU,以使CPU将接收到的对象的类别及属性,作为待识别图像的图像识别结果的步骤,可以包括:Optionally, the step of sending the obtained category and the attribute of each object to the CPU, so that the CPU uses the category and the attribute of the received object as the image recognition result of the image to be identified, may include:
将得到的每个对象的位置区域、类别及属性发送给CPU,以使CPU将接收到的对象的位置区域、类别及属性,作为待识别图像的图像识别结果。The obtained location area, category, and attribute of each object are sent to the CPU, so that the CPU determines the location area, category, and attribute of the received object as the image recognition result of the image to be recognized.
可选地,内容识别神经网络还用于识别图像所包含的对象的类别对应的置信度;内容识别结果中还包括:图像所包含的对象的类别对应的置信度;Optionally, the content recognition neural network is further configured to identify a confidence level corresponding to a category of the object included in the image; and the content recognition result further includes: a confidence level corresponding to the category of the object included in the image;
在将得到的每个位置区域对应的图像块输入至预先构建的属性识别神经网络,获得每个对象的属性之前,该方法还可以包括:Before the image blocks corresponding to each of the obtained location areas are input to the pre-built attribute recognition neural network to obtain the attributes of each object, the method may further include:
判断得到的置信度是否大于预设阈值;若是,将大于预设阈值的置信度对应的对象,作为筛选后的对象;Determining whether the obtained confidence is greater than a preset threshold; if yes, the object corresponding to the confidence level greater than the preset threshold is used as the filtered object;
相应地,将得到的每个位置区域对应的图像块输入至预先构建的属性识别神经网络,获得每个对象的属性的步骤,可以包括:Correspondingly, the step of inputting the image block corresponding to each location area to the pre-built attribute recognition neural network to obtain the attribute of each object may include:
将筛选后的每个对象的位置区域对应的图像块发送至预先构建的属性识别神经网络进行属性识别,得到筛选后的每个对象的属性;Sending the image block corresponding to the selected location area of each object to the pre-built attribute recognition neural network for attribute recognition, and obtaining the attribute of each object after the screening;
相应地,将得到的每个对象的类别及属性发送给CPU的步骤,可以包括:Correspondingly, the step of sending the obtained category and attribute of each object to the CPU may include:
将得到的筛选后的每个对象的类别及属性发送给CPU。Send the obtained categories and attributes of each object after filtering to the CPU.
可选地,协处理器包括图形处理器GPU、数字信号处理器DSP和现场可编程门阵列处理器FPGA中的至少一种。Optionally, the coprocessor includes at least one of a graphics processor GPU, a digital signal processor DSP, and a field programmable gate array processor FPGA.
可选地,将得到的每个位置区域对应的图像块输入至预先构建的属性识别神经网络,获得每个对象的属性的步骤,可以包括:Optionally, the step of inputting the image block corresponding to each location area to the pre-built attribute recognition neural network to obtain the attribute of each object may include:
将得到的每个位置区域对应的图像块进行缩放处理;将缩放处理后得到的每个图像块输入至预先构建的属性识别神经网络,获得每个对象的属性。The obtained image blocks corresponding to each location area are subjected to scaling processing; each image block obtained after the scaling processing is input to a pre-built attribute recognition neural network to obtain attributes of each object.
可选地,待识别图像为:CPU对原始图像进行图像格式转换和缩放处理后得到的。Optionally, the image to be identified is obtained by the CPU performing image format conversion and scaling processing on the original image.
第四方面,本申请实施例还提供了一种应用程序,当其在包括协处理器和中央处理器CPU的电子设备上运行时,使得该协处理器执行:In a fourth aspect, an embodiment of the present application further provides an application that, when running on an electronic device including a coprocessor and a central processing unit CPU, causes the coprocessor to execute:
接收由CPU发送的待识别图像;将待识别图像输入至预先构建的内容识别神经网络,获得内容识别结果,内容识别结果中包括:待识别图像所包含的对象的类别及位置区域;将得到的每个位置区域对应的图像块输入至预先构建的属性识别神经网络,获得每个对象的属性;将得到的每个对象的类别及属性发送给CPU,以使CPU将接收到的对象的类别及属性,作为待识别图像的图像识别结果。Receiving an image to be recognized sent by the CPU; inputting the image to be recognized into a pre-constructed content recognition neural network, and obtaining a content recognition result, where the content recognition result includes: a category and a location area of the object included in the image to be recognized; The image blocks corresponding to each location area are input to a pre-built attribute recognition neural network to obtain attributes of each object; the obtained category and attributes of each object are sent to the CPU, so that the CPU will receive the type of the object and Attribute as the result of image recognition of the image to be recognized.
可选地,将得到的每个位置区域对应的图像块输入至预先构建的属性识别神经网络,获得每个对象的属性的步骤,可以包括:Optionally, the step of inputting the image block corresponding to each location area to the pre-built attribute recognition neural network to obtain the attribute of each object may include:
基于预设映射关系和待识别图像所包含的每个对象的类别,确定每个对象对应的属性识别神经网络;其中,预设映射关系包括:预设的类别和预先构建的属性识别神经网络之间的对应关系;将得到的每个位置区域对应的图像块输入至:该对象对应的属性识别神经网络,得到每个对象的属性。Determining an attribute recognition neural network corresponding to each object based on a preset mapping relationship and a category of each object included in the image to be identified; wherein the preset mapping relationship comprises: a preset category and a pre-built attribute recognition neural network Correspondence between the two; input the image block corresponding to each location area to: the attribute corresponding to the object identifies the neural network, and obtains the attribute of each object.
可选地,将得到的每个位置区域对应的图像块输入至:该对象对应的属性识别神经网络,得到每个对象的属性的步骤,可以包括:Optionally, the obtained image block corresponding to each location area is input to: the attribute corresponding to the object identifies the neural network, and the step of obtaining the attribute of each object may include:
将待识别图像所包含的对象分为两组,得到第一组对象和第二组对象; 将第一组对象中每个对象的位置区域对应的对象输入至:该对象对应的属性识别神经网络,得到第一组对象中每个对象的属性;将第二组对象中每个对象的位置区域发送至CPU,以使CPU将第二组对象中每个对象的位置区域对应的图像块,输入至:该对象对应的属性识别神经网络,得到第二组对象中每个对象的属性;The objects included in the image to be identified are divided into two groups to obtain a first group of objects and a second group of objects; and an object corresponding to a location area of each object in the first group of objects is input to: an attribute recognition neural network corresponding to the object Obtaining an attribute of each object in the first group of objects; sending a location area of each object in the second group of objects to the CPU, so that the CPU inputs the image block corresponding to the location area of each object in the second group of objects To: the attribute corresponding to the object identifies the neural network, and obtains the attribute of each object in the second group of objects;
相应地,将得到的每个对象的类别及属性发送给CPU的步骤,可以包括:Correspondingly, the step of sending the obtained category and attribute of each object to the CPU may include:
将第一组对象中每个对象的类别及属性,第二组对象中每个对象的类别发送至CPU,以使CPU将第一组对象中每个对象的类别及属性,和第二组对象中每个对象的类别及属性,作为待识别图像的图像识别结果。Sending the category and attribute of each object in the first group of objects, the category of each object in the second group of objects to the CPU, so that the CPU will classify the category and attribute of each object in the first group of objects, and the second group of objects The category and attribute of each object in the image as the result of image recognition of the image to be recognized.
可选地,将待识别图像所包含的对象分为两组,得到第一组对象和第二组对象的步骤,可以包括:Optionally, the step of dividing the objects included in the image to be identified into two groups, and obtaining the first group of objects and the second group of objects may include:
从待识别图像所包含的对象中选择出预设数量个对象,作为第一组对象,剩余对象作为第二组对象;或者,将待识别图像中第一预设类别的对象,作为第一组对象,将待识别图像中不为第一预设类别的对象,作为第二组对象。Selecting a preset number of objects from the objects included in the image to be identified, as the first group of objects, and the remaining objects as the second group of objects; or, as the first group, the objects of the first preset category in the image to be identified The object is an object that is not the first preset category in the image to be identified as the second group of objects.
可选地,将得到的每个位置区域对应的图像块输入至:该对象对应的属性识别神经网络,得到每个对象的属性的步骤,可以包括:Optionally, the obtained image block corresponding to each location area is input to: the attribute corresponding to the object identifies the neural network, and the step of obtaining the attribute of each object may include:
将待识别图像所包含的对象中为第二预设类别的每个第一对象的位置区域发送至CPU,以使CPU将每个第一对象的位置区域对应的图像块输入至:该第一对象对应的属性识别神经网络中的第一类属性识别神经网络,得到每个第一对象的第一类属性;将每个第一对象的位置区域对应的图像块输入至:该第一对象对应的属性识别神经网络中的第二类属性识别神经网络,得到每个第一对象的第二类属性;将待识别图像所包含的对象中不为第二预设类别的每个第二对象的位置区域对应的图像块,输入至:该第二对象对应的属性识别神经网络中的第二类属性识别神经网络,得到每个第二对象的第二类属性;Sending, to the CPU, a location area of each of the objects of the second preset category among the objects included in the image to be identified, so that the CPU inputs the image block corresponding to the location area of each first object to: the first The attribute corresponding to the object identifies the first type of attribute recognition neural network in the neural network, and obtains the first type attribute of each first object; the image block corresponding to the position area of each first object is input to: the first object corresponds to The second type of attribute recognition neural network in the attribute recognition neural network obtains the second type attribute of each first object; the second object of the second preset category is not included in the object to be recognized An image block corresponding to the location area is input to: a second type of attribute recognition neural network in the attribute recognition neural network corresponding to the second object, to obtain a second type attribute of each second object;
相应地,将得到的每个对象的类别和属性发送给CPU的步骤,可以包括:Correspondingly, the step of sending the obtained category and attribute of each object to the CPU may include:
将每个第一对象的第二类属性和类别,及每个第二对象的第二属性和类别发送至CPU,以使CPU将每个第一对象的第一类属性、第二类属性和类别, 以及每个第二对象的第二类属性及类别,作为待识别图像的图像识别结果。Sending a second type of attribute and category of each first object, and a second attribute and category of each second object to the CPU, so that the CPU will first class attribute, second type attribute, and The category, and the second type of attribute and category of each second object, are the image recognition results of the image to be recognized.
可选地,将得到的每个对象的类别及属性发送给CPU,以使CPU将接收到的对象的类别及属性,作为待识别图像的图像识别结果的步骤,可以包括:Optionally, the step of sending the obtained category and the attribute of each object to the CPU, so that the CPU uses the category and the attribute of the received object as the image recognition result of the image to be identified, may include:
将得到的每个对象的位置区域、类别及属性发送给CPU,以使CPU将接收到的对象的位置区域、类别及属性,作为待识别图像的图像识别结果。The obtained location area, category, and attribute of each object are sent to the CPU, so that the CPU determines the location area, category, and attribute of the received object as the image recognition result of the image to be recognized.
可选地,内容识别神经网络还用于识别图像所包含的对象的类别对应的置信度;内容识别结果中还包括:图像所包含的对象的类别对应的置信度;Optionally, the content recognition neural network is further configured to identify a confidence level corresponding to a category of the object included in the image; and the content recognition result further includes: a confidence level corresponding to the category of the object included in the image;
在将得到的每个位置区域对应的图像块输入至预先构建的属性识别神经网络,获得每个对象的属性之前,该方法还可以包括:Before the image blocks corresponding to each of the obtained location areas are input to the pre-built attribute recognition neural network to obtain the attributes of each object, the method may further include:
判断得到的置信度是否大于预设阈值;若是,将大于预设阈值的置信度对应的对象,作为筛选后的对象;Determining whether the obtained confidence is greater than a preset threshold; if yes, the object corresponding to the confidence level greater than the preset threshold is used as the filtered object;
相应地,将得到的每个位置区域对应的图像块输入至预先构建的属性识别神经网络,获得每个对象的属性的步骤,可以包括:Correspondingly, the step of inputting the image block corresponding to each location area to the pre-built attribute recognition neural network to obtain the attribute of each object may include:
将筛选后的每个对象的位置区域对应的图像块发送至预先构建的属性识别神经网络进行属性识别,得到筛选后的每个对象的属性;Sending the image block corresponding to the selected location area of each object to the pre-built attribute recognition neural network for attribute recognition, and obtaining the attribute of each object after the screening;
相应地,将得到的每个对象的类别及属性发送给CPU的步骤,可以包括:Correspondingly, the step of sending the obtained category and attribute of each object to the CPU may include:
将得到的筛选后的每个对象的类别及属性发送给CPU。Send the obtained categories and attributes of each object after filtering to the CPU.
可选地,协处理器包括图形处理器GPU、数字信号处理器DSP和现场可编程门阵列处理器FPGA中的至少一种。Optionally, the coprocessor includes at least one of a graphics processor GPU, a digital signal processor DSP, and a field programmable gate array processor FPGA.
可选地,将得到的每个位置区域对应的图像块输入至预先构建的属性识别神经网络,获得每个对象的属性的步骤,可以包括:Optionally, the step of inputting the image block corresponding to each location area to the pre-built attribute recognition neural network to obtain the attribute of each object may include:
将得到的每个位置区域对应的图像块进行缩放处理;将缩放处理后得到的每个图像块输入至预先构建的属性识别神经网络,获得每个对象的属性。The obtained image blocks corresponding to each location area are subjected to scaling processing; each image block obtained after the scaling processing is input to a pre-built attribute recognition neural network to obtain attributes of each object.
可选地,待识别图像为:CPU对原始图像进行图像格式转换和缩放处理后得到的。在本申请实施例中,电子设备中的协处理器可以接收该电子设备中的CPU发送的待识别图像,并可以将该待识别图像输入至预先构建的内容 识别神经网络中,从而获得该待识别图像中所包含的对象的类别及位置区域。然后,该协处理器将得到的每个位置区域对应的图像块输入至预先构建的属性识别神经网络中,从而可以获得每个对象的属性。进而,协处理器可以将得到的每个对象的类别及属性发送给CPU,使得CPU可以将接收得到的对象的类别及属性,作为该待识别图像的图像识别结果。该种方式中,协处理器可以借助内容识别神经网络和属性识别神经网络,对该待识别图像中所包含的对象的类别及属性进行准确识别,并且,分担了CPU对图像进行识别的计算压力,从而降低了CPU的计算压力。Optionally, the image to be identified is obtained by the CPU performing image format conversion and scaling processing on the original image. In the embodiment of the present application, the coprocessor in the electronic device may receive the image to be recognized sent by the CPU in the electronic device, and input the image to be recognized into the pre-built content recognition neural network, thereby obtaining the to-be-identified image. Identify the category and location area of the object contained in the image. Then, the coprocessor inputs the obtained image blocks corresponding to each location area into the pre-built attribute recognition neural network, so that the attributes of each object can be obtained. Further, the coprocessor can send the obtained category and attribute of each object to the CPU, so that the CPU can use the type and attribute of the received object as the image recognition result of the image to be recognized. In this manner, the coprocessor can identify the type and attribute of the object included in the image to be identified by means of the content recognition neural network and the attribute recognition neural network, and share the calculation pressure of the CPU to recognize the image. , which reduces the computational pressure on the CPU.
附图说明DRAWINGS
为了更清楚地说明本申请实施例和现有技术的技术方案,下面对实施例和现有技术中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present application and the technical solutions of the prior art, the following description of the embodiments and the drawings used in the prior art will be briefly introduced. Obviously, the drawings in the following description are only Some embodiments of the application may also be used to obtain other figures from those of ordinary skill in the art without departing from the scope of the invention.
图1为本申请实施例提供的一种图像识别方法流程图;FIG. 1 is a flowchart of an image recognition method according to an embodiment of the present application;
图2为本申请实施例提供的一种图像识别方法的示意图;2 is a schematic diagram of an image recognition method according to an embodiment of the present application;
图3为本申请实施例提供的另一种图像识别方法的示意图;FIG. 3 is a schematic diagram of another image recognition method according to an embodiment of the present application; FIG.
图4为本申请实施例提供的又一种图像识别方法的示意图;4 is a schematic diagram of still another image recognition method according to an embodiment of the present application;
图5为本申请实施例提供的又一种图像识别方法的示意图;FIG. 5 is a schematic diagram of still another image recognition method according to an embodiment of the present application; FIG.
图6为本申请实施例提供的一种电子设备的结构示意图。FIG. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
具体实施方式Detailed ways
为使本申请的目的、技术方案、及优点更加清楚明白,以下参照附图并举实施例,对本申请进一步详细说明。显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to make the objects, technical solutions, and advantages of the present application more comprehensible, the present application will be further described in detail below with reference to the accompanying drawings. It is apparent that the described embodiments are only a part of the embodiments of the present application, and not all of them. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present application without departing from the inventive scope are the scope of the present application.
为解决现有技术中存在的问题,本申请实施例提供了一种图像识别方法和电子设备。To solve the problems in the prior art, the embodiment of the present application provides an image recognition method and an electronic device.
下面首先对本申请实施例提供的图像识别方法进行说明。The image recognition method provided by the embodiment of the present application is first described below.
本申请实施例提供的图像识别方法应用于电子设备中的协处理器,该协处理器可以为GPU(Graphics Processing Unit,图形处理器),也可以为DSP(Digital Signal Processing,数字信号处理器),还可以为FPGA(Field-Programmable Gate Array,现场可编程门阵列)。当然,也可以为GPU、DSP和FPGA的任意组合形式,这都是合理的。另外,该电子设备中还包括CPU(Central Processing Unit,中央处理器)。The image recognition method provided by the embodiment of the present application is applied to a coprocessor in an electronic device, and the coprocessor may be a GPU (Graphics Processing Unit) or a DSP (Digital Signal Processing). It can also be an FPGA (Field-Programmable Gate Array). Of course, it can also be any combination of GPU, DSP and FPGA, which is reasonable. In addition, the electronic device further includes a CPU (Central Processing Unit).
其中,该电子设备可以为前端设备,例如摄像机等;也可以为后端设备,例如服务器等。具体地,当该电子设备为前端设备时,该协处理器可以选择低功耗的DSP和/或FPGA;当该电子设备为后端设备时,该协处理器可以选择功耗较高但更容易开发的GPU,当然并不局限与此。其中,在本申请实施例中,协处理器能够支撑复杂的浮点计算。The electronic device may be a front-end device, such as a video camera, or a back-end device, such as a server. Specifically, when the electronic device is a front-end device, the coprocessor can select a low-power DSP and/or an FPGA; when the electronic device is a back-end device, the coprocessor can select a higher power consumption but more The GPU that is easy to develop is certainly not limited to this. Among them, in the embodiment of the present application, the coprocessor can support complex floating point calculation.
参见图1,本申请实施例提供的图像识别方法包括如下步骤:Referring to FIG. 1 , an image recognition method provided by an embodiment of the present application includes the following steps:
S101:接收由CPU发送的待识别图像;S101: Receive an image to be identified sent by the CPU;
S102:将待识别图像输入至预先构建的内容识别神经网络,获得内容识别结果,内容识别结果中包括:待识别图像所包含的对象的类别及位置区域;S102: input the image to be identified to the pre-constructed content recognition neural network, and obtain a content recognition result, where the content recognition result includes: a category and a location area of the object included in the image to be identified;
S103:将得到的每个位置区域对应的图像块输入至预先构建的属性识别神经网络,获得每个对象的属性;S103: input the obtained image block corresponding to each location area to a pre-built attribute recognition neural network, and obtain an attribute of each object;
S104:将得到的每个对象的类别及属性发送给CPU,以使CPU将接收到的对象的类别及属性,作为待识别图像的图像识别结果。S104: Send the obtained category and attribute of each object to the CPU, so that the CPU uses the category and attribute of the received object as the image recognition result of the image to be recognized.
可以理解的是,电子设备中的协处理器可以接收该电子设备中的CPU发送的待识别图像,并可以将该待识别图像输入至预先构建的内容识别神经网络中,从而获得该待识别图像中所包含的对象的类别及位置区域。然后,该协处理器将得到的每个位置区域对应的图像块输入至预先构建的属性识别神经网络中,从而可以获得每个对象的属性。进而,协处理器可以将得到的每个对象的类别及属性发送给CPU,使得CPU可以将接收得到的对象的类别及属性,作为该待识别图像的图像识别结果。该种方式中,协处理器可以借助内容识别神经网络和属性识别神经网络,对该待识别图像中所包含的对象的类别及属性进行准确识别,分担了CPU对图像进行识别的计算压力,从而降低 了CPU的计算压力。It can be understood that the coprocessor in the electronic device can receive the image to be recognized sent by the CPU in the electronic device, and can input the image to be recognized into the pre-constructed content recognition neural network, thereby obtaining the image to be recognized. The category and location area of the object contained in it. Then, the coprocessor inputs the obtained image blocks corresponding to each location area into the pre-built attribute recognition neural network, so that the attributes of each object can be obtained. Further, the coprocessor can send the obtained category and attribute of each object to the CPU, so that the CPU can use the type and attribute of the received object as the image recognition result of the image to be recognized. In this manner, the coprocessor can identify the type and attribute of the object included in the image to be identified by using the content recognition neural network and the attribute recognition neural network, and share the calculation pressure of the CPU to recognize the image, thereby Reduced the computational pressure of the CPU.
举例而言,待识别图像可以为一张道路监测图像,该道路监测图像中包含一个人和一辆车。那么,协处理器可以识别得到该道路监测图像中包含的一个对象的类别为人,包含的另一个对象的类别为车。并且可以识别得到人的性别属性为女性、衣着颜色属性为蓝色等等,识别得到车的颜色属性为黑色、车型属性为小轿车等等。For example, the image to be identified may be a road monitoring image that includes a person and a car. Then, the coprocessor can recognize that the category of one object included in the road monitoring image is a person, and the category of another object included is a vehicle. And it can be identified that the gender attribute of the person is female, the color attribute of the clothing is blue, and the like, and the color attribute of the vehicle is black, the vehicle attribute is a car, and the like.
该待识别图像可以是CPU通过对原始图像进行预处理后得到的,当然,该待识别图像也可以是CPU接收到的、待识别的原始图像本身,这都是合理的。其中,该预处理对应的操作可以包括:图像格式转换和图像缩放等。这样,通过图像格式转换可以将原始图像转换为内容识别神经网络可识别的图像格式,并通过图像缩放可以将原始图像转换为内容识别神经网络可识别的分辨率,从而使得得到的待识别图像满足内容识别神经网络的图像格式和分辨率要求。当然,该预处理对应的操作还可以包括:对原始图像中的感兴趣区域进行区域提取,得到该感兴趣区域;对原始图像进行去噪处理来提高图像质量等等,这样,可以提高后续对图像进行识别的识别效果。The image to be identified may be obtained by the CPU preprocessing the original image. Of course, the image to be recognized may also be the original image itself to be recognized by the CPU, which is reasonable. The operation corresponding to the preprocessing may include: image format conversion, image scaling, and the like. In this way, the original image can be converted into an image format recognizable by the content recognition neural network by image format conversion, and the original image can be converted into a resolution recognizable by the content recognition neural network by image scaling, so that the obtained image to be recognized is satisfied. Content recognition neural network image format and resolution requirements. Of course, the operation corresponding to the pre-processing may further include: performing region extraction on the region of interest in the original image to obtain the region of interest; performing denoising processing on the original image to improve image quality, etc., thereby improving subsequent pairs. The recognition effect of the image for recognition.
也就是说,可以由CPU对原始图像进行预处理计算,得到待识别图像。然后,可以由协处理器对待识别图像进行识别,得到该待识别图像所包含的对象的类别及属性。这样,当需要进行识别的图像的数量较大时,CPU在对图像进行预处理之后,即可将预处理得到的待识别图像发送至协处理器进行处理。然后,空闲下来的CPU可以开始对下一帧图像进行预处理,使得CPU和协处理器可以实现并行计算,避免了图像需要排队等待CPU进行图像识别所导致的:获得图像识别结果的速度较慢的问题。That is to say, the original image can be preprocessed by the CPU to obtain an image to be identified. Then, the co-processor recognizes the image to be recognized, and obtains the category and attribute of the object included in the image to be recognized. In this way, when the number of images to be identified is large, the CPU can send the pre-processed image to be recognized to the coprocessor for processing after pre-processing the image. Then, the idle CPU can start preprocessing the next frame image, so that the CPU and the coprocessor can realize parallel computing, which avoids the image that needs to be queued for the CPU to perform image recognition: the image recognition result is slower. The problem.
其中,该预先构建的内容识别神经网络可以是基于Faster R-CNN(Faster Region-based Convolutional Network method,更快的基于区域的卷积网络算法)、YOLO(You Only Look Once)算法或SSD(Single Shot MultiBox Detector)算法等人工神经网络算法训练得到的。而且,在训练过程中采用了大量的图像样本,以及每个图像样本中所包含的对象的类别及位置区域对该内容识别神经网络进行训练。因此,该训练得到的内容识别神经网络可以对图像中包含的对象的类别及位置区域进行识别。并且,发明人经过大量实验发现,相 对于通过传统的SVM(Support Vector Machine,支持向量机)算法对图像中所包含的对象的类别进行识别而言,该基于神经网络训练得到内容识别神经网络能够获得更准确的类别、位置区域识别结果。The pre-built content recognition neural network may be based on Faster Region-based Convolutional Network Method (Faster Region-based Convolutional Network Method), YOLO (You Only Look Once) algorithm or SSD (Single) Shot MultiBox Detector) algorithm and other artificial neural network algorithm training. Moreover, a large number of image samples are used in the training process, and the content recognition neural network is trained by the category and location area of the objects included in each image sample. Therefore, the content recognition neural network obtained by the training can identify the category and location area of the object included in the image. Moreover, the inventors have found through a large number of experiments that the content recognition neural network based on neural network training can be compared with the traditional SVM (Support Vector Machine) algorithm for identifying the categories of objects contained in the image. Get more accurate category and location area recognition results.
另外,由于现有技术中是利用人为设定的属性特征,来判断图像中所包含的对象的属性的。例如,人为设定红色对应的颜色取值范围,即人为设定红色的颜色特征,当判断对象的颜色位于该红色对应的颜色取值范围内时,则判断该对象的颜色属性为红色。但是,当该红色对应的颜色取值范围设置不准确时,会导致颜色属性的判断结果并不准确。因此可知,该种属性判断方式的准确度受人为因素影响较大,从而导致属性识别效果并不稳定。In addition, in the prior art, the attribute of an object included in an image is determined by using an attribute feature that is artificially set. For example, the color value range corresponding to the red color is artificially set, that is, the color feature of the red color is artificially set. When the color of the object is determined to be within the range of the color corresponding to the red color, the color attribute of the object is determined to be red. However, when the color range corresponding to the red color is not set accurately, the judgment result of the color attribute is not accurate. Therefore, it can be known that the accuracy of the method for determining the attribute is greatly influenced by the human factor, and the attribute recognition effect is not stable.
而在本申请实施例中,可以基于LeNet、AlexNet或GoogleNet等卷积神经网络算法训练得到属性识别神经网络。并且,由于该属性识别神经网络是通过大量的对象样本,以及每个对象样本的属性训练得到的。因此,该训练得到的属性识别神经网络可以不依赖于人的经验设定属性特征来对图像中所包含的对象的属性进行识别。并且随着训练样本的增多,该属性识别神经网络的识别准确度就越高,识别效果越稳定。In the embodiment of the present application, the attribute recognition neural network can be trained based on a convolutional neural network algorithm such as LeNet, AlexNet, or GoogleNet. And, since the attribute recognition neural network is trained through a large number of object samples, and the attributes of each object sample. Therefore, the attribute-recognition neural network obtained by the training can identify the attributes of the objects contained in the image without depending on the experience setting characteristics of the person. And with the increase of the training samples, the recognition accuracy of the attribute recognition neural network is higher, and the recognition effect is more stable.
当然,在将对象输入至属性识别神经网络进行识别之前,还可以对该对象进行缩放处理,然后将缩放处理后得到的对象输入至该属性识别神经网络进行识别。其中,当对对象进行缩小处理(即进行下采样处理)时,可以降低属性识别神经网络对该对象的数据处理量,从而提高处理速度。当然,也可以对对象进行放大处理,以使放大后的对象的小大与用于训练该属性识别神经网络的对象样本的大小相匹配,从而获得更好的属性识别结果。Of course, before the object is input to the attribute recognition neural network for recognition, the object may be scaled, and then the object obtained by the scaling process is input to the attribute recognition neural network for recognition. Wherein, when the object is reduced (ie, subjected to downsampling processing), the amount of data processing of the object by the attribute recognition neural network can be reduced, thereby improving the processing speed. Of course, it is also possible to enlarge the object so that the size of the enlarged object matches the size of the object sample used to train the attribute recognition neural network, thereby obtaining a better attribute recognition result.
下面结合图2对本申请实施例提供的图像识别方法进行详细说明。The image recognition method provided by the embodiment of the present application will be described in detail below with reference to FIG. 2 .
参见图2,在本申请实施例中,CPU对原始图像进行预处理后,可以得到待识别图像。之后,该CPU可以将该待识别图像发送给协处理器。协处理器在接收该待识别图像后,可以将该待识别图像输入至预先构建的内容识别神经网络。Referring to FIG. 2, in the embodiment of the present application, after the CPU performs pre-processing on the original image, the image to be identified can be obtained. Thereafter, the CPU can send the image to be identified to the coprocessor. After receiving the image to be identified, the coprocessor may input the image to be recognized into a pre-built content recognition neural network.
当该内容识别神经网络除了可以识别图像所包含的对象的类别和位置区 域之外,还可以计算识别得到的每个对象的类别对应的置信度时,该内容识别神经网络可以输出:该待识别图像中所包含的对象1、对象2、对象3、……、对象N-1和对象N的类别、这N个对象在该待识别图像中的位置区域,以及这N个对象中每个对象的类别对应的置信度。其中,置信度是指识别得到的类别的可信度。When the content recognition neural network can calculate the confidence level corresponding to the category of each object obtained by the image in addition to the category and location area of the object included in the image, the content recognition neural network can output: the to-be-identified The object 1, the object 2, the object 3, ..., the object N-1 and the category of the object N included in the image, the position area of the N objects in the image to be recognized, and each of the N objects The confidence level corresponding to the category. Among them, the confidence level refers to the credibility of the identified category.
这样,协处理器可以根据置信度对各个对象进行过滤,具体的过滤方式可以为:判断对象的类别对应的置信度是否大于预设阈值。若大于预设阈值,表明识别得到的、该对象的类别的可信度较高,此时可以继续将该对象输入至预先构建的属性识别神经网络来识别该对象的属性;若小于该预设阈值,表明识别得到的、该对象的类别的可信度不高,此时不将该对象输入至该属性识别神经网络进行后续属性识别。该种方式中,协处理器可以不继续对识别得到的、可信度不高的类别对应的对象的属性进行识别,也就是,可以删除一些不可信的对象,从而可以提高图像识别结果的准确性,并且可以降低协处理器对对象的属性进行识别的识别压力。In this way, the coprocessor can filter each object according to the confidence level. The specific filtering method can be: determining whether the confidence level corresponding to the object category is greater than a preset threshold. If it is greater than the preset threshold, it indicates that the identified category of the object has high credibility. At this time, the object may continue to be input to the pre-built attribute recognition neural network to identify the attribute of the object; if less than the preset The threshold indicates that the credibility of the identified category of the object is not high, and the object is not input to the attribute identifying neural network for subsequent attribute recognition. In this manner, the coprocessor may not continue to identify the attributes of the objects corresponding to the identified and less reliable categories, that is, some untrusted objects may be deleted, thereby improving the accuracy of the image recognition result. Sexuality, and can reduce the recognition pressure of the coprocessor to identify the attributes of the object.
需要说明的是,图2中所示的属性识别神经网络可以是同一个属性识别神经网络,该属性识别神经网络用于对同一种属性特征(例如颜色特征)进行识别。也可以是多个不同的属性识别神经网络,且每个属性识别神经网络用于对一种类别的对象的属性进行识别。例如图2中对象1的类别为车时,对象1对应的属性识别神经网络可以是用于:识别车的颜色特征的属性识别神经网络。对象2的类别为人时,对象2对应的属性识别神经网络可以是用于:识别人的性别特征的属性识别神经网络。It should be noted that the attribute recognition neural network shown in FIG. 2 may be the same attribute recognition neural network, and the attribute recognition neural network is used to identify the same attribute feature (eg, color feature). There may also be a plurality of different attribute recognition neural networks, and each attribute recognition neural network is used to identify attributes of an object of a category. For example, when the category of the object 1 in FIG. 2 is a vehicle, the attribute recognition neural network corresponding to the object 1 may be an attribute recognition neural network for identifying the color characteristics of the vehicle. When the category of the object 2 is a person, the attribute recognition neural network corresponding to the object 2 may be an attribute recognition neural network for identifying the gender feature of the person.
当然,该对象1和对象2对应的属性识别网络也可以是多个。例如,对象1对应的属性识别神经网络可以是:识别车的颜色特征的属性识别神经网络,以及,识别车的车型特征的属性识别神经网络,当然并不局限于此。Of course, the attribute identification network corresponding to the object 1 and the object 2 may also be multiple. For example, the attribute recognition neural network corresponding to the object 1 may be an attribute recognition neural network that recognizes the color characteristics of the vehicle, and an attribute recognition neural network that identifies the vehicle type characteristics of the vehicle, and is of course not limited thereto.
这样,可以针对不同类别的对象设置不同的属性识别网络,同时设置每种对象可以对应有多个属性识别网络,使得可以对对象的多个属性进行识别,从而可以获得更丰富的属性信息。In this way, different attribute recognition networks can be set for different categories of objects, and each object can be set to have multiple attribute recognition networks, so that multiple attributes of the object can be identified, so that richer attribute information can be obtained.
其中,确定对象1对应的属性识别神经网络的方式为:在确定得到对象1的类别为车后,基于预设关系中记录的:类别车与识别车的颜色特征的属性 识别神经网络,以及,识别车的车型特征的属性识别神经网络的对应关系,确定得到该对象1对应的属性识别神经网络。其中,本领域技术人员可以根据实际需求来设置该属性识别神经网络,在此不做一一举例说明。The method for determining the attribute corresponding to the object 1 to identify the neural network is: after determining that the category of the object 1 is a vehicle, the neural network is identified based on the attribute of the color characteristic of the category car and the identification vehicle recorded in the preset relationship, and The attribute identifying the vehicle type feature of the vehicle identifies the correspondence relationship of the neural network, and determines the attribute recognition neural network corresponding to the object 1. The attribute recognition neural network can be set by a person skilled in the art according to actual needs, and is not illustrated here.
当然,也可以结合图3所示的示意图,对本申请实施例提供的图像识别方法进行说明。Of course, the image recognition method provided by the embodiment of the present application may also be described in conjunction with the schematic diagram shown in FIG. 3 .
参见图3,假设摄像机源源不断地向该电子设备中的CPU发送需要识别的图像帧。并且,CPU在对接收到的第N-1帧图像进行预处理后,可得到第N-1帧图像对应的待识别图像。之后,该CPU将该待识别图像传输至协处理器,该协处理器对该第N-1帧图像对应的待识别图像进行识别,识别得到该待识别图像所包含的对象的位置区域、类别及属性,并将该识别得到的对象的位置区域、类别及属性返回给CPU,以使该CPU将接收到的对象的位置区域、类别及属性作为该待识别图像的图像识别结果。Referring to FIG. 3, it is assumed that the camera continuously transmits an image frame to be identified to the CPU in the electronic device. Moreover, after preprocessing the received N-1th frame image, the CPU can obtain an image to be recognized corresponding to the image of the N-1th frame. Afterwards, the CPU transmits the image to be identified to the coprocessor, and the coprocessor identifies the image to be identified corresponding to the image of the N-1th frame, and identifies the location area and the category of the object included in the image to be recognized. And an attribute, and returning the identified location area, category, and attribute of the object to the CPU, so that the CPU uses the location area, category, and attribute of the received object as the image recognition result of the image to be recognized.
在将该待识别图像传输至协处理器后,该CPU可以继续对接收到的第N帧图像进行预处理,并将得到的第N帧图像对应的待识别图像发送至协处理器,以使协处理器对该第N帧图像对应的待识别图像进行识别。按照该种方式,CPU和协处理器可以对图像进行异步协同处理,提高了电子设备对图像的识别速度。After transmitting the image to be identified to the coprocessor, the CPU may continue to preprocess the received image of the Nth frame, and send the image to be identified corresponding to the obtained image of the Nth frame to the coprocessor, so that The coprocessor identifies the image to be identified corresponding to the image of the Nth frame. According to this method, the CPU and the coprocessor can perform asynchronous cooperative processing on the image, thereby improving the recognition speed of the image by the electronic device.
另外,当协处理器需要对较多对象的属性进行识别时,可以采用如图4所示的图像识别方式来提高图像识别的速度。In addition, when the coprocessor needs to identify the attributes of more objects, the image recognition method as shown in FIG. 4 can be used to improve the speed of image recognition.
参见图4,假设协处理器接收到CPU发送的、第N-1帧图像对应的待识别图像。此时,该协处理器可以将该第N-1帧图像对应的待识别图像,输入至预先构建的内容识别神经网络中,识别得到该待识别图像所包含的对象的类别和位置区域。并假设协处理器在识别得到该待识别图像所包含的对象的类别和位置区域之后,还需要对识别得到的对象中较多对象的属性进行识别。此时,可以将该待识别图像所包含的对象分为两组,得到第一组对象和第二组对象。然后,协处理器可以对计算量较多的第一组对象的属性进行识别,具 体地,协处理器可以将该第一组对象中每个对象的位置区域对应的图像块输入至:该对象对应的属性识别神经网络,得到该第一组对象中每个对象的属性。Referring to FIG. 4, it is assumed that the coprocessor receives the image to be recognized corresponding to the image of the N-1th frame transmitted by the CPU. At this time, the coprocessor can input the image to be recognized corresponding to the image of the N-1th frame into the pre-constructed content recognition neural network, and identify the category and the location area of the object included in the image to be recognized. It is also assumed that after the coprocessor recognizes the category and location area of the object included in the image to be identified, it also needs to identify the attributes of more objects in the identified object. At this time, the objects included in the image to be identified may be divided into two groups, and the first group of objects and the second group of objects are obtained. Then, the coprocessor can identify the attributes of the first group of objects that are more computationally intensive. Specifically, the coprocessor can input the image blocks corresponding to the location area of each object in the first group of objects to: the object The corresponding attribute identifies the neural network, and the attributes of each object in the first set of objects are obtained.
并且,协处理器可以将计算量较少的第二组对象的属性识别任务,迁移至CPU进行计算。具体地,协处理器将第二组对象中每个对象的位置区域发送至CPU,以使CPU将第二组对象中每个对象的位置区域对应的图像块输入至:该对象对应的属性识别神经网络,得到第二组对象中每个对象的属性。Moreover, the coprocessor can migrate the attribute recognition task of the second group of objects with less computational load to the CPU for calculation. Specifically, the coprocessor sends a location area of each object in the second group of objects to the CPU, so that the CPU inputs the image block corresponding to the location area of each object in the second group of objects to: attribute recognition corresponding to the object The neural network gets the properties of each object in the second set of objects.
这样,可以充分发挥CPU和协处理器各自的计算能力,具备较高的属性识别速度。并且,使得当协处理器的属性识别压力较大时,可以将一部分属性识别任务发送给CPU来进行处理,避免了协处理器计算压力较大而CPU出现等待的情况发生。In this way, the computing power of the CPU and the coprocessor can be fully utilized, and the attribute recognition speed is high. Moreover, when the attribute recognition pressure of the coprocessor is large, a part of the attribute recognition task can be sent to the CPU for processing, which avoids the situation that the coprocessor calculation pressure is large and the CPU waits.
然后,协处理器可以将计算得到的第一组对象中每个对象的类别及属性,以及第二组对象中每个对象的类别发送至CPU,使得CPU将第一组对象中每个对象的类别及属性,和第二组对象中每个对象的类别及属性进行汇总,得到该待识别图像的图像识别结果。Then, the coprocessor can send the calculated category and attribute of each object in the first group of objects, and the category of each object in the second group of objects to the CPU, so that the CPU will each object in the first group of objects The category and the attribute are summarized with the category and attribute of each object in the second group of objects to obtain an image recognition result of the image to be recognized.
其中,将该待识别图像所包含的对象分为两组的分组方式可以为:从该待识别图像所包含的对象中选择出预设数量个对象,作为第一组对象,剩余对象作为第二组对象;或者,将该待识别图像所包含的对象中为第一预设类别(例如类别车)的对象,作为第一组对象,将该待识别图像所包含的对象中不为该第一预设类别的对象,作为第二组对象,这都是合理的。The grouping manner of dividing the object included in the image to be identified into two groups may be: selecting a preset number of objects from the objects included in the image to be identified, as the first group of objects, and remaining objects as the second group. a group object; or, the object included in the image to be recognized is a first preset category (for example, a category car), as the first group of objects, and the object included in the image to be recognized is not the first object It is reasonable to preset the object of the category as the second group of objects.
此外,当协处理器需要对一个对象的多种属性进行识别时,还可以采用如图5所示的图像识别方式来提高图像识别的速度。In addition, when the coprocessor needs to recognize multiple attributes of an object, an image recognition method as shown in FIG. 5 can also be used to improve the speed of image recognition.
参见图5,假设协处理器在识别得到第N-1帧图像对应的该待识别图像所包含的对象的类别和位置区域之后,还需要对识别得到的、类别为第二预设类别的对象的多种属性进行识别。Referring to FIG. 5, it is assumed that after the coprocessor recognizes the category and location area of the object included in the image to be identified corresponding to the image of the N-1th frame, the identified object of the second preset category is also needed. Multiple attributes are identified.
例如第二预设类别为车,那么,在识别得到对象为车,以及车的位置区域之后,还需要对类别为车的对象的颜色、车型等多种属性进行识别。但是, 对不为第二预设类别(例如类别为人)的对象,仅需对颜色属性进行识别。那么,可以将车型属性作为第一类属性,将颜色属性作为第二类属性。For example, after the second preset category is a car, after identifying the object as the vehicle and the location area of the vehicle, it is also necessary to identify various attributes such as the color and the model of the object of the category. However, for objects that are not in the second preset category (for example, the category is a person), only the color attributes need to be identified. Then, you can use the car type attribute as the first type attribute and the color attribute as the second type attribute.
在属性识别过程中,可以将类别为车的每个对象(即类别为第二预设类别的对象)作为一个第一对象。并且,可以将识别得到的、类别为第二预设类别的每个第一对象的位置区域发送至CPU,以使CPU将每个第一对象的位置区域对应的图像块输入至:该第一对象对应的属性识别神经网络中的第一类属性识别神经网络(即用于识别车的车型的属性识别神经网络),得到每个第一对象的第一类属性。这样,使得当协处理器的属性识别压力较大时,可以将一部分属性识别任务发送给CPU来进行处理,避免了协处理器计算压力较大而CPU出现等待的情况发生,提高了图像识别速度。In the attribute recognition process, each object whose category is a car (ie, an object whose category is the second preset category) can be regarded as a first object. And, the identified location area of each first object of the second preset category is sent to the CPU, so that the CPU inputs the image block corresponding to the location area of each first object to: the first The attribute corresponding to the object identifies the first type of attribute recognition neural network in the neural network (ie, the attribute recognition neural network for identifying the vehicle type of the vehicle), and obtains the first type of attribute of each first object. In this way, when the attribute recognition pressure of the coprocessor is large, a part of the attribute recognition task can be sent to the CPU for processing, which avoids the situation that the coprocessor calculation pressure is large and the CPU waits, which improves the image recognition speed. .
而对于协处理器而言,协处理器还可以将类别为第二预设类别的每个第一对象的位置区域对应的图像块输入至:该第一对象对应的属性识别神经网络中的第二类属性识别神经网络(即用于识别车的颜色的属性识别神经网络),得到每个第一对象的第二类属性。同时,协处理器也可以将类别不为车的每个对象(即类别不为第二预设类别的对象)作为一个第二对象,并且,将类别不为第二预设类别的第二对象(例如类别为人的对象)的位置区域对应的图像块输入至:该第二对象对应的属性识别神经网络中的第二类属性识别神经网络(即用于识别人的头发的颜色的属性识别神经网络),得到每个第二对象的第二类属性。And for the coprocessor, the coprocessor may further input the image block corresponding to the location area of each first object of the second preset category to: the attribute of the first object corresponding to the identifier in the neural network The second type of attribute identifies the neural network (ie, the attribute recognition neural network used to identify the color of the car) to obtain a second type of attribute for each first object. Meanwhile, the coprocessor may also treat each object whose category is not the vehicle (ie, the object whose category is not the second preset category) as a second object, and the second object whose category is not the second preset category. The image block corresponding to the location area of the object (for example, the object of the category) is input to: the second type of attribute recognition neural network in the attribute recognition neural network corresponding to the second object (ie, the attribute recognition nerve for identifying the color of the human hair) Network), get the second type of property for each second object.
然后,协处理器可以将识别得到的、每个第一对象的第二类属性和类别,以及每个第二对象的第二类属性和类别发送至CPU,以使CPU将每个第一对象的第一类属性、第二类属性和类别,以及每个第二对象的第二类属性及类别进行汇总,从而得到待识别图像的图像识别结果。Then, the coprocessor can send the identified second type of attributes and categories of each first object, and the second type of attributes and categories of each second object to the CPU, so that the CPU will each of the first objects The first type attribute, the second type attribute and the category, and the second type attribute and category of each second object are summarized to obtain an image recognition result of the image to be recognized.
例如,可以根据实际需求来训练该第一类属性识别神经网络和第二类属性识别神经网络。示例性地,该第一类属性识别神经网络中可以包括第一数量个属性识别神经网络,该第一数量个属性识别神经网络中的每个属性识别神经网络用于识别同一类别对象的不同属性。该第二类属性识别神经网络中可以包括第二数量个属性识别神经网络,该第二数量个属性识别神经网络中的每个属性识别神经网络用于识别同一类别对象的不同属性。且该第一类属 性识别神经网络所识别的属性与该第二类属性识别神经网络所识别的属性并不相同。For example, the first type of attribute recognition neural network and the second type of attribute recognition neural network can be trained according to actual needs. Illustratively, the first type of attribute recognition neural network may include a first number of attribute recognition neural networks, each of the first number of attribute recognition neural network identifiers used to identify different attributes of the same category object . The second type of attribute recognition neural network may include a second number of attribute recognition neural networks that identify each attribute in the neural network to identify different attributes of the same category object. And the attribute identified by the first type of attribute recognition neural network is not the same as the attribute identified by the second type of attribute recognition neural network.
另外,第二预设类别也可以根据实际情况进行设定,在此不做限定。In addition, the second preset category may also be set according to actual conditions, and is not limited herein.
综上,应用本申请实施例,可以对图像所包含的对象的位置区域、类别及属性进行识别,并可以降低CPU的计算压力,并可以提高图像识别效果和图像识别速度。In summary, the embodiment of the present application can identify the location area, category, and attributes of the object included in the image, and can reduce the calculation pressure of the CPU, and can improve the image recognition effect and the image recognition speed.
相应于上述方法实施例,本申请实施例还提供了一种电子设备,如图6所示,该电子设备600包括协处理器601和中央处理器CPU602;Corresponding to the above method embodiment, the embodiment of the present application further provides an electronic device, as shown in FIG. 6, the electronic device 600 includes a coprocessor 601 and a central processing unit CPU 602;
CPU602,用于向协处理器601发送待识别图像;The CPU 602 is configured to send the image to be identified to the coprocessor 601.
协处理器601,用于接收CPU602发送的待识别图像;The coprocessor 601 is configured to receive an image to be identified sent by the CPU 602.
协处理器601,还用于将待识别图像输入至预先构建的内容识别神经网络,获得内容识别结果,内容识别结果中包括:待识别图像所包含的对象的类别及位置区域;The coprocessor 601 is further configured to input the image to be recognized to the pre-constructed content recognition neural network to obtain a content recognition result, where the content recognition result includes: a category and a location area of the object included in the image to be identified;
协处理器601,还用于将得到的每个位置区域对应的图像块输入至预先构建的属性识别神经网络,获得每个对象的属性;The coprocessor 601 is further configured to input the obtained image block corresponding to each location area to a pre-built attribute recognition neural network to obtain an attribute of each object;
协处理器601,还用于将得到的每个对象的类别及属性发送给CPU602;The coprocessor 601 is further configured to send the obtained category and attribute of each object to the CPU 602;
CPU602,还用于接收协处理器601发送的每个对象的类别及属性,并将接收到的对象的类别及属性,作为待识别图像的图像识别结果。The CPU 602 is further configured to receive the category and attribute of each object sent by the coprocessor 601, and use the category and attribute of the received object as the image recognition result of the image to be identified.
在本申请实施例中,电子设备中的协处理器可以接收该电子设备中的CPU发送的待识别图像,并可以将该待识别图像输入至预先构建的内容识别神经网络中,从而获得该待识别图像中所包含的对象的类别及位置区域。然后,该协处理器将得到的每个位置区域对应的图像块输入至预先构建的属性识别神经网络中,从而可以获得每个对象的属性。进而,协处理器可以将得到的每个对象的类别及属性发送给CPU,使得CPU可以将接收得到的对象的类 别及属性,作为该待识别图像的图像识别结果。该种方式中,协处理器可以借助内容识别神经网络和属性识别神经网络,对该待识别图像中所包含的对象的类别及属性进行准确识别,分担了CPU对图像进行识别的计算压力,从而降低了CPU的计算压力。In the embodiment of the present application, the coprocessor in the electronic device may receive the image to be recognized sent by the CPU in the electronic device, and input the image to be recognized into the pre-built content recognition neural network, thereby obtaining the to-be-identified image. Identify the category and location area of the object contained in the image. Then, the coprocessor inputs the obtained image blocks corresponding to each location area into the pre-built attribute recognition neural network, so that the attributes of each object can be obtained. Further, the coprocessor can send the obtained category and attribute of each object to the CPU, so that the CPU can use the type and attribute of the received object as the image recognition result of the image to be recognized. In this manner, the coprocessor can identify the type and attribute of the object included in the image to be identified by using the content recognition neural network and the attribute recognition neural network, and share the calculation pressure of the CPU to recognize the image, thereby Reduced the computational pressure of the CPU.
可选地,协处理器601具体可以用于:Optionally, the coprocessor 601 can be specifically configured to:
基于预设映射关系和待识别图像所包含的每个对象的类别,确定每个对象对应的属性识别神经网络;其中,预设映射关系包括:预设的类别和预先构建的属性识别神经网络之间的对应关系;将得到的每个位置区域对应的图像块输入至:该对象对应的属性识别神经网络,得到每个对象的属性。Determining an attribute recognition neural network corresponding to each object based on a preset mapping relationship and a category of each object included in the image to be identified; wherein the preset mapping relationship comprises: a preset category and a pre-built attribute recognition neural network Correspondence between the two; input the image block corresponding to each location area to: the attribute corresponding to the object identifies the neural network, and obtains the attribute of each object.
更具体地,协处理器601具体可以用于:More specifically, the coprocessor 601 can be specifically used to:
将待识别图像所包含的对象分为两组,得到第一组对象和第二组对象;基于第一组对象中每个对象的位置,将第一组对象中每个对象的位置区域对应的图像块输入至:该对象对应的属性识别神经网络,得到第一组对象中每个对象的属性;将第二组对象中每个对象的位置区域发送至CPU;Dividing the objects included in the image to be identified into two groups, obtaining a first group of objects and a second group of objects; and correspondingly determining a location area of each object in the first group of objects based on a position of each object in the first group of objects The image block is input to: the attribute corresponding to the object identifies the neural network, and obtains the attribute of each object in the first group of objects; and sends the location area of each object in the second group of objects to the CPU;
相应地,CPU602具体可以用于:将第二组对象中每个对象的位置区域对应的图像块输入至:该对象对应的属性识别神经网络,得到第二组对象中每个对象的属性;将第一组对象中每个对象的类别及属性,和第二组对象中每个对象的类别及属性,作为待识别图像的图像识别结果。Correspondingly, the CPU 602 may be configured to: input an image block corresponding to a location area of each object in the second group of objects to: an attribute identifying the neural network corresponding to the object, and obtain an attribute of each object in the second group of objects; The category and attribute of each object in the first group of objects, and the category and attribute of each object in the second group of objects, as the image recognition result of the image to be recognized.
可选地,协处理器601具体可以用于:Optionally, the coprocessor 601 can be specifically configured to:
从待识别图像所包含的对象中选择出预设数量个对象,作为第一组对象,剩余对象作为第二组对象;或者,将待识别图像中第一预设类别的对象,作为第一组对象,将待识别图像中不为第一预设类别的对象,作为第二组对象。Selecting a preset number of objects from the objects included in the image to be identified, as the first group of objects, and the remaining objects as the second group of objects; or, as the first group, the objects of the first preset category in the image to be identified The object is an object that is not the first preset category in the image to be identified as the second group of objects.
可选地,协处理器601具体可以用于:Optionally, the coprocessor 601 can be specifically configured to:
将待识别图像所包含的对象中为第二预设类别的每个第一对象的位置区域发送至CPU;将每个第一对象输入至:该第一对象对应的属性识别神经网络中的第二类属性识别神经网络,得到每个第一对象的第二类属性;将待识别图像所包含的对象中不为第二预设类别的每个第二对象的位置区域对应的 图像块,输入至:该第二对象对应的属性识别神经网络中的第二类属性识别神经网络,得到每个第二对象的第二类属性;将每个第一对象的第二类属性和类别,及每个第二对象的第二属性和类别发送至CPU;Transmitting, to the CPU, a location area of each of the objects of the second preset category among the objects included in the image to be identified; inputting each of the first objects to: an attribute in the neural network corresponding to the first object The second type of attribute identifies the neural network, and obtains a second type of attribute of each of the first objects; and inputs an image block corresponding to the position area of each second object that is not the second preset category among the objects included in the image to be identified. To: the second object of the second object identifies the second type of attribute in the neural network to identify the neural network, and obtains the second type of attribute of each second object; the second type of attribute and category of each first object, and each The second attribute and category of the second object are sent to the CPU;
相应地,CPU602具体可以用于:将每个第一对象的位置区域对应的图像块输入至:该第一对象对应的属性识别神经网络中的第一类属性识别神经网络,得到每个第一对象的第一类属性;将每个第一对象的第一类属性、第二类属性和类别,以及每个第二对象的第二类属性及类别,作为待识别图像的图像识别结果。Correspondingly, the CPU 602 is specifically configured to: input an image block corresponding to the location area of each first object to: the first type of attribute recognition neural network in the attribute recognition neural network corresponding to the first object, and obtain each first The first type of attributes of the object; the first type attribute, the second type attribute and the category of each first object, and the second type attribute and category of each second object are used as image recognition results of the image to be recognized.
可选地,协处理器601具体可以用于:Optionally, the coprocessor 601 can be specifically configured to:
将得到的每个对象的位置区域、类别及属性发送给CPU;Sending the obtained location area, category, and attribute of each object to the CPU;
相应地,CPU602具体可以用于:将接收到的对象的位置区域、类别及属性,作为待识别图像的图像识别结果。Correspondingly, the CPU 602 may be specifically configured to: use the location area, the category, and the attribute of the received object as the image recognition result of the image to be identified.
可选地,内容识别神经网络还用于识别图像所包含的对象的类别对应的置信度;内容识别结果中还包括:图像所包含的对象的类别对应的置信度;Optionally, the content recognition neural network is further configured to identify a confidence level corresponding to a category of the object included in the image; and the content recognition result further includes: a confidence level corresponding to the category of the object included in the image;
协处理器601还可以用于:在将得到的每个位置区域对应的图像块输入至预先构建的属性识别神经网络,获得每个对象的属性之前,判断得到的置信度是否大于预设阈值;若是,将大于预设阈值的置信度对应的对象,作为筛选后的对象;将筛选后的每个对象的位置区域对应的图像块发送至预先构建的属性识别神经网络进行属性识别,得到筛选后的每个对象的属性;将得到的筛选后的每个对象的类别及属性发送给CPU。The coprocessor 601 is further configured to: input the image block corresponding to each of the obtained location areas to the pre-built attribute recognition neural network, and determine whether the obtained confidence level is greater than a preset threshold before obtaining the attribute of each object; If yes, the object corresponding to the confidence level greater than the preset threshold is used as the filtered object; the image block corresponding to the selected location area of each object is sent to the pre-built attribute recognition neural network for attribute recognition, and after screening The properties of each object; the selected categories and attributes of each object after filtering are sent to the CPU.
可选地,协处理器601包括图形处理器GPU、数字信号处理器DSP和现场可编程门阵列处理器FPGA中的至少一种。Optionally, the coprocessor 601 includes at least one of a graphics processor GPU, a digital signal processor DSP, and a field programmable gate array processor FPGA.
可选地,在本申请实施例中,协处理器601具体可以用于:Optionally, in the embodiment of the present application, the coprocessor 601 may be specifically configured to:
将得到的每个位置区域对应的图像块进行缩放处理;将缩放处理后得到的每个图像块输入至预先构建的属性识别神经网络,获得每个对象的属性。The obtained image blocks corresponding to each location area are subjected to scaling processing; each image block obtained after the scaling processing is input to a pre-built attribute recognition neural network to obtain attributes of each object.
可选地,在本申请实施例中,CPU602还可以用于:Optionally, in the embodiment of the present application, the CPU 602 is further configured to:
对原始图像进行图像格式转换和缩放处理,获得待识别图像。Image format conversion and scaling processing is performed on the original image to obtain an image to be recognized.
相应于上述方法实施例,本申请实施例还提供了一种可读存储介质,该可读存储介质为包括协处理器和中央处理器CPU的电子设备中的存储介质,该可读存储介质内存储有计算机程序,计算机程序被协处理器执行时实现如下步骤:Corresponding to the above method embodiment, the embodiment of the present application further provides a readable storage medium, which is a storage medium in an electronic device including a coprocessor and a central processing unit CPU, and the readable storage medium A computer program is stored, and when the computer program is executed by the coprocessor, the following steps are implemented:
接收由CPU发送的待识别图像;将待识别图像输入至预先构建的内容识别神经网络,获得内容识别结果,内容识别结果中包括:待识别图像所包含的对象的类别及位置区域;将得到的每个位置区域对应的图像块输入至预先构建的属性识别神经网络,获得每个对象的属性;将得到的每个对象的类别及属性发送给CPU,以使CPU将接收到的对象的类别及属性,作为待识别图像的图像识别结果。Receiving an image to be recognized sent by the CPU; inputting the image to be recognized into a pre-constructed content recognition neural network, and obtaining a content recognition result, where the content recognition result includes: a category and a location area of the object included in the image to be recognized; The image blocks corresponding to each location area are input to a pre-built attribute recognition neural network to obtain attributes of each object; the obtained category and attributes of each object are sent to the CPU, so that the CPU will receive the type of the object and Attribute as the result of image recognition of the image to be recognized.
可选地,将得到的每个位置区域对应的图像块输入至预先构建的属性识别神经网络,获得每个对象的属性的步骤,可以包括:Optionally, the step of inputting the image block corresponding to each location area to the pre-built attribute recognition neural network to obtain the attribute of each object may include:
基于预设映射关系和待识别图像所包含的每个对象的类别,确定每个对象对应的属性识别神经网络;其中,预设映射关系包括:预设的类别和预先构建的属性识别神经网络之间的对应关系;将得到的每个位置区域对应的图像块输入至:该对象对应的属性识别神经网络,得到每个对象的属性。Determining an attribute recognition neural network corresponding to each object based on a preset mapping relationship and a category of each object included in the image to be identified; wherein the preset mapping relationship comprises: a preset category and a pre-built attribute recognition neural network Correspondence between the two; input the image block corresponding to each location area to: the attribute corresponding to the object identifies the neural network, and obtains the attribute of each object.
可选地,将得到的每个位置区域对应的图像块输入至:该对象对应的属性识别神经网络,得到每个对象的属性的步骤,可以包括:Optionally, the obtained image block corresponding to each location area is input to: the attribute corresponding to the object identifies the neural network, and the step of obtaining the attribute of each object may include:
将待识别图像所包含的对象分为两组,得到第一组对象和第二组对象;将第一组对象中每个对象的位置区域对应的对象输入至:该对象对应的属性识别神经网络,得到第一组对象中每个对象的属性;将第二组对象中每个对象的位置区域发送至CPU,以使CPU将第二组对象中每个对象的位置区域对应的图像块,输入至:该对象对应的属性识别神经网络,得到第二组对象中每个对象的属性;The objects included in the image to be identified are divided into two groups to obtain a first group of objects and a second group of objects; and an object corresponding to a location area of each object in the first group of objects is input to: an attribute recognition neural network corresponding to the object Obtaining an attribute of each object in the first group of objects; sending a location area of each object in the second group of objects to the CPU, so that the CPU inputs the image block corresponding to the location area of each object in the second group of objects To: the attribute corresponding to the object identifies the neural network, and obtains the attribute of each object in the second group of objects;
相应地,将得到的每个对象的类别及属性发送给CPU的步骤,可以包括:Correspondingly, the step of sending the obtained category and attribute of each object to the CPU may include:
将第一组对象中每个对象的类别及属性,第二组对象中每个对象的类别发送至CPU,以使CPU将第一组对象中每个对象的类别及属性,和第二组对象中每个对象的类别及属性,作为待识别图像的图像识别结果。Sending the category and attribute of each object in the first group of objects, the category of each object in the second group of objects to the CPU, so that the CPU will classify the category and attribute of each object in the first group of objects, and the second group of objects The category and attribute of each object in the image as the result of image recognition of the image to be recognized.
可选地,将待识别图像所包含的对象分为两组,得到第一组对象和第二组对象的步骤,可以包括:Optionally, the step of dividing the objects included in the image to be identified into two groups, and obtaining the first group of objects and the second group of objects may include:
从待识别图像所包含的对象中选择出预设数量个对象,作为第一组对象,剩余对象作为第二组对象;或者,将待识别图像中第一预设类别的对象,作为第一组对象,将待识别图像中不为第一预设类别的对象,作为第二组对象。Selecting a preset number of objects from the objects included in the image to be identified, as the first group of objects, and the remaining objects as the second group of objects; or, as the first group, the objects of the first preset category in the image to be identified The object is an object that is not the first preset category in the image to be identified as the second group of objects.
可选地,将得到的每个位置区域对应的图像块输入至:该对象对应的属性识别神经网络,得到每个对象的属性的步骤,可以包括:Optionally, the obtained image block corresponding to each location area is input to: the attribute corresponding to the object identifies the neural network, and the step of obtaining the attribute of each object may include:
将待识别图像所包含的对象中为第二预设类别的每个第一对象的位置区域发送至CPU,以使CPU将每个第一对象的位置区域对应的图像块输入至:该第一对象对应的属性识别神经网络中的第一类属性识别神经网络,得到每个第一对象的第一类属性;将每个第一对象的位置区域对应的图像块输入至:该第一对象对应的属性识别神经网络中的第二类属性识别神经网络,得到每个第一对象的第二类属性;将待识别图像所包含的对象中不为第二预设类别的每个第二对象的位置区域对应的图像块,输入至:该第二对象对应的属性识别神经网络中的第二类属性识别神经网络,得到每个第二对象的第二类属性;Sending, to the CPU, a location area of each of the objects of the second preset category among the objects included in the image to be identified, so that the CPU inputs the image block corresponding to the location area of each first object to: the first The attribute corresponding to the object identifies the first type of attribute recognition neural network in the neural network, and obtains the first type attribute of each first object; the image block corresponding to the position area of each first object is input to: the first object corresponds to The second type of attribute recognition neural network in the attribute recognition neural network obtains the second type attribute of each first object; the second object of the second preset category is not included in the object to be recognized An image block corresponding to the location area is input to: a second type of attribute recognition neural network in the attribute recognition neural network corresponding to the second object, to obtain a second type attribute of each second object;
相应地,将得到的每个对象的类别和属性发送给CPU的步骤,可以包括:Correspondingly, the step of sending the obtained category and attribute of each object to the CPU may include:
将每个第一对象的第二类属性和类别,及每个第二对象的第二属性和类别发送至CPU,以使CPU将每个第一对象的第一类属性、第二类属性和类别,以及每个第二对象的第二类属性及类别,作为待识别图像的图像识别结果。Sending a second type of attribute and category of each first object, and a second attribute and category of each second object to the CPU, so that the CPU will first class attribute, second type attribute, and The category, and the second type of attribute and category of each second object, are the image recognition results of the image to be recognized.
可选地,将得到的每个对象的类别及属性发送给CPU,以使CPU将接收到的对象的类别及属性,作为待识别图像的图像识别结果的步骤,可以包括:Optionally, the step of sending the obtained category and the attribute of each object to the CPU, so that the CPU uses the category and the attribute of the received object as the image recognition result of the image to be identified, may include:
将得到的每个对象的位置区域、类别及属性发送给CPU,以使CPU将接收到的对象的位置区域、类别及属性,作为待识别图像的图像识别结果。The obtained location area, category, and attribute of each object are sent to the CPU, so that the CPU determines the location area, category, and attribute of the received object as the image recognition result of the image to be recognized.
可选地,内容识别神经网络还用于识别图像所包含的对象的类别对应的置信度;内容识别结果中还包括:图像所包含的对象的类别对应的置信度;Optionally, the content recognition neural network is further configured to identify a confidence level corresponding to a category of the object included in the image; and the content recognition result further includes: a confidence level corresponding to the category of the object included in the image;
在将得到的每个位置区域对应的图像块输入至预先构建的属性识别神经 网络,获得每个对象的属性之前,该方法还可以包括:Before the image blocks corresponding to each of the obtained location areas are input to the pre-built attribute recognition neural network to obtain the attributes of each object, the method may further include:
判断得到的置信度是否大于预设阈值;若是,将大于预设阈值的置信度对应的对象,作为筛选后的对象;Determining whether the obtained confidence is greater than a preset threshold; if yes, the object corresponding to the confidence level greater than the preset threshold is used as the filtered object;
相应地,将得到的每个位置区域对应的图像块输入至预先构建的属性识别神经网络,获得每个对象的属性的步骤,可以包括:Correspondingly, the step of inputting the image block corresponding to each location area to the pre-built attribute recognition neural network to obtain the attribute of each object may include:
将筛选后的每个对象的位置区域对应的图像块发送至预先构建的属性识别神经网络进行属性识别,得到筛选后的每个对象的属性;Sending the image block corresponding to the selected location area of each object to the pre-built attribute recognition neural network for attribute recognition, and obtaining the attribute of each object after the screening;
相应地,将得到的每个对象的类别及属性发送给CPU的步骤,可以包括:Correspondingly, the step of sending the obtained category and attribute of each object to the CPU may include:
将得到的筛选后的每个对象的类别及属性发送给CPU。Send the obtained categories and attributes of each object after filtering to the CPU.
可选地,协处理器包括图形处理器GPU、数字信号处理器DSP和现场可编程门阵列处理器FPGA中的至少一种。Optionally, the coprocessor includes at least one of a graphics processor GPU, a digital signal processor DSP, and a field programmable gate array processor FPGA.
可选地,将得到的每个位置区域对应的图像块输入至预先构建的属性识别神经网络,获得每个对象的属性的步骤,可以包括:Optionally, the step of inputting the image block corresponding to each location area to the pre-built attribute recognition neural network to obtain the attribute of each object may include:
将得到的每个位置区域对应的图像块进行缩放处理;将缩放处理后得到的每个图像块输入至预先构建的属性识别神经网络,获得每个对象的属性。The obtained image blocks corresponding to each location area are subjected to scaling processing; each image block obtained after the scaling processing is input to a pre-built attribute recognition neural network to obtain attributes of each object.
可选地,待识别图像为:CPU对原始图像进行图像格式转换和缩放处理后得到的。Optionally, the image to be identified is obtained by the CPU performing image format conversion and scaling processing on the original image.
应用本申请实施例,可以对图像所包含的对象的类别及属性进行准确识别,并可以降低CPU的计算压力,提高了图像识别效果和图像识别速度。By applying the embodiments of the present application, the categories and attributes of the objects included in the image can be accurately identified, and the calculation pressure of the CPU can be reduced, and the image recognition effect and the image recognition speed are improved.
相应于上述方法实施例,本申请实施例还提供了一种应用程序,当其在包括协处理器和中央处理器CPU的电子设备上运行时,使得该协处理器执行:Corresponding to the above method embodiment, the embodiment of the present application further provides an application that, when running on an electronic device including a coprocessor and a central processing unit CPU, causes the coprocessor to execute:
接收由CPU发送的待识别图像;将待识别图像输入至预先构建的内容识别神经网络,获得内容识别结果,内容识别结果中包括:待识别图像所包含的对象的类别及位置区域;将得到的每个位置区域对应的图像块输入至预先构建的属性识别神经网络,获得每个对象的属性;将得到的每个对象的类别及属性发送给CPU,以使CPU将接收到的对象的类别及属性,作为待识别图 像的图像识别结果。Receiving an image to be recognized sent by the CPU; inputting the image to be recognized into a pre-constructed content recognition neural network, and obtaining a content recognition result, where the content recognition result includes: a category and a location area of the object included in the image to be recognized; The image blocks corresponding to each location area are input to a pre-built attribute recognition neural network to obtain attributes of each object; the obtained category and attributes of each object are sent to the CPU, so that the CPU will receive the type of the object and Attribute as the result of image recognition of the image to be recognized.
可选地,将得到的每个位置区域对应的图像块输入至预先构建的属性识别神经网络,获得每个对象的属性的步骤,可以包括:Optionally, the step of inputting the image block corresponding to each location area to the pre-built attribute recognition neural network to obtain the attribute of each object may include:
基于预设映射关系和待识别图像所包含的每个对象的类别,确定每个对象对应的属性识别神经网络;其中,预设映射关系包括:预设的类别和预先构建的属性识别神经网络之间的对应关系;将得到的每个位置区域对应的图像块输入至:该对象对应的属性识别神经网络,得到每个对象的属性。Determining an attribute recognition neural network corresponding to each object based on a preset mapping relationship and a category of each object included in the image to be identified; wherein the preset mapping relationship comprises: a preset category and a pre-built attribute recognition neural network Correspondence between the two; input the image block corresponding to each location area to: the attribute corresponding to the object identifies the neural network, and obtains the attribute of each object.
可选地,将得到的每个位置区域对应的图像块输入至:该对象对应的属性识别神经网络,得到每个对象的属性的步骤,可以包括:Optionally, the obtained image block corresponding to each location area is input to: the attribute corresponding to the object identifies the neural network, and the step of obtaining the attribute of each object may include:
将待识别图像所包含的对象分为两组,得到第一组对象和第二组对象;将第一组对象中每个对象的位置区域对应的对象输入至:该对象对应的属性识别神经网络,得到第一组对象中每个对象的属性;将第二组对象中每个对象的位置区域发送至CPU,以使CPU将第二组对象中每个对象的位置区域对应的图像块,输入至:该对象对应的属性识别神经网络,得到第二组对象中每个对象的属性;The objects included in the image to be identified are divided into two groups to obtain a first group of objects and a second group of objects; and an object corresponding to a location area of each object in the first group of objects is input to: an attribute recognition neural network corresponding to the object Obtaining an attribute of each object in the first group of objects; sending a location area of each object in the second group of objects to the CPU, so that the CPU inputs the image block corresponding to the location area of each object in the second group of objects To: the attribute corresponding to the object identifies the neural network, and obtains the attribute of each object in the second group of objects;
相应地,将得到的每个对象的类别及属性发送给CPU的步骤,可以包括:Correspondingly, the step of sending the obtained category and attribute of each object to the CPU may include:
将第一组对象中每个对象的类别及属性,第二组对象中每个对象的类别发送至CPU,以使CPU将第一组对象中每个对象的类别及属性,和第二组对象中每个对象的类别及属性,作为待识别图像的图像识别结果。Sending the category and attribute of each object in the first group of objects, the category of each object in the second group of objects to the CPU, so that the CPU will classify the category and attribute of each object in the first group of objects, and the second group of objects The category and attribute of each object in the image as the result of image recognition of the image to be recognized.
可选地,将待识别图像所包含的对象分为两组,得到第一组对象和第二组对象的步骤,可以包括:Optionally, the step of dividing the objects included in the image to be identified into two groups, and obtaining the first group of objects and the second group of objects may include:
从待识别图像所包含的对象中选择出预设数量个对象,作为第一组对象,剩余对象作为第二组对象;或者,将待识别图像中第一预设类别的对象,作为第一组对象,将待识别图像中不为第一预设类别的对象,作为第二组对象。Selecting a preset number of objects from the objects included in the image to be identified, as the first group of objects, and the remaining objects as the second group of objects; or, as the first group, the objects of the first preset category in the image to be identified The object is an object that is not the first preset category in the image to be identified as the second group of objects.
可选地,将得到的每个位置区域对应的图像块输入至:该对象对应的属性识别神经网络,得到每个对象的属性的步骤,可以包括:Optionally, the obtained image block corresponding to each location area is input to: the attribute corresponding to the object identifies the neural network, and the step of obtaining the attribute of each object may include:
将待识别图像所包含的对象中为第二预设类别的每个第一对象的位置区 域发送至CPU,以使CPU将每个第一对象的位置区域对应的图像块输入至:该第一对象对应的属性识别神经网络中的第一类属性识别神经网络,得到每个第一对象的第一类属性;将每个第一对象的位置区域对应的图像块输入至:该第一对象对应的属性识别神经网络中的第二类属性识别神经网络,得到每个第一对象的第二类属性;将待识别图像所包含的对象中不为第二预设类别的每个第二对象的位置区域对应的图像块,输入至:该第二对象对应的属性识别神经网络中的第二类属性识别神经网络,得到每个第二对象的第二类属性;Sending, to the CPU, a location area of each of the objects of the second preset category among the objects included in the image to be identified, so that the CPU inputs the image block corresponding to the location area of each first object to: the first The attribute corresponding to the object identifies the first type of attribute recognition neural network in the neural network, and obtains the first type attribute of each first object; the image block corresponding to the position area of each first object is input to: the first object corresponds to The second type of attribute recognition neural network in the attribute recognition neural network obtains the second type attribute of each first object; the second object of the second preset category is not included in the object to be recognized An image block corresponding to the location area is input to: a second type of attribute recognition neural network in the attribute recognition neural network corresponding to the second object, to obtain a second type attribute of each second object;
相应地,将得到的每个对象的类别和属性发送给CPU的步骤,可以包括:Correspondingly, the step of sending the obtained category and attribute of each object to the CPU may include:
将每个第一对象的第二类属性和类别,及每个第二对象的第二属性和类别发送至CPU,以使CPU将每个第一对象的第一类属性、第二类属性和类别,以及每个第二对象的第二类属性及类别,作为待识别图像的图像识别结果。Sending a second type of attribute and category of each first object, and a second attribute and category of each second object to the CPU, so that the CPU will first class attribute, second type attribute, and The category, and the second type of attribute and category of each second object, are the image recognition results of the image to be recognized.
可选地,将得到的每个对象的类别及属性发送给CPU,以使CPU将接收到的对象的类别及属性,作为待识别图像的图像识别结果的步骤,可以包括:Optionally, the step of sending the obtained category and the attribute of each object to the CPU, so that the CPU uses the category and the attribute of the received object as the image recognition result of the image to be identified, may include:
将得到的每个对象的位置区域、类别及属性发送给CPU,以使CPU将接收到的对象的位置区域、类别及属性,作为待识别图像的图像识别结果。The obtained location area, category, and attribute of each object are sent to the CPU, so that the CPU determines the location area, category, and attribute of the received object as the image recognition result of the image to be recognized.
可选地,内容识别神经网络还用于识别图像所包含的对象的类别对应的置信度;内容识别结果中还包括:图像所包含的对象的类别对应的置信度;Optionally, the content recognition neural network is further configured to identify a confidence level corresponding to a category of the object included in the image; and the content recognition result further includes: a confidence level corresponding to the category of the object included in the image;
在将得到的每个位置区域对应的图像块输入至预先构建的属性识别神经网络,获得每个对象的属性之前,该方法还可以包括:Before the image blocks corresponding to each of the obtained location areas are input to the pre-built attribute recognition neural network to obtain the attributes of each object, the method may further include:
判断得到的置信度是否大于预设阈值;若是,将大于预设阈值的置信度对应的对象,作为筛选后的对象;Determining whether the obtained confidence is greater than a preset threshold; if yes, the object corresponding to the confidence level greater than the preset threshold is used as the filtered object;
相应地,将得到的每个位置区域对应的图像块输入至预先构建的属性识别神经网络,获得每个对象的属性的步骤,可以包括:Correspondingly, the step of inputting the image block corresponding to each location area to the pre-built attribute recognition neural network to obtain the attribute of each object may include:
将筛选后的每个对象的位置区域对应的图像块发送至预先构建的属性识别神经网络进行属性识别,得到筛选后的每个对象的属性;Sending the image block corresponding to the selected location area of each object to the pre-built attribute recognition neural network for attribute recognition, and obtaining the attribute of each object after the screening;
相应地,将得到的每个对象的类别及属性发送给CPU的步骤,可以包括:Correspondingly, the step of sending the obtained category and attribute of each object to the CPU may include:
将得到的筛选后的每个对象的类别及属性发送给CPU。Send the obtained categories and attributes of each object after filtering to the CPU.
可选地,协处理器包括图形处理器GPU、数字信号处理器DSP和现场可编程门阵列处理器FPGA中的至少一种。Optionally, the coprocessor includes at least one of a graphics processor GPU, a digital signal processor DSP, and a field programmable gate array processor FPGA.
可选地,将得到的每个位置区域对应的图像块输入至预先构建的属性识别神经网络,获得每个对象的属性的步骤,可以包括:Optionally, the step of inputting the image block corresponding to each location area to the pre-built attribute recognition neural network to obtain the attribute of each object may include:
将得到的每个位置区域对应的图像块进行缩放处理;将缩放处理后得到的每个图像块输入至预先构建的属性识别神经网络,获得每个对象的属性。The obtained image blocks corresponding to each location area are subjected to scaling processing; each image block obtained after the scaling processing is input to a pre-built attribute recognition neural network to obtain attributes of each object.
可选地,待识别图像为:CPU对原始图像进行图像格式转换和缩放处理后得到的。Optionally, the image to be identified is obtained by the CPU performing image format conversion and scaling processing on the original image.
应用本申请实施例,可以对图像所包含的对象的类别及属性进行准确识别,并可以降低CPU的计算压力,提高了图像识别效果和图像识别速度。By applying the embodiments of the present application, the categories and attributes of the objects included in the image can be accurately identified, and the calculation pressure of the CPU can be reduced, and the image recognition effect and the image recognition speed are improved.
需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should be noted that, in this context, relational terms such as first and second are used merely to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply such entities or operations. There is any such actual relationship or order between them. Furthermore, the term "comprises" or "comprises" or "comprises" or any other variations thereof is intended to encompass a non-exclusive inclusion, such that a process, method, article, or device that comprises a plurality of elements includes not only those elements but also Other elements, or elements that are inherent to such a process, method, item, or device. An element that is defined by the phrase "comprising a ..." does not exclude the presence of additional equivalent elements in the process, method, item, or device that comprises the element.
本说明书中的各个实施例均采用相关的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于电子设备实施例和可读存储介质实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。The various embodiments in the present specification are described in a related manner, and the same or similar parts between the various embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for an electronic device embodiment and a readable storage medium embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment.
以上所述仅为本申请的较佳实施例而已,并非用于限定本申请的保护范围。凡在本申请的精神和原则之内所作的任何修改、等同替换、改进等,均包含在本申请的保护范围内。The above description is only the preferred embodiment of the present application, and is not intended to limit the scope of the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application are included in the scope of the present application.

Claims (22)

  1. 一种图像识别方法,其特征在于,应用于电子设备中的协处理器,所述电子设备中还包括中央处理器CPU,所述方法包括:An image recognition method is characterized in that it is applied to a coprocessor in an electronic device, and the electronic device further includes a central processing unit CPU, and the method includes:
    接收由所述CPU发送的待识别图像;Receiving an image to be recognized transmitted by the CPU;
    将所述待识别图像输入至预先构建的内容识别神经网络,获得内容识别结果,所述内容识别结果中包括:所述待识别图像所包含的对象的类别及位置区域;Inputting the to-be-identified image into a pre-constructed content recognition neural network, and obtaining a content recognition result, where the content recognition result includes: a category and a location area of the object included in the image to be recognized;
    将得到的每个位置区域对应的图像块输入至预先构建的属性识别神经网络,获得每个对象的属性;Inputting the obtained image blocks corresponding to each location area into a pre-built attribute recognition neural network to obtain attributes of each object;
    将得到的每个对象的类别及属性发送给所述CPU,以使所述CPU将接收到的对象的类别及属性,作为所述待识别图像的图像识别结果。Sending the obtained category and attribute of each object to the CPU, so that the CPU uses the category and attribute of the received object as the image recognition result of the image to be recognized.
  2. 根据权利要求1所述的方法,其特征在于,所述将得到的每个位置区域对应的图像块输入至预先构建的属性识别神经网络,获得每个对象的属性的步骤,包括:The method according to claim 1, wherein the step of inputting the obtained image block corresponding to each location area to a pre-built attribute recognition neural network to obtain attributes of each object comprises:
    基于预设映射关系和所述待识别图像所包含的每个对象的类别,确定所述每个对象对应的属性识别神经网络;其中,所述预设映射关系包括:预设的类别和预先构建的属性识别神经网络之间的对应关系;Determining an attribute recognition neural network corresponding to each object according to a preset mapping relationship and a category of each object included in the image to be identified; wherein the preset mapping relationship comprises: a preset category and a pre-built Attributes identify the correspondence between neural networks;
    将得到的每个位置区域对应的图像块输入至:该对象对应的属性识别神经网络,得到每个对象的属性。The obtained image block corresponding to each position area is input to: the attribute corresponding to the object identifies the neural network, and the attribute of each object is obtained.
  3. 根据权利要求2所述的方法,其特征在于,所述将得到的每个位置区域对应的图像块输入至:该对象对应的属性识别神经网络,得到每个对象的属性的步骤,包括:The method according to claim 2, wherein the step of inputting the image block corresponding to each location area to the attribute recognition neural network corresponding to the object, and obtaining the attribute of each object comprises:
    将所述待识别图像所包含的对象分为两组,得到第一组对象和第二组对象;Dividing the objects included in the image to be identified into two groups, and obtaining a first group of objects and a second group of objects;
    将所述第一组对象中每个对象的位置区域对应的图像块输入至:该对象对应的属性识别神经网络,得到所述第一组对象中每个对象的属性;Inputting an image block corresponding to a location area of each object in the first group of objects to: an attribute recognition neural network corresponding to the object, and obtaining an attribute of each object in the first group of objects;
    将所述第二组对象中每个对象的位置区域发送至所述CPU,以使所述CPU 将所述第二组对象中每个对象的位置区域对应的图像块输入至:该对象对应的属性识别神经网络,得到所述第二组对象中每个对象的属性;Sending a location area of each of the second group of objects to the CPU, so that the CPU inputs an image block corresponding to a location area of each object of the second group of objects to: corresponding to the object Attribute recognition neural network, obtaining attributes of each object in the second set of objects;
    所述将得到的每个对象的类别及属性发送给所述CPU的步骤,包括:The step of sending the obtained category and attribute of each object to the CPU includes:
    将所述第一组对象中每个对象的类别及属性,所述第二组对象中每个对象的类别发送至所述CPU,以使所述CPU将所述第一组对象中每个对象的类别及属性,和所述第二组对象中每个对象的类别及属性,作为所述待识别图像的图像识别结果。Transmitting a category and an attribute of each of the first set of objects, a category of each of the second set of objects to the CPU, such that the CPU will each of the first set of objects The category and attribute, and the category and attribute of each object in the second group of objects, as the image recognition result of the image to be recognized.
  4. 根据权利要求3所述的方法,其特征在于,所述将所述待识别图像所包含的对象分为两组,得到第一组对象和第二组对象的步骤,包括:The method according to claim 3, wherein the step of dividing the objects included in the image to be identified into two groups, and obtaining the first group of objects and the second group of objects comprises:
    从所述待识别图像所包含的对象中选择出预设数量个对象,作为第一组对象,剩余对象作为第二组对象;Selecting, from the objects included in the image to be identified, a preset number of objects as the first group of objects, and the remaining objects as the second group of objects;
    或者,or,
    将所述待识别图像中第一预设类别的对象,作为第一组对象,将所述待识别图像中不为所述第一预设类别的对象,作为第二组对象。The object of the first preset category in the image to be identified is used as the first group of objects, and the object that is not the first preset category in the image to be identified is used as the second group of objects.
  5. 根据权利要求2所述的方法,其特征在于,所述将得到的每个位置区域对应的图像块输入至:该对象对应的属性识别神经网络,得到每个对象的属性的步骤,包括:The method according to claim 2, wherein the step of inputting the image block corresponding to each location area to the attribute recognition neural network corresponding to the object, and obtaining the attribute of each object comprises:
    将所述待识别图像所包含的对象中为第二预设类别的每个第一对象的位置区域发送至所述CPU,以使所述CPU将每个第一对象的位置区域对应的图像块输入至:该第一对象对应的属性识别神经网络中的第一类属性识别神经网络,得到每个第一对象的第一类属性;Transmitting, to the CPU, a location area of each of the objects of the second preset category among the objects included in the image to be identified, so that the CPU blocks the image block corresponding to the location area of each first object Inputting: the attribute corresponding to the first object identifies a first type of attribute recognition neural network in the neural network, and obtains a first type attribute of each first object;
    将所述每个第一对象的位置区域对应的图像块输入至:该第一对象对应的属性识别神经网络中的第二类属性识别神经网络,得到每个第一对象的第二类属性;Inputting an image block corresponding to the location area of each of the first objects to: a second type of attribute recognition neural network in the attribute recognition neural network corresponding to the first object, and obtaining a second type attribute of each first object;
    将所述待识别图像所包含的对象中不为所述第二预设类别的每个第二对象的位置区域对应的图像块,输入至:该第二对象对应的属性识别神经网络中的第二类属性识别神经网络,得到每个第二对象的第二类属性;Inputting, in the object included in the image to be recognized, an image block corresponding to a location area of each second object of the second preset category to: an attribute in the attribute recognition neural network corresponding to the second object The second type of attribute identifies the neural network and obtains a second type of attribute of each second object;
    所述将得到的每个对象的类别和属性发送给所述CPU的步骤,包括:The step of sending the obtained category and attribute of each object to the CPU includes:
    将每个第一对象的第二类属性和类别,及每个第二对象的第二属性和类别发送至所述CPU,以使所述CPU将每个第一对象的第一类属性、第二类属性和类别,以及每个第二对象的第二类属性及类别,作为所述待识别图像的图像识别结果。Sending a second type of attribute and category of each first object, and a second attribute and category of each second object to the CPU, such that the CPU will first class attribute of each first object, The second type of attributes and categories, and the second type of attributes and categories of each second object, serve as image recognition results for the image to be identified.
  6. 根据权利要求1-5中任一项所述的方法,其特征在于,所述将得到的每个对象的类别及属性发送给所述CPU,以使所述CPU将接收到的对象的类别及属性,作为所述待识别图像的图像识别结果的步骤,包括:The method according to any one of claims 1 to 5, wherein the class and attribute of each object obtained are sent to the CPU such that the CPU will receive the type of the object and An attribute, as a result of the image recognition result of the image to be identified, comprising:
    将得到的每个对象的位置区域、类别及属性发送给所述CPU,以使所述CPU将接收到的对象的位置区域、类别及属性,作为所述待识别图像的图像识别结果。Sending the obtained location area, category, and attribute of each object to the CPU, so that the CPU uses the location area, category, and attribute of the received object as the image recognition result of the image to be recognized.
  7. 根据权利要求1-5中任一项所述的方法,其特征在于,所述内容识别神经网络还用于识别图像所包含的对象的类别对应的置信度;所述内容识别结果中还包括:所述图像所包含的对象的类别对应的置信度;The method according to any one of claims 1 to 5, wherein the content recognition neural network is further configured to identify a confidence level corresponding to a category of the object included in the image; the content recognition result further includes: a confidence level corresponding to a category of an object included in the image;
    在所述将得到的每个位置区域对应的图像块输入至预先构建的属性识别神经网络,获得每个对象的属性之前,所述方法还包括:Before the image blocks corresponding to each of the obtained location regions are input to the pre-built attribute recognition neural network to obtain the attributes of each object, the method further includes:
    判断得到的置信度是否大于预设阈值;Determining whether the obtained confidence is greater than a preset threshold;
    若是,将大于所述预设阈值的置信度对应的对象,作为筛选后的对象;If yes, the object corresponding to the confidence level greater than the preset threshold is used as the filtered object;
    所述将得到的每个位置区域对应的图像块输入至预先构建的属性识别神经网络,获得每个对象的属性的步骤,包括:The step of inputting the obtained image block corresponding to each location area to the pre-built attribute recognition neural network to obtain the attributes of each object includes:
    将筛选后的每个对象的位置区域对应的图像块发送至预先构建的属性识别神经网络进行属性识别,得到筛选后的每个对象的属性;Sending the image block corresponding to the selected location area of each object to the pre-built attribute recognition neural network for attribute recognition, and obtaining the attribute of each object after the screening;
    所述将得到的每个对象的类别及属性发送给所述CPU的步骤,包括:The step of sending the obtained category and attribute of each object to the CPU includes:
    将得到的筛选后的每个对象的类别及属性发送给所述CPU。The obtained filtered categories and attributes of each object are sent to the CPU.
  8. 根据权利要求1所述的方法,其特征在于,所述协处理器包括图形处理器GPU、数字信号处理器DSP和现场可编程门阵列处理器FPGA中的至少一 种。The method of claim 1 wherein the coprocessor comprises at least one of a graphics processor GPU, a digital signal processor DSP, and a field programmable gate array processor FPGA.
  9. 根据权利要求1所述的方法,其特征在于,所述将得到的每个位置区域对应的图像块输入至预先构建的属性识别神经网络,获得每个对象的属性的步骤,包括:The method according to claim 1, wherein the step of inputting the obtained image block corresponding to each location area to a pre-built attribute recognition neural network to obtain attributes of each object comprises:
    将得到的每个位置区域对应的图像块进行缩放处理;And scaling the image block corresponding to each of the obtained location areas;
    将缩放处理后得到的每个图像块输入至预先构建的属性识别神经网络,获得每个对象的属性。Each image block obtained after the scaling process is input to a pre-built attribute recognition neural network to obtain attributes of each object.
  10. 根据权利要求1所述的方法,其特征在于,所述待识别图像为:所述CPU对原始图像进行图像格式转换和缩放处理后得到的。The method according to claim 1, wherein the image to be identified is obtained by the CPU performing image format conversion and scaling processing on the original image.
  11. 一种电子设备,其特征在于,所述电子设备包括协处理器和中央处理器CPU;An electronic device, comprising: a coprocessor and a central processing unit CPU;
    所述CPU,用于向所述协处理器发送待识别图像;The CPU is configured to send an image to be identified to the coprocessor;
    所述协处理器,用于接收所述CPU发送的待识别图像;The coprocessor is configured to receive an image to be identified sent by the CPU;
    所述协处理器,还用于将所述待识别图像输入至预先构建的内容识别神经网络,获得内容识别结果,所述内容识别结果中包括:所述待识别图像所包含的对象的类别及位置区域;The coprocessor is further configured to input the image to be recognized to a pre-constructed content recognition neural network, and obtain a content recognition result, where the content recognition result includes: a category of the object included in the image to be recognized Location area
    所述协处理器,还用于将得到的每个位置区域对应的图像块输入至预先构建的属性识别神经网络,获得每个对象的属性;The coprocessor is further configured to input the obtained image block corresponding to each location area to a pre-built attribute recognition neural network to obtain an attribute of each object;
    所述协处理器,还用于将得到的每个对象的类别及属性发送给所述CPU;The coprocessor is further configured to send the obtained category and attribute of each object to the CPU;
    所述CPU还用于:接收所述协处理器发送的每个对象的类别及属性,并将接收到的对象的类别及属性,作为所述待识别图像的图像识别结果。The CPU is further configured to: receive a category and an attribute of each object sent by the coprocessor, and use a category and an attribute of the received object as an image recognition result of the image to be identified.
  12. 根据权利要求11所述的电子设备,其特征在于,所述协处理器具体用于:The electronic device according to claim 11, wherein the coprocessor is specifically configured to:
    基于预设映射关系和所述待识别图像所包含的每个对象的类别,确定所述每个对象对应的属性识别神经网络;其中,所述预设映射关系包括:预设的类别和预先构建的属性识别神经网络之间的对应关系;Determining an attribute recognition neural network corresponding to each object according to a preset mapping relationship and a category of each object included in the image to be identified; wherein the preset mapping relationship comprises: a preset category and a pre-built Attributes identify the correspondence between neural networks;
    将得到的每个位置区域对应的图像块输入至:该对象对应的属性识别神经网络,得到每个对象的属性。The obtained image block corresponding to each position area is input to: the attribute corresponding to the object identifies the neural network, and the attribute of each object is obtained.
  13. 根据权利要求12所述的电子设备,其特征在于,所述协处理器具体用于:The electronic device according to claim 12, wherein the coprocessor is specifically configured to:
    将所述待识别图像所包含的对象分为两组,得到第一组对象和第二组对象;Dividing the objects included in the image to be identified into two groups, and obtaining a first group of objects and a second group of objects;
    将所述第一组对象中每个对象的位置区域对应的图像块输入至:该对象对应的属性识别神经网络,得到所述第一组对象中每个对象的属性;Inputting an image block corresponding to a location area of each object in the first group of objects to: an attribute recognition neural network corresponding to the object, and obtaining an attribute of each object in the first group of objects;
    将所述第二组对象中每个对象的位置区域发送至所述CPU将所述第一组对象中每个对象的类别及属性,所述第二组对象中每个对象的类别发送至所述CPU;Sending a location area of each of the second set of objects to the CPU to send a category and an attribute of each of the first set of objects, and a category of each of the second set of objects to the CPU
    所述CPU具体用于:将所述第二组对象中每个对象的位置区域对应的图像块输入至:该对象对应的属性识别神经网络,得到所述第二组对象中每个对象的属性;将所述第一组对象中每个对象的类别及属性,和所述第二组对象中每个对象的类别及属性,作为所述待识别图像的图像识别结果。The CPU is specifically configured to: input an image block corresponding to a location area of each object in the second group of objects to: an attribute recognition neural network corresponding to the object, and obtain an attribute of each object in the second group of objects And selecting, as the image recognition result of the image to be recognized, a category and an attribute of each object in the first group of objects, and a category and an attribute of each object in the second group of objects.
  14. 根据权利要求13所述的电子设备,其特征在于,所述协处理器具体用于:The electronic device according to claim 13, wherein the coprocessor is specifically configured to:
    从所述待识别图像所包含的对象中选择出预设数量个对象,作为第一组对象,剩余对象作为第二组对象;Selecting, from the objects included in the image to be identified, a preset number of objects as the first group of objects, and the remaining objects as the second group of objects;
    或者,将所述待识别图像中第一预设类别的对象,作为第一组对象,将所述待识别图像中不为所述第一预设类别的对象,作为第二组对象。Alternatively, the object of the first preset category in the image to be identified is used as the first group of objects, and the object that is not the first preset category in the image to be identified is used as the second group of objects.
  15. 根据权利要求12所述的电子设备,其特征在于,所述协处理器具体用于:The electronic device according to claim 12, wherein the coprocessor is specifically configured to:
    将所述待识别图像所包含的对象中为第二预设类别的每个第一对象的位置区域发送至所述CPU将所述每个第一对象的位置区域对应的图像块输入至:该第一对象对应的属性识别神经网络中的第二类属性识别神经网络,得到每个第一对象的第二类属性;Transmitting, to the CPU, a location area corresponding to a location area of each of the first objects, to the CPU, the location area of each of the objects included in the image to be identified The attribute matching the first object identifies a second type of attribute in the neural network to identify the neural network, and obtains a second type of attribute of each first object;
    将所述待识别图像所包含的对象中不为所述第二预设类别的每个第二对象的位置区域对应的图像块,输入至:该第二对象对应的属性识别神经网络中的第二类属性识别神经网络,得到每个第二对象的第二类属性;Inputting, in the object included in the image to be recognized, an image block corresponding to a location area of each second object of the second preset category to: an attribute in the attribute recognition neural network corresponding to the second object The second type of attribute identifies the neural network and obtains a second type of attribute of each second object;
    将每个第一对象的第二类属性和类别,及每个第二对象的第二属性和类别发送至所述CPU;Sending a second type of attribute and category of each first object, and a second attribute and category of each second object to the CPU;
    所述CPU具体用于:将每个第一对象的位置区域对应的图像块输入至:该第一对象对应的属性识别神经网络中的第一类属性识别神经网络,得到每个第一对象的第一类属性;The CPU is specifically configured to: input an image block corresponding to a location area of each first object to: a first type of attribute recognition neural network in the attribute recognition neural network corresponding to the first object, and obtain a first object The first type of attribute;
    将每个第一对象的第一类属性、第二类属性和类别,以及每个第二对象的第二类属性及类别,作为所述待识别图像的图像识别结果。The first type attribute, the second type attribute and the category of each first object, and the second type attribute and category of each second object are used as image recognition results of the image to be recognized.
  16. 根据权利要求11-15中任一项所述的电子设备,其特征在于,所述协处理器具体用于:将得到的每个对象的位置区域、类别及属性发送给所述CPU;The electronic device according to any one of claims 11 to 15, wherein the coprocessor is specifically configured to: send the obtained location area, category and attribute of each object to the CPU;
    所述CPU具体用于:将接收到的对象的位置区域、类别及属性,作为所述待识别图像的图像识别结果。The CPU is specifically configured to: use a location area, a category, and an attribute of the received object as an image recognition result of the image to be identified.
  17. 根据权利要求11-15中任一项所述的电子设备,其特征在于,所述内容识别神经网络还用于识别图像所包含的对象的类别对应的置信度;所述内容识别结果中还包括:所述图像所包含的对象的类别对应的置信度;The electronic device according to any one of claims 11 to 15, wherein the content recognition neural network is further configured to identify a confidence level corresponding to a category of the object included in the image; the content recognition result further includes : a confidence level corresponding to a category of an object included in the image;
    所述协处理器还用于:在将得到的每个位置区域对应的图像块输入至预先构建的属性识别神经网络,获得每个对象的属性之前,判断得到的置信度是否大于预设阈值;若是,将大于所述预设阈值的置信度对应的对象,作为筛选后的对象;将筛选后的每个对象的位置区域对应的图像块发送至预先构建的属性识别神经网络进行属性识别,得到筛选后的每个对象的属性;将得到的筛选后的每个对象的类别及属性发送给所述CPU。The coprocessor is further configured to: input the image block corresponding to each of the obtained location areas to the pre-built attribute recognition neural network, and determine whether the obtained confidence level is greater than a preset threshold before obtaining the attribute of each object; If yes, the object corresponding to the confidence level of the preset threshold is used as the filtered object; the image block corresponding to the selected location area of each object is sent to the pre-built attribute recognition neural network for attribute recognition, and The attributes of each object after filtering; the obtained categories and attributes of each object after filtering are sent to the CPU.
  18. 根据权利要求11所述的电子设备,其特征在于,所述协处理器包括图形处理器GPU、数字信号处理器DSP和现场可编程门阵列处理器FPGA中的至少一种。The electronic device of claim 11, wherein the coprocessor comprises at least one of a graphics processor GPU, a digital signal processor DSP, and a field programmable gate array processor FPGA.
  19. 根据权利要求11所述的电子设备,其特征在于,所述协处理器具体 用于:The electronic device according to claim 11, wherein the coprocessor is specifically configured to:
    将得到的每个位置区域对应的图像块进行缩放处理;And scaling the image block corresponding to each of the obtained location areas;
    将缩放处理后得到的每个图像块输入至预先构建的属性识别神经网络,获得每个对象的属性。Each image block obtained after the scaling process is input to a pre-built attribute recognition neural network to obtain attributes of each object.
  20. 根据权利要求11所述的电子设备,其特征在于,所述CPU还用于:The electronic device according to claim 11, wherein the CPU is further configured to:
    对原始图像进行图像格式转换和缩放处理,获得待识别图像。Image format conversion and scaling processing is performed on the original image to obtain an image to be recognized.
  21. 一种可读存储介质,其特征在于,所述可读存储介质为包括协处理器和中央处理器CPU的电子设备中的存储介质,所述可读存储介质内存储有计算机程序,所述计算机程序被协处理器执行时实现:权利要求1-10中任一项所述的图像识别方法。A readable storage medium, characterized in that the readable storage medium is a storage medium in an electronic device including a coprocessor and a central processing unit CPU, and the readable storage medium stores therein a computer program, the computer The image recognition method according to any one of claims 1 to 10 is implemented when the program is executed by a coprocessor.
  22. 一种应用程序,其特征在于,当其在包括协处理器和中央处理器CPU的电子设备上运行时,使得所述协处理器执行:权利要求1-10中任一项所述的图像识别方法。An application characterized by causing the coprocessor to perform the image recognition of any one of claims 1-10 when it is run on an electronic device comprising a coprocessor and a central processing unit CPU method.
PCT/CN2018/108229 2017-12-19 2018-09-28 Image recognition method and electronic device WO2019119919A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201711378700.4 2017-12-19
CN201711378700.4A CN109934077B (en) 2017-12-19 2017-12-19 Image identification method and electronic equipment

Publications (1)

Publication Number Publication Date
WO2019119919A1 true WO2019119919A1 (en) 2019-06-27

Family

ID=66984129

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/108229 WO2019119919A1 (en) 2017-12-19 2018-09-28 Image recognition method and electronic device

Country Status (2)

Country Link
CN (1) CN109934077B (en)
WO (1) WO2019119919A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112365465A (en) * 2020-11-09 2021-02-12 浙江大华技术股份有限公司 Method and apparatus for determining type of synthesized image, storage medium, and electronic apparatus
EP4115602A4 (en) * 2020-03-04 2024-03-06 Videopura Llc An encoding device and method for utility-driven video compression

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111880661A (en) * 2020-07-31 2020-11-03 Oppo广东移动通信有限公司 Gesture recognition method and device
CN112308172B (en) * 2020-12-24 2022-04-01 北京达佳互联信息技术有限公司 Identification method and device and electronic equipment

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105488044A (en) * 2014-09-16 2016-04-13 华为技术有限公司 Data processing method and device
US20160180195A1 (en) * 2013-09-06 2016-06-23 Toyota Jidosha Kabushiki Kaisha Augmenting Layer-Based Object Detection With Deep Convolutional Neural Networks
CN205726177U (en) * 2016-07-01 2016-11-23 浪潮集团有限公司 A kind of safety defense monitoring system based on convolutional neural networks chip
US20170004619A1 (en) * 2015-07-01 2017-01-05 Jianming Liang System and method for automatic pulmonary embolism detection
CN106446782A (en) * 2016-08-29 2017-02-22 北京小米移动软件有限公司 Image identification method and device
CN106599840A (en) * 2016-12-13 2017-04-26 郑州云海信息技术有限公司 Image identification coprocessor, and image identification system and method
CN106778583A (en) * 2016-12-07 2017-05-31 北京理工大学 Vehicle attribute recognition methods and device based on convolutional neural networks
CN107239727A (en) * 2016-12-07 2017-10-10 北京深鉴智能科技有限公司 Gesture identification method and system

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106250874B (en) * 2016-08-16 2019-04-30 东方网力科技股份有限公司 Recognition methods and the device of a kind of dress ornament and carry-on articles
CN106339719A (en) * 2016-08-22 2017-01-18 微梦创科网络科技(中国)有限公司 Image identification method and image identification device
CN107133650A (en) * 2017-05-10 2017-09-05 合肥华凌股份有限公司 Food recognition methods, device and the refrigerator of refrigerator

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160180195A1 (en) * 2013-09-06 2016-06-23 Toyota Jidosha Kabushiki Kaisha Augmenting Layer-Based Object Detection With Deep Convolutional Neural Networks
CN105488044A (en) * 2014-09-16 2016-04-13 华为技术有限公司 Data processing method and device
US20170004619A1 (en) * 2015-07-01 2017-01-05 Jianming Liang System and method for automatic pulmonary embolism detection
CN205726177U (en) * 2016-07-01 2016-11-23 浪潮集团有限公司 A kind of safety defense monitoring system based on convolutional neural networks chip
CN106446782A (en) * 2016-08-29 2017-02-22 北京小米移动软件有限公司 Image identification method and device
CN106778583A (en) * 2016-12-07 2017-05-31 北京理工大学 Vehicle attribute recognition methods and device based on convolutional neural networks
CN107239727A (en) * 2016-12-07 2017-10-10 北京深鉴智能科技有限公司 Gesture identification method and system
CN106599840A (en) * 2016-12-13 2017-04-26 郑州云海信息技术有限公司 Image identification coprocessor, and image identification system and method

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP4115602A4 (en) * 2020-03-04 2024-03-06 Videopura Llc An encoding device and method for utility-driven video compression
CN112365465A (en) * 2020-11-09 2021-02-12 浙江大华技术股份有限公司 Method and apparatus for determining type of synthesized image, storage medium, and electronic apparatus
CN112365465B (en) * 2020-11-09 2024-02-06 浙江大华技术股份有限公司 Synthetic image category determining method and device, storage medium and electronic device

Also Published As

Publication number Publication date
CN109934077B (en) 2020-12-04
CN109934077A (en) 2019-06-25

Similar Documents

Publication Publication Date Title
WO2019119919A1 (en) Image recognition method and electronic device
US10726244B2 (en) Method and apparatus detecting a target
Zhang et al. Triplet-based semantic relation learning for aerial remote sensing image change detection
CN108520219B (en) Multi-scale rapid face detection method based on convolutional neural network feature fusion
US20220044040A1 (en) Liveness test method and apparatus
CN107529650B (en) Closed loop detection method and device and computer equipment
CN110321873B (en) Sensitive picture identification method and system based on deep learning convolutional neural network
Zhang et al. Joint face detection and alignment using multitask cascaded convolutional networks
WO2018171109A1 (en) Video action detection method based on convolutional neural network
WO2018188453A1 (en) Method for determining human face area, storage medium, and computer device
WO2019232866A1 (en) Human eye model training method, human eye recognition method, apparatus, device and medium
WO2018103608A1 (en) Text detection method, device and storage medium
WO2019232862A1 (en) Mouth model training method and apparatus, mouth recognition method and apparatus, device, and medium
WO2021232969A1 (en) Action recognition method and apparatus, and device and storage medium
CN108009472B (en) Finger back joint print recognition method based on convolutional neural network and Bayes classifier
WO2016023264A1 (en) Fingerprint identification method and fingerprint identification device
CN111626371A (en) Image classification method, device and equipment and readable storage medium
WO2020244071A1 (en) Neural network-based gesture recognition method and apparatus, storage medium, and device
Mantecon et al. Depth-based face recognition using local quantized patterns adapted for range data
CN115294332B (en) Image processing method, device, equipment and storage medium
CN109754077B (en) Network model compression method and device of deep neural network and computer equipment
CN114387505A (en) Hyperspectral and laser radar multi-modal remote sensing data classification method and system
CN112434647A (en) Human face living body detection method
CN108647605B (en) Human eye gaze point extraction method combining global color and local structural features
CN109035285B (en) Image boundary determining method and device, terminal and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18892594

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18892594

Country of ref document: EP

Kind code of ref document: A1