Weighing method, data classification method, equipment and medium

By performing linear transformation and normalization on the data, combined with time-series data compression and feature extraction, and weighted operations, the problem of neural networks struggling to capture features is solved, thus improving the accuracy of data classification.

CN121723237APending Publication Date: 2026-03-24JIANGYU KANGJIAN INNOVATION MEDICAL TECH CHENGDU CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-24
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

In existing technologies, neural networks struggle to capture features that significantly impact classification from data, resulting in poor data classification accuracy, especially evident in electrocardiogram (ECG) signal data processing.

Method used

By performing linear transformation and normalization on the data, higher linear weights are assigned to elements that have a greater impact on classification. Furthermore, through compression of time-series data, feature extraction, and weighting operations, features with a greater impact on classification are strengthened, while features with a smaller impact are weakened.

Benefits of technology

It improves the accuracy of data classification, ensures the capture of feature data with significant impact, and enhances the recognition ability of the classification network.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121723237A_ABST
    Figure CN121723237A_ABST
Patent Text Reader

Abstract

The invention provides a weighting method, a data classification method, equipment and a medium. The weighting method comprises the following steps: carrying out preset operation on data to obtain a plurality of linear weighted values; performing normalization processing on each linear weighted value to obtain a normalized weighted value; wherein the preset operation comprises linear transformation; wherein the data comprises a plurality of elements. By means of the method, classification can be more focused on elements which have large influence on classification in data, interference of different scales can be avoided, and therefore classification accuracy can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to a weighting method, a data classification method, an apparatus, and a medium. Background Technology

[0002] In the process of data classification, the relevant technology often directly inputs the data into the neural network for classification. However, the neural network often has difficulty capturing the features that have a significant impact on the classification from the data, resulting in poor classification accuracy.

[0003] Taking the field of electrocardiogram (ECG) signal data processing as an example, if neural networks are used directly to classify ECG signal data, the neural networks will have difficulty capturing features that have a significant impact on classification, resulting in poor classification accuracy of ECG signal data. Summary of the Invention

[0004] In view of the above, it is necessary to provide a weighting method, a data classification method, an apparatus and a medium that can solve the technical problem of poor data classification accuracy.

[0005] On one hand, embodiments of this application provide a weighting method, the weighting method comprising: performing a preset operation on data to obtain multiple linear weighted values, and normalizing each of the linear weighted values ​​to obtain a normalized weighted value, wherein the preset operation includes a linear transformation, and wherein the data includes multiple elements.

[0006] In some embodiments of this application, the data has multiple dimensions, including a first dimension, and each element in the data has a corresponding first index on the first dimension. The preset operation further includes: extracting multiple sequences from the data, wherein each sequence includes multiple elements in the data that have the same first index, and performing a linear transformation on each sequence to obtain a linear weighted value corresponding to each first index.

[0007] In some embodiments of this application, the weighting method further includes: determining a normalized weighted value corresponding to each element based on a first index corresponding to each element in the data, and multiplying each element with the corresponding normalized weighted value to obtain multiplied data.

[0008] In some embodiments of this application, the plurality of dimensions further includes a second dimension, each element having a corresponding second index on the second dimension, and the weighting method further includes: adding the multiplied data having the same second index on the second dimension to obtain a plurality of weighted data.

[0009] In some embodiments of this application, the weighting method further includes: using a fully connected layer to perform a linear transformation on the data to obtain the plurality of linearly weighted values.

[0010] In the weighting method provided in this application embodiment, by performing a linear transformation on the data, the correlation between different elements in the data can be obtained, and the elements with a greater or lesser impact on classification can be identified. Therefore, a corresponding linear weighting value can be assigned to each element based on its influence on the data classification; for example, elements with a greater impact on classification can be assigned a higher linear weighting value, and elements with a lesser impact can be assigned a lower linear weighting value. Thus, elements with a greater impact on classification become more significant compared to elements with a smaller impact, allowing the classification process to focus more on elements with a greater impact on classification, thereby improving classification accuracy. Normalizing the linear weighting values ​​unifies the scale of the linear weighting values, thereby eliminating the influence of different scales on classification and further improving classification accuracy.

[0011] On the other hand, this application provides a data classification method, which includes: acquiring time-series data; performing compression operations on the time-series data to obtain compressed data, wherein the compressed data includes multiple compressed data arranged in time; performing feature extraction operations on the compressed data to obtain target data features; using the weighting method, performing weighted operations on the target data features to obtain weighted data features; and performing classification operations on the weighted data features to obtain data categories.

