Disclosure of Invention
The embodiment of the invention aims to provide a method for identifying the multidimensional out-of-sequence spatial distribution of a street environment, which can be applied to the accurate and rapid acquisition of street environment out-of-sequence information required by urban environment management, urban criminal prevention and control and urban resident safety improvement.
In order to achieve the above object, an embodiment of the present invention provides a method for identifying multidimensional out-of-order spatial distribution in a street environment, including the following steps:
acquiring sample points according to road network data of a research area, and acquiring street view image data of the research area according to the sample points;
extracting partial street view images from the street view image data through a sampling method, and classifying the partial street view images in 4 dimensions according to a 4-dimensional evaluation standard of street view environment disorder to obtain 4 groups of street view image samples with street view environment disorder in 4 dimensions;
establishing a 4-dimensional street view disorder two-classification model according to the 4-dimensional disorder street view image samples of the 4 groups of street environments;
taking the partial street view images as a training set and a test set of the two classification models, and optimizing the two classification models to obtain a trained recognition model;
inputting street view images in the street view image data into the identification model to generate an identification result;
and performing space visualization analysis and hot spot detection analysis on the research area according to the identification result to generate the space distribution of the disorder characteristics of the street environment of the research area.
Further, the obtaining of the sample point according to the road network data of the research area and the obtaining of the street view image data of the research area according to the sample point specifically include:
acquiring road network data of a research area, and generating a plurality of sampling points according to road network intervals of a preset distance through space analysis software;
and acquiring image data of four angles at the front, the back, the left and the right of the sampling points according to the positions of the sampling points to form street view image data.
Further, the 4-dimensional evaluation criteria of the streetscape environment comprise 4 dimensions of building disorder, weed disorder, garbage disorder and disorder.
Further, establishing a 4-dimensional street view disorder binary classification model according to the 4-dimensional disorder street view image samples of the 4 groups of street environments specifically comprises:
performing sample increment on the 4 groups of street view image samples with the street environment in the 4-dimensional disorder, and classifying the street view image samples after the increment to obtain the same number of samples with disorder and non-disorder;
and inputting the same number of out-of-sequence and non-out-of-sequence samples serving as training sets and test sets into a convolutional neural network, and constructing the 4-dimensional streetscape out-of-sequence two-classification model.
Further, the way of sample increment is performed on the street view image sample, including rotating, translating, transforming, scaling and flipping the sample.
Further, the partial street view image is used as a training set and a test set of the two-classification model, and the two-classification model is optimized to obtain a trained recognition model, which specifically comprises:
taking the partial street view images as a training set and a test set of the two classification models, and training the two classification models;
judging whether the two classification models reach preset accuracy, if so, taking the two classification models reaching the accuracy as trained recognition models;
otherwise, carrying out sample increment on part of street view images in the training set and the test set, and adding the images after increment into the training set and the test set of the two classification models until the two classification models reach the preset accuracy.
Further, the preset precision is 80%.
Further, the step of performing spatial visualization analysis and hotspot detection analysis on the research area according to the recognition result to generate spatial distribution of the disorder characteristics of the street environment of the research area specifically comprises:
extracting street images which contain the out-of-order features and meet preset regulations from the recognition results, and calculating the length and density features of streets corresponding to the street images containing the out-of-order features;
and detecting the cold and hot point distribution of the disorder characteristics of the research area by a spatial autocorrelation analysis method to generate the spatial distribution of the disorder characteristics of the street environment of the research area.
Further, the preset specification is that the number of times of the out-of-order features with a certain dimension is not less than 2, and the actual length of the street image is not less than 50 m.
Further, the calculating the length and density features of the streets corresponding to the street images containing the out-of-order features specifically includes:
and calculating the total lengths of the main road, the secondary road and the branch road including the out-of-sequence points of different types, the proportion of the total lengths of the roads in the corresponding grades and the proportion of the land areas in the corresponding regions.
The embodiment of the invention has the following beneficial effects:
compared with the prior art, the method for identifying the multidimensional out-of-sequence spatial distribution of the street environment, provided by the embodiment of the invention, comprises the steps of obtaining sample points according to road network data of a research area, and obtaining street view image data of the research area according to the sample points; extracting partial street view images from the street view image data through a sampling method, and classifying the partial street view images in 4 dimensions according to a 4-dimensional evaluation standard of street view environment disorder to obtain 4 groups of street view image samples with street view environment disorder in 4 dimensions; establishing a 4-dimensional street view disorder two-classification model according to the 4-dimensional disorder street view image samples of the 4 groups of street environments; taking the partial street view images as a training set and a test set of the two classification models, and optimizing the two classification models to obtain a trained recognition model; inputting street view images in the street view image data into the identification model to generate an identification result; and performing space visualization analysis and hotspot detection analysis on the research area according to the recognition result to generate the spatial distribution of the street environment disorder characteristics of the research area, and can be applied to the accurate and rapid acquisition of street environment disorder information required by urban environment management, urban crime prevention and control and urban resident safety improvement.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, fig. 1 is a schematic flowchart of a method for identifying multidimensional out-of-order spatial distribution in a street environment according to an embodiment of the present invention; the embodiment of the invention provides a method for identifying multidimensional out-of-order spatial distribution of a street environment, which comprises the steps of S1 to S6;
and S1, acquiring sample points according to the road network data of the research area, and acquiring street view image data of the research area according to the sample points.
In this embodiment, step S1 specifically includes: acquiring road network data of a research area, and generating a plurality of sampling points according to road network intervals of a preset distance through space analysis software; and acquiring image data of four angles at the front, the back, the left and the right of each sampling point according to the positions of the sampling points to form street view image data.
S2, extracting partial street view images from the street view image data through a sampling method, and classifying the partial street view images in 4 dimensions according to the 4-dimensional evaluation standard of the street view environment disorder to obtain 4 groups of street view image samples with the street view environment disorder in 4 dimensions.
As a preferred embodiment of the present invention, the 4-dimensional evaluation criteria for street view environment disorder include 4 dimensions, such as out-of-order buildings (is the building damaged here.
S3, establishing a 4-dimensional street view disorder binary classification model according to the 4-dimensional disorder street view image samples of the 4 groups of street environments.
In this embodiment, step S3 specifically includes: performing sample increment on the 4 groups of street view image samples with the street environment in the 4-dimensional disorder, and classifying the street view image samples after the increment to obtain the same number of samples with disorder and non-disorder; and inputting the same number of out-of-sequence and non-out-of-sequence samples serving as training sets and test sets into a convolutional neural network, and constructing the 4-dimensional streetscape out-of-sequence two-classification model.
The method for performing sample increment on the street view image sample comprises the steps of rotating, translating, transforming, scaling and turning the sample.
By carrying out sample increment on the street view image samples, the number of samples can be increased, so that the model can observe more contents of data, and the street view image has better generalization capability. And then fitting the model by using a batch generator, storing the model, and drawing a loss curve and a precision curve in the training process.
And S4, taking the partial street view image as a training set and a test set of the two-classification model, and optimizing the two-classification model to obtain a trained recognition model.
In this embodiment, step S4 specifically includes: taking the partial street view images as a training set and a test set of the two classification models, and training the two classification models; judging whether the two classification models reach preset accuracy, if so, taking the two classification models reaching the accuracy as trained recognition models; otherwise, carrying out sample increment on part of street view images in the training set and the test set, and adding the images after increment into the training set and the test set of the two classification models until the two classification models reach the preset accuracy.
It should be noted that the preset accuracy is 80%.
And S5, inputting the street view image in the street view image data into the recognition model to generate a recognition result.
And S6, performing space visualization analysis and hot spot detection analysis on the research area according to the recognition result, and generating the space distribution of the disorder characteristics of the street environment of the research area.
In this embodiment, step S6 specifically includes: extracting street images which contain the out-of-order features and meet preset regulations from the recognition results, and calculating the length and density features of streets corresponding to the street images containing the out-of-order features; and detecting the cold and hot point distribution of the disorder characteristics of the research area by a spatial autocorrelation analysis method to generate the spatial distribution of the disorder characteristics of the street environment of the research area.
It should be noted that the principle of extraction is to determine whether each street corresponding to an image contains an out-of-sequence feature of a certain dimension and extract the street on the basis of identifying whether a single street view image contains the out-of-sequence feature of the certain dimension and performing topology processing on the road, and the extraction is required to meet a preset rule that the number of times of the out-of-sequence feature of the certain dimension is not less than 2 and the actual length of the street image corresponding to the street of not less than 50 m.
Wherein, the calculating the length and density characteristics of the street corresponding to the street image containing the out-of-order characteristics specifically comprises: and calculating the total lengths of the main road, the secondary road and the branch road including the out-of-sequence points of different types, the proportion of the total lengths of the roads in the corresponding grades and the proportion of the land areas in the corresponding regions.
In order to better illustrate the method for identifying the multidimensional out-of-order spatial distribution of the street environment, the following is a specific embodiment performed by adopting the method provided by the invention:
firstly, a random point generating tool of geographic information space analysis software is utilized to set a sampling point to be generated every 50m so as to obtain all sampling point data of the area, and then street view images of all sampling points are obtained according to the positions of the sampling points, wherein each sampling point comprises street view images at four angles, namely front, back, left and right. Then, the evaluation criteria of street environment disorder are determined, and the criteria include 4 dimensions of buildings being worn (here is there a worn building.
According to the street environment disorder standard of the 4 dimensions, pictures representing the 4 dimensions disorder are obtained respectively, wherein the number of the pictures of each dimension disorder is 2000, and 8000 pictures are obtained, the images are distinguished by a plurality of trained personnel, and the consistency degree of scoring street view images by different scorers is evaluated by using a Cronbach index of α. for the images with the value of α being less than 0.6, scoring is carried out again until the value of α is more than or equal to 0.6, wherein 0 represents that the street view images are not out of sequence in a certain dimension (such as that buildings are not worn), and 1 represents that the street view images are out of sequence in a certain dimension (such as that the buildings are worn).
And acquiring 8000 street view environment images with 4 dimensions without disorder according to 8000 street environment images with 4 dimensions, and forming 4 groups of images for machine learning training. Each set of images contained training samples and test samples, where the number of images for both training samples and test samples was 2000. In each group of training samples and test samples, the number of out-of-sequence pictures and the number of non-out-of-sequence pictures are 1000 respectively.
As shown in fig. 3, based on the street view out-of-sequence classification samples with multiple dimensions, a convolutional neural network classification method is used to model a plurality of street view out-of-sequence two-class models respectively. For street view out-of-order modeling of any dimension, the modeling steps are as follows:
first, images are copied to a catalog of training, validation and testing, and 2000 training images, 2000 testing images are determined for modeling in either dimension. The number of samples in the two classes in each group is the same, which is a balanced two-class problem, and the classification precision can be used as a criterion for measuring success.
And (3) reconstructing a network: the convolutional neural network is composed of an input layer, a convolutional layer, a pooling layer, a full-link layer and an output layer. Accordingly, the convolutional neural network comprising 1 input layer, 4 convolutional layers, 4 pooling layers, 2 fully-connected layers and 1 output layer is constructed.
Then, data processing: firstly, reading images from a catalog, training a convolutional neural network by using a data enhancement generator, performing operations such as image rotation, translation, transformation, scaling and overturning, and increasing the number of samples, so that the model can observe more contents of the data, and has better generalization capability. And then fitting the model by using a batch generator, storing the model, and drawing a loss curve and a precision curve in the training process.
And finally, judging the model precision and optimizing the model: for the trained model, under the condition that the accuracy is greater than or equal to 80% of the accuracy, optimization is not needed; if the accuracy is less than 80%, methods such as adding samples, rotating or transforming images, optimizing a convolutional neural network model and the like are needed to optimize the model.
And respectively carrying out two-classification evaluation on each dimension out-of-sequence feature of the whole sample street view by using the trained model, and then carrying out space visualization analysis and hot spot detection analysis on the multi-dimension out-of-sequence feature of the street view environment. The specific steps are shown in fig. 4, and include:
extracting out-of-order feature distribution roads: on the basis of identifying whether a single street view image contains the out-of-sequence feature of a certain dimension and performing topology processing on roads, judging whether each road contains the out-of-sequence feature of the certain dimension and extracting. In order to ensure that the determined out-of-sequence feature point distribution road has high accuracy, through multiple comparison tests, a road which contains out-of-sequence features with a certain dimension for not less than 2 times and has a length of more than or equal to 50m is determined as a final out-of-sequence feature distribution road, as shown in fig. 5.
And calculating the length and density characteristics of the road containing the out-of-sequence characteristics, wherein the length and the density characteristics comprise the total length of the main road, the secondary road and the branch road containing different types of out-of-sequence points, the proportion of the total length of the road corresponding to the grade, and the proportion of the land area corresponding to the region.
And (3) detecting and analyzing a spatial hot spot: the distribution of hot and cold spots characteristic of the sample region disorder is detected by using a spatial autocorrelation analysis method.
Referring to fig. 6, fig. 6 is a schematic diagram of a cold and hot spot area provided by an embodiment of the present invention, specifically, a fishing net is established in a research area, the side length of each square grid of the fishing net is set to be 500m, global spatial autocorrelation analysis is performed by taking the sum of street lengths containing disorder features in each grid as a research field, and then local spatial autocorrelation analysis (hot spot analysis) is performed. And finally, counting and comparing area proportions of the hot spot and the cold spot. The global spatial autocorrelation can detect the spatial correlation global trend of the element attribute values of the spatial neighbors in the case area. The Global Moran's I index was generally used as an index for its measurement. The index is calculated as follows:
wherein I is the Moran's I index; n is the number of elements; y is
iAnd Y
jIs the attribute value of the i object and the j object; is a spatial weight matrix; s
2Is the variance of the attribute value object;
is an object propertyThe mean of the value objects. The value of I is in the range of [ -1 to 1 [)]Indicating that at a certain level of significance, the spatial cell attribute values have a tendency to cluster if the I value is significantly positive (+). If the I value is significantly negative (-), the spatial cell property values have a tendency to diverge. If the I value is 0, no spatial autocorrelation situation exists between the spatial cell attribute values.
The local spatial autocorrelation is used for measuring and calculating the consistency of attribute values of local objects in the case area and attribute values of neighboring objects. Generally expressed by LISA Index (Local Index of Spatial Autocorrelation). The calculation formula of the index is as follows:
wherein, I
iIs a local spatial autocorrelation LISA value; x
iIs the attribute value of object i, X
jIs the attribute value of object j;
is X
jThe mean value of (a); m is the number of study spots; w
ijIs the corresponding spatial weight matrix.
The embodiment of the invention provides a method for identifying the multidimensional out-of-sequence spatial distribution of a street environment, which is rapid and accurate and can greatly improve the identification precision of the out-of-sequence characteristics of the street environment. The street view image data are utilized, the evaluation standard of subjective and objective combination is adopted, the convolutional neural network model is utilized to establish the relation between the street view image characteristics and the built-in environment disorder of each dimension, the generated training model is utilized to evaluate the built-in environment disorder characteristics of each dimension of the street view image, and the efficiency of street environment disorder evaluation is effectively improved. According to the space visualization analysis and the hot spot detection analysis, the space aggregation characteristics of the roads containing the out-of-sequence characteristics can be identified in a large range, and the problems that the space distribution of the out-of-sequence characteristics of the road environment in one area cannot be identified in a large scale in the previous research and practice are solved.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
While the foregoing is directed to the preferred embodiment of the present invention, it will be understood by those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention.