CN111815658B - Image recognition method and device - Google Patents

Image recognition method and device Download PDF

Info

Publication number
CN111815658B
CN111815658B CN201910291025.4A CN201910291025A CN111815658B CN 111815658 B CN111815658 B CN 111815658B CN 201910291025 A CN201910291025 A CN 201910291025A CN 111815658 B CN111815658 B CN 111815658B
Authority
CN
China
Prior art keywords
image
feature
edge contour
feature component
lbcnn
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910291025.4A
Other languages
Chinese (zh)
Other versions
CN111815658A (en
Inventor
韩璐
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Potevio Information Technology Co Ltd
Original Assignee
Potevio Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Potevio Information Technology Co Ltd filed Critical Potevio Information Technology Co Ltd
Priority to CN201910291025.4A priority Critical patent/CN111815658B/en
Publication of CN111815658A publication Critical patent/CN111815658A/en
Application granted granted Critical
Publication of CN111815658B publication Critical patent/CN111815658B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T10/00Road transport of goods or passengers
    • Y02T10/10Internal combustion engine [ICE] based vehicles
    • Y02T10/40Engine management systems

Landscapes

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

Abstract

The embodiment of the invention provides an image recognition method and device, wherein the image recognition method comprises the following steps: acquiring an image to be identified; inputting an image to be identified into an LBCNN model obtained through pre-training to obtain a first feature vector output by the LBCNN model; decomposing the first feature vector to obtain a first edge contour feature component and a first main feature component of the image to be identified; and identifying the image to be identified according to the first edge contour feature component and the first main body feature component to obtain an identification result. The embodiment of the invention reduces the network resource consumption and improves the recognition accuracy of the image.

Description

Image recognition method and device
Technical Field
The present invention relates to the field of communications technologies, and in particular, to an image recognition method and apparatus.
Background
With the continuous development of deep learning neural network structures, deep convolutional neural networks have achieved great success in solving the problems in the computer vision field such as target detection, tracking and recognition. However, on intelligent devices with limited computing resources such as automatic driving automobiles, intelligent robots and intelligent mobile phones, the model based on the standard deep convolutional neural network structure cannot meet the real-time requirement. In addition, the standard end-to-end deep convolutional neural network model is large, more calculation resources are required to be consumed, and the problem of over-fitting easily occurs in training of a small data set.
Aiming at the situation, one current mode is to adopt a network with a simple structure to construct a model, and reduce the calculation consumption in a mode of sacrificing the precision, but the method can not meet the application requirements of precision and speed; the other mode is to replace a binary neural network of real-value weight by binary weight, so that the operation amount can be effectively reduced, the real-value network structure with relatively simple precision is improved, but the mode still cannot meet the application requirement of effectively identifying the dynamic target in real time when the problems of large target scale change, multiple target types and the like exist in a complex environment.
In summary, when the computing resources are limited, the recognition algorithm in the prior art has the problem of low recognition accuracy.
Disclosure of Invention
The embodiment of the invention provides an image recognition method and device, which are used for solving the problem of lower recognition precision when a recognition algorithm in the prior art is limited in computing resources.
The embodiment of the invention provides an image recognition method, which comprises the steps of obtaining an image to be recognized, and further comprises the following steps:
inputting the image to be identified into a local binary convolutional neural network LBCNN model obtained by training in advance, and obtaining a first feature vector output by the LBCNN model, wherein the first feature vector comprises a plurality of feature components of the image to be identified;
decomposing the first feature vector to obtain a first edge contour feature component of the image to be identified and a first main feature component except the first edge contour feature component;
identifying the image to be identified according to the first edge contour feature component and the first main body feature component of the image to be identified to obtain an identification result; wherein,
the LBCNN model is obtained by training based on a first loss function and a second loss function; the first loss function is a function for predicting the edge contour of the preset sample image based on the edge contour feature component and the edge contour identification tag of the preset sample image; the second loss function is a function of predicting a subject of a preset sample image based on a subject feature component of the preset sample image other than the edge contour feature component and a subject identification tag.
The embodiment of the invention provides an image recognition device, which comprises a first acquisition module, a second acquisition module and a display module, wherein the first acquisition module is used for acquiring an image to be recognized; the image recognition apparatus further includes:
the second acquisition module is used for inputting the image to be identified into a local binary convolutional neural network LBCNN model obtained through pre-training to obtain a first feature vector output by the LBCNN model, wherein the first feature vector comprises a plurality of feature components of the image to be identified;
the third acquisition module is used for decomposing the first feature vector to obtain a first edge contour feature component of the image to be identified and a first main body feature component except the first edge contour feature component;
the fourth acquisition module is used for identifying the image to be identified according to the first edge contour feature component and the first main body feature component of the image to be identified to obtain an identification result; wherein,
the LBCNN model is obtained by training based on a first loss function and a second loss function; the first loss function is a function for predicting the edge contour of the preset sample image based on the edge contour feature component and the edge contour identification tag of the preset sample image; the second loss function is a function of predicting a subject of a preset sample image based on a subject feature component of the preset sample image other than the edge contour feature component and a subject identification tag.
The embodiment of the invention provides an electronic device, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor realizes the steps of the image recognition method when executing the program.
Embodiments of the present invention provide a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the image recognition method.
According to the image recognition method and device provided by the embodiment of the invention, the first feature vector of the image to be recognized is obtained through the LBCNN model, the first feature vector is decomposed to obtain the first edge contour feature component and the first main body feature component, finally the image to be recognized is recognized according to the first edge contour feature component and the first main body feature component to obtain the recognition result, at the moment, the network calculation consumption is reduced based on the first feature vector obtained through the LBCNN model, and in addition, the image to be recognized is recognized based on the first edge contour feature component and the first main body feature component obtained through the decomposition of the first feature vector, so that the edge contour information of the image to be recognized is fully utilized, the dynamic image recognition precision under a complex scene is improved, and the recognition precision of a dynamic target is improved while the calculation resource consumption is reduced.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions of the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart illustrating steps of an image recognition method according to an embodiment of the present invention;
FIG. 2 is a block diagram of an image recognition device according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
As shown in fig. 1, a flowchart of steps of an image recognition method according to an embodiment of the present invention includes the following steps:
step 101: and acquiring an image to be identified.
Step 102: and inputting the image to be identified into a local binary convolutional neural network LBCNN model obtained by pre-training to obtain a first feature vector output by the LBCNN model.
Specifically, a Local Binary Convolutional Neural Network (LBCNN) model is obtained by training based on a first loss function and a second loss function; the first loss function is a function for predicting the edge contour of the preset sample image based on the edge contour feature component and the edge contour identification tag of the preset sample image; the second loss function is a function of predicting a subject of a preset sample image based on a subject feature component of the preset sample image other than the edge contour feature component and a subject identification tag. Therefore, the LBCNN model is obtained through training of the first loss function and the second loss function, and when the first feature vector is obtained through the LBCNN model, accuracy in identifying an image to be identified can be guaranteed through the first edge contour feature component and the first main body feature component which are obtained through first feature vector decomposition in the subsequent process.
Of course, it should be noted here that the preset sample image corresponds to the edge profile identification tag and the subject identification tag.
In this step, the obtained image to be identified may be directly input into the LBCNN model, so as to obtain the first feature component output by the LBCNN model, thereby reducing the calculation amount of the neural network.
Of course, the first eigenvector is output by the full connection layer in the LBCNN model.
In addition, the LBCNN model is specifically described below.
The traditional Local Binary Pattern (LBP) operator can describe the local texture characteristics of the image, and the original LBP operator calculation method comprises the following steps: and in a window of 3 times 3 or 5 times 5, and the like, generating an LBP operator by comparing the values of surrounding pixel points and the values of central pixel points, wherein the surrounding pixel points are higher than the values of the central pixel points and are expressed as 1, otherwise, the surrounding pixel points are expressed as 0, and the aggregated LBP characteristic values can reflect the local texture information of the image. In addition, the LBP operator shows the texture characteristics of the image in a binarization mode with less calculation amount. In this way, the present embodiment can reduce the calculation amount of the neural network while extracting the features by referring to the LBP feature layer in the standard neural network, that is, by the LBCNN model.
In particular, the LBCNN model may include n convolution kernels, where the image is input, i.e., the image X to be identified i N different LBP signatures are generated by n convolution kernels and a nonlinear activation function. Furthermore, the n LBP profiles are based on a learnable weight V i Linear combination to form LBP characteristic diagram combination X i+1 And the generated feature map combination X i+1 Can be used as the next layer input of the convolutional neural network. Of course, the LBCNN model in the present embodimentCan be used for replacing any standard convolutional neural network convolutional layer to reduce the calculated amount.
Step 103: and decomposing the first feature vector to obtain a first edge contour feature component of the image to be identified and a first main body feature component except the first edge contour feature component.
In this step, specifically, after the first feature vector output by the LBCNN model is obtained, the first feature vector may be directly decomposed to obtain a first edge contour feature component of the image to be identified and a first main feature component except for the first edge contour feature component, that is, the first feature vector includes the first edge contour feature component and the first main feature component.
Specifically, when the first feature vector is decomposed, the first feature vector may be decomposed based on a spherical coordinate system to obtain the first edge contour feature component and the first main feature component.
This will be specifically described below.
Specifically, since the target recognition loss function of the target based on angle calculation is excellent, in order to ensure the consistency of the overall feature space mapping, the first feature vector may be decomposed under the spherical coordinate system, that is, the first feature vector may be decomposed by the following formula:
X sphere =X edge ×X cont
X edge =r; wherein,
X sphere representing a first feature vector;is the angle in the spherical coordinate systemComponent, i.e. X cont Representing a first subject feature component associated with a subject of an image to be identified; r is the radial component in the spherical coordinate system for representing the edge profile information, i.e. X edge Representing a first edge contour feature component of the image to be identified.
Therefore, based on the fact that the number of the to-be-identified target types is large in the complex scene, different target edge profiles have large differences, at the moment, the first feature vector is decomposed into the first edge profile feature component and the first main body feature component, so that the target large type classification can be carried out by utilizing the target edge profile information, then fine identification can be carried out in the type to which the target edge profile information belongs, the edge profile features and the main body features are combined, and therefore the dynamic target identification accuracy is effectively improved.
Step 104: and identifying the image to be identified according to the first edge contour feature component and the first main body feature component of the image to be identified, so as to obtain an identification result.
In this step, specifically, after the first edge contour feature component and the first main feature component of the image to be identified are obtained, the image to be identified may be identified directly through the first edge contour feature component and the first main feature component, so as to obtain an identification result of the image to be identified.
Specifically, the image to be identified is identified through the first edge contour feature component and the first main body feature component, so that the full utilization of the edge contour information of the image to be identified is realized, the combination of the edge contour feature and the main body feature is realized, and the identification precision of the image to be identified is further effectively improved.
In this way, the first feature vector is obtained through the LBCNN model, so that network computing consumption is reduced, and in addition, the image to be identified is identified through the first edge contour feature component and the first main body feature component which are obtained based on the first feature vector decomposition, so that the edge contour information of the image to be identified is fully utilized, the dynamic image identification precision under a complex scene is improved, and the dynamic target identification precision is improved while the computing resource consumption is reduced under the condition of limited computing resources.
Furthermore, it should be noted that, before the image to be identified is input into the local binary convolutional neural network LBCNN model obtained by training in advance, the method further includes:
training to obtain the LBCNN model through a preset sample image; wherein the preset sample image corresponds to an edge profile identification tag and a subject identification tag.
Specifically, when training to obtain the LBCNN model through the preset sample image, the method may include the following steps:
step A: inputting the preset sample image into a pre-constructed LBCNN model to be trained to obtain a feature vector output by the LBCNN model to be trained, wherein the feature vector comprises a plurality of feature components of the preset sample image.
Specifically, the feature vector is output by the full connection layer of the LBCNN model to be trained.
And (B) step (B): and decomposing the feature vector to obtain an edge contour feature component and a main feature component except the edge contour feature component of the preset sample image.
In this step, the specific process of decomposing the feature vector is the same as the specific process of decomposing the first feature vector, and will not be described in detail here.
Step C: obtaining a first loss function for predicting the edge profile of the preset sample image based on the edge profile characteristic component and the edge profile identification tag of the preset sample image, and obtaining a second loss function for predicting the main body of the preset sample image based on the main body characteristic component and the main body identification tag of the preset sample image.
In this step, specifically, the present embodiment establishes a predictive recognition task of an edge contour and a predictive recognition task of a subject, respectively, based on the decomposed edge contour feature component and subject feature component.
In particular, based on the resolved edge profileWhen the characteristic component establishes the prediction recognition task of the edge contour, in order to not introduce too much extra calculation amount, the edge contour prediction can be estimated in a linear regression mode, at the moment, the number of preset sample images can be set to be N, the number of the preset sample images is input to an LBCNN model to be trained and is the ith image sample, and z i For the edge contour identification label of the ith image sample, m is the L2 norm of the edge contour feature component corresponding to the image sample i, and the f (m) mapping function is used for fitting m and z i Mapping relation between the two. In order to minimize the calculation amount, f (m) is mapped by using a linear polynomial, that is, f (x) =kx+b, and the following regression loss function is used in the task of predicting and identifying the edge contour, that is, the first loss function is as follows:
in addition, in particular, when the predictive recognition task of the subject is established based on the decomposed subject feature components, a second loss function based on angle calculation, which is commonly used, may be adopted in the predictive recognition task of the subject.
In this way, the feature components are decomposed into edge contour feature components and main feature components, and an edge contour prediction linear regression task is added based on the decomposed edge contour feature components, so that the edge contour information of the image is fully utilized.
Step D: and obtaining a target recognition loss function for predicting the preset sample image according to the first loss function and the second loss function.
In this step, specifically, when the target recognition loss function for predicting the preset sample image is obtained according to the first loss function and the second loss function, the target recognition loss function can be obtained by the following formula:
L=L cont +μL edge the method comprises the steps of carrying out a first treatment on the surface of the Wherein,
l is a target recognition loss function, L cont As a second loss function, L edge For the first loss function, μ is the weight value occupied by the first loss function, of course the firstThe weight value occupied by the loss function can be correspondingly adjusted according to the complexity degree of different application scenes.
In this way, by establishing the first loss function and the second loss function based on the decomposed edge contour feature components and the main body feature components, namely, establishing the edge contour prediction task and the main body prediction recognition task, the dynamic target recognition loss function can be constructed in a multi-task learning mode, and the dynamic target recognition precision is further improved.
Step E: and training parameters in the LBCNN model to be trained based on the target recognition loss function to obtain the LBCNN model, wherein the value of the target recognition loss function corresponding to the LBCNN model is smaller than a preset threshold.
In this step, specifically, based on the obtained target recognition loss function, the parameters in the LBCNN model to be trained may be trained to obtain the LBCNN model, where the value of the target recognition loss function corresponding to the LBCNN model is smaller than a preset threshold, that is, the LBCNN model may ensure the recognition accuracy of the image to be recognized.
Therefore, the LBCNN model is obtained through training in the steps, so that network calculation consumption can be reduced when the image is identified by the feature vector output by the LBCNN model, and the identification accuracy of the image can be effectively improved based on the decomposed edge contour feature component and main feature component.
In addition, further in this embodiment, before the image to be identified is identified according to the first edge contour feature component and the first main feature component of the image to be identified, and an identification result is obtained, the image identification method further includes:
acquiring an image to be compared, and acquiring a second feature vector of the image to be compared through the LBCNN model, wherein the second feature vector comprises a plurality of feature components of the image to be compared; and then decomposing the second feature vector to obtain a second edge contour feature component of the image to be compared and a second main body feature component except the second edge contour feature component.
Of course, it should be noted here that the specific process of acquiring the second edge contour feature component and the second main feature component of the image to be compared is the same as the specific process of acquiring the first edge contour feature component and the first main feature component of the image to be identified, and detailed description thereof will not be repeated here.
At this time, when the image to be identified is identified according to the first edge contour feature component and the first main feature component of the image to be identified, and an identification result is obtained, a first feature similarity between the first edge contour feature component and the second edge contour feature component can be calculated, a second feature similarity between the first main feature component and the second main feature component can be calculated, and then the similarity between the image to be identified and the image to be compared can be determined according to the first feature similarity and the second feature similarity.
When the similarity is larger than a preset threshold value, obtaining a recognition result indicating that the image to be recognized is the same as the image to be compared; of course, when the similarity is lower than a preset threshold, a recognition result indicating that the image to be recognized is different from the image to be compared is obtained.
In addition, it should be noted that, specifically, when determining the similarity between the image to be identified and the image to be compared according to the first feature similarity and the second feature similarity, the weighted sum may be performed on the first feature similarity and the second feature similarity, and the value after the weighted sum is used as the similarity between the image to be identified and the image to be compared; the weighted sum of the first feature similarity and the second feature similarity may be performed, and then the value after the sum is obtained as the similarity between the image to be identified and the image to be compared, that is, a specific manner of determining the similarity between the image to be identified and the image to be compared is not limited.
In this way, the first edge contour feature component and the first main body feature component of the image to be identified are compared with the second edge feature component and the second main body feature component of the image to be compared in similarity, and the final similarity is obtained by combining the obtained two feature similarities, so that the edge contour feature and the main body feature are combined, and the identification precision of the image is effectively improved.
According to the image recognition method, the first feature vector is obtained through the LBCNN model, network computing consumption is reduced, in addition, the image to be recognized is recognized through the first edge contour feature component and the first main body feature component which are obtained through decomposition based on the first feature vector, so that the edge contour information of the image to be recognized is fully utilized, the dynamic image recognition precision under a complex scene is improved, and therefore the recognition precision of a dynamic target can be improved while the computing resource consumption is reduced under the condition that computing resources are limited.
In addition, as shown in fig. 2, a block diagram of an image recognition apparatus according to an embodiment of the present invention includes a first obtaining module 201 configured to obtain an image to be recognized; furthermore, the image recognition apparatus further includes:
the second obtaining module 202 is configured to input the image to be identified into a local binary convolutional neural network LBCNN model obtained by training in advance, so as to obtain a first feature vector output by the LBCNN model, where the first feature vector includes a plurality of feature components of the image to be identified;
a third obtaining module 203, configured to decompose the first feature vector to obtain a first edge contour feature component of the image to be identified and a first main feature component except for the first edge contour feature component;
a fourth obtaining module 204, configured to identify the image to be identified according to the first edge contour feature component and the first main feature component of the image to be identified, so as to obtain an identification result; wherein,
the LBCNN model is obtained by training based on a first loss function and a second loss function; the first loss function is a function for predicting the edge contour of the preset sample image based on the edge contour feature component and the edge contour identification tag of the preset sample image; the second loss function is a function of predicting a subject of a preset sample image based on a subject feature component of the preset sample image other than the edge contour feature component and a subject identification tag.
Optionally, the third obtaining module 203 is specifically configured to decompose the first feature vector based on a spherical coordinate system to obtain the first edge contour feature component and the first body feature component.
Optionally, the image recognition device further includes:
a fifth obtaining module, configured to obtain an image to be compared, and obtain a second feature vector of the image to be compared through the LBCNN model, where the second feature vector includes a plurality of feature components of the image to be compared;
a sixth obtaining module, configured to decompose the second feature vector to obtain a second edge contour feature component of the image to be compared and a second main feature component except for the second edge contour feature component;
the fourth acquisition module includes:
a calculation unit configured to calculate a first feature similarity between the first edge contour feature component and the second edge contour feature component, and calculate a second feature similarity between the first body feature component and the second body feature component;
the determining unit is used for determining the similarity of the image to be identified and the image to be compared according to the first feature similarity and the second feature similarity;
and the first acquisition unit is used for acquiring an identification result indicating that the image to be identified is the same as the image to be compared when the similarity is larger than a preset threshold value.
Optionally, the image recognition device further includes:
the training module is used for training to obtain the LBCNN model through a preset sample image; the preset sample image corresponds to an edge contour identification tag and a main body identification tag;
the training module comprises:
the second acquisition unit is used for inputting the preset sample image into a pre-constructed LBCNN model to be trained to obtain a feature vector output by the LBCNN model to be trained, wherein the feature vector comprises a plurality of feature components of the preset sample image;
a third obtaining unit, configured to decompose the feature vector to obtain an edge contour feature component of the preset sample image and a main feature component other than the edge contour feature component;
a fourth obtaining unit, configured to obtain a first loss function for predicting an edge contour of the preset sample image based on an edge contour feature component and an edge contour identification tag of the preset sample image, and obtain a second loss function for predicting a main body of the preset sample image based on a main body feature component and a main body identification tag of the preset sample image;
a fifth obtaining unit, configured to obtain a target recognition loss function for predicting the preset sample image according to the first loss function and the second loss function;
and a sixth obtaining unit, configured to train parameters in the LBCNN model to be trained based on the target recognition loss function, to obtain the LBCNN model, where a value of the target recognition loss function corresponding to the LBCNN model is smaller than a preset threshold.
In this way, the image recognition device provided in this embodiment inputs the image to be recognized into the LBCNN model obtained by training in advance through the second acquisition module, obtains the first feature vector output by the LBCNN model, decomposes the first feature vector through the third acquisition module, obtains the first edge contour feature component and the first main feature component of the image to be recognized, and finally recognizes the image to be recognized through the fourth acquisition module according to the first edge contour feature component and the first main feature component of the image to be recognized, so as to obtain a recognition result, thereby realizing that the recognition accuracy of the dynamic target can be improved while reducing the consumption of computing resources under the condition of limited computing resources.
In addition, as shown in fig. 3, an entity structure schematic diagram of an electronic device according to an embodiment of the present invention may include: processor 310, communication interface (Communications Interface) 320, memory 330 and communication bus 340, wherein processor 310, communication interface 320, memory 330 accomplish communication with each other through communication bus 340. The processor 310 may invoke a computer program stored in the memory 330 and executable on the processor 310 to perform the methods provided by the above embodiments, including, for example: acquiring an image to be identified; inputting the image to be identified into a local binary convolutional neural network LBCNN model obtained by training in advance, and obtaining a first feature vector output by the LBCNN model, wherein the first feature vector comprises a plurality of feature components of the image to be identified; decomposing the first feature vector to obtain a first edge contour feature component of the image to be identified and a first main feature component except the first edge contour feature component; identifying the image to be identified according to the first edge contour feature component and the first main body feature component of the image to be identified to obtain an identification result; the LBCNN model is obtained by training based on a first loss function and a second loss function; the first loss function is a function for predicting the edge contour of the preset sample image based on the edge contour feature component and the edge contour identification tag of the preset sample image; the second loss function is a function of predicting a subject of a preset sample image based on a subject feature component of the preset sample image other than the edge contour feature component and a subject identification tag.
Further, the logic instructions in the memory 330 described above may be implemented in the form of software functional units and may be stored in a computer-readable storage medium when sold or used as a stand-alone product. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
Embodiments of the present invention also provide a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, is implemented to perform the methods provided by the above embodiments, for example, comprising: acquiring an image to be identified; inputting the image to be identified into a local binary convolutional neural network LBCNN model obtained by training in advance, and obtaining a first feature vector output by the LBCNN model, wherein the first feature vector comprises a plurality of feature components of the image to be identified; decomposing the first feature vector to obtain a first edge contour feature component of the image to be identified and a first main feature component except the first edge contour feature component; identifying the image to be identified according to the first edge contour feature component and the first main body feature component of the image to be identified to obtain an identification result; the LBCNN model is obtained by training based on a first loss function and a second loss function; the first loss function is a function for predicting the edge contour of the preset sample image based on the edge contour feature component and the edge contour identification tag of the preset sample image; the second loss function is a function of predicting a subject of a preset sample image based on a subject feature component of the preset sample image other than the edge contour feature component and a subject identification tag.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (8)

1. An image recognition method, comprising obtaining an image to be recognized, characterized in that the image recognition method further comprises:
inputting the image to be identified into a local binary convolutional neural network LBCNN model obtained by training in advance, and obtaining a first feature vector output by the LBCNN model, wherein the first feature vector comprises a plurality of feature components of the image to be identified;
decomposing the first feature vector to obtain a first edge contour feature component of the image to be identified and a first main feature component except the first edge contour feature component;
identifying the image to be identified according to the first edge contour feature component and the first main body feature component of the image to be identified to obtain an identification result; wherein,
the LBCNN model is obtained by training based on a first loss function and a second loss function; the first loss function is a function for predicting the edge contour of the preset sample image based on the edge contour feature component and the edge contour identification tag of the preset sample image; the second loss function is a function for predicting a subject of a preset sample image based on a subject feature component of the preset sample image other than the edge contour feature component and a subject identification tag;
the image to be identified is identified according to the first edge contour feature component and the first main body feature component of the image to be identified, and before the identification result is obtained, the image identification method further comprises the following steps:
acquiring an image to be compared, and acquiring a second feature vector of the image to be compared through the LBCNN model, wherein the second feature vector comprises a plurality of feature components of the image to be compared;
decomposing the second feature vector to obtain a second edge contour feature component of the image to be compared and a second main feature component except the second edge contour feature component;
the identifying the image to be identified according to the first edge contour feature component and the first main body feature component of the image to be identified, to obtain an identification result, includes:
calculating a first feature similarity between the first edge contour feature component and the second edge contour feature component, and calculating a second feature similarity between the first body feature component and the second body feature component;
determining the similarity of the image to be identified and the image to be compared according to the first feature similarity and the second feature similarity; wherein,
and when the similarity is larger than a preset threshold value, obtaining a recognition result indicating that the image to be recognized is the same as the image to be compared.
2. The image recognition method according to claim 1, wherein the decomposing the first feature vector to obtain a first edge contour feature component of the image to be recognized and a first body feature component other than the first edge contour feature component includes:
and decomposing the first feature vector based on a spherical coordinate system to obtain the first edge contour feature component and the first main body feature component.
3. The image recognition method according to claim 1, wherein before the image to be recognized is input into a local binary convolutional neural network LBCNN model obtained by training in advance to obtain a first feature vector output by the LBCNN model, the image recognition method further comprises:
training to obtain the LBCNN model through a preset sample image; the preset sample image corresponds to an edge contour identification tag and a main body identification tag;
the training to obtain the LBCNN model through a preset sample image includes:
inputting the preset sample image into a pre-constructed LBCNN model to be trained to obtain a feature vector output by the LBCNN model to be trained, wherein the feature vector comprises a plurality of feature components of the preset sample image;
decomposing the feature vector to obtain an edge contour feature component and a main feature component except the edge contour feature component of the preset sample image;
obtaining a first loss function for predicting the edge contour of the preset sample image based on the edge contour feature component and the edge contour identification tag of the preset sample image, and obtaining a second loss function for predicting the main body of the preset sample image based on the main body feature component and the main body identification tag of the preset sample image;
obtaining a target recognition loss function for predicting the preset sample image according to the first loss function and the second loss function;
and training parameters in the LBCNN model to be trained based on the target recognition loss function to obtain the LBCNN model, wherein the value of the target recognition loss function corresponding to the LBCNN model is smaller than a preset threshold.
4. An image recognition device comprises a first acquisition module, a second acquisition module and a processing module, wherein the first acquisition module is used for acquiring an image to be recognized; the image recognition device is characterized by further comprising:
the second acquisition module is used for inputting the image to be identified into a local binary convolutional neural network LBCNN model obtained through pre-training to obtain a first feature vector output by the LBCNN model, wherein the first feature vector comprises a plurality of feature components of the image to be identified;
the third acquisition module is used for decomposing the first feature vector to obtain a first edge contour feature component of the image to be identified and a first main body feature component except the first edge contour feature component;
the fourth acquisition module is used for identifying the image to be identified according to the first edge contour feature component and the first main body feature component of the image to be identified to obtain an identification result; wherein,
the LBCNN model is obtained by training based on a first loss function and a second loss function; the first loss function is a function for predicting the edge contour of the preset sample image based on the edge contour feature component and the edge contour identification tag of the preset sample image; the second loss function is a function for predicting a subject of a preset sample image based on a subject feature component of the preset sample image other than the edge contour feature component and a subject identification tag;
a fifth obtaining module, configured to obtain an image to be compared, and obtain a second feature vector of the image to be compared through the LBCNN model, where the second feature vector includes a plurality of feature components of the image to be compared;
a sixth obtaining module, configured to decompose the second feature vector to obtain a second edge contour feature component of the image to be compared and a second main feature component except for the second edge contour feature component;
the fourth acquisition module includes:
a calculation unit configured to calculate a first feature similarity between the first edge contour feature component and the second edge contour feature component, and calculate a second feature similarity between the first body feature component and the second body feature component;
the determining unit is used for determining the similarity of the image to be identified and the image to be compared according to the first feature similarity and the second feature similarity;
and the first acquisition unit is used for acquiring an identification result indicating that the image to be identified is the same as the image to be compared when the similarity is larger than a preset threshold value.
5. The image recognition device of claim 4, wherein the third obtaining module is specifically configured to decompose the first feature vector based on a spherical coordinate system to obtain the first edge contour feature component and the first body feature component.
6. The image recognition device of claim 4, wherein the image recognition device further comprises:
the training module is used for training to obtain the LBCNN model through a preset sample image; the preset sample image corresponds to an edge contour identification tag and a main body identification tag;
the training module comprises:
the second acquisition unit is used for inputting the preset sample image into a pre-constructed LBCNN model to be trained to obtain a feature vector output by the LBCNN model to be trained, wherein the feature vector comprises a plurality of feature components of the preset sample image;
a third obtaining unit, configured to decompose the feature vector to obtain an edge contour feature component of the preset sample image and a main feature component other than the edge contour feature component;
a fourth obtaining unit, configured to obtain a first loss function for predicting an edge contour of the preset sample image based on an edge contour feature component and an edge contour identification tag of the preset sample image, and obtain a second loss function for predicting a main body of the preset sample image based on a main body feature component and a main body identification tag of the preset sample image;
a fifth obtaining unit, configured to obtain a target recognition loss function for predicting the preset sample image according to the first loss function and the second loss function;
and a sixth obtaining unit, configured to train parameters in the LBCNN model to be trained based on the target recognition loss function, to obtain the LBCNN model, where a value of the target recognition loss function corresponding to the LBCNN model is smaller than a preset threshold.
7. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the image recognition method according to any one of claims 1 to 3 when the program is executed.
8. A non-transitory computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the image recognition method according to any one of claims 1 to 3.
CN201910291025.4A 2019-04-11 2019-04-11 Image recognition method and device Active CN111815658B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910291025.4A CN111815658B (en) 2019-04-11 2019-04-11 Image recognition method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910291025.4A CN111815658B (en) 2019-04-11 2019-04-11 Image recognition method and device

Publications (2)

Publication Number Publication Date
CN111815658A CN111815658A (en) 2020-10-23
CN111815658B true CN111815658B (en) 2023-11-24

Family

ID=72844209

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910291025.4A Active CN111815658B (en) 2019-04-11 2019-04-11 Image recognition method and device

Country Status (1)

Country Link
CN (1) CN111815658B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112861949B (en) * 2021-01-29 2023-08-04 成都视海芯图微电子有限公司 Emotion prediction method and system based on face and sound

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105740808A (en) * 2016-01-28 2016-07-06 北京旷视科技有限公司 Human face identification method and device
CN109583357A (en) * 2018-11-23 2019-04-05 厦门大学 A kind of improvement LBP and the cascade face identification method of light weight convolutional neural networks

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10726244B2 (en) * 2016-12-07 2020-07-28 Samsung Electronics Co., Ltd. Method and apparatus detecting a target

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105740808A (en) * 2016-01-28 2016-07-06 北京旷视科技有限公司 Human face identification method and device
CN109583357A (en) * 2018-11-23 2019-04-05 厦门大学 A kind of improvement LBP and the cascade face identification method of light weight convolutional neural networks

Also Published As

Publication number Publication date
CN111815658A (en) 2020-10-23

Similar Documents

Publication Publication Date Title
Qi et al. Convolutional neural network based detection and judgement of environmental obstacle in vehicle operation
CN108229479B (en) Training method and device of semantic segmentation model, electronic equipment and storage medium
CN111507993A (en) Image segmentation method and device based on generation countermeasure network and storage medium
CN113705769A (en) Neural network training method and device
CN111738403B (en) Neural network optimization method and related equipment
US11574500B2 (en) Real-time facial landmark detection
CN109726195B (en) Data enhancement method and device
CN104636118A (en) QR two-dimensional code self-adaptation binarization processing method and device based on light balance
CN113837942A (en) Super-resolution image generation method, device, equipment and storage medium based on SRGAN
CN111223128A (en) Target tracking method, device, equipment and storage medium
CN114091554A (en) Training set processing method and device
CN111652181A (en) Target tracking method and device and electronic equipment
CN115147632A (en) Image category automatic labeling method and device based on density peak value clustering algorithm
CN113971644A (en) Image identification method and device based on data enhancement strategy selection
CN111815658B (en) Image recognition method and device
CN110826563A (en) Finger vein segmentation method and device based on neural network and probability map model
Zhou et al. An improved algorithm using weighted guided coefficient and union self‐adaptive image enhancement for single image haze removal
CN109299743A (en) Gesture identification method and device, terminal
CN115457365A (en) Model interpretation method and device, electronic equipment and storage medium
CN112732967B (en) Automatic image annotation method and system and electronic equipment
CN114972871A (en) Image registration-based few-sample image anomaly detection method and system
CN114818785A (en) Signal modulation mode identification method based on multi-model fusion
CN109740646B (en) Image difference comparison method and system and electronic device
CN116071625B (en) Training method of deep learning model, target detection method and device
CN116912283A (en) Video segmentation method and device based on cascade residual convolution neural network

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant