Classification vector generation method, device, computer equipment and storage medium

By extracting and merging feature vectors of multiple rotation angles, the problem of low accuracy of existing metric learning methods when the data angle changes is solved, achieving higher classification accuracy and adaptability.

CN112348060BActive Publication Date: 2025-01-24刘丽
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011154930.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-10-26
Publication Date
2025-01-24
Estimated Expiration
2040-10-26

AI Technical Summary

Technical Problem

When the existing metric learning methods change in data angle, the model has low accuracy and cannot effectively adapt to the changes in data angle.

Method used

By obtaining the picture data to be processed at multiple rotation angles, enter it to the pre -trained classification network, extract the feature vector of multiple rotation angles, and merge it into a comprehensive classification vector to improve the accuracy of the classification.

Benefits of technology

By merging the feature vector of multiple rotation angles, the accuracy of the classification of picture classification can be improved and the needs of the data angle change can be improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112348060B_ABST
    Figure CN112348060B_ABST
Patent Text Reader

Abstract

The present application relates to a classification vector generation method, device, computer equipment and storage medium. The method comprises: obtaining image data to be processed, wherein the image data to be processed comprises image data to be processed at multiple rotation angles; inputting the image data to be processed into a pre-trained classification network to extract feature vectors of multiple rotation angles corresponding to the image data to be processed; merging the extracted feature vectors of multiple rotation angles to obtain a comprehensive classification vector, wherein the comprehensive classification vector is used to classify the image data to be processed to obtain corresponding classification labels. The use of this method can improve accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a classification vector generation method, apparatus, computer equipment and storage medium. Background Art

[0002] Metric Learning is a common machine learning method in face recognition, proposed by Eric Xing in NIPS 2002. It can learn a feature (Embedding) space, in which all data is converted into a feature vector, and the distance between the feature vectors of similar samples is small, and the distance between the feature vectors of dissimilar samples is large, so as to distinguish the data. Metric learning is also called distance metric learning (DML) or similarity learning. Now metric learning is commonly used in many fields, such as image target detection, image classification, target tracking, face recognition, data classification, etc.

[0003] In traditional technology, metric learning is divided into two types, one is based on supervised learning and the other is based on unsupervised learning.

[0004] However, current metric learning only uses samples with a uniform angle for training. When the angle of the data changes, the accuracy of the model obtained by the original training is low. Summary of the invention

[0005] Based on this, it is necessary to provide a classification vector generation method, device, computer equipment and storage medium that can improve accuracy in response to the above technical problems.

[0006] A classification vector generation method, the method comprising:

[0007] Acquire image data to be processed, wherein the image data to be processed includes image data to be processed at multiple rotation angles;

[0008] Inputting the image data to be processed into a pre-trained classification network to extract feature vectors of multiple rotation angles corresponding to the image data to be processed;

[0009] The extracted feature vectors of multiple rotation angles are combined to obtain a comprehensive classification vector, and the comprehensive classification vector is used to classify the image data to be processed to obtain a corresponding classification label.

[0010] In one embodiment, the step of inputting the image data to be processed into a pre-trained classification network to extract feature vectors of multiple rotation angles corresponding to the image data to be processed includes:

[0011] Extracting an initial classification vector corresponding to the image data to be processed at each rotation angle;

[0012] The initial classification vector is subjected to dimensionality reduction processing to obtain a feature vector corresponding to each rotation angle.

[0013] In one embodiment, the dimensionality reduction processing of the initial classification vector to obtain the feature vector corresponding to each rotation angle includes:

[0014] The initial classification vector is sequentially input into the fully connected layer and the normalization layer to perform dimension reduction processing on the initial classification vector to obtain a feature vector corresponding to each rotation angle.

[0015] In one embodiment, before inputting the image data to be processed into a pre-trained classification network to extract feature vectors of multiple rotation angles corresponding to the image data to be processed, the method further includes:

[0016] Splitting the image data to be processed to obtain image data to be processed at multiple rotation angles;

[0017] Merge the image data to be processed at multiple rotation angles in the batch size dimension.

[0018] In one embodiment, splitting the image data to be processed to obtain image data to be processed at multiple rotation angles includes:

