WO2023123869A1 - Visibility value measurement method and apparatus, device, and storage medium - Google Patents

Visibility value measurement method and apparatus, device, and storage medium Download PDF

Info

Publication number
WO2023123869A1
WO2023123869A1 PCT/CN2022/097325 CN2022097325W WO2023123869A1 WO 2023123869 A1 WO2023123869 A1 WO 2023123869A1 CN 2022097325 W CN2022097325 W CN 2022097325W WO 2023123869 A1 WO2023123869 A1 WO 2023123869A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
detected
visibility
characterization
visibility value
Prior art date
Application number
PCT/CN2022/097325
Other languages
French (fr)
Chinese (zh)
Inventor
陈康
谭发兵
朱铖恺
武伟
Original Assignee
上海商汤智能科技有限公司
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 上海商汤智能科技有限公司 filed Critical 上海商汤智能科技有限公司
Publication of WO2023123869A1 publication Critical patent/WO2023123869A1/en

Links

Images

Classifications

    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis

Definitions

  • the present disclosure relates to the technical field of artificial intelligence, and in particular to a visibility value detection method, device, equipment and storage medium.
  • Fog, smog, dust and other climates will lead to low visibility in the environment and affect traffic travel.
  • the common foggy climate is affected by the micro-climate environment in local areas.
  • Fog with lower visibility appears in the local area of heavy fog. It is very harmful to road traffic safety, especially on high-speed expressways, and it is easy to cause major traffic accidents. Therefore, by identifying the visibility value of the area to be detected, it is possible to determine the influence of fog, sand and dust, etc., to guide traffic. Therefore, it is necessary to provide a scheme that can conveniently and accurately determine the visibility value of the area to be detected.
  • a visibility value detection method comprising: acquiring an image to be detected; performing feature extraction on the image to be detected to obtain a characterization quantity of the image to be detected; The mapping relationship between the calibrated characteristic quantity and the visibility value, and the characteristic quantity of the image to be detected determine the visibility value of the image to be detected; wherein, the characteristic quantity can reflect the magnitude of the visibility value of the scene contained in the image.
  • a visibility value detection device comprising: an acquisition module, used to acquire an image to be detected; a characterization module, used to analyze the image to be detected through a pre-trained neural network performing feature extraction to obtain the characterization quantity of the image to be detected; a visibility value determination module, configured to determine the corresponding The visibility value of , wherein the characterization quantity can reflect the magnitude of the visibility value of the scene contained in the image.
  • an electronic device the electronic device includes a processor, a memory, and computer instructions stored in the memory that can be executed by the processor, and the processor executes the computer Instructions, the method mentioned in the first aspect above can be implemented.
  • a computer-readable storage medium on which computer instructions are stored, and when the computer instructions are executed, the method mentioned in the above-mentioned first aspect is implemented.
  • a computer program product includes a computer program, and when the computer program is executed by a processor, the method mentioned in the above first aspect is implemented.
  • Fig. 1 is a flow chart of a method for detecting a visibility value according to an embodiment of the disclosure.
  • Fig. 2 is a schematic diagram of a detection method for determining a visibility value according to an embodiment of the present disclosure.
  • Fig. 3 is a schematic diagram of an application scenario according to an embodiment of the present disclosure.
  • Fig. 4 is a schematic diagram of a neural network structure according to an embodiment of the disclosure.
  • Fig. 5 is a schematic diagram of a logic structure of a road visibility detection device according to an embodiment of the disclosure.
  • Fig. 6 is a schematic diagram of a logic structure of an electronic device according to an embodiment of the present disclosure.
  • first, second, third, etc. may be used in the present disclosure to describe various information, the information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of the present disclosure, first information may also be called second information, and similarly, second information may also be called first information. Depending on the context, the word “if” as used herein may be interpreted as “at” or “when” or “in response to a determination.”
  • the amount of haze or dust content in the area to be detected can be determined by identifying the visibility value of the area to be detected, so as to guide traffic travel.
  • some methods are to directly detect the visibility value of the area to be inspected through the visibility meter. This method requires the deployment of special inspection equipment in the area to be inspected, which is costly and difficult to implement.
  • the image of the area to be detected can be input into a pre-trained neural network to predict the visibility of the area to be detected.
  • a pre-trained neural network to predict the visibility of the area to be detected.
  • the visibility value range of the area for example, less than 50m, less than 100m, greater than 1000m, etc., so that when the neural network predicts the image of the area to be detected, it only predicts a rough visibility value range, and cannot obtain accurate visibility values, and Because the visibility value range of the sample image estimated by human experience will be affected by subjective factors, the prediction result is not very accurate.
  • an embodiment of the present disclosure provides a visibility value detection method, which can pre-calibrate the mapping relationship between the characterization quantity that can reflect the visibility value of the scene contained in the image and the visibility value.
  • the feature extraction of the image to be detected can be performed to obtain the representation of the image to be detected, and then based on the pre-calibrated mapping relationship between the representation and the visibility value, and the representation of the image to be detected, the visibility value of the scene contained in the image to be detected can be determined.
  • the visibility value of the image to be detected can also be determined without using a special visibility value tester.
  • the embodiment of the present disclosure can also obtain a finer-grained visibility value, which is convenient for subsequent applications.
  • the methods provided by the embodiments of the present disclosure can be executed by various electronic devices, such as cloud servers, user terminals, etc., and the methods can be used to predict visibility values in cloudy fog, haze, sand and other climates.
  • the method for determining the visibility value in the embodiment of the present disclosure may include steps S102 to S106.
  • the image to be detected can be obtained, the image to be detected can be an image of an area where the visibility value needs to be detected, collected by an image acquisition device, and the image to be detected can include scenes such as fog, sand and haze.
  • step S104 feature extraction may be performed on the image to be detected to obtain a characterization quantity representing the visibility value of the scene contained in the image to be detected.
  • a pre-trained neural network can be used to extract features from the image to be detected, or other methods can be used to extract features from the image to be detected, as long as it can be determined that it can reflect the visibility value of the scene contained in the image to be detected
  • the characterization quantity of size is enough.
  • the neural network can be trained through sample images, so that the trained neural network can accurately extract features related to the visibility value of the image, and output a representation quantity that can represent the visibility value.
  • the representation quantity can be a representation of the visibility value
  • Various information of size for example, can be vectors, matrices, specific values, etc.
  • the representation quantity may be a one-dimensional scalar quantity.
  • S106 Determine the visibility value of the image to be detected based on the pre-calibrated mapping relationship between the characterization quantity and the visibility value, and the characterization quantity of the image to be detected, wherein the characterization quantity can reflect the visibility value of the scene contained in the image the size of.
  • step S106 after obtaining the characterization quantity of the image to be detected, the characterization quantity of the image to be detected can be mapped into a visibility value based on the pre-calibrated mapping relationship between the characterization quantity and the visibility value, and the scene contained in the image to be detected can be obtained. visibility value.
  • the characterization quantity mentioned in the embodiments of the present disclosure can reflect the magnitude of the visibility value of the scene contained in the image.
  • feature extraction can be performed on some images with known visibility values to obtain the characterization quantities of these images, and the mapping relationship is constructed according to the correspondence between the characterization quantities of these images and the visibility values.
  • mapping relationship for the range of visibility values.
  • the accurate visibility value of the scene contained in the image can be predicted, and the visibility of the image can be represented in a more fine-grained manner, which is convenient for subsequent applications.
  • the feature extraction of the image to be detected may be performed through a pre-trained neural network to obtain the characterization of the image to be detected.
  • the mapping relationship between the representation quantity and the visibility value can be constructed based on the pre-trained neural network, and then the neural network is used to determine the representation quantity of the image to be detected, and then based on the representation quantity and the mapping relationship of the image to be detected to determine the Detects the visibility value of an image. Since it is difficult to calibrate the accurate visibility value of the sample image, it is difficult to obtain a large number of samples with accurate visibility value labels for training the neural network when training the neural network.
  • the trained neural network In order for the trained neural network to accurately extract features from the image and output a characterization quantity that can reflect the scene visibility value contained in the image, in some embodiments, when the neural network is trained, a pair of sample images carrying label information can be obtained , the label information is used to indicate the relative size relationship of the visibility values corresponding to the two frames of sample images in the sample image pair, and then the two frames of sample images in the sample image pair are input into the preset initial neural network, using the preset
  • the initial neural network is assumed to output the prediction result of the relative size relationship between the visibility values of the two frames of sample images in the sample image pair, and then based on the difference between the prediction result and the real result indicated by the label information, the network parameters of the initial neural network are continuously adjusted to Train the neural network.
  • sample image A and sample image B can be obtained, wherein the visibility value of sample image A is greater than the visibility value of sample image B, and then the initial neural network is used to output the probability that sample image A is an image with a larger visibility value, and then with The sample image A is compared with the real probability of the image with a large visibility value, and the deviation is determined. Based on the deviation, the initial neural network parameters are continuously adjusted until convergence, and a trained neural network is obtained. In this way, without obtaining sample images carrying visibility value labels, a neural network that can accurately extract representations reflecting the magnitude of the visibility value of an image can also be trained.
  • the preset initial neural network may include a feature extraction network, a representation quantity determination network, and an output layer.
  • the feature extraction network can be used to extract the features of the two frames of images in the sample image pair first, and then through the representation quantity
  • the determination network determines the respective representations of the two frames of images in the sample image pair, and then the visibility of the two frames of images can be determined through the output layer based on the respective representations of the two frames of images in the sample image pair The relative size relationship of the values.
  • the characterization quantity output by the neural network needs to reflect the visibility value of the scene contained in the image as truly as possible, the visibility value obtained based on the characterization quantity mapping will be accurate.
  • the applicant has optimized the structure of the neural network to improve its performance.
  • the characterization quantity determination network may include two network branches, that is, the first network branch and the second network branch, and the relative magnitudes of the visibility values of the two frame sample images in the output sample image pair according to the preset initial neural network
  • the representation of the second image and then determine the prediction result based on the representation of the first image and the representation of the second image.
  • the features of the extracted two frames of images are extracted by using two network branches, so as to obtain the first image and the second image respectively. Compared with only using one network branch to extract the features of the extracted two frames of images, the result obtained will be more accurate.
  • the characterization quantity determination network may also only include one network branch, and the features extracted by the feature extraction network of the two frames of images in the sample image pair can all be input into the network branch, through which the network branch respectively Determining the characterization quantities corresponding to the two frames of images.
  • one of the network branches may be randomly selected for the sample image input first, and another network branch is selected for the sample image input later.
  • the two network branches can also correspond to the visibility values of the sample images. For example, for the first network branch, it can be specially used for feature extraction of sample images with larger visibility values, and for the second network branch , which can be specially used for feature extraction of sample images with small visibility values, etc.
  • At least two first image sets can be acquired, wherein the visibility value range of each image in each first image set of the at least two first image sets is the same, and any two images in the first image set The visibility value ranges for do not overlap. Then one frame of image is respectively acquired from any two first image sets to form a sample image pair. Since the visibility ranges of the images in any two sample image sets are different, a large number of sample image pairs with different visibility values can be obtained by randomly combining each image in any two first image sets. Train the neural network.
  • the characterization quantity representing the visibility value of the scene included in the image may be a one-dimensional scalar, such as a specific value, so as to facilitate the establishment of a mapping relationship between the characterization quantity and the visibility value.
  • the specific visibility values of some images can also be determined first through a visibility meter or other means, and then based on the characterization quantities of these images and the visibility values of these images Build a mapping relationship.
  • a third image set may be obtained, wherein the third image set may include multiple frames of images with known visibility values, and then feature extraction may be performed on the multiple frames of images in the third image set to determine the representation of the multiple frames of images,
  • a mapping relationship may be constructed based on the representation quantities of the multiple frames of images and the visibility values of the multiple frames of images.
  • the visibility values of the multiple frames of images in the third image set can be evenly distributed within a specified visibility range , where the specified visibility range can be determined based on the approximate distribution range of the visibility values of the image to be tested. For example, assuming that the visibility values of the image to be detected are generally distributed within 1000m, it is necessary to accurately calibrate the visibility values and representations within the visibility value range Therefore, the specified visibility range is 0-1000m. In order to make the calibrated mapping relationship as accurate as possible, the visibility values of the multi-frame images in the third image set can be distributed as evenly as possible within this range to cover Individual visibility gradients within the range.
  • each second image set when establishing the mapping relationship between the characterization quantity and the visibility value, at least one second image set can be obtained, and each second image set includes multiple frames of images , the visibility value range of the images in each second image set is the same, for example, both are 0-50m, or all are 50-100m.
  • each second image set feature extraction can be performed on each frame of the image in the second image set to obtain the representation of each frame of the image in the second image set, for example, each frame of image can be input into the trained neural network, Utilize the neural network to output the characterization quantity of the image, so that the distribution range of the characterization quantity of each image in the second image set can be obtained, and then the characterization quantity can be determined according to the visibility value range and the characterization quantity distribution range of each image in each second image set The mapping relationship with the visibility value.
  • each second image set may include a large number of sample images, and the more images there are, the more the visibility values of the images can cover each visibility value within the visibility value range, and the more accurate the established mapping relationship is.
  • the visibility values of these images are in the range of 0-50m. Since there are a large number of images, these images can basically cover each visibility value between 0-50m. Then the representations of these images can be output through the neural network, wherein the representations and visibility values can be positively or negatively correlated, for example, the greater the visibility, the greater the representation.
  • the mapping relationship may be determined according to the distribution range of the characteristic quantities and the visibility value range of these images. For example, the distribution range of the token is A-B, assuming that the token is positively correlated with the visibility value, then the visibility value corresponding to token A is 0, and the visibility value corresponding to token B is 50, and then the mapping relationship can be established.
  • the above is just a simple example, and it may be more complicated when actually constructing the mapping relationship.
  • the visibility value ranges of the images in two adjacent second image sets are continuous.
  • the ranges of visibility values corresponding to these six second image sets are (0m,50m], (50m,100m], (100m,200m], (200m,500m], (500m, 1000m], (1000m, ⁇ )
  • the ranges of visibility values corresponding to two adjacent second image sets are continuous and separated by target visibility values.
  • the visibility ranges are (0m, 50m] and ( 50m, 100m], the two second image sets are separated by the target visibility value 50m.
  • the mapping relationship is determined based on the visibility value range and characterization quantity distribution range corresponding to each second image set
  • the mapping relationship determines the representation quantity corresponding to the target visibility value, and then Determine the mapping relationship based on the characterization of the target visibility value. Since the target visibility value is the boundary between two adjacent visibility value ranges, when determining the mapping relationship, it is mainly determined based on the boundary of the visibility value range and the boundary of the distribution range of the characterization quantity , so accurately determining the characterization of the boundary is the key to accurately determining the mapping relationship.
  • the target visibility value 50m is the boundary of the two visibility value ranges.
  • the characterization quantity corresponding to the target visibility value of 50m can be determined. For example, taking the positive correlation between the characterization quantity and the visibility value as an example, the characterization quantity corresponding to the target visibility value of 50m is the largest characterization quantity in the previous second image set, and the next second image set.
  • the minimum characterization quantity of the target visibility value 50m determined based on the two second image sets may be inconsistent, so the final target visibility value can be obtained based on the characterization quantities of the target visibility value 50m respectively determined by the two second image sets the amount of representation.
  • the characterization quantity of the target visibility value when determining the characterization quantity of the target visibility value based on the visibility value range and the distribution range of the characterization quantity corresponding to two adjacent second image sets, it may be based on the visibility value range of the two adjacent second image sets and the distribution range of the characterization quantity, determine the initial characterization quantity corresponding to the target visibility value, and then continuously adjust the initial characterization quantity to obtain the adjusted characterization quantity, based on the adjusted characterization quantity, the images in the two adjacent second image sets are Classify until the accuracy of the classification results of the two adjacent second image sets reaches the maximum value, and then use the adjusted characterization as the characterization corresponding to the target visibility value.
  • the output characterization value is between 0-20.
  • the output of the characterization quantity is between 18-40, therefore, based on the latter second image set, it can be preliminarily determined that the characterization quantity corresponding to 50m is 18, and then, one of the characterization quantities (18 or 20) or the average value of the two can be taken as 19
  • the initial characterization quantity of the target visibility value of 50m and then adjust the initial characterization quantity within a certain range (for example, increase or decrease by a certain step size)
  • the initial characterization quantity is adjusted, based on the adjusted characterization quantity, the All the images in these two image sets are classified to obtain classification results bounded by the adjusted characterization amount, and determine the accuracy of each classification result.
  • the adjusted characterization amount is 19, that is, 50m corresponds to If the representation value is 19, then according to the classification according to the representation value, the image whose representation value is in the range of 19-20 in the previous sample image set will be misclassified, so that a classification accuracy can be calculated. Similarly, the representation value in the latter sample image set is in the range of 18 The image of -19 will also be misclassified, so a classification accuracy can also be calculated.
  • the characterization quantity when the classification accuracy of the two sample image sets is the highest can be taken as the characterization quantity corresponding to the target visibility value of 50m. For other target visibility Values (for example, 100m, 200m, 500, 1000m in the above six second image sets), a similar method can also be used.
  • the pre-trained neural network may include a feature extraction network, a first network branch, and a second network branch.
  • feature extraction can be performed on the image to be detected through the feature extraction network, and the extracted features can be input to any one of the first network branch or the second network branch to obtain the characterization quantity of the image to be detected, that is, when extracting the feature of the image to be detected
  • one of the network branches can be used to output the characterization of the image to be detected.
  • the final representations may also be obtained by combining the representations of the images to be detected output by the two network branches.
  • the feature extraction network of the neural network can be used to perform feature extraction on the image to be detected, and the extracted features can be input to the first network branch to obtain the first representation, and the extracted features can be input to the second network branch.
  • a second characterization quantity is obtained, and a characterization quantity of the image to be detected is obtained based on the first characterization quantity and the second characterization quantity.
  • the representation quantity of the image to be detected can be obtained by weighting the first representation quantity and the second representation quantity, wherein the weights can be the same, or can be set differently according to actual requirements.
  • the image to be detected can be an image of a road area, and the image to be detected can be collected by an image acquisition device installed on the road. After determining the visibility value of the scene contained in the image to be detected, it can also be based on the visibility value.
  • Determine the hazard level of the current specific climate for example, foggy weather, sandy weather, haze climate, etc.
  • select a control strategy corresponding to the hazard level to control the traffic on the road For example, multiple levels for evaluating the degree of fog weather hazard can be preset. Different levels correspond to different visibility value ranges. Each hazard level can be preset with corresponding control strategies to control traffic on the road.
  • the management and control strategy may include early warning of foggy weather for vehicles on the road, the management and control strategy may also include prompting the speed of vehicles on the road to be controlled below a certain speed, and the management and control strategy may also include closing road intersections and prohibiting vehicles from passing.
  • the image to be detected may be an image of a road area
  • the image to be detected may be a multi-frame image collected at different times by an image acquisition device set in the road.
  • a frame of image of the road area can be obtained every 30 minutes, and the corresponding visibility value of the image can be determined to obtain the change trend of the road visibility value within a period of time, so that it can be predicted that the fog concentration in the road is gradually increasing , or decrease, so as to predict the change trend of foggy climate.
  • the image to be detected may be an image of a road area
  • the image to be detected may be an image collected by an image acquisition device installed on the road at preset time intervals, for example, one or more frames of images are collected every hour , and then determine the visibility value corresponding to this frame or multiple frames of images through the neural network to determine whether a specific climate (for example, cloudy weather, sandy weather, haze weather, etc.) phenomenon is currently occurring.
  • a specific climate for example, cloudy weather, sandy weather, haze weather, etc.
  • the visibility value corresponding to the image exceeds a preset threshold, if the visibility values corresponding to each frame of image exceed the preset threshold, or the corresponding visibility values of a certain number of images exceed the preset threshold, Then it is determined that a specific weather phenomenon is currently occurring in the road area.
  • the average value of the visibility values of the frame or multiple frames of images may be determined, and if the average value exceeds a preset threshold, it is determined that a specific weather phenomenon is currently occurring in the road area.
  • one or more frames of road area images can be collected every 2 hours, and the visibility value corresponding to this frame or multiple frames of road area images can be predicted by the neural network. If the visibility values of these images exceed the preset threshold, then It is determined that clusters of fog have occurred in the road area, and the frequency of daily clusters of fog can be determined by counting the total number of clusters of fog in a day.
  • the images of the road area are collected by cameras set on the road, and the visibility of the road area contained in the image is predicted based on the neural network.
  • the neural network is only trained by sample images carrying visibility value range labels, and the output of the neural network is only the classification result of the visibility value range of the image, and the exact specific value of visibility cannot be obtained.
  • This embodiment provides a method that can detect specific values of visibility in an image
  • Figure 3 is a schematic diagram of an application scenario of the method, the method can be used to detect specific values of visibility in a road area, and then carry out road traffic monitoring Control.
  • the method includes a neural network training stage, a calibration of the mapping relationship between a one-dimensional scalar output by the neural network and a concrete numerical value of visibility, and a neural network reasoning stage.
  • a large number of sample images can be collected. For each sample image, there is no need to calibrate its specific visibility value. It is only necessary to determine the category of the visibility value range to which it belongs. For example, the sample images can be divided into 6 categories, and the corresponding 6 visibility value ranges are : (0m,50m], (50m,100m], (100m,200m], (200m,500m], (500m,1000m], (1000m, ⁇ ). Since only the visibility value range of the image needs to be calibrated, it is easy to implement, Thus, a large number of sample images can be acquired.
  • sample images in any two categories of the above six types of sample image sets can be combined in pairs to obtain a large number of sample image pairs, wherein the relative magnitude relationship of the visibility value of each sample image pair is known.
  • the sample image pair can be used as a training sample, and the relative size relationship of the visibility value of the sample image pair can be used as a label to train the initial neural network to obtain a trained neural network.
  • the structure of the neural network is shown in FIG. 4 , including a feature extraction network, a first network branch, a second network branch, and an output layer.
  • the feature extraction network for example, can choose the resnet18 network, which includes 5 convolutional layers (such as conv1-conv5 in Figure 4), and accesses 2 network branches after conv5, namely the first network branch and the second network branch , each network branch contains 3 layers of fully connected layers.
  • the output dimension of the fully connected layer fc1 is 256, and the activation function is selected as prelu; the output dimension of the fully connected layer fc2 is 128, and the activation function is selected as prelu; the output dimension of the fully connected layer fc3 is 1, and the activation function is selected as liner.
  • sample image A and sample image B When a sample image pair (sample image A and sample image B) is input into the neural network, the sample image A can extract features through the feature extraction network, and then further input the extracted features to the first network branch for feature extraction, and finally A one-dimensional scalar RA is output, which can reflect the magnitude of the visibility value of the scene included in the sample image A.
  • the sample image B can extract features through the feature extraction network, and then further input the extracted features to the second network branch for feature extraction, and finally output a one-dimensional scalar RB, which can reflect the visibility value of the scene included in the sample image B.
  • the one-dimensional scalar output by the neural network may be positively correlated with the specific value of the visibility, and the larger the one-dimensional scalar, the greater the specific value of the visibility.
  • the one-dimensional scalars RA and RB can be input into the output layer, and the output layer can determine the probability p that the sample image A is an image with a higher specific value of visibility based on the one-dimensional scalars RA and RB, and that the sample image B is an image with a higher specific value of visibility.
  • the loss function can use cross-entropy loss.
  • the real probability that the sample image A is an image with a larger specific value of the visibility is y (y is 1 or is preset A value close to 1, such as 0.8), the real probability that the sample image B is an image with a larger specific value of visibility is 1-y.
  • the parameters of the neural network can be continuously adjusted based on the cross-entropy loss until the loss function converges to obtain a trained neural network.
  • Each frame image in the above six classifications can be input into the neural network, and the neural network is used to output a one-dimensional scalar representing the specific value of the visibility corresponding to each frame image. Due to the large number of sample images, it can be considered that the output one-dimensional scalar is basically It can reflect various specific values of visibility. For example, there are 10,000 sample images in the category (0,50], which has a high probability of reflecting each visibility value between 0m and 50m, and then based on the labeling in each category The image visibility value range and the one-dimensional scalar range construct the mapping relationship.
  • the one-dimensional scalar corresponding to the boundary value of each visibility value range for example, 0m, 50m, 100m, 200m, 500m , 1000m.
  • the one-dimensional scalar is positively correlated with the specific value of visibility, the minimum value of the one-dimensional scalar in the image whose visibility value range is (0,50] corresponds to the boundary value 0m.
  • the maximum value of the one-dimensional scalar in the image set whose visibility value range is (0,50] corresponds to 50m
  • the minimum value of the one-dimensional scalar value in the image set whose visibility value range is (50,100] is also Corresponding to 50m
  • the one-dimensional scalar corresponding to 50m determined based on the two classified image sets may not be equal.
  • the one-dimensional scalar corresponding to 50m in the image set whose visibility value range is in (0,50] is 10
  • the visibility value range is in ( 50,100] in the image set
  • the one-dimensional scalar corresponding to 50m is 15.
  • the one-dimensional scalar corresponding to the boundary value 50m can be continuously adjusted (for example, take the one-dimensional scalar between 10-15 value), and then determine the accuracy of classifying the images in these two classifications based on the adjusted one-dimensional scalar. For example, when the one-dimensional scalar corresponding to the boundary value 50m is 12, the visibility value range is located at ( 0,50], the accuracy is only 80%.
  • the accuracy based on the one-dimensional scalar 12 is 80%; similarly, based on This one-dimensional scalar classifies all images whose visibility values range from (50,100], the accuracy is only 90%, and then continuously adjusts the one-dimensional scalar value corresponding to the boundary value 50m until the classification accuracy of the two classified images When the maximum value is reached, the one-dimensional scalar is determined as the one-dimensional scalar corresponding to the visibility value 50m.
  • mapping relationship can be constructed based on the one-dimensional scalar.
  • the specific value of the visibility of multiple frames of images it is also possible to first determine the specific value of the visibility of multiple frames of images through the visibility meter, and then determine the one-dimensional scalar of the multiple frames of images through the pre-trained neural network, based on the one-dimensional scalar sum of the multiple frames of images
  • the specific numerical value of the visibility constructs the mapping relationship.
  • the specific values of the visibility of the multiple frames of images should cover the gradients of each visibility value as much as possible.
  • the image to be detected When you want to detect the specific value of the visibility of the image to be detected, you can obtain the image to be detected, input the image to be detected into the neural network, and output the one-dimensional scalar of the image to be detected through the neural network (it can be determined by using a network branch, or can be selected The average of the output results of the two network branches). Then, the specific value of the visibility of the image to be detected is determined according to the one-dimensional scalar of the image to be detected and the pre-calibrated mapping relationship. After determining the specific value of the visibility of the image to be detected, the traffic on the road can be controlled based on the specific value of the visibility.
  • the neural network can be trained without calibrating the specific value of the visibility of the sample image, and the specific value of the visibility of the image to be detected can be determined based on the trained neural network. Compared with determining the range of visibility values, more accurate visibility results can be obtained.
  • the embodiment of the present disclosure also provides a visibility value detection device.
  • the device 50 includes: an acquisition module 51 for acquiring an image to be detected;
  • the pre-trained neural network performs feature extraction on the image to be detected to obtain the characterization quantity of the image to be detected;
  • the visibility value determination module 53 is used to determine the mapping relationship based on the pre-calibrated characterization quantity and visibility value, and the to-be-detected image.
  • the characterization quantity of the detected image determines the visibility value corresponding to the image to be detected, wherein the characterization quantity can reflect the magnitude of the visibility value of the scene contained in the image.
  • an embodiment of the present disclosure is also an electronic device.
  • the electronic device includes a processor 61, a memory 62, and computer instructions stored in the memory 62 for execution by the processor 61.
  • the processor executes the computer instructions, the method described in any of the foregoing embodiments can be implemented.
  • An embodiment of the present disclosure further provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the method described in any one of the foregoing embodiments is implemented.
  • Computer-readable media including both permanent and non-permanent, removable and non-removable media, can be implemented by any method or technology for storage of information.
  • Information may be computer readable instructions, data structures, modules of a program, or other data.
  • Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Flash memory or other memory technology, Compact Disc Read-Only Memory (CD-ROM), Digital Versatile Disc (DVD) or other optical storage, Magnetic tape cartridge, tape magnetic disk storage or other magnetic storage device or any other non-transmission medium that can be used to store information that can be accessed by a computing device.
  • computer-readable media excludes transitory computer-readable media, such as modulated data signals and carrier waves.
  • a typical implementing device is a computer, which may take the form of a personal computer, laptop computer, cellular phone, camera phone, smart phone, personal digital assistant, media player, navigation device, e-mail device, game control device, etc. desktops, tablets, wearables, or any combination of these.
  • each embodiment in this specification is described in a progressive manner, the same and similar parts of each embodiment can be referred to each other, and each embodiment focuses on the differences from other embodiments.
  • the description is relatively simple, and for relevant parts, please refer to part of the description of the method embodiment.
  • the device embodiments described above are only illustrative, and the modules described as separate components may or may not be physically separated, and the functions of each module may be integrated in the same or multiple software and/or hardware implementations. Part or all of the modules can also be selected according to actual needs to achieve the purpose of the solution of this embodiment. It can be understood and implemented by those skilled in the art without creative effort.

