City vehicle method for tracing based on fast area convolutional neural networks
Technical field
The present invention relates to image procossing, machine learning fields, and in particular to one kind is based on fast area convolutional neural networks
City vehicle method for tracing.
Background technique
In video object recognition methods, moving object segmentation is typically carried out, obtains all fortune after background removal
Animal body identifies each moving object.This method is simple and effective, but in video if moving object is more,
Environment is more complicated, and this method will be interfered, and accuracy rate is lower.
In image object detection method, region convolutional neural networks effect is fine, and this method first obtains many targets
Assuming that region, then identifies all goal hypothesis regions.But since most of picture goal hypothesis region is
Overlapping, it causes and largely computes repeatedly, therefore the algorithm speed of service is slower, efficiency is lower, is not suitable for video processing.
In the training process of neural network, all by the way of GPU acceleration, this mode is faster than cpu mode several hundred
Times, however, still being needed several hours for catenet training, the training time is longer, and tracking degree of difficulty is higher,
This is also not suitable for the demand of the training network model within the shortest time, in the case where algorithm is constant, uses GPU cluster
Training pattern is best solution.
Summary of the invention
To solve shortcoming and defect in the prior art, the invention proposes one kind to be based on fast area convolutional neural networks
City vehicle method for tracing, establish fast area convolutional neural networks, and carry out pre-training using biggish data set, regarding
The vehicle to be tracked is demarcated in frequency, is entered into training network model in neural network, is existed using trained network model
It is scanned in the search radius of prediction, once finding the vehicle, just uses and continue to track vehicle in the way of route search.
The technical scheme of the present invention is realized as follows:
A kind of city vehicle method for tracing based on fast area convolutional neural networks, including network training and car tracing
Two processes;
In network training process, a kind of fast area convolutional neural networks are established;
During car tracing, by the way of being combined by half path search and by route search;
Pre-training model is obtained by pre-training, the vehicle to be tracked is marked in monitor video, is entered into quickly
In the convolutional neural networks of region, it is adjusted on pre-training model, quickly obtains final mask;Then it uses by radius and presses
The mode that route search combines tracks vehicle, and all positions for finding the vehicle are marked on map, are connected sequentially in time
It connects, obtains vehicle driving trace, the position that vehicle will reach is predicted according to driving trace.
Optionally, in network training process, a kind of fast area convolutional neural networks, specific steps are established are as follows:
(11) complete convolutional neural networks are established, are input an image into complete convolutional neural networks, convolution last
Layer obtains characteristic pattern;
(12) carry out slip scan on the characteristic pattern that last convolution obtains, the network of sliding every time with n*n on characteristic pattern
Window connect entirely, be then mapped to a low-dimensional vector;
(13) the low-dimensional vector is finally sent to two full articulamentums, i.e. box returns layer and box classification layer.
Optionally, specific to walk by the way of being combined by half path search and by route search during car tracing
Suddenly are as follows:
(21) after training network model and obtaining final mask, pass through consumed time and current block speed shape
Condition, the maximum distance that prediction vehicle can travel, determines search radius, scans in search radius;
(22) once finding the vehicle in search radius, using this crossing as origin, diffuse to what this crossing can be connected to
All crossings continue searching the monitor video at these crossings.
Optionally, in the training stage of neural network model, the training neural network on Spark cluster.
Optionally, it is trained using Spark cluster, specific steps are as follows:
(31) pre-training is carried out using biggish, general data set, initializes the weight of neural network;
(32) vehicle to be tracked is demarcated, is input in neural network, is adjusted on the model of pre-training, quick
To final model.
Optionally, existing convolutional neural networks are directly used, add up-samples at end, the study of parameter utilizes volume
The backpropagation principle of product neural network itself.
The beneficial effects of the present invention are:
(1) convolutional neural networks learn good feature automatically, and accuracy rate is very high, while it is special to avoid artificial selection
The limitation of sign, reduces complicated manual operation, and adaptability is stronger;
(2) in terms of identification region selection, be different from moving object segmentation, the method be find video image in it is all can
The object of energy is identified, rather than the object of all movements, and ability can be also well adapted under complex environment;
(3) the training neural network in Spark cluster, increases substantially training speed, can obtain within the shortest time
To final training pattern;
(4) it is scanned for, can targetedly be searched for most possible by the way of being combined by radius and by route
Region, reduce unnecessary work;
(5) convolutional neural networks can input the picture of arbitrary size completely, not need to be adjusted video resolution,
It is easier to adapt to all monitor videos.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with
It obtains other drawings based on these drawings.
Fig. 1 is that the present invention is based on the flow charts of the city vehicle method for tracing of fast area convolutional neural networks;
Fig. 2 is fast area convolutional neural networks structure chart of the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other
Embodiment shall fall within the protection scope of the present invention.
As shown in Figure 1, the invention proposes a kind of city vehicle method for tracing based on fast area convolutional neural networks,
It is divided into two processes of network training and car tracing.
In network training process, a kind of fast area convolutional neural networks are established, as shown in Fig. 2, specific steps are as follows:
(11) complete convolutional neural networks are established, are input an image into complete convolutional neural networks, convolution last
Layer obtains characteristic pattern;
(12) slip scan is carried out on the characteristic pattern that last convolution obtains using a small network, the net of this sliding
Network is connect with the window of n*n on characteristic pattern entirely every time, and usual n value is 3, is then mapped to a low-dimensional vector;
(13) this low-dimensional vector is finally sent to two full articulamentums, i.e. box returns layer and box classification layer.
During car tracing, by the way of being combined by half path search and by route search, specific steps are as follows:
(21) after training network model, by consumed time and current block speed situation, vehicle is predicted
The maximum distance that can be travelled, determines search radius, scans in this search radius;
(22) once finding the vehicle in search radius, using this crossing as origin, diffuse to what this crossing can be connected to
All crossings continue searching the monitor video at these crossings.
Method of the invention establishes fast area convolutional neural networks, is obtained using biggish data set progress pre-training pre-
Training pattern marks the vehicle to be tracked in monitor video, is entered into neural network, carries out on pre-training model
Adjustment, quickly obtains final mask.Then vehicle is tracked by the way of combining by radius and by route search, on map
Mark is found the position of the vehicle, connects sequentially in time, so that it may obtain vehicle driving trace, and can basis
The position that driving trace prediction vehicle will reach.
Method of the invention directly uses existing convolutional neural networks, adds up-samples, the study of parameter at end
Utilize the backpropagation principle of convolutional neural networks itself.
Preferably, in the training stage of neural network model, training neural network, specific steps on Spark cluster are as follows:
(31) pre-training is carried out using biggish, general data set, initializes the weight of neural network;
(32) vehicle to be tracked is demarcated, is input in neural network, is adjusted on the model of pre-training, quick
To final model.
The present invention is based on the city vehicle method for tracing of fast area convolutional neural networks, establish fast area convolutional Neural
Network will generate two goal hypothesis region, identification region object Process fusions into a network, not only reduce cumbersome
Program has also speeded up the speed of service, allows to carry out real-time video analysis;By half path search and the phase in the way of route search
In conjunction with can more efficiently search target vehicle;The training neural network in Spark cluster increases substantially training speed
Degree completes training within the shortest time, improves the success rate of search.
The present invention can be tracked for the hit-and-run vehicle in city, can not determine that vehicle is believed license plate is covered
In the case where breath, according to the resemblance of vehicle, training neural network analyzes the monitor video at each crossing, accurate positionin is escaped
Escape vehicle, and this method saves a large amount of manual labor, avoids since picture loss occurs in observer's fatigue omission vehicle
The case where target, and convolutional neural networks accuracy rate is very high, can be in the case where a crossing multi-frame video image recognition
Guarantee identifies the vehicle.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the invention, all in essence of the invention
Within mind and principle, any modification, equivalent replacement, improvement and so on be should all be included in the protection scope of the present invention.