CN108614601B - Facility light environment regulation and control method fused with random forest algorithm - Google Patents

Facility light environment regulation and control method fused with random forest algorithm Download PDF

Info

Publication number
CN108614601B
CN108614601B CN201810304729.6A CN201810304729A CN108614601B CN 108614601 B CN108614601 B CN 108614601B CN 201810304729 A CN201810304729 A CN 201810304729A CN 108614601 B CN108614601 B CN 108614601B
Authority
CN
China
Prior art keywords
model
light
algorithm
regulation
random forest
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
CN201810304729.6A
Other languages
Chinese (zh)
Other versions
CN108614601A (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.)
Northwest A&F University
Original Assignee
Northwest A&F 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 Northwest A&F University filed Critical Northwest A&F University
Priority to CN201810304729.6A priority Critical patent/CN108614601B/en
Publication of CN108614601A publication Critical patent/CN108614601A/en
Application granted granted Critical
Publication of CN108614601B publication Critical patent/CN108614601B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05DSYSTEMS FOR CONTROLLING OR REGULATING NON-ELECTRIC VARIABLES
    • G05D25/00Control of light, e.g. intensity, colour or phase
    • G05D25/02Control of light, e.g. intensity, colour or phase characterised by the use of electric means

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Automation & Control Theory (AREA)
  • Circuit Arrangement For Electric Light Sources In General (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention relates to a facility light environment regulation and control method fused with a random forest algorithm, which is used for solving the problems of low fitting degree, complex fitting formula and the like of the current commonly used photosynthetic rate model (multivariate regression, linear fitting and the like), and establishing a photosynthesis regulation and control model fused with the random forest algorithm by adopting a photosynthetic rate model optimizing method for improving a fish swarm algorithm; aiming at the problems that a traditional embedded light environment control system cannot directly load an intelligent algorithm model, the reliability of equipment is low, the system response is slow and the like, a raspberry dispatching system frame and a platform system capable of realizing algorithm transplantation are designed, the equipment mainly comprises a raspberry dispatching main control node, a sensor monitoring node and an LED dimming node, and information interaction is realized among the nodes through a ZigBee wireless technology; the method effectively overcomes the defects of a light supplementing system in the traditional facility agriculture, and has the advantages of good algorithm portability, quick response of the light supplementing process, high equipment reliability, convenience in system upgrading and the like in the regulation and control of the facility light environment.

Description

Facility light environment regulation and control method fused with random forest algorithm
Technical Field
The invention belongs to the technical field of intelligent facility agriculture, and particularly relates to a facility light environment regulation and control method fusing a random forest algorithm.
Background
The protected vegetable cultivation area in China accounts for more than 90% of the total area of the world, and becomes an important component of modern agriculture in China. Although the technical level of facility management in China is improved year by year, a large gap still exists compared with developed countries, the yield of the facility vegetables per unit area is only 1/5-1/3 in the Netherlands, and low photosynthetic rate in the production process is a key factor causing the phenomenon. Light is an energy source for photosynthesis of greenhouse crops to form temperature and humidity conditions in the greenhouse. In some areas, due to low-temperature and weak light in winter and spring seasons and heavy rainy and low-temperature weather, and the unclean or aging of greenhouse covering materials, the light transmittance is low, the light environment parameters (including light quality and photon flux density) in facilities are usually lower than the minimum requirement of photosynthesis, so that the growth and development of crops are slowed down, the probability of occurrence of various plant diseases and insect pests is increased, the problems of leaf drop, small amount of flowering, irregular flower shape and color, low fruit setting rate and the like are caused, the yield and the quality of the crops are seriously influenced, particularly the LED light source technology which appears recently, the problems of traditional light supplement equipment such as high heat, large energy consumption, incapability of quantitatively adjusting brightness, difficulty in adjusting and controlling light quality and photon flux density and the like are avoided to a certain degree, the LED-based facility light supplement technology becomes a hotspot of facility light supplement research, various LED-based facility light supplement equipment appears, and the crop quality and the energy-saving effect are improved to a certain degree.
In recent years, facility light environment regulation and control are widely researched, a photosynthetic factor regulation and control model is fused, most of the regulation and control models are obtained by constructing dynamic acquisition of light saturation points at any temperature by taking the temperature of the environment as an independent variable and the light saturation points output in a photosynthetic rate model as a dependent variable through a nonlinear regression method, and thus, corresponding PFD values are obtained; after the carbon dioxide factor is added into the actual model, the precision of the model is reduced, the complexity is obviously improved, the running time of the model is prolonged, and finally the response of the whole light regulation and control system is slow and the precision of a regulation and control value is low, so that the influence of the carbon dioxide on the final light saturation point is not considered in the conventional general regulation and control system; in conclusion, the existing facility light environment regulation and control is embedded into a control system through a formula with good model fitting, so that the problems of low algorithm adaptability, poor model transportability, inaccurate regulation and control process, low equipment response speed and the like are solved. Therefore, finding an intelligent algorithm with high regulation and control precision and low complexity becomes a key for solving the problem; compared with other algorithms, the random forest algorithm does not need to set a function form in advance, can overcome complex interaction among covariates, can process high-dimensional data, is short in data processing time and high in predictability, is mainly applied to the fields of computer vision, medicine, ecology and the like at present, is introduced into facility light environment regulation and control, and designs facility light environment regulation and control equipment fused with the random forest algorithm so as to solve the problems of poor transportability, low reliability of the equipment, slow system response, high energy consumption and the like of the conventional facility light environment regulation and control system.
Disclosure of Invention
In order to overcome the defects of the prior art, the invention aims to provide a facility light environment regulation and control method fused with a random forest algorithm, so as to solve the problems of poor portability, low equipment reliability, slow system response, high energy consumption and the like of the conventional facility light environment regulation and control system.
In order to achieve the purpose, the invention adopts the technical scheme that:
a facility light environment regulation and control method fused with a random forest algorithm comprises the following steps:
the method comprises the following steps: according to the influence of the change of light, carbon dioxide and temperature on the plant photosynthetic rate in the plant growth process and the environmental factors of associated temperature, illumination and carbon dioxide concentration, a photosynthetic rate prediction model is established by using a BP algorithm, and then an improved fish swarm algorithm is adopted to optimize the photosynthetic rate model;
step two: finding light saturation points under different temperatures and carbon dioxide conditions by the optimization algorithm in the step one, establishing a light environment regulation and control model fused with a random forest algorithm, and gathering a large number of classification trees by selecting a random characteristic strategy to improve the prediction precision of the random forest model;
step three: the method comprises the steps that a raspberry group system frame and a platform system capable of achieving model transplantation are built, cross-platform transplantation of an intelligent regulation and control algorithm is achieved in the regulation and control process, the hardware structure of equipment mainly comprises a raspberry group main control node, a sensor monitoring node and an LED dimming node, information interaction is achieved among the nodes through a ZigBee wireless technology, and a modular design idea is adopted inside;
step four: after the model establishment and the cross-platform transplantation of the intelligent algorithm in the steps are completed, in the actual regulation process, the basic parameters of a controlled object are selected through a parameter selection interface, the environment condition is fed back by monitoring nodes in real time, the stored random forest model is directly called, the target value of the light environment regulation and control at the moment can be calculated by seeing the model in the interface, the photon flux density value actually required by the current environment is calculated by comparing with the input illumination intensity of the environment, the photon flux density value is converted into a pulse width modulation control signal, and the LED light supplementing node is controlled to complete dynamic and accurate regulation and control according to the actual light environment.
In the first step, the specific steps of constructing the photosynthetic rate prediction model and the optimization model are as follows:
step 1: according to the regulation model experiment scheme, a photosynthetic rate prediction model is established by using a BP algorithm, and a BP neural network model is established by taking temperature, carbon dioxide and illumination environment factor normalization processing as an input sample set of the model:
Figure BDA0001620611400000031
where n represents the number of input nodes, l represents the number of hidden layer nodes, m represents the number of output nodes, x represents the input quantity, wijRepresenting the connection weight, w, between the input layer and the hidden layerjkRepresenting the connection weight between the hidden layer and the output layer, ajIndicating initialization of hidden layer thresholds, bkRepresenting the initialized output layer threshold, f () representing the hidden layer excitation function; establishing a BP photosynthetic rate prediction model: pnNet (T, C, D) formula wherein PnRepresenting photosynthetic rate, T temperature, C carbon dioxide concentration, D photon flux density, completing the model P from the input samplenInstantiation of net (T, C, D) temperature, carbon dioxide and photon flux density, establishing prediction function P under different conditions of temperature, carbon dioxide and photon flux densitym=net(Tm,Cm,Dm);
Step 2: after the BP photosynthetic rate prediction model in the step one is established, optimizing the photosynthetic rate model by adopting an improved fish swarm algorithm, randomly generating an initial fish swarm, and expressing the state vector of the generated initial fish swarm individual as X ═ X (X)1,x2,…xn) Wherein x isnFor the corresponding light saturation points of the variables to be optimized under different temperature and dioxide concentration conditions, and utilizing the obtained optimization target value function F under specific temperature and carbon dioxide conditionsmThe positions of the artificial fishes are continuously updated through the processing of foraging behaviors, social behaviors and rear-end collisions in the fish swarm algorithm,therefore, the individual food concentration in the new fish school is continuously improved, the optimal photosynthetic rate of the crop in the current generation is gradually increased along with the increase of the evolution algebra, and when the artificial fish school algorithm generates a new individual approaching to the optimal solution, the individual food concentration is basically kept constant, so that the photosynthetic rate optimization is completed.
In the second step, the light regulation and control model fusing the random forest algorithm specifically comprises the following steps:
the method comprises the following steps: let X { (X)m,ym) M is 1,2, M is a light saturation point sample set which is obtained by optimizing an improved fish school algorithm under different temperature and dioxygen concentration conditions and is used as a group of training sets of a light environment optimization regulation model, wherein X ismIs the temperature and carbon dioxide concentration, y, corresponding to the mth light saturation pointmIs the mth light saturation point sample data; generating L decision trees f (X, theta) by randomly sampling the set of optimized samples Xk) Assembling and constructing a random forest, wherein k is 1,2kIs the random vector used by the kth decision tree to select sample points;
step two: randomly generating theta by Bootstrap sampling methodkRandomly drawing 2/3 training sample points to generate a kth decision tree, a random vector thetakAre independent of each other and are distributed uniformly;
Figure BDA0001620611400000041
in the formula
Figure BDA0001620611400000042
Indicating that each decision tree produces a photon flux density value corresponding to a predicted light saturation point,
Figure BDA0001620611400000043
and the photon flux density value corresponding to the light saturation point representing the random forest prediction is obtained by averaging the predicted values of all decision trees.
After a light regulation and control model fused with a random forest algorithm is established, in order to modify the model and improve the prediction precision of the random forest, a random characteristic selection strategy is adopted: at each of each decision treeAt the node, randomly extracting N optical saturation point variables from the N total input optical saturation point variables, selecting an optimal optical saturation point variable from the N optical saturation point variables to segment the node, increasing or decreasing the value of N until the minimum test error is obtained, and outputting the final output photon flux density value at the moment
Figure BDA0001620611400000044
The method is an optimal regulation value, wherein N is less than or equal to N, so that the final regulation model has higher precision.
In the third step, the specific steps of the raspberry dispatching system framework and the intelligent algorithm transplantation are as follows:
step 1: the system controller adopts a raspberry group 3 generation B type, carries a Linux operating system, completes the development of an equipment interface on Qt, adopts a 7inch HDMI LCD touch display screen, is convenient for man-machine interaction, thereby building a raspberry group system frame and a platform system which can realize model transplantation, and realizing real-time accurate calculation and intelligent feedback control on a regulation target value of a fusion random forest light environment regulation model on an embedded platform;
step 2: after the random forest model is constructed, the random forest model is stored and output through a model variable, the variable is stored into a txt file or other file forms, the variable in the program is stored into a local file by using a pick.dump () function in a pick module of python, the storage work of the model is completed, the pick.load () function in the pick module of python is imported into the corresponding position of the program from the local file, the loading of the model is realized, the model can be exported only by loading the model on the corresponding path in the model transplanting process, and the cross-platform light control model transplanting is completed;
and step 3: the hardware structure of the equipment mainly comprises a raspberry group main control node, a sensor monitoring node and an LED dimming node, information interaction is realized among the nodes through a ZigBee wireless technology, and a modular design idea is adopted inside the equipment; each node adopts CC2530 as a core processing module, realizes Wireless Sensor Network (WSN) ad hoc network and management function based on the ZigBee protocol, the sensor monitoring node is used as a router in the ZigBee network to realize data forwarding among different greenhouse nodes, the raspberry group control node sends a main control program to the LED dimming node in a broadcasting mode through a coordinator, and the LED dimming node receives an LED control signal sent by the central control node by utilizing the CC 2530.
After the construction of a raspberry group system framework and the transplantation of an intelligent algorithm are completed, crop selection and light supplement stages are determined on an equipment parameter setting interface, a random forest model embedded into the system is loaded on a corresponding path of a raspberry group, environmental factors monitored by a sensor are used as input of the model, at the moment, the random forest algorithm gathers a large number of classification trees, photon flux density values corresponding to light saturation points of the model are obtained by averaging predicted values of all decision trees, and photosynthetically active radiation values are monitored according to sensor monitoring nodes in an actual environment to perform difference value calculation regulation.
And step four, in the actual regulation and control process, selecting basic parameters of a controlled object through a parameter selection interface, directly calling a stored random forest model, periodically monitoring the photosynthetically active radiation value by using a sensor monitoring node, calculating the current red and blue light quantum flux density by using the proportional relation between the solar altitude angle and the red and blue light in natural light, sending the current red and blue light quantum flux density to a raspberry dispatching main control node, calculating the difference value between the current red and blue light quantum flux density and the target quantity required by crops by using the main control node, converting the difference value into a pulse width modulation control signal, and controlling the LED dimming node to control the LED output brightness through the ZigBee control LED dimming node, so that the dynamic, accurate and wireless regulation and control of the output light quantity of the LED light supplementing lamp.
Compared with the prior art, the invention has the beneficial effects that:
1) the facility light environment regulation and control equipment is fused with a random forest algorithm to dynamically calculate the light regulation and control target value, compared with the traditional multiple linear regression model or the parameter regression model, the random forest algorithm does not need to set a function form in advance, and can overcome the complex interaction among covariates, has higher classification accuracy, improves the model prediction accuracy by gathering a large number of classification trees, has high tolerance on abnormal values and noise, is not easy to generate overfitting phenomenon, has longer exponential multiplication compared with the complexity of an SVM model based on an RBF kernel function along with the increase of the sample size, the time complexity thereof also becomes larger along with the increase of the training set sample base, and the random forest algorithm has the advantages of simple operation, short data processing time, high response speed and the like, therefore, the accuracy of the regulation and control system is effectively improved, and the requirement of the system on a hardware system is reduced.
2) In order to realize smooth transplantation of an intelligent control algorithm of a random forest light environment control model, the facility light environment control equipment designs a new raspberry dispatching system frame and a platform system, and compared with the traditional embedded light environment control system which cannot directly load the intelligent algorithm model, the system can store and output the intelligent algorithm model through model variables after the random forest model is constructed; in the model transplanting process, the model can be derived only by loading the model on a corresponding path, and the cross-platform light control model transplanting is completed, so that the regulation target value of the random forest light environment regulation and control model is fused on the embedded platform to carry out real-time accurate calculation and intelligent feedback control.
Drawings
FIG. 1 is an overall view of the light environment control of the facility system of the present invention.
Fig. 2 is a flow chart of the improved fish swarm algorithm of the present invention.
FIG. 3 is a schematic diagram of a structural framework of the random forest learning algorithm model of the present invention.
FIG. 4 is a graph of the output of the control target value of the random forest model of the present invention.
FIG. 5 is a model validation graph of the random forest algorithm of the present invention.
Fig. 6 is a schematic diagram of the hardware structure of the system of the present invention.
FIG. 7 is a diagram of a model migration interface in accordance with the present invention.
FIG. 8 is a diagram of a light-modulating display interface of the system of the present invention.
Detailed Description
The embodiments of the present invention will be described in detail below with reference to the drawings and examples.
The invention mainly comprises the following steps:
the method comprises the following steps: according to the influence of the changes of light, carbon dioxide and temperature on the plant photosynthetic rate in the plant growth process and the correlation of environmental factors of temperature, illumination and carbon dioxide concentration, a photosynthetic rate prediction model is established by using a BP algorithm, an improved fish swarm algorithm is adopted to optimize the photosynthetic rate model, light saturation points under different temperatures and carbon dioxide conditions are found, and a photosynthesis regulation and control model fused with a random forest algorithm is established.
Step two: a Wireless Sensor Network (WSN) with the advantages of ad hoc network, low energy consumption, easiness in management and the like is adopted to deploy whole facility light environment regulation and control equipment, a novel raspberry dispatching system frame and a platform system are designed, equipment hardware is composed of raspberry dispatching control nodes, sensor monitoring nodes and LED light dimming nodes, each node adopts CC2530 as a core processing module, and the Wireless Sensor Network (WSN) ad hoc network and information transmission are achieved based on a ZigBee protocol. The raspberry group control node has management functions of gathering real-time environment information, calculating light supplement amount, issuing a light supplement command, setting system parameters and the like, sends a main control program to the light supplement node in a broadcasting mode through a coordinator, and receives environment factor information sent by the sensor monitoring node; the sensor nodes finish the acquisition, processing and transmission of environmental factors, and are used as routers in the ZigBee network to realize data forwarding among different greenhouse nodes; the LED dimming node receives an LED control signal sent by the central control node by using the CC2530, converts the LED control signal into a corresponding PWM signal, and controls the LED output current through the LED driving chip to realize the purpose that the dimming lamp group outputs illuminance as required.
Step three: in the actual facility light environment regulation, a user enters a model import interface, selects a corresponding light supplement crop, loads a required model, and completes cross-platform transplantation of the model, wherein the model takes the temperature, carbon dioxide and illumination intensity of the environment as input, the model can be seen in the interface to calculate the target value of the light environment regulation at the moment, and the target value is compared with the input illumination intensity of the environment; and obtaining a value required in the environment of the model at the moment, and sending an instruction to the LED light supplement node through the raspberry sending main control node to complete dynamic light supplement for the tomatoes.
The following is a specific experimental protocol for the control model
The test for tomato seedlings was carried out in the laboratory incubator in the northern school district of agriculture and forestry technology university in northwest in 2017, 9 months to 2017, 10 months. The Li-6800 type portable photosynthetic apparatus produced by LI-COR company is adopted in the experiment, and the net photosynthetic rate can be measured while setting and regulating the small environment of a leaf chamber; adopt illumination, temperature, carbon dioxide coupling nested test mode to obtain the photosynthetic rate to the tomato seedling under different gradient temperature, illumination, carbon dioxide condition, carry out gross error analysis and filtering, secondly carry out the preliminary treatment to the data after the gross error of filtering to form the photosynthetic rate sample set that corresponds under the required different temperature of modeling, illumination, carbon dioxide combination condition, wherein control carbon dioxide concentration gradient is respectively: 400, 0,200, 400, 800, 1200 and 1600, and the control temperature is as follows: 14, 17, 20, 23, 16, 30 and 33, controlling the illumination intensity as follows: 1500,1300,1200,1100,900,700,500,300,200,100,50,20,0, ten gradients; and (3) carrying out 60 groups of experiments, randomly selecting 7 eggplant plants in each group of experiments, measuring each eggplant plant for 5 times, taking an average value, repeating the three groups to finally form a test sample set with the sample capacity of 350, and finally obtaining test samples with the sample number of 314 after data analysis and processing.
Based on the experimental scheme, the steps of establishing the photosynthetic rate prediction model by using the BP algorithm are as follows:
the method comprises the following steps: the data is preprocessed, the magnitude order difference of each variable in the facility environment is large, in order to enable the model calculation to be more effective, the original input variable is subjected to normalized processing and converted into a dimensionless variable, a normalized processing formula is shown as follows, and all the processed input variables are subjected to distribution with the mean value of 0 and the variance of 1.
Figure BDA0001620611400000081
Wherein the content of the first and second substances,
Figure BDA0001620611400000084
an input variable for the normalized jth temperature;
Figure BDA0001620611400000082
Sjthe mean value and the sample variance of the initial input variables of the jth original temperature are respectively, and the normalized vector X is equal to (X)1,x2,…xn) Is the input of the photosynthetic rate model.
Step two: the BP neural network model established by using the processed data is as follows:
Figure BDA0001620611400000083
where n represents the number of input nodes, l represents the number of hidden layer nodes, m represents the number of output nodes, x represents the input quantity, wijRepresenting the connection weight, w, between the input layer and the hidden layerjkRepresenting the connection weight between the hidden layer and the output layer, ajIndicating initialization of hidden layer thresholds, bkRepresenting the initialized output layer threshold, f () representing the hidden layer excitation function.
The established BP photosynthetic rate prediction model formula is as follows:
Pn=net(T,C,D)
in the formula PnRepresents the photosynthetic rate in units of [ mu ] mol/(m)2S), net () representing the BP neural network model, T representing temperature, C representing carbon dioxide concentration, D representing photon flux density, model P being completed from the predicted samplesnInstantiation of net (T, C, D) temperature, carbon dioxide and photon flux density, establishing prediction function P under different conditions of temperature, carbon dioxide and photon flux densitym=net(Tm,Cm,Dm)。
Based on the BP algorithm photosynthetic rate prediction model, the temperature and carbon dioxide coupling photosynthetic rate model optimization steps of the improved fish swarm algorithm are as follows:
the method comprises the following steps: the flow chart of the improved fish swarm algorithm is shown in fig. 2, wherein an initial fish swarm is randomly generated, and the generated state vector of an initial fish swarm individual is represented as X ═ (X ═ X)1,x2,…xn) Wherein x isnThe corresponding light saturation points under different temperature and dioxygen concentration conditions of the variables to be optimized are obtainedUsing the obtained optimized target function F under specific temperature and carbon dioxide conditionsmAs the food concentration Y under specific temperature and carbon dioxide conditions, thereby utilizing Ym=FmAnd calculating the food concentration to finish evaluation, and when the fish school evaluation does not meet the stop condition, continuing optimizing operation through the improved fish school by using the dynamic adjustment formula of the core visual field and the step length of the improved fish school algorithm as follows.
Figure BDA0001620611400000091
Wherein v represents the field of view of the artificial fish in the present search, stThe step length v of the artificial fish movement is searchedi-1Indicating the field of view, s, of the artificial fish from the previous searcht,i-1Indicating the field of view of the artificial fish searched for the previous time, a indicating the adjustment factor, vminMinimum variation s of visual field rangetminIndicating the minimum amount of change in step size.
Step two: through the calculation of the third step, the foraging behavior is calculated as follows: recording the current state of the artificial fish as xiRandomly selecting a state x within the sensing rangejI.e. by
xj=xi+(2r-1)st
Wherein r is a random number, and the food concentration of the state of the artificial fish satisfies Yj>Yi,Yj、Yi,xi++Location update as
Figure BDA0001620611400000092
Step three: through the calculation of the third step, the calculation of the clustering behavior is as follows: the artificial fish moves toward the center of the partner, if the food concentration at the center of the artificial fish school is YcCurrent food concentration of YiNumber of buddies n in current viewfIf it is satisfied
Figure BDA0001620611400000101
Where σ is the degree of crowding,thereby limiting the scale of artificial fish herd aggregation, executing the clustering behavior, and the calculation formula is
Figure BDA0001620611400000102
Step four: through the calculation of the step three, the rear-end collision behavior is calculated as follows: the artificial fish moves towards the optimal position partner direction, and if the current optimal position food concentration Y of the artificial fish school isbestWith the current food concentration YiSatisfy the requirement of
Figure BDA0001620611400000103
When the vehicle is running, the rear-end collision behavior is executed, and the calculation formula is
Figure BDA0001620611400000104
Step five: the positions of the artificial fishes are continuously updated by processing foraging behaviors, social behaviors and rear-end collision behaviors in the fish swarm algorithm, so that the individual food concentration in a new fish swarm is continuously improved, and the optimal photosynthetic rate of the tomato generation is gradually increased along with the increase of evolution algebra; and the artificial fish swarm algorithm is increased along with the evolution algebra, when a new individual approaches to an optimal solution, the individual food concentration is basically kept constant, and therefore the photosynthetic rate optimization is completed.
Optimizing a temperature and carbon dioxide coupled photosynthetic rate model based on the improved fish swarm algorithm, and establishing a regulation and control model fusing a random forest algorithm, wherein the steps of the regulation and control model are as follows:
the method comprises the following steps: let X { (X)m,ym) M is 1,2, M is a light saturation point sample set which is obtained by optimizing an improved fish school algorithm under different temperature and dioxygen concentration conditions and is used as a group of training sets of a light environment optimization regulation model, wherein X ismIs the temperature and carbon dioxide concentration, y, corresponding to the mth light saturation pointmIs the mth light saturation point sample data; generating L decision trees f (X, theta) by randomly sampling the set of optimized samples Xk) And (6) collecting and constructing a random forest. Wherein k is 1,2kIs a random vector used by the kth decision tree to select sample points, and randomly generates theta through a Bootstrap sampling methodkRandomly drawing 2/3 training sample points to generate a kth decision tree, a random vector thetakAre independent of each other and are distributed uniformly;
Figure BDA0001620611400000111
in the formula
Figure BDA0001620611400000112
Indicating that each decision tree produces a PFD corresponding to a predicted light saturation point,
Figure BDA0001620611400000113
and the PFD value corresponding to the light saturation point representing the random forest prediction is obtained by averaging the predicted values of all decision trees.
Step two: FIG. 3 is a schematic diagram of a structural framework of a random forest learning algorithm model, in order to improve the prediction accuracy of a random forest, a random feature selection strategy is adopted, in which firstly, at each node of each decision tree, N (N is less than or equal to N) light saturation point variables are randomly extracted from N total input light saturation point variables, and an optimal light saturation point variable is selected from the N total input light saturation point variables to segment the node; then increase or decrease the value of n until the minimum test error is obtained, at which time the final output PFD value is output
Figure BDA0001620611400000114
Is the optimal regulation value.
Step three: FIG. 4 is a graph of the output of a control target value of a random forest model, and the verification model needs to pass through a proper evaluation index, wherein the goodness of fit R2The fitting degree of the regression model to the sample data can be checked, the value is between 0 and 1, and the higher the fitting goodness is, the higher the interpretable degree of the representative model is; the root mean square error RMSE can reflect the discrete degree of a sample, the value is an integer larger than 0, the lower the value is, the higher the precision is, but the size of the error is influenced by the size of a predicted value; the value of the precision P is between 0 and 1, and the higher the precision is, the higher the prediction accuracy is; FIG. 5 is the present inventionAnd (5) a model verification diagram of the bright random forest algorithm.
Based on the establishment of the regulation and control model, the hardware structure of the device is shown in fig. 6, and the structure of each part is as follows:
the hardware structure of the device mainly comprises a raspberry group main control node, a sensor monitoring node and an LED dimming node, wherein the raspberry group main control node controls the whole device, information interaction is realized among the nodes through a ZigBee wireless technology, and a modular design idea is adopted inside the device.
The raspberry master control node sends a master control program to the LED dimming node in a broadcasting mode through the coordinator, and receives environmental factor information sent by the sensor monitoring node; the receiving and sending program has management functions of gathering real-time environment information, calculating the light supplement amount, issuing a light supplement command, setting system parameters and the like, and the user interaction module adopts a 7inch HDMI LCD display screen with the ultra-clear resolution being 1024X600, supports touch operation and facilitates man-machine interaction.
The sensor monitoring node sends factors in a facility environment to the main control node in real time through the ZigBee by installing the temperature sensor, the illumination sensor and the carbon dioxide sensor, and the sensor monitoring node is regularly calibrated in order to guarantee the data validity of the sensor.
The LED dimming node adopts an array type light supplementing lamp group, blue light with the central wavelength of 450nm and red light with the central wavelength of 680nm are selected as dimming light sources, the red/blue ratio is set to be 3:2, a control signal sent by the intelligent regulation node is received by CC2530 and converted into a PWM control signal corresponding to the red and blue light, the PWM regulation mechanism is that a PT4115LED integrated driving chip is adopted, different PWM duty ratio signals are loaded at a control end, and the current of the output end of the driving chip is linearly changed, so that the current flowing through the LED is changed, and the quantitative control of the brightness of the LED is realized.
Based on the hardware design of the system equipment, the detailed steps of the specific embodiment of the invention are as follows:
the method comprises the following steps: training a model, namely training a random forest tool kit in a Python scimit-learn algorithm, training a random forest model by using a random forest tool kit class, and setting corresponding parameters according to the requirement of the random forest tool kit class on an expected model; preprocessing data to obtain attributes, labels and attribute names, storing the attributes, labels and attribute names into a list, converting the list into a numpy array form, constructing a training set and a test set by using train _ test _ split of sklern, displaying the performance change process of the integrated method when the number of decisions in the integrated method changes by using a performance curve, initializing a random forest tester object, calling a fit () method, using the training data set as an input parameter, calling a predict () method to predict, inputting the attribute of the test data set, comparing a predicted value with the label in the test data, calculating a predicted mean square error by using a mean _ squared _ error function of sklern. metrics, and finally storing the trained model.
Step two: outputting a model variable; because the trained model outputs a variable, the variable needs to be saved into a txt file or other files, because some programs later use the important file and store the important file locally, the local file is read and imported into a dictionary type when the program is called next time, the program can be accessed as long as the program is called, and the readability of the code is high; the variables in the program are stored to the local file using the pick.dump () function in the pick module of python.
Step three: model loading as shown in fig. 7, in order to improve the portability of the algorithm, a loading and transplanting interface of the model is provided in the device, and the function is realized by establishing a step two basis, saving the model variable output obtained in the step one, and then importing the model variable output into a corresponding position of a program from a local file by using a pick.
Step four: the system light control display interface of the device is shown in fig. 8, in actual facility light environment control, the sensor monitoring node displays the collected environment factors on the touch screen in real time, so that a user can look up the environment factors at the moment and the environment factors are used as input variables of a control model, the system loads the model through a corresponding path where the model is located at the moment and can derive the model, cross-platform light control model transplantation is completed, and photon flux density values required by the current environment are calculated through a constructed random forest model.
Step five: the sensor monitoring node monitors the photosynthetically active radiation value periodically, the current red and blue light quantum flux density is calculated by utilizing the proportional relation between the solar altitude angle and the red and blue light in natural light, the current red and blue light quantum flux density is transmitted to the raspberry sending main control node, the difference between the current red and blue light quantum flux density and the target quantity required by crops is calculated by utilizing the main control node and converted into a pulse width modulation control signal, then the LED dimming node is controlled by the ZigBee to control the LED output brightness, and the dynamic, accurate and wireless regulation and control of the output light quantity of the LED light supplementing lamp are realized.

