CN109409014A - The calculation method of shining time per year based on BP neural network model - Google Patents

The calculation method of shining time per year based on BP neural network model Download PDF

Info

Publication number
CN109409014A
CN109409014A CN201811504805.4A CN201811504805A CN109409014A CN 109409014 A CN109409014 A CN 109409014A CN 201811504805 A CN201811504805 A CN 201811504805A CN 109409014 A CN109409014 A CN 109409014A
Authority
CN
China
Prior art keywords
matrix
neural network
network model
grid
per year
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201811504805.4A
Other languages
Chinese (zh)
Other versions
CN109409014B (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

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • General Engineering & Computer Science (AREA)
  • Evolutionary Computation (AREA)
  • General Physics & Mathematics (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • General Health & Medical Sciences (AREA)
  • Neurology (AREA)
  • Computational Linguistics (AREA)
  • Artificial Intelligence (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Microelectronics & Electronic Packaging (AREA)
  • Computer Hardware Design (AREA)
  • Geometry (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention belongs to technical field of geographic information, and in particular to a kind of calculation method of the shining time per year based on BP neural network model.The present invention includes step: training BP neural network model;The digital elevation model image for calculating area is built into input matrix;The input matrix is passed to BP neural network model, output matrix is calculated;The output matrix is converted into calculate the shining time per year numerical matrix in area.The present invention can quickly and accurately calculate the sunshine time for being arbitrarily designated place, model is easily understood, calculation amount is small, more existing mathematical model calculation, which substantially reduces, calculates the time, precision is higher, basic data can be provided to understand the spatial distribution characteristic of sunshine time in depth, calculating direct solar radiation, scattering radiation and reflected radiation, reliable data foundation is provided for scientific research and actual production, there is important scientific research value and practical value.

Description

The calculation method of shining time per year based on BP neural network model
Technical field
The invention belongs to technical field of geographic information, and in particular to a kind of shining time per year based on BP neural network model Calculation method.
Background technique
An important factor for sunshine is weather formation, is that solar radiation most intuitively shows.Sunshine time refer to somewhere too Positive directly irradiation level meets or exceeds the temporal summation of 120W/m 2 (as unit of hour).Number when sunshine time can be divided into real shine And the sunshine time, number when number refers to the actual sunshine for considering atmospheric effect and terrain masking influence when shining in fact;Sunshine time point For astronomical sunshine time and geographical sunshine time, the former, which refers to, does not consider atmospheric effect and the maximum possible sunshine that terrain masking influences When number, the latter refer to consider terrain masking influence without consider atmospheric effect possibility sunshine time.What the present invention calculated is geographical Sunshine time (is hereafter referred to as " sunshine time ").It is number and then the calculating earth's surface practical incident sun when calculating actual sunshine Basic data necessary to radiation (directly radiating, global radiation etc.) is exploitation solar energy resources, layout agricultural production, exploitation trip The important design parameter of idle fund source and ecological restoration and ecological construction.
The acquisition methods of sunshine time are main following several at present: the first is website measurement.But actual measuring station Point quantity is extremely limited, and most of websites are located at flat ground, when can not often reflect the sunshine in rolling topography region Number changing rule (mountain area especially with a varied topography).Second is that the sunshine time based on rolling topography calculates.Such as using Digital elevation model (Digital Elevation Model, DEM) calculates the sunshine time under actual landform, can get vast The sunshine time in non-measured website area, the effective space distribution rule for reflecting sunshine time under rolling topography, but model ratio It is more complex, it is computationally intensive, it is not easy to promote.
Summary of the invention
It is an object of the present invention to overcoming disadvantage mentioned above, when shining of designated place can be quickly and accurately calculated Number, computation model is easily understood, calculation amount is small, while can calculate the wide geographic area comprising measurement website and non-measured website Sunshine time.
In order to solve the above-mentioned technical problems, the present invention provides a kind of shining time per years based on BP neural network model Calculation method, comprising the following steps:
Step 1, training BP neural network model;
The DEM image for calculating area is built into input matrix by step 2;
The input matrix is passed to BP neural network model by step 3, and output matrix is calculated;
The output matrix is converted into calculating the shining time per year numerical matrix in area by step 4.
Further, the BP neural network model be five layer networks, by an input layer, three hidden layers, one it is defeated Layer is constituted out, and the neuronal quantity of the hidden layer is 15, and the neuronal quantity of the output layer is 1;
The activation primitive formula of the hidden layer are as follows:
Wherein l=1,2,3;AlFor the output matrix of BP neural network l layers of hidden layer of model, Al-1For BP neural network The input matrix of l layers of hidden layer of model, as l=1, A0=P, P are the input matrix of BP neural network mode input layer;Wl And BlFor the weight matrix and threshold vector of l layers of hidden layer of BP neural network model;
The activation primitive formula of the output layer are as follows:
Y=purelin (X)=X
Wherein Y is the output matrix of BP neural network model output layer, and X is the input square of BP neural network model output layer Battle array.
Further, the step 1 " training BP neural network model ", comprising the following steps:
Step 11 chooses training sample;
The DEM image of the training sample is built into sample input numerical matrix by step 12;
Step 13, the shining time per year value for calculating the training sample corresponding area construct desired output matrix;
Step 14, the weight matrix and threshold vector for initializing each layer of BP neural network;
Sample input numerical matrix and the desired output matrix is normalized in step 15 respectively, together Shi Baocun it is expected the maximum value and minimum value before output matrix normalization;
Step 16, the basic parameter threshold value of setting BP neural network training;
Sample input numerical matrix after normalization is passed to BP neural network model by step 17, calculates output matrix, Training objective error, the training objective error calculation formula are calculated further according to the desired output matrix after normalization are as follows:
Wherein n is the quantity of training sample;K is 1 to the integer between n, τkFor the desired output matrix kth after normalization The value of a element;okFor the value of k-th of element of output matrix of BP neural network model;
Step 18 judges whether the training objective error is less than the threshold value of setting, if the training objective error is less than The threshold value of setting, then going to step 19 continues to execute;Otherwise, then to each layer weight matrix and threshold value of BP neural network model After vector is modified, going to step 17 is continued to execute;
Step 19 saves each layer weight matrix of BP neural network model and threshold vector, completes BP neural network model structure It builds.
Further, the step 13 " calculates the shining time per year value of the training sample corresponding area, building expectation is defeated Matrix out ", comprising the following steps:
Step 131, by the DEM video conversion of training sample corresponding area be numerical matrix;
Step 132, the practical shining time per year that training sample corresponding area is calculated according to mathematical model;
The practical shining time per year value of training sample corresponding area is built into desired output matrix by step 133.
Further, the step 2 " the DEM image for calculating area is built into input matrix ", comprising the following steps:
Step 21 obtains the DEM image for calculating area, and pre-processes to DEM image;
Step 22 extracts input numerical matrix from pre-processed results;
The input numerical matrix is normalized in step 23.
Further, the step 21 " DEM image is pre-processed ", specifically: by DEM video conversion be numerical value square Battle array, fills the vacancy value in the numerical matrix, and the grid of DEM image is numbered.
Further, the step 22 " input numerical matrix is extracted from pre-processed results ", specifically:
Using the latitude and longitude coordinates of DEM image center grid as the latitude and longitude value of each grid, extract every in DEM image The elevation of a grid, the gradient, aspect factor and the grid four direction neighborhood grid (left, right, top, lower section) height Journey, the gradient and aspect factor form input matrix Input as column vectorm×nIt is as follows:
Wherein, m is the line number of input matrix, and n is the columns of input matrix, and i is 1 to the integer between m, j be 1 to n it Between integer, indicate DEM image grid number, x1jAnd x2jThe longitude and latitude of respectively j-th grid take width DEM shadow The longitude and latitude of inconocenter grid;x3j、x4j、x5jElevation, the gradient, the slope aspect of respectively j-th grid;x6j、x7j、x8jRespectively For elevation, the gradient, the slope aspect of j-th of grid left direction neighborhood grid;x9j、x10j、x11jRespectively j-th of grid right direction neighborhood Elevation, the gradient, the slope aspect of grid;x12j、x13j、x14jThe elevation of direction neighborhood grid, the gradient, slope on respectively j-th of grid To;x15j、x16j、x17jElevation, the gradient, the slope aspect of direction neighborhood grid under respectively j-th of grid.
Further, the step 4 " being converted into the output matrix to calculate the shining time per year numerical matrix in area ", The following steps are included:
Step 41 carries out anti-normalization processing to the output matrix, obtains uniline output matrix;
The uniline output matrix is reassembled into the shining time per year numerical matrix for calculating area by step 42.
The beneficial effect comprise that
1) sunshine time for being arbitrarily designated place can be quickly and accurately calculated, model is easily understood, calculation amount is small, compared with Existing mathematical model calculation, which substantially reduces, calculates the time, and precision is higher.
2) BP neural network training method of the invention can be applied to the DEM of any spatial resolution, training additional space The BP neural network model of resolution ratio, replicability are high.
3) the calculated result of present invention institute --- the sunshine time can be the spatial distribution spy for understanding the sunshine time in depth Number, direct solar radiation, scattering radiation and reflected radiation provide basic data when sign, calculating actual sunshine, are scientific research Reliable data foundation is provided with actual production, there is important scientific research value and practical value.
Detailed description of the invention
Fig. 1 is the calculation method flow chart of steps the present invention is based on the shining time per year of BP neural network model.
Fig. 2 is the step flow chart of present invention training BP neural network model.
Fig. 3 is the step flow chart that the present invention calculates shining time per year value using mathematical model.
Fig. 4 is the schematic diagram of the terrain masking of the embodiment of the present invention.
Fig. 5 is the BP neural network model structure of the calculating shining time per year of the embodiment of the present invention.
Fig. 6 be the present invention by calculate area DEM image be built into input matrix flow chart of steps.
Fig. 7 is that the output matrix is converted into calculating the shining time per year numerical matrix steps flow chart in area by the present invention Figure.
Fig. 8 is the DEM image of 30 meters of spatial resolutions in the sample area of the embodiment of the present invention.
Fig. 9 is the shining time per year distribution map of the zoning of the embodiment of the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other Embodiment shall fall within the protection scope of the present invention.
It is the calculation method flow chart of steps the present invention is based on the shining time per year of BP neural network model such as Fig. 1, including Following steps:
Step 1, training BP neural network model;It is the step process of present invention training BP neural network model such as Fig. 2 Figure, comprising the following steps:
Step 11 chooses training sample;
In embodiments of the present invention, the land surface of China's Mainland can be by 1120 width digital elevation model (Digital Elevation Model, DEM) image all coverings, DEM image data is in Chinese Academy of Sciences's computer network information Heart geographical spatial data cloud platform (http://www.gscloud.cn).Download the DEM shadow of this 1120 width 30m spatial resolution Picture chooses several width DEM images as training field from this 1120 width DEM image, and a width DEM image corresponds to an area Ge Yang, It is required that selected sample area image is dispersed evenly to the land surface of China's Mainland.
The longitude and latitude interval for each width DEM image downloaded is 1 °, and image format is tiff format, each width The pixel of DEM image is 3601 × 3601, will be every in a width DEM image according to the communicative habits of GIS major One pixel is known as grid, and the numerical value in grid indicates the dispersed elevation value of position corresponding to the grid.A then width 30m resolution ratio DEM image share 12967201 (3601 × 3601) a grids, the grid of single width DEM image is numbered, according to elder generation from Top to bottm, after sequence from left to right be successively numbered, such as: the grid number of the 1st row the 1st column is 1, the 2nd row the 1st column Grid number is that the grid number of the 2, the 3rd row the 1st column is 3 ..., and the grid number of the 3601st row 3601 column is 12967201.
Using 250 width DEM images of selection as training field, and for randomly selecting out of each sample area 40 grids. Sequence by selected sample area according to its orientation from West to East, from north orientation south is numbered, and numbers from 1 to 250;It saves simultaneously 10000 grids can be obtained in the number of the grid extracted in each sample area, this 10000 grids are known as " sampling grids ".
The DEM image of the training sample is built into sample input numerical matrix by step 12;
The training sample (250 width DEM image) of selection is converted into numerical matrix, to there are use at the grid of vacancy value Neighbouring method is filled, that is, inserts the height value of closest grid.
The corresponding matrix l of DEM image that building number is 11,
In formula, l1For the matrix of 17 rows 40 column;l1Subscript indicate DEM image number;D=1,2,3 ..., 40;Matrix l1In d column element x1d, x2d..., x17,dIt is followed successively by longitude, latitude value, the height value, four sides of d-th of sampling grids To the height value of neighborhood grid, value of slope, the value of slope of four direction neighborhood grid, slope aspect value, four direction neighborhood grid Slope aspect value;
And so on, construct the matrix l of sampling grids in all 250 width DEM images1, l2..., l250, by it by as follows Mode is combined, and obtains the input matrix P of BP neural network model,
P=[l1, l2..., l250]
In formula, P is 17 rows, the matrix of 10000 column;
Step 13, the shining time per year value for calculating the training sample corresponding area construct desired output matrix;Such as Fig. 3 It is the step flow chart that shining time per year value is calculated using mathematical model of the embodiment of the present invention, comprising the following steps:
The DEM image of training sample corresponding area is built into input numerical matrix by step 131;
It is numerical matrix by 250 width DEM video conversions of selection, there are neighbour is used at the grid of vacancy value for logarithm value matrix Nearly method is filled, that is, inserts the height value of closest grid.The gradient and slope aspect value for calculating each DEM grid, obtain the ground The latitude in area.
Step 132, the practical shining time per year that training sample corresponding area is calculated according to mathematical model;
In the present embodiment, the step of shining time per year being calculated using mathematical model, comprising:
1) solar declination, calculation formula are calculated are as follows:
δ=0.006894-0.399512cos θ -0.072075sin θ -0.006799cos2 θ+0.00089sin2 θ
Wherein θ claims a day angle, λ/365.2422 the π of θ=2.That is λ=N-1, N are day of year, i.e. the serial number of date within the year.January Day of year on the 1st is 1, and the day of year on January 2 is 2 ..., the day of year on December 31 is 365 or 366 (non-leap year 365, leap year be 366)。
2) sun sunrise and Mo hour angle, calculation formula are calculated are as follows:
Wherein, ωsFor day end hour angle, ωrFor sunrise hour angle, ωrHour angle, for 0, is positive clockwise with due south direction, the inverse time Needle is negative.ψ is latitude.
3) the dispersed number ρ for confirming hour angle from sun to sun, determines the interval delta ω of hour angle, i.e., corresponding time span Δ t, calculation formula are as follows:
Δ t=Δ ω/15
When dispersed number is bigger, then calculated result is finer, and precision is higher, but calculating the time can be longer.In general, the time When step-length is 20 minutes, i.e. when dispersed number ρ=36, relative error very little is able to satisfy required precision completely.
4) each hour angle ω is calculatedtCorresponding solar elevation htWith solar azimuth Λt, calculation formula is as follows:
ωtr+I×Δω
Wherein, I=1,2,3 ..., 36.
5) ω is calculatedtThe terrain masking factor d at momentt
In embodiments of the present invention, if Fig. 4 is the schematic diagram of the terrain masking in the embodiment of the present invention.Hypsography is larger Area, the sunshine not only masking by massif itself, but also blocked by massif around such as the C point in figure, is exactly It is blocked by D point without sunshine.
The calculating of terrain masking uses biggest advantage of light track algorithm, all grid points on incident path is searched for, if certain grid points is high Elevation angle η between journey D and calculating grid point height C is greater than the solar elevation γ on the incident path, then this is a quilt Path is covered, remembers dt=0;Otherwise dt=1.The calculation command of the lighting simulation provided in this experiment using ARCGIS software HILLSHADE calculates dt, calculate dtWhen need the solar elevation and solar azimuth of corresponding moment (hour angle).
6) judge ωtTo ωt+1Masking situation in this differential period
Calculate separately the d of different momentstValue, judges whether can shine in each differential period, terrain masking coefficient gtValue According to following rule:
Above formula is indicated in (ωt-1, ωt) in the period, study the sunshine that sunshine situation a little depends entirely on both ends point moment Situation.Even both ends point moment can shine (masking), then whole Duan Kezhao (masking);If one end point moment can shine, other end point moment It covers, then (ωt-1, ωt) have half the time that can shine in the period, half masking.
7) sunshine time is calculated
Each grid daily sunshine time are as follows:
The shining time per year of each grid are as follows:
Wherein Td is each grid daily sunshine time, and unit is hour;ρ is the dispersion number of hour angle from sun to sun Mesh;Ts is each grid shining time per year, and unit is hour;N is day of year, i.e. the serial number of date within the year.
The practical shining time per year value of the sample regions is built into desired output matrix by step 133.
In embodiments of the present invention, it is instructed the calculated practical shining time per year of mathematical model as BP neural network model Experienced desired output, the numerical matrix that calculated various kinds area shining time per year is 3601 × 3601, each element corresponding one The shining time per year value of a grid.Meanwhile each element is numbered, numbering and training field DEM image grid Numbering is consistent.
The shining time per year matrix t of all sampling grids in the DEM image that building number is 11,
t1=[y1, y2..., y40]
In formula, t1For the matrix of 1 row 40 column, subscript indicates the number of DEM image;y1, y2..., y40Respectively above-mentioned institute There is the shining time per year value of sampling grids;
And so on, construct the shining time per year matrix t of all 250 all sampling grids of width DEM image1, t2..., t250, it is combined as follows, obtains the output matrix T of BP neural network model,
T=[t1, t2..., t250]
In formula, T is the matrix of 1 row 10000 column;
The maximum value and minimum value before desired output matrix normalizes in all elements need to be saved, y is denoted asmaxAnd ymin
Step 14, the weight matrix and threshold vector for initializing each layer of BP neural network;
In a preferred embodiment, it can assist realizing that initialization BP neural network is each by computer programming language The weight matrix and threshold vector of layer, such as: the rands function of MATLAB software.
Sample input numerical matrix and the desired output matrix is normalized in step 15 respectively, together Shi Baocun it is expected the maximum value and minimum value before output matrix normalization;The normalization formula are as follows:
In formula, i=1,2,3 ..., 17;J=1,2,3 ..., 10000;xi,jIt is matrix Input the i-th row jth column element Value;It is the maximum value in matrix Input the i-th row all elements,It is in matrix Input the i-th row all elements Minimum value, Pi,jIt is the value of matrix P the i-th row jth column element after normalization, value range is [- 1,1].Meanwhile saving expectation Maximum value and minimum value before output matrix normalization, are denoted as ymaxAnd ymin, counter return for the output matrix of BP neural network model One change is prepared.
In a preferred embodiment, it can assist realizing normalization process by computer programming language, for example, making It is completed with the mapminmax function of MATLAB software, the call format of function is following (it is expected being normalized to for output matrix Example):
[Tt, Tn]=mapminmax (T, tmin, tmax)
T is the desired output matrix in formula, and Tt is the desired output matrix after normalization, and Tn is to call The parameter obtained when mapminmax function mainly contains the minimum value t of expectation output matrix whole element before normalizationminWith Maximum value tmax, and normalization after it is expected output matrix Tt whole element maximum value tmaxWith minimum value tmin(tminBe defaulted as- 1, tmaxIt is defaulted as 1).Meanwhile saving expectation output matrix and normalizing parameter Tn obtained, it is the defeated of BP neural network model Matrix renormalization is prepared out.
Step 16, the basic parameter threshold value of setting BP neural network training;
In the present invention, the basic parameter of the BP neural network training includes maximum frequency of training, training objective minimum Error, learning rate, the maximum frequency of failure.For example, in a specific embodiment, settable network basic parameter: maximum training Number is 10000;Training objective minimal error is set as 100;Learning rate is set as 0.01;The maximum frequency of failure is set as 20.
Sample input numerical matrix after normalization is passed to BP neural network model by step 17, calculates output matrix, Training objective error is calculated further according to the desired output matrix after normalization.
Firstly, the sample input numerical matrix after normalization is passed to BP neural network model, output matrix is calculated.? In technical solution of the present invention, the BP neural network model is five layer networks, by an input layer, three hidden layers, one Output layer is constituted, and the neuronal quantity of the hidden layer is 15, and the neuronal quantity of the output layer is 1, is meter such as Fig. 5 Calculate the BP neural network model structure of shining time per year.In Fig. 5, P is the input matrix after normalization;The line number that r is P, that is, defeated Enter the number of variable, r is 17 in the technical solution of the present invention;Columns of the q for P, different, s1, s2 according to the sample number of selection, S3 is hidden layer neuron quantity, and the s1 in this model, s2, s3 is 15;S4 is output layer neuron quantity, in this model S4 is 1;H1, h2, h3 are the integer between 1 to 15, h4 1.
F1, F2, F3For the activation primitive of hidden layer, the activation primitive formula of hidden layer are as follows:
Wherein l=1,2,3;AlFor the output matrix of BP neural network l layers of hidden layer of model, Al-1For BP neural network The input matrix of l layers of hidden layer of model, as l=1, A0=P, P are the input matrix of input layer, WlAnd BlFor BP nerve net The weight matrix and threshold vector of l layers of hidden layer of network model;
F4For the activation primitive of output layer, the activation primitive formula of output layer are as follows:
Y=purelin (X)=X
Wherein Y is the output matrix of BP neural network model output layer, and X is the input square of BP neural network model output layer Battle array.
In the BP neural network model, the input matrix of output layer is A3, the output matrix of output layer is O, O= A3
It calculates, is instructed secondly, the numerical value of expected matrix after the numerical value of output matrix and normalization is substituted into formula Practice target error, the training objective error calculation formula are as follows:
Wherein n is the quantity of training sample;K is 1 to the integer between n, τkFor the desired output matrix kth after normalization The value of a element;okFor the value of k-th of element of output matrix of BP neural network model;
Step 18 judges whether the training objective error is less than the threshold value of setting, in the present embodiment, sets minimum training Target error is 100, if E < 100, going to step 19 is continued to execute;Otherwise, then each layer of BP neural network model is weighed After value matrix and threshold vector are modified, going to step 17 is continued to execute;
Step 19 saves each layer weight matrix of BP neural network model and threshold vector, completes BP neural network model structure It builds.Obtained each layer weight matrix and threshold vector after the completion of training, it is ensured that the subsequent sunshine time calculate can obtain compared with For accurately result.In addition, it is necessary to explanation, the training step of BP neural network model might not calculate year every time can According to when numerical value when all repetition trainings, when training obtain more accurate model after, subsequent calculating can directly input.If mould Type precision is inadequate, then can resurvey sample data continue training obtain more preferably model.
The DEM image for calculating area is built into input matrix by step 2;It is the DEM that the present invention will calculate area such as Fig. 6 Image is built into input matrix flow chart of steps, comprising the following steps:
Step 21 obtains the DEM image for calculating area, and pre-processes to DEM image;
In embodiments of the present invention, digital elevation model (Digital Elevation Model, DEM) image data comes Derived from Computer Network Information Center, Chinese Academy of Sciences's geographical spatial data cloud platform (http://www.gscloud.cn).Under The DEM image for carrying the 30m spatial resolution that area to be calculated includes, between the longitude and latitude for each width DEM image downloaded Every being 1 °, image format is tiff format, and the pixel of each width DEM image is 3601 × 3601, according to GIS-Geographic Information System The communicative habits of profession, are known as grid for each of width DEM image pixel, then the DEM image of a width 30m resolution ratio is total There are 12967201 (3601 × 3601) a grids.The grid of single width DEM image is numbered, according to first from top to bottom, after from Left-to-right sequence is successively numbered, such as: the grid number of the 1st row the 1st column is 1, and the grid number of the 2nd row the 1st column is The grid number of 2, the 3rd row the 1st column is 3 ..., and the grid number of the 3601st row 3601 column is 12967201, so as to form one Matrix.The numerical value of the matrix is the corresponding pixel value of each grid of DEM image number, i.e., the DEM image pixel institute is in place The height value set.Logarithm value matrix inserts closest grid there are being filled at the grid of vacancy value using neighbouring method Height value.
In addition, the longitude and latitude for needing DEM image each grid when astronomical radiation is calculated, due to the longitude of every width DEM image It is only 1 ° with latitude interval, for convenience of calculating, the latitude and longitude coordinates of each grid take the longitude and latitude of DEM image center grid to sit Mark.
In a preferred embodiment, building numerical matrix can be assisted by computer programming language, comprising: Python, C++, MATLAB script etc..
Step 22 extracts input numerical matrix from pre-processed results;
Using the latitude and longitude coordinates of DEM image center grid as the latitude and longitude value of each grid, extract every in DEM image The elevation of a grid, the gradient, aspect factor and the four direction neighborhood grid (left, right, top, lower section) of grid height Journey, the gradient and aspect factor form input matrix Input as column vectorm×nIt is as follows:
Wherein, m is the line number of input matrix, and n is the columns of input matrix, and i is 1 to the integer between m, j be 1 to n it Between integer, indicate DEM image grid number, x1jAnd x2jThe longitude and latitude of respectively j-th grid take width DEM shadow As the longitude and latitude of image center grid;x3j、x4j、x5jElevation, the gradient, the slope aspect of respectively j-th grid;x6j、x7j、x8j Elevation, the gradient, the slope aspect of respectively j-th grid left direction neighborhood grid;x9j、x10j、x11jRespectively j-th of grid right direction Elevation, the gradient, the slope aspect of neighborhood grid;x12j、x13j、x14jThe elevation of direction neighborhood grid on respectively j-th of grid, the gradient, Slope aspect;x15j、x16j、x17jElevation, the gradient, the slope aspect of direction neighborhood grid under respectively j-th of grid.
The input numerical matrix is normalized in step 23.
Substitute into normalization formula, the input matrix after normalize, the normalized processing mode such as step above Described in 15.
The input matrix is passed to BP neural network model by step 3, and output matrix is calculated;It is according to the present invention The weight matrix and threshold vector of BP neural network structure and trained each layer, can quickly obtain output matrix.
The output matrix is converted into calculating the shining time per year numerical matrix in area by step 4.
If Fig. 7 is the shining time per year numerical matrix flow chart of steps that the output matrix is converted into calculating area, packet Include following steps:
Step 41 carries out anti-normalization processing to the output matrix, obtains uniline output matrix;
In numerical procedure of the present invention, renormalization formula are as follows:
J=1 in formula, 2,3 ..., 12967201;OutputjFor the value after renormalization;OjFor BP neural network model Output valve;ymaxAnd yminIt is the maximum value of all elements before desired output matrix normalization in BP neural network training process And minimum value.
In a preferred embodiment, it can assist realizing renormalization process by computer programming language, such as The mapminmax function of MATLAB software, the call format of function are as follows:
Output=mapminmax (' reverse ', O, Tn),
In formula, Output is the matrix after renormalization;O is the matrix before normalization;Tn is that desired output matrix is returned One parameter obtained when changing;
The uniline output matrix is reassembled into the shining time per year numerical matrix for calculating area by step 42.
By row vector Output1×12967201It reconfigures as Output3601×3601Matrix.Rule of combination are as follows: the 1st arrives 3601st element is as first row, and the 3602nd to the 7202nd element is as secondary series ..., and the 12963421st to 12967021 elements are as the 3601st column), the shining time per year numerical matrix of this area can be obtained in this way.
It should be noted that described " the calculating area " in the present invention, it all will be with the whole picture comprising " the calculating area " DEM image is unit, and the sunshine time that calculating whole picture DEM image corresponds to sample area therefore need to be according to the longitude and latitude model of designated place Enclosing the corresponding DEM image of downloading can be calculated if the range of designated place includes several DEM images by width.In addition, this Invent the BP neural network model proposed can be constructed using a variety of computer programming languages (such as Python, C++, MATLAB scripting language), with MATLAB software, (business mathematics that MathWorks company, the U.S. releases are soft in embodiment illustrates Part) for illustrate the processing of data, the building of mathematical model, BP neural network model training process, but be not limited to This tool.
Below by taking In Shunyi District of Beijing region as an example, the shining time per year in the region is calculated.Assuming that BP neural network mould For type according to trained completion is described above, the longitude and latitude range in the region is about 40 ° of N~40 °, 18 ' N, 116 ° of 28 E~116 ° ' 58 ' E, the middle curve area defined as shown in the DEM image of the 30m spatial resolution of Fig. 8.
Calculating the calculating of shining time per year using BP neural network model of the invention, steps are as follows:
1) according to the longitude and latitude range in the region, downloading includes the DEM image in the region, as shown in Figure 8.Due to the region DEM image longitude and latitude range be 40 ° of N~41 ° N, 116 ° of E~117 ° E, span is only 1 °, for convenience of calculate, each grid Latitude and longitude coordinates take the latitude and longitude coordinates (40 ° of 30 ' N, 116 ° of 30 ' E) of DEM image center grid, are converted to radian and are made as (0.7069N, 2.0333E).It is numerical matrix by DEM video conversion;Then to there are the grids of elevation vacancy value in DEM image It is filled.
Extract elevation, the gradient, aspect factor and the grid four direction neighborhood grid of each grid in DEM image Elevation, the gradient and the aspect factor of (left, right, top, lower section) construct numerical matrix as column vector Input17×12967201
3) logarithm value matrix Input17×12967201It is normalized, obtains input matrix P17×12967201Matrix;
4) by input matrix P17×12967201Incoming BP neural network model, calculates output matrix O1×12967201
5) to output matrix O1×12967201Anti-normalization processing is carried out, Output is obtained1×12967201.By uniline Output1×12967201The matrix that matrix reconfigures as 3601 × 3601 obtains the shining time per year matrix of the zoning Output3601×3601, as shown in figure 9, being the shining time per year distribution map of zoning.
BP neural network model of the invention, which calculates shining time per year, has the calculating time short, and calculation method is simply excellent Point, equally calculating shining time per year value using computer, (configuration condition of computer is as follows: CPU i7-6700,64 bit manipulations System, the memory of 16GB), using is only the 0.21% of mathematical model the time required to BP neural network model, and precision can reach 0.01% or so;It is demonstrated experimentally that using aforementioned computer calculate 1120 area Ge Yang of China's Mainland (gross area is about 1.3071 × 107km2) shining time per year, using mathematical model method calculating take 224 days, and use BP neural network mould of the present invention Type calculating only needs 2.8 hours;The training method of BP neural network model of the invention also can be used for other BP neural network moulds Type.The present invention can calculate the sunshine time of the wide geographic area comprising meteorological site and non-meteorological website, mention for subsequent research For more accurate basic data;Number, the sun are direct when to understand the spatial distribution characteristic of sunshine time in depth, calculating actual sunshine Radiation, scattering radiation and reflected radiation provide basic data;For accurate, scientifically calculating assessment solar energy resources provide basis Data provide foundation to large-scale develop and utilize renewable solar energy resources;Important sunshine is provided for fining agricultural production When number basic data, provide foundation for the planning in agricultural planting region, the assessment of agricultural resource;It is provided for engineering design important Basic data provides call parameter for architectural design, the engineering design of natural resources exploitation department;For the development of meteorology and climate Basic data is provided, provides new Research Thinking for the spatial simulation and Visualization of regional climate, there is important section Grind value and practical value.
Above-mentioned specific embodiment is only explained in detail technical solution of the present invention, the present invention not only only office It is limited to above-described embodiment, all any improvement or replacement according to the principle of the invention should all be within protection scope of the present invention.

