IP Library Granted Patent US 12,423,965
Granted Patent B2
US 12,423,965 · App. 18/032,125 · Granted Sep 23, 2025

Image processing method, apparatus and device, and readable storage medium

Inventors: Lingyan Liang (Beijing, CN); Gang Dong (Beijing, CN); Yaqian Zhao (Beijing, CN); Qichun Cao (Beijing, CN); Wenfeng Yin (Beijing, CN)
Assignee: INSPUR (BEIJING) ELECTRONIC INFORMATION INDUSTRY CO., LTD.
G06V10/82G06N3/09G06V10/40G06V10/762G06V10/764G06V10/98
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,423,965
App. No.
18/032,125
Granted
Sep 23, 2025
Kind
B2
Abstract

An image processing method, apparatus and device, and a readable storage medium are disclosed, including: obtaining a target image; inputting the target image into a quantized target deep neural network model for classification/detection to obtain an output result; and processing the target image according to a policy corresponding to the output result. A process of performing quantization to obtain the target deep neural network model includes: obtaining a pre-trained floating point type deep neural network model; extracting weight features of a deep neural network model; determining a quantization policy using the weight features; and quantizing the deep neural network model according to the quantization policy to obtain the target deep neural network model.

Claims (88)

1. An image processing method, comprising:

obtaining a target image;

inputting the target image into a quantized target deep neural network model for at least one of classification or detection to obtain an output result; and

processing the target image according to a policy corresponding to the output result; and

performing quantization to obtain the target deep neural network model by:

obtaining a pre-trained floating point type deep neural network model;

extracting weight features of a deep neural network model;

determining a quantization policy using the weight features; and

quantizing the deep neural network model according to the quantization policy to obtain the target deep neural network model.

2. The image processing method according to claim 1 , wherein under a circumstance that the weight features are weight parameter features, extracting the weight features of the deep neural network model comprises:

calculating a per-layer quantization error and a per-channel quantization error corresponding to the deep neural network model separately; and

determining the per-layer quantization error and the per-channel quantization error as the weight parameter features.

3. The image processing method according to claim 2 , wherein determining the quantization policy using the weight features comprises:

calculating a difference value between the per-layer quantization error and the per-channel quantization error;

determining whether the difference value is within an error range;

in response to the difference value being within the error range, determining that the quantization policy is the per-layer quantization; and

in response to the difference value being not within the error range, determining that the quantization policy is the per-channel quantization, or performing quantization according to a certain quantization unit.

4. The image processing method according to claim 3 , wherein before determining that the quantization policy is the per-channel quantization, or performing quantization according to the certain quantization unit, the method further comprises:

extracting weight channel features of the deep neural network model; and

taking similar weight channels in the deep neural network model as the certain quantization unit by using the weight channel features, wherein the certain quantization unit comprises at least one weight channel.

5. The image processing method according to claim 1 , wherein under a circumstance that the weight features are weight channel features, extracting the weight features of the deep neural network model comprises:

clustering various weight channels in the deep neural network model to obtain clustering results; and

determining the clustering results as the weight channel features.

6. The image processing method according to claim 5 , wherein clustering the various weight channels in the deep neural network model to obtain the clustering results comprises:

obtaining weight value ranges of the various weight channels in the deep neural network model, and a statistical distribution chart of weight parameter values of the various weight channels; and

clustering the various weight channels based on the weight value ranges and the statistical distribution chart of the weight parameter values, to obtain the clustering results.

7. The image processing method according to claim 5 , wherein the determining a quantization policy using the weight features comprises:

in response to the number of clusters of the clustering results being 1, determining that the quantization policy is the per-layer quantization;

in response to the number of clusters being equal to a number of the weight channels, determining that the quantization policy is the per-channel quantization; and

in response to the number of clusters being greater than 1 and less than the number of the weight channels, taking all the weight channels corresponding to each cluster as an entirety for quantization.

8. An image processing device, comprising:

a memory storing a computer program; and

a processor configured to execute the computer program wherein the processor, upon execution of the computer program, is configured to:

obtain a target image;

input the target image into a quantized target deep neural network model for at least one of classification or detection to obtain an output result;

process the target image according to a policy corresponding to the output result; and

perform quantization to obtain the target deep neural network model by:

obtaining a pre-trained floating point type deep neural network model;

extracting weight features of a deep neural network model;

determining a quantization policy using the weight features; and

quantizing the deep neural network model according to the quantization policy to obtain the target deep neural network model.

9. The image processing device according to claim 8 , wherein the processor, upon execution of the computer program, is further configured to:

calculate a per-layer quantization error and a per-channel quantization error corresponding to the deep neural network model separately; and

determine the per-layer quantization error and the per-channel quantization error as the weight parameter features.

10. The image processing device according to claim 9 , wherein the processor, upon execution of the computer program, is further configured to:

calculate a difference value between the per-layer quantization error and the per-channel quantization error;

determine whether the difference value is within an error range;

in response to the difference value being within the error range, determine that the quantization policy is the per-layer quantization; and