Claims (3)

1. A facility light environment regulation and control method fused with a random forest algorithm is characterized by comprising the following steps:
the method comprises the following steps: according to the influence of the change of light, carbon dioxide and temperature on the plant photosynthetic rate in the plant growth process and the environmental factors of associated temperature, illumination and carbon dioxide concentration, a photosynthetic rate prediction model is established by using a BP algorithm, and then an improved fish swarm algorithm is adopted to optimize the photosynthetic rate model;
the specific steps of the construction of the photosynthetic rate prediction model and the optimization model are as follows:
step 1: according to the regulation model experiment scheme, a photosynthetic rate prediction model is established by using a BP algorithm, and a BP neural network model is established by taking temperature, carbon dioxide and illumination environment factor normalization processing as an input sample set of the model:
Figure FDA0002963925810000011
where n represents the number of input nodes, l represents the number of hidden layer nodes, m represents the number of output nodes, x represents the input quantity, wijRepresenting the connection weight, w, between the input layer and the hidden layerjkRepresenting the connection weight between the hidden layer and the output layer, ajIndicating initialization of hidden layer thresholds, bkRepresenting the initialized output layer threshold, f () representing the hidden layer excitation function; establishing a BP photosynthetic rate prediction model: pnNet (T, C, D) formula wherein PnRepresenting photosynthetic rate, T representing temperature, C representing photosynthetic rateCarbon dioxide concentration, D represents photon flux density, model P is completed from input samplenInstantiation of net (T, C, D) temperature, carbon dioxide and photon flux density, establishing prediction function P under different conditions of temperature, carbon dioxide and photon flux densitym=net(Tm,Cm,Dm);
Step 2: after the BP photosynthetic rate prediction model in the step one is established, optimizing the photosynthetic rate model by adopting an improved fish swarm algorithm, randomly generating an initial fish swarm, and expressing the state vector of the generated initial fish swarm individual as X ═ X (X)1,x2,…xn) Wherein x isnFor the corresponding light saturation points of the variables to be optimized under different temperature and dioxide concentration conditions, and utilizing the obtained optimization target value function F under specific temperature and carbon dioxide conditionsmThe positions of the artificial fishes are continuously updated by processing foraging behaviors, social behaviors and rear-end collision behaviors in the fish swarm algorithm, so that the individual food concentration in a new fish swarm is continuously improved, the optimal photosynthetic rate of crops in the current generation is gradually increased along with the increase of evolution algebra, and when a new individual generated by the artificial fish swarm algorithm approaches to an optimal solution, the individual food concentration is basically kept constant, so that the photosynthetic rate optimization is completed;
step two: finding light saturation points under different temperatures and carbon dioxide conditions by the optimization algorithm in the step one, establishing a light environment regulation and control model fused with a random forest algorithm, and gathering a large number of classification trees by selecting a random characteristic strategy to improve the prediction precision of the random forest model;
step three: the method comprises the steps that a raspberry group system frame and a platform system capable of realizing model transplantation are built, cross-platform transplantation of an intelligent regulation and control algorithm is realized in a regulation and control process, a hardware structure of equipment of the equipment consists of a raspberry group main control node, a sensor monitoring node and an LED dimming node, information interaction is realized among the nodes through a ZigBee wireless technology, and a modular design idea is adopted inside the equipment;
the specific steps of the raspberry pi system framework and the intelligent algorithm transplantation are as follows:
step 1: the system controller adopts a raspberry group 3 generation B type, carries a Linux operating system, completes the development of an equipment interface on Qt, adopts a 7inch HDMI LCD touch display screen, is convenient for man-machine interaction, thereby building a raspberry group system frame and a platform system which can realize model transplantation, and realizing real-time accurate calculation and intelligent feedback control on a regulation target value of a fusion random forest light environment regulation model on an embedded platform;
step 2: after the random forest model is constructed, the random forest model is saved and output through a model variable, the variable is saved as a txt file, the variable in the program is stored into a local file by using a pick.dump () function in a pick module of python, the storage work of the model is completed, the pick.load () function in the pick module of python is imported into the corresponding position of the program from the local file, the loading of the model is realized, the model can be exported only by loading the model on the corresponding path in the model transplanting process, and the cross-platform light control model transplanting is completed;
and step 3: each node adopts CC2530 as a core processing module, Wireless Sensor Network (WSN) ad hoc network and management functions are realized based on a ZigBee protocol, the sensor monitoring nodes serve as routers in the ZigBee network to realize data forwarding among different greenhouse nodes, the raspberry group control node sends a main control program to the LED dimming nodes in a broadcast mode through a coordinator, and the LED dimming nodes receive LED control signals sent by the central control node by utilizing the CC 2530;
step four: after the model establishment and the cross-platform transplantation of the intelligent algorithm in the steps are completed, the selection of crops and the determination of a light supplement stage are carried out on an equipment parameter setting interface, a random forest model embedded into a system is loaded on a corresponding path of a raspberry group, an environmental factor monitored by a sensor is used as the input of the model, at the moment, the random forest algorithm can carry out differential value calculation regulation and control by gathering a large number of classification trees, the photon flux density value corresponding to the light saturation point of the model is obtained by averaging the predicted values of all decision trees, and then the photosynthetically active radiation value is monitored according to the sensor monitoring node in the actual environment; in the actual regulation and control process, basic parameters of a regulated and controlled object are selected through a parameter selection interface, a stored random forest model is directly called, a sensor monitoring node periodically monitors a photosynthetic effective radiation value, the current red and blue light quantum flux density is calculated by utilizing the proportional relation between the solar altitude angle and the red and blue light in natural light, the current red and blue light quantum flux density is sent to a raspberry dispatching main control node, the difference value between the current red and blue light quantum flux density and the target quantity required by crops is calculated by utilizing the main control node, the current red and blue light quantum flux density and the target quantity required by the crops are converted into pulse width modulation control signals, and then the LED dimming node is controlled through ZigBee to control the LED output brightness, so that the dynamic, accurate and wireless.
2. The facility light environment regulation and control method fused with the random forest algorithm according to claim 1, wherein in the second step, the specific steps of the light regulation and control model fused with the random forest algorithm are as follows:
the method comprises the following steps: let X { (X)m,ym) M is 1,2, M is a light saturation point sample set which is obtained by optimizing an improved fish school algorithm under different temperature and dioxygen concentration conditions and is used as a group of training sets of a light environment optimization regulation model, wherein X ismIs the temperature and carbon dioxide concentration, y, corresponding to the mth light saturation pointmIs the mth light saturation point sample data; generating L decision trees f (X, theta) by randomly sampling the set of optimized samples Xk) Assembling and constructing a random forest, wherein k is 1,2kIs the random vector used by the kth decision tree to select sample points;
step two: randomly generating theta by Bootstrap sampling methodkRandomly drawing 2/3 training sample points to generate a kth decision tree, a random vector thetakAre independent of each other and are distributed uniformly;
Figure FDA0002963925810000031
in the formula
Figure FDA0002963925810000032
Indicating that each decision tree produces a photon flux density value corresponding to a predicted light saturation point,
Figure FDA0002963925810000033
and the photon flux density value corresponding to the light saturation point representing the random forest prediction is obtained by averaging the predicted values of all decision trees.
3. The facility light environment regulation and control method fusing random forest algorithms as claimed in claim 2, wherein after the light regulation and control model fusing random forest algorithms is established, in order to correct the model and improve the prediction accuracy of random forests, a random feature selection strategy is adopted: at each node of each decision tree, randomly extracting N optical saturation point variables from the N total input optical saturation point variables, selecting an optimal optical saturation point variable from the N optical saturation point variables to segment the node, increasing or decreasing the value of N until the minimum test error is obtained, and outputting the final output photon flux density value at the moment
Figure FDA0002963925810000041
The method is an optimal regulation value, wherein N is less than or equal to N, so that the final regulation model has higher precision.
CN201810304729.6A 2018-04-08 2018-04-08 Facility light environment regulation and control method fused with random forest algorithm Active CN108614601B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810304729.6A CN108614601B (en) 2018-04-08 2018-04-08 Facility light environment regulation and control method fused with random forest algorithm

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810304729.6A CN108614601B (en) 2018-04-08 2018-04-08 Facility light environment regulation and control method fused with random forest algorithm

