Prune stem detection method and device based on image information, equipment and medium
Through a method based on image information and machine learning, the presence or absence of plum stalks can be automatically detected, solving the problem of low efficiency of manual judgment in the existing technology and achieving efficient and accurate classification of plum stalks.
Patent Information
- Application Number
- CN202510820453.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-19
- Publication Date
- 2025-09-23
AI Technical Summary
Existing technologies make it difficult to efficiently and automatically determine whether a plum has a stalk, resulting in low manual identification efficiency and an inability to meet the needs of high-quality and standardized storage of plums.
An image-based method combined with machine learning is used to obtain plum images for preprocessing and edge detection, calculate the roundness of the plums, and use the linear kernel function of the support vector machine to train the classification model to achieve automatic detection of whether plums have stalks or not.
It improves the accuracy and efficiency of plum stem detection, reduces time and labor costs, and provides an efficient automated sorting solution.
Smart Images

Figure CN120689865A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of non-destructive detection of prunes, and in particular to a method, device, equipment and medium for detecting prune stalks based on image information. Background Art
[0002] Identifying the presence of stalks in prunes is a crucial component of post-harvest storage. Generally, prunes with stalks last longer than those without stalks under the same storage conditions. With the continuous growth of prune production in my country, manual post-harvest prune stalk identification alone is no longer sufficient. A more standardized and high-quality prune identification method is needed. Therefore, a method for identifying the presence of stalks in prunes that is both manual and undemanding is a significant need.
[0003] Existing techniques for determining the presence of prunes based on pedicles primarily focus on selecting the image background, image preprocessing, and feature selection. Using a single feature to easily and accurately identify prune pedicles is currently a challenge in image-based detection. Summary of the Invention
[0004] In view of this, the purpose of the present invention is to overcome the deficiencies in the prior art and provide a method, device, equipment and medium for detecting plum stalks based on image information, which is used to detect whether plums have stalks by utilizing image information combined with machine learning.
[0005] The present invention provides the following technical solutions: In a first aspect, the present invention provides a method for detecting prune stalks based on image information, comprising: Acquiring a plurality of prune images under a preset background, and preprocessing each of the prune images; performing edge detection on each preprocessed prune image to obtain a prune roundness corresponding to each preprocessed prune image; Constructing a training set based on the roundness of each prune and the pre-labeled labels corresponding to each prune image; the pre-labeled labels include a label with a stalk and a label without a stalk; Based on the linear kernel function of the support vector machine, the initial classification model is trained according to the training set to obtain a mature target classification model; The target classification model is used to detect whether the plum to be identified has a stalk.
[0006] In one embodiment, the pre-processing of each of the prune images includes: For each of the prune images, converting the prune image into a grayscale image based on an average weighted method; reducing noise in the grayscale image based on Gaussian filtering to obtain a filtered image; Binarizing the filtered image based on an adaptive threshold method to obtain a binarized image; Pixel values of the binarized image are inverted to obtain the preprocessed prune image.
[0007] In one embodiment, performing edge detection on each preprocessed prune image to obtain the prune roundness corresponding to each preprocessed prune image includes: For each of the preprocessed prune images, determining a plurality of connected regions from the preprocessed prune image; Acquire region attributes of each of the connected regions based on edge detection; Determining the connected region with the largest area from the plurality of connected regions as the target region according to the attributes of each region; The regional circularity of the target area is calculated according to the regional attributes of the target area, and the regional circularity is used as the prune circularity corresponding to the preprocessed prune image.
[0008] In one embodiment, determining a plurality of connected regions from the pre-processed prune image comprises: Filling the holes in the preprocessed plum image to obtain a filled image; The connected regions are determined from the padded image.
[0009] In one embodiment, constructing a training set based on the roundness of each prune and the pre-labeled label corresponding to each prune image includes: An initial index array is established based on the roundness of each prune and the pre-labeled label corresponding to each prune image; Randomly rearrange the order of the initial index array to obtain a target index array; The training set is determined from the target index array.
[0010] In one embodiment, the linear kernel function based on the support vector machine is used to train the classification model according to the training set to obtain a mature target classification model, including: Inputting the training set into the initial classification model for training to obtain a predicted value; Establishing a confusion matrix based on the training set and the predicted value; Based on the linear kernel function of the support vector machine, the optimization direction of the initial classification model is adjusted according to the confusion matrix until the initial classification model is trained to convergence, thereby obtaining the target classification model.
[0011] In one embodiment, the method further comprises: determining a test set from the target index array; The target classification model is verified based on the test set.
[0012] In a second aspect, the present invention provides a device for detecting prune stems based on image information, comprising: a processing module, configured to obtain a plurality of prune images under a preset background and pre-process each of the prune images; an acquisition module, configured to perform edge detection on each preprocessed prune image to obtain a prune roundness corresponding to each preprocessed prune image; A construction module is used to construct a training set based on the roundness of each prune and the pre-labeled labels corresponding to each prune image; the pre-labeled labels include a fruit stalk label and a fruit stalk-free label; A training module is used to train the initial classification model based on the linear kernel function of the support vector machine according to the training set to obtain a mature target classification model; The detection module is used to detect whether the plum to be identified has a stalk through the target classification model.
[0013] In a third aspect, the present invention provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the method for detecting prune stalks based on image information as described in the first aspect is implemented.
[0014] In a fourth aspect, the present invention provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the method for detecting prune stalks based on image information as described in the first aspect.
[0015] The present invention discloses a method, device, equipment, and medium for detecting prune stalks based on image information. The method obtains multiple prune images under a preset background and pre-processes each prune image; performs edge detection on each pre-processed prune image to obtain the prune roundness corresponding to each pre-processed prune image; constructs a training set based on the prune roundness and the pre-labeled labels corresponding to each prune image; the pre-labeled labels include a stalk label and a no stalk label; trains an initial classification model based on the training set based on the linear kernel function of a support vector machine to obtain a trained target classification model; and detects whether the prune to be identified has a stalk using the target classification model. In this way, machine vision is used to quickly and accurately classify prune images, thereby improving classification efficiency and greatly saving time and labor costs. At the same time, using the roundness of the prune as a classification feature greatly reduces the difficulty of information processing and provides excellent classification accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solution of the present invention, the following is a brief introduction to the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present invention and should not be regarded as limiting the scope of protection of the present invention. In each of the drawings, similar components are numbered similarly.
[0017] Figure 1 A schematic diagram of a process of the prune stalk detection method based on image information proposed in this embodiment is shown; Figure 2 Another schematic diagram of the process of detecting prune stems based on image information proposed in this embodiment is shown; Figure 3 Another schematic diagram of the process of the prune stalk detection method based on image information proposed in this embodiment is shown; Figure 4 A schematic diagram of the image processing stage of prunes with stalks proposed in this embodiment is shown; Figure 5 A schematic diagram of the image processing stage of stalkless plums proposed in this embodiment is shown; Figure 6 A schematic diagram of the confusion matrix proposed in this embodiment is shown; Figure 7 A schematic diagram showing the test results proposed in this embodiment; Figure 8 A schematic structural diagram of a prune stalk detection device based on image information proposed in this embodiment is shown. DETAILED DESCRIPTION
[0018] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.
[0019] The components of the embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a variety of different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the figures is not intended to limit the scope of the claimed invention, but rather merely represents selected embodiments of the present invention. All other embodiments derived by those skilled in the art based on the embodiments of the present invention without inventive effort are intended to be within the scope of protection of the present invention.
[0020] Hereinafter, the terms "including", "having" and their cognates, which may be used in various embodiments of the present invention, are intended only to indicate specific features, numbers, steps, operations, elements, components or combinations of the foregoing items, and should not be understood as first excluding the existence of one or more other features, numbers, steps, operations, elements, components or combinations of the foregoing items or the possibility of adding one or more features, numbers, steps, operations, elements, components or combinations of the foregoing items.
[0021] Furthermore, the terms “first,” “second,” “third,” etc., are merely used for distinguishing descriptions and are not to be understood as indicating or implying relative importance.
[0022] Unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by those skilled in the art to which the various embodiments of the present invention pertain. The terms (such as those defined in generally used dictionaries) will be interpreted as having the same meaning as in the context of the relevant technical field and will not be interpreted as having an idealized meaning or an overly formal meaning unless clearly defined in the various embodiments of the present invention.
[0023] Example 1 The presence of a stalk is a crucial factor in determining post-harvest prune storage options. Generally, prunes with stalks last longer than those without stalks under the same storage conditions. With the continuous growth of prune production in my country, manual post-harvest prune stalk identification alone is no longer sufficient. A more standardized and high-quality prune identification method is needed. Therefore, a method for identifying the presence of stalks in prunes that is both manual and undemanding is a significant need.
[0024] The disclosed embodiments provide a method for detecting prune stalks based on image information, which is used to detect whether prunes have stalks by utilizing image information in combination with machine learning.
[0025] See Figure 1 The image-based prune stalk detection method includes steps S101 to S105, and each step is described in detail below.
[0026] Step S101 : acquiring a plurality of prune images under a preset background, and preprocessing each of the prune images.
[0027] In this example, multiple individual prune images were collected against a preset background and preprocessed, improving the accuracy of subsequent prune images used for model training. Prunes are dark in color, so a white background was used as the preset background to enhance image contrast.
[0028] See Figure 2In a specific embodiment, step S101 includes steps S1011 to S1014, and each step is described in detail below.
[0029] Step S1011 : for each of the prune images, convert the prune image into a grayscale image based on an average weighted method.
[0030] In this embodiment, each prune image is grayscaled based on the average value method to obtain a grayscale image corresponding to each prune image, thereby simplifying subsequent processing steps while retaining basic image information.
[0031] Step S1012: reducing noise in the grayscale image based on Gaussian filtering to obtain a filtered image.
[0032] In this embodiment, random noise in the grayscale image is reduced based on Gaussian filtering to obtain a smoother filtered image, which facilitates subsequent image segmentation and feature extraction.
[0033] Step S1013 , binarizing the filtered image based on an adaptive threshold method to obtain a binarized image.
[0034] In this embodiment, the filtered image is binarized based on the adaptive threshold method, which can better process images with uneven illumination, so as to obtain a binarized image with good binarization effect under different illumination conditions.
[0035] Step S1014 , performing pixel value inversion on the binarized image to obtain the pre-processed plum image.
[0036] In this embodiment, pixel values of the binary image are inverted to obtain a pre-processed prune image that more prominently highlights the contours of the prunes.
[0037] Step S102 : performing edge detection on each pre-processed prune image to obtain the prune roundness corresponding to each pre-processed prune image.
[0038] In this embodiment, edge detection is performed on each pre-processed prune image to obtain the area and perimeter of the prune in each pre-processed prune image, and the corresponding prune circularity is calculated using the following formula: Using the roundness of prunes as a classification feature greatly reduces the difficulty of information processing and provides excellent classification accuracy.
[0039] See Figure 3 In a specific embodiment, step S102 includes steps S1021 to S1024, and each step is described in detail below.
[0040] Step S1021 : for each of the preprocessed prune images, determining a plurality of connected regions from the preprocessed prune image.
[0041] In this embodiment, multiple connected regions are identified from each preprocessed prune image. A connected region is a region consisting of interconnected pixels with the same pixel value. Specifically, a connected region labeling algorithm (such as a 4-connected or 8-connected algorithm) is used to process the preprocessed prune image to identify the connected regions within the image.
[0042] In a specific embodiment, step S1021 includes: filling the holes inside the pre-processed prune image to obtain a filled image; and determining each of the connected regions from the filled image.
[0043] In this embodiment, the holes inside the pre-processed prune image are filled to obtain a more complete filled image; and a connected component labeling algorithm is further used to determine each connected component from the filled image.
[0044] Step S1022: Acquire region attributes of each connected region based on edge detection.
[0045] In this embodiment, edge detection is used to obtain the region attributes of each connected region. For example, the region attribute may be the region area.
[0046] Step S1023 : determining the connected region with the largest area from the multiple connected regions as the target region according to the region attributes.
[0047] In this embodiment, the connected region with the largest area is determined from multiple connected regions according to region attributes as the target region, which helps to eliminate noise or small-area interference.
[0048] Step S1024 , calculating the regional circularity of the target region according to the regional attributes of the target region, and using the regional circularity as the prune circularity corresponding to the pre-processed prune image.
[0049] In this embodiment, the circularity of the target region is calculated based on its regional attributes, and this circularity is used as the circularity of the prune corresponding to the preprocessed prune image. The circularity value typically ranges from 0 to 1, with values closer to 1 indicating a more circular shape. This can be used to assess whether a prune has a stalk.
[0050] See Figure 4 and Figure 5, respectively, are the processing processes of the plum image with a stalk and the plum image without a stalk. From left to right, they are the original plum image, the preprocessed plum image, the filled image, and the plum roundness corresponding to the original plum image.
[0051] Step S103 , constructing a training set based on the roundness of each prune and the pre-labeled labels corresponding to each prune image; the pre-labeled labels include a label with a stalk and a label without a stalk.
[0052] In this embodiment, each prune image is pre-labeled to determine whether it has a stalk, and a training set is constructed based on the prune roundness corresponding to each prune image and the pre-labeled labels corresponding to each prune image for model training.
[0053] In a specific embodiment, step S103 includes: establishing an initial index array based on the roundness of each prune and the pre-labeled label corresponding to each prune image; randomly rearranging the order of the initial index array to obtain a target index array; and determining the training set from the target index array.
[0054] In this embodiment, when constructing the training set, data randomization is typically required to prevent the order of the data from affecting model training. Specifically, an initial index array is created based on the roundness of each prune and its corresponding pre-labeled label. The order of the initial index array is randomly rearranged to obtain a target index array. The training set is then partitioned from the target index array.
[0055] Step S104 , based on the linear kernel function of the support vector machine, the initial classification model is trained according to the training set to obtain a mature target classification model.
[0056] In this embodiment, the initial classification model is trained by the linear kernel function of the support vector machine (SVM) algorithm. During the training process, the training set is input into the initial classification model for training. The SVM uses the linear kernel function on the given training set to solve a convex optimization problem, and finally learns a robust linear classification model defined by the weight vector w and the bias b based on the maximum margin principle, i.e., the target classification model.
[0057] In a specific embodiment, step S104 includes: inputting the training set into the initial classification model for training to obtain a predicted value; establishing a confusion matrix based on the training set and the predicted value; based on the linear kernel function of the support vector machine, adjusting the optimization direction of the initial classification model according to the confusion matrix until the initial classification model is trained to convergence to obtain the target classification model.
[0058] In this embodiment, the training set is input into the initial classification model for training to obtain a prediction value, which is the label of whether the initial classification model predicts the roundness of the prune and whether there is a stalk.
[0059] Furthermore, a confusion matrix is established based on the true pre-labeled labels corresponding to the roundness of plums in the training set and the corresponding predicted labels of whether there is a fruit stem, such as Figure 6 As shown, "1" means there is a fruit stalk, and "0" means there is no fruit stalk.
[0060] Furthermore, the error type is determined according to the confusion matrix, and the linear kernel function of the support vector machine is used to adjust the weight vector w and bias b according to the error type until the error rate on the training set is minimized and stable, and the target classification model is obtained.
[0061] In a specific embodiment, the method further includes: determining a test set from the target index array; and verifying the target classification model based on the test set.
[0062] In this embodiment, the test set is determined from the target index array, and the target classification model is verified based on the test set to determine the overall classification effect of the target classification model, and then adjust the training direction of the classification model. Generally, the training set and the test set are divided according to the ratio of 0.7:0.3. The test results are as follows Figure 7 shown.
[0063] Step S105: detecting whether the plum to be identified has a stalk by using the target classification model.
[0064] In this embodiment, the roundness of the prune to be identified is calculated and input into a trained target classification model to detect the presence or absence of a fruit stalk, thereby enabling rapid and accurate classification of prune images through machine vision, thereby improving classification efficiency and greatly saving time and labor costs.
[0065] The present embodiment proposes a method for detecting prune stalks based on image information. The method obtains multiple prune images under a preset background and pre-processes each prune image. Edge detection is performed on each pre-processed prune image to obtain the prune roundness corresponding to each pre-processed prune image. A training set is constructed based on the roundness of each prune and the pre-labeled labels corresponding to each prune image. The pre-labeled labels include a stalk label and a no stalk label. Based on the linear kernel function of a support vector machine, an initial classification model is trained according to the training set to obtain a mature target classification model. The target classification model is used to detect whether the prune to be identified has a stalk. In this way, machine vision is used to quickly and accurately classify prune images, which improves classification efficiency and greatly saves time and labor costs. At the same time, the use of the roundness of the prune as a classification feature greatly reduces the difficulty of information processing and provides excellent classification accuracy.
[0066] Example 2 In addition, the present disclosure provides a device 800 for detecting prune stems based on image information. Figure 8 ,include: The processing module 801 is used to obtain a plurality of prune images under a preset background and pre-process each of the prune images; An acquisition module 802 is configured to perform edge detection on each pre-processed prune image to obtain a prune roundness corresponding to each pre-processed prune image; A construction module 803 is configured to construct a training set based on the roundness of each prune and the pre-labeled labels corresponding to each prune image; the pre-labeled labels include a stalk label and a no stalk label; A training module 804 is configured to train the initial classification model based on the training set using a linear kernel function of a support vector machine to obtain a mature target classification model; The detection module 805 is used to detect whether the plum to be identified has a stalk through the target classification model.
[0067] Optionally, the processing module 801 is further used to convert each of the prune images into a grayscale image based on an average weighted method; reduce the noise in the grayscale image based on Gaussian filtering to obtain a filtered image; binarize the filtered image based on an adaptive threshold method to obtain a binarized image; and invert the pixel values of the binarized image to obtain the preprocessed prune image.
[0068] Optionally, the acquisition module 802 is further used to determine, for each of the preprocessed prune images, multiple connected regions from the preprocessed prune images; obtain regional attributes of each of the connected regions based on edge detection; determine, from the multiple connected regions, the connected region with the largest area as the target region according to each of the regional attributes; calculate the regional circularity of the target region according to the regional attributes of the target region, and use the regional circularity as the prune circularity corresponding to the preprocessed prune image.
[0069] Optionally, the acquisition module 802 is further configured to fill the holes in the pre-processed plum image to obtain a filled image; and determine each of the connected regions from the filled image.
[0070] Optionally, construction module 803 is further configured to establish an initial index array based on the roundness of each prune and the pre-labeled label corresponding to each prune image; randomly rearrange the order of the initial index array to obtain a target index array; and determine the training set from the target index array.
[0071] Optionally, the training module 804 is also used to input the training set into the initial classification model for training to obtain a predicted value; establish a confusion matrix based on the training set and the predicted value; and adjust the optimization direction of the initial classification model according to the confusion matrix based on the linear kernel function of the support vector machine until the initial classification model is trained to convergence to obtain the target classification model.
[0072] Optionally, the construction module 803 is further configured to determine a test set from the target index array; The training module 804 is further configured to verify the target classification model based on the test set.
[0073] The device provided in the embodiment of the present disclosure can execute the steps of the prune stalk detection method based on image information provided in Example 1, which will not be described again to avoid repetition.
[0074] The image-based prune stalk detection device proposed in this embodiment obtains multiple prune images under a preset background and pre-processes each of the prune images; performs edge detection on each pre-processed prune image to obtain the prune roundness corresponding to each of the pre-processed prune images; constructs a training set based on the roundness of each prune and the pre-labeled labels corresponding to each of the prune images; the pre-labeled labels include a stalk label and a no stalk label; trains an initial classification model based on the training set based on the linear kernel function of a support vector machine to obtain a mature target classification model; and detects whether the prune to be identified has a stalk using the target classification model. In this way, machine vision is used to quickly and accurately classify prune images, thereby improving classification efficiency and greatly saving time and labor costs. At the same time, using the roundness of the prune as a classification feature greatly reduces the difficulty of information processing and provides excellent classification accuracy.
[0075] Example 3 In addition, an embodiment of the present disclosure provides a computer device including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the method for detecting prune stalks based on image information described in Example 1 is implemented.
[0076] The device provided in the embodiment of the present disclosure can execute the steps of the prune stalk detection method based on image information provided in Example 1, which will not be described again to avoid repetition.
[0077] Example 4 The embodiment of the present disclosure provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the method for detecting prune stalks based on image information described in the first embodiment is implemented.
[0078] In this embodiment, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0079] The computer-readable storage medium provided in this embodiment can implement the method for detecting prune stalks based on image information provided in Example 1, and will not be described again here to avoid repetition.
[0080] In all examples shown and described herein, any specific values should be interpreted as merely exemplary and not limiting, and thus other examples of the exemplary embodiments may have different values.
[0081] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, it does not require further definition or explanation in subsequent drawings.
[0082] The above-described embodiments merely illustrate several implementations of the present invention, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that variations and modifications are possible without departing from the scope of the present invention, and such variations and modifications are fully within the scope of protection of the present invention.
Claims
1. A method for detecting prune stems based on image information, characterized in that: include: Acquiring a plurality of prune images under a preset background, and preprocessing each of the prune images; performing edge detection on each preprocessed prune image to obtain a prune roundness corresponding to each preprocessed prune image; Constructing a training set based on the roundness of each prune and the pre-labeled labels corresponding to each prune image; the pre-labeled labels include a label with a stalk and a label without a stalk; Based on the linear kernel function of the support vector machine, the initial classification model is trained according to the training set to obtain a mature target classification model; The target classification model is used to detect whether the plum to be identified has a stalk.
2. The method for detecting prune stems based on image information according to claim 1, wherein: The preprocessing of each of the prune images comprises: For each of the prune images, converting the prune image into a grayscale image based on an average weighted method; reducing noise in the grayscale image based on Gaussian filtering to obtain a filtered image; Binarizing the filtered image based on an adaptive threshold method to obtain a binarized image; Pixel values of the binarized image are inverted to obtain the preprocessed prune image.
3. The method for detecting prune stalks based on image information according to claim 1, wherein: The performing edge detection on each pre-processed prune image to obtain the prune roundness corresponding to each pre-processed prune image includes: For each of the preprocessed prune images, determining a plurality of connected regions from the preprocessed prune image; Acquire region attributes of each of the connected regions based on edge detection; Determining the connected region with the largest area from the plurality of connected regions as the target region according to the attributes of each region; The regional circularity of the target area is calculated according to the regional attributes of the target area, and the regional circularity is used as the prune circularity corresponding to the preprocessed prune image.
4. The method for detecting prune stalks based on image information according to claim 3, wherein: Determining a plurality of connected regions from the preprocessed plum image includes: Filling the holes in the preprocessed plum image to obtain a filled image; The connected regions are determined from the padded image.
5. The method for detecting prune stalks based on image information according to claim 1, wherein: The constructing of a training set according to the roundness of each prune and the pre-labeled label corresponding to each prune image comprises: An initial index array is established based on the roundness of each prune and the pre-labeled label corresponding to each prune image; Randomly rearrange the order of the initial index array to obtain a target index array; The training set is determined from the target index array.
6. The method for detecting prune stalks based on image information according to claim 1, wherein: The linear kernel function based on the support vector machine is used to train the classification model according to the training set to obtain a mature target classification model, including: Inputting the training set into the initial classification model for training to obtain a predicted value; Establishing a confusion matrix based on the training set and the predicted value; Based on the linear kernel function of the support vector machine, the optimization direction of the initial classification model is adjusted according to the confusion matrix until the initial classification model is trained to convergence, thereby obtaining the target classification model.
7. The method for detecting prune stalks based on image information according to claim 5, characterized in that: The method further comprises: determining a test set from the target index array; The target classification model is verified based on the test set.
8. A device for detecting prune stems based on image information, characterized in that: include: a processing module, configured to obtain a plurality of prune images under a preset background and pre-process each of the prune images; an acquisition module, configured to perform edge detection on each preprocessed prune image to obtain a prune roundness corresponding to each preprocessed prune image; A construction module is used to construct a training set based on the roundness of each prune and the pre-labeled labels corresponding to each prune image; the pre-labeled labels include a fruit stalk label and a fruit stalk-free label; A training module is used to train the initial classification model based on the linear kernel function of the support vector machine according to the training set to obtain a mature target classification model; The detection module is used to detect whether the plum to be identified has a stalk through the target classification model.
9. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the method for detecting prune stalks based on image information according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium, characterized in that It stores a computer program, which, when executed by a processor, implements the method for detecting prune stalks based on image information as described in any one of claims 1 to 7.