CN109409014B - BP neural network model-based annual illuminable time calculation method - Google Patents

BP neural network model-based annual illuminable time calculation method Download PDF

Info

Publication number
CN109409014B
CN109409014B CN201811504805.4A CN201811504805A CN109409014B CN 109409014 B CN109409014 B CN 109409014B CN 201811504805 A CN201811504805 A CN 201811504805A CN 109409014 B CN109409014 B CN 109409014B
Authority
CN
China
Prior art keywords
matrix
neural network
network model
illuminable
annual
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811504805.4A
Other languages
Chinese (zh)
Other versions
CN109409014A (en
Inventor
陈楠
李换格
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fuzhou University
Original Assignee
Fuzhou University
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 Fuzhou University filed Critical Fuzhou University
Priority to CN201811504805.4A priority Critical patent/CN109409014B/en
Publication of CN109409014A publication Critical patent/CN109409014A/en
Application granted granted Critical
Publication of CN109409014B publication Critical patent/CN109409014B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/20Design optimisation, verification or simulation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/06Physical realisation, i.e. hardware implementation of neural networks, neurons or parts of neurons
    • G06N3/061Physical realisation, i.e. hardware implementation of neural networks, neurons or parts of neurons using biological neurons, e.g. biological neurons connected to an integrated circuit

Abstract

The invention belongs to the technical field of geographic information, and particularly relates to a method for calculating annual illuminable time based on a BP neural network model. The invention comprises the following steps: training a BP neural network model; constructing a digital elevation model image of the calculated area into an input matrix; transmitting the input matrix into a BP neural network model, and calculating to obtain an output matrix; and converting the output matrix into a numerical matrix of annual illuminable hours of the calculation region. The method can quickly and accurately calculate the illuminable time of any specified place, has simple and easily understood model and small calculated amount, greatly shortens the calculation time compared with the existing mathematical model calculation mode, has higher precision, can provide basic data for deeply knowing the spatial distribution characteristics of the illuminable time and calculating the direct solar radiation, the scattered radiation and the reflected radiation, provides reliable data basis for scientific research and actual production, and has important scientific research value and practical value.

Description

BP neural network model-based annual illuminable time calculation method
Technical Field
The invention belongs to the technical field of geographic information, and particularly relates to a method for calculating annual illuminable time based on a BP neural network model.
Background
Sunlight is an important factor for climate formation and is the most intuitive manifestation of solar radiation. The number of hours of sunshine refers to the sum of the time (in hours) that the direct solar irradiance reaches or exceeds 120W/m 2 somewhere. The sunshine duration can be divided into real-time sunshine duration and illuminable duration, and the real-time sunshine duration refers to the actual sunshine duration considering the atmospheric influence and the terrain shielding influence; the number of hours of illumination is divided into astronomical and geographical numbers of hours of illumination, the former referring to the maximum possible number of hours of illumination without regard to atmospheric effects and terrain masking effects, and the latter referring to the possible number of hours of illumination without regard to atmospheric effects and with regard to terrain masking effects. The present invention calculates the geographical illuminable hours (hereinafter, simply referred to as "illuminable hours"). The method is necessary basic data for calculating actual sunshine hours and further calculating actual incident solar radiation (direct radiation, total radiation and the like) on the earth surface, and is an important design parameter for developing solar energy resources, laying out agricultural production, developing tourism resources and ecological restoration construction.
The method for acquiring sunshine hours at present mainly comprises the following steps: the first is site measurement. However, the number of actual measurement stations is extremely limited, and most of the stations are located on a flat ground, so that the change rule of sunshine hours in an undulating terrain area (especially in a mountainous area with complex terrain) cannot be reflected. The second is based on the number of sunshine hours in undulating terrain. For example, the sunshine duration under actual terrain is calculated by using a Digital Elevation Model (DEM), so that the sunshine duration of vast non-measurement site areas can be obtained, and the spatial distribution rule of the sunshine duration under undulating terrain is effectively reflected.
Disclosure of Invention
One of the objects of the present invention is to overcome the above disadvantages, to quickly and accurately calculate the number of hours of illumination at a specific location, to calculate a simple and easy-to-understand calculation model with a small calculation amount, and to calculate the number of hours of illumination in a wide area including a measurement site and a non-measurement site.
In order to solve the technical problem, the invention provides a method for calculating the annual illuminable time based on a BP neural network model, which comprises the following steps:
step 1, training a BP neural network model;
step 2, constructing the DEM image of the calculation area into an input matrix;
step 3, transmitting the input matrix into a BP neural network model, and calculating to obtain an output matrix;
and 4, converting the output matrix into a numerical matrix of annual illuminable hours of the calculation region.
Further, the BP neural network model is a five-layer network and consists of an input layer, three hidden layers and an output layer, the number of neurons in the hidden layers is 15, and the number of neurons in the output layer is 1;
the activation function formula of the hidden layer is as follows:
Figure BDA0001899169980000021
wherein l is 1, 2, 3; a. thelAn output matrix of the l-th hidden layer of the BP neural network model, Al-1For the input matrix of the l layer hidden layer of the BP neural network model, when l is 1, A0P is an input matrix of the BP neural network model input layer; wlAnd BlA weight matrix and a threshold vector of the first layer hidden layer of the BP neural network model are obtained;
the activation function formula of the output layer is as follows:
Y=purelin(X)=X
wherein Y is the output matrix of the BP neural network model output layer, and X is the input matrix of the BP neural network model output layer.
Further, the step 1 "training the BP neural network model" includes the following steps:
step 11, selecting a training sample;
step 12, constructing the DEM image of the training sample into a sample input numerical matrix;
step 13, calculating annual illuminable time values of areas corresponding to the training samples, and constructing an expected output matrix;
step 14, initializing weight matrixes and threshold vectors of all layers of the BP neural network;
step 15, respectively carrying out normalization processing on the sample input numerical matrix and the expected output matrix, and simultaneously storing the maximum value and the minimum value before normalization of the expected output matrix;
step 16, setting a basic parameter threshold value of BP neural network training;
step 17, transmitting the normalized sample input numerical matrix into a BP neural network model, calculating an output matrix, and calculating a training target error according to the normalized expected output matrix, wherein the training target error calculation formula is as follows:
Figure BDA0001899169980000031
wherein n is the number of training samples; k is an integer from 1 to n, τkThe value of the k element of the expected output matrix after normalization; okIs the value of the kth element of the output matrix of the BP neural network model;
step 18, judging whether the training target error is smaller than a set threshold value, and if the training target error is smaller than the set threshold value, skipping to step 19 to continue execution; otherwise, after correcting the weight matrix and the threshold vector of each layer of the BP neural network model, skipping to the step 17 to continue execution;
and step 19, storing the weight matrix and the threshold vector of each layer of the BP neural network model, and completing the construction of the BP neural network model.
Further, the step 13 "calculating the annual illuminable time value of the region corresponding to the training sample, and constructing the expected output matrix" includes the following steps:
step 131, converting the DEM image of the area corresponding to the training sample into a numerical matrix;
step 132, calculating the actual annual illuminable time of the area corresponding to the training sample according to the mathematical model;
and step 133, constructing the actual annual illuminable time value of the region corresponding to the training sample into an expected output matrix.
Further, the step 2 of constructing the DEM image of the calculation area into the input matrix includes the following steps:
step 21, acquiring a DEM image of the calculation area, and preprocessing the DEM image;
step 22, extracting an input numerical matrix from the preprocessing result;
and 23, normalizing the input numerical matrix.
Further, the step 21 "pre-process the DEM image" specifically includes: and converting the DEM image into a numerical matrix, filling vacancy values in the numerical matrix, and numbering grids of the DEM image.
Further, the step 22 "extracting an input numerical matrix from the preprocessing result" specifically includes:
taking longitude and latitude coordinates of a central grid of the DEM image as longitude and latitude values of each grid, extracting elevation, gradient and slope factors of each grid in the DEM image and elevation, gradient and slope factors of neighborhood grids (left, right, upper and lower) in four directions of the grid as column vectors, and forming an Input matrix Inputm×nThe following were used:
Figure BDA0001899169980000041
wherein m is the number of rows of the input matrix, n is the number of columns of the input matrix, i is an integer between 1 and m, j is an integer between 1 and n, representing the number of the DEM image grid, x1jAnd x2jRespectively taking the longitude and the latitude of the central grid of the DEM image; x is the number of3j、x4j、x5jRespectively the elevation, the gradient and the slope of the jth grid; x is the number of6j、x7j、x8jRespectively the elevation, the gradient and the slope of the adjacent grid in the left direction of the jth grid; x is the number of9j、x10j、x11jRespectively the elevation, the gradient and the slope of the adjacent grid in the right direction of the jth grid; x is the number of12j、x13j、x14jRespectively the elevation, the gradient and the slope of the grid in the direction neighborhood above the jth grid; x is the number of15j、x16j、x17jRespectively the elevation, the slope and the slope of the adjacent grid in the direction below the jth grid.
Further, the step 4 "converting the output matrix into a numerical matrix of annual illuminable hours of the calculation region", includes the following steps:
step 41, performing inverse normalization processing on the output matrix to obtain a single-row output matrix;
and 42, recombining the single row output matrixes into a numerical value matrix of the annual illuminable hours of the calculation region.
The beneficial effects of the invention include:
1) the method can quickly and accurately calculate the illuminable time of any specified place, and has the advantages of simple and understandable model, small calculated amount, greatly shortened calculation time compared with the existing mathematical model calculation mode, and higher precision.
2) The BP neural network training method can be applied to DEMs with any spatial resolution, trains BP neural network models with corresponding spatial resolution, and is high in popularization.
3) The result, the illuminable time, calculated by the invention can provide basic data for deeply knowing the spatial distribution characteristics of the illuminable time, calculating the actual sunshine duration, direct solar radiation, scattered radiation and reflected radiation, and provide reliable data basis for scientific research and actual production, thereby having important scientific research value and practical value.
Drawings
FIG. 1 is a flow chart of the steps of the calculation method of annual illuminable number based on BP neural network model.
FIG. 2 is a flowchart of the steps of training a BP neural network model according to the present invention.
FIG. 3 is a flow chart of the steps of the present invention for calculating annual illuminable time values using a mathematical model.
Fig. 4 is a schematic diagram of a terrain mask according to an embodiment of the present invention.
FIG. 5 is a model structure of a BP neural network for calculating annual illuminable hours according to an embodiment of the present invention.
FIG. 6 is a flowchart illustrating the steps of constructing the DEM image of the computed area into an input matrix according to the present invention.
FIG. 7 is a flow chart of the steps of the present invention for converting the output matrix to a matrix of values of annual illuminable hours for a computing area.
Fig. 8 is a DEM image of a sample area with a spatial resolution of 30 meters according to an embodiment of the present invention.
Fig. 9 is a distribution diagram of the annual illuminable hours of the calculation region according to the embodiment of the present invention.
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.
Fig. 1 is a flow chart of the steps of the method for calculating the annual illuminable time based on the BP neural network model, which comprises the following steps:
step 1, training a BP neural network model; fig. 2 is a flowchart of the steps of training the BP neural network model according to the present invention, which includes the following steps:
step 11, selecting a training sample;
in the embodiment of the invention, the land surface of the continental China can be completely covered by 1120 Digital Elevation Model (DEM) images, and the DEM image data is derived from a computer network information center geospatial data cloud platform (http:// www.gscloud.cn) of the Chinese academy of sciences. The 1120 DEM images with the spatial resolution of 30m are downloaded, a plurality of DEM images are selected from the 1120 DEM images to serve as training sample areas, one DEM image corresponds to one sample area, and the selected sample area images are required to be uniformly scattered on the land surface of continental China.
The longitude and latitude interval of each downloaded DEM image is 1 degree, the image format is a TIFF format, the pixel of each DEM image is 3601 multiplied by 3601, each pixel in one DEM image is called a grid according to the professional expression habit of a geographic information system, and the numerical value in the grid represents the average elevation value of the position corresponding to the grid. Then, 12967201(3601 × 3601) grids are total for a 30 m-resolution DEM image, and the grids of a single DEM image are numbered sequentially from top to bottom and then from left to right, for example: the grid number of row 1, column 1 is 1, the grid number of row 2, column 1 is 2, the grid number of row 3, column 1 is 3, …, and the grid number of column 3601, row 3601 is 12967201.
Take 250 DEM images as training sample areas and randomly extract 40 grids from each sample area as an example. Numbering the selected sample areas according to the sequence of the directions from west to east and from north to south, wherein the numbering is from 1 to 250; and the number of the extracted grid in each sample area is stored at the same time, 10000 grids can be obtained, and the 10000 grids are called as sampling grids.
Step 12, constructing the DEM image of the training sample into a sample input numerical matrix;
and converting the selected training samples (250 DEM images) into a numerical matrix, and filling the grids with the vacancy values by using a proximity method, namely filling the elevation values of the nearest grids.
Constructing a matrix l corresponding to the DEM image with the number of 11
Figure BDA0001899169980000071
In the formula I1A matrix of 17 rows and 40 columns; l1Subscript of (a) indicates the number of the DEM image; d 1, 2, 3.., 40; matrix l1Element x of the d-th column1d,x2d,...,x17,dSequentially obtaining a longitude value, a latitude value and an elevation value of the d-th sampling grid, elevation values and slope values of four-direction neighborhood grids, slope values and slope values of the four-direction neighborhood grids;
by analogy, constructing a matrix l of sampling grids in all 250 DEM images1,l2,...,l250Combining the two modes in the following mode to obtain an input matrix P of the BP neural network model,
P=[l1,l2,...,l250]
wherein, P is a matrix with 17 rows and 10000 columns;
step 13, calculating annual illuminable time values of areas corresponding to the training samples, and constructing an expected output matrix; FIG. 3 is a flow chart of the steps for calculating annual illuminable time value using a mathematical model, according to an embodiment of the present invention, including the steps of:
step 131, constructing DEM images of areas corresponding to the training samples into an input numerical matrix;
and converting the selected 250 DEM images into a numerical matrix, and filling the grids with the vacancy values in the numerical matrix by using a proximity method, namely filling the elevation values of the nearest grids. And calculating the gradient and slope value of each DEM grid to obtain the latitude of the area.
Step 132, calculating the actual annual illuminable time of the area corresponding to the training sample according to the mathematical model;
in this embodiment, the step of calculating the annual illuminable number by using the mathematical model includes:
1) calculating the declination of the sun according to the following calculation formula:
δ=0.006894-0.399512cosθ-0.072075sinθ-0.006799cos2θ+0.00089sin2θ
where θ is called the sun angle, θ is 2 π λ/365.2422. I.e. λ N-1, N is the day, i.e. the chronological order of the day. The product day of 1 month and 1 day is 1, the product day of 1 month and 2 days is 2, the product day of 12 months and 31 days is 365 or 366 (365 for the next year and 366 for the leap year).
2) Calculating the sunrise and the time angle at the end of the sun by the following calculation formula:
Figure BDA0001899169980000084
wherein, ω issAt the time of the end of the day, omegarAt the sunrise angle, omegarThe hour angle is 0 in the positive south direction, positive clockwise and negative anticlockwise. Psi is the latitude.
3) Confirming the discrete number rho of the time angles from sunrise to sunset, and determining the interval delta omega of the time angles, namely the corresponding time length delta t, wherein the calculation formula is as follows:
Figure BDA0001899169980000081
Δt=Δω/15
when the discrete number is larger, the calculation result is finer, the accuracy is higher, but the calculation time is longer. Generally, when the time step is 20 minutes, that is, when the discrete number ρ is 36, the relative error is small, and the accuracy requirement is completely satisfied.
4) Calculating each time angle omegatCorresponding solar altitude htAnd sun azimuth angle ΛtThe calculation formula is as follows:
ωt=ωr+I×Δω
Figure BDA0001899169980000082
Figure BDA0001899169980000083
wherein I ═ 1, 2, 3.., 36.
5) Calculate ωtTopographic shading factor d of time of dayt
In the embodiment of the present invention, fig. 4 is a schematic diagram of a terrain shading in the embodiment of the present invention. In areas with large topographic relief, sunlight is shielded not only by the mountain body, but also by surrounding mountain bodies, such as point C in the figure, namely by point D, and no sunlight exists.
The calculation of the terrain shielding adopts a ray tracing algorithm to search all grid points on an incident path, if the altitude eta between the elevation D of a certain grid point and the elevation C of a calculation grid point is larger than the solar altitude gamma on the incident path, the path is a shielded path, and D is recordedt0; otherwise d t1. In the experiment, d is calculated by adopting a calculation command HILLSHADE of illumination simulation provided by ARCGIS softwaretCalculating dtThe time is needed to have the solar altitude and solar azimuth at the corresponding time (hour angle).
6) Judgment of omegatTo omegat+1Shadowing during this differential period
Respectively calculating d at different momentstValue, judging whether the illumination is available in each differential time interval, and the terrain shielding coefficient gtThe value of (A) is determined according to the following rule:
Figure BDA0001899169980000091
the above formula is represented by (omega)t-1,ωt) During the period, the sunshine conditions of the research point are completely dependent on the sunshine conditions of two endpoints at the moment. Namely, if the two end points can illuminate (shield) at any time, the whole section can illuminate (shield); if one endpoint is illuminated at a time and the other endpoint is masked at a time (ω)t-1,ωt) Half of the time in the time interval can be irradiated and half of the time is shielded.
7) Calculating the number of illuminable hours
The daily accessible hours for each grid are:
Figure BDA0001899169980000092
the annual hours per grid are:
Figure BDA0001899169980000101
where Td is the number of hours per day per grid; ρ is the discrete number of time angles from sunrise to sunset; ts is the number of illuminable hours per grid year in hours; n is the product date, i.e. the sequence number of the date in the year.
Step 133, construct the actual annual illuminable value of the sample area into the expected output matrix.
In the embodiment of the invention, the actual annual illuminable hours calculated by the mathematical model are used as expected output values of BP neural network model training, the calculated annual illuminable hours of various regions are a numerical matrix of 3601 × 3601, and each element corresponds to the annual illuminable hours value of one grid. Meanwhile, each element is numbered, and the numbering mode is consistent with that of the DEM image grids of the training sample area.
Constructing an annual illuminable time matrix t of all sampling grids in the DEM image with the number of 11
t1=[y1,y2,...,y40]
In the formula, t1The matrix is a matrix with 1 row and 40 columns, and subscripts indicate the number of the DEM image; y is1,y2,...,y40Respectively the annual illuminable time values of all the sampling grids;
by analogy, constructing an annual illuminable time matrix t of all sampling grids of the whole 250 DEM images1,t2,...,t250Combining the two modes in the following mode to obtain an output matrix T of the BP neural network model,
T=[t1,t2,...,t250]
in the formula, T is a matrix with 1 row and 10000 columns;
the maximum and minimum values of all elements before normalization of the expected output matrix are stored and recorded as ymaxAnd ymin
Step 14, initializing weight matrixes and threshold vectors of all layers of the BP neural network;
in a preferred embodiment, the initialization of the weight matrix and the threshold vector of each layer of the BP neural network can be implemented with the aid of a computer programming language, such as: rands function of MATLAB software.
Step 15, respectively carrying out normalization processing on the sample input numerical matrix and the expected output matrix, and simultaneously storing the maximum value and the minimum value before normalization of the expected output matrix; the normalization formula is:
Figure BDA0001899169980000111
in the formula, i is 1, 2, 3, …, 17; j ═ 1, 2, 3, …, 10000; x is the number ofi,jIs the value of the element in the ith row and the jth column of the matrix Input;
Figure BDA0001899169980000112
is the maximum value among all elements in the ith row of the matrix Input,
Figure BDA0001899169980000113
is all in the ith row of the matrix InputMinimum value of elements, Pi,jIs the value of the ith row and jth column elements of the normalized matrix P, and the value range is [ -1, 1]. Meanwhile, the maximum value and the minimum value before normalization of the expected output matrix are stored and recorded as ymaxAnd yminAnd preparing for the inverse normalization of the output matrix of the BP neural network model.
In a preferred embodiment, the normalization process can be implemented with the aid of a computer programming language, for example, by using the mapminmax function of MATLAB software, and the calling format of the function is as follows (taking the normalization of the desired output matrix as an example):
[Tt,Tn]=mapminmax(T,tmin,tmax)
in the formula, T is the expected output matrix, Tt is the normalized expected output matrix, Tn is a parameter obtained when a mapminmax function is called, and the minimum value T of all elements of the normalized expected output matrix is mainly containedminAnd maximum value tmaxAnd the maximum value t of all elements of the normalized expected output matrix TtmaxAnd a minimum value tmin(tminDefaults to-1, tmaxDefault to 1). Meanwhile, parameters Tn obtained by normalization of the expected output matrix are stored, and preparation is made for inverse normalization of the output matrix of the BP neural network model.
Step 16, setting a basic parameter threshold value of BP neural network training;
in the invention, the basic parameters of the BP neural network training comprise maximum training times, minimum error of a training target, learning rate and maximum failure times. For example, in a specific embodiment, the network basic parameters may be set: the maximum training frequency is 10000; training target minimum error is set to 100; the learning rate was set to 0.01; the maximum number of failures is set to 20.
And step 17, transmitting the normalized sample input numerical matrix into a BP neural network model, calculating an output matrix, and calculating a training target error according to the normalized expected output matrix.
Firstly, the normalized sample input numerical matrix is transmitted into a BP neural network model, and an output matrix is calculated. In the technical scheme of the invention, the BP neural network model is a five-layer network and consists of an input layer, three hidden layers and an output layer, the number of neurons in the hidden layers is 15, the number of neurons in the output layer is 1, and the BP neural network model structure is used for calculating the annual illuminable time as shown in figure 5. In fig. 5, P is the normalized input matrix; r is the number of rows of P, namely the number of input variables, and in the technical scheme of the invention, r is 17; q is the number of columns of P, which is different according to the number of selected samples, s1, s2 and s3 are the number of neurons in a hidden layer, and s1, s2 and s3 are all 15 in the model; s4 is the number of neurons in the output layer, s4 is 1 in this model; h1, h2, h3 are integers between 1 and 15, and h4 is 1.
F1,F2,F3For the hidden layer activation function, the hidden layer activation function formula is:
Figure BDA0001899169980000121
wherein l is 1, 2, 3; a. thelAn output matrix of the l-th hidden layer of the BP neural network model, Al-1For the input matrix of the l layer hidden layer of the BP neural network model, when l is 1, A0P is the input matrix of the input layer, WlAnd BlA weight matrix and a threshold vector of the first layer hidden layer of the BP neural network model are obtained;
F4for the activation function of the output layer, the activation function formula of the output layer is:
Y=purelin(X)=X
wherein Y is the output matrix of the BP neural network model output layer, and X is the input matrix of the BP neural network model output layer.
In the BP neural network model, the input matrix of the output layer is A3The output matrix of the output layer is O, O ═ A3
Secondly, substituting the numerical value of the output matrix and the numerical value of the expectation matrix after normalization into a formula for calculation to obtain a training target error, wherein the training target error calculation formula is as follows:
Figure BDA0001899169980000122
wherein n is the number of training samples; k is an integer from 1 to n, τkThe value of the k element of the expected output matrix after normalization; okIs the value of the kth element of the output matrix of the BP neural network model;
step 18, determining whether the training target error is smaller than a set threshold, in this embodiment, setting a minimum training target error to be 100, and if E <100, skipping to step 19 to continue execution; otherwise, after correcting the weight matrix and the threshold vector of each layer of the BP neural network model, skipping to the step 17 to continue execution;
and step 19, storing the weight matrix and the threshold vector of each layer of the BP neural network model, and completing the construction of the BP neural network model. After training is completed, the weight matrix and the threshold vector of each layer are obtained, so that the follow-up illuminable time calculation can be ensured to obtain a more accurate result. In addition, it should be noted that the training step of the BP neural network model is not necessarily repeated when the annual illuminable time value is calculated every time, and after a more accurate model is obtained by training, the subsequent calculation can be directly input. If the model precision is not enough, the sample data can be collected again to continue training to obtain a better model.
Step 2, constructing the DEM image of the calculation area into an input matrix; fig. 6 is a flowchart of the step of constructing the DEM image of the calculation area into the input matrix according to the present invention, which includes the following steps:
step 21, acquiring a DEM image of the calculation area, and preprocessing the DEM image;
in the embodiment of the invention, the image data of the Digital Elevation Model (DEM) is from a geospatial data cloud platform (http:// www.gscloud.cn) of a computer network information center of Chinese academy of sciences. The method includes the steps that DEM images with 30m spatial resolution contained in an area to be calculated are downloaded, the longitude and latitude intervals of each downloaded DEM image are both 1 degrees, the image format is a TIFF format, the pixel of each DEM image is 3601 multiplied by 3601, each pixel in one DEM image is called a grid according to the professional expression habit of a geographic information system, and 12967201(3601 multiplied by 3601) grids are shared in the 30m DEM image. The grids of the single DEM image are numbered sequentially from top to bottom and then from left to right, for example: the number of the grid in row 1 and column 1 is 1, the number of the grid in row 2 and column 1 is 2, the number of the grid in row 3 and column 1 is 3, …, and the number of the grid in row 3601 and column 3601 is 12967201, thereby forming a matrix. The matrix value is a pixel value corresponding to each grid number of the DEM image, namely an elevation value of the position of the pixel of the DEM image. And filling the grids with the vacancy values of the numerical matrix by using a proximity method, namely filling the elevation values of the nearest grids.
In addition, the longitude and latitude of each grid of the DEM image are needed in calculation of astronomical radiation, and as the interval between the longitude and the latitude of each DEM image is only 1 degree, the longitude and latitude coordinates of each grid are the longitude and latitude coordinates of the central grid of the DEM image for convenient calculation.
In a preferred embodiment, the numerical matrix can be constructed with the aid of a computer programming language, comprising: python, C + +, MATLAB scripts, etc.
Step 22, extracting an input numerical matrix from the preprocessing result;
taking longitude and latitude coordinates of a central grid of the DEM image as longitude and latitude values of each grid, extracting elevation, gradient and slope factors of each grid in the DEM image and elevation, gradient and slope factors of four-direction neighborhood grids (left, right, upper and lower) of the grid as column vectors, and forming an Input matrix Inputm×nThe following were used:
Figure BDA0001899169980000141
wherein m is the number of rows of the input matrix, n is the number of columns of the input matrix, i is an integer between 1 and m, j is an integer between 1 and n, representing the number of the DEM image grid, x1jAnd x2jAre respectively the jth gridLongitude and latitude of the grid, and the longitude and latitude of the central grid of the DEM image are taken; x is the number of3j、x4j、x5jRespectively the elevation, the gradient and the slope of the jth grid; x is the number of6j、x7j、x8jRespectively the elevation, the gradient and the slope of the adjacent grid in the left direction of the jth grid; x is the number of9j、x10j、x11jRespectively the elevation, the gradient and the slope of the adjacent grid in the right direction of the jth grid; x is the number of12j、x13j、x14jRespectively the elevation, the gradient and the slope of the grid in the direction neighborhood above the jth grid; x is the number of15j、x16j、x17jRespectively the elevation, the slope and the slope of the adjacent grid in the direction below the jth grid.
And 23, normalizing the input numerical matrix.
The normalized input matrix is obtained by substituting the normalization formula, and the normalization process is as described in step 15 above.
Step 3, transmitting the input matrix into a BP neural network model, and calculating to obtain an output matrix; according to the BP neural network structure, the trained weight matrix and threshold vector of each layer, an output matrix can be obtained quickly.
And 4, converting the output matrix into a numerical matrix of annual illuminable hours of the calculation region.
Fig. 7 is a flow chart of the step of converting the output matrix into a numerical matrix of annual illuminable hours for a calculation region, which includes the following steps:
step 41, performing inverse normalization processing on the output matrix to obtain a single-row output matrix;
in the calculation scheme of the invention, the inverse normalization formula is as follows:
Figure BDA0001899169980000151
j is 1, 2, 3, …, 12967201; outputjIs the denormalized value; o isjIs the output value of the BP neural network model; y ismaxAnd yminThe maximum value and the minimum value of all elements before the normalization of the expected output matrix are obtained in the training process of the BP neural network.
In a preferred embodiment, the denormalization procedure can be implemented with the aid of a computer programming language, such as the mapminmax function of MATLAB software, and the call format of the function is as follows:
Output=mapminmax(‘reverse’,O,Tn),
in the formula, Output is a matrix after inverse normalization; o is a matrix before normalization; tn is a parameter obtained when the expected output matrix is normalized;
and 42, recombining the single row output matrixes into a numerical value matrix of the annual illuminable hours of the calculation region.
Output the single-row matrix1×12967201Recombining into Output3601×3601Of the matrix of (a). The combination rule is as follows: the 1 st to 3601 st elements as the first column, the 3602 nd to 7202 th elements as the second column, … th and the 12963421 nd to 12967021 th elements as the 3601 st column), so that the annual illuminable hours number value matrix of the region can be obtained.
It should be noted that, in the "calculation region" in the present invention, the number of times of illumination of the sample region corresponding to the entire DEM image is calculated using the entire DEM image including the "calculation region" as a unit, and therefore, the corresponding DEM image needs to be downloaded according to the latitude and longitude range of the specified location, and if the range of the specified location includes a plurality of DEM images, calculation can be performed one by one. In addition, the BP neural network model provided by the present invention can be constructed by using various computer programming languages (such as Python, C + +, MATLAB scripting languages), and in the description of the embodiment, MATLAB software (commercial mathematical software introduced by MathWorks, u.s.a.) is taken as an example to describe the data processing, the mathematical model construction, and the training process of the BP neural network model, but is not limited to this tool.
Hereinafter, the annual accessible hours of a certain area in the cistron of Beijing city are calculated as an example. Assuming that the BP neural network model has been trained as described above, the latitude and longitude of the region is about 40N-40 18 'N, 116E-58' E, as shown in FIG. 8 for a 30m spatial resolution DEM image.
The calculation steps for calculating the annual illuminable time by adopting the BP neural network model of the invention are as follows:
1) according to the latitude and longitude range of the area, the DEM image containing the area is downloaded, as shown in FIG. 8. Because the latitude and longitude ranges of the DEM image in the area are 40-41 degrees N, 116-117 degrees E and the span is only 1 degree, for the convenience of calculation, the latitude and longitude coordinates of each grid are the latitude and longitude coordinates (40-30 'N and 116-30' E) of the central grid of the DEM image and are converted into radian systems (0.7069N and 2.0333E). Converting the DEM image into a numerical matrix; the grid with elevation nulls in the DEM image is then filled.
Extracting the elevation, gradient and slope factor of each grid in the DEM image and the elevation, gradient and slope factor of neighborhood grids (left, right, upper and lower) in four directions of the grid as column vectors, and constructing a numerical matrix Input17×12967201
3) Logarithm value matrix Input17×12967201Carrying out normalization processing to obtain an input matrix P17×12967201A matrix;
4) will input the matrix P17×12967201Transmitting BP neural network model, and calculating output matrix O1×12967201
5) To the output matrix O1×12967201Performing inverse normalization processing to obtain Output1×12967201. Will single line Output1×12967201Recombining the matrixes into a matrix of 3601 multiplied by 3601 to obtain an annual illuminable time matrix Output of the calculation area3601×3601Fig. 9 shows a distribution diagram of the annual illuminable hours of the calculated area.
The calculation of the annual illuminable time of the BP neural network model has the advantages of short calculation time and simple calculation method, the annual illuminable time value is calculated by using a computer (the configuration conditions of the computer are as follows: a CPU is i7-6700, a 64-bit operating system and a 16GB memory), the time required by using the BP neural network model is only 0.21 percent of that of the mathematical model, and the precision can reach about 0.01 percent; experiments prove that the computer is used for calculating China1120 sample areas on continents (total area about 1.3071X 107 km)2) The annual illuminable time of the satellite is calculated by using a mathematical model method for 224 days, while the calculation by using the BP neural network model of the invention only needs 2.8 hours; the training method of the BP neural network model can also be used for other BP neural network models. The method can calculate the illuminable time of a wide area comprising the meteorological site and the non-meteorological site, and provides more accurate basic data for subsequent research; providing basic data for deeply knowing the spatial distribution characteristics of the sunshine duration, calculating the actual sunshine duration, and providing basic data for direct solar radiation, scattered radiation and reflected radiation; basic data are provided for accurately and scientifically calculating and evaluating solar energy resources, and a basis is provided for large-scale development and utilization of renewable solar energy resources; important sunshine duration basic data are provided for fine agricultural production, and a basis is provided for planning of an agricultural planting area and evaluation of agricultural resources; providing important basic data for engineering design and providing necessary parameters for the engineering design of building design and natural resource development departments; basic data are provided for the development of meteorological climatology, a new research idea is provided for the space simulation and the visual expression of regional climate, and the method has important scientific research value and practical value.
The above embodiments are merely illustrative of the technical solutions of the present invention, and the present invention is not limited to the above embodiments, and any modifications or alterations according to the principles of the present invention should be within the protection scope of the present invention.

