A kind of road Edge Detection based on deep learning
Technical field
The invention belongs to intelligent driving technical fields, are related under a kind of special scenes of computer vision combination deep learning
Object detection method.
Background technique
Road Edge check is one of automatic Pilot field and the important component in active safety field, it can be helped certainly
It is dynamic to drive the current travelable region of vehicle identification and judge routing information.
Due to the significance of road Edge check, for such issues that, lot of domestic and international mechanism has been presented for a part
Detection method, and existing road edge sense technology mostly be to be realized based on 3D laser radar, mostly according to roadside along with it is feasible
The height change between road is sailed to detect roadside edge, the limitation of this detection method is as follows:
(1) price of 3D laser radar is relatively high, and large-scale application has certain difficulty;
(2) the roadside edge of no clear geometrical characteristic and difference in height can not be identified;
In fact, many efficient algorithm of target detection have been emerged at present with the development of depth learning technology, but
Regrettably these algorithm of target detection satisfy the need this occupancy pixel in edge it is few, without clear geometrical characteristic and be continuous linear
Target is simultaneously not suitable for.
Summary of the invention
For the limitation of the prior art, the road Edge Detection based on deep learning that the present invention provides a kind of,
The image data obtained using vehicle-mounted high-definition camera extracts different piece in image using the convolutional neural networks of multitask
Information merges disappearance dot position information, and Preliminary detection goes out road edge portions therein, satisfies the need edge further according to road region information
Information further judges to enhance the robustness of algorithm.
To achieve the above object, the technical solution adopted in the present invention is as follows:
(1) acquire real roads on include roadside edge image data, and by artificial mask method mark wherein with road
The position of the relevant target of Edge check and classification information construct the data set of road Edge check;
(2) building is suitable for the multitask convolutional neural networks and corresponding loss function of road Edge check;
(3) acquired image and labeled data are input in the convolutional neural networks of step (2) building, according to output
Penalty values between value and target value are updated the parameter value in neural network, when penalty values converge to its global minimum
When, save final network parameter.
Optionally, in step (1), the acquisition of image data and annotation step are as follows:
(1-1) demarcates the inside and outside parameter of camera;
(1-2) is directed to the roadside being likely to occur under actual condition along type, the roadside edge of acquisition is divided into following several: true
Real visible roadside edge, roadside along side there are barrier, non-genuine visible roadside along etc.;
The classification of (1-3) image data mark is broadly divided into following several: background can travel region, and roadside edge is non-feasible
Sail region, barrier etc.;Wherein, virtual roadside is marked out along position using manual identified for non-genuine visible roadside edge
It sets;
(1-4) is labeled acquired image data using annotation tool, and notation methods include but is not limited to pixel
Grade mark, grid mark.
Optionally, in step (2), building suitable for the multitask convolutional neural networks of road Edge check and corresponding
Steps are as follows for loss function:
(2-1) constructs roadside along feature extraction network, and the image information for that will input carries out feature extraction and feature is compiled
Code, obtain it is multiple dimensioned, can be used for road Edge check, road vanishing Point Detection Method and road area detection sharing feature floor;
(2-2) constructs road vanishing Point Detection Method network, to the further convolution of sharing feature layer obtained in step (2-1),
The disappearance dot position information of road can be obtained by its output layer;
(2-3) constructs road edge and detects network, first by sharing feature layer obtained in step (2-1) and step (2-
2) output layer that road end point is detected obtained in, which is connected, obtains the input layer of road edge detection network;To this input layer into
Row up-sampling, can be obtained road side information by final output layer;
(2-4) constructs road area and detects network, carries out down-sampling to output layer obtained in step (2-3) first and incites somebody to action
This result is connected to obtain the input layer of road area detection network with sharing feature layer obtained in step (2-1), to this input
Layer is up-sampled, and road region information can be obtained by final output layer;
(2-5) building is suitable for the target detection loss function of class imbalance, for calculating the detection of road end point
Loss, and influence caused by the imbalance of the ratio of end point and background in sample can be inhibited;
(2-6) constructs cross entropy loss function, for calculating the road edge position information of road edge detection network output
With the loss of actual position information;
(2-7) constructs cross entropy loss function, for calculating the road area of road area detection network output and true
Loss between road area.
Optionally, in step (3), training network the step of it is as follows:
Acquired image is carried out data prediction by (3-1), and key step includes: to turn over image into row stochastic level
Turn, cut and uniformly zoom to fixed size, labeled data is also overturn accordingly, cut and scaled, on this basis
Obtained image is normalized by channel;
(3-2) carries out pre-training, obtained parameter value to above-mentioned network using SoftMax loss function on ImageNet
Initial parameter as network;
Vanishing Point Detection Method network and road Edge check are connected to the network by (3-3), by pretreated picture and labeled data
It is input in network, the road end point of network output is calculated using the loss function constructed in step (2-5), step (2-6)
And the penalty values of road edge placement and actual position, parameter value is updated, when penalty values converge to its global minimum,
Save current network parameter;
Road edge sence network is connected by (3-4) with road area detection network, utilizes the loss constructed in step (2-7)
Function calculates the penalty values between network output road area and real road region, and into one on the basis of step (3-3)
The parameter that step carries out network updates, and obtains final result.
By adopting the above scheme, the beneficial effects of the present invention are:
The first, sensor of the present invention is monocular camera, the road Edge Detection kind before price is opposite
Used 3D laser radar is very cheap, facilitates practical popularization, the application of detection method;
The second, multitask network of the present invention takes full advantage of the information of road end point, so that roadside is along inspection
The input layer of survey grid network contains more characteristic informations, enhances the robustness of algorithm;
Third, multitask network of the present invention use the output of road edge sence network in conjunction with shared characteristic layer
In detection road area to update again to parameter value, the accuracy of identification is increased;
4th, depth convolutional neural networks of the present invention also have the roadside edge without clear geometrical characteristic
Good detection effect.
Detailed description of the invention
Fig. 1 is the overall construction drawing of multitask convolutional neural networks of the present invention.
Fig. 2 is roadside of the present invention along feature extraction network structure.
Fig. 3 is road vanishing Point Detection Method network structure of the present invention.
Fig. 4 is Edge check network structure in road of the present invention.
Fig. 5 is that road area of the present invention detects network structure.
Specific embodiment
The road Edge Detection based on deep learning that the present invention provides a kind of, this method is with depth convolutional neural networks
Based on, and merged the accuracy of road Vanishing Point Information and road region information enhancing road Edge check.Detailed network
Structure is as shown in Figure 1.Method includes the following steps:
(1) acquire real roads on include roadside edge image data, and by artificial mask method mark wherein with road
The position of the relevant target of Edge check and classification information construct the data set of road Edge check;
(2) building is suitable for the multitask convolutional neural networks and corresponding loss function of road Edge check;
(3) acquired image and labeled data are input in the convolutional neural networks of step (2) building, according to output
Penalty values between value and target value are updated the parameter value in neural network, finally obtain ideal network ginseng
Number;
Optionally, in step (1), the acquisition of image data and annotation step are as follows:
(1-1) demarcates the inside and outside ginseng of camera, and calibration internal reference is demarcated for eliminating pattern distortion caused by camera lens
For outer ginseng for determining that the point of the road surface on image is corresponding in position in the real world, calibration process can refer to chessboard method, with to
Calibration camera shoots the image that multiple include chessboard calibration plate, then inputs in the tool box Calibration of Matlab, obtains
To the inside and outside ginseng of camera;
(1-2) is directed to the roadside being likely to occur under actual condition along type, the roadside edge of acquisition is divided into following several: true
, there is the roadside edge of barrier on one side in real visible roadside edge, non-genuine visible roadside along etc..It is equipped with the number of camera
Acquisition image data is travelled in real roads according to collecting vehicle, and is acquired under different weather, light conditions to increase
The richness of data;
The classification of (1-3) image data mark is broadly divided into following several: background, road area, and roadside edge is non-to can travel
Region, barrier etc.;Wherein, background parts are the part such as sky etc. that this method is not concerned with;Road area is the feasible of vehicle
Sail region;There is the roadside edge of barrier along true visible roadside edge is divided into roadside, non-genuine visible roadside edge on one side,
Wherein for there are the roadside of barrier edges to mark out obstacle information, manual identified is utilized for non-genuine visible roadside edge
Mark out virtual road edge placement;Non- travelable region is except road area but on the influential area of judgement road edge placement
Domain, such as pavement;
(1-4) is labeled acquired image data using annotation tool, and notation methods include but is not limited to pixel
Grade mark, grid mark.Marked content includes each classification being previously mentioned in step (1-3), and annotation tool can be used
Computer Vision Annotation Tool (CVAT), the tool can carry out Pixel-level to video and image data
Mark, while it can be deployed in page end, facilitate multiple person cooperational;
In step (2), building suitable for road Edge check multitask convolutional neural networks and lose letter accordingly
Steps are as follows for number:
(2-1) constructs roadside along feature extraction network, and the image information for that will input carries out feature extraction and feature is compiled
Code can be used for the sharing feature floor of road Edge check, road vanishing Point Detection Method and road area detection.The network structure of this part
As shown in Fig. 2, extracting the RGB information of each pixel in image first with conventional image procossing library, a spy is formed
Levy tensor, the sharing feature layer that the characteristic tensor of input is exported after 3 down-samplings.Wherein single down-sampling is adopted
Sample multiple is 2, by a maximum pond layer, convolutional layer and an a kind of ReLu (activation that a convolution kernel size is 3 × 3
Function) active coating constitute.
(2-2) constructs road vanishing Point Detection Method network, to the further convolution of sharing feature layer obtained in step (2-1),
The disappearance dot position information of road can be obtained by its output layer.The network structure of this part is as shown in figure 3, input layer is passing through two
The convolutional layer that a convolution kernel size is 1 × 1 exports end point hotspot graph;
(2-3) constructs road edge and detects network, as shown in figure 4, first by sharing feature layer obtained in step (2-1)
It is connected with the output layer for detecting road end point obtained in step (2-2), i.e., folds two tensors in its third dimension
Add to obtain the input layer of road edge detection network.2 up-samplings are carried out to this input layer, it is 2 that single, which up-samples multiple, is above adopted
Quadrat method is deconvolution, and score of each pixel in roadside on mark is exported after a logical full articulamentum, to obtain road
The location information at edge;
(2-4) constructs road area and detects network, as shown in figure 5, obtaining after up-sampling first to 2 times in step (2-3)
Output layer carry out 2 down-samplings, the step of down-sampling and method is with the down-sampling in (2-1), and by this result and step (2-
1) sharing feature layer obtained in is connected, i.e., is superimposed two tensors in its third dimension, obtains road area detection net
The input layer of network carries out 2 up-samplings to this input layer, and it is 2 that single, which up-samples multiple, and top sampling method is deconvolution, and is passed through
It crosses a full articulamentum and exports score of each pixel on road area mark, to obtain road region information;
(2-5) building is suitable for the target detection loss function of class imbalance, for calculating the detection of road end point
Loss, and influence caused by the imbalance of the ratio of end point and background in sample can be inhibited;
(2-6) constructs cross entropy loss function, for calculating the road edge position information of road edge detection network output
With the loss of actual position information;
(2-7) constructs cross entropy loss function, for calculating the road area of road area detection network output and true
Loss between road area.
In step (3), training network the step of it is as follows:
Acquired image is carried out data prediction by (3-1), and key step includes: to turn over image into row stochastic level
Turn, cut and uniformly zoom to fixed size, labeled data is also overturn accordingly, cut and scaled, on this basis
Obtained image is normalized by channel, the fixed dimension used in the present embodiment is 2048 × 1024;
(3-2) on ImageNet using SoftMax loss function satisfy the need side information extract network carry out pre-training, obtain
Initial parameter of the parameter value arrived as network;
Vanishing Point Detection Method network and road Edge check are connected to the network by (3-3), by pretreated picture and labeled data
It is input in network, the road end point of network output is calculated using the loss function constructed in step (2-5), step (2-6)
And the penalty values of road edge placement and actual position, it carries out backpropagation and calculates gradient, and update network using Adam optimizer
Parameter saves current network parameter when penalty values converge to its global minimum;
Road edge sence network is connected by (3-4) with road area detection network, utilizes the loss constructed in step (2-7)
Penalty values between function calculating network output road area and real road region, progress backpropagation calculating gradient, and
It is updated on the basis of step (3-3) using the parameter of Adam optimizer further progress network, obtains final result.
In short, the present invention provides a kind of road Edge Detection based on deep learning, to various visible and non-visible
Roadside along suffering from preferable detectability.
Person skilled in the art obviously easily can make various modifications to these embodiments, and saying herein
Bright General Principle is applied in other embodiments without having to go through creative labor.Therefore, the present invention is not limited to here
Embodiment, those skilled in the art's announcement according to the present invention, improvement and modification made without departing from the scope of the present invention are all answered
This is within protection scope of the present invention.