[0012] In some embodiments of this application, the feature extraction operation is a circular convolution operation.

[0013] In the data classification method provided in this application embodiment, by compressing time-series data, the temporal characteristics of the time-series data can be preserved in the compressed data, ensuring the temporal sequence of the compressed data. Through feature extraction operations, effective target data features can be extracted from the compressed data. By performing weighted operations on the target data features, the correlation between different feature data in the target data features can be learned, thereby optimizing the target data features. For example, strengthening the feature data that has a greater impact on classification and weakening the feature data that has a smaller impact on classification, resulting in weighted data features. Classifying the weighted data features can accurately capture the feature data that has a greater impact on classification, thereby ensuring the accuracy of data category classification.

[0014] On the other hand, this application provides an electronic device, the electronic device comprising: a memory storing at least one instruction; and a processor executing the at least one instruction to implement the weighting method or the data classification method.

[0015] On the other hand, this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the weighting method or the data classification method described above. Attached Figure Description

[0016] Figure 1 This is a flowchart of a weighting method provided in an embodiment of this application.

[0017] Figure 2 This is a flowchart of a data classification method provided in an embodiment of this application.

[0018] Figure 3 This is a schematic diagram of electrocardiogram signal data provided in an embodiment of this application.

[0019] Figure 4 This is a schematic diagram of time-series data compression provided in an embodiment of this application.

[0020] Figure 5 This is a schematic diagram illustrating the calculation of weights provided in an embodiment of this application.

[0021] Figure 6 This is a schematic diagram of a neuron in a fully connected layer provided in an embodiment of this application.

[0022] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0023] It should be noted that in this application, "at least one" means one or more, and "more than one" means two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The terms "first," "second," "third," "fourth," etc. (if present) in the specification, claims, and drawings of this application are used to distinguish similar objects, not to describe a specific order or sequence.

[0024] It should be noted that the definitions of rows and columns in arrays or matrices in this application are as follows:

[0025] Row: Equivalent to the English word "row," indicating a horizontal direction;

[0026] Column: Equivalent to the English word "column", the direction is vertical.

[0027] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design solutions. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a specific manner. Unless otherwise specified, the following embodiments and features described herein can be combined with each other.

[0028] This application provides a weighting method that assigns a corresponding linear weighting value to each element in the data based on the magnitude of its influence on the data classification. This allows the classification to focus more on the elements in the data that have a greater impact on the classification, avoiding interference from different scales and thus improving classification accuracy.

[0029] like Figure 1 The diagram shown is a flowchart of a weighting method provided in an embodiment of this application. Depending on different needs, the order of the steps in this flowchart can be adjusted according to actual requirements, and some steps can be omitted. The weighting method is applied to electronic devices, such as… Figure 7 The electronic device 10 shown.

[0030] S11 performs a preset operation on the data to obtain multiple linear weighted values.

[0031] In some embodiments of this application, the data includes multiple elements, and this application does not limit the type of data. For example, the data may be time-series data such as electrocardiogram (ECG) signal data, industrial production data, and weather data, or data obtained after data compression and feature extraction operations on ECG signal data, industrial production data, and weather data. The data has multiple dimensions, including a first dimension and a second dimension. For example, the data may be in the form of a two-dimensional matrix or an array. Each element in the data has a corresponding first index on the first dimension and a corresponding second index on the second dimension.

[0032] For example, if the data is in matrix form, the first dimension can be columns, the second dimension can be rows, and the first index corresponding to each element in the first dimension can be a column number, such as column 1, column 2, column 3, etc. The second index corresponding to each element in the second dimension can be a row number, such as row 1, row 2, row 3, etc.

[0033] In some embodiments of this application, the preset operation may include a linear transformation. The electronic device performs a preset operation on the data to obtain multiple linearly weighted values, including: extracting multiple sequences from the data, wherein each sequence includes multiple elements in the data that have the same first index, performing a linear transformation on each sequence to obtain a linearly weighted value corresponding to each first index.

[0034] For example, if the data is in matrix form, multiple elements with the same first index can be elements in the same column of the matrix. Performing a linear transformation on multiple elements with the same first index in the data can be a linear transformation on the elements in the same column. Performing a linear transformation on the elements of each column in the data yields a linearly weighted value corresponding to that column. For example, performing a linear transformation on the elements of the second column in the data yields a linearly weighted value corresponding to the second column.