Abstract

Provided are a visibility value measurement method and apparatus, a device, and a storage medium. The method comprises: acquiring an image to be measured; performing feature extraction on said image to obtain a representation amount of said image; and determining a visibility value corresponding to said image on the basis of a pre-calibrated mapping relationship between the representation amount and the visibility value, and the representation amount of said image, wherein the representation amount can reflect the size of the visibility value of a scene contained in the image.

Description

能见度值检测方法、装置、设备及存储介质Visibility value detection method, device, equipment and storage medium
相关申请交叉引用Related Application Cross Reference
本申请主张申请号为202111656430.5、申请日为2021年12月30日的中国专利申请的优先权,该中国专利申请的全部内容在此引入本申请作为参考。This application claims the priority of a Chinese patent application with application number 202111656430.5 and a filing date of December 30, 2021. The entire content of this Chinese patent application is hereby incorporated by reference into this application.
技术领域technical field
本公开涉及人工智能技术领域,尤其涉及一种能见度值检测方法、装置、设备及存储介质。The present disclosure relates to the technical field of artificial intelligence, and in particular to a visibility value detection method, device, equipment and storage medium.
背景技术Background technique
雾天、雾霾、沙尘等气候会导致环境中的能见度较低,影响交通出行。比如,常见的团雾气候,是受局部地区的微气候环境的影响,在大雾局部范围内出现的能见度更低的雾,团雾发生时,能见度突然急剧降低,较难提前预测及预报,对道路交通安全危害性大,尤其是在高快速公路上,易酿成重大交通事故。因而,可以通过识别待检测区域的能见度值来判定雾天、沙尘等气候的影响,以指导交通出行。所以,有必要提供一种可以方便而准确地确定待检测区域的能见度值的方案。Fog, smog, dust and other climates will lead to low visibility in the environment and affect traffic travel. For example, the common foggy climate is affected by the micro-climate environment in local areas. Fog with lower visibility appears in the local area of heavy fog. It is very harmful to road traffic safety, especially on high-speed expressways, and it is easy to cause major traffic accidents. Therefore, by identifying the visibility value of the area to be detected, it is possible to determine the influence of fog, sand and dust, etc., to guide traffic. Therefore, it is necessary to provide a scheme that can conveniently and accurately determine the visibility value of the area to be detected.
发明内容Contents of the invention
根据本公开实施例的第一方面,提供一种能见度值检测方法,所述方法包括:获取待检测图像;对所述待检测图像进行特征提取,得到所述待检测图像的表征量;基于预先标定的表征量与能见度值的映射关系、以及所述待检测图像的表征量,确定所述待检测图像的能见度值;其中,所述表征量能够反映图像中包含的场景的能见度值的大小。According to the first aspect of an embodiment of the present disclosure, there is provided a visibility value detection method, the method comprising: acquiring an image to be detected; performing feature extraction on the image to be detected to obtain a characterization quantity of the image to be detected; The mapping relationship between the calibrated characteristic quantity and the visibility value, and the characteristic quantity of the image to be detected determine the visibility value of the image to be detected; wherein, the characteristic quantity can reflect the magnitude of the visibility value of the scene contained in the image.
根据本公开实施例的第二方面,提供一种能见度值检测装置,所述装置包括:获取模块,用于获取待检测图像;表征模块,用于通过预先训练的神经网络对所述待检测图像进行特征提取,得到所述待检测图像的表征量;能见度值确定模块,用于基于预先标定的表征量与能见度值的映射关系、以及所述待检测图像的表征量确定所述待检测图像对应的能见度值,其中,所述表征量能够反映图像中包含的场景的能见度值的大小。According to the second aspect of the embodiments of the present disclosure, there is provided a visibility value detection device, the device comprising: an acquisition module, used to acquire an image to be detected; a characterization module, used to analyze the image to be detected through a pre-trained neural network performing feature extraction to obtain the characterization quantity of the image to be detected; a visibility value determination module, configured to determine the corresponding The visibility value of , wherein the characterization quantity can reflect the magnitude of the visibility value of the scene contained in the image.
根据本公开实施例的第三方面,提供一种电子设备,所述电子设备包括处理器、存储器、存储在所述存储器可供所述处理器执行的计算机指令,所述处理器执行所述计算机指令时,可实现上述第一方面提及的方法。According to a third aspect of the embodiments of the present disclosure, there is provided an electronic device, the electronic device includes a processor, a memory, and computer instructions stored in the memory that can be executed by the processor, and the processor executes the computer Instructions, the method mentioned in the first aspect above can be implemented.
根据本公开实施例的第四方面,提供一种计算机可读存储介质,所述存储介质上存储有计算机指令,所述计算机指令被执行时实现上述第一方面提及的方法。According to a fourth aspect of the embodiments of the present disclosure, there is provided a computer-readable storage medium, on which computer instructions are stored, and when the computer instructions are executed, the method mentioned in the above-mentioned first aspect is implemented.
根据本公开实施例的第五方面,提供一种计算机程序产品,该产品包括计算机程序,该计算机程序被处理器执行时实现上述第一方面提及的方法。According to a fifth aspect of the embodiments of the present disclosure, a computer program product is provided, the product includes a computer program, and when the computer program is executed by a processor, the method mentioned in the above first aspect is implemented.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,而非限制本公开。It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
附图说明Description of drawings
此处的附图被并入说明书中并构成本说明书的一部分,这些附图示出了符合本公开的实施例,并与说明书一起用于说明本公开的技术方案。The accompanying drawings here are incorporated into the description and constitute a part of the present description. These drawings show embodiments consistent with the present disclosure, and are used together with the description to explain the technical solution of the present disclosure.
图1是根据本公开实施例的一种能见度值检测方法的流程图。Fig. 1 is a flow chart of a method for detecting a visibility value according to an embodiment of the disclosure.
图2是根据本公开实施例的一种确定能见度值的检测方法的示意图。Fig. 2 is a schematic diagram of a detection method for determining a visibility value according to an embodiment of the present disclosure.
图3是根据本公开实施例的一种应用场景示意图。Fig. 3 is a schematic diagram of an application scenario according to an embodiment of the present disclosure.
图4是根据本公开实施例的一种神经网络结构示意图。Fig. 4 is a schematic diagram of a neural network structure according to an embodiment of the disclosure.
图5是根据本公开实施例的一种道路能见度值检测装置的逻辑结构示意图。Fig. 5 is a schematic diagram of a logic structure of a road visibility detection device according to an embodiment of the disclosure.
图6是根据本公开实施例的一种电子设备的逻辑结构示意图。Fig. 6 is a schematic diagram of a logic structure of an electronic device according to an embodiment of the present disclosure.
具体实施方式Detailed ways
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本公开相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本公开的一些方面相一致的装置和方法的例子。Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numerals in different drawings refer to the same or similar elements unless otherwise indicated. The implementations described in the following exemplary examples do not represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatuses and methods consistent with aspects of the present disclosure as recited in the appended claims.
在本公开使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本公开。在本公开和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。还应当理解,本文中使用的术语“和/或”是指并包含一个或多个相关联的列出项目的任何或所有可能组合。另外,本文中术语“至少一种”表示多种中的任意一种或多种中的至少两种的任意组合。The terminology used in the present disclosure is for the purpose of describing particular embodiments only, and is not intended to limit the present disclosure. As used in this disclosure and the appended claims, the singular forms "a", "the", and "the" are intended to include the plural forms as well, unless the context clearly dictates otherwise. It should also be understood that the term "and/or" as used herein refers to and includes any and all possible combinations of one or more of the associated listed items. In addition, the term "at least one" herein means any one of a plurality or any combination of at least two of a plurality.
应当理解,尽管在本公开可能采用术语第一、第二、第三等来描述各种信息,但这 些信息不应限于这些术语。这些术语仅用来将同一类型的信息彼此区分开。例如,在不脱离本公开范围的情况下,第一信息也可以被称为第二信息,类似地,第二信息也可以被称为第一信息。取决于语境,如在此所使用的词语“如果”可以被解释成为“在……时”或“当……时”或“响应于确定”。It should be understood that although the terms first, second, third, etc. may be used in the present disclosure to describe various information, the information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of the present disclosure, first information may also be called second information, and similarly, second information may also be called first information. Depending on the context, the word "if" as used herein may be interpreted as "at" or "when" or "in response to a determination."
为了使本技术领域的人员更好的理解本公开实施例中的技术方案,并使本公开实施例的上述目的、特征和优点能够更加明显易懂,下面结合附图对本公开实施例中的技术方案作进一步详细的说明。In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present disclosure, and to make the above-mentioned purposes, features and advantages of the embodiments of the present disclosure more obvious and understandable, the technical solutions in the embodiments of the present disclosure are described below in conjunction with the accompanying drawings The program is described in further detail.
雾天、雾霾、沙尘等气候会导致环境中的能见度较低,易引发交通事故。通常,可以通过识别待检测区域的能见度值来判定待检测区域中雾霾或沙尘含量的大小,以指导交通出行。目前,在确定待检测区域的能见度大小时,有些方式是直接通过能见度仪检测待检测区域的能见度值,这种方式需要在待检测区域内部署专门的检测设备,成本较高,也不易实现。也有些方式可以基于待检测区域的图像来确定待检测区域的能见度。比如,可以将待检测区域的图像输入至预先训练的神经网络中,以预测待检测区域的能见度。但是,由于标定样本图像准确的能见度值存在较大难度,难以获得大量携带能见度值标签的图像,因而,在标定用于训练神经网络的样本图像时,通常只是基于人为经验估计样本图像中包括的区域的能见度值范围,比如,小于50m、小于100m、大于1000m等,从而神经网络在对待检测区域的图像进行预测时,也仅仅是预测一个粗略的能见度值范围,无法获取精确的能见度值,并且由于通过人为经验估计的样本图像的能见度值范围会受主观因素影响,导致预测结果不太准确。Fog, smog, dust and other climates will lead to low visibility in the environment and easily lead to traffic accidents. Generally, the amount of haze or dust content in the area to be detected can be determined by identifying the visibility value of the area to be detected, so as to guide traffic travel. At present, when determining the visibility of the area to be inspected, some methods are to directly detect the visibility value of the area to be inspected through the visibility meter. This method requires the deployment of special inspection equipment in the area to be inspected, which is costly and difficult to implement. There are also some ways to determine the visibility of the area to be inspected based on the image of the area to be inspected. For example, the image of the area to be detected can be input into a pre-trained neural network to predict the visibility of the area to be detected. However, due to the difficulty in calibrating the exact visibility value of the sample image, it is difficult to obtain a large number of images carrying visibility value labels. Therefore, when calibrating the sample image used to train the neural network, it is usually only estimated based on human experience. The visibility value range of the area, for example, less than 50m, less than 100m, greater than 1000m, etc., so that when the neural network predicts the image of the area to be detected, it only predicts a rough visibility value range, and cannot obtain accurate visibility values, and Because the visibility value range of the sample image estimated by human experience will be affected by subjective factors, the prediction result is not very accurate.
基于此,本公开实施例提供一种能见度值检测方法,可以预先标定能够反映图像包含的场景能见度值大小的表征量与能见度值的映射关系,当要确定待检测图像包含的场景的能见度值时,可以对待检测图像进行特征提取,得到待检测图像的表征量,然后基于预先标定的表征量和能见度值的映射关系,以及待检测图像的表征量确定待检测图像包含的场景的能见度值。Based on this, an embodiment of the present disclosure provides a visibility value detection method, which can pre-calibrate the mapping relationship between the characterization quantity that can reflect the visibility value of the scene contained in the image and the visibility value. When determining the visibility value of the scene contained in the image to be detected , the feature extraction of the image to be detected can be performed to obtain the representation of the image to be detected, and then based on the pre-calibrated mapping relationship between the representation and the visibility value, and the representation of the image to be detected, the visibility value of the scene contained in the image to be detected can be determined.
通过这种方式,无需使用专门的能见度值测试仪,也可以确定待检测图像的能见度值。相比于相关技术中只能确定粗略的能见度值范围,本公开实施例也可以得到更加细粒度的能见度值,便于后续的应用。In this way, the visibility value of the image to be detected can also be determined without using a special visibility value tester. Compared with the related art that can only determine a rough visibility value range, the embodiment of the present disclosure can also obtain a finer-grained visibility value, which is convenient for subsequent applications.
本公开实施例提供的方法可以由各种电子设备执行,比如,云端服务器、用户终端等,该方法可以用于预测团雾、雾霾、沙尘等气候下的能见度值。The methods provided by the embodiments of the present disclosure can be executed by various electronic devices, such as cloud servers, user terminals, etc., and the methods can be used to predict visibility values in cloudy fog, haze, sand and other climates.
如图1所示,本公开实施例中的确定能见度值的方法可以包括步骤S102至步骤S106。As shown in FIG. 1 , the method for determining the visibility value in the embodiment of the present disclosure may include steps S102 to S106.
S102、获取待检测图像。S102. Acquire an image to be detected.
在步骤S102中,可以获取待检测图像,待检测图像可以是由图像采集装置采集的、需要检测能见度值的区域的图像,待检测图像中可以包括团雾、沙尘、雾霾等场景。In step S102, the image to be detected can be obtained, the image to be detected can be an image of an area where the visibility value needs to be detected, collected by an image acquisition device, and the image to be detected can include scenes such as fog, sand and haze.
S104、对所述待检测图像进行特征提取,得到所述待检测图像的表征量。S104. Perform feature extraction on the image to be detected to obtain a characteristic quantity of the image to be detected.
在步骤S104中,可以对待检测图像进行特征提取,得到表征该待检测图像包含的场景能见度值大小的表征量。其中,对待检测图像进行特征提取时,可以采用预先训练的神经网络对待检测图像进行特征提取,或者也可以采用其他方式对待检测图像进行特征提取,只要可以确定能够反映待检测图像包含的场景能见度值大小的表征量即可。比如,可以通过样本图像对神经网络进行训练,使得训练得到的神经网络可以准确提取与图像的能见度值大小相关的特征,并输出可以表征能见度值大小的表征量,该表征量可以是表征能见度值大小的各种信息,比如,可以是向量、矩阵、具体的数值等。在一些实施例中,为了方便对表征量和能见度值进行映射,表征量可以是一维的标量。In step S104, feature extraction may be performed on the image to be detected to obtain a characterization quantity representing the visibility value of the scene contained in the image to be detected. Among them, when performing feature extraction on the image to be detected, a pre-trained neural network can be used to extract features from the image to be detected, or other methods can be used to extract features from the image to be detected, as long as it can be determined that it can reflect the visibility value of the scene contained in the image to be detected The characterization quantity of size is enough. For example, the neural network can be trained through sample images, so that the trained neural network can accurately extract features related to the visibility value of the image, and output a representation quantity that can represent the visibility value. The representation quantity can be a representation of the visibility value Various information of size, for example, can be vectors, matrices, specific values, etc. In some embodiments, for the convenience of mapping the representation quantity and the visibility value, the representation quantity may be a one-dimensional scalar quantity.
S106、基于预先标定的表征量与能见度值的映射关系、以及所述待检测图像的表征量确定所述待检测图像的能见度值,其中,所述表征量能够反映图像中包含的场景的能见度值的大小。S106. Determine the visibility value of the image to be detected based on the pre-calibrated mapping relationship between the characterization quantity and the visibility value, and the characterization quantity of the image to be detected, wherein the characterization quantity can reflect the visibility value of the scene contained in the image the size of.
在步骤S106中,在得到待检测图像的表征量后,可以基于预先标定的表征量和能见度值的映射关系,将待检测图像的表征量映射成能见度值,得到待检测图像中包含的场景的能见度值。其中,本公开实施例中提到的表征量能够反映图像中包含的场景的能见度值的大小。在标定映射关系时,可以对一些已知能见度值的图像进行特征提取,得到这些图像的表征量,根据这些图像的表征量和能见度值的对应关系构建该映射关系。或者,由于图像对应的准确能见度值的标定较为困难,也可以是对一些已知能见度值范围的图像进行特征提取,确定这些图像的表征量分布情况,基于这些图像的表征量分布范围以及这些图像的能见度值范围构建映射关系。标定映射关系的方式很多,只要该映射关系可以准确地反映表征量与能见度值的对应关系即可,本公开实施例不做限制。In step S106, after obtaining the characterization quantity of the image to be detected, the characterization quantity of the image to be detected can be mapped into a visibility value based on the pre-calibrated mapping relationship between the characterization quantity and the visibility value, and the scene contained in the image to be detected can be obtained. visibility value. Wherein, the characterization quantity mentioned in the embodiments of the present disclosure can reflect the magnitude of the visibility value of the scene contained in the image. When calibrating the mapping relationship, feature extraction can be performed on some images with known visibility values to obtain the characterization quantities of these images, and the mapping relationship is constructed according to the correspondence between the characterization quantities of these images and the visibility values. Or, because it is difficult to calibrate the exact visibility value corresponding to the image, it is also possible to perform feature extraction on some images with known visibility value ranges, determine the distribution of the representations of these images, and based on the distribution range of representations of these images and the distribution of these images Construct the mapping relationship for the range of visibility values. There are many ways to calibrate the mapping relationship, as long as the mapping relationship can accurately reflect the corresponding relationship between the characterization quantity and the visibility value, which is not limited in the embodiments of the present disclosure.
通过本公开实施例的方式,可以预测图像中包含的场景的准确的能见度值,更加细粒度的表征图像的能见度,方便后续应用。Through the method of the embodiments of the present disclosure, the accurate visibility value of the scene contained in the image can be predicted, and the visibility of the image can be represented in a more fine-grained manner, which is convenient for subsequent applications.
在一些实施例中,可以通过预先训练的神经网络对待检测图像进行特征提取,得到待检测图像的表征量。如图2所示,可以基于预先训练的神经网络构建表征量与能见度 值的映射关系,然后再利用该神经网络确定待检测图像的表征量,进而基于待检测图像的表征量和映射关系确定待检测图像的能见度值。由于标定样本图像准确的能见度值比较困难,因而,在训练神经网络时,很难获取大量携带准确的能见度值标签的样本用于训练神经网络。为了训练的神经网络可以准确对图像进行特征提取,输出能够反映图像包含的场景能见度值大小的表征量,在一些实施例中,在对神经网络进行训练时,可以获取携带标签信息的样本图像对,该标签信息用于指示该样本图像对中的两帧样本图像分别对应的能见度值的相对大小关系,然后该样本图像对中的两帧样本图像输入到预设的初始神经网络中,利用预设的初始神经网络输出该样本图像对中的两帧样本图像能见度值相对大小关系的预测结果,然后基于该预测结果与标签信息指示的真实结果的差异,不断调整初始神经网络的网络参数,以训练得到神经网络。比如,可以获取样本图像A和样本图像B,其中,样本图像A的能见度值大于样本图像B的能见度值,然后利用初始的神经网络输出样本图像A为能见度值较大的图像的概率,然后与样本图像A为能见度值较大的图像的真实概率进行比较,确定偏差,基于该偏差不断调整初始的神经网络的参数,直至收敛,得到训练好的神经网络。通过这种方式,无需获得携带能见度值标签的样本图像,也可以训练得到可以准确提取反映图像能见度值大小的表征量的神经网络。In some embodiments, the feature extraction of the image to be detected may be performed through a pre-trained neural network to obtain the characterization of the image to be detected. As shown in Figure 2, the mapping relationship between the representation quantity and the visibility value can be constructed based on the pre-trained neural network, and then the neural network is used to determine the representation quantity of the image to be detected, and then based on the representation quantity and the mapping relationship of the image to be detected to determine the Detects the visibility value of an image. Since it is difficult to calibrate the accurate visibility value of the sample image, it is difficult to obtain a large number of samples with accurate visibility value labels for training the neural network when training the neural network. In order for the trained neural network to accurately extract features from the image and output a characterization quantity that can reflect the scene visibility value contained in the image, in some embodiments, when the neural network is trained, a pair of sample images carrying label information can be obtained , the label information is used to indicate the relative size relationship of the visibility values corresponding to the two frames of sample images in the sample image pair, and then the two frames of sample images in the sample image pair are input into the preset initial neural network, using the preset The initial neural network is assumed to output the prediction result of the relative size relationship between the visibility values of the two frames of sample images in the sample image pair, and then based on the difference between the prediction result and the real result indicated by the label information, the network parameters of the initial neural network are continuously adjusted to Train the neural network. For example, sample image A and sample image B can be obtained, wherein the visibility value of sample image A is greater than the visibility value of sample image B, and then the initial neural network is used to output the probability that sample image A is an image with a larger visibility value, and then with The sample image A is compared with the real probability of the image with a large visibility value, and the deviation is determined. Based on the deviation, the initial neural network parameters are continuously adjusted until convergence, and a trained neural network is obtained. In this way, without obtaining sample images carrying visibility value labels, a neural network that can accurately extract representations reflecting the magnitude of the visibility value of an image can also be trained.
在一些实施例中,预设的初始神经网络可以包括特征提取网络、表征量确定网络和输出层。在通过预设的初始神经网络输出样本图像对中的两帧图像能见度值相对大小关系的预测结果时,可以先通过特征提取网络对样本图像对中的两帧图像进行特征提取,然后通过表征量确定网络基于特征提取网络提取到的特征,确定样本图像对中的两帧图像各自的表征量,进而可以通过输出层基于样本图像对中的两帧图像各自的表征量确定这两帧图像的能见度值的相对大小关系。In some embodiments, the preset initial neural network may include a feature extraction network, a representation quantity determination network, and an output layer. When the preset initial neural network is used to output the prediction results of the relative size relationship of the visibility values of the two frames in the sample image pair, the feature extraction network can be used to extract the features of the two frames of images in the sample image pair first, and then through the representation quantity Based on the features extracted by the feature extraction network, the determination network determines the respective representations of the two frames of images in the sample image pair, and then the visibility of the two frames of images can be determined through the output layer based on the respective representations of the two frames of images in the sample image pair The relative size relationship of the values.
由于神经网络输出的表征量需尽可能真实地反映图像包含的场景的能见度值的大小,进而基于表征量映射得到的能见度值才会准确。为了让神经网络输出的表征量尽可能准确,申请人对神经网络的结构进行了优化,以提升其性能。在一些实施例中,表征量确定网络可以包括两个网络分支,即第一网络分支和第二网络分支,在根据预设的初始神经网络输出样本图像对中的两帧样本图像能见度值相对大小关系的预测结果时,可以先通过特征提取网络对样本图像对中的第一图像进行特征提取,并将提取到的特征输入到第一网络分支,通过第一网络分支基于该提取到的特征得到第一图像的表征量,然后通过特征提取网络对样本图像对中的第二图像进行特征提取,并将提取到的特征输入到第二网络分支,通过第二网络分支基于该提取到的特征得到第二图像的表征量,然后基于 第一图像的表征量和第二图像的表征量确定该预测结果。在利用特征提取网络对样本图像对中的两帧图像进行特征提取后,通过利用两个网络分支分别对提取到的两帧图像的特征进行特征提取,从而分别得到第一图像和第二图像的反映图像能见度值大小的表征量,相比于只利用一个网络分支对提取到的两帧图像的特征进行提取,得到的结果会更准确。Since the characterization quantity output by the neural network needs to reflect the visibility value of the scene contained in the image as truly as possible, the visibility value obtained based on the characterization quantity mapping will be accurate. In order to make the representation output by the neural network as accurate as possible, the applicant has optimized the structure of the neural network to improve its performance. In some embodiments, the characterization quantity determination network may include two network branches, that is, the first network branch and the second network branch, and the relative magnitudes of the visibility values of the two frame sample images in the output sample image pair according to the preset initial neural network When predicting the relationship, you can first perform feature extraction on the first image in the sample image pair through the feature extraction network, and input the extracted features to the first network branch, and use the first network branch based on the extracted features to obtain The characterization quantity of the first image, and then perform feature extraction on the second image in the sample image pair through the feature extraction network, and input the extracted features to the second network branch, and obtain based on the extracted features through the second network branch The representation of the second image, and then determine the prediction result based on the representation of the first image and the representation of the second image. After the feature extraction network is used to extract the features of the two frames of images in the sample image pair, the features of the extracted two frames of images are extracted by using two network branches, so as to obtain the first image and the second image respectively. Compared with only using one network branch to extract the features of the extracted two frames of images, the result obtained will be more accurate.
当然,在一些实施例中,表征量确定网络也可以仅包括一个网络分支,样本图像对中的两帧图像经特征提取网络提取到的特征均可以输入到该网络分支中,通过该网络分支分别确定两帧图像各自对应的表征量。Of course, in some embodiments, the characterization quantity determination network may also only include one network branch, and the features extracted by the feature extraction network of the two frames of images in the sample image pair can all be input into the network branch, through which the network branch respectively Determining the characterization quantities corresponding to the two frames of images.
在一些实施例中,先输入的样本图像可以随机选取其中一个网络分支,后输入的样本图像则选取另一网络分支。在一些实施例中,两个网络分支也可以和样本图像的能见度值大小对应,比如,对于第一网络分支,可以专门用于对能见度值较大的样本图像进行特征提取,对于第二网络分支,可以专门用于对能见度值较小的样本图像进行特征提取等。In some embodiments, one of the network branches may be randomly selected for the sample image input first, and another network branch is selected for the sample image input later. In some embodiments, the two network branches can also correspond to the visibility values of the sample images. For example, for the first network branch, it can be specially used for feature extraction of sample images with larger visibility values, and for the second network branch , which can be specially used for feature extraction of sample images with small visibility values, etc.
当然,确定图像对应的能见度值比较困难,但是确定图像对应的大致的能见度范围还是相对简单,凭借人为经验目测即可以确定。所以,可以获取大量图像,针对每帧图像可以确定其能见度值范围,得到图像的能见度值范围标签,比如,0-50m、50-100m、100-150m、大于1000m等,同一能见度范围的图像可以构成一个第一图像集,从而可以得到多个携带能见度范围标签的第一图像集。在获取样本图像对时,可以获取至少两个第一图像集,其中,至少两个第一图像集中的每个第一图像集中各图像的能见度值范围相同,并且任意两个第一图像集中图像的能见度值范围不重叠。然后从任意两个第一图像集中分别获取一帧图像,构成样本图像对。由于任意两个样本图像集中的图像的能见度范围都不同,通过将任意两个第一图像集中各自的一张图像两两随机组合,从而可以得到大量能见度值大小不一样的样本图像对,用于训练神经网络。Of course, it is difficult to determine the visibility value corresponding to the image, but it is relatively simple to determine the approximate visibility range corresponding to the image, which can be determined by human experience and visual inspection. Therefore, a large number of images can be obtained, and the range of visibility values can be determined for each frame of image, and the visibility value range label of the image can be obtained, for example, 0-50m, 50-100m, 100-150m, greater than 1000m, etc. Images with the same visibility range can be A first image set is formed, so that multiple first image sets carrying visibility range labels can be obtained. When acquiring a pair of sample images, at least two first image sets can be acquired, wherein the visibility value range of each image in each first image set of the at least two first image sets is the same, and any two images in the first image set The visibility value ranges for do not overlap. Then one frame of image is respectively acquired from any two first image sets to form a sample image pair. Since the visibility ranges of the images in any two sample image sets are different, a large number of sample image pairs with different visibility values can be obtained by randomly combining each image in any two first image sets. Train the neural network.
在一些实施例中,表征图像包含场景的能见度值大小的表征量可以是一维标量,例如一个具体数值,从而方便建立表征量和能见度值的映射关系。In some embodiments, the characterization quantity representing the visibility value of the scene included in the image may be a one-dimensional scalar, such as a specific value, so as to facilitate the establishment of a mapping relationship between the characterization quantity and the visibility value.
在一些实施例中,在构建表征量与能见度值之间的映射关系时,也可以先通过能见度仪或者其他方式确定一些图像的具体能见度值,然后基于这些图像的表征量和这些图像的能见度值构建映射关系。比如,可以获取第三图像集,其中,第三图像集中可以包括能见度值已知的多帧图像,然后可以对第三图像集中的多帧图像进行特征提取,确定这多帧图像的表征量,进而可以基于这多帧图像的表征量和这多帧图像的能见度值构建 映射关系。In some embodiments, when constructing the mapping relationship between characterization quantities and visibility values, the specific visibility values of some images can also be determined first through a visibility meter or other means, and then based on the characterization quantities of these images and the visibility values of these images Build a mapping relationship. For example, a third image set may be obtained, wherein the third image set may include multiple frames of images with known visibility values, and then feature extraction may be performed on the multiple frames of images in the third image set to determine the representation of the multiple frames of images, Furthermore, a mapping relationship may be constructed based on the representation quantities of the multiple frames of images and the visibility values of the multiple frames of images.
在一些实施例中,在利用第三图像集中的多帧图像构建映射关系时,为了得到的映射关系尽可能准确,第三图像集中的多帧图像的能见度值可以均匀分布在指定的能见度范围内,其中,指定的能见度范围可以基于待测图像的能见度值大体的分布范围确定,比如,假设待检测图像的能见度值大体分布在1000m以内,因而需要准确标定该能见度值范围内的能见度值和表征量的映射关系,所以指定的能见度范围为0-1000m,为了使标定的映射关系尽可能准确,第三图像集中的这多帧图像的能见度值可以尽可能均匀地分布在该范围内,以覆盖该范围内的各个能见度梯度。In some embodiments, when using multiple frames of images in the third image set to construct the mapping relationship, in order to obtain a mapping relationship as accurate as possible, the visibility values of the multiple frames of images in the third image set can be evenly distributed within a specified visibility range , where the specified visibility range can be determined based on the approximate distribution range of the visibility values of the image to be tested. For example, assuming that the visibility values of the image to be detected are generally distributed within 1000m, it is necessary to accurately calibrate the visibility values and representations within the visibility value range Therefore, the specified visibility range is 0-1000m. In order to make the calibrated mapping relationship as accurate as possible, the visibility values of the multi-frame images in the third image set can be distributed as evenly as possible within this range to cover Individual visibility gradients within the range.
当然,由于确定图像的能见度值需要借助专门的仪器,比较繁琐。为了可以无需通过专门的仪器也可以构建映射关系,在一些实施例中,在建立表征量与能见度值的映射关系时,可以获取至少一个第二图像集,每个第二图像集中包括多帧图像,每个第二图像集中的图像的能见度值范围相同,比如,均为0-50m,或者均为50-100m。针对每个第二图像集,可以对第二图像集中的每帧图像进行特征提取,得到第二图像集中每帧图像的表征量,比如,可以将每帧图像输入到训练好的神经网络中,利用神经网络输出该图像的表征量,从而可以得到该第二图像集中的各图像的表征量分布范围,然后可以根据各个第二图像集中各图像的能见度值范围和表征量分布范围,确定表征量与能见度值之间的映射关系。其中,每个第二图像集中可以包括大量样本图像,图像的数量越多,图像的能见度值越可以覆盖能见度值范围内的各个能见度值,则建立的映射关系越准确。Of course, since the determination of the visibility value of the image requires special instruments, it is relatively cumbersome. In order to construct the mapping relationship without using special instruments, in some embodiments, when establishing the mapping relationship between the characterization quantity and the visibility value, at least one second image set can be obtained, and each second image set includes multiple frames of images , the visibility value range of the images in each second image set is the same, for example, both are 0-50m, or all are 50-100m. For each second image set, feature extraction can be performed on each frame of the image in the second image set to obtain the representation of each frame of the image in the second image set, for example, each frame of image can be input into the trained neural network, Utilize the neural network to output the characterization quantity of the image, so that the distribution range of the characterization quantity of each image in the second image set can be obtained, and then the characterization quantity can be determined according to the visibility value range and the characterization quantity distribution range of each image in each second image set The mapping relationship with the visibility value. Wherein, each second image set may include a large number of sample images, and the more images there are, the more the visibility values of the images can cover each visibility value within the visibility value range, and the more accurate the established mapping relationship is.
举个例子,假设某个第二图像集中包括大量的图像,这些图像的能见度值位于0-50m,由于图像数量较多,因而这些图像基本可以覆盖0-50m之间的各个能见度值。然后可以通过神经网络输出这些图像的表征量,其中,表征量和能见度值可以是正相关或负相关,比如,能见度值越大,表征量也越大。进而,可以根据这些图像的表征量分布范围和能见度值范围确定映射关系。比如,表征量分布范围是A-B,假设表征量与能见度值正相关,那么表征量A对应的能见度值为0,表征量B对应的能见度值为50,进而可以建立映射关系。当然,以上只是列举的一个简单的例子,实际在构建映射关系时,可能会更加复杂。For example, assuming that a certain second image set includes a large number of images, the visibility values of these images are in the range of 0-50m. Since there are a large number of images, these images can basically cover each visibility value between 0-50m. Then the representations of these images can be output through the neural network, wherein the representations and visibility values can be positively or negatively correlated, for example, the greater the visibility, the greater the representation. Furthermore, the mapping relationship may be determined according to the distribution range of the characteristic quantities and the visibility value range of these images. For example, the distribution range of the token is A-B, assuming that the token is positively correlated with the visibility value, then the visibility value corresponding to token A is 0, and the visibility value corresponding to token B is 50, and then the mapping relationship can be established. Of course, the above is just a simple example, and it may be more complicated when actually constructing the mapping relationship.
在一些实施例中,可以有多个第二图像集,将这多个第二图像集按照能见度值范围大小顺序排序后,相邻两个第二图像集中各图像的能见度值范围连续。比如,以6个第二图像集为例,这6个第二图像集对应的能见度值范围分别为(0m,50m]、(50m,100m]、(100m,200m]、(200m,500m]、(500m,1000m]、(1000m,∞),相邻两个第二图像集对应 的能见度值范围是连续的,且通过目标能见度值分隔开。比如,能见度范围为(0m,50m]和(50m,100m]的两个第二图像集通过目标能见度值50m分隔开。为了可以准确构建映射关系,在基于每个第二图像集对应的能见度值范围和表征量分布范围,确定该映射关系时,可以先基于相邻两个第二图像集中各图像的能见度值范围和表征量分布范围,针对相邻两个第二图像集中的目标能见度值,确定该目标能见度值对应的表征量,然后基于目标能见度值的表征量确定映射关系。由于目标能见度值即为相邻两个能见度值范围的边界,而在确定映射关系时,主要是基于能见度值范围的边界和表征量分布范围的边界确定,因而准确确定边界的表征量是准确确定映射关系的关键。In some embodiments, there may be multiple second image sets, and after the multiple second image sets are sorted according to the size of the visibility value range, the visibility value ranges of the images in two adjacent second image sets are continuous. For example, taking six second image sets as an example, the ranges of visibility values corresponding to these six second image sets are (0m,50m], (50m,100m], (100m,200m], (200m,500m], (500m, 1000m], (1000m, ∞), the ranges of visibility values corresponding to two adjacent second image sets are continuous and separated by target visibility values. For example, the visibility ranges are (0m, 50m] and ( 50m, 100m], the two second image sets are separated by the target visibility value 50m. In order to accurately construct the mapping relationship, the mapping relationship is determined based on the visibility value range and characterization quantity distribution range corresponding to each second image set When , based on the visibility value range and the representation quantity distribution range of each image in the adjacent two second image sets, for the target visibility values in the two adjacent second image sets, determine the representation quantity corresponding to the target visibility value, and then Determine the mapping relationship based on the characterization of the target visibility value. Since the target visibility value is the boundary between two adjacent visibility value ranges, when determining the mapping relationship, it is mainly determined based on the boundary of the visibility value range and the boundary of the distribution range of the characterization quantity , so accurately determining the characterization of the boundary is the key to accurately determining the mapping relationship.
比如,以能见度值范围分别为(0m,50m]、(50m,100m]两个第二图像集为例,目标能见度值50m为两个能见度值范围的边界,根据这两个第二图像集均可以确定目标能见度值50m对应的表征量,比如,以表征量和能见度值正相关为例,目标能见度值50m对应的表征量为前一个第二图像集中的最大表征量,后一个第二图像集中的最小表征量,基于这两个第二图像集确定的目标能见度值50m的表征量可能不一致,因而可以基于两个第二图像集各自确定的目标能见度值50m的表征量得到该目标能见度值最终的表征量。For example, taking two second image sets whose visibility value ranges are (0m, 50m] and (50m, 100m] respectively as an example, the target visibility value 50m is the boundary of the two visibility value ranges. The characterization quantity corresponding to the target visibility value of 50m can be determined. For example, taking the positive correlation between the characterization quantity and the visibility value as an example, the characterization quantity corresponding to the target visibility value of 50m is the largest characterization quantity in the previous second image set, and the next second image set The minimum characterization quantity of the target visibility value 50m determined based on the two second image sets may be inconsistent, so the final target visibility value can be obtained based on the characterization quantities of the target visibility value 50m respectively determined by the two second image sets the amount of representation.
在一些实施例中,在基于相邻两个第二图像集对应的能见度值范围和表征量分布范围,确定目标能见度值的表征量时,可以基于相邻两个第二图像集的能见度值范围和表征量分布范围,确定该目标能见度值对应的初始表征量,进而不断调整该初始表征量得到调整后的表征量,基于调整后的表征量对该相邻两个第二图像集中的图像进行分类,直至相邻两个所述第二图像集的分类结果的准确度均达到最大值,然后将调整后的表征量作为该目标能见度值对应的表征量。In some embodiments, when determining the characterization quantity of the target visibility value based on the visibility value range and the distribution range of the characterization quantity corresponding to two adjacent second image sets, it may be based on the visibility value range of the two adjacent second image sets and the distribution range of the characterization quantity, determine the initial characterization quantity corresponding to the target visibility value, and then continuously adjust the initial characterization quantity to obtain the adjusted characterization quantity, based on the adjusted characterization quantity, the images in the two adjacent second image sets are Classify until the accuracy of the classification results of the two adjacent second image sets reaches the maximum value, and then use the adjusted characterization as the characterization corresponding to the target visibility value.
举个例子,以能见度值范围为(0m,50m]、(50m,100m]两个第二图像集为例,假设能见度值和表征量正相关,将前一个第二图像集中的图像输入到神经网络后,输出的表征量在0-20之间,因而,基于前一个第二图像集可以初步确定50m对应的表征值为20;将后一个第二图像集中的图像输入到神经网络后,输出的表征量在18-40之间,因而,基于后一个第二图像集可以初步确定50m对应的表征量为18,进而,可以取其中一个表征量(18或20)或者两者的平均值19作为目标能见度值50m的初始表征量,然后在一定范围内调整该初始表征量(比如,按一定步长增大或减小),每调整一次该初始表征量,则基于调整后的表征量对这两个图像集中的所有图像进行分类,以获得以该调整后的表征量为界的分类结果,并确定各分类结果的准确度。比如,假设调整后的表征量 为19,即50m对应的表征量为19,那么按照该表征量分类,前一个样本图像集中表征量位于19-20的图像就会错误分类,从而可以计算一个分类准确度,同样的,后一个样本图像集中表征量位于18-19的图像也会错误分类,从而也可以计算一个分类准确度。可以取两个样本图像集分类准确度最高时的表征量,作为该目标能见度值50m对应的表征量。对于其他的目标能见度值(比如,上述6个第二图像集中的100m、200m、500、1000m),也可以采用类似的方法。For example, take two second image sets whose visibility values range from (0m, 50m] and (50m, 100m] as an example, assuming that the visibility value and the representation are positively correlated, the images in the previous second image set are input to the neural network After the network, the output characterization value is between 0-20. Therefore, based on the previous second image set, it can be preliminarily determined that the characterization value corresponding to 50m is 20; after inputting the image in the latter second image set to the neural network, the output The characterization quantity is between 18-40, therefore, based on the latter second image set, it can be preliminarily determined that the characterization quantity corresponding to 50m is 18, and then, one of the characterization quantities (18 or 20) or the average value of the two can be taken as 19 As the initial characterization quantity of the target visibility value of 50m, and then adjust the initial characterization quantity within a certain range (for example, increase or decrease by a certain step size), each time the initial characterization quantity is adjusted, based on the adjusted characterization quantity, the All the images in these two image sets are classified to obtain classification results bounded by the adjusted characterization amount, and determine the accuracy of each classification result. For example, suppose the adjusted characterization amount is 19, that is, 50m corresponds to If the representation value is 19, then according to the classification according to the representation value, the image whose representation value is in the range of 19-20 in the previous sample image set will be misclassified, so that a classification accuracy can be calculated. Similarly, the representation value in the latter sample image set is in the range of 18 The image of -19 will also be misclassified, so a classification accuracy can also be calculated. The characterization quantity when the classification accuracy of the two sample image sets is the highest can be taken as the characterization quantity corresponding to the target visibility value of 50m. For other target visibility Values (for example, 100m, 200m, 500, 1000m in the above six second image sets), a similar method can also be used.
在一些实施例中,预训练的神经网络可以包括特征提取网络、第一网络分支和第二网络分支,在通过预先训练的神经网络对待检测图像进行特征提取,得到待检测图像的表征量时,可以先通过特征提取网络对待检测图像进行特征提取,将提取到的特征输入至第一网络分支或第二网络分支中的任一个,得到待检测图像的表征量,即在提取待检测图像的特征时,可以利用其中的一个网络分支,以输出待检测图像的表征量。在一些实施例中,也可以结合两个网络分支输出的待检测图像的表征量,得到最终的表征量。比如,可以通过神经网络的特征提取网络对待检测图像进行特征提取,将提取到的特征输入至第一网络分支中,得到第一表征量,将该提取到的特征输入至第二网络分支中,得到第二表征量,基于第一表征量和第二表征量得到待检测图像的表征量。比如,通过将第一表征量和第二表征量加权平均可以得到待检测图像的表征量,其中,权重可以相同,也可以根据实际需求设置得不同。In some embodiments, the pre-trained neural network may include a feature extraction network, a first network branch, and a second network branch. When the feature extraction of the image to be detected is performed through the pre-trained neural network to obtain the representation of the image to be detected, First, feature extraction can be performed on the image to be detected through the feature extraction network, and the extracted features can be input to any one of the first network branch or the second network branch to obtain the characterization quantity of the image to be detected, that is, when extracting the feature of the image to be detected When , one of the network branches can be used to output the characterization of the image to be detected. In some embodiments, the final representations may also be obtained by combining the representations of the images to be detected output by the two network branches. For example, the feature extraction network of the neural network can be used to perform feature extraction on the image to be detected, and the extracted features can be input to the first network branch to obtain the first representation, and the extracted features can be input to the second network branch. A second characterization quantity is obtained, and a characterization quantity of the image to be detected is obtained based on the first characterization quantity and the second characterization quantity. For example, the representation quantity of the image to be detected can be obtained by weighting the first representation quantity and the second representation quantity, wherein the weights can be the same, or can be set differently according to actual requirements.
在一些实施例中,待检测图像可以是道路区域的图像,待检测图像可以通过道路中设置的图像采集装置采集,在确定待检测图像中包含的场景的能见度值后,还可以基于该能见度值确定当前特定气候(比如,雾天气候、沙尘气候、雾霾气候等)的危害等级,并选取与危害等级对应的管控策略对道路中的交通进行管控。比如,可以预先设置多个用于评价雾天气候危害程度的等级,不同等级对应不同的能见度值范围,每个危害等级可以预先设置相应的管控策略,以对道路中的交通进行管控。比如,管控策略可以包括对道路中的车辆进行大雾天气预警,管控策略也可以包括提示道路中的车辆车速控制在某个速度以下,管控策略还可以包括封闭道路路口、禁止车辆通行等。In some embodiments, the image to be detected can be an image of a road area, and the image to be detected can be collected by an image acquisition device installed on the road. After determining the visibility value of the scene contained in the image to be detected, it can also be based on the visibility value. Determine the hazard level of the current specific climate (for example, foggy weather, sandy weather, haze climate, etc.), and select a control strategy corresponding to the hazard level to control the traffic on the road. For example, multiple levels for evaluating the degree of fog weather hazard can be preset. Different levels correspond to different visibility value ranges. Each hazard level can be preset with corresponding control strategies to control traffic on the road. For example, the management and control strategy may include early warning of foggy weather for vehicles on the road, the management and control strategy may also include prompting the speed of vehicles on the road to be controlled below a certain speed, and the management and control strategy may also include closing road intersections and prohibiting vehicles from passing.
在一些实施例中,待检测图像可以是道路区域的图像,待检测图像可以是道路中设置的图像采集装置在不同时刻采集的多帧图像,在确定这多帧图像对应的能见度值后,可以基于能见度值预测特定气候(比如,雾天气候、沙尘气候、雾霾气候等)的变化趋势。举个例子,可以每隔30min获取一帧道路区域的图像,并确定该图像对应的能见度值,得到一段时间内道路的能见度值的变化趋势,从而可以预测道路中的雾浓度是在逐 渐增大、还是减小,从而预测雾天气候的变化趋势。In some embodiments, the image to be detected may be an image of a road area, and the image to be detected may be a multi-frame image collected at different times by an image acquisition device set in the road. After determining the visibility values corresponding to the multi-frame images, you can Predict the change trend of a specific climate (for example, foggy weather, sandy weather, haze weather, etc.) based on the visibility value. For example, a frame of image of the road area can be obtained every 30 minutes, and the corresponding visibility value of the image can be determined to obtain the change trend of the road visibility value within a period of time, so that it can be predicted that the fog concentration in the road is gradually increasing , or decrease, so as to predict the change trend of foggy climate.
在一些实施例中,待检测图像可以是道路区域的图像,待检测图像可以是道路中设置的图像采集装置按照预设时间间隔采集的图像,比如,每隔一小时采集一帧或多帧图像,然后通过神经网络确定这一帧或多帧图像对应的能见度值,以判定当前是否发生了特定气候(比如,团雾气候、沙尘气候、雾霾气候等)现象。比如,针对每帧图像,可以判定该图像对应的能见度值是否超过预设阈值,如果每帧图像对应的能见度值都超过预设阈值,或者一定数量的图像的对应的能见度值超过预设阈值,则判定该道路区域内当前发生了特定气候现象。或者,可以确定这一帧或多帧图像的能见度值的平均值,如果平均值超过预设阈值,则确定该道路区域内当前发生了特定气候现象。通过统计目标时间段内发生特定气候的总次数,可以预测某个区域发生特定气候的频率,用于对该区域的气候规律进行研究。In some embodiments, the image to be detected may be an image of a road area, and the image to be detected may be an image collected by an image acquisition device installed on the road at preset time intervals, for example, one or more frames of images are collected every hour , and then determine the visibility value corresponding to this frame or multiple frames of images through the neural network to determine whether a specific climate (for example, cloudy weather, sandy weather, haze weather, etc.) phenomenon is currently occurring. For example, for each frame of image, it may be determined whether the visibility value corresponding to the image exceeds a preset threshold, if the visibility values corresponding to each frame of image exceed the preset threshold, or the corresponding visibility values of a certain number of images exceed the preset threshold, Then it is determined that a specific weather phenomenon is currently occurring in the road area. Alternatively, the average value of the visibility values of the frame or multiple frames of images may be determined, and if the average value exceeds a preset threshold, it is determined that a specific weather phenomenon is currently occurring in the road area. By counting the total number of occurrences of a specific climate within a target period of time, the frequency of occurrences of a specific climate in a certain area can be predicted, which can be used to study the climate laws of the area.
比如,可以每隔2小时采集一帧或多帧道路区域的图像,利用神经网络预测的这一帧或多帧道路区域图像对应的能见度值,如果这些图像的能见度值都超过预设阈值,则确定道路区域发生了团雾,通过统计一天时间内发生团雾的总次数,可以确定每天团雾发生的频率。For example, one or more frames of road area images can be collected every 2 hours, and the visibility value corresponding to this frame or multiple frames of road area images can be predicted by the neural network. If the visibility values of these images exceed the preset threshold, then It is determined that clusters of fog have occurred in the road area, and the frequency of daily clusters of fog can be determined by counting the total number of clusters of fog in a day.
为了进一步解释本公开实施例提供的检测能见度值的方法,以下结合一个具体的实施例加以解释。In order to further explain the method for detecting the visibility value provided by the embodiment of the present disclosure, it will be explained below in conjunction with a specific embodiment.
对于雾霾、沙尘、团雾等天气,通常需要检测道路区域的能见度,基于能见度对交通进行管理。通常是通过道路中设置的摄像头采集路面区域的图像,基于神经网络预测图像中包含的路面区域的能见度。但是,由于很难标定图像中包含的场景准确的能见度的具体数值,因而,难以获取到大量携带能见度具体数值标签的样本图像来训练神经网络。目前,只是通过携带能见度值范围标签的样本图像训练神经网络,神经网络输出的也只是图像的能见度值范围的分类结果,无法得到准确的能见度具体数值。本实施例提供了一种可以检测图像中能见度具体数值的方法,如图3所示为该方法的一种应用场景示意图,该方法可以用于检测道路区域的能见度具体数值,进而对道路交通进行管控。该方法包括神经网络训练阶段、神经网络输出的一维标量与能见度具体数值映射关系的标定、神经网络推理阶段。For smog, dust, fog and other weather, it is usually necessary to detect the visibility of the road area, and manage traffic based on the visibility. Usually, the images of the road area are collected by cameras set on the road, and the visibility of the road area contained in the image is predicted based on the neural network. However, since it is difficult to calibrate the specific value of the exact visibility of the scene contained in the image, it is difficult to obtain a large number of sample images carrying specific value labels of the visibility to train the neural network. At present, the neural network is only trained by sample images carrying visibility value range labels, and the output of the neural network is only the classification result of the visibility value range of the image, and the exact specific value of visibility cannot be obtained. This embodiment provides a method that can detect specific values of visibility in an image, as shown in Figure 3 is a schematic diagram of an application scenario of the method, the method can be used to detect specific values of visibility in a road area, and then carry out road traffic monitoring Control. The method includes a neural network training stage, a calibration of the mapping relationship between a one-dimensional scalar output by the neural network and a concrete numerical value of visibility, and a neural network reasoning stage.
(1)神经网络训练阶段(1) Neural network training stage
可以收集大量样本图像,针对每个样本图像无需标定其具体的能见度值,仅需确 定其所属的能见度值范围类别,比如,可以将样本图像分为6类,对应的6个能见度值范围分别是:(0m,50m]、(50m,100m]、(100m,200m]、(200m,500m]、(500m,1000m]、(1000m,∞)。由于仅需标定图像的能见度值范围,易于实现,因而可以获取大量的样本图像。A large number of sample images can be collected. For each sample image, there is no need to calibrate its specific visibility value. It is only necessary to determine the category of the visibility value range to which it belongs. For example, the sample images can be divided into 6 categories, and the corresponding 6 visibility value ranges are : (0m,50m], (50m,100m], (100m,200m], (200m,500m], (500m,1000m], (1000m,∞). Since only the visibility value range of the image needs to be calibrated, it is easy to implement, Thus, a large number of sample images can be acquired.
然后可以对上述6类样本图像集中的任意两个类别中的样本图像两两进行组合,得到大量的样本图像对,其中,每个样本图像对的能见度值相对大小关系已知。然后可以将样本图像对作为训练样本,样本图像对的能见度值相对大小关系作为标签,对初始的神经网络进行训练,得到训练后的神经网络。Then, the sample images in any two categories of the above six types of sample image sets can be combined in pairs to obtain a large number of sample image pairs, wherein the relative magnitude relationship of the visibility value of each sample image pair is known. Then, the sample image pair can be used as a training sample, and the relative size relationship of the visibility value of the sample image pair can be used as a label to train the initial neural network to obtain a trained neural network.
其中,神经网络的结构如图4所示,包括特征提取网络、第一网络分支、第二网络分支、以及输出层。其中,特征提取网路例如可以选取resnet18网络,其包括5个卷积层(例如图4中的conv1-conv5),在conv5之后接入2个网络分支,即第一网络分支和第二网络分支,每个网络分支含有3层全连接层。全连接层fc1输出维度为256,激活函数选取prelu;全连接层fc2输出维度为128,激活函数选取prelu;全连接层fc3输出维度为1,激活函数选取liner。Wherein, the structure of the neural network is shown in FIG. 4 , including a feature extraction network, a first network branch, a second network branch, and an output layer. Among them, the feature extraction network, for example, can choose the resnet18 network, which includes 5 convolutional layers (such as conv1-conv5 in Figure 4), and accesses 2 network branches after conv5, namely the first network branch and the second network branch , each network branch contains 3 layers of fully connected layers. The output dimension of the fully connected layer fc1 is 256, and the activation function is selected as prelu; the output dimension of the fully connected layer fc2 is 128, and the activation function is selected as prelu; the output dimension of the fully connected layer fc3 is 1, and the activation function is selected as liner.
当一个样本图像对(样本图像A和样本图像B)输入到神经网络中后,样本图像A可以经特征提取网络提取特征,然后将提取的特征进一步输入至第一网络分支进行特征提取,最后会输出一个一维标量RA,能够反映样本图像A包括的场景的能见度值的大小。样本图像B可以经特征提取网络提取特征,然后将提取的特征进一步输入至第二网络分支进行特征提取,最后会输出一个一维标量RB,能够反映样本图像B包括的场景的能见度值的大小。其中,神经网络输出的一维标量和能见度具体数值可以呈正相关,一维标量越大,能见度具体数值也越大。When a sample image pair (sample image A and sample image B) is input into the neural network, the sample image A can extract features through the feature extraction network, and then further input the extracted features to the first network branch for feature extraction, and finally A one-dimensional scalar RA is output, which can reflect the magnitude of the visibility value of the scene included in the sample image A. The sample image B can extract features through the feature extraction network, and then further input the extracted features to the second network branch for feature extraction, and finally output a one-dimensional scalar RB, which can reflect the visibility value of the scene included in the sample image B. Wherein, the one-dimensional scalar output by the neural network may be positively correlated with the specific value of the visibility, and the larger the one-dimensional scalar, the greater the specific value of the visibility.
然后可以将一维标量RA和RB输入到输出层中,输出层可以基于一维标量RA和RB确定样本图像A为能见度具体数值较大的图像的概率p,以及样本图像B为能见度具体数值较大的图像的概率1-p。其中,损失函数可以采用交叉熵损失,比如,假设样本图像A的能见度具体数值大于样本图像B,则样本图像A为能见度具体数值较大的图像的真实概率为y(y为1或者为预先设置的一个接近1的数值,比如0.8),样本图像B为能见度具体数值较大的图像的真实概率为1-y。然后可以计算预测概率p和真实概率y的交叉熵损失:Cross Entropy(p,y)=-[y*log(p)+(1-y)*log(1-p)]。可以基于交叉熵损失不断的调整神经网络的参数,直至损失函数收敛,得到训练好的神经网络。Then the one-dimensional scalars RA and RB can be input into the output layer, and the output layer can determine the probability p that the sample image A is an image with a higher specific value of visibility based on the one-dimensional scalars RA and RB, and that the sample image B is an image with a higher specific value of visibility. Larger images with probability 1-p. Among them, the loss function can use cross-entropy loss. For example, assuming that the specific value of the visibility of the sample image A is greater than that of the sample image B, the real probability that the sample image A is an image with a larger specific value of the visibility is y (y is 1 or is preset A value close to 1, such as 0.8), the real probability that the sample image B is an image with a larger specific value of visibility is 1-y. Then the cross-entropy loss of predicted probability p and true probability y can be calculated: Cross Entropy(p,y)=-[y*log(p)+(1-y)*log(1-p)]. The parameters of the neural network can be continuously adjusted based on the cross-entropy loss until the loss function converges to obtain a trained neural network.
(2)神经网络输出的一维标量与能见度具体数值映射关系的标定(2) Calibration of the mapping relationship between the one-dimensional scalar output of the neural network and the specific numerical value of the visibility
可以将上述6个分类中的各帧图像输入到神经网络中,利用神经网络输出表征各帧图像对应的能见度具体数值的一维标量,由于样本图像的数量很多,可以认为输出的一维标量基本可以反映各种能见度具体数值,例如,位于(0,50]的分类中有10000张样本图像,其有很大概率反映能见度值在0m到50m间的每个能见度值,然后基于各分类中标注的图像能见度值范围和一维标量范围构建映射关系。其中,为了可以准确构建映射关系,可以先确定各个能见度值范围的边界值对应的一维标量,比如,0m、50m、100m、200m、500m、1000m。以0m为例,由于一维标量和能见度具体数值呈正相关,因而,能见度值范围位于(0,50]的图像中一维标量的最小值则对应边界值0m。以50m为例,由于50m为两个分类的分界值,因而,能见度值范围位于(0,50]的图像集中一维标量的最大值对应50m,能见度值范围位于(50,100]的图像集中一维标量的最小值也对应50m,可能基于这两个分类的图像集确定的50m对应的一维标量不相等,比如能见度值范围位于(0,50]的图像集中50m对应的一维标量为10,能见度值范围位于(50,100]的图像集中50m对应的一维标量为15,为了可以准确确定边界值50m对应的一维标量,可以不断的调整边界值50m对应的一维标量(比如,分别取10-15之间的值),然后基于调整后的一维标量确定对这两个分类中的图像进行分类的精度。比如,边界值50m对应的一维标量取12时,基于该一维标量对能见度值范围位于(0,50]的所有图像进行分类,其准确度只有80%,例如,基于该一维标量12对能见度值范围位于(0,50]的8000张图像进行分类,将这8000张样本图像的标签去除后输入该神经网络,得到能见度值范围位于(0,50]的图像为6400张,由此可知,基于该一维标量12(对应边界值50m)的准确度为80%;类似地,基于该一维标量对能见度值范围位于(50,100]的所有图像进行分类,其准确度只有90%,然后不断调整边界值50m对应的一维标量取值,直至这两个分类的图像的分类准确度达到最大值,则将该一维标量确定为能见度值50m对应的一维标量。同样的,针对其他的能见度值范围边界值,也可以采用类似的方法,确定其对应的一维标量。在确定能见度值范围的边界值对应的一维标量后,则可以基于该一维标量构建映射关系。Each frame image in the above six classifications can be input into the neural network, and the neural network is used to output a one-dimensional scalar representing the specific value of the visibility corresponding to each frame image. Due to the large number of sample images, it can be considered that the output one-dimensional scalar is basically It can reflect various specific values of visibility. For example, there are 10,000 sample images in the category (0,50], which has a high probability of reflecting each visibility value between 0m and 50m, and then based on the labeling in each category The image visibility value range and the one-dimensional scalar range construct the mapping relationship. Among them, in order to accurately construct the mapping relationship, you can first determine the one-dimensional scalar corresponding to the boundary value of each visibility value range, for example, 0m, 50m, 100m, 200m, 500m , 1000m. Taking 0m as an example, since the one-dimensional scalar is positively correlated with the specific value of visibility, the minimum value of the one-dimensional scalar in the image whose visibility value range is (0,50] corresponds to the boundary value 0m. Taking 50m as an example, Since 50m is the boundary value of the two classifications, the maximum value of the one-dimensional scalar in the image set whose visibility value range is (0,50] corresponds to 50m, and the minimum value of the one-dimensional scalar value in the image set whose visibility value range is (50,100] is also Corresponding to 50m, the one-dimensional scalar corresponding to 50m determined based on the two classified image sets may not be equal. For example, the one-dimensional scalar corresponding to 50m in the image set whose visibility value range is in (0,50] is 10, and the visibility value range is in ( 50,100] in the image set, the one-dimensional scalar corresponding to 50m is 15. In order to accurately determine the one-dimensional scalar corresponding to the boundary value 50m, the one-dimensional scalar corresponding to the boundary value 50m can be continuously adjusted (for example, take the one-dimensional scalar between 10-15 value), and then determine the accuracy of classifying the images in these two classifications based on the adjusted one-dimensional scalar. For example, when the one-dimensional scalar corresponding to the boundary value 50m is 12, the visibility value range is located at ( 0,50], the accuracy is only 80%. For example, based on the one-dimensional scalar 12, 8000 images whose visibility value range is in (0,50] are classified, and the labels of these 8000 sample images Input the neural network after removal, and obtain 6400 images with visibility values in the range of (0,50], it can be seen that the accuracy based on the one-dimensional scalar 12 (corresponding to the boundary value 50m) is 80%; similarly, based on This one-dimensional scalar classifies all images whose visibility values range from (50,100], the accuracy is only 90%, and then continuously adjusts the one-dimensional scalar value corresponding to the boundary value 50m until the classification accuracy of the two classified images When the maximum value is reached, the one-dimensional scalar is determined as the one-dimensional scalar corresponding to the visibility value 50m. Similarly, for other boundary values of the visibility value range, a similar method can be used to determine its corresponding one-dimensional scalar. After determining After the one-dimensional scalar corresponding to the boundary value of the visibility value range, the mapping relationship can be constructed based on the one-dimensional scalar.
当然,在一些实施例中,也可以先通过能见度仪确定多帧图像的能见度具体数值,然后通过预先训练的神经网络确定这多帧图像的一维标量,基于这多帧图像的一维标量和能见度具体数值构建映射关系。其中,为了使构建的映射关系尽可能准确,这多帧图像的能见度具体数值应尽可能覆盖各个能见度值梯度。Certainly, in some embodiments, it is also possible to first determine the specific value of the visibility of multiple frames of images through the visibility meter, and then determine the one-dimensional scalar of the multiple frames of images through the pre-trained neural network, based on the one-dimensional scalar sum of the multiple frames of images The specific numerical value of the visibility constructs the mapping relationship. Wherein, in order to make the constructed mapping relationship as accurate as possible, the specific values of the visibility of the multiple frames of images should cover the gradients of each visibility value as much as possible.
(3)神经网络推理阶段(3) Neural network reasoning stage
当想要检测待检测图像的能见度具体数值时,可以获取待检测图像,将待检测图像输入至神经网络,通过神经网络输出待检测图像的一维标量(可以利用一个网络分支确定,也可以取两个网络分支输出结果的平均值)。然后再根据待检测图像的一维标量和预先标定的映射关系确定待检测图像的能见度具体数值。在确定待检测图像的能见度具体数值后,可以基于能见度具体数值对道路上的交通进行管控等。When you want to detect the specific value of the visibility of the image to be detected, you can obtain the image to be detected, input the image to be detected into the neural network, and output the one-dimensional scalar of the image to be detected through the neural network (it can be determined by using a network branch, or can be selected The average of the output results of the two network branches). Then, the specific value of the visibility of the image to be detected is determined according to the one-dimensional scalar of the image to be detected and the pre-calibrated mapping relationship. After determining the specific value of the visibility of the image to be detected, the traffic on the road can be controlled based on the specific value of the visibility.
通过本实施例提供的方法,可以在无需标定样本图像的能见度具体数值的情况下,对神经网络进行训练,并基于训练的神经网络确定待检测图像的能见度具体数值。相比于确定能见度值范围,可以得到更加精准的能见度结果。Through the method provided in this embodiment, the neural network can be trained without calibrating the specific value of the visibility of the sample image, and the specific value of the visibility of the image to be detected can be determined based on the trained neural network. Compared with determining the range of visibility values, more accurate visibility results can be obtained.
与上述方法相对应,本公开实施例还提供了一种能见度值检测装置,如图5所示,所述装置50包括:获取模块51,用于获取待检测图像;表征模块52,用于通过预先训练的神经网络对所述待检测图像进行特征提取,得到所述待检测图像的表征量;能见度值确定模块53,用于基于预先标定的表征量与能见度值的映射关系、以及所述待检测图像的表征量确定所述待检测图像对应的能见度值,其中,所述表征量能够反映图像中包含的场景的能见度值的大小。Corresponding to the above method, the embodiment of the present disclosure also provides a visibility value detection device. As shown in FIG. 5 , the device 50 includes: an acquisition module 51 for acquiring an image to be detected; The pre-trained neural network performs feature extraction on the image to be detected to obtain the characterization quantity of the image to be detected; the visibility value determination module 53 is used to determine the mapping relationship based on the pre-calibrated characterization quantity and visibility value, and the to-be-detected image. The characterization quantity of the detected image determines the visibility value corresponding to the image to be detected, wherein the characterization quantity can reflect the magnitude of the visibility value of the scene contained in the image.
其中,所述装置用于确定待检测图像的能见度值的具体实现过程可以参考上述方法实施例中的描述,在此不再赘述。Wherein, for the specific implementation process of the device for determining the visibility value of the image to be detected, reference may be made to the description in the above-mentioned method embodiments, and details are not repeated here.
此外,本公开实施例还一种电子设备,如图6所示,所述电子设备包括处理器61、存储器62、存储在所述存储器62可供所述处理器61执行的计算机指令,所述处理器执行所述计算机指令时,可实现前述任一实施例所述的方法。In addition, an embodiment of the present disclosure is also an electronic device. As shown in FIG. 6 , the electronic device includes a processor 61, a memory 62, and computer instructions stored in the memory 62 for execution by the processor 61. When the processor executes the computer instructions, the method described in any of the foregoing embodiments can be implemented.
本公开实施例还提供一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现前述任一实施例所述的方法。An embodiment of the present disclosure further provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the method described in any one of the foregoing embodiments is implemented.
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑 可读媒体(transitory media),如调制的数据信号和载波。Computer-readable media, including both permanent and non-permanent, removable and non-removable media, can be implemented by any method or technology for storage of information. Information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Flash memory or other memory technology, Compact Disc Read-Only Memory (CD-ROM), Digital Versatile Disc (DVD) or other optical storage, Magnetic tape cartridge, tape magnetic disk storage or other magnetic storage device or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media excludes transitory computer-readable media, such as modulated data signals and carrier waves.
通过以上的实施方式的描述可知,本领域的技术人员可以清楚地了解到本说明书实施例可借助软件加必需的通用硬件平台的方式来实现。基于这样的理解,本说明书实施例的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本说明书实施例各个实施例或者实施例的某些部分所述的方法。It can be known from the above description of the implementation manners that those skilled in the art can clearly understand that the embodiments of this specification can be implemented by means of software plus a necessary general hardware platform. Based on this understanding, the essence of the technical solutions of the embodiments of this specification or the part that contributes to the prior art can be embodied in the form of software products, and the computer software products can be stored in storage media, such as ROM/RAM, A magnetic disk, an optical disk, etc., include several instructions to enable a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments of this specification.
上述实施例阐明的系统、装置、模块或单元,可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为计算机,计算机的具体形式可以是个人计算机、膝上型计算机、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件收发设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任意几种设备的组合。The systems, devices, modules or units described in the above embodiments may be realized by computer chips or entities, or by products with certain functions. A typical implementing device is a computer, which may take the form of a personal computer, laptop computer, cellular phone, camera phone, smart phone, personal digital assistant, media player, navigation device, e-mail device, game control device, etc. desktops, tablets, wearables, or any combination of these.
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于装置实施例而言,由于其基本相似于方法实施例,所以描述得比较简单,相关之处参见方法实施例的部分说明即可。以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,在实施本说明书实施例方案时可以把各模块的功能在同一个或多个软件和/或硬件中实现。也可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。Each embodiment in this specification is described in a progressive manner, the same and similar parts of each embodiment can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, as for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and for relevant parts, please refer to part of the description of the method embodiment. The device embodiments described above are only illustrative, and the modules described as separate components may or may not be physically separated, and the functions of each module may be integrated in the same or multiple software and/or hardware implementations. Part or all of the modules can also be selected according to actual needs to achieve the purpose of the solution of this embodiment. It can be understood and implemented by those skilled in the art without creative effort.
以上所述仅是本说明书实施例的实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本说明书实施例原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本说明书实施例的保护范围。The above is only the implementation of the embodiment of this specification. It should be pointed out that for those of ordinary skill in the art, without departing from the principle of the embodiment of this specification, some improvements and modifications can also be made. These improvements and retouching should also be regarded as the scope of protection of the embodiments of this specification.

