Disclosure of Invention
Based on this, the embodiment of the invention provides a method and a system for detecting a lane line of a rainy and snowy crown block based on a generation countermeasure network, which can accurately detect the position of the lane line in rainy and snowy weather and are suitable for scenes with unknown number of lane lines.
In order to achieve the purpose, the invention provides the following scheme:
a rain and snow crown block lane line detection method based on a generation countermeasure network comprises the following steps:
acquiring a target image in rainy and snowy weather;
inputting the target image into a rain and snow trace removing model to obtain a trace removing image of the target image; the rain and snow trace removing model is obtained by training a generated countermeasure network by adopting a first training set; the first training set comprises lane line images added with rain and snow marks;
inputting the trace-removed image of the target image into a lane line feature extraction model to obtain lane line pixel points of the target image and lane line high-dimensional features of the target image; the lane line feature extraction model is obtained by training a convolutional neural network model by adopting a second training set; the second training set is an image obtained by removing the trace of the first training set by adopting the rain and snow trace removing model; the convolutional neural network model comprises an encoder, and a semantic segmentation branch and an example segmentation branch which are respectively connected with the encoder; the semantic division branch is used for outputting lane line pixel points of the second training set; the example division branch is used for outputting lane line high-dimensional features of the second training set; the example division branch comprises a first convolution layer, a second convolution layer and an upper sampling layer which are connected in sequence;
based on the lane line high-dimensional characteristics of the target image, clustering lane line pixel points of the target image by adopting a clustering algorithm to obtain a lane line example;
and performing segmentation fitting on the lane line example to obtain the lane line of the target image.
Optionally, the determination method of the rain and snow trace removing model includes:
acquiring the first training set;
constructing the generative confrontation network; the generation countermeasure network comprises a generation network and a judgment network which are connected in sequence; the generation network comprises a first volume block, a residual error structure and a second volume block which are connected in sequence; the first convolution block includes a convolution layer; the residual error structure comprises four residual error blocks which are sequentially connected in series; the second convolution block comprises three convolution layers which are connected in series in sequence; the discriminating network comprises a third volume block and a full connection layer; the third convolution block comprises five convolution layers which are sequentially connected in series;
inputting the first training set into the generation network, and inputting the trace-removed images of the first training set output by the first training set and the generation network into the discrimination network for training to obtain a trained generation countermeasure network; and the trained generated confrontation network is the rain and snow trace removal model.
Optionally, the determining method of the lane line feature extraction model is as follows:
acquiring the second training set;
constructing the convolutional neural network model; the encoder is an ENet encoder; the semantic division branch is an ENet decoder embedded with an attention mechanism in each upsampling process;
inputting the second training set into the encoder, and inputting the image features output by the encoder into the semantic segmentation branch and the example segmentation branch respectively for training to obtain a trained convolutional neural network model; and the trained convolutional neural network model is the lane line characteristic extraction model.
Optionally, the clustering, based on the high-dimensional characteristics of the lane line of the target image, the clustering is performed on the lane line pixel points of the target image by using a clustering algorithm to obtain a lane line example, which specifically includes:
screening the lane line pixel points of the target image by using confidence;
and clustering the screened lane line pixel points by adopting a noise density-based clustering method according to the lane line high-dimensional characteristics of the target image to obtain a lane line example.
Optionally, the performing segment fitting on the lane line example to obtain the lane line of the target image specifically includes:
segmenting the lane line examples according to positions to obtain lane line examples on the upper half part of the image and lane line examples on the lower half part of the image;
and respectively fitting the lane line examples of the upper half part of the image and the lane line examples of the lower half part of the image by adopting a random sampling consistency algorithm and combining a least square method to obtain the lane lines of the target image.
The invention also provides a rain and snow crown block lane line detection system based on the generation countermeasure network, which comprises the following steps:
the image acquisition module is used for acquiring a target image in rainy and snowy weather;
the trace removing module is used for inputting the target image into a rain and snow trace removing model to obtain a trace removing image of the target image; the rain and snow trace removing model is obtained by training a generated countermeasure network by adopting a first training set; the first training set comprises lane line images added with rain and snow traces;
the image extraction module is used for inputting the trace-removed image of the target image into a lane line feature extraction model to obtain lane line pixel points of the target image and lane line high-dimensional features of the target image; the lane line feature extraction model is obtained by training a convolutional neural network model by adopting a second training set; the second training set is an image obtained by removing the trace of the first training set by adopting the rain and snow trace removing model; the convolutional neural network model comprises an encoder, and a semantic segmentation branch and an example segmentation branch which are respectively connected with the encoder; the semantic division branch is used for outputting lane line pixel points of the second training set; the example division branch is used for outputting lane line high-dimensional features of the second training set; the example division branch comprises a first convolution layer, a second convolution layer and an upper sampling layer which are connected in sequence;
the clustering module is used for clustering lane line pixel points of the target image by adopting a clustering algorithm based on the lane line high-dimensional characteristics of the target image to obtain a lane line example;
and the segmentation fitting module is used for performing segmentation fitting on the lane line example to obtain the lane line of the target image.
Optionally, the system for detecting a lane line of a rainy or snowy overhead traveling crane based on a generation countermeasure network further includes: a first model determination module; the first model determining module is used for determining the rain and snow trace removing model; the first model determining module specifically includes:
a first training set acquisition unit configured to acquire the first training set;
a generation countermeasure network construction unit for constructing the generation countermeasure network; the generation countermeasure network comprises a generation network and a judgment network which are connected in sequence; the generation network comprises a first volume block, a residual error structure and a second volume block which are connected in sequence; the first convolution block includes a convolution layer; the residual error structure comprises four residual error blocks which are sequentially connected in series; the second convolution block comprises three convolution layers which are sequentially connected in series; the discriminating network comprises a third volume block and a full connection layer; the third convolution block comprises five convolution layers which are sequentially connected in series;
the first model training unit is used for inputting the first training set into the generation network, and inputting trace-removed images of the first training set output by the first training set and the generation network into the discrimination network for training to obtain a trained generation countermeasure network; and the trained generated confrontation network is the rain and snow trace removal model.
Optionally, the system for detecting a lane line of a rainy and snowy crown block based on a generation countermeasure network further includes: a second model determination module; the second model determining module is used for determining the lane line feature extraction model; the second model determining module specifically includes:
a second training set obtaining unit, configured to obtain the second training set;
the convolutional neural network model building unit is used for building the convolutional neural network model; the encoder is an ENet encoder; the semantic division branch is an ENet decoder embedded with an attention mechanism in each upsampling process;
the second model training unit is used for inputting the second training set into the encoder, and inputting the image characteristics output by the encoder into the semantic segmentation branch and the example segmentation branch respectively for training to obtain a trained convolutional neural network model; and the trained convolutional neural network model is the lane line characteristic extraction model.
Optionally, the clustering module specifically includes:
the screening unit is used for screening the lane line pixel points of the target image by adopting the confidence coefficient;
and the pixel point clustering unit is used for clustering the screened lane line pixel points according to the lane line high-dimensional characteristics of the target image by adopting a noise density-based clustering method to obtain a lane line example.
Optionally, the piecewise fitting module specifically includes:
the segmentation unit is used for segmenting the lane line examples according to positions to obtain lane line examples on the upper half part of the image and lane line examples on the lower half part of the image;
and the fitting unit is used for respectively fitting the lane line examples on the upper half part of the image and the lane line examples on the lower half part of the image by adopting a random sampling consensus algorithm and combining a least square method to obtain the lane lines of the target image.
Compared with the prior art, the invention has the beneficial effects that:
the embodiment of the invention provides a rain and snow crown block lane line detection method and system based on a generated countermeasure network, wherein rain and snow traces in a target image are removed by adopting a rain and snow trace removal model obtained by training the generated countermeasure network in a first training set, then lane line characteristic extraction models obtained by training a convolutional neural network model in a second training set are adopted to extract lane lines of the trace removal image, example segmentation branches are introduced into the convolutional neural network model to prepare for subsequent clustering, and finally different lane lines are distinguished according to high-dimensional characteristics of the lane lines by using a clustering algorithm, so that the detection of the rain and snow crown block lane lines is completed. The rain and snow trace removing model enables the lane line position to be accurately detected in the rain and snow weather, and the lane line feature extracting model is combined with the clustering algorithm to enable the method to be suitable for scenes with unknown lane line quantity.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
Fig. 1 is a flowchart of a method for detecting a lane line of a rainy and snowy overhead traveling crane based on a generation countermeasure network according to an embodiment of the present invention. Referring to fig. 1, the method of the present embodiment includes:
step 101: and acquiring a target image in rainy and snowy weather.
Step 102: inputting the target image into a rain and snow trace removal model to obtain a trace removal image of the target image; the rain and snow trace removing model is obtained by training a generated countermeasure network by adopting a first training set; the first training set includes lane line images with added rain and snow marks (rain marks and snowflakes).
The determination method of the rain and snow trace removal model comprises the following steps:
1) And acquiring the first training set.
2) Constructing the generative confrontation network; the generation countermeasure network comprises a generation network and a discrimination network which are connected in sequence. Generating a network as shown in fig. 2, referring to fig. 2, the generating network includes a first convolution block, a residual structure, and a second convolution block, which are connected in sequence; the first volume block comprises a convolution layer (convolution layer 1); the residual structure comprises four residual blocks (a residual block 1, a residual block 2, a residual block 3 and a residual block 4) which are sequentially connected in series; the second convolution block comprises three convolution layers (convolution layer 2, convolution layer 3 and convolution layer 4) which are connected in series in sequence; the intermediate layer of the generating network uses the PRelu activation function and the output layer uses the tanh activation function. The discrimination network is shown in fig. 3, referring to fig. 3, and includes a third convolution block and a full connection layer; the third convolutional block includes five convolutional layers (convolutional layer 1, convolutional layer 2, convolutional layer 3, convolutional layer 4, and convolutional layer 5) connected in series in this order. The discrimination network is formed by connecting five convolution layers and a full connection layer in series for down sampling, and is output after being activated by a sigmoid function.
3) Inputting the first training set into the generation network, and inputting the trace-removed images of the first training set output by the first training set and the generation network into the discrimination network for training to obtain a trained generation countermeasure network; and the trained generated confrontation network is the rain and snow trace removal model. The specific training process is as follows: and comparing the images in the first training set corresponding to the trace-removed image rain of the first training set output by the generation network under the current iteration number, judging whether the images are true or false, determining the generated confrontation network corresponding to the current iteration number as the trained generated confrontation network when the judgment result is true, and adjusting the parameters of the generation network and the judgment network when the judgment result is false to carry out the next iteration.
Step 103: inputting the trace-removed image of the target image into a lane line feature extraction model to obtain lane line pixel points of the target image and lane line high-dimensional features of the target image; the lane line feature extraction model is obtained by training a convolutional neural network model by adopting a second training set; the convolutional neural network model comprises an encoder, and a semantic segmentation branch and an instance segmentation branch which are respectively connected with the encoder.
And the second training set is an image obtained by removing the trace of the first training set by adopting the rain and snow trace removing model. Taking a trace-removed image of the target image as an input of the encoder, wherein the encoder processes the trace-removed image so as to output image characteristics; the semantic segmentation branch is used for processing image features and outputting lane line pixel points of the second training set; the example segmentation branch is used for processing image features and outputting lane line high-dimensional features of the second training set; the example division branch comprises a first convolution layer, a second convolution layer and an upper sampling layer which are connected in sequence. The first convolution layer and the second convolution layer are both 3 x 3 convolution layers, and the excitation layer uses the ReLu activation function. The lane line high-dimensional features are features for distinguishing different lane lines, and the lane line high-dimensional features provide for subsequent clustering to distinguish different lane lines.
The method for determining the lane line feature extraction model comprises the following steps:
1) And acquiring the second training set.
2) And constructing the convolutional neural network model, wherein the structure of the convolutional neural network model is shown in FIG. 4. The encoder is an ENet encoder. The semantic segmentation branch is an ENet decoder with an attention mechanism embedded in each upsampling process, and specifically, the main branch of each upsampled BottleNeck module of the ENet decoder is connected with the attention mechanism in series to obtain the semantic segmentation branch. This embodiment refers to the attentive-bottleeck module as the attentive-bottleeck module, and the structure of the attentive-bottleeck module in the down-sampling process is shown in fig. 5.
3) Inputting the second training set into the encoder, inputting the image features output by the encoder into the semantic segmentation branch and the example segmentation branch respectively, and training by taking the minimum semantic segmentation loss function and the minimum example segmentation loss function as targets to obtain a trained convolutional neural network model; and the trained convolutional neural network model is the lane line feature extraction model.
The specific training process is as follows: inputting a second training set corresponding to the current iteration times into an encoder, and outputting training image characteristics by the encoder; training image features are respectively used as input of a semantic segmentation branch and an example segmentation branch, the semantic segmentation branch outputs training lane line pixel points, the example segmentation branch outputs training lane line high-dimensional features, whether a semantic segmentation loss function and an example segmentation loss function are minimum under the current iteration frequency is judged, if yes, a corresponding convolutional neural network model under the current iteration frequency is determined to be a trained convolutional neural network model, and if not, parameters of an encoder, the semantic segmentation branch and the example segmentation branch are adjusted, and next iteration is carried out. Under the condition of bisection, the final result to be predicted of the model has only two conditions, for each category, the probability obtained by prediction is p and 1-p, a dichotomy cross entropy function is adopted as a semantic segmentation loss function to calculate the loss, and the formula is as follows:
wherein L isbinRepresenting semantic segmentation loss, yiLabel representing pixel i, 1 representing lane line pixel, 0 representing background pixel, N representing number of pixels, piAnd representing the probability that the pixel point i belongs to the lane line.
For example division branches, in order to make the clustering effect better, points belonging to the same lane need to be close to each other, and points belonging to different lanes need to be far from each other. The example segmentation loss function comprises two terms of a variance term (variance term) and a distance term (distance term), wherein the variance term has the function of generating a pulling force acting inside the same cluster, and points in the same cluster are gathered towards the center of the cluster through the pulling force; the effect of the distance term is to create a repulsive force between the different clusters of the action domain, by which the different clusters are moved away from each other. Variance term L in clustering loss functionvarAnd the distance term LdistCalculating the distance between feature points using a second order norm, the total loss LinstanceThe weighted sum of the losses generated for the variance term and the distance term is formulated as follows:
in the above formula, C is the number of lanes, CARepresenting any one lane, CBIs represented by the formula CADifferent arbitrary lane lines, NcIs the number of feature points in the corresponding cluster, xiFeature vectors corresponding to feature points output for a branched network, [ x ]]+Denotes max (0, x), μcRepresents the mean vector of cluster C. Delta. For the preparation of a coatingvIndicating the range of action of the pulling force inside the cluster. The distance between the feature point and the intra-cluster mean is less than δvWhen the time variance term is zero, the internal tension of the cluster is also zero. DeltadRepresenting the range of action of repulsion forces between clusters, the inter-cluster distance being greater than deltadThe time distance term is zero and the cluster repulsion is zero. In this example deltavIs 0.5, deltadIs 3. Lambda1And λ2Is the weight of the distance term and the variance term, λ in this embodiment1、λ2The values are all 1.
In practical application, the size of an input image is 512 multiplied by 256, the batch size is 64 and the learning rate is a constant value of 0.0005 during the training of the convolutional neural network model, an Adam optimizer is adopted to optimize the model, 300 epochs are trained totally, each 5 epochs are tested on a verification set once, and the model with the minimum loss on the verification set is stored as an optimal model. In order to alleviate overfitting in the training process, the following processing is carried out when the model is trained: 1) Each input training picture is clipped or horizontally rotated with a probability of 0.5; 2) A Dropout module was added after the main branch of each BottleNeck module of the model to inactivate neurons with a probability of 0.3.
Step 104: and based on the lane line high-dimensional characteristics of the target image, clustering lane line pixel points of the target image by adopting a clustering algorithm to obtain a lane line example.
Step 104, specifically including:
1) And screening the lane line pixel points of the target image by using the confidence coefficient so as to reduce the calculation complexity in the subsequent process of lane line detection. Specifically, branches are segmented according to line traversal semantics by using a sliding window with the size of kx 1, pixel points which belong to the lane line and have the highest reliability are reserved in the sliding window, and the screened pixel points of the lane line are obtained. The sliding window is shifted laterally by k steps at a time as shown in fig. 6.
2) And Clustering the screened lane line pixel points by adopting a Noise-Based Spatial Clustering of Applications with Noise (DBSCAN) according to the high-dimensional features of the lane lines of the target images to obtain a lane line example.
Step 105: and performing segmentation fitting on the lane line example to obtain the lane line of the target image.
Step 105, specifically including:
1) And segmenting the lane line examples according to positions to obtain lane line examples on the upper half part of the image and lane line examples on the lower half part of the image.
2) And respectively fitting the upper half lane line example of the image and the lower half lane line example of the image by adopting a random sample consensus (RANSAC) algorithm and combining a least square method to obtain the lane line of the target image.
The following describes a method for detecting a lane line of a rainy or snowy overhead traveling crane based on a generation countermeasure network in more detail.
S1, acquiring a target image (including an image to be identified of a lane line) in rainy and snowy weather.
And S2, inputting the target image into a rain and snow trace removing model (a pre-trained generation countermeasure network) (GAN network) to remove rain and snow traces in the image.
Firstly, inputting images containing lane lines in a lane line data set into a network to train the network by adding rain marks and snowflakes into the processed images and original images; and after training is finished, inputting the image to be recognized including the lane line in the rainy and snowy weather into a generator to generate a result, and finishing removing the rain and snow trace in the image.
And S3, inputting the image from which the rain and snow traces are removed into a lane line feature extraction model (a pre-trained convolutional neural network model).
The example segmentation method is based on semantic segmentation, and improves a semantic segmentation model ENet. Compared with other semantic segmentation tasks, one significant feature of the lane line is that lane pixels occupy a small proportion in the whole image, so that most of the features extracted by the neural network are background rather than the lane line. To focus the network more on extracting lane-line features, the present embodiment embeds a self-attention mechanism in each upsampling process of the ENet decoder. The method specifically comprises the steps that an attention module is connected in series after the last convolution of a main branch of a BottleNeck module, and the attention module is used for carrying out weighting processing on output features.
Extracting all pixels belonging to the lane line from the image alone does not satisfy the requirement of lane line fitting, and in order to satisfy the lane line fitting, it is also necessary to distinguish different lane lines. The currently mainstream example segmentation method usually uses a rectangular frame to represent the target, and then classifies the target pixel by pixel in the rectangular frame to realize example segmentation, and is not suitable for the targets which are slender, inclined and difficult to describe by using the rectangular frame, such as lane lines. In this embodiment, a high-dimensional feature for clustering is generated for each pixel, the high-dimensional features belonging to the same object (cluster) are compressed into a hypersphere by using the semantic segmentation loss function and the example segmentation loss function designed above, and then the high-dimensional features are used to cluster the pixel points. The compression principle is as follows: the loss function used by the example segmentation branch comprises two terms, namely a variance term (variance term) and a distance term (distance term), wherein the variance term has the function of generating a pulling force acting inside the same cluster, and points in the same cluster are gathered towards the center of the cluster through the pulling force; the effect of the distance term is to create a repulsive force between the different clusters of the action field, by which the different clusters are moved away from each other. When the centers of different clusters are too close to each other, cluster-to-cluster repulsive force enables the centers of different clusters to be far away from each other, and when the feature points belonging to the same cluster are too far away from the cluster center, the feature points are pulled to the cluster center by pulling force in the cluster. Through the action of pulling force and repulsion force, high-dimensional features belonging to the same object (cluster) can be compressed into a hypersphere, and then the high-dimensional features are utilized to cluster pixel points. The example segmentation branch designed by the embodiment comprises two convolutional layers and an upsampling layer, wherein the two convolutional layers use common 3 × 3 convolution and ReLU as an activation function, the upsampling layer uses a bilinear interpolation method to amplify the feature map to obtain an output equivalent to the size of an input image, a rectangular frame is not needed to describe a target in advance, and the example segmentation branch is very suitable for performing example segmentation on a specially-shaped target such as a lane line.
S4, screening and filtering the output result of the lane line feature extraction model:
in this embodiment, the output of the semantic segmentation branch of the lane line is all the pixel points belonging to the lane line in the image, and the calculation amount of the algorithm can be increased by directly using the pixel points to perform the subsequent steps. The semantic segmentation network can also provide the confidence of the segmentation result while outputting the segmentation result, the higher the confidence is, the higher the probability that the segmentation result is correct is shown. The screening process comprises the following steps: and covering the image by using a k multiplied by 1 pane during screening, only keeping the pixel point with the maximum confidence level in the pane coverage range, filtering other pixel points, and sliding the pane from left to right by the step length k.
And S5, segmenting the lane line example by using a clustering algorithm.
The semantic segmentation network can only separate lane lines and backgrounds and cannot distinguish different lane lines. In order to allocate pixel points to different lane lines, the present embodiment clusters the pixel points by using DBSCAN according to the high-dimensional features output by the instance segmentation branches. Compared with the traditional K-means clustering algorithm, the example segmentation branch designed by the embodiment has two outstanding advantages: firstly, the number of clusters does not need to be specified, and any number of lane lines can be identified; and secondly, abnormal noise in the data can be found in the clustering process.
And S6, fitting the lane line by using polynomial segmentation.
In order to generate a continuous and smooth lane line, the present embodiment performs fitting on the lane line instance segmentation result. The commonly used lane line expressions are mainly polynomial and spline curves. Considering that the spline curve calculation process is complex and time-consuming, the embodiment describes the lane line by using a polynomial. The polynomial expression of the lane line curve equation is as follows:
f(x)=a0+a1x+a2x2+...+anxn;
wherein x is the abscissa of the pixel point, n is the polynomial order, a0-akFitting the selected local interior points by a least square method to obtain a polynomial expression of the lane line curve equation. In this embodiment, a RANSAC algorithm and a least square method are used in the lane line fitting process, data are divided into local points (sampling points selected by the lane line fitting process) and local points (points not used for fitting process), and then the local point fitting process is reselected through continuous iterationCombining the models, and finally selecting the result with the optimal data fitting degree in the iterative process as the final model, wherein the data screening mode enables the models to have better anti-noise capacity, and a flow chart is shown in fig. 7 and is summarized as follows:
(1) a certain number of local points are randomly selected, and the local points are fitted by using a least square method to solve the polynomial coefficient of the polynomial expression. The local interior points are randomly selected from all the points at the beginning of the algorithm, and the local interior points with the best fitting effect are finally determined through multiple iterative optimization.
(3) And judging whether other points in the point set are suitable for the currently fitted model or not, and adding the points suitable for the current model into the local interior points.
(3) If the number of the current local points is larger than a certain value, the lane line is re-fitted by using a new local point set, the fitting effect is compared with the previous best model, and the model with the best fitting effect at the current moment is reserved.
(4) Repeating the steps 1-3 for multiple times, and outputting the optimal model (the optimal lane line curve equation corresponding to the polynomial coefficient) in the iterative process.
In the method for detecting a lane line of a sleet crown block based on a generation countermeasure network, rain and fog elements in an image are removed by using the generation countermeasure network, and then the lane line is extracted, so that the detection of the lane line of the sleet crown block can be completed; in addition, different lane lines are regarded as different categories in the method, the different lane lines are distinguished through a multi-category semantic division mode in different modes, an example is added to divide branches to regard different lane lines as different targets, the scene with unknown lane line quantity can be dealt with, the problems that in the prior art, the lane line detection effect is poor in rainy and snowy weather, most lane lines can only be detected in fixed quantity are solved, and the method has practical value.
The invention also provides a system for detecting the lane line of the rainy and snowy crown block based on the generation countermeasure network, and referring to fig. 8, the system comprises:
an image obtaining module 801, configured to obtain a target image in rainy and snowy weather.
A trace removing module 802, configured to input the target image into a rain and snow trace removing model to obtain a trace removed image of the target image; the rain and snow trace removing model is obtained by training a generated countermeasure network by adopting a first training set; the first training set comprises lane line images added with rain and snow marks;
an image extraction module 803, configured to input the trace-removed image of the target image into a lane line feature extraction model, to obtain lane line pixel points of the target image and lane line high-dimensional features of the target image; the lane line feature extraction model is obtained by training a convolutional neural network model by adopting a second training set; the second training set is an image obtained by removing the trace of the first training set by adopting the rain and snow trace removing model; the convolutional neural network model comprises an encoder, and a semantic segmentation branch and an example segmentation branch which are respectively connected with the encoder; the semantic segmentation branch is used for outputting lane line pixel points of the second training set; the example division branch is used for outputting lane line high-dimensional features of the second training set; the example division branch comprises a first convolution layer, a second convolution layer and an upper sampling layer which are connected in sequence;
the clustering module 804 is used for clustering lane line pixel points of the target image by adopting a clustering algorithm based on the lane line high-dimensional characteristics of the target image to obtain a lane line example;
and a segment fitting module 805, configured to perform segment fitting on the lane line example to obtain a lane line of the target image.
In one example, the snowing and raining crown block lane line detection system based on the generation countermeasure network further comprises: a first model determination module; the first model determining module is used for determining the rain and snow trace removing model. The first model determining module specifically includes:
a first training set obtaining unit, configured to obtain the first training set.
A generation countermeasure network construction unit for constructing the generation countermeasure network; the generation countermeasure network comprises a generation network and a judgment network which are connected in sequence; the generation network comprises a first volume block, a residual error structure and a second volume block which are connected in sequence; the first convolution block includes a convolution layer; the residual error structure comprises four residual error blocks which are sequentially connected in series; the second convolution block comprises three convolution layers which are sequentially connected in series; the discriminating network comprises a third volume block and a full connection layer; the third convolution block includes five convolution layers connected in series in sequence.
The first model training unit is used for inputting the first training set into the generation network, and inputting trace-removed images of the first training set output by the first training set and the generation network into the discrimination network for training to obtain a trained generation confrontation network; and the trained generated confrontation network is the rain and snow trace removal model.
In one example, the snowing and raining crown block lane line detection system based on the generation countermeasure network further includes: a second model determination module; the second model determination module is used for determining the lane line feature extraction model. The second model determining module specifically includes:
and the second training set acquisition unit is used for acquiring the second training set.
The convolutional neural network model building unit is used for building the convolutional neural network model; the encoder is an ENet encoder; the semantic segmentation branch is an ENet decoder with an attention mechanism embedded in each upsampling process.
The second model training unit is used for inputting the second training set into the encoder, and inputting the image characteristics output by the encoder into the semantic segmentation branch and the example segmentation branch respectively for training to obtain a trained convolutional neural network model; and the trained convolutional neural network model is the lane line feature extraction model.
In an example, the clustering module specifically includes:
and the screening unit is used for screening the lane line pixel points of the target image by adopting the confidence coefficient.
And the pixel point clustering unit is used for clustering the screened lane line pixel points according to the high-dimensional characteristics of the lane line of the target image by adopting a noise density-based clustering method to obtain a lane line example.
In an example, the segment fitting module specifically includes:
and the segmenting unit is used for segmenting the lane line examples according to positions to obtain the lane line examples on the upper half part of the image and the lane line examples on the lower half part of the image.
And the fitting unit is used for respectively fitting the upper half lane line example of the image and the lower half lane line example of the image by adopting a random sampling consistency algorithm and combining a least square method to obtain the lane line of the target image.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. For the system disclosed by the embodiment, the description is relatively simple because the system corresponds to the method disclosed by the embodiment, and the relevant points can be referred to the description of the method part.
The principle and the embodiment of the present invention are explained by applying specific examples, and the above description of the embodiments is only used to help understanding the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, the specific embodiments and the application range may be changed. In view of the foregoing, the description is not to be taken in a limiting sense.