[0035] For example, an electronic device can use a fully connected layer to perform a linear transformation on the data to obtain the plurality of linearly weighted values. The number of neurons at the input and output ends of the fully connected layer is not the same. For instance, if the data is in matrix form, the number of neurons at the input end of the fully connected layer can be the same as the number of rows in the data, and the number of neurons at the output end of the fully connected layer can be one.

[0036] The method for obtaining the multiple linear weighted values ​​by performing a linear transformation on the data through a fully connected layer can refer to the fully connected operation process in related technologies, and will not be repeated in this application.

[0037] In this embodiment, by performing a linear transformation on the data, the correlation between different elements in the data can be obtained, and the elements with a greater or lesser impact on classification can be identified. This allows for the assignment of a corresponding linear weighting value to each element based on its influence on the data classification; for example, elements with a greater impact on classification can be assigned a higher linear weighting value, while elements with a lesser impact can be assigned a lower linear weighting value. Therefore, elements with a greater impact on classification become more significant compared to those with a smaller impact, enabling the classification process to focus more on the elements with a greater impact on classification, thereby improving classification accuracy.

[0038] S12, normalize each of the linear weighted values ​​to obtain normalized weighted values.

[0039] In some embodiments of this application, the electronic device can normalize each of the linear weighted values ​​according to a normalization function to obtain a normalized weighted value. The normalization function can be softmax, etc.

[0040] The electronic device can determine the normalized weighted value corresponding to each element based on the first index corresponding to each element in the data, multiply each element by the corresponding normalized weighted value to obtain the multiplied data corresponding to each element, and add the multiplied data with the same second index in the second dimension to obtain multiple weighted data.

[0041] Since the normalized weighted value is obtained by normalizing the linear weighted value, each normalized weighted value has a corresponding first index in the first dimension. For example, continuing with the above embodiment, if the first dimension is a column, then each column has a corresponding normalized weighted value.

[0042] For example, the normalized weighted value corresponding to the first index of each element can be determined as the normalized weighted value corresponding to each element. For instance, for each element in the first column of the data, the normalized weighted value corresponding to the first column can be determined as the normalized weighted value corresponding to each element in the first column; similarly, for each element in the second column of the data, the normalized weighted value corresponding to the second column can be determined as the normalized weighted value corresponding to each element in the second column. The normalized weighted value corresponding to the second index of each element can be the normalized weighted value corresponding to the row containing that element. Multiplied data with the same second index in the second dimension can be multiplied data from the same row. Summing the multiplied data from each row yields the weighted data corresponding to that row; thus, multiple weighted data can be obtained from multiplied data from multiple rows.

[0043] In this embodiment, normalizing the linear weighted values ​​can unify the scale of the linear weighted values, thereby eliminating the influence of different scales on classification and further improving classification accuracy.

[0044] This application also provides a data classification method that can accurately capture the feature data that has a significant impact on classification among the weighted data features, thereby ensuring the accuracy of data category classification. For example... Figure 2 The diagram shown is a flowchart of a data classification method provided in an embodiment of this application. Depending on different needs, the order of the steps in this flowchart can be adjusted according to actual requirements, and some steps can be omitted. The data classification method is applied to electronic devices, such as… Figure 7 The electronic device 10 shown.

[0045] S21, acquire time series data.

[0046] In some embodiments of this application, time-series data can be data that changes over time. This time-series data can include biomedical data, industrial production data, and weather data, etc., and this application does not limit the specific type of time-series data. For example, biomedical data can be electrocardiogram (ECG) data or electroencephalogram (EEG) data. Industrial production data can be data on machine operating status and product output that changes over time.

[0047] Taking electrocardiogram (ECG) signal data as an example, ECG signal data consists of a series of waveform signals that change over time; therefore, ECG signal data can be considered time-series data. Figure 3 The diagram shown is a schematic representation of electrocardiogram (ECG) signal data provided in an embodiment of this application. Electronic devices can acquire ECG signal data in various ways, and this application does not limit the method of acquiring ECG signal data.

[0048] For example, an electronic device can acquire electrocardiogram (ECG) signal data from an ECG monitoring device that is communicatively connected to the electronic device. The ECG monitoring device is a device that monitors the electrical activity of the heart, such as a wearable ECG wristband. The ECG monitoring device can collect ECG signal data from a living organism, which can be a human or an animal, according to a preset sampling frequency and a preset sampling duration. The sampling frequency and sampling duration can be customized, and this application does not limit them. For example, the sampling frequency can be 250Hz and the sampling duration can be 30s. Collecting data at a sampling frequency of 250Hz and a sampling duration of 30s can yield ECG signal data with a sequence length of 7500 = 250 * 30.

