Data processing model deployment method and device, computer device, storage medium and program product

CN123011254APending Publication Date: 2026-10-30曙光信息产业(河南)有限公司 +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610930919.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-25
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

但是,申请人研究发现,相关技术中提供的知识蒸馏技术和轻量化网络部署方案,至少存在蒸馏计算开销高、学生模型与新型加速卡硬件适配不足的技术问题

Benefits of technology

[0048]第五方面,本申请还提供了一种计算机程序产品,包括计算机程序,该计算机程序被处理器执行时实现第一方面中的步骤。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123011254A_ABST
    Figure CN123011254A_ABST
Patent Text Reader

Abstract

The application relates to a data processing model deployment method and device, computer equipment, a storage medium and a program product, and relates to the technical field of artificial intelligence. The method comprises the following steps: obtaining hardware constraint data of a deployment target of a data processing model, and constructing a student model based on the hardware constraint data; obtaining a teacher model adapted to pre-training completion of the data processing model, and determining an effective sample pair set based on output confidence of the teacher model; determining sample relationships of intermediate layer features of the student model and the teacher model based on the effective sample pair set; training the student model based on the sample relationships respectively corresponding to the student model and the teacher model, to obtain a target data processing model after training completion; and issuing the target data processing model to the deployment target for model deployment. The method can improve distillation efficiency and obtain a target data processing model more adapted to the deployment target.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and in particular to a method, apparatus, computer device, storage medium, and program product for deploying a data processing model. Background Technology

[0002] Knowledge distillation, as a model compression technique, aims to transfer knowledge contained in large, complex "teacher" models to small, lightweight "student" models. This significantly reduces computational resource consumption and inference latency while maintaining model performance, thus meeting deployment requirements on resource-constrained devices. However, the applicant's research has found that the knowledge distillation techniques and lightweight network deployment schemes provided in related technologies suffer from at least the technical problems of high distillation computational overhead and insufficient compatibility between student models and new accelerator card hardware. Summary of the Invention

[0003] Based on this, it is necessary to provide a method, apparatus, computer equipment, computer-readable storage medium, and computer program product for deploying a data processing model that can improve distillation efficiency and model compatibility with new accelerator cards, addressing the aforementioned technical problems.

[0004] Firstly, this application provides a method for deploying a data processing model, the method comprising:

[0005] Obtain the hardware constraint data of the deployment target of the data processing model, and construct a student model based on the hardware constraint data;

[0006] Obtain a teacher model adapted to the pre-trained data processing model, and determine the set of valid sample pairs based on the output confidence of the teacher model;

[0007] Based on the set of effective sample pairs, the sample relationship of the intermediate layer features of the student model and the teacher model is determined respectively;

[0008] Based on the sample relationships corresponding to the student model and the teacher model respectively, the student model is trained to obtain the trained target data processing model;

[0009] The target data processing model is distributed to the deployment target for model deployment.

[0010] In this embodiment, the student model is constructed using hardware constraint data related to the deployment target of the data processing model. This makes the initially constructed student model more suitable for the relevant deployment target, which can improve the adaptability of the target data processing model trained on the student model to the deployment target to a certain extent. Furthermore, the sample confidence is calculated based on the output probability of the teacher model to construct an effective sample pair set. This allows subsequent distillation of the relationship between the student model and the teacher model to be performed only on the effective sample pair set, which helps to reduce the computational load of sample relationship calculation and improve the corresponding distillation efficiency. For the selected effective sample pair set, the sample relationship of the intermediate layer features of the student model and the teacher model is determined for use in training the student model. This enables the student model to learn more stable sample structure information in the teacher model, making the trained target data processing model more adaptable to the deployment target.

[0011] In one embodiment, training the student model based on the sample relationships corresponding to the student model and the teacher model respectively to obtain the trained target data processing model includes:

[0012] Based on the sample relationships corresponding to the student model and the teacher model respectively, determine the corresponding relationship distillation loss;

[0013] Based on the supervised classification loss and the relation distillation loss corresponding to the student model, the student model is jointly trained to obtain the trained target data processing model.

[0014] In this embodiment, after determining the sample relationship between the intermediate layer features of the teacher model and the student model, the corresponding relation distillation loss is determined based on the obtained sample relationship. This enables the student model to learn more stable sample structure information from the teacher model. Then, the student model is jointly trained using the supervised classification loss and relation distillation loss corresponding to the student model. This helps to ensure that the target data processing model obtained after training has more stable sample structure information and is a model form that is more suitable for deployment and execution of the target, thereby improving the efficiency of the target data processing model in application.

[0015] In one embodiment, the step of jointly training the student model based on the supervised classification loss and the relation distillation loss corresponding to the student model to obtain the trained target data processing model includes:

[0016] Obtain the supervised classification loss corresponding to the student model, including the self-cross-entropy loss and the KL divergence distillation loss;

[0017] Based on the self-cross-entropy loss, the KL divergence distillation loss, and the relation distillation loss, determine the total training loss adapted to the student model;

[0018] The student model is trained based on the total training loss to obtain the trained target data processing model.

[0019] In this embodiment, the total training loss adapted to the student model is obtained by using the student model's own cross-entropy loss, KL divergence distillation loss, and the determined relation distillation loss. Then, the student model is trained using this total training loss, so that the student model can not only learn how to classify, but also learn the decision boundary and inference path of the teacher model. This comprehensive knowledge absorption enables the trained target data processing model to have higher data processing accuracy; at the same time, it also helps to reduce the latency of the target data processing model in processing data.

[0020] In one embodiment, determining the total training loss adapted to the student model based on the self-cross-entropy loss, the KL divergence distillation loss, and the relation distillation loss includes:

[0021] Obtain a first weighting coefficient adapted to the KL divergence distillation loss, and a second weighting coefficient adapted to the relational distillation loss;

[0022] Based on the self-cross-entropy loss, the KL divergence distillation loss, the relation distillation loss, the first weight coefficient, and the second weight coefficient, the total training loss adapted to the student model is determined.

[0023] In this embodiment, during the process of determining the total training loss of the student model, appropriate weight coefficients can be determined for the KL divergence distillation loss and the relation distillation loss, respectively. The addition of these weight coefficients helps to improve the data processing accuracy of the target data processing model obtained by training the student model based on the corresponding total training loss.