[0019] The image data to be processed is split according to the channel dimension to obtain image data to be processed at multiple rotation angles.

[0020] In one embodiment, the training method of the pre-trained classification network includes:

[0021] Acquire sample image data, wherein the sample image data includes sample image data at multiple rotation angles and corresponding sample labels;

[0022] Inputting the sample image data into an initial classification network to extract feature vectors of multiple rotation angles corresponding to the sample image data;

[0023] According to the sample label and the feature vectors of multiple rotation angles, respectively calculate the angle loss function corresponding to each rotation angle;

[0024] A comprehensive loss function is calculated according to the angle loss function;

[0025] The initial classification network is trained by performing gradient backpropagation through the comprehensive loss function until the change of the comprehensive loss function is less than a preset value, and the training of the initial classification network is completed.

[0026] In one embodiment, the calculating the comprehensive loss function according to the angle loss function includes:

[0027] The average value corresponding to the angle loss function is calculated as the comprehensive loss function.

[0028] A method for classifying pictures, the method comprising:

[0029] Generate a comprehensive classification vector by the classification vector generation method according to any one of claims 1 to 7;

[0030] Matching the comprehensive classification vector with a standard vector in a database;

[0031] When the comprehensive classification vector successfully matches the standard vector in the database, the classification label corresponding to the successfully matched standard vector is obtained as the classification label of the image data to be processed.

[0032] A classification vector generating device, the device comprising:

[0033] A data acquisition module, used to acquire image data to be processed, wherein the image data to be processed includes image data to be processed at multiple rotation angles;

[0034] A multi-angle feature generation module, used for inputting the image data to be processed into a pre-trained classification network to extract feature vectors of multiple rotation angles corresponding to the image data to be processed;

[0035] The classification vector generation module is used to merge the extracted feature vectors of multiple rotation angles to obtain a comprehensive classification vector, and the comprehensive classification vector is used to classify the image data to be processed to obtain a corresponding classification label.

[0036] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any one of the above methods when executing the computer program.

[0037] A computer-readable storage medium stores a computer program, which implements the steps of any of the above methods when executed by a processor.

[0038] The above-mentioned classification vector generation method, device, computer equipment and storage medium obtain the feature vectors of multiple rotation angles corresponding to the image data to be processed through the classification network, and merge the feature vectors of multiple rotation angles to obtain a comprehensive classification vector. The classification label is obtained by classifying the image data to be processed through the comprehensive feature vector, which can improve the classification accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 A schematic diagram of a flow chart of a classification vector generation method in one embodiment;

[0040] Figure 2 is a schematic diagram of the structure of a classification network in an embodiment;

[0041] Figure 3 is a flow chart of a training process of a classification network in one embodiment;

[0042] Figure 4 for Figure 3 A schematic diagram of an iterative process in the training process of the classification network in the illustrated embodiment;

[0043] Figure 5 is a flowchart of a method for classifying pictures in one embodiment;

[0044] Figure 6 is a structural block diagram of a classification vector generating device in one embodiment;

[0045] Figure 7 is a structural block diagram of a picture classification device in one embodiment;

[0046] Figure 8 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0047] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0048] In one embodiment, Figure 1 As shown, a classification vector generation method is provided. This embodiment takes the method applied to a terminal as an example. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:

[0049] S102: Acquire image data to be processed, where the image data to be processed includes image data to be processed at multiple rotation angles.

[0050] Specifically, the image data to be processed is an image for which a comprehensive classification vector needs to be extracted, wherein the image data to be processed includes image data to be processed at multiple rotation angles, and specifically, the rotation angle may refer to the rotation angle of the image, such as 0, 90, 180, 270 degrees, etc. In other embodiments, it may also be other rotation angles. The image data to be processed is the image data to be processed at multiple rotation angles obtained together.

[0051] S104: Inputting the image data to be processed into a pre-trained classification network to extract feature vectors of multiple rotation angles corresponding to the image data to be processed.

[0052] Specifically, the classification network is pre-trained and may include a feature extraction network for extracting initial classification features of the image data to be processed, and a network head for reducing the dimension of the extracted features. For details, see Figure 2 As shown, the classification network may include a feature extraction network, such as a BN-Inception network, and a network head for reducing the dimension of the extracted features, and the network head may include a fully connected layer and a normalized layer.