[0049] The above examples of methods for acquiring electrocardiogram (ECG) signal data are merely illustrative of methods for acquiring time-series data. In practical applications, the methods for acquiring time-series data are not limited to these examples. For instance, electronic devices can also acquire time-series data from a pre-set database.

[0050] S22 performs compression operations on the time-series data to obtain compressed data.

[0051] In some embodiments of this application, a data compression network in a data classification model can be used to compress time-series data. The data classification model can be trained using labeled training data, which can be time-series data such as electrocardiogram (ECG) signals.

[0052] Time-series data can include original data X ordered by time. Each compressed data Y can have a corresponding data set, and the data set corresponding to each compressed data Y can include multiple original data X ordered by time. The size of the data set corresponding to each compressed data can be controlled by a window value w. The data sets corresponding to two adjacent compressed data are interconnected. The size of the data set can be the number of original data included in that data set. In each data set, the first original data in the sorted order is the first data. The first data in interconnected data sets are separated by N original data, where N can be controlled by an interval value d. The N original data separated by the first data in interconnected data sets can be overlapping original data between the two interconnected data sets.

[0053] In some embodiments of this application, the data compression network may include multiple network modules, and the network parameters of each network module may include a stride and a kernel size. The window value may be determined by the kernel size of the multiple network modules, and the interval value d may be determined by the stride of the multiple network modules. For example, the window value w is proportional to the kernel size of the multiple network modules, and the interval value d is proportional to the stride of the multiple network modules.

[0054] For example, the method for determining the data set corresponding to each compressed data can refer to the following formula (1):

[0055]

[0056] Where Y represents compressed data, and t represents the t-th data point. The {} represents the corresponding data set, X represents the original data, w represents the window value, d represents the interval value, and T represents the sequence length of the compressed data.

[0057] like Figure 4 The diagram shown is a schematic representation of timing data compression provided in an embodiment of this application. Figure 4 In the sequence, time-series data X of length n includes X1 to X... n Given a set of original data, time-series data (e.g., electrocardiogram signal data) can be compressed using a data compression network to obtain compressed data Y of sequence length T, where Y includes Y1 to Y2. T The compressed data is determined by the network parameters of the data compression network, where the window value w = 4 and the interval value d = 2. It can be determined by formula (1) that the data set corresponding to Y1 includes the original data X1 to X4, the data set corresponding to Y2 includes the original data X3 to X6, the data set corresponding to Y3 includes the original data X5 to X8, and so on. The data set corresponding to each compressed data can be determined.

[0058] In some embodiments of this application, the sequence length of the compressed data is T = n / c, where n represents the number of original data in the time series data and c represents the compression ratio.

[0059] In this compression network, the compression ratio *c* is inversely proportional to the interval *d*. The compression ratio *c* can be determined by the stride of each network module in the compression network. For example, if the data compression network contains three network modules with strides *S1*, *S2*, and *S3*, then the relationship between the compression ratio *c* and the stride of the network modules can be expressed as: [Compression ratio *c*...]

[0060] In some embodiments of this application, in order to preserve the temporal characteristics of compressed data, it is necessary to ensure that the compressed data has temporal sequence. The temporal sequence of compressed data can be determined by the temporal sequence degree, and the compressed data with a higher temporal sequence degree has better temporal sequence.

[0061] For example, an electronic device can calculate the difference between the window value and the interval value to obtain the intersection difference, and calculate the quotient of the intersection difference and the window value to obtain the temporal sequence degree corresponding to the compressed data.

[0062] For example, the calculation method for the temporal degree of compressed data can refer to the following formula (2):

[0063] TS degree = (wd) / w; (2)

[0064] Where TS degree represents the time series degree, w represents the window value, and d represents the interval value.

[0065] In some embodiments of this application, the timing degree (TS degree) is greater than 0.7.

[0066] In some embodiments of this application, the data compression network can be a convolutional neural network, and the multiple network modules in the data compression network can include network modules such as convolutional layers, pooling layers, and residual network layers. For example, the convolutional layer can be a one-dimensional convolutional layer (conv1D), and the pooling layer can be a one-dimensional max pooling layer (MaxPool1D). The residual network layer includes multiple residual modules, each residual module including multiple convolutional layers with skip connections or residual connections. This application does not limit the number of residual modules or the number of convolutional layers in each residual module. The above examples of the structure of the data compression network are merely illustrative and do not constitute a limitation on the data compression network.