[0024] In one embodiment, determining the set of valid sample pairs based on the output confidence of the teacher model includes:

[0025] The obtained current batch of samples is input into the teacher model to obtain the output probability of the teacher model for the current batch of samples;

[0026] The output confidence level of the current batch of samples in the teacher model is determined based on the output probability.

[0027] Based on the target sample data whose confidence values ​​are greater than or equal to a preset confidence threshold in the output confidence scores, a set of valid sample pairs is formed; the target sample data belongs to the current batch of samples.

[0028] In this embodiment, the teacher model processes the current batch of samples to obtain the output probability for the current batch of samples. Based on this output probability, the output confidence of the current batch of samples in the teacher model is compared with a preset confidence threshold. According to the comparison result, the target sample data corresponding to the output confidence value with the larger confidence value is selected. These target sample data form an effective sample pair set, which helps to reduce the interference of low-confidence samples or mispredicted samples on the training of the student model. This not only improves the training efficiency of the student model, but also helps to ensure the data processing accuracy of the target data processing model finally trained.

[0029] In one embodiment, obtaining the hardware constraint data of the deployment target of the data processing model includes:

[0030] Obtain the convolution operator type, kernel size, channel parallelism granularity, supported range of grouped convolution, data layout, and cache capacity of the deployment target of the data processing model to form the corresponding hardware constraint data.

[0031] In this embodiment, by acquiring the characteristic parameters of the deployment target of the data processing model, hardware constraint data is constructed using the acquired characteristic parameters such as convolution operator type, convolution kernel size, channel parallel granularity, group convolution support range, data layout, and cache capacity. This provides basic parameters for the subsequent construction of the student model, which helps to ensure the correlation and adaptation between the subsequently constructed student model and the deployment target.

[0032] In one embodiment, constructing the student model based on the hardware constraint data includes:

[0033] Based on the hardware constraint data, including the type of convolution operator, kernel size, channel parallelism granularity, supported range of grouped convolution, data layout, and cache capacity, determine the target kernel size, target number of channels, target number of branches, and target grouping method suitable for building the student model.

[0034] The student model is constructed based on the target convolution kernel size, the target number of channels, the target number of branches, and the target grouping method.

[0035] In this embodiment, the characteristic parameters of the deployment target of the data processing model are used to determine the feature data suitable for building the student model. The student model is built based on the target convolution kernel size, target number of channels, target number of branches and target grouping method included in the determined feature data, which helps to ensure the correlation and fit between the built student model and the deployment target.

[0036] In one embodiment, determining the sample relationship of the intermediate layer features of the student model and the teacher model based on the set of effective sample pairs includes:

[0037] Based on the set of effective sample pairs, the first Pearson correlation coefficient of the intermediate layer features of the student model is obtained, and the corresponding sample relationship is obtained.

[0038] Based on the set of effective sample pairs, the second Pearson correlation coefficient of the intermediate layer features of the teacher model is determined, and the corresponding sample relationship is obtained.

[0039] In this embodiment, a method for determining the sample relationships of intermediate-layer features of the student model is provided by obtaining the first Pearson correlation coefficient of the intermediate-layer features of the student model through a set of effective sample pairs; simultaneously, a method for determining the sample relationships of intermediate-layer features of the teacher model is provided by obtaining the second Pearson correlation coefficient of the intermediate-layer features of the teacher model through a set of effective sample pairs; this method simplifies the determination of the sample relationships of the intermediate-layer features of the model; and determining the sample relationships enables the student model to learn more stable sample structure information in the teacher model, which is beneficial to improving the generalization ability of the student model.

[0040] Secondly, this application also provides a deployment apparatus for a data processing model, the apparatus comprising:

[0041] The model building module is used to obtain the hardware constraint data of the deployment target of the data processing model, and to build a student model based on the hardware constraint data.

[0042] The sample determination module is used to obtain a teacher model that is adapted to the pre-trained data processing model and to determine a set of valid sample pairs based on the output confidence of the teacher model.

[0043] The relationship determination module is used to determine the sample relationship of the intermediate layer features of the student model and the teacher model based on the set of effective sample pairs, respectively.

[0044] The model training module is used to train the student model based on the sample relationships corresponding to the student model and the teacher model respectively, so as to obtain the trained target data processing model.

[0045] The model deployment module is used to distribute the target data processing model to the deployment target for model deployment.

[0046] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the first aspect.

[0047] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the first aspect.

[0048] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps in the first aspect.

[0049] Regarding the beneficial effects of any of the technical solutions in the second to fifth aspects mentioned above, refer to the beneficial effects of the corresponding technical solutions in the first aspect; repeated examples will not be listed here. Attached Figure Description

[0050] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0051] Figure 1 This is an application environment diagram of a data processing model deployment method in one embodiment;

[0052] Figure 2 This is a flowchart illustrating the deployment method of a data processing model in one embodiment;

[0053] Figure 3 This is a flowchart illustrating the deployment method of the data processing model in another embodiment;

[0054] Figure 4 This is a schematic diagram of the student model architecture in one embodiment;

[0055] Figure 5 This is a schematic diagram of an effective sample relationship distillation strategy in another embodiment;

[0056] Figure 6 This is a structural block diagram of a deployment device for a data processing model in one embodiment;

[0057] Figure 7 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0058] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0059] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments, or any combination of multiple embodiments.

[0060] As deep learning models are increasingly used in scenarios such as fault diagnosis, image recognition, speech processing, and industrial edge computing, the size and computational complexity of these models are also constantly increasing. Larger network models typically rely on high-performance GPUs (Graphics Processing Units) for training and inference. While they can achieve good accuracy in server environments, they are prone to problems such as high inference latency, large memory usage, high power consumption, and unstable operator call efficiency on resource-constrained platforms such as edge devices, embedded platforms, and new accelerator cards.

[0061] New accelerator cards differ from general-purpose GPU platforms in terms of parallel computing capabilities, on-chip storage structure, operator library support, channel parallelism granularity, and data layout. Some lightweight network structures that perform well on GPUs may not achieve ideal performance when directly migrated to new accelerator cards. For example, operations such as multi-branch convolution, feature concatenation, grouped convolution, and normalization may incur additional data read / write and scheduling overhead if their channel count, grouping method, or data layout is incompatible with the target hardware, thus impacting overall training and inference efficiency.

