A high-precision ckks medical multi-agent secure reasoning method based on homomorphic subtraction
Patent Information
- Application Number
- CN202610766492.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-29
- Publication Date
- 2026-10-16
AI Technical Summary
[0004]本发明的目的在于提供一种基于同态减法的高精度CKKS医疗多智能体安全推理方法,旨在解决现有全同态加密自举操作引入的大整数干扰项导致密文特征精度退化、全密文域下无法直接执行高精度非线性医疗逻辑判定,以及分布式多方协同推理中隐私安全与特征融合开销难以兼顾的技术问题
[0041] (1) This invention proposes a feature stripping mechanism based on homomorphic subtraction. By accurately extracting the background integer offset introduced by the modulus increase in the decision path and physically subtracting it from the main path reference ciphertext, the accumulated rounding error caused by modulus reduction (rescale) in the traditional CKKS scheme is directly eliminated. This "offset compensation" logic replaces "approximate rounding", so that the restored medical feature vector can still maintain a very high numerical consistency with the plaintext in the ciphertext state, effectively solving the stringent requirements for high-precision values such as biochemical indicators and image quantification data in clinical auxiliary diagnosis. At the same time, this invention significantly improves the convergence accuracy of the decision boundary while reducing the multiplication level overhead by introducing cascaded composite functions and Horner evaluation scheme.
Smart Images

