Cotton picker and real-time yield measurement device and yield calibration method thereof
By setting up detection channels and temperature compensation channels in the cotton picker sensor, and using the improved random forest regression model of Sparrow Search for calibration, the problems of inaccurate sensor installation and environmental impact are solved, and high-precision cotton yield detection is achieved.
Patent Information
- Application Number
- CN202310226263.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-03
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2043-03-03
AI Technical Summary
The existing anti-aircraft density cotton yield detection sensors are difficult to accurately align the optical path when installed. The ambient temperature is affected and the defoliator sticks to block the optical port, resulting in a decrease in detection accuracy and insufficient fit and anti-interference.
Multiple detection channels and temperature compensation channels are set up between the transmitter and the receiver, and the temperature compensation partition is isolated by temperature compensation, and calibration is carried out in combination with the improved random forest regression model of sparrow search to achieve temperature compensation and data processing.
The installation accuracy of the cotton picking machine's production measurement sensor is improved, the ambient temperature and the influence of defoliants are reduced, and real-time and high-precision cotton yield detection is achieved.
Smart Images

Figure CN116349496B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to agricultural intelligent sensors and machine learning, and in particular to a cotton picker that is calibrated using a deep learning method and applied to real-time yield detection during operation, as well as a real-time yield measurement device and yield calibration method thereof. Background Art
[0002] As the mechanization of the cotton harvest process increases year by year, and to achieve increased income and production, and meet the requirements of precision agriculture, the need to obtain accurate cotton yield distribution maps is extremely urgent. The cotton flow sensor is a core component in the entire yield detection system. Its stability and accuracy directly determine the accuracy of cotton field yields and, in turn, impact the accuracy of the entire yield detection system. Sensor calibration methods have a significant impact on the entire yield detection system. Establishing a model with high interference resistance and good fit can significantly improve cotton yield detection accuracy. Cotton flow sensors require a stable light source, a suitable optical path, and a high degree of tolerance to harsh operating environments to ensure detection accuracy.
[0003] Existing through-beam density cotton yield detection sensors require manual alignment of the transmitter and receiver optical paths during installation. However, due to limited installation locations on the cotton conveying pipeline, it is sometimes impossible to correctly and accurately install the two parts, or the distance between the two parts cannot be installed to the pre-designed length, so optimal optical path detection cannot be guaranteed. In addition, the LED transmitting tube used will be affected by the ambient temperature and its own temperature, which will change the rated radiation and affect the detection data. Before the cotton picker starts working, defoliant will be sprayed to accelerate the shedding of cotton boll leaves. Usually, the detection light port is often blocked by the sticky pulp of the leaves due to the action of the defoliant, affecting the accuracy and normal operation of the detection system.
[0004] Existing through-beam density cotton yield sensors analyze data from each channel by summing them and finding an approximate linear relationship to determine the calibration relationship. This approach cannot guarantee good fit and interference immunity. While the summation method reduces the amount of data to be processed, it also offsets the information contained in each channel. This can mask unevenly distributed information within the cotton conveyor pipe and prevent it from being reflected to the detection system, resulting in calibration errors. Summary of the Invention
[0005] The technical problem to be solved by the present invention is to provide a cotton picker and a real-time yield measurement device and yield calibration method thereof in response to the above-mentioned defects of the prior art.
[0006] To achieve the above-mentioned object, the present invention provides a cotton picker operation real-time production measurement device, wherein the device is installed on the cotton conveying pipe of the cotton picker via a first connecting member and a second connecting member, and the device comprises:
[0007] a transmitter, two ends of which are respectively connected to one end of the first connector and one end of the second connector;
[0008] a receiver, arranged corresponding to the transmitter, with both ends of the receiver connected to the other end of the first connector and the other end of the second connector, respectively; a plurality of one-to-one corresponding detection channels and a temperature compensation channel are evenly distributed between the transmitter and the receiver, and the temperature compensation channel is located at one end of the transmitter and the receiver close to the second connector; and
[0009] A temperature compensation baffle is installed on the second connecting member and has two ends connected to the transmitter and the receiver respectively. The temperature compensation baffle separates the temperature compensation channel from all the detection channels.
[0010] The above-mentioned cotton picker operation real-time production measurement device, wherein the transmitter includes:
[0011] Launch casing;
[0012] An emitting lens is mounted on an emitting lens mounting plate, and the emitting lens mounting plate is located in the emitting housing;
[0013] An emission protection plate is mounted on the front end surface of the emission housing corresponding to the emission lens mounting plate and is used to protect the emission lens;
[0014] an emitting circuit board, mounted in the emitting housing and located behind the emitting lens mounting plate, wherein the LED emitting tube of the emitting circuit board faces the emitting lens and is located at the focus of the emitting lens, and the emitted light path is in a collimated state; and
[0015] The launch rear cover plate is installed on the rear end surface of the launch shell and encloses a closed space together with the launch shell and the launch protection plate.
[0016] The above-mentioned cotton picker operation real-time production measurement device, wherein the receiver includes:
[0017] receiving housing;
[0018] A receiving lens is mounted on a receiving lens mounting plate, and the receiving lens mounting plate is located in the receiving housing;
[0019] a receiving protection plate, mounted on the front end surface of the receiving housing corresponding to the receiving lens mounting plate, and used for protecting the receiving lens;
[0020] a receiving circuit board, mounted in the receiving housing and located behind the receiving lens mounting plate, wherein the photoelectric sensor of the receiving circuit board faces the receiving lens and is located at the focus of the receiving lens, and the received light path is in a collimated state; and
[0021] The receiving rear cover is mounted on the rear end surface of the receiving shell and encloses a closed space together with the receiving shell and the receiving protection plate.
[0022] In order to better achieve the above-mentioned object, the present invention further provides a calibration platform for a cotton picker's real-time yield measurement device, wherein the calibration platform used for the above-mentioned real-time yield measurement device comprises:
[0023] Stand;
[0024] A simulated cotton conveying pipeline is installed on the platform, and the real-time production measurement device is installed on the simulated cotton conveying pipeline; a fan is connected to one end of the simulated cotton conveying pipeline, and a barrier net is provided at the other end of the simulated cotton conveying pipeline; a cotton feeding port is provided on the simulated cotton conveying pipeline; and
[0025] The cotton feeding conveyor belt is arranged corresponding to the cotton feeding port.
[0026] In order to better achieve the above-mentioned object, the present invention further provides a yield calibration method for a cotton picker's real-time yield measurement device, wherein the calibration of the real-time yield measurement device is performed using the above-mentioned calibration platform, comprising the following steps:
[0027] S100, obtaining a calibration experiment data set; setting the fan power, the conveying speed of the cotton conveyor belt, and the length and mass of the cotton laid on the cotton conveyor belt;
[0028] S200, data processing to construct a data set, temperature compensation for each detection channel, effective value extraction of the temperature-compensated data of each detection channel to obtain an effective data sequence; extracting features of the effective data sequence to complete the construction of the data set; and
[0029] S300, training model, using the random forest algorithm improved by Sparrow Search, training an optimized random forest regression model to fit the yield measurement and yield relationship of the cotton picker, which is used for the cotton picker to obtain the cotton yield harvested within a unit distance in real time.
[0030] In the above-mentioned yield calibration method of the real-time yield measurement device of the cotton picker, the following formula is used to perform temperature compensation on each detection channel:
[0031]
[0032] in, is the time series data set after temperature compensation in the i-th calibration test; is the time series data set of the jth detection channel in the i-th calibration test; is the time series data set of the temperature compensation channel in the i-th calibration test.
[0033] In the above-mentioned yield calibration method for the real-time yield measurement device of the cotton picker, when using the random forest model for regression analysis, the sparrow algorithm is used to find the optimal parameters, and the characteristic dimensions of the sparrow population are set as the number of trees and depth; the number of optimization iterations is set; the upper and lower bounds and initial values of the number of trees and depth are set, and the parameters are adaptively optimized within the set range; and the mean square error of the label quality is used as the fitness function to evaluate the model regression effect after each parameter update; the mean square error of the label quality is calculated using the following formula:
[0034]
[0035] Among them, m i ——The mass of cotton in the i-th calibration test.
[0036] In the above-mentioned yield calibration method for the real-time yield measurement device of the cotton picker, the established data set is randomly divided into a validation set and a training set in a ratio of 1:3. The minimum mean square error is used as the judgment criterion for the split point using the given parameter initial values and the split training set data. When training the nodes of any decision tree of the random forest, for a certain feature A, the split point satisfies the following formula:
[0037]
[0038] Among them, v is the optional division point of each feature, c1 is the mean of the sample labels of the dataset D1, c2 is the mean of the sample labels of the dataset D2, and y i is the label mean in the data set, x i is the value of this feature.
[0039] In the above-mentioned yield calibration method of the real-time yield measurement device for cotton pickers, after the model training is completed, the validation set data is input for prediction to obtain the final random forest regression model:
[0040]
[0041] Among them, M is the number of decision trees in the random forest, and G is the output of each decision tree for the input validation set feature data.
[0042] In order to better achieve the above-mentioned purpose, the present invention also provides a cotton picker, which includes the above-mentioned real-time production measurement device, and the real-time production measurement device adopts the above-mentioned production calibration method to perform real-time production calibration.
[0043] The technical effects of the present invention are:
[0044] The present invention has a simple structure and is easy to install. It improves the installation accuracy and adjustable shooting distance of the cotton picker's yield measurement sensor, reduces the influence of the ambient temperature and self-heating of the LED transmitting tube on the radiation intensity, avoids the influence of grass leaves adhering to the lens on the detection accuracy, and adopts a random forest regression model improved by the sparrow algorithm to obtain real-time cotton yield data harvested by the cotton picker within a unit distance.
[0045] The present invention will be described in detail below with reference to the accompanying drawings and specific embodiments, but this does not limit the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 This is a structural diagram of a cotton picker according to an embodiment of the present invention;
[0047] Figure 2 This is a structural diagram of a real-time production measurement device according to an embodiment of the present invention;
[0048] Figure 3 This is a schematic diagram of the installation method of the real-time production measurement device of an embodiment of the present invention;
[0049] Figure 4 This is a schematic diagram of the transmitter structure according to one embodiment of the present invention;
[0050] Figure 5 A schematic diagram of the structure of a receiver according to an embodiment of the present invention;
[0051] Figure 6 This is a schematic structural diagram of a first connecting member according to an embodiment of the present invention;
[0052] Figure 7 This is a schematic structural diagram of a second connecting member and a verification channel partition according to an embodiment of the present invention;
[0053] Figure 8 A schematic diagram of a calibration platform according to an embodiment of the present invention;
[0054] Figure 9 A schematic diagram of a random forest regression model according to an embodiment of the present invention;
[0055] Figure 10 This is a flowchart of the sparrow optimization algorithm according to one embodiment of the present invention.
[0056] Among them, the reference numerals
[0057] 1 Chassis
[0058] 2 cabs
[0059] 3 picking heads
[0060] 4. Real-time production measurement device for operation
[0061] 41 launchers
[0062] 411 launch shell
[0063] 412 emission lens
[0064] 413 launch protection plate
[0065] 414 transmitter circuit board
[0066] 415 launch seal
[0067] 416 launch cover
[0068] 417 Transmitter lens mounting plate
[0069] 42 receivers
[0070] 421 receiving shell
[0071] 422 receiving lens
[0072] 423 receiving protection plate
[0073] 424 receiving circuit board
[0074] 425 receiving seal
[0075] 426 receiving rear cover
[0076] 427 receiving lens mounting plate
[0077] 43 first connecting piece
[0078] 44 second connecting piece
[0079] 45 temperature compensation partition
[0080] 5 cotton storage box
[0081] 6 Cotton transport pipeline
[0082] 7 Calibration platform
[0083] 71 racks
[0084] 72 simulated cotton transport pipeline
[0085] 73 conveyor belt
[0086] 74 cotton feeding port
[0087] 75 fan
[0088] 76 blocking net DETAILED DESCRIPTION
[0089] The structural principle and working principle of the present invention are described in detail below with reference to the accompanying drawings:
[0090] See also Figure 1 , Figure 1 The cotton picker of the present invention is a structural schematic diagram of an embodiment of the present invention. The cotton picker of the present invention includes a chassis 1 and a cab 2, a picking head 3, a cotton storage box 5, a cotton conveying pipe 6 and a real-time production measurement device 4 installed on the chassis 1. The picking head 3 is installed at the front end of the chassis 1, located in the front and lower part of the cab 2. The cotton storage box 5 is located behind the cab 2. The cotton conveying pipe 6 is connected to the picking head 3 and the cotton storage box 5 respectively. The real-time production measurement device 4 is installed on the cotton conveying pipe 6. A display and operating device is provided in the cab 2, and the power is supplied by an onboard 12V power supply. The composition, structure, mutual positional relationship, connection relationship and function of the other components of the cotton picker are all relatively mature existing technologies, so they will not be elaborated here. The following is a detailed description of the real-time production measurement device 4 and its calibration method of the present invention.
[0091] See also Figure 2 and Figure 3 , Figure 2 This is a structural diagram of a real-time production measurement device 4 according to an embodiment of the present invention. Figure 3 The figure is a schematic diagram of the installation method of the real-time production measurement device 4 of one embodiment of the present invention. The real-time production measurement device 4 of the present invention is installed on the cotton conveying pipe 6 of the cotton picker through a first connecting member 43 and a second connecting member 44. The real-time production measurement device 4 includes: a transmitter 41, whose two ends are respectively connected to one end of the first connecting member 43 and one end of the second connecting member 44; a receiver 42, which is arranged corresponding to the transmitter 41, and whose two ends are respectively connected to the other end of the first connecting member 43 and the other end of the second connecting member 44; a plurality of one-to-one corresponding detection channels and a temperature compensation channel are evenly distributed between the transmitter 41 and the receiver 42, and the temperature compensation channel is located at one end of the transmitter 41 and the receiver 42 near the second connecting member 44; and a temperature compensation baffle 45, which is installed on the second connecting member 44 and whose two ends are respectively connected to the transmitter 41 and the receiver 42, and the temperature compensation baffle 45 separates the temperature compensation channel from all the detection channels.
[0092] In this embodiment, the detection channel near the second connecting plate is used as a temperature compensation channel and is isolated from the remaining detection channels by a temperature compensation partition 45, so that cotton in the cotton conveying pipe 6 does not flow through this detection channel during operation. The LED transmitting tubes of all detection channels share a power supply system and are all located in a sealed space formed by the receiving shell 421 and the receiving back cover 426. By subtracting the data of the temperature compensation channel from the detection data of the remaining detection channels, the purpose of temperature compensation is achieved, and the influence of the ambient temperature and self-heating on the radiation intensity of the LED transmitting tube is reduced. Both the transmitter 41 and the receiver 42 adopt a lens-embedded structure, and a transparent protective plate made of Teflon material is installed on the outside of the lens to ensure that dust and leaf slurry caused by the defoliant will not block the detection lens during operation, that is, it will not block the six detection channels, reducing the impact of grass leaves sticking to the lens on detection accuracy.
[0093] See also Figure 4 , Figure 4 The figure is a schematic diagram of the structure of a transmitter 41 according to an embodiment of the present invention. The transmitter 41 of the present invention comprises: a transmitter housing 411; a transmitter lens 412, mounted on a transmitter lens mounting plate 417, the transmitter lens mounting plate 417 being located inside the transmitter housing 411; a transmitter protection plate 413, mounted on the front face of the transmitter housing 411 corresponding to the transmitter lens mounting plate 417, for protecting the transmitter lens 412; a transmitter circuit board 414, mounted inside the transmitter housing 411 and located behind the transmitter lens mounting plate 417, the LED radiation source of the transmitter circuit board 414 facing the transmitter lens 412 and located at the focus of the transmitter lens 412, and the emitted light path being in a collimated state; and a transmitter rear cover plate 416, mounted on the rear face of the transmitter housing 411, and enclosing a closed space together with the transmitter housing 411 and the transmitter protection plate 413. The transmitter circuit board 414 comprises an LED transmitter tube and a power conversion module, which are welded to the body of the transmitter circuit board 414. The power conversion module steps down the 12V voltage to 5V, which is then supplied to six parallel LED emitters. Radiation from the LED emitters passes through an emitting lens 412, forming a parallel optical path toward the receiver 42. To improve the LED focusing effect, an LED emitter with a small focusing angle can be selected as the emitter 41. By using the relationship between the optical path diagram of a convex lens and trigonometric functions, an emitting lens 412 with an appropriate focal length and thickness can be selected to maximize the use of the light source radiation and ensure the focusing degree of the collimated optical path.
[0094] When assembling the transmitter 41 of the present embodiment, first, the planes of the five transmitting lenses 412 are oriented toward the interior of the transmitting housing 411, and fixed in the lens groove of the transmitting housing 411 using hot melt adhesive, and then the transmitting protection plate 413 is fixed in the guard plate groove of the transmitting housing 411 by hot melt adhesive, and just does not contact the transmitting lens 412. At this time, the transmitting lens 412 is protected by the transmitting protection plate 413, which prevents the occurrence of the situation in which the grass leaf mucus adheres to the lens during actual operation. Then the transmitting circuit board 414 is installed in the transmitting housing 411 and fixed with bolts. At this time, the LED radiation source is oriented toward the transmitting lens 412 and is at the focus of the lens, and the light path of the emission is in a collimated state. Then the transmitting sealing ring 415 is installed in the sealing ring groove of the transmitting rear cover plate 416. The diameter, groove depth and groove width of the transmitting sealing ring 415 all meet the national standards. The side of the launch rear cover plate 416 with the sealing ring groove faces the interior of the launch shell 411. The launch rear cover plate 416 and the launch shell 411 are installed together and fixed with bolts to complete the assembly of the launcher 41.
[0095] See also Figure 5 , Figure 5The figure is a schematic diagram of the structure of a receiver 42 according to an embodiment of the present invention. The receiver 42 of the present invention comprises: a receiving housing 421; a receiving lens 422 mounted on a receiving lens mounting plate 427, which is located within the receiving housing 421; a receiving protective plate 423 mounted on the front face of the receiving housing 421 corresponding to the receiving lens mounting plate 427 and used to protect the receiving lens 422; a receiving circuit board 424 mounted within the receiving housing 421 and located behind the receiving lens mounting plate 427. The photoelectric sensor of the receiving circuit board 424 faces the receiving lens 422 and is located at the focal point of the receiving lens 422, so that the received light path is collimated; and a receiving rear cover 426 mounted on the rear face of the receiving housing 421 and, together with the receiving housing 421 and the receiving protective plate 423, forms a sealed space. The receiving circuit board 424 includes a photoelectric sensor, an optocoupler chip, an STM32F103 microcontroller, a CAN transceiver, and a power conversion module, all of which are soldered to the receiving circuit board 424. The six photoelectric sensors are filtered by their respective optocoupler chips and ultimately connected to the STM32F103 single-chip microcomputer. Each photoelectric sensor collects the radiation from the six LED emission tubes of the transmitter 41 through the receiving lens 422, forming six groups of detection channels. The CAN port of the STM32F103 single-chip microcomputer is connected to the CAN transceiver, which sends the integrated data to the host computer. When cotton passes through the cotton conveying pipe 6, the intensity of the light emitted from the transmitter 41 received by the receiver 42 will be weakened. By measuring the received light intensity, the mass flow rate passing through the cotton conveying pipe 6 can be indirectly measured. The receiving circuit board 424 converts the light intensity signal into an electrical signal so that the subsequent circuit can process and calculate it to obtain the final output measurement value.
[0096] When assembling the receiver 42, first face the flat surface of the five receiving lenses 422 toward the inside of the receiving shell 421 and fix them in the lens groove of the receiving shell 421 with hot melt adhesive. Then fix the receiving protective plate 423 in the protective plate groove of the receiving shell 421 with hot melt adhesive, and just do not contact the receiving lens 422. At this time, the receiving lens 422 is protected by the receiving protective plate 423, preventing dust, defoliants, and grass leaves from adhering to the lens during actual operation. Then install the receiving circuit board 424 in the receiving shell 421 and fix it with bolts. At this time, the photoelectric sensor faces the receiving lens 422 and is at the focus of the lens, focusing the collimated light emitted by the transmitter 41 to the photoelectric sensor. Then install the receiving sealing ring 425 in the sealing ring groove of the receiving rear cover 426. The diameter, groove depth and groove width of the receiving sealing ring 425 all meet national standards. The side of the receiving rear cover 426 with the sealing ring groove faces the interior of the receiver 42 housing. The receiving rear cover 426 and receiving housing 421 are assembled together and secured with bolts to complete the assembly of the receiver 42. The transmitting housing 411 and the receiving housing 421 each have four threaded holes on their left and right sides, which are used to connect to the first connecting member 43 and the second connecting member 44 via bolts, respectively. The temperature compensation spacer 45 connects to the corresponding threaded holes on the second connecting member 44, forming a temperature compensation channel isolated from the detection channel.
[0097] See also Figure 6 and Figure 7 , Figure 6 This is a structural diagram of the first connecting member 43 according to an embodiment of the present invention. Figure 7 This is a schematic diagram of the second connector 44 and the calibration channel baffle structure according to one embodiment of the present invention. Before a cotton picker is put into field operation, the real-time yield measurement device 4 must be installed on the cotton conveying pipe 6. In this embodiment, the transmitter 41, receiver 42, and temperature compensation channel baffle are bolted together using the first and second connectors 43, 44. The device is then secured to the cotton conveying pipe 6 of the cotton picker using bolts and nuts through the corresponding, identically arranged connection holes on the first and second connectors 43, 44. The real-time yield measurement device 4 is bolted together using the mounting holes on the first and second connectors 43, 44 and the threaded holes on the transmitter 41 and receiver 42. This ensures the four components are positioned and aligned before installation on the cotton picker. This addresses the issue of insufficient optical path alignment accuracy caused by limited installation space in existing technologies and improves the accuracy of the cotton picker's yield measurement sensor installation. Several equally spaced mounting holes are reserved on the first and second connectors 43, 44, allowing the real-time yield measurement device 4 to achieve stepwise adjustment of the spacing between the transmitter 41 and receiver 42, i.e., adjustable beam distance. According to the positions of the mounting holes reserved on the first connecting plate and the second connecting plate, the distance between the transmitter 41 and the receiver 42 can be adjusted in steps between 254 mm and 296 mm.
[0098] During overall installation, first bolt the transmitter 41 to the first connector 43 and the second connector 44. Connect one side of the transmitter 41's detection channel to the second connector 44, using four bolts on each side. Then, similarly, install the receiver 42 on the other end of the second connector 44, with the temperature compensation channel side of the receiver 42 positioned near the second connector 44. Finally, place the temperature compensation channel partition on the platform of the second connector 44 and secure it with bolts. Next, place the real-time production measurement device 4 on the cotton conveying duct 6, aligning the through-holes in the middle protrusions of the first and second connectors 43 and 44 with the corresponding through-holes in the cotton conveying duct 6, and connect them using bolts and nuts. Finally, connect the power and signal cables, and the installation of the real-time production measurement device 4 is complete.
[0099] See also Figure 8 , Figure 8 The figure is a schematic diagram of the calibration platform 7 of an embodiment of the present invention. The real-time production measurement device 4 needs to undergo a calibration experiment before operation to obtain a calibration relationship with higher fitting and anti-interference properties. The calibration experiment is performed on the calibration platform 7. The calibration platform 7 of the real-time production measurement device 4 of the present invention is used for the calibration of the real-time production measurement device 4, and includes: a stand 71; a simulated cotton conveying pipe 72, which is installed on the stand 71, and the real-time production measurement device 4 is installed on the simulated cotton conveying pipe 72; one end of the simulated cotton conveying pipe 72 is connected to a fan 75, and the other end of the simulated cotton conveying pipe 72 is provided with a blocking net 76; a cotton feeding port 74 is provided on the simulated cotton conveying pipe 72; and a cotton feeding conveyor belt 73, which is provided corresponding to the cotton feeding port 74.
[0100] Before the experiment, ensure that the real-time production measurement device 4 and the host computer are receiving data normally. Set the power of fan 75 to ensure consistency during the experiment. Evenly spread the cotton on the cotton conveyor belt 73 and set the conveying speed of the cotton conveyor belt 73. Start fan 75. After the host computer receives stable detection data, start the cotton feeding conveyor belt 73. The cotton on it enters the pipeline through the cotton feeding port 74 on the simulated carding pipeline. Under the blowing of fan 75, it flows through the real-time production measurement device 4 and is finally collected by the wire barrier 76.
[0101] See also Figure 9 and Figure 10 , Figure 9 This is a schematic diagram of a random forest regression model according to an embodiment of the present invention. Figure 10 The output calibration method of the real-time production measurement device 4 of the present invention uses the above-mentioned calibration platform to calibrate the real-time production measurement device 4, and includes the following steps:
[0102] Step S100, obtaining a calibration experiment data set; setting the power of the fan 75, the conveying speed of the cotton conveyor belt 73, and the length and mass of the flat cotton on the cotton conveyor belt 73;
[0103] Step S200: Data processing to construct a data set, temperature compensation is performed on each detection channel, and effective value extraction is performed on the temperature-compensated data of each detection channel to obtain an effective data sequence; features of the effective data sequence are extracted to complete the construction of the data set; and
[0104] Step S300, training model, using the random forest algorithm improved by Sparrow Search, training to obtain an optimized random forest regression model to fit the yield measurement and yield relationship of the cotton picker, which is used for the cotton picker to obtain the cotton yield harvested within a unit distance in real time.
[0105] The following formula is used to perform temperature compensation on each detection channel:
[0106]
[0107] in, is the time series data set after temperature compensation in the i-th calibration test; is the time series data set of the jth detection channel in the i-th calibration test; is the time series data set of the temperature compensation channel in the i-th calibration test.
[0108] In this embodiment, when using the random forest model for regression analysis, the sparrow algorithm is used to find the optimal parameters. The characteristic dimensions of the sparrow population are set as the number of trees and depth. The number of optimization iterations is set. The upper and lower bounds and initial values of the number of trees and depth are set, and the parameters are adaptively optimized within the set range. The mean square error of label quality is used as the fitness function to evaluate the model regression effect after each parameter update. The mean square error of label quality is calculated using the following formula:
[0109]
[0110] Among them, m i ——The mass of cotton in the i-th calibration test.
[0111] After obtaining the adaptive number of random forest trees through the sparrow search algorithm, the random forest is generated. Since the final goal is to obtain a regression model, the Gini coefficient is no longer used as the branching condition, but the mean square error of the split point is used as the judgment standard. The established data set is randomly divided into a validation set and a training set in a ratio of 1:3. Using the given parameter initial values and the divided training set data, the minimum mean square error is used as the judgment standard for the split point. When training any node of the random forest decision tree, the minimum split variable and split point are found. For a certain feature A, the split point satisfies the following formula:
[0112]
[0113] Among them, v is the optional division point of each feature, c1 is the mean of the sample labels of the dataset D1, c2 is the mean of the sample labels of the dataset D2, and y i is the label mean in the data set, x i is the value of this feature.
[0114] After completing the training of M base models, the validation set data is input for prediction to obtain the final random forest regression model:
[0115]
[0116] Among them, M is the number of decision trees in the random forest, and G is the output of each decision tree for the input validation set feature data.
[0117] In this embodiment, step S100 performs a calibration experiment to obtain a data set. The cotton passes through the real-time yield measurement device 4 within a specified unit time. The five detection channels of the receiver 42 have a change sequence of the radiation intensity of the photoelectric sensor within this period of time. (n is the time series number, i is the experiment number, and the upper right corner is the detection channel number) and the data of the temperature compensation channel are It is necessary to conduct multiple experiments. In each experiment, the power of the fan 75, the conveying speed of the cotton feeding conveyor belt 73, and the length of the cotton laid flat on the cotton feeding conveyor belt 73 remain unchanged. The mass of cotton on the cotton feeding conveyor belt 73 needs to be quantitatively increased each time.
[0118] Step S200: Data processing. Since the data of the temperature compensation channel includes the influence of temperature on the LED emitter tube and the influence of photoelectric sensor drift, each detection channel and the temperature compensation channel are differentiated to complete the temperature compensation. The compensation formula is as follows:
[0119]
[0120] Extract the effective value of the data of each channel after temperature compensation, that is, remove the data sequence after temperature compensation of each experiment The two segments before and after the cotton have not passed through the sequence data. Calculate the difference between the two consecutive data before and after each group of sequences. If the difference is greater than the set threshold, the data after the sequence number is valid, and the data after it is retained to complete the interception of the previous segment of data. The same method is used to intercept the data after the segment. Get the valid data sequence
[0121] Extract the features of the valid data sequence and calculate the range, variance and integral of each valid data sequence for each experiment. According to the data of each experiment, five ranges, variances and integrals can be obtained, a total of 15 features, which will correspond to the cotton mass m of the experiment. i As labels for these features, we get a piece of data in the training dataset. We process the data of each experiment as above to complete the construction of the dataset.
[0122] In step S300, the model is trained using the Random Forest (RF) algorithm, an ensemble algorithm composed of decision trees and belonging to the bagging type. During the training process, random feature selection is introduced, sampling the training set to obtain multiple training subsets. A base learner is then trained based on each sampled training subset. By combining the base learners, a more effective model is ultimately obtained through voting or averaging. The Sparrow Search Algorithm (SSA) was primarily inspired by the foraging and anti-predator behaviors of sparrows. The Sparrow Search Algorithm takes all factors within a population into account, enabling the sparrows in the population to move toward a global optimum, rapidly converging near this optimal value. The algorithm's convergence rate is evident from the outset of the optimization process. When using a random forest model for regression analysis, the setting of the number of trees and depth parameters in the random forest is subject to significant human subjectivity, which can affect the accuracy of the model during training. Therefore, the Sparrow Search Algorithm is used to find the optimal parameters, resulting in a more effective regression model.
[0123] Set the characteristic dimension of the sparrow population to 2 dimensions, which are the number of trees and the depth; set the number of optimization iterations to 30 generations; set the upper and lower bounds of these two characteristic parameters, and adaptively optimize the parameters within the set range; set the initial value of the parameter; and use the mean square error of the label quality:
[0124]
[0125] As a fitness function, it is used to evaluate the model regression effect after each parameter update.
[0126] The established dataset is randomly divided into a validation set and a training set with a ratio of 1:3. Using the given parameter initial values and the divided training set data, the minimum mean square error is used as the judgment criterion for the split point.
[0127] When training the nodes of any randomly generated decision tree, for a certain feature A, the partition point should satisfy the following formula:
[0128]
[0129] Among them, v is the optional division point of each feature, c1 is the mean of the sample labels of the dataset D1, c2 is the mean of the sample labels of the dataset D2, and y i is the label mean in the data set, x i is the value of this feature.
[0130] After completing the model training, input the validation set data for prediction. After each decision tree gets the output, use the following formula to get the final regression result:
[0131]
[0132] Among them, M is the number of decision trees in the random forest, and G is the output of each decision tree for the input validation set feature data.
[0133] The predicted results are compared with the validation set's labeled data, and the mean squared error (MSE), or "population fitness," is calculated. This updates the positions of each sparrow within the population. After the position update, new modeling parameters are obtained. These parameters are then incorporated into the model, and the model is trained again. The mean squared error (MSE) between the new model's output and the validation set is calculated until the set number of iterations is reached. The search algorithm determines the modeling parameters that minimize the MSE, and the final random forest model is trained, completing the calibration experiment.
[0134] During operation, the cotton picker's picking head 3 removes the cotton stalks from the cotton stalks. The harvested bolls are then transported to the cotton storage bin 5 via the negative pressure cotton conveyor 6. The real-time yield measurement device 4 then begins to monitor the quality of the cotton flowing through the conveyor 6. Radiation intensity data from the five detection channels, along with temperature and drift correction data from the one temperature compensation channel, are transmitted to the STM32F103RCT6 microcontroller via the IIC communication protocol. Temperature compensation is first performed internally within the microcontroller, with the radiation intensity data from the temperature compensation channel subtracted from the data from the five detection channels. The six-channel detection data is then output via the CAN bus, in two batches, within one sampling cycle of the photoelectric sensor. This output data is received by a host computer and then, using a random forest regression model optimized with the Sparrow algorithm obtained in pre-operation calibration tests, is used to derive real-time cotton yield data for each unit distance covered by the cotton picker.
[0135] Of course, the present invention may have many other embodiments. Without departing from the spirit and essence of the present invention, those skilled in the art may make various corresponding changes and modifications based on the present invention, but these corresponding changes and modifications should all fall within the scope of protection of the claims attached to the present invention.
Claims
1. A method for calibrating the yield of a cotton picker's real-time yield measurement device, characterized in that: The steps include: S100, obtaining a calibration experiment data set; setting the fan power, the conveying speed of the cotton conveyor belt, and the length and mass of the cotton laid on the cotton conveyor belt; S200, data processing to construct a data set, temperature compensation for each detection channel, effective value extraction of the temperature-compensated data of each detection channel to obtain an effective data sequence; extracting features of the effective data sequence to complete the construction of the data set; as well as S300, training a model, using a random forest algorithm improved by Sparrow Search, to train an optimized random forest regression model to fit the yield measurement relationship of the cotton picker, so that the cotton picker can obtain the cotton yield harvested within a unit distance in real time; The following formula is used to perform temperature compensation on each detection channel: in, is the time series data set after temperature compensation in the i-th calibration test; is the time series data set of the jth detection channel in the i-th calibration test; is the time series data set of the temperature compensation channel in the i-th calibration test; The established data set was randomly divided into a validation set and a training set in a ratio of 1:
3. When using the random forest model for regression analysis, the sparrow algorithm was used to find the optimal parameters. The characteristic dimensions of the sparrow population were set as the number of trees and depth. The number of optimization iterations was set. The upper and lower bounds and initial values of the number of trees and depth were set. The parameters were adaptively optimized within the set range. The mean square error of label quality was used as the fitness function to evaluate the model regression effect after each parameter update. The mean square error (MSE) of label quality was calculated using the following formula: Among them, m is the cotton mass of the calibration experiment; n is the number of validation set data divided; m i is the actual cotton mass in the i-th calibration test; is the cotton quality predicted by the model in the i-th calibration experiment.
2. The yield calibration method of the real-time yield measurement device for a cotton picker according to claim 1, characterized in that: Using the parameter values obtained by optimization and the divided training set data, the minimum mean square error is used as the judgment standard for the division point; when training the nodes of any decision tree of the random forest, for a certain feature A, the division point G(A, v) satisfies the following formula: Among them, v is the optional division point of each feature, c1 is the mean of the sample labels of the dataset D1, c2 is the mean of the sample labels of the dataset D2, and y i is the label mean in the data set, x i is the value of this feature.
3. The yield calibration method of the real-time yield measurement device of the cotton picker according to claim 2, characterized in that: After completing the model training, input the validation set data for prediction to obtain the final random forest regression model F: Among them, M is the number of decision trees in the random forest, and G is the output of each decision tree for the input validation set feature data.
4. A real-time yield measurement device for a cotton picker, characterized in that: The yield calibration method according to any one of claims 1 to 3 is used to perform real-time yield calibration. The real-time yield measurement device is installed on the cotton conveying pipe of the cotton picker through a first connecting member and a second connecting member, and comprises: a transmitter, two ends of which are respectively connected to one end of the first connector and one end of the second connector; a receiver, arranged corresponding to the transmitter, with both ends of the receiver connected to the other end of the first connector and the other end of the second connector, respectively; a plurality of one-to-one corresponding detection channels and a temperature compensation channel are evenly distributed between the transmitter and the receiver, and the temperature compensation channel is located at one end of the transmitter and the receiver close to the second connector; and A temperature compensation baffle is installed on the second connecting member and has two ends connected to the transmitter and the receiver respectively. The temperature compensation baffle separates the temperature compensation channel from all the detection channels.
5. The real-time yield measurement device for cotton pickers according to claim 4, characterized in that: The transmitter comprises: Launch casing; An emitting lens is mounted on an emitting lens mounting plate, and the emitting lens mounting plate is located in the emitting housing; An emission protection plate is mounted on the front end surface of the emission housing corresponding to the emission lens mounting plate and is used to protect the emission lens; an emitting circuit board, mounted in the emitting housing and located behind the emitting lens mounting plate, wherein the LED radiation source of the emitting circuit board faces the emitting lens and is located at the focal point of the emitting lens, and the emitted light path is in a collimated state; and The launch rear cover plate is installed on the rear end surface of the launch shell and encloses a closed space together with the launch shell and the launch protection plate.
6. The real-time yield measurement device for a cotton picker according to claim 4 or 5, characterized in that: The receiver comprises: receiving housing; A receiving lens is mounted on a receiving lens mounting plate, and the receiving lens mounting plate is located in the receiving housing; a receiving protection plate, mounted on the front end surface of the receiving housing corresponding to the receiving lens mounting plate, and used for protecting the receiving lens; a receiving circuit board, mounted in the receiving housing and located behind the receiving lens mounting plate, wherein the photoelectric sensor of the receiving circuit board faces the receiving lens and is located at the focus of the receiving lens, and the received light path is in a collimated state; and The receiving rear cover is mounted on the rear end surface of the receiving shell and encloses a closed space together with the receiving shell and the receiving protection plate.
7. A calibration platform for a real-time yield measurement device for a cotton picker, characterized in that: The method for calibrating the real-time production measurement device according to any one of claims 4 to 6 comprises: Stand; A simulated cotton conveying pipeline is installed on the platform, and the real-time production measurement device is installed on the simulated cotton conveying pipeline; a fan is connected to one end of the simulated cotton conveying pipeline, and a barrier net is provided at the other end of the simulated cotton conveying pipeline; a cotton feeding port is provided on the simulated cotton conveying pipeline; and The cotton feeding conveyor belt is arranged corresponding to the cotton feeding port.
8. A cotton picker, characterized in that: The device comprises the real-time production measurement device according to any one of claims 4 to 6.
Citation Information
Patent Citations
Grain yield distribution information measurement method and device
CN102379189A