WO2023216642A1 - 多分支网络的分发推理方法和装置 - Google Patents

多分支网络的分发推理方法和装置 Download PDF

Info

Publication number
WO2023216642A1
WO2023216642A1 PCT/CN2023/070521 CN2023070521W WO2023216642A1 WO 2023216642 A1 WO2023216642 A1 WO 2023216642A1 CN 2023070521 W CN2023070521 W CN 2023070521W WO 2023216642 A1 WO2023216642 A1 WO 2023216642A1
Authority
WO
WIPO (PCT)
Prior art keywords
branch
picture
network
uncertainty
output
Prior art date
Application number
PCT/CN2023/070521
Other languages
English (en)
French (fr)
Inventor
周悦芝
梁志伟
Original Assignee
清华大学
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Priority claimed from CN202210507991.7A external-priority patent/CN114972850B/zh
Application filed by 清华大学 filed Critical 清华大学
Publication of WO2023216642A1 publication Critical patent/WO2023216642A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/764Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
    • G06V10/765Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects using rules for classification or partitioning the feature space
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2415Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on parametric or probabilistic models, e.g. based on likelihood ratio or false acceptance rate versus a false rejection rate
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/774Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/82Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks
    • 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
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • the present disclosure belongs to the field of computer vision and deep learning, and specifically relates to a multi-branch network distribution inference method, device, electronic equipment and storage medium.
  • Simple samples can be accurately classified with less calculation, while difficult samples require more calculation. Simple samples can achieve higher accuracy on all branches, while difficult samples generally achieve higher accuracy on deep branches than on shallow branches. By adjusting the proportion of sample outputs from different branches, solutions with different accuracy and inference time can be obtained.
  • Branchynet and its variants were proposed, academic circles have used it in combination with other technologies to solve model deployment optimization problems in edge computing.
  • multi-branch networks are rarely used in industry because their design and training are complex, which limits their applications.
  • This method can be mixed with model acceleration methods such as compression and quantization to provide a better solution.
  • the traditional implementation method of multi-branch networks is to first study the location of branch insertion and the design of the branch structure, and then jointly train all branches and the original model (Origin Model).
  • the complexity of this implementation method limits the development of multi-branch networks to a certain extent.
  • the joint training method requires the network structure to be determined before training, and the network structure cannot be changed during runtime. If a new branch needs to be inserted, the network needs to be retrained.
  • the traditional cascade reasoning mode of multi-branch networks involves a lot of trial and error processes.
  • the present disclosure proposes a distribution inference method, device, electronic device and storage medium for a multi-branch network.
  • the first embodiment of the present disclosure proposes a distribution inference method for a multi-branch network, including:
  • the pre-processed picture is input into the first branch of the preset multi-branch network, and the first branch outputs the initial prediction result corresponding to the picture; using the initial prediction result, calculate the different prediction results of the picture. certainty;
  • the corresponding output branch of the picture in the distribution scheme is determined according to the uncertainty level corresponding to the picture, so as to obtain the final prediction result of the picture.
  • the preset distribution scheme of the multi-branch network is used to determine the output branch corresponding to the picture in the distribution scheme according to the uncertainty level corresponding to the picture, so as to obtain the
  • the final prediction results of the picture include:
  • the initial prediction result is the final prediction result of the picture; otherwise, the output result of the output branch corresponding to the picture is used as the final prediction result of the picture. final prediction result.
  • calculating the uncertainty of the picture using the initial prediction result includes:
  • the initial prediction result includes the probability of each category output by the picture through the first branch. Subtracting the second maximum value of the probability from the maximum value of the probability is the uncertainty of the picture. .
  • the method before inputting the preprocessed image into the first branch of the preset multi-branch network, the method further includes:
  • the training of multi-branch networks includes:
  • Each branch of the multi-branch network is trained separately using the pre-processed training set to obtain the trained multi-branch network; wherein, when training each branch, the branch and the branch The previous pre-trained network part forms a new network for training, and the weight of the pre-trained network part before the branch remains unchanged during training.
  • the method for determining the uncertainty level classification result includes:
  • the method for determining the distribution plan of the multi-branch network includes:
  • the acceleration ratio is the increase in prediction accuracy brought by using the current candidate branch compared to the current output branch.
  • the prediction accuracy is the average prediction accuracy of all pictures corresponding to any uncertainty level in the evaluation set output by any branch
  • the inference time is the average prediction accuracy of any uncertainty level in the evaluation set.
  • the second embodiment of the present disclosure proposes a distribution inference device for a multi-branch network, including:
  • Image acquisition module used to acquire images to be inferred and perform preprocessing
  • the initial prediction module is used to input the pre-processed picture into the first branch of the preset multi-branch network, and the first branch outputs the initial prediction result corresponding to the picture; using the initial prediction result, Calculate the uncertainty of said image;
  • An uncertainty classification module configured to divide the results according to the preset uncertainty levels according to the uncertainty, and determine the uncertainty level corresponding to the picture;
  • the final prediction module is configured to use the preset distribution scheme of the multi-branch network to determine the output branch corresponding to the picture in the distribution scheme according to the uncertainty level corresponding to the picture, so as to obtain the final prediction of the picture. prediction results.
  • a third embodiment of the present disclosure provides an electronic device, including:
  • At least one processor and, a memory communicatively connected to the at least one processor;
  • the memory stores instructions executable by the at least one processor, and the instructions are configured to execute the distribution inference method of a multi-branch network according to the embodiment of the first aspect of the present disclosure.
  • a fourth embodiment of the present disclosure provides a computer-readable storage medium that stores computer instructions, and the computer instructions are used to cause the computer to execute the multi-branch network of the first embodiment of the present disclosure. Distribution reasoning method.
  • the fifth embodiment of the present disclosure provides a computer program product, which includes a computer program or instructions.
  • the computer program or instructions are executed by a processor, the distribution inference method of a multi-branch network of the first embodiment of the present disclosure is implemented.
  • Figure 1 is an overall flow chart of a distribution inference method for a multi-branch network according to an embodiment of the present disclosure.
  • Figure 2 is a schematic structural diagram of a multi-branch network according to an embodiment of the present disclosure.
  • Figure 3 is a schematic structural diagram of the first branch b1 of the multi-branch network according to the embodiment of the present disclosure.
  • Figure 4 is a schematic diagram of separate training of a multi-branch network according to an embodiment of the present disclosure.
  • Figure 5 is a schematic diagram of a multi-branch network distribution inference mode according to an embodiment of the present disclosure.
  • Embodiments of the present disclosure provide a distribution inference method, device, electronic device, and storage medium for a multi-branch network.
  • the present disclosure will be further described in detail below with reference to the accompanying drawings and specific embodiments.
  • the first embodiment of the present disclosure proposes a distribution inference method for a multi-branch network, including:
  • the pre-processed picture is input into the first branch of the preset multi-branch network, and the first branch outputs the initial prediction result corresponding to the picture; using the initial prediction result, calculate the different prediction results of the picture. certainty;
  • the corresponding output branch of the picture in the distribution scheme is determined according to the uncertainty level corresponding to the picture, so as to obtain the final prediction result of the picture.
  • the overall flow chart of the method is shown in Figure 1, which includes: a training phase, a calibration phase and an inference phase, specifically including 1) training phase, 2) calibration phase and 3) inference phase.
  • multi-branch networks can be used in computer vision tasks such as image classification and target detection
  • data sets need to be prepared according to the target tasks.
  • the main content of the data set is generally pictures or videos and their corresponding annotation information.
  • the size of the pictures will vary depending on the task objectives.
  • the data set is divided into a training set and an evaluation set according to the set ratio.
  • a multi-branch network is trained for image classification.
  • the data set uses the cifar10 data set, which contains 50,000 32*32 pictures and classification information corresponding to each picture. 40,000 pictures are randomly selected as the training set, and the remaining 10,000 pictures are as an evaluation set.
  • all images in the training set and evaluation set and corresponding annotation results are processed into types acceptable to the target task model.
  • the images are randomly rotated and then standardized.
  • the image does not need to be enhanced such as cropping.
  • the formula for normalization processing is as follows:
  • preprocessing also includes processing the annotation corresponding to the image from a single category to a probability of the category.
  • the probability value of the image corresponding to that category is 1, and the probability value corresponding to the other categories are all 0; for example, for any picture with a category label of 5, its processed category probability value is [0,0,0,0,1,0,0,0,0,0] to match the model output ( Output).
  • the pre-trained network is a trained DNN model for computer vision tasks.
  • the pre-trained network can be obtained using traditional training methods by using the training set, or you can directly use the existing pre-trained network to save preparation time.
  • the training set of step 1) is used to train a VGG19 network for image classification as a pre-trained network.
  • a new branch is inserted after each max_pooling layer to form a multi-branch network.
  • the structure diagram of the multi-branch network is shown in Figure 2, with a total of 4 branches, where the nodes (v 1 , v 2 , v 3 , v 4 , v 5 ) respectively represent the convolution blocks block1, block2, block3, block4 and block5 in the pre-training network. These structures are connected in series to form VGG19.
  • the nodes (b 1 , b 2 , b 3 , b 4 ) respectively represent the inserted branches, the solid arrows represent the flow process of intermediate data, and the dotted arrows represent the flow direction of the prediction results.
  • Each branch can use statistical machine learning methods such as SVM (soft support vector machine), or deep learning models such as CNN (convolutional neural network) or VIT (Vision-Transformer). In this embodiment, a CNN network with relatively balanced accuracy and speed is selected as a branch.
  • Each branch has the same structure. Taking the first branch b 1 as an example, the structure is shown in Figure 3, and layer inference is performed from top to bottom.
  • each layer On the left is the name of each layer, including conv (convolutional layer), bn (batch normalization layer), relu (activation layer), max_pooling (maximum pooling layer) and linear (fully connected layer), and on the right is the layer Corresponding to changes in data dimensions, * represents batchsize.
  • the flatten operation converts high-dimensional data into one-dimensional data. You can see the changes in the data dimensions on the right. It includes a convolution module (Conv Block) to perform feature extraction and data dimensionality reduction on the input data, and a classifier (Classifier) composed of two fully connected layers to complete the final image classification task.
  • Conv Block convolution module
  • Classifier classifier
  • the pre-trained network needs to be solidified to extract features.
  • Each branch is trained based on the output of its corresponding pre-trained network part.
  • the pre-trained network part corresponding to branch b 1 is the pre-trained network before node v 1.
  • training branch b 1 it is necessary to fix the pre-trained network before node v 1 , and use the pre-trained network to The output of 1 is input as branch b 1 .
  • Figure 4 shows the composition of the corresponding new network during four branch training, in which the first branch network is composed of block1 and branch b1 in the pre-trained network, and the second branch network is composed of block 1 and branch b1 in the pre-trained network. It consists of block1, block2 and branch b2.
  • the third branch network consists of block1, block2, block3 and branch b3 in the pre-trained network.
  • the fourth branch network consists of block1, block2, block3, block4 and branch b4 in the pre-trained network. composition. It should be noted that the corresponding part of the pre-trained network is fixed, which means that the weight of this part is not updated during branch training.
  • the new network composed of each branch is trained separately using the training set.
  • the branch is trained. After all branches are trained, the trained multi-branch network is obtained.
  • the uncertainty is the difficulty of sample prediction. Divide different uncertainty levels according to the uncertainty distribution and determine the accuracy performance of each uncertainty level on different branches, thereby determining the distribution scheme of the multi-branch network for different uncertainty levels. Specific steps include steps 2-1) to 2-3).
  • the initial prediction results obtained by passing the evaluation set through the first branch of the multi-branch network (that is, the branch closest to the input of the multi-branch network, branch b 1 in this embodiment) are used to calculate the initial uncertainty of all samples in the evaluation set. distributed.
  • temperature Scaling temperature scaling
  • T is a hyperparameter, which can be determined through a heuristic method to make the uncertainty distribution close to a uniform distribution.
  • T 1.5.
  • the evaluation set samples are evenly divided into M parts according to the uncertainty of each sample in the evaluation set to determine M levels of uncertainty, where M is an adjustable parameter , the larger M is, the more fine-grained the uncertainty division is, but the calculation will be more complex and the requirements for the number of evaluation set samples will be higher.
  • M 10
  • the classification boundaries of different levels are [0.000, 0.058, 0.130, 0.223, 0.343, 0.480, 0.625, 0.777, 0.894, 0.966, 1].
  • Samples with uncertainty close to 0 are difficult samples, and samples with uncertainty close to 1 are simple samples.
  • the evaluation set is divided into 10 sample sets according to the classification boundary, and the accuracy of each branch and the inference delay of each branch of the sample sets with different uncertainty levels are tested, where the accuracy is the output of each sample set by each branch.
  • the average prediction accuracy and inference latency are the average execution times for each sample set to be output by each branch.
  • the DSGA algorithm distributed plan generation algorithm
  • the distribution scheme determines the output branch corresponding to each uncertainty level.
  • the output branch may be the first branch, that is, the remaining branches are no longer used. In some embodiments, if the output branch is the first branch, Then the prediction result of branch b 1 is directly selected as the final classification result of the input sample. Specific steps include steps 2-3-1) to 2-3-3).
  • the initial distribution plan is [1,1,1,1,1,1,1,1,1 ], that is, the evaluation set samples divided into 10 uncertainty levels all choose branch b 1 to output the corresponding image classification results.
  • the current candidate branch corresponding to each uncertainty level be the next branch of the current output branch.
  • the initial candidate branch for each uncertainty level is branch b 2
  • the initial candidate branch set is [2 ,2,2,2,2,2,2,2,2].
  • the speedup ratio is the accuracy increase brought by using the current candidate branch compared with the current output branch and the accuracy brought by using the current candidate branch compared with the current output branch.
  • the ratio of the increase in inference time, the expression is:
  • ⁇ acc NewBranch acc - OldBranch acc represents the increase in prediction accuracy caused by the current candidate branch replacing the current output branch; NewBranch acc is the prediction accuracy corresponding to the current candidate branch, and OldBranch acc is the prediction accuracy corresponding to the current output branch;
  • NewBranch time -OldBranch time represents the increase in inference time caused by replacing the current output branch with the current candidate branch; NewBranch time is the inference time corresponding to the current candidate branch, and OldBranch time is the inference time corresponding to the current output branch;
  • the candidate branch with the largest speedup corresponds to the first uncertainty level
  • the current distribution plan is updated to [2,1,1,1,1,1,1,1 ,1]
  • the candidate branch set is updated to [3,2,2,2,2,2,2,2].
  • the speedup ratio of the candidate branch corresponding to the first uncertainty level is updated as the ratio of the accuracy improvement and inference delay increase brought by the first uncertainty level sample in branch 3 compared to branch 2.
  • the core concept of the DSGA algorithm proposed in this embodiment is to greedily select the candidate branch with the largest acceleration ratio every time the current distribution plan is updated, until all current candidate branches in the candidate branch set will not bring accuracy improvement. Or the current distribution scheme already meets the target accuracy.
  • the final distribution scheme corresponding to no accuracy loss relative to the pre-trained network is [5, 5, 5, 5, 4, 4, 3, 3, 1, 1]. This means that the uncertainty between [0.000, 0.058] is the most difficult level, and the fifth branch will be selected as the output branch. About 40% of the samples are output from branch 5, 20% of the samples are output from branch 4, 20% of the samples are output from branch 3, and 20% of the samples are output from branch 1.
  • the image to be inferred is processed according to step 2) by preprocessing the training set to obtain the input image x.
  • the expression is as follows:
  • v1(x) represents the output of x at node v1
  • b1(z) represents the output of x at the first branch.
  • the uncertainty of determining x At which level it is located among the M uncertainty levels is then determined according to the distribution plan.
  • the uncertainty is calculated to be 0.813, which is between [0.777, 0.894].
  • the output branch is determined to be the third branch, then the third branch multiplexes the output z of x at node v1, and then Get the updated prediction result of x from the output of the third branch (It should be noted that in this case, the initial prediction of x obtained in the first branch is directly discarded).
  • the prediction information of the basic part of step 2-2) is taken as the final prediction result of the input picture. That is, if the calculated uncertainty is 0.991, the output branch determined by the distribution plan is the first branch, so there is no need to continue reasoning.
  • the prediction information of the third branch is selected as the final prediction result.
  • the second embodiment of the present disclosure proposes a distribution inference device for a multi-branch network, including a picture acquisition module, an initial prediction module, an uncertainty classification module and a final prediction module.
  • the picture acquisition module is used to obtain the images to be inferred and preprocess them.
  • the initial prediction module is used to input the pre-processed picture into the first branch of the preset multi-branch network, and the first branch outputs the initial prediction result corresponding to the picture; using the initial prediction result, Calculate the uncertainty of the picture.
  • the uncertainty classification module is configured to divide the results according to the preset uncertainty levels according to the uncertainty, and determine the uncertainty level corresponding to the picture.
  • the final prediction module is configured to use the preset distribution scheme of the multi-branch network to determine the output branch corresponding to the picture in the distribution scheme according to the uncertainty level corresponding to the picture, so as to obtain the final prediction of the picture. prediction results.
  • the final prediction module is used to:
  • the initial prediction result is the final prediction result of the picture; otherwise, the output result of the output branch corresponding to the picture is used as the final prediction result of the picture. final prediction result.
  • the initial prediction module is used to:
  • the initial prediction result includes the probability of each category output by the picture through the first branch. Subtracting the second maximum value of the probability from the maximum value of the probability is the uncertainty of the picture. .
  • the initial prediction module is also used to:
  • the training of multi-branch networks includes:
  • Each branch of the multi-branch network is trained separately using the pre-processed training set to obtain the trained multi-branch network; wherein, when training each branch, the branch and the branch The previous pre-trained network part forms a new network for training, and the weight of the pre-trained network part before the branch remains unchanged during training.
  • the initial prediction module is used to:
  • the initial prediction module is used to:
  • the acceleration ratio is the increase in prediction accuracy brought by using the current candidate branch compared to the current output branch.
  • the prediction accuracy is the average prediction accuracy of all pictures corresponding to any uncertainty level in the evaluation set output by any branch
  • the inference time is the average prediction accuracy of any uncertainty level in the evaluation set.
  • a third embodiment of the present disclosure provides an electronic device, including at least one processor; and a memory communicatively connected to the at least one processor;
  • the memory stores instructions executable by the at least one processor, and the instructions are configured to execute the distribution inference method of a multi-branch network according to the embodiment of the first aspect of the present disclosure.
  • the fourth aspect of the present disclosure provides a computer-readable storage medium.
  • the computer-readable storage medium stores computer instructions.
  • the computer instructions are used to cause the computer to execute the first aspect of the present disclosure.
  • the fifth aspect of the present disclosure provides a computer program product, which includes a computer program or instructions.
  • the computer program or instructions are executed by a processor, the multi-branch implementation of the first aspect of the present disclosure is implemented.
  • Distributive reasoning methods for networks are implemented.
  • This disclosure provides a separate multi-branch network design and training solution based on the transfer learning method, which eliminates the mutual influence between branches and reduces the difficulty of model deployment.
  • Multi-branch networks are rarely used in the industry because their design and training are complex, which limits their applications.
  • the separated training method can directly use pre-trained networks, reducing the preparation time of multi-branch networks.
  • this disclosure proposes a distribution inference model for multi-branch networks.
  • This disclosure proposes the concept that sample uncertainty is consistent for all branches, and provides a distribution plan generation algorithm that can adjust the proportion of samples output in different branches, and improve the accuracy of multi-branch networks as much as possible under specific inference delay requirements.
  • the multi-branch network proposed in this disclosure can be mixed with model acceleration methods such as compression and quantization to provide a better solution.
  • model acceleration methods such as compression and quantization
  • sample distribution inference method of the present disclosure is suitable for combined inference between multiple models.
  • the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the above two.
  • the computer-readable storage medium may be, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or any combination thereof. More specific examples of computer readable storage media may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard drive, random access memory (RAM), read only memory (ROM), removable Programmd read-only memory (EPROM or flash memory), fiber optics, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
  • a computer-readable storage medium may be any tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device.
  • a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code therein. Such propagated data signals may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above.
  • a computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device .
  • Program code embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to: wire, optical cable, RF (radio frequency), etc., or any suitable combination of the above.
  • the above-mentioned computer-readable medium may be included in the above-mentioned electronic device; it may also exist independently without being assembled into the electronic device.
  • the computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, a distribution reasoning method for a multi-branch network is provided.
  • Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional Procedural programming language—such as "C" or a similar programming language.
  • the program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server.
  • the remote computer can be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (such as an Internet service provider through Internet connection).
  • LAN local area network
  • WAN wide area network
  • Internet service provider such as an Internet service provider through Internet connection
  • references to the terms “one embodiment,” “some embodiments,” “an example,” “specific examples,” or “some examples” or the like means that specific features are described in connection with the embodiment or example. , structures, materials or features are included in at least one embodiment or example of the present application. In this specification, the schematic expressions of the above terms are not necessarily directed to the same embodiment or example. Furthermore, the specific features, structures, materials or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, those skilled in the art may combine and combine different embodiments or examples and features of different embodiments or examples described in this specification unless they are inconsistent with each other.
  • first and second are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the quantity of indicated technical features. Therefore, features defined as “first” and “second” may explicitly or implicitly include at least one of these features.
  • “plurality” means at least two, such as two, three, etc., unless otherwise expressly and specifically limited.
  • a "computer-readable medium” may be any device that can contain, store, communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
  • Non-exhaustive list of computer readable media include the following: electrical connections with one or more wires (electronic device), portable computer disk cartridges (magnetic device), random access memory (RAM), Read-only memory (ROM), erasable and programmable read-only memory (EPROM or flash memory), fiber optic devices, and portable compact disc read-only memory (CDROM).
  • the computer-readable medium may even be paper or other suitable medium on which the program may be printed, as the program may be printed, for example, by optical scanning of the paper or other medium, followed by editing, interpretation, or in other suitable manner if necessary Processing to obtain a program electronically and then store it in computer memory.
  • various parts of the present application can be implemented in hardware, software, firmware, or a combination thereof.
  • various steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system.
  • a logic gate circuit with a logic gate circuit for implementing a logic function on a data signal.
  • Discrete logic circuits application specific integrated circuits with suitable combinational logic gates, programmable gate arrays (PGA), field programmable gate arrays (FPGA), etc.
  • each functional unit in various embodiments of the present application can be integrated into a processing module, or each unit can exist physically alone, or two or more units can be integrated into one module.
  • the above integrated modules can be implemented in the form of hardware or software function modules. Integrated modules can also be stored in a computer-readable storage medium if they are implemented in the form of software function modules and sold or used as independent products.
  • the storage media mentioned above can be read-only memory, magnetic disks or optical disks, etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Evolutionary Computation (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Multimedia (AREA)
  • Medical Informatics (AREA)
  • Health & Medical Sciences (AREA)
  • Software Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Databases & Information Systems (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Probability & Statistics with Applications (AREA)
  • Evolutionary Biology (AREA)
  • General Engineering & Computer Science (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Image Analysis (AREA)

Abstract

本公开提出一种多分支网络的分发推理方法、装置、电子设备及存储介质,属于计算机视觉及深度学习领域。其中,所述方法包括:获取待推理图片并进行预处理;将预处理完毕的所述图片输入预设的多分支网络的第一个分支,得到所述图片的初始预测结果;利用初始预测结果,计算所述图片的不确信度;按照预设的不确信度级别划分结果,确定所述图片对应的不确信度级别;利用预设的所述多分支网络的分发方案,根据不确信度级别确定所述图片在所述分发方案中对应的输出分支,以得到所述图片最终的预测结果。

Description

多分支网络的分发推理方法和装置
相关申请的交叉引用
本申请基于申请号为202210507991.7、申请日为2022年5月11日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本申请作为参考。
技术领域
本公开属于计算机视觉及深度学习领域,具体涉及一种多分支网络的分发推理方法、装置、电子设备及存储介质。
背景技术
作为最受欢迎的技术,深度学习在计算机视觉任务中取得了超过传统方法的效果。随着模型的深度和宽度不断的增加,机器学习模型的复杂程度和所需要的计算量也在逐步增长。在模型实际落地的过程中,会遇到推理延时和能量消耗的重大限制。而且随着移动互联网的发展,在物联网设备上实现图像分类算法成为了迫切的需求。但是物联网设备的处理能力是有限的,机器学习模型在设备执行的延迟是难以忍受的。所以如何优化物联网设备中图像分类算法的使用体验是个亟待解决的问题。
从近些年图像分类算法的更新历史来看,模型计算量的增加和模型的精度提升是非线性的,增加几倍的计算量只会带来少量的精度提升。模型中存在大量的冗余计算,模型剪枝,模型量化,知识蒸馏等工作可以在牺牲一点精度的情况下减少DNN(深度神经网络)模型的计算量,大幅地提高模型的推理速度。一些工作设计了一些轻量型模型部署到物联网设备上,但是牺牲了大量的精度。另一方面,从数据角度出发,Branchynet等多分支网络让简单样本可以提前从模型中输出来提高推理速度。这意味着不同样本的分析难度对于模型来说是不同的,简单样本在较少的计算量下就可以准确分类,而困难样本则需要更多的计算量。简单样本在所有分支上都可以得到较高的精度,困难样本一般在深层分支得到的精度比浅层分支得到的高。通过调整不同分支样本输出的比例,可以得到精度和推理时间不同的方案。
Branchynet及其变种被提出以来,学术界使用其结合其他技术用来解决边缘计算中的模型部署优化问题。但是多分支网络在工业界使用较少,因为其设计和训练比较复杂,限制了它的应用。但是该方法可以和压缩量化等模型加速方法混合使用,可以提供更好的方案。多分支网络的传统实现方式是先研究分支插入的位置和分支结构的设计,然后再对所有分支以及原模型(Origin Model)进行联合训练。这种实现方法的复杂在一定程度上限制了多分支网络的发展。联合训练的方式需要在训练前就确定好网络结构,在运行时无法对网络结构进行改变。如果需要新插入一个分支,就需要重新对网络进行训练一遍。另一方面,多分支网络传统的级联推理模式存在较多的试错过程。
发明内容
本公开提出了一种多分支网络的分发推理方法、装置、电子设备及存储介质。
本公开第一方面实施例提出了一种多分支网络的分发推理方法,包括:
获取待推理图片并进行预处理;
将预处理完毕的所述图片输入预设的多分支网络的第一个分支,所述第一个分支输出所述图片对应的初始预测结果;利用所述初始预测结果,计算所述图片的不确信度;
根据所述不确信度,按照预设的不确信度级别划分结果,确定所述图片对应的不确信度级别;
利用预设的所述多分支网络的分发方案,根据所述图片对应的不确信度级别确定所述图片在所述分发方案中对应的输出分支,以得到所述图片最终的预测结果。
在一些实施例中,所述利用预设的所述多分支网络的分发方案,根据所述图片对应的不确信度级别确定所述图片在所述分发方案中对应的输出分支,以得到所述图片最终的预测结果,包括:
若所述输出分支为所述多分支网络的第一个分支,则所述初始预测结果即为所述图片的最终预测结果;否则,将所述图片对应输出分支的输出结果作为所述图片的最终预测结果。
在一些实施例中,所述利用所述初始预测结果,计算所述图片的不确信度,包括:
所述初始预测结果包括所述图片经由所述第一个分支输出的对应各分类的概率,将所述概率的最大值减去所述概率的第二最大值即为所述图片的不确信度。
在一些实施例中,在所述将预处理完毕的所述图片输入预设的多分支网络的第一个分支之前,还包括:
训练所述多分支网络;
所述训练多分支网络,包括:
根据所述多分支网络的任务获取数据集,所述数据集包括多张图片及所述图片的标注信息;将所述数据集划分为训练集和评估集;
对所述数据集进行预处理;
获取用于所述任务的预训练网络作为所述多分支网络的主干,在所述预训练网络设定位置处加入分支,以构建所述多分支网络;
利用预处理完毕的所述训练集对所述多分支网络的每个分支分别训练,得到训练完毕的所述多分支网络;其中,所述每个分支训练时,将所述分支及所述分支之前的所述预训练网络部分构成一个新的网络进行训练,所述分支之前的所述预训练网络部分在训练时权重保持不变。
在一些实施例中,所述不确信度级别划分结果的确定方法包括:
将预处理完毕的所述评估集的各图片输入所述训练完毕的多分支网络的第一个分支,得到所述评估集各图片的初始预测结果;
根据所述初始预测结果,计算所述评估集各图片的不确信度;
根据所述评估集各图片的不确信度,将所述评估集所有图片平均划分为M组,以得到所述不确信度级别划分结果,其中M为预设的不确信度级别总数。
在一些实施例中,所述多分支网络的分发方案确定方法包括:
1)确定初始分发方案,所述初始方案中所述评估集中每个不确信度级别的图片对应的当前输出分支均为所述多分支网络的第一个分支;
2)令每个不确信度级别对应的当前候选分支为当前输出分支的下一个分支;
3)利用所述评估集,对每个不确信度级别,计算当前候选分支对应的加速比,所述加速比为采用所述当前候选分支相比所述当前输出分支带来的预测精度增加量与采用所述当前候选分支相比所述当前输出分支带来的推理时间增加量之比;
4)在所有当前候选分支中选择加速比最大值对应的不确信度级别,将所述不确信度级别的当前候选分支作为所述不确信度级别新的当前输出分支,得到更新后的当前分发方案;更新所述不确信度级别的当前候选分支,得到更新后的候选分支集合;
5)重复步骤3)至4),直至所述候选分支集合中所有当前候选分支不再提升所述预测精度或者所述当前分发方案达到设定的所述预测精度,则将所述当前分发方案作为所述多分支网络的最终分发方案。
在一些实施例中,所述预测精度为所述评估集中任一不确信度级别对应的所有图片由任一分支进行输出的平均预测准确率,所述推理时间为所述评估集中任一不确信度级别对应的所有图片由任一分支进行输出的平均执行时间。
本公开第二方面实施例提出了一种多分支网络的分发推理装置,包括:
图片获取模块,用于获取待推理图片并进行预处理;
初始预测模块,用于将预处理完毕的所述图片输入预设的多分支网络的第一个分支,所述第一个分支输出所述图片对应的初始预测结果;利用所述初始预测结果,计算所述图片的不确信度;
不确信度划分模块,用于根据所述不确信度,按照预设的不确信度级别划分结果,确定所述图片对应的不确信度级别;
最终预测模块,用于利用预设的所述多分支网络的分发方案,根据所述图片对应的不确信度级别确定所述图片在所述分发方案中对应的输出分支,以得到所述图片最终的预测结果。
本公开第三方面实施例提出了一种电子设备,包括:
至少一个处理器;以及,与所述至少一个处理器通信连接的存储器;
其中,所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被设置为用于执行本公开第一方面实施例的多分支网络的分发推理方法。
本公开第四方面实施例提出了一种计算机可读存储介质,所述计算机可读存储介质存储计算机指令,所述计算机指令用于使所述计算机执行本公开第一方面实施例的多分支网络的分发推理方法。
本公开第五方面实施例提出了一种计算机程序产品,包括计算机程序或指令,所述计算机程序或指令被处理器执行时,实现本公开第一方面实施例的多分支网络的分发推理方法。
附图说明
图1是本公开实施例的多分支网络的分发推理方法的整体流程图。
图2是本公开实施例的多分支网络的结构示意图。
图3是本公开实施例的多分支网络第一个分支b1的结构示意图。
图4是本公开实施例的多分支网络分离式训练的示意图。
图5是本公开实施例的多分支网络分发推理模式的示意图。
具体实施方式
本公开实施例提出了一种多分支网络的分发推理方法、装置、电子设备及存储介质。为了使得本方明的技术方案更加清晰,下面结合附图及具体实施例对本公开作进一步详细说明。
本公开第一方面实施例提出了一种多分支网络的分发推理方法,包括:
获取待推理图片并进行预处理;
将预处理完毕的所述图片输入预设的多分支网络的第一个分支,所述第一个分支输出所述图片对应的初始预测结果;利用所述初始预测结果,计算所述图片的不确信度;
根据所述不确信度,按照预设的不确信度级别划分结果,确定所述图片对应的不确信度级别;
利用预设的所述多分支网络的分发方案,根据所述图片对应的不确信度级别确定所述图片在所述分发方案中对应的输出分支,以得到所述图片最终的预测结果。
在一些实施例中,该方法整体流程图如图1所示,包括:训练阶段、校准阶段和推理阶段,具体包括1)训练阶段、2)校准阶段和3)推理阶段。
1)训练阶段。
1-1)准备数据集,所述数据集包括训练集和评估集。
因为多分支网络可以用在图像分类、目标检测等计算机视觉任务上,所以需要根据目标任务准备数据集。数据集的主要内容一般是图片或视频和其对应的标注信息,图片大小根据任务目标也会不同。将所述数据集按照设定的比例划分为训练集和评估集。
在一些实施例中,训练一个多分支网络以用于图像分类。在该实施例中,所述数据集采用cifar10数据集,该数据集包含50000张32*32的图片和每张图片对应的分类信息,随机选取其中的40000张图片作为训练集,剩余10000张图片作为评估集。
1-2)数据集预处理。
本实施例中,将训练集和评估集的所有图片以及对应的标注结果处理成目标任务模型可接受的类型。在一些实施例中,以cifar10数据集为例,对图片进行随机旋转,然后进行标准化处理。本实施例中图片不需要进行裁剪等增强操作,标准化处理的公式如下:
Figure PCTCN2023070521-appb-000001
其中,x表示该数据集中任一图片的像素值(从RGB格式的0-255映射到0-1的数据),μ表示训练集中所有图片的像素均值,σ表示训练集中所有图片的像素标准差。该实施例中, μ=[0.4914,0.4822,0.4465],σ=[0.2023,0.1994,0.2010]。该实施例中,预处理还包括将图片对应的标注从单一类别处理成类别的概率,若任一图像属于某一类别,则该图片对应该类别的概率值为1,对应其余类别的概率值均为0;比如对于类别标注为5的任一图片,其处理后的类别概率值为[0,0,0,0,1,0,0,0,0,0],以匹配模型输出(Output)。
1-3)构建多分支网络并进行训练;具体步骤包括步骤1-3-1)至1-3-3)。
1-3-1)根据任务目标和需求,获取预训练网络,预训练网络为经过训练的用于计算机视觉任务的DNN模型。预训练网络可以通过使用训练集用传统训练方法获取,也可以直接使用已有的预训练网络以节省准备时间。
在一些实施例中,使用步骤1)的训练集训练一个用于图像分类的VGG19网络作为预训练网络。
1-3-2)在预训练网络的基础上加入分支以构建多分支网络。
具体地,首先需要确定分支的插入位置,一般会选在预训练网络的池化层或者激活层之后,因为这些层的计算时间比较短,而且处理完的数据容易被分支网络处理。在一些实施例中,以VGG19网络为例,选择在每个max_pooling(最大池化)层之后插入新的分支以形成多分支网络,该多分支网络的结构图如图2所示,共存在4个分支,其中节点(v 1,v 2,v 3,v 4,v 5)分别代表预训练网络中的卷积块block1,block2,block3,block4和block5,这些结构串联组成了VGG19。节点(b 1,b 2,b 3,b 4)分别代表插入的分支,实线箭头代表中间数据的流动过程,虚线箭头代表预测结果的流动方向。各分支可以使用统计机器学习的SVM(软支持向量机)等方法,也可以使用深度学习的CNN(卷积神经网络)或者VIT(Vision-Transformer)等模型。本实施例选择了精度和速度相对比较均衡的CNN网络作为分支,每个分支结构相同,其中以第一个分支b 1为例,结构如图3所示,从上往下进行层的推理。左边是每个层的名字,包括conv(卷积层)、bn(批归一化层)、relu(激活层)、max_pooling(最大池化层)和linear(全连接层),右边是该层次对应数据维度的变化情况,*代表了batchsize(批大小)。flatten操作是将高维数据转换为一维数据,可见右边数据维度的变化。其中包含一个卷积模块(Conv Block)对输入(Input)数据进行特征提取和数据降维,和两个全连接层组成的分类器(Classifier)完成最终的图像分类任务。
1-3-3)对每个分支进行训练。
本实施例中,在训练分支的过程中,需要对预训练网络进行固化用来提取特征。每个分支基于自身对应的预训练网络部分的输出进行训练。在一些实施例中,分支b 1对应的预训练网络部分为节点v 1之前的预训练网络,在训练分支b 1时,需要固定节点v 1之前的预训练网络,使用预训练网络在节点v 1的输出作为分支b 1输入。
各分支训练时,将每个分支对应的预训练网络的部分与该分支自身组成一个新的网络。 在一些实施例中,图4展示了四个分支训练时对应新网络的构成,其中第一个分支网络由预训练网络中的block1和分支b1组成,第二个分支网络由预训练网络中的block1、block2和分支b2组成,第三个分支网络由预训练网络中的block1、block2、block3和分支b3组成,第四个分支网络由预训练网络中的block1、block2、block3、block4和分支b4组成。需要说明的是,所述预训练网络的对应部分固定,即表示该部分在分支训练时权重不更新。
利用训练集对每个分支构成的新网络分别进行训练,当达到设定的训练轮数或者损失稳定时,该分支训练完毕。所有分支训练完毕后,得到训练完毕的多分支网络。
2)校准阶段。
对经过步骤1)训练完毕的多分支网络的评估校准。
在该步骤中,需要得到评估集的不确信度分布,不确信度即样本预测困难程度。根据所述不确信度分布划分不同的不确信度级别并确定每个不确信度级别在不同分支上的精度表现,从而确定多分支网络对于不同不确信度级别的分发方案。具体步骤包括步骤2-1)至2-3)。
2-1)确定评估集的不确信度分布。
具体地,利用评估集经过多分支网络第一个分支(即距离多分支网络输入最近的分支,本实施例中为分支b 1)得到的初始预测结果,计算评估集所有样本的初始不确信度分布。
因为分发模式需要在第一个分支完成计算后直接确定输出分支。多分支网络会存在过拟合问题,在预测概率上比较自信,造成不确信度分布倾向于垂尾分布。所以需要使用temperature Scaling(温度缩放)确定一个合适的参数T将初始不确信度分布由垂尾分布放平为均匀分布,得到评估集的不确信度分布。temperature Scaling可以对模型进行校准,提升多分支网络的精度表现。
在一些实施例中,对于评估集的任一样本,假设分支b 1的输出为y=(y 1,y 2,...,y 10),其中y i代表预测样本为第i类的概率。则最后输出的每个类别概率
Figure PCTCN2023070521-appb-000002
为:
Figure PCTCN2023070521-appb-000003
其中,T为超参数,可通过启发式方法确定,使不确信度分布接近于均匀分布,在本公开一个具体实施例例中,T=1.5。
该样本的不确信度由最终输出
Figure PCTCN2023070521-appb-000004
确定,表达式如下:
Figure PCTCN2023070521-appb-000005
Figure PCTCN2023070521-appb-000006
中最大值
Figure PCTCN2023070521-appb-000007
减去
Figure PCTCN2023070521-appb-000008
中第二大值
Figure PCTCN2023070521-appb-000009
的差值即为该样本的不确信度。
2-2)划分不确信度级别。
由步骤2-1)得到的不确信度分布,根据评估集每个样本的不确信度将评估集样本平均划分为M份,以确定不确信度的M个级别,其中M为一个可调参数,M越大,不确信度划分越细粒度,但是计算会更复杂,对评估集样本数量要求也更高。
在一些实施例中,M=10,且不同级别的分类边界是[0.000,0.058,0.130,0.223,0.343,0.480,0.625,0.777,0.894,0.966,1]。不确信度接近于0的为困难样本,不确信度接近于1的为简单样本。然后根据分类边界将评估集划分为10组样本集,测试不同不确信度级别的样本集在每个分支的精度和每个分支的推理延迟,其中精度即每个样本集由各个分支进行输出的平均预测准确率,推理延迟即每个样本集由各个分支进行输出的平均执行时间。
2-3)生成多分支网络的分发方案。
在本实施例中,使用DSGA算法(分发方案生成算法)生成符合目标精度需求的分发方案。所述分发方案即确定每个不确信度级别对应的输出分支,所述输出分支可以是第一个分支,即不再使用剩余分支,在一些实施例中,若输出分支为第一个分支,则直接选取分支b 1的预测结果作为输入样本的最终分类结果。具体步骤包括步骤2-3-1)至2-3-3)。
2-3-1)分发方案初始化。
令所有不确信度级别的样本初始时均从第一个分支输出,本公开一个具体实施例中初始的分发方案为[1,1,1,1,1,1,1,1,1,1],即被划分成10个不确信度级别的评估集样本均选择分支b 1输出对应的图片分类结果。
令每个不确信度级别对应的当前候选分支为当前输出分支的下一个分支,在一些实施例中,每个不确信度级别的初始候选分支为分支b 2,初始的候选分支集合为[2,2,2,2,2,2,2,2,2,2]。
对于每个不确信度级别,计算当前候选分支对应的加速比,所述加速比为采用当前候选分支相比当前输出分支带来的精度增加量与采用当前候选分支相比当前输出分支带来的推理时间增加量之比,表达式为:
Figure PCTCN2023070521-appb-000010
其中,Δ acc=NewBranch acc-OldBranch acc表示当前候选分支替换当前输出分支所带来的预测精度增加量;NewBranch acc为当前候选分支对应的预测精度,OldBranch acc为当前输出分支对应的预测精度;
Δ time=NewBranch time-OldBranch time表示当前候选分支替换当前输出分支所带来的推理时间增加量;NewBranch time为当前候选分支对应的推理时间,OldBranch time为当前输出分支对应的推理时间;
2-3-2)分发方案的更新。
在所有当前候选分支中选择加速比最大值对应的不确信度级别,将该不确信度级别的当前候选分支作为该不确信度级别新的当前输出分支,得到更新后的当前分发方案;然后更新 该不确信度级别的候选分支为当前输出分支的下一个分支,得到更新后的候选分支集合;利用更新后当前分发方案和候选分支集合,计算每个不确信度级别更新后的加速比。
在一些实施例中,第一次更新后加速比最大的候选分支对应第一个不确信度级别,则当前分发方案更新为[2,1,1,1,1,1,1,1,1,1],候选分支集合更新为[3,2,2,2,2,2,2,2,2,2]。第一个不确信度级别对应的候选分支的加速比更新为第一个不确信度级别样本在分支3相对比分支2带来的精度提升与推理延迟增加的比例。
2-3-3)利用DSGA算法得到每个不确信度级别对应的最终输出分支,构成所述多分支网络的最终分发方案。
需要说明的是,本实施例提出的DSGA算法的核心概念是每一次更新当前分发方案都贪婪地选择加速比最大的候选分支,直到候选分支集合中所有的当前候选分支都不会带来精度提升或者当前分发方案已经满足目标精度。
在一些实施例中,相对于预训练网络没有精度损失对应的最终分发方案是[5,5,5,5,4,4,3,3,1,1]。这意味不确信度介于[0.000,0.058]属于最困难的级别,会选择第五个分支为输出分支。约有40%的样本从分支5输出,20%的样本从分支4输出,20%的样本从分支3输出,20%的样本从分支1输出。
3)推理阶段。
本实施例中,已经完成了多分支网络的训练、不确信度级别的划分和分发方案的确定,可以直接进行真实样本的推理。本公开提出的分发推理模式示意图如图5所示,其中dispense模块负责根据当前分发方案分发样本。详细推理步骤包括步骤3-1)至3-3)。
3-1)获取待推理图片并进行预处理。
在一些实施例中,按照步骤2)对训练集预处理的方式处理待推理图片,得到输入图片x。
3-2)将输入图片x输入训练完毕的多分支网络的第一个分支,即多分支网络的基础部分,得到对应的初始预测结果和对应的不确信度;
在一些实施例中,表达式如下:
z=v1(x)
y=b1(z)=(y 1,y 2,...,y 10)
Figure PCTCN2023070521-appb-000011
Figure PCTCN2023070521-appb-000012
其中,v1(x)表示x在节点v1的输出,b1(z)表示x在第一个分支的输出。
3-3)根据预设的不确信度级别划分结果,确定x所属的不确信度级别;根据所述不确信度级别,确定x对应的输出分支并得到最终的预测结果。
在一些实施例中,判断x的不确信度
Figure PCTCN2023070521-appb-000013
位于M个不确信度级别中的哪一级别,然后根据分发方案确定该级别对应的输出分支。
在一些实施例中,不确信度计算出为0.813,介于[0.777,0.894],基于分发方案确定输出分支为第三个分支,则第三个分支复用x在节点v1的输出z,然后从第三个分支的输出得到x更新后的预测结果
Figure PCTCN2023070521-appb-000014
(需要说明的是,在这种情况下,x在第一个分支得到的初始预测直接被舍弃)。
如果确定的输出分支为第一个分支,则采取步骤2-2)的基础部分的预测信息作为输入图片的最终预测结果。即如果计算出的不确信度为0.991,分发方案确定的输出分支为第一个分支,所以不需要继续推理。
如果输出分支为剩余分支,则使用输出分支继续推理,采取最终输出分支的预测信息作为最终结果。在一些实施例中,选择第三个分支的预测信息
Figure PCTCN2023070521-appb-000015
作为最终预测结果。
为实现上述实施例,本公开第二方面实施例提出了一种多分支网络的分发推理装置,包括图片获取模块、初始预测模块、不确信度划分模块和最终预测模块。
图片获取模块,用于获取待推理图片并进行预处理。
初始预测模块,用于将预处理完毕的所述图片输入预设的多分支网络的第一个分支,所述第一个分支输出所述图片对应的初始预测结果;利用所述初始预测结果,计算所述图片的不确信度。
不确信度划分模块,用于根据所述不确信度,按照预设的不确信度级别划分结果,确定所述图片对应的不确信度级别。
最终预测模块,用于利用预设的所述多分支网络的分发方案,根据所述图片对应的不确信度级别确定所述图片在所述分发方案中对应的输出分支,以得到所述图片最终的预测结果。
在一些实施例中,所述最终预测模块用于:
若所述输出分支为所述多分支网络的第一个分支,则所述初始预测结果即为所述图片的最终预测结果;否则,将所述图片对应输出分支的输出结果作为所述图片的最终预测结果。
在一些实施例中,所述初始预测模块用于:
所述初始预测结果包括所述图片经由所述第一个分支输出的对应各分类的概率,将所述概率的最大值减去所述概率的第二最大值即为所述图片的不确信度。
在一些实施例中,所述初始预测模块还用于:
训练所述多分支网络;
所述训练多分支网络,包括:
根据所述多分支网络的任务获取数据集,所述数据集包括多张图片及所述图片的标注信息;将所述数据集划分为训练集和评估集;
对所述数据集进行预处理;
获取用于所述任务的预训练网络作为所述多分支网络的主干,在所述预训练网络设定位置处加入分支,以构建所述多分支网络;
利用预处理完毕的所述训练集对所述多分支网络的每个分支分别训练,得到训练完毕的 所述多分支网络;其中,所述每个分支训练时,将所述分支及所述分支之前的所述预训练网络部分构成一个新的网络进行训练,所述分支之前的所述预训练网络部分在训练时权重保持不变。
在一些实施例中,所述初始预测模块用于:
将预处理完毕的所述评估集的各图片输入所述训练完毕的多分支网络的第一个分支,得到所述评估集各图片的初始预测结果;
根据所述初始预测结果,计算所述评估集各图片的不确信度;
根据所述评估集各图片的不确信度,将所述评估集所有图片平均划分为M组,以得到所述不确信度级别划分结果,其中M为预设的不确信度级别总数。
在一些实施例中,所述初始预测模块用于:
1)确定初始分发方案,所述初始方案中所述评估集中每个不确信度级别的图片对应的当前输出分支均为所述多分支网络的第一个分支;
2)令每个不确信度级别对应的当前候选分支为当前输出分支的下一个分支;
3)利用所述评估集,对每个不确信度级别,计算当前候选分支对应的加速比,所述加速比为采用所述当前候选分支相比所述当前输出分支带来的预测精度增加量与采用所述当前候选分支相比所述当前输出分支带来的推理时间增加量之比;
4)在所有当前候选分支中选择加速比最大值对应的不确信度级别,将所述不确信度级别的当前候选分支作为所述不确信度级别新的当前输出分支,得到更新后的当前分发方案;更新所述不确信度级别的当前候选分支,得到更新后的候选分支集合;
5)重复步骤3)至4),直至所述候选分支集合中所有当前候选分支不再提升所述预测精度或者所述当前分发方案达到设定的所述预测精度,则将所述当前分发方案作为所述多分支网络的最终分发方案。
在一些实施例中,所述预测精度为所述评估集中任一不确信度级别对应的所有图片由任一分支进行输出的平均预测准确率,所述推理时间为所述评估集中任一不确信度级别对应的所有图片由任一分支进行输出的平均执行时间。
关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。
为实现上述实施例,本公开第三方面实施例提出了一种电子设备,包括至少一个处理器;以及,与所述至少一个处理器通信连接的存储器;
其中,所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被设置为用于执行本公开第一方面实施例的多分支网络的分发推理方法。
为实现上述实施例,本公开第四方面实施例提出了一种计算机可读存储介质,所述计算机可读存储介质存储计算机指令,所述计算机指令用于使所述计算机执行本公开第一方面实施例的多分支网络的分发推理方法。
为实现上述实施例,本公开第五方面实施例提出了一种计算机程序产品,包括计算机程序或指令,所述计算机程序或指令被处理器执行时,实现本公开第一方面实施例的多分支网络的分发推理方法。
本公开基于迁移学习方法提供了一个分离式的多分支网络设计和训练方案,消除了分支间的互相影响,减少了模型的部署难度。多分支网络在工业界使用较少,因为其设计和训练比较复杂,限制了它的应用,而分离式的训练方法可以直接使用预训练网络,减少了多分支网络的准备时间。
为了更充分地发挥早期退出机制的优势,本公开提出了多分支网络的分发推理模式。本公开提出了样本不确信度对所有分支一致的概念,并提供了分发方案生成算法,能够调整在不同分支输出的样本比例,在特定推理延迟需求下,尽可能地提高多分支网络的精度。
本公开提出的多分支网络可以和压缩量化等模型加速方法混合使用,以提供更好的方案。而且本公开的样本分发推理方法适用于多个模型之间组合推理的情况。
需要说明的是,本公开上述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。
上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,一种多分支网络的分发推理方法。
可以以一种或多种程序设计语言或其组合来编写用于执行本公开的操作的计算机程序代码,上述程序设计语言包括面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网 (WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。
在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本申请的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不必须针对的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任一个或多个实施例或示例中以合适的方式结合。此外,在不相互矛盾的情况下,本领域的技术人员可以将本说明书中描述的不同实施例或示例以及不同实施例或示例的特征进行结合和组合。
此外,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括至少一个该特征。在本申请的描述中,“多个”的含义是至少两个,例如两个,三个等,除非另有明确具体的限定。
流程图中或在此以其他方式描述的任何过程或方法描述可以被理解为,表示包括一个或更多个用于实现特定逻辑功能或过程的步骤的可执行指令的代码的模块、片段或部分,并且本申请的优选实施方式的范围包括另外的实现,其中可以不按所示出或讨论的顺序,包括根据所涉及的功能按基本同时的方式或按相反的顺序,来执行功能,这应被本申请的实施例所属技术领域的技术人员所理解。
在流程图中表示或在此以其他方式描述的逻辑和/或步骤,例如,可以被认为是用于实现逻辑功能的可执行指令的定序列表,可以具体实现在任何计算机可读介质中,以供指令执行系统、装置或设备(如基于计算机的系统、包括处理器的系统或其他可以从指令执行系统、装置或设备取指令并执行指令的系统)使用,或结合这些指令执行系统、装置或设备而使用。就本说明书而言,"计算机可读介质"可以是任何可以包含、存储、通信、传播或传输程序以供指令执行系统、装置或设备或结合这些指令执行系统、装置或设备而使用的装置。计算机可读介质的更具体的示例(非穷尽性列表)包括以下:具有一个或多个布线的电连接部(电子装置),便携式计算机盘盒(磁装置),随机存取存储器(RAM),只读存储器(ROM),可擦除可编辑只读存储器(EPROM或闪速存储器),光纤装置,以及便携式光盘只读存储器(CDROM)。另外,计算机可读介质甚至可以是可在其上打印程序的纸或其他合适的介质,因为可以例如通过对纸或其他介质进行光学扫描,接着进行编辑、解译或必要时以其他合适方式进行处理来以电子方式获得程序,然后将其存储在计算机存储器中。
应当理解,本申请的各部分可以用硬件、软件、固件或它们的组合来实现。在上述实施方式中,多个步骤或方法可以用存储在存储器中且由合适的指令执行系统执行的软件或固件来实现。例如,如果用硬件来实现,和在另一实施方式中一样,可用本领域公知的下列技术中的任一项或他们的组合来实现:具有用于对数据信号实现逻辑功能的逻辑门电路的离散逻辑电路,具有合适的组合逻辑门电路的专用集成电路,可编程门阵列(PGA),现场可编程门阵列(FPGA)等。
本技术领域的普通技术人员可以理解实现上述实施例方法携带的全部或部分步骤是可 以通过程序来指令相关的硬件完成,的程序可以存储于一种计算机可读存储介质中,该程序在执行时,包括方法实施例的步骤之一或其组合。
此外,在本申请各个实施例中的各功能单元可以集成在一个处理模块中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。上述提到的存储介质可以是只读存储器,磁盘或光盘等。尽管上面已经示出和描述了本申请的实施例,可以理解的是,上述实施例是示例性的,不能理解为对本申请的限制,本领域的普通技术人员在本申请的范围内可以对上述实施例进行变化、修改、替换和变型。

Claims (17)

  1. 一种多分支网络的分发推理方法,包括:
    获取待推理图片并进行预处理;
    将预处理完毕的所述图片输入预设的多分支网络的第一个分支,所述第一个分支输出所述图片对应的初始预测结果;利用所述初始预测结果,计算所述图片的不确信度;
    根据所述不确信度,按照预设的不确信度级别划分结果,确定所述图片对应的不确信度级别;
    利用预设的所述多分支网络的分发方案,根据所述图片对应的不确信度级别确定所述图片在所述分发方案中对应的输出分支,以得到所述图片最终的预测结果。
  2. 根据权利要求1所述的方法,其中,所述利用预设的所述多分支网络的分发方案,根据所述图片对应的不确信度级别确定所述图片在所述分发方案中对应的输出分支,以得到所述图片最终的预测结果,包括:
    若所述输出分支为所述多分支网络的第一个分支,则所述初始预测结果即为所述图片的最终预测结果;否则,将所述图片对应输出分支的输出结果作为所述图片的最终预测结果。
  3. 根据权利要求1所述的方法,其中,所述利用所述初始预测结果,计算所述图片的不确信度,包括:
    所述初始预测结果包括所述图片经由所述第一个分支输出的对应各分类的概率,将所述概率的最大值减去所述概率的第二最大值即为所述图片的不确信度。
  4. 根据权利要求3所述的方法,其中,在所述将预处理完毕的所述图片输入预设的多分支网络的第一个分支之前,还包括:
    训练所述多分支网络;
    所述训练多分支网络,包括:
    根据所述多分支网络的任务获取数据集,所述数据集包括多张图片及所述图片的标注信息;将所述数据集划分为训练集和评估集;
    对所述数据集进行预处理;
    获取用于所述任务的预训练网络作为所述多分支网络的主干,在所述预训练网络设定位置处加入分支,以构建所述多分支网络;
    利用预处理完毕的所述训练集对所述多分支网络的每个分支分别训练,得到训练完毕的所述多分支网络;其中,所述每个分支训练时,将所述分支及所述分支之前的所述预训练网络部分构成一个新的网络进行训练,所述分支之前的所述预训练网络部分在训练时权重保持不变。
  5. 根据权利要求4所述的方法,其中,所述不确信度级别划分结果的确定方法包括:
    将预处理完毕的所述评估集的各图片输入所述训练完毕的多分支网络的第一个分支,得到所述评估集各图片的初始预测结果;
    根据所述初始预测结果,计算所述评估集各图片的不确信度;
    根据所述评估集各图片的不确信度,将所述评估集所有图片平均划分为M组,以得到 所述不确信度级别划分结果,其中M为预设的不确信度级别总数。
  6. 根据权利要求5所述的方法,其中,所述多分支网络的分发方案确定方法包括:
    1)确定初始分发方案,所述初始方案中所述评估集中每个不确信度级别的图片对应的当前输出分支均为所述多分支网络的第一个分支;
    2)令每个不确信度级别对应的当前候选分支为当前输出分支的下一个分支;
    3)利用所述评估集,对每个不确信度级别,计算当前候选分支对应的加速比,所述加速比为采用所述当前候选分支相比所述当前输出分支带来的预测精度增加量与采用所述当前候选分支相比所述当前输出分支带来的推理时间增加量之比;
    4)在所有当前候选分支中选择加速比最大值对应的不确信度级别,将所述不确信度级别的当前候选分支作为所述不确信度级别新的当前输出分支,得到更新后的当前分发方案;更新所述不确信度级别的当前候选分支,得到更新后的候选分支集合;
    5)重复步骤3)至4),直至所述候选分支集合中所有当前候选分支不再提升所述预测精度或者所述当前分发方案达到设定的所述预测精度,则将所述当前分发方案作为所述多分支网络的最终分发方案。
  7. 根据权利要求6所述的方法,其中,所述预测精度为所述评估集中任一不确信度级别对应的所有图片由任一分支进行输出的平均预测准确率,所述推理时间为所述评估集中任一不确信度级别对应的所有图片由任一分支进行输出的平均执行时间。
  8. 一种多分支网络的分发推理装置,包括:
    图片获取模块,用于获取待推理图片并进行预处理;
    初始预测模块,用于将预处理完毕的所述图片输入预设的多分支网络的第一个分支,所述第一个分支输出所述图片对应的初始预测结果;利用所述初始预测结果,计算所述图片的不确信度;
    不确信度划分模块,用于根据所述不确信度,按照预设的不确信度级别划分结果,确定所述图片对应的不确信度级别;
    最终预测模块,用于利用预设的所述多分支网络的分发方案,根据所述图片对应的不确信度级别确定所述图片在所述分发方案中对应的输出分支,以得到所述图片最终的预测结果。
  9. 根据权利要求8所述的装置,其中,所述最终预测模块用于:
    若所述输出分支为所述多分支网络的第一个分支,则所述初始预测结果即为所述图片的最终预测结果;否则,将所述图片对应输出分支的输出结果作为所述图片的最终预测结果。
  10. 根据权利要求8所述的装置,其中,所述初始预测模块用于:
    所述初始预测结果包括所述图片经由所述第一个分支输出的对应各分类的概率,将所述概率的最大值减去所述概率的第二最大值即为所述图片的不确信度。
  11. 根据权利要求10所述的装置,其中,所述初始预测模块还用于:
    训练所述多分支网络;
    所述训练多分支网络,包括:
    根据所述多分支网络的任务获取数据集,所述数据集包括多张图片及所述图片的标注信息;将所述数据集划分为训练集和评估集;
    对所述数据集进行预处理;
    获取用于所述任务的预训练网络作为所述多分支网络的主干,在所述预训练网络设定位置处加入分支,以构建所述多分支网络;
    利用预处理完毕的所述训练集对所述多分支网络的每个分支分别训练,得到训练完毕的所述多分支网络;其中,所述每个分支训练时,将所述分支及所述分支之前的所述预训练网络部分构成一个新的网络进行训练,所述分支之前的所述预训练网络部分在训练时权重保持不变。
  12. 根据权利要求11所述的装置,其中,所述初始预测模块用于:
    将预处理完毕的所述评估集的各图片输入所述训练完毕的多分支网络的第一个分支,得到所述评估集各图片的初始预测结果;
    根据所述初始预测结果,计算所述评估集各图片的不确信度;
    根据所述评估集各图片的不确信度,将所述评估集所有图片平均划分为M组,以得到所述不确信度级别划分结果,其中M为预设的不确信度级别总数。
  13. 根据权利要求12所述的装置,其中,所述初始预测模块用于:
    1)确定初始分发方案,所述初始方案中所述评估集中每个不确信度级别的图片对应的当前输出分支均为所述多分支网络的第一个分支;
    2)令每个不确信度级别对应的当前候选分支为当前输出分支的下一个分支;
    3)利用所述评估集,对每个不确信度级别,计算当前候选分支对应的加速比,所述加速比为采用所述当前候选分支相比所述当前输出分支带来的预测精度增加量与采用所述当前候选分支相比所述当前输出分支带来的推理时间增加量之比;
    4)在所有当前候选分支中选择加速比最大值对应的不确信度级别,将所述不确信度级别的当前候选分支作为所述不确信度级别新的当前输出分支,得到更新后的当前分发方案;更新所述不确信度级别的当前候选分支,得到更新后的候选分支集合;
    5)重复步骤3)至4),直至所述候选分支集合中所有当前候选分支不再提升所述预测精度或者所述当前分发方案达到设定的所述预测精度,则将所述当前分发方案作为所述多分支网络的最终分发方案。
  14. 根据权利要求13所述的装置,其中,所述预测精度为所述评估集中任一不确信度级别对应的所有图片由任一分支进行输出的平均预测准确率,所述推理时间为所述评估集中任一不确信度级别对应的所有图片由任一分支进行输出的平均执行时间。
  15. 一种电子设备,包括:
    至少一个处理器;以及,与所述至少一个处理器通信连接的存储器;
    其中,所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被设置为用于执行上述权利要求1至7任一项所述的方法。
  16. 一种计算机可读存储介质,所述计算机可读存储介质存储计算机指令,所述计算机指令用于使所述计算机执行权利要求1至7任一项所述的方法。
  17. 一种计算机程序产品,包括计算机程序或指令,所述计算机程序或指令被处理器执行时,实现如权利要求1至7中任一项所述的方法。