Claims (18)

  1. 一种能见度值检测方法,包括:A method for detecting a visibility value, comprising:
    获取待检测图像;Obtain the image to be detected;
    对所述待检测图像进行特征提取,得到所述待检测图像的表征量;performing feature extraction on the image to be detected to obtain the characterization quantity of the image to be detected;
    基于预先标定的表征量与能见度值的映射关系、以及所述待检测图像的表征量,确定所述待检测图像的能见度值;其中,所述表征量能够反映图像中包含的场景的能见度值的大小。Determine the visibility value of the image to be detected based on the pre-marked mapping relationship between the characterization quantity and the visibility value and the characterization quantity of the image to be detected; wherein the characterization quantity can reflect the visibility value of the scene contained in the image. size.
  2. 根据权利要求1所述的方法,其中,对所述待检测图像进行特征提取,包括:The method according to claim 1, wherein performing feature extraction on the image to be detected comprises:
    通过预先训练的神经网络对所述待检测图像进行特征提取;其中,所述神经网络基于以下方式训练得到:The image to be detected is subjected to feature extraction through a pre-trained neural network; wherein, the neural network is trained in the following manner:
    获取携带标签信息的样本图像对,所述标签信息用于指示所述样本图像对中的两帧图像分别对应的能见度值的相对大小关系;Acquiring a sample image pair carrying tag information, the tag information being used to indicate the relative size relationship of the visibility values corresponding to the two frame images in the sample image pair;
    将所述样本图像对中的两帧图像输入预设的初始神经网络;Inputting two frames of images in the sample image pair into a preset initial neural network;
    由所述初始神经网络输出所述样本图像对中的两帧图像能见度值相对大小关系的预测结果;Outputting the prediction result of the relative size relationship of the visibility values of the two frames of images in the sample image pair by the initial neural network;
    基于所述预测结果与所述标签信息的差异,调整所述初始神经网络的网络参数,得到所述神经网络。Based on the difference between the prediction result and the label information, adjust the network parameters of the initial neural network to obtain the neural network.
  3. 根据权利要求2所述的方法,其中,所述初始神经网络包括特征提取网络、表征量确定网络和输出层;The method according to claim 2, wherein the initial neural network comprises a feature extraction network, a representation quantity determination network and an output layer;
    由所述初始神经网络输出所述样本图像对中的两帧图像能见度值相对大小关系的预测结果,包括:Outputting the prediction results of the relative size relationship between the visibility values of the two frames of images in the sample image pair by the initial neural network, including:
    通过所述特征提取网络对所述样本图像对中的两帧图像进行特征提取;Carry out feature extraction to two frames of images in the sample image pair through the feature extraction network;
    通过所述表征量确定网络基于所述特征提取网络提取到的特征,确定所述样本图像对中的两帧图像各自的表征量;Determining the respective characterization quantities of the two frames of images in the sample image pair through the characterization quantity determination network based on the features extracted by the feature extraction network;
    通过所述输出层基于所述样本图像对中的两帧图像各自的表征量确定所述两帧图像的能见度值相对大小关系。The relative size relationship of the visibility values of the two frames of images is determined through the output layer based on the respective representation quantities of the two frames of images in the sample image pair.
  4. 根据权利要求3所述的方法,其中,所述表征量确定网络包括第一网络分支和第二网络分支;The method according to claim 3, wherein the characterization quantity determination network comprises a first network branch and a second network branch;
    通过所述表征量确定网络基于所述特征提取网络提取到的特征,确定所述样本图像对中的两帧图像各自的表征量,包括:Determining the respective characterizations of the two frames of images in the sample image pair through the feature determination network based on the features extracted by the feature extraction network, including:
    通过所述第一网络分支基于从所述样本图像对中的第一图像提取得到的特征, 确定所述第一图像的表征量;determining, by the first network branch, a characterization quantity of the first image based on features extracted from the first image in the pair of sample images;
    通过所述第二网络分支基于从所述样本图像对中的第二图像提取得到的特征,确定所述第二图像的表征量。A characterization quantity of the second image is determined by the second network branch based on features extracted from the second image in the pair of sample images.
  5. 根据权利要求2-4中任一项所述的方法,其中,所述样本图像对基于以下方式得到:The method according to any one of claims 2-4, wherein the sample image pair is obtained based on the following method:
    获取至少两个第一图像集,其中,针对所述至少两个第一图像集中的每个第一图像集,该第一图像集中各图像的能见度值范围相同,任意两个所述第一图像集中各图像的能见度值范围不重叠;Acquiring at least two first image sets, wherein, for each first image set in the at least two first image sets, the visibility value ranges of the images in the first image sets are the same, and any two of the first images The visibility value ranges of the images in the set do not overlap;
    从所述任意两个第一图像集中分别选取一帧图像,构成所述样本图像对。One frame of image is respectively selected from the arbitrary two first image sets to form the sample image pair.
  6. 根据权利要求1-5中任一项所述的方法,其中,所述表征量为一维标量,所述预先标定的表征量与能见度值的映射关系基于以下方式确定:The method according to any one of claims 1-5, wherein the characterization quantity is a one-dimensional scalar quantity, and the mapping relationship between the pre-calibrated characterization quantity and the visibility value is determined based on the following method:
    获取至少一个第二图像集,针对所述至少一个第二图像集中的每个第二图像集,该第二图像集中各图像的能见度值范围相同;Acquiring at least one second image set, for each second image set in the at least one second image set, the visibility value ranges of the images in the second image set are the same;
    对所述至少一个第二图像集中的各个第二图像集中各图像进行特征提取,得到所述各个第二图像集中各图像的表征量;performing feature extraction on each image in each second image set in the at least one second image set, to obtain the characterization quantity of each image in each second image set;
    基于所述各个第二图像集中各图像的表征量,得到所述各个第二图像集中各图像的表征量分布范围;Based on the characterization quantities of the images in the respective second image sets, obtain the distribution range of the characterization quantities of the images in the respective second image sets;
    基于所述各个第二图像集中各图像的能见度值范围和所述表征量分布范围,确定所述映射关系。The mapping relationship is determined based on the visibility value range of each image in each second image set and the distribution range of the characteristic quantity.
  7. 根据权利要求1-5中任一项所述的方法,其中,所述表征量为一维标量,所述预先标定的表征量与能见度值的映射关系基于以下方式确定:The method according to any one of claims 1-5, wherein the characterization quantity is a one-dimensional scalar quantity, and the mapping relationship between the pre-calibrated characterization quantity and the visibility value is determined based on the following method:
    获取第三图像集,所述第三图像集中各图像的能见度值已知;Acquiring a third image set, where the visibility value of each image in the third image set is known;
    对所述第三图像集中各图像进行特征提取,得到所述第三图像集中各图像的表征量;performing feature extraction on each image in the third image set, to obtain the characterization quantity of each image in the third image set;
    基于所述第三图像集中各图像的表征量和所述第三图像集中各图像的能见度值确定所述映射关系。The mapping relationship is determined based on the characterization of each image in the third image set and the visibility value of each image in the third image set.
  8. 根据权利要求6所述的方法,其中,基于所述各个第二图像集中各图像的能见度值范围和所述表征量分布范围,确定所述映射关系,包括:The method according to claim 6, wherein, based on the visibility value range of each image in each second image set and the distribution range of the characteristic quantity, determining the mapping relationship includes:
    所述至少一个第二图像集包括多个第二图像集;the at least one second image set includes a plurality of second image sets;
    基于所述多个第二图像集中能见度值范围相邻的两个第二图像集中各图像的能见度值范围和所述表征量分布范围,确定目标能见度值对应的表征量,其中,相邻两个所述第二图像集中各图像的能见度值范围连续,且通过所述目标能见度值分隔开;Based on the visibility value range of each image in two second image sets with adjacent visibility value ranges in the plurality of second image sets and the distribution range of the characteristic quantity, determine the characteristic quantity corresponding to the target visibility value, wherein the two adjacent The visibility value ranges of the images in the second image set are continuous and separated by the target visibility value;
    基于所述目标能见度值对应的表征量确定所述映射关系。The mapping relationship is determined based on the characterization quantity corresponding to the target visibility value.
  9. 根据权利要求8所述的方法,其中,基于所述多个第二图像集中能见度值范围相邻的两个第二图像集中各图像的能见度值范围和所述表征量分布范围,确定所述目标能见度值对应的表征量,包括:The method according to claim 8, wherein the target is determined based on the visibility value range of each image in two second image sets whose visibility value ranges are adjacent to the plurality of second image sets and the distribution range of the characteristic quantity. The characterization quantities corresponding to the visibility value include:
    基于所述多个第二图像集中能见度值范围相邻的两个第二图像集中各图像的能见度值范围和所述表征量分布范围,确定所述目标能见度值对应的初始表征量;Based on the visibility value range of each image in two second image sets whose visibility value ranges are adjacent to the plurality of second image sets and the distribution range of the characterization quantity, determine the initial characterization quantity corresponding to the target visibility value;
    调整所述初始表征量得到调整后的表征量,基于所述调整后的表征量分别对该两个第二图像集中的图像进行分类,直至该两个第二图像集的分类结果的准确度均达到最大值;adjusting the initial characterization quantity to obtain an adjusted characterization quantity, and classifying the images in the two second image sets based on the adjusted characterization quantity until the accuracy of the classification results of the two second image sets is equal to Reaches the maximum value;
    将所述调整后的表征量作为所述目标能见度值对应的表征量。The adjusted characterization quantity is used as the characterization quantity corresponding to the target visibility value.
  10. 根据权利要求1-9中任一项所述的方法,其中,所述待检测图像的表征量通过预先训练的神经网络对所述待检测图像进行特征提取得到,所述神经网络包括特征提取网络、第一网络分支和第二网络分支;The method according to any one of claims 1-9, wherein the characterization quantity of the image to be detected is obtained by performing feature extraction on the image to be detected by a pre-trained neural network, and the neural network includes a feature extraction network , the first network branch and the second network branch;
    通过预先训练的神经网络对所述待检测图像进行特征提取,得到所述待检测图像的表征量,包括:Feature extraction is performed on the image to be detected by a pre-trained neural network to obtain the characterization of the image to be detected, including:
    通过所述特征提取网络对所述待检测图像进行特征提取,得到所述待检测图像的特征,将所述提取到的特征输入至所述第一网络分支或所述第二网络分支中的任一个,得到所述待检测图像的表征量。Feature extraction is performed on the image to be detected through the feature extraction network to obtain features of the image to be detected, and the extracted features are input to any of the first network branch or the second network branch. One, obtaining the characterization quantity of the image to be detected.
  11. 根据权利要求1-9中任一项所述的方法,其中,所述待检测图像的表征量通过预先训练的神经网络对所述待检测图像进行特征提取得到,所述神经网络包括特征提取网络、第一网络分支和第二网络分支;The method according to any one of claims 1-9, wherein the characterization quantity of the image to be detected is obtained by performing feature extraction on the image to be detected by a pre-trained neural network, and the neural network includes a feature extraction network , the first network branch and the second network branch;
    通过预先训练的神经网络对所述待检测图像进行特征提取,得到所述待检测图像的表征量,包括:Feature extraction is performed on the image to be detected by a pre-trained neural network to obtain the characterization of the image to be detected, including:
    通过所述神经网络的特征提取网络对所述待检测图像进行特征提取,得到所述待检测图像的特征,将所述提取到的特征输入至所述第一网络分支中,得到第一表征量;Feature extraction is performed on the image to be detected through the feature extraction network of the neural network to obtain features of the image to be detected, and the extracted features are input into the first network branch to obtain a first characterization quantity ;
    将所述提取到的特征输入至所述第二网络分支中,得到第二表征量;inputting the extracted features into the second network branch to obtain a second representation;
    基于所述第一表征量和所述第二表征量得到所述待检测图像的表征量。A characteristic quantity of the image to be detected is obtained based on the first characteristic quantity and the second characteristic quantity.
  12. 根据权利要求1-11中任一项所述的方法,其中,所述待检测图像包括道路区域的图像,所述方法还包括:The method according to any one of claims 1-11, wherein the image to be detected comprises an image of a road area, and the method further comprises:
    基于所述待检测图像包含的道路区域的能见度值,确定特定气候的危害等级;Determine the hazard level of a specific climate based on the visibility value of the road area contained in the image to be detected;
    根据与所述危害等级对应的管控策略对所述道路区域内的交通进行管控。The traffic in the road area is controlled according to the control strategy corresponding to the hazard level.
  13. 根据权利要求1-12中任一项所述的方法,其中,所述待检测图像包括不同时刻采集的道路区域的多帧图像,所述方法包括:The method according to any one of claims 1-12, wherein the images to be detected include multiple frames of images of road areas collected at different times, the method comprising:
    基于所述多帧图像中所述道路区域的能见度值的变化趋势,预测所述道路区域内的特定气候的变化趋势。Based on the change trend of the visibility value of the road area in the multiple frames of images, the change trend of a specific climate in the road area is predicted.
  14. 根据权利要求1-12中任一项所述的方法,其中,所述待检测图像包括按照预设时间间隔采集的道路区域的图像,所述方法包括:The method according to any one of claims 1-12, wherein the images to be detected include images of road areas collected at preset time intervals, the method comprising:
    响应于所述图像对应的能见度值超过预设阈值,确定所述道路区域出现了特定气候;In response to the visibility value corresponding to the image exceeding a preset threshold, it is determined that a specific climate occurs in the road area;
    基于目标时间段内所述道路区域出现特定气候的总次数确定所述道路区域出现特定气候的频率。The frequency of occurrence of the specific weather in the road area is determined based on the total number of occurrences of the specific weather in the road area within the target time period.
  15. 一种能见度值检测装置,包括:A visibility value detection device, comprising:
    获取模块,用于获取待检测图像;An acquisition module, configured to acquire an image to be detected;
    表征模块,用于通过预先训练的神经网络对所述待检测图像进行特征提取,得到所述待检测图像的表征量;A characterization module, configured to perform feature extraction on the image to be detected through a pre-trained neural network to obtain a characterization of the image to be detected;
    能见度值确定模块,用于基于预先标定的表征量与能见度值的映射关系、以及所述待检测图像的表征量确定所述待检测图像对应的能见度值,其中,所述表征量能够反映图像中包含的场景的能见度值的大小。A visibility value determination module, configured to determine the visibility value corresponding to the image to be detected based on the pre-marked mapping relationship between the characterization quantity and the visibility value, and the characterization quantity of the image to be detected, wherein the characterization quantity can reflect the The size of the visibility value of the contained scene.
  16. 一种电子设备,所述设备包括处理器、存储器、存储于所述存储器可供所述处理器执行的计算机指令,所述处理器执行所述计算机指令时实现如权利要求1-14任一项所述的方法。An electronic device, the device comprising a processor, a memory, and computer instructions stored in the memory for execution by the processor, when the processor executes the computer instructions, any one of claims 1-14 is realized the method described.
  17. 一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机指令,所述计算机指令被执行时实现如权利要求1-14任一项所述的方法。A computer-readable storage medium, where computer instructions are stored on the computer-readable storage medium, and when the computer instructions are executed, the method according to any one of claims 1-14 is implemented.
  18. 一种计算机程序产品,该产品包括计算机程序,该计算机程序被处理器执行时实现权利要求1至14任一所述的方法。A computer program product, the product includes a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 14 is implemented.