[0062] Therefore, under the premise of ensuring model recognition capability, how to reduce the size of student models through knowledge distillation, and design student model structure and distillation training method in combination with the hardware constraints of new accelerator cards, are problems that need to be solved in current model compression and engineering deployment.

[0063] The applicant's research revealed that knowledge distillation is a commonly used model compression method. Its basic idea is to use a more accurate and structurally complex teacher model to guide the training of a smaller student model, allowing the student model to maintain good recognition performance with lower parameter and computational requirements. Knowledge distillation methods in related technologies typically include the following categories:

[0064] (1) Logits distillation: The class probability distribution output by the teacher model is smoothed by temperature coefficient, so that the student model learns the similarity relationship between classes.

[0065] (2) Feature distillation: The feature representation of the intermediate layer of the teacher model is used as supervision information to guide the student model to approach the teacher model in the feature space.

[0066] (3) Attention distillation: Using the spatial attention, channel attention or other attention distributions generated by the teacher model, guide the student model to focus on more discriminative feature regions or feature channels.

[0067] (4) Relation distillation: By constraining the student model through the distance, similarity or correlation between samples, the student model learns the sample distribution structure formed by the teacher model in the feature space.

[0068] The methods described above can reduce model complexity and improve the training performance of lightweight models to some extent. However, these methods still have shortcomings when deployed on new accelerator cards: on the one hand, relation distillation methods usually require the construction of many sample pairs or complete relation matrices, which can easily increase the overhead of sample relation calculation and gradient backpropagation; on the other hand, lightweight student models usually directly adopt existing network structures and rarely combine the operator support range, channel parallelism granularity and data layout of new accelerator cards for constraint design, resulting in a limited improvement in actual training or inference efficiency despite a reduction in the number of parameters.

[0069] Furthermore, during the research process, the applicant analyzed the knowledge distillation methods and lightweight network deployment schemes in related technologies and found that these technologies mainly have the following problems when training and inferring for new accelerator cards:

[0070] (1) Relation distillation has high computational overhead: knowledge distillation methods in related technologies mostly rely on the output probabilities of the teacher model, single-layer features, or attention maps, and do not make sufficient use of the structural relationships between samples. Although some relation distillation methods introduce similarity constraints between samples, they usually need to construct a complete relation matrix for the current batch of samples, which easily increases the overhead of memory access, matrix calculation, and gradient backpropagation. The reason for this is that related methods mainly aim to improve model accuracy and rarely consider the computational cost of distillation loss on resource-constrained hardware.

[0071] (2) Low-confidence distillation information can easily interfere with student model training: In the knowledge distillation process, the teacher model cannot provide reliable judgments for all training samples. If all samples are used directly to construct distillation supervision information, low-confidence samples or incorrectly predicted samples may also participate in relation distillation, causing the student model to learn unstable or even incorrect sample structure relations. The reason for this is that related methods usually assume that the output of the teacher model has high confidence and lack a screening mechanism for the quality of distilled samples.

[0072] (3) Insufficient Adaptation of Lightweight Student Models to Hardware Constraints of New Accelerator Cards: Lightweight student models in related technologies typically adopt existing network structures directly, such as depthwise separable convolutions, grouped convolutions, multi-branch convolutions, or Ghost-type modules (lightweight feature extraction modules). Although these can reduce the number of parameters and theoretical computational cost, they rarely incorporate constraints related to the operator support range, channel parallelism granularity, data layout, and storage access methods of new accelerator cards. This is because related model designs focus more on the number of parameters, FLOPs (Floating-point Operations Per Second), and recognition accuracy, while neglecting the actual execution efficiency of the target hardware.

[0073] (4) Lack of coordinated design between training and deployment: The solutions in related technologies usually complete knowledge distillation training first, and then transfer the student model to the target hardware for deployment. The training phase does not fully consider the channel alignment, data layout, precision format and data transfer overhead in the subsequent deployment, resulting in limited improvement in end-to-end running efficiency even though the model is compressed. The reason is that there is a lack of unified design between the distillation strategy, the student model structure and the hardware deployment process.

[0074] To address at least some of the technical problems existing in the knowledge distillation methods and lightweight network deployment schemes in the aforementioned related technologies, this application provides a deployment method for a data processing model. The method involves: acquiring hardware constraint data of the deployment target of the data processing model and constructing a student model based on the hardware constraint data; acquiring a teacher model adapted to the pre-trained data processing model and determining a set of valid sample pairs based on the output confidence of the teacher model; then, based on the set of valid sample pairs, determining the sample relationships of the intermediate layer features of the student model and the teacher model respectively, and training the student model based on the corresponding sample relationships of the student model and the teacher model to obtain the trained target data processing model; and finally, distributing the target data processing model to the deployment target for model deployment. This method improves distillation efficiency and yields a target data processing model that is more adapted to the deployment target.

[0075] The data processing model deployment method provided in this application embodiment can be applied to, for example, Figure 1In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104, or it can be located in the cloud or on other network servers. The data storage system can store hardware constraint data of the deployment target, teacher models adapted to the pre-trained data processing models, etc. Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, etc. Server 104 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.

[0076] In one exemplary embodiment, such as Figure 2 As shown, a method for deploying a data processing model is provided, which can be applied to... Figure 1 Taking the server in the example, the explanation includes the following steps 201 to 205. Wherein:

[0077] Step 201: Obtain the hardware constraint data of the deployment target of the data processing model, and construct the student model based on the hardware constraint data.

[0078] The deployment targets can be new accelerator cards, or other resource-constrained platforms such as edge devices and embedded platforms. New accelerator cards can be understood as dedicated hardware modules (integrated circuit components) independently developed by enterprises with independent intellectual property rights; their core function is to replace or offload the AI ​​(Artificial Intelligence) related computing load of general-purpose CPUs (Central Processing Units) or GPUs, significantly improving the training speed and inference efficiency of artificial intelligence models by utilizing powerful parallel computing capabilities.

[0079] Deployment targets can also be understood as platforms that are prone to problems such as high inference latency, large memory usage, high power consumption, and unstable operator call efficiency.

