A transmission protection circuit for medical neural network chips
By using a read-only memory, counter, comparator, and transmission protection circuit of a cross-interchange module on a medical neural network chip, the cross-interchange module outputs data alternately under state switching, solving the problem of data monitoring and achieving device-side security enhancement without increasing server-side resources.
Patent Information
- Application Number
- CN202411323472.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-23
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2044-09-23
AI Technical Summary
Existing technologies require increasing hardware overhead on both the device and server sides to prevent data monitoring of medical neural network chips, resulting in a waste of resources.
A transmission protection circuit is composed of a read-only memory, a counter, a comparator and a cross-interchange module. The cross-interchange module switches states under the control of the comparator and alternately outputs input data and weight data to prevent attackers from obtaining complete data.
It effectively prevents data monitoring by adding only a small amount of hardware on the device side and does not require additional hardware overhead on the server side, thereby improving the security of medical neural network chips.
Smart Images

Figure CN119294452B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a transmission protection circuit, in particular to a transmission protection circuit for a medical neural network chip. Background Art
[0002] Cache attacks against medical neural network chips are a common method for stealing patients' important private data. Numerous studies have proposed a range of protective measures. For example, Chinese patent application number CN202310915909.9 discloses a privacy-preserving neural network prediction method and system. This method and system, based on a secret-sharing protocol for the nonlinear layer of a neural network, avoids the conversion overhead between the numerical representation of the linear layer and the Boolean representation of the nonlinear layer. Furthermore, ciphertext calculation and parameter preparation are all performed offline, making the online nonlinear layer calculations lightweight. This significantly reduces prediction time and improves the efficiency of privacy-preserving neural network predictions. A Chinese patent with publication number CN114003961B discloses a deep neural network inference method with privacy protection. The method mainly includes: the client generates a key; the client uses the key to send it to the edge server; the edge server returns the calculation result to the client; the client verifies the returned result, accepts it if the result is correct, and rejects it if the result is incorrect; for the verified correct result, the client uses the locally stored key and bias matrix to restore the actual output result of the linear layer; the client performs calculations on the nonlinear layer locally, and uses the calculation result as the input of the next linear layer, repeating the above steps until the final inference result is obtained.
[0003] However, both of the above technologies prevent data monitoring attacks on medical neural network chips and generate large additional hardware overhead on the device and server sides of the medical neural network chip. Summary of the Invention
[0004] The technical problem to be solved by the present invention is to provide a transmission protection circuit for medical neural network chips that can effectively prevent data monitoring and does not require additional hardware overhead on the server side, but only requires a small amount of hardware on the device side.
[0005] The technical solution adopted by the present invention to solve the above technical problems is: a transmission protection circuit of a medical neural network chip, including a read-only memory, a counter, a comparator and a cross-exchange module, the read-only memory is used to store all input data and all weight data of the medical neural network chip, and output one input data and one weight data of the medical neural network chip to the cross-exchange module each time according to a preset sequence; the cross-exchange module has two states, namely, an "exchange" state and a "non-exchange" state, and the cross-exchange module is used to switch between the "exchange" state and the "non-exchange" state under the control of the comparator, and the The initial state of the cross-exchange module is the "non-exchange" state; when the cross-exchange module receives an input data and a weight data outputted thereto by the read-only memory, if it is in the "exchange" state, it exchanges the currently received input data and weight data and outputs them to complete a round of output work; if it is in the "non-exchange" state, it directly outputs the currently received input data and weight data to complete a round of output work; the counter is used to perform real-time statistics on the output work rounds of the cross-exchange module, obtain a real-time statistical value as the current statistical value for storage, and output the current statistical value to the comparator, The initial statistical value of the counter is 0; the comparator is used to generate two control signals according to the current statistical value output by the counter, wherein the first control signal is output to the counter to control whether the counter is reset to zero, and the second control signal is output to the cross-exchange module to control whether the cross-exchange module switches between the "exchange" state and the "non-exchange" state; when the current statistical value output by the counter is 1000, the first control signal output by the comparator controls the counter to set the current statistical value stored therein to 0, and at this time the counter restarts from 0. The output working rounds of the cross-exchange module are counted, and the second control signal controls the cross-exchange module to switch between the "exchange" state and the "non-exchange" state. At this time, if the cross-exchange module is in the "exchange" state, it switches to the "non-exchange" state; if the cross-exchange module is in the "non-exchange" state, it switches to the "exchange" state; when the current statistical value output by the counter is less than 1000, the first signal output by the comparator controls the counter to continue counting based on the current statistical value it saves, and the second control signal controls the cross-exchange module to maintain its current state unchanged.
[0006] The read-only memory has a reset terminal, an input data output channel with a bit width of 32 bits, and a weight data output channel with a bit width of 32 bits; the counter has a clock terminal, a reset terminal, a counting input terminal with a bit width of 10 bits, and a counting output terminal with a bit width of 10 bits; the comparator has a clock terminal, a reset terminal, a counting input terminal with a bit width of 10 bits, a counting output terminal with a bit width of 10 bits, and a switching output terminal; the cross-interchange module has a switching input terminal, a reset terminal, two input data terminals with a bit width of 32 bits, and two output data terminals with a bit width of 32 bits, and the two input data terminals with a bit width of 32 bits are respectively referred to as the input data terminal 1 and the input data terminal 2, and the two output data terminals with a bit width of 32 bits are respectively referred to as the output data terminal 1 and the output data terminal 2; the input data output channel of the read-only memory is connected to the input data terminal 1 of the cross-interchange module, and the weight data output channel of the read-only memory is connected to the The data input terminal 2 of the cross-interchange module is connected to the reset terminal of the read-only memory, the reset terminal of the counter, the reset terminal of the comparator and the reset terminal of the cross-interchange module, and its connection terminal serves as the reset port of the data transmission protection circuit, which is used to access an external reset signal to restore the data transmission protection circuit to an initial state; the counting input terminal of the counter is connected to the counting output terminal of the comparator, the counting output terminal of the counter is connected to the counting input terminal of the comparator, the clock terminal of the counter is connected to the clock terminal of the comparator, and its connection terminal serves as the clock terminal outside the data transmission protection circuit, which is used to access a clock signal; the switching output terminal of the comparator is connected to the switching input terminal of the cross-interchange module, the output data terminal 1 of the cross-interchange module serves as the data output terminal 1 of the data transmission protection circuit, and the output data terminal 2 of the cross-interchange module serves as the data output terminal 2 of the data transmission protection circuit.
[0007] The cross-exchange module includes four data selectors, which are respectively referred to as data selector 1, data selector 2, data selector 3 and data selector 4. The data selector 1 has a switching input terminal, two 32-bit input data terminals and a 32-bit output data terminal, and its two 32-bit input data terminals are respectively referred to as input data terminal 1 and input data terminal 2; the data selector 2 has a reset terminal, a 32-bit input data terminal, and a 32-bit low-level input terminal. and an output data terminal with a bit width of 32 bits; the data selector three has a switching input terminal, two input data terminals with a bit width of 32 bits and an output data terminal with a bit width of 32 bits, and its two input data terminals with a bit width of 32 bits are respectively referred to as its input data terminal 1 and input data terminal 2; the data selector four has a reset terminal, a 32-bit input data terminal, a 32-bit low-level input terminal and a 32-bit output data terminal; the output data terminal of the data selector one is connected to the output data terminal of the data selector two The input data end is connected, the switching input end of the data selector one is connected to the switching input end of the data selector three, and its connection end serves as the switching input end of the cross-interchange module, the input data end one of the data selector one is connected to the input data end one of the data selector three, and its connection end serves as the input data end one of the cross-interchange module, the input data end two of the data selector one is connected to the input data end two of the data selector three, and its connection end serves as the input data end two of the cross-interchange module; the low level input end of the data selector two is connected to the low level input end of the data selector four and is connected to the 32-bit low level, the reset end of the data selector two is connected to the reset end of the data selector four, and its connection end serves as the reset end of the cross-interchange module, the output data end of the data selector two serves as the output data end one of the cross-interchange module; the output data end of the data selector three is connected to the input data end of the data selector four; the output data end of the data selector four is the output data end two of the cross-interchange module.
[0008] Compared with the prior art, the advantage of the present invention is that a transmission protection circuit of a medical neural network chip is formed by a read-only memory, a counter, a comparator and a cross-exchange module. The read-only memory stores all input data and all weight data of the medical neural network chip collected by the sensor device, and outputs one input data and one weight data of the medical neural network chip to the cross-exchange module each time in a preset order. The cross-exchange module has two states: an "exchange" state and a "non-exchange" state. The cross-exchange module switches between the "exchange" state and the "non-exchange" state under the control of the comparator. The initial state of the cross-exchange module is the "non-exchange" state. When the cross-exchange module receives an input data outputted thereto by the read-only memory, the cross-exchange module switches between the "exchange" state and the "non-exchange" state. When receiving data and a weight data, if it is in the "exchange" state, the currently received input data and weight data are exchanged and output to complete a round of output work. If it is in the "non-exchange" state, the currently received input data and weight data are directly output to complete a round of output work. The counter performs real-time statistics on the output work rounds of the cross-exchange module, obtains the real-time statistical value as the current statistical value, saves it, and outputs the current statistical value to the comparator. The initial statistical value of the counter is 0. The comparator generates two control signals according to the current statistical value output by the counter. The first control signal is output to the counter to control whether the counter is cleared, and the second control signal is output to the cross-exchange module to control Whether the cross-exchange module switches between the "exchange" state and the "non-exchange" state, when the current statistical value output by the counter is 1000, the first control signal output by the comparator controls the counter to set the current statistical value stored in it to 0, and the counter starts counting the output working rounds of the cross-exchange module from 0 again. The second control signal controls the cross-exchange module to switch between the "exchange" state and the "non-exchange" state. At this time, if the cross-exchange module is in the "exchange" state, it switches to the "non-exchange" state. If the cross-exchange module is in the "non-exchange" state, it switches to the "exchange" state. When the current statistical value output by the counter is less than 1000, the first signal output by the comparator controls the counter in The counting continues based on the current statistical value it saves, and the second control signal controls the cross-exchange module to keep its current state unchanged. When the attacker monitors the input data and weight data of the medical neural network chip output by the cross-exchange module, since the cross-exchange module switches between the "exchange" state and the "non-exchange" state, the input data and weight data of the medical neural network chip output by it also become alternating states, that is, the attacker will obtain discontinuous input data and weight data of the medical neural network chip from the cross-exchange module, and cannot obtain complete input data and weight data of the medical neural network chip, thereby achieving the purpose of protection. Therefore, the present invention can effectively prevent data monitoring and does not require additional hardware overhead on the server side.The present invention only needs to be deployed on the device side, that is, only a small amount of hardware needs to be added on the device side. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] Figure 1 This is a schematic structural diagram of the transmission protection circuit of the medical neural network chip of the present invention;
[0010] Figure 2 This is a schematic structural diagram of the cross-interchange module of the transmission protection circuit of the medical neural network chip of the present invention;
[0011] Figure 3 This is a diagram showing the area cost of the transmission protection circuit of the medical neural network chip of the present invention;
[0012] Figure 4 This is a diagram showing the power consumption of the transmission protection circuit of the medical neural network chip of the present invention;
[0013] Figure 5 This is a comparison diagram of the medical neural network chip being attacked by CNN before and after using the transmission protection circuit of the medical neural network chip of the present invention. DETAILED DESCRIPTION
[0014] The present invention will be described in further detail below with reference to the accompanying drawings and embodiments.
[0015] Example 1: Figure 1As shown, a transmission protection circuit of a medical neural network chip includes a read-only memory, a counter, a comparator and a cross-exchange module. The read-only memory is used to store all input data and all weight data of the medical neural network chip (obtained by training EEG signals using Python), and outputs one input data and one weight data of the medical neural network chip to the cross-exchange module each time in a preset order, wherein all input data and all weight data of the medical neural network chip are collected by a sensor device; the cross-exchange module has two states: an "exchange" state and a "non-exchange" state. The cross-exchange module is used to switch between the "exchange" state and the "non-exchange" state under the control of the comparator, and the initial state of the cross-exchange module is the "non-exchange" state; when the cross-exchange module receives an input data and a weight data outputted to it by the read-only memory, if it is in the "exchange" state, the currently received input data and weight data are exchanged and output to complete a round of output work; if it is in the "non-exchange" state, the currently received input data and weight data are directly output to complete a round of output work; the counter is used to perform real-time statistics on the output work rounds of the cross-exchange module to obtain The real-time statistical value is saved as the current statistical value and output to the comparator. The initial statistical value of the counter is 0. The comparator is used to generate two control signals according to the current statistical value output to it by the counter. The first control signal is output to the counter to control whether the counter is cleared to zero, and the second control signal is output to the cross-exchange module to control whether the cross-exchange module switches between the "exchange" state and the "non-exchange" state. When the current statistical value output by the counter is 1000, the first control signal output by the comparator controls the counter to set the current statistical value stored therein to 0. At this time, The counter starts counting the output working rounds of the cross-exchange module again from 0. The second control signal controls the cross-exchange module to switch between the "exchange" state and the "non-exchange" state. At this time, if the cross-exchange module is in the "exchange" state, it switches to the "non-exchange" state. If the cross-exchange module is in the "non-exchange" state, it switches to the "exchange" state. When the current statistical value output by the counter is less than 1000, the first signal output by the comparator controls the counter to continue counting based on the current statistical value it saves, and the second control signal controls the cross-exchange module to maintain its current state unchanged.
[0016] In this embodiment, when an attacker monitors the input data and weight data of the medical neural network chip output by the cross-interchange module, since the cross-interchange module switches between the "exchange" state and the "non-exchange" state, the input data and weight data of the medical neural network chip output by it also become alternating states, that is, the attacker will obtain discontinuous input data and weight data of the medical neural network chip from the cross-interchange module, and cannot obtain complete input data and weight data of the medical neural network chip, thereby achieving the purpose of protection. Therefore, the present invention can effectively prevent data monitoring, and does not require additional hardware overhead on the server side. It only needs to be deployed on the device side, that is, only a small amount of hardware needs to be added on the device side.
[0017] Embodiment 2: This embodiment is basically the same as embodiment 1, except that: in this embodiment, the read-only memory has 1 reset terminal, 1 input data output channel with a bit width of 32 bits and 1 weight data output channel with a bit width of 32 bits; the counter has 1 clock terminal, 1 reset terminal, 1 counting input terminal with a bit width of 10 bits and 1 counting output terminal with a bit width of 10 bits; the comparator has 1 clock terminal, 1 reset terminal, 1 counting input terminal with a bit width of 10 bits, 1 counting output terminal with a bit width of 10 bits and 1 switching output terminal; the cross-interchange module has 1 switching input terminal, 1 reset terminal, two input data terminals with a bit width of 32 bits and two output data terminals with a bit width of 32 bits, and its two input data terminals with a bit width of 32 bits are respectively referred to as its input data terminal 1 and input data terminal 2, and its two output data terminals with a bit width of 32 bits are respectively referred to as its output data terminal 1 and output data terminal 2; the input data output of the read-only memory The channel is connected to the input data terminal one of the cross-interchange module, the weight data output channel of the read-only memory is connected to the input data terminal two of the cross-interchange module, the reset terminal of the read-only memory, the reset terminal of the counter, the reset terminal of the comparator and the reset terminal of the cross-interchange module are connected, and its connection terminal serves as the reset port of the data transmission protection circuit, which is used to access the external reset signal to restore the data transmission protection circuit to the initial state; the counting input terminal of the counter is connected to the counting output terminal of the comparator, the counting output terminal of the counter is connected to the counting input terminal of the comparator, the clock terminal of the counter is connected to the clock terminal of the comparator, and its connection terminal serves as the clock terminal outside the data transmission protection circuit, which is used to access the clock signal; the switching output terminal of the comparator is connected to the switching input terminal of the cross-interchange module, the output data terminal one of the cross-interchange module serves as the data output terminal one of the data transmission protection circuit, and the output data terminal two of the cross-interchange module serves as the data output terminal two of the data transmission protection circuit.
[0018] In this embodiment, when the data transmission protection circuit is in the initial state, the cross-interchange module is in the "non-exchange" state, the initial count value of the counter is 0, and when the input data output channel of the read-only memory starts to output the input data of the medical neural network chip to the input data terminal 1 of the cross-interchange module, and the weight data output channel of the read-only memory starts to output the weight data of the medical neural network chip to the input data terminal 2 of the cross-interchange module, the data transmission protection circuit enters the working state and starts to work periodically. In each working cycle, the data transmission protection circuit is first in the "non-exchange" stage and then in the "exchange" stage. When the data transmission protection circuit is in the "non-exchange" stage, the cross-interchange module is in the "non-exchange" state. When entering the "non-exchange" stage, the counter starts counting. When the input data output channel of the read-only memory outputs the input data of the medical neural network chip to the input data terminal 1 of the cross-exchange module for the tth time in the current working cycle, and the weight data output channel of the read-only memory outputs the weight data of the medical neural network chip to the input data terminal 2 of the cross-exchange module for the tth time in the current working cycle, if t=1, the current statistical value of the counter is set to 1, and its counting input terminal does not receive the data output by the counting output terminal of the comparator. The counter transmits the current statistical value to the counting input terminal of the comparator through its counting output terminal. At this time, the switching output terminal of the comparator outputs 0 to the switching input terminal of the cross-exchange module; the output data terminal 1 of the cross-exchange module sets the current input to its The data of input data terminal 1 is output, and the output data terminal 2 outputs the data currently input to its input data terminal 2. If t is greater than 1 and less than 1000, the current statistical value of the counter is increased by 1 as the real-time statistical value, and the real-time statistical value is used to update its current statistical value. The counting input terminal of the counter can receive the data output by the counting output terminal of the comparator. The counter transmits the current statistical value to the counting input terminal of the comparator through its counting output terminal. At this time, the switching output terminal of the comparator outputs 0 to the switching input terminal of the cross-interchange module, and the counting output terminal of the comparator outputs the current statistical value to the counting input terminal of the counter. The counter maintains its current statistical value. The output data terminal 1 of the cross-interchange module outputs the data currently input to its input data terminal 1, and the output data terminal Second, the counter outputs the data currently input to its input data terminal two; if t is equal to 1000, the current statistical value of the counter is added by 1 as the real-time statistical value, and the real-time statistical value is used to update its current statistical value, and the counting input terminal of the counter can receive the data output by the counting output terminal of the comparator, and the counter transmits the current statistical value to the counting input terminal of the comparator through its counting output terminal. At this time, the switching output terminal of the comparator outputs 0 to the switching input terminal of the cross-interchange module, and the counting output terminal of the comparator outputs the current statistical value to the counting input terminal of the counter, and the counter sets its current statistical value to 0. The output data terminal one of the cross-interchange module outputs the data currently input to its input data terminal one, and the output data terminal two outputs the data currently input to its input data terminal two;If t is greater than or equal to 1001 and less than 2000, the data transmission protection circuit enters the "exchange" stage, the current statistical value of the counter is added by 1 as the real-time statistical value, and the real-time statistical value is used to update its current statistical value, and the counting input end of the counter can receive the data output by the counting output end of the comparator, and the counter transmits the current statistical value to the counting input end of the comparator through its counting output end. At this time, the switching output end of the comparator outputs 1 to the switching input end of the cross-exchange module, and the cross-exchange module switches to the "exchange" state. The counting output end of the comparator outputs the current statistical value to the counting input end of the counter, and the counter keeps its current statistical value unchanged. The output data end 1 of the cross-exchange module outputs the data currently input to its input data end 2, and the output data end 1 outputs the data currently input to its input data end 2. The data terminal 2 outputs the data currently input to its input data terminal 1; if t is equal to 2000, the current statistical value of the counter is increased by 1 as the real-time statistical value, and the real-time statistical value is used to update its current statistical value. The counting input terminal of the counter is able to receive the data output by the counting output terminal of the comparator. The counter transmits the current statistical value to the counting input terminal of the comparator through its counting output terminal. At this time, the switching output terminal of the comparator outputs 1 to the switching input terminal of the cross-interchange module. The counting output terminal of the comparator outputs the current statistical value to the counting input terminal of the counter. The counter sets its current statistical value to 0. The output data terminal 1 of the cross-interchange module outputs the data currently input to its input data terminal 1, and the output data terminal 2 outputs the data currently input to its input data terminal 2.
[0019] Example 3: This example is basically the same as Example 2, except that: in this example, Figure 2As shown, the cross-exchange module includes four data selectors, which are respectively referred to as data selector 1, data selector 2, data selector 3 and data selector 4. Data selector 1 has 1 switching input terminal, two 32-bit input data terminals and 1 32-bit output data terminal, and its two 32-bit input data terminals are respectively referred to as input data terminal 1 and input data terminal 2; data selector 2 has 1 reset terminal, 1 32-bit input data terminal, 1 The data selector 3 has a switching input terminal, two 32-bit input data terminals and a 32-bit output data terminal, and its two 32-bit input data terminals are respectively referred to as input data terminal 1 and input data terminal 2; the data selector 4 has a reset terminal, a 32-bit input data terminal, a 32-bit low-level input terminal and a 32-bit output data terminal. ; The output data end of data selector one is connected to the input data end of data selector two, the switching input end of data selector one is connected to the switching input end of data selector three, and its connection end serves as the switching input end of the cross-interchange module, the input data end one of data selector one is connected to the input data end one of data selector three, and its connection end serves as the input data end one of the cross-interchange module, the input data end two of data selector one is connected to the input data end two of data selector three, and its connection end serves as the input data end two of the cross-interchange module; the low level input end of data selector two is connected to the low level input end of data selector four and is connected to the 32-bit low level, the reset end of data selector two is connected to the reset end of data selector four, and its connection end serves as the reset end of the cross-interchange module, the output data end of data selector two serves as the output data end one of the cross-interchange module; the output data end of data selector three is connected to the input data end of data selector four; the output data end of data selector four is the output data end two of the cross-interchange module.
[0020] In the cross-interchange module of this embodiment, when the switching input terminal of data selector 1 is connected to signal 0, its output data terminal outputs the data connected to its input data terminal 2 at this time; when the switching input terminal of data selector 1 is connected to signal 1, its output data terminal outputs the data connected to its input data terminal 1 at this time; when the reset terminal of data selector 2 is connected to signal 0, its output data terminal outputs the data connected to its low-level input terminal; when the reset terminal of data selector 2 is connected to signal 1, its output data terminal outputs the data connected to its input data terminal at this time; when the switching input terminal of data selector 3 is connected to signal 0, its output data terminal outputs the data connected to its input data terminal 2 at this time; when the switching input terminal of data selector 3 is connected to signal 1, its output data terminal outputs the data connected to its input data terminal 1 at this time; when the reset terminal of data selector 4 is connected to signal 0, its output data terminal outputs the data connected to its low-level input terminal; when the reset terminal of data selector 4 is connected to signal 1, its output data terminal outputs the data connected to its input data terminal at this time.
[0021] In order to verify the performance of the transmission protection circuit of the medical neural network chip of the present invention, the transmission protection circuit of the medical neural network chip of the present invention was modeled on an Intel Core i5-12400 CPU with a 2.3GHz processor, and EDA tools (such as VCS, ModelSim, design compiler, IC compiler, Virtuoso layout editor IC5141) were used to simulate and verify the transmission protection circuit of the medical neural network chip of the present invention. The transmission protection circuit of the medical neural network chip of the present invention was applied to the medical neural network chip disclosed in the document "An efficient ANN SoC for detecting Alzheimer's disease based on recurrent computing", and its resource consumption was analyzed. Among them, the area overhead of the transmission protection circuit of the medical neural network chip of the present invention is as follows: Figure 3 As shown, the power consumption is as follows Figure 4 Analysis Figure 3 and Figure 4 It can be seen that the hardware overhead of the medical neural network chip using the transmission protection circuit of the medical neural network chip of the present invention only increases by 2.5%, and the power consumption overhead only increases by 3.61%.
[0022] The CNN model generated by training with the TensorFlow database in Python 3.9 was used to attack the medical neural network chip disclosed in the document "Anefficient ANN SoC for detecting Alzheimer's disease based on recurrent computing" and the medical neural network chip after using the transmission protection circuit of the medical neural network chip of the present invention. The comparison chart is as follows: Figure 5 Analysis Figure 5 It can be seen that before the transmission protection circuit of the medical neural network chip of the present invention was used, 86.12% of the protected data in the medical neural network chip could be obtained through an attack. However, after using the transmission protection circuit of the medical neural network chip of the present invention, only 8.4% of the protected data in the medical neural network chip could be obtained through an attack. This shows that the transmission protection circuit of the medical neural network chip of the present invention greatly improves the security of the medical neural network chip.
[0023] To sum up, by deploying the transmission protection circuit of the medical neural network chip of the present invention on the device side (at the medical neural network chip), data monitoring can be effectively prevented while only a small amount of hardware needs to be added on the device side, without adding additional hardware overhead on the server side.
Claims
1. A transmission protection circuit for a medical neural network chip, characterized in that The invention comprises a read-only memory, a counter, a comparator and a cross-exchange module. The read-only memory is used to store all input data and all weight data of the medical neural network chip, and outputs one input data and one weight data of the medical neural network chip to the cross-exchange module each time according to a preset order; the cross-exchange module has two states: a "switching" state and a "non-switching" state. The cross-exchange module is used to switch between the "switching" state and the "non-switching" state under the control of the comparator. The initial state of the cross-exchange module is the "non-switching" state; when the cross-exchange module receives an input data and a weight data outputted thereto by the read-only memory, if it is in the "switching" state, the input data and weight data currently received are exchanged and then outputted to complete a round of output work; if it is in the "non-switching" state, the input data and weight data currently received are directly outputted to complete a round of output work; the counter is used to perform real-time statistics on the output work rounds of the cross-exchange module, obtain a real-time statistical value as the current statistical value for storage, and output the current statistical value to the comparator. The initial statistical value of the counter is 0; the comparator The comparator is configured to generate two control signals based on the current statistical value outputted by the counter, wherein the first control signal is outputted to the counter to control whether the counter is reset to zero, and the second control signal is outputted to the cross-interchange module to control whether the cross-interchange module switches between a "switching" state and a "non-switching" state. When the current statistical value outputted by the counter is 1000, the first control signal outputted by the comparator controls the counter to reset the current statistical value stored therein to 0, at which point the counter restarts counting the output working rounds of the cross-interchange module from 0. The second control signal controls the cross-interchange module to switch between a "switching" state and a "non-switching" state. If the cross-interchange module is in the "switching" state, the comparator switches to the "non-switching" state; if the cross-interchange module is in the "non-switching" state, the comparator switches to the "switching" state. When the current statistical value outputted by the counter is less than 1000, the first control signal outputted by the comparator controls the counter to continue counting based on the current statistical value stored therein, and the second control signal controls the cross-interchange module to maintain its current state.
2. The transmission protection circuit of a medical neural network chip according to claim 1, characterized in that The read-only memory has a reset terminal, an input data output channel with a bit width of 32 bits and a weight data output channel with a bit width of 32 bits; the counter has a clock terminal, a reset terminal, a counting input terminal with a bit width of 10 bits and a counting output terminal with a bit width of 10 bits; the comparator has a clock terminal, a reset terminal, a counting input terminal with a bit width of 10 bits, a counting output terminal with a bit width of 10 bits and a switching output terminal; the cross-interchange module has a switching input terminal, a reset terminal, two input data terminals with a bit width of 32 bits and two output data terminals with a bit width of 32 bits, and its two input data terminals with a bit width of 32 bits are respectively referred to as its input data terminal one and input data terminal two, and its two output data terminals with a bit width of 32 bits are respectively referred to as its output data terminal one and output data terminal two; the input data output channel of the read-only memory is connected to the input data terminal one of the cross-interchange module, and the weight data output channel of the read-only memory is connected to the input data terminal one of the cross-interchange module, and the weight data output channel of the read-only memory is connected to the output data terminal one of the cross-interchange module. It is connected to the input data terminal 2 of the cross-interchange module, the reset terminal of the read-only memory, the reset terminal of the counter, the reset terminal of the comparator and the reset terminal of the cross-interchange module, and its connection terminal serves as the reset port of the data transmission protection circuit, which is used to access the external reset signal to restore the data transmission protection circuit to its initial state; the counting input terminal of the counter is connected to the counting output terminal of the comparator, the counting output terminal of the counter is connected to the counting input terminal of the comparator, the clock terminal of the counter is connected to the clock terminal of the comparator, and its connection terminal serves as the clock terminal outside the data transmission protection circuit, which is used to access the clock signal; the switching output terminal of the comparator is connected to the switching input terminal of the cross-interchange module, the output data terminal 1 of the cross-interchange module serves as the data output terminal 1 of the data transmission protection circuit, and the output data terminal 2 of the cross-interchange module serves as the data output terminal 2 of the data transmission protection circuit.
3. The transmission protection circuit of a medical neural network chip according to claim 2, characterized in that The cross-exchange module includes four data selectors, which are respectively referred to as data selector 1, data selector 2, data selector 3 and data selector 4. The data selector 1 has a switching input terminal, two 32-bit input data terminals and a 32-bit output data terminal, and its two 32-bit input data terminals are respectively referred to as input data terminal 1 and input data terminal 2; the data selector 2 has a reset terminal, a 32-bit input data terminal, and a 32-bit low-level input terminal. and an output data terminal with a bit width of 32 bits; the data selector three has a switching input terminal, two input data terminals with a bit width of 32 bits and an output data terminal with a bit width of 32 bits, and its two input data terminals with a bit width of 32 bits are respectively referred to as its input data terminal 1 and input data terminal 2; the data selector four has a reset terminal, a 32-bit input data terminal, a 32-bit low-level input terminal and a 32-bit output data terminal; the output data terminal of the data selector one is connected to the output data terminal of the data selector two The input data end is connected, the switching input end of the data selector one is connected to the switching input end of the data selector three, and its connection end serves as the switching input end of the cross-interchange module, the input data end one of the data selector one is connected to the input data end one of the data selector three, and its connection end serves as the input data end one of the cross-interchange module, the input data end two of the data selector one is connected to the input data end two of the data selector three, and its connection end serves as the input data end two of the cross-interchange module; the low level input end of the data selector two is connected to the low level input end of the data selector four and is connected to the 32-bit low level, the reset end of the data selector two is connected to the reset end of the data selector four, and its connection end serves as the reset end of the cross-interchange module, the output data end of the data selector two serves as the output data end one of the cross-interchange module; the output data end of the data selector three is connected to the input data end of the data selector four; the output data end of the data selector four is the output data end two of the cross-interchange module.
Citation Information
Patent Citations
A privacy-preserving deep neural network inference method
CN114003961B
A privacy-preserving neural network prediction method and system
CN116663064B