Hierarchical model aggregation method and apparatus

CN122615656APending Publication Date: 2026-08-21ZHONGJIA MICROVISION (SHENZHEN) SEMICONDUCTOR TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610502750.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-04-16
Publication Date
2026-08-21

AI Technical Summary

Technical Problem

然而,在非IID数据分布下,这种单层聚合方式容易引发“负迁移”问题:即部分工位的检测性能提升,而其他工位性能反而下降,难以实现所有工位性能的协同优化

Benefits of technology

[0019]As can be seen from the above technical solution, this application provides a hierarchical model aggregation method and apparatus. By acquiring workstation metadata and constructing cluster keys, the workstations are divided into multiple groups through initial clustering. During the idle period, the workstations locally train to generate model update quantities, which are then reported to the group-level aggregator after quality verification and gradient quantization. Each group-level aggregator performs outlier detection and weighted aggregation on the update quantities to form a group-level model biased towards the data distribution of its own group. After evaluation by key indicators, high-quality models are selected and uploaded to the central aggregator. The central aggregator calculates the global aggregation weight based on the group metadata, performs a weighted average of the group-level models to obtain the global model, and distributes the group-level or global models to the workstations for inference according to the distribution strategy. This enables the support of multi-model collaborative training architecture under non-IID data distribution, improving the efficiency and robustness of model collaborative training.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122615656A_ABST
    Figure CN122615656A_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a hierarchical model aggregation method and device, the method comprising: obtaining station metadata and constructing a clustering key, and dividing the stations into multiple groups through initial clustering; the station locally trains a model update amount during an empty window period, and reports the model update amount to a group-level aggregator of the group after quality verification and gradient quantization; each group-level aggregator performs outlier detection and weighted aggregation on the update amount to form a group-level model biased towards the data distribution of the group, and selects high-quality models to upload to a central aggregator after key indicator evaluation; the central aggregator calculates global aggregation weights according to group metadata, performs weighted averaging on each group-level model to obtain a global model, and distributes the group-level or global model to the stations for inference according to a distribution strategy. The present application can support a multi-model collaborative training architecture under a non-IID data distribution, and improve the efficiency and robustness of model collaborative training.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing, specifically to a hierarchical model aggregation method and apparatus. Background Technology

[0002] In industrial manufacturing scenarios such as roll-to-roll multi-station defect detection, the data collected at different workstations exhibits significant differences in distribution due to variations in camera model, light source configuration, material type, and process stage, displaying typical non-independent identically distributed (non-IID) characteristics. Traditional federated learning or distributed collaborative training typically employs a single-layer global aggregation strategy, such as simply averaging the model updates uploaded from each workstation. However, under non-IID data distributions, this single-layer aggregation approach is prone to the "negative transfer" problem: that is, the detection performance of some workstations improves, while the performance of other workstations declines, making it difficult to achieve collaborative optimization of the performance of all workstations.

[0003] Furthermore, the existing solution requires all workstations to interact directly with the central server at high frequency. As the number of workstations increases, communication overhead and aggregation computing pressure grow rapidly, forming a system bottleneck and limiting the large-scale deployment and expansion of the solution. At the same time, the current method lacks an explicit distinction between workstation / group-specific models and the central generalized model. Once the global model is updated and performance deteriorates, there is a lack of effective version management and rollback mechanisms, making it difficult to ensure the stable operation of the production line.

[0004] Therefore, there is an urgent need for a hierarchical model aggregation method that can support multi-model collaborative training architecture under non-IID data distribution, thereby improving the efficiency and robustness of model collaborative training. Summary of the Invention

[0005] To address the problems in the prior art, this application provides a hierarchical model aggregation method and apparatus that can support a multi-model collaborative training architecture under non-IID data distribution, thereby improving the efficiency and robustness of model collaborative training.

[0006] To solve at least one of the above problems, this application provides the following technical solution: Firstly, this application provides a hierarchical model aggregation method, including: Obtain workstation metadata for multiple workstations, construct clustering keys, perform initial clustering of the multiple workstations based on the clustering keys and the workstation metadata, determine the corresponding multiple workstation groups, each workstation performs local model training during the idle period, determines the corresponding model update amount, performs local quality verification on the model update amount, and uploads the quality-verified model update amount to the group-level aggregator of the workstation group to which the workstation belongs according to a preset gradient quantization method. Each group-level aggregator performs outlier detection on the model update volume reported by all workstations within its group, removes outliers, performs group-level weighted aggregation on the model update volume after outlier detection, determines the corresponding group-level model, evaluates the group-level model based on a preset validation set for key indicators, and uploads the group-level model with the evaluation value higher than the preset threshold to the central aggregator. The central aggregator receives multiple group-level models and their corresponding group metadata. Based on the group metadata, it calculates a global aggregation weight for each group-level model and performs a weighted average of the group-level models based on the global aggregation weight to determine the corresponding global model. The group-level model or the global model is then distributed to the corresponding workstation for workstation inference according to a preset distribution strategy.

[0007] Furthermore, the construction of the cluster key includes: Obtain the workstation properties of each workstation, including the physical properties of the workstation equipment, optical imaging properties, properties of the detected materials, properties of the production process, and properties of the operating conditions; Based on at least one of the workstation properties or a combination of multiple workstation properties, a clustering key is constructed so that workstation groups clustered according to the clustering key have the same data collection conditions or similar data distributions.

[0008] Furthermore, the local quality verification includes: Verify whether the gradient norm of the model update is within the preset norm range; Verify whether the difference between the model update amount and the previous local model is lower than a preset difference threshold; Verify the quality of sample annotations at the workstation during the training process, and remove update amounts with annotation noise exceeding a preset noise threshold.

[0009] Furthermore, each of the group-level aggregators performs outlier detection on the model update amounts reported by all workstations within its group, removing outliers, including: Each group-level aggregator performs similarity calculations on the model update amounts reported by all workstations within its group, and identifies and removes update amounts whose average similarity with other update amounts is lower than a preset similarity threshold as outliers. Alternatively, a clustering-based method can be used to identify and remove update values ​​that do not belong to any main cluster as outliers.

[0010] Furthermore, the weighting factors of the group-level weighted aggregation include: The sample size of the workstation, the model update confidence score of the workstation, the typicality score of the workstation data distribution, the historical contribution of the workstation, and the degree of recent performance drift of the workstation are all considered.

[0011] Furthermore, the central aggregator receives multiple group-level models and their corresponding group metadata, and calculates a global aggregation weight for each group-level model based on the group metadata, including: The central aggregator receives multiple group-level models and their corresponding group metadata, including at least one of the following: number of workstations within the group, total number of samples, group-level model performance metrics, and model update timestamps. Based on the group metadata, a global aggregation weight is calculated for each group-level model. The global aggregation weight is positively correlated with the number of workstations in the group, the total number of samples, and the performance index of the group-level model, and negatively correlated with the model update time delay.

[0012] Furthermore, the distribution strategy includes: For each workstation, the group-level model of its respective workstation group is distributed first for online inference; When a new workstation is added, a workstation encounters new materials, or the inference confidence of the current group-level model of the workstation is lower than the preset confidence threshold, the global model is sent out for cold start or fallback inference. When the workstation is in experimental mode or gray release stage, candidate group-level models or candidate global models are issued and the inference results are compared with the current stable model.

[0013] Furthermore, the method also includes: Assign a unique version number to each workstation model, each group-level model, and the global model, and associate the model version with production metadata records. When the key performance indicators of a certain workstation or group are found to be lower than the preset rollback threshold after the model is updated, the rollback command is automatically triggered to restore the workstation or group to the previous stable version model.

[0014] Furthermore, the method also includes a multi-level extension step: The workstation group is defined as a primary group, and multiple primary groups are divided into secondary groups according to the production line or factory dimension. A secondary group aggregator is added between the central aggregator and the primary group aggregator. In this process, the first-level group aggregator uploads the group-level model to its subordinate second-level group aggregator for second-level aggregation to determine the corresponding production line-level model or factory-level model. Then, the central aggregator performs global aggregation on the models reported by multiple second-level group aggregators.

[0015] Secondly, this application provides a hierarchical model aggregation device, comprising: The workstation model update module is used to obtain workstation metadata of multiple workstations, construct clustering keys, perform initial clustering of the multiple workstations based on the clustering keys and the workstation metadata, determine the corresponding multiple workstation groups, each workstation performs local model training during the idle period, determines the corresponding model update amount, performs local quality verification on the model update amount, and uploads the quality-verified model update amount to the group-level aggregator of the workstation group to which the workstation belongs according to a preset gradient quantization method. The group-level model determination module is used for each group-level aggregator to perform outlier detection on the model update volume reported by all workstations in the group, remove outliers, perform group-level weighted aggregation on the model update volume after outlier detection, determine the corresponding group-level model, evaluate the group-level model based on a preset validation set, and upload the group-level model with the evaluation value higher than the preset threshold to the central aggregator. The global model determination module is used by the central aggregator to receive multiple group-level models and their corresponding group metadata, calculate a global aggregation weight for each group-level model based on the group metadata, perform a weighted average of each group-level model based on the global aggregation weight, determine the corresponding global model, and distribute the group-level model or the global model to the corresponding workstation according to a preset distribution strategy for workstation inference.

[0016] Thirdly, this application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the hierarchical model aggregation method.

[0017] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the hierarchical model aggregation method described above.

[0018] Fifthly, this application provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the steps of the hierarchical model aggregation method described above.

[0019] As can be seen from the above technical solution, this application provides a hierarchical model aggregation method and apparatus. By acquiring workstation metadata and constructing cluster keys, the workstations are divided into multiple groups through initial clustering. During the idle period, the workstations locally train to generate model update quantities, which are then reported to the group-level aggregator after quality verification and gradient quantization. Each group-level aggregator performs outlier detection and weighted aggregation on the update quantities to form a group-level model biased towards the data distribution of its own group. After evaluation by key indicators, high-quality models are selected and uploaded to the central aggregator. The central aggregator calculates the global aggregation weight based on the group metadata, performs a weighted average of the group-level models to obtain the global model, and distributes the group-level or global models to the workstations for inference according to the distribution strategy. This enables the support of multi-model collaborative training architecture under non-IID data distribution, improving the efficiency and robustness of model collaborative training. Attached Figure Description

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

[0021] Figure 1 This is one of the flowcharts illustrating the hierarchical model aggregation method in the embodiments of this application; Figure 2 This is a structural diagram of the hierarchical model aggregation device in the embodiments of this application; Figure 3 This is a schematic diagram of the structure of the electronic device in the embodiments of this application.

[0022] Figure label: Electronic device 9600, central processing unit 9100, memory 9140, communication module 9110, input unit 9120, audio processor 9130, display 9160, power supply 9170, buffer memory 9141, application / function storage unit 9142, data storage unit 9143, driver storage unit 9144, antenna 9111, speaker 9131, microphone 9132. Detailed Implementation

[0023] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, 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 some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0024] The acquisition, storage, use, and processing of data in this application comply with relevant laws and regulations.

[0025] In industrial manufacturing scenarios such as roll-to-roll multi-station defect detection, the model detection data of each station exhibits non-independent and identically distributed characteristics. However, under this characteristic, traditional federated model aggregation methods are prone to negative transfer, making it difficult to achieve collaborative optimization across all stations. This application provides a hierarchical model aggregation method and apparatus. By acquiring station metadata and constructing cluster keys, the stations are divided into multiple groups through initial clustering. During the idle period, each station locally trains and generates model update quantities, which are then reported to the group-level aggregator after quality verification and gradient quantization. Each group-level aggregator performs outlier detection and weighted aggregation on the update quantities, forming a group-level model biased towards its own group's data distribution. After evaluation by key indicators, high-quality models are selected and uploaded to the central aggregator. The central aggregator calculates the global aggregation weight based on the group metadata, performs a weighted average of the group-level models to obtain the global model, and distributes the group-level or global models to the stations for inference according to the distribution strategy. This enables a multi-model collaborative training architecture under non-IID data distribution, improving the efficiency and robustness of model collaborative training.

[0026] To support multi-model collaborative training architectures under non-IID data distributions and improve the efficiency and robustness of model collaborative training, this application provides an embodiment of a hierarchical model aggregation method, see [link to relevant documentation]. Figure 1 The hierarchical model aggregation method specifically includes the following: Step S101: Obtain workstation metadata for multiple workstations, construct clustering keys, perform initial clustering of the multiple workstations based on the clustering keys and the workstation metadata, determine the corresponding multiple workstation groups, each workstation performs local model training during the idle period, determines the corresponding model update amount, performs local quality verification on the model update amount, and uploads the quality-verified model update amount to the group-level aggregator of the workstation group to which the workstation belongs according to the preset gradient quantization method. Optionally, in this embodiment, this step involves a defect detection scenario at roll-to-roll workstations. In this application scenario, each defect detection workstation is equipped with a corresponding auxiliary detection model.

[0027] Optionally, in this embodiment, metadata of all workstations participating in collaborative training is collected.

[0028] Metadata is key information describing the hardware configuration and process attributes of a workstation, such as camera model, light source wavelength, material type, and process segment identifier. Simultaneously, the system predefines "grouping keys," which are rules or combinations of dimensions used to divide groups, such as "camera model + material type."

[0029] Based on the clustering key, the system extracts and encodes features from the metadata of each workstation and performs initial clustering operations. The clustering result groups workstations with similar hardware configurations and process characteristics into the same group, forming multiple workstation groups with significantly different data distributions among themselves, but relatively homogeneous data distributions within each group. This lays the structural foundation for subsequent hierarchical aggregation, enabling the group-level dedicated model to learn efficiently within homogeneous groups.

[0030] Optionally, in this embodiment, after the group division is completed, each workstation enters the local training phase.

[0031] To avoid disrupting normal production, each workstation only utilizes "off-peak periods" (such as material changeover intervals or standby times) within the production cycle to perform local model training. Based on the current local model copy, the workstation uses real image data collected at that workstation (which has its unique non-independent and identically distributed characteristics) to perform several rounds of iterative training, calculating the update amount of the model parameters, such as gradients or parameter increments.

[0032] Each workstation model will upload its update data to the group-level aggregator of the workstation group to which it belongs, based on the group division results, so that the group-level aggregator can perform group-level aggregation to obtain a dedicated group-level model.

[0033] Before uploading the model update, the workstation performs a local quality check. This check filters out obviously abnormal or low-quality updates, such as verifying whether the gradient norm of the update is within a reasonable range and whether the difference from the previous model is too large, thereby eliminating invalid updates caused by annotation noise, momentary sensor failures, or data anomalies. After passing the quality check, the system then applies a preset gradient quantization method to compress the update, such as retaining only the top K components with the largest gradient values, or performing low-bit-width quantization on the gradient values, thus significantly reducing the amount of data to be transmitted.

[0034] Finally, the workstation uploads the compressed model update to the group-level aggregator of its group. The entire upload process is highly efficient and occurs only within the workstation and group, avoiding the communication bottleneck caused by all workstations directly connecting to the central server.

[0035] Step S102: Each group-level aggregator performs outlier detection on the model update volume reported by all workstations in its group, removes outliers, performs group-level weighted aggregation on the model update volume after outlier detection, determines the corresponding group-level model, evaluates the group-level model based on a preset validation set for key indicators, and uploads the group-level models with evaluation values ​​higher than a preset threshold to the central aggregator. Optionally, in this embodiment, after receiving the model update amounts reported by each workstation within the group, the group-level aggregator performs outlier detection on all collected model update amounts.