PCT/CN2023/070521 2022-05-11 2023-01-04 多分支网络的分发推理方法和装置 WO2023216642A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210507991.7 2022-05-11
CN202210507991.7A CN114972850B (zh) 2022-05-11 多分支网络的分发推理方法、装置、电子设备及存储介质

Publications (1)

Publication Number Publication Date
WO2023216642A1 true WO2023216642A1 (zh) 2023-11-16

Family

ID=82981258

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/070521 WO2023216642A1 (zh) 2022-05-11 2023-01-04 多分支网络的分发推理方法和装置

Country Status (1)

Country Link
WO (1) WO2023216642A1 (zh)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111582091A (zh) * 2020-04-27 2020-08-25 西安交通大学 基于多分支卷积神经网络的行人识别方法
CN113067873A (zh) * 2021-03-19 2021-07-02 北京邮电大学 基于深度强化学习的边云协同优化方法
CN114972850A (zh) * 2022-05-11 2022-08-30 清华大学 多分支网络的分发推理方法、装置、电子设备及存储介质

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111582091A (zh) * 2020-04-27 2020-08-25 西安交通大学 基于多分支卷积神经网络的行人识别方法
CN113067873A (zh) * 2021-03-19 2021-07-02 北京邮电大学 基于深度强化学习的边云协同优化方法
CN114972850A (zh) * 2022-05-11 2022-08-30 清华大学 多分支网络的分发推理方法、装置、电子设备及存储介质

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
LIANG ZHIWEI; ZHOU YUEZHI: "Dispense Mode for Inference to Accelerate Branchynet", 2022 IEEE INTERNATIONAL CONFERENCE ON IMAGE PROCESSING (ICIP), IEEE, 16 October 2022 (2022-10-16), pages 1246 - 1250, XP034293081, DOI: 10.1109/ICIP46576.2022.9897574 *
PARK EUNHYEOK; KIM DONGYOUNG; KIM SOOBEOM; KIM YONG-DEOK; KIM GUNHEE; YOON SUNGROH; YOO SUNGJOO: "Big/little deep neural network for ultra low power inference", 2015 INTERNATIONAL CONFERENCE ON HARDWARE/SOFTWARE CODESIGN AND SYSTEM SYNTHESIS (CODES+ISSS), IEEE, 4 October 2015 (2015-10-04), pages 124 - 132, XP032813440, DOI: 10.1109/CODESISSS.2015.7331375 *