Claims (6)

1. A method for calculating annual illuminable time based on a BP neural network model is characterized by comprising the following steps:
step 1, training a BP neural network model;
step 2, constructing the digital elevation model image of the calculated area into an input matrix;
step 3, transmitting the input matrix into a BP neural network model, and calculating to obtain an output matrix;
step 4, converting the output matrix into a numerical matrix of annual illuminable hours of the calculation region;
step 2, "construct the digital elevation model image of the calculation area into an input matrix", includes the following steps:
step 21, acquiring a digital elevation model image of a calculation area, and preprocessing the digital elevation model image;
step 22, extracting an input numerical matrix from the preprocessing result, specifically:
taking longitude and latitude coordinates of a central grid of the digital elevation model image as longitude and latitude values of each grid, extracting elevation, gradient and slope factors of each grid in the digital elevation model image and elevation, gradient and slope factors of adjacent grids in four directions of the grid as column vectors, and forming an Input matrix Inputm×nThe following were used:
Figure FDA0002930669860000011
wherein m is the number of rows of the input matrix, n is the number of columns of the input matrix, i is an integer between 1 and m, j is an integer between 1 and n, represents the number of the digital elevation model image grids, x1jAnd x2jRespectively taking the longitude and the latitude of the central grid of the digital elevation model image, wherein the longitude and the latitude are respectively the longitude and the latitude of the jth grid; x is the number of3j、x4j、x5jRespectively the elevation, the gradient and the slope of the jth grid; x is the number of6j、x7j、x8jRespectively the elevation, the gradient and the slope of the adjacent grid in the left direction of the jth grid; x is the number of9j、x10j、x11jRespectively the elevation, the gradient and the slope of the adjacent grid in the right direction of the jth grid; x is the number of12j、x13j、x14jRespectively the elevation, the gradient and the slope of the grid in the direction neighborhood above the jth grid; x is the number of15j、x16j、x17jRespectively the elevation, the gradient and the slope of a neighborhood grid in the direction below the jth grid;
and 23, normalizing the input numerical matrix.
2. The method for calculating the annual illuminable time based on the BP neural network model as claimed in claim 1, wherein the BP neural network model is a five-layer network, which is composed of an input layer, three hidden layers and an output layer, the number of neurons in the hidden layers is 15, and the number of neurons in the output layer is 1;
the activation function formula of the hidden layer is as follows:
Figure FDA0002930669860000021
wherein l is 1, 2, 3; a. thelAn output matrix of the l-th hidden layer of the BP neural network model, Al-1For the input matrix of the l layer hidden layer of the BP neural network model, when l is 1, A0P is an input matrix of the BP neural network model input layer; wlAnd BlA weight matrix and a threshold vector of the first layer hidden layer of the BP neural network model are obtained;
the activation function formula of the output layer is as follows:
Y=purelin(X)=X
wherein Y is the output matrix of the BP neural network model output layer, and X is the input matrix of the BP neural network model output layer.
3. The calculation method of the annual illuminable number based on the BP neural network model as set forth in claim 1, wherein the step 1 "training the BP neural network model" comprises the steps of:
step 11, selecting a training sample;
step 12, constructing the digital elevation model image of the training sample into a sample input numerical matrix;
step 13, calculating annual illuminable time values of areas corresponding to the training samples, and constructing an expected output matrix;
step 14, initializing weight matrixes and threshold vectors of all layers of the BP neural network;
step 15, respectively carrying out normalization processing on the sample input numerical matrix and the expected output matrix, and simultaneously storing the maximum value and the minimum value before normalization of the expected output matrix;
step 16, setting a basic parameter threshold value of BP neural network training;
step 17, transmitting the normalized sample input numerical matrix into a BP neural network model, calculating an output matrix, and calculating a training target error according to the normalized expected output matrix, wherein the training target error calculation formula is as follows:
Figure FDA0002930669860000031
wherein n is the number of training samples; k is an integer from 1 to n, τkThe value of the k element of the expected output matrix after normalization; okIs the value of the kth element of the output matrix of the BP neural network model;
step 18, judging whether the training target error is smaller than a set threshold value, and if the training target error is smaller than the set threshold value, skipping to step 19 to continue execution; otherwise, after correcting the weight matrix and the threshold vector of each layer of the BP neural network model, skipping to the step 17 to continue execution;
and step 19, storing the weight matrix and the threshold vector of each layer of the BP neural network model, and completing the construction of the BP neural network model.
4. The method for calculating the annual illuminable number of the BP neural network model according to claim 3, wherein the step 13 "calculating the annual illuminable number value of the region corresponding to the training sample and constructing the expected output matrix" comprises the following steps:
step 131, converting the digital elevation model image of the area corresponding to the training sample into a numerical matrix;
step 132, calculating the actual annual illuminable time of the area corresponding to the training sample according to the mathematical model;
and step 133, constructing the actual annual illuminable time value of the region corresponding to the training sample into an expected output matrix.
5. The method for calculating the annual illuminable number based on the BP neural network model as set forth in claim 1, wherein the step 21 "constructing the numerical matrix according to the digital elevation model image" specifically comprises: and converting the digital elevation model image into a numerical matrix, filling vacancy values in the numerical matrix, and numbering grids of the digital elevation model image.
6. The method for calculating the annual illuminable number based on the BP neural network model as set forth in claim 1, wherein the step 4 "converting the output matrix into the numerical matrix of annual illuminable number for the calculation region" comprises the steps of:
step 41, performing inverse normalization processing on the output matrix to obtain a single-row output matrix;
and 42, recombining the single row output matrixes into a numerical value matrix of the annual illuminable hours of the calculation region.
CN201811504805.4A 2018-12-10 2018-12-10 BP neural network model-based annual illuminable time calculation method Active CN109409014B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811504805.4A CN109409014B (en) 2018-12-10 2018-12-10 BP neural network model-based annual illuminable time calculation method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811504805.4A CN109409014B (en) 2018-12-10 2018-12-10 BP neural network model-based annual illuminable time calculation method