[0036] In real-world industrial production environments, different workstations may generate model updates of extremely poor quality due to temporary sensor malfunctions, light interference, operator errors, or brief process anomalies. These updates deviate significantly from the update direction of normal workstations within the group. Outlier detection aims to identify and remove these anomalous updates. Detection methods can be based on vector similarity calculations, such as calculating the cosine or Euclidean distance between the update reported by each workstation and the average of all updates within the group. Updates with a distance exceeding a preset threshold are identified as outliers and removed, preventing anomalous updates from a single workstation from contaminating the entire group-level model.

[0037] After outlier detection, the group aggregator performs group-weighted aggregation on the remaining normal updates. This process is not a simple arithmetic average, but rather assigns different weights based on the importance and reliability of each workstation.

[0038] Weighting factors can include the number of samples for a workstation, data quality scores, historical contribution stability, or recent performance. For example, high-reputation workstations that handle large-volume production tasks and have stable detection capabilities will be assigned higher weights, while new workstations that have just completed maintenance or have a small sample size will have relatively lower weights. Through weighted aggregation, the group-level aggregator generates a group-level model that represents the common knowledge of the group and is biased towards the data distribution of the group.

[0039] The swarm aggregator evaluates the swarm model using a pre-defined validation set. This validation set is a set of accurately labeled samples independent of the training data, covering various typical scenarios and defect types that the swarm may encounter. Evaluation metrics may include accuracy, recall, F1 score, or detection rate for specific hard examples. Only swarm models with evaluation values ​​higher than a pre-defined threshold are allowed to be uploaded to the central aggregator; low-quality swarm models are blocked locally.

[0040] Optionally, in this embodiment, the group-level aggregation can be triggered based on the idle time of the workstation node, or the aggregation can be triggered based on a set time.

[0041] This step significantly improves the robustness and specialized performance of the swarm-level model through outlier detection and weighted aggregation. On the other hand, it ensures that only qualified swarm-level models participate in subsequent global aggregation through quality threshold control, thereby guaranteeing the stability and aggregation efficiency of the entire hierarchical architecture.

[0042] Step S103: The central aggregator receives multiple group-level models and their corresponding group metadata. Based on the group metadata, it calculates a global aggregation weight for each group-level model and performs a weighted average of the group-level models based on the global aggregation weight to determine the corresponding global model. Based on a preset distribution strategy, it distributes the group-level model or the global model to the corresponding workstation for workstation inference.

[0043] Optionally, in this embodiment, the central aggregator first receives data uploaded from multiple group-level aggregators: First, there is the group-level model after aggregation and evaluation within the group (whose parameter weights have aggregated the local data features of all workstations within the group); second, there is the group metadata (such as the number of workstations within the group, process priority, data diversity index, etc.) bound to each group-level model.

[0044] In this way, the central aggregator only needs to interact with the group-level aggregator, instead of interacting with all workstations at high frequency, reducing the risk of overload.

[0045] The central aggregator does not simply average all group-level models, but rather applies differentiated weights based on the metadata of each group. For example, groups that handle key processes or have more diverse data are given higher global aggregation weights. Subsequently, the central aggregator performs a weighted average operation: multiplying the parameter vector of each group-level model by its corresponding weight, summing the results, and then dividing by the total weights, thereby generating a global model that incorporates knowledge from multiple groups and has better generalization capabilities.

[0046] Optionally, in this embodiment, the global aggregation can be triggered according to batch / work order rhythm, or according to a set time or set node.

[0047] Optionally, in this embodiment, during the model distribution stage...

[0048] For routine production scenarios, priority is given to issuing dedicated group-level models to the workstations to maintain optimal detection performance for the data distribution of the group.

[0049] When encountering situations such as the launch of a new workstation, the switching of a workstation to new materials causing a decrease in the confidence of the original model, or an increase in the uncertainty of the inference results of the group-level model, the global model is automatically distributed as a cold start template or a fallback solution to avoid detection failure.

[0050] This step maintains a balance between specificity and generalization through differentiated aggregation, while achieving adaptive model switching through strategic distribution, thereby improving the system's robustness and transfer efficiency without increasing communication burden.

[0051] This example demonstrates how this embodiment divides workstations into multiple groups according to a preset grouping key. Workstations within a group train locally and report updates during idle periods, forming a group-level model first at the group-level aggregator. Then, the central aggregator aggregates multiple group-level models to form a global model, ensuring the detection effect of each workstation / various scenarios while reducing communication volume and negative migration risk.

[0052] As described above, the hierarchical model aggregation method provided in this application can obtain workstation metadata and construct clustering keys, and divide workstations into multiple groups through initial clustering; workstations locally train and generate model update quantities during idle periods, and report them to the group-level aggregator of their respective groups after quality verification and gradient quantization; each group-level aggregator performs outlier detection and weighted aggregation on the update quantities to form a group-level model biased towards the data distribution of its own group, and selects high-quality models after evaluation by key indicators and uploads them to the central aggregator; the central aggregator calculates the global aggregation weight based on the group metadata, performs a weighted average of each group-level model to obtain the global model, and distributes the group-level or global model to workstations for inference according to the distribution strategy, thereby supporting a multi-model collaborative training architecture under non-IID data distribution, improving the efficiency and robustness of model collaborative training.

[0053] In one embodiment of the hierarchical model aggregation method of this application, it may further include the following: Step S201: Obtain the workstation properties of each workstation, including the physical properties of the workstation equipment, optical imaging properties, properties of the detected materials, properties of the production process, and properties of the operating conditions; Step S202: Construct a clustering key based on at least one of the workstation properties or a combination of multiple workstation properties, so that the workstation groups clustered according to the clustering key have the same data collection conditions or similar data distributions.

[0054] Optionally, in this embodiment, the nature of the workstation.

[0055] It is understood that the application scenario of this embodiment is aimed at roll-to-roll production lines and product defect detection targets on the production line. The nature of the workstations involved includes the cameras and light sources used for defect detection; the materials and processes of the products; and the operating status of the production line.

[0056] First, the physical properties of the workstation equipment refer to the inherent hardware parameters such as camera model, lens focal length, sensor pixel size, light source type, and installation angle. These determine the acquisition resolution, noise level, and imaging geometry of the original image.

[0057] Second, optical imaging properties, encompassing light source wavelength, light intensity, illumination uniformity, filter configuration, and imaging optical path structure, affect the contrast of defects in the image, edge sharpness, and color reproduction characteristics.

[0058] Third, the properties of the material being tested refer to the material type of the object being tested, such as metal, plastic, glass, and ceramic, as well as the surface roughness, color, and light transmittance of the material. Different materials have drastically different reflection, absorption, and scattering characteristics to the same light source, resulting in significant differences in the distribution of image features.

[0059] Fourth, the nature of the production process, including process segment identifiers such as coating, exposure, etching, and bonding, as well as the unique defect types, defect size ranges, and defect frequency distributions specific to that process segment. This determines the defect morphology and complexity that the model needs to focus on.

[0060] Fifth, the nature of the operating conditions, encompassing dynamic factors such as production line operating speed, ambient temperature, vibration amplitude, and equipment aging. These factors affect the real-time stability and drift of the data.

[0061] Optionally, in this embodiment, based on actual business needs, at least one property or a combination of multiple properties is selected from the above five types of workstation properties to construct a "clustering key". The essence of a clustering key is a clustering rule or a multi-dimensional feature vector, and the system clusters workstations according to this rule.

[0062] The key objective of constructing clustering keys is to ensure that within each workstation group resulting from the final clustering, all workstations share the same data acquisition conditions or similar data distribution characteristics. For example, if "camera model + light source wavelength + material type" is chosen as the clustering key, then workstations within the same group will be completely identical or highly similar in these three dimensions, thus guaranteeing consistency in resolution, lighting tone, and material background of the acquired images. Data within such groups is closer to identically distributed (IID), avoiding direct mixing and aggregation of data with different distributions (non-IID), which is beneficial for efficient aggregation of subsequent group-level models.

[0063] Furthermore, after workstation aggregation based on this grouping key, a dynamic adjustment mechanism for workstation groups is also included, which automatically or manually reassigns groups when processes switch or performance drifts.