[0053] The feature extraction network of the initial classification feature is used to process the image data to be processed to obtain the normalized initial classification feature, such as optimizing the initial classification feature to make the distribution of the initial classification feature more stable in classification, that is, the classification network can learn the feature vectors of the image data to be processed at various rotation angles, so that no matter how the image data to be processed is rotated, the classification label corresponding to the image data to be processed can be accurately obtained. The network head is to reduce the dimension of the initial classification feature to reduce the amount of calculation in the subsequent classification processing.

[0054] The terminal inputs the to-be-processed image data of multiple rotation angles into the pre-trained classification network together, so that the feature vector corresponding to the to-be-processed image data of each rotation angle can be obtained. Optionally, the classification network can process the to-be-processed image data of multiple rotation angles in series or in parallel.

[0055] S106: The extracted feature vectors of multiple rotation angles are combined to obtain a comprehensive classification vector, and the comprehensive classification vector is used to classify the image data to be processed to obtain a corresponding classification label.

[0056] Specifically, after obtaining the feature vectors of multiple rotation angles, the terminal merges the feature vectors of the multiple rotation angles, for example, connecting the multiple feature vectors in order from small to large rotation angles to obtain a comprehensive classification vector.

[0057] Therefore, the subsequent terminal can classify the image data to be processed according to the comprehensive classification vector to obtain the corresponding classification label.

[0058] The above-mentioned classification vector generation method obtains the feature vectors of multiple rotation angles corresponding to the image data to be processed through the classification network, and merges the feature vectors of multiple rotation angles to obtain a comprehensive classification vector. The classification label is obtained by classifying the image data to be processed through the comprehensive feature vector, which can improve the classification accuracy.

[0059] In one of the embodiments, the image data to be processed is input into a pre-trained classification network to extract feature vectors of multiple rotation angles corresponding to the image data to be processed, including: extracting an initial classification vector corresponding to the image data to be processed at each rotation angle; and performing dimensionality reduction processing on the initial classification vector to obtain a feature vector corresponding to each rotation angle.

[0060] Specifically, combined Figure 2 As shown, the terminal inputs the image data to be processed into the classification network. The classification network first uses the feature extraction network to extract the initial classification vector corresponding to each rotation angle, such as an initial classification vector of 2048 dimensions, and then obtains the feature vector corresponding to each rotation angle through dimensionality reduction processing, such as reducing the dimension to 512 dimensions.

[0061] In practical applications, the image data to be processed is (a, b, c, d), where a represents the number of rotation angles, and b represents the number of channels. For example, the image to be processed at each rotation angle is represented by three RGB channels, and c and d represent the resolution of the image to be processed. Assuming that there are 4 rotation angles, such as 0, 90, 180, and 270 degrees, each image to be processed can be represented by (4, 3, c, d), and then input into the classification network to obtain an initial classification vector of (4, 2048), where 4 represents the number of rotation angles, and 2048 is the dimension before dimensionality reduction mentioned above. The initial classification vector is then subjected to dimensionality reduction to obtain the feature vector corresponding to each rotation angle, that is, (4, 512), where 512 represents the dimension after dimensionality reduction.

[0062] Optionally, the initial classification vector is subjected to dimensionality reduction processing to obtain a feature vector corresponding to each rotation angle, including: the initial classification vector is sequentially input into a fully connected layer and a normalization layer to perform dimensionality reduction processing on the initial classification vector to obtain a feature vector corresponding to each rotation angle.

[0063] Specifically, combined Figure 2As shown, the terminal inputs the initial classification vector into a fully connected layer to obtain a dimension of 512, that is, a reduced dimension vector after dimensionality reduction, and then inputs the reduced dimension vector into a normalized layer to obtain a feature vector. It should be noted that for each rotation angle, the corresponding feature vector is obtained through the above classification network, so that after obtaining the feature vector, the feature vectors are merged to obtain a comprehensive feature vector, and classification processing is performed based on the comprehensive feature vector to obtain the classification label corresponding to the image data to be processed.

