Method and apparatus for adapting deep learning model, and electronic device

US12387136B2 · US · B2

Patent metadata
FieldValue
Publication numberUS-12387136-B2
Application numberUS-202017604670-A
CountryUS
Kind codeB2
Filing dateSep 16, 2020
Priority dateJun 29, 2020
Publication dateAug 12, 2025
Grant dateAug 12, 2025

How to read this patent

A practical reading order for non-experts. Skip the full description unless you need deep technical detail.

  1. Title

    What the patent document calls the invention.

  2. Abstract

    A short plain-language summary of the technical disclosure.

  3. Assignees and inventors

    Who owns or filed the patent and who is credited as inventor.

  4. Key dates

    Filing, priority, publication, and grant dates set the timeline.

  5. First independent claim

    The legal scope of protection — read this for what is actually claimed.

  6. CPC / IPC classifications

    Technology tags used to group this patent with similar filings.

  7. Citations and related patents

    Prior art links and similar publications in this corpus.

Abstract

Official abstract text for this publication.

The present disclosure discloses a method and an apparatus for adapting a deep learning model, an electronic device and a medium, which relates to technology fields of artificial intelligence, deep learning, and cloud computing. The specific implementation plan is: obtaining model information of an original deep learning model and hardware information of a target hardware to be adapted; querying a conversion path table according to the model information and the hardware information to obtain a matched target conversion path; and converting, according to the target conversion path, the original deep learning model to an intermediate deep learning model in the conversion path, and converting the intermediate deep learning model to the target deep learning model. Therefore, the deep learning model conversion is performed based on the model conversion path determined by the model information of the original deep learning model and the hardware information of the target hardware, which realizes converting any type of original deep learning model into the target deep learning model adapted to any target hardware, and solves the problem that the deep learning model is difficult to be applied to different hardware terminals.

First claim

Opening claim text (preview).

