A method and system for online detection of buckwheat shelling parameters for buckwheat shelling machine
Through the combination of U-NET neural network and ResNet network, combined with the area estimation and fuzzy reasoning system, the online detection of buckwheat shelling parameters is realized, which solves the problems of low production efficiency and poor segmentation effect of buckwheat shelling machine, and improves the quality of buckwheat. The shelling machine works efficiently and accurately.
Patent Information
- Application Number
- CN202310529770.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-11
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2043-05-11
AI Technical Summary
Existing technology is difficult to effectively detect buckwheat shelling parameters online, resulting in low production efficiency, low rice yield and high energy consumption per unit output. In addition, traditional image segmentation algorithms are ineffective when facing adhesion phenomena and are difficult to promote.
Using a semantic segmentation model based on U-NET neural network, combined with the ResNet-18 coding network and ResNet network, through the area estimation method and fuzzy inference system, online detection of buckwheat shelling parameters is achieved to achieve unshelled, shelled and Accurate classification and segmentation of broken rice.
It improves the working efficiency of the buckwheat shelling machine, reduces the complexity of parameter tuning, improves the segmentation effect and counting efficiency, reduces the computing power consumption, and enhances the robustness of the system.
Smart Images

Figure CN116703829B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image recognition, and in particular to an online detection method and system for buckwheat shelling parameters of a buckwheat shelling machine. Background Art
[0002] In order to improve the shelling efficiency of the buckwheat shelling machine and adjust the sand plate gap and speed of the buckwheat shelling machine in real time, it is necessary to count the proportion of unshelled buckwheat, shelled buckwheat and broken rice at the outlet of the buckwheat shelling machine. Among them, the proportion of shelled buckwheat to the total number of buckwheat is called the buckwheat shelling parameter. At present, we can only rely on manual observation of the amount of shelled buckwheat and adjust the equipment parameters such as the sand plate gap and the sand plate speed based on experience, which leads to problems such as low production efficiency, low rice output rate and high energy consumption per unit output. Therefore, it is urgent to design an effective online detection method for buckwheat shelling parameters to form a closed-loop feedback and perform error correction on the control effect.
[0003] Considering that as the number of grains increases, some buckwheat grains have serious adhesion phenomenon, traditional image segmentation algorithms are usually based on thresholds, edges, clustering, regions, morphology, graph theory and certain specific theories, which cannot solve the adhesion problem in images well. Often, a complex parameter tuning process is required to obtain relatively satisfactory results, and it is difficult to generalize to different scenarios. It is necessary to improve the above defects. The present invention proposes to use the U-NET neural network in semantic segmentation to classify unshelled grains, shelled buckwheat and broken rice in the image and segment the three types of buckwheat.
[0004] As the density of grains in the image increases and the phenomenon of grains sticking to each other increases, the quality of the segmentation effect also declines to a certain extent, thus affecting the accuracy of buckwheat shelling parameters. The existing connected region marking method for counting will cause miscounting due to the adhesion of multiple grains, and multiple grains will be counted as one; the buckwheat counting work based on deep learning is prone to insufficient computing power and low efficiency due to the deepening of the adhesion degree. When the adhesion degree continues to increase, the image segmentation based on the neural network will produce a few unsegmented conditions. Therefore, it is necessary to improve the above-mentioned defects of the prior art. Summary of the invention
[0005] In order to solve the problems existing in the prior art, the purpose of the present invention is to provide an effective means for online detection of buckwheat shelling parameters. After image segmentation of buckwheat grains is performed by a neural network, the buckwheat grains are identified by an area estimation algorithm, and the number of buckwheat grains is recorded. By obtaining the buckwheat shelling parameters of a buckwheat sheller, the buckwheat sheller is adjusted to improve the working efficiency of the buckwheat sheller.
[0006] In order to achieve the above technical objectives, the present invention provides an online detection method for buckwheat husking parameters of a buckwheat husking machine, wherein the buckwheat husking parameters are expressed as the ratio of husked buckwheat to the total number of buckwheat, comprising the following steps:
[0007] Based on the U-NET neural network, the semantic segmentation model is constructed by improving the ResNet-18 encoding network and the ResNet network;
[0008] Collect several buckwheat grain images from the outlet of the buckwheat shelling machine, annotate the unshelled buckwheat, shelled buckwheat and broken buckwheat groats respectively, generate a data set to train the semantic segmentation model, and identify the unshelled buckwheat, shelled buckwheat and broken buckwheat groats in the buckwheat grain images;
[0009] Based on the sum of the areas of each grain of a recognized buckwheat grain image, the amount of shelled buckwheat is estimated by dividing the median of the areas of all grains of each buckwheat grain image obtained, and the buckwheat shelling parameters are obtained.
[0010] Preferably, in the process of building a semantic segmentation model, based on the U-NET neural network, the downsampling structure of the U-NET neural network is replaced by the ResNet network, and the U-NET neural network is improved to speed up the training and improve the training effect through transfer learning technology.
[0011] Preferably, in the process of improving the U-NET neural network, the backbone network of the U-NET neural network is improved by the ResNet-18 encoding network, wherein the ResNet-18 encoding network includes 5 network blocks, each of which adopts a residual structure design for residual connections between different depth layers of the network, thereby avoiding the gradient diffusion problem caused by too many network layers, and also reducing the number of network parameters and accelerating the speed of training convergence.
[0012] Preferably, in the process of building a semantic segmentation model, the loss function of the semantic segmentation model is expressed as:
[0013] Loss = CE Loss + Dice Loss
[0014] Among them, CE Loss is expressed as the cross entropy loss function, and Dice Loss is expressed as the Dice coefficient.
[0015] Preferably, in the process of estimating the number of shelled buckwheat, the connected regions of different grains in the buckwheat grain image are obtained;
[0016] The number of shelled buckwheat in the connected area was recalculated, and the estimated number of shelled buckwheat was corrected once, wherein the number of buckwheat grains with an area greater than 11 times the median area of the grain and less than 0.1 times the median area of the grain was recorded as 0, the number of buckwheat grains with an area greater than 0.1 times the median area of the grain and less than 1.3 times the median area of the grain was recorded as 1, and the buckwheat grains with an area greater than 1.3 times the median area of the grain and less than 11 times the median area of the buckwheat grain were recalculated and obtained using the method that the number of shelled buckwheat is equal to area / median area of buckwheat grains, wherein the specific value of this multiple is set based on experience.
[0017] Preferably, after the estimated number of shelled buckwheat is corrected once, the number of shelled buckwheat after the correction is corrected twice by obtaining the membership function of the area, roundness and number of buckwheat grains.
[0018] Preferably, in the process of performing secondary correction on the number of shelled buckwheat, when a certain grain is larger and two or more grains are stuck together in the picture, the shelled buckwheat is distinguished by the area and roundness of the buckwheat grains, which specifically includes the following steps:
[0019] The area and circularity of all the kernels in the statistical data set were collected, and a scatter plot was made with the kernel area as the abscissa and the kernel circularity as the ordinate;
[0020] According to the distribution characteristics of the scatter plot, the area and circularity characteristics of a single grain, the area and circularity characteristics of two grains adhering to each other, the area and circularity characteristics of three grains adhering to each other, and the area and circularity characteristics of multiple grains adhering to each other, an area threshold and a circularity threshold are set;
[0021] Traverse all connected domains, determine the number of shelled buckwheat according to the area threshold and circularity threshold, and accumulate them.
[0022] Preferably, in the process of making a secondary correction to the number of shelled buckwheat, based on a fuzzy inference system, a secondary correction is made to the number of shelled buckwheat according to the area and roundness of the buckwheat grains, wherein the membership function and membership rules of the area, roundness and number of the buckwheat grains are obtained to construct a fuzzy inference system.
[0023] Preferably, in the process of performing secondary correction on the amount of shelled buckwheat, the secondary correction process comprises the following steps:
[0024] The area and circularity of all the kernels in the statistical data set were collected, and a scatter plot was made with the kernel area as the abscissa and the kernel circularity as the ordinate;
[0025] Different regions are divided according to the distribution characteristics of the scatter plot, the area and circularity characteristics of a single grain, the area and circularity characteristics of two grains sticking together, the area and circularity characteristics of three grains sticking together, and the area and circularity characteristics of multiple grains sticking together. There are overlapping parts between the regions.
[0026] According to the membership functions and membership rules of area, circularity and quantity, a fuzzy inference system is constructed;
[0027] Each connected domain is traversed, the area and circularity are input into the fuzzy inference system, the number of shelled buckwheat is taken as output and accumulated, and the number of shelled buckwheat that has been corrected once is corrected twice.
[0028] The invention discloses an online detection system for buckwheat shelling parameters of a buckwheat shelling machine, comprising:
[0029] A data acquisition module, used for acquiring a number of buckwheat grain images from the outlet of the buckwheat shelling machine;
[0030] A labeling module, used for labeling unhulled buckwheat, hulled buckwheat and broken buckwheat groats in the buckwheat grain image;
[0031] The parameter recognition module is used to recognize the annotated buckwheat grain image based on the semantic segmentation model, and obtain buckwheat shelling parameters by estimating the number of shelled buckwheat. The semantic segmentation model is constructed based on the U-NET neural network and improved by the ResNet-18 encoding network and the ResNet network. The recognition model is constructed by training the data set composed of the annotated buckwheat grain images, and the annotated buckwheat grain image is recognized to obtain the area and roundness of the buckwheat grains. The buckwheat shelling parameters are obtained by limiting the features and calculating the number. In the process of obtaining the parameters, the annotated buckwheat grain image is recognized, and the number of shelled buckwheat is estimated based on the sum of the areas of each grain of an identified buckwheat grain image and divided by the median of the areas of all grains of each buckwheat grain image obtained to obtain the buckwheat shelling parameters.
[0032] The present invention discloses the following technical effects:
[0033] (1) The segmentation algorithm of attached buckwheat based on U-NET neural network saves the complicated process of parameter adjustment and has good segmentation effect:
[0034] (2) The counting algorithm of adhering buckwheat based on area estimation saves computing power and improves counting efficiency;
[0035] (3) The method combining connected region labeling and area estimation reduces the application scenarios of the area estimation method and effectively reduces the error;
[0036] (4) The area and circularity-based counting algorithm for adhering buckwheat solves the problem of errors caused by judging the number of buckwheat only by area;
[0037] (5) The area and circularity-based counting algorithm for sticky buckwheat with the addition of a fuzzy inference system solves the "either-or" problem in threshold judgment and enhances the robustness of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0039] Figure 1 The original image containing buckwheat seeds according to the embodiment of the present invention;
[0040] Figure 2 A predicted image based on an original image according to an embodiment of the present invention;
[0041] Figure 3 Labeling buckwheat grain images using Labelme as described in an embodiment of the present invention;
[0042] Figure 4 The label file described in the embodiment of the present invention;
[0043] Figure 5 The punctuation diagram described in the embodiment of the present invention;
[0044] Figure 6 The label diagram described in the embodiment of the present invention;
[0045] Figure 7 A schematic diagram of a U-NET neural network according to an embodiment of the present invention;
[0046] Figure 8 A schematic diagram of a RESNET network according to an embodiment of the present invention;
[0047] Fig. 9 Schematic diagram of a residual module in the residual ResUnet according to an embodiment of the present invention;
[0048] Fig.10 Schematic diagram of residual connection of three convolutional blocks according to an embodiment of the present invention;
[0049] Fig.11 A scatter plot of the area and circularity of unhulled kernels according to an embodiment of the present invention;
[0050] Fig.12A schematic diagram of an area circularity method with fuzzy reasoning according to an embodiment of the present invention;
[0051] Fig.13 A binary image of the unhulled kernels described in the embodiment of the present invention;
[0052] Fig.14 A schematic diagram of a membership function and a fuzzy rule according to an embodiment of the present invention;
[0053] Fig.15 The present invention is a schematic diagram of the method flow chart. DETAILED DESCRIPTION
[0054] In order to make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with 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 of the embodiments. The components of the embodiments of the present application generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0055] like Figure 1-15 As shown, Example 1: The present invention provides an online detection method for buckwheat shelling parameters: including buckwheat segmentation and counting. In terms of segmentation, the purpose of the present invention is to provide a buckwheat segmentation algorithm based on a neural network, which successfully divides the grains into three categories and realizes the buckwheat grain segmentation, with good effect and avoiding the complicated parameter adjustment process; in terms of counting, the purpose of the present invention is to provide an adhesion buckwheat counting algorithm based on area estimation, and the area estimation method effectively avoids the low efficiency caused by insufficient computing power; on the basis of the area estimation method, combined with the connected region marking method, a method combining connected region marking and area estimation is proposed, which reduces the application scenarios of area estimation and improves the accuracy; when the area is difficult to distinguish between single and multiple grains, the judgment standard of roundness is added to help judge the number of grains; when the judgment thresholds of area and roundness are fixed values, the thresholds are fuzzy processed, a fuzzy reasoning system is constructed, and the area and roundness are used as inputs of the fuzzy reasoning system, and the number is used as output, thereby improving the counting accuracy.
[0056] The segmentation algorithm of attached buckwheat based on U-NET neural network mainly uses Labelme tool to manually annotate the collected buckwheat grain images, annotate unshelled buckwheat, shelled buckwheat and broken buckwheat groats, form a data set that can be used for semantic segmentation model training, and expand the number of data sets to 1032 through data enhancement method. Improve the original U-Net network model. Change the backbone network and use a deeper ResNet network to obtain richer image features. Then use transfer learning technology to speed up the training speed, further improve the training effect, and use an improved loss function to improve network performance.
[0057] The overall idea of the buckwheat counting algorithm based on area estimation is to use the number = total buckwheat grain area / single grain area. The "single grain area" is the value that best represents the area of a single grain. Each time the number of buckwheat grains in a picture is calculated, the median of the area of all the grains in the picture is calculated, and this median is used as the "single grain area".
[0058] The counting method using area estimation can be summarized as:
[0059] Step 1: Count the area of each grain in a picture and add them up to get the sum of the areas of all grains;
[0060] Step 2: Count the areas of all the grains in each picture and find the median of the areas of these grains;
[0061] Step 3: Divide the sum of all kernel areas by the median to obtain the count result.
[0062] This method has the feature of being adaptive. When the buckwheat species, batches and sizes are different, the size of the “single grain area” can be adjusted according to the size of the buckwheat area.
[0063] When the buckwheat grains are too uneven in size, the counting of the attached buckwheat grains based on area estimation may produce a certain error. In order to reduce this error, the present invention proposes a method combining connected region marking and area estimation: the method assumes that the most common buckwheat of the same type is a single grain, so the area of the statistical connected domain is restricted, and a connected domain with an area greater than 10 and less than 1.5 times the area of a single grain is considered to be a grain, and a connected domain with an area greater than 1.5 times the area of a single grain is considered to be a plurality of grains attached, and this area is divided by the area of a single grain.
[0064] The method of combining connected region labeling and area estimation can be summarized as follows:
[0065] Step 1: Count the areas of all connected domains in the image and find their median;
[0066] Step 2: Traverse each connected domain. When the area of a connected domain is greater than 10 and less than 1.5 times the median, the number is increased by 1.
[0067] Step 3: When the area of a connected domain is greater than 1.5 times the median, the number = number + area divided by the median.
[0068] The area estimation method is only applied when the area is larger than 1.5 times the area of a single grain, which reduces the application scenarios of the area estimation method and effectively reduces errors.
[0069] When there is a large grain and two or more grains are stuck together in the picture, the grain areas of these two situations are very close, and it is difficult to distinguish the two by area alone. The present invention adds a judgment standard for roundness, and the roundness of a single grain is closer to 1, and the roundness of two grains is concentrated around 2; similarly, there are two large grains stuck together and three small grains stuck together in the picture. At this time, the grain areas of the two situations are also very close, and the judgment condition of roundness is also added. The roundness of two grains is close to 2, and the roundness of three grains is closer to 3. The present invention proposes an algorithm for counting stuck buckwheat based on area and roundness, that is, the area and roundness of all grains in the statistical data set are counted to obtain their distribution characteristics. According to the distribution characteristics of the area and roundness, the number of each grain is judged and accumulated.
[0070] The area and circularity methods can be summarized as:
[0071] Step 1: Count the area and circularity of all the kernels in the statistical data set, and make a scatter plot with the kernel area as the horizontal axis and the kernel circularity as the vertical axis. Fig.11 ;
[0072] Step 2: according to the distribution characteristics of the scatter plot, the area and circularity characteristics of a single grain, the area and circularity characteristics of two grains adhering to each other, the area and circularity characteristics of three grains adhering to each other, and the area and circularity characteristics of multiple grains adhering to each other, set (multiple) area thresholds and (multiple) circularity thresholds;
[0073] Step 3: Traverse all connected domains, determine the number of grains based on the area threshold and circularity threshold, and accumulate them.
[0074] In addition, the judgment thresholds of area and circularity are not constant. Different people observe different thresholds, and different results are obtained according to the different thresholds. Therefore, the present invention adopts a fuzzy inference system to make corresponding membership functions according to the characteristics of area and circularity. For each grain, its area and circularity are read, input into the fuzzy inference system, and its number is judged and accumulated.
[0075] The area and circularity counting methods with the addition of fuzzy inference system are summarized as follows:
[0076] Step 1: Count the area and circularity of all the kernels in the statistical data set, and make a scatter plot with the kernel area as the abscissa and the kernel circularity as the ordinate;
[0077] Step 2: According to the distribution characteristics of the scatter plot, the area and circularity characteristics of a single grain, the area and circularity characteristics of two grains sticking together, the area and circularity characteristics of three grains sticking together, and the area and circularity characteristics of multiple grains sticking together, different regions are divided. The overlapping parts between regions are as follows: Fig.12 ;
[0078] Step 3: According to Fig.12 Make membership functions and membership rules for area, circularity, and quantity as follows Fig.14 Fuzzy reasoning system;
[0079] Step 4: Traverse each connected domain, input the area and circularity into the fuzzy inference system, and take the quantity as output and accumulate it.
[0080] Example 2: The segmentation and counting algorithm of adhering buckwheat based on neural network and area estimation provided by the present invention. Figure 1 shown.
[0081] The original image is cropped to a size of 512×512 and annotated using Labelme software as follows: Figure 3 , the conversion of .json tag files is as follows Figure 4 Finally, we get 172 valid image tables (such as punctuation diagrams such as Figure 5 , label diagram as Figure 6 ), and completed the preliminary preparation of the data set.
[0082] Data enhancement is performed by using flip transformation, scaling transformation and random brightness, and the dataset is expanded to 1032 images.
[0083] The structure of the U-NET neural network is as follows Figure 7 , change the downsampling structure of the U-NET network and adopt a deeper ResNet network such as Figure 8 To obtain richer features of the image; speed up the training and improve the training effect through transfer learning technology; use the improved loss function Loss = CE Loss + Dice Loss to improve network performance, CE Loss is expressed as CE loss function, and Dice Loss is expressed as Dice coefficient.
[0084] The backbone network of the original U-Net is replaced with ResNet. The parameters of the ResNet-18 encoding network structure are shown in Table 1. There are 5 network blocks in total. Each network block adopts a residual structure design. The connection method of the residual block is as follows Fig.12 The residual module design in the ResUnet network is as follows: Fig. 9 By using residual connections between layers of different depths in the network instead of continuous stacking of convolutional layers, the gradient diffusion problem caused by too many network layers is avoided. At the same time, the number of network parameters is reduced, which speeds up the training convergence.
[0085] Table 1
[0086]
[0087] The ResNet-18 encoding network is trained using the dataset, and the network weights obtained from the training are used to train the Figure 1 Make a prediction Figure 2 (This includes unhulled kernels, hulled kernels, and broken rice).
[0088] When counting, we can take unhulled buckwheat as an example. Figure 2 The unshelled kernels in the image are screened out and marked as binary images, and the image is obtained as follows: Fig.13 The unhulled kernels are the portion that needs to be counted in the present invention.
[0089] The number of unshelled kernels in the original image was counted and it was considered to be the actual number, which is 440.
[0090] Using the adaptive area estimation method, the number of area = total buckwheat grain area / median grain area in this picture, and the counting accuracy is calculated as the absolute value of the area number minus the true number value divided by the true number value, which is 98.64%.
[0091] A method combining connected region labeling and area estimation: Based on experience, the present invention records the number of buckwheat grains with an area greater than 11 times the median area of the grain and less than 0.1 times the median area of the grain as 0, the number of buckwheat grains with an area greater than 0.1 times the median area of the grain and less than 1.3 times the median area of the grain as 1, and the number of buckwheat grains with an area greater than 1.3 times the median area of the grain and less than 11 times the median area of the buckwheat grain is recalculated and obtained by the method of number equal to area / median area of buckwheat grains. At this time, the calculation counting accuracy is 99.32%, which is 0.68% higher than the accuracy of the adaptive area estimation method.
[0092] Counting by area and circularity method: First, according to the data set of the present invention, the number of buckwheat grains with a grain area greater than 500 and less than 10 is recorded as 0; the number of buckwheat grains with a grain area greater than 10 and less than 135 is recorded as 1 (here, due to the large difference in the circularity of individual grains, the circularity is not restricted); the number of buckwheat grains with a grain area greater than 135 and less than 220 and a circularity greater than 0 and less than 5 is recorded as 2; the number of buckwheat grains with a grain area greater than 220 and less than 290 and a circularity greater than 2 and less than 4 is recorded as 3; the number of buckwheat grains with a grain area greater than 290 and less than 500 is calculated separately, and the calculation method is number = grain area / 90.5+1. The counting accuracy of this method is 99.77%, which is 0.45% higher than the accuracy of the method combining connected region marking and area estimation.
[0093] Based on the method of area and circularity, the method of fuzzy reasoning is added. According to the experience of the present invention, the membership function of the area, circularity and number of buckwheat seeds is deployed as follows: Fig.14 When the area and roundness of buckwheat seeds are Fig.12 At the junction of zone I and zone II, zone II and zone III, and zone III and zone IV, the present invention uses a fuzzy inference system to determine the number of grains. The counting accuracy of this method is 99.87%, which is 0.1% higher than the accuracy of the method using only area and circularity. This proves the superiority of this counting method.
[0094] Similarly, the present invention can calculate the number of shelled grains. Since the broken rice has an irregular shape, the present invention adopts a weighing method to measure the number.
[0095] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.
[0096] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
Claims
1. A method for online detection of buckwheat shelling parameters for a buckwheat shelling machine, wherein the buckwheat shelling parameters are expressed as the ratio of shelled buckwheat to the total number of buckwheat, characterized in that: The following steps are involved: Based on the U-NET neural network, the semantic segmentation model is constructed by improving the ResNet-18 encoding network and the ResNet network; Collecting a number of buckwheat grain images from the outlet of a buckwheat shelling machine, annotating unshelled buckwheat, shelled buckwheat and broken buckwheat groats respectively, generating a data set to train the semantic segmentation model, and identifying the unshelled buckwheat, shelled buckwheat and broken buckwheat groats in the buckwheat grain images; Based on the sum of the areas of each grain in the identified buckwheat grain image, the amount of shelled buckwheat is estimated by dividing the median of the areas of all grains in each of the buckwheat grain images, thereby obtaining the buckwheat shelling parameters; In the process of estimating the amount of shelled buckwheat, the connected regions of different grains in the buckwheat grain image are obtained; The number of shelled buckwheat in the connected area is recalculated, and the estimated number of shelled buckwheat is corrected once, wherein the number of buckwheat grains with an area greater than 11 times the median area of the grains and less than 0.1 times the median area of the grains is recorded as 0, the number of buckwheat grains with an area greater than 0.1 times the median area of the grains and less than 1.3 times the median area of the grains is recorded as 1, and the buckwheat grains with an area greater than 1.3 times the median area of the grains and less than 11 times the median area of the buckwheat grains are recalculated and obtained by the method that the number of shelled buckwheat is equal to area / median area of buckwheat grains; After the estimated number of shelled buckwheat is corrected once, the number of shelled buckwheat after the correction is corrected twice by obtaining the membership function of the area, roundness and number of the buckwheat grains; In the process of secondary correction of the number of shelled buckwheat, when a certain grain is larger and two or more grains are stuck together in the picture, the shelled buckwheat is distinguished by the area and roundness of the buckwheat grains, which specifically includes the following steps: The area and circularity of all the kernels in the statistical data set were collected, and a scatter plot was made with the kernel area as the abscissa and the kernel circularity as the ordinate; According to the distribution characteristics of the scatter plot, the area and circularity characteristics of a single grain, the area and circularity characteristics of two grains adhering to each other, the area and circularity characteristics of three grains adhering to each other, and the area and circularity characteristics of multiple grains adhering to each other, an area threshold and a circularity threshold are set; Traversing all connected domains, determining the number of shelled buckwheats according to an area threshold and a circularity threshold and accumulating the number; In the process of performing secondary correction on the number of shelled buckwheat, the number of shelled buckwheat is secondary corrected based on the fuzzy inference system according to the area and roundness of the buckwheat grains, wherein the membership function and membership rule of the area, roundness and number of the buckwheat grains are obtained to construct the fuzzy inference system; In the process of performing secondary correction on the amount of shelled buckwheat, the secondary correction process comprises the following steps: The area and circularity of all the kernels in the statistical data set were collected, and a scatter plot was made with the kernel area as the abscissa and the kernel circularity as the ordinate; According to the distribution characteristics of the scatter plot, the area and circularity characteristics of a single grain, the area and circularity characteristics of two grains adhering to each other, the area and circularity characteristics of three grains adhering to each other, and the area and circularity characteristics of multiple grains adhering to each other, different regions are divided, and there are overlapping parts between the regions; According to the membership functions and membership rules of area, circularity and quantity, a fuzzy inference system is constructed; Each connected domain is traversed, the area and circularity are input into the fuzzy inference system, the number of shelled buckwheat is taken as output and accumulated, and the number of shelled buckwheat that has been corrected once is corrected twice.
2. According to claim 1, a method for online detection of buckwheat shelling parameters for a buckwheat shelling machine is characterized in that: In the process of building a semantic segmentation model, based on the U-NET neural network, the downsampling structure of the U-NET neural network is replaced by the ResNet network, and the U-NET neural network is improved to speed up the training speed and improve the training effect through transfer learning technology.
3. According to claim 2, a method for online detection of buckwheat shelling parameters for a buckwheat shelling machine is characterized in that: In the process of improving the U-NET neural network, the backbone network of the U-NET neural network is improved through the ResNet-18 encoding network, wherein the ResNet-18 encoding network includes 5 network blocks, each of which adopts a residual structure design for residual connections between different depth layers of the network, thereby avoiding the gradient diffusion problem caused by too many network layers, and also reducing the number of network parameters and accelerating the speed of training convergence.
4. According to claim 3, a method for online detection of buckwheat shelling parameters for a buckwheat shelling machine is characterized in that: In the process of building a semantic segmentation model, the loss function of the semantic segmentation model is expressed as: Loss = CE Loss + Dice Loss Among them, CELoss is represented by the cross entropy loss function, and DiceLoss is represented by the Dice coefficient.
5. An online detection system for buckwheat shelling parameters of a buckwheat shelling machine, characterized in that: include: A data acquisition module, used for acquiring a number of buckwheat grain images from the outlet of the buckwheat shelling machine; a labeling module, used for labeling unhulled buckwheat, hulled buckwheat and broken buckwheat groats in the buckwheat grain image; A parameter recognition module is used to recognize the annotated buckwheat grain image based on a semantic segmentation model, and obtain the buckwheat shelling parameters by estimating the number of shelled buckwheat. The semantic segmentation model is constructed based on a U-NET neural network, improved by a ResNet-18 encoding network and a ResNet network, and trained by a data set consisting of the annotated buckwheat grain images to construct a recognition model, recognize the annotated buckwheat grain image, obtain the buckwheat grain area and roundness, and obtain the buckwheat shelling parameters by limiting its features and calculating the number of buckwheat grains; The system obtains the connected areas of different grains in the buckwheat grain image during the process of estimating the number of shelled buckwheat grains; The number of shelled buckwheat in the connected area is recalculated, and the estimated number of shelled buckwheat is corrected once, wherein the number of buckwheat grains with an area greater than 11 times the median area of the grains and less than 0.1 times the median area of the grains is recorded as 0, the number of buckwheat grains with an area greater than 0.1 times the median area of the grains and less than 1.3 times the median area of the grains is recorded as 1, and the buckwheat grains with an area greater than 1.3 times the median area of the grains and less than 11 times the median area of the buckwheat grains are recalculated and obtained by the method that the number of shelled buckwheat is equal to area / median area of buckwheat grains; After the system makes a primary correction to the estimated number of shelled buckwheat, the system makes a secondary correction to the number of shelled buckwheat after the primary correction by obtaining the membership function of the area, roundness and number of the buckwheat grains; In the process of secondary correction of the number of shelled buckwheat, when a certain grain is larger and two or more grains are stuck together in the picture, the shelled buckwheat is distinguished by the area and roundness of the buckwheat grains, which specifically includes the following steps: The area and circularity of all the kernels in the statistical data set were collected, and a scatter plot was made with the kernel area as the abscissa and the kernel circularity as the ordinate; According to the distribution characteristics of the scatter plot, the area and circularity characteristics of a single grain, the area and circularity characteristics of two grains adhering to each other, the area and circularity characteristics of three grains adhering to each other, and the area and circularity characteristics of multiple grains adhering to each other, an area threshold and a circularity threshold are set; Traversing all connected domains, determining the number of shelled buckwheats according to an area threshold and a circularity threshold and accumulating the number; In the process of secondary correction of the number of shelled buckwheat, the system performs secondary correction of the number of shelled buckwheat according to the area and roundness of the buckwheat grains based on the fuzzy inference system, wherein the membership function and membership rule of the area, roundness and number of the buckwheat grains are obtained to construct the fuzzy inference system; In the process of performing secondary correction on the amount of shelled buckwheat, the secondary correction process comprises the following steps: The area and circularity of all the kernels in the statistical data set were collected, and a scatter plot was made with the kernel area as the abscissa and the kernel circularity as the ordinate; According to the distribution characteristics of the scatter plot, the area and circularity characteristics of a single grain, the area and circularity characteristics of two grains adhering to each other, the area and circularity characteristics of three grains adhering to each other, and the area and circularity characteristics of multiple grains adhering to each other, different regions are divided, and there are overlapping parts between the regions; According to the membership functions and membership rules of area, circularity and quantity, a fuzzy inference system is constructed; Each connected domain is traversed, the area and circularity are input into the fuzzy inference system, the number of shelled buckwheat is taken as output and accumulated, and the number of shelled buckwheat that has been corrected once is corrected twice.
Citation Information
Patent Citations
Wheat ear automatic identification method and system based on transfer learning
CN112883915A
Deep learning-based unmanned aerial vehicle remote sensing wheat new variety lodging area extraction method and system
CN115223063A
Wheat lodging detection method, device, equipment and medium
CN115641444A
Cited By
Method for detecting eggshells in egg liquid
CN119991684A
A method for detecting eggshells in egg liquid
CN119991684B