Figure CN122932937A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a high-precision CKKS medical multi-agent secure reasoning method based on homomorphic subtraction, belonging to the field of medical multi-agent secure reasoning technology. Background Technology
[0002] With the rapid development of smart healthcare, medical multi-agent systems have shown great potential in areas such as assisted diagnosis and cross-institutional collaborative decision-making. However, medical data is highly privacy-sensitive, and how to achieve secure joint reasoning among multiple institutions without disclosing patients' original characteristics has become a focus of industry attention. Homomorphic encryption (especially the CKKS scheme) is widely used to protect data privacy during computation.
[0003] However, the traditional CKKS bootstrapping process often suffers significant accuracy loss when dealing with large-scale medical features due to rounding errors during the modulus boosting and scaling process. This is unacceptable in clinical decision support where high accuracy is required. Furthermore, differences in computational depth during multi-agent collaborative reasoning can easily lead to mismatched ciphertext parameters, thus affecting the continuity and stability of the reasoning. Summary of the Invention
[0004] The purpose of this invention is to provide a high-precision CKKS medical multi-agent secure reasoning method based on homomorphic subtraction, aiming to solve the technical problems of degradation of ciphertext feature accuracy caused by large integer interference terms introduced by the existing fully homomorphic encryption bootstrapping operation, inability to directly execute high-precision nonlinear medical logic judgment in the fully ciphertext domain, and difficulty in balancing privacy security and feature fusion overhead in distributed multi-party collaborative reasoning.
[0005] To achieve the above objectives, the technical solution of this invention is: a high-precision CKKS medical multi-agent secure reasoning method based on homomorphic subtraction. This method utilizes cascaded composite functions and the Horner scheme to construct high-precision decision logic, extracts integer offsets in the encrypted state, and accurately removes interference terms through homomorphic subtraction, thereby restoring the original medical features with high-precision numerical states without leaking privacy. The method includes the following steps:
[0006] Step 1: Each medical multi-agent collects local multi-source medical privacy data and performs vectorization encoding to generate local medical privacy feature vectors. The local medical privacy feature vectors are then homomorphically encrypted using a public key to obtain ciphertext containing the original medical features. Modulus enhancement is then performed on the ciphertext containing the original medical features to generate an initial backup ciphertext.
[0007] Step 2: The ciphertext containing the original medical features is transformed by homomorphic linear transformation and dimension mapping, and then transformed from the coefficient space to the coding slot space and hierarchically aligned to obtain the hierarchically aligned ciphertext.
[0008] Step 3: Construct a cascaded composite function to perform homomorphic rounding on the hierarchically aligned ciphertext, and extract the integer offset from the ciphertext information;
[0009] Step 4: Use the integer offset to perform parameter forced synchronization on the ciphertext containing the original medical features. After the parameter forced synchronization is completed, perform a homomorphic subtraction operation on the initial backup ciphertext and the integer offset to obtain the medical feature ciphertext. Based on the medical feature ciphertext, trigger the medical multi-agent collaborative reasoning model to perform secure reasoning.
[0010] Optionally, step 1 specifically includes:
[0011] Step 1.1: The server generates CKKS encryption parameters, including the polynomial modulus. Modular chain and initial scaling factor and issue public keys Relinearized key and Galois Key To various medical multi-agent terminals;
[0012] Step 1.2: Each medical multi-agent terminal uses the public key For the local medical privacy feature vector Perform homomorphic encryption to generate components from the first polynomial. With the second polynomial component The ciphertext containing original medical characteristics ;
[0013] Step 1.3: The server processes the encrypted data containing the original medical characteristics. Perform a modular enhancement operation to extract the ciphertext containing the original medical characteristics. The modulus from the current level Increase to maximum modulus The ciphertext after modulus enhancement satisfy ,in, Representative cipher With client private key Homomorphic decryption structure operations, To encrypt the inherent random noise, This is due to the background integer interference term introduced by the modulus increase. For each integer item to be stripped;
[0014] Step 1.4: The server performs static backup of the ciphertext after modulus enhancement as the base variable for the main computation path, and marks it as the initial backup ciphertext. .
[0015] Optionally, step 2 specifically includes:
[0016] Step 2.1: The server performs a coefficient-to-slot linear transformation on the ciphertext after modulus enhancement to obtain the transformed ciphertext. By using homomorphic rotation and addition operators, medical privacy data components hidden in the polynomial space are extracted into the coding slots;
[0017] Step 2.2: Process the transformed ciphertext Perform homomorphic level downscaling and noise reduction operations to synchronize the hierarchy and maintain the initial scaling factor. The ciphertext after hierarchical alignment is obtained. .
[0018] Optionally, step 3 specifically includes:
[0019] Step 3.1: Align the ciphertext by level pending message components Mapped to Within the range, according to the preset bootstrapping range Construct a set of boundary detection nodes for dividing the modulus space region. ,in, The fundamental modulus factor for homomorphic encryption schemes, An integer index representing the current ciphertext modulus level;
[0020] Step 3.2: Use the Horner scheme to process the message components to be processed. Perform odd polynomial evaluation And only for the coefficients of odd-degree terms. The operation is performed, and the expression is:
[0021]
[0022] in, This is the ciphertext of the squared terms generated by the homomorphic square operator;
[0023] By locking the sign characteristics of numerical values in the modular space using low-order odd polynomials and maintaining the ciphertext scale using rescaling operations, a first-level decision ciphertext is generated. ;
[0024] Step 3.3: Use the first-level ciphertext for judgment. As input, utilize higher-order iterative odd polynomials implement The homomorphic cascade composition operation, wherein the hierarchical recursive composition logic of the homomorphic cascade composition operation is expressed as follows: ,in, For the first The current level interval judgment feature ciphertext output by the next iteration, initial state This allows for the construction of a ladder-like homomorphic comparison function within a preset range of the detection nodes. ;
[0025] Step 3.4: Use the ladder-like homomorphic comparison function For each detection node To perform a homomorphic comparison, the expression is:
[0026]
[0027] in, This represents a homomorphic comparison operation, which generates an endpoint comparison vector. The endpoint comparison vector The components satisfy The value is 1 if it is true, and 0 otherwise.
[0028] Compare the endpoint vectors Perform homomorphic subtraction on adjacent components to construct the one-hot decision vector, expressed as:
[0029]
[0030] in, Representing the A grid interval, This indicates that the ciphertext data crosses the leftmost... The state of the region boundary points, This indicates that the ciphertext data crosses the rightmost position. The status of the region boundary points;
[0031] Step 3.5: Construct a midpoint vector containing the midpoint values of each interval. Integer offsets are extracted using homomorphic inner product operations. The expression is:
[0032]
[0033] The integer offset is transformed from the coding slot space back to the coefficient space using the linear inverse transform slot to coefficient, thus completing the attribute regression from vectorized decision value to polynomial representation.
[0034] Optionally, step 4 specifically includes:
[0035] Step 4.1: Using the initial backup ciphertext As the main ciphertext, a hierarchical switching algorithm is used to reduce the parameter ID of the main ciphertext to the integer offset mentioned above. They are at the same modular level;
[0036] Step 4.2: Under the premise of aligning the hierarchy and scaling factor, perform a homomorphic subtraction operation on the main path ciphertext and the integer offset to obtain the repaired high-precision medical feature ciphertext. ;
[0037] Step 4.3: Utilize the repaired high-precision medical feature ciphertext As input, the medical multi-agent collaborative reasoning model is triggered. Each secure computing node in the medical multi-agent collaborative reasoning model performs a homomorphic ciphertext-plaintext scalar multiplication operation using a locally pre-trained plaintext local weight matrix to calculate and output the local diagnostic score in the encrypted state. ;
[0038] Step 4.4: Each secure computing node uses its local diagnostic score under the encrypted state. As input, perform high-order Chebyshev polynomial cascade homomorphic multiplication-addition decision operations to complete the nonlinear logic decisions of each agent within the model, and calculate and output local encryption diagnostic opinions specific to each agent. ;
[0039] Step 4.5: The main control server of the medical multi-agent collaborative reasoning model introduces a preset plaintext global collaborative confidence weight, performs a cross-node homomorphic weighted cumulative feature fusion operation on all locally encrypted diagnostic opinions, and directly calculates and generates the final ciphertext of the auxiliary diagnostic result. .
[0040] The beneficial effects of this invention are:
[0041] (1) This invention proposes a feature stripping mechanism based on homomorphic subtraction. By accurately extracting the background integer offset introduced by the modulus increase in the decision path and physically subtracting it from the main path reference ciphertext, the accumulated rounding error caused by modulus reduction (rescale) in the traditional CKKS scheme is directly eliminated. This "offset compensation" logic replaces "approximate rounding", so that the restored medical feature vector can still maintain a very high numerical consistency with the plaintext in the ciphertext state, effectively solving the stringent requirements for high-precision values such as biochemical indicators and image quantification data in clinical auxiliary diagnosis. At the same time, this invention significantly improves the convergence accuracy of the decision boundary while reducing the multiplication level overhead by introducing cascaded composite functions and Horner evaluation scheme.
[0042] (2) This invention innovatively combines cascaded composite functions and the Horner scheme in the determination process. By optimizing the evaluation process of odd polynomials through the Horner scheme and maximizing the reuse of squared term ciphertexts using a nested multiplication-accumulation structure, the computational complexity is reduced from linear to logarithmic, greatly controlling the noise growth in the bootstrapping process. At the same time, by constructing a step-like comparison function with extremely high steepness through multiple high-order iterations, the recognition sensitivity near the detection node is significantly improved, ensuring the accurate attribution of large-scale medical privacy data when it is distributed across modal spaces.
[0043] (3) In view of the problem of computational depth difference in medical multi-agent collaborative reasoning, the present invention introduces an in-situ level switching algorithm for energy level synchronization alignment. This algorithm can force the alignment of parameter IDs of the main computation path ciphertext and the branch decision offset ciphertext, ensuring that the two ciphertexts are in the same mathematical residue space. This not only avoids the homomorphic operation anomaly caused by the unequal level ID or scaling factor in the CKKS scheme, but also ensures the logical continuity and system robustness of cross-institution and multi-node collaborative reasoning tasks in complex heterogeneous environments.
[0044] (4) This invention utilizes CKKS homomorphic encryption technology to provide full lifecycle privacy protection for medical features, ensuring that the data exists in encrypted form throughout the entire chain from data collection and encryption, intermediate state bootstrapping repair to cloud-based collaborative inference. By reserving sufficient noise budget for the decision logic through modulus boosting operations, the risk of information leakage due to numerical overload during bootstrapping is prevented. Combined with a multi-agent collaborative mechanism, it enables the generation of high-value inference conclusions from sensitive medical data without leaving the domain or decryption, providing comprehensive technical support for the compliant implementation of privacy computing in smart healthcare. Attached Figure Description
[0045] Figure 1 This is a flowchart illustrating the present invention;
[0046] Figure 2 This is a schematic diagram of the model interaction of the present invention. Detailed Implementation
[0047] The present invention will be further described below with reference to the accompanying drawings and specific embodiments.
[0048] Example 1: As Figure 1 and Figure 2 As shown, a high-precision CKKS medical multi-agent secure inference method based on homomorphic subtraction is proposed. This method achieves accurate inference of distributed medical agent data under the premise of privacy protection by constructing a precision compensation mechanism based on homomorphic subtraction on a cloud server. The method includes the following steps:
[0049] Step 1: Each medical multi-agent collects local multi-source medical privacy data and performs vectorization encoding to generate local medical privacy feature vectors. The local medical privacy feature vectors are then homomorphically encrypted using a public key to obtain ciphertext containing the original medical features. Modulus enhancement is then performed on the ciphertext containing the original medical features to generate an initial backup ciphertext.
[0050] Optionally, the server first configures a global encryption parameter set for medical security inference scenarios. Each distributed medical agent node acts as an independent inference unit, using the generated parameters to perform CKKS homomorphic encryption on locally collected local privacy medical feature vectors representing the patient's physiological state, generating ciphertext containing the original medical features. After receiving the ciphertext, the server performs a modulus boosting operation, using modulus expansion technology to increase the modulus of the ciphertext to a preset maximum modulus, reserving sufficient noise budget and numerical space for subsequent bootstrapping decision logic. Specifically:
[0051] Step 1.1: System initialization and medical data encryption. The server generates CKKS encryption parameters, including polynomial modulus. Modular chain and initial scaling factor and issue public keys Relinearized key and Galois Key To various medical multi-agent terminals;
[0052] Step 1.2: Each medical multi-agent terminal uses the public key For the local medical privacy feature vector Perform homomorphic encryption to generate components from the first polynomial. With the second polynomial component The ciphertext containing original medical characteristics This ensures that the data is encrypted before being transmitted off-domain.
[0053] Step 1.3: The server processes the encrypted data containing the original medical characteristics. Perform a ModRaise operation to convert the ciphertext containing the original medical characteristics... The modulus from the current level Increase to maximum modulus The ciphertext after modulus enhancement satisfy ,in, Representative ciphertext With client private key Homomorphic decryption structure operations, To encrypt the inherent random noise, This is due to the background integer interference term introduced by the modulus increase. For each integer item to be stripped;
[0054] Step 1.4: The server performs static backup of the ciphertext after modulus enhancement as the base variable for the main computation path, and marks it as the initial backup ciphertext. .
[0055] It is understandable that this embodiment expands the modulus space to include the background integer terms to be subsequently stripped. The complete ciphertext is preserved in the high-order space of the ciphertext. At this point, the server uses the ciphertext after modulus enhancement as the base variable of the main calculation path, statically locks it, and marks it as the initial backup ciphertext for subsequent precision compensation.
[0056] Step 2: The ciphertext containing the original medical features is transformed by homomorphic linear transformation and dimension mapping, and then transformed from the coefficient space to the coding slot space and hierarchically aligned to obtain the hierarchically aligned ciphertext.
[0057] Step 2.1: The server performs a coefficient-to-slot linear transformation on the ciphertext after modulus enhancement to obtain the transformed ciphertext. By using homomorphic rotation and addition operators, medical privacy data components hidden in the polynomial space are extracted into coding slots to form message components to be processed. ;
[0058] Step 2.2: Process the transformed ciphertext Perform homomorphic level downscaling and noise reduction operations to synchronize the hierarchy and maintain the initial scaling factor. To prevent numerical overflow in subsequent judgment processes, the ciphertext is obtained after hierarchical alignment. .
[0059] It is understood that in this embodiment, the server performs linear mapping and dimension transformation on the ciphertext after modulus enhancement, extracts privacy features from the polynomial coefficient space to the parallel coding slot space through the homomorphic rotation operator, and uses the in-situ level switching algorithm to force the alignment of the energy level of the main path reference ciphertext and the decision branch, thereby eliminating the parameter mismatch problem caused by the difference in computation depth.
[0060] Step 3: Construct a cascaded composite function to perform homomorphic rounding on the hierarchically aligned ciphertext, and extract the integer offset from the ciphertext information;
[0061] Optionally, the server-side utilizes a cascaded composite decision function combined with the Horner scheme to perform high-precision homomorphic comparison operations on the message components in the coding slot. By using a nested multiply-accumulate structure to reuse the ciphertext of the squared terms to control multiplication depth loss, the server identifies the modulus distribution interval of the message in the encrypted state. Subsequently, homomorphic inner product operations are used to extract the encrypted offset ciphertext representing background integer term interference, providing a precise numerical benchmark for subsequent feature stripping. Specifically:
[0062] Step 3.1: Align the ciphertext by level pending message components Mapped to Within the range, according to the preset bootstrapping range Construct a set of boundary detection nodes for dividing the modulus space region. ,in, The fundamental modulus factor for homomorphic encryption schemes, An integer index representing the current ciphertext modulus level is used to limit the remaining multiplication depth under the decision path;
[0063] Step 3.2: Use the Horner scheme to process the message components to be processed. Perform odd polynomial evaluation And only for the coefficients of odd-degree terms. The operation is performed, and the expression is:
[0064]
[0065] in, This involves generating ciphertext for squared terms using a homomorphic square operator and reusing it using a nested multiply-accumulate structure. The terms, under the premise of controlling noise growth, initially lock the modulus space characteristics of the values;
[0066] By locking the sign characteristics of numerical values in the modular space using low-order odd polynomials and maintaining the ciphertext scale using a rescale operation, a first-level decision ciphertext is generated. ;
[0067] Step 3.3: Use the first-level ciphertext for judgment. As input, utilize higher-order iterative odd polynomials implement The homomorphic cascade composition operation, wherein the hierarchical recursive composition logic of the homomorphic cascade composition operation is expressed as follows: ,in, For the first The current level interval judgment feature ciphertext output by the next iteration, initial state This allows for the construction of a highly discriminative, ladder-like homomorphic comparison function within a preset range of the detection nodes. In this embodiment, Take 3;
[0068] It is understandable that this embodiment significantly improves the numerical convergence accuracy at the decision boundary by constructing a step-like homomorphic comparison function with extremely high steepness characteristics, ensuring that the extracted integer offset has extremely high numerical reliability and accuracy in the encrypted state.
[0069] Step 3.4: Use the ladder-like homomorphic comparison function For each detection node To perform a homomorphic comparison, the expression is:
[0070]
[0071] in, This represents a homomorphic comparison operation, which generates an endpoint comparison vector. The endpoint comparison vector The components satisfy The value is 1 if it is true, and 0 otherwise.
[0072] Compare the endpoint vectors Perform homomorphic subtraction on adjacent components to construct a one-hot vector, expressed as:
[0073]
[0074] in, Representing the Each grid interval Regional boundary points Regional boundary points , This indicates that the ciphertext data crosses the leftmost... The state of the boundary points of the region (1 if crossed, 0 if not crossed). This indicates that the ciphertext data crosses the rightmost position. The state of the region boundary points (1 if crossed, 0 if not crossed);
[0075] Step 3.5: Construct a midpoint vector containing the midpoint values of each interval. Integer offsets are extracted using homomorphic inner product operations. The expression is:
[0076]
[0077] By using the linear inverse transform slot-to-coefficient method, the integer offset is transformed from the coding slot space back to the coefficient space, completing the attribute regression from the vectorized decision value to the polynomial representation, thereby providing a precise deduction term for eliminating precision offset in the subsequent main path feature restoration.
[0078] Step 4: Force synchronization of parameters for the ciphertext containing the original medical features using the integer offset. After completing the forced synchronization, ensure the initial backup ciphertext under the main computing path is synchronized. Integer offset from the output of the decision path After ciphertext energy level alignment, a homomorphic subtraction operation is performed between the initial backup ciphertext and the integer offset, starting from the initial backup ciphertext. Subtract integer offset from By stripping away background integer interference terms, a lossless medical feature ciphertext is obtained, and a medical multi-agent collaborative reasoning model is triggered based on the medical feature ciphertext to perform secure reasoning.
[0079] Step 4.1: Using the initial backup ciphertext As the main ciphertext, a hierarchical switching algorithm is used to reduce the parameter ID of the main ciphertext to the integer offset mentioned above. The consistent modular hierarchy ensures that the main road benchmark and the branch road offset are in the same mathematical residual space, eliminating the risk of parameter mismatch caused by differences in computational depth;
[0080] It is understood that step 4.1 in this embodiment eliminates the difference in computational depth between the decision path and the main computational path, ensuring that the two ciphertexts are in the same mathematical residue space, thereby avoiding computational anomalies caused by parameter mismatch.
[0081] Step 4.2: Under the premise of aligning the hierarchy and scaling factor, perform a homomorphic subtraction operation on the main path ciphertext and the integer offset to obtain the repaired high-precision medical feature ciphertext. ;
[0082] Understandably, this embodiment uses homomorphic subtraction to employ a physical logic stripping mechanism in the encrypted state to accurately deduct integer interference terms introduced by modulus enhancement from the message component to be processed. By replacing the traditional "approximate rounding" with "offset compensation", the accumulated rounding error in the bootstrapping process is completely eliminated. Under the premise of not leaking privacy, the original medical features with high-precision numerical state are restored, driving the medical multi-agent collaborative reasoning model to generate decision results with high fidelity, and realizing the deep reconstruction and repair of the accuracy of the ciphertext.
[0083] Step 4.3: Utilize the repaired high-precision medical feature ciphertext As input, the medical multi-agent collaborative reasoning model is triggered. Each secure computing node in the medical multi-agent collaborative reasoning model performs a homomorphic ciphertext-plaintext scalar multiplication operation using a locally pre-trained plaintext local weight matrix to calculate and output the local diagnostic score in the encrypted state. ;
[0084] Step 4.4: Each secure computing node uses its local diagnostic score under the encrypted state. As input, perform high-order Chebyshev polynomial cascade homomorphic multiplication-addition decision operations to complete the nonlinear logic decisions of each agent within the model, and calculate and output local encryption diagnostic opinions specific to each agent. ;
[0085] Step 4.5: The main control server of the medical multi-agent collaborative reasoning model introduces a preset plaintext global collaborative confidence weight, performs a cross-node homomorphic weighted cumulative feature fusion operation on all locally encrypted diagnostic opinions, and directly calculates and generates the final ciphertext of the auxiliary diagnostic result. .
[0086] The technical solution provided in this embodiment will be further illustrated below through a specific implementation example. The specific implementation process is as follows:
[0087] Step 1: First, configure the global encryption parameter set on the server side. Suppose a patient's original medical privacy feature vector. The client uses the public key to... Homomorphic encryption is performed, and the initial ciphertext in the decrypted state is approximately When the server receives the ciphertext and performs a ModRaise operation, the ciphertext modulus is increased from the initial energy level to the maximum modulus. According to mathematical logic, a background integer interference term will be generated in the ciphertext space at this point. Let the value of this interference term be... At this point, the total value contained in the main ciphertext actually becomes The server uses this result as a baseline variable and statically locks it as the initial backup ciphertext. .
[0088] Step 2: The server performs a coefficient-to-slot linear transformation on the ciphertext after modulus enhancement, mapping the medical privacy data to the encoded slots in parallel computing to obtain the message component to be processed. Meanwhile, the server retrieves the backup. The algorithm uses an in-situ level switching mechanism to force the parameter ID to be reduced to a level completely consistent with the output of the subsequent decision path. This operation ensures that the two data streams are processed at the same energy level, so that the "baseline number" of the main path and the "deduction item" of the branch path can match, avoiding homomorphic operation anomalies caused by level asymmetry.
[0089] Step 3: Process the message components to be processed in the encoding slots. The system executes interval identification logic. First, the Horner scheme is used to optimize the odd polynomial evaluation to control noise growth. Then, iterative processing is performed using a high-order stepped composite function to construct a step-like decision function with extremely clear boundaries. This function can very accurately distinguish the position of encrypted data in the modulus space and precisely identify the extra integer part in the message. After homomorphic comparison and inner product operation, the system extracts the encrypted integer offset. The corresponding numerical result is exactly the same as the given value. .
[0090] Step 4: This step is the core step that demonstrates the accuracy improvement in this embodiment. The server calls the homomorphic subtraction operator and executes... The calculation process after substituting the numerical values is very intuitive:
[0091]
[0092] The resulting improvement in accuracy is shown in the following comparison:
[0093] Traditional methods typically use approximate functions to "guess" and attempt to eliminate the integer interference term. Limited by fitting accuracy, the results obtained using traditional methods often deviate from the original value (e.g., becoming...). ), produced approximately Rounding error offset.
[0094] This invention utilizes a direct cancellation mechanism to directly "subtract" redundant interference terms through homomorphic subtraction. Because subtraction has linear fidelity, it eliminates the extra terms without any error. This perfectly restored the result to the state it was when it was initially encrypted. The state achieved a non-destructive restoration of medical characteristics.
[0095] The restored high-precision ciphertext then triggers a collaborative inference model to generate a diagnostic result. Because the input data completely eliminates accumulated rounding errors, the generated diagnostic conclusion has extremely high numerical reliability and clinical reference value.
[0096] In summary, this invention first configures global encryption parameters on the server side, and each medical agent uses a public key to perform CKKS homomorphic encryption on local medical features. The server then performs modulus boosting on the ciphertext and linearly transforms it to the coding slot space. Integer offsets are extracted using cascaded composite functions and the Horner scheme. Subsequently, a level-switching algorithm is used to perform energy level alignment, and the integer offsets are precisely extracted from the initial ciphertext using a homomorphic subtraction operator. This direct cancellation completely eliminates computational errors, thus restoring the original medical features with high-precision numerical states intact. This triggers collaborative reasoning among multiple medical agents to generate auxiliary diagnostic results. This invention effectively solves the accuracy bottleneck in the CKKS bootstrapping process, ensuring high-precision and high-stability secure cross-institutional reasoning of sensitive medical data without leaving the domain or decryption.
[0097] The specific embodiments of the present invention have been described in detail above with reference to the accompanying drawings. However, the present invention is not limited to the above embodiments. Within the scope of knowledge possessed by those skilled in the art, various changes can be made without departing from the spirit of the present invention.
Claims
1. A high-precision CKKS medical multi-agent secure reasoning method based on homomorphic subtraction, characterized in that, The method includes the following steps: Step 1: Each medical multi-agent collects local multi-source medical privacy data and performs vectorization encoding to generate local medical privacy feature vectors. The local medical privacy feature vectors are then homomorphically encrypted using a public key to obtain ciphertext containing the original medical features. Modulus enhancement is then performed on the ciphertext containing the original medical features to generate an initial backup ciphertext. Step 2: The ciphertext containing the original medical features is transformed by homomorphic linear transformation and dimension mapping, and then transformed from the coefficient space to the coding slot space and hierarchically aligned to obtain the hierarchically aligned ciphertext. Step 3: Construct a cascaded composite function to perform homomorphic rounding on the hierarchically aligned ciphertext, and extract the integer offset from the ciphertext information; Step 4: Use the integer offset to perform parameter forced synchronization on the ciphertext containing the original medical features. After the parameter forced synchronization is completed, perform a homomorphic subtraction operation on the initial backup ciphertext and the integer offset to obtain the medical feature ciphertext. Based on the medical feature ciphertext, trigger the medical multi-agent collaborative reasoning model to perform secure reasoning.
2. The high-precision CKKS medical multi-agent secure inference method based on homomorphic subtraction according to claim 1, characterized in that, Step 1 specifically involves: Step 1.1: The server generates CKKS encryption parameters, including the polynomial modulus. Modular chain and initial scaling factor and issue public keys Relinearized key and Galois Key To various medical multi-agent terminals; Step 1.2: Each medical multi-agent terminal uses the public key For the local medical privacy feature vector Perform homomorphic encryption to generate components from the first polynomial. With the second polynomial component The ciphertext containing original medical characteristics ; Step 1.3: The server processes the encrypted data containing the original medical characteristics. Perform a modular enhancement operation to extract the ciphertext containing the original medical characteristics. The modulus from the current level Increase to maximum modulus The ciphertext after modulus enhancement satisfy ,in, Representative ciphertext With client private key Homomorphic decryption structure operations, To encrypt the inherent random noise, This is due to the background integer interference term introduced by the modulus increase. For each integer item to be stripped; Step 1.4: The server performs static backup of the ciphertext after modulus enhancement as the base variable for the main computation path, and marks it as the initial backup ciphertext. .
3. The high-precision CKKS medical multi-agent secure inference method based on homomorphic subtraction according to claim 2, characterized in that, Step 2 specifically involves: Step 2.1: The server performs a coefficient-to-slot linear transformation on the ciphertext after modulus enhancement to obtain the transformed ciphertext. By using homomorphic rotation and addition operators, medical privacy data components hidden in the polynomial space are extracted into the coding slots; Step 2.2: Process the transformed ciphertext Perform homomorphic level downscaling and noise reduction operations to synchronize the hierarchy and maintain the initial scaling factor. The ciphertext after hierarchical alignment is obtained. .
4. The high-precision CKKS medical multi-agent secure reasoning method based on homomorphic subtraction according to claim 3, characterized in that, Step 3 specifically involves: Step 3.1: Align the ciphertext by level pending message components Mapped to Within the range, according to the preset bootstrapping range Construct a set of boundary detection nodes for dividing the modulus space region. ,in, The fundamental modulus factor for homomorphic encryption schemes, An integer index representing the current ciphertext modulus level; Step 3.2: Use the Horner scheme to process the message components to be processed. Perform odd polynomial evaluation And only for the coefficients of odd-degree terms. The operation is performed, and the expression is: ; in, This is the ciphertext of the squared terms generated by the homomorphic square operator; By locking the sign characteristics of numerical values in the modular space using low-order odd polynomials and maintaining the ciphertext scale using rescaling operations, a first-level decision ciphertext is generated. ; Step 3.3: Use the first-level ciphertext for judgment. As input, utilize higher-order iterative odd polynomials implement The homomorphic cascade composition operation, wherein the hierarchical recursive composition logic of the homomorphic cascade composition operation is expressed as follows: ,in, For the first The current level interval judgment feature ciphertext output by the next iteration, initial state This allows for the construction of a ladder-like homomorphic comparison function within a preset range of the detection nodes. ; Step 3.4: Use the ladder-like homomorphic comparison function For each detection node To perform a homomorphic comparison, the expression is: ; in, This represents a homomorphic comparison operation, which generates an endpoint comparison vector. The endpoint comparison vector The components satisfy The value is 1 if it is true, and 0 otherwise. Compare the endpoint vectors Perform homomorphic subtraction on adjacent components to construct the one-hot decision vector, expressed as: ; in, Representing the A grid interval, This indicates that the ciphertext data crosses the leftmost... The state of the region boundary points, This indicates that the ciphertext data crosses the rightmost position. The status of the region boundary points; Step 3.5: Construct a midpoint vector containing the midpoint values of each interval. Integer offsets are extracted using homomorphic inner product operations. The expression is: ; The integer offset is transformed from the coding slot space back to the coefficient space using the linear inverse transform slot to coefficient, thus completing the attribute regression from vectorized decision value to polynomial representation.
5. The high-precision CKKS medical multi-agent secure inference method based on homomorphic subtraction according to claim 4, characterized in that, Step 4 specifically involves: Step 4.1: Using the initial backup ciphertext As the main ciphertext, a hierarchical switching algorithm is used to reduce the parameter ID of the main ciphertext to the integer offset mentioned above. They are at the same modular level; Step 4.2: Under the premise of aligning the hierarchy and scaling factor, perform a homomorphic subtraction operation on the main path ciphertext and the integer offset to obtain the repaired high-precision medical feature ciphertext. ; Step 4.3: Utilize the repaired high-precision medical feature ciphertext As input, the medical multi-agent collaborative reasoning model is triggered. Each secure computing node in the medical multi-agent collaborative reasoning model performs a homomorphic ciphertext-plaintext scalar multiplication operation using a locally pre-trained plaintext local weight matrix to calculate and output the local diagnostic score in the encrypted state. ; Step 4.4: Each secure computing node uses its local diagnostic score under the encrypted state. As input, perform high-order Chebyshev polynomial cascade homomorphic multiplication-addition decision operations to complete the nonlinear logic decisions of each agent within the model, and calculate and output local encryption diagnostic opinions specific to each agent. ; Step 4.5: The main control server of the medical multi-agent collaborative reasoning model introduces a preset plaintext global collaborative confidence weight, performs a cross-node homomorphic weighted cumulative feature fusion operation on all locally encrypted diagnostic opinions, and directly calculates and generates the final ciphertext of the auxiliary diagnostic result. .