Publications (2)

Publication Number Publication Date
CN109409014A CN109409014A (en) 2019-03-01
CN109409014B true CN109409014B (en) 2021-05-04

Family

ID=65458178

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811504805.4A Active CN109409014B (en) 2018-12-10 2018-12-10 BP neural network model-based annual illuminable time calculation method

Country Status (1)

Country Link
CN (1) CN109409014B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020181508A1 (en) * 2019-03-12 2020-09-17 深圳市大疆创新科技有限公司 Digital surface model construction method, and processing device and system
CN110717841A (en) * 2019-10-10 2020-01-21 广东博智林机器人有限公司 Sunshine analysis method, device, equipment and storage medium based on AutoEncoder
CN110737995A (en) * 2019-10-24 2020-01-31 广东博智林机器人有限公司 building house sunshine duration prediction method, device and equipment based on GAN
CN111768039B (en) * 2020-07-01 2022-03-18 天津师范大学 Animal home domain estimation method based on active learning

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102129013A (en) * 2011-01-21 2011-07-20 昆明理工大学 Distribution network fault location method utilizing natural frequency and artificial neural network
CN104915515A (en) * 2015-06-26 2015-09-16 武汉大学 BP neural network based GFET modeling method
CN105630458A (en) * 2015-12-29 2016-06-01 东南大学—无锡集成电路技术研究所 Prediction method of out-of-order processor steady-state average throughput rate based on artificial neural network
CN107194929A (en) * 2017-06-21 2017-09-22 太原理工大学 A kind of good pernicious sorting technique of Lung neoplasm based on depth belief network

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102129013A (en) * 2011-01-21 2011-07-20 昆明理工大学 Distribution network fault location method utilizing natural frequency and artificial neural network
CN104915515A (en) * 2015-06-26 2015-09-16 武汉大学 BP neural network based GFET modeling method
CN105630458A (en) * 2015-12-29 2016-06-01 东南大学—无锡集成电路技术研究所 Prediction method of out-of-order processor steady-state average throughput rate based on artificial neural network
CN107194929A (en) * 2017-06-21 2017-09-22 太原理工大学 A kind of good pernicious sorting technique of Lung neoplasm based on depth belief network

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
《Computation of monthly mean daily global solar radiation in China using artificial neural networks and comparison with other empirical models》;JIANG Yingni;《Energy》;20091231;全文 *
《利用LM-BP神经网络估算西北地区太阳辐射》;李净等;《干旱区地理》;20150531;第一段、章节1.2、章节1.3.2、图2 *

