Electrode falling detection method and device based on convolutional neural network
Through the electrode shed detection method based on convolutional neural network, the problem of low accuracy of electrode shed detection in the prior art is solved, and higher detection accuracy and response speed are achieved, ensuring the objectivity and consistency of the detection results.
Patent Information
- Application Number
- CN202411597300.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-08
- Publication Date
- 2025-03-04
AI Technical Summary
The prior art has a problem of low accuracy in electrode shed detection, especially in electrical impedance imaging measurements. Data heterogeneity caused by differences in thoracic morphology and age leads to cumulative errors, affecting the accuracy and reliability of the detection.
The electrode shed detection method based on the convolutional neural network is adopted to obtain the detection data of the person to be detected for pre-processing, reducing the influence of noise and outliers, and using the preset convolutional neural network model for electrode shed detection, reducing possible errors in the manual judgment process.
The accuracy and response speed of electrode shed detection are improved, the objectivity and consistency of the detection results are ensured, and the impact of cumulative errors is reduced.
Smart Images

Figure CN119557723A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of bioelectrical impedance imaging, and in particular to a method and device for detecting electrode detachment based on a convolutional neural network. Background Art
[0002] At present, the electrode detachment detection technology is to manually extract the characteristics of the electrical signal when the electrode falls off and classify it through the model. This method includes manually extracting statistical results from the electrical signal, such as the root mean square (RMS) value, or extracting feature vectors from the frequency domain of the electrical signal, and then using the data-driven model for classification or detection. The second is the electrode contact state detection algorithm that directly uses the current signal as input. The main approach is to directly input the collected current waveform into the neural network model, and the neural network model automatically completes the model training based on the characteristics of the current waveform.
[0003] Although the existing technologies described above can meet the needs of electrode detachment detection to a certain extent, in practical applications, especially in electrical impedance tomography (EIT) measurement, data heterogeneity caused by chest morphology and age differences poses a challenge to electrode detachment detection. Since the model training process needs to be carried out in stages and the objective functions of each training module are not unified, this leads to the problem of cumulative error, affecting the accuracy and reliability of the detection. Summary of the invention
[0004] One purpose of an embodiment of the present invention is to provide an electrode detachment detection method and device based on a convolutional neural network, so as to solve the technical problem that the traditional model in electrode detachment detection has low accuracy, resulting in inaccurate electrode detachment detection.
[0005] In a first aspect, an embodiment of the present invention provides an electrode detachment detection method based on a convolutional neural network, the method comprising:
[0006] Obtaining the test data of the person to be tested;
[0007] Preprocessing the detection data to obtain the preprocessed target data;
[0008] Obtain a preset convolutional neural network model, where the preset convolutional neural network model has been trained using a target training set;
[0009] The target data is input into the preset convolutional neural network model for electrode detachment detection processing to obtain a target prediction value, and the target prediction value is used to compare the actual value of the person to be detected in the electrode detachment detection to obtain the detection result of the person to be detected.
[0010] In a second aspect, an embodiment of the present invention provides an electrode detachment detection device based on a convolutional neural network, the device comprising:
[0011] An acquisition unit, used for acquiring the detection data of the person to be detected;
[0012] A processing unit, used for preprocessing the detection data to obtain the preprocessed target data;
[0013] The acquisition unit is further used to acquire a preset convolutional neural network model, where the preset convolutional neural network model has been trained using a target training set;
[0014] The processing unit is also used to input the target data into the preset convolutional neural network model to perform electrode detachment detection processing to obtain a target prediction value, and the target prediction value is used to compare the actual value of the person to be detected in the electrode detachment detection to obtain the detection result of the person to be detected.
[0015] In a third aspect, an embodiment of the present invention provides a computer device, including:
[0016] at least one processor; and,
[0017] a memory communicatively connected to the at least one processor; wherein,
[0018] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to the first aspect.
[0019] In a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor executes the method as described in the first aspect.
[0020] In the scheme implemented by the above-mentioned electrode detachment detection method, device, equipment and storage medium based on convolutional neural network, this method can effectively reduce the influence of noise and outliers by obtaining detailed detection data of the person to be detected and preprocessing it, thereby improving the accuracy of electrode detachment detection; further preprocessing steps can standardize and normalize the data, making the data more suitable for the input requirements of the convolutional neural network model, improving data processing efficiency and model training speed; using a preset convolutional neural network model for electrode detachment detection reduces possible errors in the manual judgment process and ensures the objectivity and consistency of the detection results. Therefore, this method can input the target data in real time and quickly obtain the predicted value, compare the predicted value with the true value, promptly discover the electrode detachment situation, and take corresponding measures, thereby improving the response speed of electrode detachment detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0022] Figure 1A It is a flow chart of a method for detecting electrode detachment based on a convolutional neural network in one embodiment of the present invention;
[0023] Figure 1B is a schematic diagram of the structure of a preset convolutional neural network model in one embodiment of the present invention;
[0024] Figure 1C is a structural diagram of a residual network module in one embodiment of the present invention;
[0025] Figure 2 It is a structural schematic diagram of an electrode detachment detection device based on a convolutional neural network in one embodiment of the present invention;
[0026] Figure 3 It is a schematic diagram of the structure of a computer device in one embodiment of the present invention. DETAILED DESCRIPTION
[0027] In order to make the purpose, technical scheme and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0028] It should be noted that, if there is no conflict, the various features in the embodiments of the present invention can be combined with each other, all within the scope of protection of the present invention. In addition, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in a different order from the module division in the device or the flow chart. Furthermore, the words "first", "second", "third", etc. used in the present invention do not limit the data and execution order, but only distinguish the same items or similar items with basically the same functions and effects.
[0029] The technical solution of the present application can be applied to various electrode detachment detection scenarios.
[0030] In view of this, the present application proposes an electrode detachment detection method based on a convolutional neural network to solve the above problem, which is described in detail below.
[0031] See also Figure 1A , Figure 1A A flow chart of an electrode detachment detection method based on a convolutional neural network provided in an embodiment of the present invention comprises the following steps:
[0032] S10: Obtaining the test data of the person to be tested.
[0033] The detection data refers to the voltage data collected from people undergoing electrical impedance imaging or other electrophysiological tests during the electrode detachment detection process. The detection data will be used for analysis to determine whether the electrode is in normal working condition or has fallen off.
[0034] Among them, before obtaining the test data of the person to be tested, ensure that the electrodes of the person to be tested are correctly placed and fixed in the appropriate position to reduce motion artifacts and measurement errors, check the contact quality between the electrode and the skin, ensure that there is good electrical contact between the electrode and the skin, prepare data acquisition equipment, such as multi-channel analog switches, voltage-controlled current sources, voltage measurement equipment, etc., to ensure that all equipment is working properly.
[0035] Furthermore, during the acquisition process, a control signal is used to activate a multi-way analog switch to output the current of the voltage-controlled current source to the selected electrode pair to apply an excitation current. The excitation current will flow between the selected electrode pair to establish an electric field. While the excitation current is being applied, the voltage difference between other adjacent electrode pairs is measured, which usually involves selecting different electrode pairs as excitation electrodes in turn and measuring the voltages of all possible adjacent electrode pairs. The measured voltage values are recorded, and these values will constitute the detection data of the person to be detected. The detection data should include a timestamp so that time changes can be taken into account in subsequent analysis.
[0036] It can be seen that the detection data of the person to be detected collected in real time in this embodiment further ensures the accuracy and reliability of technologies such as electrical impedance imaging.
[0037] S20: preprocessing the detection data to obtain the preprocessed target data.
[0038] The preprocessing process may include but is not limited to the following: data cleaning, noise filtering, data correction, feature extraction, data conversion, dimensionality reduction, etc.
[0039] Among them, the preprocessed target data is high-quality, standardized, contains the most relevant features for electrode detachment detection, and is easy to process.
[0040] It can be seen that the preprocessed target data in this embodiment provides a solid foundation for subsequent analysis and model training. By properly preprocessing the data, the performance and accuracy of the electrode detachment detection method can be significantly improved.
[0041] S30. Obtain a preset convolutional neural network model, where the preset convolutional neural network model has been trained using a target training set.
[0042] Among them, the preset convolutional neural network model is obtained by training the initial convolutional neural network model with the target training set data, and can effectively predict new data.
[0043] The target training set is a set of data with known labels for training the CNN model. In this data, the data of electrode detachment and normal state are labeled so that the model can learn to distinguish between the two states.
[0044] During the training process, the model calculates the predicted value through forward propagation and adjusts the weight of the network through back propagation to reduce the difference between the predicted value and the true label. The training process may include multiple stages, such as pre-training and fine-tuning, to improve the generalization ability of the model. Completion of training means that the model has been iterated a sufficient number of times through the target training set so that the performance of the model reaches the predetermined standard, which is usually evaluated by the performance of the validation set.
[0045] The preset convolutional neural network model, i.e., the initial convolutional neural network model, includes a first convolution module, a global pooling layer module, a residual network module, a multi-layer fully connected layer, and an activation function layer. Figure 1B , Figure 1B It is the specific connection relationship of the preset convolutional neural network model.
[0046] Among them, the first convolution module is used to extract features from the input data. Each layer of convolution uses a set of learnable filters (or convolution kernels) to slide on the input data to generate a feature map; the global pooling layer is usually used to reduce the dimension of the feature map while retaining important information. It can apply pooling operations such as global average pooling or global maximum pooling on the entire feature map to generate a single value for each channel; the residual network allows the gradient to flow directly through the convolution layer by introducing jump connections (or residual connections), which helps solve the gradient disappearance problem in deep networks and allows the network to be trained deeper; each neuron in the fully connected layer is connected to all neurons in the previous layer. The first fully connected layer receives features from the convolution layer and the pooling layer and converts them into a fixed-size feature vector. The second fully connected layer is used to further process these features and map them to the final output, such as the classification of electrode shedding status; the activation function is used to introduce nonlinear factors so that the neural network can learn and simulate more complex functions. Common activation functions include ReLU, Sigmoid, Tanh, etc.
[0047] Specifically, the first convolution module may include but is not limited to: three layers of convolution, the first convolution layer C1, the second convolution layer C2 and the third convolution layer C3. For example, when the dimension of the input data is N*32*1 (N is the batch size, 32 is the time step or sequence length, and 1 is the number of channels), after the first layer of convolution, the dimension of the feature map becomes 4*32*64, after the second layer of convolution, the dimension of the feature map becomes 4*64*128, after the third layer of convolution, the dimension of the feature map becomes 4*128*32, and the dimension of the final output feature map is 4*32*1.
[0048] Among them, the dimension change of the feature map depends on the size of the convolution kernel, the step size, the padding method, and whether the pooling layer is applied.
[0049] Specifically, the multiple fully connected layers may include but are not limited to two fully connected layers.
[0050] It can be seen that the preset convolutional neural network model obtained in this embodiment already has the ability to identify the electrode detachment status from new detection data and can be used for actual electrode detachment detection tasks.
[0051] S40, inputting the target data into the preset convolutional neural network model to perform electrode detachment detection processing to obtain a target prediction value, wherein the target prediction value is used to compare the actual value of the person to be detected in the electrode detachment detection to obtain the detection result of the person to be detected.
[0052] The target data is preprocessed electrophysiological signal data.
[0053] Among them, the target prediction value is the prediction result of the preset convolutional neural network model on the input data. The target prediction value can be TRUE / FALSE, where TRUE represents the positive class (electrode detachment) and FALSE represents the negative class (normal operation).
[0054] Specifically, in the process where the target predicted value is used to compare the true value of the person to be detected in the electrode detachment detection to obtain the detection result of the person to be detected, the comparison can be performed through the following confusion matrix table:
[0055]
[0056] As shown in the above table, the predicted value indicates the target predicted value, which includes TRUE / FALSE; the true value is the true value obtained by feature processing of the person to be detected in the electrode detachment detection, which includes TRUE / FALSE.
[0057] Specifically, in the table, the true positives (TP) are those whose true values are positive (electrode detachment) and the model prediction is also positive, indicating that the model correctly identifies the samples with electrode detachment; the false positives (FP) are those whose true values are negative (normal operation) but the model prediction is positive, indicating that the model mistakenly identifies the samples with normal operation as those with electrode detachment; the true negatives (TN) are those whose true values are negative (normal operation) and the model prediction is negative, indicating that the model correctly identifies the samples with normal operation; the false negatives (FN) are those whose true values are positive (electrode detachment) but the model prediction is negative, indicating that the model mistakenly identifies the samples with electrode detachment as those with normal operation.
[0058] Therefore, the target prediction value is compared with the true value to verify the accuracy of the test result. If the target prediction value is consistent with the true value, it indicates that the electrode detachment detection model correctly identifies the state of the electrode. If not, further verification or adjustment of the model may be required.
[0059] It can be seen that in this embodiment, the preset convolutional neural network model can quickly process the input data and give a predicted value, thereby realizing real-time or near real-time monitoring of the electrode state, improving the accuracy of electrode detachment detection, and reducing the possibility of human error.
[0060] By obtaining detailed test data of the person to be tested and preprocessing it, the method can effectively reduce the influence of noise and outliers, thereby improving the accuracy of electrode detachment detection; further preprocessing steps can standardize and normalize the data, making the data more suitable for the input requirements of the convolutional neural network model, improving data processing efficiency and the speed of model training; using a preset convolutional neural network model for electrode detachment detection reduces possible errors in the manual judgment process and ensures the objectivity and consistency of the test results. Therefore, the method can input the target data in real time and quickly obtain the predicted value, compare the predicted value with the true value, timely discover the electrode detachment, and take corresponding measures, thereby improving the response speed of electrode detachment detection.
[0061] In one embodiment, before obtaining the preset convolutional neural network model, the method also includes: obtaining a first data set for electrode detachment detection, the first data set including a positive sample subset in a first state and a negative sample subset in a second state, the positive sample subset and the negative sample subset being obtained by voltage values between multiple pairs of two adjacent electrodes; performing data processing according to the first data set to obtain a target training set, a target verification set and a target test set; training an initial convolutional neural network model according to the target training set to obtain the preset convolutional neural network model.
[0062] Among them, the first data set is a data set used to train a convolutional neural network model, which contains sample data for electrode detachment detection.
[0063] Among them, the positive sample subset in the first state includes samples in the electrode detachment state, that is, positive cases that the model needs to identify. The positive samples are usually obtained through experiments or simulations, reflecting the electrophysiological signal characteristics when the electrode is detached.
[0064] Among them, the negative sample subset in the second state includes samples when the electrode is in a normal state, that is, negative cases that the model needs to exclude. The negative samples reflect the electrophysiological signal characteristics when the electrode works normally.
[0065] The voltage values in the positive sample subset and the negative sample subset are composed of voltage values between multiple pairs of adjacent electrodes, which are direct indicators for electrode detachment detection.
[0066] Among them, data processing is used to divide the first data set into different subsets, each subset has a different purpose, specifically a target training set, which is a data set used to train a convolutional neural network model; a target validation set, which is a data set used to adjust model parameters and prevent overfitting during training; a target test set, which is a data set used to evaluate the performance of the final model and is usually not used during training.
[0067] For example, the first data set is divided into a training set, a validation set, and a test set. The first data set is divided in a ratio of 0.75:0.125:0.125. The ratio of positive and negative samples in the training set is 1:3.5, the ratio of positive and negative samples in the validation set is 1:1.5, and the ratio of positive and negative samples in the test set is 1:0.5. This helps to effectively verify the training results, and the scattered data helps to improve the generalization ability of the model.
[0068] Among them, the initial convolutional neural network model is the model at the beginning of training, and its weights are usually randomly initialized; the preset convolutional neural network model is a trained and adjusted model, which is ready for actual electrode detachment detection.
[0069] Optionally, the initial convolutional neural network model is trained using the target training set. This process may include forward propagation and backpropagation, as well as updating of weights and biases. During the training process, the target validation set is used to monitor the performance of the model and adjust the training strategy as needed. Once the model training is completed, the target test set is used for a final performance evaluation. Based on the test results, the model may need to be further optimized, such as adjusting the network structure or training parameters.
[0070] It can be seen that in this embodiment, the initial convolutional neural network model is trained by the first data set to obtain a fully trained and verified convolutional neural network model, which can be effectively used for electrode detachment detection.
[0071] In one embodiment, the method of obtaining a first data set for electrode detachment detection includes: obtaining a control signal for controlling a multi-way analog switch, wherein the control signal connects the output current of the first end of a voltage-controlled current source to a corresponding electrode pair to achieve excitation of adjacent electrode pairs; according to the control signal, injecting an excitation current into two adjacent electrodes in turn to obtain a voltage between the two adjacent electrodes; and sequentially collecting voltages of multiple people to be collected to obtain a first data set.
[0072] The control signal is used to select which electrode pair will be excited.
[0073] Furthermore, according to the control signal, an excitation current is injected into two adjacent electrodes in sequence to establish a sensitive field, and after the excitation current is injected, the voltage between the two adjacent electrodes is measured.
[0074] Specifically, the adjacent injection method is used to construct a sensitive field by alternately selecting adjacent electrode pairs for excitation and measuring the voltage on the non-excitation electrode pairs. Taking a 16-electrode cylindrical conductor as an example, the specific steps are as follows: select electrode 1 and electrode 2 as excitation electrodes, measure the voltage between electrode 3 and electrode 4, electrode 4 and electrode 5, ..., until electrode 15 and electrode 16, and obtain 13 measurement values; select electrode 2 and electrode 3 as excitation electrodes, repeat the above measurement process, and obtain another 13 measurement values; continue this process, select electrode 3 and electrode 4, electrode 4 and electrode 5, ..., until electrode 16 and electrode 1 as excitation electrodes, and measure the voltage of other adjacent electrode pairs each time; finally, 13 (measurement value / each excitation) x 16 (number of electrode pair rotations) = 208 measurement values will be obtained.
[0075] Furthermore, the above-mentioned measurement values constitute a first data set for electrode detachment detection, which includes a positive sample subset (data in the electrode detachment state) and a negative sample subset (data in the electrode normal working state).
[0076] Optionally, the data in the first data set may be randomly combined, that is, the data in the data set are not in a one-to-one correspondence.
[0077] It can be seen that in this embodiment, through the above voltage acquisition process, it can be ensured that the voltage response of each electrode pair under different stimulation conditions is recorded, thereby providing comprehensive data support for electrode detachment detection.
[0078] In one embodiment, the initial convolutional neural network model is trained according to the target training set to obtain the preset convolutional neural network model, including: inputting the target training set into the first convolution module in the initial convolutional neural network model to obtain a first feature map; inputting the first feature map into the global pooling layer module in the initial convolutional neural network model and the residual network module in the initial convolutional neural network model respectively to obtain a first feature vector output by the global pooling layer module and a second feature map output by the residual network module; fusing the first feature vector and the second feature map to obtain a fused second feature vector; inputting the second feature vector into the multi-layer fully connected layer in the initial convolutional neural network model to obtain a target vector output by the multi-layer fully connected layer; inputting the target vector into the activation function layer in the initial convolutional neural network model to obtain a predicted value output by the activation function layer; training the initial convolutional neural network model according to the target training set in turn until a preset stop condition is met, stopping the training, and obtaining the preset convolutional neural network model.
[0079] Among them, the first convolution module extracts local features of input data through convolution operation to obtain a first feature map; the first feature map is input into the global pooling layer module, and the global pooling layer reduces the feature map to a fixed size through pooling operation (such as average pooling or maximum pooling), extracts global features, and obtains a first feature vector; at the same time, the first feature map is input into the residual network module, and the residual network module further extracts deep-level features through multi-layer convolution operations and residual connections to obtain a second feature map; the first feature vector output by the global pooling layer module and the second feature map output by the residual network module are data fused; the fused second feature vector is input into the multi-layer fully connected layer in the initial convolutional neural network model, and the fully connected layer maps the high-dimensional feature vector to the target vector space through linear transformation and nonlinear activation function to obtain the target vector output by the multi-layer fully connected layer; the target vector is input into the activation function layer in the initial convolutional neural network model, and the activation function layer processes the target vector through a nonlinear activation function (such as ReLU, Sigmoid, etc.) to obtain the predicted value output by the activation function layer.
[0080] Specifically, the global pooling layer shrinks the feature map through pooling operations, extracts global features, reduces the amount of calculation and the number of parameters, and enhances the generalization ability of the model; the residual network module solves the gradient vanishing problem in deep networks through residual connections (skip connections), allowing information to be transmitted deeper in the network and improving model performance; the multi-layer fully connected layer maps the high-dimensional feature vector to the target vector space, usually including several hidden layers, each layer containing multiple neurons, and performs linear transformation and nonlinear activation; the activation function layer introduces nonlinearity, enabling the model to learn and represent complex functional relationships. Commonly used activation functions include ReLU, Sigmoid, Tanh, etc.
[0081] Among them, data fusion can be performed in many ways, such as feature concatenation, weighted averaging, etc. The fusion result is a second feature vector that combines global and local features.
[0082] The training process is to calculate the error between the predicted value and the true value (such as the cross entropy loss function) based on the true label in the target training set, calculate the gradient of the error to the model parameters through the back propagation algorithm, and update the model parameters to reduce the error. This process will be repeated to gradually optimize the model parameters until the preset stop condition is met.
[0083] It can be seen that the present method introduces a residual network module, which allows the gradient to be directly transferred by introducing skip connections, thereby alleviating the gradient vanishing problem and making the network easier to optimize because they allow the gradient to flow directly through the skip connections, which helps to accelerate convergence; the residual network module makes it possible to train deeper networks because they can effectively transfer gradients, so that the network can still learn useful features at a deeper level; further, the original input or intermediate layer output is directly transferred to the subsequent layer through the skip connection, which helps the network learn a richer feature representation.
[0084] Among them, the preset stopping conditions may include but are not limited to reaching a predetermined accuracy rate, the verification loss no longer decreasing, reaching a maximum number of iterations, etc.
[0085] It can be seen that in this embodiment, by training and optimizing the initial convolutional neural network model, a preset convolutional neural network model that can effectively perform the electrode detachment detection task is finally formed.
[0086] In one embodiment, the step of inputting the first feature map into the residual network module in the initial convolutional neural network model to obtain the second feature map output by the residual network module includes: inputting the first feature map into the batch normalization layer in the initial residual network module to obtain the third feature map after normalization; inputting the third feature map into the first activation layer in the initial residual network module to obtain the fourth feature map output by the first activation layer; inputting the fourth feature map into the weight layer in the initial residual network module to obtain the fifth feature map output by the weight layer; performing jump connection processing on the first feature map and the fifth feature map to obtain the sixth feature map; and inputting the sixth feature map into the second activation layer in the initial residual network module to obtain the second feature map.
[0087] The residual network module includes: batch normalization layer, first activation layer, weight layer and second activation layer; for details, please refer to Figure 1C , Figure 1C Schematic diagram of the structure of the residual network module.
[0088] Among them, the role of the batch normalization layer is to normalize the input feature map so that its mean is 0 and its variance is 1, thereby accelerating the network training process and stabilizing the training effect.
[0089] Among them, the role of the activation layer (the first activation layer or the second activation layer) is to introduce nonlinearity so that the network can learn and represent more complex functions. The commonly used activation function is ReLU (Rectified Linear Unit). Specifically, after the third feature map is input into the first activation layer, the fourth feature map is obtained, which contains the features that have undergone nonlinear transformation.
[0090] Among them, the weight layer refers to the convolution layer, which performs convolution operations on the input feature map through learnable weights (convolution kernels) to extract higher-level features. After the fourth feature map is input into the weight layer, the fifth feature map is obtained. Optionally, the weight layer may include multiple convolution layers, each of which can be followed by a batch normalization layer and an activation layer. The configuration of the weight layer (such as convolution kernel size, step size, padding, etc.) has an important influence on the effect of feature extraction.
[0091] Among them, the skip connection is a key feature of the residual network, which allows the input (first feature map) to be directly added to the output of the weight layer (fifth feature map) to form the sixth feature map. This connection method helps alleviate the gradient disappearance problem and enables the network to better learn the residual mapping.
[0092] It can be seen that the residual network module in this embodiment can effectively extract the features of the input data and maintain the information flow through jump connections, thereby improving the learning ability and performance of the entire convolutional neural network.
[0093] In one embodiment, the initial convolutional neural network model is trained in turn according to the target training set until a preset stop condition is met, and the training is stopped to obtain the preset convolutional neural network model, including: obtaining a training stop parameter in the preset stop condition; judging whether the training parameter meets the training stop parameter, the training parameter being a parameter obtained after the target training set is trained on the initial convolutional neural network model each time; if the training parameter meets the training stop parameter, the training is stopped to obtain the preset convolutional neural network model; or, if the training parameter does not meet the training stop parameter, the training is continued until the training stop parameter is met, and the training is stopped to obtain the preset convolutional neural network model.
[0094] The training stop parameter is used to determine when to stop training to avoid overfitting or too long training time. The training stop parameter may include but is not limited to the maximum number of training rounds (Epochs), target accuracy, target loss, early stopping, etc.
[0095] Specifically, the maximum number of training rounds indicates the maximum number of training iterations; the target accuracy indicates the target accuracy achieved by the model on the validation set or test set; the target loss indicates the target loss value achieved by the model on the validation set or test set; and early stopping means stopping training early when the performance on the validation set has not improved within several rounds.
[0096] The training parameters may include but are not limited to the current number of training rounds, current accuracy, current loss, and validation set performance. Specifically, the current number of training rounds is the number of training iterations that have been completed; the current accuracy is the accuracy of the model on the current validation set or test set; the current loss is the loss value of the model on the current validation set or test set; and the validation set performance is the performance change of the model on the validation set.
[0097] Optionally, during the training process, you can dynamically adjust hyperparameters such as the learning rate and optimizer to improve the training effect. At the same time, you can monitor various indicators during the training process to ensure the stability and performance of the model.
[0098] Therefore, the preset stopping conditions may include but are not limited to: reaching the preset maximum number of training rounds; the loss function value does not change much in several consecutive rounds, indicating that the model has reached a convergence state; the performance indicators on the validation set (such as accuracy, F1 score, etc.) reach the expected goals, or the performance on the validation set no longer improves, or even begins to decline (to prevent overfitting).
[0099] For example, a training parameter is set to require the model to train for 15 epochs. During the training process, the performance of the model on the validation set is evaluated after each epoch. If the performance of the model on the validation set continues to improve in the first 10 epochs, but the performance no longer improves in the 11th epoch, then even if the training parameter is set for 15 epochs, the EarlyStopping mechanism will stop training at the 11th epoch. In this way, the model will not overfit on the training data and can also save training time.
[0100] Among them, if the training parameters meet the training stop parameters, the training is stopped, and after the preset convolutional neural network model is obtained, the trained model is saved to a file for subsequent loading and use. Common saving formats include HDF5, TensorFlow SavedModel, etc.; or the model is further evaluated and tested to ensure its performance in practical applications. Evaluation indicators may include precision, recall rate, F1 score, etc.
[0101] Wherein, if the training parameters do not meet the training stop parameters, the training is continued until the training stop parameters are met, and the training is stopped to obtain the preset convolutional neural network model. In the process of continuing training, the learning rate, optimizer and other hyperparameters can be dynamically adjusted to improve the training effect. For example, the learning rate decay strategy (Learning Rate Decay) is used to gradually reduce the learning rate; various indicators in the training process are monitored in real time, including training loss, verification loss, training accuracy and verification accuracy, etc., to ensure the stability and performance of the model. After each training iteration, it is checked whether the current training parameters have reached the preset stop condition.
[0102] It can be seen that this embodiment ensures that the trained convolutional neural network model has good performance and does not overfit the training data, so that it can work effectively on tasks such as electrode detachment detection.
[0103] In one embodiment, after training the initial convolutional neural network model according to the target training set to obtain the preset convolutional neural network model, the method further includes: testing the preset convolutional neural network model according to the target test set to obtain a test result; if the test result is qualified, determining that the preset convolutional neural network model is used for electrode detachment detection; or, if the test result is unqualified, retraining the preset convolutional neural network model.
[0104] Among them, the target test set does not participate in the training process of the model and is used to evaluate the performance of the model on unknown data.
[0105] Among them, the process of testing the preset convolutional neural network model is to input the data of the target test set into the trained model to observe the prediction performance of the model.
[0106] Among them, the test results are a quantitative evaluation of the performance of the model on the target test set, usually including performance indicators such as accuracy, recall, and F1 score. If the test results meet the predetermined performance standards, such as the accuracy reaches a certain threshold, the model is considered qualified; if the test results do not meet the predetermined performance standards, the model is considered to need further optimization; if the model is unqualified, it is necessary to adjust the parameters or structure of the model based on the test result feedback and retrain it using the target training set. Furthermore, if the test results are unqualified, the model can be analyzed for cases where the model predicts errors to understand on which types of samples the model performs poorly.
[0107] In the process of retraining the preset convolutional neural network model, the training set can be expanded through data enhancement to improve the generalization ability of the model; or, hyperparameter tuning, such as adjusting the learning rate, batch size, regularization parameters, etc., can be performed to improve the model training effect; or, the network architecture can be modified, such as adding convolutional layers, adjusting the number of nodes in the fully connected layer, etc.
[0108] Furthermore, in order to more accurately evaluate the performance of the model, the cross-validation method can be used, that is, dividing the dataset into multiple subsets, using one part as the test set and the rest as the training set in turn.
[0109] It can be seen that the testing process in this embodiment ensures that the convolutional neural network model finally deployed has reliable and effective performance in the electrode detachment detection task.
[0110] It should be noted that, in each of the above-mentioned embodiments, there is not necessarily a certain order between the above-mentioned steps. A person skilled in the art can understand, based on the description of the embodiments of the present application, that in different embodiments, the above-mentioned steps may have different execution orders, that is, they may be executed in parallel, may be executed interchangeably, and so on.
[0111] As another aspect of the embodiment of the present application, the embodiment of the present application provides an electrode detachment detection device based on a convolutional neural network. The electrode detachment detection device based on a convolutional neural network can be a software module, which includes a number of instructions stored in a memory, and the processor can access the memory and call the instructions for execution to complete the electrode detachment detection method based on a convolutional neural network described in the above-mentioned various embodiments.
[0112] See also Figure 2 , Figure 2Schematic diagram of the structure of an electrode detachment detection device based on a convolutional neural network provided in an embodiment of the present application. Figure 2 As shown, the electrode detachment detection device 200 based on convolutional neural network includes:
[0113] An acquisition unit 201 is used to acquire the detection data of the person to be detected;
[0114] The processing unit 202 is used to preprocess the detection data to obtain the preprocessed target data;
[0115] The acquisition unit 201 is further used to acquire a preset convolutional neural network model, where the preset convolutional neural network model has been trained using a target training set;
[0116] The processing unit 202 is further used to input the target data into the preset convolutional neural network model to perform electrode detachment detection processing to obtain a target prediction value, and the target prediction value is used to compare the actual value of the person to be detected in the electrode detachment detection to obtain the detection result of the person to be detected.
[0117] By obtaining detailed test data of the person to be tested and preprocessing it, the method can effectively reduce the influence of noise and outliers, thereby improving the accuracy of electrode detachment detection; further preprocessing steps can standardize and normalize the data, making the data more suitable for the input requirements of the convolutional neural network model, improving data processing efficiency and the speed of model training; using a preset convolutional neural network model for electrode detachment detection reduces possible errors in the manual judgment process and ensures the objectivity and consistency of the test results. Therefore, the method can input the target data in real time and quickly obtain the predicted value, compare the predicted value with the true value, timely discover the electrode detachment, and take corresponding measures, thereby improving the response speed of electrode detachment detection.
[0118] In one embodiment, before obtaining the preset convolutional neural network model, the acquisition unit 201 is further used to: obtain a first data set for electrode detachment detection, the first data set including a positive sample subset in a first state and a negative sample subset in a second state, the positive sample subset and the negative sample subset being obtained by voltage values between multiple pairs of two adjacent electrodes; perform data processing according to the first data set to obtain a target training set, a target verification set and a target test set; train an initial convolutional neural network model according to the target training set to obtain the preset convolutional neural network model.
[0119] In one embodiment, in the acquisition of the first data set for electrode detachment detection, the acquisition unit 201 is further used to: acquire a control signal for controlling a multi-way analog switch, the control signal connecting the output current of the first end of the voltage-controlled current source to the corresponding electrode pair to achieve excitation of adjacent electrode pairs; according to the control signal, injecting excitation current into two adjacent electrodes in turn to obtain the voltage between the two adjacent electrodes; and sequentially collecting voltages of multiple people to be collected to obtain the first data set.
[0120] In one embodiment, in the step of training the initial convolutional neural network model according to the target training set to obtain the preset convolutional neural network model, the acquisition unit 201 is further used to: input the target training set into the first convolution module in the initial convolutional neural network model to obtain a first feature map; input the first feature map into the global pooling layer module in the initial convolutional neural network model and the residual network module in the initial convolutional neural network model respectively to obtain a first feature vector output by the global pooling layer module and a second feature map output by the residual network module; perform data fusion on the first feature vector and the second feature map to obtain a fused second feature vector; input the second feature vector into the multi-layer fully connected layer in the initial convolutional neural network model to obtain a target vector output by the multi-layer fully connected layer; input the target vector into the activation function layer in the initial convolutional neural network model to obtain a predicted value output by the activation function layer; train the initial convolutional neural network model according to the target training set in sequence until a preset stop condition is met, then stop the training to obtain the preset convolutional neural network model.
[0121] In one embodiment, in the step of inputting the first feature map into the residual network module in the initial convolutional neural network model to obtain the second feature map output by the residual network module, the acquisition unit 201 is further used to: input the first feature map into the batch normalization layer in the initial residual network module to obtain a third feature map after normalization; input the third feature map into the first activation layer in the initial residual network module to obtain a fourth feature map output by the first activation layer; input the fourth feature map into the weight layer in the initial residual network module to obtain a fifth feature map output by the weight layer; perform jump connection processing on the first feature map and the fifth feature map to obtain a sixth feature map; input the sixth feature map into the second activation layer in the initial residual network module to obtain the second feature map.
[0122] In one embodiment, in the step of training the initial convolutional neural network model according to the target training set in sequence until a preset stop condition is met, stopping the training to obtain the preset convolutional neural network model, the acquisition unit 201 is further used to: obtain a training stop parameter in the preset stop condition; determine whether the training parameter meets the training stop parameter, the training parameter being a parameter obtained after the target training set is trained on the initial convolutional neural network model each time; if the training parameter meets the training stop parameter, stopping the training to obtain the preset convolutional neural network model; or, if the training parameter does not meet the training stop parameter, continuing the training until the training stop parameter is met, stopping the training to obtain the preset convolutional neural network model.
[0123] In one embodiment, after the initial convolutional neural network model is trained according to the target training set to obtain the preset convolutional neural network model, the acquisition unit 201 is further used to: test the preset convolutional neural network model according to the target test set to obtain a test result; if the test result is qualified, determine that the preset convolutional neural network model is used for electrode detachment detection; or, if the test result is unqualified, re-train the preset convolutional neural network model.
[0124] It should be noted that the above-mentioned electrode detachment detection device based on convolutional neural network can execute the electrode detachment detection method based on convolutional neural network provided in the embodiment of the present application, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not fully described in the embodiment of the electrode detachment detection device based on convolutional neural network, please refer to the electrode detachment detection method based on convolutional neural network provided in the embodiment of the present application.
[0125] See also Figure 3 , Figure 3 3 is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. The computer device includes one or more processors 31 and a memory 32. The memory 32 is connected to the one or more processors 31, for example, connected to the processor 31 via a bus.
[0126] The processor 31 is configured to support the computer device to perform the corresponding functions in the method in the above method embodiment. The processor 31 can be a central processing unit (CPU), a network processor (NP), a hardware chip or any combination thereof. The above hardware chip can be an application specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof. The above PLD can be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof.
[0127] The memory 32 is used to store program codes, etc. The memory 32 may include a volatile memory (VM), such as a random access memory (RAM); the memory 32 may also include a non-volatile memory (NVM), such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD); the memory 32 may also include a combination of the above-mentioned types of memories.
[0128] The memory 32 can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as program instructions / modules corresponding to the electrode detachment detection method based on a convolutional neural network in the embodiment of the present application. The processor 31 executes various functional applications and data processing of the electrode detachment detection method based on a convolutional neural network and the electrode detachment detection device based on a convolutional neural network by running the non-volatile software programs, instructions and modules stored in the memory 32, that is, realizes the functions of each module or unit of the electrode detachment detection method based on a convolutional neural network and the electrode detachment detection device based on a convolutional neural network provided in the above method embodiment.
[0129] The memory 32 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required for at least one function. The data storage area may store data created according to the use of the electrode detachment detection device based on a convolutional neural network, etc. In some embodiments, the memory 32 may optionally include a memory 32 remotely arranged relative to the processor 31, and these remote memories 32 may be connected to the electrode detachment detection device based on a convolutional neural network via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0130] The one or more modules are stored in the memory 32. When executed by the one or more processors 31, the electrode detachment detection method based on convolutional neural network in any of the above-mentioned method embodiments is executed, for example, the method steps described in the above-mentioned method embodiments are executed to realize the functions of the modules described in the above-mentioned device embodiments.
[0131] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a computer, the computer executes the method described in the above embodiment.
[0132] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0133] The above disclosure is only the preferred embodiment of the present application, which certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.
Claims
1. A method for detecting electrode detachment based on convolutional neural network, characterized in that: include: Obtaining the test data of the person to be tested; Preprocessing the detection data to obtain the preprocessed target data; Obtain a preset convolutional neural network model, where the preset convolutional neural network model has been trained using a target training set; The target data is input into the preset convolutional neural network model for electrode detachment detection processing to obtain a target prediction value, and the target prediction value is used to compare the actual value of the person to be detected in the electrode detachment detection to obtain the detection result of the person to be detected.
2. The method according to claim 1, characterized in that: Before obtaining the preset convolutional neural network model, the method further includes: Acquire a first data set for electrode detachment detection, wherein the first data set includes a positive sample subset in a first state and a negative sample subset in a second state, wherein the positive sample subset and the negative sample subset are obtained by voltage values between multiple pairs of two adjacent electrodes; Performing data processing according to the first data set to obtain a target training set, a target verification set, and a target test set; An initial convolutional neural network model is trained according to the target training set to obtain the preset convolutional neural network model.
3. The method according to claim 2, characterized in that The step of acquiring a first data set for electrode detachment detection includes: Acquire a control signal for controlling the multi-channel analog switch, wherein the control signal connects the output current of the first end of the voltage-controlled current source to the corresponding electrode pair to realize the excitation of the adjacent electrode pair; According to the control signal, injecting excitation current into two adjacent electrodes in sequence to obtain a voltage between the two adjacent electrodes; Voltage collection is performed on a plurality of people to be collected in sequence to obtain a first data set.
4. The method according to claim 2, characterized in that: The initial convolutional neural network model is trained according to the target training set to obtain the preset convolutional neural network model, including: Inputting the target training set into the first convolution module in the initial convolutional neural network model to obtain a first feature map; Inputting the first feature map into the global pooling layer module in the initial convolutional neural network model and the residual network module in the initial convolutional neural network model respectively, to obtain a first feature vector output by the global pooling layer module and a second feature map output by the residual network module; Fusing the first feature vector and the second feature map to obtain a fused second feature vector; Inputting the second feature vector into the multi-layer fully connected layer in the initial convolutional neural network model to obtain the target vector output by the multi-layer fully connected layer; Inputting the target vector into the activation function layer in the initial convolutional neural network model to obtain a predicted value output by the activation function layer; The initial convolutional neural network model is trained in turn according to the target training set until a preset stop condition is met, and the training is stopped to obtain the preset convolutional neural network model.
5. The method according to claim 4, characterized in that The step of inputting the first feature map into the residual network module in the initial convolutional neural network model to obtain a second feature map output by the residual network module includes: Inputting the first feature map into a batch normalization layer in the initial residual network module to obtain a normalized third feature map; Inputting the third feature map into the first activation layer in the initial residual network module to obtain a fourth feature map output by the first activation layer; Inputting the fourth feature map into the weight layer in the initial residual network module to obtain a fifth feature map output by the weight layer; Performing a jump connection process on the first feature map and the fifth feature map to obtain a sixth feature map; The sixth feature map is input into the second activation layer in the initial residual network module to obtain the second feature map.
6. The method according to claim 4, characterized in that The initial convolutional neural network model is trained in turn according to the target training set until a preset stop condition is met, and the training is stopped to obtain the preset convolutional neural network model, including: Obtaining a training stop parameter in the preset stop condition; Determine whether the training parameters satisfy the training stop parameters, where the training parameters are parameters obtained after the target training set is trained on the initial convolutional neural network model each time; If the training parameters satisfy the training stop parameters, the training is stopped to obtain the preset convolutional neural network model; or, If the training parameters do not meet the training stop parameters, the training continues until the training stop parameters are met, and the training is stopped to obtain the preset convolutional neural network model.
7. The method according to claim 2, characterized in that: After training the initial convolutional neural network model according to the target training set to obtain the preset convolutional neural network model, the method further includes: Testing the preset convolutional neural network model according to the target test set to obtain a test result; If the test result is qualified, determining that the preset convolutional neural network model is used for electrode detachment detection; or, If the test result is unqualified, the preset convolutional neural network model is retrained.
8. An electrode detachment detection device based on a convolutional neural network, the device comprising: An acquisition unit, used for acquiring the detection data of the person to be detected; A processing unit, used for preprocessing the detection data to obtain the preprocessed target data; The acquisition unit is further used to acquire a preset convolutional neural network model, where the preset convolutional neural network model has been trained using a target training set; The processing unit is also used to input the target data into the preset convolutional neural network model to perform electrode detachment detection processing to obtain a target prediction value, and the target prediction value is used to compare the actual value of the person to be detected in the electrode detachment detection to obtain the detection result of the person to be detected.
9. A computer device, comprising a memory and a processor, wherein the memory is connected to the processor, and the processor is used to execute one or more computer programs stored in the memory, and when the processor executes the one or more computer programs, the computer device implements the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor is caused to perform the method according to any one of claims 1 to 7.