Claims (8)

1. a kind of calculation method of the shining time per year based on BP neural network model, which comprises the following steps:
Step 1, training BP neural network model;
The digital elevation model image for calculating area is built into input matrix by step 2;
The input matrix is passed to BP neural network model by step 3, and output matrix is calculated;
The output matrix is converted into calculating the shining time per year numerical matrix in area by step 4.
2. the calculation method of the shining time per year as described in claim 1 based on BP neural network model, which is characterized in that institute Stating BP neural network model is five layer networks, is made of an input layer, three hidden layers, an output layer, the hidden layer Neuronal quantity be 15, the neuronal quantity of the output layer is 1;
The activation primitive formula of the hidden layer are as follows:
Wherein l=1,2,3;AlFor the output matrix of BP neural network l layers of hidden layer of model, Al-1For BP neural network model The input matrix of l layers of hidden layer, as l=1, A0=P, P are the input matrix of BP neural network mode input layer;WlAnd BlFor The weight matrix and threshold vector of l layers of hidden layer of BP neural network model;
The activation primitive formula of the output layer are as follows:
Y=purelin (X)=X
Wherein Y is the output matrix of BP neural network model output layer, and X is the input matrix of BP neural network model output layer.
3. the calculation method of the shining time per year as described in claim 1 based on BP neural network model, which is characterized in that institute State step 1 " training BP neural network model ", comprising the following steps:
Step 11 chooses training sample;
The digital elevation model image of the training sample is built into sample input numerical matrix by step 12;
Step 13, the shining time per year value for calculating the training sample corresponding area construct desired output matrix;
Step 14, the weight matrix and threshold vector for initializing each layer of BP neural network;
Sample input numerical matrix and the desired output matrix is normalized in step 15 respectively, protects simultaneously Deposit the maximum value and minimum value before desired output matrix normalization;
Step 16, the basic parameter threshold value of setting BP neural network training;
Sample input numerical matrix after normalization is passed to BP neural network model by step 17, calculates output matrix, then root Training objective error, the training objective error calculation formula are calculated according to the desired output matrix after normalization are as follows:
Wherein n is the quantity of training sample;K is 1 to the integer between n, τkFor k-th yuan of desired output matrix after normalization The value of element;okFor the value of k-th of element of output matrix of BP neural network model;
Step 18 judges whether the training objective error is less than the threshold value of setting, if the training objective error is less than setting Threshold value, then going to step 19 continues to execute;Otherwise, then to each layer weight matrix and threshold vector of BP neural network model After being modified, going to step 17 is continued to execute;
Step 19 saves each layer weight matrix of BP neural network model and threshold vector, completes BP neural network model construction.
4. the calculation method of the shining time per year as claimed in claim 3 based on BP neural network model, which is characterized in that institute State step 13 " calculating the shining time per year value of the training sample corresponding area, construct desired output matrix ", including following step It is rapid:
Step 131, by the digital elevation model video conversion of training sample corresponding area be numerical matrix;
Step 132, the practical shining time per year that training sample corresponding area is calculated according to mathematical model;
The practical shining time per year value of training sample corresponding area is built into desired output matrix by step 133.
5. the calculation method of the shining time per year as described in claim 1 based on BP neural network model, which is characterized in that institute State step 2 " the digital elevation model image for calculating area is built into input matrix ", comprising the following steps:
Step 21 obtains the digital elevation model image for calculating area, and pre-processes to digital elevation model image;
Step 22 extracts input numerical matrix from pre-processed results;
The input numerical matrix is normalized in step 23.
6. the calculation method of the shining time per year as claimed in claim 5 based on BP neural network model, which is characterized in that institute State step 21 " according to digital elevation model image construct numerical matrix ", specifically: by digital elevation model video conversion be number Value matrix fills the vacancy value in the numerical matrix, and the grid of digital elevation model image is numbered.
7. the calculation method of the shining time per year as claimed in claim 5 based on BP neural network model, which is characterized in that institute Step 22 " input numerical matrix is extracted from the numerical matrix " is stated, specifically:
Using the latitude and longitude coordinates of digital elevation model image center grid as the latitude and longitude value of each grid, then extract number The elevation of each grid, the gradient, aspect factor and grid four direction neighborhood grid (left, the right side in elevation model image Side, top, lower section) elevation, the gradient and aspect factor as column vector, form input matrix Inputm×nIt is as follows:
Wherein, m is the line number of input matrix, and n is the columns of input matrix, and i is 1 to the integer between m, and j is 1 between n Integer indicates the number of digital elevation model image grid, x1jAnd x2jThe longitude and latitude of respectively j-th grid, take the width The longitude and latitude of digital elevation model image center grid;x3j、x4j、x5jThe elevation of respectively j-th grid, the gradient, slope To;x6j、x7j、x8jElevation, the gradient, the slope aspect of respectively j-th grid left direction neighborhood grid;x9j、x10j、x11jRespectively jth Elevation, the gradient, the slope aspect of a grid right direction neighborhood grid;x12j、x13j、x14jDirection neighborhood grid on respectively j-th of grid Elevation, the gradient, slope aspect;x15j、x16j、x17jElevation, the gradient, the slope aspect of direction neighborhood grid under respectively j-th of grid.
8. the calculation method of the shining time per year as described in claim 1 based on BP neural network model, which is characterized in that institute State step 4 " being converted into the output matrix to calculate the shining time per year numerical matrix in area ", comprising the following steps:
Step 41 carries out anti-normalization processing to the output matrix, obtains uniline output matrix;
The uniline output matrix is reassembled into the shining time per year numerical matrix for calculating area by step 42.
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 true CN109409014A (en) 2019-03-01
CN109409014B 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)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
CN111247564A (en) * 2019-03-12 2020-06-05 深圳市大疆创新科技有限公司 Method for constructing digital earth surface model, processing equipment and system
CN111768039A (en) * 2020-07-01 2020-10-13 天津师范大学 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 (3)