[0064] In the above embodiment, features are first extracted through a feature extraction network and then subjected to dimensionality reduction processing, thereby ensuring that the dimension of the subsequent comprehensive feature vector is not too high, thereby ensuring the improvement of the efficiency of the subsequent classification process.

[0065] In one of the embodiments, before inputting the image data to be processed into a pre-trained classification network to extract feature vectors of multiple rotation angles corresponding to the image data to be processed, it also includes: splitting the image data to be processed to obtain image data to be processed at multiple rotation angles; and merging the image data to be processed at multiple rotation angles under the batch size dimension.

[0066] Specifically, the image data to be processed can be obtained from a database, in which multiple rotation angles are merged together, such as (n, m, c, d), where m is the number of channels, and n is the number of images to be processed, that is, the batch size dimension. For example, if the number of rotation angles is a, then m=a*3, for example, when a=4, then m is 12, that is, 0-12, and every 3 channels represent a rotation angle.

[0067] Therefore, during processing, the terminal first splits the image data to be processed to obtain image data to be processed at multiple rotation angles. For example, the image data to be processed is split according to the channel dimension to obtain image data to be processed at multiple rotation angles, that is, the image data to be processed is split to obtain a sub-data with a size of (n, m / 3, c, d), and then the image data to be processed at multiple rotation angles are merged under the batch size dimension, that is, (a*n, m / 3, c, d).

[0068] In the above embodiment, before the image data to be processed is input into the classification network, the image data to be processed is first processed to obtain the image data to be processed at multiple rotation angles, which lays a foundation for subsequent processing.

[0069] In one embodiment, see Figure 3 As shown, Figure 3 is a flowchart of a training process of a classification network in one embodiment, Figure 4 for Figure 3The schematic diagram of an iterative process in the training process of the classification network in the illustrated embodiment. In this embodiment, the training method of the classification network obtained by pre-training includes:

[0070] S302: Obtain sample image data, where the sample image data includes sample image data at multiple rotation angles and corresponding sample labels.

[0071] Specifically, the sample image data is collected in advance, wherein the sample image data includes sample image data at multiple rotation angles, such as 0, 90, 180, 270 degrees, etc. mentioned above. The sample label refers to the category to which the sample belongs. In practical applications, the sample image data can be represented by (BS, m, c, d), where BS represents the size of the batch input to the network each time, and can also be simply understood as the number of sample images involved, which is a set hyperparameter. m represents the number of channels of the sample image data, ranging from 0-3x, that is, every 3 channels represent a rotation angle. c and d represent the resolution of the sample image. Based on this data structure, before proceeding forward, the terminal splits the sample image data into 4 sub-data of size (BS, 3, c, d), each sub-data representing a rotation angle of the same batch of images. Then, the terminal merges the 4 sub-data in the first dimension to obtain data of size (4*BS, 3, c, d).

[0072] S304: Input the sample image data into the initial classification network to extract feature vectors of multiple rotation angles corresponding to the sample image data.

[0073] Specifically, the structure of the initial classification network can be found in Figure 2 As shown, the terminal inputs the sample image data into the initial classification network, so as to extract feature vectors of multiple rotation angles corresponding to the sample image data. For example, the above-mentioned (4*BS, 3, c, d) data is input into the initial classification network to obtain a feature vector output of (4*BS, 512).

[0074] S306: Calculate the angle loss function corresponding to each rotation angle according to the sample label and the feature vectors of multiple rotation angles.

[0075] S308: Calculate a comprehensive loss function based on the angle loss function.

[0076] S310: Perform gradient backpropagation through the comprehensive loss function to train the initial classification network until the change of the comprehensive loss function is less than a preset value, and the initial classification network training is completed.

[0077] Specifically, when calculating the loss function, the terminal first splits the obtained feature vector into feature vectors corresponding to the number of rotation angles according to the above-mentioned merging method, for example, into 4 sub-feature vectors of size (BS, 512), each of which represents the feature vector extracted by the classification network from the same batch of pictures at one angle. The terminal puts them into MS-loss to calculate the loss, and obtains four angle loss functions (l1, l2, l3, l4). The comprehensive loss function is calculated using the four angle loss functions, and back-propagation is performed to complete the one-step update of the classification network training.

