CN113537003A - A method and device for visual detection of external environment of a vehicle for assisted driving - Google Patents

A method and device for visual detection of external environment of a vehicle for assisted driving Download PDF

Info

Publication number
CN113537003A
CN113537003A CN202110747205.6A CN202110747205A CN113537003A CN 113537003 A CN113537003 A CN 113537003A CN 202110747205 A CN202110747205 A CN 202110747205A CN 113537003 A CN113537003 A CN 113537003A
Authority
CN
China
Prior art keywords
neural network
discrete image
image
network model
discrete
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110747205.6A
Other languages
Chinese (zh)
Other versions
CN113537003B (en
Inventor
李松
李玉
刘近平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Anyang Institute of Technology
Original Assignee
Anyang Institute of Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Anyang Institute of Technology filed Critical Anyang Institute of Technology
Priority to CN202110747205.6A priority Critical patent/CN113537003B/en
Publication of CN113537003A publication Critical patent/CN113537003A/en
Application granted granted Critical
Publication of CN113537003B publication Critical patent/CN113537003B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Evolutionary Computation (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Software Systems (AREA)
  • Mathematical Physics (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Computing Systems (AREA)
  • Molecular Biology (AREA)
  • General Health & Medical Sciences (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Analysis (AREA)

Abstract

本发明提供的一种用于辅助驾驶的车外环境视觉检测方法及装置,通过图像采集设备采集描述车辆状态的图像,通过对离散图像进行规范化处理,在计算规范化后的离散图像的能量梯度之后输入神经网络模型,可以克服灰度加权平均带来的信息弱化,能够更好的保留彩色图像局部通道的特征信息。设计多隐藏层的卷积窗口,使得神经网络模型的全向卷积窗口组合,从而检测各个方向各种形态的特征,并设计非线性函数作为神经网络模型的激励函数,改善神经网络模型的检测能力,输出控制变量,实现对多个被控制备的智能辅助控制。本发明可以降低辅助驾驶系统所需要的外部传感器数量,减轻辅助驾驶系统的载荷,降低系统复杂度。

Figure 202110747205

The present invention provides a method and device for visual detection of the outside environment of the vehicle for assisted driving. An image describing the state of the vehicle is collected by an image acquisition device, and by normalizing the discrete image, after calculating the energy gradient of the normalized discrete image The input neural network model can overcome the information weakening caused by the gray-scale weighted average, and can better retain the characteristic information of the local channel of the color image. Design the convolution window of multiple hidden layers, so that the omnidirectional convolution window of the neural network model can be combined, so as to detect the characteristics of various forms in all directions, and design a nonlinear function as the excitation function of the neural network model to improve the detection of the neural network model. ability, output control variables, and realize intelligent auxiliary control of multiple controlled equipment. The invention can reduce the number of external sensors required by the auxiliary driving system, reduce the load of the auxiliary driving system, and reduce the complexity of the system.

Figure 202110747205

Description

一种用于辅助驾驶的车外环境视觉检测方法及装置A method and device for visual detection of external environment of a vehicle for assisted driving

技术领域technical field

本发明属于自动驾驶领域技术领域,具体涉及一种用于辅助驾驶的车外环境视觉检测方法及装置。The invention belongs to the technical field of the field of automatic driving, and in particular relates to a method and a device for visual detection of an external environment of a vehicle for assisted driving.

背景技术Background technique

自动驾驶系统,是近年来工业界研究的热门领域,其依靠机器学习、图像处理、雷达和定位系统等信息采集分析系统协同合作,让系统可以在没有人类主动操作的环境下,自动、安全地操控机动车辆。The autonomous driving system is a hot field of research in the industry in recent years. It relies on the cooperation of information acquisition and analysis systems such as machine learning, image processing, radar and positioning systems, so that the system can automatically and safely operate in an environment without human active operation. Control motor vehicles.

在自动驾驶过程中需要多种传感器感受周围的环境,然后通过驾驶车辆的控制系统控制设备启动或者关闭实现控制。而往往传感器越多导致驾驶车辆的控制系统约复杂。控制系统在获取传感器的传感参数后,往往需要较多的时间查找对应的被控设备。并且传感器的多种多样导致控制器在处理传感参数的过程较为复杂,往往达不到自动驾驶实时辅助的目的。In the process of autonomous driving, a variety of sensors are required to sense the surrounding environment, and then the control system of the driving vehicle controls the activation or deactivation of the device to achieve control. And often the more sensors, the more complicated the control system of the driving vehicle. After the control system obtains the sensing parameters of the sensor, it often takes more time to find the corresponding controlled device. In addition, the variety of sensors makes the process of the controller processing sensor parameters more complicated, which often fails to achieve the purpose of real-time assistance for automatic driving.

在现有技术中也有通过神经网络模型进行检测,输出控制被控设备开始或者关闭的辅助驾驶策略。由于传感器输入的传感参数多样性,神经网络模型的内部结构较为复杂,且神经网络模型中的各层结构在识别传感参数特征时,其识别效果不佳。In the prior art, there are also assisted driving strategies that are detected through a neural network model and output to control the start or shutdown of the controlled device. Due to the diversity of sensing parameters input by the sensor, the internal structure of the neural network model is relatively complex, and the recognition effect of each layer structure in the neural network model is not good when recognizing the characteristics of the sensing parameters.

发明内容SUMMARY OF THE INVENTION

本发明提供了一种用于辅助驾驶的车外环境视觉检测方法及装置,以提高车外环境视觉检测方法的准确性以及高效性。具体的技术方案如下。The present invention provides a method and device for visual detection of the external environment of the vehicle for assisting driving, so as to improve the accuracy and efficiency of the visual detection method of the external environment of the vehicle. The specific technical solution is as follows.

第一方面.本发明提供的一种用于辅助驾驶的车外环境视觉检测方法包括:A first aspect. The present invention provides a method for visual detection of an external environment for assisted driving, comprising:

获取描述车辆状态的原始数据组成集合;Obtain a collection of raw data describing the state of the vehicle;

其中,所述集合包括多个元素,每个元素为离散图像,所述离散图像按照时间形成序列,每张离散图像由三个通道组成,每个通道表示为一个二维矩阵;Wherein, the set includes a plurality of elements, each element is a discrete image, the discrete images form a sequence according to time, each discrete image is composed of three channels, and each channel is represented as a two-dimensional matrix;

对所述集合中的每张离散图像进行规范化,以使每张离散图像的值映射到在固定范围内,获得规范化后的离散图像;Normalizing each discrete image in the set, so that the value of each discrete image is mapped within a fixed range, to obtain a normalized discrete image;

根据图像的灰度能量分布,计算每张规范化后的离散图像的能量梯度;Calculate the energy gradient of each normalized discrete image according to the gray energy distribution of the image;

将每张离散图像的能量梯度作为训练后的神经网络模型的输入,以使所述神经网络模型对每张离散图像的能量梯度进行特征提取以及检测,获得所述神经网络模型输出的多个或者多组控制变量;The energy gradient of each discrete image is used as the input of the trained neural network model, so that the neural network model performs feature extraction and detection on the energy gradient of each discrete image, and obtains multiple or Multiple sets of control variables;

其中,所述神经网络模型各个隐藏层的卷积窗口结构和卷积方向不同,所述神经网络模型的卷积层的激励函数为线性函数,所述控制变量对应被控设备;Wherein, the convolution window structure and convolution direction of each hidden layer of the neural network model are different, the excitation function of the convolution layer of the neural network model is a linear function, and the control variable corresponds to the controlled device;

根据所述控制变量的数值与阈值的大小关系,控制所述控制变量对应的被控设备执行相应的操作。According to the magnitude relationship between the value of the control variable and the threshold, the controlled device corresponding to the control variable is controlled to perform the corresponding operation.

可选的,所述对所述集合中的每张离散图像进行规范化,以使每张离散图像的值映射到在固定范围内包括:Optionally, normalizing each discrete image in the set, so that the value of each discrete image is mapped to a fixed range including:

使用第一规范化公式对每张离散图像中每个通道的二维矩阵进行规范化,以使每张离散图像的值映射到在固定范围内;Normalize the two-dimensional matrix of each channel in each discrete image using the first normalization formula, so that the values of each discrete image are mapped to within a fixed range;

其中,第一规范化公式为:Among them, the first normalization formula is:

Figure BDA0003144708020000021
Figure BDA0003144708020000021

其中,It(·,·,c)表示每个通道的二维矩阵,

Figure BDA0003144708020000022
表示规范化后的每个通道的二维矩阵,
Figure BDA0003144708020000023
mean表示矩阵It(·,·,c)的均值,std为标准差,c={red,green,blue}表示离散图像中的三原色通道,i、j表示离散图像的二维空间坐标。where I t (·,·,c) represents a two-dimensional matrix for each channel,
Figure BDA0003144708020000022
a two-dimensional matrix representing each channel after normalization,
Figure BDA0003144708020000023
mean represents the mean of the matrix It (·,·,c), std is the standard deviation, c={red, green, blue} represents the three primary color channels in the discrete image, i, j represent the two-dimensional spatial coordinates of the discrete image.

可选的,所述根据图像的灰度能量分布计算每张规范化后的离散图像的能量梯度包括:Optionally, calculating the energy gradient of each normalized discrete image according to the grayscale energy distribution of the image includes:

将以二维矩阵的二维空间坐标为中心的矩形窗口设置在归一化后的离散图像中,将矩形窗口所在区域的像素点按照像素值进行排序,确定中位像素值;Set the rectangular window centered on the two-dimensional spatial coordinates of the two-dimensional matrix in the normalized discrete image, sort the pixels in the area where the rectangular window is located according to the pixel value, and determine the median pixel value;

针对每张规范化的离散图像的每个通道,计算该通道的每个像素值与所述中位像素值的偏差,确定差值最大的像素值;For each channel of each normalized discrete image, calculate the deviation between each pixel value of the channel and the median pixel value, and determine the pixel value with the largest difference;

将差值最大的像素值确定为离散图像该空间位置上的能量梯度。The pixel value with the largest difference is determined as the energy gradient at the spatial position of the discrete image.

其中,所述能量梯度表示为:Wherein, the energy gradient is expressed as:

Figure BDA0003144708020000031
Figure BDA0003144708020000031

其中,

Figure BDA0003144708020000032
表示能量梯度,I(i,j,c)表示规范后的离散图像,c={red,green,blue}表示图像中的三原色通道,i、j表示图像的二维空间坐标,median(wij(u,v))表示中位像素值,wij(u,v)表示二维矩阵中以(i,j)为中心、(u,v)为高和宽的一个矩形窗口。in,
Figure BDA0003144708020000032
Represents the energy gradient, I(i, j, c) represents the normalized discrete image, c={red, green, blue} represents the three primary color channels in the image, i, j represent the two-dimensional spatial coordinates of the image, median(w ij (u, v)) represents the median pixel value, and w ij (u, v) represents a rectangular window with (i, j) as the center and (u, v) as the height and width in a two-dimensional matrix.

可选的,所述训练后的神经网络模型通过如下步骤得到:Optionally, the trained neural network model is obtained through the following steps:

设置每个隐藏层的卷积窗口尺寸,以使各个隐藏层的卷积窗口结构以及卷积方向不同;Set the convolution window size of each hidden layer so that the convolution window structure and convolution direction of each hidden layer are different;

将输入层、卷积层以及输出层中的神经元依次,从而构建初始神经网络模型;The neurons in the input layer, the convolution layer and the output layer are sequentially constructed to construct the initial neural network model;

获取训练数据集;Get the training dataset;

其中,所述训练数据集包括多个样本,一个样本包括离散图像能量梯度以及人工标注的该梯度能量对应的被控设备的标号;Wherein, the training data set includes a plurality of samples, and one sample includes the discrete image energy gradient and the manually marked label of the controlled device corresponding to the gradient energy;

将每个样本输入所述初始神经网络中,将梯度能量对应的被控设备的标号所对应的控制变量作为学习目标,迭代训练所述初始神经网络模型,直至达到学习目标或者达到迭代次数;Input each sample into the initial neural network, take the control variable corresponding to the label of the controlled device corresponding to the gradient energy as the learning target, and iteratively train the initial neural network model until the learning target is reached or the number of iterations is reached;

将达到学习目标或者达到迭代次数的初始神经网络,作为训练后的神经网络模型。The initial neural network that has reached the learning goal or reached the number of iterations is used as the trained neural network model.

其中,所述激励函数为:Wherein, the excitation function is:

Figure BDA0003144708020000041
Figure BDA0003144708020000041

其中,x表示输入,α表示使函数在x=0点处产生一个不连续断点,R表示实数集。Among them, x represents the input, α represents the function to generate a discontinuous breakpoint at the point x=0, and R represents the set of real numbers.

其中,所述固定范围为[0,1],所述控制变量的取值位于[0,1]之间。Wherein, the fixed range is [0, 1], and the value of the control variable is between [0, 1].

可选的,所述按照所述控制变量的数值,控制所述控制变量对应的被控设备执行相应的操作包括:Optionally, the controlling the controlled device corresponding to the control variable to perform corresponding operations according to the value of the control variable includes:

当控制变量的取值大于阈值时,控制该控制变量对应的被控设备开启;When the value of the control variable is greater than the threshold, the controlled device corresponding to the control variable is controlled to be turned on;

当控制变量的取值不大于阈值时,控制该控制变量对应的被控设备关闭。When the value of the control variable is not greater than the threshold, the controlled device corresponding to the control variable is controlled to be turned off.

可选的,所述被控制备包括:灯光类设备、空调类设备以及制动类设备。Optionally, the controlled equipment includes: lighting equipment, air conditioning equipment, and braking equipment.

第二方面,本发明提供的一种基于双模神经网络模型的驾驶环境评估装置,包括:In a second aspect, the present invention provides a driving environment evaluation device based on a dual-mode neural network model, comprising:

获取模块,用于获取描述车辆状态的原始数据组成集合;The acquisition module is used to acquire the raw data composition set describing the state of the vehicle;

其中,所述集合包括多个元素,每个元素为离散图像,所述离散图像按照时间形成序列,每张离散图像由三个通道组成,每个通道表示为一个二维矩阵;Wherein, the set includes a plurality of elements, each element is a discrete image, the discrete images form a sequence according to time, each discrete image is composed of three channels, and each channel is represented as a two-dimensional matrix;

规范模块,用于对所述集合中的每张离散图像进行规范化,以使每张离散图像的值映射到在固定范围内,获得规范化后的离散图像;a normalization module, configured to normalize each discrete image in the set, so that the value of each discrete image is mapped to a fixed range to obtain a normalized discrete image;

计算模块,用于根据图像的灰度能量分布,计算每张规范化后的离散图像的能量梯度;The calculation module is used to calculate the energy gradient of each normalized discrete image according to the gray energy distribution of the image;

检测模块,用于将每张离散图像的能量梯度作为训练后的神经网络模型的输入,以使所述神经网络模型对每张离散图像的能量梯度进行特征提取以及检测,获得所述神经网络模型输出的多个或者多组控制变量;The detection module is used to use the energy gradient of each discrete image as the input of the neural network model after training, so that the neural network model performs feature extraction and detection on the energy gradient of each discrete image to obtain the neural network model. Multiple or multiple sets of control variables to be output;

其中,所述神经网络模型各个隐藏层的卷积窗口结构和卷积方向不同,所述神经网络模型的卷积层的激励函数为线性函数,所述控制变量对应被控设备;Wherein, the convolution window structure and convolution direction of each hidden layer of the neural network model are different, the excitation function of the convolution layer of the neural network model is a linear function, and the control variable corresponds to the controlled device;

控制模块,用于根据所述控制变量的数值与阈值的大小关系,控制所述控制变量对应的被控设备执行相应的操作。The control module is configured to control the controlled device corresponding to the control variable to perform the corresponding operation according to the magnitude relationship between the value of the control variable and the threshold.

本发明实施例的创新点包括:The innovative points of the embodiments of the present invention include:

1、本发明提供的一种用于辅助驾驶的车外环境视觉检测方法,只需通过图像采集设备采集描述车辆状态的图像,即可完成对灯光、空调、制动等随车系统的有效控制,大大降低了辅助驾驶系统所需要的外部传感器数量,减轻了辅助驾驶系统的载荷,降低了系统复杂度。1. The present invention provides a visual detection method for the external environment of the vehicle for assisted driving, which can effectively control the lighting, air conditioning, braking and other on-board systems only by collecting images describing the state of the vehicle through an image acquisition device. , which greatly reduces the number of external sensors required by the assisted driving system, reduces the load of the assisted driving system, and reduces the system complexity.

2、本发明提供的一种用于辅助驾驶的车外环境视觉检测方法,通过对离散图像进行规范化处理,可以提高神经网络模型的可靠度。2. The present invention provides a visual detection method for the external environment of the vehicle for assisted driving, which can improve the reliability of the neural network model by normalizing discrete images.

3、本发明提供的一种用于辅助驾驶的车外环境视觉检测方法,通过计算离散图像的能量梯度作为神经网络模型的输入,可以克服灰度加权平均带来的信息弱化,能够更好的保留彩色图像局部通道的特征信息,使得神经网络模型取得更好检测效果。3. The present invention provides a visual detection method for the external environment of the vehicle for assisted driving. By calculating the energy gradient of the discrete image as the input of the neural network model, the information weakening caused by the gray-scale weighted average can be overcome, and the information can be better. The feature information of the local channel of the color image is preserved, so that the neural network model can achieve better detection results.

4、本发明提供的一种用于辅助驾驶的车外环境视觉检测方法,通过多隐藏层的卷积窗口,使得神经网络模型的全向卷积窗口组合,从而检测各个方向各种形态的特征,并且设计非线性函数作为神经网络模型的激励函数,改善神经网络模型的检测能力,输出控制变量,实现对多个被控制备的智能辅助控制。4. The present invention provides a visual detection method for the outside environment of the vehicle for assisted driving. Through the convolution windows of multiple hidden layers, the omnidirectional convolution windows of the neural network model are combined, so as to detect the features of various shapes in all directions. , and design a nonlinear function as the excitation function of the neural network model, improve the detection ability of the neural network model, output control variables, and realize intelligent auxiliary control of multiple controlled equipment.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单介绍。显而易见地,下面描述中的附图仅仅是本发明的一些实施例。对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the embodiments of the present invention or the technical solutions in the prior art more clearly, the following briefly introduces the accompanying drawings that are required in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the invention. For those of ordinary skill in the art, other drawings can also be obtained from these drawings without creative effort.

图1为本发明实施例提供的一种用于辅助驾驶的车外环境视觉检测方法的流程示意图;FIG. 1 is a schematic flowchart of a visual detection method for an external environment of a vehicle for assisted driving according to an embodiment of the present invention;

图2是构建的跟踪模型的结构示意图;Fig. 2 is the structural representation of the tracking model constructed;

图3a是卷积层卷积的映射图;Figure 3a is a map of convolution layer convolution;

图3b是卷积层连接方式示意图;Figure 3b is a schematic diagram of the connection mode of the convolution layer;

图4为本发明实施例提供的一种用于辅助驾驶的车外环境视觉检测装置的结构示意图。FIG. 4 is a schematic structural diagram of an external environment visual detection device for assisting driving according to an embodiment of the present invention.

具体实施方式Detailed ways

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整的描述。显然,所描述的实施例仅仅是本发明的一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有付出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some, but not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

需要说明的是,本发明实施例及附图中的术语“包括”和“具有”以及它们的任何变形,意图在于覆盖不排他的包含。例如包含的一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其他步骤或单元。It should be noted that the terms "comprising" and "having" and any modifications thereof in the embodiments of the present invention and the accompanying drawings are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the steps or units listed, but optionally also includes steps or units not listed, or optionally also includes For other steps or units inherent to these processes, methods, products or devices.

图1为本发明实施例提供的一种用于辅助驾驶的车外环境视觉检测方法的流程示意图。该方法应用于自动驾驶车辆。该方法具体包括以下步骤。FIG. 1 is a schematic flowchart of a visual detection method for an external environment of a vehicle for assisted driving according to an embodiment of the present invention. The method is applied to self-driving vehicles. The method specifically includes the following steps.

S1,获取描述车辆状态的原始数据组成集合;S1, obtain a set of raw data describing the state of the vehicle;

其中,集合包括多个元素,每个元素为离散图像,离散图像按照时间形成序列,每张离散图像由三个通道组成,每个通道表示为一个二维矩阵;Among them, the set includes multiple elements, each element is a discrete image, the discrete images form a sequence according to time, each discrete image is composed of three channels, and each channel is represented as a two-dimensional matrix;

本发明可以从随车辆安装的图像采集装置采集原始数据,原始数据是离散的按时间采样的图像序列。The present invention can collect raw data from an image acquisition device installed with the vehicle, and the raw data is a discrete time-sampled image sequence.

假设图像传感器采集到的原始图像数据序列形成一个集合V,其每一个元素是一幅图像I,该图像由3个通道组成(RGB),即c={red,green,blue},定义图像I=I(i,j,c),其中i、j是二维空间坐标,图像序列的集合V={I1,I2,…,It,…},t表示图像获取的时间顺序。图像It的每一个通道I(·,·,red),I(·,·,green),I(·,·,blue)是一个二维矩阵。Assuming that the original image data sequence collected by the image sensor forms a set V, each element of which is an image I, and the image consists of 3 channels (RGB), that is, c={red, green, blue}, defining the image I =I(i,j,c), where i, j are two-dimensional spatial coordinates, the set of image sequences V={I 1 , I 2 ,...,I t ,...}, t represents the time sequence of image acquisition. Each channel I( · ,·,red), I(·,·,green), I(·,·,blue) of the image It is a two-dimensional matrix.

S2,对集合中的每张离散图像进行规范化,以使每张离散图像的值映射到在固定范围内,获得规范化后的离散图像;S2, normalize each discrete image in the set, so that the value of each discrete image is mapped to a fixed range, and a normalized discrete image is obtained;

S3,根据图像的灰度能量分布,计算每张规范化后的离散图像的能量梯度;S3, according to the gray energy distribution of the image, calculate the energy gradient of each normalized discrete image;

S4,将每张离散图像的能量梯度作为训练后的神经网络模型的输入,以使神经网络模型对每张离散图像的能量梯度进行特征提取以及检测,获得神经网络模型输出的多个或者多组控制变量;S4, take the energy gradient of each discrete image as the input of the neural network model after training, so that the neural network model can perform feature extraction and detection on the energy gradient of each discrete image, and obtain multiple or multiple groups of outputs of the neural network model control variable;

其中,神经网络模型各个隐藏层的卷积窗口结构和卷积方向不同,神经网络模型的卷积层的激励函数为线性函数,控制变量对应被控设备;固定范围为[0,1],控制变量的取值位于[0,1]之间。Among them, the convolution window structure and convolution direction of each hidden layer of the neural network model are different, the excitation function of the convolution layer of the neural network model is a linear function, and the control variable corresponds to the controlled device; the fixed range is [0, 1], the control The value of the variable is between [0,1].

神经网络模型的非线性单元称为激励函数σ,用于使网络具有对非线性数据集分类的能力。The nonlinear unit of the neural network model is called the excitation function σ, which is used to give the network the ability to classify nonlinear data sets.

其中,激励函数为:Among them, the excitation function is:

Figure BDA0003144708020000081
Figure BDA0003144708020000081

其中,x表示输入,α表示使函数在x=0点处产生一个不连续断点,R表示实数集。Among them, x represents the input, α represents the function to generate a discontinuous breakpoint at the point x=0, and R represents the set of real numbers.

S5,根据控制变量的数值与阈值的大小关系,控制控制变量对应的被控设备执行相应的操作。S5, according to the magnitude relationship between the value of the control variable and the threshold, the controlled device corresponding to the control variable is controlled to perform a corresponding operation.

其中,被控制备包括:灯光类设备、空调类设备以及制动类设备。Among them, the controlled equipment includes: lighting equipment, air conditioning equipment and braking equipment.

本发明提供的一种用于辅助驾驶的车外环境视觉检测方法及装置,通过图像采集设备采集描述车辆状态的图像,通过对离散图像进行规范化处理,在计算规范化后的离散图像的能量梯度之后输入神经网络模型,可以克服灰度加权平均带来的信息弱化,能够更好的保留彩色图像局部通道的特征信息。设计多隐藏层的卷积窗口,使得神经网络模型的全向卷积窗口组合,从而检测各个方向各种形态的特征,并设计非线性函数作为神经网络模型的激励函数,改善神经网络模型的检测能力,输出控制变量,实现对多个被控制备的智能辅助控制。本发明可以降低辅助驾驶系统所需要的外部传感器数量,减轻辅助驾驶系统的载荷,降低系统复杂度。The present invention provides a method and device for visual detection of the outside environment of the vehicle for assisted driving. An image describing the state of the vehicle is collected by an image acquisition device, and by normalizing the discrete image, after calculating the energy gradient of the normalized discrete image The input neural network model can overcome the information weakening caused by the gray-scale weighted average, and can better retain the characteristic information of the local channel of the color image. Design the convolution window of multiple hidden layers, so that the omnidirectional convolution window of the neural network model can be combined, so as to detect the characteristics of various forms in all directions, and design a nonlinear function as the excitation function of the neural network model to improve the detection of the neural network model. ability, output control variables, and realize intelligent auxiliary control of multiple controlled equipment. The invention can reduce the number of external sensors required by the auxiliary driving system, reduce the load of the auxiliary driving system, and reduce the complexity of the system.

作为本发明一种可选的实施方式,对集合中的每张离散图像进行规范化,以使每张离散图像的值映射到在固定范围内包括:As an optional implementation manner of the present invention, each discrete image in the set is normalized, so that the value of each discrete image is mapped to a fixed range including:

使用第一规范化公式对每张离散图像中每个通道的二维矩阵进行规范化,以使每张离散图像的值映射到在固定范围内;Normalize the two-dimensional matrix of each channel in each discrete image using the first normalization formula, so that the values of each discrete image are mapped to within a fixed range;

其中,第一规范化公式为:Among them, the first normalization formula is:

Figure BDA0003144708020000082
Figure BDA0003144708020000082

其中,It(·,·,c)表示每个通道的二维矩阵,

Figure BDA0003144708020000083
表示规范化后的每个通道的二维矩阵,
Figure BDA0003144708020000084
mean表示矩阵It(·,·,c)的均值,std为标准差,c={red,green,blue}表示离散图像中的三原色通道,i、j表示离散图像的二维空间坐标。where I t (·,·,c) represents a two-dimensional matrix for each channel,
Figure BDA0003144708020000083
a two-dimensional matrix representing each channel after normalization,
Figure BDA0003144708020000084
mean represents the mean of the matrix It (·,·,c), std is the standard deviation, c={red, green, blue} represents the three primary color channels in the discrete image, i, j represent the two-dimensional spatial coordinates of the discrete image.

对时间t采集到图像的每个通道I_t(·,·,c),其中每一个元素为I_t(i,j,c),宽度为w,高度为h,对每个通道单独使用第一规范化公式进行处理,规范化后的矩阵

Figure BDA0003144708020000091
进行下一步处理。For each channel I_t(·,·,c) of the image acquired at time t, each element is I_t(i,j,c), the width is w, the height is h, and the first normalization is used separately for each channel The formula is processed, the normalized matrix
Figure BDA0003144708020000091
Proceed to the next step.

作为本发明一种可选的实施方式,根据图像的灰度能量分布计算每张规范化后的离散图像的能量梯度包括:As an optional embodiment of the present invention, calculating the energy gradient of each normalized discrete image according to the grayscale energy distribution of the image includes:

步骤一:将以二维矩阵的二维空间坐标为中心的矩形窗口设置在归一化后的离散图像中,将矩形窗口所在区域的像素点按照像素值进行排序,确定中位像素值;Step 1: Set the rectangular window centered on the two-dimensional spatial coordinates of the two-dimensional matrix in the normalized discrete image, sort the pixels in the area where the rectangular window is located according to the pixel value, and determine the median pixel value;

步骤二:针对每张规范化的离散图像的每个通道,计算该通道的每个像素值与中位像素值的偏差,确定差值最大的像素值;Step 2: For each channel of each normalized discrete image, calculate the deviation between each pixel value of the channel and the median pixel value, and determine the pixel value with the largest difference;

步骤三:将差值最大的像素值确定为离散图像该空间位置上的能量梯度。Step 3: Determine the pixel value with the largest difference as the energy gradient at the spatial position of the discrete image.

在本发明中,图像的能量梯度定义为图像能量变化的一种度量,具体的,定义如下:In the present invention, the energy gradient of an image is defined as a measure of the energy change of the image. Specifically, the definition is as follows:

定义wij(u,v)表示二维矩阵(图像)中以(i,j)为中心、(u,v)为高和宽的一个矩形窗口。median(wij(u,v))表示窗口的中值,即对窗口中所有像素按值大小进行排序后,位于中间的那个值。则能量梯度可以表示为:Definition w ij (u, v) represents a rectangular window in a two-dimensional matrix (image) with (i, j) as the center and (u, v) as the height and width. median(w ij (u,v)) represents the median value of the window, that is, the value in the middle after sorting all the pixels in the window by value size. Then the energy gradient can be expressed as:

Figure BDA0003144708020000092
Figure BDA0003144708020000092

其中,

Figure BDA0003144708020000093
表示能量梯度,I(i,j,c)表示规范后的离散图像,c={red,green,blue}表示图像中的三原色通道,i、j表示图像的二维空间坐标,median(wij(u,v))表示中位像素值对于一幅三通道RGB图像,该图像的能量梯度是一个二维矩阵,首先对每个通道计算像素与其周围像素中位值的偏差,再取各通道偏差最大的那个值作为图像该空间位置上的能量梯度。in,
Figure BDA0003144708020000093
Represents the energy gradient, I(i, j, c) represents the normalized discrete image, c={red, green, blue} represents the three primary color channels in the image, i, j represent the two-dimensional spatial coordinates of the image, median(w ij (u, v)) represents the median pixel value. For a three-channel RGB image, the energy gradient of the image is a two-dimensional matrix. First, calculate the deviation of the pixel from the median value of the surrounding pixels for each channel, and then take each channel. The value with the largest deviation is used as the energy gradient at the spatial position of the image.

本发明使用图像的能量梯度代替原始图像像素来表达环境特征,一方面降低了数据的维度,另一方面可以克服灰度加权平均带来的信息弱化,能够更好的保留彩色图像局部通道的特征信息,取得更好的环境识别效果。The invention uses the energy gradient of the image to replace the original image pixels to express the environmental characteristics, on the one hand, the dimension of the data is reduced, on the other hand, it can overcome the information weakening caused by the gray-scale weighted average, and can better retain the characteristics of the local channel of the color image. information for better environmental recognition.

作为本发明一种可选的实施方式,训练后的神经网络模型通过如下步骤得到:As an optional embodiment of the present invention, the trained neural network model is obtained through the following steps:

步骤一:设置每个隐藏层的卷积窗口尺寸,以使各个隐藏层的卷积窗口结构以及卷积方向不同;Step 1: Set the convolution window size of each hidden layer so that the convolution window structure and convolution direction of each hidden layer are different;

步骤二:将输入层、卷积层以及输出层中的神经元依次,从而构建初始神经网络模型;Step 2: Arrange the neurons in the input layer, the convolution layer and the output layer in order to construct the initial neural network model;

参考图2,神经网络模型的基本模型由输入层、输出层和隐藏层组成,每一层包含若干个节点,称为神经元,神经元、神经元之间的连接组成了神经网络,该网络由激励函数、权重和神经元之间的连接方式所确定。Referring to Figure 2, the basic model of the neural network model consists of an input layer, an output layer and a hidden layer. Each layer contains several nodes, called neurons, and the connections between neurons and neurons form a neural network. Determined by the excitation function, weights, and how neurons are connected.

图2中,最左侧三个节点X1,X2,1为输入层节点,右侧节点y为输出层节点,h1,h2,h3为隐藏层节点,σ表示激励函数,作用是使神经网络具备非线性分类能力。神经网络的输出与输入之间的关系由下面式子定义:In Figure 2, the leftmost three nodes X 1 , X 2 , 1 are the input layer nodes, the right node y is the output layer node, h 1 , h 2 , h 3 are the hidden layer nodes, σ represents the excitation function, the role of It is to make the neural network have nonlinear classification ability. The relationship between the output and input of a neural network is defined by the following formula:

a1=w1-11x1+w1-21x2+b1-1 a 1 =w 1-11 x 1 +w 1-21 x 2 +b 1-1

a2=w1-12x1+w1-22x2+b1-2 a 2 =w 1-12 x 1 +w 1-22 x 2 +b 1-2

a3=w1-13x1+w1-23x2+b1-3 a 3 =w 1-13 x 1 +w 1-23 x 2 +b 1-3

y=σ(w2-1σ(a1)+w2-2σ(a2)+w2-3σ(a3))y=σ(w 2-1 σ(a 1 )+w 2-2 σ(a 2 )+w 2-3 σ(a 3 ))

其中,a1表示h1节点的输入与输出的关系,a2表示h2节点输入与输出关系,a3表示h3节点输入与输出关系,w带下角标表示节点之间的通道权重。b带下角标表示节点1与激励函数之间的参数。σ带括号表示括号内表示的通道的激励函数。Among them, a 1 represents the relationship between the input and output of the h 1 node, a 2 represents the input and output relationship of the h 2 node, a 3 represents the input and output relationship of the h 3 node, and w with a subscript represents the channel weight between the nodes. b with subscripts indicates the parameters between node 1 and the excitation function. σ in parentheses indicates the excitation function of the channel indicated in the parentheses.

图2所示的是一种全连接的神经网络(最完备形态),即隐藏层的每一个节点都与前一层的任一个节点有连接(不考虑激励函数),实际应用中,隐藏层可以有多个,每一层的节点数与前一层的连接关系在实现允许的前提下可以自由定义,即在全连接的基础上进行连接的合并或删减。Figure 2 shows a fully connected neural network (the most complete form), that is, each node in the hidden layer is connected to any node in the previous layer (regardless of the excitation function). In practical applications, the hidden layer There can be more than one, and the connection relationship between the number of nodes in each layer and the previous layer can be freely defined under the premise that the implementation allows, that is, the connection is merged or deleted on the basis of full connection.

建立一个输入层为图像能量梯度

Figure BDA0003144708020000111
的神经网络N,并且定义隐藏层如下:Build an input layer for the image energy gradient
Figure BDA0003144708020000111
The neural network N, and the hidden layer is defined as follows:

(11)神经网络模型N第一个隐藏层H1定义如下。(11) The first hidden layer H1 of the neural network model N is defined as follows.

Figure BDA0003144708020000112
Figure BDA0003144708020000112

H1是根据输入层数据

Figure BDA0003144708020000113
通过卷积窗
Figure BDA0003144708020000114
后的结果。H1 is based on the input layer data
Figure BDA0003144708020000113
through the convolution window
Figure BDA0003144708020000114
the result after.

图3a以及图3b给出了窗口尺寸为3x3时的连接情况,即1≤p,q≤3,每一个节点仅与其上一层(即输入层数据

Figure BDA0003144708020000115
)对应位置的3x3个节点有连接;将这3x3个连接的权重按行-列的顺序分别定义为
Figure BDA0003144708020000116
并且H1的每一个节点v与输入连接的3x3个点,其在对应位置的权重均相同。b带下角标表示第几个隐藏层的参数,从下角标为0的第一个隐藏层开始,pq表示卷积核的尺寸。Figure 3a and Figure 3b show the connection when the window size is 3x3, that is, 1≤p, q≤3, and each node is only connected to its upper layer (ie, the input layer data
Figure BDA0003144708020000115
) 3x3 nodes at the corresponding positions are connected; the weights of these 3x3 connections are defined in row-column order as
Figure BDA0003144708020000116
And each node v of H1 is connected to the 3x3 points of the input, and its weights at the corresponding positions are the same. b with subscripts indicates the parameters of the first hidden layer, starting from the first hidden layer marked with 0 in the lower corner, and pq indicates the size of the convolution kernel.

特别的,本发明定义H1层窗口尺寸为5x5,即1≤p,q≤5。In particular, the present invention defines the window size of the H1 layer as 5×5, that is, 1≤p, q≤5.

(12)神经网络模型N第二个隐藏层H2定义如下。(12) The second hidden layer H2 of the neural network model N is defined as follows.

Figure BDA0003144708020000117
Figure BDA0003144708020000117

H2是根据H1层的输出,通过卷积窗

Figure BDA0003144708020000118
后的结果。H2 is based on the output of the H1 layer, through the convolution window
Figure BDA0003144708020000118
the result after.

同H1层结构类似,定义H2层的权重窗口也是一个矩形窗,尺寸为3x7,即1≤p≤3,1≤q≤7。Similar to the structure of the H1 layer, the weight window defining the H2 layer is also a rectangular window with a size of 3x7, that is, 1≤p≤3, 1≤q≤7.

(13)神经网络模型第三个隐藏层H3定义如下。(13) The third hidden layer H3 of the neural network model is defined as follows.

Figure BDA0003144708020000119
Figure BDA0003144708020000119

H3是根据H2层的输出,通过卷积窗

Figure BDA0003144708020000121
后的结果。H3 is based on the output of the H2 layer, through the convolution window
Figure BDA0003144708020000121
the result after.

同H1、H2层结构类似,定义H3层的权重窗口也是一个矩形窗,尺寸为7x3,即1≤p≤7,1≤q≤3。Similar to the structure of the H1 and H2 layers, the weight window defining the H3 layer is also a rectangular window with a size of 7x3, that is, 1≤p≤7, 1≤q≤3.

(14)网络N第四个隐藏层H4定义如下。(14) The fourth hidden layer H4 of the network N is defined as follows.

Figure BDA0003144708020000122
Figure BDA0003144708020000122

H4层是根据H3层的输出,通过卷积窗

Figure BDA0003144708020000123
后的结果。The H4 layer is based on the output of the H3 layer, through the convolution window
Figure BDA0003144708020000123
the result after.

H4层的卷积窗口

Figure BDA0003144708020000124
是一个对称矩阵,并且1≤p,q≤7。Convolutional window of H4 layer
Figure BDA0003144708020000124
is a symmetric matrix, and 1≤p, q≤7.

(15)网络N第五个隐藏层H5定义如下。(15) The fifth hidden layer H5 of the network N is defined as follows.

Figure BDA0003144708020000125
Figure BDA0003144708020000125

并且当p>q时,

Figure BDA0003144708020000126
and when p>q,
Figure BDA0003144708020000126

H5层是根据H4层的输出,通过卷积窗

Figure BDA0003144708020000127
后的结果。The H5 layer is based on the output of the H4 layer, through the convolution window
Figure BDA0003144708020000127
the result after.

H5层的卷积窗口

Figure BDA0003144708020000128
是一个上(下)三角矩阵,并且1≤p,q≤7。Convolutional window of H5 layer
Figure BDA0003144708020000128
is an upper (lower) triangular matrix, and 1≤p, q≤7.

(16)网络N第六个隐藏层H6定义如下。(16) The sixth hidden layer H6 of the network N is defined as follows.

Figure BDA0003144708020000129
Figure BDA0003144708020000129

并且当p<q时,

Figure BDA00031447080200001210
and when p<q,
Figure BDA00031447080200001210

H6层是根据H5层的输出,通过卷积窗口

Figure BDA00031447080200001211
后的结果。The H6 layer is based on the output of the H5 layer, through the convolution window
Figure BDA00031447080200001211
the result after.

H6层的卷积窗

Figure BDA00031447080200001212
是一个与卷积窗
Figure BDA00031447080200001213
相对的下(上)三角矩阵。并且1≤p,q≤7。Convolutional window of H6 layer
Figure BDA00031447080200001212
is a convolutional window with
Figure BDA00031447080200001213
Relative lower (upper) triangular matrix. And 1≤p, q≤7.

H2-H6层组合不同方向、不同结构的卷积窗口对特征进行检测,以便识别各个方向、各种形态的特征,这种多层全向检测窗口组合为本发明的另一重要特点。The H2-H6 layers combine convolution windows of different directions and structures to detect features, so as to identify features in various directions and shapes. This combination of multi-layer omnidirectional detection windows is another important feature of the present invention.

(17)网络N第七个隐藏层H7定义如下。(17) The seventh hidden layer H7 of network N is defined as follows.

Figure BDA0003144708020000131
Figure BDA0003144708020000131

H7是隐藏层H6的输出在窗口pxq范围内的最大值,并且1≤p,q≤4。H7 is the maximum value of the output of the hidden layer H6 within the window pxq, and 1≤p, q≤4.

(18)网络N第八个隐藏层H8定义如下。(18) The eighth hidden layer H8 of the network N is defined as follows.

Figure BDA0003144708020000132
Figure BDA0003144708020000132

H8是根据H7层的输出,通过卷积窗

Figure BDA0003144708020000133
后的结果。H8 is based on the output of the H7 layer, through the convolution window
Figure BDA0003144708020000133
the result after.

H8层窗口尺寸为5x5,即1≤p,q≤5。The window size of the H8 layer is 5x5, that is, 1≤p, q≤5.

(19)网络N第九个隐藏层H9定义如下。(19) The ninth hidden layer H9 of the network N is defined as follows.

Figure BDA0003144708020000134
Figure BDA0003144708020000134

H9层是根据H8层的输出,通过卷积窗

Figure BDA0003144708020000135
后的结果。The H9 layer is based on the output of the H8 layer, through the convolution window
Figure BDA0003144708020000135
the result after.

H9层的卷积窗口w9的所有元素都相等,并且1≤p,q≤5。All elements of the convolutional window w9 of the H9 layer are equal, and 1≤p, q≤5.

(110)网络N第十个隐藏层H10是形如全连接层,H10的每一个节点与H9的每一个节点之间均存在连接,且连接权重均独立。(110) The tenth hidden layer H10 of the network N is in the form of a fully connected layer. There is a connection between each node of H10 and each node of H9, and the connection weights are independent.

(111)网络N第十个隐藏层H10后,以全连接形式连接输出层Y。(111) After the tenth hidden layer H10 of the network N, the output layer Y is connected in a fully connected form.

输出层Y表示若干个或若干组控制变量,取值在[0,1]之间,含义是对某个(或某组)开关的开启或关闭;当Y的某个分量>0.66时,可认为开关开启,否则认为开关关闭。控制变量的个数与实际要控制的设备有关,根据设备在驾驶系统中的用途不同,分为“灯光类”、“空调类”、“制动类”等,每个类别又根据实际设备数目的不同对应一个或多个输出分量。The output layer Y represents several or several groups of control variables, and the value is between [0, 1], which means that a certain (or a certain group) switch is turned on or off; when a certain component of Y is >0.66, it can be The switch is considered to be on, otherwise the switch is considered to be off. The number of control variables is related to the actual equipment to be controlled. According to the different uses of the equipment in the driving system, it is divided into "lighting", "air conditioning", "braking", etc., and each category is based on the actual number of equipment. The difference corresponds to one or more output components.

输出Y的维度是相互独立且有限的,但输出Y的维数并不受实际设备类别或个数限制。同时,本发明中描述的模型也不受限于实际设备的类别或个数。The dimensions of the output Y are independent and limited, but the dimensions of the output Y are not limited by the actual device category or number. At the same time, the models described in the present invention are not limited to the type or number of actual devices.

步骤三:获取训练数据集;Step 3: Obtain the training data set;

其中,训练数据集包括多个样本,一个样本包括离散图像能量梯度以及人工标注的该梯度能量对应的被控设备的标号;Wherein, the training data set includes a plurality of samples, and one sample includes the discrete image energy gradient and the manually marked label of the controlled device corresponding to the gradient energy;

步骤四:将每个样本输入初始神经网络中,将梯度能量对应的被控设备的标号所对应的控制变量作为学习目标,迭代训练初始神经网络模型,直至达到学习目标或者达到迭代次数;Step 4: Input each sample into the initial neural network, take the control variable corresponding to the label of the controlled device corresponding to the gradient energy as the learning target, and iteratively train the initial neural network model until the learning target is reached or the number of iterations is reached;

步骤五:将达到学习目标或者达到迭代次数的初始神经网络,作为训练后的神经网络模型。Step 5: The initial neural network that has reached the learning target or reached the number of iterations is used as the neural network model after training.

可以理解,对神经网络进行训练时,选取若干组视频数据,经过建立图像能量梯度

Figure BDA0003144708020000142
并人工标注与该梯度图对应的各控制开关所处的位置(开/关:1/0)对初始神经网络模型进行训练。It can be understood that when training the neural network, several sets of video data are selected, and the image energy gradient is established by establishing the image energy gradient.
Figure BDA0003144708020000142
And manually mark the position of each control switch (on/off: 1/0) corresponding to the gradient map to train the initial neural network model.

本发明中的神经网络模型,对输入图像数据进行了特殊处理,设计了特有的图像能量梯度特征和具备多层全向检测窗口的神经网络模型以及该模型的非线性处理单元。与经典算法相比,本发明的神经网络模型有效的提升了开关状态判断的正确率。The neural network model in the present invention performs special processing on the input image data, and designs a unique image energy gradient feature, a neural network model with a multi-layer omnidirectional detection window, and a nonlinear processing unit of the model. Compared with the classical algorithm, the neural network model of the present invention effectively improves the correct rate of switch state judgment.

作为本发明一种可选的实施方式,按照控制变量的数值,控制控制变量对应的被控设备执行相应的操作包括:As an optional embodiment of the present invention, according to the value of the control variable, controlling the controlled device corresponding to the control variable to perform the corresponding operation includes:

步骤一:当控制变量的取值大于阈值时,控制该控制变量对应的被控设备开启;Step 1: when the value of the control variable is greater than the threshold, the controlled device corresponding to the control variable is controlled to be turned on;

步骤二:当控制变量的取值不大于阈值时,控制该控制变量对应的被控设备关闭。Step 2: When the value of the control variable is not greater than the threshold, the controlled device corresponding to the control variable is controlled to be turned off.

下面以实际数据验证本发明的效果,参见表1。The effect of the present invention is verified below with actual data, see Table 1.

表1效果对比表Table 1 Effect comparison table

Figure BDA0003144708020000141
Figure BDA0003144708020000141

Figure BDA0003144708020000151
Figure BDA0003144708020000151

从表1中可知,第一行是采用Alex网络、ReLU非线性单元和加权灰度图像特征(R、G、B三通道的值取平均值)所得的判断正确率;第二行是采用本发明多层全向检测窗口神经网络模型、本发明提供的非线性单元和加权灰度图像特征所得的判断正确率;第三行是采用本发明多层全向检测窗口神经网络模型、本发明提供的新型非线性单元和图像能量梯度特征所得的正确率。可见,本发明提出的一种基于双模神经网络模型的驾驶环境评估方法有效提升了开关状态判断正确率。As can be seen from Table 1, the first line is the judgment accuracy obtained by using the Alex network, ReLU nonlinear unit and weighted grayscale image features (the values of the three channels of R, G, and B are averaged); the second line is the use of this Invented the multi-layer omnidirectional detection window neural network model, the non-linear unit provided by the present invention and the judgment accuracy obtained by the weighted gray image features; the third row is the multi-layer omnidirectional detection window neural network model of the present invention, provided by the present invention. The accuracy obtained by the novel nonlinear unit and image energy gradient feature of . It can be seen that the driving environment evaluation method based on the dual-mode neural network model proposed by the present invention effectively improves the correct rate of switch state judgment.

如图4所示,本发明提供的一种基于双模神经网络模型的驾驶环境评估装置包括:As shown in FIG. 4 , a driving environment evaluation device based on a dual-mode neural network model provided by the present invention includes:

获取模块41,用于获取描述车辆状态的原始数据组成集合;an acquisition module 41, configured to acquire a set of raw data describing the state of the vehicle;

其中,集合包括多个元素,每个元素为离散图像,离散图像按照时间形成序列,每张离散图像由三个通道组成,每个通道表示为一个二维矩阵;Among them, the set includes multiple elements, each element is a discrete image, the discrete image forms a sequence according to time, each discrete image is composed of three channels, and each channel is represented as a two-dimensional matrix;

规范模块42,用于对集合中的每张离散图像进行规范化,以使每张离散图像的值映射到在固定范围内,获得规范化后的离散图像;The normalization module 42 is used to normalize each discrete image in the set, so that the value of each discrete image is mapped to a fixed range to obtain a normalized discrete image;

计算模块43,用于根据图像的灰度能量分布,计算每张规范化后的离散图像的能量梯度;The calculation module 43 is used to calculate the energy gradient of each normalized discrete image according to the grayscale energy distribution of the image;

检测模块44,用于将每张离散图像的能量梯度作为训练后的神经网络模型的输入,以使神经网络模型对每张离散图像的能量梯度进行特征提取以及检测,获得神经网络模型输出的多个或者多组控制变量;The detection module 44 is used to use the energy gradient of each discrete image as the input of the neural network model after training, so that the neural network model performs feature extraction and detection on the energy gradient of each discrete image, and obtains the output of the neural network model. one or more sets of control variables;

其中,神经网络模型各个隐藏层的卷积窗口结构和卷积方向不同,神经网络模型的卷积层的激励函数为线性函数,控制变量对应被控设备;Among them, the convolution window structure and convolution direction of each hidden layer of the neural network model are different, the excitation function of the convolution layer of the neural network model is a linear function, and the control variable corresponds to the controlled device;

控制模块45,用于根据控制变量的数值与阈值的大小关系,控制控制变量对应的被控设备执行相应的操作。The control module 45 is configured to control the controlled device corresponding to the control variable to perform corresponding operations according to the magnitude relationship between the value of the control variable and the threshold.

上述装置实施例与方法实施例相对应,与该方法实施例具有同样的技术效果,具体说明参见方法实施例。装置实施例是基于方法实施例得到的,具体的说明可以参见方法实施例部分,此处不再赘述。The above apparatus embodiments correspond to the method embodiments, and have the same technical effects as the method embodiments. For specific descriptions, refer to the method embodiments. The apparatus embodiment is obtained based on the method embodiment, and the specific description can refer to the method embodiment section, which will not be repeated here.

本领域普通技术人员可以理解:附图只是一个实施例的示意图,附图中的模块或流程并不一定是实施本发明所必须的。Those of ordinary skill in the art can understand that the accompanying drawing is only a schematic diagram of an embodiment, and the modules or processes in the accompanying drawing are not necessarily necessary to implement the present invention.

本领域普通技术人员可以理解:实施例中的装置中的模块可以按照实施例描述分布于实施例的装置中,也可以进行相应变化位于不同于本实施例的一个或多个装置中。上述实施例的模块可以合并为一个模块,也可以进一步拆分成多个子模块。Those skilled in the art may understand that: the modules in the apparatus in the embodiment may be distributed in the apparatus in the embodiment according to the description of the embodiment, and may also be located in one or more apparatuses different from this embodiment with corresponding changes. The modules in the foregoing embodiments may be combined into one module, or may be further split into multiple sub-modules.

最后应说明的是:以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明实施例技术方案的精神和范围。Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present invention, but not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand: it can still be Modifications are made to the technical solutions described in the foregoing embodiments, or some technical features thereof are equivalently replaced; and these modifications or replacements do not make the essence of the corresponding technical solutions depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (10)

1. A method for visual detection of an environment external to a vehicle for driver assistance, the method comprising:
acquiring a raw data composition set describing a vehicle state;
wherein the set comprises a plurality of elements, each element being a discrete image, the discrete images forming a sequence over time, each discrete image consisting of three channels, each channel being represented as a two-dimensional matrix;
normalizing each discrete image in the set so as to map the value of each discrete image in a fixed range to obtain a normalized discrete image;
calculating the energy gradient of each normalized discrete image according to the gray level energy distribution of the image;
taking the energy gradient of each discrete image as the input of a trained neural network model, so that the neural network model performs feature extraction and detection on the energy gradient of each discrete image to obtain a plurality of or a plurality of groups of control variables output by the neural network model;
the convolution window structures and convolution directions of all hidden layers of the neural network model are different, the excitation function of the convolution layer of the neural network model is a linear function, and the control variable corresponds to controlled equipment;
and controlling the controlled equipment corresponding to the control variable to execute corresponding operation according to the magnitude relation between the numerical value of the control variable and the threshold value.
2. A method for visual inspection of an off-board environment according to claim 1, wherein said normalizing each discrete image in said set such that the value of each discrete image maps to within a fixed range comprises:
normalizing the two-dimensional matrix of each channel in each discrete image using a first normalization formula such that the values of each discrete image are mapped to within a fixed range;
wherein the first normalized formula is:
Figure FDA0003144708010000011
wherein, It(-, c) represents a two-dimensional matrix for each channel,
Figure FDA0003144708010000021
a two-dimensional matrix representing each channel after normalization,
Figure FDA0003144708010000022
mean represents the matrix ItThe mean value of ·, c), std is the standard deviation, c ═ { red, green, blue } represents the three primary color channels in the discrete image, and i, j represent the two-dimensional spatial coordinates of the discrete image.
3. The vehicle exterior environment visual detection method according to claim 1, wherein said calculating an energy gradient of each normalized discrete image from a gray scale energy distribution of the image comprises:
setting a rectangular window taking the two-dimensional space coordinate of the two-dimensional matrix as the center in the normalized discrete image, sequencing pixel points of the area where the rectangular window is located according to pixel values, and determining a median pixel value;
calculating the deviation of each pixel value of each channel and the median pixel value aiming at each channel of each normalized discrete image, and determining the pixel value with the maximum difference;
and determining the pixel value with the largest difference as the energy gradient at the spatial position of the discrete image.
4. A method for visual inspection of an off-board environment according to claim 3, characterized in that said energy gradient is expressed as:
Figure FDA0003144708010000023
wherein,
Figure FDA0003144708010000024
representing the energy gradient, I (I, j, c) representing the normalized discrete image, c ═ { red, green, blue } representing the three primary color channels in the image, I, j representing the two-dimensional spatial coordinates of the image, mean (w)ij(u, v)) represents the median pixel value, Wij(u, v) represents a rectangular window centered at (i, j) and high and wide in the two-dimensional matrix.
5. The vehicle exterior environment visual inspection method according to claim 1, wherein the trained neural network model is obtained by:
setting the convolution window size of each hidden layer to ensure that the convolution window structure and the convolution direction of each hidden layer are different;
sequentially arranging the neurons in the input layer, the convolutional layer and the output layer so as to construct an initial neural network model;
acquiring a training data set;
the training data set comprises a plurality of samples, and one sample comprises a discrete image energy gradient and a manually marked label of controlled equipment corresponding to the gradient energy;
inputting each sample into the initial neural network, taking a control variable corresponding to a label of controlled equipment corresponding to gradient energy as a learning target, and iteratively training the initial neural network model until the learning target is reached or the iteration times are reached;
and taking the initial neural network reaching the learning target or reaching the iteration times as a trained neural network model.
6. A method for visual inspection of an extra-vehicular environment according to claim 1, characterized in that said excitation function is:
Figure FDA0003144708010000031
where x denotes the input, α denotes the function is made to produce a discontinuous break at the point where x is 0, and R denotes the real number set.
7. The visual detection method for the environment outside the vehicle according to claim 1, wherein the fixed range is [0,1], and the value of the control variable is located between [0,1 ].
8. The visual detection method for the exterior environment of the vehicle according to claim 7, wherein the controlling the controlled device corresponding to the controlled variable to perform corresponding operations according to the numerical value of the controlled variable comprises:
when the value of the control variable is larger than the threshold value, controlling the controlled equipment corresponding to the control variable to be started;
and when the value of the control variable is not greater than the threshold value, controlling the controlled equipment corresponding to the control variable to be closed.
9. The vehicle exterior environment visual inspection method according to claim 1, wherein the controlled preparation includes: lighting equipment, air conditioning equipment, and braking equipment.
10. A driving environment evaluation apparatus based on a dual-mode neural network model, the apparatus comprising:
the acquisition module is used for acquiring a raw data composition set describing the vehicle state;
wherein the set comprises a plurality of elements, each element being a discrete image, the discrete images forming a sequence over time, each discrete image consisting of three channels, each channel being represented as a two-dimensional matrix;
the normalization module is used for normalizing each discrete image in the set so as to map the value of each discrete image in a fixed range and obtain the normalized discrete image;
the computing module is used for computing the energy gradient of each normalized discrete image according to the gray level energy distribution of the image;
the detection module is used for taking the energy gradient of each discrete image as the input of the trained neural network model so that the neural network model performs feature extraction and detection on the energy gradient of each discrete image to obtain a plurality of or a plurality of groups of control variables output by the neural network model;
the convolution window structures and convolution directions of all hidden layers of the neural network model are different, the excitation function of the convolution layer of the neural network model is a linear function, and the control variable corresponds to controlled equipment;
and the control module is used for controlling the controlled equipment corresponding to the control variable to execute corresponding operation according to the magnitude relation between the numerical value of the control variable and the threshold value.
CN202110747205.6A 2021-07-02 2021-07-02 A method and device for visual detection of external environment of a vehicle for assisted driving Expired - Fee Related CN113537003B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110747205.6A CN113537003B (en) 2021-07-02 2021-07-02 A method and device for visual detection of external environment of a vehicle for assisted driving

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110747205.6A CN113537003B (en) 2021-07-02 2021-07-02 A method and device for visual detection of external environment of a vehicle for assisted driving

Publications (2)

Publication Number Publication Date
CN113537003A true CN113537003A (en) 2021-10-22
CN113537003B CN113537003B (en) 2022-10-21

Family

ID=78097549

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110747205.6A Expired - Fee Related CN113537003B (en) 2021-07-02 2021-07-02 A method and device for visual detection of external environment of a vehicle for assisted driving

Country Status (1)

Country Link
CN (1) CN113537003B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109993074A (en) * 2019-03-14 2019-07-09 杭州飞步科技有限公司 Assist processing method, device, equipment and the storage medium driven
CN110059582A (en) * 2019-03-28 2019-07-26 东南大学 Driving behavior recognition methods based on multiple dimensioned attention convolutional neural networks
CN110163077A (en) * 2019-03-11 2019-08-23 重庆邮电大学 A kind of lane recognition method based on full convolutional neural networks
CN110598637A (en) * 2019-09-12 2019-12-20 齐鲁工业大学 Unmanned driving system and method based on vision and deep learning
US20200026936A1 (en) * 2018-03-30 2020-01-23 Beijing Sensetime Technology Development Co., Ltd. Vehicle lamp detection methods and apparatuses, methods and apparatuses for implementing intelligent driving, media and devices

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200026936A1 (en) * 2018-03-30 2020-01-23 Beijing Sensetime Technology Development Co., Ltd. Vehicle lamp detection methods and apparatuses, methods and apparatuses for implementing intelligent driving, media and devices
CN110163077A (en) * 2019-03-11 2019-08-23 重庆邮电大学 A kind of lane recognition method based on full convolutional neural networks
CN109993074A (en) * 2019-03-14 2019-07-09 杭州飞步科技有限公司 Assist processing method, device, equipment and the storage medium driven
CN110059582A (en) * 2019-03-28 2019-07-26 东南大学 Driving behavior recognition methods based on multiple dimensioned attention convolutional neural networks
CN110598637A (en) * 2019-09-12 2019-12-20 齐鲁工业大学 Unmanned driving system and method based on vision and deep learning

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
YUANFANG ZHAO ET AL.: "End-to-end autonomous driving based on the convolution neural network model", 《PROCEEDINGS OF APSIPA ANNUAL SUMMIT AND CONFERENCE 2019》 *
闫龙 等: ""基于视觉的驾驶辅助系统研究"", 《科技创新与应用》 *

Also Published As

Publication number Publication date
CN113537003B (en) 2022-10-21

Similar Documents

Publication Publication Date Title
CN109584248B (en) Infrared target instance segmentation method based on feature fusion and dense connection network
CN105488534B (en) Traffic scene deep analysis method, apparatus and system
CN105975931B (en) A Convolutional Neural Network Face Recognition Method Based on Multi-scale Pooling
US10984289B2 (en) License plate recognition method, device thereof, and user equipment
CN104850845B (en) A kind of traffic sign recognition method based on asymmetric convolutional neural networks
CN105825511B (en) A kind of picture background clarity detection method based on deep learning
CN111401517B (en) Method and device for searching perceived network structure
CN113807464A (en) Target detection method of UAV aerial imagery based on improved YOLO V5
CN110717903A (en) Method for detecting crop diseases by using computer vision technology
CN108009526A (en) A kind of vehicle identification and detection method based on convolutional neural networks
WO2022179587A1 (en) Feature extraction method and apparatus
CN107688856B (en) Indoor robot scene active identification method based on deep reinforcement learning
CN112183740B (en) Methods used to train neural networks
CN104978580A (en) Insulator identification method for unmanned aerial vehicle polling electric transmission line
Shinzato et al. Fast visual road recognition and horizon detection using multiple artificial neural networks
CN106778745A (en) A kind of licence plate recognition method and device, user equipment
CN110991444A (en) Complex scene-oriented license plate recognition method and device
CN109190458B (en) A small human head detection method based on deep learning
CN110969171A (en) Image classification model, method and application based on improved convolutional neural network
CN113326735A (en) Multi-mode small target detection method based on YOLOv5
CN110458004B (en) Target object identification method, device, equipment and storage medium
CN110503098A (en) A fast real-time lightweight target detection method and device
CN107766810B (en) Cloud and shadow detection method
CN101127086A (en) Multiple-choice weighted classification method for hyperspectral images
Shabarinath et al. Convolutional neural network based traffic-sign classifier optimized for edge inference

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20221021

CF01 Termination of patent right due to non-payment of annual fee