[0080] Among them, the hardware constraint data of the deployment target refers to constraint information such as the parallel computing capability, on-chip storage structure, operator library support range, channel parallel granularity, data layout, storage access method and precision format of the new accelerator card.

[0081] Among them, the data processing model is the student model, which is a lighter and more efficient alternative model trained by using knowledge distillation technology on the initial student model to learn the features output by the teacher model. This model will eventually be deployed to the deployment target.

[0082] For example, when a server is developing a specific data processing model for a deployment target, it can first obtain the hardware constraint data of that deployment target, and then use this hardware constraint data to build the student model. Since some deployment targets (e.g., new accelerator cards) have different hardware support for certain data types, using the hardware constraint data of the deployment target to build the student model helps ensure the compatibility of the built student model with the deployment target. Furthermore, the hardware constraint data of the deployment target also provides reference information for training the student model, such as rewriting underlying operators, adjusting parallel strategies, and optimizing communication mechanisms, so as to fully utilize computing power within limited hardware boundaries and ultimately achieve low-cost, high-precision model distillation.

[0083] Step 202: Obtain the teacher model adapted to the pre-trained data processing model, and determine the set of valid sample pairs based on the output confidence of the teacher model.

[0084] In this context, the teacher model refers to a neural network model with a large parameter scale and high recognition accuracy, used to provide supervisory information such as output probabilities, intermediate layer features, and sample relationships to the student model during distillation training. Correspondingly, the student model refers to a neural network model with a lighter structure, fewer parameters, and lower computational cost, used to complete training under the guidance of the teacher model and deployed on resource-constrained platforms such as new accelerator cards to perform inference tasks.

[0085] The teacher model is trained based on pre-provided raw training data. For example, the raw training data is obtained, normalized, denoised, or segmented using a sliding window, and divided into training, validation, and test sets. The teacher model is then trained using the processed raw training data to obtain a teacher network with high recognition accuracy, which provides supervisory information such as output probabilities, intermediate layer features, and sample structure relationships to the student model.

[0086] The pre-trained teacher model typically outputs a probability distribution during prediction, which is also known as the output confidence level. The set of effective sample pairs is determined based on the output confidence level of the teacher model. Specifically, it can consist of samples with high output confidence levels, while samples with low output confidence levels can be filtered out. This helps improve the efficiency and final accuracy of the effective sample pairs used for training the student model.

[0087] Among them, the effective sample pair set refers to a data combination that has been rigorously screened, is of extremely high quality, and has been packaged in a specific format.

[0088] For example, before training the constructed student model, the server can first obtain a teacher model that is adapted to the pre-trained data processing model, and then construct a set of effective sample pairs based on the samples selected according to the output confidence of the teacher model.

[0089] Step 203: Based on the set of valid sample pairs, determine the sample relationships of the intermediate layer features of the student model and the teacher model respectively.

[0090] The intermediate layer features of the model refer to the information representation extracted and processed in the hidden layer when the data passes through the neural network model; the hidden layer is the intermediate network layer that is neither the input layer nor the final output layer.

[0091] For example, when the server obtains a valid set of sample pairs, it can further use a pre-selected correlation coefficient determination method to determine the sample relationship of the intermediate layer features of the student model and the sample relationship of the intermediate layer features of the teacher model, so as to provide a favorable training basis for the subsequent training of the student model through the obtained sample relationship.

[0092] Step 204: Based on the sample relationships corresponding to the student model and the teacher model respectively, train the student model to obtain the trained target data processing model.

[0093] Among them, the target data processing model is still a student model, which refers to a student model that has been trained and can be deployed to the deployment target (such as a new type of accelerator card).

[0094] For example, after the server determines the sample relationship corresponding to the student model and the teacher model respectively, it can further train the student model based on the obtained sample relationship. This method enables the student model to learn more stable sample structure information in the teacher model during training, thereby improving the data processing accuracy of the target data processing model finally trained.

[0095] Step 205: Distribute the target data processing model to the deployment target for model deployment.

[0096] For example, after the server obtains the trained target data processing model, it can distribute it to the deployment target for model deployment, so that the deployment target can perform data processing tasks based on the deployed target data processing model.

[0097] The data processing model deployment method provided in this application constructs a student model using hardware constraint data related to the deployment target of the data processing model. This makes the initially constructed student model more suitable for the relevant deployment target, which can improve the adaptability of the target data processing model trained on the student model to the deployment target to a certain extent. Furthermore, the sample confidence is calculated based on the output probability of the teacher model to construct an effective sample pair set. This allows subsequent distillation of the relationship between the student model and the teacher model to be performed only on the effective sample pair set, which helps to reduce the computational amount of sample relationship calculation and improve the corresponding distillation efficiency. For the selected effective sample pair set, the sample relationship of the intermediate layer features of the student model and the teacher model is determined for use in training the student model. This enables the student model to learn more stable sample structure information in the teacher model, making the trained target data processing model more adaptable to the deployment target.

[0098] For example, student models can also be compressed using depthwise separable convolution, grouped convolution, Ghost modules, Shuffle modules, or other lightweight convolutional structures, but this requires adaptation to the operator library and channel parallel granularity of new accelerator cards.

[0099] In an exemplary embodiment, the above steps, which involve training the student model based on the sample relationships corresponding to the student model and the teacher model respectively, to obtain the trained target data processing model, include: determining the corresponding relation distillation loss based on the sample relationships corresponding to the student model and the teacher model respectively; and jointly training the student model based on the supervised classification loss and relation distillation loss corresponding to the student model to obtain the trained target data processing model.

[0100] Supervised classification loss measures the difference between the student model's predictions and the true labels in the dataset, ensuring that the student model does not deviate from the general direction while learning from the teacher model. No matter how strong the teacher model is, the student model must guarantee that its output is highly consistent with objective reality (the true labels).

[0101] Among them, relation distillation loss measures the similarity between the sample relations extracted by the student model and the sample relations extracted by the teacher model.

[0102] For example, after determining the sample relationships corresponding to the student model and the teacher model, the server can construct a related relation distillation loss based on the differences between the two. This loss can then be further combined with supervised classification loss to jointly train the student model, resulting in the trained target data processing model. In other words, the total loss used to train the student model consists of the supervised classification loss and the relation distillation loss.

