WO2020253416A1 - 物体检测方法、装置和计算机存储介质 - Google Patents

物体检测方法、装置和计算机存储介质 Download PDF

Info

Publication number
WO2020253416A1
WO2020253416A1 PCT/CN2020/089438 CN2020089438W WO2020253416A1 WO 2020253416 A1 WO2020253416 A1 WO 2020253416A1 CN 2020089438 W CN2020089438 W CN 2020089438W WO 2020253416 A1 WO2020253416 A1 WO 2020253416A1
Authority
WO
WIPO (PCT)
Prior art keywords
detected
image
training
information
neural network
Prior art date
Application number
PCT/CN2020/089438
Other languages
English (en)
French (fr)
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 WO2020253416A1 publication Critical patent/WO2020253416A1/zh
Priority to US17/553,236 priority Critical patent/US20220108546A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/70Labelling scene content, e.g. deriving syntactic or semantic representations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N5/00Computing arrangements using knowledge-based models
    • G06N5/02Knowledge representation; Symbolic representation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • G06T7/73Determining position or orientation of objects or cameras using feature-based methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/764Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/7715Feature extraction, e.g. by transforming the feature space, e.g. multi-dimensional scaling [MDS]; Mappings, e.g. subspace methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/82Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10016Video; Image sequence
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20084Artificial neural networks [ANN]