Also Published As

Publication number Publication date
CN109409014A (en) 2019-03-01

Similar Documents

Publication Publication Date Title
CN109409014B (en) BP neural network model-based annual illuminable time calculation method
Walch et al. Big data mining for the estimation of hourly rooftop photovoltaic potential and its uncertainty
Sinha et al. Effects of historical and projected land use/cover change on runoff and sediment yield in the Netravati river basin, Western Ghats, India
Linares-Rodríguez et al. Generation of synthetic daily global solar radiation data based on ERA-Interim reanalysis and artificial neural networks
Effat Selection of potential sites for solar energy farms in Ismailia Governorate, Egypt using SRTM and multicriteria analysis
CN113297528B (en) NO based on multi-source big data2High-resolution space-time distribution calculation method
CN103728609B (en) Satellite-borne multispectral infrared sensor cross-radiometric calibration method
Antonanzas-Torres et al. Evaluation and improvement of empirical models of global solar irradiation: Case study northern Spain
Tapakis et al. Computations of diffuse fraction of global irradiance: Part 1–Analytical modelling
US20210208307A1 (en) Training a machine learning algorithm and predicting a value for a weather data variable, especially at a field or sub-field level
Ruiz-Arias et al. A topographic geostatistical approach for mapping monthly mean values of daily global solar radiation: A case study in southern Spain
Lefèvre et al. The HelioClim-1 database of daily solar radiation at Earth surface: an example of the benefits of GEOSS Data-CORE
Kheradmanda et al. Clearness index predicting using an integrated artificial neural network (ANN) approach
Greenberg et al. Using LiDAR Data Analysis to Estimate Changes in Insolation Under Large‐Scale Riparian Deforestation 1
Haurant et al. Disaggregation of satellite derived irradiance maps: Evaluation of the process and application to Corsica
Mubiru et al. Monthly average daily global solar irradiation maps for Uganda: A location in the equatorial region
Lee et al. A comparative study on generating simulated Landsat NDVI images using data fusion and regression method—the case of the Korean Peninsula
Chinasho et al. Evaluation of seven gap-filling techniques for daily station-based rainfall datasets in South Ethiopia
CN112285808B (en) Method for reducing scale of APHRODITE precipitation data
Orellana-Samaniego et al. Estimating monthly air temperature using remote sensing on a region with highly variable topography and scarce monitoring in the southern Ecuadorian Andes
CN110991702B (en) Method and device for calculating rainfall in mountainous area, computer equipment and storage medium
CN109885808B (en) Near-surface meteorological element calculation method
Gusev et al. Scenario prediction of changes in water balance components in the Lena Basin in the context of possible climate changes
Jande et al. Assessment of land use and land cover changes and urban expansion using remote sensing and GIS in Gboko, Benue State, Nigeria
Zhang et al. Merging framework for estimating daily surface air temperature by integrating observations from multiple polar-orbiting satellites

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant