Deep learning-based non-motor vehicle attribute recognition method, device, medium and equipment
By constructing a non-motorized vehicle attribute recognition model with multiple single-attribute models and training it using overlapping feature blocks and a joint loss function, the problems of slow speed, low accuracy, and poor robustness in non-motorized vehicle attribute recognition are solved, achieving faster and more accurate attribute recognition.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GRG BANKING EQUIPMENT CO LTD
- Filing Date
- 2022-09-06
- Publication Date
- 2026-04-14
AI Technical Summary
Existing technologies for non-motorized vehicle attribute recognition suffer from problems such as slow speed, low accuracy, poor robustness, and mutual suppression of prediction capabilities for different attributes.
A non-motorized vehicle attribute recognition model is constructed, which is composed of multiple single attribute models. Each model includes a shared layer and a unique layer. The output features of the shared layer are divided into overlapping feature blocks according to the region through slicing operation. The model is trained using a training sample set and supervised by a joint loss function of Softmax loss and center loss.
It improves the speed and accuracy of non-motorized vehicle attribute recognition, reduces the model's memory usage, enhances the model's generalization and robustness, and solves the problems caused by attribute imbalance and negative correlation.
Smart Images

Figure CN115424218B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of big data technology, and in particular to a method, apparatus, medium and equipment for identifying non-motorized vehicle attributes based on deep learning. Background Technology
[0002] For short-distance travel, bicycles and electric bicycles have become the main mode of transportation for the general public due to their low cost and ease of operation. However, government departments face difficulties in managing, controlling, and effectively managing non-motorized vehicles. Existing technologies, leveraging big data to identify the attributes of non-motorized vehicles and generate structured data, can provide decision-making support for government departments involved in urban command, traffic, and comprehensive governance, thus assisting in the management and control of non-motorized vehicles.
[0003] Non-motorized vehicle attribute recognition technology is a computer vision technique that analyzes the morphological features of non-motorized vehicles and drivers to form structured data. Current methods for non-motorized vehicle attribute recognition directly place all attributes in the same network branch, mining shared representations between attributes through multi-task learning of hard parameter sharing. However, this method has the following shortcomings:
[0004] (1) Since the non-motorized vehicle targets obtained do not all have all the attributes in the attribute list, each target only has some of the attributes in the attribute list. The data distribution of the attributes is uneven, resulting in very poor accuracy for the few attributes.
[0005] (2) It fails to consider that the differences in the semantic layers of attributes will lead to different learning difficulties for different attributes. Placing all attributes in a single network branch ignores the negative correlation between attributes, which can cause the model's predictive ability for different attributes to suppress each other.
[0006] (3) Since the image regions and sizes corresponding to different attributes are different, and the semantic levels corresponding to different attributes are different, this method is difficult to learn more robust attribute features.
[0007] (4) The model training process is cumbersome and the speed of attribute recognition needs to be improved.
[0008] It is evident that existing technologies suffer from shortcomings in speed, accuracy, and robustness when identifying the attributes of non-motorized vehicles, as well as the tendency for different attributes to suppress each other's predictive capabilities. Summary of the Invention
[0009] This invention provides a method, apparatus, medium, and device for identifying non-motorized vehicle attributes based on deep learning, in order to solve the problems of poor speed, accuracy, robustness, and mutual suppression of the predictive capabilities of different attributes in the existing technology for identifying non-motorized vehicle attributes.
[0010] A method for identifying the attributes of non-motorized vehicles based on deep learning, the method comprising:
[0011] A non-motorized vehicle attribute recognition model is constructed, which is formed by the fusion of multiple single attribute models. Each single attribute model includes a shared layer and a unique layer. The shared layer of each single attribute model is the same, and the unique layer corresponds one-to-one with the single attribute model. The non-motorized vehicle attribute model also divides the output features of the shared layer into several overlapping feature blocks according to the region through a slicing operation. The overlapping feature blocks are used to identify single attributes related to the region.
[0012] Obtain a training sample set, which includes several image information, in which the non-motorized vehicle target in each image information has been labeled with attribute tags;
[0013] The single-attribute model is trained using the training sample set, and the trained single-attribute model is fused to obtain the non-motorized vehicle attribute recognition model.
[0014] Optionally, the non-motorized vehicle attribute model further divides the output features of the shared layer into several overlapping feature blocks according to the region through a slicing operation;
[0015] The overlapping feature blocks are used to identify single attributes related to the region.
[0016] Optionally, the shared layer is achieved by pruning MobilenetV1.
[0017] Optionally, the step of obtaining a training sample set includes several image information sets, and the non-motorized vehicle targets in each image information set have been labeled with attribute tags including:
[0018] Obtain original images for several application scenarios;
[0019] The SSD (Single Shot MultiBox Detector) detection algorithm is used to detect targets in the original image of the application scenario, and all non-motorized vehicle targets in the image are obtained.
[0020] The non-motorized vehicle targets are labeled with attribute tags.
[0021] Optionally, training the single-attribute model using the training sample set includes:
[0022] Modify the shared layer category parameter of a single attribute model in the non-motor vehicle attribute recognition model to the first attribute type;
[0023] The modified single-attribute model is trained using the training sample set and supervised by a joint loss function of Softmax loss and center loss to obtain the first attribute model.
[0024] Optionally, training the single-attribute model using the training sample set includes:
[0025] Modify the shared layer category parameter of a single attribute model in the non-motorized vehicle attribute recognition model to a second attribute type;
[0026] A single attribute model with the second attribute type as the category parameter of the shared layer is initialized based on the first attribute model to obtain the second attribute model;
[0027] Freeze the shared layer in the second attribute model;
[0028] The second attribute model is trained using the training sample set and supervised using a joint loss function of Softmax loss and center loss to obtain the second attribute model.
[0029] Optionally, the overlapping feature blocks are divided into regions, including at least a top feature block and a middle feature block;
[0030] When the overlapping feature block is a top feature block or a middle feature block, training the single-attribute model using the training sample set includes:
[0031] Modify the shared layer category parameter of a single attribute model in the non-motorized vehicle attribute recognition model to a third attribute type;
[0032] A single attribute model with a third attribute type as the category parameter of the shared layer is initialized based on the first attribute model to obtain the third attribute model;
[0033] Freeze the shared layer in the third attribute model;
[0034] The third attribute model is trained using the training sample set and supervised using a joint loss function of Softmax loss and center loss to obtain the third attribute model.
[0035] A non-motorized vehicle attribute recognition device based on deep learning, the device comprising:
[0036] A construction module is used to construct a non-motorized vehicle attribute recognition model. The non-motorized vehicle attribute recognition model is formed by the fusion of multiple single attribute models. Each single attribute model includes a shared layer and a unique layer. The shared layer of each single attribute model is the same, and the unique layer corresponds one-to-one with the single attribute model.
[0037] The acquisition module is used to acquire a training sample set, which includes several image information, and the non-motorized vehicle targets in each image information have been labeled with attribute tags;
[0038] The training module is used to train the single-attribute model using the training sample set, and to fuse the trained single-attribute model to obtain the non-motorized vehicle attribute recognition model.
[0039] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the deep learning-based non-motor vehicle attribute recognition method described above.
[0040] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the deep learning-based non-motor vehicle attribute recognition method as described above.
[0041] This invention has three improvements by constructing a non-motorized vehicle attribute recognition model:
[0042] First, the non-motorized vehicle attribute recognition model is formed by the fusion of multiple single attribute models. Each single attribute model includes a shared layer and a unique layer. The shared layer of each single attribute model is the same and can run synchronously, thereby effectively improving the speed of non-motorized vehicle attribute recognition.
[0043] Secondly, the unique layer corresponds one-to-one with the single attribute model, which makes the non-motor vehicle attribute recognition model more focused on a single attribute, which is conducive to improving the accuracy of attribute recognition.
[0044] Third, during training, a training sample set is acquired, which includes several image information sets, each containing non-motorized vehicle targets with attribute labels. The non-motorized vehicle attribute recognition model is trained using this training sample set. First, single-attribute models are trained, then multiple single-attribute models are fused together, and finally a model capable of recognizing all attributes of non-motorized vehicles is obtained. This not only solves the problem of poor model performance caused by imbalanced samples of different attributes, but also avoids the influence of negative correlations between attributes, greatly improving the model's speed, reducing its memory usage, and ensuring the model's accuracy, generalization, and robustness. Attached Figure Description
[0045] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0046] Figure 1 This is a flowchart of a non-motorized vehicle attribute recognition method based on deep learning provided in an embodiment of the present invention;
[0047] Figure 2 This is a schematic diagram of the structure of a single attribute model provided in an embodiment of the present invention;
[0048] Figure 3 This is a flowchart of step S102 in a deep learning-based non-motorized vehicle attribute recognition method provided in an embodiment of the present invention;
[0049] Figure 4 This is a schematic diagram of a feature block layer provided in an embodiment of the present invention;
[0050] Figure 5 This is a flowchart of the overall algorithm for non-motorized vehicle attribute recognition provided in an embodiment of the present invention;
[0051] Figure 6 This is a schematic diagram of the structure of a non-motorized vehicle attribute recognition device based on deep learning according to an embodiment of the present invention;
[0052] Figure 7 This is a schematic diagram of a computer device according to an embodiment of the present invention. Detailed Implementation
[0053] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0054] In constructing a deep learning-based non-motorized vehicle attribute recognition model, this invention innovatively prunes the MobilnetV1 structure to obtain a shared layer for a single-attribute model, resulting in a more accurate and faster non-motorized vehicle attribute recognition model. Secondly, leveraging the prior knowledge that different regions of the non-motorized vehicle target image contain different attributes, overlapping feature blocks are designed for training on region-related attributes. This allows the network's learning to focus more on different image locations, improving the accuracy of the model related to region-related attributes. Regarding model training, firstly, single-attribute models are trained, then the models are fused, and finally, a single attribute model is obtained to recognize all attributes of non-motorized vehicles. This achieves the recognition of all non-motorized vehicle attributes by a single model, not only solving the problem of poor model performance caused by imbalanced samples of different attributes but also avoiding the influence of negative correlations between attributes. This significantly improves the model's speed, reduces its memory usage, and ensures the model's accuracy, generalization, and robustness.
[0055] The following is a detailed description of the deep learning-based non-motorized vehicle attribute recognition method provided in this embodiment. For example... Figure 1 As shown, the deep learning-based non-motorized vehicle attribute recognition method includes:
[0056] In step S101, a non-motorized vehicle attribute recognition model is constructed.
[0057] The non-motorized vehicle attribute recognition model is composed of multiple single-attribute models. Each single-attribute model includes a shared layer and a unique layer, wherein the shared layer of each single-attribute model is identical. For example, the shared layer can be obtained by pruning a lightweight deep neural network, MobileNetV1. The unique layer corresponds one-to-one with each single-attribute model.
[0058] Unlike existing technologies, the non-motorized vehicle attribute recognition model provided in this embodiment of the invention is composed of multiple single-attribute models. Each single-attribute model is used to identify a single attribute. The attributes identified by each single-attribute model are fused together and used as the output of the non-motorized vehicle attribute recognition model. Each single-attribute model includes a shared layer and a unique layer. The shared layer of each single-attribute model is uniform and can be obtained by trimming MobilenetV1, thereby achieving a higher accuracy and faster non-motorized vehicle attribute recognition model. The unique layer corresponds to a single attribute; that is, the structure of the unique layer of different single-attribute models is related to the attribute to be identified. The structure of the unique layer of each single-attribute model is different, and each single-attribute model is used to identify only one attribute, which helps to improve the accuracy of attribute recognition. Optionally, for ease of understanding, Figure 2 This is a schematic diagram of the structure of a single-attribute model provided in an embodiment of the present invention. Figure 2 As can be seen, the single attribute model includes a shared layer and a unique layer.
[0059] Furthermore, in this embodiment of the invention, the non-motorized vehicle attribute model further segments the output features of the shared layer into several overlapping feature blocks according to regions through a slicing operation. These overlapping feature blocks are used to identify single attributes related to a region. This embodiment of the invention utilizes the prior knowledge that different regions of the non-motorized vehicle target image contain different attributes to design overlapping feature blocks for training on region-related attributes. This makes the network's learning more focused on different image locations, which is beneficial for improving the model accuracy for region-related attributes.
[0060] In step S102, a training sample set is obtained, which includes several image information, and the non-motorized vehicle targets in each image information have been labeled with attribute tags.
[0061] In this embodiment of the invention, each image information in the training sample set is labeled with a non-motorized vehicle target attribute label. It should be understood that each image information may include one, more, or all of the attribute labels; this is not limited here. Optionally, as a preferred example of the invention, such as... Figure 3 As shown, step S102 further includes:
[0062] In step S1021, several original images of application scenarios are acquired.
[0063] Optionally, embodiments of the present invention acquire original images of the application scenario from cameras installed at locations such as roadsides, sidewalks, and intersections.
[0064] In step S1022, the SSD detection algorithm is used to perform target detection on the original image of the application scenario to obtain all non-motorized vehicle targets in the image.
[0065] The SSD detection algorithm, short for Single Shot MultiBox Detector, is a fast single-shot object detector for multiple categories. It is used to obtain all non-motorized vehicle targets from the original image of the application scenario.
[0066] In step S1023, attribute labels are added to the non-motorized vehicle target.
[0067] After identifying non-motorized vehicle targets in the original images of the application scenario, corresponding attribute labels are assigned to the attributes of the non-motorized vehicle targets, and the non-motorized vehicle targets are associated with the attribute labels. This process is repeated for each original image of the application scenario, and finally, the original images of the application scenario, their non-motorized vehicle targets, and their attribute labels are combined to form a training sample set.
[0068] In step S103, the single-attribute model is trained using the training sample set, and the trained single-attribute model is fused to obtain the non-motorized vehicle attribute recognition model.
[0069] Here, in this embodiment of the invention, a single-attribute model is trained based on a single attribute, and then all trained single-attribute models are fused to obtain the non-motorized vehicle attribute recognition model. This not only solves the problem of poor model performance caused by imbalance of different attribute samples, but also avoids the influence of negative correlation between attributes, greatly improving the speed of attribute recognition by the model.
[0070] Optionally, in this embodiment of the invention, the non-motorized vehicle attributes include several types. This embodiment further divides the attributes into several types, namely a first attribute type, a second attribute type, and a third attribute type, and trains the single attribute model according to different attribute types. As a preferred example of the invention, for the first attribute type, training the single attribute model using the training sample set in step S103 includes:
[0071] In step 401, the shared layer category parameter of a single attribute model in the non-motor vehicle attribute recognition model is modified to the first attribute type.
[0072] The structure of the single-attribute model is as described above and will not be repeated here. Modifying the category parameter of the shared layer of the single-attribute model to the first attribute category indicates that the single-attribute model is a model used to identify the first attribute type.
[0073] In step S402, the modified single-attribute model is trained using the training sample set, and supervised by a joint loss function of the fully connected layer loss function Softmax loss and the center loss function, to obtain the first attribute model.
[0074] After modifying the category, the training sample set obtained in step S102 is input into the single-attribute model described in step S401 to train the single-attribute model for recognizing the first attribute type. During training, a joint loss function of Softmax loss and center loss is used for supervised training, wherein the joint loss function is as follows:
[0075]
[0076] In the above formula, L S L represents the softmax loss. C Let x represent center loss. iThis represents the i-th depth feature, which belongs to the y-th depth feature. i Class, W j The j-th column represents the weight W of the last fully connected layer, b represents the bias term, m represents the batch size, n represents the number of classes, and c represents the weight W. yi Indicates the yth i The feature centers of the class, λ serves as a balance between the two loss functions.
[0077] As a preferred embodiment of the present invention, for the second attribute type, the step S103 of training the single attribute model using the training sample set includes:
[0078] In step S501, the shared layer category parameter of a single attribute model in the non-motor vehicle attribute recognition model is modified to a second attribute type.
[0079] The structure of the single-attribute model is as described above and will not be repeated here. Modifying the category of the shared layer of the single-attribute model to the second attribute category indicates that the single-attribute model is a model used to identify the second attribute type.
[0080] In step S502, a single attribute model with a shared layer category parameter of the second attribute type is initialized based on the first attribute model to obtain the second attribute model.
[0081] Here, in this embodiment of the invention, the trained first attribute model is used to initialize the single attribute model obtained in step S501 to obtain the prototype of the second attribute model.
[0082] In step S503, the shared layer in the second attribute model is frozen.
[0083] Freezing the shared layer in the second attribute model means keeping the parameters of the shared layer in the second attribute model unchanged. That is, when training the second attribute model in step S504, the shared layer of the second attribute model does not participate in the training, which is beneficial to improving the training speed of the model.
[0084] In step S504, the second attribute model is trained using the training sample set, and supervised by a joint loss function of Softmax loss and center loss to obtain the second attribute model.
[0085] After modifying the category, the training sample set obtained in step S102 is input into the second attribute model described in step S503 to perform recognition training for the second attribute type. During the training process, a joint loss function of Softmax loss and center loss is used for supervised training. For details of the joint loss function, please refer to the description in the above embodiment, which will not be repeated here.
[0086] Optionally, taking non-motorized vehicle attribute recognition as an example, the attribute types include, but are not limited to, driver age type, driver gender type, number of drivers type, non-motorized vehicle direction type, and non-motorized vehicle type; the first attribute type and the second attribute type are divided according to actual training needs. As a preferred embodiment of the present invention, the first attribute type includes driver age type; the second attribute type includes driver gender type, number of drivers type, non-motorized vehicle direction type, or non-motorized vehicle type. As another preferred embodiment of the present invention, the first attribute type includes driver gender type; the second attribute type includes driver age type, number of drivers type, non-motorized vehicle direction type, or non-motorized vehicle type.
[0087] As a preferred embodiment of the present invention, for the third attribute type, this embodiment further segments the feature image output by the shared layer according to the region based on the location information of the third attribute type in the image, obtaining overlapping feature blocks. The overlapping feature blocks, segmented by region, include at least a top feature block and a middle feature block, and may also include a bottom feature block. For ease of understanding, Figure 4 This is a schematic diagram of feature segmentation provided in an embodiment of the present invention.
[0088] Optionally, when the overlapping feature block is a top feature block or a middle feature block, the step S103 of training the single-attribute model using the training sample set includes:
[0089] In step S601, the shared layer category parameter of a single attribute model in the non-motor vehicle attribute recognition model is modified to a third attribute type.
[0090] The structure of the single-attribute model is as described above and will not be repeated here. Modifying the shared layer category parameter of the single-attribute model to a third attribute category indicates that the single-attribute model is used to identify the third attribute type.
[0091] In step S602, a single attribute model with a shared layer category parameter of the third attribute type is initialized based on the first attribute model to obtain the third attribute model.
[0092] Here, in this embodiment of the invention, the trained first attribute model is used to initialize the single attribute model obtained in step S601 to obtain the prototype of the third attribute model.
[0093] In step S603, the shared layer in the third attribute model is frozen.
[0094] Similarly, freezing the shared layer in the third attribute model means keeping the parameters of the shared layer in the third attribute model unchanged. That is, when training the third attribute model in step S604, the shared layer of the third attribute model does not participate in the training, which is beneficial to improving the training speed of the model.
[0095] In step S604, the third attribute model is trained using the training sample set and supervised using a joint loss function of Softmax loss and center loss to obtain the third attribute model.
[0096] After modifying the category, the training sample set obtained in step S102 is input into the third attribute model described in step S603 to perform training for the recognition of the third attribute type. During the training process, a joint loss function of Softmax loss and center loss is used for supervised training. For details of the joint loss function, please refer to the description in the above embodiment, which will not be repeated here.
[0097] Optionally, taking non-motorized vehicle attribute recognition as an example, the attribute type may also include whether the driver is wearing a hat, the color of the driver's hat, the color of the driver's upper body, and the length of the driver's sleeves. As a preferred embodiment of the present invention, when the overlapping feature block is the top feature block, the third attribute type includes whether the driver is wearing a hat and / or the color of the driver's hat;
[0098] When the overlapping feature block is a central feature block, the third attribute type includes the driver's upper body color and / or the driver's long / short sleeve information.
[0099] Here, in this embodiment of the invention, the driver age type model is trained using the method of steps S401 to S402. Then, the driver hat type model and the driver hat color type model are initialized and trained using the driver age type model. The driver upper body color type model and the driver long / short sleeve information type model are trained in the same way.
[0100] After obtaining the driver age type model, driver gender type model, driver number type model, non-motorized vehicle direction type model, non-motorized vehicle type model, driver hat type model, driver hat color type model, driver upper body color type model, and driver long / short sleeve information type model, these models are combined to obtain the non-motorized vehicle attribute recognition model. For ease of understanding, Figure 5This is the overall algorithm flow for non-motorized vehicle attribute recognition provided in this embodiment of the invention. Since the single attribute models share the same shared layer, when running the non-motorized vehicle attribute recognition model, the shared layer of each single attribute model can be executed synchronously. Then, after obtaining the shared layer output, each single attribute model executes its own unique layer sequentially. Compared to each single attribute model executing the entire process independently, this significantly improves the overall speed of attribute recognition.
[0101] In summary, this invention innovatively prunes the MobilnetV1 structure to obtain a shared layer for a single-attribute model when constructing a deep learning-based non-motorized vehicle attribute recognition model, resulting in a higher-precision and faster non-motorized vehicle attribute network. Secondly, by utilizing the prior knowledge that different regions of the non-motorized vehicle target image contain different attributes, overlapping feature blocks are designed for training on region-related attributes, making the network's learning more focused on different image locations and improving the accuracy of the model related to region-related attributes. Regarding model training, firstly, single-attribute models are trained, then the models are fused, and finally, a model that recognizes all attributes of non-motorized vehicles is obtained. This achieves the recognition of all non-motorized vehicle attributes by a single model, which not only solves the problem of poor model performance caused by imbalanced samples of different attributes but also avoids the influence of negative correlations between attributes, greatly improving the model's speed, reducing its memory usage, and ensuring its accuracy, generalization, and robustness.
[0102] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0103] In one embodiment, the present invention also provides a non-motorized vehicle attribute recognition device based on deep learning, which corresponds one-to-one with the non-motorized vehicle attribute recognition method based on deep learning in the above embodiments. For example... Figure 6 As shown, the deep learning-based non-motorized vehicle attribute recognition device includes a construction module 61, an acquisition module 62, and a training module 63. Detailed descriptions of each functional module are as follows:
[0104] Module 61 is used to construct a non-motorized vehicle attribute recognition model. The non-motorized vehicle attribute recognition model is formed by the fusion of multiple single attribute models. Each single attribute model includes a shared layer and a unique layer. The shared layer of each single attribute model is the same, and the unique layer corresponds one-to-one with the single attribute model.
[0105] The acquisition module 62 is used to acquire a training sample set, which includes several image information, and the non-motorized vehicle targets in each image information have been labeled with attribute tags;
[0106] Training module 63 is used to train the single attribute model using the training sample set, and to fuse the trained single attribute model to obtain the non-motor vehicle attribute recognition model.
[0107] Optionally, the non-motorized vehicle attribute model further divides the output features of the shared layer into several overlapping feature blocks according to the region through a slicing operation;
[0108] The overlapping feature blocks are used to identify single attributes related to the region.
[0109] Optionally, the shared layer is obtained by cutting MobilenetV1.
[0110] Optionally, the acquisition module 62 includes:
[0111] The acquisition unit is used to acquire original images for several application scenarios;
[0112] The detection unit is used to perform target detection on the original image of the application scenario using the SSD (Single Shot MultiBox Detector) detection algorithm to obtain all non-motorized vehicle targets in the image;
[0113] The annotation unit is used to annotate attribute labels on the non-motorized vehicle target.
[0114] Optionally, the training module 63 includes:
[0115] The first modification unit is used to modify the shared layer category parameter of a single attribute model in the non-motor vehicle attribute recognition model to the first attribute type;
[0116] The first training unit is used to train the modified single-attribute model using the training sample set and supervise it using a joint loss function of Softmax loss and center loss to obtain the first attribute model.
[0117] Optionally, the training module 63 includes:
[0118] The first modification unit is used to modify the shared layer category parameter of a single attribute model in the non-motor vehicle attribute recognition model to a second attribute type;
[0119] The first initialization unit is used to initialize a single attribute model with a shared layer category parameter of the second attribute type based on the first attribute model, so as to obtain the second attribute model.
[0120] The first freezing unit is used to freeze the shared layer in the second attribute model;
[0121] The second training unit is used to train the second attribute model using the training sample set and supervise it using a joint loss function of Softmax loss and center loss to obtain the second attribute model.
[0122] Optionally, the overlapping feature blocks are divided into regions, including at least a top feature block and a middle feature block;
[0123] When the overlapping feature block is a top feature block or a middle feature block, the training module 63 includes:
[0124] The third modification unit is used to modify the shared layer category parameter of a single attribute model in the non-motor vehicle attribute recognition model to a third attribute type;
[0125] The second initialization unit is used to initialize a single attribute model with a shared layer category parameter of the third attribute type based on the first attribute model, so as to obtain the third attribute model.
[0126] The second freezing unit is used to freeze the shared layer in the third attribute model;
[0127] The third training unit is used to train the third attribute model using the training sample set and supervise it using a joint loss function of Softmax loss and center loss to obtain the third attribute model.
[0128] Specific limitations regarding the deep learning-based non-motorized vehicle attribute recognition device can be found in the limitations of the deep learning-based non-motorized vehicle attribute recognition method described above, and will not be repeated here. Each module in the aforementioned deep learning-based non-motorized vehicle attribute recognition device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in memory as software, so that the processor can call and execute the corresponding operations of each module.
[0129] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 7As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used for communication with external terminals via a network connection. When executed by the processor, the computer program implements a deep learning-based method for non-motorized vehicle attribute recognition.
[0130] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the following steps:
[0131] A non-motorized vehicle attribute recognition model is constructed, which is composed of multiple single attribute models. Each single attribute model includes a shared layer and a unique layer. The shared layer of each single attribute model is the same, and the unique layer corresponds one-to-one with the single attribute model.
[0132] Obtain a training sample set, which includes several image information, in which the non-motorized vehicle target in each image information has been labeled with attribute tags;
[0133] The single-attribute model is trained using the training sample set, and the trained single-attribute model is fused to obtain the non-motorized vehicle attribute recognition model.
[0134] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided by this invention can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), and direct memory bus dynamic RAM.
Claims
1. A method for identifying the attributes of non-motorized vehicles based on deep learning, characterized in that, The method includes: A non-motorized vehicle attribute recognition model is constructed, which is formed by fusing multiple single attribute models. Each single attribute model includes a shared layer and a unique layer, wherein the shared layer of each single attribute model is the same, and the unique layer corresponds one-to-one with the single attribute model. The non-motorized vehicle attribute recognition model also uses a slicing operation to divide the output features of the shared layer into several overlapping feature blocks according to the region. The overlapping feature blocks are used to identify single attributes related to the region. The overlapping feature blocks are divided according to the region and include at least a top feature block and a middle feature block. Obtain a training sample set, which includes several image information, in which the non-motorized vehicle target in each image information has been labeled with attribute tags; The single-attribute model is trained using the training sample set, and the trained single-attribute models are fused to obtain the non-motorized vehicle attribute recognition model. Each single-attribute model is used to recognize a single attribute. The attributes recognized by each single-attribute model are fused and used as the output of the non-motorized vehicle attribute recognition model. The single-attribute models have the same shared layer. When running the non-motorized vehicle attribute recognition model, the shared layer of each single-attribute model is executed synchronously. After obtaining the output of the shared layer, each single-attribute model executes its own unique layer in sequence. The step of training the single-attribute model using the training sample set includes: The shared layer category parameter of a single attribute model in the non-motor vehicle attribute recognition model is modified to the first attribute type; the modified single attribute model is trained using the training sample set, and supervised by the joint loss function of the fully connected layer loss function Softmax loss and the center loss function, to obtain the first attribute model; The step of training the single-attribute model using the training sample set includes: The shared layer category parameters of a single attribute model in the non-motorized vehicle attribute recognition model are modified to the second attribute type; a single attribute model with shared layer category parameters of the second attribute type is initialized based on the first attribute model to obtain the second attribute model; the shared layer in the second attribute model is frozen; the second attribute model is trained using the training sample set and supervised by the joint loss function of the fully connected layer loss function Softmax loss and the center loss function centerloss to obtain the second attribute model. When the overlapping feature block is a top feature block or a middle feature block, training the single attribute model using the training sample set includes: modifying the shared layer category parameter of a single attribute model in the non-motorized vehicle attribute recognition model to a third attribute type; initializing a single attribute model with the shared layer category parameter of the third attribute type based on the first attribute model to obtain the third attribute model; freezing the shared layer in the third attribute model; training the third attribute model using the training sample set, and supervising it using a joint loss function of the fully connected layer loss function Softmax loss and the center loss function to obtain the third attribute model.
2. The non-motorized vehicle attribute recognition method based on deep learning as described in claim 1, characterized in that, The shared layer is obtained by pruning the lightweight deep neural network MobilenetV1.
3. The non-motorized vehicle attribute recognition method based on deep learning as described in claim 1, characterized in that, The acquisition of the training sample set includes several image information sets, and the attribute labels of the non-motorized vehicle targets in each image information set include: Obtain original images for several application scenarios; The SSD detection algorithm is used to perform target detection on the original image of the application scenario to obtain all non-motorized vehicle targets in the image; The non-motorized vehicle targets are labeled with attribute tags.
4. A non-motorized vehicle attribute recognition device based on deep learning, characterized in that, The device includes: A construction module is used to construct a non-motorized vehicle attribute recognition model. This model is formed by fusing multiple single-attribute models. Each single-attribute model includes a shared layer and a unique layer. The shared layer of each single-attribute model is identical, and the unique layer corresponds one-to-one with each single-attribute model. The non-motorized vehicle attribute recognition model also uses a slicing operation to divide the output features of the shared layer into several overlapping feature blocks according to regions. These overlapping feature blocks are used to identify single attributes related to regions. The overlapping feature blocks, when divided by region, include at least a top feature block and a middle feature block. The acquisition module is used to acquire a training sample set, which includes several image information, and the non-motorized vehicle targets in each image information have been labeled with attribute tags; The training module is used to train the single-attribute model using the training sample set, and to fuse the trained single-attribute models to obtain the non-motorized vehicle attribute recognition model. Each single-attribute model is used to recognize a single attribute. The attributes recognized by each single-attribute model are fused and used as the output of the non-motorized vehicle attribute recognition model. The single-attribute models have the same shared layer. When running the non-motorized vehicle attribute recognition model, the shared layer of each single-attribute model is executed synchronously. After obtaining the output of the shared layer, each single-attribute model executes its own unique layer in sequence. Wherein, training the single-attribute model using the training sample set is used for: The shared layer category parameter of a single attribute model in the non-motor vehicle attribute recognition model is modified to the first attribute type; the modified single attribute model is trained using the training sample set, and supervised by the joint loss function of the fully connected layer loss function Softmax loss and the center loss function, to obtain the first attribute model; The training of the single-attribute model using the training sample set is used for: The shared layer category parameters of a single attribute model in the non-motorized vehicle attribute recognition model are modified to the second attribute type; a single attribute model with shared layer category parameters of the second attribute type is initialized based on the first attribute model to obtain the second attribute model; the shared layer in the second attribute model is frozen; the second attribute model is trained using the training sample set and supervised by the joint loss function of the fully connected layer loss function Softmax loss and the center loss function centerloss to obtain the second attribute model. When the overlapping feature block is a top feature block or a middle feature block, the step of training the single attribute model using the training sample set is used to: modify the shared layer category parameter of a single attribute model in the non-motor vehicle attribute recognition model to a third attribute type; initialize a single attribute model with the shared layer category parameter of the third attribute type based on the first attribute model to obtain the third attribute model; freeze the shared layer in the third attribute model; train the third attribute model using the training sample set, and supervise it using a joint loss function of the fully connected layer loss function Softmax loss and the center loss function to obtain the third attribute model.
5. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the deep learning-based non-motor vehicle attribute recognition method as described in any one of claims 1 to 3.
6. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the deep learning-based non-motor vehicle attribute recognition method as described in any one of claims 1 to 3.
Citation Information
Patent Citations
Vehicle attribute identification method and device based on neural network, equipment and medium
CN109635656A
Vehicle re-identification method based on multi-branch deep learning
CN110084139A
Vehicle detection method and device, computer equipment and storage medium
CN111144372A
Dangerous goods vehicle identification method, system and device and medium
CN112200231A
Vehicle identification method and device and storage medium
CN114708575A