Cotton seed quality online detection method, device, system and storage medium
By generating target images through air-coupled ultrasonic signals and performing image classification, the problem of non-destructive testing for cotton seed detection is solved, enabling effective detection of the quality of slightly damaged cotton seeds and achieving non-destructive testing of cotton seed quality. This also solves the problem of online detection of cotton seed quality and enables non-destructive testing of cotton seed quality.
Patent Information
- Application Number
- CN202210908438.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-29
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2042-07-29
AI Technical Summary
Existing cotton seed testing methods are destructive, inefficient, and time-consuming, and are particularly difficult to effectively detect the quality of slightly damaged cotton seeds. Traditional methods cannot detect the quality of slightly damaged cotton seeds. Existing technologies cannot detect the quality of slightly damaged cotton seeds.
Non-destructive testing is performed using air-coupled ultrasonic signals. Target images are generated using these signals, and a trained cotton seed quality detection model is used for image classification, enabling online detection of cotton seed quality.
It enables non-destructive testing of cotton seed quality, effectively identifying slightly damaged cotton seeds and improving the efficiency and accuracy of online cotton seed sorting.
Smart Images

Figure CN115456939B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of agriculture, and in particular to a cotton seed quality online detection method, device, system and storage medium. BACKGROUND
[0002] Cotton is an important economic crop in the world. After cotton is harvested, cotton seeds will go through a series of processes such as ginning and dehairing, which may cause damage to the epidermis of the cotton seeds. In addition, during the process of removing excess lint from the cotton seeds, foam acid is usually used, which can enter the cotton seeds through the damaged parts of the epidermis of the cotton seeds, resulting in a decrease in the germination rate of the cotton seeds after sowing. After the cotton seeds are sown, water will also enter the interior of the cotton seeds through the damaged parts of the epidermis of the cotton seeds, further reducing the germination rate of the cotton seeds. Therefore, the quality of the cotton seeds is an important factor that determines the yield and quality of cotton.
[0003] In actual production, in order to reduce the waste of cotton seeds, the automatic precision sowing technology of cotton seeds has been widely applied. Through the production mode of accurate sowing, cotton fields do not need to be thinned or consider the treatment of inconsistent individual growth and development. Therefore, precision sowing of cotton can significantly reduce the production cost of cotton, improve the efficiency of field management, and realize standardized planting. However, this technology puts forward higher requirements for the quality of cotton seeds, and the quality detection of cotton seeds becomes crucial.
[0004] Traditional cotton seed detection methods are destructive, inefficient, time-consuming and non-automatic. Agricultural production urgently needs to develop a rapid, high-throughput and non-destructive seed quality detection method. In recent years, machine vision non-destructive detection technology has gradually become a new method for detecting seed quality. However, in practical application, machine vision technology can only detect severely damaged cotton seeds, and it is extremely difficult for the human eye to distinguish slightly damaged cotton seeds, and simple machine vision technology cannot effectively detect them.
[0005] Therefore, how to better detect the quality of cotton seeds has become a technical problem to be solved in the industry. SUMMARY
[0006] The present application provides a cotton seed quality online detection method, device, system and storage medium, which can better detect the quality of cotton seeds.
[0007] The present application provides a cotton seed quality online detection method, which comprises:
[0008] In the case where the quality category of the to-be-tested cotton seed is determined not to belong to the first quality category, an air-coupled ultrasonic signal for detecting the quality of the to-be-tested cotton seed is acquired;
[0009] Based on the air-coupled ultrasonic signal, a target image is generated;
[0010] input the target image into the trained cotton seed quality detection model, and output a target quality category of the cotton seed to be detected;
[0011] The trained cotton seed quality detection model is obtained according to training of a target image sample; the target image sample is obtained by acquiring the target image of the cotton seed sample of the second quality category and the target image of the cotton seed sample with an undamaged epidermis; the epidermal damage degree of the cotton seed of the first quality category is greater than the epidermal damage degree of the cotton seed of the second quality category.
[0012] According to the cotton seed quality online detection method provided by the application, a target image is generated based on the air-coupled ultrasonic signal, including:
[0013] The air-coupled ultrasonic signal is subjected to variational mode decomposition to obtain a plurality of intrinsic mode functions;
[0014] A target function matrix is constructed based on the plurality of intrinsic mode functions;
[0015] The target image is generated based on an extracted feature vector of the target function matrix.
[0016] According to the cotton seed quality online detection method provided by the application, the target image is generated based on the extracted feature vector of the target function matrix, including:
[0017] The feature vector is extracted column by column from the target function matrix in a preset order, and a polyline is generated based on each column of the feature vector extracted each time; the color or gray scale of the polyline is determined based on a preset color order or gray scale order;
[0018] A plurality of polylines are generated based on a plurality of columns of the feature vector extracted column by column;
[0019] The number of the plurality of columns of the feature vector is determined based on the length of the air-coupled ultrasonic signal; and the target image includes the plurality of polylines.
[0020] According to the cotton seed quality online detection method provided by the application, before the air-coupled ultrasonic signal used for detecting the quality of the cotton seed to be detected is acquired, in the case that the quality category of the cotton seed to be detected does not belong to the first quality category, the method further includes:
[0021] A plurality of images of the cotton seed to be detected under different shooting angles are acquired, and the plurality of images are spliced to generate a composite image;
[0022] The composite image is input into a trained target detection model, and a quality category of the cotton seed to be detected is output;
[0023] The trained target detection model is obtained according to cotton seed image samples carrying a label of severe damage of epidermis, and is used for identifying cotton seeds belonging to the first quality category.
[0024] According to the cotton seed quality online detection method provided in the application, the background image of the target image is generated based on a first quantity of air-coupled ultrasonic signals corresponding to the cotton seeds of the second quality category and a second quantity of air-coupled ultrasonic signals corresponding to the cotton seeds without damaged epidermis.
[0025] The application further provides a cotton seed quality online detection device.
[0026] The acquisition module is configured to acquire an air-coupled ultrasonic signal for detecting the quality of the to-be-tested cotton seeds in a case where the quality category of the to-be-tested cotton seeds is determined to not belong to the first quality category.
[0027] The generation module is configured to generate a target image based on the air-coupled ultrasonic signal.
[0028] The output module is configured to input the target image into a trained cotton seed quality detection model and output a target quality category of the to-be-tested cotton seeds.
[0029] The trained cotton seed quality detection model is obtained after training based on target image samples; the target image samples are obtained by acquiring the target image of the cotton seed samples of the second quality category and the target image of the cotton seed samples without damaged epidermis; and the epidermis damage degree of the cotton seeds of the first quality category is greater than the epidermis damage degree of the cotton seeds of the second quality category.
[0030] The application further provides a cotton seed quality online detection system.
[0031] The cotton seed slide, the first photoelectric switch, the air-coupled ultrasonic signal acquisition unit and the control unit.
[0032] The cotton seed slide comprises a first detection station.
[0033] The air-coupled ultrasonic signal acquisition unit comprises an air-coupled ultrasonic acquisition controller, an air-coupled ultrasonic transducer transmitting end, an air-coupled ultrasonic transducer receiving end and an amplifier.
[0034] The first photoelectric switch and the air-coupled ultrasonic signal acquisition unit are arranged in sequence along the sliding direction of the cotton seed slide; and the air-coupled ultrasonic transducer transmitting end and the air-coupled ultrasonic transducer receiving end are symmetrically arranged in the vertical direction of the first detection station.
[0035] The cotton seed slide is used for delivering the to-be-tested cotton seeds.
[0036] The first photoelectric switch is configured to send a detection signal of the passing cotton seed to the control unit, so as to trigger the control unit to control the operation of the air-coupled ultrasonic signal acquisition unit.
[0037] The air-coupled ultrasonic transducer transmitting end is configured to transmit original air-coupled ultrasonic signals to the cotton seed in the first detection station.
[0038] The air-coupled ultrasonic transducer receiving end is configured to receive target air-coupled ultrasonic signals after the original air-coupled ultrasonic signals penetrate the cotton seed.
[0039] The amplifier is configured to receive and amplify the target air-coupled ultrasonic signals, and send the amplified target air-coupled ultrasonic signals to the air-coupled ultrasonic acquisition controller.
[0040] The air-coupled ultrasonic acquisition controller is configured to send the amplified target air-coupled ultrasonic signals to the control unit.
[0041] The control unit is configured to, in a case where it is determined that the cotton seed does not belong to the first quality category, determine a target quality category of the cotton seed based on the amplified target air-coupled ultrasonic signals; the target quality category includes a second quality category or a quality category with no damaged epidermis; the damaged epidermis degree of the cotton seed of the first quality category is greater than the damaged epidermis degree of the cotton seed of the second quality category.
[0042] The control unit includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the program to realize the cotton seed quality online detection method as described above.
[0043] According to the cotton seed quality online detection system provided by the application, the first photoelectric switch, the second photoelectric switch, the first camera module, and the second camera module are arranged in the second detection station.
[0044] The first camera module, the second camera module, and the second photoelectric switch.
[0045] The cotton seed slide further includes a second detection station.
[0046] In the sliding direction of the cotton seed slide, the second detection station is located at the rear end of the first detection station; and the second photoelectric switch, the first camera module, and the second camera module are arranged in sequence at the rear end of the first photoelectric switch; the first camera module and the second camera module are symmetrically arranged in the vertical direction of the second detection station; and the second photoelectric switch is arranged on the cotton seed slide.
[0047] The first camera module and the second camera module are used to collect images of the to-be-tested cotton seeds in the first detection station and send the images of the to-be-tested cotton seeds to the control unit.
[0048] The second photoelectric switch is used to send a detection signal of a passing to-be-tested cotton seed to the control unit to trigger the control unit to control the operation of the first camera module and the operation of the second camera module.
[0049] The control unit is used to determine the first quality category of the to-be-tested cotton seed based on the images of the to-be-tested cotton seed.
[0050] The application further provides a non-transitory computer-readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the cotton seed quality online detection method.
[0051] The application further provides a computer program product, which comprises a computer program, and the computer program is executed by a processor to implement the cotton seed quality online detection method.
[0052] The cotton seed quality online detection method, device, system and storage medium provided by the application can effectively realize online nondestructive detection and accurate classification of the quality of the to-be-tested cotton seed, can not cause damage to the cotton seed, can effectively detect the slightly damaged cotton seed, can effectively screen the undamaged intact cotton seed, and greatly improves the efficiency of the cotton seed online sorting. BRIEF DESCRIPTION OF DRAWINGS
[0053] In order to more clearly illustrate the technical solutions in the application or prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are some embodiments of the application, and for those skilled in the art, other drawings can also be obtained from these drawings without creative labor.
[0054] Figure 1 is a flowchart of the cotton seed quality online detection method provided by the application;
[0055] Figure 2is a structural schematic diagram of a cotton seed quality online detection system provided by the application;
[0056] Figure 3 is a structural schematic diagram of a cotton seed quality online detection device provided by the application;
[0057] Figure 4 is a physical structure schematic diagram of a control unit in a cotton seed quality online detection system provided by the application. DETAILED DESCRIPTION
[0058] To make the objectives, technical solutions and advantages of the present application clearer, the technical solutions in the present application will be described below in conjunction with the accompanying drawings in the present application. Obviously, the described embodiments are only some 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 of ordinary skill in the art without creative work fall within the scope of protection of the present application.
[0059] In the description of the application, it should be noted that, unless otherwise explicitly specified and limited, the terms "mounting", "connection" and "linking" should be understood in a broad sense, for example, can be fixed connection, can also be detachable connection, or integrally connected; can be mechanical connection, can also be electrical connection; can be directly connected, can also be indirectly connected through an intermediate medium, can be the communication inside two elements. For those of ordinary skill in the art, the specific meaning of the above terms in the present application can be understood according to the specific circumstances.
[0060] The cotton seed quality online detection method, device, system and storage medium of the present application will be described below in conjunction with Figures 1-4
[0061] Figure 1 is a flowchart of a cotton seed quality online detection method provided by the application, as shown in Figure 1 , including steps 110, 120 and 130.
[0062] Step 110, in the case of determining that the quality category of the to-be-tested cotton seed does not belong to the first quality category, acquiring an air-coupled ultrasonic signal for detecting the quality of the to-be-tested cotton seed;
[0063] Specifically, in the embodiments of the present application, the quality category of the to-be-tested cotton seed includes a first quality category, a second quality category and a quality category with no skin damage. The skin damage degree of the cotton seed under the first quality category is greater than the skin damage degree of the cotton seed under the second quality category.
[0064] In the embodiments of the present application, the first quality category can represent a quality category with severe skin damage of the cotton seed, and the second quality category can represent a quality category with slight skin damage of the cotton seed.
[0065] The air-coupled ultrasonic signal described in the embodiments of the present application refers to an ultrasonic signal that is directly coupled through air without the need for a coupling agent and is detected in a non-contact manner.
[0066] It should be noted that the cotton seeds of the first quality category, i.e., the cotton seeds with severely damaged epidermis, can be effectively detected by machine vision methods, but it is also extremely difficult for the human eye to distinguish the cotton seeds with slightly damaged epidermis, and simple machine vision technology cannot effectively detect the cotton seeds.
[0067] In the embodiments of the present application, an air-coupled ultrasonic signal acquisition unit based on air coupling can be arranged to obtain an air-coupled ultrasonic signal for detecting the quality of the cotton seeds to be detected. The acquisition method can adopt a penetration method, i.e., the cotton seeds to be detected are placed between the two probes, i.e., the air-coupled ultrasonic transducer transmitting end and the air-coupled ultrasonic transducer receiving end, and the probes are symmetrically arranged on both sides of the cotton seeds to be detected to ensure that the ultrasonic waves can penetrate the cotton seeds to be detected vertically.
[0068] In the embodiments of the present application, the air-coupled ultrasonic transducer transmitting end emits ultrasonic signals, which penetrate the cotton seeds to be detected through the air coupling agent, and then enter the air-coupled ultrasonic transducer receiving end through the air coupling agent. The receiving end amplifies the received air-coupled ultrasonic signals through a preamplifier to send the amplified air-coupled ultrasonic signals as the air-coupled ultrasonic signals for detecting the quality of the cotton seeds to be detected to the control unit for processing. Thus, the control unit can obtain the air-coupled ultrasonic signals for detecting the quality of the cotton seeds to be detected.
[0069] It can be understood that the air-coupled ultrasonic signals for detecting the quality of the cotton seeds to be detected are one-dimensional air-coupled ultrasonic signals, which are generated by detecting the ranging and positioning of the cotton seeds.
[0070] Step 120, generating a target image based on the air-coupled ultrasonic signals;
[0071] Specifically, the target image described in the embodiments of the present application refers to a two-dimensional image obtained by signal processing of the air-coupled ultrasonic signals and signal image drawing using a drawing function.
[0072] In the embodiments of the present application, after obtaining the air-coupled ultrasonic signals for detecting the quality of the cotton seeds to be detected, the air-coupled ultrasonic signals can be processed and drawn into a signal image to generate a target image.
[0073] Based on the content of the above embodiments, as an optional embodiment, generating a target image based on the air-coupled ultrasonic signals includes:
[0074] The air-coupled ultrasonic signals are subjected to variational mode decomposition to obtain a plurality of intrinsic mode functions.
[0075] Construct the objective function matrix based on multiple intrinsic moduli;
[0076] The target image is generated based on the feature vectors extracted from the objective function matrix.
[0077] It should be noted that a single-component signal with a specific physical interpretation is called an intrinsic mode function, also known as an intrinsic mode function (IMF).
[0078] Variational Mode Decomposition (VMD) is a signal decomposition and estimation method. In the process of obtaining the decomposed components, this method determines the frequency center and bandwidth of each component by iteratively searching for the optimal solution of the variational model, thereby adaptively achieving frequency domain partitioning of the signal and effective separation of each IMF component.
[0079] Specifically, the objective function matrix described in the embodiments of the present invention refers to an intrinsic mode function matrix composed of multiple intrinsic mode functions obtained by variational mode decomposition of air-coupled ultrasonic signals, which are vectors of intrinsic mode functions.
[0080] Furthermore, in an embodiment of the present invention, after acquiring the air-coupled ultrasonic signal used to detect the quality of the cotton seed to be tested, the air-coupled ultrasonic signal can be subjected to VMD processing to obtain multiple intrinsic mode functions. Assuming the obtained intrinsic mode functions are M, to achieve variational mode decomposition of the signal, the objective function and constraint conditions of the variational constraint model are first constructed according to the following formula:
[0081] ;
[0082] in, This indicates the collected air-coupled ultrasonic signal. This represents the intrinsic modulo functions that need to be obtained. Represents the Dirac function, This refers to the convolution operation in signal processing. represents an imaginary number, Describes the Euclidean norm ( norm), This represents the center frequency corresponding to the intrinsic modulus function.
[0083] Then, the constrained variational optimization problem is transformed into an unconstrained optimization problem as shown in the following formula:
[0084] ;
[0085] in, represents a quadratic penalty factor, and represents a Lagrange multiplier.
[0086] Further, by solving the unconstrained optimization problem, M eigenmode functions can be obtained.
[0087] Further, for the M eigenmode functions obtained as described above, an eigenmode function matrix is constructed according to the following formula, that is, a target function matrix is constructed, that is, there is:
[0088] ;
[0089] wherein, to M eigenmode functions, and the M mode functions constitute a target function matrix S .
[0090] Further, in an embodiment of the present application, eigenvectors can be extracted from the target function matrix, and according to the color categories or gray categories defined and set in advance, a two-dimensional image of each eigenvector is drawn according to the extracted eigenvectors, and a target image is generated.
[0091] Based on the content of the above embodiment, as an optional embodiment, the target image is generated based on the eigenvectors extracted from the target function matrix, and includes:
[0092] According to a preset order, eigenvectors are extracted from the target function matrix column by column, and based on each column of eigenvectors extracted each time, a polyline is generated; the color or gray scale of the polyline is determined based on a preset color filling order or gray scale filling order;
[0093] Based on the multiple columns of eigenvectors extracted column by column, multiple polylines are generated;
[0094] The number of multiple columns of eigenvectors is determined based on the length of the air-coupled ultrasonic signal; and the target image includes multiple polylines.
[0095] Specifically, in an embodiment of the present application, the target image includes multiple polylines, that is, the target image is composed of multiple polylines.
[0096] In an embodiment of the present application, based on the target function matrix S , eigenvectors can be extracted from the target function matrix S column by column, as follows:
[0097] ;
[0098] Each column of eigenvectors is represented by , to L column vectors, the L column vectors can be regarded as signal features and can be used to draw a two-dimensional image.
[0099] It should be noted that each column vector extracted in the embodiment of the present application contains the signal characteristics of M eigenmode functions.
[0100] Optionally, in the embodiment of the present application, in order to ensure efficient detection efficiency and high precision, M can be 3, so that 3 eigenmode functions can be used as elements of the target function matrix, and according to each column vector of the extracted target function matrix, a colored or gray line is drawn on a white background.
[0101] In the embodiment of the present application, the drawing function can be:
[0102] ;
[0103] In the embodiment of the present application, and represent the coordinate origin of the drawing plane, and represent the maximum and minimum values of the target function matrix S , and represent the width and height of the colored image range respectively, represents the th data in the th column vector in the target function matrix S.
[0104] Optionally, in the embodiment of the present application, a plurality of colors or gray scales can be defined in advance, for example, 10 different colors or 10 different gray scales can be defined, and the filling order of the 10 different colors or 10 different gray scales can be set. Thus, the 10 different colors or 10 different gray scales defined in advance can be selected, and the color or gray scale image can be repeatedly drawn based on the drawing function according to the specified color order or gray scale order.
[0105] Further, the feature vectors are extracted column by column from the target function matrix according to the preset order, for example, the feature vectors are extracted row by row from the left to the right of the target function matrix S, to obtain , and a broken line is generated based on each column of the extracted feature vectors, that is, according to each feature vector, a colored or gray line is drawn on a white background using the above drawing function, so that the colored or gray line corresponding to each feature vector can be drawn step by step based on the column-by-column extracted multiple column vectors, thereby generating a target image composed of multiple colored or gray lines, that is, the target image can be generated.
[0106] Optionally, in the embodiment of the present application, the set 10 colors and filling order are respectively red, orange, yellow, green, cyan, blue, purple, pink, gray, black, and the first to tenth broken lines are filled with red, orange, yellow, green, cyan, blue, purple, pink, gray, and black in turn, and the eleventh to twentieth broken lines are filled with red, orange, yellow, green, cyan, blue, purple, pink, gray, and black in the color filling order, and the broken lines are repeatedly drawn until the last column of feature vectors , the broken lines are drawn, and finally the target image is generated.
[0107] The method of the embodiment of the present application extracts the feature vectors column by column from the target function matrix by transposing the target function matrix, and draws a two-dimensional image according to different colors or different gray scales for each column of feature vectors, thereby realizing the conversion from one-dimensional air-coupled ultrasonic signals to two-dimensional color images or gray scale images, providing accurate image data for a subsequent cotton seed quality detection model used for detecting the quality category of cotton seeds, and being beneficial to realizing online nondestructive detection and accurate classification of the quality of the cotton seeds to be detected.
[0108] Step 130, inputting the target image into the trained cotton seed quality detection model to output the target quality category of the cotton seed to be detected;
[0109] The trained cotton seed quality detection model is obtained after training according to target image samples; the target image samples are obtained by acquiring target images of cotton seed samples of a second quality category and target images of cotton seed samples with undamaged epidermis; the epidermal damage degree of cotton seeds of a first quality category is greater than that of cotton seeds of the second quality category.
[0110] Specifically, the second quality category described in the embodiment of the present application refers to a quality category that can represent slightly damaged epidermis of cotton seeds.
[0111] The trained cotton seed quality detection model described in the present application is obtained after training according to target image samples, and is used for identifying input images converted from air-coupled ultrasonic signals, so as to realize classification of the air-coupled ultrasonic signals through image classification processing, thereby outputting the quality category of the cotton seed to be detected.
[0112] The training samples, i.e., the target image samples, are obtained by acquiring target images of cotton seed samples of a second quality category and target images of cotton seed samples with undamaged epidermis, that is, for cotton seed samples representing slightly damaged epidermis and undamaged epidermis, the air-coupled ultrasonic signals corresponding to each cotton seed sample are acquired, the air-coupled ultrasonic signals are processed through VMD, and finally the target images of each cotton seed sample are obtained through the method of converting the air-coupled ultrasonic signals into target images, thereby obtaining the target image samples used for training the cotton seed quality detection model.
[0113] It can be understood that the target quality category described in the embodiments of the present application refers to the quality classification result obtained by inputting the target image corresponding to the to-be-tested cotton seeds into the trained cotton seed quality detection model, which can be the second quality category representing the slightly damaged skin of the cotton seeds, or the quality category representing the undamaged skin of the cotton seeds.
[0114] Optionally, in the embodiments of the present application, the cotton seed quality detection model can be constructed by using a model combining convolutional neural network and Transformer. By training the cotton seed quality detection model by using multiple groups of cotton seed ultrasonic image samples, and combining the self-attention mechanism in the Transformer model and the convolutional neural network to build a classification model, the input target image is classified, the online detection and classification of the cotton seed quality are realized, the severely damaged cotton seeds and the slightly damaged cotton seeds can be effectively detected, and thus the undamaged intact cotton seeds can be effectively sorted out.
[0115] Specifically, in the embodiments of the present application, the training process of the cotton seed quality detection model can include the following steps:
[0116] S1, obtaining target images of cotton seed samples of different quality categories to obtain a cotton seed ultrasonic image sample dataset, and dividing the sample dataset into a training set, a validation set and a test set according to a set proportion, for example, 70% of the sample dataset can be taken as the training set, 10% as the validation set, and 20% as the test set;
[0117] S2, constructing a convolutional neural network model, using the convolutional neural network model to extract the features of the input image and performing feature embedding on the tensor output by the convolutional neural network model in the last stage, so that it can be connected with the Transformer module;
[0118] S3, constructing an attention analysis mechanism, equally dividing the tensor output by the convolutional neural network model in step S2 into several blocks, extracting a vector from the same position of each block, and generating an input representation of the Transformer model from the several vectors;
[0119] S4, the Transformer model is trained and learned according to the input representation, and the learned features are still converted into the form of a tensor, and then the prediction result is output through global average pooling and a classification layer;
[0120] S5, using the cotton seed ultrasonic images of the training set in step S1 to train the network model for multiple rounds, using the cotton seed ultrasonic images of the validation set to measure the model corresponding to the best round to determine the result, testing the model on the cotton seed ultrasonic images of the test set and outputting the result, thereby obtaining the best trained cotton seed quality detection model.
[0121] Further, in the embodiment of the present application, the target image obtained is input into the trained cotton seed quality detection model, the target quality category of the cotton seed to be detected can be output, the quality category of the cotton seed to be detected is determined, and the online nondestructive detection of the quality of the cotton seed to be detected and the online sorting of the cotton seed can be realized.
[0122] The cotton seed quality online detection method provided by the embodiment of the present application realizes the classification of the air-coupled ultrasonic signal by using the image classification method, so that the online nondestructive detection and accurate classification of the quality of the cotton seed to be detected can be effectively realized, the cotton seed is not damaged, and the slightly damaged cotton seed can be effectively detected, so that the undamaged and intact cotton seed can be effectively screened, and the efficiency of the online sorting of the cotton seed is greatly improved.
[0123] Based on the content of the above embodiment, as an optional embodiment, the background image of the target image is generated based on the air-coupled ultrasonic signals corresponding to the first number of the cotton seeds of the second quality category and the air-coupled ultrasonic signals corresponding to the second number of the cotton seeds with undamaged epidermis.
[0124] Specifically, the first number described in the embodiment of the present application refers to a preset number threshold for the cotton seeds of the second quality category representing the slightly damaged epidermis, which can be a system default number threshold or a number threshold set by a user, and can be set according to actual calculation requirements.
[0125] The second number described in the embodiment of the present application refers to a preset number threshold for the cotton seeds with undamaged epidermis, which can also be a system default number threshold or a number threshold set by a user, and can be set according to actual calculation requirements.
[0126] Optionally, in the embodiment of the present application, the first quantity can be valued at 100, and the second quantity can be valued at 100. In order to obtain higher online detection accuracy of cotton seeds, the background image of the target image can be improved, that is, the white background described above for generating the target image is modified. Specifically, 100 air-coupled ultrasonic data of cotton seeds with slightly damaged epidermis can be randomly selected, and 100 air-coupled ultrasonic data of intact cotton seeds with no damaged epidermis can be randomly selected. The 200 air-coupled ultrasonic signal data are drawn into color fold lines or gray fold lines according to the method described above of converting one-dimensional air-coupled ultrasonic signals into two-dimensional images, and color images or gray images are generated as background images of the target image, instead of white background images.
[0127] The method of the embodiment of the present application uses a certain number of air-coupled ultrasonic data of cotton seeds with slightly damaged epidermis and a certain number of air-coupled ultrasonic data of intact cotton seeds with no damaged epidermis to generate a color background image or a gray background image of the target image as an image reference index. The target image with the color background image or the gray background image is input to the trained cotton seed quality detection model for recognition, which can improve the recognition accuracy of cotton seeds and improve the accuracy of online detection of cotton seeds.
[0128] Based on the content of the above embodiment, as an optional embodiment, in the case where it is determined that the quality category of the to-be-detected cotton seed does not belong to the first quality category, before the air-coupled ultrasonic signal used for detecting the quality of the to-be-detected cotton seed is acquired, the method further includes:
[0129] Acquiring a plurality of images of the to-be-detected cotton seed under different shooting angles, and splicing the plurality of images to generate a composite image;
[0130] Inputting the composite image into the trained target detection model to output the quality category of the to-be-detected cotton seed;
[0131] The trained target detection model is trained according to cotton seed image samples carrying a severely damaged epidermis label, and is used for identifying cotton seeds belonging to the first quality category.
[0132] Specifically, in the embodiment of the present application, in order to improve the efficiency of online detection of a large number of cotton seeds, the entire online detection process can be divided into a machine vision detection stage and an ultrasonic detection stage. In the machine vision detection stage, the cotton seeds can be divided into two categories, one category is the cotton seeds with severely damaged epidermis, that is, the cotton seeds belonging to the first quality category, and the other category is the cotton seeds with non-severely damaged epidermis, that is, the cotton seeds representing the second quality category with slightly damaged epidermis and the cotton seeds with no damaged epidermis.
[0133] In the embodiment of the present application, in order to improve the online detection speed of cotton seeds with severely damaged epidermis, first, the machine vision detection stage is processed before the ultrasonic detection stage, and the cotton seeds of the first quality category representing the severely damaged epidermis and the cotton seeds representing the non-severely damaged epidermis are detected.
[0134] In the embodiment of the present application, the multiple images of the to-be-detected cotton seeds under different shooting angles can be obtained by using two industrial cameras to collect images from the top and bottom of the to-be-detected cotton seeds, so as to obtain more comprehensive visual information of the surface of the cotton seeds. Thus, the images shot from the top and bottom of the to-be-detected cotton seeds can be spliced to generate a composite image with rich visual information, which is beneficial to improve the detection speed and accuracy.
[0135] Further, the composite image is input into the trained target detection model, and the quality category of the to-be-detected cotton seed can be output, so as to obtain the detection result of the to-be-detected cotton seed.
[0136] In the embodiment of the present application, the target detection model can be obtained after training according to the cotton seed image samples carrying the label of severely damaged epidermis, and then being subjected to sparse training and channel pruning, and is mainly used to identify the cotton seeds belonging to the first quality category representing the severely damaged epidermis.
[0137] Optionally, in the embodiment of the present application, the target detection model can be obtained based on the YOLOv4 model. Specifically, the deep learning-based target detection model is trained according to the training label data, using the cotton seed image samples carrying the label of severely damaged epidermis to train the original model to obtain the trained detection model, and then the trained detection model is subjected to sparse processing, and according to the network after the sparse processing, the channel pruning is performed on the network line according to the set parameters, and then the layer pruning is performed to realize the compression of the network structure. After the model training and pruning, the trained target detection model is obtained, which realizes the purpose of reducing the model parameters and improving the model detection speed. Through the trained target detection model, the region of the cotton seed in the composite image can be identified, and the category information of the epidermal defect of the cotton seed in the region of the cotton seed can be given.
[0138] In the embodiment of the present application, by dividing the entire online detection process into the machine vision detection stage and the ultrasonic detection stage, the cotton seeds with severely damaged epidermis are quickly identified in the machine vision detection stage, and the cotton seeds with slightly damaged epidermis and the intact cotton seeds without damage are accurately identified in the ultrasonic detection stage, which can greatly save the time of the online detection of the cotton seeds and greatly improve the efficiency of the online detection of the cotton seeds.
[0139] The method of the embodiment of the present application is used for online detection of cotton seeds with severely damaged epidermis, and the target detection model obtained through sparse training and channel pruning is used for detection, so that the precision is ensured, the calculation amount is small, the speed is fast, the cotton seeds with severely damaged epidermis are quickly and accurately detected and sorted, and the cotton seeds with non-severely damaged epidermis are screened out, thereby providing reliable data for the next ultrasonic detection stage.
[0140] Figure 2 is a structural schematic diagram of the cotton seed quality online detection system provided by the present application, as Figure 2 indicated, the cotton seed quality online detection system can include:
[0141] a cotton seed slide 1, a first photoelectric switch 2, an air-coupled ultrasonic signal acquisition unit 3 and a control unit 4;
[0142] The cotton seed slide 1 includes a first detection station 11.
[0143] The air-coupled ultrasonic signal acquisition unit 3 includes an air-coupled ultrasonic acquisition controller 31, an air-coupled ultrasonic transducer transmitting end 32, an air-coupled ultrasonic transducer receiving end 33 and an amplifier 34.
[0144] The first photoelectric switch 2 and the air-coupled ultrasonic signal acquisition unit 3 are arranged in sequence along the sliding direction of the cotton seed slide 1; the air-coupled ultrasonic transducer transmitting end 32 and the air-coupled ultrasonic transducer receiving end 33 are symmetrically arranged in the vertical direction of the first detection station 11.
[0145] The cotton seed slide 1 is used for feeding the cotton seeds to be detected 5.
[0146] The first photoelectric switch 2 is used for sending the detection signal of the passing cotton seed to be detected to the control unit 4, so as to trigger the control unit 4 to control the operation of the air-coupled ultrasonic signal acquisition unit 3.
[0147] The air-coupled ultrasonic transducer transmitting end 32 is used for transmitting the original ultrasonic signal to the cotton seed to be detected in the first detection station 11.
[0148] The air-coupled ultrasonic transducer receiving end 33 is used for receiving the target air-coupled ultrasonic signal after the original ultrasonic signal penetrates the cotton seed to be detected.
[0149] The amplifier 34 is used for receiving and amplifying the target air-coupled ultrasonic signal, and sending the amplified target air-coupled ultrasonic signal to the air-coupled ultrasonic acquisition controller 31.
[0150] The air-coupled ultrasonic acquisition controller 31 is used for sending the amplified target air-coupled ultrasonic signal to the control unit 4; the amplified target air-coupled ultrasonic signal can be used for detecting the quality of the cotton seed to be detected.
[0151] The control unit 4 is configured to determine the target quality category of the cotton seeds to be tested based on the amplified target air-coupled ultrasonic signals in a case where it is determined that the cotton seeds to be tested do not belong to the first quality category; the target quality category includes the second quality category or the quality category with intact epidermis; the epidermis damage degree of the cotton seeds of the first quality category is greater than the epidermis damage degree of the cotton seeds of the second quality category.
[0152] Specifically, in the embodiment of the present application, the first detection station 11 for collecting air-coupled ultrasonic signals can be arranged on the cotton seed slide 1, and a thin aluminum plate with a specified thickness can be inlaid on the first detection station 11 to reduce the attenuation of the ultrasonic signals emitted by the air-coupled ultrasonic transmitting end when passing through the cotton seed bearing plate, so as to ensure that the air-coupled ultrasonic receiving end 33 can receive sufficient air-coupled ultrasonic signals.
[0153] In the embodiment of the present application, the first photoelectric switch 2 installed on the cotton seed slide 1 detects the passing of the cotton seeds to be tested 5, generates a detection signal, and can send the detection signal to the control unit 4; the control unit 4 can send a collection command of air-coupled ultrasonic signals to the air-coupled ultrasonic signal collection unit 3 through the network port after receiving the detection signal, and control the operation of the air-coupled ultrasonic signal collection unit 3.
[0154] Further, the air-coupled ultrasonic collection controller 31 in the air-coupled ultrasonic signal collection unit 3 controls the air-coupled ultrasonic transducer transmitting end 32 to emit original ultrasonic signals to the cotton seeds to be tested 5 passing through the first detection station 11, the original ultrasonic signals pass through the air coupling, pass through the thin aluminum plate on the first detection station 11 and the cotton seeds to be tested 5, and then pass through the air coupling agent to enter the air-coupled ultrasonic receiving end 33, the air-coupled ultrasonic receiving end 33 can receive the target air-coupled ultrasonic signals after the original ultrasonic signals penetrate the cotton seeds to be tested, and then the air-coupled ultrasonic receiving end 33 amplifies the received target air-coupled ultrasonic signals through the amplifier 34, and then sends the amplified target air-coupled ultrasonic signals to the air-coupled ultrasonic collection controller 31, the air-coupled ultrasonic collection controller 31 sends the collected amplified target air-coupled ultrasonic signals to the control unit 4 through the network port for processing, and detects the quality category of the cotton seeds to be tested 5.
[0155] Further, in the embodiment of the present application, in the case of determining that the to-be-tested cotton seeds do not belong to the first quality category of cotton seeds, the control unit receives the amplified target air-coupled ultrasonic signal, that is, after obtaining the air-coupled ultrasonic signal for detecting the quality of the to-be-tested cotton seeds, the air-coupled ultrasonic signal is subjected to variational mode decomposition to obtain a plurality of eigenmode functions; and based on the plurality of eigenmode functions, a target function matrix is constructed; thereby based on extracting a feature vector of the target function matrix, a target image is generated; and finally the target image is input into the trained cotton seed quality detection model to output a target quality category of the to-be-tested cotton seeds.
[0156] The cotton seed quality online detection system provided by the embodiment of the present application utilizes the characteristic that the air-coupled ultrasonic signal is sensitive to object defects, collects the air-coupled ultrasonic signal for detecting the quality of the to-be-tested cotton seeds through the air-coupled ultrasonic signal acquisition unit, and subjects the air-coupled ultrasonic signal to variational mode decomposition to obtain a plurality of eigenmode functions; based on the plurality of eigenmode functions, a target function matrix is constructed; based on extracting a feature vector of the target function matrix, a target image is generated, and the encoding process from the air-coupled ultrasonic signal to the image is utilized to convert the one-dimensional air-coupled ultrasonic signal into a two-dimensional image; and then the target image is input into the trained cotton seed quality detection model to output a target quality category of the to-be-tested cotton seeds, and the image classification method is utilized to realize the classification of the air-coupled ultrasonic signal, so that the online nondestructive detection and accurate classification of the quality of the to-be-tested cotton seeds can be effectively realized, the cotton seeds are not damaged, and the slightly damaged cotton seeds can be effectively detected, so that the undamaged intact cotton seeds can be effectively screened, and the efficiency of the cotton seed online sorting is greatly improved.
[0157] Based on the content of the above embodiment, as an optional embodiment, the system further comprises:
[0158] The first camera module 6, the second camera module 7, and the second photoelectric switch 8;
[0159] The cotton seed slide 1 further comprises a second detection station 12;
[0160] In the sliding direction of the cotton seed slide, the second detection station is located at the rear end of the first detection station; and the second photoelectric switch and the first camera module 6 and the second camera module 7 are arranged in sequence at the rear end of the first photoelectric switch; the first camera module 6 and the second camera module 7 are arranged in the vertical direction of the second detection station 12; and the second photoelectric switch 8 is arranged on the cotton seed slide;
[0161] The first camera module 6 and the second camera module 7 are used for collecting the image of the to-be-tested cotton seeds in the second detection station 12 and sending the image of the to-be-tested cotton seeds to the control unit 4;
[0162] The second photoelectric switch 8 is used for sending a detection signal of the passing cotton seed to be detected to the control unit 4, so as to trigger the control unit 4 to control the operation of the first camera module 6 and the operation of the second camera module 7.
[0163] The control unit 4 is used for determining the first quality category of the cotton seed to be detected based on the image of the cotton seed to be detected.
[0164] Specifically, in the embodiment of the present application, in order to improve the efficiency of the online detection of the cotton seed quality, the whole online detection process can be divided into a machine vision detection stage and an ultrasonic detection stage.
[0165] In the machine vision detection stage, for all the cotton seeds to be detected, the cotton seeds of the first quality category representing the serious epidermis damage are first detected. A second detection station is preset on the cotton seed slide, a transparent glass is installed at the second detection station, the first camera module and the second camera module are symmetrically installed at the upper and lower positions of the transparent glass, and the camera modules can adopt industrial cameras.
[0166] Once the cotton seed to be detected passes, the second photoelectric switch installed on the cotton seed slide generates a detection signal and sends the detection signal to the control unit, the control unit controls the operation of the first camera module and the operation of the second camera module, the cotton seed image passing through the transparent glass at the second detection station is collected through the first camera module and the second camera module, thereby two images of the cotton seed to be detected can be collected, the two images are simultaneously sent into the control unit, a composite image is generated from the two images, and the composite image is input into a preset target detection model trained, so that not only the position of the cotton seed to be detected in the composite image can be recognized, but also the quality category of the cotton seed to be detected can be output.
[0167] In the embodiment of the present application, in the machine vision detection stage, the cotton seeds to be detected can be recognized as two categories, one category is the cotton seeds with serious epidermis damage, i.e. the cotton seeds belonging to the first quality category, and the other category is the cotton seeds with non-serious epidermis damage, i.e. the cotton seeds belonging to the second quality category and the cotton seeds with no epidermis damage.
[0168] Specifically, when the cotton seed to be detected passes the first photoelectric switch on the cotton seed slide, the first photoelectric switch detects that the cotton seed to be detected passes and sends a detection signal to the control unit, and the control unit calculates whether the cotton seed to be detected is the cotton seed of the first quality category according to the sliding time of the cotton seed to be detected. Since the sliding time of the cotton seed on the slide is fixed, whether the cotton seed is the cotton seed of the first quality category, i.e. the cotton seed with serious epidermis damage, has been detected, and the detection result has been saved to the control unit, so that the control unit can judge whether the cotton seed passing the first photoelectric switch is the cotton seed of the first quality category representing the serious epidermis damage or the cotton seed with non-serious epidermis damage.
[0169] If the cotton seeds to be detected are identified as cotton seeds with severely damaged epidermis in the machine vision detection stage, the air-coupled ultrasonic signal acquisition unit will not start working when the cotton seeds with severely damaged epidermis pass through the air-coupled ultrasonic signal acquisition unit. If the cotton seeds to be detected are identified as cotton seeds with non-severely damaged epidermis, i.e., the cotton seeds to be detected are determined to be not the first quality category, the ultrasonic detection stage can be entered for processing.
[0170] When the cotton seeds are detected online and enter the ultrasonic detection stage, and the control unit determines that the cotton seeds to be detected are not the first quality category, the control unit can send an air-coupled ultrasonic signal acquisition command to the air-coupled ultrasonic signal acquisition unit through the USB port to control the operation of the air-coupled ultrasonic signal acquisition unit, and then obtain the air-coupled ultrasonic signal data for detecting the quality of the cotton seeds to be detected, i.e., the aforementioned amplified target air-coupled ultrasonic signal, through the network port, and process the air-coupled ultrasonic signal to detect the target quality category of the cotton seeds to be detected.
[0171] Further, in the embodiment of the present application, after the air-coupled ultrasonic signal for detecting the quality of the cotton seeds to be detected is obtained, the control unit processes the air-coupled ultrasonic signal by VMD to obtain a plurality of eigenmode functions, constructs a target function matrix based on the plurality of eigenmode functions, generates a target image based on the feature vectors extracted from the target function matrix, and finally inputs the target image into the trained cotton seed quality detection model to output the target quality category of the cotton seeds to be detected, further identifying whether the cotton seeds to be detected are cotton seeds with slightly damaged epidermis or intact cotton seeds with no damaged epidermis.
[0172] The system of the embodiment of the present application can detect severely damaged cotton seeds and slightly damaged cotton seeds in sequence by the method of machine vision and ultrasonic processing, and can effectively detect intact cotton seeds with no damaged epidermis by the two-stage detection method, so as to perform online detection and accurate screening on a large number of cotton seeds on the cotton seed chute, and greatly improve the efficiency of online detection of cotton seed quality.
[0173] The cotton seed quality online detection device provided by the present application will be described below. The cotton seed quality online detection device described below can be referred to in conjunction with the cotton seed quality online detection method described above.
[0174] Figure 3 is a structural schematic diagram of the cotton seed quality online detection device provided by the present application, as shown in Figure 3 includes:
[0175] The acquisition module 310 is used to acquire an air-coupled ultrasonic signal for detecting the quality of the cotton seeds to be detected in the case where the quality category of the cotton seeds to be detected is determined to be not the first quality category.
[0176] The generating module 320 is configured to generate a target image based on the air-coupled ultrasonic signal.
[0177] The output module 330 is configured to input the target image into the trained cotton seed quality detection model and output a target quality category of the cotton seed to be detected.
[0178] The trained cotton seed quality detection model is obtained after training based on a target image sample, and the target image sample is obtained by acquiring the target image of a cotton seed sample of a second quality category and the target image of a cotton seed sample with an intact epidermis; the epidermal damage degree of the cotton seed of the first quality category is greater than the epidermal damage degree of the cotton seed of the second quality category.
[0179] The cotton seed quality online detection device described in the embodiment can be used to execute the cotton seed quality online detection method embodiment, and has similar principles and technical effects, which will not be described here.
[0180] The cotton seed quality online detection device provided in the embodiment obtains the air-coupled ultrasonic signal for detecting the quality of the cotton seed to be detected by using the characteristic that the air-coupled ultrasonic signal is sensitive to defects of an object, and performs signal processing and signal image drawing on the air-coupled ultrasonic signal to generate a target image. The one-dimensional air-coupled ultrasonic signal is converted into a two-dimensional image by using the encoding process from the air-coupled ultrasonic signal to the image. Then, the target image is input into the trained cotton seed quality detection model to output the target quality category of the cotton seed to be detected. The method of image classification is used to realize the classification of the air-coupled ultrasonic signal, so that the online nondestructive detection and accurate classification of the quality of the cotton seed to be detected can be effectively realized. The intact cotton seeds without damage can be effectively screened out, and the efficiency of the online sorting of the cotton seeds is greatly improved.
[0181] Figure 4 is the entity structure schematic diagram of the control unit in the cotton seed quality online detection system provided by the embodiment, as Figure 4As shown, the control unit can include a processor 410, a communications interface 420, a memory 430, and a communications bus 440, wherein the processor 410, the communications interface 420, and the memory 430 communicate with each other through the communications bus 440. The processor 410 can invoke the logic instructions in the memory 430 to execute the cotton seed quality online detection method provided by the above-mentioned methods, which includes: in the case of determining that the quality category of the to-be-tested cotton seed does not belong to the first quality category, acquiring an air-coupled ultrasonic signal for detecting the quality of the to-be-tested cotton seed; generating a target image based on the air-coupled ultrasonic signal; inputting the target image into a trained cotton seed quality detection model to output a target quality category of the to-be-tested cotton seed; the trained cotton seed quality detection model is obtained after training according to a target image sample; the target image sample is obtained by acquiring the target image of a cotton seed sample of a second quality category and the target image of a cotton seed sample with an intact epidermis; the epidermal damage degree of the cotton seed of the first quality category is greater than the epidermal damage degree of the cotton seed of the second quality category.
[0182] In addition, the logic instructions in the memory 430 described above can be implemented in the form of a software function unit and sold or used as an independent product, which can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or part of the technical solutions can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a plurality of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in various embodiments of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various program code storage media.
[0183] In another aspect, the present application also provides a computer program product, which comprises a computer program, the computer program being stored in a non-transitory computer readable storage medium, and the computer program being capable of executing the cotton seed quality online detection method provided by the above-mentioned methods when executed by a processor, the method comprising: in a case where it is determined that the quality category of the to-be-tested cotton seed does not belong to a first quality category, acquiring an air-coupled ultrasonic signal used for detecting the quality of the to-be-tested cotton seed; generating a target image based on the air-coupled ultrasonic signal; inputting the target image into a trained cotton seed quality detection model, and outputting a target quality category of the to-be-tested cotton seed; the trained cotton seed quality detection model is obtained after training based on target image samples; the target image samples are obtained by acquiring the target images of cotton seed samples of a second quality category and the target images of cotton seed samples with intact epidermis; the epidermal damage degree of the cotton seeds of the first quality category is greater than the epidermal damage degree of the cotton seeds of the second quality category.
[0184] In yet another aspect, the present application also provides a non-transitory computer readable storage medium, which stores a computer program, the computer program being capable of implementing the cotton seed quality online detection method provided by the above-mentioned methods when executed by a processor, the method comprising: in a case where it is determined that the quality category of the to-be-tested cotton seed does not belong to a first quality category, acquiring an air-coupled ultrasonic signal used for detecting the quality of the to-be-tested cotton seed; generating a target image based on the air-coupled ultrasonic signal; inputting the target image into a trained cotton seed quality detection model, and outputting a target quality category of the to-be-tested cotton seed; the trained cotton seed quality detection model is obtained after training based on target image samples; the target image samples are obtained by acquiring the target images of cotton seed samples of a second quality category and the target images of cotton seed samples with intact epidermis; the epidermal damage degree of the cotton seeds of the first quality category is greater than the epidermal damage degree of the cotton seeds of the second quality category.
[0185] The device embodiments described above are merely illustrative, wherein the units illustrated as separate components can or can not be physically separated, and the components illustrated as units can or can not be physical units, i.e., can be located in one place, or can be distributed on multiple network units. Part or all of the modules can be selected to achieve the purposes of the embodiments according to actual needs. Those skilled in the art can understand and implement without creative labor.
[0186] Those skilled in the art can clearly understand the technical solutions of the various embodiments from the above description of the embodiments, and the various embodiments can be implemented by means of software with the necessary general hardware platforms, and of course, can also be implemented by hardware. Based on such understanding, the above technical solutions, essentially or in other words, the part of the prior art that makes a contribution, can be embodied in the form of a software product, which can be stored in a computer readable storage medium, such as a ROM / RAM, a magnetic disk, an optical disk, and the like, and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0187] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for some technical features therein; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for online detection of cotton seed quality, characterized in that, The method comprises the steps of: In the case where the quality category of the to-be-tested cotton seeds is determined not to belong to the first quality category, acquiring an air-coupled ultrasonic signal for detecting the quality of the to-be-tested cotton seeds; Based on the air-coupled ultrasonic signal, a target image is generated; The target image is input into a trained cotton seed quality detection model, and a target quality category of the to-be-tested cotton seeds is output; The trained cotton seed quality detection model is obtained after training according to target image samples; The target image samples are obtained by acquiring the target images of cotton seed samples of a second quality category and the target images of cotton seed samples with intact epidermis; the epidermal damage degree of the cotton seeds of the first quality category is greater than the epidermal damage degree of the cotton seeds of the second quality category.
2. The method of claim 1, wherein, Based on the air-coupled ultrasonic signal, a target image is generated, comprising: Performing variational mode decomposition on the air-coupled ultrasonic signal to obtain a plurality of intrinsic mode functions; Based on the plurality of intrinsic mode functions, a target function matrix is constructed; Based on extracting a feature vector of the target function matrix, the target image is generated.
3. The method according to claim 2, wherein, Based on extracting a feature vector of the target function matrix, the target image is generated, comprising: According to a preset order, the feature vector is extracted column by column from the target function matrix, and based on each column of the feature vector extracted each time, a polyline is generated; the color or gray scale of the polyline is determined based on a preset color filling order or gray scale filling order; Based on a plurality of columns of the feature vector extracted column by column, a plurality of polylines are generated; The number of the plurality of columns of the feature vector is determined based on the length of the air-coupled ultrasonic signal; the target image comprises a plurality of polylines.
4. The method of claim 2, wherein the step of detecting the quality of the cotton seeds is performed by using a camera. Before the step of acquiring, in the case where the quality category of the to-be-tested cotton seeds is determined not to belong to the first quality category, an air-coupled ultrasonic signal for detecting the quality of the to-be-tested cotton seeds, the method further comprises the steps of: Acquiring a plurality of images of the to-be-tested cotton seeds under different shooting angles, and generating a composite image by splicing the plurality of images; Inputting the composite image into a trained target detection model to output the quality category of the to-be-tested cotton seeds; The trained target detection model is trained according to cotton seed image samples carrying an epidermal severe damage label, and is used for identifying cotton seeds belonging to the first quality category.
5. The method of claim 2-4, wherein the method further comprises: The background image of the target image is generated based on a first number of air-coupled ultrasonic signals corresponding to the cotton seeds of the second quality category and a second number of air-coupled ultrasonic signals corresponding to the cotton seeds with intact epidermis.
6. A cotton seed quality on-line detection device, characterized in that, The method comprises the steps of: An acquisition module is configured to acquire, in the case where the quality category of the to-be-tested cotton seeds is determined not to belong to the first quality category, an air-coupled ultrasonic signal for detecting the quality of the to-be-tested cotton seeds; A generation module is configured to generate a target image based on the air-coupled ultrasonic signal; An output module is configured to input the target image into a trained cotton seed quality detection model, and output a target quality category of the to-be-tested cotton seeds; The trained cotton seed quality detection model is obtained after training according to target image samples; The trained cotton seed quality detection model is obtained after training according to target image samples; The target image sample is obtained by acquiring the target image of the cotton seed sample of the second quality category and the target image of the cotton seed sample with intact epidermis; the first quality category of the cotton seed has a greater epidermis damage degree than the second quality category of the cotton seed.
7. A cotton seed quality on-line detection system characterized by, Comprise: The cotton seed slide, the first photoelectric switch, the air coupled ultrasonic signal acquisition unit and the control unit; The cotton seed slide comprises a first detection station; The air coupled ultrasonic signal acquisition unit comprises an air coupled ultrasonic acquisition controller, an air coupled ultrasonic transducer transmitting end, an air coupled ultrasonic transducer receiving end and an amplifier; The first photoelectric switch and the air coupled ultrasonic signal acquisition unit are arranged in sequence along the sliding direction of the cotton seed slide; the air coupled ultrasonic transducer transmitting end and the air coupled ultrasonic transducer receiving end are symmetrically arranged in the vertical direction of the first detection station; The cotton seed slide is used for feeding the cotton seed to be detected; The first photoelectric switch is used for sending the detection signal of the passing cotton seed to be detected to the control unit to trigger the control unit to control the operation of the air coupled ultrasonic signal acquisition unit; The air coupled ultrasonic transducer transmitting end is used for transmitting the original air coupled ultrasonic signal to the cotton seed to be detected in the first detection station; The air coupled ultrasonic transducer receiving end is used for receiving the target air coupled ultrasonic signal after the original air coupled ultrasonic signal penetrates the cotton seed to be detected; The amplifier is used for receiving and amplifying the target air coupled ultrasonic signal and sending the amplified target air coupled ultrasonic signal to the air coupled ultrasonic acquisition controller; The air coupled ultrasonic acquisition controller is used for sending the amplified target air coupled ultrasonic signal to the control unit; The control unit is used for determining the target quality category of the cotton seed to be detected based on the amplified target air coupled ultrasonic signal in the case that the cotton seed to be detected does not belong to the first quality category of the cotton seed; The target quality category comprises the second quality category or the quality category with intact epidermis; the first quality category of the cotton seed has a greater epidermis damage degree than the second quality category of the cotton seed; The control unit comprises a memory, a processor and a computer program stored in the memory and executable on the processor; the processor executes the program to realize the cotton seed quality online detection method according to any one of claims 1 to 5.
8. The online cotton seed quality detection system of claim 7, wherein, Further comprise: The first camera module, the second camera module, the second photoelectric switch; The cotton seed slide further comprises a second detection station; Along the sliding direction of the cotton seed slide, the second detection station is arranged at the rear end of the first detection station; and the second photoelectric switch and the first camera module and the second camera module are arranged in sequence at the rear end of the first photoelectric switch; the first camera module and the second camera module are symmetrically arranged in the vertical direction of the second detection station; and the second photoelectric switch is arranged on the cotton seed slide; The first camera module and the second camera module are configured to collect images of the cotton seeds to be tested in the second detection station and send the images of the cotton seeds to be tested to the control unit; The second photoelectric switch is configured to send a detection signal of a cotton seed to be tested passing by to the control unit, so as to trigger the control unit to control the operation of the first camera module and the operation of the second camera module; The control unit is configured to determine the first quality category of the cotton seed to be tested based on the images of the cotton seed to be tested. 9.A non-transitory computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by a processor to implement the cotton seed quality online detection method according to any one of claims 1 to 5.
10. A computer program product comprising a computer program, characterized in that, The computer program is executed by a processor to implement the cotton seed quality online detection method according to any one of claims 1 to 5.