City vehicle method for tracing based on fast area convolutional neural networks
Technical field
The present invention relates to image procossing, machine learning field, be specifically related to a kind of based on fast area convolution god
City vehicle method for tracing through network.
Background technology
In VS recognition methods, typically all carry out moving object segmentation, after background removal, obtain institute
Some moving object, is identified each moving object.This method is simply effective, but in video
If moving object is more, environment is more complicated, and this method will be interfered, and accuracy rate is relatively low.
In image object detection method, region convolutional neural networks effect is fine, and this method first obtains very
Multiple target assumes region, is then identified all of goal hypothesis region.But due to a pictures target
Assuming that region great majority are overlapping, cause substantial amounts of computing repeatedly, therefore the algorithm speed of service is relatively slow,
Inefficient, it is not suitable for Video processing.
During the training of neutral net, all have employed the mode that GPU accelerates, this mode compares CPU
The fast hundred times of mode, however, still needs several hours for catenet training, the training time
The longest tracking degree of difficulty is the highest, and this is the most inapplicable for the demand of training network model within the shortest time,
In the case of algorithm is constant, using GPU cluster training pattern is best solution.
Summary of the invention
For solving shortcoming and defect of the prior art, the present invention proposes a kind of based on fast area convolution god
Through the city vehicle method for tracing of network, set up fast area convolutional neural networks, and use bigger data
Collection carries out pre-training, demarcates vehicle to be followed the trail of in video, is entered into training network in neutral net
Model, uses the network model trained to scan in the search radius of prediction, once finds this vehicle,
Just use and continue to follow the trail of vehicle by the mode of route search.
The technical scheme is that and be achieved in that:
A kind of city vehicle method for tracing based on fast area convolutional neural networks, including network training and car
Follow the trail of two processes;
In network training process, set up a kind of fast area convolutional neural networks;
During car tracing, use by half path search and the mode that combines by route search;
Obtain pre-training model by pre-training, monitor video marks vehicle to be followed the trail of, is inputted
In fast area convolutional neural networks, pre-training model is adjusted, quickly obtains final mask;
Then use and follow the trail of vehicle by radius and the mode combined by route search, map marks all discoveries
The position of this vehicle, connects sequentially in time, obtains vehicle driving trace, according to the pre-measuring car of driving trace
The position that will arrive.
Alternatively, in network training process, set up a kind of fast area convolutional neural networks, concrete steps
For:
(11) set up complete convolutional neural networks, input an image in complete convolutional neural networks, at volume
Last layer long-pending obtains characteristic pattern;
(12) the characteristic pattern enterprising line slip scanning obtained in last convolution, the network of slip is every time and feature
On figure, the window of n*n connects entirely, is then mapped to a low dimensional vector;
(13) described low dimensional vector is finally sent to two full articulamentums, i.e. box returns layer and box divides
Class layer.
Alternatively, during car tracing, use by half path search and the mode that combines by route search,
Concretely comprise the following steps:
(21) after training network model and obtaining final mask, pass through the consumed time and work as Front St
District's speed situation, it was predicted that the maximum distance that vehicle can travel, determines search radius, enters in search radius
Line search;
(22) in search radius, once find this vehicle, with this crossing as initial point, diffuse to this crossing energy
All crossings of enough connections, continue search for the monitor video at these crossings.
Alternatively, in the training stage of neural network model, Spark cluster is trained neutral net.
Alternatively, use Spark cluster to be trained, concretely comprise the following steps:
(31) use bigger, general data set to carry out pre-training, initialize the weight of neutral net;
(32) demarcate vehicle to be followed the trail of, be input in neutral net, the model of pre-training is adjusted
Whole, quickly obtain final model.
Alternatively, directly use existing convolutional neural networks, add up-samples, of parameter at end
Practise the backpropagation principle utilizing convolutional neural networks itself.
The invention has the beneficial effects as follows:
(1) convolutional neural networks learns good feature automatically, and accuracy rate is the highest, avoids people simultaneously
The limitation of work selected characteristic, decreases the manual operation of complexity, adapts to ability higher;
(2) identifying that aspect is chosen in region, be different from moving object segmentation, the method is to find video image
In all possible object be identified rather than the object of all motions, also can have under complex environment
Well adapt to ability;
(3) in Spark cluster, train neutral net, increase substantially training speed, can be the shortest
Final training pattern is obtained in time;
(4) employing is scanned for by radius and the mode combined by route, can search for targetedly
Possible region, reduces unnecessary work;
(5) convolutional neural networks can input the picture of arbitrary size completely, it is not necessary to enters video resolution
Row sum-equal matrix, it is easier to all of monitor video of adaptation.
Accompanying drawing explanation
In order to be illustrated more clearly that the embodiment of the present invention or technical scheme of the prior art, below will be to enforcement
In example or description of the prior art, the required accompanying drawing used is briefly described, it should be apparent that, describe below
In accompanying drawing be only some embodiments of the present invention, for those of ordinary skill in the art, do not paying
On the premise of going out creative work, it is also possible to obtain other accompanying drawing according to these accompanying drawings.
Fig. 1 is the flow chart of present invention city vehicle based on fast area convolutional neural networks method for tracing;
Fig. 2 is fast area convolutional neural networks structure chart of the present invention.
Detailed description of the invention
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clearly
Chu, be fully described by, it is clear that described embodiment be only a part of embodiment of the present invention rather than
Whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art are not making creation
The every other embodiment obtained under property work premise, broadly falls into the scope of protection of the invention.
Chase after as it is shown in figure 1, the present invention proposes a kind of city vehicle based on fast area convolutional neural networks
Track method, is divided into network training and two processes of car tracing.
In network training process, set up a kind of fast area convolutional neural networks, as in figure 2 it is shown, specifically
Step is:
(11) set up complete convolutional neural networks, input an image in complete convolutional neural networks, at volume
Last layer long-pending obtains characteristic pattern;
(12) the characteristic pattern enterprising line slip scanning that a little network obtains is used in last convolution, this
The network slided is connected with the window of n*n on characteristic pattern every time entirely, and usual n value is 3, is then mapped to one
Individual low dimensional vector;
(13) this low dimensional vector is finally sent to two full articulamentums, i.e. box returns layer and box divides
Class layer.
During car tracing, use by half path search with by the mode that route search combines, specifically walk
Suddenly it is:
(21) after training network model, consumed time and current block speed situation are passed through,
The maximum distance that prediction vehicle can travel, determines search radius, scans in this search radius;
(22) in search radius, once find this vehicle, with this crossing as initial point, diffuse to this crossing energy
All crossings of enough connections, continue search for the monitor video at these crossings.
The method of the present invention sets up fast area convolutional neural networks, uses bigger data set to carry out pre-training
Obtain pre-training model, monitor video mark vehicle to be followed the trail of, is entered in neutral net,
Pre-training model is adjusted, quickly obtains final mask.Then use and press radius and by route search
The mode combined follows the trail of vehicle, marks the position of all this vehicles of discovery, sequentially in time on map
Connect, it is possible to obtain vehicle driving trace, and can predict what vehicle will arrive according to driving trace
Position.
The method of the present invention directly uses existing convolutional neural networks, adds up-samples, parameter at end
Study utilize the backpropagation principle of convolutional neural networks itself.
Preferably, in the training stage of neural network model, Spark cluster is trained neutral net, specifically
Step is:
(31) use bigger, general data set to carry out pre-training, initialize the weight of neutral net;
(32) demarcate vehicle to be followed the trail of, be input in neutral net, the model of pre-training is adjusted
Whole, quickly obtain final model.
Present invention city vehicle based on fast area convolutional neural networks method for tracing, sets up fast area volume
Long-pending neutral net, will produce goal hypothesis region, identify in object two Process fusions to the network of region,
Not only reduce red tape, also speeded up the speed of service so that it is real-time video analysis can be carried out;Press
Half path search and combining by the mode of route search, can search target vehicle more efficiently;?
Spark cluster is trained neutral net, increases substantially training speed, within the shortest time, complete training,
Improve the success rate of search.
The present invention can be tracked for the hit-and-run vehicle in city, cannot determine car plate is covered
In the case of information of vehicles, according to the resemblance of vehicle, train neutral net, analyze the prison at each crossing
Control video, is accurately positioned escape vehicle, and this method saves substantial amounts of manual labor, it is to avoid owing to seeing
The person's of examining fatigue is omitted vehicle and is occurred that picture loses the situation of target, and convolutional neural networks accuracy rate is the highest,
In the case of a crossing multi-frame video image recognition, it is ensured that identify this vehicle.
The foregoing is only presently preferred embodiments of the present invention, not in order to limit the present invention, all at this
Within bright spirit and principle, any modification, equivalent substitution and improvement etc. made, should be included in this
Within bright protection domain.