PCT/CN2022/097325 2021-12-30 2022-06-07 Visibility value measurement method and apparatus, device, and storage medium WO2023123869A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111656430.5A CN114359211A (en) 2021-12-30 2021-12-30 Visibility value detection method, device, equipment and storage medium
CN202111656430.5 2021-12-30

Publications (1)

Publication Number Publication Date
WO2023123869A1 true WO2023123869A1 (en) 2023-07-06

Family

ID=81106025

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/097325 WO2023123869A1 (en) 2021-12-30 2022-06-07 Visibility value measurement method and apparatus, device, and storage medium

Country Status (2)

Country Link
CN (1) CN114359211A (en)
WO (1) WO2023123869A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114359211A (en) * 2021-12-30 2022-04-15 上海商汤智能科技有限公司 Visibility value detection method, device, equipment and storage medium
CN115116252A (en) * 2022-08-30 2022-09-27 四川九通智路科技有限公司 Method, device and system for guiding vehicle safely

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110910378A (en) * 2019-11-29 2020-03-24 南通大学 Bimodal image visibility detection method based on depth fusion network
CN111145120A (en) * 2019-12-26 2020-05-12 上海眼控科技股份有限公司 Visibility detection method and device, computer equipment and storage medium
CN111191629A (en) * 2020-01-07 2020-05-22 中国人民解放军国防科技大学 Multi-target-based image visibility detection method
CN113658275A (en) * 2021-08-23 2021-11-16 深圳市商汤科技有限公司 Visibility value detection method, device, equipment and storage medium
CN114359211A (en) * 2021-12-30 2022-04-15 上海商汤智能科技有限公司 Visibility value detection method, device, equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110910378A (en) * 2019-11-29 2020-03-24 南通大学 Bimodal image visibility detection method based on depth fusion network
CN111145120A (en) * 2019-12-26 2020-05-12 上海眼控科技股份有限公司 Visibility detection method and device, computer equipment and storage medium
CN111191629A (en) * 2020-01-07 2020-05-22 中国人民解放军国防科技大学 Multi-target-based image visibility detection method
CN113658275A (en) * 2021-08-23 2021-11-16 深圳市商汤科技有限公司 Visibility value detection method, device, equipment and storage medium
CN114359211A (en) * 2021-12-30 2022-04-15 上海商汤智能科技有限公司 Visibility value detection method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN114359211A (en) 2022-04-15

