Model training method, user identification method and electronic equipment
By converting user timing data into image data and combining convolution module and attention mechanism, the problem of insufficient feature extraction capability caused by the shallow network of existing models is solved, and the accuracy and classification effect of user classification models are improved, especially in Areas with strong individual differences.
Patent Information
- Application Number
- CN202410908992.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-08
- Publication Date
- 2024-11-01
AI Technical Summary
The existing machine learning model network is too shallow and the feature extraction ability is weak, resulting in poor classification effect of user classification models in catering, shopping malls and other fields, especially the individual differences in user data, unclear display of subject features, interfering with model training, resulting in Classification results are misleading.
Convert user timing data into image data, train the model through the convolution module and attention mechanism module, highlight data time characteristics and correlation information, improve feature extraction capabilities, use the Gram angle field method to convert one-dimensional data into two-dimensional data, enriching Characteristic expression.
It improves the accuracy and classification effect of the user classification model, can better display the user subject feature correlation, enhance the model's feature extraction ability, and improve the accuracy of user identification.
Smart Images

Figure CN118887448A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a model training method, a user identification method and an electronic device. Background Art
[0002] With the rapid development of machine learning and deep learning, some fields, such as catering and shopping malls, use machine learning methods to mine user personal data features and build user group classification models. However, the current machine learning model network is too shallow and the feature extraction ability is weak, resulting in poor classification results of the trained classification model. Summary of the invention
[0003] The purpose of this application is to provide a model training method, a user identification method and an electronic device, which can improve the accuracy of model user classification.
[0004] In a first aspect, the present invention provides a model training method, comprising: for each user time series data in a user time series data set, converting the user time series data into user image data to obtain a user image data set, wherein one piece of the user image data is used to characterize feature information of a user; inputting the user image data set into an initial classification model for training to obtain a user classification model.
[0005] In the above implementation, by converting the user time series data representing user characteristics into two-dimensional image data, the temporal characteristics of the data can be better highlighted and the data ontology characteristics can be enriched, so that the user classification model trained based on the image data can more accurately realize user identification.
[0006] In an optional implementation, the user time series data is one-dimensional user data; converting the user time series data into user image data includes: calculating each two-dimensional image pixel value based on the element value in the one-dimensional user data to obtain the user image data.
[0007] In an optional embodiment, the method of calculating each two-dimensional image pixel value based on the element value in the one-dimensional user data to obtain user image data includes: converting the one-dimensional user data into two-dimensional data; mapping each element in the two-dimensional data to a specified interval to obtain an intermediate value; calculating the intermediate value to obtain a pixel value at each position to obtain user image data.
[0008] In the above implementation, converting one-dimensional data into two-dimensional data can enable user characteristics to be presented more comprehensively.
[0009] In an optional embodiment, converting the one-dimensional user data into two-dimensional data includes: determining the element in the i-th row and j-th column based on the i-th element and the j-th element in the one-dimensional user data to obtain two-dimensional data corresponding to the user time series data, wherein i and j are both positive integers.
[0010] In an optional embodiment, the initial classification model includes: multiple convolution modules, one or more attention mechanism modules, and one or more fully connected layers; wherein the attention mechanism module is arranged between two adjacent convolution modules; and the output data of the last convolution module among the multiple convolution modules is used as input data of the one or more fully connected layers.
[0011] In the above implementation, an attention mechanism can be added to it, and a feature recalibration strategy can be used to strengthen important channel features, so that the model can capture the global correlation information between pixels on the basis of capturing local features, thereby improving the model's feature extraction capability and network classification performance.
[0012] In an optional embodiment, the attention mechanism module includes: at least two convolution units, a compression unit connected to the convolution unit, an excitation unit connected to the compression unit, and an activation unit connected to the excitation unit.
[0013] In an optional embodiment, each of the convolution modules includes at least two identical convolution layers.
[0014] In the above implementation, each convolution module is provided with at least two identical convolution layers, which can better extract features, and thus make the obtained user classification model more accurate.
[0015] In a second aspect, the present invention provides a user identification method, comprising: converting user data to be identified into image data to be identified; inputting the image data to be identified into a user classification model for classification to obtain a user category of a user corresponding to the user data to be identified, wherein the user classification model is trained using the model training method described in any one of the aforementioned embodiments.
[0016] In a third aspect, the present invention provides an electronic device, comprising: a processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the machine-readable instructions are executed by the processor to perform the steps of the method described in any one of the aforementioned embodiments.
[0017] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the method described in any one of the aforementioned embodiments are executed.
[0018] In a fifth aspect, the present invention provides a computer program product, wherein the computer program product comprises a computer program, and when the computer program is executed by a processor, the method described in any one of the aforementioned embodiments is implemented. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0020] Figure 1 A schematic diagram of the interaction between the server and the terminal device provided in the embodiment of the present application;
[0021] Figure 2 A block diagram of an electronic device provided in an embodiment of the present application;
[0022] Figure 3 A flowchart of a model training method provided in an embodiment of the present application;
[0023] Figure 4 A schematic diagram of the model structure used in the model training method provided in the embodiment of the present application;
[0024] Figure 5 A schematic diagram of a part of the model structure used in the model training method provided in the embodiment of the present application;
[0025] Figure 6 A flowchart of a user identification method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0026] The technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings in the embodiments of the present application.
[0027] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0028] At present, the potential of data is constantly being explored by scholars, and the development trend of deep learning technology is changing with each passing day. Deep learning models represented by AlexNet, VGG16, and VGG19 have been widely used in the field of big data analysis. Big data analysis technology is applied in the field of business decision-making to classify users by analyzing customer data.
[0029] Manufacturers often use deep learning methods to mine the characteristics of user personal data and build user group classification models. However, the current deep learning model network is too shallow, the feature extraction ability is weak, and the classification effect is often unsatisfactory. Deep learning models are mostly based on AlexNet, VGG16, and VGG19, which show good performance in multi-classification tasks. However, for some fields with a wide range of users, such as catering, shopping malls and other industries, the customer population is complex and diverse, and the user data in these fields is full of individual difference characteristics. Individual difference characteristics can easily interfere with model training and mislead classification results. However, the main problems in this field are as follows: user data has strong individual differences, and the main features are not clearly displayed; the classic deep learning model has insufficient feature extraction capabilities, resulting in poor performance of the obtained user classification model.
[0030] Based on the above research, the embodiments of the present application can provide a model training method, a user identification method and an electronic device, which can convert user time series data into image data, better display the relationship between subject features, and improve the user classification effect of the deep learning model.
[0031] To facilitate understanding of this embodiment, the operating environment of a model training method and a user identification method disclosed in the embodiment of the present application is first introduced.
[0032] like Figure 1 , which is a schematic diagram of the interaction between the server 110 and the terminal device 120 provided in an embodiment of the present application. The server 110 is connected to one or more terminal devices 120 through a network for data communication or interaction. The server 110 may be a network server, a database server, etc. The terminal device 120 may be a server device. The terminal device 120 may be a personal computer (PC), a tablet computer, a smart phone, a personal digital assistant (PDA), etc.
[0033] In this embodiment, the server 110 may be used to receive user data sent by each terminal device 120, and implement user classification model training based on the user data. The user classification model may be used to implement user classification.
[0034] The terminal device 120 may be a device of each participant participating in the user classification model training. The terminal device 120 may store user data of each participant. For different application scenarios, each participant is different, and the content of the user data contained by each participant is also different. The participant may provide user data for use by the server to train the model.
[0035] Taking the dining scenario as an example, each participant can be an independent restaurant, a chain restaurant, etc. The user data of the participant can include information such as user ID, user dining frequency, user dining type, dining price, dining distance, etc. Taking the shopping mall scenario as an example, each participant can be a shopping mall in different geographical locations, shopping malls of different brands, shopping malls in different cities, etc. The user data of the participant can include information such as user ID, user shopping frequency, user shopping price range, etc.
[0036] like Figure 2 , which is a block diagram of an electronic device. The electronic device 200 may include a memory 211 and a processor 213. A person skilled in the art may understand that Figure 2 The structure shown is only for illustration and does not limit the structure of the electronic device 200. For example, the electronic device 200 may further include Figure 2 More or fewer components as shown, or with Figure 2 Different configurations are shown.
[0037] The above-mentioned memory 211 and processor 213 are electrically connected to each other directly or indirectly to realize data transmission or interaction. For example, these elements can be electrically connected to each other through one or more communication buses or signal lines. The above-mentioned processor 213 is used to execute the executable module stored in the memory.
[0038] The memory 211 may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), etc. The memory 211 is used to store programs, and the processor 213 executes the program after receiving the execution instruction. The method executed by the electronic device 200 defined by the process disclosed in any embodiment of the present application can be applied to the processor 213, or implemented by the processor 213.
[0039] The processor 213 may be an integrated circuit chip with signal processing capability. The processor 213 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), a dedicated integrated circuit, or a processor.
[0040] (Application Specific Integrated Circuit, referred to as ASIC), Field Programmable Gate Array (Field Programmable Gate Array, referred to as FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc.
[0041] In this embodiment, the above Figure 1 The server 110 and the terminal device 120 in the operating environment shown may include the Figure 2 The components included in the electronic device 200 shown in FIG. 1 . Of course, based on different actual needs, the server 110 may also include more components than the electronic device 200, for example, the server 110 may also include a communication unit. The terminal device 120 may also include more components than the electronic device 200, for example, the terminal device 120 may also include a display unit, a positioning unit, a communication unit, and other components.
[0042] The electronic device 200 in this embodiment can be used to execute each step in each method provided in the embodiments of the present application. The implementation process of the model training method and the user identification method is described in detail below through several embodiments.
[0043] See also Figure 3 , is a flow chart of the model training method provided in the embodiment of the present application. The model training method provided in the embodiment of the present application can be applied to a server, and the steps in the model training method are executed by the server. Figure 3 The specific process shown is described in detail.
[0044] Step 310 : for each user time series data in the user time series data set, convert the user time series data into user image data to obtain a user image data set.
[0045] Among them, one piece of user image data is used to represent the characteristic information of a user.
[0046] Optionally, in this embodiment, each user time series data may be provided by each participant. The terminal device of each participant may collect its original user data and perform preprocessing to obtain the user time series data.
[0047] Optionally, each participant may also provide original user data, which is transmitted to the server through the participant's terminal device, and the server performs preprocessing to obtain user time series data.
[0048] Exemplarily, the above-mentioned preprocessing may include data cleaning, data patching and data normalization.
[0049] The data cleaning can be to remove useless data from the collected original user data. The useless data can be data that is not helpful for training. Exemplarily, the useless data can be pre-set. Taking the dining scene as an example, the useless data can be the length of time the user queues for dining and the length of time the user eats. Exemplarily, the useless data can also be incomplete data, for example, some user data that only contains partial information. For example, a piece of user data does not contain a user ID, but only contains a user's consumption situation once.
[0050] Data patching can be used to patch some incomplete data. For example, for some data with missing information, specified content can be used to fill it. For example, if a user identifier in a user data is missing, it can be filled with the identifier specified content, and the identifier specified content can be two digits. For example, the identifier specified content can be 00. Of course, depending on the actual scenario, the user data can include more information, and the specified content used to fill each information can be preset.
[0051] The data normalization process may map each element in the user data to a specified numerical interval, for example, the specified numerical interval may be the interval [0, 1].
[0052] In this embodiment, the user time series data may be mapped into a two-dimensional space, and the element values obtained in each two-dimensional space may be used as pixels to obtain the user image data.
[0053] In this embodiment, the conversion in step 310 is performed on each item of user time series data to obtain user image data corresponding to each item of user time series data.
[0054] Exemplarily, the above-mentioned user time series data can be a one-dimensional vector obtained after feature conversion of the preprocessed original user data. The original user data may include a user identifier and user behavior data, and the user identifier may be a user name, a user ID number, a user mobile phone number, etc. The user behavior data may represent the personalized behavior of the user. Based on different application scenarios, the user behavior data of the original user data contains different contents. For example, in a dining scenario, the user behavior data may include the user's dining frequency, the user's dining type, the dining price, the dining distance, etc. For another example, in a shopping mall scenario, the user behavior data of the original user data may include the user's shopping frequency and the user's shopping price range.
[0055] Step 320: input the user image data set into an initial classification model for training to obtain a user classification model.
[0056] Optionally, each item of user image data may be provided with a label, and the user image data set is input into an initial classification model for supervised training to obtain a user classification model.
[0057] The conditions for the end of training can be set in advance. The conditions for the end of training can be that the number of training times reaches a preset number of times; or that the error obtained from training is less than a preset threshold.
[0058] Optionally, the user image data set can be divided into a training image set and a verification image set. The training image set is used to train the initial classification model to adjust the parameters in the initial classification model. The verification image set can be used to verify the accuracy of the trained model.
[0059] The user classification model can calculate the received user data to obtain the category of the user corresponding to the received user data. Taking the dining scene as an example, the user category can be a category based on the amount of consumption, a category based on the type of food, or a category based on the dining place. Of course, based on different actual application scenarios, the user categories divided are also different. For example, taking the financial industry as an example, the user category can be a category based on the investment amount, or a category based on the investment risk level, etc.
[0060] Through the above method, time series data can be converted into image data that can better represent information, highlight the time characteristics of the data, and enrich the data ontology characteristics, so that the user classification model trained based on image data can better realize user classification.
[0061] In this embodiment, the user time series data may be one-dimensional user data; the above step 310 may include calculating each two-dimensional image pixel value based on the element value in the one-dimensional user data to obtain the user image data.
[0062] Alternatively, the one-dimensional user data may be converted into user image data using a Gram angular field method.
[0063] The above-mentioned method of calculating each two-dimensional image pixel value based on the element value in the one-dimensional user data to obtain the user image data includes: converting the one-dimensional user data into two-dimensional data; mapping each element in the two-dimensional data to a specified interval to obtain an intermediate value; calculating the intermediate value to obtain the pixel value of each position to obtain the user image data.
[0064] Exemplarily, the element in the i-th row and j-th column can be determined based on the i-th element and the j-th element in the one-dimensional user data to obtain two-dimensional data corresponding to the user time series data, where i and j are both positive integers.
[0065] The above steps can be achieved by the following formula:
[0066] x ij = x(i).x(j);
[0067] Among them, x(i) represents the i-th element in the user time series data, and x(j) represents the j-th element in the user time series data.
[0068] The above-mentioned specified interval may be an interval within an angle range, and the specified interval may be [0, π].
[0069] The above intermediate values can be calculated by the following formula:
[0070] θ ij =arccos(x ij ).
[0071] In this embodiment, the intermediate value can be converted into a pixel value interval, so that the pixel value of each position of the two-dimensional image can be obtained. The pixel value interval can be the interval [0, 1].
[0072] Exemplarily, calculating the intermediate values to obtain the pixel value at each position can be achieved by the following formula: ij =πθ ij .
[0073] The one-dimensional user time series data can be converted into a two-dimensional grayscale image in the above manner.
[0074] In order to make the obtained user classification model more accurate in classification, the initial training model can be designed so that it can better extract features. Figure 4As shown, the initial classification model includes: multiple convolution modules, one or more attention mechanism modules, and one or more fully connected layers.
[0075] Among them, the attention mechanism module is arranged between two adjacent convolution modules; the output data of the last convolution module among the multiple convolution modules is used as the input data of the one or more fully connected layers.
[0076] exist Figure 4 In the example shown, the initial training model includes three convolution modules, two attention mechanism modules, and two fully connected layers. Among them, the attention mechanism module is set between the two convolution modules, and the fully connected layer is set after the convolution module. Therefore, the data flow of the initial training model is the first convolution module Cm1, the first attention mechanism module Se1, the second convolution module Cm2, the second attention mechanism module Se2, the third convolution module Cm3, the first fully connected layer Fc1, and the second fully connected layer Fc2.
[0077] In this embodiment, each of the convolution modules includes at least two identical convolution layers. For example, each convolution module includes two identical convolution layers.
[0078] Optionally, the attention mechanism module may include: at least two convolution units, a compression unit connected to the convolution unit, an excitation unit connected to the compression unit, and an activation unit connected to the excitation unit.
[0079] like Figure 5 As shown, the attention mechanism module may include two convolution units (divided into cm1 and cm2), a compression unit Cu connected to the convolution unit, an excitation unit Iu connected to the compression unit, and an activation unit Au connected to the excitation unit. The data flow of the attention mechanism module is the first convolution unit cm1, the second convolution unit cm2, the compression unit Cu, the excitation unit Iu, and the activation unit Au.
[0080] In this embodiment, feature recalibration is achieved through compression, excitation, and reactivation to compensate for the limited receptive field of the convolution module and better capture global correlation information.
[0081] The attention mechanism module can compress global information into channels through global average pooling, which can be achieved through the following formula:
[0082]
[0083] Where z∈R c , z c represents the cth element of z, H and W represent the spatial dimensions of space U, and z cGenerated by contracting space U; u c (i, j) represents the input feature map, that is, the input data of the attention mechanism module.
[0084] Secondly, the channel dependency is captured by the compressed information, which can be achieved by the following formula:
[0085] s=F ex (z, W) = σ(g(z, W)) = σ(W 2 δ(W 1 z));
[0086] Among them, σ represents the sigmoid activation function, δ represents the ReLU activation function, and They represent the parameters of the dimensionality reduction layer and the dimensionality increase layer respectively, and r represents the dimensionality reduction ratio.
[0087] Finally, the output is rescaled by the activation function of the activation unit:
[0088] x c =F scale (u c , S c )=S c ·u c ;
[0089] Among them, F scale (u c , S c ) represents the feature map u c ∈R H×W and the scalar S c The product of c Represents the output data of the attention mechanism module.
[0090] In this embodiment, Figure 4 Taking the example shown in the figure as an example, the output data of the third convolution module is used as the input data of the fully connected layer. The input data of the fully connected layer passes through the fully connected layer and calculates the conditional probability of each class through the Softmax function. The fully connected layer can be implemented by the following formula:
[0091] x (k) =f(W (k) x (k-1) +b (k) );
[0092] Among them, k represents the depth of the fully connected layer, W represents the weight parameter, and b represents the bias term.
[0093] Exemplarily, the Softmax function is implemented by the following formula:
[0094]
[0095] C = αrgmax(P);
[0096] Among them, C represents the final classification result, c represents the set of classifications, θ represents the parameters that the classification model needs to learn, exp(.) identifies the exponential function with the natural constant e as the base, and argmax(.) represents the maximum value function.
[0097] In the embodiment of the present application, the Gram angular field method is used to convert user time series data into image data, which shows the dependence of data in the time dimension while ensuring the integrity of the characteristics, and enriches the main features of the user data provided by the participants. In addition, the convolutional neural network is used as the main body of the model, and the channel attention mechanism of the attention mechanism module is introduced. The feature recalibration strategy is used to strengthen important channel features, which facilitates the model to extract features and improve classification performance.
[0098] See also Figure 6 , is a flow chart of a user identification method provided in an embodiment of the present application. The user identification method provided in an embodiment of the present application can be applied to a terminal device, and the steps in the user identification method are performed by the terminal device. Figure 6 The specific process shown is described in detail.
[0099] Step 410: convert the user data to be identified into image data to be identified.
[0100] This step 410 can process the user data by training a user classification model. For example, the user data to be identified can be processed by the method of step 310.
[0101] Step 420: Input the image data to be identified into a user classification model for classification to obtain a user category of the user corresponding to the user data to be identified.
[0102] The user classification model is trained using the aforementioned model training method embodiment.
[0103] By using the above user identification method, user data identification is implemented based on image data, so that the identification result can be more accurate.
[0104] In addition, an embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the model training method or the user identification method described in the above method embodiment are executed.
[0105] The computer program products of the model training method and the user identification method provided in the embodiments of the present application include a computer-readable storage medium storing program code, and the instructions included in the program code can be used to execute the steps of the model training method or the user identification method described in the above method embodiments. For details, please refer to the above method embodiments, which will not be repeated here.
[0106] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0107] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0108] If the function is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a disk or an optical disk. It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprises" or any other variation thereof are intended to cover non-exclusive inclusion, so that a process, method, article or apparatus that includes a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or apparatus. In the absence of more restrictions, the elements defined by the sentence "includes..." do not exclude the presence of other identical elements in the process, method, article or apparatus that includes the elements.
[0109] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application. It should be noted that similar numbers and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings.
[0110] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A model training method, characterized in that: include: For each user time series data in the user time series data set, convert the user time series data into user image data to obtain a user image data set, wherein one piece of the user image data is used to represent feature information of one user; The user image data set is input into an initial classification model for training to obtain a user classification model.
2. The method according to claim 1, characterized in that: The user time series data is one-dimensional user data; The converting the user time series data into user image data comprises: The pixel values of each two-dimensional image are calculated based on the element values in the one-dimensional user data to obtain user image data.
3. The method according to claim 2, characterized in that The calculating each two-dimensional image pixel value based on the element value in the one-dimensional user data to obtain the user image data includes: converting the one-dimensional user data into two-dimensional data; Mapping each element in the two-dimensional data into a specified interval to obtain an intermediate value; The intermediate values are calculated to obtain pixel values at each position to obtain user image data.
4. The method according to claim 3, characterized in that The converting the one-dimensional user data into two-dimensional data comprises: Based on the i-th element and the j-th element in the one-dimensional user data, the element in the i-th row and the j-th column is determined to obtain two-dimensional data corresponding to the user time series data, wherein i and j are both positive integers.
5. The method according to claim 1, characterized in that The initial classification model includes: multiple convolution modules, one or more attention mechanism modules, and one or more fully connected layers; Wherein, the attention mechanism module is arranged between two adjacent convolution modules; Output data of the last convolution module among the multiple convolution modules is used as input data of the one or more fully connected layers.
6. The method according to claim 5, characterized in that The attention mechanism module includes: at least two convolution units, a compression unit connected to the convolution unit, an excitation unit connected to the compression unit, and an activation unit connected to the excitation unit.
7. The method according to claim 5, characterized in that Each of the convolution modules includes at least two identical convolution layers.
8. A user identification method, characterized in that: include: Converting the user data to be identified into image data to be identified; The image data to be identified is input into a user classification model for classification to obtain a user category of a user corresponding to the user data to be identified, wherein the user classification model is trained using the model training method described in any one of claims 1 to 7.
9. An electronic device, characterized in that: include: A processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the machine-readable instructions are executed by the processor to perform the steps of the method according to any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed by a processor, performs the steps of the method according to any one of claims 1 to 8.
11. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Method and system for identifying Tor user visited website based on Gramer angle field transformation
CN114710417A
User portrait classification method and device based on deep learning, equipment and medium
CN114943289A
