Knowledge distillation type cooperative training method of heterogeneous local models, electronic device
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHONGJIA MICROVISION (SHENZHEN) SEMICONDUCTOR TECHNOLOGY CO LTD
- Filing Date
- 2026-04-23
- Publication Date
- 2026-08-07
AI Technical Summary
[0007]本申请实施例的主要目的在于提供一种异构本地模型的知识蒸馏式协同训练方法、电子设备,以解决相关技术中工位精度需求不一致、性能/成本不匹配、本地语义空间无法对齐以及负载不均衡的问题
本申请实施例提供的协同训练方法,允许各工位保留最适合自身工况的检测模型,在协同训练中不直接平均模型参数,而是通过蒸馏机制将多方知识融合并共享,从而实现跨工位的协同性能提升。同时,本申请实施例引入了特征级的公共探针集合作为对齐基准,以增强异构模型融合的鲁棒性,还采用自适应通信压缩与负载门控策略,以最大限度降低训练过程对在线生产推理的影响。
Smart Images

Figure CN122529002A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of computation based on a specific computational model, specifically to a knowledge distillation-based collaborative training method for heterogeneous local models and an electronic device. Background Technology
[0002] In multi-station visual inspection production lines such as roll-to-roll, roll-to-film, and film-to-film, each station is typically equipped with an independent camera and GPU inference node. Due to the different process stages they are in, the performance requirements of different stations exhibit a divergent trend: high-speed transmission stations require millisecond-level response times and need to deploy lightweight models to meet processing capabilities of tens to hundreds of frames per second; while critical defect screening stations are sensitive to the recall rate of minor defects and tend to use detection models with large parameters, high accuracy, but higher computational overhead. Therefore, multi-station visual inspection production lines often exhibit a heterogeneous deployment state where lightweight models and high-precision models coexist.
[0003] Existing federated learning frameworks generally employ a parameter averaging aggregation strategy when handling multi-client collaborative training. This strategy requires all participants to have completely identical model structures; otherwise, element-wise alignment and averaging of parameters at each layer is impossible. Forcibly unifying the model structures of each workstation on the production line could lead to decreased real-time performance at lightweight workstations due to insufficient computing resources, while high-precision workstations might sacrifice detection accuracy due to limited model capacity—both are unacceptable. Therefore, the parameter averaging methods used in these technologies cannot be directly applied to industrial scenarios with heterogeneous models.
[0004] The image data collected at each workstation exhibits significant differences in distribution: the optical illumination conditions, reflectivity of the inspected materials, and defect types vary across different workstations, resulting in a non-independent, identically distributed pattern in the local data. Under this constraint, directly fusing the model outputs or intermediate features from each workstation can easily lead to oscillations during training, unstable convergence, and even negative transfer—that is, the local detection performance of the workstation model degrades after absorbing external knowledge. The root cause is that the feature representation space learned by heterogeneous models under different data distributions lacks a unified alignment benchmark, making it difficult to avoid semantic shift issues.
[0005] Multi-station visual inspection production lines operate on a production-first principle. Therefore, computational tasks such as model training and knowledge uploading must be performed during low-load periods to avoid interfering with the normal inspection and inference process. Furthermore, the factory's internal network often involves cross-segment deployments, resulting in fluctuating communication bandwidth and uncertain connectivity. Frequent transmission of the full model weights not only consumes bandwidth resources but is also difficult to complete within a limited time window.
[0006] In summary, the collaborative training methods of related technologies face significant technical challenges in being implemented in industrial vision scenarios, and can no longer meet people's requirements, so improvements are urgently needed. Summary of the Invention
[0007] The main objective of this application is to provide a knowledge distillation-based collaborative training method and electronic device for heterogeneous local models, in order to solve the problems of inconsistent workstation accuracy requirements, performance / cost mismatch, inability to align local semantic spaces, and unbalanced load in related technologies.
[0008] The embodiments of this application adopt the following technical solutions:
[0009] According to one aspect of the embodiments of this application, a knowledge distillation-based collaborative training method for heterogeneous local models is provided, comprising: acquiring device resource status parameters of system hardware based on a local client, constructing a device profile of the local client, and allocating heterogeneous local detection models to the local client according to the device profile; pre-constructing a common probe set through a central server and receiving feature vectors from the local client, wherein the common probe set is used to perform consistency evaluation on the output features of the local client to obtain a consistency score; receiving compressed and encoded knowledge data uploaded by the local client through the central server, wherein the compression and encoding method of the knowledge data is dynamically determined according to the current network bandwidth, and calculating the local client's... The consistency score between the terminal output and the public probe set is used to weight and fuse the knowledge data uploaded by the local client based on the consistency score to generate dual-form aggregated knowledge. Knowledge data uploaded by the local client with a consistency score below the threshold is downweighted or rejected. The dual-form aggregated knowledge is distributed to the local client through the central server. The local client performs local distillation update during the window period when the inference load is below the set threshold. When performing local distillation update, the distillation temperature and distillation weight are dynamically adjusted according to the current inference latency and queue length of the local client. The distillation loss and local supervision loss are superimposed for multi-objective optimization to generate candidate version models and perform canary release or rollback operations.
[0010] According to at least one specific embodiment of the present application, the step of acquiring device resource status parameters of system hardware based on a local client, constructing a device profile for the local client, and allocating heterogeneous local detection models based on the device profile; pre-constructing a public probe set through a central server and receiving feature vectors from the local client, the public probe set being used to perform consistency evaluation on the output features of the local client to obtain a consistency score, further includes: the device profile construction process includes: periodically collecting GPU model, video memory capacity, inference latency, and current network bandwidth through the local client calling the system hardware API to construct a device profile for the local client, the device profile including: hardware computing power specifications, memory resource capacity, real-time response performance, and communication links. The system analyzes the following: Based on the hardware computing power specifications and memory resource capacity in the device profile, heterogeneous local detection models are matched for local clients from a preset model library. Based on the real-time response performance and communication link status in the device profile, the compression rate of knowledge data upload is determined, and inference load thresholds and distillation update trigger conditions are set. Feature vectors of representative samples are collected from local clients through a central server. These representative samples cover different defect types, lighting conditions, and material categories. Version numbers are assigned to the public probe set. The system periodically receives feature vectors output by local clients after performing forward calculations on the current version of the probe set to obtain a consistency score. When the global consistency score drops by more than a preset range, the probe set version is updated, representative samples are reselected, and feature vectors are extracted.
[0011] According to at least one specific embodiment of the present application, the step of assigning a version number to the public probe set further includes: performing forward computation on the representative samples, extracting intermediate layer feature vectors as the initial content of the probe set, and assigning a version number to the public probe set; the step of obtaining a consistency score further includes: calculating the cosine distance or KL divergence between the local client output and the baseline features of the probe set, and obtaining a consistency score.
[0012] According to at least one specific embodiment of the present application, the step of receiving compressed and encoded knowledge data uploaded by a local client through a central server, wherein the compression and encoding method of the knowledge data is dynamically determined based on the current network bandwidth, calculating a consistency score between the local client output and the public probe set, performing weighted fusion on the knowledge data uploaded by the local client based on the consistency score to generate dual-form aggregated knowledge, and down-weighting or rejecting knowledge data uploaded by the local client with a consistency score below a threshold, further includes: the local client performing local training during a window period to acquire corresponding knowledge data, wherein the knowledge data includes soft... Logits, bounding box distribution summaries, or feature prototypes are obtained; the current network bandwidth is acquired, and the compression encoding method is dynamically determined based on the current network bandwidth, and uploaded to the central server; after receiving the knowledge data uploaded by each local client, the central server extracts the feature vectors contained in the knowledge data, compares them with the benchmark feature vectors of the corresponding samples in the public probe set, and calculates the cosine distance or KL divergence as a consistency score; based on the consistency score, the fusion weight of each local client is determined, the higher the consistency score, the greater the fusion weight, and knowledge data with a consistency score lower than a preset threshold is directly removed from the fusion; the weighted softlogits are weighted and averaged to generate soft-label aggregated knowledge, and the weighted feature prototypes are aggregated according to weight to generate feature prototype aggregated knowledge, which is combined into dual-form aggregated knowledge.
[0013] According to at least one specific implementation of the embodiments of this application, the step of dynamically determining the compression encoding method based on the current network bandwidth and uploading it to the central server further includes: using INT8 quantization encoding when the network bandwidth is higher than a preset high bandwidth threshold, and using a combination of Top-K sparse encoding and differential encoding when the network bandwidth is lower than a preset low bandwidth threshold, encapsulating the compressed knowledge data into a data packet, adding a probe set version number and a timestamp, and uploading it to the central server.
[0014] According to at least one specific embodiment of the present application, the step of distributing the dual-morphology aggregated knowledge to local clients via a central server, and having the local clients perform local distillation updates during a window period when the inference load is below a set threshold, further includes: the central server selecting to distribute soft-tag aggregated knowledge and / or feature prototype aggregated knowledge based on the device profile of each local client; after receiving the dual-morphology aggregated knowledge, the local clients, during a window period when the inference load is below a set threshold, use the dual-morphology aggregated knowledge as the distillation target and calculate the corresponding distillation loss; before performing local distillation updates, the local clients obtain the current inference latency and queue length and calculate the current inference load, and adopt the corresponding distillation method according to the different inference load latency; during the distillation process, the changes in inference load are monitored in real time, and when the inference load exceeds the interruption threshold, the distillation process is immediately interrupted and the current model state is saved.
[0015] According to at least one specific embodiment of the present application, the distillation loss further includes: KL divergence loss between output layer logits and mean squared error loss between feature layers. During local distillation update, the distillation loss and local supervision loss are superimposed for multi-objective optimization. The step of adopting a corresponding distillation method according to different inference load latency further includes: when the inference latency is lower than a preset low latency threshold and the queue length is lower than a preset low queue threshold, deep distillation is performed with high distillation temperature and high distillation weight; or: when the inference latency is higher than a preset high latency threshold or the queue length is higher than a preset high queue threshold, light distillation is performed with low distillation temperature and low distillation weight, and the training rounds of a single distillation are shortened. The step of generating candidate version models and performing canary release or rollback operations is further described. Further, it includes: after the local client completes the local distillation update, it generates a candidate version model, runs the candidate version model and the current production version model in parallel in shadow mode, and compares the consistency of the output feature distribution of the candidate version model and the current production version model on the common probe set; when the consistency score of the candidate version model is higher than that of the current production version model and the inference latency does not exceed the preset tolerance range of the current production version model, the central server issues a gray-scale release instruction to the local client, and gradually switches traffic to the candidate version model according to a preset ratio, or: when the consistency score of the candidate version model is lower than that of the current production version model or the inference latency exceeds the preset tolerance range, it triggers automatic rollback, deletes the candidate version model and restores the current production version model, and reports abnormal diagnostic information to the central server.
[0016] According to another aspect of the embodiments of this application, a knowledge distillation-based collaborative training system for heterogeneous local models is provided, used to implement the knowledge distillation-based collaborative training method for heterogeneous local models, comprising: a consistency score generation module, which acquires device resource status parameters of system hardware based on a local client, constructs a device profile of the local client, and allocates heterogeneous local detection models to the local client according to the device profile; a central server pre-constructs a common probe set and receives feature vectors from the local client, the common probe set being used to perform consistency evaluation on the output features of the local client to obtain a consistency score; and a knowledge data weighted fusion module, which receives compressed and encoded knowledge data uploaded by the local client through a central server, the compression and encoding method of the knowledge data being based on... The current network bandwidth is dynamically determined. A consistency score is calculated between the local client output and the public probe set. Based on the consistency score, the knowledge data uploaded by the local client is weighted and fused to generate dual-form aggregated knowledge. Knowledge data uploaded by local clients with a consistency score below a threshold is downweighted or rejected. The canary release / rollback operation processing module distributes the dual-form aggregated knowledge to the local client through the central server. The local client performs local distillation updates during a window period when the inference load is below a set threshold. During the local distillation update, the distillation temperature and distillation weight are dynamically adjusted according to the current inference latency and queue length of the local client. The distillation loss and local supervision loss are superimposed for multi-objective optimization to generate candidate version models and perform canary release or rollback operations.
[0017] According to another aspect of the embodiments of this application, an electronic device is provided, including: a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of the method.
[0018] According to another aspect of the embodiments of this application, a computer-readable storage medium is provided that stores a computer program executable by an electronic device, which, when run on the electronic device, causes the electronic device to perform the steps of the method.
[0019] The beneficial technical effects of the embodiments of this application are: The collaborative training method provided in this application allows each workstation to retain the detection model best suited to its own working conditions. Instead of directly averaging model parameters during collaborative training, it integrates and shares knowledge from multiple parties through a distillation mechanism, thereby improving cross-workstation collaborative performance. Furthermore, this application introduces a feature-level common probe set as an alignment benchmark to enhance the robustness of heterogeneous model fusion. It also employs adaptive communication compression and load gating strategies to minimize the impact of the training process on online production inference.
[0020] This application's embodiments support heterogeneous models working collaboratively within the same framework, allowing each workstation to improve together without requiring a unified model structure, thus accommodating the differentiated needs of different workstations for real-time performance and detection accuracy. By introducing a set of feature-level common probes as a unified alignment benchmark, the negative migration risk and convergence fluctuations caused by non-independent and identically distributed data are effectively reduced, improving the stability of the fusion process.
[0021] This application employs an adaptive compression and gated upload mechanism, which can adapt to cross-network segment intranet environments and bandwidth fluctuations, reducing the interference of collaborative training on production tasks. The adaptive compression and gated upload mechanism is compatible with both object detection and image segmentation tasks, facilitating expansion and reuse within the same production line. It is suitable for multi-station detection production lines with various configurations, such as roll-to-roll, roll-to-film, and film-to-film. Attached Figure Description
[0022] To more clearly illustrate the technical solutions in the specific implementation methods or related technologies of this application, the accompanying drawings used in the description of the specific implementation methods or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are only some implementation methods of the embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0023] Figure 1 This is a flowchart of a knowledge distillation-based collaborative training method for heterogeneous local models.
[0024] Figure 2 This is a flowchart of the optimization technical solutions provided in steps S11 to S13.
[0025] Figure 3 This is a flowchart of the optimization technical solutions provided in steps S21 to S23.
[0026] Figure 4 This is a flowchart of the optimization technical solutions provided in steps S31 to S33.
[0027] Figure 5 This is an architecture diagram of a knowledge distillation-based collaborative training system for heterogeneous local models.
[0028] Figure 6 This is a schematic diagram of the electronic device. Detailed Implementation
[0029] To enable those skilled in the art to better understand the embodiments of this application, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the implementation methods of the embodiments of this application, and not all of the implementation methods. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the protection scope of the embodiments of this application.
[0030] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of the embodiments of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of the present application described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to these processes, methods, products, or devices.
[0031] This application belongs to the fields of federated learning, heterogeneous client collaborative training, and knowledge distillation technology, and its main application scenario is industrial visual defect detection. In the application scenario of industrial visual defect detection, different workstations can choose different model structures, input resolutions, or detection head configurations according to their own needs. To solve the problem of collaborative training in this application scenario, this application uses a collaborative mechanism of feature-level common probe set, central server distillation aggregation, and local distillation update to achieve the technical effects of cross-workstation knowledge sharing, stable convergence, and improved communication efficiency. The collaborative mechanism of this application is compatible with both object detection and image segmentation tasks, and can be applied to various types of industrial production lines such as roll-to-roll, roll-to-sheet, and sheet-to-sheet.
[0032] The following technical prerequisites and constraints apply to the specific implementation of this application: Each workstation can obtain multiple operational metrics in real time through the system or hardware programming interface, including graphics processor model, video memory capacity, inference latency, task queue length, processing frame rate, operating temperature, power consumption, and current network bandwidth.
[0033] During operation, the central server only saves and manages the feature representation information extracted from the data, and does not retain the original image data. The teacher signals generated by the system can be distributed in both soft label and feature prototype forms.
[0034] The communication environment is usually an internal factory network, and there may be communication scenarios between different network segments.
[0035] When implementing the embodiments of this application in application scenarios, the specific task form can be determined according to the actual needs of the production line, supporting target detection, image segmentation, or a hybrid deployment of both. In addition to roll-to-roll production lines, it is also applicable to roll-to-film and film-to-film production line forms.
[0036] Definitions: Federated learning: A distributed machine learning framework that allows multiple clients to collaboratively train a global model by exchanging model updates or knowledge without exchanging the original data.
[0037] Knowledge distillation: A model training technique that achieves high performance while maintaining lightweight design by having a smaller “student model” mimic the output behavior of a larger “teacher model”.
[0038] Feature-level common probe set: A set of standardized feature vectors maintained by a central server, serving as a unified alignment benchmark between different client models, used to evaluate and calibrate the semantic consistency of the outputs of each model.
[0039] Soft labels: Compared to the hard labels of related technologies, which are either right or wrong, soft labels contain probability distribution information of the model for each category (e.g., A-0.7, B-0.2, C-0.1), and contain more information.
[0040] Feature prototype: A high-dimensional vector extracted from the intermediate layer of the model, which can represent the typical features of a certain type of sample and is mainly used for cross-model feature alignment and knowledge transfer.
[0041] R2R (Roll to Roll): refers to a continuous production method in which materials are released from one roll, processed or inspected, and then wound up onto another roll. It is suitable for flexible materials such as films and copper foils.
[0042] R2P (Roll to Piece): This refers to a production method where the input material is in roll form, and after processing or testing, it is cut into individual pieces for output. It is commonly used in the manufacturing of solar panels, die-cut parts, etc.
[0043] P2P (sheet-to-sheet): refers to a production method where both input and output are single sheet materials. The materials are usually rigid or semi-rigid (such as glass panels or circuit boards), and a stepping intermittent motion is used.
[0044] like Figure 1The knowledge distillation-based collaborative training method for heterogeneous local models shown includes: Step S1: Based on the device resource status parameters of the system hardware obtained by the local client, a device profile of the local client is constructed. The local client allocates heterogeneous local detection models according to the device profile. A public probe set is pre-constructed through the central server, and the feature vector of the local client is received. The public probe set is used to evaluate the consistency of the output features of the local client and obtain a consistency score.
[0045] In step S1, the central server receives the feature vectors from the local client. This can be a feature vector distribution, which is the feature vector output by the local client after performing forward computation on the samples in the probe set. The public probe provides a unified feature space reference for the local client, used to quantitatively evaluate the alignment of the client's output features. Each feature vector in the feature space reference corresponds to the intermediate layer output of a representative sample, such as the penultimate layer of ResNet, the feature layer of the detection head, etc.
[0046] Forward computation is the basic computational process of deep learning models. Input data is fed into the model through forward computation, and the model performs calculations layer by layer to finally obtain the output result.
[0047] Device profiles are collected through system or hardware APIs. The purpose of a device profile is to describe a set of characteristic data about the hardware resources and runtime status of a local client (workstation).
[0048] Step S2 involves receiving compressed and encoded knowledge data uploaded by local clients through a central server. The compression and encoding method of the knowledge data is dynamically determined based on the current network bandwidth. A consistency score is calculated between the local client's output and the public probe set. Based on the consistency score, the knowledge data uploaded by local clients is weighted and fused to generate dual-form aggregated knowledge. Knowledge data uploaded by local clients with a consistency score below a threshold is downweighted or rejected. In this step, the knowledge data, after weighted fusion, is generated and distributed to the local client as a knowledge carrier. The weighted and fused knowledge data contains two different forms of knowledge representation: soft labels / predicted distribution and feature prototypes / aggregated features.
[0049] Step S3: The dual-mode aggregated knowledge is sent from the central server to the local client. The local client performs local distillation update during the window period when the inference load is lower than the set threshold. When performing local distillation update, the distillation temperature and distillation weight are dynamically adjusted according to the current inference latency and queue length of the local client. The distillation loss and local supervision loss are superimposed to perform multi-objective optimization, generate candidate version models, and perform canary release or rollback operations.
[0050] In step S3, inference load refers to the level of busyness of the production inference tasks currently undertaken by the local client (workstation).
[0051] Local distillation refers to the following: Local clients receive aggregated knowledge (teacher signals) from the central server, use it as a learning target, and guide the local model to update through distillation loss without changing their own model structure. This allows them to absorb collaborative knowledge from across workstations, forming a multi-workstation collaborative mode. Each workstation uploads its local knowledge to the central server, which then merges and distributes it to all workstations. Each workstation absorbs knowledge from other workstations to improve itself while maintaining its own model structure.
[0052] The technical solutions provided in steps S1 to S3 start with the equipment profile to build a heterogeneous model deployment foundation, then achieve cross-model semantic alignment through a common probe set, and finally complete knowledge fusion and local distillation update with dual-form aggregated knowledge as the carrier, realizing collaborative knowledge transfer between multiple workstations while maintaining the independence of the model structure of each workstation.
[0053] Step S1 constructs a device profile by collecting hardware resources and operating status data from each workstation, and assigns a heterogeneous detection model adapted to its computing power constraints to each workstation. The central server pre-builds a common probe set, receives the forward computation results of probe samples from each workstation, and forms a unified feature space reference. The purpose of step S1 is to establish a measurable semantic alignment benchmark between heterogeneous models, providing a consistency evaluation basis for subsequent knowledge fusion.
[0054] Step S2 receives compressed and encoded knowledge data uploaded from each workstation via a central server, dynamically adjusts the compression method based on the current network bandwidth, calculates the consistency score between the output of each workstation and the common probe set, and performs weighted fusion of the knowledge data based on the score to generate dual-form aggregated knowledge containing soft tags and feature prototypes. The purpose of step S2 is to: filter reliable knowledge sources through consistency scores, generate high-quality teacher signals using weighted fusion, and avoid the negative impact of low-quality or biased knowledge on collaborative training.
[0055] In step S3, the dual-mode aggregated knowledge is distributed to each workstation via the central server. During the window period when the inference load is below the threshold, each workstation performs local distillation updates. The distillation temperature and weights are dynamically adjusted based on the current inference latency and queue length. The distillation loss is combined with the local supervision loss for optimization, ultimately generating a candidate version model and performing canary release or rollback. The purpose of step S3 is to allow each workstation to absorb the fused cross-workstation knowledge without interfering with production inference, while retaining the characteristics of the local data.
[0056] As can be seen, step S1 establishes the alignment benchmark, step S2 completes knowledge fusion and filtering, and step S3 achieves local absorption and version update. Step S1 establishes the alignment benchmark through equipment profiling and heterogeneous model allocation mechanism, so that each workstation can participate in collaborative training without a unified model structure. Step S2, through knowledge fusion and filtering, makes dual-form aggregated knowledge (soft label + feature prototype) independent of the specific network architecture, which can be received by any model and used for distillation update. Step S3's local distillation completes knowledge absorption without changing the model structure, realizing local absorption and version update. The three steps work together to realize the entire process of knowledge distillation-style collaborative training method from alignment evaluation to fusion generation and then to local digestion. This allows lightweight models and high-precision models to improve collaboratively under the same framework, taking into account the real-time and accuracy requirements of different workstations. It not only realizes cross-workstation knowledge sharing but also prevents negative transfer and improves the stability of training convergence.
[0057] Furthermore, the common probe set constructed in step S1 provides a unified feature space reference for each workstation. Step S2 calculates a consistency score based on the probe set, downweighting or rejecting knowledge from workstations with excessive deviations to ensure that only semantically aligned knowledge enters the fusion process. Step S3's local distillation absorbs fused knowledge while simultaneously adding local supervision loss to prevent the model from being biased by external knowledge. These three steps, working in synergy, achieve cross-workstation knowledge sharing, prevent negative transfer, and improve the stability of training convergence. This allows collaborative training to be completed without interfering with normal production line operations, adapting to industrial environments with cross-network segments and bandwidth fluctuations. It is not dependent on specific material transmission methods and is therefore applicable to various production line configurations, exhibiting good scalability and reusability.
[0058] like Figure 2 As shown, preferably, in step S1, the local client constructs a device profile by acquiring device resource status parameters of the system hardware, and the local client allocates heterogeneous local detection models according to the device profile; a public probe set is pre-constructed by the central server, and the feature vector output by the local client after performing forward computation on the public probe set is received. The public probe set is used to evaluate the consistency of the output features of the local client, further including: Step S11, the process of constructing the device profile includes: periodically collecting GPU model, video memory capacity, inference latency, and current network bandwidth through the system hardware API called by the local client to construct the device profile of the local client. The device profile includes: hardware computing power specifications, memory resource capacity, real-time response performance, and communication link status. In other words, the device profile refers to a set of characteristic data used to describe the hardware resources and runtime status of the local client (workstation).
[0059] Step S12: Based on the hardware computing power specifications and memory resource capacity in the device profile, match heterogeneous local detection models for the local client from the preset model library. Based on the real-time response performance and communication link status in the device profile, determine the compression rate of knowledge data upload and set the inference load threshold and distillation update trigger conditions.
[0060] Step S13: Collect feature vectors of representative samples from local clients through the central server. The representative samples cover different defect types, lighting conditions and material categories. Assign version numbers to the public probe set. Periodically receive the feature vectors output by the local client after performing forward calculation on the current version of the probe set to obtain a consistency score. When the global consistency score drops by more than a preset range, update the probe set version, reselect representative samples and extract feature vectors.
[0061] As an example, in step S13, assigning a version number to the public probe set further includes: performing forward computation on the representative samples to extract intermediate layer feature vectors as the initial content of the probe set, and assigning a version number to the public probe set. Obtaining the consistency score further includes: calculating the cosine distance or KL divergence between the local client output and the baseline features of the probe set to obtain the consistency score.
[0062] The optimization solutions provided in steps S11 to S13 construct equipment profiles based on periodically collected equipment operation indicators. Model adaptation and training strategy configuration are then completed according to the static specifications and dynamic states within the profiles. Simultaneously, versioned management and consistency monitoring of the probe set provide a continuous and reliable alignment benchmark for subsequent knowledge fusion. Step S11 involves periodically calling the system hardware API through the local client to collect metrics such as GPU model, video memory capacity, inference latency, and network bandwidth. These metrics are then integrated into a device profile, which includes at least four dimensions: hardware computing power specifications, memory resource capacity, real-time response performance, and communication link status. This process quantifies the static capabilities and dynamic loads of heterogeneous devices into structured data, providing an objective basis for subsequent differentiated configurations.
[0063] Step S12, based on the device profile provided in step S11, uses the hardware computing power specifications and memory resource capacity in the device profile as a basis to match the most suitable heterogeneous detection model for each local client from the preset model library, taking into account its computing power constraints. Based on real-time response performance and communication link status, it determines the compression rate for knowledge data upload and sets the inference load threshold and distillation update trigger conditions. It can be seen that step S12, through its collaboration with step S11, transforms the device profile into an executable operation strategy, achieving automatic adaptation of computing power, bandwidth, and load. This allows local clients with high computing power to adapt to high-precision models, local clients with low bandwidth to adapt to high compression rates, and local clients with high loads to adapt to delayed distillation.
[0064] In step S13, the central server collects representative sample feature vectors covering different defect types, lighting conditions, and material categories from local clients, assigns version numbers to the probe set, and periodically receives the feature vectors output by each client after forward computation of the current version of the probe set. A consistency score is obtained by calculating the cosine distance or KL divergence. When the global consistency score decreases by more than a preset margin, a probe set version update is triggered, representative samples are reselected, and feature vectors are extracted. The purpose of step S13 is to ensure that the probe set always reflects the semantic distribution state of the current client models, avoiding alignment benchmark failure due to data distribution drift or model evolution.
[0065] As can be seen, step S11 is responsible for collecting the device status, step S12 generates the adaptation strategy based on the collected status in step S11, and step S13 is used to maintain the timeliness of the probe set. Steps S11 and S12 provide operation parameters for knowledge uploading and distillation updates in subsequent steps. The operation parameters include key information such as the knowledge uploading subject, the uploading content, and the uploading time limit. Step S13 provides a measurement standard for subsequent consistency scoring. The three steps work together to realize the initialization and continuous calibration mechanism of collaborative training.
[0066] like Figure 3 As shown, preferably, in step S2, the process of receiving compressed and encoded knowledge data uploaded by local clients through a central server, wherein the compression and encoding method of the knowledge data is dynamically determined based on the current network bandwidth, calculating a consistency score between the local client output and the public probe set, weighting and fusing the knowledge data uploaded by local clients based on the consistency score to generate dual-form aggregated knowledge, and downweighting or rejecting knowledge data uploaded by local clients with consistency scores below a threshold, further includes: Step S21: During the off-peak period, the local client performs local training to acquire corresponding knowledge data, including soft logits, bounding box distribution summaries, or feature prototypes. It also acquires the current network bandwidth, dynamically determines the compression encoding method based on the current network bandwidth, and uploads the data to the central server. For example, dynamically determining the compression encoding method based on the current network bandwidth and uploading it to the central server further includes: using INT8 quantization encoding when the network bandwidth is higher than a preset high bandwidth threshold, and using a combination of Top-K sparse encoding and differential encoding when the network bandwidth is lower than a preset low bandwidth threshold. The compressed knowledge data is then encapsulated into a data packet, a probe set version number and a timestamp are added, and the packet is uploaded to the central server.
[0067] In step S22, after the central server receives the knowledge data uploaded by each local client, it extracts the feature vector contained in the knowledge data, compares it with the benchmark feature vector of the corresponding sample in the public probe set, and calculates the cosine distance or KL divergence as a consistency score.
[0068] Step S23: Determine the fusion weight of each local client based on the consistency score. The higher the consistency score, the greater the fusion weight. Knowledge data with a consistency score lower than a preset threshold are directly removed and do not participate in the fusion. The weighted soft logits are weighted and averaged to generate soft tag aggregated knowledge. The weighted feature prototypes are aggregated according to their weights to generate feature prototype aggregated knowledge. The two are combined into dual-form aggregated knowledge.
[0069] In the optimization solutions provided in steps S21 to S23, the local client generates knowledge data during the window period, dynamically selects the compression encoding method based on the current network bandwidth, and then uploads it to the central server. The central server calculates a consistency score through a set of public probes, and uses this score to perform differentiated weighted fusion of the knowledge data from each client, generating dual-form aggregated knowledge for subsequent distillation. In step S21, the compression encoding method is dynamically determined based on the current network bandwidth. If step S21 does not employ a dynamic compression mechanism, uploading large data packets under low bandwidth conditions will result in timeouts or transmission failures, while under high bandwidth conditions, it will lead to over-compression and wasted information capacity. Furthermore, without a version number and timestamp, the central server will be unable to determine which version of the probe set the received knowledge data corresponds to, leading to a mismatch in the baseline. Step S21 ensures the reliable arrival of the knowledge data, providing a basis for the subsequent evaluation and fusion operations in steps S22 and S23.
[0070] Step S22 quantifies the alignment of the client's uploaded knowledge with respect to the public probe set into a consistency score by calculating the cosine distance or KL divergence. The consistency score reflects whether the client's current model has undergone semantic shift. Without step S22, the central server can only treat all clients equally and cannot identify clients that have shifted, thus compromising the fusion quality.
[0071] Step S23 determines the fusion weight of each client based on the consistency score; the higher the score, the greater the weight, and scores below the threshold are directly ignored. This mechanism ensures that only semantically aligned reliable knowledge enters the fusion process, while offset knowledge is automatically excluded. Weighted soft logits are averaged according to their weights to generate soft-label aggregated knowledge, and weighted feature prototypes are aggregated according to their weights to generate feature prototype aggregated knowledge, combining them into dual-form aggregated knowledge. The score threshold elimination mechanism in step S23 is crucial. Without it, low-scoring knowledge would still participate in the fusion, potentially propagating the offset semantics to other clients and causing negative transfer. Without weighted averaging and aggregation operations, it would be impossible to integrate multi-client knowledge into a unified teacher signal.
[0072] like Figure 4 As shown, preferably, in step S3, the dual-morphology aggregated knowledge is distributed from the central server to the local client, and the local client performs local distillation updates during a window period when the inference load is below a set threshold. During the local distillation update, the distillation temperature and distillation weight are dynamically adjusted based on the current inference latency and queue length of the local client. The distillation loss and local supervision loss are superimposed for multi-objective optimization to generate candidate version models and perform canary release or rollback operations. This further includes: In step S31, the central server selects and distributes soft tag aggregation knowledge and / or feature prototype aggregation knowledge according to the device profile of each local client. After receiving the dual-mode aggregation knowledge, the local client uses the dual-mode aggregation knowledge as the distillation target and calculates the corresponding distillation loss during the window period when the inference load is lower than the set threshold.
[0073] In step S32, before performing local distillation update, the local client obtains the current inference latency and queue length and calculates the current inference load, and adopts the corresponding distillation method according to the different inference load latency.
[0074] Step S33: During the distillation process, the inference load changes are monitored in real time. When the inference load exceeds the interruption threshold, the distillation process is immediately interrupted and the current model state is saved. Although the distillation process is interrupted in this step, it can be resumed after the load decreases.
[0075] The optimization solutions provided in steps S31 to S33 can be summarized as follows: The central server distributes corresponding aggregated knowledge based on the differences in the device profiles of each local client. During the window period when the inference load is below the threshold, the local client updates with dual-form aggregated knowledge as the distillation target, and dynamically adjusts the distillation intensity and interruption strategy according to the real-time inference load to achieve collaborative knowledge absorption under production priority constraints. Step S31 distributes only the feature prototype aggregated knowledge (with low computational cost and good feature layer alignment) to clients sensitive to real-time response. For clients prioritizing accuracy, a combination of the two aggregated knowledge types is distributed, as this combination provides richer information and is suitable for clients optimizing for accuracy. Without the differentiated distribution mechanism in step S31, all clients would receive the same teacher signal. Clients with weak computing power might receive too much soft-label knowledge, leading to excessive computational load during the distillation process and impacting production inference.
[0076] Step S32 calculates the inference load based on the current inference latency and queue length, and dynamically adjusts the distillation temperature and weight accordingly: when the load is light, a high-temperature, high-weight deep distillation is used; when the load is heavy, a low-temperature, low-weight light distillation is switched. In other words, step S32 provides a load-aware intensity adjustment mechanism, ensuring that distillation operations always give way to production inference. If step S32 did not provide a load-aware intensity adjustment mechanism, even if step S31 selected a time when the load was below a threshold to start distillation, the distillation intensity would remain constant during load fluctuations, and high-intensity distillation would continuously preempt resources when the load increases.
[0077] Step S33 monitors the inference load in real time during distillation. When the load exceeds the interruption threshold, it immediately interrupts the process and saves the current model state. Distillation resumes from the interruption point after the load decreases. It can be seen that step S33 and step S32 form a two-level protection mechanism: step S32 adjusts the intensity to adapt to load fluctuations. If the load increases sharply, but the adjustment intensity is still insufficient to avoid production interference, step S33 can provide a fallback mechanism for forced interruption. Without step S33, when the load increases sharply, even if S32 has reduced the distillation intensity to a minimum, it may still impact production inference, and all completed distillation calculations will be invalidated.
[0078] In summary, steps S31 to S33 work together to form a complete distillation control system: step S31 is responsible for start-up control (when to start and what to learn), S32 is responsible for intensity control (at what intensity to learn), and S33 is responsible for safety control (when to stop and how to resume). These three steps respectively enable the normal start-up of the distillation process, the distillation intensity to adapt to load fluctuations, and the prevention of potential damage to production inference under extreme load conditions. This provides a technical foundation for the local client to safely and efficiently absorb dual-mode aggregated knowledge and also provides reliable technical support for cross-workstation collaborative knowledge transfer.
[0079] As a further optimization, in step S31, the distillation loss further includes: KL divergence loss between output layer logits and mean square error loss between feature layers. During the local distillation update process, the distillation loss and the local supervision loss are superimposed for multi-objective optimization. The method of employing corresponding distillation methods based on different inference load latency further includes: when the inference latency is lower than a preset low latency threshold and the queue length is lower than a preset low queue threshold, performing deep distillation with a high distillation temperature and a high distillation weight, or: When the inference latency exceeds the preset high latency threshold or the queue length exceeds the preset high queue threshold, a light distillation is performed using a low distillation temperature and a low distillation weight, and the training rounds for a single distillation are shortened.
[0080] The process of generating candidate version models and performing canary releases or rollbacks further includes: After the local client completes the local distillation update, it generates a candidate version model. The candidate version model and the current production version model are run in parallel in shadow mode. The consistency of the output feature distribution of the candidate version model and the current production version model on the common probe set is compared. When the consistency score of the candidate version model is higher than that of the current production version model and the inference latency does not exceed the preset tolerance range of the current production version model, a canary release instruction is issued from the central server to the local client, gradually switching traffic to the candidate version model according to a preset ratio, or: When the consistency score of the candidate version model is lower than that of the current production version model or the inference latency exceeds the preset tolerance range, an automatic rollback is triggered, the candidate version model is deleted and the current production version model is restored, and abnormal diagnostic information is reported to the central server.
[0081] As a further optimization of step S31, three key aspects were deepened and refined, involving the composition of distillation loss, the grading strategy for distillation intensity, and the acceptance and release mechanism for candidate model versions. This involves improving the quality of knowledge absorption through multi-objective optimization of distillation loss design, achieving fine-grained control of distillation intensity through a grading threshold strategy, and ensuring the safety and reliability of model updates through shadow mode and comparative verification mechanisms. The optimizations in these three key aspects can be summarized as follows: A balance between knowledge absorption quality and local characteristics is achieved through multi-objective optimization: KL divergence loss ensures that the predicted distribution of the local model converges with the teacher signal, mean squared error loss ensures that the intermediate feature representations are semantically aligned with the teacher signal, and local supervision loss prevents the model from overfitting the teacher signal and forgetting the unique distribution of the local data.
[0082] A tiered threshold strategy enables refined and predictable control of distillation intensity: the distillation mode is divided into two distinct levels: deep distillation and light distillation. Compared with continuous dynamic adjustment, the tiered strategy exhibits more predictable behavior, is simpler to implement in engineering, and covers both idle and busy operating conditions, complementing each other: deep distillation learns fully under extremely light loads, while light distillation conservatively updates under heavier loads.
[0083] A three-tiered acceptance mechanism ensures secure and controllable model updates: The optimized solution establishes a three-tiered acceptance mechanism encompassing model evaluation, canary release, and automatic rollback. In shadow mode, the old and new models run in parallel, comparing their consistency scores on a common probe set without impacting production, achieving low-risk pre-validation. Canary releases gradually switch traffic according to a preset ratio, ensuring that even if problems occur, only a small portion of traffic is affected, achieving a controllable, gradual deployment. Automatic rollback immediately recovers upon detecting degradation and reports anomaly diagnostic information, enabling rapid fault self-healing and preventing degraded models from directly entering production mode and affecting all traffic, forming a complete quality closed loop of training-validation-release.
[0084] Observability and traceability are achieved through an anomaly reporting mechanism: when an automatic rollback is triggered, the local client reports anomaly diagnosis information to the central server, enabling the central server to grasp the failure status of model updates at each workstation, which facilitates the operation and maintenance personnel to analyze the cause and adjust the distillation strategy or trigger probe set updates accordingly.
[0085] like Figure 5 As shown, this application provides a knowledge distillation-based collaborative training system for heterogeneous local models, used to implement the knowledge distillation-based collaborative training method for heterogeneous local models described in any specific embodiment of this application, including: The consistency score generation module constructs a device profile for the local client by acquiring device resource status parameters of the system hardware. The local client then allocates heterogeneous local detection models based on the device profile. A public probe set is pre-constructed by the central server, and feature vectors from the local client are received. The public probe set is used to evaluate the consistency of the output features of the local client to obtain a consistency score.
[0086] The knowledge data weighted fusion module receives compressed and encoded knowledge data uploaded by local clients through a central server. The compression and encoding method of the knowledge data is dynamically determined based on the current network bandwidth. It calculates the consistency score between the local client output and the public probe set, and performs weighted fusion on the knowledge data uploaded by local clients based on the consistency score to generate dual-form aggregated knowledge. Knowledge data uploaded by local clients with a consistency score below the threshold is downweighted or rejected.
[0087] The canary release / rollback operation processing module distributes the dual-mode aggregated knowledge to the local client through the central server. The local client performs local distillation updates during the window period when the inference load is lower than the set threshold. When performing local distillation updates, the distillation temperature and distillation weight are dynamically adjusted according to the current inference latency and queue length of the local client. The distillation loss and local supervision loss are superimposed to perform multi-objective optimization, generate candidate version models, and perform canary release or rollback operations.
[0088] Any flowchart or other description of a process or method can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing a particular logical function or process. Furthermore, the scope of preferred embodiments of the invention includes additional implementations in which functions may be performed and implemented not in the order shown or discussed, including substantially simultaneously or in reverse order according to the functions involved, or in accordance with program structures such as loops, branches, etc., as will be readily understood by those skilled in the art when implementing the embodiments of this application.
[0089] like Figure 6 As shown, this application embodiment, in addition to providing a knowledge distillation-based collaborative training method and system for heterogeneous local models, also provides corresponding electronic devices and storage media: An electronic device includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus; the memory stores a computer program, which, when executed by the processor, causes the processor to perform the steps of a knowledge distillation-based collaborative training method for heterogeneous local models.
[0090] A computer-readable storage medium storing a computer program executable by an electronic device, which, when run on the electronic device, causes the electronic device to perform the steps of a knowledge distillation-based collaborative training method for heterogeneous local models.
[0091] Figure 6 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Figure 6 As shown, device 800 includes a processor 801, a memory 802, a communication interface 803, and a bus 804. The processor 801, memory 802, and communication interface 803 communicate via bus 804, or via other means such as wireless transmission. The memory 802 stores instructions, and the processor 801 executes the instructions stored in the memory 802. The memory 802 stores program code 8021, and the processor 801 can call the program code 8021 stored in the memory 802 to execute the steps of the knowledge distillation-based collaborative training method for heterogeneous local models.
[0092] It should be understood that in the embodiments of this application, processor 801 may be a CPU, or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. General-purpose processors may be microprocessors or any conventional processors, etc.
[0093] The memory 802 may include read-only memory (ROM) and random access memory (RAM), and provides instructions and data to the processor 801. The memory 802 may also include non-volatile random access memory. The memory 802 may be volatile memory or non-volatile memory, or may include both. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory may be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM).
[0094] In addition to the data bus, bus 804 may also include a power bus, a control bus, and a status signal bus. However, for clarity, all buses are labeled as bus 804 in the diagram.
[0095] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded or executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more sets of available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium. A semiconductor medium can be a solid-state drive (SSD).
[0096] 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 the specification of the embodiments of this application.
[0097] In the description of the embodiments of this application, the reference to terms such as "an embodiment," "example," "specific example," etc., means that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the embodiments of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0098] Furthermore, the technical solutions of the various implementation methods in this application can be combined with each other, but only if they are based on the ability of those skilled in the art to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such combination of technical solutions does not exist and is not within the scope of protection claimed by the embodiments of this application.
[0099] All features disclosed in the embodiments of this application, or all steps in the disclosed methods or processes, may be combined in any way, except for mutually exclusive features and / or steps. Any feature disclosed in the specification of the embodiments of this application, unless specifically stated otherwise, may be replaced by other equivalent or similar alternative features. That is, unless specifically stated otherwise, each feature is merely one example of a series of equivalent or similar features. Throughout the specification, the same reference numerals indicate the same elements.
[0100] Those skilled in the art will understand that modules in the device of the embodiments can be adaptively changed and placed in one or more devices different from that embodiment. Modules, units, or components in the embodiments can be combined into a single module, unit, or component, and further, they can be divided into multiple sub-modules, sub-units, or sub-components. Except where at least some of such features and / or processes or units are mutually exclusive, any combination can be used to combine all features disclosed in this specification of embodiments (including the corresponding claims, abstract, and drawings) and all processes or units of any method or device so disclosed. Unless expressly stated otherwise, each feature disclosed in this specification of embodiments (including the corresponding claims, abstract, and drawings) may be replaced by an alternative feature that serves the same, equivalent, or similar purpose.
[0101] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the embodiments of this application, and are not intended to limit them. Although the embodiments of this application have been described in detail with reference to the foregoing specific embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing specific embodiments, or equivalent substitutions can be made to some or all of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions provided by the specific embodiments of this application.
Claims
1. A knowledge distillation-based collaborative training method for heterogeneous local models, characterized in that, include: Based on the device resource status parameters of the system hardware obtained by the local client, a device profile of the local client is constructed. The local client allocates heterogeneous local detection models according to the device profile. A public probe set is pre-constructed by the central server and the feature vectors of the local client are received. The public probe set is used to evaluate the consistency of the output features of the local client and obtain a consistency score. The central server receives compressed and encoded knowledge data uploaded by local clients. The compression and encoding method of the knowledge data is dynamically determined according to the current network bandwidth. The consistency score between the local client output and the public probe set is calculated. Based on the consistency score, the knowledge data uploaded by local clients is weighted and fused to generate dual-form aggregated knowledge. Knowledge data uploaded by local clients with a consistency score below the threshold is downweighted or rejected. The dual-mode aggregated knowledge is distributed from the central server to the local client. The local client performs local distillation updates during the window period when the inference load is below a set threshold. When performing local distillation updates, the distillation temperature and distillation weight are dynamically adjusted according to the current inference latency and queue length of the local client. The distillation loss and local supervision loss are superimposed to perform multi-objective optimization, generate candidate version models, and perform canary release or rollback operations.
2. The knowledge distillation-based collaborative training method for heterogeneous local models according to claim 1, characterized in that, The process involves obtaining device resource status parameters of the system hardware from a local client, constructing a device profile for the local client, and allocating heterogeneous local detection models based on the device profile. A central server pre-constructs a common probe set and receives feature vectors from the local client. This common probe set is used to evaluate the consistency of the output features of the local client to obtain a consistency score. The process further includes: The process of constructing the device profile includes: periodically collecting GPU model, video memory capacity, inference latency, and current network bandwidth by calling the system hardware API through the local client, and constructing the device profile of the local client. The device profile includes: hardware computing power specifications, memory resource capacity, real-time response performance, and communication link status. Based on the hardware computing power specifications and memory resource capacity in the device profile, a heterogeneous local detection model is matched for the local client from the preset model library. Based on the real-time response performance and communication link status in the device profile, the compression rate of knowledge data upload is determined, and the inference load threshold and distillation update trigger conditions are set. The central server collects feature vectors of representative samples from local clients. These representative samples cover different defect types, lighting conditions, and material categories. A version number is assigned to the public probe set. The server periodically receives feature vectors output by the local clients after performing forward calculations on the current version of the probe set to obtain a consistency score. When the global consistency score drops by more than a preset range, the probe set version is updated, and representative samples are reselected and feature vectors are extracted.
3. The knowledge distillation-based collaborative training method for heterogeneous local models according to claim 2, characterized in that, Assigning a version number to the public probe set further includes: performing forward computation on the representative samples, extracting intermediate layer feature vectors as the initial content of the probe set, and assigning a version number to the public probe set; The process of obtaining the consistency score further includes: calculating the cosine distance or KL divergence between the local client output and the baseline features of the probe set to obtain the consistency score.
4. The knowledge distillation-based collaborative training method for heterogeneous local models according to claim 1, characterized in that, The process of receiving compressed and encoded knowledge data uploaded by local clients through a central server, wherein the compression and encoding method of the knowledge data is dynamically determined based on the current network bandwidth, calculating a consistency score between the local client output and the public probe set, weighting and fusing the knowledge data uploaded by local clients based on the consistency score to generate dual-form aggregated knowledge, and downweighting or rejecting knowledge data uploaded by local clients with a consistency score below a threshold, further includes: During the off-peak period, the local client performs local training to obtain corresponding knowledge data, which includes softlogits, bounding box distribution summaries, or feature prototypes; it also obtains the current network bandwidth, dynamically determines the compression encoding method based on the current network bandwidth, and uploads it to the central server. After receiving the knowledge data uploaded by each local client, the central server extracts the feature vector contained in the knowledge data, compares it with the benchmark feature vector of the corresponding sample in the public probe set, and calculates the cosine distance or KL divergence as a consistency score. The fusion weight of each local client is determined based on the consistency score. The higher the consistency score, the greater the fusion weight. Knowledge data with a consistency score lower than a preset threshold is directly removed and does not participate in the fusion. The weighted soft logits are weighted and averaged to generate soft tag aggregated knowledge. The weighted feature prototypes are aggregated according to their weights to generate feature prototype aggregated knowledge. The two are combined into dual-form aggregated knowledge.
5. The knowledge distillation-based collaborative training method for heterogeneous local models according to claim 4, characterized in that, The step of dynamically determining the compression encoding method based on the current network bandwidth and uploading it to the central server further includes: using INT8 quantization encoding when the network bandwidth is higher than a preset high bandwidth threshold, and using a combination of Top-K sparse encoding and differential encoding when the network bandwidth is lower than a preset low bandwidth threshold. The compressed and encoded knowledge data is then encapsulated into a data packet, a probe set version number and a timestamp are added, and the data is uploaded to the central server.
6. The knowledge distillation-based collaborative training method for heterogeneous local models according to claim 1, characterized in that, The process of distributing the dual-morphology aggregated knowledge to local clients via a central server, with local clients performing local distillation updates during a window period when the inference load is below a set threshold, involves dynamically adjusting the distillation temperature and weight based on the current inference latency and queue length of the local client during local distillation updates, superimposing the distillation loss and local supervision loss for multi-objective optimization, generating candidate version models, and performing canary releases or rollback operations. This further includes: Based on the device profiles of each local client, the central server selects and distributes soft tag aggregation knowledge and / or feature prototype aggregation knowledge. After receiving the dual-mode aggregation knowledge, the local client uses the dual-mode aggregation knowledge as the distillation target and calculates the corresponding distillation loss during the window period when the inference load is lower than the set threshold. Before performing local distillation updates, the local client obtains the current inference latency and queue length and calculates the current inference load. Based on the different inference load latencies, the corresponding distillation method is adopted. The inference load changes are monitored in real time during the distillation process. When the inference load exceeds the interruption threshold, the distillation process is immediately interrupted and the current model state is saved.
7. The knowledge distillation-based collaborative training method for heterogeneous local models according to claim 6, characterized in that, The distillation loss further includes: KL divergence loss between output layer logits and mean square error loss between feature layers. During the local distillation update process, the distillation loss and the local supervision loss are superimposed for multi-objective optimization. The method of employing corresponding distillation methods based on different inference load latency further includes: when the inference latency is lower than a preset low latency threshold and the queue length is lower than a preset low queue threshold, performing deep distillation with a high distillation temperature and a high distillation weight, or: When the inference latency exceeds the preset high latency threshold or the queue length exceeds the preset high queue threshold, a light distillation is performed using a low distillation temperature and a low distillation weight, and the training rounds for a single distillation are shortened. The process of generating candidate version models and performing canary releases or rollbacks further includes: After the local client completes the local distillation update, it generates a candidate version model. The candidate version model and the current production version model are run in parallel in shadow mode. The consistency of the output feature distribution of the candidate version model and the current production version model on the common probe set is compared. When the consistency score of the candidate version model is higher than that of the current production version model and the inference latency does not exceed the preset tolerance range of the current production version model, a canary release instruction is issued from the central server to the local client, gradually switching traffic to the candidate version model according to a preset ratio, or: When the consistency score of the candidate version model is lower than that of the current production version model or the inference latency exceeds the preset tolerance range, an automatic rollback is triggered, the candidate version model is deleted and the current production version model is restored, and abnormal diagnostic information is reported to the central server.
8. A knowledge distillation-based collaborative training system for heterogeneous local models, used to implement the knowledge distillation-based collaborative training method for heterogeneous local models according to any one of claims 1 to 7, characterized in that, include: The consistency score generation module obtains device resource status parameters of the system hardware from the local client, constructs a device profile of the local client, and allocates heterogeneous local detection models according to the device profile. The central server pre-constructs a set of public probes and receives feature vectors from the local client. The set of public probes is used to evaluate the consistency of the output features of the local client to obtain a consistency score. The knowledge data weighted fusion module receives compressed and encoded knowledge data uploaded by local clients through a central server. The compression and encoding method of the knowledge data is dynamically determined according to the current network bandwidth. It calculates the consistency score between the local client output and the public probe set, performs weighted fusion on the knowledge data uploaded by local clients based on the consistency score, generates dual-form aggregated knowledge, and downgrades or rejects knowledge data uploaded by local clients with consistency scores below the threshold. The canary release / rollback operation processing module distributes the dual-mode aggregated knowledge to the local client through the central server. The local client performs local distillation updates during the window period when the inference load is lower than the set threshold. When performing local distillation updates, the distillation temperature and distillation weight are dynamically adjusted according to the current inference latency and queue length of the local client. The distillation loss and local supervision loss are superimposed to perform multi-objective optimization, generate candidate version models, and perform canary release or rollback operations.
9. An electronic device, characterized in that, include: The system includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus; the memory stores a computer program, which, when executed by the processor, causes the processor to perform the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, It stores a computer program executable by an electronic device, which, when run on the electronic device, causes the electronic device to perform the steps of the method according to any one of claims 1 to 7.