Sketch recognition method
By preprocessing and sampling the sketch, sketch data with a timing structure is constructed, and the graph neural network model is used for identification, the problem of lack of timing information in the existing technology is solved, and the accuracy and efficiency of sketch recognition are improved.
Patent Information
- Application Number
- CN202411370595.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2025-02-25
AI Technical Summary
When using graph neural networks to process sketches, the built graph structure lacks timing information, resulting in increased model size and calculation overhead and reduced identification accuracy.
By obtaining the original sketch data, converting it into sketch sequence data, removing duplicate points and isolated nodes, using the vertex distance maximization sampling method and normalization processing, sketch data with a time-sequential structure is constructed, and the graph neural network model is used for identification.
Introducing timing information when building the graph structure of the sketch reduces the model scale and calculation overhead and improves the accuracy of sketch recognition.
Smart Images

Figure CN119516556A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of graph data processing, and in particular to a sketch recognition method. Background Art
[0002] Sketch recognition is the basis of some sketch-related downstream tasks and is an important research direction to explain how humans obtain abstract descriptions of targets subconsciously. Compared with ordinary images, sketches drawn by humans can describe rich content in a concise way, but sketches are highly abstract, and each person has different sketching styles and habits, which leads to huge differences in sketches of the same object. In order to deal with problems such as the abstractness and diversity of sketches, a common approach is to learn the representation of the entire sketch through a neural network model and then analyze and process the representation.
[0003] Although the coordinate points in the sketch sequence are discrete, the process of drawing them on the canvas so that the coordinate points of each stroke are connected according to rules such as time sequence can be regarded as a natural composition process, and the graph is a mathematical tool that can represent structural related information. The graph neural network, which has emerged and flourished in recent years, is part of geometric deep learning and is suitable for studying learning and prediction tasks of data with structural attributes and topological properties. Therefore, the use of graph neural network methods to study sketches has attracted more and more interest.
[0004] At present, the methods of using graph neural networks to process sketches include S3Net, SketchGNN, and SSR-GNNs. Among them, S3Net abstracts each stroke as a point, connects it to the virtual central node to build an edge, and obtains the embedding of the stroke as a feature matrix through RNN and MLP, and then uses graph neural network and MLP to obtain the classification result of the whole picture. It is a two-stage architecture, and the input data of the model is the sketch sequence. SketchGNN constructs a simple sketch graph, uses a dual-branch structure composed of static and dynamic graph convolution to obtain the embedding of the whole picture, and then classifies to obtain the category of each stroke of the sketch. The input data of the model is a simple sketch graph. SSR-GNNs uses image processing technology to extract control points from sketch images to construct connected sketch strokes, abstracts each stroke as a node, and uses the Euclidean distance of paired original control points to construct a dense adjacency matrix and node feature matrix, which are then input into GNNs to obtain embedding. However, the composition method of this model stipulates that each stroke must have a common vertex, which has great limitations.
[0005] In summary, previous studies on graph neural networks applied in the sketch field only constructed undirected graphs and used traditional neural networks to assist in obtaining the temporal structure of sketches, which increased the scale and computational overhead of the model and reduced the accuracy of subsequent sketch recognition. Summary of the invention In view of the above-mentioned deficiencies in the prior art, the present invention provides a sketch recognition method.
[0006] In order to achieve the above-mentioned object of the invention, the technical solution adopted by the present invention is: A sketch recognition method comprises the following steps: S1, obtaining sketch original data, converting the sketch original data into sketch sequence data, removing duplicate points and isolated nodes in the sketch sequence data, and obtaining sketch sequence optimized data; S2, sampling the sketch sequence optimization data in step S1 using the vertex distance maximization sampling method, and normalizing the sampled sketch sequence optimization data to obtain sketch sequence standard data; S3, constructing sketch data with a time sequence structure according to the sketch sequence standard data in step S2; S4. Construct a sketch recognition model, and obtain a sketch recognition result according to the sketch data with a time series structure and the sketch recognition model in step S3.
[0007] Furthermore, in step S1, the sketch original data is converted into sketch sequence data, which is expressed as: ,
[0008] in: is the sketch sequence data, is the 0th stroke in the sketch sequence data, is the first stroke in the sketch sequence data, is the first A stroke, is the first coordinate points, For the The horizontal coordinate of a point in the canvas, For the The vertical coordinate of a point in the canvas, For the Dot-stroke spacing symbol, ,when Indicates that the current stroke is being drawn. Indicates the end of the current stroke drawing. is the first A stroke, is the stroke number in the sketch sequence data, is the number of strokes in the sketch sequence data, Number the coordinate points in the sketch sequence data. is the number of coordinate points in the sketch sequence data.
[0009] Further, in step S2, the sketch sequence optimization data in step S1 is sampled using a vertex distance maximization sampling method, including the following steps: A1. According to the sketch sequence optimization data in step S1, the distance between the middle coordinate point and the line segment formed by its adjacent points is calculated, and the distance is sorted in descending order to obtain the coordinate point descending data of the sketch sequence optimization data; A2. Optimize the starting and ending points of the data according to the sketch sequence and determine the number of sampling nodes; A3, according to the coordinate point descending data of the sketch sequence optimization data in step A1 and the number of sampling nodes in step A2, the sketch sequence optimization data in step S1 is sampled, which is expressed as:
[0010] in: Optimize data for sampled sketch sequences, Before selection coordinates, is the descending sorting function, is the stroke number in the sketch sequence data, is the number of strokes in the sketch sequence data, is the coordinate point Its adjacent points and The distance between the line segments, is the coordinate point Its adjacent points and The distance between the line segments, is the number of sampling nodes.
[0011] Furthermore, in step S2, the sampled sketch sequence optimization data is normalized to obtain the sketch sequence standard data, which is expressed as:
[0012] in: is the standard data of the sketch sequence, is the stroke number in the sketch sequence data, is the number of strokes in the sketch sequence data, For the The horizontal coordinate of a point in the canvas, For the The vertical coordinate of a point in the canvas, Optimize the maximum value of the horizontal coordinate in the data for the sampled sketch sequence, Optimize the maximum value of the vertical coordinate in the data for the sampled sketch sequence, For the Dot-stroke spacing symbol, ,when Indicates that the current stroke is being drawn. Indicates the end of the current stroke drawing Number the coordinate points in the sketch sequence data. is the number of coordinate points in the sketch sequence data.
[0013] Further, step S3 includes the following steps: S31, construct simple graph data according to the sketch sequence standard data in step S2, expressed as: ,
[0014] in: For simple graph data, For the sub-graphs, is the stroke number in the sketch sequence data, is the number of strokes in the sketch sequence data, For the nodes, For the sides; S32. According to the simple graph data in step S31, a sketch data with a time sequence structure is constructed, which is expressed as:
[0015] in: is the sketch data with a time-series structure, Construct algorithmic notation for timing.
[0016] Furthermore, in step S4, the constructed sketch recognition model includes a graph neural network module, a global average pooling layer and a classifier module connected in sequence; the graph neural network module is used to receive sketch data with a time series structure, and obtain sketch embedding according to the sketch data with a time series structure; the global average pooling layer is used to calculate the feature vector of the sketch embedding; the classifier module is used to obtain the sketch recognition result according to the feature vector of the sketch embedding.
[0017] Furthermore, the calculation formula of the graph neural network module is expressed as:
[0018] in: For passing Layer GCNs calculate node features obtained by feature aggregation, For The concatenation of layers of GCNs, For the The SAGEConv operator of the layer, is the adjacency matrix, For the Parameters of layer GCNs.
[0019] Furthermore, the calculation formula of the global average pooling layer is expressed as:
[0020] in: is the global average pooling result of the output of the graph neural network module, is the global average pooling operation, For the Node features of a graph neural network module.
[0021] Furthermore, the formula of the sketch recognition model is expressed as:
[0022] in: For the Global average pooling result of linear layer , For the Global average pooling result of linear layer , is the activation function, For the The weights of the linear layers, For the The bias of the linear layer, For the The weights of the linear layers, For the The bias of the linear layer.
[0023] The present invention has the following beneficial effects: The present invention obtains original sketch data, converts the original sketch data into sketch sequence data, removes duplicate points and isolated nodes in the sketch sequence data, obtains sketch sequence optimization data, then samples the sketch sequence optimization data using a vertex distance maximization sampling method, normalizes the sampled sketch sequence optimization data, obtains sketch sequence standard data, and then constructs sketch data with a time sequence structure based on the sketch sequence standard data. Finally, a sketch recognition model is constructed, and a sketch recognition result is obtained based on the sketch data with a time sequence structure and the sketch recognition model. When constructing the graph structure of the sketch, time sequence information is introduced and directly processed by GNNs, so there is no need for the participation of a traditional neural network model, and instead a traditional neural network is used to assist in obtaining the time sequence structure of the sketch, thereby reducing the scale and computational overhead of the model and improving the accuracy of subsequent sketch recognition. BRIEF DESCRIPTION OF THE DRAWINGS Figure 1 It is a flowchart of a sketch recognition method; Figure 2 To clean up the Storke3 sequence algorithm flow chart; Figure 3 Build an algorithm flow diagram for timing; Figure 4 Identify the model structure diagram for the sketch; Figure 5 The loss change curve under three weight decay conditions with a fixed learning rate of 0.0005; Figure 6 The loss change curve under three learning rates when the fixed weight decays to 0; Figure 7 This is a diagram showing the accuracy of the fixed learning rate of 0.0005 under three weight decay conditions; Figure 8 A diagram showing the accuracy of three learning rates when the weight decays to 0. DETAILED DESCRIPTION
[0024] The specific implementation modes of the present invention are described below so that those skilled in the art can understand the present invention. However, it should be clear that the present invention is not limited to the scope of the specific implementation modes. For those of ordinary skill in the art, as long as various changes are within the spirit and scope of the present invention as defined and determined by the attached claims, these changes are obvious, and all inventions and creations utilizing the concept of the present invention are protected.
[0025] like Figure 1 As shown, a sketch recognition method comprises the following steps: S1. Obtain original sketch data, convert the original sketch data into sketch sequence data, remove duplicate points and isolated nodes in the sketch sequence data, and obtain sketch sequence optimized data.
[0026] In an optional embodiment of the present invention, the present invention converts the sketch original data into sketch sequence data, which is expressed as: ,
[0027] in: is the sketch sequence data, is the 0th stroke in the sketch sequence data, is the first stroke in the sketch sequence data, is the first A stroke, is the first coordinate points, For the The horizontal coordinate of a point in the canvas, For the The vertical coordinate of a point in the canvas, For the Dot-stroke spacing symbol, ,when Indicates that the current stroke is being drawn. Indicates the end of the current stroke drawing. is the first A stroke, is the stroke number in the sketch sequence data, is the number of strokes in the sketch sequence data, Number the coordinate points in the sketch sequence data. is the number of coordinate points in the sketch sequence data.
[0028] The present invention adopts cleaning The sequence algorithm removes duplicate points and isolated nodes in the sketch sequence data to obtain the sketch sequence optimization data. The algorithm flow chart is as follows Figure 2 shown.
[0029] S2. Use the vertex distance maximization sampling method to sample the sketch sequence optimization data in step S1, and normalize the sampled sketch sequence optimization data to obtain sketch sequence standard data.
[0030] In an optional embodiment of the present invention, the present invention adopts a vertex distance maximization sampling method to sample the sketch sequence optimization data in step S1, comprising the following steps: A1. According to the sketch sequence optimization data in step S1, calculate the distance between the line segment formed by the middle coordinate point and its adjacent points, and sort them in descending order to obtain the coordinate point descending data of the sketch sequence optimization data.
[0031] A2. Optimize the starting and ending points of the data according to the sketch sequence and determine the number of sampling nodes.
[0032] A3, according to the coordinate point descending data of the sketch sequence optimization data in step A1 and the number of sampling nodes in step A2, the sketch sequence optimization data in step S1 is sampled, which is expressed as:
[0033] in: Optimize data for sampled sketch sequences, Before selection coordinates, is the descending sorting function, is the stroke number in the sketch sequence data, is the number of strokes in the sketch sequence data, is the coordinate point Its adjacent points and The distance between the line segments, is the coordinate point Its adjacent points and The distance between the line segments, is the number of sampling nodes.
[0034] The present invention normalizes the sampled sketch sequence optimization data to obtain the sketch sequence standard data, which is expressed as:
[0035] in: is the standard data of the sketch sequence, is the stroke number in the sketch sequence data, is the number of strokes in the sketch sequence data, For the The horizontal coordinate of a point in the canvas, For the The vertical coordinate of a point in the canvas, Optimize the maximum value of the horizontal coordinate in the data for the sampled sketch sequence, Optimize the maximum value of the vertical coordinate in the data for the sampled sketch sequence, For the Dot-stroke spacing symbol, ,when Indicates that the current stroke is being drawn. Indicates the end of the current stroke drawing Number the coordinate points in the sketch sequence data. is the number of coordinate points in the sketch sequence data.
[0036] S3. Construct sketch data with a time sequence structure according to the sketch sequence standard data in step S2.
[0037] In an optional embodiment of the present invention, step S3 includes the following steps: S31, construct simple graph data according to the sketch sequence standard data in step S2, expressed as: ,
[0038] in: For simple graph data, For the sub-graphs, is the stroke number in the sketch sequence data, is the number of strokes in the sketch sequence data, For the nodes, For the An edge.
[0039] S32. According to the simple graph data in step S31, a sketch data with a time sequence structure is constructed, which is expressed as:
[0040] in: is the sketch data with a time-series structure, Construct algorithmic notation for timing.
[0041] like Figure 3 As shown, the present invention provides a flow chart of a timing construction algorithm.
[0042] S4. Construct a sketch recognition model, and obtain a sketch recognition result according to the sketch data with a time series structure and the sketch recognition model in step S3.
[0043] In an optional embodiment of the present invention, the sketch recognition model constructed by the present invention includes a graph neural network module, a global average pooling layer and a classifier module connected in sequence; the graph neural network module is used to receive sketch data with a time series structure, and obtain sketch embedding according to the sketch data with a time series structure; the global average pooling layer is used to calculate the feature vector of the sketch embedding; the classifier module is used to obtain the sketch recognition result according to the feature vector of the sketch embedding.
[0044] The calculation formula of the graph neural network module is expressed as:
[0045] in: For passing Layer GCNs calculate node features obtained by feature aggregation, For The concatenation of layers of GCNs, For the The SAGEConv operator of the layer, is the adjacency matrix, For the Parameters of layer GCNs.
[0046] The calculation formula of the global average pooling layer is expressed as:
[0047] in: is the global average pooling result of the output of the graph neural network module, is the global average pooling operation, For the Node features of a graph neural network module.
[0048] The formula of the sketch recognition model is expressed as:
[0049] in: For the Global average pooling result of linear layer , For the Global average pooling result of linear layer , is the activation function, For the The weights of the linear layers, For the The bias of the linear layer, For the The weights of the linear layers, For the The bias of the linear layer.
[0050] The present invention obtains the sketch recognition result by calculating the confidence score of each calculation result based on the calculation results obtained by the sketch recognition model, which is expressed as: .
[0051] Specifically, the present invention adopts cross entropy loss as the optimization objective to minimize the difference between the model prediction results and the true label distribution, which is expressed as: .
[0052] Simulation experiment: The present invention uses the QuickDraw data set as the original sketch data. The present invention randomly extracts 20,000 sketches from a total of 345 categories, and distributes the training, verification and test sets in a ratio of 6:2:2. Since the data set contains the category "line", and the total amount of data obtained in this category after data preprocessing is less than 20,000, the number of categories actually used is 344, and a total of 5,160,000 sketch sequences constitute the training data. In addition, the QuickDraw data set is a sketch drawn by a user within 20 seconds, so there are many confusing sketches in the data set category, and the data set also contains noise data such as messy line graffiti. The data of the present invention is completely randomly extracted from the original data set without any selection or data enhancement. The present invention fixes the Block of GNNs to 2, the input dimension to 2, and the output dimension to 512+1024. After global average pooling of the graph, it is connected to a two-layer MLP to map the features to the number of categories. The model is trained on a single Nvidia Geforce GTX3070 Ti GPU. The Adam optimizer is used to optimize the model. The initial learning rate is set to 0.0005, the weight decay is fixed to 0, the training batch size is kept at 100, the data is set to be randomly shuffled in Dataloder, and the number of training rounds is set to 4. In order to verify the classification effect of the sketch data with a time series structure constructed by the present invention on graph convolution, the present invention conducted a series of comparative experiments, as shown in Table 1. ChebConv sets the Chebyshev polynomial approximation order to 2, and MLP is a multi-layer perceptron, which is set as a benchmark to verify the effectiveness of the graph neural network. The parameters of all methods remain consistent.
[0053] As shown in Table 1, the accuracy of the sketch data with a time-series structure constructed by the present invention is compared in various methods. Where absXY and delXY represent the node features using absolute coordinates and relative coordinates, respectively, and n in nLayer represents Figure 4 The number of layers in the .
[0054] Table 1
[0055] Table 1 shows the evaluation of the present invention on various graph convolution methods, different numbers of GCNs layers, different node features, and whether or not the learning rate scheduler is used. The results show that compared with the directly constructed sketch simple graph The sketch data with a temporal structure constructed by the present invention improves the model accuracy in various graph convolutions and different node features. Without using a learning rate scheduler, the accuracy of absXY features is improved by 2.44% to 31.84%, and the accuracy of delXY features is improved by 1.39% to 16.40%. When using a learning rate scheduler, the accuracy of absXY features is improved by 2.27% to 5.33%, and the accuracy of delXY features is improved by 2.05% to 5.48%. Represents the depth of the network, by and As the network gets deeper, the model becomes more The difference in classification accuracy between the sketch data with a time-series structure constructed by the present invention and the sketch data with a time-series structure constructed by the present invention is gradually narrowing, which means that the sketch data with a time-series structure constructed by the present invention is more effective when the network depth is shallow.
[0056] Without using the learning rate scheduler, the improvement of DSSG (sequential construction algorithm, the composition method of the present invention) compared with the simple graph is significantly greater than that of using the scheduler, proving that the temporal information introduced by DSSG can enable the model to consider the higher-order information of spatiotemporal structure and thus more effectively capture the sketch features. In addition, when using the learning rate scheduler, and There is little difference in the accuracy, and no matter whether the input node feature type is absXY or delXY, the final classification results of the two cases are almost the same, indicating that the model becomes insensitive to the input node features at this time. Therefore, after eliminating the interference of node features, the classification accuracy is improved by 2.05% to 5.48% after using the composition method proposed in the present invention, which further proves the effectiveness of DSSG.
[0057] The present invention further considers the sensitivity of DSSG to changes in model parameters. The present invention finds that when the model uses a learning rate scheduler, there is little difference between the number of layers being 2 and 3, and the node features being absXY or delXY. Therefore, in this section, the present invention sets the number of layers n=2 and the node features being absXY. Taking SAGEConv as an example, the following is the loss and accuracy of DSSG under multiple learning rates and multiple weight decays. Figure 5 Indicates the loss change curve under three weight decays with a fixed learning rate of 0.0005; Figure 6 Indicates the loss change curve under three learning rates when the fixed weight decays to 0. Figure 7 Indicates the accuracy under three weight decay conditions with a fixed learning rate of 0.0005; Figure 8Indicates the accuracy under three learning rates when the fixed weight decay is 0. The above simulation shows that as the weight decay value increases, the loss value tends to increase, and the model accuracy decreases accordingly. Since a larger weight decay value will make the model more inclined to reduce the size of the weight, the model cannot fully learn the complex patterns in the data, limiting the model's expressive power, thereby increasing the training loss. At the same time, the present invention finds that the change in learning rate has little effect on the loss and accuracy of the model. This may be because under the DSSG composition method, the generated graph structure can better capture the intrinsic characteristics of the data, making the model insensitive to changes in the learning rate.
[0058] In summary, the graph data constructed by DSSG shows significant sensitivity to the weight decay parameter. Reasonable selection of weight decay parameters is of great significance for improving model performance. The change of learning rate has relatively little effect on the model, which shows that under the DSSG graph construction method provided by the present invention, the model can maintain good performance in a wider range of learning rate settings.
[0059] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0060] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0061] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0062] The present invention uses specific embodiments to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
[0063] Those skilled in the art will appreciate that the embodiments described herein are intended to help readers understand the principles of the present invention, and should be understood that the protection scope of the present invention is not limited to such specific statements and embodiments. Those skilled in the art can make various other specific variations and combinations that do not deviate from the essence of the present invention based on the technical revelations disclosed by the present invention, and these variations and combinations are still within the protection scope of the present invention.
Claims
1. A sketch recognition method, characterized in that: The following steps are involved: S1, obtaining sketch original data, converting the sketch original data into sketch sequence data, removing duplicate points and isolated nodes in the sketch sequence data, and obtaining sketch sequence optimized data; S2, sampling the sketch sequence optimization data in step S1 using the vertex distance maximization sampling method, and normalizing the sampled sketch sequence optimization data to obtain sketch sequence standard data; S3, constructing sketch data with a time sequence structure according to the sketch sequence standard data in step S2; S4. Construct a sketch recognition model, and obtain a sketch recognition result according to the sketch data with a time series structure and the sketch recognition model in step S3.
2. The sketch recognition method according to claim 1, characterized in that: In step S1, the sketch raw data is converted into sketch sequence data, which is expressed as: , in: is the sketch sequence data, is the 0th stroke in the sketch sequence data, is the first stroke in the sketch sequence data, is the first A stroke, is the first coordinate points, For the The horizontal coordinate of a point in the canvas, For the The vertical coordinate of a point in the canvas, For the Dot-stroke spacing symbol, ,when Indicates that the current stroke is being drawn. Indicates the end of the current stroke drawing. is the first A stroke, is the stroke number in the sketch sequence data, is the number of strokes in the sketch sequence data, Number the coordinate points in the sketch sequence data. is the number of coordinate points in the sketch sequence data.
3. The sketch recognition method according to claim 1, characterized in that: In step S2, the sketch sequence optimization data in step S1 is sampled using a vertex distance maximization sampling method, including the following steps: A1. According to the sketch sequence optimization data in step S1, the distance between the middle coordinate point and the line segment formed by its adjacent points is calculated, and the distance is sorted in descending order to obtain the coordinate point descending data of the sketch sequence optimization data; A2. Optimize the starting and ending points of the data according to the sketch sequence and determine the number of sampling nodes; A3, according to the coordinate point descending data of the sketch sequence optimization data in step A1 and the number of sampling nodes in step A2, the sketch sequence optimization data in step S1 is sampled, which is expressed as: in: Optimize data for sampled sketch sequences, Before selection coordinates, is the descending sorting function, is the stroke number in the sketch sequence data, is the number of strokes in the sketch sequence data, is the coordinate point Its adjacent points and The distance between the line segments, is the coordinate point Its adjacent points and The distance between the line segments, is the number of sampling nodes.
4. The sketch recognition method according to claim 1, characterized in that: In step S2, the sampled sketch sequence optimization data is normalized to obtain the sketch sequence standard data, which is expressed as: in: is the standard data of the sketch sequence, is the stroke number in the sketch sequence data, is the number of strokes in the sketch sequence data, For the The horizontal coordinate of a point in the canvas, For the The vertical coordinate of a point in the canvas, Optimize the maximum value of the horizontal coordinate in the data for the sampled sketch sequence, Optimize the maximum value of the vertical coordinate in the data for the sampled sketch sequence, For the Dot-stroke spacing symbol, ,when Indicates that the current stroke is being drawn. Indicates the end of the current stroke drawing Number the coordinate points in the sketch sequence data. is the number of coordinate points in the sketch sequence data.
5. The sketch recognition method according to claim 1, characterized in that: Step S3 includes the following steps: S31, construct simple graph data according to the sketch sequence standard data in step S2, expressed as: , in: For simple graph data, For the sub-graphs, is the stroke number in the sketch sequence data, is the number of strokes in the sketch sequence data, For the nodes, For the sides; S32. According to the simple graph data in step S31, a sketch data with a time sequence structure is constructed, which is expressed as: in: is the sketch data with a time-series structure, Construct algorithmic notation for timing.
6. The sketch recognition method according to claim 1, characterized in that: In step S4, the constructed sketch recognition model includes a graph neural network module, a global average pooling layer and a classifier module connected in sequence; the graph neural network module is used to receive sketch data with a time series structure, and obtain sketch embedding according to the sketch data with a time series structure; the global average pooling layer is used to calculate the feature vector of the sketch embedding; the classifier module is used to obtain the sketch recognition result according to the feature vector of the sketch embedding.
7. The sketch recognition method according to claim 6, characterized in that: The calculation formula of the graph neural network module is expressed as: in: For passing Layer GCNs calculate node features obtained by feature aggregation, For The concatenation of layers of GCNs, For the The SAGEConv operator of the layer, is the adjacency matrix, For the Parameters of layer GCNs.
8. The sketch recognition method according to claim 6, characterized in that: The calculation formula of the global average pooling layer is expressed as: in: is the global average pooling result of the output of the graph neural network module, is the global average pooling operation, For the Node features of a graph neural network module.
9. The sketch recognition method according to claim 6, characterized in that: The formula of the sketch recognition model is expressed as: in: For the Global average pooling result of linear layer , For the Global average pooling result of linear layer , is the activation function, For the The weights of the linear layers, For the The bias of the linear layer, For the The weights of the linear layers, For the The bias of the linear layer.