Definitions

  • This application relates to the field of computer vision, and more specifically to an object detection method, device and computer storage medium.
  • Computer vision is an inseparable part of various intelligent/autonomous systems in various application fields, such as manufacturing, inspection, document analysis, medical diagnosis, and military. It is about how to use cameras/video cameras and computers to obtain What we need is the knowledge of the data and information of the subject. To put it vividly, computer vision is to install eyes (cameras/cameras) and brains (algorithms) on computers to replace human eyes to identify, track, and measure targets, so that the computer can perceive the environment. Because perception can be seen as extracting information from sensory signals, computer vision can also be seen as a science that studies how to make artificial systems "perceive" from images or multi-dimensional data.
  • computer vision uses various imaging systems to replace the visual organs to obtain input information, and then the computer replaces the brain to complete the processing and interpretation of the input information.
  • the ultimate research goal of computer vision is to enable computers to observe and understand the world through vision like humans, and have the ability to adapt to the environment autonomously.
  • Object detection is a specific application in the field of computer vision. Object detection refers to the process of marking the location and classification of objects in a picture or a video. Traditional solutions generally detect different objects in the picture to be detected separately to determine the position and classification of each object in the picture to be detected. However, in many scenes (for example, there are more objects in the picture to be detected, and the occlusion between objects is also more serious), the detection effect of the traditional solution is average.
  • This application provides an object detection method, device and computer storage medium to improve the effect of object detection.
  • an object detection method includes: acquiring an image to be detected; performing convolution processing on the image to be detected to obtain the initial image feature of the object to be detected; and determining the enhanced image feature of the object to be detected based on knowledge map information ; According to the initial image feature of the object to be detected and the enhanced image feature of the object to be detected, the candidate frame and classification of the object to be detected are determined.
  • the above-mentioned knowledge map information includes the association relationship between different object categories corresponding to different objects in the image to be detected, and the enhanced image feature of the above-mentioned object to be detected indicates the semantics of the object category corresponding to other objects associated with the object to be detected information.
  • the determined candidate frame of the object to be detected may be the final candidate frame of the object to be detected, and the classification of the object to be detected determined above may be the final classification (result) of the object to be detected.
  • the above object detection method can be applied in different application scenarios.
  • the above object detection method can be applied in the scene of recognizing everything, and it can also be applied in the scene of street view recognition.
  • the above-mentioned image to be detected may be an image taken by the mobile terminal through a camera, or an image already stored in the mobile terminal's album.
  • the above-mentioned image to be detected may be a street view image taken by a camera on the roadside.
  • the aforementioned initial image feature and enhanced image feature may specifically be convolution feature maps.
  • the above object detection method may be executed by a neural network. Specifically, the above object detection method may be executed by a convolutional neural network CNN or a deep neural network DNN.
  • performing convolution processing on the image to be detected includes: using a convolutional neural network CNN or a deep neural network DNN to perform convolution processing on the image to be detected.
  • the above method further includes: determining the initial candidate frame and initial classification of the object to be detected according to the initial image feature of the object to be detected.
  • the entire image of the image to be detected is first subjected to convolution processing to obtain the convolution characteristics of the entire image of the image to be detected, and then according to the fixed size requirements, Divide the image to be detected into different boxes, score the features corresponding to the images in each box, filter out the boxes with higher scores as the initial candidate box, and determine the image features corresponding to the initial candidate box The initial classification of the image corresponding to the initial candidate frame.
  • the entire image of the first image can be convolved to obtain the total image of the first image. Convolution features, and then divide the first image into 3 ⁇ 3 boxes, and score the features corresponding to the image of each box. Finally, box A and box B with higher scores can be screened out as the initial candidate boxes, and then the initial classification of the image in box A can be determined by the features of the image in box A, and the The feature corresponding to the image determines the initial classification of the image in box B.
  • the detection result of the object to be detected is comprehensively determined by the initial image feature of the object to be detected and the enhanced image feature, and the detection result is obtained by considering only the initial image feature of the object to be detected In comparison, better detection results can be obtained.
  • this application when determining the detection result of the object to be detected, this application not only considers the initial image characteristics reflecting the characteristics of the object to be detected, but also considers the semantic information of other objects in the image to be detected that are associated with the object to be detected.
  • the present application comprehensively determines the detection result of the object to be detected by integrating the characteristics of the object to be detected and the characteristics of other related objects, which can improve the accuracy of the detection result of the object to be detected to a certain extent.
  • the first object when determining the detection result of the first object, the first object can be considered comprehensively.
  • the initial image features extracted from the object and the semantic information of people and roads determine the detection result of the first object. Assuming that the initial classification result of the first object is a bicycle, since people and roads are likely to appear at the same time as a bicycle, the confidence that the first object belongs to a bicycle can be improved by using the semantic information of people and roads. Therefore, the accuracy of the detection result of the first object is finally improved.
  • performing convolution processing on the image to be detected to obtain the initial image feature of the object to be detected includes: performing convolution processing on the entire image of the image to be detected to obtain the complete image feature of the image to be detected; Among the complete image features, the image feature corresponding to the object to be detected is determined as the initial image feature of the object to be detected.
  • the entire image of the image to be detected is first subjected to convolution processing to obtain the complete image feature of the image to be detected, and then the image feature corresponding to the object to be detected is obtained from the complete image feature of the image to be detected.
  • the method of the image feature of the object can reduce the complexity of acquiring the image feature of the object to be detected.
  • determining the enhanced image feature of the object to be detected according to the knowledge map information includes: determining the graph structure information according to the knowledge graph information and the memory pool information; and determining the enhanced image feature of the object to be detected based on the graph structure information.
  • the foregoing determination of the graph structure information based on the knowledge graph information and the memory pool information can also be referred to as generating the graph structure based on the knowledge graph information and the memory pool information.
  • the above graph structure information may include multiple nodes, where each node corresponds to an object category, and the corresponding object categories (or object classifications) between interconnected nodes have certain Each node contains the semantic information of the corresponding object category.
  • the foregoing graph structure may generally include multiple nodes, and the object categories corresponding to the multiple nodes may include the object category of the object to be detected and other object categories associated with the object category of the object to be detected.
  • the enhanced image features of the object to be detected according to the graph structure information it can specifically determine the node corresponding to the object category of the object to be detected in the graph structure according to the graph structure information, and then extract the semantic information of the surrounding nodes of the node In this way, the enhanced image characteristics of the object to be detected are obtained.
  • the graph structure when determining the graph structure information based on the knowledge graph information and the memory pool information, the graph structure can be specifically generated based on the types of object categories contained in the memory pool information and the association relationships between different object categories contained in the knowledge graph information. information.
  • the above-mentioned knowledge graph information includes the association relationship between 1000 object categories, and the above-mentioned memory pool contains the classification layer parameters of 100 object categories, then one of the 100 object categories recorded in the memory pool information can be obtained from the knowledge graph information.
  • the graph structure contains 100 nodes, and the 100 nodes correspond to the above 100 object categories.
  • the foregoing determination of the candidate frame and classification of the object to be detected based on the initial image feature of the object to be detected and the enhanced image feature of the object to be detected includes: the initial image feature of the object to be detected and the enhanced image feature of the object to be detected Combine to obtain the final image feature of the object to be detected; determine the candidate frame and classification of the object to be detected according to the final image feature of the object to be detected.
  • the initial image feature of the object to be detected and the enhanced image feature of the object to be detected may correspond to tensors of different dimensions, and the tensor corresponding to the final image feature of the object to be detected may correspond to the initial image feature of the object to be detected The tensor is merged with the tensor corresponding to the enhanced image feature of the object to be detected.
  • the initial image feature of the object to be detected is a convolution feature map with a size of M1 ⁇ N1 ⁇ C1
  • the enhanced image feature of the object to be detected is a convolution feature map with a size of M1 ⁇ N1 ⁇ C2.
  • the combination of these two convolution feature maps can obtain the final image feature of the object to be detected, and the final image feature is a convolution feature map with a size of M1 ⁇ N1 ⁇ (C1+C2).
  • the above-mentioned knowledge graph information is preset.
  • the aforementioned knowledge graph information may be preset based on experience.
  • the knowledge graph information can be set or generated according to the association relationship between different types of objects manually labeled.
  • the knowledge graph information can be determined by artificially counting the similarity between objects of different categories and the probability of simultaneous appearance of objects of different categories.
  • the association relationship between different object categories corresponding to different objects in the image to be detected includes at least one of the following information: attribute association relationships of different object categories; The positional relationship between different object categories; the degree of similarity between word vectors of different object categories; the probability that different object categories appear at the same time.
  • the aforementioned attribute association relationship of objects of different types may specifically refer to whether objects of different types have the same attributes. For example, if the color of an apple is red and the color of a strawberry is also red, then apples and strawberries have the same color attributes (or, it can be said that apples and strawberries are relatively close in color attributes).
  • the above-mentioned knowledge graph information is obtained by training the neural network model according to training data, and the training data includes training images and object categories to which different objects in the training images belong.
  • the above-mentioned training image may generally contain multiple objects to be detected, and the object categories to which different objects in the above-mentioned training image belong may also be referred to as labeled data of the training image, and the labeled data may be (manually) pre-labeled data.
  • the initial knowledge map information can be
  • the initial knowledge map information can be
  • the current knowledge map information can be used as the final training knowledge map information.
  • the foregoing initial knowledge map information may include the association relationship between different object categories corresponding to different objects in the image to be detected, and the initial knowledge map information includes the association relationship between different object categories corresponding to different objects in the image to be detected. It can be set randomly.
  • the above determining the enhanced image features of the object to be detected based on the knowledge map information includes: adopting a graph convolution method based on the attention mechanism or a graph sparse volume based on spatial information
  • the convolution method performs convolution processing on the semantic information of the object categories corresponding to other objects associated with the object to be detected to obtain the enhanced image features of the object to be detected.
  • the enhanced image features can be extracted from each other object that is most concerned by the object to be detected, so that the information reflected by the enhanced image features is more targeted It is convenient to finally improve the detection effect of the object to be detected.
  • the enhanced image features can be extracted from other objects whose spatial distance from the object to be detected is within a certain range, so that the information reflected by the enhanced image features is more Targeted, which is convenient to ultimately improve the detection effect of the object to be detected.
  • the above method further includes: displaying the detection result of the object to be detected, and the detection result of the object to be detected includes the candidate frame and classification of the object to be detected.
  • the foregoing displaying the detection result of the object to be detected includes: displaying the detection result of the object to be detected on a display screen.
  • the method of the first aspect described above can be executed by a neural network (model). Specifically, after the image to be detected is acquired, the image to be detected can be convolved through a neural network to obtain the initial image features of the object to be detected, and the enhanced image features of the object to be detected can be determined according to the neural network and knowledge map information, and then use The neural network then determines the candidate frame and classification of the object to be detected based on the initial image feature of the object to be detected and the enhanced image feature of the object to be detected.
  • a neural network model
  • a neural network training method includes: acquiring training data, the training data including training images and object detection and labeling results of the objects to be detected in the training images; extracting the training images according to the neural network The initial image feature of the object to be detected; the enhanced image feature of the object to be detected in the training image is extracted according to the neural network and knowledge map information; the initial image feature and the enhanced image feature of the object to be detected are processed according to the neural network to obtain the The object detection result of the object to be detected; according to the object detection result of the object to be detected in the training image and the object detection and labeling result of the object to be detected in the training image, the model parameters of the neural network are determined.
  • the above-mentioned knowledge map information includes the association relationship between object categories corresponding to different objects in the training image, and the enhanced image feature of the object to be detected in the training image indicates objects corresponding to other objects associated with the object to be detected The semantic information of the category.
  • the object detection and labeling result of the object to be detected in the training image includes the labeling candidate frame and labeling classification result of the object to be detected in the training image.
  • the aforementioned label candidate frame and label classification result may be pre-labeled (specifically, it may be manually labeled).
  • a set of initial model parameters can be set for the neural network, and then based on the object detection result of the object to be detected in the training image and the object detection labeling result of the object to be detected in the training image Gradually adjust the model parameters of the neural network until the difference between the object detection structure of the object to be detected in the training image and the object detection and annotation results of the object to be detected in the training image is within a certain preset range, or when When the number of times of training reaches the preset number of times, the model parameters of the neural network at this time are determined as the final parameters of the neural network model, thus completing the training of the neural network.
  • neural network trained through the second aspect can be used to implement the method in the first aspect of the present application.
  • the training method of the present application extracts more features for object detection during the training process, and can train a neural network with better performance, so that the neural network for object detection can achieve better object detection results. .
  • the above-mentioned knowledge graph information is preset.
  • the above-mentioned knowledge map information is obtained by training other neural network models based on training data, and the training data includes training images and objects to which different objects in the training images belong category.
  • the other neural network models here may be different from the neural network models trained in the training method of the second aspect.
  • the association relationship between different object categories corresponding to different objects in the training image includes at least one of the following: attribute association relationships of different object categories; different object categories The positional relationship between; the degree of similarity between the word vectors of different object categories; the probability that different object categories appear at the same time.
  • an object detection device in a third aspect, includes various modules for executing the method in the first aspect.
  • a neural network training device in a fourth aspect, includes various modules for executing the method in the second aspect.
  • an object detection device in a fifth aspect, includes: a memory for storing a program; a processor for executing the program stored in the memory, and when the program stored in the memory is executed, the processing The device is used to perform the method in the first aspect described above.
  • a neural network training device in a sixth aspect, includes a memory for storing a program; a processor for executing the program stored in the memory. When the program stored in the memory is executed, the device The processor is used to execute the method in the above second aspect.
  • an electronic device in a seventh aspect, includes the object detection device in the third aspect or the fifth aspect.
  • an electronic device which includes the object detection device in the fourth aspect or the sixth aspect.
  • the above-mentioned electronic device may specifically be a mobile terminal (for example, a smart phone), a tablet computer, a notebook computer, an augmented reality/virtual reality device, a vehicle-mounted terminal device, and so on.
  • a mobile terminal for example, a smart phone
  • a tablet computer for example, a tablet computer
  • a notebook computer for example, a tablet computer
  • an augmented reality/virtual reality device for example, a vehicle-mounted terminal device, and so on.
  • a computer storage medium stores program code, and the program code includes instructions for executing the steps in the method in the first aspect or the second aspect.
  • a tenth aspect provides a computer program product containing instructions, when the computer program product runs on a computer, the computer executes the method in the first aspect or the second aspect.
  • a chip in an eleventh aspect, includes a processor and a data interface.
  • the processor reads instructions stored in a memory through the data interface and executes the method in the first aspect or the second aspect.
  • the chip may further include a memory in which instructions are stored, and the processor is configured to execute the instructions stored in the memory.
  • the processor is used to execute the method in the first aspect.
  • the aforementioned chip may specifically be a field programmable gate array FPGA or an application specific integrated circuit ASIC.
  • the foregoing method of the first aspect may specifically refer to the first aspect and a method in any one of the various implementation manners of the first aspect.
  • the above-mentioned method in the second aspect may specifically refer to the second aspect and a method in any one of the various implementation manners in the second aspect.
  • FIG. 1 is a schematic structural diagram of a system architecture provided by an embodiment of the present application.
  • FIG. 2 is a schematic diagram of object detection using a convolutional neural network model provided by an embodiment of the present application
  • FIG. 3 is a schematic diagram of a chip hardware structure provided by an embodiment of the present application.
  • FIG. 4 is a schematic flowchart of an object detection method according to an embodiment of the present application.
  • Fig. 5 is a schematic diagram of a graph structure of an embodiment of the present application.
  • Fig. 6 is a flowchart of an object detection method according to an embodiment of the present application.
  • FIG. 7 is a flowchart of an object detection method according to an embodiment of the present application.
  • FIG. 8 is a schematic flowchart of a neural network training method according to an embodiment of the present application.
  • FIG. 9 is a schematic block diagram of an object detection device according to an embodiment of the present application.
  • FIG. 10 is a schematic block diagram of an object detection device according to an embodiment of the present application.
  • Fig. 11 is a schematic block diagram of a neural network training device according to an embodiment of the present application.
  • the embodiments of the present application can be applied to scenes of large-scale object detection. For example, face recognition, recognition of all things, unmanned vehicle perception system object recognition, social networking site photo object recognition, intelligent robot object recognition, etc.
  • the object detection method of the embodiment of the present application can be applied to scenes such as mobile phone recognition of everything and street view recognition.
  • scenes such as mobile phone recognition of everything and street view recognition.
  • the two scenarios are briefly introduced below.
  • the object detection method of the embodiment of the application can be used to detect objects in pictures taken by the mobile phone. Since the object detection method of the embodiment of the application combines the knowledge map when detecting the object, the object detection of the embodiment of the application is adopted The method performs better object detection on pictures taken by mobile phones (for example, the position of the object and the classification of the object are more accurate).
  • Cameras deployed on the street can take pictures of passing vehicles and people. After the pictures are obtained, the pictures can be uploaded to the control center equipment, and the control center equipment will perform object detection on the pictures and obtain the object detection results. The control center can send out an alarm when the object is missing.
  • the neural network training method provided by the embodiments of this application involves computer vision processing, and can be specifically applied to data processing methods such as data training, machine learning, deep learning, etc., for training data (such as training pictures in this application and training pictures in this application). Labeling results) Carry out symbolic and formal intelligent information modeling, extraction, preprocessing, training, etc., and finally get a trained neural network.
  • the object detection method provided by the embodiment of the application can use the above-mentioned trained neural network to input input data (such as the picture in this application) into the trained neural network to obtain output data (such as the picture in this application). Test results).
  • the neural network training method provided by the embodiment of the application and the object detection method of the embodiment of the application are inventions based on the same concept, and can also be understood as two parts in a system, or an overall process Two stages: such as model training stage and model application stage.
  • a neural network can be composed of neural units, which can refer to an arithmetic unit that takes x s and intercept 1 as inputs.
  • the output of the arithmetic unit can be as shown in formula (1):
  • s 1, 2,...n, n is a natural number greater than 1
  • W s is the weight of x s
  • b is the bias of the neural unit.
  • f is the activation function of the neural unit, which is used to introduce nonlinear characteristics into the neural network to convert the input signal in the neural unit into an output signal.
  • the output signal of the activation function can be used as the input of the next convolutional layer, and the activation function can be a sigmoid function.
  • a neural network is a network formed by connecting multiple above-mentioned single neural units together, that is, the output of one neural unit can be the input of another neural unit.
  • the input of each neural unit can be connected with the local receptive field of the previous layer to extract the characteristics of the local receptive field.
  • the local receptive field can be a region composed of several neural units.
  • Deep neural network also called multi-layer neural network
  • DNN can be understood as a neural network with multiple hidden layers.
  • DNN is divided according to the positions of different layers.
  • the neural network inside the DNN can be divided into three categories: input layer, hidden layer, and output layer.
  • the first layer is the input layer
  • the last layer is the output layer
  • the number of layers in the middle are all hidden layers.
  • the layers are fully connected, that is to say, any neuron in the i-th layer must be connected to any neuron in the i+1th layer.
  • DNN looks complicated, it is not complicated in terms of the work of each layer. Simply put, it is the following linear relationship expression: among them, Is the input vector, Is the output vector, Is the offset vector, W is the weight matrix (also called coefficient), and ⁇ () is the activation function.
  • Each layer is just the input vector After such a simple operation, the output vector is obtained Due to the large number of DNN layers, the coefficient W and the offset vector The number is also relatively large.
  • DNN The definition of these parameters in DNN is as follows: Take coefficient W as an example: Suppose in a three-layer DNN, the linear coefficients from the fourth neuron in the second layer to the second neuron in the third layer are defined as The superscript 3 represents the number of layers where the coefficient W is located, and the subscript corresponds to the output third layer index 2 and the input second layer index 4.
  • the coefficient from the kth neuron in the L-1th layer to the jth neuron in the Lth layer is defined as
  • the input layer has no W parameter.
  • more hidden layers make the network more capable of portraying complex situations in the real world. Theoretically speaking, a model with more parameters is more complex and has a greater "capacity", which means it can complete more complex learning tasks.
  • Training a deep neural network is also a process of learning a weight matrix, and its ultimate goal is to obtain the weight matrix of all layers of the trained deep neural network (a weight matrix formed by vectors W of many layers).
  • Convolutional neural network (convolutional neuron network, CNN) is a deep neural network with convolutional structure.
  • the convolutional neural network contains a feature extractor composed of a convolution layer and a sub-sampling layer.
  • the feature extractor can be regarded as a filter.
  • the convolutional layer refers to the neuron layer that performs convolution processing on the input signal in the convolutional neural network.
  • a neuron can be connected to only part of the neighboring neurons.
  • a convolutional layer usually contains several feature planes, and each feature plane can be composed of some rectangularly arranged neural units. Neural units in the same feature plane share weights, and the shared weights here are the convolution kernels.
  • Sharing weight can be understood as the way to extract image information has nothing to do with location.
  • the convolution kernel can be initialized in the form of a matrix of random size. During the training of the convolutional neural network, the convolution kernel can obtain reasonable weights through learning. In addition, the direct benefit of sharing weights is to reduce the connections between the layers of the convolutional neural network, while reducing the risk of overfitting.
  • the residual network is a deep convolutional network proposed in 2015. Compared with the traditional convolutional neural network, the residual network is easier to optimize and can increase the accuracy by adding considerable depth.
  • the core of the residual network is to solve the side effect (degradation problem) caused by increasing the depth, so that the network performance can be improved by simply increasing the network depth.
  • the residual network generally contains many sub-modules with the same structure. ResNet is usually used to connect a number to indicate the number of times the sub-module is repeated. For example, ResNet50 means that there are 50 sub-modules in the residual network.
  • the classifier is generally composed of a fully connected layer and a softmax function, and can output different types of probabilities according to the input.
  • the neural network can use an error back propagation (BP) algorithm to modify the size of the parameters in the initial neural network model during the training process, so that the reconstruction error loss of the neural network model becomes smaller and smaller. Specifically, forwarding the input signal to the output will cause error loss, and the parameters in the initial neural network model are updated by backpropagating the error loss information, so that the error loss is converged.
  • the backpropagation algorithm is a backpropagation motion dominated by error loss, and aims to obtain the optimal neural network model parameters, such as the weight matrix.
  • a graph is a data format that can be used to represent social networks, communication networks, protein molecular networks, etc.
  • the nodes in the graph represent the individuals in the network, and the lines represent the connections between individuals.
  • Many machine learning tasks such as community discovery and link prediction require graph structure data. Therefore, the emergence of graph convolutional neural networks (GCN) provides new ideas for solving these problems.
  • GCN can be used for deep learning of graph data.
  • GCN is a natural promotion of convolutional neural networks in the graph domain. It can simultaneously perform end-to-end learning of node feature information and structural information, and is currently the best choice for graph data learning tasks.
  • the applicability of GCN is extremely wide, suitable for nodes and graphs of any topology.
  • FIG. 1 is a schematic diagram of the system architecture of an embodiment of the present application.
  • the system architecture 100 includes an execution device 110, a training device 120, a database 130, a client device 140, a data storage system 150, and a data acquisition system 160.
  • the execution device 110 includes a calculation module 111, an I/O interface 112, a preprocessing module 113, and a preprocessing module 114.
  • the calculation module 111 may include the target model/rule 101, and the preprocessing module 113 and the preprocessing module 114 are optional.
  • the data collection device 160 is used to collect training data.
  • the training data may include the training image and the annotation result corresponding to the training image.
  • the annotation result of the training image may be the (manually) pre-annotated training image of each object to be detected. Classification results.
  • the data collection device 160 stores the training data in the database 130, and the training device 120 trains to obtain the target model/rule 101 based on the training data maintained in the database 130.
  • the training device 120 performs object detection on the input training image, and compares the output detection result with the object pre-labeled detection result until the training device 120 outputs The difference between the detection result of the object and the pre-labeled detection result is less than a certain threshold, thereby completing the training of the target model/rule 101.
  • the above-mentioned target model/rule 101 can be used to implement the object detection method of the embodiment of the present application, that is, input the image to be detected (after relevant preprocessing) into the target model/rule 101 to obtain the detection result of the image to be detected.
  • the target model/rule 101 in the embodiment of the present application may specifically be a neural network.
  • the training data maintained in the database 130 may not all come from the collection of the data collection device 160, and may also be received from other devices.
  • the training device 120 does not necessarily perform the training of the target model/rule 101 based on the training data maintained by the database 130. It is also possible to obtain training data from the cloud or other places for model training. Limitations of Examples.
  • the target model/rule 101 trained according to the training device 120 can be applied to different systems or devices, such as the execution device 110 shown in FIG. 1.
  • the execution device 110 may be a terminal, such as a mobile phone terminal, a tablet computer, notebook computers, augmented reality (AR)/virtual reality (VR), vehicle-mounted terminals, etc., can also be servers or clouds.
  • the execution device 110 configures input/output
  • the (input/output, I/O) interface 112 is used for data interaction with external devices.
  • the user can input data to the I/O interface 112 through the client device 140, and the input data may include: client The image to be processed input by the device.
  • the client device 140 here may specifically be a terminal device.
  • the preprocessing module 113 and the preprocessing module 114 are used for preprocessing according to the input data (such as the image to be processed) received by the I/O interface 112.
  • the preprocessing module 113 and the preprocessing module may not be provided 114 (there may only be one preprocessing module), and the calculation module 111 is directly used to process the input data.
  • the execution device 110 may call data, codes, etc. in the data storage system 150 for corresponding processing .
  • the data, instructions, etc. obtained by corresponding processing may also be stored in the data storage system 150.
  • the I/O interface 112 presents the processing result, such as the detection result of the object obtained above, to the client device 140 to provide it to the user.
  • the training device 120 can generate corresponding target models/rules 101 based on different training data for different goals or tasks, and the corresponding target models/rules 101 can be used to achieve the above goals or complete The above tasks provide the user with the desired result.
  • the user can manually set input data, and the manual setting can be operated through the interface provided by the I/O interface 112.
  • the client device 140 can automatically send input data to the I/O interface 112. If the client device 140 is required to automatically send the input data and the user's authorization is required, the user can set the corresponding authority in the client device 140.
  • the user can view the result output by the execution device 110 on the client device 140, and the specific presentation form may be a specific manner such as display, sound, and action.
  • the client device 140 can also be used as a data collection terminal to collect the input data of the input I/O interface 112 and the output result of the output I/O interface 112 as new sample data, and store it in the database 130 as shown in the figure.
  • the I/O interface 112 directly uses the input data input to the I/O interface 112 and the output result of the output I/O interface 112 as a new sample as shown in the figure.
  • the data is stored in the database 130.
  • Fig. 1 is only a schematic diagram of a system architecture provided by an embodiment of the present application, and the positional relationship between the devices, devices, modules, etc. shown in the figure does not constitute any limitation.
  • the data The storage system 150 is an external memory relative to the execution device 110. In other cases, the data storage system 150 may also be placed in the execution device 110.
  • the target model/rule 101 is obtained by training according to the training device 120.
  • the neural network in the application may be CNN and deep convolution.
  • Neural networks deep convolutional neural networks, DCNN) and so on.
  • CNN is a very common neural network
  • the structure of CNN will be introduced in detail below in conjunction with Figure 2.
  • a convolutional neural network is a deep neural network with a convolutional structure. It is a deep learning architecture.
  • a deep learning architecture refers to a machine learning algorithm. Multi-level learning is carried out on the abstract level of
  • CNN is a feed-forward artificial neural network. Each neuron in the feed-forward artificial neural network can respond to the input image.
  • a convolutional neural network (CNN) 200 may include an input layer 210, a convolutional layer/pooling layer 220 (the pooling layer is optional), and a neural network layer 230.
  • CNN convolutional neural network
  • the convolutional layer/pooling layer 220 shown in Figure 2 may include layers 221-226 as shown in the examples.
  • layer 221 is a convolutional layer
  • layer 222 is a pooling layer
  • layer 223 is a convolutional layer
  • Layers, 224 is the pooling layer
  • 225 is the convolutional layer
  • 226 is the pooling layer
  • 221 and 222 are the convolutional layers
  • 223 is the pooling layer
  • 224 and 225 are the convolutional layers.
  • Layer, 226 is the pooling layer. That is, the output of the convolutional layer can be used as the input of the subsequent pooling layer, or as the input of another convolutional layer to continue the convolution operation.
  • the convolution layer 221 can include many convolution operators.
  • the convolution operator is also called a kernel. Its function in image processing is equivalent to a filter that extracts specific information from the input image matrix.
  • the convolution operator is essentially It can be a weight matrix. This weight matrix is usually pre-defined. In the process of convolution on the image, the weight matrix is usually one pixel after one pixel (or two pixels after two pixels) along the horizontal direction on the input image. ...It depends on the value of stride) to complete the work of extracting specific features from the image.
  • the size of the weight matrix should be related to the size of the image. It should be noted that the depth dimension of the weight matrix and the depth dimension of the input image are the same.
  • the weight matrix will extend to Enter the entire depth of the image. Therefore, convolution with a single weight matrix will produce a single depth dimension convolution output, but in most cases, a single weight matrix is not used, but multiple weight matrices with the same size (row ⁇ column) are used. That is, multiple homogeneous matrices.
  • the output of each weight matrix is stacked to form the depth dimension of the convolutional image, where the dimension can be understood as determined by the "multiple" mentioned above.
  • Different weight matrices can be used to extract different features in the image. For example, one weight matrix is used to extract edge information of the image, another weight matrix is used to extract specific colors of the image, and another weight matrix is used to eliminate unwanted noise in the image.
  • the multiple weight matrices have the same size (row ⁇ column), the size of the convolution feature maps extracted by the multiple weight matrices of the same size are also the same, and then the multiple extracted convolution feature maps of the same size are combined to form The output of the convolution operation.
  • weight values in these weight matrices need to be obtained through a lot of training in practical applications.
  • Each weight matrix formed by the weight values obtained through training can be used to extract information from the input image, so that the convolutional neural network 200 can make correct predictions. .
  • the initial convolutional layer (such as 221) often extracts more general features, which can also be called low-level features; with the convolutional neural network
  • the features extracted by the subsequent convolutional layers (for example, 226) become more and more complex, such as features such as high-level semantics, and features with higher semantics are more suitable for the problem to be solved.
  • the pooling layer can be a convolutional layer followed by a layer
  • the pooling layer can also be a multi-layer convolutional layer followed by one or more pooling layers.
  • the pooling layer may include an average pooling operator and/or a maximum pooling operator for sampling the input image to obtain a smaller size image.
  • the average pooling operator can calculate the pixel values in the image within a specific range to generate an average value as the result of average pooling.
  • the maximum pooling operator can take the pixel with the largest value within a specific range as the result of the maximum pooling.
  • the operators in the pooling layer should also be related to the image size.
  • the size of the image output after processing by the pooling layer can be smaller than the size of the image of the input pooling layer, and each pixel in the image output by the pooling layer represents the average value or the maximum value of the corresponding sub-region of the image input to the pooling layer.
  • the convolutional neural network 200 After processing by the convolutional layer/pooling layer 220, the convolutional neural network 200 is not enough to output the required output information. Because as mentioned above, the convolutional layer/pooling layer 220 only extracts features and reduces the parameters brought by the input image. However, in order to generate the final output information (the required class information or other related information), the convolutional neural network 200 needs to use the neural network layer 230 to generate one or a group of required classes of output. Therefore, the neural network layer 230 may include multiple hidden layers (231, 232 to 23n as shown in FIG. 2) and an output layer 240. The parameters contained in the multiple hidden layers can be based on specific task types. The relevant training data of the, for example, the task type can include image recognition, image classification, image super-resolution reconstruction and so on.
  • the output layer 240 After the multiple hidden layers in the neural network layer 230, that is, the final layer of the entire convolutional neural network 200 is the output layer 240.
  • the output layer 240 has a loss function similar to the classification cross entropy, which is specifically used to calculate the prediction error.
  • the convolutional neural network 200 shown in FIG. 2 is only used as an example of a convolutional neural network. In specific applications, the convolutional neural network may also exist in the form of other network models.
  • CNN convolutional neural network
  • FIG. 2 may be used to execute the object detection method of the embodiment of the present application.
  • the image to be processed passes through the input layer 210 and the convolutional layer/pooling layer 220. After processing with the neural network layer 230, the image detection result can be obtained.
  • FIG. 3 is a chip hardware structure provided by an embodiment of the application, and the chip includes a neural network processor 50.
  • the chip may be set in the execution device 110 as shown in FIG. 1 to complete the calculation work of the calculation module 111.
  • the chip can also be set in the training device 120 as shown in FIG. 1 to complete the training work of the training device 120 and output the target model/rule 101.
  • the algorithms of each layer in the convolutional neural network as shown in Figure 2 can be implemented in the chip as shown in Figure 3.
  • the NPU is mounted as a co-processor to a main central processing unit (central processing unit, CPU) (host CPU), and the main CPU distributes tasks.
  • the core part of the NPU is the arithmetic circuit 503.
  • the controller 504 controls the arithmetic circuit 503 to extract data from the memory (weight memory or input memory) and perform calculations.
  • the arithmetic circuit 503 includes multiple processing units (process engines, PE). In some implementations, the arithmetic circuit 503 is a two-dimensional systolic array. The arithmetic circuit 503 may also be a one-dimensional systolic array or other electronic circuits capable of performing mathematical operations such as multiplication and addition. In some implementations, the arithmetic circuit 503 is a general-purpose matrix processor.
  • the arithmetic circuit 503 fetches the data corresponding to matrix B from the weight memory 502 and caches it on each PE in the arithmetic circuit 503.
  • the arithmetic circuit 503 takes the matrix A data and the matrix B from the input memory 501 to perform matrix operations, and the partial result or final result of the obtained matrix is stored in an accumulator 508.
  • the vector calculation unit 507 may perform further processing on the output of the arithmetic circuit 503, such as vector multiplication, vector addition, exponential operation, logarithmic operation, size comparison, and so on.
  • the vector calculation unit 507 can be used for network calculations in the non-convolutional/non-FC layer of the neural network, such as pooling, batch normalization, local response normalization, etc. .
  • the vector calculation unit 507 can store the processed output vector in the unified buffer 506.
  • the vector calculation unit 507 may apply a nonlinear function to the output of the arithmetic circuit 503, such as a vector of accumulated values, to generate the activation value.
  • the vector calculation unit 507 generates a normalized value, a combined value, or both.
  • the processed output vector can be used as an activation input to the arithmetic circuit 503, for example for use in subsequent layers in a neural network.
  • the unified memory 506 is used to store input data and output data.
  • the weight data directly transfers the input data in the external memory to the input memory 501 and/or the unified memory 506 through the storage unit access controller 505 (direct memory access controller, DMAC), and stores the weight data in the external memory into the weight memory 502, And the data in the unified memory 506 is stored in the external memory.
  • DMAC direct memory access controller
  • the bus interface unit (BIU) 510 is used to implement interaction between the main CPU, the DMAC, and the fetch memory 509 through the bus.
  • An instruction fetch buffer 509 connected to the controller 504 is used to store instructions used by the controller 504;
  • the controller 504 is used to call the instructions cached in the memory 509 to control the working process of the computing accelerator.
  • the unified memory 506, the input memory 501, the weight memory 502, and the instruction fetch memory 509 are all on-chip (On-Chip) memories, and the external memory is a memory external to the NPU.
  • the external memory can be a double data rate synchronous dynamic random access memory. Memory (double data rate synchronous dynamic random access memory, referred to as DDR SDRAM), high bandwidth memory (HBM) or other readable and writable memory.
  • DDR SDRAM double data rate synchronous dynamic random access memory
  • HBM high bandwidth memory
  • each layer in the convolutional neural network shown in Figure 2 can be determined by the operation circuit
  • the execution device 110 in FIG. 1 introduced above can execute each step of the object detection method in the embodiment of the present application.
  • the CNN model shown in FIG. 2 and the chip shown in FIG. 3 can also be used to execute the object in the embodiment of the present application.
  • the object detection method of the embodiment of the present application will be described in detail below with reference to the accompanying drawings.
  • the method shown in FIG. 4 may be executed by an object detection device, which may be an electronic device with an object detection function.
  • the electronic device may specifically be a mobile terminal (for example, a smart phone), a computer, a personal digital assistant, a wearable device, an augmented reality/virtual reality device, a vehicle-mounted device, an Internet of Things device or other devices capable of object detection.
  • the method shown in FIG. 4 includes steps 1001 to 1004, which will be described in detail below.
  • the method shown in FIG. 4 can be applied in different scenarios. Specifically, the method shown in FIG. 4 can be applied in scenarios such as recognizing everything and street view recognition.
  • the image to be detected in step 1001 may be an image taken by the mobile terminal through a camera, or an image already stored in the mobile terminal's album.
  • the image to be detected in step 1001 may be a street view image taken by a camera on the roadside.
  • the method shown in FIG. 4 may be executed by a neural network (model). Specifically, the method shown in FIG. 4 may be executed by CNN or DNN.
  • the entire image of the image to be detected may be subjected to convolution processing first to obtain the image characteristics of the entire image, and then the initial image characteristics corresponding to the object to be detected are obtained from the image characteristics of the entire image.
  • performing convolution processing on the image to be detected to obtain the initial image feature of the object to be detected includes: performing convolution processing on the entire image of the image to be detected to obtain the complete image feature of the image to be detected; Among the complete image features, the image feature corresponding to the object to be detected is determined as the initial image feature of the object to be detected.
  • the entire image of the image to be detected is first subjected to convolution processing to obtain the complete image feature of the image to be detected, and then the image feature corresponding to the object to be detected is obtained from the complete image feature of the image to be detected.
  • the method of the image feature of the object can reduce the complexity of acquiring the image feature of the object to be detected.
  • the above-mentioned knowledge map information includes the association relationship between different object categories corresponding to different objects in the image to be detected, and the enhanced image feature of the above-mentioned object to be detected indicates the semantics of the object category corresponding to other objects associated with the object to be detected information.
  • the foregoing semantic information may refer to high-level information that can assist in image detection.
  • the above-mentioned semantic information can specifically be what the object is and what is around the object (semantic information is generally different from low-level information, such as the edges of the image, pixels, and brightness, etc.).
  • the object to be detected is a bicycle
  • other objects associated with the bicycle in the image to be detected include people and roads
  • the enhanced image features of the object to be detected may indicate semantic information of people and roads.
  • the above-mentioned knowledge graph information may be preset or obtained by training the neural network model according to the training data.
  • the aforementioned knowledge graph information may be preset based on experience.
  • the knowledge graph information can be set or generated according to the association relationship between different types of objects manually labeled.
  • the knowledge graph information can be determined by artificially counting the similarity between objects of different categories and the probability of simultaneous appearance of objects of different categories.
  • the training data includes the training image and the object categories to which different objects in the training image belong.
  • the above-mentioned training image may generally contain multiple objects to be detected, and the object categories to which different objects in the above-mentioned training image belong may also be referred to as labeled data of the training image, and the labeled data may be (manually) pre-labeled data.
  • the initial knowledge map information can be
  • the initial knowledge map information can be
  • the current knowledge map information can be used as the final training knowledge map information.
  • the foregoing initial knowledge map information may include the association relationship between different object categories corresponding to different objects in the image to be detected, and the initial knowledge map information includes the association relationship between different object categories corresponding to different objects in the image to be detected. It can be set randomly.
  • the knowledge map information may include the association relationship between different object categories corresponding to different objects in the image to be detected, and the association relationship between different object categories corresponding to different objects in the image to be detected It may include at least one of the following: the attribute association relationship of different object categories; the positional relationship between different object categories; the degree of similarity between word vectors of different object categories; the probability of simultaneous appearance of different object categories.
  • attribute association relationships of different object categories may refer to whether objects of different categories have the same attributes.
  • apples and strawberries have the same color attributes (or, it can be said that apples and strawberries are relatively close in color attributes).
  • the above-mentioned knowledge graph information may be represented by a table.
  • the above-mentioned knowledge graph information may be in the form shown in Table 1.
  • Table 1 shows the similarity between knife, spoon, bowl, banana and apple.
  • the values in the table are similar values between different objects.
  • the similarity The larger the value, the higher the similarity between the corresponding two objects.
  • the similarity value between the spoon and the knife is 0.016
  • the similarity value between the bowl and the spoon is 0.094, which shows that the similarity between the bowl and the knife is higher.
  • the similarity value between the objects is 1, it indicates that the two objects are completely the same. At this time, the two objects can be regarded as the same object.
  • the similarity value between a knife and a knife is 1, and the similarity value between a spoon and a spoon is also 1.
  • Table 1 is only an example of a possible manifestation of the knowledge graph information, and the knowledge graph information may directly include the association relationship information between related objects, which is not limited in this application.
  • the different types of objects in Table 1 can be further divided according to actual needs.
  • the spoons in Table 1 can be further divided into long spoons, short spoons, soup spoons, and so on.
  • determining the enhanced image feature of the object to be detected according to the knowledge graph information in the above step 1003 includes: determining the graph structure information according to the knowledge graph information and the memory pool information; and determining the enhanced image feature of the object to be detected according to the graph structure information.
  • the above-mentioned graph structure information may include multiple nodes, where each node corresponds to an object, the node corresponding to each object is connected to the node corresponding to other objects that are related to the object, and the multiple nodes include the object to be detected. As well as other objects associated with the object to be detected, each node contains semantic information of the corresponding object.
  • the enhanced image features of the object to be detected based on the graph structure information it can specifically determine the object to be detected based on the graph structure information, and then connect the nodes around the object to be detected (that is, other objects associated with the object to be detected).
  • the semantic information of) is extracted to obtain enhanced image features.
  • the graph when determining the graph structure information based on the knowledge graph information and the memory pool information, the graph can be specifically generated based on the types of objects contained in the memory pool information and the association relationships between the various types of objects contained in the knowledge graph information. Structure information.
  • the above-mentioned knowledge map information includes the association relationship between 1000 category objects, and the above-mentioned memory pool contains 100 classified classification layer parameters, then the 100 category objects recorded in the memory pool information can be obtained from the knowledge map information Then, a graph structure including 100 categories is constructed according to the relationship between the 100 categories of objects.
  • Figure 5 shows a schematic diagram of a graph structure.
  • each node corresponds to a different object, where node L corresponds to the object to be detected, and the objects corresponding to node M, node N, and node O are objects to be detected
  • the objects in the image are related to the object to be detected, while the nodes R and S are objects that are not related to the object to be detected in the graph structure. Therefore, when acquiring the enhanced image feature of the object to be detected, the enhanced image feature of the object to be detected can be obtained by extracting the semantic information of the node M, the node N, and the node O.
  • the candidate frame and classification of the object to be detected determined in step 1004 may be the final candidate frame and the final classification (result) of the object to be detected, respectively.
  • step 1004 the initial image feature of the object to be detected and the enhanced image feature of the object to be detected can be combined to obtain the final image feature of the object to be detected, and then the candidate of the object to be detected is determined according to the final image feature of the object to be detected Box and classification.
  • the initial image feature of the object to be detected is a convolution feature map with a size of M1 ⁇ N1 ⁇ C1 (M1, N1, and C1 can represent width, height, and number of channels, respectively), and the enhanced image feature of the object to be detected is a size It is a convolution feature map of M1 ⁇ N1 ⁇ C2 (M1, N1, and C2 represent width, height, and number of channels, respectively). Then, by combining these two convolution feature maps, the final image features of the object to be detected can be obtained , The final image feature is a convolution feature map with a size of M1 ⁇ N1 ⁇ (C1+C2).
  • the description here is based on an example in which the convolution feature map of the initial image feature and the convolution feature map of the enhanced image feature have the same size (same width and height) but different channel numbers.
  • the size of the convolution feature map of the initial image feature and the convolution feature map of the enhanced image feature are different, the initial image feature and the enhanced image feature can also be combined. In this case, you can first The size of the product feature map and the convolution feature map of the enhanced image feature are unified (the width and height are unified), and then the convolution feature map of the initial image feature and the convolution feature map of the enhanced image feature are combined to obtain the final image feature Convolution feature map.
  • the detection result of the object to be detected is comprehensively determined by the initial image feature of the object to be detected and the enhanced image feature, and the detection result is obtained by considering only the initial image feature of the object to be detected In comparison, better detection results can be obtained.
  • this application when determining the detection result of the object to be detected, this application not only considers the initial image characteristics reflecting the characteristics of the object to be detected, but also considers the semantic information of other objects in the image to be detected that are associated with the object to be detected.
  • the present application comprehensively determines the detection result of the object to be detected by integrating the characteristics of the object to be detected and the characteristics of other related objects, which can improve the accuracy of the detection result of the object to be detected to a certain extent.
  • the first object when determining the detection result of the first object, the first object can be considered comprehensively.
  • the initial image features extracted from the object and the semantic information of people and roads determine the detection result of the first object. Assuming that the initial classification result of the first object is a bicycle, since people and roads are likely to appear at the same time as a bicycle, the confidence that the first object belongs to a bicycle can be improved by using the semantic information of people and roads. Therefore, the accuracy of the detection result of the first object is finally improved.
  • determining the enhanced image feature of the object to be detected according to the knowledge map information specifically includes: using the graph convolution method based on the attention mechanism to convolve the semantic information of the object category corresponding to other objects associated with the object to be detected Processing to obtain the enhanced image features of the object to be detected.
  • the enhanced image features can be extracted from each other object that is most concerned by the object to be detected, so that the information reflected by the enhanced image features is more targeted It is convenient to finally improve the detection effect of the object to be detected.
  • the spatial information-based graph sparse convolution method can also be used for convolution processing.
  • determining the enhanced image feature of the object to be detected according to the knowledge map information specifically includes: convolving the semantic information of the object category corresponding to other objects in the graph sparse convolution method based on spatial information to obtain the object to be detected The enhanced image characteristics.
  • the method shown in FIG. 4 further includes: determining the initial candidate frame and initial classification of the object to be detected according to the initial image feature of the object to be detected.
  • the entire image of the image to be detected is first subjected to convolution processing to obtain the convolution characteristics of the entire image of the image to be detected, and then according to the fixed size requirements, Divide the image to be detected into different boxes, score the features corresponding to the images in each box, filter out the boxes with higher scores as the initial candidate box, and determine the image features corresponding to the initial candidate box The initial classification of the image corresponding to the initial candidate frame.
  • the entire image of the first image can be convolved to obtain the total image of the first image. Convolution features, and then divide the first image into 3 ⁇ 3 boxes, and score the features corresponding to the image of each box. Finally, box A and box B with higher scores can be screened out as the initial candidate boxes, and then the initial classification of the image in box A can be determined by the features of the image in box A, and the The feature corresponding to the image determines the initial classification of the image in box B.
  • the process of determining the candidate frame and classification of the object to be detected may be to first combine the initial image feature and the enhanced image feature to obtain The final image feature, and then adjust the initial candidate frame according to the final image feature to obtain the candidate frame, and correct the initial classification result according to the final image feature to obtain the classification result.
  • the foregoing adjustment of the initial candidate frame according to the final image feature may be adjusting the coordinates around the initial candidate frame according to the final image feature until the candidate frame is obtained, and the foregoing adjustment of the initial classification result according to the final image feature may be Build a classifier to reclassify, and then get the classification result.
  • Fig. 6 is a schematic flowchart of an object detection method according to an embodiment of the present application.
  • the method shown in FIG. 6 may be executed by an object detection device, which may be an electronic device with an object detection function.
  • the form of the device specifically included in the electronic device can be as described above in the method shown in FIG. 4.
  • the method shown in FIG. 6 includes steps 2001 to 2003, steps 3001 to 3005, and steps 4001 and 4002. These steps are described in detail below.
  • steps 2001 to 2003 can be detailed implementations of step 1002 (or called specific implementations)
  • steps 3001 to 3005 can be detailed implementations of step 1003
  • steps 4001 and 4002 can be detailed implementations of step 1004 the way.
  • Steps 2001 to 2003 are mainly to select the initial candidate area of the image to be detected, and obtain the initial image characteristics of the initial candidate area.
  • Steps 3001 to 3005 are mainly to extract the enhanced image features of the initial candidate area, and steps 4001 and 4002 are mainly to synthesize the initial image features and enhanced image features of the initial candidate area to determine the final candidate area of the image to be processed and the classification result.
  • the image to be detected here may be a picture that needs object detection.
  • the image to be detected can be obtained either by shooting with a camera, or can be obtained from a memory.
  • the method of obtaining the image to be detected in step 2001 is similar to the method of obtaining the image to be detected in step 1001, and will not be described in detail here.
  • the initial candidate area was selected.
  • the image to be detected can be input into a traditional object detector for processing (such as Faster-RCNN) to obtain an initial candidate region and an initial classification.
  • a traditional object detector for processing such as Faster-RCNN
  • the image to be detected may be subjected to convolution processing first to obtain the convolution characteristics of the entire image of the image to be detected, and then the image to be detected is divided into different boxes according to certain size requirements, and then Score the feature corresponding to the image in each box, select the box with a higher score as the initial candidate box, and use the image feature corresponding to the initial candidate box to determine the initial classification of the image corresponding to the initial candidate box.
  • CNN can be used to extract the image features of the initial candidate region.
  • the first image is the image to be detected
  • the first image in order to obtain the initial candidate frame and initial classification of the object to be detected in the first image, the first image can be convolved to obtain the convolution of the first image Feature, and then divide the first image into 4 ⁇ 4 boxes (it can also be divided into other numbers of boxes), score the features corresponding to the image of each box, and divide the boxes A and Box B is screened out as the initial candidate box.
  • the image feature of the entire image of the image to be detected (the image feature of the entire image of the image to be detected can be obtained by convolution processing the entire image of the image to be detected) corresponding to the square
  • the initial image feature corresponding to box A and the initial image feature corresponding to box B are obtained.
  • the classifier in the object detector can be used to extract the parameters of the classification layer, and a memory pool can be constructed to record the high-level visual features of each category (for example, the color, shape and Texture).
  • the extracted classification layer parameters may be the classification layer parameters of all the classifications in the classifiers in the object detector for object detection of the object to be detected.
  • the memory pool can be continuously updated with the optimization of the classifier during the training process.
  • the classification layer parameters corresponding to different classifications in the classifier may continuously change.
  • the classification layer parameters corresponding to the classification in the memory pool can be updated.
  • a graph structure can be constructed according to a manually designed knowledge graph, or based on the feature similarity of candidate regions.
  • the obtained graph structure will record the association relationship between different nodes, for example, attribute relationship graphs of different categories, common occurrence probability, attribute similarity graph, and so on.
  • the constructed graph structure can be used to spread the information of the memory pool on the nodes by using the graph convolutional network, so that each node can obtain the global information obtained after inference.
  • step 3005 the semantic information of the object category corresponding to other objects associated with the object in the initial candidate area can be obtained according to the knowledge map information, and then the object category of the object category corresponding to the other objects associated with the object in the initial candidate area can be obtained.
  • Semantic information is used as the enhanced image feature of the initial candidate area, or the convolution processing result of the semantic information of the object category corresponding to other objects associated with the object in the initial candidate area can also be used as the enhanced image feature of the initial candidate area .
  • step 4001 the initial image feature of the initial candidate area and the enhanced image feature may be combined to obtain the final image feature of the initial candidate area.
  • the specific combination process refer to the related description about the combination of the initial image feature and the enhanced image feature under step 1004.
  • the initial candidate frame may be adjusted according to the final image feature to obtain the final candidate area (or called the final candidate frame), and the initial classification result is corrected according to the final image feature to obtain the final classification result.
  • step 4002 is equivalent to the candidate frame obtained in step 1004, and the final classification result obtained in step 4002 is equivalent to the classification obtained in step 1004.
  • the object detection method in the embodiment of the application is described in detail above in conjunction with the flowchart.
  • the object detection method in the embodiment of the application is described in detail below in conjunction with a more specific flowchart. description of.
  • FIG. 7 is a schematic flowchart of an object detection method according to an embodiment of the present application.
  • the method shown in FIG. 7 may be executed by an object detection device, which may be an electronic device with an object detection function.
  • the form of the device specifically included in the electronic device can be as described above in the method shown in FIG. 4.
  • the method shown in FIG. 7 includes steps 1 to 5, and these steps are respectively described in detail below.
  • Step 1 Construct a graph structure based on the global memory pool and knowledge graph.
  • the above-mentioned knowledge graph may be artificially constructed or obtained through neural network training.
  • the global memory pool may contain the classification layer parameters of each object type when the object to be detected is detected.
  • Step 2 Perform convolution processing on the detection image to obtain the initial convolution image feature of the image to be detected.
  • step 2 convolution processing can be performed on the entire image of the image to be detected, and the obtained convolution feature of the entire image is the initial convolution image feature of the image to be detected.
  • Step 3 Determine the initial candidate frame of the object to be detected and the initial image feature corresponding to the object to be detected.
  • the initial image feature corresponding to the object to be detected can be obtained from the initial convolution image feature of the image to be detected according to the image area corresponding to the initial candidate frame in the image to be detected, which is shown in Figure 7 The image characteristics of the initial candidate frame.
  • Step 4 Convolve the graph structure using the graph convolution method based on the attention mechanism to obtain the enhanced image features of the object to be detected.
  • step 4 the image convolution method based on the attention mechanism is used to perform convolution processing on the graph structure, which is essentially to perform convolution processing on other objects closely related to the object to be detected to obtain enhanced image features of the detected object.
  • a graph sparse convolution method based on spatial information can also be used to detect objects that are spatially associated with the object to be detected (for example, objects adjacent to the object to be detected, or the distance from the object to be detected).
  • objects that are spatially associated with the object to be detected for example, objects adjacent to the object to be detected, or the distance from the object to be detected
  • the semantic information of objects within a certain range is convolved to obtain enhanced image features of the object to be detected.
  • Step 5 Determine the detection result of the object to be detected according to the initial image feature of the object to be detected and the enhanced image feature of the object to be detected.
  • step 5 The specific process of determining the detection result in the above step 5 can refer to the related description in the method shown in FIG. 4 above, which will not be described in detail here.
  • the method of the present application shown in Table 2 means that the graph convolution method based on the attention mechanism is adopted in the convolution processing, and the knowledge graph is manually designed.
  • the test data sets include the Visual Genome (v1.4) version 1.4 data set and the ADE data set.
  • the Visual Genome (v1.4) has a large-scale general object detection data set of 1000 categories and 3000 categories. , A training data set of 92,000 images and a test set of 5,000.
  • the ADE data set has 445 types of large-scale general object detection data sets, a training data set of 20,000 images, and a test set of 1,000.
  • the average precision (AP) and average recall (AR) are mainly used for evaluation, and the accuracy under different thresholds is considered in the comparison.
  • the average precision and average recall of the object are mainly used for evaluation, and the accuracy under different thresholds is considered in the comparison.
  • Table 2 shows the improvement value of the public index of this application relative to the traditional method 4. From Table 2, it can be seen that the method of this application has a relatively obvious effect improvement compared to the traditional method 4.
  • the method of the present application has no significant increase in the size of the parameter. Therefore, compared with the traditional method 1 to the traditional method 4, the method of the present application can lift the object while ensuring that the parameter is basically unchanged. Detection effect.
  • Table 3 adds a new Common Objects in Context (COCO) data set for context information.
  • This data set has 80 common object detection labels, including about 11,000 training data sets and 5,000 tests. set.
  • the evaluation indicators in Table 3 include average AP (mean average precision, mAP), parameter amount (unit: M), processing time (unit: ms)
  • the knowledge graph information can be determined through manual preset methods, and can also be obtained through learning.
  • Table 4 shows the situation where the knowledge graph information in the embodiments of the present application is obtained through learning. The following is compared with the effect of the traditional method, and the obtained effect is shown in Table 4.
  • the 5 traditional methods are traditional method A (light-head RCNN), traditional method B (Cascade RCNN), traditional method C (HKRM), and traditional method D (Faster -RCNN) and traditional method E (FPN), based on different implementation architectures, the method of this application can be divided into method X (Faster-RCNN w SGRN) and method Y (FPN w SGRN) of this application. It can be seen from Table 4 that both the method X of this application and the method Y of this application, the AP index and the AR index are improved compared to the traditional scheme. Therefore, the object detection method of the embodiment of the present application can significantly improve the recognition accuracy and recall rate of existing object detectors.
  • the object detection method of the embodiment of the present application is described in detail above in conjunction with the accompanying drawings.
  • the object detection method of the embodiment of the present application may use a neural network (model) to realize object detection.
  • the neural network (model) used here can be obtained by training according to a certain training method.
  • the training method of the neural network of the embodiment of the present application will be introduced below with reference to FIG. 8.
  • Fig. 8 is a schematic flowchart of a neural network training method according to an embodiment of the present application.
  • the method shown in FIG. 8 can be executed by a device with strong computing capability such as a computer device, a server device, or a computing device.
  • the method shown in FIG. 8 includes steps 5001 to 5005, which are respectively described in detail below.
  • the training data in step 5001 includes training images and object detection and labeling results of the objects to be detected in the training images.
  • the knowledge map information in step 5003 includes the association relationship between object categories corresponding to different objects in the training image, and the enhanced image feature of the object to be detected in the training image indicates that the object is associated with the object to be detected. Semantic information of the object category.
  • the object detection and annotation result of the object to be detected in the training image includes the annotation candidate frame and the annotation classification result of the object to be detected in the training image.
  • the aforementioned label candidate frame and label classification result may be pre-labeled (specifically, it may be manually labeled).
  • a set of initial model parameters can be set for the neural network, and then based on the object detection result of the object to be detected in the training image and the object detection labeling result of the object to be detected in the training image Gradually adjust the model parameters of the neural network until the difference between the object detection structure of the object to be detected in the training image and the object detection and annotation results of the object to be detected in the training image is within a certain preset range, or when When the number of times of training reaches the preset number of times, the model parameters of the neural network at this time are determined as the final parameters of the neural network model, thus completing the training of the neural network.
  • neural network trained through the method shown in FIG. 8 can be used to implement the object detection method of the embodiment of the present application.
  • the training method of the present application extracts more features for object detection during the training process, and can train a neural network with better performance, so that the neural network for object detection can achieve better object detection results. .
  • the above-mentioned knowledge graph information is preset.
  • the above-mentioned knowledge graph information is obtained by training other neural network models according to training data, and the training data includes training images and object categories to which different objects in the training images belong.
  • the other neural network models here may be different from the neural network models trained in the training method shown in FIG. 8.
  • the association relationship between object categories corresponding to different objects in the above training image includes at least one of the following: attribute association relationships of different object categories; position relationships between different object categories; among word vectors of different object categories The degree of similarity between the two; the probability that different object categories appear at the same time.
  • the object detection method and neural network training method of the embodiment of the present application are described in detail above with reference to the accompanying drawings.
  • the following describes the related apparatus of the embodiment of the present application in detail with reference to FIGS. 9 to 11.
  • the object detection device shown in FIG. 9 and FIG. 10 can execute each step of the object detection method of the embodiment of the application
  • the neural network training device shown in FIG. 11 can execute each of the neural network training methods of the embodiment of the application. Steps, the repeated description will be appropriately omitted when introducing the devices shown in FIGS. 9 to 11 below.
  • Fig. 9 is a schematic block diagram of an object detection device according to an embodiment of the present application.
  • the object detection device 7000 shown in FIG. 9 includes:
  • the image acquisition unit 7001 is used to acquire the image to be detected
  • the feature extraction unit 7002 is configured to perform convolution processing on the image to be detected to obtain the initial image feature of the object to be detected in the image to be detected;
  • the feature extraction unit 7002 is also used to determine the enhanced image feature of the object to be detected according to the knowledge map information
  • the detection unit 7003 is configured to determine the candidate frame and classification of the object to be detected according to the initial image feature of the object to be detected and the enhanced image feature of the object to be detected.
  • the above-mentioned knowledge map information includes the association relationship between different object categories corresponding to different objects in the image to be detected, and the enhanced image feature of the above-mentioned object to be detected indicates the semantics of the object category corresponding to other objects associated with the object to be detected information.
  • the detection result of the object to be detected is comprehensively determined by the initial image feature of the object to be detected and the enhanced image feature, and the detection result is obtained by considering only the initial image feature of the object to be detected In comparison, better detection results can be obtained.
  • the image acquisition unit 7001 in the object detection device 7000 may be equivalent to the I/O interface 112 in the execution device 110, and the object detection device 7000
  • the feature extraction unit 7002 and the detection unit 7003 in are equivalent to the calculation module 111 in the execution device 110.
  • the image acquisition unit 7001 in the object detection device 7000 may be equivalent to the bus interface unit 510 in the neural network processor 50, and the object The feature extraction unit 7002 and the detection unit 7003 in the detection device 7000 are equivalent to the arithmetic circuit 503 in the execution device 110, or the feature extraction unit 7002 and the detection unit 7003 in the object detection device 7000 can also be equivalent to the calculation in the execution device 110 Circuit 503+vector calculation unit 507+accumulator 508.
  • Fig. 10 is a schematic block diagram of an object detection device according to an embodiment of the present application.
  • the object detection device 8000 shown in FIG. 10 includes a memory 8001, a processor 8002, a communication interface 8003, and a bus 8004.
  • the memory 8001, the processor 8002, and the communication interface 8003 implement communication connections between each other through the bus 8004.
  • the communication interface 8003 is equivalent to the image acquisition unit 7001 in the object detection device 7000, and the processor 8002 is equivalent to the feature extraction unit 7002 and the detection unit 7003 in the object detection device 7000.
  • the various modules and units in the object detection device 8000 are described in detail below.
  • the memory 8001 may be a read only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM).
  • the memory 8001 may store a program.
  • the processor 8002 and the communication interface 8003 are used to execute each step of the object detection method in the embodiment of the present application.
  • the communication interface 8003 may obtain the image to be detected from a memory or other devices, and then the processor 8002 performs object detection on the image to be detected.
  • the processor 8002 may adopt a general central processing unit (CPU), a microprocessor, an application specific integrated circuit (ASIC), a graphics processing unit (GPU), or one or more An integrated circuit, used to execute related programs to implement the functions required by the units in the object detection device of the embodiment of the present application (for example, the processor 8002 can implement the feature extraction unit 7002 and the detection unit 7003 in the above object detection device 7000 Function required to be executed), or execute the object detection method of the embodiment of the present application.
  • CPU central processing unit
  • ASIC application specific integrated circuit
  • GPU graphics processing unit
  • the processor 8002 may also be an integrated circuit chip with signal processing capabilities.
  • each step of the object detection method in the embodiment of the present application can be completed by an integrated logic circuit of hardware in the processor 8002 or instructions in the form of software.
  • the aforementioned processor 8002 may also be a general-purpose processor, digital signal processing (DSP), ASIC, ready-made programmable gate array (field programmable gate array, FPGA) or other programmable logic devices, discrete gates or transistor logic Devices, discrete hardware components.
  • DSP digital signal processing
  • FPGA field programmable gate array
  • the aforementioned general-purpose processor may be a microprocessor or the processor may also be any conventional processor.
  • the steps of the method disclosed in the embodiments of the present application may be directly embodied as being executed and completed by a hardware decoding processor, or executed and completed by a combination of hardware and software modules in the decoding processor.
  • the software module can be located in a mature storage medium in the field such as random access memory, flash memory, read-only memory, programmable read-only memory, or electrically erasable programmable memory, registers.
  • the storage medium is located in the memory 8001, and the processor 8002 reads the information in the memory 8001, and combines its hardware to complete the functions required by the unit included in the object detection device of the embodiment of the present application, or perform the object detection of the method embodiment of the present application method.
  • the communication interface 8003 uses a transceiver device such as but not limited to a transceiver to implement communication between the device 8000 and other devices or communication networks. For example, the image to be processed can be obtained through the communication interface 8003.
  • a transceiver device such as but not limited to a transceiver to implement communication between the device 8000 and other devices or communication networks.
  • the image to be processed can be obtained through the communication interface 8003.
  • the bus 8004 may include a path for transferring information between various components of the device 8000 (for example, the memory 8001, the processor 8002, and the communication interface 8003).
  • FIG. 11 is a schematic diagram of the hardware structure of a neural network training device according to an embodiment of the present application. Similar to the above device 8000, the neural network training device 9000 shown in FIG. 11 includes a memory 9001, a processor 9002, a communication interface 9003, and a bus 9004. Among them, the memory 9001, the processor 9002, and the communication interface 9003 implement communication connections between each other through the bus 9004.
  • the memory 9001 may store a program.
  • the processor 9002 is configured to execute each step of the neural network training method of the embodiment of the present application.
  • the processor 9002 may adopt a general-purpose CPU, a microprocessor, an ASIC, a GPU or one or more integrated circuits to execute related programs to implement the neural network training method of the embodiment of the present application.
  • the processor 9002 may also be an integrated circuit chip with signal processing capabilities.
  • the steps of the neural network training method in the embodiment of the present application can be completed by the integrated logic circuit of hardware in the processor 9002 or instructions in the form of software.
  • the neural network is trained by the neural network training device 9000 shown in FIG. 11, and the trained neural network can be used to execute the object detection method of the embodiment of the present application (the method shown in FIG. 8).
  • the device shown in FIG. 11 can obtain training data and the neural network to be trained from the outside through the communication interface 9003, and then the processor trains the neural network to be trained according to the training data.
  • the device 8000 and device 9000 only show a memory, a processor, and a communication interface, in the specific implementation process, those skilled in the art should understand that the device 8000 and the device 9000 may also include those necessary for normal operation. Other devices. At the same time, according to specific needs, those skilled in the art should understand that the device 8000 and the device 9000 may also include hardware devices that implement other additional functions. In addition, those skilled in the art should understand that the device 8000 and the device 9000 may also include only the components necessary to implement the embodiments of the present application, and not necessarily include all the components shown in FIG. 10 and FIG. 11.
  • the disclosed system, device, and method may be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of the units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components can be combined or It can be integrated into another system, or some features can be ignored or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • each unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium.
  • the technical solution of this application essentially or the part that contributes to the existing technology or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the method described in each embodiment of the present application.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (read-only memory, ROM), random access memory (random access memory, RAM), magnetic disk or optical disk and other media that can store program code .

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Evolutionary Computation (AREA)
  • General Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Software Systems (AREA)
  • Computing Systems (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Multimedia (AREA)
  • Data Mining & Analysis (AREA)
  • Medical Informatics (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Mathematical Physics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Biophysics (AREA)
  • Molecular Biology (AREA)
  • Biomedical Technology (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Image Analysis (AREA)

Abstract

本申请提供了物体检测方法和装置。涉及人工智能领域,具体涉及计算机视觉领域。该方法包括:先获取待检测图像;然后对该检测图像进行卷积处理,以得到待检测图像中的待检测物体的初始图像特征;再根据知识图谱信息确定待检测物体的增强图像特征,最后再综合待检测物体的初始图像特征和增强图像特征来确定待检测物体的候选框和分类。由于上述增强图像特征指示了待检测物体相关联的其他物体对应的不同物体类别的语义信息,因此,本申请能够提高物体检测方法的效果。

Description

物体检测方法、装置和计算机存储介质
本申请要求于2019年06月17日提交中国专利局、申请号为201910523157.5、申请名称为“物体检测方法、装置和计算机存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及本申请涉及计算机视觉领域,并且更具体地,涉及一种物体检测方法、装置和计算机存储介质。
背景技术
计算机视觉是各个应用领域,如制造业、检验、文档分析、医疗诊断,和军事等领域中各种智能/自主系统中不可分割的一部分,它是一门关于如何运用照相机/摄像机和计算机来获取我们所需的,被拍摄对象的数据与信息的学问。形象地说,计算机视觉就是给计算机安装上眼睛(照相机/摄像机)和大脑(算法)用来代替人眼对目标进行识别、跟踪和测量等,从而使计算机能够感知环境。因为感知可以看作是从感官信号中提取信息,所以计算机视觉也可以看作是研究如何使人工系统从图像或多维数据中“感知”的科学。总的来说,计算机视觉就是用各种成像系统代替视觉器官获取输入信息,再由计算机来代替大脑对这些输入信息完成处理和解释。计算机视觉的最终研究目标就是使计算机能像人那样通过视觉观察和理解世界,具有自主适应环境的能力。
物体检测是计算机视觉领域中的具体应用。物体检测是指在一张图片或者一段视频中标出物体的位置以及物体的类别过程。传统方案一般对待检测图片中的不同物体分别进行检测,以确定待检测图片中的每个物体的位置和分类。但是,在很多场景(例如,待检测图片中的物体比较多,物体之间的遮挡也比较严重)下,传统方案的检测效果一般。
发明内容
本申请提供一种物体检测方法、装置和计算机存储介质,以提高物体检测的效果。
第一方面,提供了一种物体检测方法,该方法包括:获取待检测图像;对待检测图像进行卷积处理,得到待检测物体的初始图像特征;根据知识图谱信息确定待检测物体的增强图像特征;根据待检测物体的初始图像特征和待检测物体的增强图像特征,确定待检测物体的候选框和分类。
其中,上述知识图谱信息包括待检测图像中的不同物体对应的不同物体类别之间的关联关系,上述待检测物体的增强图像特征指示了与待检测物体相关联的其它物体对应的物体类别的语义信息。
上述确定的待检测物体的候选框可以是待检测物体的最终候选框,上述确定的待检测物体的分类可以是待检测物体的最终分类(结果)。
上述物体检测方法可以应用在不同的应用场景中,例如,上述物体检测方法可以应用在识别万物的场景中,也可以应用在街景识别的场景中。
当上述方法应用在利用移动终端来识别万物的场景时,上述待检测图像可以是移动终端通过摄像头拍摄的图像,也可以是移动终端相册中已经存储的图像。
当上述方法应用在街景识别的场景时,上述待检测图像可以是路边的摄像头拍摄的街景图像。
上述初始图像特征和增强图像特征具体可以是卷积特征图。
上述物体检测方法可以由神经网络来执行,具体地,上述物体检测方法可以由卷积神经网络CNN或者深度神经网络DNN来执行。
可选地,上述对待检测图像进行卷积处理,包括:采用卷积神经网络CNN或者深度神经网络DNN对待检测图像进行卷积处理。
可选地,上述方法还包括:根据待检测物体的初始图像特征确定待检测物体的初始候选框和初始分类。
在确定待检测物体的初始候选框和初始分类的过程中,一般是先对待检测图像的整个图像进行卷积处理,得到待检测图像的整个图像的卷积特征,然后再根据固定的尺寸要求,将待检测图像划分成不同的方框,对每个方框内的图像对应的特征进行打分,将打分较高的方框筛选出来作为初始候选框,并以该初始候选框对应的图像特征确定初始候选框对应的图像的初始分类。
例如,待检测图像为第一图像,为了获得第一图像中的待检测物体的初始候选框和初始分类,可以先对第一图像的整个图像进行卷积处理,得到第一图像的整个图像的卷积特征,然后将第一图像划分成3×3个方框,对每个方框的图像对应的特征进行打分。最后可以将打分较高的方框A和方框B筛选出来作为初始候选框,然后再以方框A内的图像对应的特征确定方框A内的图像的初始分类,以方框B内的图像对应的特征确定方框B内的图像的初始分类。
本申请中,在对待检测图像进行物体检测时,通过待检测物体的初始图像特征和增强图像特征来综合确定待检测物体的检测结果,与仅考虑待检测物体的初始图像特征获取检测结果的方式相比,能够得到更好的检测结果。
具体地,本申请在确定待检测物体的检测结果时,不仅考虑到了反映待检测物体本身特性的初始图像特征,还考虑到了待检测图像中与待检测物体相关联的其他物体的语义信息。本申请通过综合待检测物体本身特征以及相关联的其他物体的特征来综合确定待检测物体的检测结果,能够在一定程度上提高待检测物体的检测结果的准确性。
例如,待检测图像中存在待检测的第一物体,待检测图像中与该第一物体相关联的物体包括道路和人,那么,在确定第一物体的检测结果时,可以综合考虑从第一物体提取到的初始图像特征,以及人和道路的语义信息来确定第一物体的检测结果。假设,第一物体的初始分类结果是自行车,那么,由于人和道路与自行车同时出现的可能性很大,因此,能够通过借助人和道路的语义信息能够提高第一物体属于自行车的置信度,从而最终提高第一物体的检测结果的准确性。
可选地,上述对待检测图像进行卷积处理,得到待检测物体的初始图像特征,包括:对待检测图像的整个图像进行卷积处理,得到待检测图像的完整图像特征;将该待检测图 像的完整图像特征中与待检测物体对应的图像特征确定为待检测物体的初始图像特征。
本申请中,先对待检测图像的整个图像进行卷积处理得到待检测图像的完整图像特征,然后再从待检测图像的完整图像特征中获取与待检测物体对应的图像特征,这种获取待检测物体的图像特征的方式与每次都单独获取各个待检测物体对应的图像特征的方式相比,能够减少获取待检测物体的图像特征的复杂度。
可选地,上述根据知识图谱信息确定待检测物体的增强图像特征,包括:根据知识图谱信息和记忆池信息确定图结构信息;根据该图结构信息确定待检测物体的增强图像特征。
上述根据知识图谱信息和记忆池信息确定图结构信息,也可以称为根据知识图谱信息和记忆池信息生成图结构。
上述图结构信息(或者也可以称为图结构)可以包括多个节点,其中,每个节点对应一个物体类别,相互连接的节点之间对应的物体类别(或者也可以称为物体分类)有一定的关联关系,每个节点包含对应的物体类别的语义信息。上述图结构一般可以包括多个节点,该多个节点对应的物体类别可以包含待检测物体的物体类别,以及与待检测物体的物体类别相关联的其它物体类别。
在根据图结构信息确定待检测物体的增强图像特征时,具体可以是根据图结构信息确定出待检测物体的物体类别在图结构中对应的节点,然后将该节点的周围节点的语义信息提取出来,这样就得到了待检测物体的增强图像特征。
另外,在根据知识图谱信息和记忆池信息确定图结构信息时,具体可以是根据记忆池信息中包含的物体类别的种类以及知识图谱信息中包含的不同物体类别之间的关联关系来生成图结构信息。
例如,上述知识图谱信息包括1000个物体类别之间的关联关系,上述记忆池包含100个物体类别的分类层参数,那么,可以从知识图谱信息中获取记忆池信息中记录的100个物体类别之间的关联关系,接下来,就可以根据该100个物体类别之间的关联关系来构的图结构(该图结构包含100个节点,该100个节点对应上述100个物体类别)了。
可选地,上述根据待检测物体的初始图像特征和待检测物体的增强图像特征,确定待检测物体的候选框和分类,包括:对待检测物体的初始图像特征和待检测物体的增强图像特征进行组合,得到待检测物体的最终图像特征;根据待检测物体的最终图像特征确定待检测物体的候选框和分类。
具体地,待检测物体的初始图像特征和待检测物体的增强图像特征可以对应不同维数的张量,而待检测物体的最终图像特征对应的张量可以是待检测物体的初始图像特征对应的张量和待检测物体的增强图像特征对应的张量合并得到的。
例如,待检测物体的初始图像特征为一个大小为M1×N1×C1的卷积特征图,待检测物体的增强图像特征是一个大小为M1×N1×C2的卷积特征图,那么,通过对这两个卷积特征图的组合,可以得到待检测物体的最终图像特征,该最终图像特征是一个大小为M1×N1×(C1+C2)卷积特征图。
结合第一方面,在第一方面的某些实现方式中,上述知识图谱信息是预先设定的。
具体地,上述知识图谱信息可以是根据经验预先设定好的。例如,可以根据人工标注的不同类别的物体之间的关联关系来设置或者生成知识图谱信息。
例如,可以通过人为统计不同类别的物体之间的相似程度以及不同类别的物体之间同时出现的概率来确定知识图谱信息。
结合第一方面,在第一方面的某些实现方式中,待检测图像中的不同物体对应的不同物体类别之间的关联关系包括以下信息中的至少一种:不同物体类别的属性关联关系;不同物体类别之间的位置关系;不同物体类别的词向量之间的相似程度;不同物体类别同时出现的概率。
上述不同类别的物体的属性关联关系具体可以是指不同类别的物体之间是否具有相同的属性。例如,苹果的颜色是红色,草莓的颜色也是红色,那么,苹果和草莓在颜色上具有相同的属性(或者,也可以说苹果和草莓在颜色属性上比较接近)。
结合第一方面,在第一方面的某些实现方式中,上述知识图谱信息是根据训练数据对神经网络模型进行训练得到的,该训练数据包括训练图像以及训练图像中不同物体所属的物体类别。
其中,上述训练图像中一般可以包含多个待检测物体,上述训练图像中不同物体所属的物体类别也可以称为训练图像的标记数据,该标记数据可以是(人工)预先标注好的数据。
在上述训练过程中,可以先预设一个初始知识图谱信息(该初始的知识图谱信息可以是),然后在利用训练数据对神经网络模型进行训练的过程中不断调整该初始知识图谱信息,当到训练图像的检测结果与训练图像的标记结果比较接近时(也可以是在训练次数达到一定程度时),就可以把当前的知识图谱信息作为最终训练得到的知识图谱信息了。
上述初始知识图谱信息可以包括待检测图像中的不同物体对应的不同物体类别之间的关联关系,该初始知识图谱信息中包含的待检测图像中的不同物体对应的不同物体类别之间的关联关系可以是随机设置的。
结合第一方面,在第一方面的某些实现方式中,上述根据知识图谱信息确定待检测物体的增强图像特征,包括:采用基于注意力机制的图卷积方式或者基于空间信息的图稀疏卷积方式对待检测物体相关联的其它物体对应的物体类别的语义信息进行卷积处理,得到待检测物体的增强图像特征。
本申请中,当采用基于注意力机制的图卷积方式进行卷积处理时,能够从每个从待检测物体最关注的其它物体中提取增强图像特征,使得增强图像特征反映的信息更有针对性,便于最终提高待检测物体的检测效果。
本申请中,当基于空间信息的图稀疏卷积方式进行卷积处理时,能够从与待检测物体的空间距离在一定范围内的其它物体中提取增强图像特征,使得增强图像特征反映的信息更有针对性,便于最终提高待检测物体的检测效果。
结合第一方面,在第一方面的某些实现方式中,上述方法还包括:显示待检测物体的检测结果,待检测物体的检测结果包括待检测物体的候选框和分类。
通过显示待检测物体的候选框和分类,便于用户查看最终的检测结果,提高用户体验。
可选地,上述显示待检测物体的检测结果,包括:在显示屏上显示待检测物体的检测结果。
上述第一方面的方法可以由神经网络(模型)来执行。具体地,在获取到待检测图像之后,可以通过神经网络对待检测图像进行卷积处理,得到待检测物体的初始图像特征, 根据神经网络以及知识图谱信息确定待检测物体的增强图像特征,然后利用神经网络再根据待检测物体的初始图像特征和待检测物体的增强图像特征,确定待检测物体的候选框和分类。
第二方面,提供了一种神经网络的训练方法,该方法包括:获取训练数据,该训练数据包括训练图像以及训练图像中待检测物体的物体检测标注结果;根据神经网络提取该训练图像中的待检测物体的初始图像特征;根据该神经网络以及知识图谱信息提取该训练图像中的待检测物体的增强图像特征;根据该神经网络对待检测物体的初始图像特征和增强图像特征进行处理,得到该待检测物体的物体检测结果;根据该训练图像的中的待检测物体的物体检测结果与该训练图像中的待检测物体的物体检测标注结果,确定该神经网络的模型参数。
其中,上述知识图谱信息包括训练图像中的不同物体对应的物体类别之间的关联关系,上述训练图像中的待检测物体的增强图像特征指示了与该待检测物体相关联的其它物体对应的物体类别的语义信息。
上述训练图像中的待检测物体的物体检测标注结果包括该训练图像中的待检测物体的标注候选框和标注分类结果。
上述标注候选框和标注分类结果可以是预先(具体可以是通过人工进行标注)标注好的。
另外,在上述训练的过程中,采用的训练图像一般是多个。
在对上述神经网络进行训练的过程中,可以为神经网络设置一套初始的模型参数,然后根据训练图像中的待检测物体的物体检测结果与训练图像中的待检测物体的物体检测标注结果的差异来逐渐调整神经网络的模型参数,直到训练图像中的待检测物体的物体检测结构与训练图像中的待检测物体的物体检测标注结果之间的差异在一定的预设范围内,或者,当训练的次数达到预设次数时,将此时的神经网络的模型参数确定为该神经网络模型的最终的参数,这样就完成了对神经网络的训练了。
应理解,通过第二方面训练得到的神经网络能够用于执行本申请第一方面中的方法。
本申请中,在训练神经网络时,不仅提取了训练图像中的待检测物体的初始图像特征,还提取了训练图像中的待检测物体的增强图像特征,并综合根据待检测物体的初始图像特征和增强图像特征来确定待检测物体的物体检测结果。也就是说,本申请的训练方法在训练过程中提取了更多的特征来进行物体检测,可以训练得到性能更好的神经网络,使得利用该神经网络进行物体检测能够取得更好的物体检测效果。
结合第二方面,在第二方面的某些实现方式中,上述知识图谱信息是预先设定的。
结合第二方面,在第二方面的某些实现方式中,上述知识图谱信息是根据训练数据对其它神经网络模型进行训练得到的,训练数据包括训练图像以及所述训练图像中不同物体所属的物体类别。
这里的其它神经网络模型可以是不同于第二方面的训练方法中进行训练的神经网络模型。
结合第二方面,在第二方面的某些实现方式中,上述训练图像中的不同物体对应的不同物体类别之间的关联关系包括以下至少一种:不同物体类别的属性关联关系;不同物体类别之间的位置关系;不同物体类别的词向量之间的相似程度;不同物体类别同时出现的 概率。
第三方面,提供了一种物体检测装置,该物体检测装置包括用于执行上述第一方面中的方法中的各个模块。
第四方面,提供了一种神经网络的训练装置,该装置包括用于执行上述第二方面中的方法中的各个模块。
第五方面,提供了一种物体检测装置,该装置包括:存储器,用于存储程序;处理器,用于执行所述存储器存储的程序,当所述存储器存储的程序被执行时,所述处理器用于执行上述第一方面中的方法。
第六方面,提供了一种神经网络的训练装置,该装置包括:存储器,用于存储程序;处理器,用于执行所述存储器存储的程序,当所述存储器存储的程序被执行时,所述处理器用于执行上述第二方面中的方法。
第七方面,提供了一种电子设备,该电子设备包括上述第三方面或者第五方面中的物体检测装置。
第八方面,提供了一种电子设备,该电子设备包括上述第四方面或者第六方面中的物体检测装置。
上述电子设备具体可以是移动终端(例如,智能手机),平板电脑,笔记本电脑,增强现实/虚拟现实设备以及车载终端设备等等。
第九方面,提供一种计算机存储介质,该计算机存储介质存储有程序代码,该程序代码包括用于执行第一方面或者第二方面中的方法中的步骤的指令。
第十方面,提供一种包含指令的计算机程序产品,当该计算机程序产品在计算机上运行时,使得计算机执行上述第一方面或者第二方面中的方法。
第十一方面,提供一种芯片,所述芯片包括处理器与数据接口,所述处理器通过所述数据接口读取存储器上存储的指令,执行上述第一方面或者第二方面中的方法。
可选地,作为一种实现方式,所述芯片还可以包括存储器,所述存储器中存储有指令,所述处理器用于执行所述存储器上存储的指令,当所述指令被执行时,所述处理器用于执行第一方面中的方法。
上述芯片具体可以是现场可编程门阵列FPGA或者专用集成电路ASIC。
应理解,上述第一方面的方法具体可以是指第一方面以及第一方面中各种实现方式中的任意一种实现方式中的方法。上述第二方面的方法具体可以是指第二方面以及第二方面中各种实现方式中的任意一种实现方式中的方法。
附图说明
图1是本申请实施例提供的系统架构的结构示意图;
图2是利用本申请实施例提供的卷积神经网络模型进行物体检测的示意图;
图3是本申请实施例提供的一种芯片硬件结构示意图;
图4是本申请实施例的物体检测方法的示意性流程图;
图5是本申请实施例的图结构的示意图;
图6是本申请实施例的物体检测方法的流程图;
图7是本申请实施例的物体检测方法的流程图;
图8是本申请实施例的神经网络的训练方法的示意性流程图;
图9是本申请实施例的物体检测装置的示意性框图;
图10是本申请实施例的物体检测装置的示意性框图;
图11是本申请实施例的神经网络训练装置的示意性框图。
具体实施方式
下面将结合附图,对本申请中的技术方案进行描述。
本申请实施例本能够应用于大规模物体检测的场景中。例如,人脸识别,识别万物,无人车感知系统物体识别,社交网站照片物体识别,智能机器人物体识别等。
具体地,本申请实施例的物体检测方法可以应用在手机识别万物以及街景识别等场景中,下面分别对这两种场景进行简单的介绍。
手机识别万物:
利用手机上的摄像头,可以拍摄包含各种事物的图片。在获取图片之后,接下来通过对该图片进行物体检测,能够确定图片中的每个物体的位置和类别。
利用本申请实施例的物体检测方法能够对手机拍摄到的图片进行物体检测,由于本申请实施例的物体检测方法在对物体进行检测时结合了知识图谱,因此,采用本申请实施例的物体检测方法对手机拍摄到的图片进行物体检测时的效果更好(例如,物体的位置以及物体的分类更加准确)。
街景识别:
通过部署在街边的摄像头可以对往来的车辆和人群进行拍照,在获取到图片之后,可以将图片上传到控制中心设备,由控制中心设备对图片进行物体检测,得到物体检测结果,当出现异常的物体时,控制中心可以发出报警。
下面从模型训练侧和模型应用侧对本申请提供的方法进行描述:
本申请实施例提供的神经网络的训练方法,涉及计算机视觉的处理,具体可以应用于数据训练、机器学习、深度学习等数据处理方法,对训练数据(如本申请中的训练图片以及训练图片的标注结果)进行符号化和形式化的智能信息建模、抽取、预处理、训练等,最终得到训练好的神经网络。
本申请实施例提供的物体检测方法可以运用上述训练好的神经网络,将输入数据(如本申请中的图片)输入到所述训练好的神经网络中,得到输出数据(如本申请中的图片的检测结果)。需要说明的是,本申请实施例提供的神经网络的训练方法和本申请实施例的物体检测方法是基于同一个构思产生的发明,也可以理解为一个系统中的两个部分,或一个整体流程的两个阶段:如模型训练阶段和模型应用阶段。
由于本申请实施例涉及到了大量神经网络的应用,为了便于理解,下面先对本申请实施例涉及的相关术语及神经网络等相关概念进行介绍。
由于本申请实施例涉及大量神经网络的应用,为了便于理解,下面先对本申请实施例可能涉及的神经网络的相关术语和概念进行介绍。
(1)神经网络
神经网络可以是由神经单元组成的,神经单元可以是指以x s和截距1为输入的运算单元,该运算单元的输出可以如公式(1)所示:
Figure PCTCN2020089438-appb-000001
其中,s=1、2、……n,n为大于1的自然数,W s为x s的权重,b为神经单元的偏置。f为神经单元的激活函数(activation functions),用于将非线性特性引入神经网络中,来将神经单元中的输入信号转换为输出信号。该激活函数的输出信号可以作为下一层卷积层的输入,激活函数可以是sigmoid函数。神经网络是将多个上述单一的神经单元联结在一起形成的网络,即一个神经单元的输出可以是另一个神经单元的输入。每个神经单元的输入可以与前一层的局部接受域相连,来提取局部接受域的特征,局部接受域可以是由若干个神经单元组成的区域。
(2)深度神经网络
深度神经网络(deep neural network,DNN),也称多层神经网络,可以理解为具有多层隐含层的神经网络。按照不同层的位置对DNN进行划分,DNN内部的神经网络可以分为三类:输入层,隐含层,输出层。一般来说第一层是输入层,最后一层是输出层,中间的层数都是隐含层。层与层之间是全连接的,也就是说,第i层的任意一个神经元一定与第i+1层的任意一个神经元相连。
虽然DNN看起来很复杂,但是就每一层的工作来说,其实并不复杂,简单来说就是如下线性关系表达式:
Figure PCTCN2020089438-appb-000002
其中,
Figure PCTCN2020089438-appb-000003
是输入向量,
Figure PCTCN2020089438-appb-000004
是输出向量,
Figure PCTCN2020089438-appb-000005
是偏移向量,W是权重矩阵(也称系数),α()是激活函数。每一层仅仅是对输入向量
Figure PCTCN2020089438-appb-000006
经过如此简单的操作得到输出向量
Figure PCTCN2020089438-appb-000007
由于DNN层数多,系数W和偏移向量
Figure PCTCN2020089438-appb-000008
的数量也比较多。这些参数在DNN中的定义如下所述:以系数W为例:假设在一个三层的DNN中,第二层的第4个神经元到第三层的第2个神经元的线性系数定义为
Figure PCTCN2020089438-appb-000009
上标3代表系数W所在的层数,而下标对应的是输出的第三层索引2和输入的第二层索引4。
综上,第L-1层的第k个神经元到第L层的第j个神经元的系数定义为
Figure PCTCN2020089438-appb-000010
需要注意的是,输入层是没有W参数的。在深度神经网络中,更多的隐含层让网络更能够刻画现实世界中的复杂情形。理论上而言,参数越多的模型复杂度越高,“容量”也就越大,也就意味着它能完成更复杂的学习任务。训练深度神经网络的也就是学习权重矩阵的过程,其最终目的是得到训练好的深度神经网络的所有层的权重矩阵(由很多层的向量W形成的权重矩阵)。
(3)卷积神经网络
卷积神经网络(convolutional neuron network,CNN)是一种带有卷积结构的深度神经网络。卷积神经网络包含了一个由卷积层和子采样层构成的特征抽取器,该特征抽取器可以看作是滤波器。卷积层是指卷积神经网络中对输入信号进行卷积处理的神经元层。在卷积神经网络的卷积层中,一个神经元可以只与部分邻层神经元连接。一个卷积层中,通常包含若干个特征平面,每个特征平面可以由一些矩形排列的神经单元组成。同一特征平面的神经单元共享权重,这里共享的权重就是卷积核。共享权重可以理解为提取图像信息的方式与位置无关。卷积核可以以随机大小的矩阵的形式初始化,在卷积神经网络的训练过程中卷积核可以通过学习得到合理的权重。另外,共享权重带来的直接好处是减少卷积神经网络各层之间的连接,同时又降低了过拟合的风险。
(4)残差网络
残差网络是在2015年提出的一种深度卷积网络,相比于传统的卷积神经网络,残差 网络更容易优化,并且能够通过增加相当的深度来提高准确率。残差网络的核心是解决了增加深度带来的副作用(退化问题),这样能够通过单纯地增加网络深度,来提高网络性能。残差网络一般会包含很多结构相同的子模块,通常会采用ResNet连接一个数字表示子模块重复的次数,比如ResNet50表示残差网络中有50个子模块。
(6)分类器
很多神经网络结构最后都有一个分类器,用于对图像中的物体进行分类。分类器一般由全连接层(fully connected layer)和softmax函数组成,能够根据输入而输出不同类别的概率。
(7)损失函数
在训练深度神经网络的过程中,因为希望深度神经网络的输出尽可能的接近真正想要预测的值,所以可以通过比较当前网络的预测值和真正想要的目标值,再根据两者之间的差异情况来更新每一层神经网络的权重向量(当然,在第一次更新之前通常会有初始化的过程,即为深度神经网络中的各层预先配置参数),比如,如果网络的预测值高了,就调整权重向量让它预测低一些,不断地调整,直到深度神经网络能够预测出真正想要的目标值或与真正想要的目标值非常接近的值。因此,就需要预先定义“如何比较预测值和目标值之间的差异”,这便是损失函数(loss function)或目标函数(objective function),它们是用于衡量预测值和目标值的差异的重要方程。其中,以损失函数举例,损失函数的输出值(loss)越高表示差异越大,那么深度神经网络的训练就变成了尽可能缩小这个loss的过程。
(8)反向传播算法
神经网络可以采用误差反向传播(back propagation,BP)算法在训练过程中修正初始的神经网络模型中参数的大小,使得神经网络模型的重建误差损失越来越小。具体地,前向传递输入信号直至输出会产生误差损失,通过反向传播误差损失信息来更新初始的神经网络模型中参数,从而使误差损失收敛。反向传播算法是以误差损失为主导的反向传播运动,旨在得到最优的神经网络模型的参数,例如权重矩阵。
以上对神经网络的一些基本内容做了简单介绍,下面针对图像数据处理时可能用到的一些特定神经网络进行介绍。
(9)图卷积神经网络
图(graph)是一种数据格式,它可以用于表示社交网络、通信网络、蛋白分子网络等,图中的节点表示网络中的个体,连线表示个体之间的连接关系。许多机器学习任务例如社团发现、链路预测等都需要用到图结构数据,因此图卷积神经网络(graph convolutional network,GCN)的出现为这些问题的解决提供了新的思路。利用GCN能够对图数据进行深度学习。
GCN是对卷积神经网络在图域(graph domain)上的自然推广。它能同时对节点特征信息与结构信息进行端对端学习,是目前对图数据学习任务的最佳选择。GCN的适用性极广,适用于任意拓扑结构的节点与图。
下面结合图1对本申请实施例的系统架构进行详细的介绍。
图1是本申请实施例的系统架构的示意图。如图1所示,系统架构100包括执行设备110、训练设备120、数据库130、客户设备140、数据存储系统150、以及数据采集系统 160。
另外,执行设备110包括计算模块111、I/O接口112、预处理模块113和预处理模块114。其中,计算模块111中可以包括目标模型/规则101,预处理模块113和预处理模块114是可选的。
数据采集设备160用于采集训练数据。针对本申请实施例的物体检测方法来说,训练数据可以包括训练图像以及训练图像对应的标注结果,其中,训练图像的标注结果可以是(人工)预先标注的训练图像中的各个待检测物体的分类结果。在采集到训练数据之后,数据采集设备160将这些训练数据存入数据库130,训练设备120基于数据库130中维护的训练数据训练得到目标模型/规则101。
下面对训练设备120基于训练数据得到目标模型/规则101进行描述,训练设备120对输入的训练图像进行物体检测,将输出的检测结果与物体预先标注的检测结果进行对比,直到训练设备120输出的物体的检测结果与预先标注的检测结果的差异小于一定的阈值,从而完成目标模型/规则101的训练。
上述目标模型/规则101能够用于实现本申请实施例的物体检测方法,即,将待检测图像(通过相关预处理后)输入该目标模型/规则101,即可得到待检测图像的检测结果。本申请实施例中的目标模型/规则101具体可以为神经网络。需要说明的是,在实际的应用中,所述数据库130中维护的训练数据不一定都来自于数据采集设备160的采集,也有可能是从其他设备接收得到的。另外需要说明的是,训练设备120也不一定完全基于数据库130维护的训练数据进行目标模型/规则101的训练,也有可能从云端或其他地方获取训练数据进行模型训练,上述描述不应该作为对本申请实施例的限定。
根据训练设备120训练得到的目标模型/规则101可以应用于不同的系统或设备中,如应用于图1所示的执行设备110,所述执行设备110可以是终端,如手机终端,平板电脑,笔记本电脑,增强现实(augmented reality,AR)/虚拟现实(virtual reality,VR),车载终端等,还可以是服务器或者云端等。在图1中,执行设备110配置输入/输出
(input/output,I/O)接口112,用于与外部设备进行数据交互,用户可以通过客户设备140向I/O接口112输入数据,所述输入数据在本申请实施例中可以包括:客户设备输入的待处理图像。这里的客户设备140具体可以是终端设备。
预处理模块113和预处理模块114用于根据I/O接口112接收到的输入数据(如待处理图像)进行预处理,在本申请实施例中,也可以没有预处理模块113和预处理模块114(也可以只有其中的一个预处理模块),而直接采用计算模块111对输入数据进行处理。
在执行设备110对输入数据进行预处理,或者在执行设备110的计算模块111执行计算等相关的处理过程中,执行设备110可以调用数据存储系统150中的数据、代码等以用于相应的处理,也可以将相应处理得到的数据、指令等存入数据存储系统150中。
最后,I/O接口112将处理结果,如上述得到的物体的检测结果呈现给客户设备140,从而提供给用户。
值得说明的是,训练设备120可以针对不同的目标或称不同的任务,基于不同的训练数据生成相应的目标模型/规则101,该相应的目标模型/规则101即可以用于实现上述目标或完成上述任务,从而为用户提供所需的结果。
在图1中所示情况下,用户可以手动给定输入数据,该手动给定可以通过I/O接口112 提供的界面进行操作。另一种情况下,客户设备140可以自动地向I/O接口112发送输入数据,如果要求客户设备140自动发送输入数据需要获得用户的授权,则用户可以在客户设备140中设置相应权限。用户可以在客户设备140查看执行设备110输出的结果,具体的呈现形式可以是显示、声音、动作等具体方式。客户设备140也可以作为数据采集端,采集如图所示输入I/O接口112的输入数据及输出I/O接口112的输出结果作为新的样本数据,并存入数据库130。当然,也可以不经过客户设备140进行采集,而是由I/O接口112直接将如图所示输入I/O接口112的输入数据及输出I/O接口112的输出结果,作为新的样本数据存入数据库130。
值得注意的是,图1仅是本申请实施例提供的一种系统架构的示意图,图中所示设备、器件、模块等之间的位置关系不构成任何限制,例如,在图1中,数据存储系统150相对执行设备110是外部存储器,在其它情况下,也可以将数据存储系统150置于执行设备110中。
如图1所示,根据训练设备120训练得到目标模型/规则101,在本申请实施例中可以是本申请中的神经网络,具体的,本申请实施例提供的神经网络可以CNN以及深度卷积神经网络(deep convolutional neural networks,DCNN)等等。
由于CNN是一种非常常见的神经网络,下面结合图2重点对CNN的结构进行详细的介绍。如上文的基础概念介绍所述,卷积神经网络是一种带有卷积结构的深度神经网络,是一种深度学习(deep learning)架构,深度学习架构是指通过机器学习的算法,在不同的抽象层级上进行多个层次的学习。作为一种深度学习架构,CNN是一种前馈(feed-forward)人工神经网络,该前馈人工神经网络中的各个神经元可以对输入其中的图像作出响应。
如图2所示,卷积神经网络(CNN)200可以包括输入层210,卷积层/池化层220(其中池化层为可选的),以及神经网络层230。下面对这些层的相关内容做详细介绍。
卷积层/池化层220:
卷积层:
如图2所示卷积层/池化层220可以包括如示例221-226层,举例来说:在一种实现中,221层为卷积层,222层为池化层,223层为卷积层,224层为池化层,225为卷积层,226为池化层;在另一种实现方式中,221、222为卷积层,223为池化层,224、225为卷积层,226为池化层。即卷积层的输出可以作为随后的池化层的输入,也可以作为另一个卷积层的输入以继续进行卷积操作。
下面将以卷积层221为例,介绍一层卷积层的内部工作原理。
卷积层221可以包括很多个卷积算子,卷积算子也称为核,其在图像处理中的作用相当于一个从输入图像矩阵中提取特定信息的过滤器,卷积算子本质上可以是一个权重矩阵,这个权重矩阵通常被预先定义,在对图像进行卷积操作的过程中,权重矩阵通常在输入图像上沿着水平方向一个像素接着一个像素(或两个像素接着两个像素……这取决于步长stride的取值)的进行处理,从而完成从图像中提取特定特征的工作。该权重矩阵的大小应该与图像的大小相关,需要注意的是,权重矩阵的纵深维度(depth dimension)和输入图像的纵深维度是相同的,在进行卷积运算的过程中,权重矩阵会延伸到输入图像的整个深度。因此,和一个单一的权重矩阵进行卷积会产生一个单一纵深维度的卷积化输出, 但是大多数情况下不使用单一权重矩阵,而是应用多个尺寸(行×列)相同的权重矩阵,即多个同型矩阵。每个权重矩阵的输出被堆叠起来形成卷积图像的纵深维度,这里的维度可以理解为由上面所述的“多个”来决定。不同的权重矩阵可以用来提取图像中不同的特征,例如一个权重矩阵用来提取图像边缘信息,另一个权重矩阵用来提取图像的特定颜色,又一个权重矩阵用来对图像中不需要的噪点进行模糊化等。该多个权重矩阵尺寸(行×列)相同,经过该多个尺寸相同的权重矩阵提取后的卷积特征图的尺寸也相同,再将提取到的多个尺寸相同的卷积特征图合并形成卷积运算的输出。
这些权重矩阵中的权重值在实际应用中需要经过大量的训练得到,通过训练得到的权重值形成的各个权重矩阵可以用来从输入图像中提取信息,从而使得卷积神经网络200进行正确的预测。
当卷积神经网络200有多个卷积层的时候,初始的卷积层(例如221)往往提取较多的一般特征,该一般特征也可以称之为低级别的特征;随着卷积神经网络200深度的加深,越往后的卷积层(例如226)提取到的特征越来越复杂,比如高级别的语义之类的特征,语义越高的特征越适用于待解决的问题。
池化层:
由于常常需要减少训练参数的数量,因此卷积层之后常常需要周期性的引入池化层,在如图2中220所示例的221-226各层,可以是一层卷积层后面跟一层池化层,也可以是多层卷积层后面接一层或多层池化层。在图像处理过程中,池化层的唯一目的就是减少图像的空间大小。池化层可以包括平均池化算子和/或最大池化算子,以用于对输入图像进行采样得到较小尺寸的图像。平均池化算子可以在特定范围内对图像中的像素值进行计算产生平均值作为平均池化的结果。最大池化算子可以在特定范围内取该范围内值最大的像素作为最大池化的结果。另外,就像卷积层中用权重矩阵的大小应该与图像尺寸相关一样,池化层中的运算符也应该与图像的大小相关。通过池化层处理后输出的图像尺寸可以小于输入池化层的图像的尺寸,池化层输出的图像中每个像素点表示输入池化层的图像的对应子区域的平均值或最大值。
神经网络层230:
在经过卷积层/池化层220的处理后,卷积神经网络200还不足以输出所需要的输出信息。因为如前所述,卷积层/池化层220只会提取特征,并减少输入图像带来的参数。然而为了生成最终的输出信息(所需要的类信息或其他相关信息),卷积神经网络200需要利用神经网络层230来生成一个或者一组所需要的类的数量的输出。因此,在神经网络层230中可以包括多层隐含层(如图2所示的231、232至23n)以及输出层240,该多层隐含层中所包含的参数可以根据具体的任务类型的相关训练数据进行预先训练得到,例如该任务类型可以包括图像识别,图像分类,图像超分辨率重建等等。
在神经网络层230中的多层隐含层之后,也就是整个卷积神经网络200的最后层为输出层240,该输出层240具有类似分类交叉熵的损失函数,具体用于计算预测误差,一旦整个卷积神经网络200的前向传播(如图2由210至240方向的传播为前向传播)完成,反向传播(如图2由240至210方向的传播为反向传播)就会开始更新前面提到的各层的权重值以及偏差,以减少卷积神经网络200的损失,及卷积神经网络200通过输出层输出的结果和理想结果之间的误差。
需要说明的是,如图2所示的卷积神经网络200仅作为一种卷积神经网络的示例,在具体的应用中,卷积神经网络还可以以其他网络模型的形式存在。
应理解,可以采用图2所示的卷积神经网络(CNN)200执行本申请实施例的物体检测方法,如图2所示,待处理图像经过输入层210、卷积层/池化层220和神经网络层230的处理之后可以得到图像的检测结果。
图3为本申请实施例提供的一种芯片硬件结构,该芯片包括神经网络处理器50。该芯片可以被设置在如图1所示的执行设备110中,用以完成计算模块111的计算工作。该芯片也可以被设置在如图1所示的训练设备120中,用以完成训练设备120的训练工作并输出目标模型/规则101。如图2所示的卷积神经网络中各层的算法均可在如图3所示的芯片中得以实现。
神经网络处理器NPU 50 NPU作为协处理器挂载到主中央处理器(central processing unit,CPU)(host CPU)上,由主CPU分配任务。NPU的核心部分为运算电路503,控制器504控制运算电路503提取存储器(权重存储器或输入存储器)中的数据并进行运算。
在一些实现中,运算电路503内部包括多个处理单元(process engine,PE)。在一些实现中,运算电路503是二维脉动阵列。运算电路503还可以是一维脉动阵列或者能够执行例如乘法和加法这样的数学运算的其它电子线路。在一些实现中,运算电路503是通用的矩阵处理器。
举例来说,假设有输入矩阵A,权重矩阵B,输出矩阵C。运算电路503从权重存储器502中取矩阵B相应的数据,并缓存在运算电路503中每一个PE上。运算电路503从输入存储器501中取矩阵A数据与矩阵B进行矩阵运算,得到的矩阵的部分结果或最终结果,保存在累加器(accumulator)508中。
向量计算单元507可以对运算电路503的输出做进一步处理,如向量乘,向量加,指数运算,对数运算,大小比较等等。例如,向量计算单元507可以用于神经网络中非卷积/非FC层的网络计算,如池化(pooling),批归一化(batch normalization),局部响应归一化(local response normalization)等。
在一些实现种,向量计算单元能507将经处理的输出的向量存储到统一缓存器506。例如,向量计算单元507可以将非线性函数应用到运算电路503的输出,例如累加值的向量,用以生成激活值。在一些实现中,向量计算单元507生成归一化的值、合并值,或二者均有。在一些实现中,处理过的输出的向量能够用作到运算电路503的激活输入,例如用于在神经网络中的后续层中的使用。
统一存储器506用于存放输入数据以及输出数据。
权重数据直接通过存储单元访问控制器505(direct memory access controller,DMAC)将外部存储器中的输入数据搬运到输入存储器501和/或统一存储器506、将外部存储器中的权重数据存入权重存储器502,以及将统一存储器506中的数据存入外部存储器。
总线接口单元(bus interface unit,BIU)510,用于通过总线实现主CPU、DMAC和取指存储器509之间进行交互。
与控制器504连接的取指存储器(instruction fetch buffer)509,用于存储控制器504使用的指令;
控制器504,用于调用指存储器509中缓存的指令,实现控制该运算加速器的工作过 程。
入口:可以根据实际发明说明这里的数据是说明数据,比如探测到车辆速度?障碍物距离等
一般地,统一存储器506,输入存储器501,权重存储器502以及取指存储器509均为片上(On-Chip)存储器,外部存储器为该NPU外部的存储器,该外部存储器可以为双倍数据率同步动态随机存储器(double data rate synchronous dynamic random access memory,简称DDR SDRAM)、高带宽存储器(high bandwidth memory,HBM)或其他可读可写的存储器。
其中,图2所示的卷积神经网络中各层的运算可以由运算电路
或向量计算单元307执行。
上文中介绍的图1中的执行设备110能够执行本申请实施例的物体检测方法的各个步骤,图2所示的CNN模型和图3所示的芯片也可以用于执行本申请实施例的物体检测方法的各个步骤。下面结合附图对本申请实施例的物体检测方法进行详细的介绍。
下面结合图4对本申请实施例的物体检测方法进行详细的介绍。
图4所示的方法可以由物体检测装置执行,该物体检测装置可以是具有物体检测功能的电子设备。该电子设备具体可以是移动终端(例如,智能手机),电脑,个人数字助理,可穿戴设备,增强现实/虚拟现实设备,车载设备,物联网设备或者其他能够进行物体检测的设备。
图4所示的方法包括步骤1001至1004,下面分别对这些步骤进行详细的描述。
1001、获取待检测图像。
图4所示的方法可以应用在不同的场景下,具体地,图4所示方法可以应用在识别万物以及街景识别等场景中。
当图4所示的方法应用在移动终端识别万物的场景时,步骤1001中的待检测图像可以是移动终端通过摄像头拍摄的图像,也可以是移动终端相册中已经存储的图像。
当图4所示的方法应用在街景识别的场景时,步骤1001中的待检测图像可以是路边的摄像头拍摄的街景图像。
图4所示的方法可以由神经网络(模型)来执行,具体地,图4所示的方法可以由CNN或者DNN来执行。
1002、对待检测图像进行卷积处理,得到待检测物体的初始图像特征。
在步骤1002中,可以先对待检测图像的整个图像进行卷积处理,以得到整个图像的图像特征,然后再从该整个图像的图像特征中获取待检测物体对应的初始图像特征。
可选地,上述对待检测图像进行卷积处理,得到待检测物体的初始图像特征,包括:对待检测图像的整个图像进行卷积处理,得到待检测图像的完整图像特征;将该待检测图像的完整图像特征中与待检测物体对应的图像特征确定为待检测物体的初始图像特征。
本申请中,先对待检测图像的整个图像进行卷积处理得到待检测图像的完整图像特征,然后再从待检测图像的完整图像特征中获取与待检测物体对应的图像特征,这种获取待检测物体的图像特征的方式与每次都单独获取各个待检测物体对应的图像特征的方式相比,能够减少获取待检测物体的图像特征的复杂度。
1003、根据知识图谱信息确定待检测物体的增强图像特征。
其中,上述知识图谱信息包括待检测图像中的不同物体对应的不同物体类别之间的关联关系,上述待检测物体的增强图像特征指示了与待检测物体相关联的其它物体对应的物体类别的语义信息。
上述语义信息可以是指能够辅助进行图像检测的高级别的信息。例如,上述语义信息具体可以是物体是什么,物体的周围有什么(语义信息一般不同于低级别的信息,如图像的边,像素点和亮度等等)。
例如,待检测物体为自行车,待检测图像中与该自行车相关联的其他物体包括人和道路,那么,上述待检测物体的增强图像特征指示的可以是人和道路的语义信息。
上述知识图谱信息就可以是预先设定的,也可以是根据训练数据对神经网络模型进行训练得到的。
具体地,上述知识图谱信息可以是根据经验预先设定好的。例如,可以根据人工标注的不同类别的物体之间的关联关系来设置或者生成知识图谱信息。
例如,可以通过人为统计不同类别的物体之间的相似程度以及不同类别的物体之间同时出现的概率来确定知识图谱信息。
另外,当上述知识图谱信息时根据训练数据对神经网络模型进行训练得到时,该训练数据包括训练图像以及训练图像中不同物体所属的物体类别。
其中,上述训练图像中一般可以包含多个待检测物体,上述训练图像中不同物体所属的物体类别也可以称为训练图像的标记数据,该标记数据可以是(人工)预先标注好的数据。
在上述训练过程中,可以先预设一个初始知识图谱信息(该初始的知识图谱信息可以是),然后在利用训练数据对神经网络模型进行训练的过程中不断调整该初始知识图谱信息,当到训练图像的检测结果与训练图像的标记结果比较接近时(也可以是在训练次数达到一定程度时),就可以把当前的知识图谱信息作为最终训练得到的知识图谱信息了。
上述初始知识图谱信息可以包括待检测图像中的不同物体对应的不同物体类别之间的关联关系,该初始知识图谱信息中包含的待检测图像中的不同物体对应的不同物体类别之间的关联关系可以是随机设置的。
对于上述知识图谱信息来说,该知识图谱信息可以包含待检测图像中的不同物体对应的不同物体类别之间的关联关系,该待检测图像中的不同物体对应的不同物体类别之间的关联关系可以包括以下至少一种:不同物体类别的属性关联关系;不同物体类别之间的位置关系;不同物体类别的词向量之间的相似程度;不同物体类别同时出现的概率。
具体地,上述不同物体类别的属性关联关系可以是指不同类别的物体之间是否具有相同的属性。
例如,苹果的颜色是红色,草莓的颜色也是红色,那么,苹果和草莓在颜色上具有相同的属性(或者,也可以说苹果和草莓在颜色属性上比较接近)。
上述知识图谱信息可以用表格来表示,例如,上述知识图谱信息可以如表1所示的形式。
表1
  勺子 香蕉 苹果
1 0.016 0.094 0.094 0
勺子 0.016 1 0 0 0.21
0.094 0 1 0 0
香蕉 0.094 0 0 1 0
苹果 0 0.21 0 0 1
表1示出了刀(knife)、勺子(spoon)、碗(bowl)、香蕉(banana)和苹果(apple)之间的相近程度,表格中的数值为不同物体之间的相似值,该相似值越大,表明对应的两个物体的相似程度越高。例如,勺子和刀之间的相似值为0.016,而碗和勺子之间的相似值为0.094,这说明,碗与刀之间的相似度更高。
另外,当物体之间的该相似值为1时,表明这两个物体完全相同,此时可以将这两个物体视为相同的物体。例如,刀和刀之间的相似值为1,勺子和勺子之间的相似值也是1。
应理解,表1只是对知识图谱信息的一种可能的表现形式进行的举例说明,知识图谱信息该可以直接包含相关联物体之间的关联关系信息,本申请对此不做限制。
当然表1中的不同类别的物体类别还可以根据实际需要做进一步的划分。例如,上述表1中的勺子可以进一步划分为长勺、短勺、汤勺等等。
可选地,上述步骤1003中根据知识图谱信息确定待检测物体的增强图像特征,包括:根据知识图谱信息和记忆池信息确定图结构信息;根据该图结构信息确定待检测物体的增强图像特征。
上述图结构信息可以包括多个节点,其中,每个节点对应一个物体,每个物体对应的节点与该物体有关联的其它物体对应的节点是连接关系,上述多个节点中包含待检测物体,以及与待检测物体相关联的其它物体,每个节点包含对应的物体的语义信息。
在根据图结构信息确定待检测物体的增强图像特征时,具体可以是根据图结构信息确定出待检测物体,然后将待检测物体周围连接的节点(也就是与该待检测物体相关联的其它物体)的语义信息提取出来,得到增强图像特征。
另外,根据知识图谱信息和记忆池信息确定图结构信息时,具体可以是根据记忆池信息中包含的物体的类别的种类以及知识图谱信息中包含的各个种类的物体之间的关联关系来生成图结构信息。
例如,上述知识图谱信息包括1000个类别物体之间的关联关系,上述记忆池包含100个分类的分类层参数,那么,可以从知识图谱信息中获取记忆池信息中记录的100个类别物体之间的关联关系,然后根据该100个类别物体之间的关联关系来构建包括100个类别的图结构。
例如,图5示出了一个图结构的示意图,在图5中,每个节点对应不同的物体,其中,节点L对应于待检测物体,节点M、节点N和节点O对应的物体为待检测图像中与待检测物体相关联的物体,而节点R和节点S则是图结构中与待检测物体无关的物体。因此,在获取待检测物体的增强图像特征时,可以通过提取节点M、节点N和节点O的语义信息可以得到待检测物体的增强图像特征。
1004、根据待检测物体的初始图像特征和待检测物体的增强图像特征,确定待检测物体的候选框和分类。
步骤1004确定得到的待检测物体的候选框和分类可以分别是待检测物体的最终候选框和最终分类(结果)。
在步骤1004中,可以先将待检测物体的初始图像特征和待检测物体的增强图像特征组合起来得到待检测物体的最终图像特征,然后再根据待检测物体的最终图像特征确定待检测物体的候选框和分类。
例如,待检测物体的初始图像特征为一个大小为M1×N1×C1(M1、N1和C1可以分别表示宽、高以及通道数)的卷积特征图,待检测物体的增强图像特征是一个大小为M1×N1×C2(M1、N1和C2分别表示宽、高以及通道数)的卷积特征图,那么,通过对这两个卷积特征图的组合,可以得到待检测物体的最终图像特征,该最终图像特征是一个大小为M1×N1×(C1+C2)卷积特征图。
应理解,这里是以初始图像特征的卷积特征图与增强图像特征的卷积特征图的尺寸相同(宽和高相同),但是通道数不同为例进行了说明。事实上,当初始图像特征的卷积特征图与增强图像特征的卷积特征图的尺寸不同时,也可以对初始图像特征和增强图像特征进行组合,此时,可以先将初始图像特征的卷积特征图与增强图像特征的卷积特征图的尺寸统一(将宽和高统一),然后再将初始图像特征的卷积特征图与增强图像特征的卷积特征图进行组合,得到最终图像特征的卷积特征图。
本申请中,在对待检测图像进行物体检测时,通过待检测物体的初始图像特征和增强图像特征来综合确定待检测物体的检测结果,与仅考虑待检测物体的初始图像特征获取检测结果的方式相比,能够得到更好的检测结果。
具体地,本申请在确定待检测物体的检测结果时,不仅考虑到了反映待检测物体本身特性的初始图像特征,还考虑到了待检测图像中与待检测物体相关联的其他物体的语义信息。本申请通过综合待检测物体本身特征以及相关联的其他物体的特征来综合确定待检测物体的检测结果,能够在一定程度上提高待检测物体的检测结果的准确性。
例如,待检测图像中存在待检测的第一物体,待检测图像中与该第一物体相关联的物体包括道路和人,那么,在确定第一物体的检测结果时,可以综合考虑从第一物体提取到的初始图像特征,以及人和道路的语义信息来确定第一物体的检测结果。假设,第一物体的初始分类结果是自行车,那么,由于人和道路与自行车同时出现的可能性很大,因此,能够通过借助人和道路的语义信息能够提高第一物体属于自行车的置信度,从而最终提高第一物体的检测结果的准确性。
在上述步骤1003中,根据知识图谱信息确定待检测物体的增强图像特征,具体包括:采用基于注意力机制的图卷积方式对待检测物体相关联的其它物体对应的物体类别的语义信息进行卷积处理,得到待检测物体的增强图像特征。
本申请中,当采用基于注意力机制的图卷积方式进行卷积处理时,能够从每个从待检测物体最关注的其它物体中提取增强图像特征,使得增强图像特征反映的信息更有针对性,便于最终提高待检测物体的检测效果。
除了采用基于注意力机制的图卷积方式进行卷积处理外,还可以采用基于空间信息的图稀疏卷积方式进行卷积处理。
在上述步骤1003中,根据知识图谱信息确定待检测物体的增强图像特征,具体包括:基于空间信息的图稀疏卷积方式对其它物体对应的物体类别的语义信息进行卷积处理,得到待检测物体的增强图像特征。
可选地,在上述步骤1004之前,图4所示的方法还包括:根据待检测物体的初始图 像特征确定待检测物体的初始候选框和初始分类。
在确定待检测物体的初始候选框和初始分类的过程中,一般是先对待检测图像的整个图像进行卷积处理,得到待检测图像的整个图像的卷积特征,然后再根据固定的尺寸要求,将待检测图像划分成不同的方框,对每个方框内的图像对应的特征进行打分,将打分较高的方框筛选出来作为初始候选框,并以该初始候选框对应的图像特征确定初始候选框对应的图像的初始分类。
例如,待检测图像为第一图像,为了获得第一图像中的待检测物体的初始候选框和初始分类,可以先对第一图像的整个图像进行卷积处理,得到第一图像的整个图像的卷积特征,然后将第一图像划分成3×3个方框,对每个方框的图像对应的特征进行打分。最后可以将打分较高的方框A和方框B筛选出来作为初始候选框,然后再以方框A内的图像对应的特征确定方框A内的图像的初始分类,以方框B内的图像对应的特征确定方框B内的图像的初始分类。
在上述步骤1004中根据待检测物体的初始图像特征和待检测物体的增强图像特征,确定待检测物体的候选框和分类的过程中,可以是先对初始图像特征和增强图像特征进行组合,得到最终图像特征,然后再根据该最终图像特征对初始候选框进行调整得到候选框,根据该最终图像特征对初始分类结果进行修正,得到分类结果。具体地,上述根据最终图像特征对初始候选框进行调整可以是根据该最终图像特征对初始候选框的四周的坐标进行调整,直到得到候选框,上述根据最终图像特征对初始分类结果进行调整可以是建立一个分类器进行重新分类,进而得到分类结果。
为了更好地理解本申请实施例的物体检测方法的完整流程,下面结合图5对本申请实施例的物体检测方法进行说明。
图6是本申请实施例的物体检测方法的示意性流程图。
图6所示的方法可以由物体检测装置执行,该物体检测装置可以是具有物体检测功能的电子设备。该电子设备具体包含的装置的形态可以如上文介绍图4所示的方法中的相关描述。
图6所示的方法包括步骤2001至2003,步骤3001至3005以及步骤4001和4002,下面对这些步骤进行详细的介绍。
其中,步骤2001至2003可以是步骤1002的细化实施方式(或者称为具体实施方式),步骤3001至3005可以是步骤1003的细化实施方式,步骤4001和4002可以是步骤1004的细化实施方式。
步骤2001至2003主要是选定待检测图像的初始候选区域,得到初始候选区域的初始图像特征。步骤3001至3005主要是为了提取初始候选区域的增强图像特征,步骤4001和4002主要是综合初始候选区域的初始图像特征和增强图像特征来确定待处理图像的最终候选区域和分类结果。
2001、获取待检测图像。
这里的待检测图像可以是需要进行物体检测的图片。待检测图像既可以通过摄像头拍摄获得,也可以从存储器中能获取。
步骤2001中获取待检测图像的方式与上述步骤1001中获取待检测图片的方式类似,这里不再详细描述。
2002、选定初始候选区域。
在步骤2002中,可以将待检测图像输入到一个传统的物体检测器中进行处理(如Faster-RCNN),得到一个初始的候选区域和一个初始分类。
具体地,在步骤2002中,可以先对待检测图像进行卷积处理,得到待检测图像的全图的卷积特征,然后再根据一定的尺寸要求,将待检测图像划分成不同的方框,然后对每个方框内的图像对应的特征进行打分,将打分较高的方框筛选出来作为初始候选框,并以该初始候选框对应的图像特征确定初始候选框对应的图像的初始分类。
2003、提取初始候选区域的初始图像特征。
在步骤2003中可以通过CNN来提取初始候选区域的图像特征。
例如,第一图像为待检测图像,那么,为了得到第一图像中的待检测物体的初始候选框和初始分类,可以先对该第一图像进行卷积处理,得到该第一图像的卷积特征,然后将该第一图像划分成4×4个方框(也可以划分成其它数量的方框),对每个方框的图像对应的特征进行打分,将打分较高的方框A和方框B筛选出来作为初始候选框。
进一步的,在获取了初始候选框之后,还可以待检测图像的整个图像的图像特征(可以通过对待检测图像的整个图像进行卷积处理来得到待检测图像的整个图像的图像特征)对应到方框A和方框B中,以获取方框A对应的初始图像特征和方框B对应的初始图像特征。
3001、提取分类层参数。
在步骤3001中,可以采用物体检测器(如Faster-RCNN)中的分类器提取分类层参数,构建一个记忆池以记录每个类别的高级视觉特征(例如,每个类别物体的颜色、形状和纹理)。
在步骤3001中,提取的分类层参数可以是对待检测物体进行物体检测的物体检测器中的分类器中的所有分类的分类层参数。
3002、构建更新记忆池。
该记忆池可以在训练过程中随着分类器的优化而不断更新。
在训练过程中,分类器中的不同分类对应的分类层参数可能会不断的发生变化,在这种情况下,可以对记忆池中分类对应的分类层参数进行更新。
3003、根据知识图谱构建图结构。
在步骤3003中可以根据手动设计的知识图谱,或者通过候选区的特征相似度构建一个图结构。得到的图结构内会记录不同节点之间的关联关系,例如,不同类别的属性关系图,共同出现的概率,属性相似度图等等。
3004、图卷积网络推理推断。
在步骤3004中可以通过构建的图结构,利用图卷积网络传播节点上记忆池的信息,使每个节点得到经过推理推断后得到的全局信息。
3005、确定初始候选区域的增强图像特征。
在步骤3005中,可以根据知识图谱信息来得到与初始候选区域的物体相关联的其他物体对应的物体类别的语义信息,然后可以将与初始候选区域的物体相关联的其他物体对应的物体类别的语义信息作为该初始候选区域的增强图像特征,或者,也可以将对与初始候选区域的物体相关联的其他物体对应的物体类别的语义信息的卷积处理结果作为该初 始候选区域的增强图像特征。
4001、确定初始候选区域的最终图像特征。
在步骤4001中,可以对初始候选区域的初始图像特征和增强图像特征进行组合,得到初始候选区域的最终图像特征。具体的组合过程可以参见步骤1004下方关于初始图像特征和增强图像特征组合的相关描述。
4002、根据初始候选区域的最终图像特征确定最终候选区域和最终分类结果。
具体地,在步骤4002中,可以根据该最终图像特征对初始候选框进行调整得到最终候选区域(或者称为最终候选框),根据该最终图像特征对初始分类结果进行修正,得到最终分类结果。
应理解,上述步骤4002中得到的最终候选区域相当于步骤1004得到的候选框,步骤4002中得到的最终分类结果相当于步骤1004中得到的分类。
上文结合流程图对本申请实施例的物体检测方法进行了详细的说明,为了更好地理解本申请实施例的物体检测方法,下面结合更具体的流程图对本申请实施例的物体检测方法进行详细的描述。
图7是本申请实施例的物体检测方法的示意性流程图。
图7所示的方法可以由物体检测装置执行,该物体检测装置可以是具有物体检测功能的电子设备。电子设备具体包含的装置的形态可以如上文介绍图4所示的方法中的相关描述。
图7所示的方法包括步骤1至步骤5,下面对这些步骤分别进行详细的介绍。
步骤1:根据全局记忆池和知识图谱构建图结构。
上述知识图谱既可以是人工构建的,也可以是通过神经网络训练得到的,该全局记忆池可以包含对待检测物体进行物体检测时的各个物体种类的分类层参数。
步骤2:对检测图像进行卷积处理,得到待检测图像的初始卷积图像特征。
在步骤2中,可以对待检测图像的整个图像进行卷积处理,得到的整个图像的卷积特征就是待检测图像的初始卷积图像特征。
步骤3:确定待检测物体的初始候选框,以及待检测物体对应的初始图像特征。
确定初始候选框的具体过程可以参见上文中的相关描述。
在确定了初始候选框之后,可以根据初始候选框在待检测图像中对应的图像区域从待检测图像的初始卷积图像特征中获取待检测物体对应的初始图像特征,也就是图7中所示的初始候选框的图像特征。
步骤4:采用基于注意力机制的图卷积方式对图结构进行卷积处理,得到待检测物体的增强图像特征。
在步骤4中,采用基于注意力机制的图卷积方式对图结构进行卷积处理,实质上就是对于待检测物体密切相关的其它物体进行卷积处理,得到检测物体的增强图像特征。
另外,在步骤4中还可以采用基于空间信息的图稀疏卷积方式对与待检测物体的空间上存在关联的物体(例如,与待检测物体相邻的物体,或者与待检测物体的距离在一定范围内的物体)的语义信息进行卷积处理,得到待检测物体的增强图像特征。
步骤5:根据待检测物体的初始图像特征和待检测物体的增强图像特征确定待检测物体的检测结果。
上述步骤5中确定检测结果的具体过程可以参见上文图4所示的方法中的相关描述,这里不再详细描述。
上文结合附图对本申请实施例的物体检测方法进行了详细的介绍,为了更好地说明本申请实施例的物体检测方法的有益效果,下面结合表2至表4以具体的实例对本申请实施例的物体检测方法相对于传统方案的效果进行详细的说明。
下面结合具体的实验数据,以表2为例,对四种传统方法与本申请方法进行物体检测的效果进行比较。表2中所示的四种传统方法分别为传统方法1(light-head RCNN)、传统方法2(Faster-RCNN w FPN)、传统方法3(Cascade RCNN)和传统方法4(Faster-RCNN),其中,传统方法3也可以称为级联RCNN方法。
表2中所示的本申请的方法是指在卷积处理时采用了基于注意力机制的图卷积方式,并且知识图谱是人工设计的。测试用的数据集包括1.4版本的视觉基因组(Visual Genome(v1.4))数据集和ADE数据集,其中,Visual Genome(v1.4)共有1000类以及3000类的大规模通用物体检测数据集,9.2万张图片的训练数据集以及数量为5000的测试集。而ADE数据集拥有445类的大规模通用物体检测数据集,2万的张图片的训练数据集以及1千张的测试集。
在对物体检测效果进行评价时,主要采用了平均精确度(average precision,AP)和平均召回率(average recall,AR)进行评价,在对比时考虑了不同阈值下的精确度,与不同大小的物体的平均精确度和平均召回率。
如表2所示,在不同的数据集下进行测试时,本申请方法的AP和AR都要分别大于四种传统方法的AP和AR,而AP和AR的数值越大说明进行物体检测的效果越好。表2标出了本申请公共相对于传统方法4的指标提升值,由表2可知,本申请方法相对于传统方法4有比较明显的效果提升。
另外,本申请方法与传统方法相比,参数量的大小也没有明显的增加,因此,本申请方法与传统方法1至传统方法4相比,能够在保证参数量基本不变的情况下提升物体检测效果。
表2
Figure PCTCN2020089438-appb-000011
Figure PCTCN2020089438-appb-000012
另外,还可以在传统方案的现有架构的基础上应用本申请实施例的物体检测方法,具体效果可以如表3所示。表3相对于表2新增了上下文信息通用物体检测数据集(Common Objects in Context,COCO)数据集,该数据集拥有80个通用物体的检测标注,含有约1.1万训练数据集以及5千张测试集。表3中的评价指标包括平均AP(mean average precision,mAP),参数量(单位为M),处理时间(单位为ms)
由表3可知,本申请方法能够显著提升已有检测器的识别准确率以及召回率,并且,本申请方法并没有显著的增加模型参数以及降低推理速度。
表3
Figure PCTCN2020089438-appb-000013
在本申请实施例中,知识图谱信息除了可以通过人工预设的方式确定之外,还可以通过学习的方式获取,下面结合表4对本申请实施例中的知识图谱信息是通过学习方式得到的情况下与传统方法的效果进行对比,得到的效果如表4所示。
如表4所示,一共有5种传统方法,这5种传统方法分别是传统方法A(light-head RCNN)、传统方法B(Cascade RCNN)、传统方法C(HKRM)、传统方法D(Faster-RCNN)和传统方法E(FPN),基于不同的实现架构,本申请的方法可以分为为本申请方法X(Faster-RCNN w SGRN)和本申请方法Y(FPN w SGRN)。由表4可知,无论是本申请方法X和本申请方法Y,AP指标和AR指标均相对于传统方案有所提高。因此,本申请实施例的物体检测方法能够显著的提高已有物体检测器的识别准确率以及召回率。
表4
Figure PCTCN2020089438-appb-000014
Figure PCTCN2020089438-appb-000015
上文结合附图对本申请实施例的物体检测方法进行了详细的介绍,本申请实施例的物体检测方法可以利用神经网络(模型)来实现物体检测。而这里采用的神经网络(模型)可以是按照一定的训练方法训练得到的,下面结合附图8对本申请实施例的神经网络的训练方法进行介绍。
图8是本申请实施例的神经网络的训练方法的示意性流程图。图8所示的方法可以由计算机设备、服务器设备或者运算设备等运算能力较强的设备来执行。图8所示的方法包括步骤5001至5005,下面分别对这几个步骤进行详细的介绍。
5001、获取训练数据。
步骤5001中的训练数据包括训练图像以及训练图像中待检测物体的物体检测标注结果。
5002、根据神经网络提取该训练图像中的待检测物体的初始图像特征。
5003、根据该神经网络以及知识图谱信息提取该训练图像中的待检测物体的增强图像特征。
步骤5003中的知识图谱信息包括训练图像中的不同物体对应的物体类别之间的关联关系,上述训练图像中的待检测物体的增强图像特征指示了与该待检测物体相关联的其它物体对应的物体类别的语义信息。
5004、根据该神经网络对待检测物体的初始图像特征和增强图像特征进行处理,得到该待检测物体的物体检测结果。
5005、根据该训练图像的中的待检测物体的物体检测结果与该训练图像中的待检测物体的物体检测标注结果,确定该神经网络的模型参数。
可选地,上述训练图像中的待检测物体的物体检测标注结果包括该训练图像中的待检测物体的标注候选框和标注分类结果。
上述标注候选框和标注分类结果可以是预先(具体可以是通过人工进行标注)标注好的。
另外,在上述训练的过程中,采用的训练图像一般是多个。
在对上述神经网络进行训练的过程中,可以为神经网络设置一套初始的模型参数,然 后根据训练图像中的待检测物体的物体检测结果与训练图像中的待检测物体的物体检测标注结果的差异来逐渐调整神经网络的模型参数,直到训练图像中的待检测物体的物体检测结构与训练图像中的待检测物体的物体检测标注结果之间的差异在一定的预设范围内,或者,当训练的次数达到预设次数时,将此时的神经网络的模型参数确定为该神经网络模型的最终的参数,这样就完成了对神经网络的训练了。
应理解,通过图8所示的方法训练得到的神经网络能够用于执行本申请实施例的物体检测方法。
本申请中,在训练神经网络时,不仅提取了训练图像中的待检测物体的初始图像特征,还提取了训练图像中的待检测物体的增强图像特征,并综合根据待检测物体的初始图像特征和增强图像特征来确定待检测物体的物体检测结果。也就是说,本申请的训练方法在训练过程中提取了更多的特征来进行物体检测,可以训练得到性能更好的神经网络,使得利用该神经网络进行物体检测能够取得更好的物体检测效果。
可选地,上述知识图谱信息是预先设定的。
可选地,上述知识图谱信息是根据训练数据对其它神经网络模型进行训练得到的,训练数据包括训练图像以及所述训练图像中不同物体所属的物体类别。
这里的其它神经网络模型可以是不同于图8所示的训练方法中进行训练的神经网络模型。
可选地,上述训练图像中的不同物体对应的物体类别之间的关联关系包括以下至少一种:不同物体类别的属性关联关系;不同物体类别之间的位置关系;不同物体类别的词向量之间的相似程度;不同物体类别同时出现的概率。
上文结合附图对本申请实施例的物体检测方法和神经网络训练方法进行了详细的描述,下面结合图9至图11对本申请实施例的相关装置进行详细的介绍。应理解,图9和图10所示的物体检测装置能够执行本申请实施例的物体检测方法的各个步骤,图11所示的神经网络训练装置能够执行本申请实施例的神经网络训练方法的各个步骤,下面在介绍图9至图11所示的装置时适当省略重复的描述。
图9是本申请实施例的物体检测装置的示意性框图。图9所示的物体检测装置7000包括:
图像获取单元7001,用于获取待检测图像;
特征提取单元7002,用于对待检测图像进行卷积处理,以得到待检测图像中的待检测物体的初始图像特征;
上述特征提取单元7002还用于根据知识图谱信息确定待检测物体的增强图像特征;
检测单元7003,用于根据待检测物体的初始图像特征和待检测物体的增强图像特征,确定待检测物体的候选框和分类。
其中,上述知识图谱信息包括待检测图像中的不同物体对应的不同物体类别之间的关联关系,上述待检测物体的增强图像特征指示了与待检测物体相关联的其它物体对应的物体类别的语义信息。
本申请中,在对待检测图像进行物体检测时,通过待检测物体的初始图像特征和增强图像特征来综合确定待检测物体的检测结果,与仅考虑待检测物体的初始图像特征获取检测结果的方式相比,能够得到更好的检测结果。
当本申请实施例的物体检测方法由图1中的执行设备110执行时,上述物体检测装置7000中的图像获取单元7001可以相当于执行设备110中的I/O接口112,而物体检测装置7000中的特征提取单元7002和检测单元7003相当于执行设备110中的计算模块111。
当本申请实施例的物体检测方法由图3中的神经网络处理器50执行时,上述物体检测装置7000中的图像获取单元7001可以相当于神经网络处理器50中的总线接口单元510,而物体检测装置7000中的特征提取单元7002和检测单元7003相当于执行设备110中的运算电路503,或者,物体检测装置7000中的特征提取单元7002和检测单元7003还可以相当于执行设备110中的运算电路503+向量计算单元507+累加器508。
图10是本申请实施例的物体检测装置的示意性框图。图10所示的物体检测装置8000包括存储器8001、处理器8002、通信接口8003以及总线8004。其中,存储器8001、处理器8002、通信接口8003通过总线8004实现彼此之间的通信连接。
上述通信接口8003相当于物体检测装置7000中的图像获取单元7001,上述处理器8002相当于物体检测装置7000中的特征提取单元7002和检测单元7003。下面对物体检测装置8000中的各个模块和单元进行详细的介绍。
存储器8001可以是只读存储器(read only memory,ROM),静态存储设备,动态存储设备或者随机存取存储器(random access memory,RAM)。存储器8001可以存储程序,当存储器8001中存储的程序被处理器8002执行时,处理器8002和通信接口8003用于执行本申请实施例的物体检测方法的各个步骤。具体地,通信接口8003可以从存储器或者其他设备中获取待检测图像,然后由处理器8002对该待检测图像进行物体检测。
处理器8002可以采用通用的中央处理器(central processing unit,CPU),微处理器,应用专用集成电路(application specific integrated circuit,ASIC),图形处理器(graphics processing unit,GPU)或者一个或多个集成电路,用于执行相关程序,以实现本申请实施例的物体检测装置中的单元所需执行的功能(例如,处理器8002可以实现上述物体检测装置7000中的特征提取单元7002和检测单元7003所需执行的功能),或者执行本申请实施例的物体检测方法。
处理器8002还可以是一种集成电路芯片,具有信号的处理能力。在实现过程中,本申请实施例的物体检测方法的各个步骤可以通过处理器8002中的硬件的集成逻辑电路或者软件形式的指令完成。
上述处理器8002还可以是通用处理器、数字信号处理器(digital signal processing,DSP)、ASIC、现成可编程门阵列(field programmable gate array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。上述通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器8001,处理器8002读取存储器8001中的信息,结合其硬件完成本申请实施例的物体检测装置中包括的单元所需执行的功能,或者执行本申请方法实施例的物体检测方法。
通信接口8003使用例如但不限于收发器一类的收发装置,来实现装置8000与其他设备或通信网络之间的通信。例如,可以通过通信接口8003获取待处理图像。
总线8004可包括在装置8000各个部件(例如,存储器8001、处理器8002、通信接口8003)之间传送信息的通路。
图11是本申请实施例的神经网络训练装置的硬件结构示意图。与上述装置8000类似,图11所示的神经网络训练装置9000包括存储器9001、处理器9002、通信接口9003以及总线9004。其中,存储器9001、处理器9002、通信接口9003通过总线9004实现彼此之间的通信连接。
存储器9001可以存储程序,当存储器9001中存储的程序被处理器9002执行时,处理器9002用于执行本申请实施例的神经网络的训练方法的各个步骤。
处理器9002可以采用通用的CPU,微处理器,ASIC,GPU或者一个或多个集成电路,用于执行相关程序,以实现本申请实施例的神经网络的训练方法。
处理器9002还可以是一种集成电路芯片,具有信号的处理能力。在实现过程中,本申请实施例的神经网络的训练方法(如图8所示的方法)的各个步骤可以通过处理器9002中的硬件的集成逻辑电路或者软件形式的指令完成。
应理解,通过图11所示的神经网络训练装置9000对神经网络进行训练,训练得到的神经网络就可以用于执行本申请实施例的物体检测方法(如图8所示的方法)。
具体地,图11所示的装置可以通过通信接口9003从外界获取训练数据以及待训练的神经网络,然后由处理器根据训练数据对待训练的神经网络进行训练。
应注意,尽管上述装置8000和装置9000仅仅示出了存储器、处理器、通信接口,但是在具体实现过程中,本领域的技术人员应当理解,装置8000和装置9000还可以包括实现正常运行所必须的其他器件。同时,根据具体需要,本领域的技术人员应当理解,装置8000和装置9000还可包括实现其他附加功能的硬件器件。此外,本领域的技术人员应当理解,装置8000和装置9000也可仅仅包括实现本申请实施例所必须的器件,而不必包括图10和图11中所示的全部器件。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。

Claims (14)

  1. 一种物体检测方法,其特征在于,包括:
    获取待检测图像;
    对所述待检测图像进行卷积处理,得到所述待检测图像中的待检测物体的初始图像特征;
    根据知识图谱信息确定所述待检测物体的增强图像特征,所述知识图谱信息包括所述待检测图像中的不同物体对应的不同物体类别之间的关联关系,所述待检测物体的增强图像特征指示与所述待检测物体相关联的其它物体对应的物体类别的语义信息;
    根据所述待检测物体的初始图像特征和所述待检测物体的增强图像特征,确定所述待检测物体的候选框和分类。
  2. 如权利要求1所述的方法,其特征在于,所述知识图谱信息是预先设定的。
  3. 如权利要求1所述的方法,其特征在于,所述知识图谱信息是根据训练数据对神经网络模型进行训练得到的,所述训练数据包括训练图像以及所述训练图像中不同物体所属的物体类别。
  4. 如权利要求1-3中任一项所述的方法,其特征在于,所述待检测图像中的不同物体对应的不同物体类别之间的关联关系包括以下信息中的至少一种:
    不同物体类别的属性关联关系;
    不同物体类别之间的位置关系;
    不同物体类别的词向量之间的相似程度;
    不同物体类别同时出现的概率。
  5. 如权利要求1-4中任一项所述的方法,其特征在于,所述根据知识图谱信息确定所述待检测物体的增强图像特征,包括:
    采用基于注意力机制的图卷积方式或者基于空间信息的图稀疏卷积方式对所述待检测物体相关联的其它物体对应的物体类别的语义信息进行卷积处理,得到所述待检测物体的增强图像特征。
  6. 如权利要求1-5中任一项所述的方法,其特征在于,所述方法还包括:
    显示所述待检测物体的检测结果,所述待检测物体的检测结果包括所述待检测物体的候选框和分类。
  7. 一种物体检测装置,其特征在于,包括:
    图像获取单元,用于获取待检测图像;
    特征提取单元,用于对所述待检测图像进行卷积处理,得到所述待检测图像中的待检测物体的初始图像特征;
    所述特征提取单元还用于根据知识图谱信息确定所述待检测物体的增强图像特征,所述知识图谱信息包括所述待检测图像中的不同物体对应的不同物体类别之间的关联关系,所述待检测物体的增强图像特征指示了与所述待检测物体相关联的其它物体对应的物体类别的语义信息;
    检测单元,用于根据所述待检测物体的初始图像特征和所述待检测物体的增强图像特 征,确定所述待检测物体的候选框和分类。
  8. 如权利要求7所述的装置,其特征在于,所述知识图谱信息是预先设定的。
  9. 如权利要求8所述的装置,其特征在于,所述知识图谱信息是根据训练数据对所述神经网络模型进行训练得到的,所述训练数据包括训练图像以及所述训练图像中不同物体所属的物体类别。
  10. 如权利要求7-9中任一项所述的装置,其特征在于,所述待检测图像中的不同物体对应的不同物体类别之间的关联关系包括以下信息中的至少一种:
    不同物体类别的属性关联关系;
    不同物体类别之间的位置关系;
    不同物体类别的词向量之间的相似程度;
    不同物体类别同时出现的概率。
  11. 如权利要求7-10中任一项所述的装置,其特征在于,所述特征提取单元用于:
    采用基于注意力机制的图卷积方式或者基于空间信息的图稀疏卷积方式对所述待检测物体相关联的其它物体对应的物体类别的语义信息进行卷积处理,得到所述待检测物体的增强图像特征。
  12. 如权利要求7-11中任一项所述的装置,其特征在于,所述装置还包括:
    显示模块,用于显示所述待检测物体的检测结果,所述待检测物体的检测结果包括所述待检测物体的候选框和分类。
  13. 一种物体检测装置,其特征在于,包括:
    存储器,用于存储程序;
    处理器,用于执行所述存储器存储的程序,当所述存储器存储的程序被执行时,所述处理器用于执行如权利要求1-6中任一项所述的方法。
  14. 一种计算机存储介质,其特征在于,所述计算机存储介质存储有程序代码,所述程序代码包括用于执行如权利要求1-6中任一项所述的方法中的步骤的指令。
PCT/CN2020/089438 2019-06-17 2020-05-09 物体检测方法、装置和计算机存储介质 WO2020253416A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US17/553,236 US20220108546A1 (en) 2019-06-17 2021-12-16 Object detection method and apparatus, and computer storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910523157.5A CN110378381B (zh) 2019-06-17 2019-06-17 物体检测方法、装置和计算机存储介质
CN201910523157.5 2019-06-17

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/553,236 Continuation US20220108546A1 (en) 2019-06-17 2021-12-16 Object detection method and apparatus, and computer storage medium

Publications (1)

Publication Number Publication Date
WO2020253416A1 true WO2020253416A1 (zh) 2020-12-24

Family

ID=68250384

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/089438 WO2020253416A1 (zh) 2019-06-17 2020-05-09 物体检测方法、装置和计算机存储介质

Country Status (3)

Country Link
US (1) US20220108546A1 (zh)
CN (1) CN110378381B (zh)
WO (1) WO2020253416A1 (zh)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112926438A (zh) * 2021-02-22 2021-06-08 深圳中科飞测科技股份有限公司 检测方法及装置、检测设备和存储介质
CN113609951A (zh) * 2021-07-30 2021-11-05 北京百度网讯科技有限公司 目标检测模型的训练和目标检测方法、装置、设备及介质
CN115249254A (zh) * 2022-09-21 2022-10-28 江西财经大学 一种基于ar技术的目标跟踪方法及系统
CN116310406A (zh) * 2023-05-22 2023-06-23 浙江之科云创数字科技有限公司 一种图像检测的方法、装置、存储介质及电子设备

Families Citing this family (24)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110163076B (zh) * 2019-03-05 2024-05-24 腾讯科技(深圳)有限公司 一种图像数据处理方法和相关装置
CN110378381B (zh) * 2019-06-17 2024-01-19 华为技术有限公司 物体检测方法、装置和计算机存储介质
CN111191689B (zh) * 2019-12-16 2023-09-12 恩亿科(北京)数据科技有限公司 样本数据的处理方法和装置
CN111191704B (zh) * 2019-12-24 2023-05-02 天津师范大学 一种基于任务图卷积网络的地基云分类方法
CN111161260A (zh) * 2020-01-02 2020-05-15 中冶赛迪重庆信息技术有限公司 一种基于深度学习的热轧带钢表面缺陷检测方法及装置
CN111310604A (zh) * 2020-01-21 2020-06-19 华为技术有限公司 一种物体检测方法、装置以及存储介质
CN111291809B (zh) * 2020-02-03 2024-04-12 华为技术有限公司 一种处理装置、方法及存储介质
CN113361529B (zh) * 2020-03-03 2024-05-10 北京四维图新科技股份有限公司 图像语义分割方法、装置、电子设备及存储介质
CN111460928B (zh) * 2020-03-17 2023-07-21 中国科学院计算技术研究所 一种人体动作识别系统及方法
CN111626291B (zh) * 2020-04-07 2023-04-25 上海交通大学 一种图像视觉关系检测方法、系统及终端
CN111612051B (zh) * 2020-04-30 2023-06-20 杭州电子科技大学 一种基于图卷积神经网络的弱监督目标检测方法
CN111967396A (zh) * 2020-08-18 2020-11-20 上海眼控科技股份有限公司 障碍物检测的处理方法、装置、设备及存储介质
CN113241124B (zh) * 2021-04-18 2022-09-06 南京理工大学 基于纳米颗粒的生物大分子检测方法及装置
CN113392781A (zh) * 2021-06-18 2021-09-14 山东浪潮科学研究院有限公司 一种基于图神经网络的视频情感语义分析方法
CN113743459B (zh) * 2021-07-29 2024-04-02 深圳云天励飞技术股份有限公司 目标检测方法、装置、电子设备及存储介质
CN115082739B (zh) * 2022-07-01 2023-09-01 苏州慧维智能医疗科技有限公司 基于卷积神经网络的内窥镜评估方法及评估系统
CN116385814B (zh) * 2023-03-07 2023-12-05 广州市妇女儿童医疗中心 一种检测目标的超声筛查方法、系统、装置及介质
CN115953666B (zh) * 2023-03-15 2023-06-06 国网湖北省电力有限公司经济技术研究院 一种基于改进Mask-RCNN的变电站现场进度识别方法
CN116229377B (zh) * 2023-05-06 2023-08-04 成都三合力通科技有限公司 一种人员管控报警系统及方法
CN116580027B (zh) * 2023-07-12 2023-11-28 中国科学技术大学 一种结直肠内窥镜视频的实时息肉检测系统及方法
CN116758111B (zh) * 2023-08-21 2023-11-17 中通信息服务有限公司 基于ai算法的施工现场目标物追踪方法及装置
CN116978011B (zh) * 2023-08-23 2024-03-15 广州新华学院 一种用于智能目标识别的图像语义通信方法及系统
CN117422855B (zh) * 2023-12-19 2024-05-03 浙江省北大信息技术高等研究院 面向机器视觉的图像预处理方法、装置、设备及存储介质
CN117423138B (zh) * 2023-12-19 2024-03-15 四川泓宝润业工程技术有限公司 基于多分支结构的人体跌倒检测方法、装置及系统

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170169315A1 (en) * 2015-12-15 2017-06-15 Sighthound, Inc. Deeply learned convolutional neural networks (cnns) for object localization and classification
US20170316285A1 (en) * 2016-04-28 2017-11-02 International Business Machines Corporation Detection of objects in images using region-based convolutional neural networks
CN108268651A (zh) * 2018-01-28 2018-07-10 海南大学 基于数据、信息和知识三层图谱架构的图像信息目标识别方法
CN109711434A (zh) * 2018-11-30 2019-05-03 北京百度网讯科技有限公司 获取和评估vqa系统的训练数据的方法、装置、设备和介质
CN109872362A (zh) * 2019-01-18 2019-06-11 腾讯科技(深圳)有限公司 一种目标检测方法及装置
CN110378381A (zh) * 2019-06-17 2019-10-25 华为技术有限公司 物体检测方法、装置和计算机存储介质
CN111310604A (zh) * 2020-01-21 2020-06-19 华为技术有限公司 一种物体检测方法、装置以及存储介质

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107644209A (zh) * 2017-09-21 2018-01-30 百度在线网络技术(北京)有限公司 人脸检测方法和装置
CN107609536A (zh) * 2017-09-29 2018-01-19 百度在线网络技术(北京)有限公司 信息生成方法和装置
US10902615B2 (en) * 2017-11-13 2021-01-26 Qualcomm Incorporated Hybrid and self-aware long-term object tracking
CN108388879B (zh) * 2018-03-15 2022-04-15 斑马网络技术有限公司 目标的检测方法、装置和存储介质
CN108846826B (zh) * 2018-04-24 2021-06-22 深圳大学 物体检测方法、装置、图像处理设备及存储介质
CN109389055B (zh) * 2018-09-21 2021-07-20 西安电子科技大学 基于混合卷积和注意力机制的视频分类方法
CN109583517A (zh) * 2018-12-26 2019-04-05 华东交通大学 一种适用于小目标检测的增强的全卷积实例语义分割算法
CN109740478B (zh) * 2018-12-26 2023-04-28 杨先明 车辆检测及识别方法、装置、计算机设备及可读存储介质
CN110309856A (zh) * 2019-05-30 2019-10-08 华为技术有限公司 图像分类方法、神经网络的训练方法及装置

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170169315A1 (en) * 2015-12-15 2017-06-15 Sighthound, Inc. Deeply learned convolutional neural networks (cnns) for object localization and classification
US20170316285A1 (en) * 2016-04-28 2017-11-02 International Business Machines Corporation Detection of objects in images using region-based convolutional neural networks
CN108268651A (zh) * 2018-01-28 2018-07-10 海南大学 基于数据、信息和知识三层图谱架构的图像信息目标识别方法
CN109711434A (zh) * 2018-11-30 2019-05-03 北京百度网讯科技有限公司 获取和评估vqa系统的训练数据的方法、装置、设备和介质
CN109872362A (zh) * 2019-01-18 2019-06-11 腾讯科技(深圳)有限公司 一种目标检测方法及装置
CN110378381A (zh) * 2019-06-17 2019-10-25 华为技术有限公司 物体检测方法、装置和计算机存储介质
CN111310604A (zh) * 2020-01-21 2020-06-19 华为技术有限公司 一种物体检测方法、装置以及存储介质

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112926438A (zh) * 2021-02-22 2021-06-08 深圳中科飞测科技股份有限公司 检测方法及装置、检测设备和存储介质
CN112926438B (zh) * 2021-02-22 2024-04-05 深圳中科飞测科技股份有限公司 检测方法及装置、检测设备和存储介质
CN113609951A (zh) * 2021-07-30 2021-11-05 北京百度网讯科技有限公司 目标检测模型的训练和目标检测方法、装置、设备及介质
CN113609951B (zh) * 2021-07-30 2023-11-24 北京百度网讯科技有限公司 目标检测模型的训练和目标检测方法、装置、设备及介质
CN115249254A (zh) * 2022-09-21 2022-10-28 江西财经大学 一种基于ar技术的目标跟踪方法及系统
CN115249254B (zh) * 2022-09-21 2022-12-30 江西财经大学 一种基于ar技术的目标跟踪方法及系统
CN116310406A (zh) * 2023-05-22 2023-06-23 浙江之科云创数字科技有限公司 一种图像检测的方法、装置、存储介质及电子设备
CN116310406B (zh) * 2023-05-22 2023-08-11 浙江之科云创数字科技有限公司 一种图像检测的方法、装置、存储介质及电子设备

Also Published As

Publication number Publication date
US20220108546A1 (en) 2022-04-07
CN110378381B (zh) 2024-01-19
CN110378381A (zh) 2019-10-25

Similar Documents

Publication Publication Date Title
WO2020253416A1 (zh) 物体检测方法、装置和计算机存储介质
WO2021043112A1 (zh) 图像分类方法以及装置
CN110298262B (zh) 物体识别方法及装置
US20220092351A1 (en) Image classification method, neural network training method, and apparatus
WO2021147325A1 (zh) 一种物体检测方法、装置以及存储介质
WO2021043168A1 (zh) 行人再识别网络的训练方法、行人再识别方法和装置
WO2021155792A1 (zh) 一种处理装置、方法及存储介质
WO2020192736A1 (zh) 物体识别方法及装置
US20220215227A1 (en) Neural Architecture Search Method, Image Processing Method And Apparatus, And Storage Medium
US20210398252A1 (en) Image denoising method and apparatus
WO2022042713A1 (zh) 一种用于计算设备的深度学习训练方法和装置
WO2022001805A1 (zh) 一种神经网络蒸馏方法及装置
US20220148291A1 (en) Image classification method and apparatus, and image classification model training method and apparatus
EP4109343A1 (en) Perception network architecture search method and device
WO2021018106A1 (zh) 行人检测方法、装置、计算机可读存储介质和芯片
CN111368972B (zh) 一种卷积层量化方法及其装置
WO2021073311A1 (zh) 图像识别方法、装置、计算机可读存储介质及芯片
US20220157046A1 (en) Image Classification Method And Apparatus
CN110222718A (zh) 图像处理的方法及装置
CN113011562A (zh) 一种模型训练方法及装置
WO2022217434A1 (zh) 感知网络、感知网络的训练方法、物体识别方法及装置
CN111797882A (zh) 图像分类方法及装置
CN112464930A (zh) 目标检测网络构建方法、目标检测方法、装置和存储介质
CN112529146A (zh) 神经网络模型训练的方法和装置
WO2022179606A1 (zh) 一种图像处理方法及相关装置

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: 20826790

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: 20826790

Country of ref document: EP

Kind code of ref document: A1