[0078] Optionally, a comprehensive loss function is calculated based on the angle loss function, including: calculating an average value corresponding to the angle loss function as the comprehensive loss function.

[0079] The terminal repeats the above steps until the classification network converges, and the classification network training is completed. The condition for the convergence of the classification network may be that the change of the comprehensive loss function is less than a preset value.

[0080] Among them, after the classification network is trained, the terminal can also test the classification network, for example, setting a control group model, which uses the same hyperparameters as the classification network, that is, the batch size is the same as the batch size during training, and the training data used is unrotated, which can also be considered as a data set with a rotation angle of 0 degrees. Then, the control group model is used to test its recall rate performance under the above-mentioned different rotation angles.

[0081] In addition, when testing the classification network, the terminal also tests the recall rate at different rotation angles, and merges the feature vectors extracted by the network at different rotation angles to obtain a vector (BS, 2048), and calculates the recall rate based on the merged vector. The control group model also merges the feature vectors at different rotation angles and tests to obtain the recall rate.

[0082] According to the test, the recall rate of the classification network corresponding to the rotation angle and the merged vector and the recall rate of the control group model are determined. If the recall rate of the classification network is greater than the recall rate of the control group model, it means that the training is successful.

[0083] In one embodiment, see Figure 5 As shown, Figure 5 FIG. 1 is a flowchart of a method for classifying pictures in an embodiment. In this embodiment, the method for classifying pictures may include:

[0084] S502: Generate a comprehensive classification vector by using the classification vector generation method in any of the above embodiments.

[0085] Specifically, the terminal may first obtain the image data to be processed, and then generate a comprehensive classification vector through the above classification vector generation method. For details, please refer to the above and will not be repeated here.

[0086] S504: Match the comprehensive classification vector with the standard vector in the database.

[0087] Specifically, the database stores standard vectors, that is, the database stores various classification labels, and provides standard vectors corresponding to the classification labels, so that the terminal matches the comprehensive classification vector with the standard vector, for example, calculates the distance between the comprehensive classification vector and each standard vector.

[0088] S506: When the comprehensive classification vector successfully matches the standard vector in the database, the classification label corresponding to the successfully matched standard vector is obtained as the classification label of the image data to be processed.

[0089] Specifically, the terminal matches the comprehensive classification vector with the standard vector, for example, the standard vector with the smallest distance to the comprehensive classification vector can be obtained as the successfully matched standard vector, and then the classification label corresponding to the successfully matched standard vector is used as the classification label of the image data to be processed.

[0090] In the above embodiment, feature vectors of multiple rotation angles corresponding to the image data to be processed are obtained through a classification network, and the feature vectors of the multiple rotation angles are merged to obtain a comprehensive classification vector. The image data to be processed is classified by the comprehensive feature vector to obtain a classification label, which can improve the classification accuracy.

[0091] It should be understood that although Figure 1 , Figure 3 and Figure 5 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1 , Figure 3 and Figure 5 At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.

[0092] In one embodiment, Figure 6As shown, a classification vector generation device is provided, comprising: a data acquisition module 100, a multi-angle feature generation module 200 and a classification vector generation module 300, wherein:

[0093] The data acquisition module 100 is used to acquire the image data to be processed, wherein the image data to be processed includes the image data to be processed at multiple rotation angles;

[0094] The multi-angle feature generation module 200 is used to input the image data to be processed into a pre-trained classification network to extract feature vectors of multiple rotation angles corresponding to the image data to be processed;

[0095] The classification vector generation module 300 is used to merge the extracted feature vectors of multiple rotation angles to obtain a comprehensive classification vector, and the comprehensive classification vector is used to classify the image data to be processed to obtain a corresponding classification label.

[0096] In one embodiment, the multi-angle feature generation module 200 may include:

[0097] An extraction unit, used to extract an initial classification vector corresponding to the image data to be processed at each rotation angle;

[0098] The dimension reduction processing unit is used to perform dimension reduction processing on the initial classification vector to obtain a feature vector corresponding to each rotation angle.

