A Method and System for Generating the Cutting Trajectory of the Main Root of Panax notoginseng

By constructing a deep learning network model, the fusion of dense annotation and multi-scale features generates the tool path trajectory of the main root of Sanqi, which solves the problem of high and low computing cost in traditional methods, and achieves efficient and accurate automated cutting.

CN114140485BActive Publication Date: 2025-07-11KUNMING UNIV OF SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111431225.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-29
Publication Date
2025-07-11
Estimated Expiration
2041-11-29

AI Technical Summary

Technical Problem

The prior art is difficult to quickly and efficiently identify the main root of Panax notoginseng and generate a tool path trajectory that removes non-main root parts. The traditional method has high calculation cost and low efficiency, so it cannot be applied to automated production.

Method used

The deep learning network model is constructed through dense continuous annotation, and a multi-scale residual unit and multi-scale feature fusion module are used to generate a dense detection bounding box, combining conditional operations and logical judgment screening coordinates, fit the main root contour of Sanqi and generate a smooth tool path trajectory.

Benefits of technology

It improves the accuracy and speed of the main root detection of Sanqi, reduces calculation costs, is suitable for automated production, reduces vibration of cutting equipment, and improves processing accuracy and stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114140485B_ABST
    Figure CN114140485B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and system for generating the cutting trajectory of the main root of Panax notoginseng. The method includes constructing a Panax notoginseng image dataset; adjusting the prototype of the constructed deep learning network model to obtain a deep learning network model; making the collected Panax notoginseng image dataset into a training dataset and a validation dataset; using the training dataset to train the deep learning network model, screening out multiple candidate weights; selecting an optimal weight; obtaining a frozen model; inputting the newly obtained Panax notoginseng image to be detected into the frozen model for detection to obtain dense detection bounding boxes; extracting the four corner coordinates and the center point coordinate of the detection bounding box to obtain scattered point coordinates and a broken line formed by connecting the center points; enumerating the scattered point coordinates in sequence and connecting them in sequence without intersecting the above-mentioned broken line to obtain a connected closed contour; smoothing the closed contour to obtain a tool path trajectory. The present invention can effectively generate a trajectory for removing the non-main root part of Panax notoginseng.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a method and system for generating the cutting trajectory of the main root of Panax notoginseng, belonging to the fields of artificial intelligence target detection and computer vision. Background Art

[0002] In practical engineering applications, the medicinal ingredient content of the main root of Panax notoginseng is relatively high. However, if other parts (such as small roots and fibrous roots) are mixed in during pharmaceutical production, its medicinal effect will be significantly affected. How to quickly and efficiently identify the main roots with large morphological differences and generate the tool path trajectory for cutting off the non-main root parts based on the scattered point coordinates fitted by the main roots is of great significance for realizing fully automated production.

[0003] In traditional target detection methods, each bounding box corresponds to a complete detection target. Limited by the diversity of the morphology of the main root of Panax notoginseng, if a single bounding box is used as the cutting trajectory of the main root, it is not conducive to effectively cutting off the non-main root parts.

[0004] Furthermore, although deep learning algorithms such as Segnet, FCN, and U-Net in the field of computer vision can accurately segment the contour of the main root of the unobstructed part from the background, there are still many problems: Firstly, the pixel-level segmentation requires a relatively high computational cost and slow speed, resulting in a significant increase in the cost of embedding industrial detection equipment and low efficiency; Secondly, generating the cutting trajectory by fitting the edges too precisely greatly improves the requirements for the motion performance and computing power of mechanical cutting equipment, and is not suitable for automated production projects that take both cost and efficiency into account. Summary of the Invention

[0005] The present invention provides a method and system for generating the cutting trajectory of the main root of Panax notoginseng, which is used to realize the detection of Panax notoginseng through dense continuous annotation in cooperation with deep learning, and on this basis, quickly generate the trajectory for cutting off the non-main root parts of Panax notoginseng.

[0006] The technical solution of the present invention is: A method for generating the cutting trajectory of the main root of Panax notoginseng, comprising:

[0007] Constructing a Panax notoginseng image dataset;

[0008] Adjusting the prototype of the constructed deep learning network model to obtain a deep learning network model;

[0009] Making the collected Panax notoginseng image dataset into a training dataset and a validation dataset;

[0010] Training the deep learning network model with the training dataset to screen out multiple candidate weights;

[0011] Evaluating the performance of the candidate weights respectively with the validation dataset, and selecting an optimal weight;

[0012] Load the optimal weights into the deep learning network model, and use this model to detect the Panax notoginseng images to be detected to adjust the detection hyperparameters of the deep learning network model. After determining the optimal detection hyperparameters, also load them into the deep learning network model to obtain a frozen model;

[0013] Input the newly obtained Panax notoginseng images to be detected into the frozen model for detection to obtain dense detection bounding boxes;

[0014] Extract the four corner coordinates and the center point coordinate of the detection bounding box. Screen and sort all the corner coordinates of the detection bounding box, and sort the center coordinates and connect them in sequence; obtain scatter point coordinates and a broken line formed by connecting the center points;

[0015] Enumerate the scatter point coordinates in sequence and connect them in sequence without intersecting the above-mentioned broken line to obtain a connected closed contour;

[0016] Smooth the closed contour to obtain a tool path trajectory.

[0017] The adjustment of the prototype of the constructed deep learning network model to obtain the deep learning network model includes: using a prototype of the deep learning network model constructed by a shallow network, multi-scale residual units, multi-scale feature fusion modules, and prediction head modules; adjusting the model through ablation experiments and size data in the Panax notoginseng dataset to obtain the deep learning network model.

[0018] The adjustment of the model through ablation experiments and size data in the Panax notoginseng dataset to obtain the deep learning network model includes:

[0019] Step 2.1: Obtain multiple different prototypes of the deep learning network model by changing the number of residual modules in the multi-scale residual unit under the same other conditions;

[0020] Step 2.2: Perform performance evaluations on multiple different prototypes of the deep learning network model, and then select the model with the best performance from them to determine the optimal number of residual modules;

[0021] Step 2.3: Redesign the sizes of the preset anchor boxes contained in the multi-scale feature maps in the multi-scale feature fusion module: Apply n different aspect ratios to the preset anchor boxes, and calculate the width and height of the preset anchor boxes in combination with the data obtained in Step 1 to obtain n + 1 different sizes of preset anchor boxes.

