Signal detection model training method, signal detection method and device
By iteratively training the signal detection model, combining abnormal categories and auxiliary index labels, the low accuracy problem caused by noise interference in PPG signal detection is solved, and a more efficient signal detection effect is achieved.
Patent Information
- Application Number
- CN202310878697.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-17
- Publication Date
- 2025-01-17
AI Technical Summary
The existing photovoltaic pulse wave schema (PPG) signal detection technology has low accuracy in signal detection due to noise interference, and it is impossible to effectively use the original PPG signal for abnormal detection.
By obtaining sample signals and their anomaly category labels and auxiliary index labels, using the signal detection model to predict, calculate the abnormal loss value and auxiliary loss value, and iteratively train the model to improve learning and noise reduction capabilities, thereby improving the accuracy of signal detection.
It improves the accuracy of signal detection, and can more effectively extract common and critical information independent of noise from sample signals, enhancing the model's learning and noise reduction capabilities.
Smart Images

Figure CN119322956A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and specifically to a signal detection model training method, a signal detection method and a device. Background Art
[0002] Photoplethysmography (PPG) is based on a light source and a detector. It measures the attenuated light after reflection and absorption by human blood vessels and tissues, records the pulsation state of blood vessels and measures pulse waves. It has become a low-cost and non-invasive way to continuously monitor heart rate and blood flow, such as health monitoring / sports bracelets and smart watches. Abnormal PPG signal detection belongs to the time series anomaly detection task and is a classification task. Since the PPG signal contains a lot of noise, the existing technology cannot effectively use the original PPG signal to detect anomalies, resulting in low signal detection accuracy.
[0003] That is, the accuracy of signal detection in the prior art is low. Summary of the invention
[0004] The embodiments of the present application provide a signal detection model training method, a signal detection method and a device, which can improve the accuracy of signal detection.
[0005] In a first aspect, the present application provides a method for training a signal detection model, comprising:
[0006] Acquire a sample signal, an abnormal category label of the sample signal, and an auxiliary indicator label of at least one auxiliary indicator of the sample signal;
[0007] Predicting the sample signal using the signal detection model to obtain an abnormality category prediction value of the sample signal and an auxiliary indicator prediction value of at least one auxiliary indicator of the sample signal;
[0008] Determining an abnormal loss value based on the abnormal category prediction value of the sample signal and the abnormal category label of the sample signal;
[0009] Determine the auxiliary loss value of each auxiliary indicator based on the auxiliary indicator prediction value and the auxiliary indicator label of each auxiliary indicator of the sample signal;
[0010] determining a target loss value based on the abnormal loss value and the auxiliary loss value of each of the auxiliary indicators;
[0011] The preset signal detection model is iteratively trained based on the target loss value until the target loss value satisfies a preset stop condition.
[0012] In a second aspect, the signal detection method provided by the present application includes:
[0013] Obtain a signal to be detected that needs to be detected;
[0014] Obtain a preset signal detection model;
[0015] The signal to be detected is input into the preset signal detection model to obtain a prediction result of the signal to be detected.
[0016] In a third aspect, the present application provides a signal detection model training device, comprising:
[0017] An acquisition module, used for acquiring a sample signal, an abnormal category label of the sample signal, and an auxiliary indicator label of at least one auxiliary indicator of the sample signal;
[0018] A prediction module, used to predict the sample signal using the signal detection model to obtain an abnormality category prediction value of the sample signal and an auxiliary indicator prediction value of at least one auxiliary indicator of the sample signal;
[0019] A first determination module, configured to determine an abnormal loss value based on an abnormal category prediction value of the sample signal and an abnormal category label of the sample signal;
[0020] A second determination module, configured to determine an auxiliary loss value of each auxiliary indicator based on the auxiliary indicator prediction value and the auxiliary indicator label of each auxiliary indicator of the sample signal;
[0021] A third determination module, configured to determine a target loss value based on the abnormal loss value and the auxiliary loss value of each of the auxiliary indicators;
[0022] A training module is used to iteratively train the preset signal detection model based on the target loss value until the target loss value meets a preset stop condition.
[0023] In a fourth aspect, the signal detection device provided by the present application includes:
[0024] A signal acquisition module is used to acquire a signal to be detected.
[0025] A model acquisition module, used to acquire a preset signal detection model;
[0026] The prediction module is used to input the signal to be detected into the preset signal detection model to obtain the prediction result of the signal to be detected.
[0027] In a fifth aspect, the electronic device provided in the present application includes a memory and a processor, the memory stores a computer program, and the processor is used to run the computer program in the memory to implement the steps in the training method of the signal detection model provided in the present application or the steps in the signal detection method.
[0028] In a sixth aspect, the computer-readable storage medium provided in the present application stores a plurality of instructions, which are suitable for loading by a processor to implement the steps in the training method of the signal detection model provided in the present application or the steps in the signal detection method.
[0029] In the seventh aspect, the computer program product provided in the present application includes a computer program or instructions, which, when executed by a processor, implements the steps in the training method of the signal detection model or the steps in the signal detection method provided in the present application.
[0030] In the present application, compared with the related art, a sample signal, an abnormal category label of the sample signal, and an auxiliary indicator label of at least one auxiliary indicator of the sample signal are obtained; the sample signal is predicted using a signal detection model to obtain an abnormal category prediction value of the sample signal and an auxiliary indicator prediction value of at least one auxiliary indicator of the sample signal; an abnormal loss value is determined based on the abnormal category prediction value of the sample signal and the abnormal category label of the sample signal; the auxiliary loss value of each auxiliary indicator is determined based on the auxiliary indicator prediction value and the auxiliary indicator label of each auxiliary indicator of the sample signal; the target loss value is determined based on the abnormal loss value and the auxiliary loss value of each auxiliary indicator; and a preset signal detection model is iteratively trained based on the target loss value until the target loss value meets the preset stop condition. During model training, the signal detection model is allowed to predict the abnormal category while predicting at least one auxiliary indicator corresponding to the sample signal, so that the model extracts general and key information that is not related to noise from the sample signal to complete the prediction of the auxiliary indicator, which can improve the learning and noise reduction capabilities of the model, thereby improving the accuracy of signal detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0032] Figure 1 is a schematic diagram of a scenario of a signal detection system provided in an embodiment of the present application;
[0033] Figure 2 It is a flowchart of an embodiment of a method for training a signal detection model provided in an embodiment of the present application;
[0034] Figure 3 It is a flow chart of extracting features from time domain data of a sample signal and frequency domain data of a sample signal to obtain signal features in one embodiment of a training method for a signal detection model provided in an embodiment of the present application;
[0035] Figure 4 is a flowchart of another embodiment of the training method of the signal detection model provided in the embodiment of the present application;
[0036] Figure 5 It is a schematic diagram of the framework of the signal detection model of this application;
[0037] Figure 6 It is a flowchart of an embodiment of a signal detection method provided in an embodiment of the present application;
[0038] Figure 7 It is a structural schematic diagram of a training device for a signal detection model provided in an embodiment of the present application;
[0039] Figure 8 is a structural schematic diagram of a signal detection device provided in an embodiment of the present application;
[0040] Fig. 9 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0041] It should be noted that the principles of the present application are illustrated by implementing them in an appropriate computing environment. The following description is based on the illustrated specific embodiments of the present application and should not be considered as limiting other specific embodiments of the present application that are not described in detail herein.
[0042] In the following description of the present application, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it can be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0043] In the following description of the present application, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described here can be implemented in an order other than that illustrated or described here.
[0044] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0045] In order to improve the effect of signal detection, the embodiments of the present application provide a signal detection model training method, a signal detection model training device, a signal detection method, a signal detection device, an electronic device, a computer-readable storage medium, and a computer program product. Among them, the signal detection model training method can be executed by the signal detection model training device, or by an electronic device integrated with the signal detection model training device; the signal detection method can be executed by the signal detection device, or by an electronic device integrated with the signal detection device.
[0046] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.
[0047] Please refer to Figure 1 , the present application also provides a signal detection system, such as Figure 1 As shown, the signal detection system includes an electronic device 100, in which the training device of the signal detection model provided by the present application and / or the signal detection device are integrated.
[0048] Among them, the electronic device 100 can be any device equipped with a processor and has processing capabilities, such as mobile electronic devices with processors such as smart phones, tablet computers, PDAs, laptops, smart speakers, or fixed electronic devices with processors such as desktop computers, televisions, servers, industrial equipment, etc.
[0049] In addition, if Figure 1 As shown, the signal detection system may further include a memory 200 for storing original data, intermediate data and result data.
[0050] In the embodiment of the present application, the memory 200 can be a cloud storage. Cloud storage is a new concept extended and developed from the concept of cloud computing. A distributed cloud storage system (hereinafter referred to as the storage system) refers to a storage system that uses cluster applications, grid technology, and distributed storage file systems to bring together a large number of different types of storage devices (storage devices are also called storage nodes) in the network through application software or application interfaces to work together and provide external data storage and business access functions.
[0051] At present, the storage method of the storage system is: create a logical volume, and when creating a logical volume, allocate physical storage space for each logical volume. The physical storage space may be composed of disks of a storage device or several storage devices. The client stores data on a logical volume, that is, stores the data on the file system. The file system divides the data into many parts, each of which is an object. The object contains not only data but also additional information such as data identification (ID, ID entity). The file system writes each object into the physical storage space of the logical volume, and the file system records the storage location information of each object, so that when the client requests to access the data, the file system can allow the client to access the data according to the storage location information of each object.
[0052] The process of the storage system allocating physical storage space to a logical volume is as follows: based on the estimated capacity of the objects stored in the logical volume (this estimate often has a large margin relative to the actual capacity of the objects to be stored) and the grouping of independent redundant disk arrays (RAID, Redundant Array of Independent Disks), the physical storage space is pre-divided into stripes. A logical volume can be understood as a stripe, thereby allocating physical storage space to the logical volume.
[0053] It should be noted that Figure 1 The scenario diagram of the signal detection system shown is merely an example. The signal detection system and scenario described in the embodiment of the present application are intended to more clearly illustrate the technical solution of the embodiment of the present application, and do not constitute a limitation on the technical solution provided in the embodiment of the present application. A person of ordinary skill in the art can appreciate that with the evolution of the signal detection system and the emergence of new business scenarios, the technical solution provided in the embodiment of the present application is equally applicable to similar technical problems.
[0054] It should be noted that the serial numbers of the following embodiments are not intended to limit the preferred order of the embodiments.
[0055] Please refer to Figure 2 , Figure 2 FIG. 1 is a flow chart of an embodiment of a method for training a signal detection model provided in an embodiment of the present application. Figure 2 As shown, the process of the signal detection model training method provided in this application is as follows:
[0056] 201. Obtain a sample signal, an abnormal category label of the sample signal, and an auxiliary indicator label of at least one auxiliary indicator of the sample signal.
[0057] The sample signal may be a PPG signal or other sequence signals. For example, the sample signal is an arterial blood pressure (ABP) signal. Arterial blood pressure refers to the lateral pressure of blood on the aortic wall per unit area, generally referring to the blood pressure in the aorta. Its international standard unit is Pa or kilopascal, and it is usually expressed in millimeters of mercury in the past.
[0058] The sample signal is a piece of PPG data collected by the photoelectric receiver of the wearable device. For example, a sample signal is X = {x1, x2, x3, ... x L}, indicating the value of the amplitude of the PPG data in the time dimension. The at least one auxiliary indicator includes at least one of a heart rate value indicator, an age indicator, and a gender indicator.
[0059] Among them, the abnormal category label of the sample signal can be pre-labeled. For example, the heart rate value of an adult is usually between 60bpm and 100bpm, and the maximum heart rate during exercise is about 50%-85%, which is usually less than 160bpm. The normal range is set to [60bpm, 160bpm]. Therefore, if the heart rate value corresponding to the sample signal does not belong to the normal range, this section of the signal is abnormal, and the abnormal category label is represented by 1; if the heart rate value corresponding to a section of signal X belongs to the normal range, this section of the signal is normal, and the abnormal category label is represented by 0.
[0060] The auxiliary indicator label of at least one auxiliary indicator of the sample signal can be manually pre-labeled. For example, the auxiliary indicator label of the heart rate value indicator is 60, indicating that the heart rate value indicator is 60bpm; the auxiliary indicator label of the age indicator is 45, indicating that the age is 45 years old; the auxiliary indicator label of the gender indicator is 1, indicating that the gender is male, and the auxiliary indicator label of the gender indicator is 0, indicating that the gender is female.
[0061] 202. Predict the sample signal using the signal detection model to obtain an abnormality category prediction value of the sample signal and an auxiliary indicator prediction value of at least one auxiliary indicator of the sample signal.
[0062] In a specific embodiment, in order to improve the feature extraction capability, the time domain data and frequency domain data of the sample signal are fully utilized, and the sample signal is predicted using a signal detection model to obtain an abnormal category prediction value of the sample signal and an auxiliary indicator prediction value of at least one auxiliary indicator of the sample signal, including:
[0063] The sample signal is processed to obtain time domain data of the sample signal and frequency domain data of the sample signal.
[0064] In the embodiment of the present application, the sample signal is used as time domain data, and the time domain data is Fourier transformed to obtain the frequency domain data of the sample signal. For example, the time domain data X is X = {x1, x2, x3, ... x L}, perform Fourier transform on the time domain data X of the sample signal to obtain the frequency domain data X~, which is Among them, x in the time domain data X i is the value of the time domain data X at time "i", and the frequency domain data X~ is the frequency domain data The value at frequency "j".
[0065] The sample signal is predicted based on the time domain data of the sample signal and the frequency domain data of the sample signal to obtain an abnormality category prediction value of the sample signal and an auxiliary indicator prediction value of at least one auxiliary indicator of the sample signal.
[0066] In a specific embodiment, the signal detection model includes an abnormal classification module and at least one auxiliary classification module. Wherein, the abnormal classification module and the at least one auxiliary classification module can both be fully connected neural networks. The sample signal is predicted based on the time domain data of the sample signal and the frequency domain data of the sample signal to obtain the abnormal category prediction value of the sample signal and the auxiliary indicator prediction value of at least one auxiliary indicator of the sample signal, including:
[0067] Feature extraction is performed on the time domain data of the sample signal and the frequency domain data of the sample signal to obtain signal features.
[0068] The feature extraction of the time domain data of the sample signal and the frequency domain data of the sample signal can be performed through the existing network models such as CNN or RNN to obtain the signal features.
[0069] The signal features are respectively input into an abnormal classification module and at least one auxiliary classification module for prediction, so as to obtain an abnormal category prediction value of the sample signal and an auxiliary indicator prediction value of at least one auxiliary indicator of the sample signal.
[0070] It should be noted that artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making.
[0071] Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level and software-level technologies. The basic technologies of artificial intelligence generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics and other technologies. Artificial intelligence software technology mainly includes machine learning (ML) technology, among which deep learning (DL) is a new research direction in machine learning. It is introduced into machine learning to make it closer to the original goal, namely artificial intelligence. At present, deep learning is mainly used in the fields of machine vision and natural speech processing.
[0072] Deep learning is the process of learning the inherent laws and representation levels of sample data. The information obtained in the learning process is very helpful for interpreting data such as text, images, and sound. Using deep learning technology and corresponding sample sets, network models that can achieve different functions can be trained.
[0073] 203. Determine an abnormal loss value based on the abnormal category prediction value of the sample signal and the abnormal category label of the sample signal.
[0074] In the embodiment of the present application, the first preset loss function is used to determine the abnormal loss value based on the abnormal category prediction value of the sample signal and the abnormal category label of the sample signal. Optionally, the first preset loss function is a cross entropy loss function. Of course, the preset loss function can be a loss function such as a mean square error loss function and an exponential loss function.
[0075] 204. Determine an auxiliary loss value of each auxiliary indicator based on the auxiliary indicator prediction value and the auxiliary indicator label of each auxiliary indicator of the sample signal.
[0076] In a specific embodiment, the auxiliary loss value of each auxiliary indicator is determined based on the auxiliary indicator prediction value and the auxiliary indicator label of each auxiliary indicator of the sample signal using the second preset loss function. Optionally, the first preset loss function is a cross entropy loss function. Of course, the preset loss function can be a loss function such as a mean square error loss function and an exponential loss function.
[0077] In another specific embodiment, different preset loss functions are used to determine the auxiliary loss value of each auxiliary indicator based on the auxiliary indicator prediction value and the auxiliary indicator label of each auxiliary indicator. The preset loss function can be a cross entropy loss function, a mean square error loss function, an exponential loss function, or other loss functions.
[0078] Specifically, at least one auxiliary indicator is a heart rate value indicator, an age indicator or a gender indicator. The auxiliary loss value of the heart rate value indicator is determined based on the auxiliary indicator prediction value and the auxiliary indicator label of the heart rate value indicator using the mean square error loss function. The auxiliary loss value of the age indicator is determined based on the auxiliary indicator prediction value and the auxiliary indicator label of the age indicator using the mean square error loss function. The auxiliary loss value of the gender indicator is determined based on the auxiliary indicator prediction value and the auxiliary indicator label of the gender indicator using the cross entropy loss function.
[0079] 205. Determine a target loss value based on the abnormal loss value and the auxiliary loss values of each auxiliary indicator.
[0080] In the embodiment of the present application, the target loss value is determined based on the abnormal loss value and the auxiliary loss value of each auxiliary index, including: obtaining the loss weight coefficients of each preset loss value; weighted summing the abnormal loss value and the auxiliary loss value of each auxiliary index based on each loss weight coefficient to obtain the target loss value. Optionally, the loss weight coefficient of the abnormal loss value is greater than the loss weight coefficient of the auxiliary loss value of the heart rate value index, the loss weight coefficient of the abnormal loss value is greater than the loss weight coefficient of the auxiliary loss value of the age index, and the loss weight coefficient of the abnormal loss value is greater than the loss weight coefficient of the auxiliary loss value of the gender index.
[0081] In a specific embodiment, the abnormal loss value is L ad , the auxiliary loss value of the heart rate indicator is L h , the auxiliary loss value of the age indicator is L a , the auxiliary loss value of the gender indicator is L g The loss weight coefficients of the abnormal loss value, the auxiliary loss weight coefficient of the heart rate value index, the auxiliary loss weight coefficient of the age index, and the auxiliary loss weight coefficient of the gender index are 1, 0.6, 0.2, and 0.2 respectively. The target loss value L total Satisfies the following formula:
[0082] L total =L ad +0.6*L h +0.2*L a +0.2*L g
[0083] 206. Iteratively train a preset signal detection model based on the target loss value until the target loss value satisfies a preset stop condition.
[0084] For further information, see Figure 3 To improve feature extraction capabilities and learn the relationship between time domain and frequency domain, please refer to Figure 3 , Figure 3FIG. 1 is a flow chart of extracting features from time domain data of a sample signal and frequency domain data of a sample signal to obtain signal features in an embodiment of a training method for a signal detection model provided in an embodiment of the present application, such as Figure 3 As shown, the feature extraction process of the time domain data of the sample signal and the frequency domain data of the sample signal to obtain the signal features is as follows:
[0085] 301. Vectorize the time domain data and the frequency domain data to obtain a time domain mapping vector of the time domain data and a frequency domain mapping vector of the frequency domain data.
[0086] Specifically, the time domain data is input into the first embedding layer for vectorization to obtain the time domain mapping vector of the time domain data, and the frequency domain data is input into the second embedding layer for vectorization to obtain the frequency domain mapping vector of the frequency domain data. Both the first embedding layer and the second embedding layer can be the embedding layer of the Transformer model. Transformer is a typical Seq2Seq model. The core idea of the Seq2Seq model is to encode a sequence (such as text) into a vector representation of a fixed size, and then decode it into another sequence. This model usually includes an encoder and a decoder, which are responsible for encoding the input sequence into a hidden representation and decoding the hidden representation into an output sequence, respectively.
[0087] 302. Transform the time domain mapping vector based on the first time domain weight information to obtain a first time domain vector corresponding to the first time domain weight information.
[0088] Among them, the first time domain weight information can be a trainable first time domain weight matrix WK1, the second time domain weight information can be a trainable second time domain weight matrix WQ1, and the third time domain weight information can be a trainable third time domain weight matrix WV1. When the model is trained for the first time, the first time domain weight information, the second time domain weight information and the third time domain weight information are randomly generated.
[0089] Specifically, the first mapping vector of the time domain data is multiplied by the first time domain weight matrix WK1 to obtain the first time domain vector.
[0090] 303. Transform the frequency domain mapping vector based on the first frequency domain weight information to obtain a first frequency domain vector corresponding to the first frequency domain weight information.
[0091] Among them, the first frequency domain weight information can be a trainable first frequency domain weight matrix WK2, the second frequency domain weight information can be a trainable second frequency domain weight matrix WQ2, and the third frequency domain weight information can be a trainable third frequency domain weight matrix WV2. When the model is trained for the first time, the first frequency domain weight information, the second frequency domain weight information and the third frequency domain weight information are randomly generated.
[0092] Specifically, the frequency domain mapping vector of the frequency domain data is multiplied by the first frequency domain weight matrix WK2 to obtain the first frequency domain vector.
[0093] 304. Input the time domain mapping vector and the first frequency domain vector into a first cross-attention module to obtain a first cross-attention output feature.
[0094] In a specific embodiment, the time domain mapping vector and the two first frequency domain vectors are respectively input into the first cross-attention module as the query vector Q, key vector K and value vector V of the first cross-attention module to obtain the first cross-attention output feature.
[0095] The attention mechanism can be described as the process of mapping a set of query vectors Q, key vectors K, and value vectors V to an output, where the query vector Q, key vector K, value vector V and the output are all vectors. The output is calculated as the weighted sum of the value vector V, where the weight assigned to each value is calculated as a function of the query vector Q and the corresponding key vector K.
[0096] In another specific embodiment, in order to improve the feature extraction effect, the time domain mapping vector and the first frequency domain vector are input into the first cross attention module to obtain the first cross attention output feature, including:
[0097] (1) Input the time domain mapping vector into the first preset attention module to obtain a first output vector.
[0098] In an embodiment of the present application, the first preset attention module may be a self-attention module.
[0099] Specifically, the time domain mapping vector is multiplied by the first time domain weight matrix WK1 to obtain the first time domain vector; the time domain mapping vector is multiplied by the second time domain weight matrix WQ1 to obtain the second time domain vector; the time domain mapping vector is multiplied by the third time domain weight matrix WV1 to obtain the third time domain vector. The first time domain vector, the second time domain vector and the third time domain vector are input as the key vector K, the query vector Q and the value vector V of the first cross attention module respectively, and the first cross attention output feature is obtained. The first preset attention module obtains the first output vector.
[0100] The present application uses the first preset attention module to improve the feature accuracy of the query vector Q input into the first cross-attention module and improve the final prediction accuracy.
[0101] (2) Input the first output vector and the first frequency domain vector into the first cross-attention module to obtain the first cross-attention output feature.
[0102] In a specific embodiment, the first output vector and the two first frequency domain vectors are respectively input into the first cross-attention module as the query vector Q, key vector K and value vector V of the first cross-attention module to obtain the first cross-attention output feature.
[0103] In another specific embodiment, the first output vector and the first frequency domain vector are input into the first cross-attention module to obtain a first cross-attention output feature, including: obtaining a third frequency domain vector obtained by transforming the frequency domain data based on the third frequency domain weight information; inputting the first output vector, the first frequency domain vector and the third frequency domain vector into the first cross-attention module as the query vector, key vector and value vector of the first cross-attention module, respectively, to obtain the first cross-attention output feature. Specifically, the third frequency domain weight information is the third frequency domain weight matrix WV2, multiplying the frequency domain mapping vector and the third frequency domain weight matrix WV2 to obtain the third frequency domain vector, inputting the first output vector, the first frequency domain vector and the third frequency domain vector into the first cross-attention module as the query vector Q, key vector K and value vector V of the first cross-attention module, respectively, to obtain the first cross-attention output feature.
[0104] S305. Input the frequency domain mapping vector and the first time domain vector into a second cross-attention module to obtain a second cross-attention output feature.
[0105] In a specific embodiment, the frequency domain mapping vector and the two first time domain vectors are respectively input into the second cross-attention module as the query vector Q, key vector K and value vector V of the second cross-attention module to obtain the second cross-attention output feature.
[0106] In another specific embodiment, in order to improve the feature extraction effect, the frequency domain mapping vector and the first time domain vector are input into the second cross attention module to obtain the second cross attention output feature, including:
[0107] (1) Input the frequency domain mapping vector into the second preset attention module to obtain a second output vector.
[0108] In an embodiment of the present application, the second preset attention module may be a self-attention module.
[0109] (2) Input the second output vector and the first time domain vector into the second cross-attention module to obtain the second cross-attention output feature.
[0110] In a specific embodiment, the second output vector and the two first time domain vectors are respectively input into the second cross-attention module as the query vector Q, key vector K and value vector V of the second cross-attention module to obtain the second cross-attention output feature.
[0111] In another specific embodiment, the second output vector and the first time domain vector are input into the second cross-attention module to obtain a second cross-attention output feature, including: obtaining a third time domain vector obtained by transforming the time domain data based on the third time domain weight information; inputting the second output vector, the first time domain vector and the third time domain vector into the second cross-attention module as the query vector, key vector and value vector of the second cross-attention module, respectively, to obtain the second cross-attention output feature. Specifically, the third time domain weight information is the third time domain weight matrix WV1, multiplying the time domain mapping vector and the third time domain weight matrix WV1 to obtain the third time domain vector, inputting the second output vector, the first time domain vector and the third time domain vector into the second cross-attention module as the query vector Q, key vector K and value vector V of the second cross-attention module, respectively, to obtain the second cross-attention output feature.
[0112] 306. Determine a signal feature based on the first cross-attention output feature and the second cross-attention output feature.
[0113] In the embodiment of the present application, the first cross-attention output feature is input into the first multilayer perceptron to obtain the first output feature; the second cross-attention output feature is input into the second multilayer perceptron to obtain the second output feature; the first output feature and the second output feature are fused to obtain the signal feature. The first multilayer perceptron includes two fully connected neural networks, and may also include one or three or more fully connected neural networks, which is not limited here.
[0114] For further information, see Figure 4 and Figure 5 , Figure 4 is a flow chart of another embodiment of the training method of the signal detection model provided in the embodiment of the present application, Figure 5 This is a schematic diagram of the framework of the signal detection model of this application. First, Figure 5 This section introduces the various symbols in the .
[0115] Among them, X represents time domain data; X~ represents time domain data, FC-T represents the first embedding layer, FC-F represents the second embedding layer, WK1 represents the first time domain weight matrix; WQ1 represents the second time domain weight matrix; WV1 represents the third time domain weight matrix; WK2 represents the first frequency domain weight matrix; WQ2 represents the second frequency domain weight matrix; WV2 represents the third frequency domain weight matrix; R represents signal features; AnomlyDetection represents the anomaly classification module; HeartRate represents the heart rate auxiliary classification module; Age represents the age auxiliary classification module; Gender represents the gender auxiliary classification module.
[0116] FFT stands for Fourier transform module. Fast Fourier transform (FFT) is an efficient algorithm. Fourier transform is one of the most basic methods in time domain-frequency domain transform analysis.
[0117] Attention represents the preset attention module. Figure 5 Two preset attention modules are shown in Figure 1, namely the first preset attention module and the second preset attention module. The attention mechanism can be described as the process of mapping a set of query vectors Q, key vectors K, and value vectors V to an output, where the query vectors Q, key vectors K, value vectors V, and the output are all vectors. The output is calculated as the weighted sum of the value vectors V, where the weight assigned to each value is calculated by a function of the query vector Q and the corresponding key vector K.
[0118] Cross Attention means the cross attention module. Figure 5 Two cross-attention modules are shown in the figure, namely the first cross-attention module and the second cross-attention module.
[0119] MLP (Multi-Layer Perceptron) is a directed structured artificial neural network that maps a set of input vectors to a set of output vectors. MLP can be viewed as a directed graph consisting of multiple node layers, each of which is fully connected to the next layer. Except for the input node, each node is a neuron (or processing unit) with a nonlinear activation function. A supervised learning method called backpropagation algorithm is often used to train MLP. MLP is a generalization of the perceptron, which overcomes the shortcoming of the perceptron that it cannot recognize linearly inseparable data. Figure 5 Two multilayer perceptrons are shown in Figure 1, namely the first multilayer perceptron and the second multilayer perceptron.
[0120] Time-Frequency Encoder represents an overall module consisting of two preset attention modules, two multi-layer perceptrons, the first embedding layer, the second embedding layer, and two cross-attention modules.
[0121] Combination Figure 4 and Figure 5 The signal detection model training method provided in the embodiment of the present application includes the following steps:
[0122] 401. Obtain a sample signal, an abnormal category label of the sample signal, and an auxiliary indicator label of at least one auxiliary indicator of the sample signal.
[0123] The sample signal may be a PPG signal or other signals. The sample signal is a piece of PPG data collected by the photoelectric receiver of the wearable device. For example, a sample signal is X = {x1, x2, x3, ... x L}, indicating the amplitude of PPG data in the time dimension. The auxiliary indicators are heart rate value indicator, age indicator or gender indicator.
[0124] Among them, the abnormal category label of the sample signal can be pre-labeled. For example, the heart rate value of an adult is usually between 60bpm and 100bpm, and the maximum heart rate during exercise is about 40%-85%, which is usually less than 160bpm. The normal range is set to [60bpm, 160bpm]. Therefore, if the heart rate value corresponding to the sample signal does not belong to the normal range, then this section of the signal is abnormal, and the abnormal category label is represented by 1; if the heart rate value corresponding to a section of signal X belongs to the normal range, then this section of the signal is normal, and the abnormal category label is represented by 0.
[0125] The auxiliary indicator label of at least one auxiliary indicator of the sample signal can be manually pre-labeled. For example, the auxiliary indicator label of the heart rate value indicator is 60, indicating that the heart rate value indicator is 60bpm; the auxiliary indicator label of the age indicator is 45, indicating that the age is 45 years old; the auxiliary indicator label of the gender indicator is 1, indicating that the gender is male, and the auxiliary indicator label of the gender indicator is 0, indicating that the gender is female.
[0126] 402. Process the sample signal to obtain time domain data of the sample signal and frequency domain data of the sample signal.
[0127] In the embodiment of the present application, the sample signal is used as the time domain data X, and the time domain data X is Fourier transformed to obtain the frequency domain data X of the sample signal. For example, the time domain data X is X={x1,x2,x3,…x L}, perform Fourier transform on the time domain data X of the sample signal to obtain the frequency domain data for Among them, x in the time domain data X i is the value of the time domain data X at time "i", and the frequency domain data In It is frequency domain data The value at frequency "j".
[0128] like Figure 5 As shown, the time domain data X is input into the FFT module for Fourier transform to obtain the frequency domain data
[0129]
[0130] 403. Vectorize the time domain data and the frequency domain data to obtain a time domain mapping vector of the time domain data and a frequency domain mapping vector of the frequency domain data.
[0131] like Figure 5 As shown, the time domain data X is input into the first embedding layer FC-T to obtain the time domain mapping vector of the time domain data X, and the frequency domain data Input the second embedding layer FC-F to get frequency domain data The frequency domain mapping vector of .
[0132] 404. Transform the time domain mapping vector based on the first time domain weight information, the second time domain weight information, and the third time domain weight information to obtain a first time domain vector, a second time domain vector, and a third time domain vector.
[0133] Among them, the first time domain weight information can be a trainable first time domain weight matrix WK1, the second time domain weight information can be a trainable second time domain weight matrix WQ1, and the third time domain weight information can be a trainable third time domain weight matrix WV1. When the model is trained for the first time, the first time domain weight information, the second time domain weight information and the third time domain weight information are randomly generated.
[0134] Specifically, multiply the time domain mapping vector and the first time domain weight matrix WK1 to obtain the first time domain vector; multiply the time domain mapping vector and the second time domain weight matrix WQ1 to obtain the second time domain vector; multiply the time domain mapping vector and the third time domain weight matrix WV1 to obtain the third time domain vector.
[0135] 405. Input the first time domain vector, the second time domain vector, and the third time domain vector into a first preset attention module to obtain a first output vector.
[0136] In an embodiment of the present application, the first preset attention module may be a self-attention module.
[0137] like Figure 5 As shown, specifically, the first time domain vector, the second time domain vector and the third time domain vector are respectively input into the first preset attention module as the key vector K, the query vector Q and the value vector V of the first preset attention module to obtain the first output vector.
[0138] 406. Transform the frequency domain mapping vector based on the first frequency domain weight information, the second frequency domain weight information, and the third frequency domain weight information to obtain a first frequency domain vector, a second frequency domain vector, and a third frequency domain vector.
[0139] Among them, the first frequency domain weight information can be a trainable first frequency domain weight matrix WK2, the second frequency domain weight information can be a trainable second frequency domain weight matrix WQ2, and the third frequency domain weight information can be a trainable third frequency domain weight matrix WV2. When the model is trained for the first time, the first frequency domain weight information, the second frequency domain weight information and the third frequency domain weight information are randomly generated.
[0140] Specifically, multiply the frequency domain mapping vector and the first frequency domain weight matrix WK2 to obtain the first frequency domain vector; multiply the frequency domain mapping vector and the second frequency domain weight matrix WQ2 to obtain the second frequency domain vector; multiply the frequency domain mapping vector and the third frequency domain weight matrix WV2 to obtain the third frequency domain vector.
[0141] 407. Input the first frequency domain vector, the second frequency domain vector, and the third frequency domain vector into a second preset attention module to obtain a second output vector.
[0142] In an embodiment of the present application, the second preset attention module may be a self-attention module.
[0143] like Figure 5 As shown, specifically, the first frequency domain vector, the second frequency domain vector and the third frequency domain vector are respectively input into the second preset attention module as the query vector Q, key vector K and value vector V of the second preset attention module to obtain a second output vector.
[0144] S408. Input the first output vector, the first frequency domain vector and the third frequency domain vector into a first cross-attention module to obtain a first cross-attention output feature.
[0145] like Figure 5 As shown, the first output vector, the first time domain vector and the third time domain vector are respectively input into the first cross-attention module as the query vector Q, key vector K and value vector V of the first cross-attention module to obtain the first cross-attention output feature.
[0146] S409, input the second output vector, the first time domain vector and the third time domain vector into a second cross-attention module to obtain a second cross-attention output feature.
[0147] Specifically, the second output vector, the first time domain vector and the third time domain vector are respectively input into the second cross-attention module as the query vector Q, key vector K and value vector V of the second cross-attention module to obtain the second cross-attention output feature.
[0148] S410, determining a signal feature based on the first cross-attention output feature and the second cross-attention output feature.
[0149] like Figure 5As shown, two multilayer perceptrons (MLPs) are identified in the figure, namely the first multilayer perceptron and the second multilayer perceptron. The first cross-attention output feature is input into the first multilayer perceptron to obtain the first output feature; the second cross-attention output feature is input into the second multilayer perceptron to obtain the second output feature; the first output feature and the second output feature are fused to obtain the signal feature R. The first multilayer perceptron includes two fully connected neural networks, and may also include one or three or more fully connected neural networks, which is not limited here.
[0150] 411. Input the signal features into the abnormal classification module, the heart rate auxiliary classification module, the age auxiliary classification module and the gender auxiliary classification module for prediction, and obtain the abnormal category prediction value of the sample signal, the auxiliary indicator prediction value of the heart rate auxiliary classification module, the auxiliary indicator prediction value of the age auxiliary classification module and the auxiliary indicator prediction value of the gender auxiliary classification module.
[0151] In a specific embodiment, the signal detection model includes an abnormal classification module AnomlyDetection and at least one auxiliary classification module. The at least one auxiliary classification module includes a heart rate auxiliary classification module HeartRate, an age auxiliary classification module Age, and a gender auxiliary classification module Gender. The abnormal classification module and the at least one auxiliary classification module can both be fully connected neural networks.
[0152] 412. Determine an abnormal loss value based on the abnormal category prediction value of the sample signal and the abnormal category label of the sample signal.
[0153] In the embodiment of the present application, the first preset loss function is used to determine the abnormal loss value based on the abnormal category prediction value of the sample signal and the abnormal category label of the sample signal. Optionally, the first preset loss function is a cross entropy loss function. Of course, the preset loss function can be a loss function such as a mean square error loss function and an exponential loss function.
[0154] 413. Determine the auxiliary loss value of each auxiliary indicator based on the auxiliary indicator prediction value and the auxiliary indicator label of each auxiliary indicator of the sample signal.
[0155] In a specific embodiment, the auxiliary loss value of each auxiliary indicator is determined based on the auxiliary indicator prediction value and the auxiliary indicator label of each auxiliary indicator of the sample signal using the second preset loss function. Optionally, the first preset loss function is a cross entropy loss function. Of course, the preset loss function can be a loss function such as a mean square error loss function and an exponential loss function.
[0156] In a specific embodiment, different preset loss functions are used to determine the auxiliary loss value of each auxiliary indicator based on the auxiliary indicator prediction value and auxiliary indicator label of each auxiliary indicator of the sample signal. The preset loss function can be a cross entropy loss function, a mean square error loss function, an exponential loss function, or other loss functions.
[0157] Specifically, at least one auxiliary indicator includes at least one of a heart rate value indicator, an age indicator, and a gender indicator. The auxiliary loss value of the heart rate value indicator is determined based on the auxiliary indicator prediction value and the auxiliary indicator label of the heart rate value indicator using a mean square error loss function. The auxiliary loss value of the age indicator is determined based on the auxiliary indicator prediction value and the auxiliary indicator label of the age indicator using a mean square error loss function. The auxiliary loss value of the gender indicator is determined based on the auxiliary indicator prediction value and the auxiliary indicator label of the gender indicator using a cross entropy loss function.
[0158] 414. Determine a target loss value based on the abnormal loss value and the auxiliary loss values of each auxiliary indicator.
[0159] In the embodiment of the present application, the target loss value is determined based on the abnormal loss value and the auxiliary loss value of each auxiliary index, including: obtaining the loss weight coefficients of each preset loss value; weighted summing the abnormal loss value and the auxiliary loss value of each auxiliary index based on each loss weight coefficient to obtain the target loss value. Optionally, the loss weight coefficient of the abnormal loss value is greater than the loss weight coefficient of the auxiliary loss value of the heart rate value index, the loss weight coefficient of the abnormal loss value is greater than the loss weight coefficient of the auxiliary loss value of the age index, and the loss weight coefficient of the abnormal loss value is greater than the loss weight coefficient of the auxiliary loss value of the gender index.
[0160] In a specific embodiment, the abnormal loss value is L ad , the auxiliary loss value of the heart rate indicator is L h , the auxiliary loss value of the age indicator is L a , the auxiliary loss value of the gender indicator is L g The loss weight coefficients of the abnormal loss value, the auxiliary loss weight coefficient of the heart rate value indicator, the auxiliary loss weight coefficient of the age indicator, and the auxiliary loss weight coefficient of the gender indicator are 1, 0.6, 0.2, and 0.2 respectively. The target loss value satisfies the following formula:
[0161] L total =L ad +0.6*L h +0.2*L a +0.2*L g
[0162] 415. Iteratively train a preset signal detection model based on the target loss value until the target loss value satisfies a preset stop condition.
[0163] For further information, please refer to Figure 6 , Figure 6 FIG. 1 is a flow chart of an embodiment of a signal detection method provided in an embodiment of the present application. Figure 6 As shown, the process of the signal detection method is as follows:
[0164] 601. Obtain a signal to be detected that needs to be detected.
[0165] 602. Obtain a preset signal detection model.
[0166] In a specific embodiment, the preset signal detection model is obtained by any of the above-mentioned signal detection model training methods.
[0167] In another specific embodiment, the signal detection model includes an abnormal classification module and at least one auxiliary classification module. The abnormal classification module is trained based on the loss function of the abnormal classification module, and each auxiliary classification module is trained based on the loss function of each auxiliary classification module to obtain a signal detection model.
[0168] 603. Input the signal to be detected into a preset signal detection model to obtain a prediction result of the signal to be detected.
[0169] The prediction result of the signal to be detected includes at least one of an auxiliary indicator prediction value and an abnormal category prediction value of the signal to be detected.
[0170] In a specific implementation, at least one auxiliary indicator includes a heart rate indicator, an age indicator, and a gender indicator. The prediction result of the signal to be detected includes: a predicted value of the heart rate indicator, a predicted value of the age indicator, a predicted value of the gender indicator, and a predicted value of the abnormal category. Of course, the prediction result of the signal to be detected may also only include the predicted value of the abnormal category, and the prediction result of the signal to be detected may also only include the predicted value of the heart rate indicator, which can be determined according to the required model function and is not limited here.
[0171] In order to facilitate better implementation of the signal detection model training method provided in the embodiment of the present application, the embodiment of the present application also provides a signal detection model training device based on the above signal detection model training method. The meanings of the terms are the same as those in the above signal detection model training method. For specific implementation details, please refer to the description in the above method embodiment.
[0172] Please refer to Figure 7 , Figure 7A schematic diagram of the structure of a training device for a signal detection model provided in an embodiment of the present application, wherein the training device for the signal detection model may include an acquisition module 701, a prediction module 702, a first determination module 703, a second determination module 704, a third determination module 705, and a training module 706, wherein:
[0173] An acquisition module, used to acquire a sample signal, an abnormal category label of the sample signal, and an auxiliary indicator label of at least one auxiliary indicator of the sample signal;
[0174] A prediction module, used to predict the sample signal using the signal detection model to obtain an abnormal category prediction value of the sample signal and an auxiliary indicator prediction value of at least one auxiliary indicator of the sample signal;
[0175] A first determination module, used to determine an abnormal loss value based on an abnormal category prediction value of the sample signal and an abnormal category label of the sample signal;
[0176] A second determination module, configured to determine an auxiliary loss value of each auxiliary indicator based on an auxiliary indicator prediction value and an auxiliary indicator label of each auxiliary indicator of the sample signal;
[0177] A third determination module is used to determine a target loss value based on the abnormal loss value and the auxiliary loss values of each auxiliary indicator;
[0178] The training module is used to iteratively train a preset signal detection model based on a target loss value until the target loss value meets a preset stop condition.
[0179] The specific implementation of each of the above modules can be found in the previous embodiments and will not be described in detail here.
[0180] In order to better implement the signal detection method provided in the embodiment of the present application, the embodiment of the present application also provides a signal detection device based on the above signal detection method. The meanings of the terms are the same as those in the above signal detection method. For specific implementation details, please refer to the description in the above method embodiment.
[0181] Please refer to Figure 8 , Figure 8 This is a schematic diagram of the structure of a signal detection device provided in an embodiment of the present application. The signal detection device may include a signal acquisition module 801, a model acquisition module 802, and a prediction module 803, wherein:
[0182] A signal acquisition module is used to acquire a signal to be detected.
[0183] A model acquisition module, used to acquire a preset signal detection model;
[0184] The prediction module is used to input the signal to be detected into a preset signal detection model to obtain the prediction result of the signal to be detected.
[0185] An embodiment of the present application also provides an electronic device, including a memory and a processor, wherein the processor is used to execute the steps in the training method of the signal detection model or the steps in the signal detection method provided in this embodiment by calling a computer program stored in the memory.
[0186] Please refer to Fig. 9 , Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0187] The electronic device may include components such as a processor 101 with one or more processing cores, a memory 102 with one or more computer-readable storage media, a power supply 103, and an input unit 104. Those skilled in the art will appreciate that Fig. 9 The electronic device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0188] The processor 101 is the control center of the electronic device, which uses various interfaces and lines to connect various parts of the entire electronic device, and executes various functions of the electronic device and processes data by running or executing software programs and / or modules stored in the memory 102, and calling data stored in the memory 102. Optionally, the processor 101 may include one or more processing cores; optionally, the processor 101 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 101.
[0189] The memory 102 can be used to store software programs and modules. The processor 101 executes various functional applications and data processing by running the software programs and modules stored in the memory 102. The memory 102 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 102 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 102 may also include a memory controller to provide the processor 101 with access to the memory 102.
[0190] The electronic device also includes a power supply 103 for supplying power to each component. Optionally, the power supply 103 can be logically connected to the processor 101 through a power management system, so as to manage charging, discharging, and power consumption through the power management system. The power supply 103 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0191] The electronic device may further include an input unit 104, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
[0192] Although not shown, the electronic device may also include a display unit, an image acquisition component, etc., which will not be described in detail here. Specifically in this embodiment, the processor 101 in the electronic device will load the executable code corresponding to one or more computer programs into the memory 102 according to the following instructions, and the processor 101 will execute the training method of the signal detection model provided in this application and / or the steps in the signal detection method, such as:
[0193] Acquire a sample signal, an abnormal category label of the sample signal, and an auxiliary indicator label of at least one auxiliary indicator of the sample signal;
[0194] Predicting the sample signal using the signal detection model to obtain an abnormal category prediction value of the sample signal and an auxiliary indicator prediction value of at least one auxiliary indicator of the sample signal;
[0195] Determine an abnormal loss value based on the abnormal category prediction value of the sample signal and the abnormal category label of the sample signal;
[0196] Determine the auxiliary loss value of each auxiliary indicator based on the auxiliary indicator prediction value and the auxiliary indicator label of each auxiliary indicator of the sample signal;
[0197] Determine a target loss value based on the abnormal loss value and the auxiliary loss values of each auxiliary indicator;
[0198] Iteratively train a preset signal detection model based on a target loss value until the target loss value meets a preset stop condition;
[0199] or,
[0200] Obtain a signal to be detected that needs to be detected;
[0201] Obtain a preset signal detection model;
[0202] The signal to be detected is input into a preset signal detection model to obtain a prediction result of the signal to be detected.
[0203] It should be noted that the electronic device provided in the embodiment of the present application belongs to the same concept as the training method of the signal detection model and / or the signal detection method in the above embodiments. The specific implementation process is detailed in the above related embodiments and will not be repeated here.
[0204] The present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program stored therein is executed on a processor of an electronic device provided in an embodiment of the present application, the processor of the electronic device executes the training method of the signal detection model and / or the steps in the signal detection method provided in the present application. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0205] The present application also provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the above-mentioned signal detection model training method and / or various optional implementations of the signal detection method.
[0206] The above is a detailed introduction to the training method of a signal detection model, the signal detection method and the device provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
[0207] It should be noted that when the above embodiments of the present application are applied to specific products or technologies, the relevant data of the user is involved, and the user's permission or consent is required, and the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
Claims
1. A method for training a signal detection model, characterized in that: include: Acquire a sample signal, an abnormal category label of the sample signal, and an auxiliary indicator label of at least one auxiliary indicator of the sample signal; Predicting the sample signal using the signal detection model to obtain an abnormality category prediction value of the sample signal and an auxiliary indicator prediction value of at least one auxiliary indicator of the sample signal; Determining an abnormal loss value based on the abnormal category prediction value of the sample signal and the abnormal category label of the sample signal; Determine the auxiliary loss value of each auxiliary indicator based on the auxiliary indicator prediction value and the auxiliary indicator label of each auxiliary indicator of the sample signal; determining a target loss value based on the abnormal loss value and the auxiliary loss value of each of the auxiliary indicators; The preset signal detection model is iteratively trained based on the target loss value until the target loss value satisfies a preset stop condition.
2. The signal detection model training method according to claim 1, characterized in that: The determining of a target loss value based on the abnormal loss value and the auxiliary loss value of each of the auxiliary indicators comprises: Get the loss weight coefficients of each preset loss value; The target loss value is obtained by weighting and summing the abnormal loss value and the auxiliary loss value of each auxiliary indicator based on each loss weight coefficient.
3. The signal detection model training method according to claim 1, characterized in that: The at least one auxiliary indicator includes at least one of a heart rate value indicator, an age indicator, and a gender indicator.
4. The signal detection model training method according to claim 1, characterized in that: The method of using the signal detection model to predict the sample signal to obtain an abnormality category prediction value of the sample signal and an auxiliary indicator prediction value of at least one auxiliary indicator of the sample signal includes: Processing the sample signal to obtain time domain data of the sample signal and frequency domain data of the sample signal; The sample signal is predicted based on the time domain data of the sample signal and the frequency domain data of the sample signal to obtain an abnormality category prediction value of the sample signal and an auxiliary indicator prediction value of at least one auxiliary indicator of the sample signal.
5. The signal detection model training method according to claim 4, characterized in that: The signal detection model includes an abnormal classification module and at least one auxiliary classification module; the sample signal is predicted based on the time domain data of the sample signal and the frequency domain data of the sample signal to obtain an abnormal category prediction value of the sample signal and an auxiliary indicator prediction value of at least one auxiliary indicator of the sample signal, including: Extracting features from the time domain data of the sample signal and the frequency domain data of the sample signal to obtain signal features; The signal features are respectively input into an abnormal classification module and at least one auxiliary classification module for prediction, so as to obtain an abnormal category prediction value of the sample signal and an auxiliary indicator prediction value of at least one auxiliary indicator of the sample signal.
6. The signal detection model training method according to claim 5, characterized in that: The signal detection model includes a first cross-attention module and a second cross-attention module; The extracting features from the time domain data of the sample signal and the frequency domain data of the sample signal to obtain signal features includes: Vectorize the time domain data and the frequency domain data to obtain a time domain mapping vector of the time domain data and a frequency domain mapping vector of the time domain data; Transforming the time domain mapping vector based on the first time domain weight information to obtain a first time domain vector corresponding to the first time domain weight information; Transforming the frequency domain mapping vector based on the first frequency domain weight information to obtain a first frequency domain vector corresponding to the first frequency domain weight information; Inputting the time domain mapping vector and the first frequency domain vector into the first cross attention module to obtain a first cross attention output feature; Inputting the frequency domain mapping vector and the first time domain vector into the second cross attention module to obtain a second cross attention output feature; The signal characteristic is determined based on the first cross-attention output characteristic and the second cross-attention output characteristic.
7. The signal detection model training method according to claim 6, characterized in that: The signal detection model includes a first preset attention module, and the time domain mapping vector and the first frequency domain vector are input into the first cross attention module to obtain a first cross attention output feature, including: Inputting the time domain mapping vector into a first preset attention module to obtain a first output vector; The first output vector and the first frequency domain vector are input into the first cross-attention module to obtain a first cross-attention output feature.
8. The signal detection model training method according to claim 7, characterized in that: The step of inputting the first output vector and the first frequency domain vector into the first cross attention module to obtain a first cross attention output feature comprises: Obtaining a third frequency domain vector obtained by transforming the frequency domain data based on the third frequency domain weight information; The first output vector, the first frequency domain vector and the third frequency domain vector are respectively input into the first cross-attention module as the query vector, key vector and value vector of the first cross-attention module to obtain the first cross-attention output feature.
9. The signal detection model training method according to claim 6, characterized in that: The signal detection model includes a first multilayer perceptron and a second multilayer perceptron; and determining the signal feature based on the first cross-attention output feature and the second cross-attention output feature includes: Inputting the first cross-attention output feature into a first multilayer perceptron to obtain a first output feature; Inputting the second cross-attention output feature into a second multilayer perceptron to obtain a second output feature; The first output feature and the second output feature are fused to obtain the signal feature.
10. A signal detection method, characterized in that: include: Obtain a signal to be detected that needs to be detected; Obtain a preset signal detection model; The signal to be detected is input into the preset signal detection model to obtain a prediction result of the signal to be detected, wherein the prediction result of the signal to be detected includes at least one of an auxiliary indicator prediction value and an abnormal category prediction value of the signal to be detected.
11. The signal detection method according to claim 10, characterized in that: include: The preset signal detection model is obtained by the training method of the signal detection model described in any one of claims 1 to 9.
12. A training device for a signal detection model, characterized in that: include: An acquisition module, used for acquiring a sample signal, an abnormal category label of the sample signal, and an auxiliary indicator label of at least one auxiliary indicator of the sample signal; A prediction module, used to predict the sample signal using the signal detection model to obtain an abnormality category prediction value of the sample signal and an auxiliary indicator prediction value of at least one auxiliary indicator of the sample signal; A first determination module, configured to determine an abnormal loss value based on an abnormal category prediction value of the sample signal and an abnormal category label of the sample signal; A second determination module, configured to determine an auxiliary loss value of each auxiliary indicator based on the auxiliary indicator prediction value and the auxiliary indicator label of each auxiliary indicator of the sample signal; A third determination module, configured to determine a target loss value based on the abnormal loss value and the auxiliary loss value of each of the auxiliary indicators; A training module is used to iteratively train the preset signal detection model based on the target loss value until the target loss value meets a preset stop condition.
13. A signal detection device, characterized in that: include: A signal acquisition module is used to acquire a signal to be detected. A model acquisition module, used to acquire a preset signal detection model; A prediction module is used to input the signal to be detected into the preset signal detection model to obtain a prediction result of the signal to be detected, wherein the prediction result of the signal to be detected includes at least one of an auxiliary indicator prediction value and an abnormal category prediction value of the signal to be detected.
14. An electronic device, characterized in that: It comprises a memory and a processor, the memory storing a computer program, and the processor being used to run the computer program in the memory to execute the steps in the training method of the signal detection model described in any one of claims 1 to 9 or the steps in the signal detection method described in claims 10 to 11.
15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a plurality of instructions, which are suitable for being loaded by a processor to execute the steps in the signal detection model training method described in any one of claims 1 to 9 or the steps in the signal detection method described in claims 10 to 11.
16. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the steps in the signal detection model training method described in any one of claims 1 to 9 or the steps in the signal detection method described in claims 10 to 11 are implemented.