Surgical navigation large model weight channel grouping compression method and related device
By performing weighted channel grouping and compression on the large surgical navigation model, and using mutual information matrix for clustering and bit allocation, the problems of quantization accuracy and inference speed of the end-side model of the composite surgical robot are solved, and the real-time response capability of the model in complex surgical scenarios is improved.
Patent Information
- Application Number
- CN202610176803.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-02-06
- Publication Date
- 2026-05-12
AI Technical Summary
Existing large-scale models for end-to-end surgical navigation in hybrid surgical robots struggle to balance quantization accuracy and inference speed, making them unsuitable for multimodal surgical navigation scenarios and unable to meet real-time navigation requirements.
By calculating the activation sampling of each layer of the surgical navigation model, flattening it into a two-dimensional matrix, calculating the mutual information matrix between channels, performing clustering and grouping, allocating the number of discrete bits according to the average importance of the group, and pruning and quantizing the weight parameters.
It achieves improved inference speed while maintaining navigation accuracy, adapts to the real-time response requirements of complex surgical scenarios, and reduces model size and computational load.
Smart Images

Figure CN122021769A_ABST
Abstract
Description
Technical Field
[0001] This application pertains to a large model optimization method, specifically involving a method for weighted channel grouping and compression of a large surgical navigation model and related apparatus. Background Technology
[0002] In recent years, the development of large-scale multimodal models has provided a feasible foundation for multimodal data processing and navigation in complex surgical scenarios. However, hybrid surgical robots require extremely low latency to achieve real-time decision-making and avoid safety hazards, and existing large-scale models are insufficient in terms of operating speed and computational complexity. Addressing the terminal hardware requirements of intelligent hybrid surgical robots, edge deployment of large-scale multimodal surgical navigation models can achieve efficient local computation, ensuring data security, accurate decision-making, and immediate response, thereby improving the safety and reliability of the navigation system. Currently, small and sophisticated edge-deployable domain models have become a research hotspot.
[0003] Edge computing can reduce reliance on network connectivity and adapt to surgical scenarios with poor network conditions. However, large-scale edge-based surgical navigation models for hybrid surgical robots face two major challenges: First, parameter quantization is difficult. The model has a large number of parameters, and efficient quantization requires balancing computational accuracy with parameter compression. How to mine parameter correlations, maximize information content, and achieve efficient edge-based parameter encoding and error-controllable quantization remains a challenge. Second, inference speed is slow. The model needs to handle a large amount of computation and concurrent data streams. With limited terminal hardware resources, it is difficult to achieve high-speed response for different surgical tasks.
[0004] Therefore, existing related technologies still have obvious shortcomings. The quantization schemes lack channel correlation mining, have rigid bit allocation, poor coordination between pruning and quantization, and are difficult to adapt to multimodal surgical navigation scenarios. They cannot balance quantization accuracy and inference speed, and cannot meet the low latency requirements of real-time navigation of composite surgical robots. An optimized solution is urgently needed to solve the above problems. Summary of the Invention
[0005] This application addresses the technical problem that existing large-scale surgical navigation models for end-to-end surgical robots cannot balance quantization accuracy and inference speed, making them difficult to adapt to multimodal surgical navigation scenarios. It provides a method and related apparatus for weighted channel grouping compression of large-scale surgical navigation models.
[0006] To achieve the above objectives, this application adopts the following technical solution: Firstly, this application proposes a method for weighted channel grouping compression of a large surgical navigation model, including: Activation sampling is performed on each layer of the large surgical navigation model to obtain sampled activations, which are then flattened into a two-dimensional matrix; the rows in the two-dimensional matrix represent different samples, and the columns represent different channels. Calculate the mutual information matrix between channels during sampling activation; The mutual information matrix is used as the similarity matrix between channels to cluster and group the channels. Based on the average importance of each group in the clustering, a number of discrete bits are assigned to each group. The weight parameters of the large surgical navigation model are pruned, and the pruned weight parameters are quantized based on the number of discrete bits allocated to each group.
[0007] Furthermore, the method for calculating the mutual information matrix between channels during sampling activation includes: The mutual information values in the mutual information matrix are calculated using the following formula:
[0008] in, For the first The first channel and the first The mutual information value of each channel, For the first The first channel and the first Pearson correlation coefficient for each channel, For the first The first channel and the first Covariance of each channel; The calculated mutual information values are normalized to obtain a normalized mutual information matrix.
[0009] Furthermore, the method for calculating the mutual information matrix between channels during sampling activation includes: The mutual information values in the mutual information matrix are calculated using the following formula:
[0010] in, For the first The first channel and the first The mutual information value of each channel, To activate the number of discretized intervals, For the first The first channel and the first The joint probability distribution of the channels, For the first The edge probability distribution of each channel For the first The marginal probability distribution of each channel; The calculated mutual information values are normalized to obtain a normalized mutual information matrix.
[0011] Furthermore, the method for clustering and grouping channels includes: Mapping the mutual information values in the mutual information matrix to similarity values yields a similarity matrix; By combining the similarity matrix and the mutual information matrix, the Laplace matrix is obtained; The Laplacian matrix is subjected to eigenvalue decomposition, and the eigenvectors corresponding to the smallest preset number of eigenvalues are selected to form an intermediate matrix. Perform K-means clustering on the row vectors of the intermediate matrix to obtain the ID of each channel; The optimal number of groups is determined by silhouette coefficients, and the channel list, group size, and average importance of each group are calculated as the clustering grouping results.
[0012] Furthermore, the method for allocating discrete bits to each group based on the average importance of each group in the clustering group includes: The groups are sorted in descending order based on their average amplitude or variance to obtain the priority ranking results. Allocate a larger number of discrete bits to higher priority groups and ensure that the global average bit meets the target average bit.
[0013] Furthermore, the method for pruning the weight parameters of the large surgical navigation model and quantizing the pruned weight parameters based on the number of discrete bits allocated to each group includes: The weight parameters of the large surgical navigation model are pruned based on the Hessian matrix approximation method; The quantization upper bound is calculated based on the number of discrete bits allocated to each group; Based on the upper bound of quantization, linear quantization is performed on the pruned weight parameters.
[0014] Furthermore, after performing linear quantization on the pruned weight parameters, the process also includes: The quantization error is calculated using the following formula and then fed back to the large surgical navigation model:
[0015] in, For quantization error, These are the quantized weight parameters. These are the weight parameters after pruning. This is the upper bound for quantification.
[0016] Secondly, this application proposes a surgical navigation large model weighted channel grouping compression system, comprising: The sampling module is used to perform activation sampling on each layer of the large surgical navigation model to obtain sampled activations, and then flatten the sampled activations into a two-dimensional matrix; the rows in the two-dimensional matrix represent different samples, and the columns represent different channels. The calculation module is used to calculate the mutual information matrix between channels during sampling activation; The grouping module is used to cluster and group channels by using the mutual information matrix as the similarity matrix between channels. The allocation module is used to allocate a number of discrete bits to each group based on the average importance of each group in the clustering group; The pruning and quantization module is used to prune the weight parameters of the large surgical navigation model and quantize the pruned weight parameters based on the number of discrete bits allocated to each group.
[0017] Thirdly, this application proposes 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 computer program to implement the steps of the above-described surgical navigation large model weighted channel grouping compression method.
[0018] Fourthly, this application proposes a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the above-described surgical navigation large model weighted channel grouping compression method.
[0019] Compared with the prior art, this application has the following beneficial effects: This application proposes a weighted channel grouping compression method for a large-scale surgical navigation model. After obtaining the sampled activations, the sampled activations are flattened into a two-dimensional matrix. Then, the mutual information matrix between channels in the sampled activations is calculated. The mutual information is used to capture the statistical relationships between channels, enabling the identification and merging of redundant channels and reducing unnecessary computation. The mutual information matrix is then used as the channel similarity matrix. Channels are clustered using spectral clustering. Based on the average importance of each cluster, a number of discrete bits are allocated to each group. Bits are dynamically allocated based on group-level importance, tilting resources towards key channels and reducing the perplexity of the large model under the same average bit budget. This method balances end-side hardware efficiency and navigation accuracy, improving the inference speed of the large-scale surgical navigation model while controlling sparsity and bit cost, thus meeting the real-time response requirements of complex surgical scenarios.
[0020] This application also proposes a surgical navigation large model weighted channel grouping compression system, an electronic device, and a computer-readable storage medium, which possesses all the advantages of the aforementioned surgical navigation large model weighted channel grouping compression method. Attached Figure Description
[0021] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1This is a flowchart illustrating a weighted channel grouping compression method for the large surgical navigation model in this application. Figure 2 This is a schematic diagram of another process for the weighted channel grouping compression method of the large surgical navigation model in this application; Figure 3 This is a schematic diagram of the surgical navigation large model weighted channel grouping compression system of this application. 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, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0024] Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0025] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0026] In the description of the embodiments of this application, it should be noted that if terms such as "upper," "lower," "horizontal," or "inner" indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, or the orientation or positional relationship commonly used when the product of the invention is in use, they are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation on this application. In addition, terms such as "first" and "second" are only used to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0027] Furthermore, the use of the term "horizontal" does not imply that the component must be absolutely horizontal, but rather that it can be slightly tilted. For example, "horizontal" simply means that its direction is more horizontal than "vertical," and does not mean that the structure must be completely horizontal, but can be slightly tilted.
[0028] In the description of the embodiments of this application, it should also be noted that, unless otherwise explicitly specified and limited, the terms "set," "install," "connect," and "link" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this application according to the specific circumstances.
[0029] In recent years, the development of large multimodal models has provided a feasible foundational tool for multimodal data processing and navigation in complex surgical scenarios. However, due to the need for extremely low latency in hybrid surgical robots to make real-time decisions in complex surgical scenarios and reduce potential safety hazards, existing large models are insufficient in terms of operating speed and computational complexity. Addressing the terminal hardware requirements of embodied intelligence hybrid surgical robots, edge deployment of large multimodal surgical navigation models enables efficient local computation, ensuring efficient and secure data transmission, high-precision decision-making, and immediate response, thereby improving the safety and reliability of the navigation system. With the parameter scale of traditional large models becoming increasingly large, the pursuit of small and precise edge-deployable domain models has become a hot research topic.
[0030] Edge computing reduces reliance on network connectivity, enabling navigation systems to function even under poor network conditions, making it particularly suitable for scenarios like hybrid surgical robots. However, the large-scale edge-side surgical navigation model for hybrid surgical robots also faces two major challenges: (1) It is difficult to quantify the parameters of the large surgical navigation model.
[0031] The sheer volume of parameters in large surgical navigation models makes quantization difficult. Efficient parameter quantization techniques require a balance between computational accuracy and the degree of parameter compression and quantization to ensure navigation precision. Addressing the issue of the large number of parameters in large surgical navigation models presents a significant challenge: identifying the correlations between these parameters, efficiently encoding end-side parameters while maximizing the information content of the large surgical navigation model, and achieving quantization with controllable end-side model errors.
[0032] (2) The reasoning speed of the large surgical navigation model is slow.
[0033] Large models, while performing numerous matrix and nonlinear operations, require the ability to handle concurrent data streams from multiple human-computer interaction objects, resulting in slow inference speeds for large surgical navigation models. Under the constraint of limited hardware resources in surgical robot terminals, discovering effective parameter sets for different surgical tasks and achieving high-speed response during navigation model inference is the second major challenge.
[0034] To address the aforementioned challenges, this application aims to utilize mutual information to measure channel correlation, perform grouping and differentiated quantization, further reduce perplexity and redundant computation while maintaining sparsity and average bit budget, and ultimately improve the inference speed of large models in complex surgical scenario navigation applications. Existing technologies have yielded some related research: (1) Large model parameter quantization algorithms. For the quantization and encoding problem of large model parameters in surgical navigation, it is particularly important to study how to efficiently encode parameters by discovering the correlation between large model parameters while maximizing model information. For example, quantization maps floating-point numbers to low-bit integers, reducing the size of large language models and inference costs. One study proposed a method to optimize large-scale Transformer models using 8-bit matrix multiplication, employing a mixed-precision quantization strategy. It only performs 8-bit quantization on most weight parameters, while retaining some weights crucial to model performance in high precision, thus avoiding a significant impact of quantization on model precision and maintaining a low perplexity value. However, the hardware efficiency of mixed-precision format is low; processing 8-bit and high-precision data requires switching computation modes, which may reduce hardware execution efficiency and speed. Other studies have proposed a robust model estimation method based on information theory and preference analysis, which can effectively reduce redundant parameters in multi-structured data. Utilizing optimal sampling and model fitting from information theory, it ensures the accuracy and stability of large model parameters in complex surgical navigation environments. However, this method optimizes parameter selection and sampling, not parameter encoding or quantization methods, thus offering relatively limited support for high-dimensional data scenarios in surgical navigation. Other studies have proposed a method for efficient parameter fine-tuning of large multimodal models. This method discretizes the parameters of a pre-trained large model and uses low-rank representation from information theory to compress the model's parameters into a smaller subspace for processing. It also uses LoRA layers to reduce the number of parameters required during training and inference, thereby ensuring the efficient operation of large surgical navigation models in complex environments. However, in high-dimensional and complex data scenarios, the compression process may lead to a decrease in model accuracy. Furthermore, the mining and utilization of correlations between parameters are insufficient, leaving room for further optimization. Therefore, for the problem of large model parameters, existing methods mainly focus on quantizing large models through information theory and efficient parameter tuning techniques. However, these methods generally lack in-depth exploration and utilization of the correlation between model parameters, and cannot make full use of information compression technology to achieve efficient parameter encoding. Although the model can be run in a resource-constrained hardware environment, there is still room for improvement in removing redundant parameters and reducing quantization errors. (2) Edge-side large model inference acceleration algorithm. When deploying large models on edge devices, parameter selective activation is an effective way to improve inference efficiency and reduce computational costs. Some studies have proposed a pruning method based on the Fisher information matrix, which optimizes the network structure by measuring the importance of neurons and synapses.This method estimates parameter importance using local activity statistics, guiding structured pruning of neural networks to reduce unnecessary parameters and improve model efficiency. Another research proposes a structured pruning method called LLM-Pruner. This method reduces model parameters by pruning the attention head and redundant parts in the feedforward network. Specifically, LLM-Pruner determines the pruning region based on the specific contribution of each layer, achieving refined pruning while maintaining high accuracy and reducing model size. However, this method significantly reduces the model's inference ability at high compression rates, indicating room for further optimization of pruning criteria. Another research proposes a reasoning-aware structured pruning technique, ZipLM, focusing on improving inference speed. It prunes redundant structures dynamically during inference, maintaining efficiency. However, its limitation is that the robustness of the model to certain tasks decreases after pruning, requiring additional adjustment of model weights to recover some performance. Yet another research proposes a fluctuation-based adaptive structured pruning method, utilizing the fluctuations in parameter importance during training for pruning. This adaptive pruning method ensures that important computational structures are preserved while compressing the model, resulting in a smaller performance degradation. However, due to the need to frequently track gradient fluctuations, its computational overhead is high, significantly extending training time. Although existing pruning techniques have made significant progress in improving the efficiency of large-scale model deployment on edge devices, edge deployment for embodied intelligent composite surgical robot navigation still faces many challenges. First, the multimodal data fusion problem is extremely complex. Surgical navigation models need to integrate multi-source data such as medical images, robot motion, and physiological monitoring, while being limited by the computing resources of edge devices, requiring efficient processing while ensuring performance. Second, large surgical navigation models have a large number of parameters. The pruned model still needs to ensure a balance between the accuracy of parameter quantization and compression to guarantee the reliability of the model in surgical navigation tasks with extremely high accuracy requirements. Finally, large models require a large number of matrix operations and nonlinear calculations during inference, while simultaneously handling concurrent human-computer interaction data streams, placing higher demands on the inference speed of the pruned model. Further optimization of model structure and pruning strategies is needed to cope with the challenges of complex real-time scenarios.
[0035] Based on the above, this application proposes a method and related apparatus for weighted channel grouping compression of a large surgical navigation model. The following is a detailed description of this application in conjunction with embodiments and accompanying drawings.
[0036] like Figure 1 The diagram shown is a flowchart of a method for weighted channel grouping and compression of a large surgical navigation model according to this application, which may include: S101, activate sampling is performed on each layer of the surgical navigation big model to obtain sampled activation, and the sampled activation is flattened into a two-dimensional matrix; the rows in the two-dimensional matrix represent different samples and the columns represent different channels.
[0037] It should be noted that activation data is the feature data output by each network layer of the surgical navigation model after processing the input data. It is the core carrier for the model to convey navigation-related features. By selectively sampling the activations of each layer of the model, sampled activations that reflect the data characteristics of typical surgical navigation scenarios can be obtained. These activations are then flattened into a two-dimensional matrix where rows correspond to samples and columns correspond to channels. This transforms the high-dimensional activation tensor into a regular data format that facilitates subsequent channel-dimensional statistics and calculations, laying a data foundation for subsequent operations such as channel correlation analysis and clustering. This application obtains activation data that characterizes the features of surgical navigation scenarios through selective sampling, avoiding redundant data processing caused by indiscriminate sampling and reducing computational resource consumption. The flattened two-dimensional matrix regularizes the correspondence between channels and samples, providing a unified and clear data carrier for all subsequent channel-centric analysis operations, improving the execution efficiency of subsequent steps. Simultaneously, it completely preserves the feature information of each channel, ensuring the accuracy of subsequent analysis results.
[0038] S102, calculate the mutual information matrix between channels during sampling activation.
[0039] It should be noted that mutual information is a quantitative indicator that measures the degree of correlation between two random variables, effectively reflecting the strength of the correlation between the features carried by different channels in the large-scale surgical navigation model. Based on the two-dimensional matrix obtained in step S101, the mutual information value between any two channels is calculated. Then, a matrix is constructed by assigning the mutual information values between all channels according to their rows and columns, thus obtaining the channel mutual information matrix. This matrix can completely present the correlation between all channels in a numerical form, providing a quantitative basis for subsequent channel clustering using it as a similarity matrix. The mutual information value accurately quantifies the degree of feature correlation between channels, and compared to indicators such as correlation coefficients, it can more comprehensively reflect linear and nonlinear correlations, aligning with the feature correlation characteristics of multimodal surgical navigation data. The mutual information matrix completely presents the correlation between all channels, providing a unified and quantitative similarity judgment standard for subsequent clustering, ensuring the scientific nature of the clustering grouping.
[0040] S103 uses the mutual information matrix as the channel similarity matrix to cluster and group the channels.
[0041] The magnitude of the values in the mutual information matrix directly reflects the strength of the feature correlation between channels. A larger value indicates a higher correlation between channels, meaning a higher similarity. Therefore, the mutual information matrix can be directly used as the channel similarity matrix. Clustering all channels based on this similarity matrix allows channels with high correlation and similar surgical navigation features to be grouped together, achieving refined channel classification. This enables subsequent bit allocation and quantization operations to be performed on a group basis, improving the targeting of compression operations. No additional similarity conversion is needed for the mutual information matrix; it can be used directly for clustering, reducing data processing steps and improving clustering efficiency. Grouping highly correlated channels together ensures that channels within the same group carry similar surgical navigation features, providing a reasonable operational unit for subsequent bit allocation and quantization by group, avoiding the high complexity of operating on individual channels separately. Clustering achieves differentiated channel classification, allowing subsequent compression operations to be performed accurately based on group characteristics, balancing compression performance and model accuracy.
[0042] S104. Assign a number of discrete bits to each group based on the average importance of each group in the clustering.
[0043] It should be noted that after clustering, the importance of surgical navigation features carried by each group of channels varies. The average importance of a group comprehensively reflects its contribution to the overall inference accuracy of the large surgical navigation model. The higher the importance of a group, the more critical its core features. Allocating different discrete bits to each group based on its average importance allows for differentiated bit allocation. This ensures that high-importance groups carrying core features receive more bits, guaranteeing the accuracy of feature representation, while low-importance groups receive fewer bits, achieving efficient compression and balancing model accuracy and compression ratio. The average importance of groups enables accurate determination of the feature value of each channel, providing a scientific basis for bit allocation. This differentiated allocation of discrete bits ensures the quantization accuracy of core feature channels while achieving efficient compression of secondary feature channels, maximizing the balance between compression ratio and inference accuracy of the large surgical navigation model. Furthermore, the discrete bit configuration is compatible with the quantization interface of the edge hardware, requiring no additional hardware adaptation and reducing the implementation cost of the solution.
[0044] S105 prunes the weight parameters of the large surgical navigation model and quantizes the pruned weight parameters based on the number of discrete bits allocated to each group.
[0045] It should be noted that some redundant weights in the surgical navigation model's weight parameters contribute very little to the model's inference accuracy. Pruning these redundant weights can directly remove them, reducing the model's parameter size and computational load from the source. After pruning, based on the number of discrete bits allocated to each group in step S104, the pruned weight parameters within the same group are uniformly quantized. This converts high-precision floating-point weight parameters into low-bit integer parameters, achieving efficient model compression. Furthermore, uniform quantization within a group improves the efficiency of the quantization operation and adapts to the computational characteristics of the edge hardware.
[0046] This application focuses on channel-based analysis and operation throughout the entire process. Through clustering and grouping, it achieves refined channel classification, ensuring targeted bit allocation and quantization operations. This avoids the loss of core feature accuracy caused by indiscriminate overall compression, guaranteeing the inference accuracy of the compressed surgical navigation model and meeting the high-precision requirements of surgical navigation for core functions such as instrument positioning and path planning. Simultaneously, the dual compression method combining pruning and quantization removes redundant weights at the source and then performs differentiated quantization on core weights, significantly reducing the model parameter size and computational load. This effectively improves the model's compression ratio, allowing the compressed model to adapt to the lightweight hardware deployment requirements of surgical navigation endpoints and reducing hardware costs. Furthermore, based on regularized data analysis and computation, this application boasts high execution efficiency at each step, and all compression operations are compatible with the computation and quantization interfaces of the endpoint hardware, requiring no additional hardware modifications, thus demonstrating strong feasibility and practicality. Meanwhile, the differentiated bit allocation and unified quantization within the group allow the model to maintain good feature representation ability after compression, and the computational load during edge operation is greatly reduced, improving the inference speed of the model and perfectly adapting to the real-time requirements of surgical navigation.
[0047] like Figure 2 The diagram shown is another flowchart illustrating the surgical navigation large model weighted channel grouping compression method of this application, which may include: Step S1: Activate sampling and statistical collection.
[0048] For multimodal inputs in complex surgical robot navigation scenarios, such as medical image features, robot motion data, and physiological monitoring signals, the activation of each layer is sampled during the forward inference stage of the large surgical navigation model, and the channel importance is statistically analyzed while the memory occupancy on the control side is being monitored.
[0049] It should be noted that "layer" here refers to the basic structural unit in the large surgical navigation model, and each layer has corresponding calculation rules and weight parameters. Activation refers to the output result obtained by each layer after processing the input data.
[0050] Specifically, the following methods can be used: First, activation sampling is performed. ≤20 batches of input activations are selected to cover the input distribution of typical surgical navigation scenarios, avoiding oversampling that could lead to memory overflow. This data is used to transmit key information through the activations of each layer of the model, reasonably controlling on-device memory usage without affecting the accuracy of subsequent channel importance statistics.
[0051] Then, data format conversion is performed. The sampling activation tensor is flattened into a two-dimensional matrix. ,in, For the sample size, This represents the number of channels.
[0052] Finally, channel importance is calculated. Channel importance is quantified using amplitude and variance. The formula for calculating the average channel amplitude is as follows: (1) in, For the first The average amplitude of each channel, The second in a two-dimensional matrix The first sample Data from each channel.
[0053] The formula for calculating channel variance is as follows: (2) in, For the first The variance of each channel, For the first The average value of each channel.
[0054] S202, Mutual Information Matrix Calculation.
[0055] Using the sampling activation in step S201 as input, calculate the mutual information matrix between channels.
[0056] Among them, mutual information matrix elements in Indicates the first The first channel and the first The mutual information value of each channel. Specifically, the mutual information value can be calculated using the following two methods: (1) Fast approximation calculation: The mutual information approximation formula based on Pearson correlation coefficient (ρ) can balance efficiency and accuracy, and adapt to the real-time requirements of surgical navigation. (3) in, For the first Channel and the first The Pearson correlation coefficient of the channel, For the first The first channel and the first The covariance of the i-th channel, the i-th The variance of each channel.
[0057] (2) Precise calculation and small-scale verification.
[0058] Mutual information is calculated using the histogram method, adapted to non-Gaussian distributed surgical navigation data. The specific calculation formula is as follows: (4) in, To activate the number of discretized intervals, For the first The first channel and the first The joint probability distribution of the channels, For the first The edge probability distribution of each channel For the first The marginal probability distribution of each channel.
[0059] It should be noted that both of the above methods can be used to normalize the mutual information matrix using the following formula to eliminate the influence of dimensions and obtain a normalized mutual information matrix:
[0060] in, For the normalized first The first channel and the first The mutual information values of each channel. In practical applications, a fast approximation calculation method can be used as the default scheme on the end side.
[0061] In practical applications, the correlation coefficient can be approximated by MI estimation based on kernel density estimation or variational lower bound to improve accuracy.
[0062] S203, Channel clustering grouping.
[0063] Normalized mutual information matrix As the inter-channel similarity matrix, spectral clustering is performed to obtain the grouping results, which can be achieved through the following methods: (1) Construct the Laplace matrix: map mutual information values to similarity. The similarity matrix is obtained. Calculate the diagonal matrix. diagonal matrix elements on the diagonal Equal to the similarity matrix No. The sum of all elements in the row. Finally, the Laplace matrix is calculated using the formula: .
[0064] (2) Spectral dimensionality reduction: for the Laplace matrix Perform eigenvalue decomposition, select the eigenvectors corresponding to the k smallest eigenvalues, and form a matrix. .
[0065] (3) K-means clustering: Perform K-means clustering on the row vectors of matrix U and output the group ID of each channel.
[0066] (4) Group quality assessment: The optimal number of groups is automatically selected using the profile coefficient. Specifically, the following formula can be used:
[0067] in, For the first The average distance from each channel to the other channels in the same group For the first The average distance from each channel to the nearest heterogeneous group For the first The profile coefficients of each channel. Then the global profile coefficients are the profile coefficients of all channels. The closer the mean is to 1, the better the grouping effect.
[0068] (5) Final output of grouping results: Calculate the channel list, group size and average importance of each group. The average importance of the group can be determined by dividing the channel amplitude within the group by the mean variance.
[0069] In practical applications, in addition to the clustering methods mentioned above, hierarchical clustering, graph community discovery algorithms, or clustering with sparse constraints can also be used to obtain a smaller number of groups. S204, Group-level bit allocation.
[0070] Specifically, this can be achieved through the following methods: Based on the group average importance and the target average bits Each group is allocated a discrete number of bits: 2 bits, 3 bits, 4 bits, 6 bits, or 8 bits. (1) Group importance ranking: Arranged in descending order of group average amplitude / variance, the priority ranking result is as follows: .in, The highest priority group The group with the second highest priority. For the first Priority groups.
[0071] (2) Bit allocation constraints: Ensure that the global average bit satisfies:
[0072] in, For the first Number of channels in a group For the first Group allocation bit count, This represents the total number of channels.
[0073] (3) Differentiated allocation: 6 bits or 8 bits are allocated to the high priority group, and 2 bits or 3 bits are allocated to the low priority redundant group. After allocation, the average bit deviation is checked, and readjustment is performed when the deviation exceeds 1%.
[0074] The above allocation method can achieve high bit count for important channels to ensure accuracy, while low bit count for redundant channels can reduce overhead, thus forming differentiated quantization. This not only adapts to the limitations of on-side memory or computational load, but also ensures the inference accuracy of the surgical navigation model.
[0075] In practical applications, reinforcement learning or integer linear programming can be incorporated to accurately satisfy the global bit budget, or mixed precision within groups can be introduced.
[0076] S205, pruning and intragroup quantification.
[0077] For the weight parameters of the large surgical navigation model, uniform quantization within the group is performed after pruning, while retaining the error compensation mechanism. This can be achieved through the following methods: (1) Weight pruning: Remove redundant weights based on the Hessian matrix approximation method to reduce the computational load on the end side.
[0078] It should be noted that the Hessian matrix approximation method is an engineering optimization of the exact calculation. By simplifying the calculation of second-order partial derivatives and using intermediate data from the model's forward and backward inference for approximate estimation, the computational complexity and memory usage of the Hessian matrix are reduced to a level that can be handled by the edge computing platform, while sacrificing minimal computational accuracy. All weights with importance values below a threshold, i.e., redundant weights, can be directly set to 0, and their removal significantly reduces the number of parameters in the model.
[0079] (2) Intra-group quantization: Based on the bit allocation results, look up the table to obtain the number of bits b in the group to which the channel belongs, and calculate the upper bound of quantization:
[0080] in, This is the upper bound for quantification.
[0081] In practical applications, a mapping table can be constructed based on the initial group-level bit allocation results, linking channels to their respective groups and corresponding bit counts. For each channel in the large surgical navigation model, the number of bits (b) allocated to its group can be quickly obtained by looking up the table. Then, based on this bit count (b) and the distribution characteristics of the effective weight parameters after weight pruning, the upper bound of the quantization for that channel group can be calculated. This defines a unified numerical boundary for subsequent linear quantization of the pruned weights, enabling all channels within the same channel group to perform unified quantization with the same number of bits. This ensures consistency in quantization rules, adapts to the quantization calculation requirements of the edge hardware, and lays a parameter foundation for accurate execution of subsequent linear quantization, improving edge quantization efficiency while controlling quantization errors.
[0082] (3) Weight parameters after pruning Perform linear quantization:
[0083] in, These are the quantized weight parameters.
[0084] (4) Error compensation.
[0085] The quantization error is calculated using the following formula. :
[0086] After the calculation is completed, the quantization error is fed back to the large surgical navigation model to reduce the impact of quantization on the accuracy of surgical navigation.
[0087] S206, Statistics and Derivation.
[0088] In practical applications, key information can be stored using structured data. Specifically, bit distribution stores the channel proportion corresponding to each number of bits and the average number of bits per layer. Grouping information stores the number of channels in each group, average importance, and allocated bits. Performance metrics store the model error before and after quantization and the improvement rate in inference speed. Statistical results are exported in a structured format, supporting model optimization in surgical navigation scenarios.
[0089] In practical applications, group information can be exported in a hardware-friendly block sparse / group quantization format, facilitating shared scaling factor caching and vectorized loading on accelerators. To validate the method presented in this application, a complete prototype has been presented. The feasibility of the fast mutual information calculation mode has been verified on surgical scenario sample data, demonstrating its ability to stably generate groups and output bit distributions. Large-scale model pre-experiments show that, compared to existing quantization or pruning schemes, the perplexity of large models is further reduced under the same bit budget, and the edge-side inference speed is improved, meeting the core requirements of low latency and high accuracy in surgical navigation. The mutual information matrix calculation and grouping quality were evaluated using the Silhouette Score in small-scale simulations, and no numerical instability was observed.
[0090] This application delves into channel correlations, resulting in smaller quantization errors and superior surgical navigation accuracy. By sharing quantization configurations across groups, it reduces the storage and access overhead of quantization parameters, while concentrating saved bits on key channels, thus improving effective bit utilization. Automated grouping and bit allocation reduce manual parameter tuning costs and can adapt to the statistical characteristics of different models or layers. Finally, the visualization of the mutual information matrix and group statistics provide interpretability, which is beneficial for further optimization of large-scale model structures.
[0091] like Figure 3 The diagram shown is a schematic of a surgical navigation large model weighted channel grouping compression system according to this application, which may include: The sampling module is used to perform activation sampling on each layer of the large surgical navigation model to obtain sampled activations, and then flatten the sampled activations into a two-dimensional matrix; the rows in the two-dimensional matrix represent different samples, and the columns represent different channels. The calculation module is used to calculate the mutual information matrix between channels during sampling activation; The grouping module is used to cluster and group channels by using the mutual information matrix as the similarity matrix between channels. The allocation module is used to allocate a number of discrete bits to each group based on the average importance of each group in the clustering group; The pruning and quantization module is used to prune the weight parameters of the large surgical navigation model and quantize the pruned weight parameters based on the number of discrete bits allocated to each group.
[0092] It should be noted that, in the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the system embodiments described above are merely illustrative; for instance, the division of each block is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple blocks may be combined or integrated into another device, or some features may be ignored or not executed. The modules described as separate components may or may not be physically separated. The components shown as modules may be one or more physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the modules can be selected to achieve the purpose of the solution in this embodiment according to actual needs.
[0093] Furthermore, in the various embodiments of the present invention, the modules can be integrated into one processing unit, or each module can exist physically separately, or two or more modules can be integrated into one unit. The integrated unit described above can be implemented in hardware or as a software functional unit.
[0094] This application also provides an electronic device, which may include one or more processors, memory and communication interfaces.
[0095] The memory, communication interface, and processor are coupled together. For example, the memory, communication interface, and processor can be coupled together via a bus.
[0096] The communication interface is used for data transmission with other devices. The memory stores computer program code. This computer program code includes computer instructions, which, when executed by the processor, cause the electronic device to perform the steps of the aforementioned surgical navigation large-model weighted channel grouping compression method.
[0097] The processor can be a processor or controller, such as a Central Processing Unit (CPU), a general-purpose processor, a Digital Signal Processor (DSP), an Application-Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with this disclosure. The processor can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc. The processor can be used to support an electronic device in performing the method steps provided in the above embodiments.
[0098] The bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. These buses can be categorized as address buses, data buses, control buses, etc.
[0099] This application provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the steps of the above-described surgical navigation large model weighted channel grouping compression method.
[0100] The computer-readable storage media involved in this application include random access memory (RAM), memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disks, removable disks, CD-ROMs, or any other form of storage media known in the art.
[0101] The above are merely preferred embodiments of this application and are not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A method for weighted channel grouping compression of a large surgical navigation model, characterized in that, include: Activation sampling is performed on each layer of the large surgical navigation model to obtain sampled activations, which are then flattened into a two-dimensional matrix; the rows in the two-dimensional matrix represent different samples, and the columns represent different channels. Calculate the mutual information matrix between channels during sampling activation; The mutual information matrix is used as the similarity matrix between channels to cluster and group the channels. Based on the average importance of each group in the clustering, a number of discrete bits are assigned to each group. The weight parameters of the large surgical navigation model are pruned, and the pruned weight parameters are quantized based on the number of discrete bits allocated to each group.
2. The surgical navigation large model weighted channel grouping compression method according to claim 1, characterized in that, The method for calculating the mutual information matrix between channels during sampling activation includes: The mutual information values in the mutual information matrix are calculated using the following formula: in, For the first The first channel and the first The mutual information value of each channel, For the first The first channel and the first Pearson correlation coefficient for each channel, For the first The first channel and the first Covariance of each channel; The calculated mutual information values are normalized to obtain a normalized mutual information matrix.
3. The surgical navigation large model weighted channel grouping compression method according to claim 1, characterized in that, The method for calculating the mutual information matrix between channels during sampling activation includes: The mutual information values in the mutual information matrix are calculated using the following formula: in, For the first The first channel and the first The mutual information value of each channel, To activate the number of discretized intervals, For the first The first channel and the first The joint probability distribution of the channels, For the first The edge probability distribution of each channel For the first The marginal probability distribution of each channel; The calculated mutual information values are normalized to obtain a normalized mutual information matrix.
4. The method for weighted channel grouping and compression of a large surgical navigation model according to claim 1, characterized in that, The method for clustering and grouping channels includes: Mapping the mutual information values in the mutual information matrix to similarity values yields a similarity matrix; By combining the similarity matrix and the mutual information matrix, the Laplace matrix is obtained; The Laplacian matrix is subjected to eigenvalue decomposition, and the eigenvectors corresponding to the smallest preset number of eigenvalues are selected to form an intermediate matrix. Perform K-means clustering on the row vectors of the intermediate matrix to obtain the ID of each channel; The optimal number of groups is determined by silhouette coefficients, and the channel list, group size, and average importance of each group are calculated as the clustering grouping results.
5. The method for weighted channel grouping and compression of a large surgical navigation model according to claim 1, characterized in that, The method for allocating discrete bits to each group based on the average importance of each group in a clustering group includes: The groups are sorted in descending order based on their average amplitude or variance to obtain the priority ranking results. Allocate a larger number of discrete bits to higher priority groups and ensure that the global average bit meets the target average bit.
6. The method for weighted channel grouping and compression of a large surgical navigation model according to claim 1, characterized in that, The method for pruning the weight parameters of the large surgical navigation model and quantizing the pruned weight parameters based on the number of discrete bits allocated to each group includes: The weight parameters of the large surgical navigation model are pruned based on the Hessian matrix approximation method; The quantization upper bound is calculated based on the number of discrete bits allocated to each group; Based on the upper bound of quantization, linear quantization is performed on the pruned weight parameters.
7. The surgical navigation large model weighted channel grouping compression method according to claim 6, characterized in that, After performing linear quantization on the pruned weight parameters, the process also includes: The quantization error is calculated using the following formula and then fed back to the large surgical navigation model: in, For quantization error, These are the quantized weight parameters. These are the weight parameters after pruning. This is the upper bound for quantification.
8. A surgical navigation large-model weighted channel grouping compression system, characterized in that, include: The sampling module is used to perform activation sampling on each layer of the large surgical navigation model to obtain sampled activations, and then flatten the sampled activations into a two-dimensional matrix; the rows in the two-dimensional matrix represent different samples, and the columns represent different channels. The calculation module is used to calculate the mutual information matrix between channels during sampling activation; The grouping module is used to cluster and group channels by using the mutual information matrix as the similarity matrix between channels. The allocation module is used to allocate a number of discrete bits to each group based on the average importance of each group in the clustering group; The pruning and quantization module is used to prune the weight parameters of the large surgical navigation model and quantize the pruned weight parameters based on the number of discrete bits allocated to each group.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the surgical navigation large model weighted channel grouping compression method as described in any one of claims 1-7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the surgical navigation large model weighted channel grouping compression method as described in any one of claims 1-7.