[0067] In other embodiments, the data compression network may include more or fewer network layers. For example, convolutional layers and pooling layers may be connected by cascaded batch normalization layers and activation function layers. Each convolutional layer in the residual module may be followed by a batch normalization layer, or a batch normalization layer and an activation function layer. For example, the activation function layer may be a rectified linear unit (ReLU).

[0068] Taking a data compression network, which includes convolutional layers, pooling layers, and residual network layers, as an example, electronic devices use a data compression network to compress time-series data to obtain compressed data. This process involves: using convolutional layers to perform convolutional processing on the time-series data to obtain convolutional feature maps; using pooling layers to perform pooling processing on the convolutional feature maps to obtain pooled feature maps; inputting the pooled feature maps into the residual network layers to obtain residual feature maps output by each of the multiple residual modules; wherein, the residual feature maps output by the preceding residual modules are used as feature maps input to the following residual modules; and the residual feature map output by the last residual module is determined as the compressed data.

[0069] Each residual module includes multiple convolutional layers. The feature map output by each convolutional layer is obtained by convolving the input feature map. The feature map output by the preceding convolutional layer serves as the input feature map to the following convolutional layer. The residual feature map output by each residual module is obtained by fusing the feature map input to the first convolutional layer with the feature map output by the last convolutional layer. This application does not limit the method of feature fusion. For example, the method of feature fusion between the feature map input to the first convolutional layer and the feature map output by the last convolutional layer can be to add the feature values ​​at corresponding positions between the feature map input to the first convolutional layer and the feature map output by the last convolutional layer.

[0070] In this embodiment, the network parameters of the data compression network can control the window value and the spacing value. The window value controls the size of the data set corresponding to each compressed data set in the time series, and the spacing value controls the amount of overlapping original data between related data sets. By controlling the size of the data set corresponding to each compressed data set in the time series and the amount of overlapping original data between related data sets, the temporality of the compressed data can be controlled, thereby ensuring the temporality of the compressed data.

[0071] S23, perform feature extraction operations on the compressed data to obtain the target data features.

[0072] In some embodiments of this application, the electronic device can utilize the feature extraction network in the data classification model to perform feature extraction operations on compressed data to obtain target data features.

[0073] The feature extraction network can be a convolutional network, and the feature extraction operation can be a convolution operation. For example, the feature extraction network can be LeNet-5, AlexNet, VGGNet, Inception, etc. Alternatively, the feature extraction network can also be a variant of a convolutional neural network, where the variant of the convolutional neural network can be a recurrent neural network (RNN) or a variant of a recurrent neural network, and the feature extraction operation can be a recurrent convolution operation. Variants of recurrent neural networks can be Long Short-Term Memory (LSTM), Gated Recurrent Unit (GRU), and Bidirectional Gated Recurrent Unit (BiGRU), etc. To more clearly illustrate the data classification method provided in this application embodiment, the following description will use the bidirectional gated recurrent unit module as an example.

[0074] The bidirectional gated recurrent unit module includes a forward-gated recurrent unit and a backward-gated recurrent unit. The forward-gated recurrent unit includes multiple first hidden neurons, and the backward-gated recurrent unit includes multiple second hidden neurons. The electronic device performs convolution operations on the compressed data within the compressed data according to a data classification model to obtain target data features. This includes: reversing the sorting of the compressed data to obtain reverse-order compressed data; inputting the compressed data into the forward-gated recurrent unit to obtain multiple first data features output by each first hidden neuron; inputting the reverse-order compressed data into the backward-gated recurrent unit to obtain multiple second data features output by each second hidden neuron; and concatenating the first and second data features to obtain the target data features. The target data features contain multiple feature data, which can be represented as a two-dimensional matrix, where feature data in the same column of the matrix corresponds to the same compressed data.

[0075] The methods for generating the first data feature and the second data feature can refer to the methods for calculating the hidden state through the gating mechanism in the bidirectional gating loop unit in related technologies, and will not be described in detail in this application.