[0099] In one of the embodiments, the dimensionality reduction processing unit is further used to input the initial classification vector into the fully connected layer and the normalization layer in sequence, so as to perform dimensionality reduction processing on the initial classification vector to obtain a feature vector corresponding to each rotation angle.

[0100] In one embodiment, the classification vector generating device further includes:

[0101] A splitting module, used for splitting the image data to be processed to obtain the image data to be processed at multiple rotation angles;

[0102] The merging module is used to merge the image data to be processed at multiple rotation angles in the batch size dimension.

[0103] In one of the embodiments, the splitting module is used to split the image data to be processed according to the channel dimension to obtain the image data to be processed at multiple rotation angles.

[0104] In one embodiment, the classification vector generating device further includes:

[0105] The sample data acquisition module 100 is used to acquire sample image data, where the sample image data includes sample image data at multiple rotation angles and corresponding sample labels;

[0106] A sample processing module, used for inputting sample image data into an initial classification network to extract feature vectors of multiple rotation angles corresponding to the sample image data;

[0107] An angle loss function calculation module, used to calculate the angle loss function corresponding to each rotation angle according to the sample label and the feature vectors of multiple rotation angles;

[0108] A comprehensive loss function calculation module is used to calculate a comprehensive loss function based on the angle loss function;

[0109] The training module is used to perform gradient backpropagation through the comprehensive loss function to train the initial classification network until the change of the comprehensive loss function is less than the preset value, and the initial classification network training is completed.

[0110] In one of the embodiments, the above-mentioned comprehensive loss function calculation module is also used to calculate the average value corresponding to the angle loss function as the comprehensive loss function.

[0111] In one embodiment, Figure 7 As shown, a picture classification device is provided, including: a vector generation module 400, a matching module 500 and an output module 600, wherein:

[0112] A vector generation module 400, configured to generate a comprehensive classification vector by using the classification vector generation method of any of the above embodiments;

[0113] A matching module 500, for matching the comprehensive classification vector with a standard vector in a database;

[0114] The output module 600 is used to obtain the classification label corresponding to the successfully matched standard vector as the classification label of the image data to be processed when the comprehensive classification vector successfully matches the standard vector in the database.

[0115] For the specific definition of the classification vector generating device, please refer to the definition of the classification vector generating method above, which will not be repeated here. Each module in the above classification vector generating device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.

[0116] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 8As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a classification vector generation method is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.

[0117] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0118] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the following steps when executing the computer program: obtaining image data to be processed, wherein the image data to be processed includes image data to be processed at multiple rotation angles; inputting the image data to be processed into a pre-trained classification network to extract feature vectors of multiple rotation angles corresponding to the image data to be processed; merging the extracted feature vectors of the multiple rotation angles to obtain a comprehensive classification vector, and the comprehensive classification vector is used to classify the image data to be processed to obtain corresponding classification labels.

[0119] In one embodiment, when a processor executes a computer program, the image data to be processed is input into a pre-trained classification network to extract feature vectors of multiple rotation angles corresponding to the image data to be processed, including: extracting an initial classification vector corresponding to the image data to be processed at each rotation angle; and performing dimensionality reduction processing on the initial classification vector to obtain a feature vector corresponding to each rotation angle.

[0120] In one embodiment, the processor executes a computer program to perform dimensionality reduction processing on the initial classification vector to obtain a feature vector corresponding to each rotation angle, including: inputting the initial classification vector into a fully connected layer and a normalization layer in sequence to perform dimensionality reduction processing on the initial classification vector to obtain a feature vector corresponding to each rotation angle.

[0121] In one embodiment, the processor executes a computer program to implement inputting the image data to be processed into a pre-trained classification network to extract feature vectors of multiple rotation angles corresponding to the image data to be processed, and also includes: splitting the image data to be processed to obtain image data to be processed at multiple rotation angles; and merging the image data to be processed at multiple rotation angles under the batch size dimension.

[0122] In one embodiment, the processor executes a computer program to split the image data to be processed to obtain the image data to be processed at multiple rotation angles, including: splitting the image data to be processed according to the channel dimension to obtain the image data to be processed at multiple rotation angles.