[0064] Specifically, when a workstation undergoes process switching, material changes, or performance drift, the workstation can be automatically or manually reassigned to different groups (e.g., switching from the "metal material group" to the "plastic material group"). The group structure can dynamically adjust to changes in the production environment, ensuring that the model always adapts to the current process conditions and preventing the model from becoming outdated or failing.

[0065] Through step S202, this embodiment localizes the non-independent identically distributed problem from the source. The data distribution differences between cross groups are large, while the differences within groups are small, thereby providing a high-quality homogeneous data foundation for training dedicated models in hierarchical aggregation architecture and effectively avoiding negative transfer.

[0066] In one embodiment of the hierarchical model aggregation method of this application, it may further include the following: Step S301: Verify whether the gradient norm of the model update is within the preset norm interval; Step S302: Verify whether the difference between the model update amount and the previous local model is lower than a preset difference threshold; Step S303: Verify the quality of sample annotations at the workstation during the training process and remove update amounts with annotation noise exceeding a preset noise threshold.

[0067] Optionally, in this embodiment, local quality verification includes one or more of the following methods, and the verification steps are independent of each other and can be used in combination.

[0068] Specifically, the gradient norm of the model updates generated during workstation training is calculated. The gradient norm is a comprehensive indicator that measures the overall magnitude of model parameter updates. The system pre-defines a reasonable norm range, which is determined based on the statistical distribution of historical normal training epochs. When the calculated gradient norm falls within this preset range, it is considered a normal update; if the gradient norm is too large, it means that the update magnitude is abnormally drastic, possibly due to data anomalies or calculation errors; if it is too small, it may indicate that the update lacks effective information. Through this verification, the system can filter out invalid updates with inappropriate magnitudes, preventing them from disturbing the aggregation results.

[0069] Specifically, the model update amount in the current round is compared with the local model in the previous round to determine the degree of difference. The difference between the parameters of the two models is calculated, for example, by using a distance metric of the parameter vectors. The system presets a difference threshold, which reflects the reasonable range of expected changes in the model during a single training round. If the difference between the current update amount and the previous model is lower than this threshold, it indicates that the model update is smooth and continuous, belonging to normal evolution; if the difference is too high, it suggests that the current training may have been affected by abnormal data or algorithm instability. This verification ensures the consistency of model updates and avoids instability in the group-level aggregation results due to sudden changes.

[0070] Specifically, the quality of sample annotations used during the training process at each workstation is verified. Training the defect detection model relies on accurate annotation data, but annotation noise may exist at the workstation, such as missing annotations, incorrect annotations, or annotation position deviations. Annotation quality is evaluated by setting a noise threshold, which can be achieved through small-scale manual sampling, automatic consistency checks, or comparison with historical annotation results. For sample batches with annotation noise exceeding the threshold, the generated model updates are considered unreliable, and the system will discard the entire batch of updates. This verification effectively suppresses the negative impact of annotation errors on model training, ensuring the authenticity and validity of uploaded updates.

[0071] Through step S303, this embodiment implements a local quality verification filtering mechanism to ensure that only high-quality, stable, and reliable model updates can be uploaded to the group aggregator.

[0072] In one embodiment of the hierarchical model aggregation method of this application, it may further include the following: Step S401: Each group-level aggregator performs similarity calculation on the model update amount reported by all workstations in its group, and determines and removes update amounts whose average similarity with other update amounts is lower than a preset similarity threshold as outliers. Step S402: Alternatively, use a clustering-based method to identify and remove update values ​​that do not belong to any main cluster as outliers.

[0073] Optionally, in this embodiment, this step describes an optional implementation method for outlier detection in a group-level aggregator.

[0074] Specifically, an outlier detection method based on similarity calculation.

[0075] After receiving model updates reported by all workstations within the group, the group-level aggregator first needs to quantify the similarity between each update. A high-dimensional vector is constructed for each workstation's model update, representing the direction and magnitude of parameter changes obtained during this training. Subsequently, the aggregator calculates the similarity between each workstation's update vector and the update vectors of all other workstations, using common similarity metrics such as cosine similarity or the reciprocal of Euclidean distance. After completing all pairwise comparisons, for each workstation's update, the aggregator sums its similarity values ​​with those of all other workstations and takes the average to obtain the average similarity. This average similarity reflects the degree of consistency between the workstation's update direction and the mainstream update direction within the group. If the average similarity of a workstation is lower than a pre-set similarity threshold, it indicates that the workstation's model update direction deviates significantly from that of most other workstations in the group, likely due to data labeling errors, sensor malfunctions, or drastic fluctuations in operating conditions. The system identifies such update amounts as outliers and removes them, thereby preventing abnormal updates from a single workstation from negatively impacting the group-level model.

[0076] Specifically, a clustering-based outlier detection method.

[0077] The model update vectors of all workstations within a group are projected as data points into a high-dimensional space. An aggregator runs clustering algorithms in this space, such as the density-based DBSCAN algorithm or the classic K-means algorithm, automatically grouping updates that are close to each other and have the same direction into the same cluster. Under normal operating conditions, the update vectors of most workstations within the group will cluster into one or a few main clusters because these workstations process similar data distributions and optimize the model in similar directions. Update vectors generated due to abnormal reasons will appear as isolated points or small clusters far from the main clusters in the space due to their abnormal vector directions. The system identifies and extracts the main clusters containing the largest number of samples and the highest density, and then identifies and removes update vectors that do not belong to any main cluster as outliers. The advantage of this method is that it does not require a pre-defined similarity threshold and can adaptively discover natural grouping structures in the data, making it particularly suitable for scenarios where there are multiple normal sub-patterns within a group, but the sub-patterns themselves have reasonable differences.

[0078] Through step S402, this embodiment successfully removes outliers from the model update amounts reported by each workstation, ensuring that the group-level aggregated model is not contaminated.

[0079] In one embodiment of the hierarchical model aggregation method of this application, it may further include the following: Step S501: At least one of the following: sample size of workstation, model update confidence score of workstation, typicality score of workstation data distribution, historical contribution of workstation, and recent performance drift of workstation.

[0080] Optionally, in this embodiment, the core consideration dimension used when calculating the aggregation weight for the model update amount reported by each workstation in group-level aggregation is...

[0081] First, the sample size of each workstation. This factor reflects the amount of data used for local training at each workstation. Each workstation reports the total number of valid samples consumed during this training phase along with the model update amount. The group aggregator determines the weights based on this value: workstations with larger sample sizes have more stable statistical characteristics and higher reliability of their updates, thus receiving higher aggregation weights. This weighting factor ensures that data-rich workstations dominate the group model, preventing the accidental noise from small-sample workstations from excessively influencing the model's direction.

[0082] Second, the model update confidence score for each workstation. This factor measures the workstation's confidence in its updated model. After completing local training, the workstation calculates the performance improvement of the model before and after the update using a local validation set, or calculates the entropy of the update gradient, quantifying the result into a confidence score between 0 and 1. The more significant the performance improvement or the more consistent the gradient direction, the higher the confidence score. This score is uploaded along with the model update. This weighting factor assigns higher weight to updates with significant training effects and clear directions, suppressing the interference of overfitting or invalid updates on the aggregation.

[0083] Third, the typicality score of workstation data distribution. This factor is used to evaluate the consistency between the data distribution of each workstation and the overall data distribution within the group. The group-level aggregator maintains a group data distribution benchmark and calculates the similarity between the data feature distribution uploaded by each workstation and the benchmark. The higher the similarity, the higher the typicality score. Workstations with high typicality represent common patterns within the group, and their update frequency is more important for maintaining the generality of the group-level model, thus receiving higher weight. Workstations with low typicality may represent edge scenarios or special working conditions, and their weight will be reduced accordingly.

