[go: up one dir, main page]

CN110956208A - Greenhouse illumination detection method and system based on logistic regression algorithm - Google Patents

Greenhouse illumination detection method and system based on logistic regression algorithm Download PDF

Info

Publication number
CN110956208A
CN110956208A CN201911182693.XA CN201911182693A CN110956208A CN 110956208 A CN110956208 A CN 110956208A CN 201911182693 A CN201911182693 A CN 201911182693A CN 110956208 A CN110956208 A CN 110956208A
Authority
CN
China
Prior art keywords
module
light intensity
greenhouse
data
illumination
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.)
Pending
Application number
CN201911182693.XA
Other languages
Chinese (zh)
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.)
Shandong Jianzhu University
Original Assignee
Shandong Jianzhu 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 Shandong Jianzhu University filed Critical Shandong Jianzhu University
Priority to CN201911182693.XA priority Critical patent/CN110956208A/en
Publication of CN110956208A publication Critical patent/CN110956208A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • AHUMAN NECESSITIES
    • A01AGRICULTURE; FORESTRY; ANIMAL HUSBANDRY; HUNTING; TRAPPING; FISHING
    • A01GHORTICULTURE; CULTIVATION OF VEGETABLES, FLOWERS, RICE, FRUIT, VINES, HOPS OR SEAWEED; FORESTRY; WATERING
    • A01G7/00Botany in general
    • A01G7/04Electric or magnetic or acoustic treatment of plants for promoting growth
    • A01G7/045Electric or magnetic or acoustic treatment of plants for promoting growth with electric lighting
    • AHUMAN NECESSITIES
    • A01AGRICULTURE; FORESTRY; ANIMAL HUSBANDRY; HUNTING; TRAPPING; FISHING
    • A01GHORTICULTURE; CULTIVATION OF VEGETABLES, FLOWERS, RICE, FRUIT, VINES, HOPS OR SEAWEED; FORESTRY; WATERING
    • A01G9/00Cultivation in receptacles, forcing-frames or greenhouses; Edging for beds, lawn or the like
    • A01G9/22Shades or blinds for greenhouses, or the like
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02ATECHNOLOGIES FOR ADAPTATION TO CLIMATE CHANGE
    • Y02A40/00Adaptation technologies in agriculture, forestry, livestock or agroalimentary production
    • Y02A40/10Adaptation technologies in agriculture, forestry, livestock or agroalimentary production in agriculture
    • Y02A40/25Greenhouse technology, e.g. cooling systems therefor