[0103] In this embodiment, after determining the sample relationship between the intermediate layer features of the teacher model and the student model, the corresponding relation distillation loss is determined based on the obtained sample relationship. This enables the student model to learn more stable sample structure information from the teacher model. Then, the student model is jointly trained using the supervised classification loss and relation distillation loss corresponding to the student model. This helps to ensure that the target data processing model obtained after training has more stable sample structure information and is a model form that is more suitable for deployment and execution of the target, thereby improving the efficiency of the target data processing model in application.

[0104] In one embodiment, the above steps of jointly training the student model based on the supervised classification loss and relation distillation loss corresponding to the student model to obtain the trained target data processing model include: obtaining the self-cross-entropy loss and KL divergence distillation loss included in the supervised classification loss corresponding to the student model; determining the total training loss adapted to the student model based on the self-cross-entropy loss, KL divergence distillation loss and relation distillation loss; and training the student model based on the total training loss to obtain the trained target data processing model.

[0105] The supervised classification loss includes Self Cross-Entropy Loss and KL Divergence Distillation Loss. Self Cross-Entropy Loss measures the difference between the student model's prediction and the absolutely true labels in the dataset; KL Divergence Distillation Loss measures the difference between the probability distribution (soft label) output by the student model and the probability distribution output by the teacher model.

[0106] The total training loss is composed of self-cross-entropy loss, KL divergence distillation loss and relation distillation loss. The three are combined to train a student model that is both compact and intelligent, and has extremely high accuracy.

[0107] For example, the server can specifically compose a total training loss adapted to the student model based on the supervised classification loss, including the self-cross-entropy loss, KL divergence distillation loss, and relation distillation loss, and train the student model through the total training loss to obtain a target data processing model (the trained student model) with higher data processing accuracy.

[0108] In this embodiment, the total training loss adapted to the student model is obtained by using the student model's own cross-entropy loss, KL divergence distillation loss, and the determined relation distillation loss. Then, the student model is trained using this total training loss, so that the student model can not only learn how to classify, but also learn the decision boundary and inference path of the teacher model. This comprehensive knowledge absorption enables the trained target data processing model to have higher data processing accuracy; at the same time, it also helps to reduce the latency of the target data processing model in processing data.

[0109] In one embodiment, the above steps of determining the total training loss adapted to the student model based on its own cross-entropy loss, KL divergence distillation loss, and relation distillation loss include: obtaining a first weight coefficient adapted to the KL divergence distillation loss and a second weight coefficient adapted to the relation distillation loss; and determining the total training loss adapted to the student model based on its own cross-entropy loss, KL divergence distillation loss, relation distillation loss, the first weight coefficient, and the second weight coefficient.

[0110] The total training loss provided in this application is: self-cross-entropy loss + first weight coefficient × KL divergence distillation loss + second weight coefficient × relation distillation loss. The first weight coefficient and the second weight coefficient are respectively adapted to the coefficient value table provided in advance based on industry experience. Multiple candidate total training losses can be constructed by taking the first and second candidate coefficients from the coefficient value table respectively. Multiple candidate student models are then trained based on different candidate total training losses. The same set of sample data is then processed by each candidate student model. The first and second candidate coefficients corresponding to the sample student model with the highest accuracy of the sample data processing result are selected as the first and second weight coefficients for the final application.

[0111] For example, the server needs to obtain a first weight coefficient adapted to the KL divergence distillation loss and a second weight coefficient adapted to the relation distillation loss through test training, and then use "self-cross-entropy loss + first weight coefficient × KL divergence distillation loss + second weight coefficient × relation distillation loss" to obtain the total training loss adapted to the student model.

[0112] In this embodiment, during the process of determining the total training loss of the student model, appropriate weight coefficients can be determined for the KL divergence distillation loss and the relation distillation loss, respectively. The addition of these weight coefficients helps to improve the data processing accuracy of the target data processing model obtained by training the student model based on the corresponding total training loss.

[0113] In one embodiment, the above steps of determining the set of valid sample pairs based on the output confidence of the teacher model include: inputting the obtained current batch of samples into the teacher model to obtain the output probability of the teacher model for the current batch of samples; determining the output confidence of the current batch of samples in the teacher model based on the output probability; forming a set of valid sample pairs based on the target sample data whose confidence value is greater than or equal to a preset confidence threshold in the output confidence; the target sample data belongs to the current batch of samples.

[0114] For example, the server can determine the output confidence level of the teacher model by inputting the current batch of samples into the output probability obtained from the teacher model. Then, it can sort the confidence levels of the output confidence levels, select samples with confidence levels greater than or equal to a preset confidence threshold as target sample data, and construct a set of effective sample pairs from these target sample data. The preset confidence threshold can be determined based on requirements, and this application does not impose specific limitations on it.

[0115] Another example is that the server can determine the output confidence level of the teacher model by inputting the current batch of samples into the output probability obtained by the teacher model, and then sort the confidence levels of the output confidence levels, selecting the top K samples corresponding to the highest confidence levels as target sample data, and forming a set of effective sample pairs using these target sample data. The value of K can be determined based on the requirements, such as 80%, 85%, etc. of the total number of samples.

[0116] In this embodiment, the teacher model processes the current batch of samples to obtain the output probability for the current batch of samples. Based on this output probability, the output confidence of the current batch of samples is compared with a preset confidence threshold. According to the comparison result, target sample data corresponding to the output confidence values ​​with higher confidence values ​​are selected. These target sample data form a set of effective sample pairs, which helps reduce the interference of low-confidence samples or incorrectly predicted samples on the training of the student model. This improves the training efficiency of the student model and ensures the data processing accuracy of the final trained target data processing model. In other words, this embodiment calculates sample confidence based on the output probability of the teacher model during the distillation training process and selects high-confidence samples to construct effective sample pairs. Relation distillation is performed only on effective sample pairs, avoiding the construction of a complete relation matrix for all samples in the current batch, thereby reducing the overhead of sample relation calculation, memory access, and gradient backpropagation.

[0117] For example, in addition to filtering high-confidence samples based on the confidence level of the teacher model output, effective sample pairs can also be filtered based on sample loss value, class label, feature distance, training rounds, or sample difficulty, which can also reduce the participation of invalid sample pairs in relationship distillation.