[0084] Fourth, the historical contribution of the workstation. This factor records the quality and stability of the workstation's participation in past rounds of aggregation. The group-level aggregator maintains a cumulative reputation score for each workstation, which is dynamically updated based on the success rate of outlier detection for the workstation's historically uploaded updates and the actual contribution of its update volume to the performance improvement of the group-level model. Workstations that consistently provide high-quality updates over a long period receive a higher historical contribution score. This weighting factor encourages workstations to maintain good operating conditions and reduces the undue impact of a single large update caused by temporary failures or occasional anomalies on the aggregation results.

[0085] Fifth, the degree of recent performance drift at each workstation. This factor is used to monitor the drastic changes in the workstation model over multiple training rounds. The group-level aggregator records the vector difference between the reported update amounts of each workstation in two consecutive rounds and calculates its moving average. If the recent update amount of a workstation changes drastically, it indicates that the workstation may be in a state of process switching, equipment fluctuation, or rapid changes in data distribution, and the stability of its update amount is questionable. Therefore, its aggregation weight is adjusted downward accordingly. Conversely, workstations with stable update amounts receive higher weights. This weight factor suppresses the artificially high weights caused by abnormal fluctuations, ensuring the smoothness and stability of the group-level aggregation process.

[0086] Taking into account the above five core dimensions, the weights of the update amount of each workstation model in the group-level model are obtained, and the specific implementation method of fusion is not limited.

[0087] Through step S501, this embodiment successfully evaluates the update quality of each workstation from five dimensions: sample size, confidence level, representativeness, historical reputation, and stability. This makes the aggregation process of the group-level model more intelligent and robust, making full use of the knowledge contribution of high-quality workstations while effectively suppressing the negative impact of abnormal, marginal, or unstable workstations on the model. Ultimately, it generates a group-level model that represents the commonalities of the group and has stable performance.

[0088] In one embodiment of the hierarchical model aggregation method of this application, it may further include the following: Step S601: The central aggregator receives multiple group-level models and their corresponding group metadata, including at least one of the following: number of workstations within the group, total number of samples, group-level model performance metrics, and model update timestamps. Step S602: Calculate the global aggregation weight for each group-level model based on the group metadata. The global aggregation weight is positively correlated with the number of workstations in the group, the total number of samples, and the performance index of the group-level model, and negatively correlated with the model update time delay.

[0089] Optionally, in this embodiment, the central aggregator is responsible for receiving two types of key information uploaded from each group-level aggregator. The first type is the group-level model itself, i.e., the set of model parameters that has been trained and aggregated within the group and represents the data distribution characteristics of that group. The second type is the group metadata accompanying the group-level model; this metadata is the basis for subsequent weight calculations. Metadata includes, but is not limited to: the number of currently active workstations within the group, the total number of samples contributed by all workstations, the performance metrics (such as accuracy, recall, or F1 score) measured by the group-level model on the pre-defined validation set, and the update timestamp when the model completed aggregation. This metadata characterizes the credibility and representativeness of each group-level model from three dimensions: scale, quality, and timeliness.

[0090] Based on the aforementioned metadata, the weight of each group-level model in the global aggregation is calculated.

[0091] The weights are designed following clear guiding principles: they are positively correlated with the number of workstations in the group, the total number of samples, and the performance indicators of the group-level model. Groups with more workstation collaboration, more sufficient samples for training, and better detection results will have greater say in generating the global model, thus ensuring that the global model is tilted towards more reliable and statistically significant groups. At the same time, the weights are negatively correlated with the model update time delay, that is, the older the group-level model and the longer it is from the current time, the lower its weight.

[0092] Through this mechanism, the central aggregator can automatically assign appropriate weights to each group-level model without manual intervention. Ultimately, these group-level models with differentiated weights are fed into a weighted average calculation to generate a global model that incorporates high-quality group knowledge while also considering timeliness.

[0093] Through step S602, this embodiment successfully performs global model aggregation, effectively avoiding the problem of high-quality models being dragged down by inferior or outdated models due to simple averaging, and significantly improving the generalization ability and adaptability of the global model to the production environment.

[0094] In one embodiment of the hierarchical model aggregation method of this application, it may further include the following: Step S701: For each workstation, prioritize distributing the group-level model of its workstation group for online inference; Step S702: When a new workstation is added, a workstation encounters a new material, or the inference confidence of the current group-level model of the workstation is lower than the preset confidence threshold, the global model is sent out for cold start or fallback inference. Step S703: When the workstation is in the experimental mode or the gray release stage, the candidate group-level model or the candidate global model is issued and the inference results are compared with the current stable model.

[0095] Optionally, in this embodiment, after obtaining the global model and the group-level models of each group through hierarchical model aggregation, the model distribution and application phase includes: In standard mode, the system prioritizes pushing a dedicated group-level model to each workstation. This model, after data aggregation within the group, is precisely tailored to the group's camera configuration, material properties, and process segment distribution. Upon receiving the model, the workstation directly loads it into the inference engine for online defect detection. This prioritization strategy ensures a high degree of match between the model output and the actual data distribution at the workstation, effectively avoiding the negative migration effect that a global model might cause, thus maintaining optimal detection accuracy and recall during stable production.

[0096] Three exceptional cases that trigger the global model are also defined: When a new workstation is first added to the system, it has not yet accumulated local data and lacks a dedicated model; when an existing workstation encounters a new type of material that has not been trained, the cognitive boundaries of the original group-level model are broken; when the group-level model currently used by the workstation continuously outputs low confidence scores during the inference process, such as frequently falling below the preset 0.7 threshold, it indicates that the model has insufficient grasp of the current input samples.

[0097] When any of the above conditions are met, the system automatically switches to and distributes the global model. Because this model incorporates generalized knowledge from multiple groups, it has wider adaptability and can be used as an initial template or fallback solution for cold starts, preventing missed or false detections due to model mismatch and ensuring the continuous availability of the production line.

[0098] Optionally, to serve the needs of model iteration and validation, the updated workstation model, the aggregated group-level model, and the aggregated global model all need to be distributed to one or more random workstations for model validation.

[0099] When a workstation is marked as experimental or in a gray-scale release phase, the system simultaneously distributes a new version of the candidate model and the currently stable production model. The workstation's inference engine runs both models in parallel, producing detection results for the same batch of input samples. The system then compares the differences between the two sets of outputs, calculating key indicators such as result consistency rate and the number of newly detected defects. This comparison mechanism allows for a quantitative assessment of the performance gains and potential risks of the new model without affecting mainline production decisions, providing data for deciding whether to fully deploy the candidate model, and achieving smooth model iteration and safe release. Through step S703, this embodiment successfully defines multiple application strategies for model distribution, ensuring the coexistence and application of specialized and generalized models, and solving the negative transfer problem.

[0100] In one embodiment of the hierarchical model aggregation method of this application, it may further include the following: Step S801: Assign a unique version number to each workstation model, each group-level model, and the global model, and associate the model version with the production metadata record; Step S802: When it is detected that the key performance indicators of a certain workstation or group are lower than the preset rollback threshold after the model is updated, the rollback command is automatically triggered to restore the workstation or group to the previous stable version model.

[0101] Optionally, in this embodiment, each workstation model, each group-level model, and the global model are assigned a unique version number across the entire system. This version number can be in the form of an incrementing number, a timestamp, or a hash value to ensure that each model version can be accurately identified. Simultaneously, a linking record is established between this version number and key metadata from the production process. This metadata includes at least: production batch number, material batches used, snapshots of key process parameters (such as temperature, pressure, and line speed), production time windows, and operator or equipment identifiers. The recording method involves the version management module automatically collecting the context information of the current production environment when a model version is released, forming a version-metadata mapping record, and storing it in a version database or distributed ledger.

[0102] By establishing this association, a traceable relationship between the model version and the production environment is created, enabling any subsequent inference result or performance to be traced back to the specific model version and its corresponding production conditions. This provides a data foundation for root cause analysis and version comparison, achieving full lifecycle traceability of the model version. When performance anomalies occur, the environmental factors or model changes that caused the anomalies can be quickly located.