* Cited by examiner, † Cited by third party
Title
JIANG YINGNI: "《Computation of monthly mean daily global solar radiation in China using artificial neural networks and comparison with other empirical models》", 《ENERGY》 *
李净等: "《利用LM-BP神经网络估算西北地区太阳辐射》", 《干旱区地理》 *
王小川等: "《《MATLAB神经网络43个案例分析》》", 31 August 2013 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111247564A (en) * 2019-03-12 2020-06-05 深圳市大疆创新科技有限公司 Method for constructing digital earth surface model, processing equipment 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
CN111768039A (en) * 2020-07-01 2020-10-13 天津师范大学 Animal home domain estimation method based on active learning
CN111768039B (en) * 2020-07-01 2022-03-18 天津师范大学 Animal home domain estimation method based on active learning

Also Published As

Publication number Publication date
CN109409014B (en) 2021-05-04

Similar Documents

Publication Publication Date Title
CN113297528B (en) NO based on multi-source big data2High-resolution space-time distribution calculation method
CN109409014A (en) The calculation method of shining time per year based on BP neural network model
WO2018145229A1 (en) Accurate large-area inversion method for near-surface air temperature
Zeng et al. Coupling of the common land model to the NCAR community climate model
Effat Selection of potential sites for solar energy farms in Ismailia Governorate, Egypt using SRTM and multicriteria analysis
Linares-Rodríguez et al. Generation of synthetic daily global solar radiation data based on ERA-Interim reanalysis and artificial neural networks
CN108268735A (en) Soil moisture NO emissions reduction method based on multi-source remote sensing satellite fused data
Yu et al. Investigating impacts of urban morphology on spatio-temporal variations of solar radiation with airborne LIDAR data and a solar flux model: a case study of downtown Houston
CN103728609B (en) Satellite-borne multispectral infrared sensor cross-radiometric calibration method
Waewsak et al. High resolution wind atlas for Nakhon Si Thammarat and Songkhla provinces, Thailand
CN105912836A (en) Pure remote sensing data driven drainage basin water circulation simulation method
CN104408258A (en) Large-scale soil organic carbon spatial distribution simulation method involving environmental factors
CN104657935B (en) A kind of temperature inversion method near the ground
Liu et al. Development and validation of a physically-based, national-scale hydrological model in China
Siebert et al. Climate and irrigation water use of a mountain oasis in northern Oman
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
Varentsov et al. High-resolution temperature mapping by geostatistical kriging with external drift from large-eddy simulations
CN116628978A (en) Method for determining drought vulnerability curve of meshed crop based on improved moisture sensitivity
Bai et al. Predicting soil conservation service in the Jinghe River Basin under climate change
Wang et al. Monitoring the effects of land use and cover changes on net primary production: A case study in China's Yongding River basin
Wang et al. Estimation of hourly actual evapotranspiration over the Tibetan Plateau from multi-source data
Jaw et al. Evaluation for Moroccan dynamically downscaled precipitation from GCM CHAM5 and its regional hydrologic response
Pan et al. Urban expansion and intra-urban land evolution as well as their natural environmental constraints in arid/semiarid regions of China from 2000–2018
CN109635239A (en) A kind of year astronomy amount of radiation calculation method based on BP neural network model

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