# US 12,118,770 B2 · Image recognition method and apparatus, electronic device and readable storage medium

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 12,118,770 B2
- Document ID: US12118770B2
- Status: Granted
- Kind: B2
- Application number: 17/657,118
- Filed: 2022-03-29
- Published: 2023-03-30
- Granted: 2024-10-15
- Earliest claimed: 2021-09-29
- Assignees: Beijing Baidu Netcom Science Technology Co., Ltd.
- Applicants: Beijing Baidu Netcom Science Technology Co., Ltd.
- Inventors: Shengyu Wei; Yuning Du; Xueying Lyu; Ying Zhou; Qiao Zhao; Qiwen Liu; Ran Bi; Xiaoguang Hu; Dianhai Yu; Yanjun Ma
- Web page: https://patentgrep.com/patent/US12118770B2

## CPC

- G06V 10/764: using classification, e.g. of video objects
- G06V 10/40: Extraction of image or video features
- G06V 10/761: {Proximity, similarity or dissimilarity measures}
- G06V 10/82: using neural networks
- G06V 40/172: {Classification, e.g. identification}
- G06V: IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING

## Abstract

The present disclosure provides an image recognition method and apparatus, an electronic device and a readable storage medium, and relates to the field of artificial intelligence technologies, such as image processing and deep learning technologies. The image recognition method includes: acquiring a to-be-recognized image, and determining a to-be-recognized subject in the to-be-recognized image; extracting a subject feature of the to-be-recognized subject, and obtaining a target feature according to the subject feature; determining a target candidate feature in a plurality of candidate features using the target feature; and taking a class corresponding to the target candidate feature as a recognition result of the to-be-recognized subject. With the present disclosure, different image recognition requirements may be met, and a speed and accuracy of image recognition may be improved.

## Claims

### Claim 1

An image recognition method, comprising:
acquiring a to-be-recognized image, and determining a to-be-recognized subject in the to-be-recognized image;
extracting a subject feature of the to-be-recognized subject, and obtaining a target feature according to the subject feature;
determining a target candidate feature in a plurality of candidate features using the target feature; and
acquiring a class corresponding to the target candidate feature as a recognition result of the to-be-recognized subject,
wherein the extracting a subject feature of the to-be-recognized subject comprises:
inputting the to-be-recognized subject into an image recognition model; and
acquiring input content of a last layer in the image recognition model as the subject feature of the to-be-recognized subject.

### Claim 2 (depends on 1)

The method according to claim 1, wherein the determining a to-be-recognized subject in the to-be-recognized image comprises:
performing subject detection on the to-be-recognized image to obtain at least one subject detection result in the to-be-recognized image; and
acquiring a subject detection result in the at least one subject detection result meeting a preset requirement as the to-be-recognized subject, wherein the preset requirement is a subject size exceeding a preset size threshold.

### Claim 3 (depends on 1)

The method according to claim 1, wherein the obtaining a target feature according to the subject feature comprises:
acquiring a preset processing method, wherein the preset processing method is a feature dimension reduction method comprising a hash function or a deep hash model; and
processing the subject feature using the preset processing method, and taking a processing result as the target feature.

### Claim 4 (depends on 1)

The method according to claim 1, further comprising: pre-generating a plurality of candidate features by:
acquiring standard images corresponding to different classes; and
obtaining the candidate feature according to each standard image, and establishing an index between the candidate feature and the class corresponding to the standard image.

### Claim 5 (depends on 1)

The method according to claim 1, wherein the determining a target candidate feature in a plurality of candidate features using the target feature comprises:
acquiring a recognition type of the to-be-recognized subject;
determining a similarity calculation method corresponding to the recognition type;
calculating similarity between the target feature and the plurality of candidate features using the similarity calculation method; and
taking a candidate feature with the highest similarity calculation result as the target candidate feature.

### Claim 6