[0022] The specific calculation of the preset anchor box is: n is taken as 5, and 5 different aspect ratios are applied to the preset anchor box Each aspect ratio corresponds to an anchor box type, that is, the anchor box types a = 1, 2, 3, 4, 5, and thus calculate the width of each preset anchor box and height For the aspect ratio a r When it is 1, add a preset anchor box. The corresponding anchor box type a = 6, and the width and height of the preset anchor box corresponding to anchor box type 6 are Each anchor box takes the center coordinates Plus width and height information Indicated; where S min Is the minimum diameter of the main root of pseudo-ginseng in the statistically measured size data, S max Is the maximum diameter of the main root of pseudo-ginseng in the statistically measured size data, k represents the sorting of m multi-scale feature maps in the multi-scale feature fusion module from large to small, and m represents the number of multi-scale feature maps.

[0023] Making the collected pseudo-ginseng image dataset into a training dataset and a validation dataset includes:

[0024] Step 3.1: Densely and continuously annotate the pseudo-ginseng image dataset through the labelImg toolkit. The dense annotation is specifically: annotate according to the shape of the main root of pseudo-ginseng using multiple annotation boxes of different sizes, and it is necessary to ensure that the annotation boxes are continuous. The continuity of the annotation boxes means that there is an area overlap between the annotation boxes; the center point distance between adjacent annotation boxes should be greater than the distance S:

[0025]

[0026] Among them, S is the distance from a single unit of the feature map with the smallest output size mapped back to the original image; W f And H f Respectively represent the width and height of the feature map with the smallest size; W and H respectively represent the width and height of the images in the input pseudo-ginseng image dataset;

[0027] Step 3.2: Divide the annotated dataset into a training dataset and a validation dataset according to 80% and 20% of its quantity.

[0028] Using the training dataset to train the deep learning network model, and screening out multiple candidate weights, including:

[0029] Step 4.1: Configure the training hyperparameters in the train.py file of the deep learning network model yolo3-master. The hyperparameter adjustment includes at least one of the following: the number of extracted pictures, the learning rate, the momentum, the number of iterations, the unlocked number of iterations, and the weight decay coefficient; the rest of the parameters are default values;

[0030] Step 4.2: Train the deep learning network model; the objects of training include: the upper left coordinates (x min 、y min ) and the lower right coordinates (x max, y max ), category class; The manifestation form of the training result is the weight file obtained after each training iteration;

[0031] Step 4.3: Call the train.py file in the deep learning network model yolo3-master to start training. The specific training process is as follows:

[0032] Step 4.3.1: Call the train.py file to train the deep learning network model;

[0033] Step 4.3.2: Randomly select a batch_size of images from the training set as the current training samples; where batch_size represents the number of images extracted from the training set at one time;

[0034] Step 4.3.3: Put each image in the training samples described in Step 4.3.2 into the deep learning network model in turn to update the weight parameters; The update of the weight parameters is specifically as follows: Randomly initialize the weight parameters or load the pre-trained weight parameters, perform the forward propagation calculation of the convolutional neural network to obtain a set of intermediate parameters, and then use the intermediate parameters to update the weight parameters through backpropagation; The new weight parameters will replace the old weight parameters used for calculating the forward propagation;

[0035] Step 4.3.4: Denote the process of performing one forward and backward propagation on all the images in the training dataset described in Step 4.3.2 as one training of the deep learning network model, and save a weight file for each training; Repeat Step 4.3.2 to Step 4.3.3 until the number of training times for the network model reaches the set number of iterations;

[0036] Step 4.3.5: After reaching the set number of training times, screen the obtained all weight files through the performance evaluation index provided by the deep learning network model to obtain multiple candidate weight files.

[0037] The obtaining of the dense detection bounding boxes includes:

[0038] Input the pseudo-ginseng image to be detected into the frozen model, and the frozen model outputs a series of offset information of the center points of the anchor boxes and scaling information of the width and height of the anchor boxes The output information and the corresponding preset anchor box information are decoded to obtain dense detection bounding box information (x c , y c , w, h), and the decoding formula is:

[0039]