[0103] Optionally, in this embodiment, key performance indicators for each workstation and each workstation group are continuously monitored after applying the new version of the model. Key performance indicators include, but are not limited to, defect detection rate, false alarm rate, processing throughput, and model inference confidence.

[0104] A preset rollback threshold is set for each metric. This threshold can be an absolute value (e.g., detection rate below 85%) or a relative change (e.g., a decrease of more than 5% compared to the previous version). When the monitoring module detects that one or more key performance indicators are below the corresponding rollback threshold, a rollback command is automatically triggered without manual intervention. The rollback command is sent to all workstations in the target workstation or target group, and includes the previous stable version number to be restored. Upon receiving the command, each workstation loads the model parameters of the stable version from its local cache or version repository, replaces the currently running model, and resumes using that version for inference. Simultaneously, the system records this rollback event, including the trigger time, the version numbers before and after the rollback, the specific metric values ​​that triggered the rollback, and can optionally pause the distribution of abnormal versions. This achieves second-level automatic recovery when model updates cause performance degradation, preventing degraded models from continuously impacting production quality.

[0105] Through step S802, this embodiment successfully ensures the stability of the production environment, minimizes the negative migration risk caused by model updates, and reduces the cost of manual intervention and fault response time.

[0106] In one embodiment of the hierarchical model aggregation method of this application, it may further include the following: Step S901: Define the workstation group as a primary group, divide the multiple primary groups into secondary groups according to the production line or factory dimension, and add a secondary group aggregator between the central aggregator and the primary group aggregator; Step S902: The first-level group aggregator uploads the group-level model to its subordinate second-level group aggregator for second-level aggregation to determine the corresponding production line-level model or factory-level model. Then, the central aggregator performs global aggregation on the models reported by multiple second-level group aggregators.

[0107] Optionally, this embodiment also includes a hierarchical extension architecture of the method.

[0108] The existing workstation groups are defined as primary groups, which are the most basic aggregation units in the entire architecture. Subsequently, multiple primary groups are divided into secondary groups according to higher-level physical or logical dimensions—such as production lines or factories. A secondary group aggregator is added between the original central aggregator and the primary group aggregators. This secondary aggregator undertakes the model aggregation function of the intermediate layer, thereby expanding the original two-layer architecture (workstation-group-central) into a three-layer architecture (workstation-primary group-secondary group-central).

[0109] After aggregating the updates to the workstation models within their respective groups, each primary group aggregator uploads its generated primary group-level model to its corresponding secondary group aggregator. The secondary group aggregator receives models from multiple primary group aggregators within its jurisdiction, performs secondary aggregation operations on these models, and generates a production line-level or factory-level model representing the overall data distribution characteristics of that production line or factory. This intermediate-layer model incorporates both the specialized knowledge of each primary group and reflects the common characteristics at the production line or factory level. Finally, the central aggregator no longer directly deals with numerous primary groups but instead receives the production line-level or factory-level models reported by each secondary group aggregator, performs a final tertiary global aggregation on these models, and obtains a global model covering all production lines or the entire group.

[0110] First, the extended scheme in this embodiment further reduces the communication and computing load of the central aggregator. The central node only needs to interact with a limited number of secondary aggregators, rather than communicating directly with a large number of primary groups. Second, a production line-level or factory-level intermediate layer model is introduced. This model can be used for collaborative optimization or fault isolation across workstations within the same production line. When a production line needs to be debugged or updated independently, it does not affect other production lines and the global model. Third, each factory or production line can maintain its own intermediate layer model while still participating in global knowledge sharing.

[0111] Through step S902, this embodiment successfully proposes an extended implementation method for the implementation scheme, which is adapted to the deployment architecture of a group with multiple factories and multiple production lines.

[0112] To support multi-model collaborative training architectures under non-IID data distributions and improve the efficiency and robustness of model collaborative training, this application provides an embodiment of a hierarchical model aggregation apparatus for implementing all or part of the hierarchical model aggregation method. See [link to relevant documentation]. Figure 2 The hierarchical model aggregation device specifically includes the following components: The workstation model update module 10 is used to obtain workstation metadata of multiple workstations, construct a clustering key, perform initial clustering of the multiple workstations according to the clustering key and the workstation metadata, determine the corresponding multiple workstation groups, each workstation performs local model training during the idle period, determines the corresponding model update amount, performs local quality verification on the model update amount, and uploads the quality-verified model update amount to the group-level aggregator of the workstation group to which the workstation belongs according to a preset gradient quantization method. The group-level model determination module 20 is used for each group-level aggregator to perform outlier detection on the model update volume reported by all workstations in the group, remove outliers, perform group-level weighted aggregation on the model update volume after outlier detection, determine the corresponding group-level model, evaluate the group-level model based on a preset validation set, and upload the group-level model with the evaluation value higher than the preset threshold to the central aggregator. The global model determination module 30 is used for the central aggregator to receive multiple group-level models and their corresponding group metadata, calculate the global aggregation weight for each group-level model based on the group metadata, perform a weighted average of each group-level model based on the global aggregation weight, determine the corresponding global model, and distribute the group-level model or the global model to the corresponding workstation according to a preset distribution strategy for workstation inference.

[0113] As described above, the hierarchical model aggregation device provided in this application can acquire workstation metadata and construct clustering keys to divide workstations into multiple groups through initial clustering. During the idle period, each workstation locally trains and generates model update quantities, which are then reported to the group-level aggregator of its respective group after quality verification and gradient quantization. Each group-level aggregator performs outlier detection and weighted aggregation on the update quantities to form a group-level model biased towards the data distribution of its own group. After evaluation by key indicators, high-quality models are selected and uploaded to the central aggregator. The central aggregator calculates the global aggregation weight based on the group metadata, performs a weighted average of the group-level models to obtain the global model, and distributes the group-level or global models to workstations for inference according to the distribution strategy. This enables the support of a multi-model collaborative training architecture under non-IID data distribution, improving the efficiency and robustness of model collaborative training.

[0114] From a hardware perspective, in order to support multi-model collaborative training architecture under non-IID data distribution and improve the efficiency and robustness of model collaborative training, this application provides an embodiment of an electronic device for implementing all or part of the hierarchical model aggregation method, wherein the electronic device specifically includes the following: The system comprises a processor, memory, a communications interface, and a bus; wherein the processor, memory, and communications interface communicate with each other via the bus; the communications interface is used to realize information transmission between the hierarchical model aggregation method and core business systems, user terminals, and related databases and other related devices; the logic controller can be a desktop computer, tablet computer, or mobile terminal, etc., and this embodiment is not limited to these. In this embodiment, the logic controller can be implemented with reference to the embodiments of the hierarchical model aggregation method in the embodiments, and the contents of the embodiments of the hierarchical model aggregation method are incorporated herein, and repeated parts will not be described again.

[0115] It is understood that the user terminal may include smartphones, tablet computers, network set-top boxes, portable computers, desktop computers, personal digital assistants (PDAs), in-vehicle devices, smart wearable devices, etc. Among these, the smart wearable devices may include smart glasses, smartwatches, smart bracelets, etc.

[0116] In practical applications, the hierarchical model aggregation method can be partially executed on the electronic device side as described above, or all operations can be completed on the client device. The choice can be made based on the processing power of the client device and the limitations of the user's usage scenario. This application does not impose any limitations on this. If all operations are completed on the client device, the client device may further include a processor.

[0117] The aforementioned client device may have a communication module (i.e., a communication unit) that can communicate with a remote server to achieve data transmission with the server. The server may include a server on the task scheduling center side; in other implementation scenarios, it may also include a server on an intermediate platform, such as a server on a third-party server platform that has a communication link with the task scheduling center server. The server may include a single computer device, a server cluster consisting of multiple servers, or a distributed server structure.

[0118] Figure 3 This is a schematic block diagram illustrating the system configuration of the electronic device 9600 according to an embodiment of this application. Figure 3 As shown, the electronic device 9600 may include a central processing unit 9100 and a memory 9140; the memory 9140 is coupled to the central processing unit 9100. It is worth noting that... Figure 3 This is an example; other types of structures can also be used to supplement or replace this structure to achieve telecommunications functions or other functions.