An electronic device, comprising:
at least one processor; and
a memory communicatively connected with the at least one processor;
wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform an image recognition method, wherein the image recognition method comprises:
acquiring a to-be-recognized image and determining a to-be-recognized subject in the to-be-recognized image;
extracting a subject feature of the to-be-recognized subject and obtaining a target feature according to the subject feature;
determining a target candidate feature in a plurality of candidate features using the target feature; and
acquiring a class corresponding to the target candidate feature as a recognition result of the to-be-recognized subject,
wherein the extracting a subject feature of the to-be-recognized subject comprises:
inputting the to-be-recognized subject into an image recognition model; and
acquiring input content of a last layer in the image recognition model as the subject feature of the to-be-recognized subject.

### Claim 7 (depends on 6)

The electronic device according to claim 6, wherein the determining a to-be-recognized subject in the to-be-recognized image comprises:
performing subject detection on the to-be-recognized image to obtain at least one subject detection result in the to-be-recognized image; and
acquiring a subject detection result in the at least one subject detection result meeting a preset requirement as the to-be-recognized subject, wherein the preset requirement is a subject size exceeding a preset size threshold.

### Claim 8 (depends on 6)

The electronic device according to claim 6, wherein the obtaining a target feature according to the subject feature comprises:
acquiring a preset processing method; and
processing the subject feature using the preset processing method, and taking a processing result as the target feature, wherein the preset processing method is a feature dimension reduction method comprising a hash function or a deep hash model.

### Claim 9 (depends on 6)

The electronic device according to claim 6, further comprising: pre-generating a plurality of candidate features by:
acquiring standard images corresponding to different classes; and
obtaining the candidate feature according to each standard image, and establishing an index between the candidate feature and the class corresponding to the standard image.

### Claim 10 (depends on 6)

The electronic device according to claim 6, wherein the determining a target candidate feature in a plurality of candidate features using the target feature comprises:
acquiring a recognition type of the to-be-recognized subject;
determining a similarity calculation method corresponding to the recognition type;
calculating similarity between the target feature and the plurality of candidate features using the similarity calculation method; and
taking a candidate feature with the highest similarity calculation result as the target candidate feature.

### Claim 11

A non-transitory computer readable storage medium with computer instructions stored thereon, wherein the computer instructions are used for causing a computer to perform an image recognition method, wherein the image recognition method comprises:
acquiring a to-be-recognized image, and determining a to-be-recognized subject in the to-be-recognized image;
extracting a subject feature of the to-be-recognized subject, and obtaining a target feature according to the subject feature;
determining a target candidate feature in a plurality of candidate features using the target feature; and
acquiring a class corresponding to the target candidate feature as a recognition result of the to-be-recognized subject,
wherein the extracting a subject feature of the to-be-recognized subject comprises:
inputting the to-be-recognized subject into an image recognition model; and
acquiring input content of a last layer in the image recognition model as the subject feature of the to-be-recognized subject.

### Claim 12 (depends on 11)

The non-transitory computer readable storage medium according to claim 11, wherein the determining a to-be-recognized subject in the to-be-recognized image comprises:
performing subject detection on the to-be-recognized image to obtain at least one subject detection result in the to-be-recognized image; and
acquiring a subject detection result in the at least one subject detection result meeting a preset requirement as the to-be-recognized subject, wherein the preset requirement is a subject size exceeding a preset size threshold.

### Claim 13 (depends on 11)

The non-transitory computer readable storage medium according to claim 11, wherein the obtaining a target feature according to the subject feature comprises:
acquiring a preset processing method, wherein the preset processing method is a feature dimension reduction method comprising a hash function or a deep hash model; and
processing the subject feature using the preset processing method, and taking a processing result as the target feature.

### Claim 14 (depends on 11)

The non-transitory computer readable storage medium according to claim 11, further comprising: pre-generating a plurality of candidate features by:
acquiring standard images corresponding to different classes; and
obtaining the candidate feature according to each standard image, and establishing an index between the candidate feature and the class corresponding to the standard image.

### Claim 15 (depends on 11)

The non-transitory computer readable storage medium according to claim 11, wherein the determining a target candidate feature in a plurality of candidate features using the target feature comprises:
acquiring a recognition type of the to-be-recognized subject;
determining a similarity calculation method corresponding to the recognition type;
calculating similarity between the target feature and the plurality of candidate features using the similarity calculation method; and
taking a candidate feature with the highest similarity calculation result as the target candidate feature.