Publications (2)

Publication Number Publication Date
CN108614601A CN108614601A (en) 2018-10-02
CN108614601B true CN108614601B (en) 2021-05-04

Family

ID=63659675

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810304729.6A Active CN108614601B (en) 2018-04-08 2018-04-08 Facility light environment regulation and control method fused with random forest algorithm

Country Status (1)

Country Link
CN (1) CN108614601B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110751192B (en) * 2019-09-27 2023-07-18 南京大学 Decision tree reasoning system and method for random forest based on CART algorithm
CN111310840B (en) * 2020-02-24 2023-10-17 北京百度网讯科技有限公司 Data fusion processing method, device, equipment and storage medium
CN112083748B (en) * 2020-09-18 2021-06-15 西北农林科技大学 Facility light environment regulation and control method with priority to light quality
CN112906184A (en) * 2021-01-14 2021-06-04 合肥阳光新能源科技有限公司 Temperature control method and system of battery energy storage system
CN115443826B (en) * 2022-09-05 2023-11-07 江苏里下河地区农业科学研究所 Fine light regulation and control method and system for healthy seedling cultivation
CN116818687B (en) * 2023-06-21 2024-02-20 浙江大学杭州国际科创中心 Soil organic carbon spectrum prediction method and device based on spectrum guide integrated learning
CN117784852A (en) * 2024-02-28 2024-03-29 山东工商学院 Multi-mode sensor temperature control method based on fish scale bionic optimization algorithm

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040222306A1 (en) * 2003-05-08 2004-11-11 Anthony Fajarillo Methods, systems and apparatus for displaying bonsai trees
CN105654242A (en) * 2015-12-31 2016-06-08 西北农林科技大学 Fish swarm algorithm-based cucumber seedling stage carbon dioxide optimization regulation and control model, establishment method and application thereof
CN105427061A (en) * 2015-12-31 2016-03-23 西北农林科技大学 Improved fish swarm algorithm-based tomato seedling stage photosynthesis optimization regulation and control model, establishment method and application
CN106650212A (en) * 2016-10-10 2017-05-10 重庆科技学院 Intelligent plant breeding method and system based on data analysis
CN107145941B (en) * 2017-04-12 2020-11-13 西北农林科技大学 Method for dynamically acquiring light demand quantity in real time based on optimal light quality and photon flux density
CN107203204B (en) * 2017-05-23 2019-05-07 浙江大学 The Agriculture Mobile Robot identified based on random forest and two dimensional code