[0118] In one embodiment, the above steps of obtaining hardware constraint data of the deployment target of the data processing model include: obtaining the convolution operator type, convolution kernel size, channel parallel granularity, grouped convolution support range, data layout and cache capacity of the deployment target of the data processing model to form the corresponding hardware constraint data.

[0119] In this embodiment, by acquiring the characteristic parameters of the deployment target of the data processing model, hardware constraint data is constructed using the acquired characteristic parameters such as convolution operator type, convolution kernel size, channel parallel granularity, group convolution support range, data layout, and cache capacity. This provides basic parameters for the subsequent construction of the student model, which helps to ensure the correlation and adaptation between the subsequently constructed student model and the deployment target.

[0120] In one embodiment, the above steps of constructing a student model based on hardware constraint data include: determining the target convolution kernel size, target number of channels, target number of branches, and target grouping method suitable for constructing the student model based on the convolution operator type, convolution kernel size, channel parallel granularity, grouped convolution support range, data layout, and cache capacity included in the hardware constraint data; and constructing the student model based on the target convolution kernel size, target number of channels, target number of branches, and target grouping method.

[0121] In this embodiment, the characteristic parameters (hardware constraint data) of the deployment target of the data processing model are used to determine the feature data suitable for building the student model. The student model is built based on the target convolution kernel size, target number of channels, target number of branches and target grouping method included in the determined feature data, which helps to ensure the correlation and fit between the built student model and the deployment target.

[0122] In one embodiment, the above steps of determining the sample relationship of the intermediate layer features of the student model and the teacher model based on the effective sample pair set include: obtaining the first Pearson correlation coefficient of the intermediate layer features of the student model based on the effective sample pair set to obtain the corresponding sample relationship; and determining the second Pearson correlation coefficient of the intermediate layer features of the teacher model based on the effective sample pair set to obtain the corresponding sample relationship.

[0123] In this embodiment, a method for determining the sample relationships of intermediate-layer features of the student model is provided by obtaining the first Pearson correlation coefficient of the intermediate-layer features of the student model through a set of effective sample pairs; simultaneously, a method for determining the sample relationships of intermediate-layer features of the teacher model is provided by obtaining the second Pearson correlation coefficient of the intermediate-layer features of the teacher model through a set of effective sample pairs; this method simplifies the determination of the sample relationships of the intermediate-layer features of the model; and determining the sample relationships enables the student model to learn more stable sample structure information in the teacher model, which is beneficial to improving the generalization ability of the student model.

[0124] For example, in addition to Pearson correlation coefficient, cosine similarity, Euclidean distance, inner product similarity or normalized cross-correlation can also be used to describe the relationship between samples and construct the relationship distillation loss.

[0125] For the deployment method of the data processing model provided in this application, please refer to Figure 3 This application also provides an optional specific embodiment, including the following steps S11-S15, wherein:

[0126] Step S11: Data Preprocessing and Teacher Model Training. Obtain the raw training data, normalize it, denoise it, or perform sliding window segmentation, dividing it into training, validation, and test sets. Then train the teacher model to obtain a teacher network with high recognition accuracy, which provides supervisory information such as output probabilities, intermediate layer features, and sample structure relationships.

[0127] Step S12: Obtain hardware constraints for the new accelerator card. Obtain constraint information such as the operator support range, channel parallelism granularity, data layout, storage access method, and precision format of the target new accelerator card, which will serve as the basis for subsequent student model design and deployment optimization;

[0128] Step S13: Construct a hardware-friendly lightweight student model. A lightweight student model is constructed based on the hardware constraints of the new accelerator card (deployment target). The model employs a multi-scale local feature extraction structure, and constraints are placed on the number of convolutional branches, kernel size, number of channels, and grouping method to make it more suitable for efficient execution by the new accelerator card's operator library.

[0129] Step S14: Distillation training based on effective sample relationships. During distillation training, high-confidence samples are selected based on the output confidence of the teacher model, and effective sample pairs are constructed from these high-confidence samples. Subsequently, the sample relationship between the intermediate layer features of the teacher model and the student model is calculated using the Pearson correlation coefficient, and a relationship distillation loss is constructed based on the difference between the two. Simultaneously, the student model is jointly trained by combining the supervised classification loss and the output distillation loss.

[0130] Step S15: Operator Adaptation and New Accelerator Card Deployment. After distillation, the student model is adapted before deployment, including channel alignment, data layout adjustment, precision format conversion, and necessary operator merging. The student model is converted into a model format suitable for execution on the target new accelerator card to reduce intermediate data read / write and operator scheduling overhead, achieving low-latency inference.

[0131] For the lightweight student model construction method in step S13, please refer to the appendix. Figure 4 Based on the hardware constraint information of the new accelerator card obtained in step S12, the lightweight feature extraction module in the student model can be designed. The hardware constraint information includes the types of convolution operators supported by the target accelerator card, the convolution kernel size suitable for efficient execution, the channel parallelism granularity, the range of grouped convolutions supported, the data layout, and the cache capacity, etc.

[0132] Let the input features be: ;in, Indicates the number of input channels. Indicates the length of the input sequence;

[0133] Furthermore, the number of module output channels is set to an integer multiple of the target novel accelerator card's channel parallel granularity to align with the accelerator card's computing units. Subsequently, channel adjustments are made to the input features: ;in, This represents a cross-channel convolution with a kernel size of 1, used to adjust the channel dimensions and fuse channel information;

[0134] Furthermore, several convolutional kernel sizes are selected from the set of convolutional kernels that are efficiently supported by the target novel accelerator card, and multi-scale lightweight convolution calculations are performed on the channel-adjusted features. Then, the outputs of each branch are concatenated along the channel dimension. , , ;in, Represents the set of convolution kernel sizes. K represents the number of convolution branches. i This represents the kernel size of the i-th convolutional branch. Indicates the kernel size as Depth convolution operation, This represents the features after splicing multiple scale branches.

[0135] To fuse channel information across multiple scale branches, grouped pointwise convolutions are used for channel fusion. Following channel fusion, a batch normalization layer and an activation function (corresponding to...) are applied. Figure 4 The BN+ReLU algorithm is used to complete the feature mapping. Furthermore, supplementary features are generated based on the fused features. , ;in, (.) represents a point convolution with a kernel size of 1, and g represents the number of groups; (.) indicates a low-cost linear operation.