[0123] In one embodiment, the training method of the pre-trained classification network involved in the execution of a computer program by the processor includes: obtaining sample image data, the sample image data including sample image data at multiple rotation angles and corresponding sample labels; inputting the sample image data into the initial classification network to extract feature vectors of multiple rotation angles corresponding to the sample image data; calculating the angle loss function corresponding to each rotation angle according to the sample label and the feature vectors of the multiple rotation angles; calculating the comprehensive loss function according to the angle loss function; and performing gradient backpropagation through the comprehensive loss function to train the initial classification network until the change in the comprehensive loss function is less than a preset value, and the initial classification network training is completed.

[0124] In one embodiment, the processor executes a computer program to calculate a comprehensive loss function based on the angle loss function, including: calculating an average value corresponding to the angle loss function as the comprehensive loss function.

[0125] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the following steps when executing the computer program: generating a comprehensive classification vector by using the classification vector generation method of any of the above embodiments; matching the comprehensive classification vector with a standard vector in a database; when the comprehensive classification vector successfully matches the standard vector in the database, obtaining a classification label corresponding to the successfully matched standard vector as a classification label for image data to be processed.

[0126] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented: obtaining image data to be processed, the image data to be processed including image data to be processed at multiple rotation angles; inputting the image data to be processed into a pre-trained classification network to extract feature vectors of multiple rotation angles corresponding to the image data to be processed; merging the extracted feature vectors of the multiple rotation angles to obtain a comprehensive classification vector, and the comprehensive classification vector is used to classify the image data to be processed to obtain corresponding classification labels.

[0127] In one embodiment, when a computer program is executed by a processor, the image data to be processed is input into a pre-trained classification network to extract feature vectors of multiple rotation angles corresponding to the image data to be processed, including: extracting an initial classification vector corresponding to the image data to be processed at each rotation angle; and performing dimensionality reduction processing on the initial classification vector to obtain a feature vector corresponding to each rotation angle.

[0128] In one embodiment, when a computer program is executed by a processor, dimension reduction processing is performed on the initial classification vector to obtain a feature vector corresponding to each rotation angle, including: inputting the initial classification vector into a fully connected layer and a normalization layer in sequence to perform dimension reduction processing on the initial classification vector to obtain a feature vector corresponding to each rotation angle.

[0129] In one embodiment, the computer program implemented when executed by the processor inputs the image data to be processed into a pre-trained classification network to extract feature vectors of multiple rotation angles corresponding to the image data to be processed, and also includes: splitting the image data to be processed to obtain image data to be processed at multiple rotation angles; merging the image data to be processed at multiple rotation angles under the batch size dimension.

[0130] In one embodiment, when the computer program is executed by a processor, splitting the image data to be processed to obtain the image data to be processed at multiple rotation angles includes: splitting the image data to be processed according to the channel dimension to obtain the image data to be processed at multiple rotation angles.

[0131] In one embodiment, the training method of the pre-trained classification network involved in the execution of the computer program by the processor includes: obtaining sample image data, the sample image data including sample image data at multiple rotation angles and corresponding sample labels; inputting the sample image data into the initial classification network to extract feature vectors of multiple rotation angles corresponding to the sample image data; calculating the angle loss function corresponding to each rotation angle according to the sample label and the feature vectors of the multiple rotation angles; calculating the comprehensive loss function according to the angle loss function; and performing gradient backpropagation through the comprehensive loss function to train the initial classification network until the change in the comprehensive loss function is less than a preset value, and the initial classification network training is completed.

[0132] In one embodiment, when the computer program is executed by a processor, the comprehensive loss function is calculated based on the angle loss function, including: calculating the average value corresponding to the angle loss function as the comprehensive loss function.

[0133] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented: generating a comprehensive classification vector by using the classification vector generation method of any of the above embodiments; matching the comprehensive classification vector with a standard vector in a database; when the comprehensive classification vector successfully matches the standard vector in the database, obtaining a classification label corresponding to the successfully matched standard vector as a classification label for the image data to be processed.