[0076] For example, following the above embodiment, if the compressed data is Y = (Y (1) ,Y (2) ,…,Y (T) If the reverse sorting yields the reverse-order compressed data, then Y′=(Y (T) ,Y (T-1) ,…,Y (1) The multiple first data features output from multiple compressed data in the compressed data of each first hidden neuron needle can be Z′ = (Z (1) Z (2) ,…,Z (T) Each second hidden neuron outputs multiple second data features for the compressed data in the reverse-order compressed data, which can be Z″ = (Z (T) Z (T-1) ,…,Z (1) By concatenating these components, the target data feature Z can be obtained. If the number of the first hidden neuron and the second hidden neuron are both H, the target data feature Z can be represented as a 2H×T two-dimensional matrix, and the feature data in the i-th row and j-th column of the target data feature Z can be represented as Zi. i,j , i=1,2…2H, j=1,2…T.

[0077] For example, the target data features can be represented by a matrix as shown in the following formula (3):

[0078]

[0079] Where Z represents the target data feature.

[0080] In this embodiment, the bidirectional gated recurrent unit can capture forward dependencies in time-series data from compressed data and backward dependencies in time-series data from reverse-order compressed data. This bidirectional processing allows the bidirectional gated recurrent unit to capture target data features in time-series data more comprehensively and effectively, thereby improving the accuracy of subsequent classification networks.

[0081] S24, perform weight calculations on the target data features to obtain a weight vector.

[0082] In some embodiments of this application, the electronic device can use the attention module in the data classification model to perform weight calculations on the target data features to obtain a weight vector.

[0083] The attention module may include a linear layer and / or a normalization function. For example, the linear layer may be a fully connected layer, and the normalization function may be a softmax function.

[0084] The method for using the attention module to perform weight calculations on the target data features to obtain a weight vector can be found in the description of the method for generating linear weighted values ​​in step S11. For example, if the attention module includes a fully connected layer and a normalization function, the electronic device uses the attention module to perform weight calculations on the target data features to obtain a weight vector. This includes: using the fully connected layer to perform a linear transformation on each column of feature data in the target data features to obtain the original score corresponding to each column of feature data; using the normalization function to normalize the original score corresponding to each column of feature data to obtain the weight corresponding to each column of feature data; and arranging the weights corresponding to each column of feature data in sequence to obtain a weight vector, where the weight vector is a one-dimensional array and includes weights that correspond one-to-one with each column of feature data in the target data features.

[0085] For example, following the above embodiments, if the target data features are a 2H×T matrix as shown in formula (3), such as Figure 5 The diagram shown is a schematic representation of weight calculation provided in an embodiment of this application. Figure 5 In this process, the j-th column of feature data is selected from the target data feature Z as shown in formula (3). The selected feature data in column j is input into the fully connected layer to obtain the original score f corresponding to the feature data in column j. j Since j = 1, 2, ..., T, we can obtain the original scores f1 corresponding to the first column of feature data, f2 corresponding to the second column of feature data, ..., f3 corresponding to the Tth column of feature data. T f1, f2...f TBy inputting into the softmax layer, we can obtain the weights W1 corresponding to the first column of feature data in the target data, W2 corresponding to the second column of feature data, ..., W1 corresponding to the Tth column of feature data. T To facilitate calculations with the target data features in the following text, W1, W2...W T Arrange them sequentially in a column to obtain a weight vector of shape T×1.

[0086] In some embodiments of this application, the fully connected layer may include neurons at the input end, hidden layers, and neurons at the output end, and the number of neurons at the input end of the fully connected layer is different from the number of neurons at the output end. For example... Figure 6 The diagram shown is a schematic representation of a neuron in a fully connected layer according to an embodiment of this application. Figure 6 In this fully connected layer, there are 2H neurons at the input end and 1 neuron at the output end, which enables the conversion of 2H feature data in each column of the target data into a raw score f.

[0087] Considering that directly inputting the target data features into the classification network of a data classification model would make it difficult for the network to capture the features that have a significant impact on classification, this embodiment utilizes a fully connected layer to perform a linear transformation on each column of feature data in the target data. This allows the network to learn the relationships between different features in the target data, thus identifying the features that have a greater or lesser impact on classification. Consequently, higher weights can be assigned to the features with a greater impact on classification in the weight vector, while lower weights can be assigned to the features with a lesser impact.

[0088] S25, perform a weighted operation on the weight vector and the target data features to obtain the weighted data features.

[0089] In some embodiments of this application, the electronic device uses a weighting module to multiply the target data features and the weight vector to obtain weighted data features.

[0090] The method for weighting the weight vector and the target data feature can be found in the description of the generation method for multiplied data and weighted data in step S12. For example, the electronic device can multiply the target data feature Z of shape 2H×T with the weight vector W of shape T×1 to obtain a vector Q of shape 2H×1. Transposing vector Q can then yield the weighted data feature K.

[0091] For example, the calculation method for vector Q can refer to the following formula (4), and the calculation method for weighted data feature K can refer to the following formula (5):

[0092]

[0093] In this embodiment, since the feature data that has a greater impact on classification has a higher weight in the weight vector, and the feature data that has a smaller impact on classification has a lower weight in the weight vector, multiplying the target data features and the weight vector can optimize the target data features. For example, it can strengthen the feature data that has a greater impact on classification and weaken the feature data that has a smaller impact on classification, thereby obtaining weighted data features.

[0094] S26. Classify the weighted data features to obtain data categories.

[0095] In some embodiments of this application, the electronic device can utilize a classification network to classify weighted data features and obtain data categories. The classification network may include linear layers and a normalization function. For example, the linear layer in the classification network can be a fully connected layer, and the normalization function can be a softmax function. For instance, if the time-series data is electrocardiogram (ECG) signal data, the data category can be a cardiac rhythm state category such as normal sinus rhythm, atrial fibrillation, and premature ventricular contractions; if the time-series data is electroencephalogram (EEG) data, the data category can be a state category such as awake, deep sleep, and light sleep; if the time-series data is weather data, the data category can be a weather state category such as sunny, cloudy, and rainy.

[0096] Electronic devices use a classification network to classify weighted data features to obtain data categories, including: using a classification network to map weighted data features to multiple preset categories, obtaining the confidence level of time series data corresponding to each preset category, and determining the data category from multiple preset categories based on the confidence level.

[0097] The multiple preset categories can be customized based on the time-series data, and this application does not impose any restrictions on this. For example, if the time-series data is electrocardiogram (ECG) signal data, the multiple preset categories may include: normal sinus rhythm, atrial fibrillation, and premature ventricular contractions, etc.; if the time-series data is weather data, the multiple preset categories may include: sunny, cloudy, rainy, etc. The data category can be the preset category corresponding to the highest confidence level. The calculation method for the time-series data corresponding to each preset category can be found in the description of the weight vector calculation method in step S24, and will not be repeated in this application.

[0098] In this embodiment, since the weighted data features are obtained by strengthening the feature data that has a greater impact on classification in the target data features and weakening the feature data that has a smaller impact on classification in the target data features, the feature data that has a greater impact on classification is more significant in the weighted data features compared to the feature data that has a smaller impact on classification. Therefore, the classification network can accurately capture the feature data that has a greater impact on classification in the weighted data features, thereby ensuring the accuracy of the classification of data categories.

[0099] In other embodiments of this application, the electronic device can use a classification network to classify target data features and obtain data categories. The method for classifying target data features using a classification network can be found in the description of the weight vector calculation method in step S24, and will not be repeated here.

[0100] like Figure 7 The diagram shown is a structural schematic of an electronic device provided in one embodiment of this application. The electronic device 10 can be a computer, tablet computer, laptop computer, mobile phone, server, or other electronic device. This application embodiment does not impose any restrictions on the specific type of electronic device.

[0101] exist Figure 7 The electronic device 10 may include a communication module 101, a memory 102, a processor 103, an input / output (I / O) interface 104, and a bus 105. The processor 103 is coupled to the communication module 101, the memory 102, and the input / output interface 104 via the bus 105.

[0102] Communication module 101 may include a wired communication module and / or a wireless communication module. The wired communication module may provide one or more wired communication solutions such as Universal Serial Bus (USB) and Controller Area Network (CAN). The wireless communication module may provide one or more wireless communication solutions such as Wireless Fidelity (Wi-Fi), Bluetooth (BT), mobile communication networks, Frequency Modulation (FM), Near Field Communication (NFC), and Infrared (IR).

[0103] Memory 102 may include one or more random access memory (RAM) and one or more non-volatile memory (NVM). The RAM can be directly read and written by the processor 103, and can be used to store executable programs (e.g., machine instructions) of other running programs, as well as user and application data. The RAM may include static random-access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), etc.

[0104] Non-volatile memory can also store executable programs and user and application data, and can be pre-loaded into random access memory for direct reading and writing by the processor 103. Non-volatile memory can include disk storage devices and flash memory. For example, flash memory can be Nand Flash.

[0105] Memory 102 is used to store one or more computer programs. The one or more computer programs are configured to be executed by processor 103. The one or more computer programs include multiple instructions that, when executed by processor 103, can implement a weighting method or a data classification method that is executed on electronic device 10.

[0106] In other embodiments, such as Figure 7 The electronic device 10 shown also includes an external memory interface for connecting to an external memory to expand the storage capacity of the electronic device 10.

[0107] Processor 103 may include one or more processing units, such as application processors (APs), modem processors, graphics processing units (GPUs), image signal processors (ISPs), controllers, video codecs, digital signal processors (DSPs), and / or neural network processing units (NPUs). These different processing units may be independent devices or integrated into one or more processors.

[0108] The processor 103 provides computing and control capabilities. For example, the processor 103 is used to execute computer programs stored in the memory 102 to implement the weighting method or data classification method described above.

[0109] The input / output interface 104 is used to provide a channel for user input or output. For example, the input / output interface 104 can be used to connect various input / output devices, such as a mouse, keyboard, touch device, display screen, etc., so that users can enter information or visualize information.

[0110] Bus 105 is used at least to provide a channel for communication between communication modules 101, memory 102, processor 103, and input / output interface 104 in electronic device 10.

[0111] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 10. In other embodiments of this application, the electronic device 10 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0112] This application also provides a computer-readable storage medium storing a computer program, which includes program instructions. When the program instructions are executed, the method implemented can refer to the methods in the above embodiments of this application.

[0113] The computer-readable storage medium can be the internal memory of the electronic device described in the above embodiments, such as the hard disk or memory of the electronic device. Alternatively, the computer-readable storage medium can be an external storage device of the electronic device, such as a plug-in hard disk, smart media card (SMC), secure digital card (SD), flash card, etc., installed on the electronic device.

[0114] In some embodiments, a computer-readable storage medium may include a stored program area and a stored data area, wherein the stored program area may store an operating system, an application program required for at least one function, etc.; and the stored data area may store data created based on the use of the electronic device, etc.

[0115] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and other division methods may be used in actual implementation.

[0116] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0117] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in the form of hardware plus software functional modules.

[0118] Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of this application is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be embraced within this application. No appended diagram markings in the claims should be construed as limiting the scope of the claims.

[0119] Furthermore, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices described in this application may also be implemented by a single unit or device through software or hardware. The terms "first," "second," etc., are used to indicate names and do not indicate any specific order.

[0120] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application and are not intended to limit it. Although this application has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of this application without departing from the spirit and scope of the technical solutions of this application.

Claims

1. A weighting method, characterized in that, The weighting method includes: Perform preset operations on the data to obtain multiple linearly weighted values; Each of the linear weighted values ​​is normalized to obtain a normalized weighted value; The preset operation includes a linear transformation; The data includes multiple elements.

2. The weighting method as described in claim 1, characterized in that, The data has multiple dimensions, including a first dimension. Each element in the data has a corresponding first index on the first dimension. The preset operation further includes: Multiple sequences are extracted from the data, wherein each sequence comprises multiple elements in the data that have the same first index; A linear transformation is performed on each sequence to obtain a linear weighted value corresponding to each of the first indices.

3. The weighting method as described in claim 2, characterized in that, The weighting method also includes: Based on the first index corresponding to each element in the data, the normalized weighted value corresponding to each element is determined, and each element is multiplied by the corresponding normalized weighted value to obtain the multiplied data.

4. The weighting method as described in claim 3, characterized in that, The plurality of dimensions further includes a second dimension, wherein each element has a corresponding second index in the second dimension, and the weighting method further includes: The multiplied data with the same second index in the second dimension are added together to obtain multiple weighted data.

5. The weighting method as described in claim 1, characterized in that, The weighting method also includes: The data is linearly transformed using a fully connected layer to obtain the multiple linearly weighted values.

6. The weighting method as described in claim 5, characterized in that, The number of neurons at the input and output ends of the fully connected layer is not the same.

7. A data classification method, characterized in that, The data classification method includes: Acquire time series data; The time-series data is compressed to obtain compressed data, which includes multiple compressed data items arranged in time. Feature extraction operations are performed on the compressed data to obtain the target data features; The target data features are weighted using the weighting method as described in any one of claims 1 to 6 to obtain weighted data features. The weighted data features are classified to obtain data categories.

8. The data classification method as described in claim 7, characterized in that, The feature extraction operation is a circular convolution operation.

9. An electronic device, characterized in that, The electronic device includes: Memory, storing at least one instruction; and The processor executes the at least one instruction to implement the weighting method as described in any one of claims 1 to 6 or the data classification method as described in any one of claims 7 to 8.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the weighting method as described in any one of claims 1 to 6 or the data classification method as described in any one of claims 7 to 8.