A testing method and system for radio frequency surgical electrodes
By combining the fuzzy PID neural network and the PID controller, the problem of misjudgment of high-frequency leakage current performance in radio frequency surgical electrode detection is solved, and higher detection accuracy and safety are achieved.
Patent Information
- Application Number
- CN202411717962.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2044-11-28
AI Technical Summary
When detecting the high-frequency leakage current performance of radio frequency surgical electrodes, the prior art fails to fully consider the impact of the access method of the high-frequency analyzer on the test results, resulting in misjudgment and potential safety hazards.
Using a test method combining fuzzy PID neural network and PID controller, a nonlinear relationship model between independent variables and high-frequency leakage current values is established by collecting independent variables of the equipment type, load resistance value and test circuit connection method of the radio frequency surgical electrode, and an accurate prediction and correction of the high-frequency leakage current value is achieved.
It improves detection accuracy, reduces the probability of error occurrence, enhances adaptability and flexibility, and improves the safety and reliability of radio frequency surgical electrodes.
Smart Images

Figure CN119224637B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of medical devices, in particular to a production and testing technology for radio frequency surgical electrodes, and in particular to a testing method and system for radio frequency surgical electrodes. Background Art
[0002] Radiofrequency surgical electrodes are key components of high-frequency (200Hz~5MHz) surgical equipment. They use the thermal effect generated when high-frequency current passes through human tissue to achieve cutting and coagulation of tissue. Compared with traditional surgical instruments, radiofrequency surgical electrodes have the advantages of clean incisions, good hemostasis, and short operation time. Therefore, they have been widely used in modern surgical operations. However, since radiofrequency surgical electrodes act directly on the human body, their safety and effectiveness are directly related to the patient's life safety and surgical results. Therefore, radiofrequency surgical electrodes need to be strictly tested to ensure that they meet relevant standards and requirements;
[0003] like Figure 2 The bipolar high-frequency leakage current detection test wiring diagram in the GB 9706.202-2021 standard is shown. The existing high-frequency leakage current test is intended to verify that the radiofrequency surgical electrode will not generate excessive leakage current or insulation failure during use, thereby avoiding safety hazards such as electric shock or burns to the patient.
[0004] The document "Zeng Anni, Du Qiunan, Hou Jianxun. Discussion on the detection method of bipolar high-frequency leakage current of high-frequency surgical equipment [J]. Medical and Health Equipment, 2024, 45(04): 88-92." Based on the test method in the current "Medical Electrical Equipment Part 2-2: Special Requirements for Basic Safety and Essential Performance of High-Frequency Surgical Equipment and High-Frequency Accessories", the bipolar high-frequency leakage current detection method of high-frequency surgical equipment was tested and pointed out that when the high-frequency analyzer is connected to the circuit as a test resistor and / or ammeter, the measurement result is relatively accurate; when it is connected to the circuit as a load resistor, it may cause the high-frequency leakage current to be too large, resulting in misjudgment. It also reveals the nonlinear relationship between the independent variables (equipment type, load resistance value, test circuit connection method) and the dependent variable (high-frequency leakage current value) of the radio frequency surgical electrode during the detection process.
[0005] In practice, if the traditional detection method is used and the impact of the access method of the high-frequency analyzer on the test results is not fully considered, it may lead to misjudgment of the high-frequency leakage current performance of the radio frequency surgical electrode. For example, when the rated load of the radio frequency surgical electrode is less than 200Ω, if a fixed 200Ω resistor is connected to the test circuit as a load, the measured high-frequency leakage current may be too large, thereby mistakenly believing that the electrode does not meet safety requirements. Conversely, when the rated load is greater than 200Ω, the measured high-frequency leakage current may be too small, resulting in missed detection of potential safety hazards. To this end, many existing technologies attempt to solve this problem, such as:
[0006] (1) CN212159930U discloses a power detection device for an electrosurgical high-frequency surgical system (publication date: 2020-12-15), which mainly extracts the vector sum and vector difference of the voltage and current of the load through a directional series coupler, and calculates the vector sum and vector difference according to the square difference module to obtain the effective power of the load circuit;
[0007] (2) CN115588964B discloses a full-band leakage detection protection circuit with correctable threshold voltage (publication date: 2023-03-03), which mainly has the function of detecting leakage signals of any phase in the full band of AC power, and a correction circuit is provided to accurately correct the leakage current detection point of the circuit, thereby reducing the difficulty of circuit production and correction;
[0008] (3) CN118112458A discloses a leakage detection device, a leakage detection system and a leakage detection method using the same (publication date: 2024-05-31), which detects AC leakage voltage (when leakage occurs) and converts the AC leakage voltage into DC leakage voltage. The DC leakage voltage can drive the switch module to turn on, and the indicator sends an indication signal to warn of the occurrence of leakage.
[0009] However, the above schemes do not take into account the nonlinear relationship between the above independent variables and the dependent variables. When the load resistance value of the radiofrequency surgical electrode changes, it may not be able to adapt to the change, thereby causing errors in the power detection results.
[0010] To this end, the present invention provides a testing method and system for radio frequency surgical electrodes. Summary of the invention
[0011] In view of this, the present invention hopes to provide a test method and system for radio frequency surgical electrodes to solve or alleviate the technical problems existing in the prior art, namely, how to consider the nonlinear relationship between the independent variables (device type, load resistance value, test circuit connection mode) and the dependent variable (high-frequency leakage current value) of radio frequency surgical electrodes during the detection process, and realize correction and detection value output during the high-frequency leakage detection process, and reduce the probability of error occurrence; the technical solution of the present invention is implemented as follows:
[0012] In the first aspect, a testing method for radiofrequency surgical electrodes:
[0013] 1. Overview:
[0014] The present invention aims to construct a radiofrequency surgical electrode testing technology that combines a fuzzy PID neural network with a PID controller to solve the problem that the traditional detection method does not fully consider the impact of the high-frequency analyzer access method on the test results. This scheme first collects independent variable information such as the device type, load resistance value, and test circuit connection method of the radiofrequency surgical electrode, and then uses a fuzzy PID neural network to establish a nonlinear relationship model between these independent variables and the high-frequency leakage current value. Through the fuzzy reasoning of the neural network and the parameter adjustment of the PID controller, the high-frequency leakage current value can be accurately predicted and corrected, thereby reducing the probability of error.
[0015] (II) Technical solution:
[0016] To achieve the above technical objectives, the present invention selects to perform the following steps:
[0017] 2.1 Step S1, Data Engineering:
[0018] The device type e, load resistance value r and test circuit connection mode c of the target radiofrequency surgical electrode are collected to form a data set as the independent variable X = [e i ,r i ,c i ];
[0019] Among them, e i 、r i and c i They are the device type, load resistance value and test circuit connection method of the i-th target radiofrequency surgical electrode:
[0020] 1) Equipment type i : refers to different models of high-frequency surgical equipment;
[0021] 2) Load resistance r i : Refers to the resistance of the resistor connected in the test circuit. Depending on the test requirements and equipment specifications, the load resistance value can be different values. Load resistance r i is a continuous variable representing the value of the load resistance, such as a floating point number;
[0022] 3) Test circuit connection method c i : Refers to the specific connection method of high-frequency analyzer, load resistor, non-inductive resistor and other equipment in the test circuit. Including:
[0023] 3.1) High-frequency analyzer built-in resistor as test resistor: The built-in resistor of the high-frequency analyzer is directly connected to the test circuit to measure the high-frequency leakage current;
[0024] 3.2) Non-inductive resistor as test resistor: Use non-inductive resistor as the resistance element in the test circuit, connected between the high-frequency analyzer and the electrode;
[0025] 3.3) High-frequency analyzer as an ammeter: The high-frequency analyzer is used only as an ammeter in the test circuit to measure the high-frequency leakage current through the circuit;
[0026] 3.4) Combination method: The built-in resistor of the high-frequency analyzer can also be used in combination with the non-inductive resistor, such as the built-in resistor of the high-frequency analyzer as the load resistor and the non-inductive resistor as the test resistor.
[0027] 2.2 Step S2, activating the fuzzy PID neural network:
[0028] In order to establish a nonlinear relationship between the independent variable X and the dependent variable y as the high-frequency leakage current value, the present invention chooses to use a fuzzy PID neural network. The output layer of the neural network directly provides the parameters of the PID controller (proportional coefficient, integral coefficient, differential coefficient). These parameters are passed to the PID controller for calculating the control quantity. The specific scheme is: receive the independent variable X to the input layer, output the initial PID parameter p to the fuzzy reasoning layer, form the reasoning factor IF and then input it to the output layer to form the final PID parameter p'. Among them, the hierarchical structure of the fuzzy PID neural network of the present invention is specifically as follows:
[0029] (1) Input layer: includes proportional neurons P, integral neurons I, and differential neurons D; receives the independent variable X and converts it into PID parameters p, including the proportional coefficient K p , integral coefficient K i and the differential coefficient K d .
[0030] (2) Fuzzy reasoning layer: It includes five fuzzy neurons, all of which use bell-shaped functions to calculate the proportional coefficient K p , integral coefficient K i and the differential coefficient K d The respective fuzzy values are then used to generate five inference factors IF based on the fuzzy rule set.
[0031] (3) Output layer: Input the inference factor IF into an objective function F, perform metric optimization based on the mean square error, and output the final PID parameter p', including the final proportional coefficient K p ', Final integration coefficient K i ' and the final differential coefficient K d '.
[0032] 2.2.1 Step S200, activate the input layer:
[0033] After the proportional neuron P, the integral neuron I, and the differential neuron D calculate the net input of the independent variable X, a nonlinear change is performed using the ReLU activation function to form the proportional coefficient K p , integral coefficient K i and the differential coefficient Kd :
[0034] (1) Proportional neuron P:
[0035] (2) Integrating neuron I:
[0036] (3) Differentiable Neurons
[0037] Among them, w pj 、w ij and w dj (j=1, 2, 3) are the device types e after the inputs of proportional neuron P, integral neuron I and differential neuron D are encoded and mapped. i ′、Test circuit connection mode after coding mapping c i ′ and load resistance r i The weight of p , b i and b d are the bias terms of these three neurons respectively. p 、z i and z d are the linear combination results (net input) of the proportional neuron P, the integral neuron I and the differential neuron D, respectively, K p , K i and K d It is the output after the nonlinear transformation of the ReLU activation function, that is, the proportional coefficient, integral coefficient and differential coefficient of the PID parameters.
[0038] 2.2.2. Step S201, activating the fuzzy reasoning layer:
[0039] The bell-shaped function is used to represent the membership function of the fuzzy set. This step uses the Gaussian function to simulate the bell-shaped function by calculating each PID parameter (K p , K i , K d ) for the membership of fuzzy sets (including "small", "medium" and "large"). The general form is as follows:
[0040]
[0041] Among them, μ is the degree of membership, x is the input value, σ is the standard deviation (controls the width of the bell), and c is the center value (controls the location of the bell).
[0042] The specific sub-steps of this step include: For each fuzzy neuron, execute:
[0043] S2010, calculate the proportionality coefficient Kp Membership degree (fuzzy value):
[0044]
[0045] Among them, c small 、c medium and c large and σ small , σ medium and σ large are the central value and standard deviation of the “small”, “medium” and “large” fuzzy sets respectively; μ Kp(small) , μ Kp(medium) and μ Kp(large) They are the proportionality coefficient K p Membership to "small", "medium" and "large" fuzzy sets;
[0046] Similarly, for K i and K d Calculate the membership:
[0047]
[0048] μ Ki(small) , μ Ki(medium) and μ Ki(large) They are the integration coefficient K i Membership degree to “small” fuzzy set, “medium” fuzzy set and “large” fuzzy set; μ Kd(small) , μ Kd(medium) and μ Kd(large) They are the differential coefficients K d Membership to "small", "medium" and "large" fuzzy sets;
[0049] S2011, according to different fuzzy values, infer the "conclusion" based on the preset fuzzy rule set (a set of IF-THEN rules); that is, define some rules to determine the value of the fuzzy value according to the proportionality coefficient K. p , integral coefficient K i and the differential coefficient K d The membership degree is used to generate the inference factor IF; the fuzzy rule set is as follows:
[0050] (1) Rule 1 (generating IF1): If the proportionality coefficient K p The value of belongs to the "large" fuzzy set, and the integral coefficient K i The value of belongs to the "small" fuzzy set, and the differential coefficient K d If the value of belongs to the “medium” fuzzy set, then the inference factor IF1 is generated.
[0051] (2) Rule 2 (generating IF2): If the proportionality coefficient K pThe value of belongs to the "medium" fuzzy set, and the integral coefficient K i The value of also belongs to the "medium" fuzzy set, and the differential coefficient K d If the value of belongs to the “small” fuzzy set, then the inference factor IF2 is generated.
[0052] (3) Rule 3 (generating IF3): If the proportionality coefficient K p The value of belongs to the "small" fuzzy set, and the integral coefficient K i The value of belongs to the "large" fuzzy set, and the differential coefficient K d If the value of also belongs to the “large” fuzzy set, then the inference factor IF3 is generated.
[0053] (4) Rule 4 (generating IF4): If the proportionality coefficient K p The value of belongs to the "medium" fuzzy set, and the integral coefficient K i The value of belongs to the "small" fuzzy set, and the differential coefficient K d If the value of belongs to the “large” fuzzy set, then the inference factor IF4 is generated.
[0054] (5) Rule 5 (generating IF5): If the proportionality coefficient K p The value of belongs to the "large" fuzzy set, and the integral coefficient K i The value of belongs to the "medium" fuzzy set, and the differential coefficient K d If the value of belongs to the “small” fuzzy set, then the inference factor IF5 is generated.
[0055] S2012, Generate Inference Factor IF: There are two options:
[0056] (1) Solution 1: Based on the fuzzy rule set, a satisfaction degree is calculated for each rule (calculated by AND and OR operations of fuzzy logic), and then the inference factor IF corresponding to the rule with the highest satisfaction degree is selected.
[0057] (2) Solution 2: In order to simplify and generate five inference factors IF, a simpler method can be used compared to Solution 1: directly based on the proportionality coefficient K p , integral coefficient K i and the differential coefficient K d The membership combinations are used to generate five different inference factors; for example, the five most representative membership combinations (with the largest membership) can be selected as inference factors:
[0058]
[0059] 2.2.3 Step S202, activate the output layer:
[0060] The output layer is responsible for converting the inference factor (IF) into a specific control output. The five inference factors (IF1, IF2, IF3, IF4, IF5) are input into an objective function F, which calculates the final PID parameter p' based on these inference factors and the optimization criterion (mean square error).
[0061] There are five sets of proportional coefficients K p , integral coefficient K i and the differential coefficient K d , corresponding to five inference factors IF1, IF2, IF3, IF4, IF5. Each set of parameters represents the PID controller settings under a specific inference factor. Define the objective function F as:
[0062] Among them, w i is the association weight with the i-th inference factor IFi, which reflects the importance of this inference factor in the final decision.
[0063] It may not be appropriate to directly perform a weighted summation on the PID parameters because the PID parameters are three independent values. Therefore, it is necessary to further calculate the proportional coefficient K p , integral coefficient K i and the differential coefficient K d Perform a weighted sum to get three independent outputs:
[0064] Among them, K pi , K ii and K di are the i-th proportional coefficient K p , integral coefficient K i and the differential coefficient K d .
[0065] Then in order to optimize these parameters, we need a metric to evaluate the deviation between the current PID parameters and the expected PID parameters. The present invention chooses to use the mean square error MSE as the metric:
[0066]
[0067] in, and is the preset expected PID parameter value, which is equivalent to a special threshold. and The output value substituted into a PID controller is a minimum value of an expected value of the target dependent variable y.
[0068] Then, an optimization algorithm is used to iterate and find the weight w that minimizes the MSE. i . Output the final proportional coefficient Kp ', Final integration coefficient K i ' and the final differential coefficient K d '.
[0069] 2.3 Step S3, output dependent variable y:
[0070] Calculate the final proportional coefficient K using the position discrete control algorithm p ', Final integration coefficient K i ' and the final differential coefficient K d 'The respective increments are input into the discretized PID controller to generate the predicted value of the dependent variable y (high-frequency leakage current value). The process includes, at the current time k, executing:
[0071] S300, calculating error e(k)=Sy(k-1); wherein S is the set value of dependent variable y; e(k) is the error at the kth moment;
[0072] S301, calculating the error variation Δe(k)=e(k)-e(k-1); wherein e(k-1) is the error at the k-1th moment;
[0073] S302, calculate the cumulative error integral term: Where A is the accumulated error;
[0074] S303, calculate the dependent variable y(k)=K at the kth moment p '·e(k)+K i 'A+K' d ·Δe(k).
[0075] (III) Mechanism for solving technical problems:
[0076] 3.1 Construction and training of fuzzy PID neural network:
[0077] The present invention selects a fuzzy PID neural network to establish a nonlinear relationship between the independent variable X and the dependent variable y (high-frequency leakage current value). The neural network includes an input layer, a fuzzy reasoning layer and an output layer.
[0078] Receive the independent variable X and calculate the PID parameters (proportional coefficient K) through the proportional neuron P, integral neuron I and differential neuron D p , integral coefficient K i and the differential coefficient K d ). These parameters are output after nonlinear transformation by ReLU activation function.
[0079] The fuzzy values of PID parameters are calculated using bell-shaped functions, and inference factors IF are inferred based on the preset fuzzy rule set. These inference factors reflect the membership of PID parameters under different fuzzy sets.
[0080] The inference factor IF is input into the objective function F, and the metric optimization is performed based on the mean square error to output the final PID parameters (final proportional coefficient K p ', Final integration coefficient K i ' and the final differential coefficient K d ').
[0081] 3.2Application and modification of PID controller:
[0082] The final PID parameters output by the output layer are passed to the PID controller. The increments of the PID parameters are calculated using the position discrete control algorithm and applied to the discretized PID controller. The PID controller calculates the predicted value of the high-frequency leakage current value based on the current error, the change in error, and the cumulative error integral term.
[0083] 3.3 Error reduction and correction mechanism:
[0084] Through learning and training, the fuzzy PID neural network can capture the nonlinear relationship between the independent variable and the dependent variable. This relationship is transmitted to the PID controller in the form of PID parameters, thereby achieving accurate prediction and correction of the high-frequency leakage current value. In the output layer, the objective function F is optimized based on the mean square error to ensure that the output PID parameters can minimize the error between the predicted value and the true value. Since the present invention takes into account the influence of multiple independent variables on the high-frequency leakage current value and uses fuzzy logic and PID control algorithms for correction, it is possible to adaptively adjust the predicted value and reduce the probability of error.
[0085] In the second aspect, a test system for radiofrequency surgical electrodes:
[0086] This system is the hardware carrier of the above-mentioned test method for radiofrequency surgical electrodes. It mainly includes:
[0087] (1) A conventional bipolar high-frequency leakage current detection test system (GB 9706.202-2021 standard), wherein the high-frequency surgical electrode is connected to the power supply network, the neutral electrode and the dual-machine accessories, and the ammeter is connected to a test resistor and a load resistor, wherein the test resistor is connected to the power supply network and the neutral electrode, and the load resistor is connected to the bipolar accessories;
[0088] (2) a processor and a memory connected to the processor, wherein the memory stores program instructions, and when the program instructions are executed by the processor, the processor executes the test method for radio frequency surgical electrodes as described above; wherein the processor is connected to the ammeter via a 485 communication interface.
[0089] Compared with the prior art, the present invention has the following beneficial effects:
[0090] 1. Improve detection accuracy: Through the fuzzy PID neural network, the present invention can capture the nonlinear relationship between the independent variables (equipment type, load resistance value, test circuit connection method) and the dependent variable (high-frequency leakage current value) during the radiofrequency surgical electrode detection process. This ability makes the detection results more consistent with the actual situation and improves the accuracy of the detection.
[0091] 2. Reduce the probability of error: The PID controller in the present invention performs adaptive adjustment according to the parameters output by the fuzzy PID neural network to correct the high-frequency leakage current value. This mechanism reduces the error caused by changes in test conditions and reduces the probability of misjudgment and missed detection. At the output layer, the present invention uses the mean square error as a metric and iterates the optimization algorithm to find the optimal PID parameters, further reducing the deviation between the predicted value and the true value.
[0092] 3. Enhanced adaptability and flexibility: The present invention takes into account the impact of multiple independent variables on the high-frequency leakage current value, including device type, load resistance value, and test circuit connection method, etc. This comprehensive consideration enables the present invention to adapt to different brands and models of radiofrequency surgical electrodes, as well as different test conditions.
[0093] 4. Flexible test methods: The present invention supports multiple test circuit connection methods, including high-frequency analyzer built-in resistors as test resistors, non-inductive resistors as test resistors, etc. This flexibility enables the present invention to meet different test requirements and improve test efficiency.
[0094] 5. Improve safety and reliability: By performing strict high-frequency leakage detection on radio frequency surgical electrodes, the present invention can ensure that the electrodes will not generate excessive leakage current or insulation failure during use, thereby avoiding safety hazards such as electric shock or burns to patients. BRIEF DESCRIPTION OF THE DRAWINGS
[0095] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0096] Figure 1 It is a schematic diagram of the method flow of the present invention;
[0097] Figure 2 It is the wiring diagram of the bipolar high-frequency leakage current detection test in GB 9706.202-2021 standard (bipolar high-frequency leakage current detection test system);
[0098] Figure 3It is a schematic diagram of the system composition of the present invention;
[0099] Figure 4 It is a schematic diagram of the execution flow of the fuzzy PID neural network of the present invention;
[0100] Figure 5 It is a schematic diagram of the hierarchical structure of the fuzzy PID neural network of the present invention;
[0101] Figure 6 It is a schematic diagram of the training process of the fuzzy PID neural network of the present invention;
[0102] Figure 7 It is a schematic diagram of the training verification effect of the fuzzy PID neural network of the present invention;
[0103] Figure 8 It is a schematic diagram of the execution flow of the optimization algorithm of the present invention;
[0104] Fig. 9 It is a schematic diagram of the comparative effect of the test example of the present invention;
[0105] Fig.10 It is a schematic diagram of the nonlinear relationship of the test output in the test example of the present invention;
[0106] Figure numerals: 1. Power supply grid; 2. High-frequency surgical equipment; 3. Table made of insulating material; 4. Neutral electrode (metal or in contact with metal foil of the same size); 5. Starting bipolar accessory; 6. Load resistor; 7. Grounded conductive plane; 8. High-frequency ammeter; 9. Test resistor (200Ω). DETAILED DESCRIPTION
[0107] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the accompanying drawings. In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention can be implemented in many other ways different from those described herein, and those skilled in the art can make similar improvements without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below;
[0108] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.
[0109] Explanation of relevant terms:
[0110] (1) High frequency: 200Hz~5MHz.
[0111] (2) Equipment type i : Refers to different models of high-frequency surgical equipment. For example, high-frequency electrosurgery equipment of different brands (such as equipment A, equipment B, etc.), or equipment of different models. These devices differ in output power, operating frequency, electrode interface, etc. Equipment type e i It is a categorical variable and can be represented by an integer or one-hot encoding.
[0112] (3) Load resistance r i : Refers to the resistance of the resistor connected in the test circuit. Depending on the test requirements and equipment specifications, the load resistance value can be different values. Load resistance r i is a continuous variable representing the value of the load resistance, such as a floating point number.
[0113] (4) Test circuit connection method c i : Refers to the specific connection method of high-frequency analyzer, load resistor, non-inductive resistor and other equipment in the test circuit. Different connection methods will affect the accuracy of the test results. It is also a categorical variable that indicates how the test circuit is connected. Different connection methods can be represented by integers or one-hot encoding.
[0114] (5) Fuzzy PID neural network: It is a neural network model that combines fuzzy logic and PID control algorithm, and is used to process systems with complex nonlinear relationships. It uses fuzzy logic to handle input uncertainty and uses the proportional, integral, and differential parameters of the PID controller to accurately control the system, thereby achieving efficient prediction and regulation.
[0115] (6) Input layer: In the fuzzy PID neural network, the input layer is responsible for receiving data or signals from the outside, such as the device type of the RF surgical electrode, the load resistance value, the test circuit connection method and other independent variable information.
[0116] (7) Proportional neuron P, integral neuron I and differential neuron D: These three types of neurons correspond to the proportional, integral and differential links in the PID controller respectively. They calculate and output the corresponding PID parameters (proportional coefficient Kp, integral coefficient Ki and differential coefficient Kd) according to the signal of the input layer. These parameters are used to describe the dynamic characteristics of the system.
[0117] (8) Fuzzy neuron: Fuzzy neuron is a key component in fuzzy PID neural network, which uses fuzzy logic to process input signals. Fuzzy neurons can handle uncertainty, convert precise input into fuzzy sets through membership functions, and perform reasoning based on fuzzy rules.
[0118] (9) Fuzzy rule set: It is a set of rules based on expert knowledge and experience, which is used to describe the fuzzy relationship between input and output. In the fuzzy PID neural network, the fuzzy rule set is used to generate inference factors to guide the adjustment of PID parameters.
[0119] (10) Membership degree: Indicates the degree to which an element belongs to a fuzzy set, and its value range is usually between 0 and 1. In fuzzy PID neural networks, membership degree is used to quantify the uncertainty of the input signal.
[0120] (11) Inference factor IF: It is the result of reasoning based on the fuzzy rule set. It integrates the outputs of multiple fuzzy neurons and represents a specific fuzzy state or trend. The inference factor is used in subsequent calculations and decision-making processes.
[0121] (12) Output layer: In the fuzzy PID neural network, the output layer is responsible for converting the inference factors into specific control outputs, such as the corrected high-frequency leakage current value. The output layer calculates the final PID parameters through the objective function and optimization algorithm, and passes these parameters to the PID controller to achieve precise control of the system.
[0122] (13) Objective function F: It is a function used to evaluate the deviation between the model output and the actual target. In the fuzzy PID neural network, the objective function F is used to calculate the mean square error (MSE), and the PID parameters are adjusted through the optimization algorithm to minimize the MSE.
[0123] (14) Mean square error (MSE): It is an indicator to measure the difference between the model prediction value and the actual value. In the fuzzy PID neural network, MSE is used to evaluate the performance of the PID controller and optimize the PID parameters by minimizing MSE.
[0124] Embodiment 1: Figure 1 As shown, this embodiment discloses a testing method for radio frequency surgical electrodes, which specifically includes the following steps S1 to S3:
[0125] In this embodiment, regarding step S1, data engineering: collect and organize the device type, load resistance value and test circuit connection method of the radio frequency surgical electrode to form a data set as the independent variable X, so as to consider the influence of these factors on the high-frequency leakage current value (dependent variable) in subsequent analysis and processing.
[0126] Specifically, the device type e, load resistance value r and test circuit connection mode c of the target radiofrequency surgical electrode are collected to form a data set as the independent variable X=[e i ,r i ,c i ];
[0127] Among them, e i 、ri and c i They are the device type, load resistance value and test circuit connection method of the i-th target radiofrequency surgical electrode:
[0128] 1) Equipment type i : Refers to different models of high-frequency surgical equipment.
[0129] 2) Load resistance r i : Refers to the resistance of the resistor connected in the test circuit. Depending on the test requirements and equipment specifications, the load resistance value can be different values. Load resistance r i is a continuous variable representing the value of the load resistance, such as a floating point number.
[0130] 3) Test circuit connection method c i : Refers to the specific connection method of high-frequency analyzer, load resistor, non-inductive resistor and other equipment in the test circuit. Including:
[0131] 3.1) High-frequency analyzer built-in resistor as test resistor: The built-in resistor of the high-frequency analyzer is directly connected to the test circuit to measure the high-frequency leakage current.
[0132] 3.2) Non-inductive resistor as test resistor: Use non-inductive resistor as the resistance element in the test circuit and connect it between the high-frequency analyzer and the electrode.
[0133] 3.3) High frequency analyzer as an ammeter: The high frequency analyzer is used only as an ammeter in the test circuit to measure the high frequency leakage current through the circuit.
[0134] 3.4) Combination method: The built-in resistor of the high-frequency analyzer can also be used in combination with the non-inductive resistor, such as the built-in resistor of the high-frequency analyzer as the load resistor and the non-inductive resistor as the test resistor.
[0135] It is understandable that by comprehensively considering the three independent variables of device type, load resistance value, and test circuit connection method, various situations in the actual surgical environment can be simulated more effectively, thereby improving the accuracy of high-frequency leakage current testing. It helps to reduce test errors caused by changes in a single factor. By comparing high-frequency leakage current values under different device types, load resistance values, and test circuit connection methods, differences in device performance and potential problems can be revealed.
[0136] In this example, see Figures 4-5, Regarding step S2, activating the fuzzy PID neural network: In order to establish a nonlinear relationship between the independent variable X and the dependent variable y as the high-frequency leakage current value, the present invention selects to use a fuzzy PID neural network. The output layer of the neural network directly provides the parameters of the PID controller (proportional coefficient, integral coefficient, differential coefficient). These parameters are passed to the PID controller for calculating the control amount.
[0137] The PID controller receives the parameters and input signals of the neural network, and calculates the control quantity through a discrete control algorithm (position or incremental PID). This control quantity represents the predicted value or control instruction of the high-frequency leakage current value in the model. Through learning and training, the neural network can capture the nonlinear relationship between the independent variable (equipment type, load resistance value, test circuit connection method) and the dependent variable (high-frequency leakage current value), and pass this relationship to the PID controller in the form of PID parameters. The PID controller uses these parameters to regulate the input signal to generate a predicted value. The specific scheme is: receive the independent variable X to the input layer, output the initial PID parameter p to the fuzzy reasoning layer, form the reasoning factor IF and input it into the output layer to form the final PID parameter p'.
[0138] The hierarchical structure of the fuzzy PID neural network in this embodiment is specifically as follows:
[0139] (1) Input layer: It includes proportional neurons P, integral neurons I, and differential neurons D. They are responsible for receiving the independent variable X (device type, load resistance value, test circuit connection method) and converting it into the initial PID parameter p (proportional coefficient K p , integral coefficient K i , differential coefficient K d ). This layer is the interface between the neural network and the external environment, by receiving external information and converting it into internal representations that the neural network can process.
[0140] (2) Fuzzy inference layer: contains five fuzzy neurons, each of which uses a bell-shaped function to calculate the proportionality coefficient K. p , integral coefficient K i and the differential coefficient K d The fuzzy values of each are inferred based on the preset fuzzy rule set to generate five inference factors IF. The fuzzy inference layer is a key part of the neural network to deal with uncertainty and fuzziness. It can capture the complex relationship between independent variables and dependent variables through fuzzy logic.
[0141] (3) Output layer: The inference factor IF generated by the fuzzy inference layer is input into an objective function F, which performs metric optimization based on the mean square error MSE and finally outputs the optimized PID parameter p' (including the final proportional coefficient K p', Final integration coefficient K i ' and the final differential coefficient K d '). The output layer is the final output part of the neural network, which provides a predicted value or control instruction for controlling or predicting the high-frequency leakage current value.
[0142] Specifically, step S200 activates the input layer: after the proportional neuron P, the integral neuron I and the differential neuron D calculate the net input of the independent variable X, the ReLU activation function is used to perform nonlinear changes to form the proportional coefficient K p , integral coefficient K i and the differential coefficient K d :
[0143] (1) Proportional neuron P: First, the proportional neuron P receives the device type e after encoding and mapping. i ', Test circuit connection method c i ′ and load resistance r i as input and passed through the weight w pj (j=1,2,3) for linear combination, plus bias term b p , and the net input z is p Then, the ReLU activation function is used to net the input z p Perform nonlinear transformation to obtain the proportional coefficient K p The expression of the ReLU activation function is max(0,zp), which ensures the proportionality coefficient K p is a non-negative number:
[0144]
[0145] (2) Integrating neuron I:
[0146] The integral neuron I also receives the encoded mapped independent variable as input, and ij (j=1,2,3) for linear combination, plus bias term b i , and the net input z is i . Use the ReLU activation function to net the input z i Perform nonlinear transformation to obtain the integral coefficient K i :
[0147]
[0148] (3) Differentiable neuron D: Differentiable neuron D receives independent variable input and transmits it through weight w dj (j=1,2,3) for linear combination, plus bias term b d , and the net input z is d . Use the ReLU activation function to net the input z dPerform nonlinear transformation to obtain the differential coefficient K d :
[0149]
[0150] Among them, w pj 、w ij and w dj (j=1, 2, 3) are the device types e after the inputs of proportional neuron P, integral neuron I and differential neuron D are encoded and mapped. i ′、Test circuit connection mode after coding mapping c i ′ and load resistance r i The weight of p , b i and b d are the bias terms of these three neurons respectively. p 、z i and z d are the linear combination results (net input) of the proportional neuron P, the integral neuron I and the differential neuron D, respectively, K p , K i and K d It is the output after the nonlinear transformation of the ReLU activation function, that is, the proportional coefficient, integral coefficient and differential coefficient of the PID parameters.
[0151] It can be understood that through the calculation of proportional neurons P, integral neurons I and differential neurons D, as well as the nonlinear transformation of the ReLU activation function, the neural network can more accurately capture the nonlinear relationship between the independent variable and the dependent variable, thereby improving the prediction accuracy of the high-frequency leakage current value. The sparsity and non-vanishing gradient characteristics of the ReLU activation function enhance the robustness of the neural network, allowing the model to maintain high accuracy and stability in the face of complex and changing surgical environments. By accurately calculating the proportional coefficient Kp, integral coefficient Ki and differential coefficient Kd, the neural network provides the optimal parameter configuration for the PID controller, thereby optimizing the control effect and improving the test efficiency and accuracy of radiofrequency surgical electrodes.
[0152] Specifically, step S201 activates the fuzzy reasoning layer: by calculating the membership of the PID parameter p to the fuzzy set (including "small", "medium" and "large"), and inferring the reasoning factor based on the preset fuzzy rule set, a decision-making basis is provided for subsequent high-frequency leakage detection and correction.
[0153] The bell-shaped function is used to represent the membership function of the fuzzy set. This step uses a Gaussian function to simulate the bell-shaped function. By calculating each PID parameter (K p , K i , K d) for the membership of fuzzy sets. The general form of the bell-shaped function is as follows:
[0154]
[0155] Among them, μ is the degree of membership, x is the input value, σ is the standard deviation (controls the width of the bell), and c is the center value (controls the location of the bell).
[0156] The specific sub-steps of this step include: For each fuzzy neuron, execute:
[0157] S2010, calculate the proportionality coefficient K p Membership degree (fuzzy value):
[0158]
[0159] Among them, c small 、c medium and c large and σ small , σ medium and σ large are the central value and standard deviation of the “small”, “medium” and “large” fuzzy sets respectively; μ Kp(small) , μ Kp(medium) and μ Kp(large) They are the proportionality coefficient K p Membership degree to “small” fuzzy set, “medium” fuzzy set and “large” fuzzy set; μ Ki(small) , μ Ki(medium) and μ Ki(large) They are the integration coefficient K i Membership degree to “small” fuzzy set, “medium” fuzzy set and “large” fuzzy set; μ Kd(small) , μ Kd(medium) and μ Kd(large) They are the differential coefficients K d Membership to "small", "medium" and "large" fuzzy sets;
[0160] S2011, according to different fuzzy values, infer the "conclusion" based on the preset fuzzy rule set (a set of IF-THEN rules); that is, define some rules to determine the value of the fuzzy value according to the proportionality coefficient K. p , integral coefficient K i and the differential coefficient K d The membership degree is used to generate the inference factor IF; the fuzzy rule set is as follows:
[0161] (1) Rule 1 (generating IF1): If the proportionality coefficient K p The value of belongs to the "large" fuzzy set, and the integral coefficient K i The value of belongs to the "small" fuzzy set, and the differential coefficient K dThe value of belongs to the "medium" fuzzy set, then the inference factor IF1 is generated. This rule reflects that in a certain case, when the proportional control effect is strong (K p large), while the integral control effect is weak (K i Small), while the differential control effect is moderate (K d When the control is in the middle, the system may show a specific behavior or state: it has good response ability to rapid changes, but the small integral action may lead to large steady-state error. Therefore, the inference factor IF1 is generated for subsequent decision-making or adjustment to optimize the control effect.
[0162] (2) Rule 2 (generating IF2): If the proportionality coefficient K p The value of belongs to the "medium" fuzzy set, and the integral coefficient K i The value of also belongs to the "medium" fuzzy set, and the differential coefficient K d If the value of belongs to the "small" fuzzy set, then the inference factor IF2 is generated. This rule takes into account the situation where the proportional, integral and differential control actions are all at a medium level. This combination is suitable for systems that need to balance response speed and steady-state accuracy. The inference factor IF2 is generated so that specific adjustments or optimizations can be made for this balanced state in subsequent processing.
[0163] (3) Rule 3 (generating IF3): If the proportionality coefficient K p The value of belongs to the "small" fuzzy set, and the integral coefficient K i The value of belongs to the "large" fuzzy set, and the differential coefficient K d The value of also belongs to the "large" fuzzy set, then the inference factor IF3 is generated. This rule reflects that when the proportional control effect is weak (K p Small), while the integral and differential control effects are strong (K i Big, K d This combination is suitable for systems that need to emphasize steady-state accuracy and suppress disturbances, but may sacrifice some response speed. Generate inference factor IF3 so that it can be adjusted in subsequent processing for this need to emphasize steady-state and suppress disturbances.
[0164] (4) Rule 4 (generating IF4): If the proportionality coefficient K p The value of belongs to the "medium" fuzzy set, and the integral coefficient K i The value of belongs to the "small" fuzzy set, and the differential coefficient K d If the value of belongs to the “large” fuzzy set, then the inference factor IF4 is generated.
[0165] This rule takes into account the moderate proportional control effect (K pIn the case of a situation where the integral control effect is weak (Ki is small) and the differential control effect is strong (Kd is large), this combination is suitable for systems that require fast response but do not require high steady-state accuracy. Generate inference factor IF4 to optimize for this fast response requirement in subsequent processing.
[0166] (5) Rule 5 (generating IF5): If the proportionality coefficient K p The value of belongs to the "large" fuzzy set, and the integral coefficient K i The value of belongs to the "medium" fuzzy set, and the differential coefficient K d The value of belongs to the "small" fuzzy set, then the inference factor IF5 is generated. This rule reflects that when the proportional control effect is strong (K p Large), the integral control effect is moderate (K i In the middle), the differential control effect is weak (K d This combination may be suitable for systems that need fast response and have certain requirements for steady-state accuracy, but are not too concerned about disturbance suppression. The inference factor IF5 is generated so that it can be adjusted for this specific requirement in subsequent processing.
[0167] It should be noted that in the above rules, "large", "medium" and "small" are labels of fuzzy sets, which are used to indicate the relative size of PID parameter values. Each rule takes into account the proportionality coefficient K p , integral coefficient K i and the differential coefficient K d All possible combinations of the three parameters are considered and different inference factors are generated based on these combinations.
[0168] It should be pointed out that the above different inference factors IF are essentially decision variables or control variables in fuzzy logic, which are calculated based on the fuzzy rule set and the membership of the input variables. In fuzzy control systems, inference factors IF are usually used to represent control strategies or decision results under certain conditions. They can be scalars in numerical form and used in subsequent control algorithms or decision-making processes.
[0169] S2012, Generate inference factor IF: In order to simplify and generate five inference factors IF, directly according to the proportional coefficient K p , integral coefficient K i and the differential coefficient K d The membership combinations are used to generate five different inference factors; for example, the five most representative membership combinations (with the largest membership) can be selected as inference factors:
[0170]
[0171] It can be understood that by introducing fuzzy sets and membership functions, the model can handle the uncertainty and ambiguity in the RF surgical electrode testing process, improving the flexibility and adaptability of the model. Based on fuzzy rule sets and inference factors, the model can make decisions more accurately based on the membership combination of PID parameters, thereby improving the accuracy and correction effect of high-frequency leakage detection.
[0172] Specifically, step S202 activates the output layer: the main task of the output layer is to convert the five inference factors (IF1, IF2, IF3, IF4, IF5) into specific PID controller parameter outputs, namely the proportional coefficient K p , integral coefficient K i and the differential coefficient K d These inference factors reflect the influence of different independent variables (such as equipment type, load resistance value, test circuit connection method, etc.) on the high-frequency leakage current value (dependent variable) during the RF surgical electrode detection process.
[0173] There are five sets of proportional coefficients K p , integral coefficient K i and the differential coefficient K d , corresponding to five inference factors IF1, IF2, IF3, IF4, IF5. Each set of parameters represents the PID controller settings under a specific inference factor.
[0174] An objective function F is introduced, which accepts five inference factors as input and calculates the final PID parameters based on these factors and the optimization criterion (mean square error MSE). The objective function F is defined as F(IF1, IF2, IF3, IF4, IF5), and the contribution of each inference factor is considered by weighted summation. The objective function F is defined as:
[0175]
[0176] Among them, w i is the association weight with the i-th inference factor IFi, which reflects the importance of this inference factor in the final decision.
[0177] It may not be appropriate to directly perform a weighted summation on the PID parameters because the PID parameters are three independent values. Therefore, it is necessary to further calculate the proportional coefficient K p , integral coefficient K i and the differential coefficient K d Perform a weighted sum to get three independent outputs:
[0178] Among them, K pi , K ii and K di are the i-th proportional coefficient Kp , integral coefficient K i and the differential coefficient K d Then in order to optimize these parameters, we need a metric to evaluate the deviation between the current PID parameters and the desired PID parameters.
[0179] Preferably, this embodiment selects to use mean square error MSE as the metric:
[0180]
[0181] in, and is the preset expected PID parameter value, which is equivalent to a special threshold. and The output value substituted into a PID controller is a minimum value of an expected value of the target dependent variable y.
[0182] Then, we perform an iteration using an optimization algorithm (such as the Adam optimizer) to find the weight w that minimizes the MSE. i . Output the final proportional coefficient K p ', Final integration coefficient K i ' and the final differential coefficient K d '.
[0183] It can be understood that the nonlinear relationship between the independent variable and the dependent variable in the RF surgical electrode test process can be more accurately reflected through the PID parameter optimization based on the inference factor, thereby improving the detection accuracy of the high-frequency leakage current. Using the mean square error MSE as the optimization criterion and finding the weight value that minimizes the MSE through iterative optimization can help reduce the error caused by improper parameter setting. This method can dynamically adjust the PID parameters according to independent variables such as different equipment types, load resistance values, and test circuit connection methods, thereby enhancing the adaptability and flexibility of the test method.
[0184] Furthermore, the MATLAB execution program of the above fuzzy PID neural network is as follows:
[0185] % Initialize related parameters
[0186] numSamples = 100; % number of samples
[0187] numInputs=3;%Number of input variables
[0188] numRules=5;%Number of fuzzy rules
[0189] numOutputs=3;% Number of PID parameters
[0190] % Initialize neural network weights and biases
[0191] weightsInput=rand(numInputs,numOutputs);
[0192] biasesInput=rand(1,numOutputs);
[0193] %Activate the three neurons in the input layer and calculate the initial PID parameters
[0194] Kp=max(0,X(:,1)*weightsInput(:,1)+biasesInput(1));
[0195] Ki=max(0,X(:,2)*weightsInput(:,2)+biasesInput(2));
[0196] Kd=max(0,X(:,3)*weightsInput(:,3)+biasesInput(3));
[0197] % Initialize fuzzy inference layer parameters
[0198] cSmall = [0.2, 0.2, 0.2];
[0199] cMedium = [0.5, 0.5, 0.5];
[0200] cLarge = [0.8, 0.8, 0.8];
[0201] sigma = [0.1, 0.1, 0.1];
[0202] %Execute the fuzzy reasoning layer to calculate the membership and reasoning factors
[0203] uzzIFication=@(x)x;%Fuzzification function
[0204] fuzzIFiedInputs=fuzzIFication(inputs);
[0205] fuzzySets=cell(numInputs,1);
[0206] for i=1:numInputs
[0207] fuzzySets{i}=@(x)max(0,min(1,(x-(i-1) / 2) / (1 / 2)));%MembershipendfuzzIFiedInputs=zeros(numInputs,1);
[0208] for i=1:numInputs
[0209] fuzzIFiedInputs(i)=fuzzySets{i}(inputs(i));
[0210] end
[0211] % Reasoning based on fuzzy rules
[0212] % "If...then..." format, and each rule corresponds to a set of PID parameters
[0213] rules = rand (numRules, numInputs); % fuzzy rule matrix
[0214] weights=ones(numRules,1);% weight
[0215] inferenceFactors=zeros(numRules,1);
[0216] for r=1:numRules
[0217] inferenceFactors(r)=prod(fuzzIFiedInputs.*rules(r,:));
[0218] endinferenceFactors = inferenceFactors / sum (inferenceFactors); % Normalization % Preset PID parameters (one set for each rule)
[0219] presetPID=rand(numRules,numOutputs); %Assumed preset PID parameter matrix %Rules layer
[0220] rules = rand (numRules, numInputs); % fuzzy rules
[0221] weights = rand (numRules, 1); % weight
[0222] inferenceFactors=sum(fuzzIFiedInputs.*rules,2). / sum(rules,2);
[0223] IF=rand(numSamples,numRules);
[0224] % Initialize output layer parameters (weights, etc.)
[0225] weightsOutput=rand(numRules,numOutputs);
[0226] %Activate the output layer and calculate the final PID parameters
[0227] Kp_prime=sum(IF.*weightsOutput(:,1),2);
[0228] Ki_prime=sum(IF.*weightsOutput(:,2),2);
[0229] Kd_prime=sum(IF.*weightsOutput(:,3),2);
[0230] % Expected PID parameter values
[0231] Kp_expected = 0.6;
[0232] Ki_expected = 0.3;
[0233] Kd_expected = 0.1;
[0234] % Calculate the mean square error (MSE) as the optimization target
[0235] MSE_Kp=mean((Kp_prime-Kp_expected).^2);
[0236] MSE_Ki=mean((Ki_prime-Ki_expected).^2);
[0237] MSE_Kd=mean((Kd_prime-Kd_expected).^2);
[0238] MSE = MSE_Kp + MSE_Ki + MSE_Kd;
[0239] % Use optimization algorithm ...
[0240] % Output the final optimized PID parameters
[0241] disp('Optimized PID Parameters:');
[0242] disp(['Kp:',num2str(mean(Kp_prime))]);
[0243] disp(['Ki:',num2str(mean(Ki_prime))]);
[0244] disp(['Kd:',num2str(mean(Kd_prime))]);
[0245] In this embodiment, regarding step S3, the output dependent variable y is: the final proportional coefficient K is calculated using the position discrete control algorithm p ', Final integration coefficient K i ' and the final differential coefficient K d 'The respective increments are input into the discretized PID controller to generate the predicted value of the dependent variable y (high-frequency leakage current value). The process includes, at the current time k, executing:
[0246] S300, at the current time k, first calculate the error e(k), which is defined as the difference between the set value S and the measured value y(k-1) of the dependent variable y at the previous time, that is:
[0247] Calculate the error e(k) = Sy(k-1); where S is the set value of the dependent variable y; e(k) is the error at the kth moment;
[0248] This step is the basis of PID control, which evaluates the gap between the current system state and the desired state by calculating the error.
[0249] S301, then, calculate the error change Δe(k), which represents the difference between the error e(k) at the current moment and the error e(k-1) at the previous moment, that is:
[0250] Δe(k)=e(k)-e(k-1); wherein e(k-1) is the error at the k-1th moment.
[0251] The change in error reflects the trend of system state change.
[0252] S302, the cumulative error integral term is used for the integral link in PID control, which represents the cumulative sum of all errors from the start of control to the current time k, expressed as:
[0253] Where A is the accumulated error; the integral term of the accumulated error helps to eliminate the static error of the system and improve the control accuracy.
[0254] S303, finally, according to the position discrete control algorithm, the predicted value of the dependent variable y(k) at the kth moment is calculated. The predicted value is based on the error e(k) at the current moment, the change in the error Δe(k) and the cumulative error integral term A(k), and is the result of the combined action of the proportional, integral and differential links of the PID controller. The specific calculation formula is as follows:
[0255] y(k)=K p '·e(k)+K i 'A+K' d ·Δe(k).
[0256] It is understandable that by comprehensively considering the current error, error change and cumulative error, the PID controller can adjust the control parameters more accurately, thereby reducing the deviation between the dependent variable (high-frequency leakage current value) and the set value and improving the accuracy of the test. The integral link can eliminate the static error of the system, and the differential link can predict the changing trend of the system state. The combination of the two makes the system more stable and robust in the face of external interference. There is a nonlinear relationship between the independent variable and the dependent variable of the radiofrequency surgical electrode during the detection process. Through the dynamic adjustment of the PID controller, it can better adapt to this nonlinear relationship and reduce the probability of error occurrence.
[0257] It should be pointed out that in this embodiment, the fuzzy PID neural network combines the advantages of fuzzy logic and neural network, and has the ability to process nonlinear, uncertain and fuzzy information. The network consists of an input layer, a fuzzy reasoning layer and an output layer. The input layer receives input information of independent variables, such as device type, load resistance value, test circuit connection mode, etc. The fuzzy reasoning layer converts these input information into fuzzy sets, that is, uses membership functions to map precise values to fuzzy values, performs reasoning based on the fuzzy rule base, and the output layer converts the fuzzy reasoning results into precise values. The fuzzy PID neural network can automatically adjust and optimize the parameters of the PID controller through the learning ability of fuzzy rules and neural networks to adapt to the nonlinear relationship between independent variables and dependent variables during radiofrequency surgical electrode detection. The position discrete control algorithm calculates the control quantity, that is, the predicted value of the high-frequency leakage current value, based on the error, error change and cumulative error at the current moment. In step S2, the fuzzy PID neural network has generated a set of optimized PID controller parameters based on the input independent variable information; in step S3, the position discrete control algorithm uses these optimized parameters to calculate the predicted value of the high-frequency leakage current value. In this way, the fuzzy PID neural network provides more accurate PID parameters to the position discrete control algorithm, which in turn uses these parameters to perform the prediction task.
[0258] It can be further understood that the fuzzy PID neural network can automatically learn and adapt to the nonlinear relationship between the independent variable and the dependent variable in the process of radiofrequency surgical electrode detection through its internal fuzzy rules and neural network structure. Once the fuzzy PID neural network completes the construction of the nonlinear relationship and the optimization of the PID parameters, the position discrete control algorithm can calculate the predicted value of the high-frequency leakage current value based on the error, error change and cumulative error at the current moment. This predicted value is based on the nonlinear relationship learned by the fuzzy PID neural network and the system state at the current moment, so it has high prediction accuracy and real-time performance.
[0259] Embodiment 2: Figures 6-7 As shown, this embodiment further provides the training process of the fuzzy PID neural network based on the first embodiment:
[0260] P1. Data preparation:
[0261] The high-frequency leakage current detection data of radiofrequency surgical electrodes are collected, including the independent variables X of device type, load resistance value and test circuit connection mode, and the corresponding high-frequency leakage current value as the dependent variable y. Then the collected data are preprocessed conventionally, including encoding categorical variables (such as device type and test circuit connection mode), normalizing continuous variables (such as load resistance value), etc.; a data set D is obtained:
[0262] D=[(X1,Y1),(X2,Y2),...,(X n ,Y n )];
[0263] Among them, (X i ,Y i ) is the i-th sample, and n is the number of samples.
[0264] P2. Network initialization:
[0265] According to the configuration, the structure of the fuzzy PID neural network as described in the first embodiment includes an input layer, a fuzzy reasoning layer and an output layer, as well as their respective numbers of neurons, connection methods and ReLU activation functions.
[0266] Randomly initialize the weights w in the network pj 、w ij and w dj , and the bias term b p , b i and b d These parameters will be gradually adjusted during the training process to optimize the network performance.
[0267] P3, forward propagation:
[0268] P3.1 Input data: Input the preprocessed data set D into the input layer of the fuzzy PID neural network.
[0269] P3.2, Calculate PID parameters: Calculate the initial PID parameter p (proportional coefficient K) through proportional neuron P, integral neuron I and differential neuron D p , integral coefficient K i and the differential coefficient K d ).
[0270] P3.3, fuzzy reasoning: In the fuzzy reasoning layer, the fuzzy values of the PID parameters are calculated using a bell-shaped function, and the inference factor IF is generated according to the preset fuzzy rule set.
[0271] P3.4, output PID parameters: input the inference factor IF to the output layer, and calculate the final PID parameters (proportional coefficient K) through the objective function F p ', integral coefficient K i ' and differential coefficient K d ').
[0272] P4. Back propagation:
[0273] Using mean square error (MSE) as a metric, calculate the error e between the predicted value of the high-frequency leakage current output by the network and the actual value. Back-propagate the error e from the output layer to the input layer and calculate the error contribution of each layer of neurons. According to the error contribution and the Adam optimizer, adjust the network weights w in the direction pj 、w ij and w dj , and the bias term b p , b i and b d , in order to reduce the error and improve the prediction accuracy.
[0274] P5. Parameter update:
[0275] Set a learning rate to control the step size of parameter update; use gradient descent method to update the network weight w pj 、w ij and w dj , and the bias term b p , b i and b d .
[0276] P6, iterative training:
[0277] Repeat P3 to P5 (forward propagation, error calculation, and back propagation) until the preset stop condition is met (such as the error e is less than the preset threshold or the maximum number of iterations is reached), and then update the weight w we need pj 、w ij and wdj , and the bias term b p , b i and b d .
[0278] During the training process, the performance of the model is evaluated periodically using the validation dataset (e.g. Figure 7 As shown, this embodiment selects MAPE) to avoid overfitting.
[0279] Embodiment 3: In step S2012 of embodiment 1, in order to simplify and generate five inference factors IF, the proportional coefficient K is directly used. p , integral coefficient K i and the differential coefficient K d The membership degree combination is used to generate five different inference factors; however, this embodiment further provides a more preferred solution, that is, calculating a satisfaction degree for each rule (calculated by AND and OR operations of fuzzy logic), and then selecting the inference factor IF corresponding to the rule with the highest satisfaction degree. The solution is:
[0280] (I) Define fuzzy logic operations:
[0281] (1) Fuzzy AND (∧): expressed using the minimum value or product.
[0282] (2) Fuzzy OR (∨): expressed using maximum value or algebraic sum.
[0283] (3) Calculate the degree of satisfaction of each condition: For the condition part (i.e., the IF part) of each rule, calculate the degree of satisfaction of each condition (between 0 and 1).
[0284] (4) Satisfaction of combined conditions: Use fuzzy logic AND and OR operations to combine the satisfaction of each condition to obtain the satisfaction of the entire rule condition.
[0285] (5) Select the rule with the highest satisfaction: Compare the satisfaction of all rules, select the rule with the highest satisfaction, and use its corresponding inference factor IF as the final choice.
[0286] (II) Reasoning scheme:
[0287] P1. Based on the n (5) rules and m conditions described in Example 1. Let C ij Indicates the satisfaction degree of the jth condition of the i-th rule (calculated by linear interpolation):
[0288] Among them, T1 and T2 are the preset maximum satisfaction and minimum satisfaction, and O is the average membership degree under the current rule.
[0289] P2. Satisfaction of combined conditions: For each rule i, combine the satisfaction of all its conditions j to obtain the satisfaction of the rule conditions S i If there are multiple conditions that need to be combined, you can use fuzzy AND and OR operations. For example, for rule i:
[0290] If the condition is an AND relationship: S i =C i1 ∧C i2 ∧...∧C im ;
[0291] If the condition is an OR relationship: S i =C i1 ∨C i2 ∨...∨C im ;
[0292] Mixed relationships can be nested and calculated according to specific logic.
[0293] P3. Select the rule with the highest satisfaction:
[0294] Find the rule with the highest satisfaction: k = argmax(S i ), where i = 1, 2, ..., n.
[0295] Select the inference factor IF corresponding to rule k.
[0296] Exemplary:
[0297] (1) Taking the first three rules in Example 1 as an example, first abstract the conditions of each rule:
[0298] Rule 1: IF(condition 11 AND condition 12)
[0299] Rule 2: IF(Condition 21 OR Condition 22)
[0300] Rule 3: IF(condition 31 AND (condition 32 OR condition 33))
[0301] (2) Calculate the satisfaction of each condition:
[0302] Satisfaction of condition 11: C 11 ;
[0303] Satisfaction of condition 12: C 12 ;
[0304] Satisfaction of condition 21: C 21 ;
[0305] Satisfaction of condition 22: C 22 ;
[0306] Satisfaction of condition 31: C 31 ;
[0307] Satisfaction of condition 32: C 32 ;
[0308] Satisfaction of condition 33: C 33 ;
[0309] (3) Satisfaction of combination conditions:
[0310] Satisfaction of Rule 1: S1 = C 11 ∧C 12 ;
[0311] Satisfaction of Rule 2: S2 = C 21 ∨C 22 ;
[0312] Satisfaction of Rule 3: S3 = C 31 ∧(C 32 ∨C 33 );
[0313] (4) Select the rule with the highest satisfaction:
[0314] k = argmax(S1, S2, S3);
[0315] (5) Finally, the inference factor IF corresponding to rule k is selected.
[0316] In this way, the applicability of each rule can be evaluated more finely and the rule that best suits the current situation can be selected. This is because the fuzzy logic method can handle more complex combinations of conditions, including logical relationships such as AND and OR, as well as weight differences between different conditions. This makes the evaluation of each rule more detailed and accurate. Furthermore, the fuzzy logic method can dynamically adjust the calculation of satisfaction according to the current situation, thereby more flexibly adapting to different input conditions.
[0317] By comprehensively considering multiple conditions and the logical relationships between them, fuzzy logic methods can reduce overall reasoning errors caused by misjudgment of a single condition. Fuzzy logic methods can handle the uncertainty and ambiguity of input data, thereby improving the robustness and stability of the reasoning system.
[0318] Example 4: Please refer to Figure 8 This embodiment further provides a specific implementation of the optimization algorithm of step S202 in embodiment 1. This embodiment selects to use the gradient descent algorithm:
[0319] P1, Initialize weights: is a random value or zero;
[0320] P2, iterative objective function:
[0321] Among them, η is the learning rate, a small positive number. is the MSE with respect to weight The partial derivative of .
[0322] P3. Define MSE:
[0323] Where: N is the number of samples; yj is the true value of the jth sample; is the predicted value of the jth sample, usually a linear combination of weights wi and input features; therefore, the partial derivative can be further expanded as:
[0324]
[0325] in, Depends on the predicted value How it depends on weights
[0326] P4, continue to execute P2 to P3 until the MSE is less than the preset threshold, and then adjust the weight is considered as the final weight.
[0327] Embodiment 5: Figure 3 As shown, this embodiment further discloses a test system for radio frequency surgical electrodes, which is the hardware carrier of the test method for radio frequency surgical electrodes recorded in all the above embodiments. The hardware composition includes:
[0328] (1) Traditional bipolar high-frequency leakage current detection test system (GB 9706.202-2021 standard):
[0329] High-frequency surgical electrode: The radiofrequency surgical electrode to be tested achieves tissue cutting and coagulation through high-frequency current.
[0330] Power supply grid: provides a stable power supply for the system.
[0331] Neutral electrode: connected to the power supply grid during the detection process to form a current loop.
[0332] Bipolar accessory: connects RF surgical electrodes and load resistors to simulate the circuit environment in actual use.
[0333] Ammeter: used to measure the current in the circuit, including high-frequency leakage current. The ammeter is connected to the power supply network, neutral electrode and bipolar accessories through the test resistor and load resistor.
[0334] Test resistor: connected to the power supply grid and the neutral electrode to assist in measuring high-frequency leakage current.
[0335] Load resistor: connected to the bipolar accessory to simulate the load condition of the RF surgical electrode during use.
[0336] (2) Processor and memory:
[0337] Processor: The core processing unit of the system, responsible for executing program instructions in memory and implementing test methods for radiofrequency surgical electrodes.
[0338] Memory: stores program instructions and data, including independent variable information such as the device type of the radiofrequency surgical electrode, the load resistance value, the test circuit connection method, as well as the parameters of the fuzzy PID neural network and the parameters of the PID controller.
[0339] 485 communication interface: used for data transmission between the processor and the ammeter to realize real-time current monitoring.
[0340] (3) Working principle:
[0341] When the system starts, the processor reads the independent variable information such as the device type, load resistance value and test circuit connection mode of the radiofrequency surgical electrode from the memory. Through the 485 communication interface, the processor obtains the current data measured by the ammeter in real time.
[0342] The processor inputs the collected independent variable information into the input layer of the fuzzy PID neural network to calculate the initial PID parameters (proportional coefficient, integral coefficient, differential coefficient). In the fuzzy inference layer, the processor uses the bell-shaped function to calculate the fuzzy value of the PID parameter and generates the inference factor based on the preset fuzzy rule set. In the output layer, the processor inputs the inference factor into the objective function and outputs the final PID parameters through mean square error optimization.
[0343] The processor passes the final PID parameters to the PID controller, which calculates the control quantity based on these parameters and real-time current data. The processor calculates the predicted value of the high-frequency leakage current value through the position discrete control algorithm. The processor then outputs the corrected high-frequency leakage current value for the user to refer to and judge the safety of the radiofrequency surgical electrode.
[0344] Specifically, the method of using this system is:
[0345] P1. System preparation: Connect the radiofrequency surgical electrodes, power supply network, neutral electrode and bipolar accessories according to the standard connection method.
[0346] P2. Parameter setting: Input the independent variable information such as the device type, load resistance value and test circuit connection mode of the radio frequency surgical electrode through the controller interface or external device. Set the set value and allowable error range of the high-frequency leakage current value.
[0347] P3. Start the test and observe the changes of the high-frequency leakage current value on the system interface in real time, and wait for the test to be completed.
[0348] P4. After the test is completed, check the corrected high-frequency leakage current value and its deviation from the set value. According to the deviation, determine whether the radiofrequency surgical electrode meets the safety requirements.
[0349] Test example:
[0350] (I) Purpose of the test:
[0351] The purpose of this experiment is to compare and verify the performance difference between the test method based on fuzzy PID neural network and the traditional CNN neural network model in predicting the high-frequency leakage current value of radiofrequency surgical electrodes, so as to evaluate the advantages of the fuzzy PID neural network described in Examples 1 to 4 in improving prediction accuracy.
[0352] (II) Experimental and control group settings
[0353] (1) Experimental group:
[0354] System configuration: The radio frequency surgical electrode testing system described in the fifth embodiment is used, and the system memory is equipped with program instructions of the testing method based on the fuzzy PID neural network.
[0355] The neural network has been trained in advance using a large amount of historical data, and parameter optimization and deployment have been completed. The fuzzy PID neural network combines the advantages of fuzzy logic and neural networks, and can handle nonlinear, uncertain and fuzzy information. It is particularly suitable for predicting high-frequency leakage current values during radiofrequency surgical electrode detection.
[0356] (2) Control group: The same radiofrequency surgical electrode test system as the experimental group was used, but the traditional CNN neural network model was installed in the memory.
[0357] The CNN neural network was also trained using the same training set as the experimental group and deployed.
[0358] (III) Test methods:
[0359] Based on a set of preset samples, these samples contain the trend of the actual dependent variable (high-frequency leakage current value) over time, such as Fig. 9 shown.
[0360] Task objective: The objectives of both the experimental group and the control group are to read the independent variables corresponding to the actual dependent variables (such as device type, load resistance value, test circuit connection method, etc.) and predict the output of the dependent variable values (high-frequency leakage current values) at different time points. The predicted values are compared with the actual dependent variables to evaluate the prediction accuracy of the two methods.
[0361] (IV) Test results:
[0362] like Fig. 9 As shown, the change trends of the prediction curves and the actual dependent variables (high-frequency leakage current values) of the experimental group (fuzzy PID neural network) and the control group (traditional CNN neural network) are compared.
[0363] Although the prediction curve output by the traditional CNN neural network roughly conforms to the trend of the actual dependent variable, there is a significant deviation. This deviation may lead to inaccurate prediction of the high-frequency leakage current value of the surgical electrode, which may lead to process defects or safety accidents.
[0364] The prediction curve output by the fuzzy PID neural network is very consistent with the trend of the actual dependent variable, almost coinciding with the actual value. This shows that the fuzzy PID neural network has higher accuracy and stability in predicting high-frequency leakage current values. At the same time, on the basis of accurate prediction, the fuzzy PID neural network can further output the relationship distribution diagram between the independent variable and the dependent variable, such as Fig.10 shown.
[0365] Furthermore, by calculating the error between the predicted value and the actual value, it is found that the error of the fuzzy PID neural network is much smaller than that of the traditional CNN neural network. At different time points, the predicted value of the fuzzy PID neural network can maintain a high stability, while the predicted value of the traditional CNN neural network has certain fluctuations.
[0366] (V) Conclusion:
[0367] This experiment compared the performance of the test method based on fuzzy PID neural network with the traditional CNN neural network model in predicting the high-frequency leakage current value of radiofrequency surgical electrodes, and verified the significant advantages of fuzzy PID neural network in improving prediction accuracy. Fuzzy PID neural network can more accurately predict the high-frequency leakage current value, providing strong technical support for the detection and quality control of radiofrequency surgical electrodes. In the future, it is recommended to further promote and apply the test method based on fuzzy PID neural network to improve the safety and reliability of radiofrequency surgical electrodes.
[0368] All the above embodiments only express the implementation methods of the relevant practical applications of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be based on the attached claims.
[0369] For those skilled in the art, it can be further appreciated that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0370] At the same time, those skilled in the art can understand that all or part of the processes in all the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media provided in this application and used in the embodiments can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
Claims
1. A testing method for radiofrequency surgical electrodes, characterized in that: The implementation steps include: S1, collect the device type e, load resistance value r and test circuit connection mode c of the target radiofrequency surgical electrode to form a data set as the independent variable X; S2, activate the fuzzy PID neural network, receive the independent variable X to the input layer, output the initial PID parameter p to the fuzzy reasoning layer, form the reasoning factor IF and input it to the output layer to form the final PID parameter p'; S3, using a position discrete control algorithm to calculate the increment of the final PID parameter p', and input it into the discretized PID controller to generate a predicted value of the dependent variable y as the high-frequency leakage current value.
2. The testing method according to claim 1, characterized in that: In S1, X = [e i ,r i ,c i ]; Among them, e i 、r i and c i are the device type, load resistance value, and test circuit connection method of the i-th target radiofrequency surgical electrode; The equipment types are different models of surgical equipment; The load resistance value is a floating point value; The test circuit connection method includes using a built-in resistor of a high-frequency analyzer as a test resistor, or / and a non-inductive resistor as a test resistor.
3. The testing method according to claim 1, characterized in that: In S2, the PID parameter p includes the proportional coefficient K p , integral coefficient K i and the differential coefficient K d ; The final PID parameter p' includes the final proportional coefficient K p ', Final integration coefficient K i ' and the final differential coefficient K d '.
4. The testing method according to claim 3, characterized in that: In the fuzzy PID neural network: The input layer: includes a proportional neuron P, an integral neuron I and a differential neuron D; receives the independent variable X and converts it into the PID parameter p; The fuzzy reasoning layer includes five fuzzy neurons, each of which uses a bell-shaped function to calculate the proportional coefficient K. p , the integral coefficient K i and the differential coefficient K d The respective fuzzy values are then used to generate five said inference factors IF based on the fuzzy rule set; The output layer: inputs the inference factor IF into the objective function F, performs metric optimization through the mean square error MSE, and outputs the final proportional coefficient K p ', the final integral coefficient K i ' and the final differential coefficient K d '.
5. The testing method according to claim 4, characterized in that: In the input layer: The proportion of neurons P: The integrating neuron I: The differential neuron D: Among them, w pj 、w ij and w dj The device types e after encoding and mapping of the inputs corresponding to the proportional neuron P, the integral neuron I and the differential neuron D are respectively i ′、Test circuit connection mode after coding mapping c i ′ and load resistance r i The weight of p 、b i and b d are the bias terms of these three neurons respectively; z p 、z i and z d are the linear combination results of these three neurons, K p , K i and K d It is the output after nonlinear transformation of the ReLU activation function, that is, the proportional coefficient, integral coefficient and differential coefficient of the PID parameter; where j = 1, 2, 3.
6. The testing method according to claim 4, characterized in that: The workflow of the fuzzy reasoning layer includes: Calculate the proportionality coefficient K p , the integral coefficient K i and the differential coefficient K d For the membership degree of different fuzzy sets; According to different memberships, the combination of the five largest memberships is selected based on the preset fuzzy rule set.
7. The testing method according to claim 4, characterized in that: The workflow of the output layer includes: reading the existing five sets of proportional coefficients K p , the integral coefficient K i and the differential coefficient K d , corresponding to the five inference factors IF1, IF2, IF3, IF4 and IF5, and substituted into the objective function F: Among them, w i is the association weight with the i-th inference factor IFi; Three separate outputs are obtained: Among them, K pi , K ii and K di are the i-th proportional coefficient K p , integral coefficient K i and the differential coefficient K d ; Optimization output: Using the mean squared error MSE as the metric: in, and is the preset expected PID parameter value; then, the optimization algorithm is used to perform iterations to find the weight w that minimizes the MSE value. i ; Finally, output the final proportional coefficient K p ', the final integral coefficient K i ' and the final differential coefficient K d '.
8. The testing method according to claim 7, characterized in that: The execution process of S3 includes: S300, calculating error e(k)=Sy(k-1); wherein S is the set value of dependent variable y; e(k) is the error at the kth moment; S301, calculating the error variation Δe(k)=e(k)-e(k-1); wherein e(k-1) is the error at the k-1th moment; S302, calculate the cumulative error integral term: Where A is the accumulated error; S303, calculate the dependent variable y(k) at the kth moment: y(k)=K p '·e(k)+K i '·A+K' d ·Δe(k)。 9. A test system for radio frequency surgical electrodes, characterized in that: The test system includes a bipolar high-frequency leakage current detection test system and a processor, and also includes a memory connected to the processor, wherein program instructions are stored in the memory. When the program instructions are executed by the processor, the processor executes the test method as described in any one of claims 1-8.
10. The test system according to claim 9, characterized in that: The bipolar high-frequency leakage current detection test system includes a power supply network, a neutral electrode and a high-frequency surgical electrode connected to a bipolar accessory, an ammeter connected to a test resistor and a load resistor, wherein the test resistor is connected to the power supply network and the neutral electrode, and the load resistor is connected to the bipolar accessory; the processor is connected to the ammeter.
Citation Information
Patent Citations
A threshold voltage-correctable full-band leakage current detection and protection circuit
CN115588964B
Electric leakage detection device, electric leakage detection system using same, and electric leakage detection method
CN118112458A
Power detection device of electrosurgical high-frequency surgical system
CN212159930U
Improved fuzzy PID control method for precise operation of cutter detection mechanical arm
CN110045597A
Brushless DC motor fuzzy PID control method based on neural network matrix
CN113783479A