[0119] In one embodiment, the hierarchical model aggregation method functionality can be integrated into the central processing unit 9100. The central processing unit 9100 can be configured to perform the following controls: Step S101: Obtain workstation metadata for multiple workstations, construct clustering keys, perform initial clustering of the multiple workstations based on the clustering keys and the workstation metadata, determine the corresponding multiple workstation groups, each workstation performs local model training during the idle period, determines the corresponding model update amount, performs local quality verification on the model update amount, and uploads the quality-verified model update amount to the group-level aggregator of the workstation group to which the workstation belongs according to the preset gradient quantization method. Step S102: Each group-level aggregator performs outlier detection on the model update volume reported by all workstations in its group, removes outliers, performs group-level weighted aggregation on the model update volume after outlier detection, determines the corresponding group-level model, evaluates the group-level model based on a preset validation set for key indicators, and uploads the group-level models with evaluation values ​​higher than a preset threshold to the central aggregator. Step S103: The central aggregator receives multiple group-level models and their corresponding group metadata. Based on the group metadata, it calculates a global aggregation weight for each group-level model and performs a weighted average of the group-level models based on the global aggregation weight to determine the corresponding global model. Based on a preset distribution strategy, it distributes the group-level model or the global model to the corresponding workstation for workstation inference.

[0120] As described above, the electronic device provided in this application obtains workstation metadata and constructs clustering keys, dividing the workstations into multiple groups through initial clustering. During the idle period, the workstations locally train to generate model update quantities, which are then reported to the group-level aggregator after quality verification and gradient quantization. Each group-level aggregator performs outlier detection and weighted aggregation on the update quantities to form a group-level model biased towards the data distribution of its own group. After evaluation by key indicators, high-quality models are selected and uploaded to the central aggregator. The central aggregator calculates the global aggregation weight based on the group metadata, performs a weighted average of the group-level models to obtain the global model, and distributes the group-level or global models to the workstations for inference according to the distribution strategy. This enables the support of a multi-model collaborative training architecture under non-IID data distribution, improving the efficiency and robustness of model collaborative training.

[0121] In another implementation, the hierarchical model aggregation method can be configured separately from the central processing unit 9100. For example, the hierarchical model aggregation method can be configured as a chip connected to the central processing unit 9100, and the hierarchical model aggregation method function can be implemented through the control of the central processing unit.

[0122] like Figure 3As shown, the electronic device 9600 may further include: a communication module 9110, an input unit 9120, an audio processor 9130, a display 9160, and a power supply 9170. It is worth noting that the electronic device 9600 does not necessarily need to include these components. Figure 3 All components shown; in addition, the electronic device 9600 may also include Figure 3 For components not shown, please refer to existing technologies.

[0123] like Figure 3 As shown, the central processing unit 9100, sometimes also referred to as a controller or operating control, may include a microprocessor or other processor device and / or logic device, which receives inputs and controls the operation of various components of the electronic device 9600.

[0124] The memory 9140 may be, for example, one or more of a cache, flash memory, hard drive, removable media, volatile memory, non-volatile memory, or other suitable devices. It may store the aforementioned failure-related information, and also store a program for executing that information. The central processing unit 9100 may execute the program stored in the memory 9140 to perform information storage or processing, etc.

[0125] Input unit 9120 provides input to central processing unit 9100. Input unit 9120 may be, for example, a keypad or touch input device. Power supply 9170 provides power to electronic device 9600. Display 9160 displays images and text. Display may be, for example, an LCD display, but is not limited thereto.

[0126] The memory 9140 can be a solid-state memory, such as a read-only memory (ROM), random access memory (RAM), a SIM card, etc. It can also be a memory that retains information even when power is off, can be selectively erased, and contains more data; examples of this type of memory are sometimes referred to as EPROMs. The memory 9140 can also be some other type of device. The memory 9140 includes a buffer memory 9141 (sometimes referred to as a buffer). The memory 9140 may include an application / function storage unit 9142 for storing application programs and function programs or processes for executing the operation of the electronic device 9600 via the central processing unit 9100.

[0127] The memory 9140 may also include a data storage unit 9143 for storing data, such as contacts, digital data, pictures, sounds, and / or any other data used by the electronic device. The driver storage unit 9144 of the memory 9140 may include various drivers for the electronic device for communication functions and / or for performing other functions of the electronic device (such as messaging applications, address book applications, etc.).

[0128] The communication module 9110 is a transmitter / receiver that sends and receives signals via the antenna 9111. The communication module 9110 is coupled to the central processing unit 9100 to provide input signals and receive output signals, which is the same as in a conventional mobile communication terminal.

[0129] Based on different communication technologies, multiple communication modules 9110 can be configured in the same electronic device, such as cellular network modules, Bluetooth modules, and / or wireless LAN modules. The communication module 9110 is also coupled to a speaker 9131 and a microphone 9132 via an audio processor 9130 to provide audio output via the speaker 9131 and receive audio input from the microphone 9132, thereby realizing typical telecommunications functions. The audio processor 9130 may include any suitable buffer, decoder, amplifier, etc. Furthermore, the audio processor 9130 is also coupled to a central processing unit 9100, enabling on-device recording via the microphone 9132 and on-device playback of stored sound via the speaker 9131.

[0130] Embodiments of this application also provide a computer-readable storage medium capable of implementing all steps of the hierarchical model aggregation method with a server or client as the execution subject in the above embodiments. The computer-readable storage medium stores a computer program that, when executed by a processor, implements all steps of the hierarchical model aggregation method with a server or client as the execution subject in the above embodiments. For example, when the processor executes the computer program, it implements the following steps: Step S101: Obtain workstation metadata for multiple workstations, construct clustering keys, perform initial clustering of the multiple workstations based on the clustering keys and the workstation metadata, determine the corresponding multiple workstation groups, each workstation performs local model training during the idle period, determines the corresponding model update amount, performs local quality verification on the model update amount, and uploads the quality-verified model update amount to the group-level aggregator of the workstation group to which the workstation belongs according to the preset gradient quantization method. Step S102: Each group-level aggregator performs outlier detection on the model update volume reported by all workstations in its group, removes outliers, performs group-level weighted aggregation on the model update volume after outlier detection, determines the corresponding group-level model, evaluates the group-level model based on a preset validation set for key indicators, and uploads the group-level models with evaluation values ​​higher than a preset threshold to the central aggregator. Step S103: The central aggregator receives multiple group-level models and their corresponding group metadata. Based on the group metadata, it calculates a global aggregation weight for each group-level model and performs a weighted average of the group-level models based on the global aggregation weight to determine the corresponding global model. Based on a preset distribution strategy, it distributes the group-level model or the global model to the corresponding workstation for workstation inference.

[0131] As described above, the computer-readable storage medium provided in this application embodiment acquires workstation metadata and constructs clustering keys, dividing workstations into multiple groups through initial clustering; workstations locally train and generate model update quantities during idle periods, which are then reported to the group-level aggregator of their respective groups after quality verification and gradient quantization; each group-level aggregator performs outlier detection and weighted aggregation on the update quantities to form a group-level model biased towards the data distribution of its own group, and selects high-quality models after evaluation by key indicators and uploads them to the central aggregator; the central aggregator calculates the global aggregation weight based on the group metadata, performs a weighted average of each group-level model to obtain the global model, and distributes the group-level or global model to workstations for inference according to the distribution strategy, thereby supporting a multi-model collaborative training architecture under non-IID data distribution, improving the efficiency and robustness of model collaborative training.