Also Published As

Publication number Publication date
CN108614601A (en) 2018-10-02

Similar Documents

Publication Publication Date Title
CN108614601B (en) Facility light environment regulation and control method fused with random forest algorithm
CN107390754B (en) Intelligent plant growth environment adjustment system and method based on Internet of Things cloud platform
CN109613947B (en) Embedded facility light environment optimization regulation and control system integrating illumination frequency and duty ratio
CN109325495B (en) Crop image segmentation system and method based on deep neural network modeling
Liu et al. Hierarchical optimization control based on crop growth model for greenhouse light environment
CN107390753B (en) Intelligent plant growth environment regulating device and method based on Internet of Things cloud platform
CN107329511A (en) Based on the vegetable aquaculture luminous environment high efficiency regulatory method and system between suitable root warm area
CN110084417A (en) A kind of strawberry greenhouse environment parameter intelligent monitor system based on GRNN neural network
CN107291126A (en) A kind of facility light supplement control method and system based on crop demand
CN104732426B (en) A kind of agricultural product production and marketing decision-making technique, apparatus and system
CN106842923A (en) Greenhouse multiple-factor control method for coordinating based on plant physiology and energy optimization
CN103605385A (en) CO2 gas fertilizer fine regulation and control method and device used for solar greenhouse
CN108983849A (en) It is a kind of to utilize compound extreme learning machine ANN Control greenhouse method
CN110119169A (en) A kind of tomato greenhouse temperature intelligent early warning system based on minimum vector machine
CN109343613B (en) Artificial light type plant growth environment intelligent control system and control method thereof
CN110533547A (en) Fruits and vegetables water-fertilizer conditioning method and device and computer readable storage medium
He et al. Study of LED array fill light based on parallel particle swarm optimization in greenhouse planting
CN103444418B (en) Based on the implementation method of the pipeline system plant factor of plant growth characteristics and rule
Wang et al. Cotton growth model under drip irrigation with film mulching: A case study of Xinjiang, China
Costa et al. Greenhouses within the Agricultura 4.0 interface
Lešić et al. Rapid plant development modelling system for predictive agriculture based on artificial intelligence
Liu et al. Multi-objective optimization for greenhouse light environment using Gaussian mixture model and an improved NSGA-II algorithm
Li et al. Determining optimal CO2 concentration of greenhouse tomato based on PSO-SVM
CN109685676A (en) Intelligent liquid manure management method and system
CN106803209A (en) The crop of real-time data base and advanced control algorithm cultivates pattern analysis optimization method

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
CB03 Change of inventor or designer information
CB03 Change of inventor or designer information

Inventor after: Hu Jin

Inventor after: Zhang Zhongxiong

Inventor after: Zhang Haihui

Inventor after: Xin Pingping

Inventor after: Zhang Pan

Inventor after: Bai Jinghua

Inventor after: Come to the beach

Inventor before: Zhang Haihui

Inventor before: Zhang Zhongxiong

Inventor before: Hu Jin

Inventor before: Xin Pingping

Inventor before: Zhang Pan

Inventor before: Bai Jinghua

Inventor before: Come to the beach

GR01 Patent grant
GR01 Patent grant