[0134] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0135] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0136] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A classification vector generation method, characterized in that: The method comprises: Acquire image data to be processed, wherein the image data to be processed includes image data to be processed at multiple rotation angles; Inputting the image data to be processed into a pre-trained classification network to extract feature vectors of multiple rotation angles corresponding to the image data to be processed in parallel; The feature vectors of the extracted multiple rotation angles are combined to obtain a comprehensive classification vector, including: connecting the multiple feature vectors in order of rotation angle from small to large to obtain a comprehensive classification vector; the comprehensive classification vector is used to classify the image data to be processed to obtain a corresponding classification label; The step of inputting the image data to be processed into a pre-trained classification network to extract feature vectors of multiple rotation angles corresponding to the image data to be processed includes: Using a feature extraction network to extract an initial classification vector corresponding to the image data to be processed at each rotation angle; Performing dimensionality reduction processing on the initial classification vector to obtain a feature vector corresponding to each rotation angle; The dimensionality reduction process of the initial classification vector is performed to obtain a feature vector corresponding to each rotation angle, including: The initial classification vector is sequentially input into the fully connected layer and the normalization layer to perform dimension reduction processing on the initial classification vector to obtain a feature vector corresponding to each rotation angle.

2. The method according to claim 1, characterized in that Before inputting the image data to be processed into a pre-trained classification network to extract feature vectors of multiple rotation angles corresponding to the image data to be processed, the method further includes: Splitting the image data to be processed to obtain image data to be processed at multiple rotation angles; Merge the image data to be processed at multiple rotation angles in the batch size dimension.

3. The method according to claim 2, characterized in that The step of splitting the image data to be processed to obtain image data to be processed at multiple rotation angles includes: The image data to be processed is split according to the channel dimension to obtain image data to be processed at multiple rotation angles.

4. The method according to claim 1, characterized in that: The training method of the pre-trained classification network includes: Acquire sample image data, wherein the sample image data includes sample image data at multiple rotation angles and corresponding sample labels; Inputting the sample image data into an initial classification network to extract feature vectors of multiple rotation angles corresponding to the sample image data; According to the sample label and the feature vectors of multiple rotation angles, respectively calculate the angle loss function corresponding to each rotation angle; A comprehensive loss function is calculated according to the angle loss function; The initial classification network is trained by performing gradient backpropagation through the comprehensive loss function until the change of the comprehensive loss function is less than a preset value, and the training of the initial classification network is completed.

5. The method according to claim 4, characterized in that The calculating of the comprehensive loss function according to the angle loss function includes: The average value corresponding to the angle loss function is calculated as the comprehensive loss function.

6. A method for image classification, characterized in that: The method comprises: Generate a comprehensive classification vector by the classification vector generation method according to any one of claims 1 to 5; Matching the comprehensive classification vector with a standard vector in a database; When the comprehensive classification vector successfully matches the standard vector in the database, the classification label corresponding to the successfully matched standard vector is obtained as the classification label of the image data to be processed.

7. A classification vector generating device, characterized in that: The device comprises: A data acquisition module, used to acquire image data to be processed, wherein the image data to be processed includes image data to be processed at multiple rotation angles; A multi-angle feature generation module, used for inputting the image data to be processed into a pre-trained classification network to extract feature vectors of multiple rotation angles corresponding to the image data to be processed; A classification vector generation module, used for merging the extracted feature vectors of multiple rotation angles to obtain a comprehensive classification vector, including: connecting the multiple feature vectors in order from small to large rotation angles to obtain a comprehensive classification vector; the comprehensive classification vector is used to classify the image data to be processed to obtain a corresponding classification label; The multi-angle feature generation module comprises: An extraction unit, used for extracting an initial classification vector corresponding to the image data to be processed at each rotation angle by using a feature extraction network; A dimensionality reduction processing unit, used for performing dimensionality reduction processing on the initial classification vector to obtain a feature vector corresponding to each rotation angle; The dimension reduction processing unit is further used to input the initial classification vector into the fully connected layer and the normalization layer in sequence, so as to perform dimension reduction processing on the initial classification vector to obtain a feature vector corresponding to each rotation angle.

8. The device according to claim 7, characterized in that The device also includes: A splitting module, used for splitting the image data to be processed to obtain image data to be processed at multiple rotation angles; The merging module is used to merge the image data to be processed at multiple rotation angles in the batch size dimension.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 or 6 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 or 6 are implemented.