[0132] Embodiments of this application also provide a computer program product capable of implementing all steps of the hierarchical model aggregation method with the execution subject being a server or client in the above embodiments. When executed by a processor, this computer program / instruction implements the steps of the hierarchical model aggregation method. For example, the computer program / instruction implements the following steps: Step S101: Obtain workstation metadata for multiple workstations, construct clustering keys, perform initial clustering of the multiple workstations based on the clustering keys and the workstation metadata, determine the corresponding multiple workstation groups, each workstation performs local model training during the idle period, determines the corresponding model update amount, performs local quality verification on the model update amount, and uploads the quality-verified model update amount to the group-level aggregator of the workstation group to which the workstation belongs according to the preset gradient quantization method. Step S102: Each group-level aggregator performs outlier detection on the model update volume reported by all workstations in its group, removes outliers, performs group-level weighted aggregation on the model update volume after outlier detection, determines the corresponding group-level model, evaluates the group-level model based on a preset validation set for key indicators, and uploads the group-level models with evaluation values ​​higher than a preset threshold to the central aggregator. Step S103: The central aggregator receives multiple group-level models and their corresponding group metadata. Based on the group metadata, it calculates a global aggregation weight for each group-level model and performs a weighted average of the group-level models based on the global aggregation weight to determine the corresponding global model. Based on a preset distribution strategy, it distributes the group-level model or the global model to the corresponding workstation for workstation inference.

[0133] As described above, the computer program product provided in this application obtains workstation metadata and constructs clustering keys, dividing the workstations into multiple groups through initial clustering. During the idle period, the workstations locally train to generate model update quantities, which are then reported to the group-level aggregator of their respective groups after quality verification and gradient quantization. Each group-level aggregator performs outlier detection and weighted aggregation on the update quantities to form a group-level model biased towards the data distribution of its own group. After evaluation by key indicators, high-quality models are selected and uploaded to the central aggregator. The central aggregator calculates the global aggregation weight based on the group metadata, performs a weighted average of the group-level models to obtain the global model, and distributes the group-level or global models to the workstations for inference according to the distribution strategy. This enables the support of a multi-model collaborative training architecture under non-IID data distribution, improving the efficiency and robustness of model collaborative training.

[0134] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, apparatus, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0135] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (devices), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0136] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0137] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0138] Specific embodiments have been used to illustrate the principles and implementation methods of this invention. The descriptions of the embodiments above are only for the purpose of helping to understand the method and core ideas of this invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this invention. Therefore, the content of this specification should not be construed as a limitation of this invention.

Claims

1. A hierarchical model aggregation method, characterized in that, The method includes: Obtain workstation metadata for multiple workstations, construct clustering keys, perform initial clustering of the multiple workstations based on the clustering keys and the workstation metadata, determine the corresponding multiple workstation groups, each workstation performs local model training during the idle period, determines the corresponding model update amount, performs local quality verification on the model update amount, and uploads the quality-verified model update amount to the group-level aggregator of the workstation group to which the workstation belongs according to a preset gradient quantization method. Each group-level aggregator performs outlier detection on the model update volume reported by all workstations within its group, removes outliers, performs group-level weighted aggregation on the model update volume after outlier detection, determines the corresponding group-level model, evaluates the group-level model based on a preset validation set for key indicators, and uploads the group-level model with the evaluation value higher than the preset threshold to the central aggregator. The central aggregator receives multiple group-level models and their corresponding group metadata. Based on the group metadata, it calculates a global aggregation weight for each group-level model and performs a weighted average of the group-level models based on the global aggregation weight to determine the corresponding global model. The group-level model or the global model is then distributed to the corresponding workstation for workstation inference according to a preset distribution strategy.

2. The hierarchical model aggregation method according to claim 1, characterized in that, The construction of the clustering key includes: Obtain the workstation properties of each workstation, including the physical properties of the workstation equipment, optical imaging properties, properties of the detected materials, properties of the production process, and properties of the operating conditions; Based on at least one of the workstation properties or a combination of multiple workstation properties, a clustering key is constructed so that workstation groups clustered according to the clustering key have the same data collection conditions or similar data distributions.

3. The hierarchical model aggregation method according to claim 1, characterized in that, The local quality verification includes: Verify whether the gradient norm of the model update is within the preset norm range; Verify whether the difference between the model update amount and the previous local model is lower than a preset difference threshold; Verify the quality of sample annotations at the workstation during the training process, and remove update amounts with annotation noise exceeding a preset noise threshold.

4. The hierarchical model aggregation method according to claim 1, characterized in that, Each of the group-level aggregators performs outlier detection on the model update amounts reported by all workstations within its group, removing outliers, including: Each group-level aggregator performs similarity calculations on the model update amounts reported by all workstations within its group, and identifies and removes update amounts whose average similarity with other update amounts is lower than a preset similarity threshold as outliers. Alternatively, a clustering-based method can be used to identify and remove update values ​​that do not belong to any main cluster as outliers.

5. The hierarchical model aggregation method according to claim 1, characterized in that, The weighting factors for the group-level weighted aggregation include: The sample size of the workstation, the model update confidence score of the workstation, the typicality score of the workstation data distribution, the historical contribution of the workstation, and the degree of recent performance drift of the workstation are all considered.

6. The hierarchical model aggregation method according to claim 1, characterized in that, The central aggregator receives multiple group-level models and their corresponding group metadata. Based on the group metadata, it calculates a global aggregation weight for each group-level model, including: The central aggregator receives multiple group-level models and their corresponding group metadata, including at least one of the following: number of workstations within the group, total number of samples, group-level model performance metrics, and model update timestamps. Based on the group metadata, a global aggregation weight is calculated for each group-level model. The global aggregation weight is positively correlated with the number of workstations in the group, the total number of samples, and the performance index of the group-level model, and negatively correlated with the model update time delay.

7. The hierarchical model aggregation method according to claim 1, characterized in that, The distribution strategy includes: For each workstation, the group-level model of its respective workstation group is distributed first for online inference; When a new workstation is added, a workstation encounters new materials, or the inference confidence of the current group-level model of the workstation is lower than the preset confidence threshold, the global model is sent out for cold start or fallback inference. When the workstation is in the experimental mode or gray release stage, candidate group-level models or candidate global models are issued and the inference results are compared with the current stable model.

8. The hierarchical model aggregation method according to claim 1, characterized in that, The method further includes: Assign a unique version number to each workstation model, each group-level model, and the global model, and associate the model version with production metadata records. When a workstation or group is found to have key performance indicators that are lower than the preset rollback threshold after the model is updated, a rollback command is automatically triggered to restore the workstation or group to the previous stable version model.

9. The hierarchical model aggregation method according to claim 1, characterized in that, The method further includes a multi-level extension step: The workstation group is defined as a primary group, and multiple primary groups are divided into secondary groups according to the production line or factory dimension. A secondary group aggregator is added between the central aggregator and the primary group aggregator. In this process, the first-level group aggregator uploads the group-level model to its subordinate second-level group aggregator for second-level aggregation to determine the corresponding production line-level model or factory-level model. Then, the central aggregator performs global aggregation on the models reported by multiple second-level group aggregators.

10. A hierarchical model aggregation device, characterized in that, The device includes: The workstation model update module is used to obtain workstation metadata of multiple workstations, construct clustering keys, perform initial clustering of the multiple workstations based on the clustering keys and the workstation metadata, determine the corresponding multiple workstation groups, each workstation performs local model training during the idle period, determines the corresponding model update amount, performs local quality verification on the model update amount, and uploads the quality-verified model update amount to the group-level aggregator of the workstation group to which the workstation belongs according to a preset gradient quantization method. The group-level model determination module is used for each group-level aggregator to perform outlier detection on the model update volume reported by all workstations in the group, remove outliers, perform group-level weighted aggregation on the model update volume after outlier detection, determine the corresponding group-level model, evaluate the group-level model based on a preset validation set, and upload the group-level model with the evaluation value higher than the preset threshold to the central aggregator. The global model determination module is used by the central aggregator to receive multiple group-level models and their corresponding group metadata, calculate a global aggregation weight for each group-level model based on the group metadata, perform a weighted average of each group-level model based on the global aggregation weight, determine the corresponding global model, and distribute the group-level model or the global model to the corresponding workstation according to a preset distribution strategy for workstation inference.