Multi-modal large model dynamic compression and reasoning optimization method based on MoE architecture
Through the dynamic compression and inference optimization method of multimodal large model with MoE architecture, the problems of unreasonable resource allocation and lack of feature alignment in medical imaging analysis are solved, and the memory reduction, energy consumption optimization and diagnostic accuracy are achieved, meeting the real-time diagnostic needs of medical imaging equipment.
Patent Information
- Application Number
- CN202510532871.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-25
- Publication Date
- 2025-08-01
AI Technical Summary
The existing multimodal large models cannot dynamically adjust the model structure in medical imaging analysis, resulting in unreasonable allocation of computing resources and cannot meet the modal feature requirements of medical imaging. It also lacks medical-specific cross-modal feature alignment and hardware collaborative optimization, resulting in insecure diagnostic accuracy and efficiency.
Using a multimodal large model based on MoE architecture, the three-layer cascade structure of the feature encoding layer, dynamic routing layer and expert execution layer, combined with sparse gated network, knowledge graph compensation and hardware instruction-level optimization, the expert module is dynamically loaded and cross-modal feature fusion and decision weighting are implemented to achieve dynamic compression and reasoning optimization of medical images.
It has achieved a significant reduction in video memory usage, optimization of computing energy consumption and improvement of diagnostic accuracy, significantly improving the accuracy and efficiency of medical imaging processing, and meeting the real-time diagnostic needs of medical imaging equipment.
Smart Images