Landscapes

  • Engineering & Computer Science (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Data Mining & Analysis (AREA)
  • Theoretical Computer Science (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Artificial Intelligence (AREA)
  • Environmental Sciences (AREA)
  • Botany (AREA)
  • Ecology (AREA)
  • Forests & Forestry (AREA)
  • Biodiversity & Conservation Biology (AREA)
  • Circuit Arrangement For Electric Light Sources In General (AREA)

Abstract

The invention discloses a greenhouse illumination detection method and system based on a logistic regression algorithm. The method comprises the steps of collecting and transmitting illumination intensity information of the greenhouse; clustering the collected greenhouse illumination intensity information through a logistic regression algorithm to obtain a plurality of classification results; giving respective operation instructions to the multiple classification results, and comparing the similarity of the collected new illumination intensity information with the classification results to obtain decision results; and executing a decision result, and adjusting the indoor illumination intensity. The intelligent building illumination intensity monitoring system can intelligently adjust the temperature and humidity inside a building according to the collected illumination intensity data, so that the illumination intensity environmental parameters inside the building are maintained in a scientific range, the problems of complex circuit wiring, low safety and reliability, high maintenance cost and the like in the traditional building illumination intensity monitoring system are solved, and the intelligent building illumination intensity monitoring system has the advantages that the traditional building illumination intensity monitoring management cannot be compared favorably.

Description

Greenhouse illumination detection method and system based on logistic regression algorithm
Technical Field
The invention relates to the technical field of environmental illumination detection, in particular to a greenhouse illumination detection method and system based on a logistic regression algorithm.
Background
Under the current situation, the greenhouse illumination detection system is mainly wired, for example, RS485 is used to transmit data information. However, this method generally has many problems:
(1) a plurality of circuit wires need to be arranged on the site, and messy situations can occur when the circuit wires are arranged;
(2) the circuit wire is easy to have safety problems;
(3) the later maintenance and repair requires much labor and high cost;
(4) the location where the data is collected is relatively fixed.
At present, the electronic information science and technology are rapidly advanced, the high-speed development of the internet of things and artificial intelligence changes the lives of people, so that everything around people is changed, and the environmental monitoring is also developed along with the development of the internet of things and the artificial intelligence under the trend. However, the research process of the environment monitoring system in China is relatively slow, environment monitoring equipment and technology are relatively laggard compared with those in developed countries, and the artificial and intelligent monitoring level is not achieved.
Disclosure of Invention
In order to overcome the defects in the prior art, the invention aims to provide a greenhouse illumination detection method and system based on a logistic regression algorithm.
In order to achieve the purpose, the invention adopts the following technical scheme:
a greenhouse big shed illumination detection method based on a logistic regression algorithm comprises the following steps:
collecting and transmitting the illumination intensity information of the greenhouse;
classifying the collected greenhouse illumination intensity information through a logistic regression algorithm to obtain a classification result, wherein the data is divided into a training set and a testing set;
giving respective operation instructions to the plurality of classification results, and comparing the collected new illumination intensity information with the classification results to obtain decision results;
and executing a decision result, and adjusting the illumination intensity of the greenhouse.
Preferably, the collecting of the illumination intensity information of the greenhouse is performed by collecting illumination intensity information of a plurality of different positions of the greenhouse.
Preferably, the greenhouse illumination intensity information is wirelessly communicated through a Zigbee protocol.
Preferably, the logistic regression algorithm comprises the following steps:
(1) firstly, creating a data set according to the acquired light intensity data; then, the light intensity values at 3 different time points are taken as 3 most representative characteristic values x1x2x3
(2) Random initialization parameter theta1θ2θ3Fitting feature x1x2x3To obtain a predicted value hθ(x);
(3) Calculating a cost function J (theta) according to the following formula;
Figure BDA0002291687950000021
wherein m is the total sample number of the data set, theta is the parameter to be optimized, and y(i)Is a true value, hθ(x(i)) Is a predicted value, x is a characteristic value;
(4) gradient descending and updating the parameter theta until the cost function J (theta) obtains the minimum value;
(5) and then multiplying each feature vector on the test set by a regression coefficient theta obtained by a gradient descent optimization method, summing the product results, and finally inputting the product results into a Sigmoid function, wherein if the corresponding Sigmoid value is more than 0.5, the class label is predicted to be 1, and otherwise, the class label is 0.
Preferably, the Zigbee protocol communicates between the light intensity sensor module, the coordinator module, and the data processing module, and the communication steps are as follows:
(1) the data processing module sends an instruction to the coordinator module through a serial port, and inquires the network address of the light intensity sensor module, wherein the instruction format comprises a frame header, a data length, a command, a data bit and a check bit;
(2) when the coordinator module receives a serial port protocol frame command from the data processing module, the serial port protocol frame is converted into a protocol stack protocol frame, and then the protocol stack protocol frame is sent to the light intensity sensor module through the ZigBee network; the coordinator module returns an instruction to the data processing module, which indicates that the coordinator module successfully receives the command of the data processing module;
after receiving the command of the coordinator module, the light intensity sensor module returns the network address of the light intensity sensor module;
(3) after the data processing module obtains the 16-bit short network address of the light intensity sensor module in the ZigBee network, the data processing module can send an instruction to the coordinator module according to the network address to request the light intensity sensor module to transmit light intensity data back to the data processing module;
(4) the light intensity sensor module reports the ambient light intensity data.
Preferably, the classification result is 1 classification and 0 classification, and the operation instructions given to each classification result are: and assigning 1 classification to an operation instruction for opening the sun shield in the execution module and closing the LED plant lamp, and assigning 0 classification to an operation instruction for opening the LED plant lamp in the execution module and closing the sun shield.
A greenhouse big shed illumination detection system based on a logistic regression algorithm comprises:
the data acquisition module is used for acquiring the illumination intensity information of the greenhouse;
the data processing center module comprises a data processing module and a decision module, wherein the data processing module is used for training the collected greenhouse illumination intensity information by using a logistic regression algorithm to obtain a plurality of classification results, and the data are divided into a training set and a test set; the decision module is used for giving respective operation instructions to the plurality of classification results and comparing the collected new illumination intensity information with the classification results to obtain decision results;
and the execution module is used for executing the decision result and adjusting the illumination intensity of the greenhouse.
Preferably, the data acquisition module includes:
the light intensity sensor module comprises a photoresistor and a chip, wherein the photoresistor is used for judging the illumination intensity after the resistance value is changed through illumination and collecting illumination data information, and the chip is used for receiving and processing the illumination data information collected by the sensing module and sending the illumination intensity data information to the coordinator module;
the coordinator module is used for establishing an internal network, sending a command of the data processing module, receiving data of the light intensity sensor module and then sending information data received under the coordinator to the data processing module in time;
the ZigBee wireless communication module is used for realizing the communication of illumination intensity data information among the light intensity sensor module, the coordinator module and the data processing module;
and the energy providing module is used for supplying power to the illumination intensity sensing module, the coordinator module and the Zigbee wireless communication module.
Preferably, the data processing center module further includes:
and the display module is used for displaying the light intensity numerical value, recording the historical numerical value, drawing a line drawing according to the real-time light intensity numerical value, and simultaneously displaying the data processing condition and the state of the execution module.
Preferably, the execution module includes: sunshading board and LED plant lamp.
By adopting the technical scheme, the invention constructs a datamation, networking and intelligent illumination intensity detection system, and has the beneficial effects that:
the remote monitoring system can monitor environmental parameters such as illumination in the area in the agricultural greenhouse in time. The system has an identity identification and authentication function through the login account name and the password; monitoring data such as illumination intensity in the greenhouse can be supported; designing a data monitoring management interface, and having the functions of real-time data display, historical data display and the like; moreover, the greenhouse can be intelligently adjusted according to the acquired light intensity data, the problems of complex circuit wiring, low safety and reliability, high maintenance cost and the like in the traditional greenhouse illumination detection system are solved, and the system has the advantages that the traditional greenhouse illumination detection management cannot be compared favorably.
Drawings
The above and/or additional aspects and advantages of the present invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
FIG. 1 is a diagram of a star network topology for ZigBee; (ii) a
FIG. 2a is a data receiving and illumination intensity displaying interface of the greenhouse illumination detection software;
FIG. 2b is a view showing an illumination curve display interface of the greenhouse illumination detection software;
FIG. 3 is a fitting graph of Excel functions of the early-stage light intensity acquisition experiment result of the embodiment;
FIG. 4a is a data receiving interface of the greenhouse illumination detection software according to the embodiment;
FIG. 4b is a light intensity curve interface of the greenhouse illumination detection software according to the present embodiment;
FIG. 5 is a Sigmoid function;
FIG. 6 is a schematic diagram of a greenhouse illumination detection method based on a logistic regression algorithm.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the accompanying drawings are illustrative only for the purpose of explaining the present invention, and are not to be construed as limiting the present invention.
As shown in the general design scheme schematic diagram of fig. 6, the present embodiment provides a building indoor illumination intensity environment monitoring method and system based on ZigBee and logistic regression algorithm.
Greenhouse illumination detecting system based on zigBee mainly divide into 3 parts: the first part is a data acquisition module, in particular a light intensity sensor module, a coordinator module, a ZigBee wireless communication module, an energy providing module, the second part is an intelligent terminal data processing center module, in particular a display and control module, a data processing module and a decision module, the third part is an execution module, wherein,
the light intensity sensor module comprises a photoresistor and a CC2530 chip, wherein the photoresistor changes resistance values through illumination, then judges illumination intensity and collects illumination data information. The CC2530 chip is a 256KB CC2530 chip with Flash and is used for receiving the illumination data information collected by the sensor module and sending the illumination data information to the coordinator module; the light intensity sensor module is used for acquiring illumination data information and sending the illumination data information to the coordinator module;
the coordinator module is a core device of the wireless local area network, and is mainly responsible for establishing an internal network, sending a command of the intelligent terminal and receiving data of a terminal device node, and then timely sending information data received under the coordinator to the intelligent terminal;
the Zigbee wireless communication module is used for realizing the communication of illumination data information between each module and the intelligent terminal;
and the energy supply module is used for supplying power to the light intensity sensor module, the coordinator module, the CC2530 chip and the Zigbee wireless communication module.
The intelligent terminal is used for receiving illumination data information sent by the Zigbee wireless communication module; the display module is used for displaying the light intensity value, recording the historical value, drawing a line graph according to the real-time light intensity value, and displaying the data processing condition, the decision-making condition and the state of the execution module. And the data processing module is used for classifying the acquired light intensity data by using a logistic regression algorithm in machine learning. And the decision module gives the classification result in the data processing module to a specific operation instruction.
And the execution module executes the command according to the specific operation instruction in the decision module. The specific execution module is a sun shield and an LED plant lamp, and after the decision module gives a specific classification operation instruction, the sun shield and the LED lamp are operated or closed through the specific operation instruction so as to achieve the purpose of reducing or increasing the illumination intensity.
The greenhouse illumination detection system based on ZigBee comprises a ZigBee wireless communication module, a coordinator module and a power module connected with the ZigBee wireless communication module, wherein the light intensity sensor is a photoresistor and a CC2530 which is communicated with a ZigBee wireless communication protocol and receives illumination information, and the light intensity sensor and the CC2530 are both connected with the power module; the intelligent terminal is used for receiving the transmission of the ZigBee wireless communication technology.
Because the topological structure of the wireless network used in the greenhouse at present is mostly a star network (the biggest advantage of the topological structure is that the structural relationship is very simple, the networking is convenient and fast, the cost is low, the implementation is easy, and the data transmission delay is small), the star network adopted by the ZigBee network topological structure in the invention is shown in figure 1.
The intelligent terminal of the greenhouse illumination detection system is designed by adopting a Qt platform, and hardware development software of the greenhouse illumination detection system is developed based on IAR software (IAR Embedded Workbench integrated development environment).
In a general scheme, the system consists of a plurality of ZigBee light intensity sensing terminal nodes (namely light intensity sensor modules) and a ZigBee coordinator node (namely a coordinator module). The ZigBee coordinator node is a core device of the wireless local area network, and has the functions of establishing, maintaining and managing a network and the like, and is mainly responsible for establishing an internal network, after the coordinator applies for a PAN ID, any other node provides an application for adding the local area network to the coordinator according to the PAN ID, and the node can be added into the local area network after the coordinator distributes a network address. After the coordinator builds a ZigBee wireless network, the sensor nodes and the intelligent terminal can be added into the network to communicate with the coordinator. The sensor node is used as a terminal node, and must be connected with the network by means of a coordinator or a router in a ZigBee network to send light intensity data information acquired by the light intensity sensor processed by the CC2530 chip.
After hardware communication is successful and hardware equipment successfully establishes a wireless local area network under a ZigBee protocol, software development is carried out on the premise. According to the difference of functions, the system is mainly divided into 3 parts on the display module: receiving real-time light intensity information returned by the sensor; displaying the light intensity value on an upper computer interface, and recording a historical value; and drawing a line graph according to the real-time light intensity value.
In the invention, a ZigBee protocol is used for communication among a light intensity sensing terminal node (namely a light intensity sensor module), a coordinator node (namely a coordinator module) and an intelligent terminal (specifically a data processing module in the intelligent terminal), and the specific communication steps are as follows:
the intelligent terminal sends an instruction to the coordinator node through the serial port, and inquires the network address of the light intensity sensing terminal node, for example: the format of the instruction sent by the intelligent terminal is shown in table 1:
table 1 lookup network address frame format
Figure BDA0002291687950000061
And when the coordinator node receives a serial port protocol frame command from the intelligent terminal, converting the serial port protocol frame into a protocol stack protocol frame, and sending the protocol stack protocol frame to the light intensity sensing terminal node through the ZigBee network.
Then, the coordinator will return an instruction to the intelligent terminal, which indicates that it has successfully received the command from the intelligent terminal, and the format of the returned command is as shown in table 2:
table 2 query network address coordinator return frame format
Figure BDA0002291687950000062
Wherein, the two-bit command bit value 6900 represents that the coordinator correctly receives the instruction return; the value 00 of the data bit indicates that the coordinator successfully sends the command.
After receiving the command from the coordinator, the light intensity sensor returns the command format as shown in table 3:
table 3 query network address sensor return frame format
Figure BDA0002291687950000063
Wherein command 6980 represents a sensor node transmission; data bit 0000 represents the coordinator address, 0101 instructs the coordinator to look up the network address from the given MAC address, 00124B 000260E 683 is the MAC address of the light intensity sensor node, 970D is the network address of the light intensity sensor node.
Because the network address allocated by the ZigBee wireless sensor network in each networking is randomly changed, 970D is not a fixed value, and the above steps are required to obtain a new network address after each networking is performed again.
After the intelligent terminal obtains the 16-bit short network address of the sensor node in the ZigBee network, the intelligent terminal can send an instruction to the coordinator according to the network address to request the sensor node to transmit light intensity data back to the intelligent terminal. The format of the data sent by the intelligent terminal is shown in table 4:
table 4 query network address sensor return frame format
Figure BDA0002291687950000071
Wherein, command 2900 indicates that the smart terminal sends; data bit 02 is a fixed value, 970D is a network address, 0002 is a command id, which represents a write parameter, 0101 is a parameter identifier of a light intensity sensor, which represents automatic reporting of data, and the reporting time interval is 5 seconds.
Thereafter, the coordinator returns a command as in table 5, and the light intensity sensor first returns a command as in table 6:
TABLE 5 format of first-time return command of light intensity sensor
Figure BDA0002291687950000072
Wherein command 6980 represents a sensor node transmission; 970D is the network address, 8002 is the write parameter response, 00 is the write operation success.
This is the first time data is sent when the light intensity information is required to be reported, and then the environmental light intensity data is reported every 5 seconds (the time is set by the last statement of the intelligent terminal), and the frame format is as shown in table 6.
TABLE 6 format of light intensity sensor Return Command
Figure BDA0002291687950000073
Figure BDA0002291687950000081
Wherein 0003 is a command id indicating that the sensor value is actively reported, 0102 is a parameter identifier of the light intensity sensor indicating that the light intensity sensor value is reported, and 37 is a light intensity value collected by the light intensity sensor.
The intelligent terminal data processing center module is specifically a display and control module, a data processing module and a decision module. The display and control module adopts a Qt software platform design, applies a QtSerialPort module, provides a uniform interface for hardware and a virtual serial port, and greatly shortens the period of developing application programs related to the serial port.
The display module comprises a, b two sides: the a surface is a data receiving and illumination intensity display interface and comprises a serial port arrangement toolbar on the left side, a serial port receiving and sending text box in the middle, a real-time illumination display frame on the right side and a historical record display frame; the side b is an illumination curve display interface and mainly comprises a serial port setting toolbar on the left side, and the rest part is an illumination curve display area. The main interface of the design is shown in fig. 2a and 2 b.
The logistic regression algorithm steps used in this design are detailed below:
step 1: firstly, creating a data set according to collected light intensity data, wherein 75% of the data set is used as a training set, and 25% of the data set is used as a testing set; then, the light intensity values at 10 am, 12 pm and 2 pm are taken as the 3 most representative characteristic values x1x2x3
The detection light intensity is the original output of the light intensity sensor of the design, and the earlier stage data acquisition result is arranged as shown in the table 7:
TABLE 7 early light intensity Collection test results
Figure BDA0002291687950000082
Step 2: random initialization parameter theta1θ2θ3Fitting feature x1x2x3To obtain a predicted value hθ(x);
The mathematical expression of the prediction function of the logistic regression output is as follows:
Figure BDA0002291687950000083
in the formula (1), g represents a sigmoid function, theta is a parameter to be optimized, and x is a characteristic value.
The experimental results are fitted by Excel function as shown in fig. 3.
The light intensity acquisition experiment result in the early stage shows that the output of the light intensity sensor of the design is in a negative correlation with the actual light intensity, the range of the detected light intensity is approximately normal display at 20-100, the data exceeding the range is wrong, the corresponding actual light intensity value is about 800 Lux-0 Lux, the detected light intensity is set to be x and the actual light intensity is y within the correct range through approximate fitting, and the corresponding relation is determined to be
y=-484.5×lnx+2209.3(2)
According to the experimental results and data analysis, the data receiving interface and the light intensity curve interface of the designed greenhouse illumination detection software are shown in fig. 4a and 4 b.
And step 3: calculating a cost function J (theta) according to a formula (3);
Figure BDA0002291687950000091
m in the formula (3) is the total sample number of the data set, theta is a parameter to be optimized, and y(i)Is a true value, hθ(x(i)) Is a predicted value, x is a characteristic value;
and 4, step 4: updating the parameter theta by gradient descent by using a gradient descent formula (4) until the cost function J (theta) obtains the minimum value;
Figure BDA0002291687950000092
theta in the formula (4)jα is a learning rate and J (theta) is a cost function for a parameter to be optimized;
the purpose of the gradient descent method is to help us find the parameter θ that fits our data better, and the updating of θ is repeated through equation 4 until the parameter θ is found that minimizes the cost function J (θ).
The important adjusting factor in the gradient descent method is 3 factors, step length, initial value and normalization.
(1) Step length: the step length is too small, the convergence is slow, and the step length is too large, so that the optimal solution can be far away. Therefore, the optimal solution needs to be tested from small to large respectively.
(2) Initial value: and randomly selecting an initial value, and when the cost function is a non-convex function, finding a solution which is possibly a local optimal solution, and selecting an optimal solution from the local optimal solution by testing for multiple times. When the loss function is a convex function, the resulting solution is the optimal solution.
(3) Normalization: if not normalized, convergence is slow.
Equation (4) is repeated until the function converges, at which point the function can be considered to have taken a minimum value. In practical applications we can set a precision epsilon and terminate the iteration when the modulus of the gradient of the function at a certain point is smaller than epsilon.
Where α is the learning rate, which determines the length of each step that goes in the negative direction of the gradient during the gradient descent iteration.
The cost function is: to evaluate the goodness of the model fit, a loss function is typically used to measure the degree of fit. The minimization of the loss function means the best fitting degree, and the corresponding model parameters are the optimal parameters.
And (3) testing an algorithm: after the optimal parameters are found, the error rate must be observed in order to quantify the regression effect. Determining whether to return to a training stage according to the error rate, and obtaining a better regression coefficient by changing parameters such as iteration times, step length and the like;
and 5: and then multiplying each feature vector on the test set by a regression coefficient theta obtained by a gradient descent optimization method, summing the product results, and finally inputting the product results into a Sigmoid function, wherein if the corresponding Sigmoid value is more than 0.5, the class label is predicted to be 1, and otherwise, the class label is 0.
Figure BDA0002291687950000101
Z in the formula (5) is a predicted value thetaTx and x are characteristic values, and theta is a parameter to be optimized;
for the binary problem, y ∈ {0,1}, 1 denotes a positive case, and 0 denotes a negative case. The logistic regression being on a linear function thetaTOn the basis of x output prediction actual value, finding a hypothesis function hθ(x)=g(θTx), the actual value is mapped between 0 and 1 if hθ(x) If > 0.5, then y is predicted to be 1, and y is a positive case; if h isθ(x) If the value is less than 0.5, the predicted value y is 0, i.e. y is a negative example.
The logistic regression selects a log-probability function (logistic function), which is an important representative of Sigmoid function (S-shaped function), as an activation function, as shown in fig. 5.
The function is robust and has a probabilistic significance in that the input range (∞- ∞) of the function is mapped between (0,1) of the output. A sample is input into the function learned by the user, and 0.7 is output, which means that the sample has a positive case of 70% probability and a negative case of 1-70% probability of 30%.
The light intensity information table of 5 days is arranged, the light intensity information of three time periods is taken as a characteristic, and the classification result is shown as the following table:
TABLE 8 light intensity data characteristics and classification results
Figure BDA0002291687950000102
The implementation modules of the invention are sunshade net and LED plant lamp devices, after the data processing module processes data and completes classification, the decision module assigns 1 classification to the operation instruction for opening the sunshade board in the implementation module and closing the LED plant lamp so as to achieve the purpose of reducing light intensity, and the decision module assigns 0 classification to the operation instruction for opening the LED plant lamp in the implementation module and closing the sunshade board so as to achieve the purpose of enhancing light intensity.
Advantageously, the sun visor further comprises an illumination intensity abnormity warning module, a plurality of light intensity sensor modules respectively collect illumination intensity information at the same time, similarity comparison is carried out on the illumination intensity information and the 2 classifications, and when the information collected by one or more light intensity sensor modules is different from a decision result obtained by the illumination intensity information collected by other light intensity sensor modules, the abnormal condition is shown, namely, the sun visor or the LED plant lamp fails to operate normally. Can be displayed through the display and control module. For example, when the information collected by other light intensity sensor modules is similar to the classification of the normal condition, and one light intensity sensor module is in other classifications, the light intensity sensor module is abnormal in position during the watch.
The greenhouse illumination detection system based on the ZigBee wireless sensor network fully utilizes the characteristics of small power consumption, low cost, simple installation, large network capacity, short time delay and the like of the ZigBee node, can remotely monitor environmental parameters such as illumination in an area in the greenhouse in time, adopts a Qt platform to realize the design and development of a user interface, displays light intensity values, records historical values, and draws a line graph according to the real-time light intensity values; the intelligent algorithm is utilized to realize the intellectualization of the adjustment of the illumination condition of the greenhouse, and specific measures can be taken according to the change of the light intensity.
Compared with the traditional wired equipment, the wireless communication technology adopted by the device is flexible to install, high in safety and reliability and low in maintenance cost; the remote monitoring system can monitor environmental parameters such as illumination in the area in the agricultural greenhouse in time. The light intensity numerical value can be displayed through a computer, the historical numerical value is recorded, a line drawing is drawn according to the real-time light intensity numerical value, and data are visual and convenient to arrange and count; the intelligent greenhouse illumination detection system is realized from the aspects of light intensity acquisition, data processing to the execution module and the like, specific measures can be taken according to specific light intensity, the whole process does not need manual operation, the plant cultivation efficiency is improved, and the greenhouse illumination detection system is pushed to the intelligent field.
While embodiments of the invention have been shown and described, it will be understood by those of ordinary skill in the art that: various changes, modifications, substitutions and alterations can be made to the embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.

Claims (10)

1. A greenhouse illumination detection method based on a logistic regression algorithm is characterized by comprising the following steps:
collecting and transmitting the illumination intensity information of the greenhouse;
classifying the collected greenhouse illumination intensity information through a logistic regression algorithm to obtain a classification result, wherein the data is divided into a training set and a testing set;
giving respective operation instructions to the plurality of classification results, and comparing the collected new illumination intensity information with the classification results to obtain decision results;
and executing a decision result, and adjusting the illumination intensity of the greenhouse.
2. The method for detecting greenhouse illumination based on logistic regression algorithm as claimed in claim 1, wherein said collecting greenhouse illumination intensity information is by collecting greenhouse illumination intensity information at a plurality of different locations.
3. The method for detecting greenhouse illumination based on logistic regression algorithm as claimed in claim 1, wherein the greenhouse illumination intensity information is wirelessly communicated by Zigbee protocol.
4. The greenhouse illumination detection method based on the logistic regression algorithm as claimed in claim 1, wherein the logistic regression algorithm comprises the following steps:
(1) firstly, creating a data set according to the acquired light intensity data; then, the light intensity values at 3 different time points are taken as 3 most representative characteristic values x1x2x3
(2) Random initialization parameter theta1θ2θ3Fitting feature x1x2x3To obtain a predicted value hθ(x);
(3) Calculating a cost function J (theta) according to the following formula;
Figure FDA0002291687940000011
wherein m is the total sample number of the data set, theta is the parameter to be optimized, and y(i)Is a true value, hθ(x(i)) Is a predicted value, x is a characteristic value;
(4) gradient descending and updating the parameter theta until the cost function J (theta) obtains the minimum value;
(5) and then multiplying each feature vector on the test set by a regression coefficient theta obtained by a gradient descent optimization method, summing the product results, and finally inputting the product results into a Sigmoid function, wherein if the corresponding Sigmoid value is more than 0.5, the class label is predicted to be 1, and otherwise, the class label is 0.
5. The greenhouse illumination detection method based on the logistic regression algorithm as claimed in claim 1, wherein the Zigbee protocol communicates among the light intensity sensor module, the coordinator module, and the data processing module, and the communication steps are as follows:
(1) the data processing module sends an instruction to the coordinator module through a serial port, and inquires the network address of the light intensity sensor module, wherein the instruction format comprises a frame header, a data length, a command, a data bit and a check bit;
(2) when the coordinator module receives a serial port protocol frame command from the data processing module, the serial port protocol frame is converted into a protocol stack protocol frame, and then the protocol stack protocol frame is sent to the light intensity sensor module through the ZigBee network; the coordinator module returns an instruction to the data processing module, which indicates that the coordinator module successfully receives the command of the data processing module;
after receiving the command of the coordinator module, the light intensity sensor module returns the network address of the light intensity sensor module;
(3) after the data processing module obtains the 16-bit short network address of the light intensity sensor module in the ZigBee network, the data processing module can send an instruction to the coordinator module according to the network address to request the light intensity sensor module to transmit light intensity data back to the data processing module;
(4) the light intensity sensor module reports the ambient light intensity data.
6. The greenhouse illumination detection method based on the logistic regression algorithm as claimed in claim 1, wherein the classification results are 1 classification and 0 classification, and the operation instructions given to each classification are respectively: and assigning 1 classification to an operation instruction for opening the sun shield in the execution module and closing the LED plant lamp, and assigning 0 classification to an operation instruction for opening the LED plant lamp in the execution module and closing the sun shield.
7. A greenhouse big shed illumination detection system based on a logistic regression algorithm is characterized by comprising:
the data acquisition module is used for acquiring the illumination intensity information of the greenhouse;
the data processing center module comprises a data processing module and a decision module, wherein the data processing module is used for training the collected greenhouse illumination intensity information by using a logistic regression algorithm to obtain a plurality of classification results, and the data are divided into a training set and a test set; the decision module is used for giving respective operation instructions to the plurality of classification results and comparing the collected new illumination intensity information with the classification results to obtain decision results;
and the execution module is used for executing the decision result and adjusting the illumination intensity of the greenhouse.
8. The logistic regression algorithm based greenhouse illumination detection system as recited in claim 7, wherein the data collection module comprises:
the light intensity sensor module comprises a photoresistor and a chip, wherein the photoresistor is used for judging the illumination intensity after the resistance value is changed through illumination and collecting illumination data information, and the chip is used for receiving and processing the illumination data information collected by the sensing module and sending the illumination intensity data information to the coordinator module;
the coordinator module is used for establishing an internal network, sending a command of the data processing module, receiving data of the light intensity sensor module and then sending information data received under the coordinator to the data processing module in time;
the ZigBee wireless communication module is used for realizing the communication of illumination intensity data information among the light intensity sensor module, the coordinator module and the data processing module;
and the energy providing module is used for supplying power to the illumination intensity sensing module, the coordinator module and the Zigbee wireless communication module.
9. The logistic regression algorithm based greenhouse illumination detection system as recited in claim 7, wherein the data processing center module further comprises:
and the display module is used for displaying the light intensity numerical value, recording the historical numerical value, drawing a line drawing according to the real-time light intensity numerical value, and simultaneously displaying the data processing condition and the state of the execution module.
10. The logistic regression algorithm based greenhouse lighting detection system as claimed in claim 7, wherein the execution module comprises: sunshading board and LED plant lamp.
CN201911182693.XA 2019-11-27 2019-11-27 Greenhouse illumination detection method and system based on logistic regression algorithm Pending CN110956208A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911182693.XA CN110956208A (en) 2019-11-27 2019-11-27 Greenhouse illumination detection method and system based on logistic regression algorithm

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911182693.XA CN110956208A (en) 2019-11-27 2019-11-27 Greenhouse illumination detection method and system based on logistic regression algorithm

Publications (1)

Publication Number Publication Date
CN110956208A true CN110956208A (en) 2020-04-03

Family

ID=69978503

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911182693.XA Pending CN110956208A (en) 2019-11-27 2019-11-27 Greenhouse illumination detection method and system based on logistic regression algorithm

Country Status (1)

Country Link
CN (1) CN110956208A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111443609A (en) * 2020-04-16 2020-07-24 成都三业嘉豪科技有限公司 Laboratory environment self-adaptive adjusting method based on Internet of things
CN113155196A (en) * 2021-04-26 2021-07-23 南京邮电大学 Bridge operation real-time monitoring system based on AIoT and monitoring method thereof

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106209457A (en) * 2016-07-14 2016-12-07 北京工业大学 Tackle method for secret protection and the system of bypass attack in smart home environment
CN108194014A (en) * 2012-11-07 2018-06-22 麦可希德体系股份有限公司 Automation screen control system and method
CN108197546A (en) * 2017-12-26 2018-06-22 深圳市友信长丰科技有限公司 Photo-irradiation treatment method, apparatus, computer equipment and storage medium in recognition of face
CN110262435A (en) * 2019-07-16 2019-09-20 河海大学常州校区 Smart greenhouse control system and method based on big data analysis

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108194014A (en) * 2012-11-07 2018-06-22 麦可希德体系股份有限公司 Automation screen control system and method
CN106209457A (en) * 2016-07-14 2016-12-07 北京工业大学 Tackle method for secret protection and the system of bypass attack in smart home environment
CN108197546A (en) * 2017-12-26 2018-06-22 深圳市友信长丰科技有限公司 Photo-irradiation treatment method, apparatus, computer equipment and storage medium in recognition of face
CN110262435A (en) * 2019-07-16 2019-09-20 河海大学常州校区 Smart greenhouse control system and method based on big data analysis

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111443609A (en) * 2020-04-16 2020-07-24 成都三业嘉豪科技有限公司 Laboratory environment self-adaptive adjusting method based on Internet of things
CN113155196A (en) * 2021-04-26 2021-07-23 南京邮电大学 Bridge operation real-time monitoring system based on AIoT and monitoring method thereof

Similar Documents

Publication Publication Date Title
CN109799726B (en) Smart home system combined with living environment detection
CN106340071B (en) A kind of smart classroom system based on cloud computing
CN107318534B (en) A kind of intelligent temperature control method and system for solar greenhouse roller shutter machine with temperature prediction function
CN118916778A (en) Energy consumption monitoring and optimizing method and system based on large model and multiple agents
CN110823291A (en) Method and system for indoor temperature and humidity environment monitoring in buildings based on K-means clustering algorithm
CN108388291A (en) A kind of greenhouse cluster environment regulation and control method and system
CN107105028B (en) Computer lab environment intelligent regulation system based on cloud calculates
CN110658725B (en) An artificial intelligence-based energy monitoring and forecasting system and method thereof
CN117835500A (en) Intelligent control system and method for intelligent city illumination based on Internet of things technology
CN111914493B (en) System and method for simulating service life of LED street lamp
CN110956208A (en) Greenhouse illumination detection method and system based on logistic regression algorithm
CN111880417A (en) Intelligent household energy management and control system based on App and optimal control method thereof
CN117634836B (en) A photovoltaic power station cleaning process evaluation method and system based on matrix analysis
CN115796390A (en) Data-driven building energy consumption abnormity diagnosis method and system
CN113658415A (en) Early warning method and system for intelligent gateway
CN107781773A (en) A kind of city Internet of Things network control system of intelligent road-lamp and intelligent road-lamp
CN2886711Y (en) Open type intelligent wireless sensor based on ZigBee mode
CN107131908A (en) Multiple-sensor network platform environment monitoring system and method
CN119644953A (en) A kind of intelligent manufacturing production line management system and method
CN214758186U (en) Miniature planting box with automatic evaluation function of plant growth model
CN110191481A (en) A Method and System for Evaluating Link Quality Using Overlimit Fast Decision Tree
CN118938783A (en) An intelligent building energy-saving control system
CN114298973A (en) An intelligent heating monitoring method based on infrared image segmentation
CN110716598A (en) An IoT-based intelligent greenhouse control and management system
CN105763648A (en) WSN-based intelligent office control system and 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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200403