[0040] For each detection bounding box, the information is from (xc , y c , the representation form of (w, h) is converted into the form represented by the upper left corner coordinates (x min , y min ), and the lower right corner coordinates (x max , y max ). The conversion formula is:

[0041]

[0042] Wherein, x c , y c represents the center point coordinate information of the dense detection bounding box; w, h represent the width and height information of the dense detection bounding box.

[0043] The obtaining of the scatter coordinates and a broken line connected by the center points includes: extracting the four corner coordinate information of all dense detection boxes in the to-be-detected Panax notoginseng image, and respectively judging whether the four corner coordinates of each detection box are located inside other detection boxes, suppressing the enclosed corner coordinates, and finally regarding the non-suppressed corner coordinates as scatter points, and calculating variances respectively according to the distributions of the scatter points on the X-axis and Y-axis for sorting; at the same time, calculating the center point coordinates of the dense detection boxes, sorting the center point coordinates in the same way, and connecting them in sequence to form a broken line.

[0044] The obtaining of the connected closed contour includes: enumerating each obtained scatter point in sequence, directly adding the first and second coordinates to the coordinate connection list as the initial upper and lower ends, and then respectively judging whether the line segments connecting the scatter point to the upper and lower ends intersect with the obtained broken line every time a scatter point is enumerated: if one intersects and one does not intersect, connect the non-intersecting end, if both connecting lines intersect, ignore the scatter point, if both connecting lines do not intersect, connect the nearer end; after each scatter point is connected to the coordinate connection list, use the head and tail ends of the coordinate connection list as the upper and lower ends of the current list; after enumerating all coordinates to obtain a complete coordinate connection list, and connecting its head and tail, obtain a closed contour approximately fitting the main root of Panax notoginseng.

[0045] A system for generating the cutting trajectory of the main root of Panax notoginseng includes:

[0046] A construction unit, used for constructing a Panax notoginseng image data set;

[0047] A first obtaining unit, used for adjusting the prototype of the constructed deep learning network model to obtain a deep learning network model;

[0048] An execution unit, used for making the collected Panax notoginseng image data set into a training data set and a validation data set;

[0049] A first screening unit, used for training the deep learning network model using the training data set to screen out multiple candidate weights;

[0050] A second screening unit, configured to use a validation data set to evaluate the performance of candidate weights respectively, and select an optimal weight.

[0051] A second obtaining unit, configured to load the optimal weight into a deep learning network model, and use this model to detect the Panax notoginseng image to be detected to adjust the detection hyperparameters of the deep learning network model. After determining the optimal detection hyperparameters, load them into the deep learning network model as well to obtain a frozen model.

[0052] A third obtaining unit, configured to input the newly obtained Panax notoginseng image to be detected into the frozen model for detection, and obtain dense detection bounding boxes.

[0053] A fourth obtaining unit, configured to extract the four corner coordinates and the center point coordinate of the detection bounding box, screen and sort all the corner coordinates of the detection bounding box, and sort the center coordinates and connect them in sequence; obtain scatter coordinates and a broken line formed by connecting the center points;

[0054] A fifth obtaining unit, configured to enumerate the scatter coordinates in sequence and connect them in sequence without intersecting the above-mentioned broken line to obtain a connected closed contour.

[0055] A sixth obtaining unit, configured to smooth the closed contour to obtain a tool path trajectory.

[0056] The beneficial effects of the present invention are as follows: The Panax notoginseng trajectory of the present invention is labeled with a series of dense annotation boxes. A single detection box can frame a local area of the main root of Panax notoginseng, while the dense detection boxes can fit the shape of the main root of Panax notoginseng, making the features learned by the deep learning network model in image-level processing more concentrated and enabling more targeted learning of the features of the main root of Panax notoginseng. A feature extractor is constructed through multi-scale residual units to achieve the consideration of the morphological features of different main roots of Panax notoginseng at different scales, which helps to expand the receptive field for main roots with various morphologies. Then, multiple anchor boxes with different aspect ratios are preset for each unit in different-sized receptive fields to adaptively fit the morphological differences of the main roots, improving the detection accuracy without reducing the detection speed.

[0057] The dense detection bounding boxes generated by the deep learning model provide scatter coordinates for the tool path trajectory planning of removing the non-main root part of Panax notoginseng. The coordinate screening algorithm combining conditional operations and logical judgments eliminates the unnecessary coordinates among them, extracts the scatter coordinates fitting the contour of the main root of Panax notoginseng at a high operation speed, and sorts them. Finally, the remaining coordinates are connected for contour fitting and second-order interpolation operations to obtain a smooth tool path trajectory, making it not only more fitting to the shape of the main root but also more in line with the kinematics of the cutting device, reducing the vibration caused by speed step during the operation of the cutting device and improving the processing accuracy and stability. Brief Description of the Drawings

[0058] Figure 1 is the overall flow chart;

[0059] Figure 2 is the classification diagram of different forms of Panax notoginseng;

[0060] Figure 3 is the classification diagram of Panax notoginseng under different backgrounds;

[0061] Figure 4 is the structural diagram of the deep learning network model;

[0062] Figure 5 is the schematic diagram of the residual module;

[0063] Figure 6 is the schematic diagram of the multi-scale feature fusion module;

[0064] Figure 7 is the diagram of the annotation method of Panax notoginseng by the labelImg tool;

[0065] Figure 8 is the flow chart of the deep learning model training;

[0066] Figure 9 is the schematic diagram of the anchor box decoding;

[0067] Figure 10 is the detection effect diagram of the deep learning model;

[0068] Figure 11 is the flow chart for generating the cutting tool path of the main root of Panax notoginseng;

[0069] Figure 12 is the schematic diagram of the dense detection box coordinate screening and sorting algorithm;

[0070] Figure 13 is the effect diagram of the contour scatter point coordinate screening and sorting;

[0071] Figure 14 is the schematic diagram of the contour scatter point coordinate connection algorithm;

[0072] Figure 15 is the effect diagram of the contour scatter point coordinate connection;

[0073] Figure 16 is the schematic diagram of the second-order interpolation;

[0074] Figure 17 is the cutting tool path trajectory diagram of the main root of Panax notoginseng. Detailed Implementation Manner

[0075] The present invention will be further described below in conjunction with the drawings and embodiments, but the content of the present invention is not limited to the described scope.

[0076] Example 1: As Figure 1-17 shown, a method for generating the cutting trajectory of the main root of Panax notoginseng includes: constructing a Panax notoginseng image data set; adjusting the prototype of the constructed deep learning network model to obtain a deep learning network model; making the collected Panax notoginseng image data set into a training data set and a validation data set; using the training data set to train the deep learning network model, screening out multiple candidate weights; using the validation data set to evaluate the performance of the candidate weights respectively, and selecting an optimal weight; loading the optimal weight into the deep learning network model, and using this model to detect the Panax notoginseng image to be detected to adjust the detection hyperparameters of the deep learning network model. After determining the optimal detection hyperparameters, load them into the deep learning network model to obtain a frozen model; input the newly obtained Panax notoginseng image to be detected into the frozen model for detection to obtain dense detection bounding boxes; extract the four corner coordinates and the center point coordinates of the detection bounding boxes, screen and sort all the corner coordinates of the detection bounding boxes, and sort the center coordinates and connect them in sequence; obtain scatter coordinates and a broken line formed by connecting the center points; enumerate the scatter coordinates in sequence and connect them in sequence without intersecting the above-mentioned broken line to obtain a connected closed contour; smooth the closed contour to obtain a tool path trajectory.

[0077] Further, it can be set that adjusting the prototype of the constructed deep learning network model to obtain a deep learning network model includes: using a shallow network, a multi-scale residual unit, a multi-scale feature fusion module, and a prediction head module to construct the prototype of the deep learning network model; adjusting the model through ablation experiments and size data in the Panax notoginseng data set to obtain a deep learning network model.

[0078] Further, it can be set that adjusting the model through ablation experiments and size data in the Panax notoginseng data set to obtain a deep learning network model includes:

[0079] Step 2.1: Under the condition that other conditions are the same, obtain multiple different prototypes of the deep learning network model by changing the number of residual modules in the multi-scale residual unit;

[0080] Step 2.2: Evaluate the performance of multiple different prototypes of the deep learning network model, and then screen out the model with the best performance from them to determine the optimal number of residual modules;

[0081] Step 2.3: Redesign the size of the preset anchor boxes contained in the multi-scale feature maps in the multi-scale feature fusion module: apply n different aspect ratios to the preset anchor boxes, and calculate the width and height of the preset anchor boxes in combination with the data obtained in Step 1 to obtain n + 1 different sizes of preset anchor boxes.

[0082] Further, the specific calculation of the preset anchor box can be set as follows: n takes the value of 5, and five different aspect ratios are applied to the preset anchor box Each aspect ratio corresponds to an anchor box type, that is, the anchor box types a = 1, 2, 3, 4, 5. Thus, the width of each preset anchor box is calculated and height For the aspect ratio a r When it is 1, a preset anchor box is added, corresponding to the anchor box type a = 6. The width and height of the preset anchor box corresponding to the anchor box type 6 are Each anchor box is represented by the center coordinates plus the width and height information where, S min is the minimum diameter of the main root of Panax notoginseng in the statistically measured size data, and S max is the maximum diameter of the main root of Panax notoginseng in the statistically measured size data. k represents the sorting of the m multi-scale feature maps in the multi-scale feature fusion module from large to small, and m represents the number of multi-scale feature maps.

[0083] Further, it can be set that the collected Panax notoginseng image dataset is made into a training dataset and a validation dataset, including:

[0084] Step 3.1: Densely and continuously annotate the Panax notoginseng image dataset through the labelImg toolkit. The dense annotation is specifically as follows: According to the shape of the main root of Panax notoginseng, multiple annotation boxes of different sizes are used for annotation, and it is necessary to ensure that the annotation boxes are continuous. The continuity of the annotation boxes means that there is an area overlap between the annotation boxes; the center point distance between adjacent annotation boxes should be greater than the distance S:

[0085]

[0086] where S is the distance when a single unit of the feature map with the smallest output size is mapped back to the original image; W f and H f respectively represent the width and height of the feature map with the smallest size; W and H respectively represent the width and height of the images in the input Panax notoginseng image dataset;

[0087] Step 3.2: Divide the annotated dataset into a training dataset and a validation dataset according to 80% and 20% of its quantity.

[0088] Further, it can be set that the training dataset is used to train the deep learning network model, and multiple candidate weights are selected, including:

[0089] Step 4.1, configure the training hyperparameters in the train.py file of the deep learning network model yolo3-master. The hyperparameter adjustment includes at least one of the following: number of extracted pictures, learning rate, momentum, number of iterations, number of unlocking iterations and weight decay coefficient; the rest of the parameters are the default values;

[0090] Step 4.2: Train the deep learning network model; the training objects include: the coordinates of the upper left corner of each annotation box (x min ,y min ) and the lower right corner coordinate (x max ,y max ), category class; the training result is expressed in the form of a weight file obtained after each training iteration;

[0091] Step 4.3, call the train.py file in the deep learning network model yolo3-master to start training. The specific process of training is as follows:

[0092] Step 4.3.1, call the train.py file to train the deep learning network model;

[0093] Step 4.3.2: Randomly extract a batch_size of images from the training set as the current training sample; batch_size represents the number of images extracted from the training set at a time;

[0094] Step 4.3.3, placing each image in the training sample described in step 4.3.2 into the deep learning network model in turn to update the weight parameters; the weight parameter update is specifically: randomly initializing the weight parameters or loading the pre-trained weight parameters, performing forward propagation calculation of the convolutional neural network and obtaining a set of intermediate parameters, and then using the intermediate parameters to perform back propagation to update the weight parameters; the new weight parameters will replace the old weight parameters previously used to calculate the forward propagation;

[0095] Step 4.3.4: Perform a forward and backward propagation process on all images of the training data set described in step 4.3.2 as a training of the deep learning network model, and save a weight file for each training; repeat steps 4.3.2 to 4.3.3 until the number of network model training times reaches the set number of iterations;

[0096] Step 4.3.5: After reaching the set number of training times, all the obtained weight files are screened through the performance evaluation indicators of the deep learning network model to obtain multiple candidate weight files.

[0097] Further, the step of obtaining a dense detection bounding box may include:

[0098] Input the Panax notoginseng image to be detected into the frozen model, and the frozen model outputs a series of offset information of the center points of the anchor boxes and the scaling information of the width and height of the anchor boxes The output information and the corresponding preset anchor box information are decoded to obtain dense detection bounding box information (x c , y c , w, h), and the decoding formula is:

[0099]

[0100] Convert the information of each detection bounding box from the representation form of (x c , y c , w, h) to the form represented by its upper left corner coordinates (x min , y min ) and the lower right corner coordinates (x max , y max ), and the conversion formula is:

[0101]

[0102] Among them, x c , y c represent the center point coordinate information of the dense detection bounding box; w, h represent the width and height information of the dense detection bounding box.

[0103] Furthermore, it is possible to set the obtaining of the scatter coordinates and a broken line formed by connecting the center points, including: extracting the four corner coordinate information of all dense detection boxes in the Panax notoginseng image to be detected, and respectively judging whether the four corner coordinates of each detection box are located inside other detection boxes, suppressing the corner coordinates that are enclosed, and finally regarding the un-suppressed corner coordinates as scatter points, and calculating the variances respectively according to the distributions of the scatter points on the X-axis and Y-axis for sorting; at the same time, calculating the center point coordinates of the dense detection boxes, sorting the center point coordinates in the same way, and connecting them in order to form a broken line.

[0104] Furthermore, it is possible to set the obtaining of the connected closed contour, including: enumerating each obtained scatter point in order, directly adding the first and second coordinates to the coordinate connection list as the initial upper and lower ends, and then for each enumerated scatter point, respectively judging whether the line segments connecting it to the upper and lower ends intersect with the obtained broken line: if one intersects and one does not intersect, connect the non-intersecting end, if both connecting lines intersect, ignore this scatter point, if both connecting lines do not intersect, connect to the nearer end; after connecting each scatter point to the coordinate connection list, use the head and tail ends of this coordinate connection list as the upper and lower ends of the current list; after enumerating all coordinates to obtain a complete coordinate connection list, and making its head and tail connected, obtain a closed contour that approximately fits the main root of Panax notoginseng.

[0105] Furthermore, the present invention provides a Panax notoginseng main root cutting trajectory generation system, comprising: a construction unit, used to construct a Panax notoginseng image data set; a first acquisition unit, used to adjust the prototype of the constructed deep learning network model to obtain the deep learning network model; an execution unit, used to make the collected Panax notoginseng image data set into a training data set and a verification data set; a first screening unit, used to train the deep learning network model using the training data set, and screen out multiple candidate weights; a second screening unit, used to use the verification data set to evaluate the performance of the candidate weights respectively, and select an optimal weight; a second acquisition unit, used to load the optimal weight into the deep learning network model, and use this model to detect the Panax notoginseng image to be detected to adjust the deep learning network The detection hyperparameters of the model are determined, and after the optimal detection hyperparameters are determined, they are also loaded into the deep learning network model to obtain a frozen model; the third acquisition unit is used to input the newly acquired Panax notoginseng image to be detected into the frozen model for detection, and obtain a dense detection bounding box; the fourth acquisition unit is used to extract the four corner coordinates and the center point coordinates of the detection bounding box, and all the corner coordinates of the detection bounding box are screened and sorted, and the center coordinates are sorted and connected in sequence; scattered point coordinates and a broken line connected by the center points are obtained; the fifth acquisition unit is used to enumerate the scattered point coordinates in sequence, and connect them in sequence, without intersecting with the above-mentioned broken line during connection, to obtain a connected closed contour; the sixth acquisition unit is used to smooth the closed contour to obtain a tool path trajectory.

[0106] Example 2: Figure 1-17 As shown, a method for generating a cutting trajectory of a main root of Panax notoginseng is provided, and the specific steps are as follows:

[0107] Step 1, collect a Panax notoginseng image dataset, and count the size data of the main root of Panax notoginseng in the dataset;

[0108] Step 2: Use the shallow network, multi-scale residual unit, multi-scale feature fusion module and prediction head module to build a prototype of the deep learning network model, and adjust the model through ablation experiments and the size data obtained in step 1 to obtain the deep learning network model;

[0109] Step 3, making the collected Panax notoginseng image dataset into a training dataset and a verification dataset;

[0110] Step 4: Use the training data set to train the deep learning network model. After the training, select multiple candidate weights based on the performance evaluation indicators of the deep learning network model.

[0111] Step 5: Use the validation data set to evaluate the performance of the candidate weights respectively to quantify the performance of the candidate weights and select an optimal weight from multiple candidate weights;

[0112] Step 6: Load the optimal weight into the deep learning network model, and use this model to detect the Panax notoginseng image to be detected. Adjust the detection hyperparameters of the deep learning network model according to the detection effect. After determining the optimal detection hyperparameters, load them into the deep learning network model, and finally generate a frozen deep learning network model as a frozen model.

[0113] At this point, the deep learning network model has been adjusted. The deep learning network models used in the following steps are all frozen deep learning network models.

[0114] Step 7: Start shooting the Panax notoginseng image to be detected and input it into the frozen model for detection. The frozen model outputs a series of anchor frame offset information and anchor frame scaling information. The output information is decoded with the corresponding preset anchor frame information to generate a series of dense detection bounding boxes.

[0115] Step 8: Extract the four corner coordinates and center point coordinates of all detection bounding boxes, filter and sort all corner coordinates of the detection bounding boxes, and sort the center coordinates and connect them in sequence; obtain the corner coordinates that meet the conditions and a polyline connected by the center points.

[0116] Step 9, enumerate the angular coordinates that meet the conditions in sequence, and connect them in sequence. When connecting, they must not intersect with the broken line obtained in step 8. Finally, they are connected into a closed contour that approximately fits the main root of Panax notoginseng;

[0117] Step 10: Perform a second-order interpolation operation on the closed contour of the main root of Panax notoginseng to generate a smooth tool path trajectory.

[0118] Furthermore, this application provides the following specific implementation steps:

[0119] The Panax notoginseng image dataset is captured by a camera with a fixed object distance and magnification on a working platform, so as to obtain Panax notoginseng images of various shapes under different backgrounds, that is, to collect various Panax notoginseng images according to actual processing scenarios. For example, the Panax notoginseng images collected in this embodiment can be divided into contrasting color background, similar color background, and other backgrounds according to different backgrounds; the shapes of the main roots of Panax notoginseng mainly include clusters, blocks, strips, and other complex shapes. Classification by the main root shape of Panax notoginseng Figure 2 As shown in the figure, the diversity and complexity of the background and the different forms of Panax notoginseng help improve the generalization ability of the deep learning network model. The collected Panax notoginseng images are classified according to the background. Figure 3 .

[0120] The data statistics in step 1 are as follows: the diameters of the main roots of Panax notoginseng on the Panax notoginseng images in the Panax notoginseng image data set are counted, and the minimum diameter is recorded as S min , the maximum diameter is denoted as S max In this embodiment, the minimum diameter S min= 1 cm, the maximum diameter is S max = 6 cm.

[0121] In step 2, the shallow network contains three layer units, and each layer unit consists of three convolutional layers plus one max pooling layer.

[0122] The residual module principle of the multi-scale residual unit in step 2 is as Figure 5 shown. The input extracts features through a 1×1 convolutional kernel (Conv1×1), and then performs identity equal division along the channel direction to obtain multiple feature sub-blocks X of different channel scales i . Secondly, multiple 3×3 convolutional kernels (Conv3×3) with the same convolutional width are used to extract the feature sub-blocks X i respectively and obtain multiple different output features. Then, all the output features are stacked in the channel direction to obtain the recombined feature Y i . Finally, the channel information is compressed by a 1×1 convolutional kernel and then output. The multi-scale residual unit can obtain more channel information from the input features and also helps to expand the receptive field of the deep learning network.

[0123] The principle of the upsampling feature fusion module in step 2 is as Figure 6 shown. The 52×52 feature map output by the multi-scale residual unit is used as the input, and is downsampled through two convolutions with 3×3 convolutional kernels to obtain feature maps of sizes 26×26 and 13×13. Then, the two feature maps are subjected to convolution with the number of channels C unchanged and deconvolution upsampling to obtain additional 52×52 and 26×26 feature maps. Then, the feature maps with the same size are concatenated in terms of the number of channels C, and finally, variable-channel convolution with a 1×1 convolutional kernel is performed to output three feature maps of different sizes as the input of the detection head.

[0124] The prediction head module consists of three independent prediction heads, and each prediction head is composed of a variable-channel convolutional layer; the detection head in step 2 is as Figure 6 , which is actually a multi-layer 3×3 convolution. Its function is to change the channels of the multi-scale feature map output by the multi-scale feature fusion module according to the number of channels C of the required detection information, and output the multi-scale feature map with the number of channels C as the final detection information. The calculation formula for its number of channels C is as follows:

[0125] C = 1 + num_class + (6×4)

[0126] where channel 1 is the probability that a single unit of the detection feature map contains a target; channel num_class is the number of types of detectable target classes, and in this example, num_class = 1; channel 6 corresponds to 6 different sizes of anchor boxes respectively; channel 4 represents the offset information of the anchor box center point and the scaling information of the anchor box width and height

[0127] The specific steps of Step 2 for adjusting the prototype of the deep learning network model are as follows:

[0128] Step 2.1: Under the same other conditions, obtain multiple different prototypes of the deep learning network model by changing the number of residual modules in the multi-scale residual unit;

[0129] Step 2.2: Perform performance evaluation on multiple different prototypes of the deep learning network model, and then select the model with the best performance from them to determine the optimal number of residual modules;

[0130] For Steps 2.1 and 2.2, ablation experiments are used to select the number of residual units and evaluate the performance. The results of the ablation experiments are shown in Table 1. In the table, RH-Res_26 represents a prototype of the deep learning network model, 26 represents the number of network layers, and the same applies to others; as shown in Table 1, the optimal number of residual modules determined by the RH-Res_53 model is 53.

[0131] Table 1 Results of ablation experiments

[0132]

[0133] Step 2.3: Redesign the sizes of the preset anchor boxes contained in the multi-scale feature maps in the multi-scale feature fusion module: Apply n different aspect ratios to the preset anchor boxes, and calculate the width and height of the preset anchor boxes in combination with the data obtained in Step 1 to obtain n + 1 different sizes of preset anchor boxes; thus, a total of n + 1 preset anchor boxes are generated on each unit of each feature map;

[0134] The specific calculation of the preset anchor box is as follows: n is taken as 5, and 5 different aspect ratios are applied to the preset anchor box Each aspect ratio corresponds to one type of anchor box, that is, the types of anchor boxes a = 1, 2, 3, 4, 5. Thus, the width of each preset anchor box is calculated and the height For the aspect ratio a r When it is 1, add a preset anchor box, corresponding to the type of anchor box a = 6, and the width and height of the preset anchor box corresponding to the type of anchor box 6 are Each anchor box takes the center coordinates plus the width and height information to represent; among them, the center coordinates are the upper left coordinates of the unit of the feature map where the current anchor box is located; S min is the minimum diameter of the main root of notoginseng in the size data statistically obtained in Step 1, S maxThe maximum diameter of the main root of Panax notoginseng in the dimensional data counted in Step 1, k represents the sorting of m multi-scale feature maps in the multi-scale feature fusion module from large to small, m represents the number of multi-scale feature maps, and here m is taken as 3. Thus, n+1 preset anchor boxes of different sizes are generated for each feature map, and then these anchor boxes are copied to each cell of their respective feature maps; when designing various anchor boxes of different shapes, the dimensional data in the dataset is considered, which can make the established model more adaptable to the target and enhance the adaptability to different sizes of the main roots of Panax notoginseng.

[0135] In Step 3, the specific production methods of the training dataset and the validation dataset are as follows:

[0136] Step 3.1: Use the labelImg toolkit to perform dense and continuous annotation on the Panax notoginseng image dataset. The dense annotation is specifically as follows: According to the shape of the main root of Panax notoginseng, use multiple annotation boxes of different sizes for annotation, and it is necessary to ensure that the annotation boxes are continuous. The continuity of the annotation boxes means that there is an area overlap between the annotation boxes; the center point distance between adjacent annotation boxes should be greater than the distance S:

[0137]

[0138] where S is the distance when a single cell of the feature map with the smallest output size (13×13 feature map) is mapped back to the original image; W f and H f respectively represent the width and height of the feature map with the smallest size; W and H respectively represent the width and height of the images in the input Panax notoginseng image dataset. By setting the distance constraint, it can prevent ambiguity caused by multiple annotation boxes being trained for regression by the same preset anchor box during the training of the deep learning model; the annotation effect using the labelImg toolkit is as Figure 7 shown. In this embodiment, there are 200 images in the Panax notoginseng image dataset; among them, 160 are in the training dataset and 40 are in the validation dataset; the minimum center point distance: S = 40 pixel distances.

[0139] Step 3.2: Divide the annotated dataset into a training dataset and a validation dataset according to 80% and 20% of its quantity.

[0140] The specific implementation method of the process of adjusting the training hyperparameters and training the model in Step 4 is as Figure 8As shown in the figure, first set the hyperparameters in the configuration file train.py of the deep learning network model yolo3-master: the number of images extracted at one time batch_size = 8, the learning rate = 0.001, the momentum = 0.9, the weight decay coefficient = 0.0005, the learning rate decays to 90% every 50 times, the unlocking iteration number = 300, the iteration number = 500; lock the weights of the shallow network and the multi-scale residual unit in the first 300 iterations, and unlock all of them after reaching the 300 unlocking iteration number, and the rest of the parameters are default. Start training, load the network model of deep learning, load the random weight parameters or pre-trained weight parameters, lock the weights of the shallow network and the multi-scale residual unit, load the images in batches according to the size of batch_size for training, and according to the set parameters, when the iteration number reaches the 300 unlocking iteration number, unlock the overall network weights and continue to optimize the iteration until reaching the set 500th iteration. Finally, screen all the obtained weight files through the performance evaluation index provided by the deep learning network model to obtain multiple candidate weight files.

[0141] Then, as described in step 5, load the candidate weight files into the deep learning network model respectively, and then use the validation data set to screen out the deep learning network model with the best detection effect, and set its weight file as the optimal weight file.

[0142] In step 6, after loading the optimal weight file obtained in step 5 into the deep learning network model, run the detection file predict.py in the deep learning network model to detect the image to be detected, and manually adjust the detection hyperparameters in the detection file predict.py through the intuitive detection effect, and select a set of detection hyperparameters with the best effect as the optimal detection hyperparameters; among them, the adjustment of the detection hyperparameters includes at least one of the following: the confidence screening threshold, the non-maximum suppression threshold, and the edge fitting dilation coefficient, and the rest of the parameters are default values. Determine the confidence screening threshold = 0.6, the non-maximum suppression threshold = 0.35, and the edge fitting dilation coefficient = 0.9 according to the detection effect, and determine this set of parameters as the optimal detection hyperparameters.

[0143] Steps 1 to 6 determine the optimal deep learning network model as the frozen model: load the optimal weight file obtained in step 5 and the optimal detection hyperparameters obtained in step 6 into the deep learning network model, and then freeze and lock all network parameters to obtain the frozen model, which is also the model used for detection in the following steps.

[0144] In step 7, input the newly captured Panax notoginseng image to be detected into the frozen model, and the frozen model outputs a series of offset information of the center points of the anchor boxes and the scaling information of the width and height of the anchor boxes The output information and the corresponding preset anchor box information are decoded to obtain dense detection bounding box information (xc , y c , w, h), and the decoding process is as Figure 9 shown. The decoding formula is:

[0145]

[0146] Among them, x c , y c represents the central point coordinate information of the dense detection bounding box; w, h represent the width and height information of the dense detection bounding box; if there is no corresponding output anchor box in the frozen model, it is ignored;

[0147] Then, the information of each detection bounding box is converted from the representation form of (x c , y c , w, h) to the form represented by its upper left corner coordinates (x min , y min ) and lower right corner coordinates (x max , y max ). The detection effect is as Figure 10 shown. The conversion formula is:

[0148]

[0149] Steps 8 to 10 described above are the part of generating the cutting tool path of the main root of Panax notoginseng using the dense detection box information output by the detection algorithm. The process is as Figure 11 shown. The specific steps are as follows:

[0150] In step 8 described above, the four corner coordinate information of all dense detection boxes in the image is extracted. It is respectively judged whether the four corner coordinates of each detection box are located inside other detection boxes. The corner coordinates that are enclosed are suppressed. Finally, the un-suppressed corner coordinates are regarded as scattered points, and the variances are calculated and sorted respectively according to the distributions of the scattered points on the X-axis and Y-axis; at the same time, the central point coordinates of the dense detection boxes are calculated, and the central point coordinates are also sorted in the same way and connected into a broken line in sequence. The specific operations are as follows:

[0151] Step 8.1: First, extract the four corner coordinate information of each detection box: upper left corner (x min , y min ), lower left corner (x min , y max ), upper right corner (x max , y min ), lower right corner (x max , y max ). It is successively judged whether each corner coordinate is located inside other detection boxes. The conditional formula is:

[0152]

[0153] Among them, x and y represent the angular coordinate values to be judged currently; X min represents the set of x values of all other boxes except the box where the current x and y are located; X min value set; X max represents the set of x values of all other boxes except the box where the current x and y are located; X max value set; and represents "AND operation", if cond is True, it means the current angular coordinate is suppressed, and if False, it means the current angular coordinate is retained;

[0154] Step 8.2: Regarding the unsuppressed angular coordinates screened out in Step 8.1 as scatter point coordinates, calculate the variances of the scatter point coordinates on the X-axis and Y-axis respectively, and select the axis with the larger variance as the first priority and sort the coordinates on this axis; as Figure 12 shown in the last figure, the scatter point coordinates numbered 1-8 sorted according to the X-axis as the first priority;

[0155] Step 8.3: Generate a polyline from the center point of the detection box, and the specific steps are as follows:

[0156] Calculate the variances of the center point coordinates (x c , y c ) of the detection bounding box on the X-axis and Y-axis respectively, select the axis with the larger variance as the first priority and sort the coordinates on this axis, and then connect the sorted center point coordinates in sequence to form a polyline, and the effect is as Figure 13 .

[0157] Step 9 in the above-mentioned will connect the scatter point coordinates in Step 8, and the process is as Figure 14 : Enumerate each coordinate point in order. The first and second coordinates are directly added to the coordinate connection list as the initial upper and lower ends. Then, each time a coordinate is enumerated, a process judgment is made, and the specific steps are as follows:

[0158] Step 9.1: Take the first coordinate and the last coordinate from the coordinate connection list as the upper end and the lower end, and connect the enumerated coordinate with the upper end coordinate and the lower end coordinate respectively to form two line segments.

[0159] Step 9.2: Judge whether the line segment formed by connecting the enumerated coordinate and the upper end coordinate in Step 9.1 intersects with the polyline obtained in Step 8. If they intersect, output False, otherwise output True; the line segment formed by connecting the enumerated coordinate and the lower end coordinate is also judged in the same way, and finally two bool values are output.

[0160] Step 9.3: Judge the two bool values output in Step 9.2. If one of the bool values is False and the other is True, add the enumerated coordinate to the end with the value of True. If both are False, skip this point; if both bool values are True, calculate the distances between the enumerated coordinate and the upper and lower end coordinates respectively, and add the enumerated coordinate to the end with the shorter distance.

[0161] Step 9.4: After connecting the enumerated coordinate to the coordinate connection list, use the new head and tail coordinates of this coordinate connection list as the upper and lower ends of the current list; the connection effect of Step 9 is as Figure 15 shown.

[0162] Step 10 inputs the coordinates obtained in Step 9 into a second-order interpolation function to generate a list of smooth tool path coordinates, and the effect is as Figure 17 shown; the principle of second-order interpolation is as Figure 16 shown, and the second-order interpolation formula is:

[0163]

[0164] where, q a (t) represents the coordinate value of the interpolation point at time t, t represents the time axis value of the current interpolation point, t0 represents the time when the previous known point is located, t1 represents the time when the next known point is located, and t f represents the time axis value corresponding to the point with zero acceleration between t0 and t1. And a0, a1, a2, a3, a4, a5 are all constant parameters. a0, a1, a2 are the position, velocity and acceleration at time t0; a3, a4, a5 are the position, velocity and acceleration at f time t.

[0165] The specific embodiments of the present invention have been described in detail above with reference to the accompanying drawings. However, the present invention is not limited to the above embodiments. Without departing from the spirit of the present invention, various changes can be made within the knowledge scope of those of ordinary skill in the art.

Claims

1. A method for generating the cutting trajectory of the main root of Panax notoginseng, characterized in that: Including: Construct a Panax notoginseng image dataset; Adjust the prototype of the constructed deep learning network model to obtain the deep learning network model; Make the collected Panax notoginseng image dataset into a training dataset and a validation dataset; Use the training dataset to train the deep learning network model and screen out multiple candidate weights; Use the validation dataset to evaluate the performance of the candidate weights respectively and select an optimal weight; Load the optimal weight into the deep learning network model, and use this model to detect the Panax notoginseng image to be detected to adjust the detection hyperparameters of the deep learning network model. After determining the optimal detection hyperparameters, also load them into the deep learning network model to obtain a frozen model; Input the newly obtained Panax notoginseng image to be detected into the frozen model for detection to obtain dense detection bounding boxes; Extract the four corner coordinates and the center point coordinates of the detection bounding box, screen and sort all the corner coordinates of the detection bounding box, and sort the center coordinates and connect them in sequence; obtain scatter coordinates and a broken line formed by connecting the center points; Enumerate the scatter coordinates in sequence and connect them in sequence without intersecting the above-mentioned broken line to obtain a connected closed contour; Smooth the closed contour to obtain a tool path; The adjustment of the prototype of the constructed deep learning network model to obtain the deep learning network model includes: using a prototype of the deep learning network model constructed by a shallow network, a multi-scale residual unit, a multi-scale feature fusion module, and a prediction head module; adjusting the model through ablation experiments and size data in the Panax notoginseng dataset to obtain the deep learning network model; The use of the training dataset to train the deep learning network model and screen out multiple candidate weights includes: Step 4.1: Configure the training hyperparameters in the train.py file of the deep learning network model yolo3-master. The hyperparameter adjustment includes at least one of the following: the number of extracted pictures, the learning rate, the momentum, the number of iterations, the unlocked number of iterations, and the weight decay coefficient; the rest of the parameters are default values; Step 4.2: Train the deep learning network model; the objects to be trained include: the upper left coordinates (x min , y min ) and the lower right coordinates (x max , y max ) of each annotation box, and the category class; the manifestation of the training result is the weight file obtained after each training iteration; Step 4.3: Call the start training of the train.py file in the deep learning network model yolo3-master. The specific process of training is as follows: Step 4.3.1: Call the train.py file to train the deep learning network model; Step 4.3.2: Randomly extract an image with a batch_size from the training set as the current training sample; where batch_size represents the number of pictures extracted from the training set at one time; Step 4.3.3: Put each image in the training sample in step 4.3.2 into the deep learning network model in sequence to update the weight parameters; the update of the weight parameters is specifically: randomly initialize the weight parameters or load the pre-trained weight parameters, perform forward propagation calculation of the convolutional neural network to obtain a set of intermediate parameters, and then use the intermediate parameters to perform backpropagation to update the weight parameters; the new weight parameters will replace the old weight parameters used for forward propagation calculation before; Step 4.3.4: Denote the process of performing one forward and backward propagation on all the images in the training dataset described in Step 4.3.2 as one training of the deep learning network model, and save a weight file for each training; repeat Step 4.3.2 to Step 4.3.3 until the number of training times for the network model reaches the set number of iterations; Step 4.3.5: After reaching the set number of training times, screen the obtained weight files through the performance evaluation metrics provided by the deep learning network model to obtain multiple candidate weight files; The obtaining of the dense detection bounding boxes includes: Input the Panax notoginseng image to be detected into the frozen model, and the frozen model outputs a series of offset information of the center points of the anchor boxes and the scaling information of the width and height of the anchor boxes The output information and the corresponding preset anchor box information are decoded to obtain dense detection bounding box information (x c , y c , w, h), and the decoding formula is: Convert the information of each detected bounding box from the representation of (x c , y c , w, h) to the form represented by its upper-left corner coordinates (x min , y min ) and lower-right corner coordinates (x max , y max ). The conversion formula is: Among them, x c , y c represent the coordinate information of the center points of the dense detection bounding boxes; w and h represent the width and height information of the dense detection bounding boxes.

2. The method for generating the cutting trajectory of the main root of Panax notoginseng according to claim 1, wherein: The adjustment of the model through ablation experiments and the size data in the Sanqi dataset to obtain the deep learning network model includes: Step 2.1: Under the condition that other conditions are the same, obtain multiple different prototypes of the deep learning network model by changing the number of residual modules in the multi-scale residual unit; Step 2.2: Perform performance evaluation on multiple different prototypes of the deep learning network model, and then screen the model with the best performance from them to determine the optimal number of residual modules; Step 2.3: Redesign the sizes of the preset anchor boxes contained in the multi-scale feature maps in the multi-scale feature fusion module: apply n different aspect ratios to the preset anchor boxes, and calculate the width and height of the preset anchor boxes in combination with the data obtained in Step 1 to obtain n + 1 different sizes of preset anchor boxes.

3. The method for generating the cutting trajectory of the main root of Panax notoginseng according to claim 2, wherein: The specific calculation of the preset anchor box is as follows: n takes the value of 5, and 5 different aspect ratios are applied to the preset anchor box Each aspect ratio corresponds to an anchor box type, that is, the anchor box types a = 1, 2, 3, 4, 5. Thus, the width of each preset anchor box is calculated and height For the aspect ratio a r When it is 1, an additional preset anchor box is added, corresponding to the anchor box type a = 6. The width and height of the preset anchor box corresponding to the anchor box type 6 are Each anchor box is represented by the center coordinates plus the width and height information wherein S min is the minimum diameter of the main root of Panax notoginseng in the statistical size data, and S max is the maximum diameter of the main root of Panax notoginseng in the statistical size data. k represents the sorting of the m multi-scale feature maps in the multi-scale feature fusion module from large to small, and m represents the number of multi-scale feature maps 4. The method for generating the cutting trajectory of the main root of Panax notoginseng according to claim 1, wherein: The making of the collected Sanqi image dataset into a training dataset and a validation dataset includes: Step 3.1: Perform dense continuous annotation on the Sanqi image dataset through the labelImg toolkit, where the dense annotation is specifically: use multiple annotation boxes of different sizes for annotation according to the shape of the main root of Sanqi, and it is necessary to ensure that the annotation boxes are continuous, that is, there is an area overlap between the annotation boxes; the center point distance between adjacent annotation boxes should be greater than the distance S; Among them, S is the distance from a single unit of the feature map with the smallest output size mapped back to the original image; W f and H f represent the width and height of the feature map with the smallest size respectively; W and H represent the width and height of the images in the input 3×7 image dataset respectively; Step 3.2: Divide the annotated dataset into a training dataset and a validation dataset according to 80% and 20% of its quantity.

5. The method for generating the cutting trajectory of the main root of Panax notoginseng according to claim 1, wherein: The obtaining of the scatter coordinates and a broken line connected by the center points includes: extract the four corner coordinate information of all the dense detection boxes in the Sanqi image to be detected, and respectively judge whether the four corner coordinates of each detection box are located inside other detection boxes, suppress the corner coordinates that are framed, and finally regard the unsuppressed corner coordinates as scatter points, and calculate the variances for sorting according to the distributions of the scatter points on the X-axis and Y-axis; at the same time, calculate the center point coordinates of the dense detection boxes, sort the center point coordinates in the same way, and connect them in sequence to form a broken line.

6. The method for generating the cutting trajectory of the main root of Panax notoginseng according to claim 1, characterized in that: The obtaining of the connected closed contour includes: enumerating each scattered point obtained in sequence. The first and second coordinates are directly added to the coordinate connection list as the initial upper and lower ends. After each scattered point is enumerated, it is respectively judged whether the line segments connecting it to the upper and lower ends intersect the obtained broken line: if one intersects and the other does not, connect the end that does not intersect; if both connecting lines intersect, ignore this scattered point; if both connecting lines do not intersect, connect to one of the ends nearby. After each scattered point is connected to the coordinate connection list, the head and tail ends of this coordinate connection list are used as the upper and lower ends of the current list. After all coordinates are enumerated to obtain a complete coordinate connection list, and making its head and tail connected, a closed contour approximately fitting the main root of pseudo-ginseng is obtained.

7. A pseudo-ginseng main root cutting trajectory generation system for implementing the pseudo-ginseng main root cutting trajectory generation method according to claim 1, characterized in that: Including: A construction unit for constructing a pseudo-ginseng image data set; A first obtaining unit for adjusting the prototype of the constructed deep learning network model to obtain a deep learning network model; An execution unit for making the collected pseudo-ginseng image data set into a training data set and a validation data set; A first screening unit for training the deep learning network model using the training data set to screen out multiple candidate weights; A second screening unit for evaluating the performance of the candidate weights respectively using the validation data set to select an optimal weight; A second obtaining unit for loading the optimal weight into the deep learning network model, and using this model to detect the to-be-detected pseudo-ginseng image to adjust the detection hyperparameters of the deep learning network model. After determining the optimal detection hyperparameters, also load them into the deep learning network model to obtain a frozen model; A third obtaining unit for inputting the newly obtained to-be-detected pseudo-ginseng image into the frozen model for detection to obtain dense detection bounding boxes; A fourth obtaining unit for extracting the four corner coordinates and the center point coordinate of the detection bounding box, screening and sorting all the corner coordinates of the detection bounding box, and sorting and connecting the center coordinates in sequence; obtaining scattered point coordinates and a broken line formed by connecting the center points; A fifth obtaining unit for enumerating the scattered point coordinates in sequence and connecting them in sequence without intersecting the above-mentioned broken line to obtain a connected closed contour; A sixth obtaining unit for smoothing the closed contour to obtain a tool path trajectory.

Citation Information

Patent Citations

  • Dam crack detection method based on multi-migration learning model fusion

    CN110544251A

  • Intersection signboard extraction and association method and device

    CN112507887A