[0136] Finally, the fused features and supplementary features are concatenated to obtain the output of this lightweight feature extraction module: .

[0137] In this way, the student model can reduce the computational cost of standard convolution while maintaining its ability to represent multi-scale features. Furthermore, the kernel size, number of channels, number of groups, and low-cost operators are all selected based on the hardware constraints of the new accelerator card, making the student model not only have lower parameter and computational costs but also easier to execute efficiently on the new accelerator card.

[0138] Specifically, the effective sample relationship distillation strategy in step S14 can be referred to... Figure 5 During the distillation training process, the current batch of samples is first input into the teacher model to obtain the output probability of the teacher model, and the sample confidence level is calculated based on the output probability. ;in, Indicates sample The teacher model outputs confidence scores. Indicates the teacher model judgment sample The output probability of belonging to class c, where C represents the total number of classes. If If ≥τ, then sample xi is considered a high-confidence sample. In one implementation, τ = 0.8.

[0139] Constructing a set of effective sample pairs from high-confidence samples: For valid sample pairs The Pearson correlation coefficients between the intermediate layer features of the teacher model and the student model were calculated separately to obtain the teacher sample relationship. Relationship with student sample Then, the effective sample relationship distillation loss is constructed using L2 form: Where L represents the number of intermediate layers involved in distillation. This indicates the number of valid sample pairs.

[0140] The total training loss of the student model is: ;in, This represents the student model's own cross-entropy loss. This indicates the KL divergence distillation loss. This represents the distillation loss of the effective sample relationship. , These are the weighting coefficients.

[0141] In this way, the present invention constructs sample relationships based only on high-confidence samples of the teacher model, reducing the computational overhead caused by low-confidence samples and the full sample pair, and enabling the student model to learn more stable sample structure information.

[0142] In summary, the deployment method of the data processing model provided in this application embodiment has at least the following technical effects:

[0143] (1) In the distillation training process, high-confidence samples are first selected based on the confidence level output by the teacher model, and then effective sample pairs are constructed based on the high-confidence samples. Compared with the method of constructing a complete relation matrix for all samples in the current batch, this invention reduces the number of invalid sample pairs participating in relation calculation, thereby reducing the overhead of sample relation calculation, memory access and gradient backpropagation.

[0144] (2) Only high-confidence samples from the teacher model are used to construct sample relationships, reducing the interference of low-confidence samples or mispredicted samples on the training of the student model. At the same time, the Pearson correlation coefficient is used to describe the relationship between sample features, enabling the student model to learn more stable sample structure information from the teacher model, which is beneficial to improving the generalization ability of the student model.

[0145] (3) Based on the operator support range, channel parallel granularity, data layout and storage access characteristics of the new accelerator card, the convolution kernel size, number of channels, number of branches and grouping method of the student model are constrained to make the student model structure more suitable for execution by the new accelerator card and reduce the performance loss caused by the mismatch between structure and hardware characteristics.

[0146] (4) After the distillation training is completed, the student model is channel aligned, data layout adjusted, precision format converted and necessary operators merged so that the trained student model can be converted into a model form suitable for the target new accelerator card to be executed, reducing intermediate data reading and writing and operator scheduling overhead.

[0147] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.

[0148] Based on the same inventive concept, this application also provides a deployment apparatus for a data processing model to implement the deployment method of the data processing model described above. The solution provided by this apparatus is similar to the implementation scheme described in the above method. Therefore, the specific limitations of one or more data processing model deployment apparatus embodiments provided below can be found in the limitations of the data processing model deployment method described above, and will not be repeated here.

[0149] In one exemplary embodiment, such as Figure 6 As shown, a data processing model deployment device is provided, including: a model building module 61, a sample determination module 62, a relation determination module 63, a model training module 64, and a model deployment module 65, wherein:

[0150] The model building module 61 is used to obtain the hardware constraint data of the deployment target of the data processing model and build a student model based on the hardware constraint data.

[0151] The sample determination module 62 is used to obtain the teacher model that is adapted to the pre-trained data processing model and determine the set of valid sample pairs based on the output confidence of the teacher model.

[0152] The relationship determination module 63 is used to determine the sample relationships of the intermediate layer features of the student model and the teacher model based on the set of effective sample pairs.

[0153] The model training module 64 is used to train the student model based on the sample relationship between the student model and the teacher model respectively, so as to obtain the trained target data processing model.

[0154] The model deployment module 65 is used to distribute the target data processing model to the deployment target for model deployment.

[0155] In an exemplary embodiment, the model training module 64 is used to train the student model based on the sample relationships corresponding to the student model and the teacher model respectively, to obtain the trained target data processing model. Specifically, it is used to: determine the corresponding relation distillation loss based on the sample relationships corresponding to the student model and the teacher model respectively; and jointly train the student model based on the supervised classification loss and relation distillation loss corresponding to the student model to obtain the trained target data processing model.

[0156] In an exemplary embodiment, the model training module 64 is used to jointly train the student model based on the supervised classification loss and relation distillation loss corresponding to the student model, to obtain the trained target data processing model. Specifically, it is used to: obtain the self-cross-entropy loss and KL divergence distillation loss included in the supervised classification loss corresponding to the student model; determine the total training loss adapted to the student model based on the self-cross-entropy loss, KL divergence distillation loss and relation distillation loss; and train the student model based on the total training loss to obtain the trained target data processing model.

[0157] In an exemplary embodiment, the model training module 64 is used to determine the total training loss adapted to the student model based on its own cross-entropy loss, KL divergence distillation loss, and relation distillation loss. Specifically, it is used to: obtain a first weight coefficient adapted to the KL divergence distillation loss and a second weight coefficient adapted to the relation distillation loss; and determine the total training loss adapted to the student model based on its own cross-entropy loss, KL divergence distillation loss, relation distillation loss, the first weight coefficient, and the second weight coefficient.

[0158] In an exemplary embodiment, the sample determination module 62 is used to determine a set of valid sample pairs based on the output confidence of the teacher model. Specifically, it is used to: input the obtained current batch of samples into the teacher model to obtain the output probability of the teacher model for the current batch of samples; determine the output confidence of the current batch of samples in the teacher model based on the output probability; form a set of valid sample pairs based on the target sample data whose confidence value is greater than or equal to a preset confidence threshold in the output confidence; the target sample data belongs to the current batch of samples.

