Forage weed identification method based on convolutional neural network and application thereof
By combining the color and morphological characteristics of the image data, the accuracy of weed recognition in alfalfa fields is solved, efficient and accurate weed recognition is achieved, and the cost of spraying herbicides is reduced.
Patent Information
- Application Number
- CN202510526044.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-24
- Publication Date
- 2025-08-05
AI Technical Summary
The prior art is difficult to accurately identify weeds in high-density crops and weed environments in alfalfa fields, resulting in inaccurate spraying of herbicides, increasing costs and environmental risks.
The convolutional neural network model is used to classify alfalfa and weeds through image data before sowing and when seedlings are green, and color characteristics and morphological characteristics are used to construct and train the convolutional neural network model to identify the network model with the highest accuracy.
It improves the accuracy and robustness of weed recognition, simplifies the weed screening process, reduces the computational complexity, and achieves efficient and accurate weed recognition.
Smart Images

Figure CN120431444A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a forage weed identification method, and in particular to a forage weed identification method based on a convolutional neural network and an application thereof. Background Art
[0002] Alfalfa is one of the main forage crops in my country. It is an important nutritious legume forage crop and is widely cultivated worldwide. Alfalfa contains a large amount of crude protein and rich minerals, especially calcium, iron and manganese, which are beneficial to the health of livestock. Weeds are the main threat to alfalfa yield and quality. They compete with alfalfa for nutrients, space, sunlight and water. In addition, some weed species, such as perilla mint, contain toxic substances that are toxic to livestock. Although weeds are almost always unevenly distributed in the field, various post-emergence herbicides are still widely used to control alfalfa weeds. For example, clethodim and 2,4-DB control a variety of grasses and broadleaf plants in traditional alfalfa, respectively, while glyphosate provides non-selective control of weeds in glyphosate-tolerant alfalfa.
[0003] Precision herbicide spraying can significantly reduce herbicide input and weed control costs. A major obstacle to autonomous precision herbicide spraying is accurate and reliable weed detection in real time. Traditional machine vision methods for weed identification rely primarily on leaf color and morphological characteristics, spatial location information, spectral analysis, and feature fusion. However, these traditional methods are unable to reliably detect weeds in complex environments with high crop and weed density.
[0004] Machine learning has developed rapidly in recent years, and convolutional neural networks (CNNs) have achieved tremendous success in various scientific applications. Studies have also demonstrated the feasibility of using CNNs for weed identification in various cropping systems. However, the feasibility and effectiveness of using CNNs for weed detection in alfalfa has not been studied. Summary of the Invention
[0005] The purpose of this invention is to propose a method for identifying pasture weeds based on a convolutional neural network in a complex environment with high crop and weed density in alfalfa fields, so as to achieve faster and more accurate weed identification and help reduce the need for herbicide spraying over large areas.
[0006] In order to achieve the above objects, the technical solution adopted by the present invention is:
[0007] A forage weed recognition method based on convolutional neural network, comprising:
[0008] Obtain image data of alfalfa fields before sowing and when seedlings turn green;
[0009] Based on the alfalfa image data before sowing, all green plants were uniformly identified as weeds by color features;
[0010] Based on the alfalfa image data at the time of seedling re-greening, weeds were classified into monocotyledonous weeds and dicotyledonous weeds according to their species, and key features of alfalfa and dicotyledonous weeds were obtained;
[0011] Attach species labels to the initial alfalfa and weeds based on key features and divide them into training and test sets;
[0012] A forage weed recognition model based on a convolutional neural network model was constructed, and the convolutional neural network was trained using a training set to select the convolutional neural network model with the corresponding parameters that had the highest recognition accuracy.
[0013] Preferably, the method of uniformly identifying all green plants as weeds based on color features based on the alfalfa image data before sowing specifically includes:
[0014] Based on the pre-processed alfalfa field image data before sowing, all pixels in the image are traversed and the grayscale value of each pixel is calculated using the color factor formula;
[0015] The histogram is calculated based on the grayscale value of the acquired image, the optimal threshold is automatically selected through the OTSU algorithm, the grayscale image is binarized, and the binary image is output to obtain the green plant area;
[0016] Through median filtering, a sliding window is used to traverse the image, and the central pixel is replaced with the median value of the pixels in the window to remove salt and pepper noise and isolated noise points in the binary image;
[0017] Morphological processing-based corrosion, expansion, and closing operations are used to fill holes, connect broken areas, and remove small noises;
[0018] Based on the processed image, the green plant areas are identified as weed areas.
[0019] Preferably, the alfalfa image data based on the regreening of the seedlings is divided into monocotyledonous weeds and dicotyledonous weeds according to the weed species, and the key features of alfalfa and dicotyledonous weeds are obtained specifically including:
[0020] Based on the acquired alfalfa image data at the time of seedling re-greening, we obtained the morphological characteristics of weed leaf length-to-width ratio, leaf edge characteristics, and leaf arrangement, and classified monocotyledonous and dicotyledonous weeds.
[0021] Based on the divided dicotyledonous weeds, a preliminary screening of alfalfa and some dicotyledonous weeds was carried out by color characteristics;
[0022] Based on the dicotyledonous weeds after preliminary screening, the vein structure and texture characteristics are extracted for further fine screening;
[0023] A weed feature dataset is constructed based on the weed identification feature data in the screening step.
[0024] Preferably, the step of assigning species labels to the initial alfalfa and weeds based on the key features and dividing the training set and the test set specifically includes:
[0025] Based on the acquired weed feature dataset, the corresponding species labels are attached to the initial alfalfa and weed color sample images;
[0026] Based on the sample images after label assignment, they are rescreened by manual verification combined with botanical features;
[0027] Based on the sample images after rescreening, weeds are divided proportionally according to their types to maintain a consistent distribution of samples.
[0028] Based on the divided sample images, the sample images of each category are divided into training set and test set categories.
[0029] Preferably, the forage weed recognition model based on the convolutional neural network model is constructed, and the convolutional neural network is trained using a training set to select the convolutional neural network model with the highest recognition accuracy corresponding to the parameters. Specifically, the forage weed recognition model is constructed based on the convolutional neural network model.
[0030] A forage weed recognition model is constructed based on a convolutional neural network model, including input, feature learning, and classification.
[0031] The feature learning part includes five convolutional units, which include convolutional layers, BatchNormalization, ReLU functions, and pooling layers. The first two convolutional units are designed to have two convolutional layers, and the last three convolutional units are designed to have three convolutional layers.
[0032] The classification part includes a fully connected layer, a softmax classification function and an output layer;
[0033] Optimize network weights through forward propagation and backpropagation, dynamically adjust learning rate with early stopping, and save the model with the highest accuracy on the validation set;
[0034] Calculate the confusion matrix, accuracy, and F1-Score based on the test set, and improve inference efficiency through model compression.
[0035] Furthermore, a forage weed recognition system based on convolutional neural network is proposed, which includes:
[0036] Data acquisition and preprocessing module: The data acquisition and preprocessing module includes a multi-phase image acquisition unit and an image preprocessing unit, which are mainly used for image acquisition before sowing and image acquisition during the seedling greening period and light noise processing, providing standardized input for subsequent analysis.
[0037] Weed feature analysis module: The weed feature analysis module includes a pre-sowing weed detection unit and a dicotyledonous weed identification unit, which are mainly used to extract plant morphological characteristics and distinguish monocotyledonous and dicotyledonous weeds to support classification decisions;
[0038] Intelligent labeling and data set management module: The intelligent labeling and data set management module includes a semi-automatic labeling system and a data set optimization unit, which are mainly used to realize the automatic generation and enhancement of data labels and build a balanced training sample library;
[0039] Convolutional neural network core module: The convolutional neural network core module includes a convolutional neural network core module and a model training optimization unit, which is mainly used to implement end-to-end weed species recognition model training through multi-layer feature abstraction learning;
[0040] Processor: The processor is mainly used for the calculation process of each formula and the construction calculation process of each model.
[0041] Compared with the prior art, the advantages of the present invention are:
[0042] By comprehensively analyzing image data from alfalfa fields at different growth stages (before sowing and when seedlings are green), the system effectively captures the visual differences between weeds and forage grasses in different environments. This phased image acquisition method enables the system to adapt to weed identification tasks at different growth stages, improving the accuracy and robustness of the model. Secondly, a preliminary judgment of green plants in pre-sowing images is made using color features, effectively simplifying the weed screening process and improving computational efficiency. Furthermore, images from the seedling green stage are refined into monocotyledonous and dicotyledonous weeds, and detailed key feature extraction is performed for each type of weed, helping to improve recognition accuracy. In addition, the deep learning model based on convolutional neural networks can automatically extract complex features from images, avoiding the tedious process of manually designing features, and has strong adaptability. During the training process, by optimizing the parameters of the CNN model, the recognition accuracy can be significantly improved, thereby achieving efficient and accurate recognition of weeds in alfalfa fields. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 A schematic diagram of the method proposed in the present invention;
[0044] Figure 2 This is a schematic diagram of the image processing before sowing proposed by the present invention;
[0045] Figure 3 This is a schematic diagram of obtaining the key characteristics of seedling regreening proposed in the present invention;
[0046] Figure 4 This is a schematic diagram of the classification, training set, and test set division proposed in the present invention;
[0047] Figure 5 This is the workflow diagram of the convolutional neural network model proposed in the present invention;
[0048] Figure 6 This is a schematic diagram of the technical route for the classification and identification of alfalfa and weeds proposed in the present invention;
[0049] Figure 7 This is a schematic diagram of the herbicide's weed control spectrum proposed by the present invention;
[0050] Figure 8 This is the network structure diagram of the convolutional neural network model proposed in the present invention;
[0051] Figure 9 This is a schematic diagram of the convolutional neural network model training proposed in the present invention;
[0052] Figure 10 This is a diagram of the architecture of the electronic equipment in this solution;
[0053] Figure 11 This is a schematic diagram of the computer-readable storage medium structure in this solution. DETAILED DESCRIPTION
[0054] The following description is intended to disclose the present invention so that those skilled in the art can implement the present invention. The preferred embodiments described below are merely examples, and those skilled in the art may conceive of other obvious variations.
[0055] A forage weed recognition system based on convolutional neural network, comprising:
[0056] Data acquisition and preprocessing module: The data acquisition and preprocessing module includes a multi-phase image acquisition unit and an image preprocessing unit, which are mainly used for image acquisition before sowing and image acquisition during the seedling greening period and light noise processing, providing standardized input for subsequent analysis.
[0057] Weed feature analysis module: The weed feature analysis module includes a pre-sowing weed detection unit and a dicotyledonous weed identification unit, which are mainly used to extract plant morphological characteristics and distinguish monocotyledonous and dicotyledonous weeds to support classification decisions;
[0058] Intelligent labeling and data set management module: The intelligent labeling and data set management module includes a semi-automatic labeling system and a data set optimization unit, which are mainly used to realize the automatic generation and enhancement of data labels and build a balanced training sample library;
[0059] Convolutional neural network core module: The convolutional neural network core module includes a convolutional neural network core module and a model training optimization unit, which is mainly used to implement end-to-end weed species recognition model training through multi-layer feature abstraction learning;
[0060] Processor: The processor is mainly used for the calculation process of each formula and the construction calculation process of each model.
[0061] See Figure 1 As shown, a forage weed recognition method based on convolutional neural network includes:
[0062] Step 1: Obtain image data of the alfalfa field before sowing and when the seedlings turn green;
[0063] Step 2: Based on the alfalfa image data before sowing, all green plants are uniformly identified as weeds by color features;
[0064] Step 3: Based on the alfalfa image data when the seedlings turn green, weeds are classified into monocotyledonous weeds and dicotyledonous weeds according to their species, and key features are obtained for alfalfa and dicotyledonous weeds;
[0065] Step 4: Attach species labels to the initial alfalfa and weeds based on key features and divide them into training and test sets;
[0066] Step 5: Build a grass and weed recognition model based on the convolutional neural network model, train the convolutional neural network through the training set, and select the convolutional neural network model with the corresponding parameters with the highest recognition accuracy
[0067] See Figure 2 As shown in the figure, based on the alfalfa image data before sowing, all green plants are uniformly identified as weeds by color features, including:
[0068] Based on the pre-processed alfalfa field image data before sowing, all pixels in the image are traversed and the grayscale value of each pixel is calculated using the color factor formula;
[0069] The histogram is calculated based on the grayscale value of the acquired image, the optimal threshold is automatically selected through the OTSU algorithm, the grayscale image is binarized, and the binary image is output to obtain the green plant area;
[0070] Through median filtering, a sliding window is used to traverse the image, and the central pixel is replaced with the median value of the pixels in the window to remove salt and pepper noise and isolated noise points in the binary image;
[0071] Morphological processing-based corrosion, expansion, and closing operations are used to fill holes, connect broken areas, and remove small noises;
[0072] Based on the processed image, the green plant areas are identified as weed areas.
[0073] Specifically, the R, G, and B components of each pixel in the acquired image are calculated according to (2G-RB). If the grayscale value of the pixel is greater than 0, the grayscale of the pixel is retained; if it is less than 0, the grayscale of the point is set to 0, thereby obtaining an image containing only green plants.
[0074] The OTSU algorithm is an algorithm for determining the threshold for image binary segmentation. For an image l(x,y), the target and background segmentation thresholds are denoted as T, the proportion of target pixels in the entire image is denoted as ω0, and its average grayscale is μ0. The proportion of background pixels in the entire image is denoted as ω1, and its average grayscale is denoted as μ1. The total average grayscale of the image is denoted as μ, and the inter-class variance is denoted as g. Assuming that the background of the image is dark and the image size is M×N, the number of pixels in the image whose grayscale value is less than the threshold T is denoted as N0, and the number of pixels whose grayscale value is greater than the threshold T is denoted as N1, then:
[0075]
[0076] N0+N1=M×N (3)
[0077] ω0+ω1=1 (4)
[0078] μ=ω0*μ0+ω1*μ1 (5)
[0079] g=ω0(μ0-μ) 2 +ω1(μ1-μ) 2 (6)
[0080] Substituting formula (5) into formula (6), we get the equivalent formula:
[0081] g=ω0ω1(μ0-μ1) 2 (7)
[0082] The traversal method is used to obtain the threshold T that maximizes the inter-class variance g.
[0083] Median filtering is a nonlinear signal processing technique based on sorting statistics theory that can effectively suppress noise. It uses a certain two-dimensional sliding template W, such as a 2*2 or 3*3 area, to sort the pixels in the template according to the size of the pixel value, generating a monotonically increasing (or decreasing) two-dimensional data sequence. The output of the two-dimensional median filter is:
[0084] g(x,y)=med{f(xk,y-1),(k,l∈W)}
[0085] Among them, f(x,y) and g(x,y) are the original image and the processed image respectively.
[0086] See Figure 3 As shown in the figure, based on the alfalfa image data when the seedlings are green, weeds are divided into monocotyledonous weeds and dicotyledonous weeds according to their species. The key features of alfalfa and dicotyledonous weeds are obtained as follows:
[0087] Based on the acquired alfalfa image data at the time of seedling re-greening, we obtained the morphological characteristics of weed leaf length-to-width ratio, leaf edge characteristics, and leaf arrangement, and classified monocotyledonous and dicotyledonous weeds.
[0088] Based on the divided dicotyledonous weeds, a preliminary screening of alfalfa and some dicotyledonous weeds was carried out by color characteristics;
[0089] Based on the dicotyledonous weeds after preliminary screening, the vein structure and texture characteristics are extracted for further fine screening;
[0090] A weed feature dataset is constructed based on the weed identification feature data in the screening step.
[0091] Specifically, weed species in alfalfa fields were collected and classified, primarily into monocotyledonous and dicotyledonous weeds. Alfalfa belongs to the dicotyledonous plant class, so identifying dicotyledonous weeds in alfalfa is theoretically difficult. Field assessments of alfalfa fields revealed that monocotyledonous weeds primarily included foxtail grass, crabgrass, goosegrass, and barnyard grass, while dicotyledonous weeds primarily included mugwort, cleavers, wild geranium, and speedwell. Herbicide control profiles were developed for each weed species.
[0092] When extracting color features, the leaf colors of dicotyledonous weeds and alfalfa are analyzed, and feature extraction is performed using color space. Alfalfa is distinguished from dicotyledonous weeds through analysis of multiple dimensions, such as hue, saturation, and brightness. This includes extracting the average color value of the leaves and comparing it with the typical color of alfalfa. For some dicotyledonous weeds with specific color characteristics (such as purple, gray-green, etc.), a preliminary screening is performed using the color threshold method. The diversity of the data can be enhanced and the robustness of the color features can be improved by adding samples with different ambient lighting and different shooting angles.
[0093] Image processing methods were used to extract the leaf vein network structure, and a skeletonization algorithm was used to extract the vein centerlines. This analysis revealed characteristics such as vein density and arrangement. This was aided by comparing the vein structures of alfalfa and dicotyledonous weeds. Texture analysis, based on the gray-level co-occurrence matrix and LBP (local binary pattern), extracted leaf texture features, such as surface texture and texture regularity, for alfalfa and some dicotyledonous weeds.
[0094] See Figure 4 As shown in the figure, the initial alfalfa and weeds are labeled based on key features, and the training and test sets are divided into the following parts:
[0095] Based on the acquired weed feature dataset, the corresponding species labels are attached to the initial alfalfa and weed color sample images;
[0096] Based on the sample images after label assignment, they are rescreened by manual verification combined with botanical features;
[0097] Based on the sample images after rescreening, weeds are divided proportionally according to their types to maintain a consistent distribution of samples.
[0098] Based on the divided sample images, the sample images of each category are divided into training set and test set categories.
[0099] Specifically, images were reviewed based on botanical characteristics (such as leaf shape, veins, phyllotaxy, and inflorescence). Labeled images were manually reviewed based on morphological characteristics, leaf distribution, and color differences, with particular emphasis on similar samples of dicotyledonous weeds and alfalfa. During rescreening, the impact of different growth stages (such as seedlings and mature plants) on morphological characteristics was taken into account, and screening criteria were adjusted appropriately.
[0100] During dataset construction, ensure that the number of samples for each weed category is roughly balanced. If there are too few samples for certain categories, data augmentation techniques (such as rotation, scaling, and flipping) can be used to generate more samples to balance the number of samples across categories and avoid having too many or too few samples in a particular category.
[0101] When dividing, the sample size of each category should be considered and divided into training set, validation set and test set according to the proportion. The specific division ratio is:
[0102] Training set: 70%-80% (used for model training)
[0103] Test set: 20%-30% (used to evaluate model performance).
[0104] See Figure 5 As shown in the figure, a forage weed recognition model based on a convolutional neural network model is constructed, and the convolutional neural network is trained using a training set. The convolutional neural network model with the highest recognition accuracy and corresponding parameters is selected. Specifically, the following are included:
[0105] A forage weed recognition model is constructed based on a convolutional neural network model, including input, feature learning, and classification.
[0106] The feature learning part includes five convolutional units, which include convolutional layers, BatchNormalization, ReLU functions, and pooling layers. The first two convolutional units are designed to have two convolutional layers, and the last three convolutional units are designed to have three convolutional layers.
[0107] The classification part includes a fully connected layer, a softmax classification function and an output layer;
[0108] Optimize network weights through forward propagation and backpropagation, dynamically adjust learning rate with early stopping, and save the model with the highest accuracy on the validation set;
[0109] Calculate the confusion matrix, accuracy, and F1-Score based on the test set, and improve inference efficiency through model compression.
[0110] Specifically, the convolutional neural network model in the present invention has the following structure: Figure 6 As shown in Figure 1, the convolution layer mainly extracts features by performing convolution operations on the input image using convolution kernels of different numbers and sizes. The convolution process is shown in the following formula (8):
[0111]
[0112] Where, Represents the i-th feature map of the convolutional layer l, f() represents the activation function, M i represents the number of convolutional layer input feature maps, represents the convolution kernel, For bias.
[0113] The pooling layer performs non-overlapping convolution on the feature maps without changing the number of feature maps, thereby achieving the purpose of reducing the model feature parameters. The pooling process is shown in the following formula (9):
[0114]
[0115] Where s represents the size of the downsampled convolution template, Represents the bias of the convolution mask.
[0116] The BatchNormalization layer uses the BatchNormalization algorithm to solve the problems of slow gradient descent and difficult fitting caused by the distribution change of input data of each convolution unit when the convolutional neural network model is trained using the AdaDelta optimization method. The specific process is as follows:
[0117] First, calculate the mean μ and variance σ of n samples in each batch, as shown in equations (10) and (11):
[0118]
[0119] However, the data is normalized as shown in the following formula (12):
[0120]
[0121] In the formula, ε is a constant to avoid the formula from failing when the variance σ is 0. In order to preserve the distribution of the original features, it is achieved through reconstruction transformation. The specific process is as follows:
[0122] y i =γi x i +β i (13)
[0123]
[0124] β i =E[x i ] (15)
[0125] Where, γ i and β i Obtained through model training, Var is the variance function, and E is the mean.
[0126] The ReLU function is used as the activation function of the neuron, specifically:
[0127]
[0128] For the convolutional neural network model, the convolution kernel network parameters are adjusted within a given interval according to the decreasing law of convolution kernel size and the exponential increasing law of convolution kernel number. Different convolution kernel network parameters are combined according to different convolution kernel sizes and numbers, thereby constructing convolutional neural network models with different network parameters. The convolutional neural network models with different network parameters are trained through the training set, and the convolutional neural network model with the highest recognition rate is selected.
[0129] The initial base learning rate is set to 0.001, and the change in validation set loss is monitored every three epochs. When the loss stagnates, the cosine annealing strategy is initiated, reducing it to a minimum of 1e-6. At the same time, the validation set accuracy is continuously tracked. If the highest record is not refreshed for five consecutive epochs, early stopping is triggered, and the model parameters are automatically rolled back to the historical optimal state.
[0130] To construct the confusion matrix, the final model was run on an independent test set. The distribution of prediction results for each category (alfalfa, monocots, and dicots) was calculated to generate an N×N matrix (N = number of categories). The sum of the diagonal elements / total sample size was used as the accuracy. For each category, 2*(precision × recall) / (precision + recall) was calculated and a weighted average was taken to obtain the F1-score. Model compression and optimization were performed through methods such as channel pruning, quantization compression, and knowledge distillation.
[0131] Furthermore, the method according to the embodiment of the present application can also be used with the aid of Figure 10 The electronic device architecture shown in FIG. Figure 10As shown, the electronic device 500 may include a bus 501, one or more CPUs 502, a read-only memory (ROM) 503, a random access memory (RAM) 504, a communication port 505 connected to a network, an input / output component 506, a hard disk 507, etc. The storage device in the electronic device 500, such as the ROM 503 or the hard disk 507, may store a forage weed identification method based on a convolutional neural network and its application provided in this application. The electronic device 500 may also include a terminal interface 508. Of course, Figure 10 The architecture shown is only exemplary and can be omitted according to actual needs when implementing different devices. Figure 10 One or more components of an electronic device are shown.
[0132] Figure 11 This is a schematic diagram of the computer-readable storage medium structure provided by an embodiment of the present application. Figure 11 , a computer-readable storage medium 600 according to one embodiment of the present application is shown. Computer-readable instructions are stored on the computer-readable storage medium 600. When the computer-readable instructions are executed by a processor, the forage weed identification method based on a convolutional neural network and its application according to the embodiment of the present application described with reference to the above figures can be executed. The storage medium 600 includes, but is not limited to, volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and cache memory. Non-volatile memory may include, for example, read-only memory (ROM), a hard disk, flash memory, etc.
[0133] It should be noted that the order in which the embodiments of the present invention are described above is for illustrative purposes only and does not necessarily represent the superiority or inferiority of the embodiments. Furthermore, the foregoing descriptions of specific embodiments of this specification are provided. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order or sequential sequence shown to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0134] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments.
[0135] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for identifying pasture weeds based on convolutional neural networks, characterized in that: include: Obtain image data of alfalfa fields before sowing and when seedlings turn green; Based on the alfalfa image data before sowing, all green plants were uniformly identified as weeds by color features; Based on the alfalfa image data at the time of seedling re-greening, weeds were classified into monocotyledonous weeds and dicotyledonous weeds according to their species, and key features of alfalfa and dicotyledonous weeds were obtained; Attach species labels to the initial alfalfa and weeds based on key features and divide them into training and test sets; A forage weed recognition model based on a convolutional neural network model was constructed, and the convolutional neural network was trained using a training set to select the convolutional neural network model with the corresponding parameters that had the highest recognition accuracy.
2. The method for identifying pasture weeds based on convolutional neural networks according to claim 1, characterized in that: The method of uniformly identifying all green plants as weeds based on the alfalfa image data before sowing by color features specifically includes: Based on the pre-processed alfalfa field image data before sowing, all pixels in the image are traversed and the grayscale value of each pixel is calculated using the color factor formula; The histogram is calculated based on the grayscale value of the acquired image, the optimal threshold is automatically selected through the OTSU algorithm, the grayscale image is binarized, and the binary image is output to obtain the green plant area; Through median filtering, a sliding window is used to traverse the image, and the central pixel is replaced with the median value of the pixels in the window to remove salt and pepper noise and isolated noise points in the binary image; Morphological processing-based corrosion, expansion, and closing operations are used to fill holes, connect broken areas, and remove small noises; Based on the processed image, the green plant areas are identified as weed areas.
3. The method for identifying pasture weeds based on convolutional neural networks according to claim 1, characterized in that: The alfalfa image data based on the greening of the seedlings is divided into monocotyledonous weeds and dicotyledonous weeds according to the weed species, and the key features of alfalfa and dicotyledonous weeds are obtained specifically including: Based on the acquired alfalfa image data at the time of seedling re-greening, we obtained the morphological characteristics of weed leaf length-to-width ratio, leaf edge characteristics, and leaf arrangement, and classified monocotyledonous and dicotyledonous weeds. Based on the divided dicotyledonous weeds, a preliminary screening of alfalfa and some dicotyledonous weeds was carried out by color characteristics; Based on the dicotyledonous weeds after preliminary screening, the vein structure and texture characteristics are extracted for further fine screening; A weed feature dataset is constructed based on the weed identification feature data in the screening step.
4. The method for identifying pasture weeds based on convolutional neural networks according to claim 1, characterized in that: The process of assigning species labels to the initial alfalfa and weeds based on key features and dividing the training set and test set specifically includes: Based on the acquired weed feature dataset, the corresponding species labels are attached to the initial alfalfa and weed color sample images; Based on the sample images after label assignment, they are rescreened by manual verification combined with botanical features; Based on the sample images after rescreening, weeds are divided proportionally according to their types to maintain a consistent distribution of samples. Based on the divided sample images, the sample images of each category are divided into training set and test set categories.
5. The method for identifying pasture weeds based on convolutional neural networks according to claim 1, characterized in that: The forage weed recognition model based on the convolutional neural network model is constructed, and the convolutional neural network is trained using a training set to select a convolutional neural network model with corresponding parameters having the highest recognition accuracy. Specifically, the forage weed recognition model is constructed as follows: A forage weed recognition model is constructed based on a convolutional neural network model, including input, feature learning, and classification. The feature learning part includes five convolutional units, which include convolutional layers, BatchNormalization, ReLU functions, and pooling layers. The first two convolutional units are designed to have two convolutional layers, and the last three convolutional units are designed to have three convolutional layers. The classification part includes a fully connected layer, a softmax classification function and an output layer; Optimize network weights through forward propagation and backpropagation, dynamically adjust learning rate with early stopping, and save the model with the highest accuracy on the validation set; Calculate the confusion matrix, accuracy, and F1-Score based on the test set, and improve inference efficiency through model compression.
6. A method for identifying pasture weeds based on a convolutional neural network is combined to implement a pasture weed identification system based on a convolutional neural network as claimed in any one of claims 1 to 6, characterized in that: include: Data acquisition and preprocessing module: The data acquisition and preprocessing module includes a multi-phase image acquisition unit and an image preprocessing unit, which are mainly used for image acquisition before sowing and image acquisition during the seedling greening period and light noise processing, providing standardized input for subsequent analysis. Weed feature analysis module: The weed feature analysis module includes a pre-sowing weed detection unit and a dicotyledonous weed identification unit, which are mainly used to extract plant morphological characteristics and distinguish monocotyledonous and dicotyledonous weeds to support classification decisions; Intelligent labeling and data set management module: The intelligent labeling and data set management module includes a semi-automatic labeling system and a data set optimization unit, which are mainly used to realize the automatic generation and enhancement of data labels and build a balanced training sample library; Convolutional neural network core module: The convolutional neural network core module includes a convolutional neural network core module and a model training optimization unit, which is mainly used to implement end-to-end weed species recognition model training through multi-layer feature abstraction learning; Processor: The processor is mainly used for the calculation process of each formula and the construction calculation process of each model.
7. An electronic device, characterized in that: include: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the forage weed identification method based on convolutional neural network as described in any one of claims 1-5.
8. A computer-readable storage medium storing computer-readable instructions, characterized in that: When the computer-readable instructions are executed by a processor, a method for identifying pasture weeds based on a convolutional neural network according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Method and system for identifying rice seedlings and weeds at seedling stage based on convolution neural network
CN109522797A
Method and system for identifying weeds in planting land based on machine vision
CN119478659A