Also Published As

Publication number Publication date
CN114972850A (zh) 2022-08-30

Similar Documents

Publication Publication Date Title
US20230229919A1 (en) Learning to generate synthetic datasets for training neural networks
US11308350B2 (en) Deep cross-correlation learning for object tracking
CN111126574B (zh) 基于内镜图像对机器学习模型进行训练的方法、装置和存储介质
WO2023173598A1 (zh) 基于改进ssd模型的风机叶片缺陷检测方法及系统
WO2022077646A1 (zh) 一种用于图像处理的学生模型的训练方法及装置
WO2023137889A1 (zh) 基于嵌入增强和自适应的小样本图像增量分类方法及装置
WO2021089012A1 (zh) 图网络模型的节点分类方法、装置及终端设备
WO2023109208A1 (zh) 小样本目标检测方法及装置
WO2021051987A1 (zh) 神经网络模型训练的方法和装置
TWI831016B (zh) 機器學習方法、機器學習系統以及非暫態電腦可讀取媒體
Dai Real-time and accurate object detection on edge device with TensorFlow Lite
EP4220555A1 (en) Training method and apparatus for image segmentation model, image segmentation method and apparatus, and device
Zhou et al. Wasserstein distance feature alignment learning for 2D image-based 3D model retrieval
WO2023216642A1 (zh) 多分支网络的分发推理方法和装置
CN117456167A (zh) 一种基于改进YOLOv8s的目标检测算法
CN115795355B (zh) 一种分类模型训练方法、装置及设备
WO2023220878A1 (en) Training neural network trough dense-connection based knowlege distillation
WO2023097428A1 (en) Methods and apparatus to perform parallel double-batched self-distillation in resource-constrained image recognition applications
US20240020531A1 (en) System and Method for Transforming a Trained Artificial Intelligence Model Into a Trustworthy Artificial Intelligence Model
CN114898426A (zh) 一种同义标签聚合方法、装置、设备及存储介质
CN114972850B (zh) 多分支网络的分发推理方法、装置、电子设备及存储介质
CN110633722A (zh) 人工神经网络调整方法和装置
WO2024055677A1 (zh) 一种深度聚类的方法、装置及系统
EP4386657A1 (en) Image optimization method and apparatus, electronic device, medium, and program product
Zeng et al. Task-Level Consistency Semi-supervised Based Domain Adaptation for Lung Nodules Segmentation

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23802419

Country of ref document: EP

Kind code of ref document: A1