Figure BDA0005377109530000041 
Figure BDA0005377109530000051 
Figure BDA0005377109530000052
Abstract
Description
Technical Field
[0001] The present invention relates to the field of visual intelligence, specifically to a branch of edge computing applications of multi-modal large models in the field of visual intelligence, and particularly to a dynamic model compression and inference optimization method for medical images based on a Mixture of Experts (MoE) architecture. Background Art
[0002] Currently, the deployment of multi-modal large models for intelligent medical image analysis in edge computing scenarios mainly relies on the following two types of technical routes: One is static model pruning and quantization technology, represented by UltraCompress of GE Healthcare and DeepMind-Edge of Siemens Healthcare. These solutions compress the model size through fixed rules (such as convolutional kernel pruning, layer fusion) or low-bit quantization (such as FP16 to INT8). For example, the complete model of Siemens DeepMind-Edge requires 360GB of video memory, and after static pruning, the video memory requirement is reduced to 90GB. However, in complex medical image scenarios (such as low signal-to-noise ratio PET-CT images, pathological sections with tissue adhesions), the lesion segmentation accuracy loss reaches 4.8%. Its core defect is that the static compression strategy cannot dynamically adjust the model structure according to the modal characteristics of medical images (such as MRI sequence parameter sensitivity). The other is research on lightweight medical multi-modal models. Methods proposed in the academic community (such as 1bit-XRayNet of Johns Hopkins University, MobileMedVLM of MIT) reduce parameters through extreme quantization, but produce boundary localization errors exceeding 3μm in key lesion detection tasks and lack a medical multi-modal feature alignment mechanism. For example, the parameter utilization rate of the image-report cross-modal projector of FastMed-Transformer is less than 35%, resulting in the loss of fine-grained features such as microcalcifications.
[0003] 1. Contradiction between Static Compression and Medical Dynamic Features
[0004] Traditional static pruning strategies fix the model structure and cannot dynamically allocate computing resources according to the modal characteristics of medical images (such as CT value dynamic range, ultrasound elastography strain rate) and lesion features (such as tumor heterogeneity, vascular fractal dimension). For example, when deploying 256-layer CT parallel reconstruction on Philips IntelliSpace, due to the limitation of the fixed model capacity, the misjudgment rate of lung nodule subtypes reaches 2.1%.
[0005] 2. Contradiction between Medical Device Resources and Model Efficiency
[0006] Although the embedded processors (such as Renesas RZ / A3M) of existing medical imaging devices (such as portable ultrasounds and endoscopic systems) improve performance through computing power stacking, they do not achieve the co-optimization of model structure and hardware instructions. Their floating-point operation energy consumption reaches 0.8 mJ / MAC. When deploying a model with hundreds of billions of parameters for real-time ultrasound elastography, the device surface temperature rises by 12 °C within 5 minutes, triggering a frequency reduction protection mechanism.
[0007] 3. Lack of alignment of medical multi-modal features
[0008] During the compression process of lightweight medical multi-modal models (such as RadGen-1.5), a medical-specific cross-modal compensation mechanism is not established, resulting in spatial offsets between image features and clinical texts. In the task of discriminating between benign and malignant breast cancers, the cross-modal retrieval accuracy of the image-pathology report of the static quantization model decreases by 6.3% compared with the original model.
[0009] The essence of the above problems is that the existing related technologies fail to build a dynamic optimization system adapted to medical characteristics: First, the decoupling of medical features and model structure. Static compression strategies ignore the modality specificity of images (such as the b-value sensitivity of DWI sequences) and cannot achieve dynamic focusing of computing resources in lesion areas; Second, the fragmentation of algorithms and medical hardware. Traditional solutions do not perform co-optimization in combination with the instruction set characteristics of medical devices (such as DSP acceleration instructions and dedicated caches for medical images); Third, the insufficiency of medical knowledge distillation. Lack of clinical knowledge constraints (such as the embedding of RECIST criteria and anatomical atlas guidance) during the lightweight process leads to the loss of key diagnostic features. Summary of the Invention
[0010] Aiming at the problem that the multi-modal large model fails to build a dynamic optimization system adapted to medical characteristics, resulting in difficult-to-meet actual requirements for accuracy loss, a method for dynamic compression and inference optimization of a multi-modal large model based on the MoE architecture is proposed.
[0011] The technical solution of the present invention is as follows:
[0012] A method for dynamic compression and inference optimization of a multi-modal large model based on the MoE architecture, comprising the following steps:
[0013] Step 1: Establish an edge computing system that complies with medical device specifications. The hardware includes a medical processor, a medical image storage server, and a medical tensor processing unit, and the software includes PACS image archiving and communication system middleware and a medical image toolkit;
[0014] Construct a medical image analysis network based on an improved Mixture of Experts (MoE) architecture, which adopts a three-level cascaded structure of a feature encoding layer, a dynamic routing layer, and an expert execution layer: The feature encoding layer uses a pre-trained Med3D-ResNet34 network to extract deep features of multi-modal images; The dynamic routing layer realizes expert selection through a gating network based on the multi-head self-attention mechanism. The gating network replaces the fully connected layer with a self-attention projection layer with dynamic sparsity, and its sparsification process is achieved through L1 regularization constraint and Top-K threshold screening; The expert execution layer contains 32 dedicated sub-models based on the 3D ResNeXt-50 architecture, and each sub-model is pre-trained with medical image features of different anatomical parts during the initialization stage;
[0015] After obtaining multi-modal DICOM image data through the PACS system, perform medical standard preprocessing, synchronously parse the slice thickness, contrast agent concentration, and scan sequence code in the DICOM metadata, and construct a 256-dimensional structured feature vector to input into the dynamic routing system;
[0016] The preprocessed image data is input into the sparse gating network, and the matching degree between the input features and 32 expert sub-models is calculated based on the self-attention mechanism, and an expert module combination related to the anatomical structure of the current image data is selected;
[0017] Step 2, perform dynamic loading of expert modules and video memory optimization: Extract the corresponding expert sub-models according to the dynamic routing results; Through the video memory paging scheduling algorithm, load the activated expert modules into the GPU video memory according to the priority, and keep the unactivated modules in the system memory; Use tensor decomposition technology to perform immediate compression on the loaded modules, and dynamically replace the precision loss during the replacement of inactive expert modules;
[0018] Step 3, perform knowledge graph compensation and domain knowledge injection: Extract the anatomical standard atlas and pathological feature library from the medical knowledge base, and encode them into a 256-dimensional vector matrix through a graph neural network; During the model inference process, perform cross-modal attention fusion on the encoded knowledge vector and the feature map output by the expert module, and the knowledge graph encoder is implemented using the graph convolutional network GCN;
[0019] Step 4, perform hardware instruction-level optimization and computing acceleration: Reorganize the instructions for the activated expert modules at the GPU computing level: Use the Winograd algorithm to optimize the three-dimensional convolution operation, and achieve pipeline parallelism of matrix multiplication and addition operations through the systolic array scheduling strategy. The hardware instruction optimization uses the CUDA kernel fusion technology to merge adjacent operators into a single kernel;
[0020] Step 5: Perform multi-expert feature fusion and decision weighting: Align the spatial dimensions and normalize the scales of the feature maps output by each activated expert module, and calculate feature weights based on the channel attention mechanism; Through the differentiable weighted fusion algorithm, complement and enhance the features of different expert modules to generate a comprehensive diagnostic feature map, and retain the decision boundary information of each expert model;
[0021] Step 6: Perform diagnostic result generation and confidence evaluation:
[0022] Input the fused feature map into the classification head network to output the lesion localization coordinates, morphological parameters, and pathological classification probabilities; At the same time, calculate the confidence index of the diagnostic result through the Monte Carlo Dropout method; Automatically trigger the cloud large model review mechanism for difficult cases with low confidence; The classification head network adopts a dual-branch structure to predict the lesion category and spatial coordinates respectively;
[0023] Step 7: Perform real-time data transmission and model iterative optimization: Deploy a lightweight feedback learning module at the edge device end, encrypt and transmit the feature activation patterns, inference time consumption, and result confidence data during the diagnostic process to the central server; Based on the online knowledge distillation framework, use the edge-side feedback data to incrementally train the sparse gating network of the expert module, optimize the scenario adaptability of the dynamic routing strategy, update the loss function, and the feedback data encryption uses the AES-GCM algorithm;
[0024] Step 8: Perform multi-device collaboration and load balancing:
[0025] Monitor the computing load status of each edge device through a distributed task scheduler. When the number of processing channels of a single device reaches the threshold, automatically allocate new tasks to idle nodes; Adopt a model parameter sharing mechanism, the load adopts a balancing strategy, and the consistency synchronization adopts the RAFT consensus algorithm;
[0026] Step 9: Perform system security monitoring and exception handling: Deploy a hardware-level trusted execution environment throughout the inference link, and perform hash verification on the loaded expert modules; Real-time monitor hardware risk events, and switch to the backup expert module after an exception is triggered for security verification. The anomaly detection uses a statistical model based on temporal residuals, and triggers a fusing mechanism when the score exceeds the threshold; At the same time, record all diagnostic operation logs;
[0027] Step 10: Generate a structured diagnostic report:
[0028] The diagnostic results are output in the form of a structured report. The report generation algorithm is based on an XML template engine, and the data integrity is guaranteed through digital signatures. The standard report template is dynamically bound to the medical knowledge graph, and similar case literatures are automatically associated to assist clinical decision-making.
[0029] Further, in step 1, the preprocessed image data is input into the sparse gating network, and the matching degree between the input features and 32 expert sub-models is calculated based on the self-attention mechanism:
[0030]
[0031] Among them, W q and W k are trainable projection matrices with dimensions of 256×256, e k is the 256-dimensional encoding vector of the k-th expert sub-model, q represents the q-th training projection matrix, d = 256 represents the feature dimension, α k represents the activation weight of the k-th expert module; x refers to the current input normalized feature vector, i ∈ {1,..., 32} represents the index number of the expert model, which is used for the denominator accumulation in the normalization calculation; W q and W k According to the preset activation threshold, the expert module combination related to the anatomical structure of the current image data is screened out; in the preprocessing stage, it is necessary to ensure that the data format conforms to the DICOM SR standard, and the data integrity is verified through the verification algorithm; if the verification fails, the data retransmission mechanism is triggered to ensure that the input quality meets the requirements of subsequent processing;
[0032] Step 2, perform dynamic loading and video memory optimization of the expert module:
[0033] According to the dynamic routing result, the corresponding expert sub-models are extracted from the one-hundred-billion-parameter base model according to the functional module granularity; through the video memory paging scheduling algorithm, the activated expert modules are loaded into the GPU video memory according to the priority, and the unactivated modules are retained in the system memory; the tensor decomposition technology is used to perform immediate compression on the loaded modules, and the compression process follows:
[0034]
[0035] Among them, T compressed is the compressed three-dimensional tensor, R = 64 is the decomposition rank, ar, br, and cr are the two-dimensional matrices after the rank-r decomposition respectively, represents the tensor outer product operation; the video memory scheduling uses an improved LRU algorithm, and the accuracy loss during the dynamic replacement of inactive expert modules is controlled within 0.3%; the video memory scheduling strategy uses the LRU (Least Recently Used) algorithm to dynamically replace inactive expert modules:
[0036]
[0037] Among them, AccessCount(k) records the call times of the k-th expert module, Δt lastIndicates the time interval since the module was last accessed, in milliseconds. Inactive refers to the set of expert modules that are currently not activated;
[0038] Step 3, Perform knowledge graph compensation and domain knowledge injection:
[0039] Extract the anatomical standard atlas and pathological feature library from the medical knowledge base, including 3,874 three-dimensional atlases of anatomical structures of 12 major human systems, and the data format conforms to the DICOM SR Supplement 161 structured report standard; the pathological feature library is integrated from NCI Thesaurus 23.11d and the TCGA public dataset, covering the pathological feature descriptions of 136 malignant tumors, and is encoded as a 256-dimensional vector matrix through a graph neural network; during the model inference process, the encoded knowledge vector v kg and the feature map f output by the expert module expert Perform cross-modal attention fusion:
[0040] f fused = LayerNorm(f expert + MultiHeadAttention(f expert , v kg ))
[0041] where LayerNorm represents the layer normalization operation, MultiHeadAttention is the 8-head attention mechanism, and v kg is the 256-dimensional knowledge graph encoded vector; the knowledge graph encoder is implemented using a graph convolutional network (GCN):
[0042]
[0043] where A~ = A + I is the adjacency matrix with self-connections added, I is the identity matrix, D~ is the corresponding degree matrix, and W (l) is the 256×256 trainable weight matrix for the l-th layer, and σ is the ReLU activation function;
[0044] Step 4, Perform hardware instruction-level optimization and computing acceleration:
[0045] Reorganize the instructions for the activated expert modules at the GPU computing level: Optimize the three-dimensional convolution operation using the Winograd algorithm, reducing the computational complexity from O(n^3) to O(n^2). The energy consumption formula is:
[0046]
[0047] Among them, Cin = 64 and Cout = 64 represent the number of input and output channels respectively, K = 3 is the convolution kernel size, H×W×D = 5123 is the input voxel dimension, and R winograd = 2.4 is the measured speedup ratio; pipelined parallelism of matrix multiply-add operations is achieved through a systolic array scheduling strategy; hardware instruction optimization adopts CUDA kernel fusion technology to merge adjacent operators into a single kernel:
[0048]
[0049] Among them, SharedMemoryUsage represents the shared memory usage, with the unit of KB; ThreadOccupancy is the thread occupancy rate, taking values from 0 to 1; OperationOverhead is the operator scheduling overhead, with the unit of microseconds; kernel merging is triggered when the fusion score exceeds the threshold θ = 0.75;
[0050] Step 5, perform multi-expert feature fusion and decision weighting:
[0051] Spatially align and scale-normalize the feature maps output by each activated expert module, and calculate feature weights based on the channel attention mechanism; through a differentiable weighted fusion algorithm, different expert modules are complementarily enhanced to generate a comprehensive diagnostic feature map:
[0052]
[0053] Among them, w k is the channel attention weight of the k-th expert module, is a gating function containing 3 fully connected layers, K represents the number of activated experts, with the value range of 4 - 8; the attention weight calculation is implemented using the SENet module:
[0054] w k = σ(W2·δ(W1·GAP(f k )))
[0055] Among them, W1 is a compression matrix of 256×16 dimensions, W2 is an expansion matrix of 16×256 dimensions, δ is the ReLU activation function, σ is the Sigmoid function, and GAP represents the global average pooling operation; this process retains the decision boundary information of each expert model;
[0056] Step 6, perform diagnostic result generation and confidence evaluation:
[0057] Input the fused feature map into the classification head network to output the lesion location coordinates, morphological parameters, and pathological classification probabilities; at the same time, calculate the confidence index of the diagnostic result through the Monte Carlo Dropout method:
[0058]
[0059] Among them, T = 50 is the number of sampling times, is the inference result of the t-th time, is the mode prediction, is the indicator function; for difficult cases with a confidence level lower than 95%, the cloud large model review mechanism is automatically triggered; the classification head network adopts a double-branch structure, predicting the lesion category and spatial coordinates respectively:
[0060]
[0061] Among them, L CE is the cross-entropy loss, L SmoothL1 is the smooth L1 loss, λ cls = 1.0 and λ reg = 2.0 are the optimal weight coefficients determined by grid search;
[0062] Step 7, perform real-time data transmission and model iterative optimization:
[0063] Deploy a lightweight feedback learning module at the edge device side, encrypt and transmit the feature activation pattern, inference time consumption, and result confidence data during the diagnosis process to the central server; based on the online knowledge distillation framework, use the edge-side feedback data to incrementally train the sparse gating network of the expert module to optimize the scenario adaptability of the dynamic routing strategy; the model update loss function is:
[0064]
[0065] Among them, L KL represents the KL divergence loss for knowledge distillation, L task is the original task loss, λ1 = 0.7 and λ2 = 0.3 are the proportionality coefficients determined by orthogonal experiments, f edge and f cloud respectively represent the feature outputs of the edge device and the cloud large model; the model update period is controlled within 72 hours; the feedback data encryption uses the AES-GCM algorithm:
[0066] Ciphertext = Enc key (Data ⊕ Nonce)
[0067] Among them, ⊕ represents the exclusive OR operation, Nonce is a 24-byte random number, Enc key is encrypted using a 256-bit AES key, and Data represents the feedback data containing the feature matrix, inference time consumption log, and confidence vector;
[0068] Step 8, perform multi-device collaboration and load balancing:
[0069] Monitor the computing load status of each edge device through a distributed task scheduler. When the number of processing channels of a single device reaches the threshold, automatically allocate new tasks to idle nodes; adopt a model parameter sharing mechanism so that collaborative devices can quickly synchronize the latest activated expert modules, ensuring that the consistency error of multi-node diagnosis results is less than 0.1%; the load balancing strategy follows:
[0070]
[0071] where T process (j) represents the processing time of task j, and C max is the maximum computing capacity of the device, and C used (i) is the amount of resources already used by device i; for consistency synchronization, the RAFT consensus algorithm is adopted:
[0072] CommitIndex = max{n|MajorityAck(n)}
[0073] where n is the log entry index and MajorityAck means that more than half of the nodes confirm; ensure the atomicity and consistency of multi-node model parameter updates;
[0074] Step 9, execute system security monitoring and exception handling:
[0075] Deploy a hardware-level trusted execution environment TEE throughout the inference link, perform hash verification on the loaded expert modules; monitor hardware risk events such as video memory access exceptions and computing instruction overflows in real time, and immediately switch to the backup expert module after an exception is triggered; the security verification formula is:
[0076]
[0077] where H pre is the pre-computed 256-bit hash value, and SHA-256 complies with the FIPS180-4 standard;
[0078] For anomaly detection, a statistical model based on temporal residuals is adopted:
[0079]
[0080] where x t is the monitoring metric at the current moment, is the predicted value of the ARIMA model, and the denominator is the standard deviation of historical residuals; when the score exceeds the threshold θ = 3σ, trigger the fusing mechanism, where σ refers to the standard deviation of temporal residuals; at the same time, record all diagnostic operation logs to meet the audit and traceability requirements of the medical AI supervision platform;
[0081] Step 10, generate a structured diagnostic report:
[0082] The diagnostic results are output in a structured report, including 23 clinical indicators such as the lesion volume V, the CT value distribution μ±σ, and the malignant probability Pmalignant. μ±σ represents the mean and standard deviation of the CT values in the lesion area. The report generation algorithm is based on an XML template engine to ensure compliance with the DICOM SR standard, and digital signatures are used to guarantee data integrity:
[0083] Sign report = RSA priv (H(Report))
[0084] Among them, RSA priv is a 2048-bit hospital private key, and H(report) is a SHA-256 hash function, which conforms to the standard report template and dynamically binds to the medical knowledge graph, automatically associates similar case literatures, and assists in clinical decision-making.
[0085] Furthermore, in step 1, the regularization parameter λ of the L1 regularization constraint is 0.02, the K of the Top-K threshold screening is 4, and the parameter scales of each sub-model are controlled within the interval to meet the edge deployment requirements. The parameter matrix of the gating network follows a 2:4 structured sparse pattern.
[0086] Furthermore, in step 1, for the edge computing system, a Renesas RZ / A3M medical processor is deployed at the hardware level, a medical image storage server with a RAID6 redundant architecture is equipped, and a medical tensor processing unit that supports INT8 sparse matrix operations is integrated. The software environment configures the Orthanc 1.12 open-source PACS middleware to achieve DICOM 3.0 standard data communication, and combines the ITK5.3 medical image toolkit to implement the preprocessing algorithm. The computing framework uses PyTorch 2.1 and the MIOpen 3.1 acceleration library to adapt to the medical computing architecture.
[0087] Furthermore, in step 1, the preprocessing is specifically as follows: The three-dimensional B-spline interpolation algorithm in the ITK toolkit is used to unify the CT / MRI voxel resolution to 0.5mm 3 , and the N4 bias field correction is applied to the MRI data to eliminate magnetic field distortion. Adaptive histogram equalization with an 8×8×8 grid partition is applied to optimize the display of tissue boundaries, with a focus on enhancing the contrast difference in the lesion area.
[0088] The beneficial effects of the present invention are as follows:
[0089] The method proposed by the present invention effectively solves the problems of resource constraints and accuracy guarantee in the deployment of multi-modal large models with hundreds of billions of parameters on medical edge devices through a dynamic compression and medical knowledge-guided optimization mechanism. Compared with the prior art, the present solution has achieved the following significant advantages in the field of medical image processing:
[0090] 1. Dynamic Compression with Adaptive Medical Features
[0091] Based on a differentiable sparse gating network, dynamically activate 0.1%-5% of the expert modules according to the characteristics of medical imaging modalities (such as CT value distribution, DWI sequence b-value sensitivity). On the Siemens MAGNETOM Vida 3T MRI device, the video memory occupancy is reduced from 360GB to 9.6GB (a reduction of 97.3%), while maintaining multi-modal relevance. This mechanism realizes dynamic allocation of computing resources for tumor heterogeneity features and improves the accuracy by 3.2pp in the pulmonary nodule subtype classification task compared with the static compression scheme.
[0092] 2. Energy Efficiency Optimization with Medical Hardware Collaboration
[0093] Through the Winograd fast convolution algorithm (reducing 72% of the multiplication operations) and the dedicated systolic array scheduling strategy for medical imaging, the energy consumption per single inference is reduced to 0.32mJ / OP on the Renesas RZ / A3M medical processor. In the real-time ultrasound elastography scenario, the temperature rise on the device surface is controlled within 4°C (meeting the IEC 60601-1-9 medical device temperature rise standard), avoiding frame rate loss caused by frequency reduction.
[0094] 3. Cross-modal Compensation with Enhanced Medical Knowledge
[0095] Construct a three-level compensation framework including KL divergence constraint, clinical decision boundary simulation (based on the RECIST 1.1 standard), and medical knowledge graph injection. In the cross-modal retrieval task of breast cancer DCE-MRI images and pathological reports, the misjudgment rate of fine-grained features (such as microcalcifications) is reduced from 6.3% to 0.47%. Specific Embodiment
[0096] The present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. This embodiment is implemented on the premise of the technical solution of the present invention, and the detailed implementation manners and specific operation processes are given, but the protection scope of the present invention is not limited to the following embodiments.
[0097] A method for dynamic compression and inference optimization of a multi-modal large model based on the MoE architecture, comprising the following steps:
[0098] The medical image analysis network constructed in the present invention is based on an improved mixture of experts (MoE) architecture. The core architecture adopts a three-level cascaded structure of a feature encoding layer, a dynamic routing layer, and an expert execution layer: The feature encoding layer uses a pre-trained Med3D-ResNet34 network to extract deep features of multi-modal images (this network has been verified on the Medical Segmentation Decathlon dataset); the dynamic routing layer realizes expert selection through a gating network based on the multi-head self-attention mechanism, and its sparsification process is achieved through L1 regularization constraint (regularization parameter λ = 0.02) and Top-K threshold screening (K = 4); the expert execution layer contains 32 dedicated sub-models based on the 3D ResNeXt-50 architecture. Each sub-model pre-trains the medical image features of different anatomical parts (including the texture features of lung CT, the diffusion tensor features of brain MRI, etc.) at the initialization stage, and the parameter scale of each sub-model is controlled in the range of 1.2 - 1.8 MB to meet the requirements of edge deployment. The improvement of the gating network is reflected in replacing the traditional fully connected layer with a self-attention projection layer with dynamic sparsity, and its parameter matrix follows the 2:4 structured sparsity pattern of NVIDIA Sparse TensorCore (tensor core).
[0099] The implementation of the present invention first requires the establishment of an edge computing system that complies with medical device specifications. At the hardware level, a Renesas RZ / A3M medical processor (compliant with the IEC 60601-1 medical electrical safety standard) is deployed, a medical image storage server with a RAID 6 redundant architecture is equipped, and a medical tensor processing unit (MTU, peak computing power 4.2 TOPS) that supports INT8 sparse matrix operations is integrated. The software environment configures the Orthanc 1.12 open-source PACS (Picture Archiving and Communication System) middleware to implement DICOM3.0 standard data communication, and combines the ITK 5.3 medical image toolkit to implement preprocessing algorithms. The computing framework uses PyTorch 2.1 and the MIOpen 3.1 acceleration library to adapt to the medical computing architecture.
[0100] After obtaining multi-modal DICOM image data through the PACS system, perform medical standardization preprocessing: use the three-dimensional B-spline interpolation algorithm (third-order spline basis function) in the ITK toolkit to unify the voxel resolution of CT / MRI to 0.5 mm 3(Compliant with the AAPM Report 204 standard), perform N4 bias field correction on the MRI data to eliminate magnetic field distortion; apply adaptive histogram equalization (CLAHE algorithm, contrast limit 2.0) with an 8×8×8 grid partition to optimize the display of tissue boundaries, and focus on enhancing the contrast difference in the lesion area (such as the CT value range of -600 to 200 HU for lung nodules). Synchronously parse the slice thickness (tag 0018,0050), contrast agent concentration (tag 0018,1048), and scan sequence code (tag 0018,0020) in the DICOM metadata, and construct a 256-dimensional structured feature vector to input into the dynamic routing system.
[0101] The preprocessed image data is input into the sparse gating network, and the matching degree between the input features and 32 expert sub-models is calculated based on the self-attention mechanism:
[0102]
[0103] Among them, W q and W k are trainable projection matrices with dimensions of 256×256, e k is the 256-dimensional encoding vector of the k-th expert sub-model, q represents the q-th training projection matrix, d = 256 represents the feature dimension, and α k represents the activation weight of the k-th expert module; x refers to the current input normalized feature vector, i ∈ {1,..., 32} represents the index number of the expert model, which is used for the denominator accumulation in the normalization calculation. W q and W k According to the preset activation threshold (dynamic adjustment range of 0.1% - 5%), select the combination of expert modules related to the anatomical structure of the current image data. In the preprocessing stage, it is necessary to ensure that the data format complies with the DICOMSR standard, and verify the data integrity through the verification algorithm. If the verification fails, trigger the data retransmission mechanism to ensure that the input quality meets the requirements of subsequent processing.
[0104] Step 2, perform dynamic loading of expert modules and video memory optimization:
[0105] According to the dynamic routing result, extract the corresponding expert sub-models (each sub-model is about 3 billion parameters) from the basic model with hundreds of billions of parameters at the functional module granularity. Through the video memory paging scheduling algorithm, load the activated expert modules into the GPU video memory according to the priority, and keep the unactivated modules in the system memory. Use tensor decomposition technology to perform immediate compression on the loaded modules, and the compression process follows:
[0106]
[0107] Among them, T compressedis the compressed three-dimensional tensor, R = 64 is the decomposition rank, and ar, br, and cr are the two-dimensional matrices after rank-r decomposition, represents the tensor outer product operation; in the example test (experimental conditions: Siemens SOMATOM Confidence CT device, the input data is a lung CT sequence of 512×512×300 voxels), this scheme reduces the single-device video memory occupancy from 390GB of the basic model to 14.2GB, and the memory bandwidth occupancy is stably below 9.8GB / s (measured by NVIDIA Nsight Systems 2023.1). The video memory scheduling adopts an improved LRU algorithm, and the accuracy loss during dynamic replacement of inactive expert modules is controlled within 0.3% to meet the 16GB video memory limit of the NVIDIA RTX A4000 graphics card. The video memory scheduling strategy adopts the LRU (Least Recently Used) algorithm to dynamically replace inactive expert modules:
[0108]
[0109] where AccessCount(k) records the call count of the k-th expert module, and Δt last represents the time interval since the module was last accessed, in milliseconds, and Inactive refers to the set of currently inactive expert modules; this mechanism realizes parallel processing of 16-channel MRI data in the actual measurement of tertiary hospitals, and the latency is controlled within 200ms.
[0110] Step 3, perform knowledge graph compensation and domain knowledge injection:
[0111] Extract the anatomical standard atlas and pathological feature library from the medical knowledge base (the anatomical standard atlas is derived from the RadLex 5.0 terminology system (maintained by RSNA, http: / / www.radlex.org), including 3,874 three-dimensional atlases of anatomical structures in 12 major systems of the human body, and the data format conforms to the DICOM SR Supplement 161 structured report standard; the pathological feature library is integrated from NCI Thesaurus 23.11d (ncit.nci.nih.gov) and the TCGA public dataset (portal.gdc.cancer.gov), covering the pathological feature descriptions of 136 malignant tumors (including histological grading, immunohistochemical indicators, etc.), and is encoded as a 256-dimensional vector matrix by a graph neural network. During the model inference process, the encoded knowledge vector v kg and the feature map f output by the expert module expert are subjected to cross-modal attention fusion:
[0112] f fused = LayerNorm(f expert+MultiHeadAttention(f expert ,v kg ))
[0113] Among them, LayerNorm represents the layer normalization operation, MultiHeadAttention is the 8-head attention mechanism, and v kg is the 256-dimensional knowledge graph encoding vector; this mechanism can correct the feature offset caused by image artifacts or noise. For example, in the pulmonary nodule detection task, the early signs atlas of lung cancer is injected to enhance the feature sensitivity to ground-glass nodules. The knowledge graph encoder is implemented using a graph convolutional network (GCN):
[0114]
[0115] Among them, A~ = A + I is the adjacency matrix with self-connections added, I is the identity matrix, D~ is the corresponding degree matrix, and W (l) is the 256×256 trainable weight matrix of the l-th layer, and σ is the ReLU activation function; actual measurements show that this strategy improves the sensitivity of pulmonary nodule detection to 98.2%, a 7.5 percentage point increase compared to the static compression model.
[0116] Step 4, perform hardware instruction-level optimization and computing acceleration:
[0117] Reorganize the instructions of the activated expert module at the GPU computing level: Use the Winograd algorithm (a fast convolution algorithm) to optimize the three-dimensional convolution operation, reducing the computational complexity from O(n^3) to O(n^2). The energy consumption formula is:
[0118]
[0119] Among them, Cin = 64 and Cout = 64 represent the number of input and output channels respectively, K = 3 is the convolution kernel size, H×W×D = 5123 is the input voxel dimension, and R winograd = 2.4 is the measured speedup ratio; achieve pipeline parallelism for matrix multiply-add operations through the systolic array scheduling strategy, enabling a single device to parallel process the real-time reconstruction task of 16-channel MRI data with the inference latency controlled within 200 ms. The hardware instruction optimization uses the CUDA kernel fusion technology to merge adjacent operators into a single kernel:
[0120]
[0121] Among them, SharedMemoryUsage represents the shared memory usage, with the unit of KB; ThreadOccupancy is the thread occupancy rate, taking values from 0 to 1; OperationOverhead is the operator scheduling overhead, with the unit of microseconds; when the fusion score exceeds the threshold θ = 0.75, kernel merging is triggered. The actual measurement shows that this strategy reduces the computational energy consumption of U-Net3D from 4.8 mJ / voxel to 1.6 mJ / voxel.
[0122] Step 5, perform multi-expert feature fusion and decision weighting:
[0123] Spatially align and scale-normalize the feature maps output by each activated expert module, and calculate the feature weights based on the channel attention mechanism. Through the differentiable weighted fusion algorithm, the high-sensitivity features of the pulmonary nodule detection expert (pre-trained based on the LIDC-IDRI dataset (DOI: 10.7937 / TCIA.e3sv-re93), optimized the sensitivity index (AUC = 0.983) using the 3D RetinaNet architecture, and dedicated to detecting low-contrast lesions such as subsolid nodules) and the spatial accuracy features of the tissue boundary segmentation expert (based on the champion solution of the MICCAI FLARE2022 challenge (arXiv:2209.10328), integrated the boundary-aware loss function (Boundary-Weighted Dice Loss), and achieved 92.4% Dice score in the liver CT segmentation task) are complementarily enhanced to generate a comprehensive diagnostic feature map:
[0124]
[0125] where, w k is the channel attention weight of the k-th expert module, is a gating function containing 3 fully connected layers, K represents the number of activated experts, and the value range is 4 - 8. The attention weight calculation is implemented using the SENet module:
[0126] w k = σ(W2 · δ(W1 · GAP(f k )))
[0127] where, W1 is a 256×16-dimensional compression matrix, W2 is a 16×256-dimensional expansion matrix, δ is the ReLU activation function, σ is the Sigmoid function, and GAP represents the global average pooling operation. This process preserves the decision boundary information of each expert model and prevents misjudgment caused by feature confusion. The actual measurement shows that the tissue boundary segmentation accuracy loss is reduced from 4.3 pp to 0.9 pp.
[0128] Step 6, perform diagnostic result generation and confidence evaluation:
[0129] The fused feature map is input into the classification head network, and the lesion localization coordinates, morphological parameters, and pathological classification probabilities are output. At the same time, the confidence index of the diagnostic result is calculated by the Monte Carlo Dropout method:
[0130]
[0131] where T = 50 is the number of sampling times, is the result of the t-th inference, is the mode prediction, is the indicator function. For difficult cases with a confidence level lower than 95%, the cloud large model review mechanism is automatically triggered. The classification head network adopts a dual-branch structure to predict the lesion category and spatial coordinates respectively:
[0132]
[0133] where L CE is the cross-entropy loss, L SmoothL1 is the smooth L1 loss, λ cls = 1.0 and λ reg = 2.0 are the optimal weight coefficients determined by grid search. The measured results show that the lung nodule localization error is less than 0.8 mm.
[0134] Step 7, Perform real-time data transmission and model iterative optimization:
[0135] A lightweight feedback learning module is deployed at the edge device end, and data such as the feature activation pattern, inference time consumption, and result confidence during the diagnosis process are encrypted and transmitted back to the central server. Based on the online knowledge distillation framework, the sparse gating network of the expert module is incrementally trained using the edge-side feedback data to optimize the scenario adaptability of the dynamic routing strategy. The model update loss function is:
[0136]
[0137] where L KL represents the KL divergence loss for knowledge distillation, L task is the original task loss, λ1 = 0.7 and λ2 = 0.3 are the proportionality coefficients determined by orthogonal experiments, f edge and f cloud represent the feature outputs of the edge device and the cloud large model respectively; the model update period is controlled within 72 hours to ensure that the algorithm iteration does not affect the clinical business continuity. The feedback data encryption uses the AES-GCM algorithm:
[0138] Ciphertext = Enc key (Data⊕Nonce)
[0139] Among them, ⊕ represents the exclusive OR operation, Nonce is a 24-byte random number, Enc key is encrypted using a 256-bit AES key, and Data represents feedback data such as a feature matrix, inference time-consuming log, and confidence vector.
[0140] Step 8, Perform multi-device collaboration and load balancing:
[0141] Monitor the computing load status of each edge device through a distributed task scheduler. When the number of processing channels of a single device reaches the threshold (such as 16-channel MRI (Magnetic Resonance Imaging) reconstruction), newly added tasks are automatically assigned to idle nodes. Adopt a model parameter sharing mechanism so that collaborative devices can quickly synchronize the latest activated expert modules, ensuring that the consistency error of the multi-node diagnosis results is less than 0.1%. The load balancing strategy follows:
[0142]
[0143] Among them, T process (j) represents the processing time of task j, and C max is the maximum computing capacity of the device, and C used (i) is the amount of resources already used by device i. Consistency synchronization adopts the RAFT consensus algorithm:
[0144] CommitIndex = max{n|MajorityAck(n)}
[0145] Among them, n is the log entry index, and MajorityAck means that more than half of the nodes confirm; ensure the atomicity and consistency of multi-node model parameter updates.
[0146] Step 9, Perform system security monitoring and exception handling:
[0147] Deploy a hardware-level trusted execution environment (TEE) throughout the inference link, perform hash verification on the loaded expert modules to prevent malicious code injection. Real-time monitor hardware risk events such as video memory access exceptions and computing instruction overflows, and switch to the backup expert module within 0.5 seconds after an exception is triggered. The security verification formula is:
[0148]
[0149] Among them, H pre is the pre-computed 256-bit hash value, and SHA-256 complies with the FIPS180-4 standard;
[0150] Anomaly detection adopts a statistical model based on temporal residuals:
[0151]
[0152] Among them, xt is the monitoring metric at the current moment, is the predicted value of the ARIMA model, the denominator is the standard deviation of historical residuals; when the score exceeds the threshold θ = 3σ (where σ refers to the standard deviation of the time series residuals), the fusing mechanism is triggered. At the same time, all diagnostic operation logs are recorded to meet the audit and traceability requirements of the medical AI supervision platform.
[0153] Step 10: Generate a structured diagnostic report:
[0154] The diagnostic results are output in the form of a structured report, including 23 clinical indicators such as the lesion volume V, the CT value distribution μ±σ (μ±σ represents the mean and standard deviation of the CT values in the lesion area), and the malignant probability Pmalignant. The report generation algorithm is based on an XML template engine to ensure compliance with the DICOM SR (structured report) standard, and the data integrity is guaranteed through digital signature:
[0155] Sign report = RSA priv (H(Report))
[0156] where, RSA priv is the 2048-bit private key of the hospital, H(report) is the SHA-256 hash function, the report template conforms to the (PKCS#1v2.2 standard) and is dynamically bound to the medical knowledge graph, automatically associating similar case literatures to assist clinical decision-making. The actual measurement shows that this process improves the film reading efficiency of radiologists by 40% and the diagnostic coincidence rate reaches 99.1%.
[0157] The above-described embodiments only represent one implementation mode of the present invention, and the description is relatively specific and detailed, but it should not be construed as a limitation on the scope of the invention patent. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present invention, several modifications and improvements can be made, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the present invention patent shall be subject to the appended claims.
Claims
1. A method for dynamic compression and inference optimization of a multimodal large model based on the MoE architecture, characterized in that It includes the following steps: Step 1: Establish an edge computing system that complies with medical device specifications. The hardware includes a medical processor, a medical image storage server, and a medical tensor processing unit. The software includes a PACS image archiving and communication system middleware and a medical image toolkit; Build a medical image analysis network based on an improved mixture of experts (MoE) architecture, using a three-level cascaded structure of a feature encoding layer, a dynamic routing layer, and an expert execution layer: The feature encoding layer uses a pre-trained Med3D-ResNet34 network to extract deep features of multi-modal images; The dynamic routing layer realizes expert selection through a gating network based on the multi-head self-attention mechanism. The gating network replaces the fully connected layer with a self-attention projection layer with dynamic sparsity, and its sparsification process is achieved through L1 regularization constraints and Top-K threshold screening; The expert execution layer contains 32 dedicated sub-models based on the 3D ResNeXt-50 architecture, and each sub-model is pre-trained with medical image features of different anatomical parts during the initialization phase; After obtaining multi-modal DICOM image data through the PACS system, perform medical standard preprocessing, synchronously parse the slice thickness, contrast agent concentration, and scan sequence code in the DICOM metadata, and construct a 256-dimensional structured feature vector to input into the dynamic routing system; The preprocessed image data is input into the sparse gating network, and the matching degree between the input features and the 32 expert sub-models is calculated based on the self-attention mechanism, and an expert module combination related to the anatomical structure of the current image data is selected; Step 2: Perform dynamic loading of expert modules and video memory optimization: Extract the corresponding expert sub-models according to the dynamic routing results; Through the video memory paging scheduling algorithm, load the activated expert modules into the GPU video memory according to the priority, and keep the unactivated modules in the system memory; Use tensor decomposition technology to instantaneously compress the loaded modules and dynamically replace the accuracy loss when replacing inactive expert modules; Step 3: Perform knowledge graph compensation and domain knowledge injection: Extract the anatomical standard atlas and pathological feature library from the medical knowledge base, and encode them into a 256-dimensional vector matrix through a graph neural network; During the model inference process, perform cross-modal attention fusion on the encoded knowledge vector and the feature map output by the expert module. The knowledge graph encoder is implemented using a graph convolutional network (GCN); Step 4: Perform hardware instruction-level optimization and computing acceleration: Recombine the instructions of the activated expert modules at the GPU computing level: Use the Winograd algorithm to optimize the three-dimensional convolution operation, and implement the pipelined parallelism of matrix multiply-add operations through the systolic array scheduling strategy. The hardware instruction optimization uses the CUDA kernel fusion technology to merge adjacent operators into a single kernel; Step 5: Perform multi-expert feature fusion and decision weighting: Perform spatial alignment and scale normalization on the feature maps output by each activated expert module, and calculate the feature weights based on the channel attention mechanism; Through the differentiable weighted fusion algorithm, complement and enhance the features of different expert modules to generate a comprehensive diagnostic feature map, and retain the decision boundary information of each expert model; Step 6: Perform diagnostic result generation and confidence evaluation: The fused feature map is input into the classification head network to output the lesion localization coordinates, morphological parameters, and pathological classification probabilities; meanwhile, the confidence index of the diagnosis result is calculated by the Monte Carlo Dropout method; for difficult cases with low confidence, the cloud large model review mechanism is automatically triggered; the classification head network adopts a dual-branch structure to predict the lesion category and spatial coordinates respectively; Step 7, perform real-time data transmission and model iterative optimization: Deploy a lightweight feedback learning module at the edge device side, encrypt and transmit the feature activation pattern, inference time consumption, and result confidence data during the diagnosis process to the central server; based on the online knowledge distillation framework, use the edge-side feedback data to incrementally train the sparse gating network of the expert module, optimize the scenario adaptability of the dynamic routing strategy, update the loss function, and the feedback data encryption uses the AES-GCM algorithm; Step 8, perform multi-device collaboration and load balancing: Monitor the computing load status of each edge device through a distributed task scheduler. When the number of processing channels of a single device reaches the threshold, automatically allocate new tasks to idle nodes; adopt a model parameter sharing mechanism, the load adopts a balancing strategy, and the consistency synchronization adopts the RAFT consensus algorithm; Step 9, perform system security monitoring and exception handling: Deploy a hardware-level trusted execution environment throughout the inference link, and perform a hash check on the loaded expert module; Real-time monitor hardware risk events, switch to the backup expert module after an exception is triggered for security verification. The anomaly detection uses a statistical model based on temporal residuals, and the fusing mechanism is triggered when the score exceeds the threshold; at the same time, record all diagnostic operation logs; Step 10, generate a structured diagnostic report: The diagnosis result is output in the form of a structured report. The report generation algorithm is based on an XML template engine, and the data integrity is guaranteed through digital signatures. The standard report template is dynamically bound to the medical knowledge graph, automatically associating similar case literatures to assist clinical decision-making.
2. The method for dynamic compression and inference optimization of a multi-modal large model based on the MoE architecture according to claim 1, characterized in that, In step 1, the preprocessed image data is input into the sparse gating network, and the matching degree between the input features and 32 expert sub-models is calculated based on the self-attention mechanism: Among them, W q and W k are trainable projection matrices of dimension 256×256, e k is the 256-dimensional encoded vector of the k-th expert sub-model, q represents the q-th training projection matrix, d = 256 represents the feature dimension, and α k represents the activation weight of the k-th expert module; x refers to the normalized feature vector of the current input, i ∈ {1,..., 32} represents the index number of the expert model, which is used for the denominator accumulation during the normalization calculation; W q and W k According to the preset activation threshold, a combination of expert modules related to the anatomical structure of the current image data is selected; in the preprocessing stage, it is necessary to ensure that the data format conforms to the DICOM SR standard, and the data integrity is verified through a verification algorithm; if the verification fails, the data retransmission mechanism is triggered to ensure that the input quality meets the requirements of subsequent processing; Step 2, perform dynamic loading of the expert module and video memory optimization: According to the dynamic routing result, extract the corresponding expert sub-models from the basic model with hundreds of billions of parameters at the functional module granularity; through the video memory paging scheduling algorithm, load the activated expert modules into the GPU video memory according to the priority, and keep the unactivated modules in the system memory; use the tensor decomposition technology to perform immediate compression on the loaded modules, and the compression process follows: where T compressed is the compressed three-dimensional tensor, R = 64 is the decomposition rank, and ar, br, and cr are the two-dimensional matrices after the rank-r decomposition, represents the tensor outer product operation; the video memory scheduling adopts an improved LRU algorithm, and the accuracy loss during the dynamic replacement of inactive expert modules is controlled within 0.3%; the video memory scheduling strategy adopts the LRU (Least Recently Used) algorithm to dynamically replace inactive expert modules: Among them, AccessCount(k) records the invocation times of the k-th expert module, and Δt last represents the time interval since the module was last accessed, in milliseconds, and Inactive refers to the set of currently inactive expert modules; Step 3, perform knowledge graph compensation and domain knowledge injection: Extract the anatomical standard atlas and pathological feature library from the medical knowledge base, including 3,874 three-dimensional atlases of anatomical structures in 12 major systems of the human body, and the data format conforms to the DICOM SR Supplement 161 structured report standard; the pathological feature library is integrated from NCI Thesaurus 23.11d and the TCGA public dataset, covering the pathological feature descriptions of 136 malignant tumors, and is encoded as a 256-dimensional vector matrix through a graph neural network; during the model inference process, the encoded knowledge vector v kg and the feature map f expert output by the expert module are subjected to cross-modal attention fusion: f fused = LayerNorm(f expert + MultiHeadAttention(f expert , v kg )) Among them, LayerNorm represents the layer normalization operation, MultiHeadAttention is the 8-head attention mechanism, and v kg is the 256-dimensional knowledge graph encoding vector; the knowledge graph encoder is implemented using the graph convolutional network GCN: where \( \widetilde{A}=A + I \) is the adjacency matrix with added self - connections, \( I \) is the identity matrix, \( \widetilde{D} \) is the corresponding degree matrix, and \( W \) (l) is a \( 256\times256 \) trainable weight matrix for the \( l \) - th layer, and \( \sigma \) is the ReLU activation function; Step 4, perform hardware instruction-level optimization and computing acceleration: Perform instruction recombination on the activated expert modules at the GPU computing layer: Optimize the three-dimensional convolution operation using the Winograd algorithm, reducing the computational complexity from O(n^3) to O(n^2), and the energy consumption formula is: Among them, Cin = 64 and Cout = 64 represent the number of input and output channels respectively, K = 3 is the convolutional kernel size, H×W×D = 5123 is the input voxel dimension, and R winograd = 2.4 is the measured speedup ratio; pipelined parallelism of matrix multiply-add operations is achieved through a systolic array scheduling strategy; for hardware instruction optimization, the CUDA kernel fusion technology is adopted to merge adjacent operators into a single kernel: Among them, SharedMemoryUsage represents the shared memory usage, with the unit of KB; ThreadOccupancy is the thread occupancy rate, taking values from 0 to 1; OperationOverhead is the operator scheduling overhead, with the unit of microseconds; when the fusion score exceeds the threshold θ = 0.75, kernel merging is triggered; Step 5: Perform multi-expert feature fusion and decision weighting: Perform spatial alignment and scale normalization on the feature maps output by each activated expert module, and calculate feature weights based on the channel attention mechanism; through the differentiable weighted fusion algorithm, complement and enhance different expert modules to generate a comprehensive diagnostic feature map: where w k is the channel attention weight of the k-th expert module, is a gating function including three fully-connected layers, K represents the number of activated experts, and its value range is 4 - 8; the calculation of the attention weight is implemented by the SENet module: w k = σ(W2 · δ(W1 · GAP(f k ))) Among them, W1 is a compression matrix of 256×16 dimensions, W2 is an expansion matrix of 16×256 dimensions, δ is the ReLU activation function, σ is the Sigmoid function, and GAP represents the global average pooling operation; this process retains the decision boundary information of each expert model; Step 6: Perform diagnostic result generation and confidence evaluation: Input the fused feature map into the classification head network to output the lesion localization coordinates, morphological parameters, and pathological classification probabilities; at the same time, calculate the confidence index of the diagnostic result through the Monte Carlo Dropout method: where T = 50 is the number of sampling times, is the inference result of the t-th time, is the mode prediction, is the indicator function; automatically trigger the cloud large model review mechanism for difficult cases with a confidence level lower than 95%; the classification head network adopts a double-branch structure to predict the lesion category and spatial coordinates respectively: Among them, L CE is the cross-entropy loss, L SmoothL1 is the smooth L1 loss, λ cls = 1.0 and λ reg = 2.0 are the optimal weight coefficients determined by grid search; Step 7: Perform real-time data backhaul and model iterative optimization: Deploy a lightweight feedback learning module at the edge device end, encrypt and backhaul the feature activation patterns, inference time consumption, and result confidence data during the diagnosis process to the central server; based on the online knowledge distillation framework, use the edge-side feedback data to incrementally train the sparse gating network of the expert module to optimize the scenario adaptability of the dynamic routing strategy; the model update loss function is: Among them, L KL represents that the KL divergence loss is used for knowledge distillation, L task is the original task loss, λ1 = 0.7 and λ2 = 0.3 are the proportionality coefficients determined by orthogonal experiments, f edge and f cloud represent the feature outputs of the edge device and the cloud large model respectively; the model update period is controlled within 72 hours; the feedback data encryption adopts the AES-GCM algorithm: Among them, represents the exclusive OR operation, Nonce is a 24-byte random number, Enc key is encrypted using a 256-bit AES key, and Data represents the data containing the feature matrix, inference time-consuming log, and confidence vector feedback data; Step 8: Perform multi-device collaboration and load balancing: Monitor the computing load status of each edge device through a distributed task scheduler. When the number of processing channels of a single device reaches the threshold, automatically allocate new tasks to idle nodes; adopt a model parameter sharing mechanism so that collaborative devices can quickly synchronize the latest activated expert modules to ensure that the consistency error of the diagnostic results of multiple nodes is less than 0.1%; the load balancing strategy follows: Among them, T process (j) represents the processing time of task j, C max is the maximum computing capacity of the device, C used (i) is the amount of resources already used by device i; the consistent synchronization adopts the RAFT consensus algorithm: CommitIndex = max{n|MajorityAck(n)} Among them, n is the log entry index, and MajorityAck means that more than half of the nodes confirm; ensure the atomicity and consistency of the multi-node model parameter update; Step 9: Perform system security monitoring and exception handling: Deploy a hardware-level trusted execution environment TEE throughout the inference link to perform hash verification on the loaded expert modules; monitor hardware risk events such as video memory access exceptions and computing instruction overflows in real time, and immediately switch to the backup expert module after an exception is triggered; the security verification formula is: Among them, H pre is a pre-computed 256-bit hash value, and SHA-256 complies with the FIPS180-4 standard; Anomaly detection uses a statistical model based on temporal residuals: Among them, x t is the monitoring index at the current moment, is the predicted value of the ARIMA model, and the denominator is the standard deviation of historical residuals; when the score exceeds the threshold θ = 3σ, where σ refers to the standard deviation of time series residuals, the fusing mechanism is triggered; at the same time, all diagnostic operation logs are recorded to meet the audit and traceability requirements of the medical AI supervision platform; Step 10: Generate a structured diagnostic report: The diagnostic results are output in the form of a structured report, including 23 clinical indicators such as the lesion volume V, the CT value distribution μ±σ, and the malignant probability Pmalignant. μ±σ represents the mean and standard deviation of the CT values in the lesion area. The report generation algorithm is based on an XML template engine to ensure compliance with the DICOM SR standard and guarantees data integrity through digital signatures: Sign report = RSA priv (H(Report)) Among them, RSA priv is a 2048-bit hospital private key, H(report) is a SHA-256 hash function, which conforms to the standard report template to dynamically bind the medical knowledge graph, automatically associate similar case literatures, and assist in clinical decision-making.
3. The method for dynamically compressing and optimizing inference of a multimodal large model based on the MoE architecture according to claim 1, wherein In step 1, the regularization parameter λ of the L1 regularization constraint is 0.02, the K of the Top-K threshold screening is 4, and the parameter scales of each sub-model are controlled within the interval to meet the edge deployment requirements. The parameter matrix of the gating network follows a 2:4 structured sparse pattern.
4. The method for dynamic compression and inference optimization of a multimodal large model based on the MoE architecture according to claim 1, wherein In step 1, for the edge computing system, a Renesas RZ / A3M medical processor is deployed at the hardware level, a medical image storage server with a RAID 6 redundant architecture is equipped, and a medical tensor processing unit that supports INT8 sparse matrix operations is integrated. The software environment configures the Orthanc 1.12 open-source PACS middleware to implement DICOM 3.0 standard data communication, combines the ITK 5.3 medical image toolkit for preprocessing algorithm implementation, and the computing framework uses PyTorch 2.1 and the MIOpen 3.1 acceleration library to adapt to the medical computing architecture.
5. The method for dynamically compressing and optimizing inference of a multimodal large model based on the MoE architecture according to claim 1, wherein In step 1, the preprocessing is specifically as follows: the three-dimensional B-spline interpolation algorithm in the ITK toolkit is used to unify the CT / MRI voxel resolution to 0.5 mm 3 , the N4 bias field correction is performed on the MRI data to eliminate magnetic field distortion; the adaptive histogram equalization with an 8×8×8 grid partition is applied to optimize the display of tissue boundaries, and the contrast difference in the lesion area is enhanced emphatically.
Citation Information
Cited By
Virtual power plant response capability assessment method and device
CN120746064A
Image-text cross-modal retrieval method based on embedded sparse gate expert hybrid model
CN120950724A
A Cross-Modal Image-Text Retrieval Method Based on an Embedded Sparse Gate Expert Hybrid Model
CN120950724B
Retraining-free pruning and recombination method and system for sparse expert hybrid large model
CN120996126A
Efficient hybrid expert model deployment system and method based on input dynamic pruning
CN121094108A