Similar Documents

Publication Publication Date Title
WO2023123869A1 (en) Visibility value measurement method and apparatus, device, and storage medium
CN106355188A (en) Image detection method and device
CN113688042B (en) Determination method and device of test scene, electronic equipment and readable storage medium
CN104112284B (en) The similarity detection method and equipment of a kind of picture
CN109657697A (en) Classified optimization method based on semi-supervised learning and fine granularity feature learning
CN114819186A (en) Method and device for constructing GBDT model, and prediction method and device
CN103020978A (en) SAR (synthetic aperture radar) image change detection method combining multi-threshold segmentation with fuzzy clustering
CN109961057A (en) A kind of vehicle location preparation method and device
KR102479804B1 (en) Method, device and program for measuring water level, volume, inflow and pollution level using an artificial intelligence model that reflects regional and seasonal characteristics
CN112819821B (en) Cell nucleus image detection method
CN113627229B (en) Target detection method, system, device and computer storage medium
CN111505705B (en) Microseism P wave first arrival pickup method and system based on capsule neural network
CN109283182A (en) A kind of detection method of battery welding point defect, apparatus and system
CN113049500B (en) Water quality detection model training and water quality detection method, electronic equipment and storage medium
CN112149503A (en) Target event detection method and device, electronic equipment and readable medium
CN113658174B (en) Microkernel histology image detection method based on deep learning and image processing algorithm
CN102360434B (en) Target classification method of vehicle and pedestrian in intelligent traffic monitoring
CN108345898A (en) A kind of novel line insulator Condition assessment of insulation method
CN115984543A (en) Target detection algorithm based on infrared and visible light images
CN115439718A (en) Industrial detection method, system and storage medium combining supervised learning and feature matching technology
CN110674887A (en) End-to-end road congestion detection algorithm based on video classification
CN116861262B (en) Perception model training method and device, electronic equipment and storage medium
CN108985350B (en) Method and device for recognizing blurred image based on gradient amplitude sparse characteristic information, computing equipment and storage medium
CN116665153A (en) Road scene segmentation method based on improved deep bv3+ network model
US20220260489A1 (en) System and method for analyzing molecular interactions on living cells using biosensor techniques

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22913158

Country of ref document: EP

Kind code of ref document: A1