[0159] In an exemplary embodiment, the model building module 61 is used to obtain hardware constraint data of the deployment target of the data processing model, specifically: to obtain the convolution operator type, convolution kernel size, channel parallel granularity, group convolution support range, data layout and cache capacity of the deployment target of the data processing model, so as to form the corresponding hardware constraint data.

[0160] In an exemplary embodiment, the model building module 61 is used to build a student model based on hardware constraint data. Specifically, it is used to: determine the target convolution kernel size, target number of channels, target number of branches, and target grouping method suitable for building the student model based on the convolution operator type, convolution kernel size, channel parallel granularity, grouped convolution support range, data layout, and cache capacity included in the hardware constraint data; and build the student model based on the target convolution kernel size, target number of channels, target number of branches, and target grouping method.

[0161] In an exemplary embodiment, the relationship determination module 63 is used to determine the sample relationship of the intermediate layer features of the student model and the teacher model based on the set of valid sample pairs, specifically: based on the set of valid sample pairs, obtain the first Pearson correlation coefficient of the intermediate layer features of the student model to obtain the corresponding sample relationship; based on the set of valid sample pairs, determine the second Pearson correlation coefficient of the intermediate layer features of the teacher model to obtain the corresponding sample relationship.

[0162] Each module in the deployment device of the aforementioned data processing model can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.

[0163] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 7 As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The database stores hardware constraint data of the deployment target, teacher models adapted to the pre-trained data processing model, etc. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements a deployment method for a data processing model.

[0164] Those skilled in the art will understand that Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0165] In one exemplary embodiment, a computer device is provided, including a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement steps of a deployment method for a data processing model.

[0166] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program implementing steps of a deployment method for a data processing model when executed by a processor.

[0167] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps of a deployment method for a data processing model.

[0168] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.

[0169] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.

[0170] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0171] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A method for deploying a data processing model, characterized in that, The method includes: Obtain the hardware constraint data of the deployment target of the data processing model, and construct a student model based on the hardware constraint data; Obtain a teacher model adapted to the pre-trained data processing model, and determine the set of valid sample pairs based on the output confidence of the teacher model; Based on the set of effective sample pairs, the sample relationship of the intermediate layer features of the student model and the teacher model is determined respectively; Based on the sample relationships corresponding to the student model and the teacher model respectively, the student model is trained to obtain the trained target data processing model; The target data processing model is distributed to the deployment target for model deployment.

2. The method according to claim 1, characterized in that, The step of training the student model based on the sample relationships corresponding to the student model and the teacher model respectively, to obtain the trained target data processing model, includes: Based on the sample relationships corresponding to the student model and the teacher model respectively, determine the corresponding relationship distillation loss; Based on the supervised classification loss and the relation distillation loss corresponding to the student model, the student model is jointly trained to obtain the trained target data processing model.

3. The method according to claim 2, characterized in that, The step of jointly training the student model based on the supervised classification loss and the relation distillation loss corresponding to the student model to obtain the trained target data processing model includes: Obtain the supervised classification loss corresponding to the student model, including the self-cross-entropy loss and the KL divergence distillation loss; Based on the self-cross-entropy loss, the KL divergence distillation loss, and the relation distillation loss, determine the total training loss adapted to the student model; The student model is trained based on the total training loss to obtain the trained target data processing model.

4. The method according to claim 3, characterized in that, The determination of the total training loss adapted to the student model based on the self-cross-entropy loss, the KL divergence distillation loss, and the relation distillation loss includes: Obtain a first weighting coefficient adapted to the KL divergence distillation loss, and a second weighting coefficient adapted to the relational distillation loss; Based on the self-cross-entropy loss, the KL divergence distillation loss, the relation distillation loss, the first weight coefficient, and the second weight coefficient, the total training loss adapted to the student model is determined.

5. The method according to claim 1, characterized in that, The determination of the set of valid sample pairs based on the output confidence score of the teacher model includes: The obtained current batch of samples is input into the teacher model to obtain the output probability of the teacher model for the current batch of samples; The output confidence level of the current batch of samples in the teacher model is determined based on the output probability. Based on the target sample data whose confidence values ​​are greater than or equal to a preset confidence threshold in the output confidence scores, a set of valid sample pairs is formed; the target sample data belongs to the current batch of samples.

6. The method according to claim 1, characterized in that, The hardware constraint data for the deployment target of the data processing model includes: Obtain the convolution operator type, kernel size, channel parallelism granularity, supported range of grouped convolution, data layout, and cache capacity of the deployment target of the data processing model to form the corresponding hardware constraint data.

7. The method according to claim 6, characterized in that, The construction of the student model based on the hardware constraint data includes: Based on the hardware constraint data, including the type of convolution operator, kernel size, channel parallelism granularity, supported range of grouped convolution, data layout, and cache capacity, determine the target kernel size, target number of channels, target number of branches, and target grouping method suitable for building the student model. The student model is constructed based on the target convolution kernel size, the target number of channels, the target number of branches, and the target grouping method.

8. The method according to any one of claims 1-7, characterized in that, The step of determining the sample relationship of the intermediate layer features of the student model and the teacher model based on the set of effective sample pairs includes: Based on the set of effective sample pairs, the first Pearson correlation coefficient of the intermediate layer features of the student model is obtained, and the corresponding sample relationship is obtained. Based on the set of effective sample pairs, the second Pearson correlation coefficient of the intermediate layer features of the teacher model is determined, and the corresponding sample relationship is obtained.

9. A deployment device for a data processing model, characterized in that, The device includes: The model building module is used to obtain the hardware constraint data of the deployment target of the data processing model, and to build a student model based on the hardware constraint data. The sample determination module is used to obtain a teacher model that is adapted to the pre-trained data processing model and to determine a set of valid sample pairs based on the output confidence of the teacher model. The relationship determination module is used to determine the sample relationship of the intermediate layer features of the student model and the teacher model based on the set of effective sample pairs, respectively. The model training module is used to train the student model based on the sample relationships corresponding to the student model and the teacher model respectively, so as to obtain the trained target data processing model. The model deployment module is used to distribute the target data processing model to the deployment target for model deployment.

10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1-8.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method described in any one of claims 1-8.

12. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method described in any one of claims 1-8.