Cottonseed variety rapid identification device and method based on near infrared spectrum and generative adversarial network
The device and method for rapid identification of cotton seed varieties by combining near-infrared spectrometer and generative adversarial network with convolutional neural network solves the problem of complex and time-consuming cotton seed variety identification, and realizes automated, rapid and accurate identification of cotton seed varieties.
Patent Information
- Application Number
- CN202511183303.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-22
- Publication Date
- 2025-12-09
AI Technical Summary
Existing methods for identifying cottonseed varieties are complex, time-consuming, and prone to contamination. Furthermore, traditional spectroscopic methods are difficult to accurately identify the internal components of cottonseeds, and insufficient sample size affects model performance.
A rapid cotton seed variety identification device and method were established by using a near-infrared spectrometer combined with a generative adversarial network (GAN-CNIRD) and a convolutional neural network (CNN), acquiring cotton seed spectral data through a fiber optic probe, and using a PLC controller to control cotton seed delivery and classification.
It enables automated, rapid, and accurate identification of cottonseed varieties, avoiding the contamination and time-consuming problems of traditional methods, and improving identification efficiency and accuracy.
Smart Images

Figure CN121082575A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of cotton seed identification, in particular to a cotton seed variety rapid identification device and method based on near-infrared spectroscopy and a generative adversarial network. BACKGROUND
[0002] China is a major cotton producing country, and there are more than 170 varieties of cotton at present, each of which has significant differences in yield and fiber quality. However, the management of the cotton seed circulation chain is not standardized, and the mismatching and counterfeiting of varieties directly affect the yield, quality and disease resistance of cotton, so it is very important to identify different varieties of cotton seeds in order to protect the economic benefits of the cotton industry.
[0003] At present, the variety identification of cotton seeds mainly relies on traditional chemical analysis method to analyze the protein or DNA in the seed, which is complex, labor-intensive, time-consuming and prone to pollution. In order to solve this problem, researchers collected the Raman spectrum of different cotton seed varieties, extracted the characteristics and developed a prediction model for different varieties, and the accuracy of the prediction model can reach 94%, which confirms that the surface of the cotton seed shell contains information about the variety of the cotton seed, but Raman spectrum mainly reflects the Raman scattering of matter to light, making it difficult to detect the internal components of the cotton seed;
[0004] In order to obtain the optical properties of cotton seed kernels and cotton seed shells at the same time, researchers tried to use near-infrared spectroscopy to successfully detect the gossypol content in cotton seeds, with a determination coefficient (R2) of 0.9331, and combined with partial least squares regression to detect the protein and fatty acid composition, with a determination coefficient greater than 0.8, indicating that near-infrared spectroscopy can extract variety information from the surface of the cotton seed. However, only extracting optical property parameters is not enough to identify the variety of cotton seeds, and a cotton seed classification model needs to be established to distinguish the variety of cotton seeds, and generally the larger the sample size, the better the model performance. However, collecting data is time-consuming and labor-intensive, and the sample size is small, so it is very important to efficiently establish a rapid detection model for cotton seed variety information.
[0005] Therefore, there is an urgent need for a device and method that can effectively establish cotton seed variety information and quickly identify the variety of cotton seeds based on near-infrared spectroscopy. SUMMARY
[0006] The purpose of the present application is to provide a cotton seed variety rapid identification device and method based on near-infrared spectroscopy and a generative adversarial network to solve the problems raised in the background art.
[0007] The purpose of the present application can be achieved by the following technical solutions:
[0008] The application discloses a cotton seed variety rapid identification device based on near-infrared spectroscopy and a generative adversarial network.
[0009] A cotton seed classification wheel disc is arranged below the optical fiber probe, and a wheel disc feeding port in the form of an annular array is formed in the outer surface of the cotton seed classification wheel disc, and the wheel disc feeding port is used for accommodating cotton seeds.
[0010] A cotton seed conveying mechanism is arranged between the optical fiber probe and the cotton seed classification wheel disc in the box body, and the cotton seed conveying mechanism comprises a turnover table capable of being turned over and horizontally moved, and the turnover table is used for moving cotton seeds to the lower side of the spectrum acquisition mechanism to collect near-infrared spectra, and after the variety of the cotton seeds is verified, the cotton seeds are conveyed to the wheel disc feeding port through turnover.
[0011] Preferably, a PLC controller and a control panel are arranged outside the box body and are electrically connected.
[0012] Preferably, a cotton seed feeding port is formed in the top of the box body, a vibration screen is fixedly arranged inside the box body and below the cotton seed feeding port, an optical sensor is arranged in the vibration screen, and the vibration screen is used for screening out the excess impurities carried by the cotton seeds.
[0013] A cotton brushing assembly is arranged inside the box body and below the vibration screen discharge port, the cotton brushing assembly comprises a containing bin body, the containing bin body is fixedly arranged in the box body, a rotatable cotton brushing roller is arranged in the containing bin body, a discharge port is arranged at the bottom of the containing bin body, and a closable baffle is arranged at the bottom of the discharge port.
[0014] Preferably, the cotton seed conveying mechanism further comprises a lead screw motor and a key groove guide rod fixedly arranged in the box body, the output end of the lead screw motor is fixedly connected with a driving lead screw, a sliding piece is arranged at the bottom of the turnover table, a lead screw guide groove and a guide key are formed in the sliding piece, the driving lead screw is threadedly connected with the lead screw guide groove, and the key groove guide rod is slidably connected with the guide key.
[0015] Preferably, a turnover shaft is arranged at the bottom of the turnover table, the outer shell part of the turnover shaft is fixedly arranged on the sliding piece, an axle body is rotatably connected to the inner part of the turnover shaft, one connecting shaft is fixedly arranged on the axle body, a 45° rotation opening is arranged on the outer shell part corresponding to the connecting part of the connecting shaft, and one end of the connecting shaft is rotatably connected with the turnover table through the rotation opening, so that the turnover table can be rotatably connected above the sliding piece through the turnover shaft.
[0016] The inside of the box body is fixedly provided with a turnover motor, and the front end of the shaft body of the turnover shaft is provided with a transmission connection hole connectable with the turnover motor, and the transmission connection hole and the driving end of the turnover motor are both rhombic in design and are aligned in the horizontal direction.
[0017] The top of the turnover table is provided with a storage bin, and an inclined structure with an inclination angle of 20°-30° is reversely arranged from the edge position to the inside of the storage bin.
[0018] Preferably, the wheel disc inlet is rotatably connected with a rotating tray inside, the lower half of the rotating tray is provided with a semispherical structure containing an axis for controlling the position of the rotating gravity center, and the upper half is provided with a groove for containing cotton seeds falling thereinto, wheel disc outlets in annular array are arranged on both sides of the cotton seed classification wheel disc, and the wheel disc outlets and the wheel disc inlets are arranged in one-to-one correspondence.
[0019] The inside of the box body is fixedly provided with a rotating shaft motor, the wheel disc rotating shaft is fixedly connected to the output end of the rotating shaft motor, the center of the cotton seed classification wheel disc is provided with a rotating disc shaft hole, and the wheel disc rotating shaft is fixedly connected to the inner wall of the rotating disc shaft hole for driving the cotton seed classification wheel disc to rotate.
[0020] Preferably, the box body is provided with a pneumatic mechanism, the pneumatic mechanism comprises a gas pump fixed to the bottom of the box body and a plurality of pneumatic nozzles, the gas outlet of the gas pump is fixedly provided with a sorting air injection pipe, the sorting air injection pipe is fixedly connected to the pneumatic nozzles, and the pneumatic nozzles are arranged in correspondence with the wheel disc outlets.
[0021] Preferably, the cotton seed variety rapid identification method based on near-infrared spectroscopy and generative adversarial network comprises the following steps:
[0022] S1, sample preparation;
[0023] S2, data acquisition and processing;
[0024] S3, a cotton seed near-infrared spectroscopy data acquisition platform is built, and near-infrared spectroscopy data of cotton seeds are collected by the acquisition platform and saved;
[0025] S4, the collected cotton seed near-infrared spectroscopy information is expanded and processed by using the improved GAN-CNIRD, and the existing cotton seed near-infrared spectroscopy data is enhanced;
[0026] S5, the enhanced cotton seed near-infrared spectroscopy data is preprocessed, and denoising and standardization are adopted to generate an enhanced cotton seed near-infrared spectroscopy data set;
[0027] S6, extract the characteristic wavelength of the cottonseed spectrum, use the CARS feature selection based on the enhanced cottonseed spectrum data set to screen the characteristic wavelength, use the CNN network to train the cottonseed variety model, and integrate the trained cottonseed variety model into the software system developed based on Qt, and deploy the software system to the computer through the software system;
[0028] S7, cottonseed variety recognition:
[0029] The improved GAN-CNIRD is used to expand the collected cottonseed spectrum information, the selected characteristic wavelength is used as input, the CNN network is trained, and the model is established, the models of different varieties are identified, and the classification of cottonseed varieties is completed, and different varieties of cottonseed are identified and screened.
[0030] Preferably, in step S6, the collected cottonseed near-infrared spectrum data is expanded and processed, specifically including the following steps:
[0031] An improved generative adversarial network is built and the generator and discriminator structures are designed, wherein the generator network generates false data matching the dimension of the real cottonseed NIR spectrum, including 1 fully connected layer, 2 one-dimensional transpose convolution layers, and 3 one-dimensional convolution layers; the discriminator network outputs the discrimination probability of true and false through the input cottonseed NIR data, including 2 fully connected layers and 2 one-dimensional convolution layers; the collected cottonseed NIR data is processed based on the improved GAN-CNIRD to generate corresponding cottonseed NIR spectrum data;
[0032] The Euclidean distance method is used to measure the similarity of the generated data, and the variety with the highest similarity is selected as the label of the generated data after calculation;
[0033] The generated virtual cottonseed NIR spectrum data is merged with the real samples to form an enhanced data set, and the SPXY algorithm is used to divide the training set and the test set to ensure balanced data distribution;
[0034] The multiplicative scatter correction MSC is used to eliminate scattering noise, and the spectral data is normalized and standardized to improve accuracy.
[0035] Preferably, in step S6, the method for selecting the characteristic wavelength of the cottonseed near-infrared spectrum and establishing the cottonseed variety model of the convolutional neural network is as follows:
[0036] The CARS algorithm is used to respond to the characteristic wavelength points of the cottonseed variety information, the Monte Carlo sampling number in the CARS algorithm is set to 100 times, the key wavelength is selected through the partial least squares regression coefficient, and the characteristic wavelength corresponding to the minimum cross-validation root mean square error is selected;
[0037] A 7-layer CNN network is constructed using one-dimensional convolution for the cotton seed variety classification model, including 1 input layer, 3 one-dimensional convolution layers, 2 one-dimensional maximum pooling layers, 1 full connection layer and 1 output layer, wherein the convolution kernel size of the three one-dimensional convolution layers is set to 3, the kernel number is set to 16, 64 and 128; the size of the two one-dimensional maximum pooling layers is set to 2; the near-infrared spectrum data training set processed above is combined with the extracted characteristic wavelength to establish the CNN network cotton seed variety classification model.
[0038] The beneficial effects of the present application are:
[0039] In the present application, the computer controls the PLC controller to control the cotton seed impurity removal mechanism and the cotton seed conveying mechanism to remove and convey the cotton seeds, and then the near-infrared spectrometer is relied on to complete the acquisition of spectrum data, and the data is fed back to the externally connected computer, the computer determines the variety of the cotton seeds through the developed software system, and the software system automatically controls the PLC controller, and then the PLC controller controls the operation of the cotton seed classification wheel disc and the pneumatic nozzle, so that different varieties of cotton seeds are identified and screened.
[0040] The rapid identification device and method disclosed by the present application further process the cotton seeds by means of a vibrating screen, a cotton brushing roller and the like, acquire spectrum data by means of a near-infrared spectrometer, generate identification data of the cotton seeds by means of an adversarial network, construct a cotton seed variety identification model based on a CNN network, and then control the cotton seed classification wheel disc by means of a PLC controller, so that different varieties of cotton seeds are classified and screened out, the cotton seeds of different varieties are accurately separated without damaging the cotton seeds, and the automatic identification of the cotton seeds is realized. BRIEF DESCRIPTION OF DRAWINGS
[0041] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or the prior art description will be briefly introduced as follows, and obviously, other drawings can also be obtained by those skilled in the art without any creative effort on the basis of these drawings;
[0042] Figure 1 It is a schematic diagram of the overall structure of the present application;
[0043] Figure 2 It is a schematic diagram of the overall structure of the present application; Figure 1
[0044] Figure 3 It is a schematic diagram of the overall structure of the present application; Figure 1
[0045] Figure 4 It is a schematic diagram of the overall structure of the present application; Figure 1
[0046] Figure 5 For the invention Figure 1 Top view of the drive screw and keyway guide rod portion.
[0047] The reference signs in the drawings are as follows:
[0048] 1, photoelectric sensor; 2, brush roller; 2001, containing bin; 3, drop port; 4, drive screw; 5, screw motor; 6, wheel disc rotating shaft; 7, rotating shaft motor; 8, PLC controller; 9, box roller; 10, air pump; 11, sorting air jet pipe; 12, pneumatic nozzle; 13, discharge port; 14, cotton seed classification wheel disc; 15, keyway guide rod; 16, overturning motor; 17, overturning storage bin; 18, optical fiber probe; 19, near infrared spectrometer; 20, vibrating screen; 100, storage bin; 101, elastic limiting rod; 102, overturning shaft; 103, screw guide groove; 104, guide key; 105, transmission connection hole; 106, sliding piece; 200, wheel disc inlet; 201, rotating tray; 202, rotating disc shaft hole; 204, wheel disc discharge port; 300, box; 301, cotton seed inlet; 302, box door; 303, socket; 304, control panel. DETAILED DESCRIPTION
[0049] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the present application.
[0050] With reference to Figures 1 to 5 The present application provides a cotton seed variety rapid identification device based on near infrared spectroscopy and generative adversarial network, comprising;
[0051] The box 300 is the shell of the device, and needs to be provided with a dark box environment by using light-tight sealing materials. Four box rollers 9 capable of changing directions are arranged at the bottom of the box 300, thereby improving the portability. A control panel 304 connected with the PLC controller 8 is arranged on the outside of the box 300, so as to control the logical setting. In an emergency, the PLC controller 8 can be directly controlled through the control panel 304, thereby directly controlling the operation of the equipment. A socket is arranged for connecting the PLC controller 8 with an external computer. The PLC controller 8 is also connected with the electrical equipment inside the box 300, so as to control the electrical equipment. An openable box door 302 is arranged on one side of the box 300, so as to facilitate the replacement and installation of part of the device. It should be noted that the box door 302 cannot be opened during the operation of the device.
[0052] The PLC controller 8 is connected with an external computer through a socket arranged on the box door 302, and is used for controlling the cooperative operation of various mechanisms and classifying and identifying the cottonseed varieties by means of the externally connected computer software system. The PLC controller 8 mainly controls the operation of the lower vibration screen 20 and the cotton brushing roller 2 by using the cottonseed signals obtained by the photoelectric sensor 1, so as to realize the impurity removal treatment of the cottonseed, moves the cottonseed to the spectral collection area by means of the cottonseed conveying mechanism, and then transmits the cottonseed information collected by the near-infrared spectrometer 19 to the software system arranged in the external computer, and finally controls the rotation of the cottonseed classification wheel 14 by means of the PLC controller 8, so as to realize the classification and screening of the cottonseed;
[0053] The cottonseed conveying mechanism is arranged at the lower end of the material falling port 3, and is used for conveying the cottonseed falling from the material falling port 3 to the area where the optical fiber probe 18 is arranged to collect spectral data. Meanwhile, the turnover table 17 is moved to be connected with the diamond structure of the driving shaft of the turnover motor 16 through the transmission connection hole 105, so as to facilitate the subsequent turnover of the cottonseed to the cottonseed classification wheel 14 for classification and screening of the cottonseed.
[0054] The pneumatic mechanism comprises a gas pump 10 and a plurality of pneumatic nozzles 12, and in this embodiment, there are three pneumatic nozzles 12. The gas pump 10 is arranged at the lowermost end of the box body 300, and is used as a gas source for the pneumatic nozzles 12. The gas pump 10 is connected with the pneumatic nozzles 12 through the sorting air injection pipe 11. After the cottonseed classification wheel 14 identifies different types of cottonseed and moves to the corresponding position of the cottonseed, the pneumatic nozzles 12 are controlled by the PLC controller 8 to blow air to the wheel discharge port 204 of the corresponding position, so as to blow the cottonseed along the discharge port 13. The discharge port 13 is provided with three groups, which are respectively corresponding to the wheel discharge ports 204 of the lower half of the cottonseed classification wheel 14. The discharge ports 13 are separated from each other, and each discharge port 13 is connected with an independent pipeline outside to convey the blown cottonseed.
[0055] The spectral collection mechanism comprises an optical fiber probe 18 matched with a near-infrared spectrometer 19. The optical fiber probe 18 is provided with a light source to collect the near-infrared spectrum of the cottonseed. The near-infrared spectrometer 19 can transmit the collected spectral data to the externally connected computer, and verify the variety of the cottonseed by means of the software system in the computer.
[0056] The cottonseed impurity removal mechanism is installed at the top end of the box body 300, and is used for removing the residual cotton and dust and other small particles on the surface of the cottonseed, so as to reduce the interference of the extra factors on the spectral data collection, improve the collection accuracy of the near-infrared spectrum, and also avoid the damage of the cottonseed identification mechanism caused by the small particles.
[0057] The cotton seed classification wheel disc 14 is a regular hexagonal structure, arranged in the lower half of the box body, and can classify and identify the cotton seeds after collecting the spectrum information in the storage bin 100. After the cotton seeds fall into the rotating tray 201 through the wheel disc inlet 200, the wheel disc rotates through the wheel disc shaft 6, and the corresponding variety of cotton seeds is moved to the wheel disc outlet 204. Then, the cotton seeds are blown out by the pneumatic nozzle 12 to achieve the classification effect.
[0058] Specifically, as shown in Figure 1 To ensure the accuracy of the near-infrared spectrometer 19, light-blocking baffles are arranged on both sides of the area where the fiber probe 18 is located to form a dark box environment. The light-blocking baffles are special parts, which are opaque plastic in this case, uniformly sprayed with black paint inside and outside, and fixed at the lower sides of both ends of the near-infrared spectrometer.
[0059] Further, the wavelength range of the SupNIR-1500 model of the near-infrared spectrometer 19 is 1000 to 1800 nm, and the spectral resolution is 1 nm. The fiber probe 18 is a device matched with the near-infrared spectrometer 19. The near-infrared spectrometer 19 is connected with the external computer using a USB data line to transmit the collected spectrum data between them. The USB data line is matched with the near-infrared spectrometer 19.
[0060] Specifically, the external computer is responsible for processing the data collected by the near-infrared spectrometer 19 and processing, and combining the software system with the pre-established model to identify the variety of cotton seeds. Then, the logical program is designed to further control and process the PLC controller 8. The computer should be equipped with spectrum data processing software and PLC controller 8 programming software. The spectrum data processing process of the spectrum processing software includes:
[0061] Reading near-infrared spectrum data;
[0062] Pretreating and enhancing the near-infrared spectrum data;
[0063] Selecting characteristic wavelengths;
[0064] Importing the enhanced data into the trained model for evaluation;
[0065] Identifying different varieties of cotton seeds according to the cotton seed variety database.
[0066] Further optimization scheme, the cotton seed impurity removal mechanism includes:
[0067] Vibration screen 20, the lower end of the cotton seed inlet 301 is connected with vibration screen 20, vibration screen 20 is prior art, it is confirmed through sensor whether there is cotton seed into identification device inside, again through the vibration of screen cloth, the excess impurities carried by cotton seed are screened out, for ensuring the accuracy of subsequent collection of cotton seed near infrared spectrum data, wherein, the size of the screen mesh aperture needs to be smaller than the cotton seed to ensure that the impurities are removed without removing the cotton seed, the length of the cotton seed is about 3mm, and the width is about 4.5mm, so the diameter of the screen mesh is set to 2mm;
[0068] Brush cotton assembly, set below the discharge port of the vibration screen 20, the brush cotton assembly includes a containing bin 2001, the containing bin 2001 is fixed to the inside of the box body 300, the inside of the containing bin is provided with a rotatable brush roller 2, driven by the servo motor arranged at the rear of the containing bin 2001, when the processed cotton seed falls into the middle of the two brush rollers 2, the two brush rollers 2 rotate at the same time to remove the excess cotton on the cotton seed and then leak out the cotton seed, for ensuring that too much cotton on the cotton seed affects the result of data collection, and avoiding the phenomenon that multiple cotton seeds are adhered due to too much cotton, due to size reasons, the gap between the two brush rollers 2 should be about 4mm;
[0069] The blanking port 3 is fixed below the containing bin 2001, and the bottom is provided with an openable baffle, the openable baffle is prior art, which can be driven by an electric telescopic rod to open and close horizontally, or driven by a motor to rotate and open and close, the baffle can be controlled to open and close by the signal transmitted by the PLC controller 8, and the baffle remains open only when the storage bin 100 is located at the lower end of the blanking port 3, so as to prevent the cotton seed from falling empty into the device when the subsequent turnover table 17 moves, the size of the upper end of the blanking port 3 should be slightly larger than that of the brush roller 2, and the size of the lower end should be slightly larger than that of the cotton seed, and in the case, a square profile with a side length of 5mm is set;
[0070] Further optimization scheme, the cotton seed classification wheel disc 14 includes:
[0071] Wheel disc inlet 200, arranged at the middle position of the regular hexagonal outer contour, can sequentially take and simultaneously process six cotton seeds for variety classification identification with the rotation of the wheel disc rotating shaft 6;
[0072] Rotary tray 201, arranged inside the wheel disc inlet 200, the lower half is arranged as a semispherical structure containing the axis to control the position of the rotating center of gravity, and the rotating shaft connected with the cotton seed classification wheel disc 14 is arranged at the central rotating position, and the upper half is arranged as a groove for containing the cotton seed falling therein;
[0073] Wheel disc shaft hole 202, set in the center of cotton seed classification wheel disc 14, inside to connect wheel disc rotating shaft 6 of rotating shaft motor 7, can drive the whole cotton seed classification wheel disc 14 to rotate, size can be adjusted according to the size of cotton seed classification wheel disc 14;
[0074] Wheel disc discharge port 204, set in the lower end corresponding to wheel disc feeding port 200 of cotton seed classification wheel disc 14, in order to avoid the structure not compact leading to cotton seed leakage, set as half of the regular hexagonal structure containing the partition plate used to fix the axis of rotating tray 201, this structure can ensure that the three positions of the lower end of the cotton seed are blown out through pneumatic nozzle 12, while the three positions of the upper end are not affected;
[0075] Specifically, since the cotton seed classification wheel disc 14 is set as a regular hexagon in the case, at most six cotton seeds can be processed at the same time, and three kinds of cotton seeds can be classified, if more cotton seeds are to be processed at the same time, the discharge, feeding port, sorting air pipe 11 and pneumatic nozzle 12 of the wheel disc can be increased in proportion, but the invention can only be designed to classify three kinds of cotton seeds;
[0076] Further, in the above case, the rotating tray 14 carrying the cotton seeds can be of any size larger than the cotton seeds, and in the embodiment, a square profile with a side length of 5mm is set;
[0077] Further, the center of gravity of rotating tray 201 should be set in the lower half of the rotating shaft area, more specifically, below the lower half of the rotating shaft, which is connected to the side of rotating tray 201 (not shown in the figure), the center position of the bottom annular opening of wheel disc feeding port 200, to ensure that the upper end of rotating tray 201 is light and the lower end is heavy, so that rotating tray 201 itself can not be affected by the rotation of cotton seed classification wheel disc 14, and always keep the opening upward, so as to realize that the cotton seeds can fall into the wheel disc feeding port 200 at the top end, while the cotton seeds will not fall off at the remaining positions;
[0078] Further optimization scheme, cotton seed conveying mechanism includes:
[0079] Lead screw motor 5, installed at the first end of driving lead screw 4, used to control the rotation of driving lead screw 4;
[0080] Driving lead screw 4, engaged with the threads of lead screw guide slot 103, converts its rotary motion through the rotation of lead screw motor 5, and controls the linear movement of turnover table 17 in combination with keyway guide rod 15;
[0081] Keyway guide rod 15, a linear positioning mechanism, slidingly matched with guide key 104, to constrain the overall position of turnover table 17, to prevent the overall rotation of turnover table 17 caused by the rotation of driving lead screw 4;
[0082] The turnover table 17 is mainly used for moving the cotton seeds from the discharge port of the cotton seed impurity removal mechanism to the area where the spectrum collection mechanism is located. The turnover table 17 is installed on the lead screw guide groove 103 and the key groove guide rod 15 through the lead screw guide groove 103 and the guide key 104 at the lower end of the turnover table 17, so that linear reciprocating motion along the lead screw guide groove 103 can be realized,
[0083] An inclined structure with an inclination angle of 20°-30° is reversely arranged in the edge position of the corresponding storage bin 100 to the inside thereof. After the turnover table 17 is turned over by 45°, the inclined structure can make the cotton seeds fall into the wheel disc discharge port 200, and can also prevent the cotton seeds in the storage bin 100 from falling off when the storage bin 100 moves along the driving lead screw 4. After the turnover, the cotton seeds fall into the cotton seed classification wheel disc 14 for classification processing. The size of the storage bin 100 only needs to be larger than the cotton seed, and can be designed by itself. In the case, the size of the storage bin 100 is set to a square with a side length of 8 mm.
[0084] Further optimization scheme, as shown in Figure 2 The turnover table 17 includes:
[0085] The storage bin 100 is installed at the uppermost end of the turnover table 17, and is used for storing the cotton seeds to be processed and as part of the turnover of the turnover table 17.
[0086] The elastic telescopic member 101 includes a sleeve with an open top. The bottom of the sleeve is rotatably connected to the sliding member 106. A tension spring is fixedly connected to the inside bottom of the sleeve. The top of the tension spring is fixedly connected to a limiting rod. The top of the limiting rod is fixed to the bottom of the turnover table 17, and extends to the outside of the sleeve.
[0087] The elastic telescopic member 101 is installed at the rear bottom position of the turnover table 17 which needs to be turned over, supports and connects the storage bin 100, and can ensure that the storage bin 100 does not turn over in the left and right directions along with the turnover shaft 102 when the storage bin 100 moves linearly along the driving lead screw 4. The circular ring structure at the bottom ensures that the angle changes with the turning over of the turnover table. Meanwhile, the telescopic rod inside is driven to extend by the turning over of the turnover table 17. After the turning over is completed, the turnover table 17 is returned to the normal position by the contraction of the limiting rod. The maximum length of the telescopic rod limits the maximum turning angle of the turnover table 17 to 45°. The fixed tube length of the telescopic rod should be the distance between the turnover table 17 and the lower end of the lead screw guide groove 103.
[0088] The turnover shaft 102 is arranged at the bottom of the turnover table 17. The outer shell of the turnover shaft 102 is fixed to the sliding member 106. The shaft body is rotatably connected inside the outer shell. A connecting shaft is fixed to the shaft body. The connecting shaft is connected to a 45° rotating opening on the outer shell. One end of the connecting shaft is rotatably connected to the turnover table 17 through the rotating opening. The turnover table 17 is rotatably connected above the sliding member 106 through the turnover shaft 102.
[0089] The front end of the shaft body has a transmission connection hole 105 which can be connected to the turnover motor 16. After the turnover table 17 moves to the spectrum collection area, the prismatic structure in the transmission connection hole 105 is connected to the drive shaft of the turnover motor 16 (the end of the drive shaft of the turnover motor 16 is designed as a rhombus). The turnover motor 16 is used to rotate the shaft body inside the turnover shaft 102. The shaft body drives the turnover table 17 to turn.
[0090] The screw guide groove 103 is arranged at the left side of the lower end of the turnover table 17. The drive screw 4 is installed inside the screw guide groove 103. The screw motor 5 is used to rotate the drive screw 4 to make the guide groove rotate forward along the thread.
[0091] The guide key 104 is arranged at the right side of the lower end of the turnover table 17. The key groove guide rod 15 is installed inside the guide key 104. The guide key 104 is used to limit the rotational movement of the turnover table 17 when the drive screw 4 rotates and moves. The turnover table 17 only moves linearly.
[0092] The transmission connection hole 105 is arranged at the part of the turnover shaft inside the turnover table 17 which is connected to the upper end storage bin 100. The hole is connected to the transmission shaft of the turnover motor 16 through the prismatic structure. The movement of the turnover motor 16 can drive the storage bin 100 to rotate. The transmission shaft of the drive screw 4 can be connected to the corresponding position of the transmission shaft of the turnover motor 16. The rotation of the turnover shaft 102 is controlled by the turnover motor 16. The size of the hole changes with the selection of the turnover motor 16. The turnover motor 16 is a general part.
[0093] The photoelectric sensor 1 is installed at the center of the vibrating screen 20. The photoelectric sensor 1 is used to detect whether there are cotton seeds in the vibrating screen 20. The PLC controller 8 controls and processes the cotton seeds. The photoelectric sensor 1 is a general part.
[0094] Specifically, the process of the cotton seed falling into the turnover table 17 after the turnover is as follows: after the turnover table 17 moves to the upper end of the wheel disc inlet 200, the spectral detection of the cotton seed is completed through the optical fiber probe 18 connected with the near-infrared spectrometer 19; after the PLC controller 8 determines that the movement of the cotton seed classification wheel disc 14 is completed through the connected signal, the turnover motor 16 is controlled to start and drive the turnover shaft 102 to rotate through the transmission connection hole 105, so that the turnover table 17 is turned over by 45°; at the same time, due to the light weight of the cotton seed in the storage bin 100, the 45° inclined structure inside the storage bin allows the cotton seed to automatically fall into the wheel disc inlet 200;
[0095] Specifically, the processes of better completing the treatment of the cotton seed and ensuring the batch variety identification of the cotton seed are as follows: Figure 3 As shown in the figure, due to the symmetrical arrangement of the cotton seed classification tray 14, the cotton seed classification tray 14 can simultaneously enter the cotton seed and blow out the cotton seed without interference;
[0096] Referring to Figure 1 The application also provides the following scheme: a cotton seed rapid identification method based on near-infrared spectroscopy and a generative adversarial network, comprising the following steps:
[0097] S1, sample preparation;
[0098] S2, data acquisition and processing;
[0099] S3, a cotton seed near-infrared spectroscopy data acquisition platform is built, and the near-infrared spectroscopy data of the cotton seed is collected through the acquisition platform and saved;
[0100] S4, the collected cotton seed near-infrared spectroscopy information is expanded and processed using the improved GAN-CNIRD network, and the existing cotton seed near-infrared spectroscopy data is enhanced;
[0101] S5, the enhanced cotton seed near-infrared spectroscopy data is preprocessed, and the enhanced cotton seed near-infrared spectroscopy dataset is generated through denoising and standardization;
[0102] S6, the characteristic wavelength of the cotton seed spectrum is extracted, the characteristic wavelength is screened based on the enhanced cotton seed spectrum dataset using the CARS feature selection, the cotton seed variety model is trained using the CNN network, the trained cotton seed variety model is integrated into the software system developed based on Qt, and the software system is deployed to an external computer;
[0103] S7, the identification of the cotton seed variety,
[0104] The improved GAN-CNIRD network is used for extended processing of the collected cotton seed spectrum information, the selected characteristic wavelengths are used as inputs, a CNN network is trained, and a model is established, different models are identified, thereby completing the classification of cotton seed varieties, and different varieties of cotton seeds are identified and screened.
[0105] Specifically, when preparing the sample, six varieties with extremely small appearance differences and representative are selected, which are: Shengong five board cotton (SGWB), Jimi-668 (JM-668), blue Han cotton (LHM), Tahe-2 (TH-2), Lu cotton rock-17 (LMY-17) and Xipu-6 (XP-6). Among them, 75 grains of each variety are selected, totaling 450 grains; each variety of cotton seeds is coated; after reading and saving the original data file of each cotton seed on the corresponding software program provided by the near-infrared spectrometer, the near-infrared spectrum data of the cotton seed is included, in order to better process the cotton seed data on the computer 10, the deployment method of the software system includes:
[0106] QTextStream is used in Qt to read the spectrum data file content saved by the near-infrared spectrometer, and the software interface has a file reading setting function;
[0107] Communication with the PLC controller 8, the serial communication between the cotton seed variety identification software and the PLC controller 8 is realized by the QSerialPort class in Qt, and the software interface has a communication parameter setting function;
[0108] Model calling, in Qt, QFile is used to read the saved model file, and then the corresponding cotton seed variety library is used to load the model and make predictions.
[0109] Further optimization scheme, the collected cotton seed near-infrared spectrum data is expanded and processed, including the following steps:
[0110] An improved GAN-CNIRD network is built and the generator and discriminator structures are designed, wherein the generator network generates false data matching the dimension of the real cotton seed NIR spectrum, including 1 fully connected layer, 2 one-dimensional transpose convolution layers, and 3 one-dimensional convolution layers; the discriminator network outputs the probability of true or false by inputting the cotton seed NIR data, including 2 fully connected layers and 2 one-dimensional convolution layers; based on the improved GAN-CNIRD network, the collected cotton seed NIR data is processed to generate corresponding cotton seed NIR spectrum data;
[0111] The Euclidean distance method is used to measure the similarity of the generated data, and the variety with the highest similarity is selected as the label of the generated data after calculation;
[0112] The generated virtual cotton seed NIR spectrum data is merged with the real samples to form an enhanced data set, and the SPXY algorithm is used to divide the training set and the test set to ensure balanced data distribution.
[0113] The scattering noise is eliminated using the multiplication scattering correction MSC, and the spectral data is normalized to improve accuracy.
[0114] Further optimization scheme, cotton seed near infrared spectrum feature selection and establishment of convolutional neural network cotton seed variety model method, the specific steps are as follows:
[0115] The CARS algorithm is used to respond to the characteristic wavelength point of the cotton seed variety information, the Monte Carlo sampling number in the CARS algorithm is set to 100 times, the key wavelength is selected through the partial least squares regression coefficient, and the characteristic wavelength corresponding to the minimum cross-validation root mean square error is selected.
[0116] A one-dimensional convolution is used to construct a 7-layer CNN network for cotton seed variety classification model, including 1 input layer, 3 one-dimensional convolution layers, 2 one-dimensional maximum pooling layers, 1 fully connected layer and 1 output layer, wherein the convolution kernel size of the three one-dimensional convolution layers is set to 3, the kernel number is set to 16, 64 and 128; The size of the two one-dimensional maximum pooling layers is set to 2; The near-infrared spectrum data training set processed above is combined with the extracted characteristic wavelength to establish a CNN cotton seed variety classification model.
[0117] Preferably, the cotton seed variety recognition specifically comprises the following steps:
[0118] The cotton seed variety recognition method based on near-infrared spectrum and generative adversarial network in claim 1 is used, and the established software system is used to pre-establish the cotton seed variety model;
[0119] The cotton seed variety rapid recognition device based on near-infrared spectrum and generative adversarial network in claim 4 is controlled to work:
[0120] The computer controls the PLC controller 8 to control the cotton seed impurity removal mechanism and the cotton seed conveying mechanism to remove and convey the cotton seeds, and then the near-infrared spectrometer 19 completes the spectrum data acquisition, and the data is fed back to the externally connected computer. The computer determines the variety of the cotton seeds through the developed software system and the cotton seed variety model, and automatically controls the PLC controller 8 with the aid of the software system, and then controls the operation of the cotton seed classification wheel disc 14 and the pneumatic nozzle 12 through the logic control of the PLC controller 8, to realize the identification and screening of different varieties of cotton seeds.
[0121] The above shows and describes the basic principles, main features and advantages of the present application. Those skilled in the art should understand that the present application is not limited to the above-mentioned embodiments, and the above-mentioned embodiments and descriptions in the specification are only to illustrate the principles of the present application. Without departing from the spirit and scope of the present application, various changes and improvements can be made to the present application, and these changes and improvements all fall within the scope of the claimed present application.
Claims
1. A rapid cotton seed variety identification device based on near-infrared spectroscopy and generative adversarial networks, comprising a housing (300), characterized in that, A near-infrared spectrometer (19) is fixedly installed inside the housing (300). A matching fiber optic probe (18) is installed on the near-infrared spectrometer (19). The fiber optic probe (18) has its own light source for collecting near-infrared spectra of cotton seeds and verifying the variety of cotton seeds. A cottonseed sorting wheel (14) is provided below the fiber optic probe (18). The outer surface of the cottonseed sorting wheel (14) is provided with a wheel inlet (200) arranged in a ring array. The wheel inlet (200) is used to hold cottonseed. A cotton seed conveying mechanism is provided inside the housing (300) and between the fiber optic probe (18) and the cotton seed sorting wheel (14). The cotton seed conveying mechanism includes a flip-up table (17) that can be flipped and moved horizontally. The flip-up table (17) is used to move the cotton seeds to the area below the spectral acquisition mechanism for near-infrared spectral acquisition. After the cotton seed variety is acquired and verified, the flip-up table conveys the cotton seeds to the wheel feed inlet (200).
2. A rapid cotton seed variety identification device based on near-infrared spectroscopy and generative adversarial networks according to claim 1, characterized in that, The enclosure (300) is equipped with a PLC controller (8) and a control panel (304), which are electrically connected.
3. A rapid cotton seed variety identification device based on near-infrared spectroscopy and generative adversarial networks according to claim 1, characterized in that, The top of the box (300) is provided with a cottonseed inlet (301). Inside the box (300) and below the cottonseed inlet (301), a vibrating screen (20) is fixedly installed. Inside the vibrating screen (20) is a photoelectric sensor (1). The vibrating screen (20) is used to screen out excess impurities carried by the cottonseed. A brushing assembly is installed inside the housing (300) and below the discharge port of the vibrating screen (20). The brushing assembly includes a receiving chamber (2001), which is fixed inside the housing (300). A rotatable brushing roller (2) is provided inside the receiving chamber. A discharge port (3) is provided at the bottom of the receiving chamber (2001), and an openable baffle is provided at the bottom of the discharge port (3).
4. A rapid cotton seed variety identification device based on near-infrared spectroscopy and generative adversarial networks according to claim 1, characterized in that, The cotton seed conveying mechanism also includes a lead screw motor (5) and a keyway guide rod (15) fixed inside the housing (300). The output end of the lead screw motor (5) is fixedly connected to a drive lead screw (4). A sliding member (106) is provided at the bottom of the tilting table (17). A lead screw guide groove (103) and a guide key (104) are provided on the sliding member (106). The drive lead screw (4) and the lead screw guide groove (103) are threadedly connected, and the keyway guide rod (15) and the guide key (104) are slidably connected.
5. A rapid cottonseed variety identification device based on near-infrared spectroscopy and generative adversarial networks according to claim 4, characterized in that, A flipping shaft (102) is provided at the bottom of the flipping table (17). The outer shell of the flipping shaft (102) is fixed to the sliding member (106), and a shaft is rotatably connected inside. A connecting shaft is fixed on the shaft. The corresponding part of the connecting shaft has a 45° rotating opening on the outer shell. One end of the connecting shaft passes through the rotating opening and is rotatably connected to the flipping table (17), so that the flipping table (17) can be rotatably connected above the sliding member (106) through the flipping shaft (102). A flip motor (16) is fixedly installed inside the housing (300). The front end of the flip shaft (102) has a transmission connection hole (105) that can be connected to the flip motor (16). Both the transmission connection hole (105) and the drive end of the flip motor (16) adopt a diamond design. The transmission connection hole (105) and the drive end of the flip motor (16) are aligned in the horizontal direction. The top of the tilting table (17) is provided with a storage bin (100), and the edge of the storage bin (100) is provided with an inclined structure with an inclination angle of 20°-30° in the opposite direction to its interior.
6. A rapid cotton seed variety identification device based on near-infrared spectroscopy and generative adversarial networks according to claim 5, characterized in that, The inner part of the wheel feed port (200) is rotatably connected to a rotating tray (201). The lower half of the rotating tray (201) is configured as a hemispherical structure containing an axis to control the position of the rotation center of gravity, and the upper half is configured as a groove to hold the cotton seeds falling into it. The cotton seed sorting wheel (14) has wheel discharge ports (204) arranged in a ring array on both sides. The wheel discharge ports (204) and the wheel feed port (200) are set in a one-to-one correspondence. A rotating shaft motor (7) is fixedly installed inside the housing (300). The output end of the rotating shaft motor (7) is fixedly connected to a wheel shaft (6). A wheel shaft hole (202) is opened at the center of the cotton seed sorting wheel (14). The wheel shaft (6) and the inner wall of the wheel shaft hole (202) are fixedly connected to drive the cotton seed sorting wheel (14) to rotate.
7. A rapid cotton seed variety identification device based on near-infrared spectroscopy and generative adversarial networks according to claim 6, characterized in that, The housing (300) is equipped with a pneumatic mechanism, which includes an air pump (10) fixed to the bottom of the housing (300) and multiple pneumatic nozzles (12). A sorting jet pipe (11) is fixedly installed at the air outlet of the air pump (10). The sorting jet pipe (11) and the pneumatic nozzles (12) are fixedly connected. The pneumatic nozzles (12) and the wheel discharge port (204) are correspondingly arranged.
8. A rapid cotton seed variety identification device based on near-infrared spectroscopy and generative adversarial networks according to any one of claims 1-7, characterized in that, A rapid cotton seed variety identification method based on near-infrared spectroscopy and generative adversarial networks includes the following steps: S1. Sample preparation; S2, Data Acquisition and Processing; S3. Build a cotton seed near-infrared spectral data acquisition platform, collect and save the cotton seed near-infrared spectral data through the acquisition platform; S4. The collected cotton seed near-infrared spectral information is extended using the improved GAN-CNIRD to enhance the existing cotton seed near-infrared spectral data. S5. Preprocess the enhanced cotton seed near-infrared spectral data, and use denoising and normalization to generate an enhanced cotton seed near-infrared spectral dataset. S6. Extract the characteristic wavelengths of cottonseed spectra, use CARS feature selection based on the enhanced cottonseed spectrum dataset to screen the characteristic wavelengths, use CNN network to train cottonseed variety models, integrate the trained cottonseed variety models into a software system developed based on Qt, and deploy the software system to a computer. S7. Identification of cottonseed varieties: The improved GAN-CNIRD is used to expand the collected cotton seed spectral information. The selected characteristic wavelengths are used as input to train a CNN network and build a model. The model is used to distinguish different varieties, thereby completing the classification of cotton seed varieties and identifying and screening different varieties of cotton seeds.
9. A method for rapid identification of cottonseed varieties based on near-infrared spectroscopy and generative adversarial networks according to claim 8, characterized in that, In step S6, the collected cotton seed near-infrared spectral data are expanded, specifically including the following steps: An improved generative adversarial network (GAN-CNIRD) was constructed, and the generator and discriminator structures were designed. The generator network generates fake data that matches the dimensions of the real cotton seed NIR spectrum, including one fully connected layer, two one-dimensional transposed convolutional layers, and three one-dimensional convolutional layers. The discriminator network outputs the probability of distinguishing between real and fake data based on the input cotton seed NIR data, including two fully connected layers and two one-dimensional convolutional layers. Based on the above improved GAN-CNIRD, the collected cotton seed NIR data is processed to generate the corresponding cotton seed NIR spectral data. The similarity of the generated data was measured using the Euclidean distance method, and the variety with the highest similarity was selected as the label for the generated data after calculation. The generated virtual cottonseed NIR spectral data was merged with real samples to form an augmented dataset. The SPXY algorithm was used to divide the training set and the test set to ensure a balanced data distribution. Multiplicative scattering correction (MSC) is used to eliminate scattering noise, and the spectral data is normalized to improve accuracy.
10. A method for rapid identification of cotton seed varieties based on near-infrared spectroscopy and generative adversarial networks according to claim 9, characterized in that, In step S6, the specific steps for feature selection of cotton seed near-infrared spectra and the establishment of a convolutional neural network cotton seed variety model are as follows: The CARS algorithm is used to reflect the characteristic wavelength points of cottonseed variety information. The number of Monte Carlo sampling in the CARS algorithm is set to 100. Key wavelengths are screened by partial least squares regression coefficients, and the characteristic wavelengths corresponding to the minimum cross-validation root mean square error are selected. A 7-layer CNN network was constructed using one-dimensional convolutions for a cottonseed variety classification model, including one input layer, three one-dimensional convolutional layers, two one-dimensional max pooling layers, one fully connected layer, and one output layer. The kernel size of the three one-dimensional convolutional layers was set to 3, and the number of kernels was set to 16, 64, and 128. The size of the two one-dimensional max pooling layers was set to 2. The CNN network cottonseed variety classification model was established by training the near-infrared spectral data with the above-processed data and combining it with the extracted feature wavelengths.