in response to the difference value being not within the error range, determine that the quantization policy is the per-channel quantization, or perform quantization according to a certain quantization unit.

11. The image processing device according to claim 10 , wherein the processor, upon execution of the computer program, is further configured to:

extract weight channel features of the deep neural network model; and

take similar weight channels in the deep neural network model as the certain quantization unit by using the weight channel features, wherein the certain quantization unit comprises at least one weight channel.

12. The image processing device according to claim 8 , wherein the processor, upon execution of the computer program, is further configured to:

cluster various weight channels in the deep neural network model to obtain clustering results; and

determine the clustering results as the weight channel features.

13. The image processing device according to claim 12 , wherein the processor, upon execution of the computer program, is further configured to:

obtain weight value ranges of the various weight channels in the deep neural network model, and a statistical distribution chart of weight parameter values of the various weight channels; and

cluster the various weight channels based on the weight value ranges and the statistical distribution chart of the weight parameter values, to obtain the clustering results.

14. The image processing device according to claim 12 , wherein the processor, upon execution of the computer program, is further configured to:

in response to the number of clusters of the clustering results being 1, determine that the quantization policy is the per-layer quantization;

in response to the number of clusters being equal to a number of the weight channels, determine that the quantization policy is the per-channel quantization; and

in response to the number of clusters being greater than 1 and less than the number of the weight channels, take all the weight channels corresponding to each cluster as an entirety for quantization.

15. A non-transitory computer-readable storage medium storing a computer program; and the computer program, when executed by a processor, is configured to cause the processor to:

obtain a target image;

input the target image into a quantized target deep neural network model for at least one of classification or detection to obtain an output result;

process the target image according to a policy corresponding to the output result; and

perform quantization to obtain the target deep neural network model by:

obtaining a pre-trained floating point type deep neural network model;

extracting weight features of a deep neural network model;

determining a quantization policy using the weight features; and

quantizing the deep neural network model according to the quantization policy to obtain the target deep neural network model.

16. The non-transitory computer-readable storage medium according to claim 15 , wherein the computer program, upon execution by the processor, is further configured to cause the processor to:

calculate a per-layer quantization error and a per-channel quantization error corresponding to the deep neural network model separately; and

determine the per-layer quantization error and the per-channel quantization error as the weight parameter features.

17. The non-transitory computer-readable storage medium according to claim 16 , wherein the computer program, upon execution by the processor, is further configured to cause the processor to:

calculate a difference value between the per-layer quantization error and the per-channel quantization error;

determine whether the difference value is within an error range;

in response to the difference value being within the error range, determine that the quantization policy is the per-layer quantization; and

in response to the difference value being not within the error range, determine that the quantization policy is the per-channel quantization, or perform quantization according to a certain quantization unit.

18. The non-transitory computer-readable storage medium according to claim 17 , wherein the computer program, upon execution by the processor, is further configured to cause the processor to:

extract weight channel features of the deep neural network model; and

take similar weight channels in the deep neural network model as the certain quantization unit by using the weight channel features, wherein the certain quantization unit comprises at least one weight channel.

19. The non-transitory computer-readable storage medium according to claim 15 , wherein the computer program, upon execution by the processor, is further configured to cause the processor to:

cluster various weight channels in the deep neural network model to obtain clustering results; and

determine the clustering results as the weight channel features.

20. The non-transitory computer-readable storage medium according to claim 19 , wherein the computer program, upon execution by the processor, is further configured to cause the processor to:

obtain weight value ranges of the various weight channels in the deep neural network model, and a statistical distribution chart of weight parameter values of the various weight channels; and

cluster the various weight channels based on the weight value ranges and the statistical distribution chart of the weight parameter values, to obtain the clustering results.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Apr 18, 2023
From: LIANG, LINGYAN; DONG, GANG; ZHAO, YAQIAN; CAO, QICHUN; YIN, WENFENG
To: INSPUR (BEIJING) ELECTRONIC INFORMATION INDUSTRY CO., LTD.
Reel/Frame 063358/0822 →
Priority Claims (1)
CN 202011110263.X · Oct 16, 2020 · national
Continuity (1)
Related Publication 20230401834A1 · Dec 14, 2023
References Cited (10)
US 12099915B2 · Boo · 2024 [cited by examiner]
US 20200026986A1 · Ha et al. · 2020 [cited by applicant]
CN 110782021A · 2020 [cited by applicant]
CN 111144511A · 2020 [cited by applicant]
CN 111723934A · 2020 [cited by applicant]
CN 112287986A · 2021 [cited by applicant]
WO WO2020081470A1 · 2020 [cited by applicant]
Computer English Translation of Chinese Patent No. CN 112766456 A. (Year: 2021). [cited by examiner]
International Search Report and Written Opinion, including English translations, of corresponding PCT application No. PCT/CN2021/109193), Nov. 4, 2021 (15 pages). [cited by applicant]
Search report of corresponding CN priority application No. CN202011110263.X dated May 25, 2023 (2 pages). [cited by applicant]