What is claimed is: 1. A method for adapting a deep learning model, comprising: obtaining model structure information of an original deep learning model and hardware information of a target hardware to be adapted; querying a conversion path table according to the model structure information and the hardware information to obtain a matched target conversion path; and converting, according to the target conversion path, the original deep learning model to an intermediate deep learning model in the conversion path, and converting the intermediate deep learning model to a target deep learning model; wherein there are a plurality of intermediate deep learning models, and the target conversion path is configured to indicate a conversion sequence of the plurality of intermediate deep learning models; wherein converting, according to the target conversion path, the original deep learning model to the intermediate deep learning model in the conversion path, and converting the intermediate deep learning model to the target deep learning model comprises: determining a model before conversion and a model after conversion for each model conversion and an execution sequence of respective model conversions according to the conversion sequence of the plurality of intermediate deep learning models in the target conversion path; generating a conversion task of each model conversion according to a mapping relation between the model before conversion and the model after conversion of each model conversion; and sequentially executing the conversion tasks of respective model conversions on the original deep learning model according to the execution sequence of respective model conversions, to obtain the target deep learning model; wherein the model structure information of the deep learning model comprises a fully-connected layer, a loop structure, a convolutional layer and a pooling layer; wherein the hardware information is an artificial intelligence, AI, inference accelerator chip information. 2. The method of claim 1 , wherein generating the conversion task of each model conversion according to the mapping relation between the model before conversion and the model after conversion of each model conversion comprises: querying at least one of an operator mapping relation, a tensor mapping relation, and a model parameter mapping relation for the model before conversion and the model after conversion of each model conversion; and generating the conversion task for each model conversion according to at least one of the operator mapping relation, the tensor mapping relation, and the model parameter mapping relation. 3. The method of claim 1 , wherein there are at least two target hardware, and querying the conversion path table according to the model structure information and the hardware information to obtain the matched target conversion path comprises: combining the hardware information of each target hardware with the model structure information to obtain at least two pieces of combined information; querying the conversion path table according to at least two pieces of combined information to obtain at least two candidate conversion paths, wherein each candidate conversion path matches one piece of combined information; and generating the target conversion path according to the at least two candidate conversion paths. 4. The method of claim 3 , wherein generating the target conversion path according to the at least two candidate conversion paths comprises: determining overlapping parts of the at least two candidate conversion paths; and merging the overlapping parts of the at least two candidate conversion paths to obtain the target conversion path. 5. The method of claim 1 , wherein the model structure information comprises model structure information and training framework information. 6. An electronic device, comprising: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory is configured to store instructions executable by the at least one processor; when the instructions are executed by the at least one processor, the at least one processor is configured to: obtain model structure information of an original deep learning model and hardware information of a target hardware to be adapted; query a conversion path table according to the model structure information and the hardware information to obtain a matched target conversion path; and convert, according to the target conversion path, the original deep learning model to an intermediate deep learning model in the conversion path, and convert the intermediate deep learning model to a target deep learning model; wherein there are a plurality of intermediate deep learning models, and the target conversion path is configured to indicate a conversion sequence of the plurality of intermediate deep learning models; wherein the at least one processor is configured to: determine a model before conversion and a model after conversion for each model conversion and an execution sequence of respective model conversions according to the conversion sequence of the plurality of intermediate deep learning models in the target conversion path; generate a conversion task of each model conversion according to a mapping relation between the model before conversion and the model after conversion of each model conversion; and sequentially execute the conversion tasks of respective model conversions on the original deep learning model according to the execution sequence of respective model conversions, to obtain the target deep learning model; wherein the model structure information of the deep learning model comprises a fully-connected layer, a loop structure, a convolutional layer and a pooling layer; wherein the hardware information is an artificial intelligence, AI, inference accelerator chip information. 7. The electronic device of claim 6 , wherein the at least one processor is configured to: query at least one of an operator mapping relation, a tensor mapping relation, and a model parameter mapping relation for the model before conversion and the model after conversion of each model conversion; and generate the conversion task for each model conversion according to at least one of the operator mapping relation, the tensor mapping relation, and the model parameter mapping relation. 8. The electronic device of claim 6 , wherein there are at least two target hardware, and the at least one processor is configured to: combine the hardware information of each target hardware with the model structure information to obtain at least two pieces of combined information; query the conversion path table according to at least two pieces of combined information to obtain at least two candidate conversion paths, wherein each candidate conversion path matches one piece of combined information; and generate the target conversion path according to the at least two candidate conversion paths. 9. The electronic device of claim 8 , wherein the at least one processor is configured to: determine overlapping parts of the at least two candidate conversion paths; and merge the overlapping parts of the at least two candidate conversion paths to obtain the target conversion path. 10. The electronic device of claim 6 , wherein the model structure information comprises model structure information and training framework information. 11. A non-transitory computer-readable storage medium having computer instructions stored thereon, wherein the computer instructions are configured to enable a computer to implement a method for adapting a deep learning model, the method comprising: obtaining model structure in

Assignees

Inventors

Classifications

  • Convolutional networks [CNN, ConvNet] · CPC title

  • Data format conversion from or to a database · CPC title

  • Query formulation · CPC title

  • G06N3/082Primary

    modifying the architecture, e.g. adding, deleting or silencing nodes or connections · CPC title

  • using electronic means · CPC title

Patent family

Related publications grouped by family.

External sources

Frequently asked questions

Answers are generated from the same data shown on this page.

What does patent US12387136B2 cover?
The present disclosure discloses a method and an apparatus for adapting a deep learning model, an electronic device and a medium, which relates to technology fields of artificial intelligence, deep learning, and cloud computing. The specific implementation plan is: obtaining model information of an original deep learning model and hardware information of a target hardware to be adapted; queryin…
Who is the assignee on this patent?
Beijing Baidu Netcom Sci & Tech Co Ltd
What technology area does this patent fall under?
Primary CPC classification G06N3/082. Mapped technology areas include Physics.
When was this patent published?
Publication date Tue Aug 12 2025 00:00:00 GMT+0000 (Coordinated Universal Time) (B2). Legal status and post-grant events are not shown on this page.
What related patents are in patentsdb?
We list 4 related publications on this page (citations in our corpus or others sharing the same primary CPC).