Chinese chestnut cutting position determination method and system

The chestnut position detection model optimized by the YOLOv5 algorithm solves the problems of inconsistent chestnut cuts and inaccurate cutting, achieving efficient and safe chestnut cutting, and improving production efficiency and intelligence level.

CN121437618APending Publication Date: 2026-01-303D ARTISAN BEIJING TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310833698.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-07-07
Publication Date
2026-01-30

AI Technical Summary

Technical Problem

Existing technology cannot guarantee the consistency of chestnut cuts, the cutting position is not precise, and the cutting equipment has a low level of intelligence, posing safety hazards.

Method used

A chestnut location detection model was established using the YOLOv5 algorithm. By optimizing the loss function and network structure, the position, rotation angle, and category information of the chestnut were accurately determined, and then cut using laser cutting equipment.

Benefits of technology

It improves the precision and consistency of chestnut cutting, increases cutting speed and efficiency, reduces production costs, and enhances the safety and intelligence of the equipment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121437618A_ABST
    Figure CN121437618A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of Chinese chestnut cutting, and provides a Chinese chestnut cutting position determination method and system, and the method comprises the steps: collecting a Chinese chestnut image, carrying out the rotation detection frame labeling and category labeling of the collected Chinese chestnut image through labeling software, and building a training data set; based on a YOLOv5 algorithm, establishing a Chinese chestnut position detection model, using the training data set to train the Chinese chestnut position detection model, and optimizing the Chinese chestnut position detection model by performing improved calculation on a loss function of the Chinese chestnut position detection model; inputting the to-be-processed Chinese chestnut image into the trained Chinese chestnut position detection model, and determining the position information, rotation angle and category information of each Chinese chestnut in the to-be-processed Chinese chestnut image; and determining the cutting position of each Chinese chestnut according to the determined position information, rotation angle and category information of each Chinese chestnut in the to-be-processed Chinese chestnut image. The automatic detection and efficient cutting process is achieved while the consistency of the depth and width of a Chinese chestnut notch is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of chestnut cutting technology, and specifically to a method and system for determining the cutting position of chestnuts. Background Technology

[0002] Traditionally, chestnuts were cut manually, which was not only time-consuming and labor-intensive but also prone to uneven cuts and breakage, reducing the market value of the chestnuts. Traditional chestnut opening machines were mostly designed with special mechanical structures based on the shape and characteristics of the chestnut, fixing it in a slot for fixed cutting. This method had a low level of automation and could not intelligently determine depth information, resulting in inconsistent cut length and depth.

[0003] With the continuous advancement of technology, computer vision and machine vision technologies have been introduced into chestnut production. By designing light fields to create a stable lighting environment and combining it with powerful deep learning algorithms, the accuracy of chestnut recognition is effectively improved. Simultaneously, this guides laser cutting equipment to make cuts on each chestnut. This technology has significant economic and social benefits; therefore, research on automatic chestnut cutting has become increasingly important. Currently, automatic chestnut cutting technology has reached a certain level of development, but some problems still exist. These will be described in detail below from the aspects of technical difficulty, cost, applicable scope, and safety.

[0004] First, technical difficulty is one of the main challenges facing automated chestnut cutting technology. Because chestnuts have complex shapes and irregular sizes, inaccurate cutting can occur. Therefore, it's necessary to ensure the equipment can adapt to chestnuts of various sizes and shapes. Simultaneously, it's crucial to ensure consistent cut depth and width to prevent the chestnut from being completely severed or cut too shallowly. Furthermore, ensuring good cut quality is essential to avoid damage or spoilage of the chestnut. Additionally, how to cut chestnuts with varying degrees of hardness is a significant aspect of the technical challenge.

[0005] Secondly, the system's cutting speed and efficiency are also crucial. It's necessary to ensure the system can complete the cutting process quickly to improve production efficiency and reduce costs. Furthermore, it's essential to maintain a balance between the system's cutting speed and efficiency, as well as the consistency and quality of the cuts.

[0006] Finally, safety is also a concern with automated chestnut cutting technology. During the automated cutting process, machine malfunctions or accidental cuts could lead to operator injury or other losses. Therefore, ensuring the safety of the automated cutting process is crucial for the practical application of this technology.

[0007] In conclusion, although automated chestnut cutting technology has been developing for many years and some feasible implementation solutions exist, it still faces numerous challenges. These challenges require collaborative efforts from researchers and companies to address, thereby promoting the further development and application of this technology. Furthermore, significant room for improvement remains in areas such as automating chestnut cutting, ensuring consistent cut patterns while simultaneously increasing cutting speed, efficiency, and accuracy.

[0008] Therefore, it is necessary to provide a method for determining the cutting position of chestnuts that can solve the above problems. Summary of the Invention

[0009] The present invention aims to provide a method for determining the cutting position of chestnuts, so as to solve the technical problems in the prior art that cannot guarantee the consistency of chestnut cuts, and that when performing chestnut laser cutting, the output target box without angle will result in cuts that are too deep or too shallow, or even the cutting position is not accurate enough. The technical problems to be solved by the present invention are achieved through the following technical solutions.

[0010] The first aspect of this invention proposes a method for determining the cutting position of chestnuts, comprising: acquiring chestnut images; using annotation software to annotate the acquired chestnut images with rotation detection boxes and category labels to establish a training dataset; establishing a chestnut position detection model based on the YOLOv5 algorithm; training the chestnut position detection model using the training dataset, wherein the chestnut position detection model is optimized by improving the calculation of the loss function of the chestnut position detection model; inputting the chestnut image to be processed into the trained chestnut position detection model to determine the position information, rotation angle, and category information of each chestnut in the chestnut image to be processed; and determining the cutting position of each chestnut based on the determined position information, rotation angle, and category information of each chestnut in the chestnut image to be processed.

[0011] According to an optional implementation, the chestnut location detection model is established based on the YOLOv5 algorithm, and the chestnut location detection model is trained using the training dataset. The chestnut location detection model is optimized by improving the calculation of its loss function, including: calculating the classification loss value and confidence loss value for each chestnut image sample using the following expression (1):

[0012]

[0013] Where N represents the number of chestnut image samples; i represents the i-th chestnut sample in the i-th chestnut image sample; y represents the actual confidence level of each chestnut position in the chestnut image sample; y i This represents the actual confidence level of the position of the i-th chestnut in the chestnut image sample; This represents the confidence prediction value calculated using the chestnut location detection model for each chestnut in the chestnut image sample. This represents the confidence prediction value calculated using the chestnut location detection model for the i-th chestnut in the chestnut image sample.

[0014] The positional loss value for each chestnut image sample is calculated using the following expression (2):

[0015]

[0016] Where GIoU represents the positional loss value of each chestnut image sample; A c Let A be the area of ​​the minimum closure region between the predicted bounding box and the ground truth bounding box for each chestnut image sample. c IoU represents the intersection-union ratio of the predicted and ground truth boxes for each chestnut image sample. IoU is used to characterize the overlap between the predicted and ground truth boxes for each chestnut image sample. Here, I represents the intersection of the predicted and ground truth boxes for each chestnut image sample, and U represents the union of the predicted and ground truth boxes for each chestnut image sample.

[0017] According to an optional implementation, the step of using annotation software to perform rotation detection box annotation on the acquired chestnut images includes: determining the minimum bounding rectangle position information of each chestnut in each chestnut image by performing rotation detection box annotation on the acquired chestnut images, and determining the rotation angle of the axis of length of each chestnut relative to the horizontal direction of each chestnut image.

[0018] According to an optional implementation, the chestnut location detection model based on the YOLOv5 algorithm includes: establishing two sub-networks: a backbone network and a detection head network. The backbone network is used to perform the first feature extraction on each input chestnut image sample to obtain feature maps at different scales. The detection head network performs information fusion on the multi-scale feature maps output by the backbone network to further extract implicit feature information, and directly outputs the location information, category information, and rotation angle of each chestnut in each chestnut image sample by performing a convolution transformation on the multi-scale feature maps output by the backbone network.

[0019] According to an optional implementation, the step of inputting the chestnut image to be processed into a trained chestnut position detection model to determine the position information, rotation angle, and category information of each chestnut in the image includes: outputting the minimum bounding rectangle position information of each chestnut in the image, the rotation angle of the axis along the length direction of each chestnut relative to the horizontal direction of the image, and the size information of each chestnut. The minimum bounding rectangle position information of each chestnut includes at least two of the following: coordinates of the four vertices, coordinates of the center point, and the length and width of the rectangle; the rotation angle of the axis along the length direction of each chestnut relative to the horizontal direction of the image is between 0 and 180 degrees; and the category information includes classification by chestnut size or chestnut weight.

[0020] According to an optional implementation, determining the cutting position of each chestnut based on the position information, rotation angle, and category information of each chestnut in the determined chestnut image to be processed includes: calculating the center point coordinates (c0, c0, of the minimum bounding rectangle position information of each chestnut in the determined chestnut image to be processed, the rotation angle of the axis along the length direction of each chestnut relative to the horizontal direction of the chestnut image to be processed, and the size information of each chestnut. x ,c y The width w and height h are used to determine the first cutting positioning point, the second cutting positioning point, and the cutting length for each chestnut.

[0021] According to an optional implementation, the four vertices of the minimum bounding rectangle of each chestnut are further calculated, and the two short sides of the minimum bounding rectangle are determined. The two midpoints of the two short sides are then used as the first and second cutting positioning points of each chestnut. The first and second cutting positioning points are connected to form a cutting line. The chestnuts are then cut according to the formed cutting line.

[0022] According to an optional implementation, a designated visual inspection system is configured, which includes a metal plate with a silver honeycomb structure as the background for photographing chestnuts, a light source formed by a specific number of white light strips as the light source to provide a brightness environment for photographing chestnuts, and the relative positional relationship of the camera, chestnuts and light source; under the designated visual inspection system, chestnuts are photographed to obtain chestnut images to be processed.

[0023] According to an optional implementation, chestnuts are cut using a laser cutting machine based on the determined cutting length, cutting depth, and cutting shape.

[0024] A second aspect of the present invention provides a chestnut cutting position determination system, which is used to execute the chestnut cutting position determination method described in the first aspect of the present invention. The chestnut cutting position determination system includes: an acquisition module for acquiring chestnut images, using annotation software to perform rotation detection box annotation and category annotation on the acquired chestnut images, and establishing a training dataset; a model building module for establishing a chestnut position detection model based on the YOLOv5 algorithm, and training the chestnut position detection model using the training dataset, wherein the chestnut position detection model is optimized by improving the loss function of the chestnut position detection model; a first determination module for inputting the chestnut image to be processed into the trained chestnut position detection model, and determining the position information, rotation angle, and category information of each chestnut in the chestnut image to be processed; and a second determination module for determining the cutting position of each chestnut based on the determined position information, rotation angle, and category information of each chestnut in the chestnut image to be processed.

[0025] The embodiments of the present invention have the following advantages:

[0026] Compared with existing technologies, this invention establishes a chestnut position detection model based on the YOLOv5 algorithm. Through the optimized network structure, it extracts chestnut feature information more effectively, accurately determining the position, rotation angle, and category information of each chestnut in the image to be processed, thus significantly improving the detection accuracy of the model. By accurately obtaining the angle information of each chestnut relative to the horizontal direction, it solves the problems of cutting seam deviation and inaccurate cutting in traditional cutting methods, and improves cutting speed, cutting efficiency, cutting accuracy, and cutting quality while ensuring the consistency of chestnut cuts.

[0027] Furthermore, the rotating frame detection technology employed in this invention can improve the working efficiency and accuracy of cutting equipment, thereby reducing production costs and increasing production benefits; it also reduces errors and waste during the cutting process, contributing to improved resource utilization and sustainable development. In addition, the method of this invention has wide applications. The chestnut position recognition technology based on the rotating frame can be extended to other similar agricultural product processing and cutting tasks. For example, it can provide more accurate recognition and cutting solutions for objects with specific shapes and angles, such as fruits and vegetables. Moreover, the rotating frame detection technology has broad application prospects in the fields of automated processing of rotating targets and machine vision. It can play a significant role in industries, agriculture, transportation, and other fields, improving the level of automation and intelligence. Attached Figure Description

[0028] Figure 1 This is a flowchart illustrating an example of the chestnut cutting position determination method of the present invention;

[0029] Figure 2 It is an application Figure 1A schematic diagram of an example of a method for determining the cutting position of chestnuts;

[0030] Figure 3 This is a schematic diagram of an example of using annotation software to perform rotation detection box annotation and category annotation on the collected chestnut images;

[0031] Figure 4 This is a schematic diagram of the network structure of the chestnut position detection model of the present invention;

[0032] Figure 5 yes Figure 4 A schematic diagram of the structure of a module in the network structure;

[0033] Figure 6 yes Figure 4 A schematic diagram of the structure of another module in the network structure;

[0034] Figure 7 yes Figure 4 A schematic diagram of the structure of another module in the network structure;

[0035] Figure 8 yes Figure 4 A schematic diagram of the structure of another module in the network structure;

[0036] Figure 9 yes Figure 4 A schematic diagram of the structure of another module in the network structure;

[0037] Figure 10 This is a schematic diagram of an example of the specified visual inspection system of the present invention;

[0038] Figure 11 This is a schematic diagram of an example of the chestnut cutting position determination system of the present invention. Detailed Implementation

[0039] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. In this invention, the upper surface of the object in the accompanying drawings is referred to as the upper surface, and the lower surface of the object in the accompanying drawings is referred to as the lower surface. This is only for the purpose of more clearly illustrating the detection process and should not be construed as a limitation of the invention. The invention will now be described in detail with reference to the accompanying drawings and embodiments.

[0040] Reference Figures 1 to 10 The first aspect of the present invention provides a method for determining the cutting position of chestnuts.

[0041] Figure 1 This is a flowchart illustrating an example of the chestnut cutting position determination method of the present invention.

[0042] like Figure 1As shown, the method for determining the chestnut cutting position according to the present invention includes the following steps.

[0043] Step S101: Collect chestnut images, and use annotation software to perform rotation detection box annotation and category annotation on the collected chestnut images to establish a training dataset.

[0044] Step S102: Based on the YOLOv5 algorithm, a chestnut location detection model is established. The chestnut location detection model is trained using the training dataset. The chestnut location detection model is optimized by improving the calculation of the loss function of the chestnut location detection model.

[0045] Step S103: Input the chestnut image to be processed into the trained chestnut position detection model to determine the position information, rotation angle and category information of each chestnut in the image to be processed.

[0046] Step S104: Determine the cutting position of each chestnut based on the position information, rotation angle, and category information of each chestnut in the determined chestnut image to be processed.

[0047] Figure 2 It is an application Figure 1 A schematic diagram of an example of a method for determining the cutting position of chestnuts. Figure 3 This is a schematic diagram of an example of using annotation software to perform rotation detection box annotation and category annotation on the collected chestnut images.

[0048] The following will combine Figure 2 and Figure 3 The following example illustrates the method for determining the chestnut cutting position according to the present invention.

[0049] First, in step S101, chestnut images are acquired, and annotation software is used to perform rotation detection box annotation and category annotation on the acquired chestnut images to establish a training dataset.

[0050] Specifically, an industrial camera is used to acquire chestnut images containing multiple chestnuts (i.e., chestnut image samples), and each chestnut in the chestnut image is labeled.

[0051] Preferably, a large number of chestnut images are acquired using a camera with a 5-megapixel resolution and an 8mm focal length lens, including images of chestnuts randomly arranged by hand (e.g., ...). Figure 2 The chestnut images shown are used to obtain the number of chestnut image samples required for model training. In the end, a total of 500 image samples were collected as the dataset.

[0052] Next, by annotating each chestnut in the collected chestnut image samples (hereinafter, sometimes simply referred to as chestnut images), the rotation detection box (specifically, the position information of the minimum bounding rectangle) of each chestnut in each chestnut image sample is determined, and the rotation angle of the axis of length of each chestnut relative to the horizontal direction of each chestnut image is determined.

[0053] For chestnut image sample annotation, the collected chestnut image samples are annotated, for example using labelImg software. Compared to traditional rectangular target detection box annotation, this invention proposes to annotate each chestnut in the chestnut image with a rotated detection box to more accurately obtain the minimum bounding rectangle information of each chestnut, for example using (c x ,c y (w,h,θ) represents the minimum bounding rectangle information for each chestnut. The minimum bounding rectangle information includes the center coordinates (c...). x ,c y )(For example Figure 3 In the diagram, white rectangles represent the center positions of each chestnut, and the minimum bounding rectangle (e.g.) Figure 3 The width w and height h (also called length) of the black rectangles surrounding each chestnut, as well as the angle of deflection (i.e., rotation angle θ) of the axis along the length of each chestnut relative to the horizontal direction of the chestnut image, are shown in the figure. Figure 3 .

[0054] It should be noted that in this example, the minimum bounding rectangle information for each chestnut is obtained using (c x ,c y The expression (w, h, θ) can be used to represent chestnuts, but is not limited to this. In other examples, it can also be represented by the four vertices of the smallest bounding rectangle of each chestnut, the center point, and the deflection angle of the axis along the length of each chestnut relative to the horizontal direction of the chestnut image. The above is only illustrative as an optional example and should not be construed as limiting the invention.

[0055] Next, a training dataset is built using chestnut image samples labeled with the minimum bounding rectangle of each chestnut and category labels, for subsequent model training.

[0056] Preferably, before labeling the chestnut image samples, data augmentation operations are performed on the chestnut images, including random rotation, scaling, etc., in order to increase the model's generalization ability to the rotated target (chestnut image, i.e., chestnut image sample) during training.

[0057] It should be noted that the above is only an optional example and should not be construed as a limitation of the present invention.

[0058] Next, in step S102, a chestnut location detection model is established based on the YOLOv5 algorithm. The chestnut location detection model is trained using the training dataset. The chestnut location detection model is optimized by improving the calculation of the loss function of the chestnut location detection model.

[0059] A chestnut location detection model was established based on the YOLOv5 algorithm.

[0060] It should be noted that the standard YOLOv5 target detection algorithm has been improved to better suit the needs of the chestnut detection and cutting scenario in this invention. The standard YOLOv5 target detection algorithm is based on image feature analysis, outputting the minimum bounding box (without angle) and target category information for the identified target. However, when performing chestnut laser cutting, outputting a target box without angle may lead to problems such as cuts that are too deep or too shallow. Therefore, this invention improves the YOLOv5 target detection algorithm so that it can output the minimum bounding box information, category information, and rotation angle for each chestnut, including the angle.

[0061] Specifically, two sub-networks, a backbone network and a detection head network, are established, and the chestnut location detection model is trained using a training dataset. The backbone network performs initial feature extraction on each input chestnut image sample, obtaining feature maps at different scales. The detection head network fuses the multi-scale feature maps output by the backbone network, further extracting implicit feature information. The multi-scale feature maps output by the backbone network are then transformed through convolution to directly output the location information (specifically, minimum bounding box information), category information, and rotation angle of each chestnut in each chestnut image sample.

[0062] Figure 4 This is a schematic diagram of the network structure of the chestnut location detection model of the present invention. Figure 5 yes Figure 4 A schematic diagram of the structure of a module in the network structure. Figure 6 yes Figure 4 A schematic diagram of the structure of another module in the network structure. Figure 7 yes Figure 4 A schematic diagram of the structure of another module in the network structure. Figure 8 yes Figure 4 A schematic diagram of the structure of another module in the network structure. Figure 9 yes Figure 4 A schematic diagram of the structure of another module in the network structure.

[0063] like Figure 4As shown, the chestnut location detection model established by the YOLOv5 algorithm based on rotated bounding boxes consists of two sub-networks: a backbone network and a detection head network. These two sub-networks jointly realize feature extraction, information fusion, and output of location information (minimum bounding rectangle information of each chestnut), category information, and rotation angle information of chestnut images, thereby achieving rapid identification and localization of the positions of each chestnut in the chestnut image to be processed.

[0064] Specifically, the backbone network, as the foundation of the algorithm, is responsible for extracting deep features from the input chestnut image (i.e., chestnut image sample). Through multi-layer convolution and pooling operations, the backbone network can generate feature maps at multiple scales, thereby providing rich feature information for the detection head network. The detection head network fuses information from the multi-scale feature maps output by the backbone network, further extracts implicit feature information, and directly outputs the position information (specifically, minimum bounding box information), category information, and rotation angle of each chestnut in the chestnut image through convolution transformation operations. Here, the multi-scale feature maps refer to feature maps of different sizes at multiple layers within the backbone network.

[0065] Next, we will provide a detailed explanation of the network components and modules of the chestnut location detection model.

[0066] like Figure 5 As shown, the chestnut location detection model includes three CBS modules (specifically, a first CBS module, a second CBS module, and a third CBS module). The three colors represent different convolutional kernels and strides in the three CBS modules. For example, the first CBS module is a 1×1 convolution with a stride of 1; the second CBS module is a 3×3 convolution with a stride of 1; and the third CBS module is a 3×3 convolution with a stride of 2. The 1×1 convolution is mainly used to change the number of channels; the 3×3 convolution with a stride of 1 is mainly used to extract chestnut image feature information (such as abstract chestnut-related feature information); and the 3×3 convolution with a stride of 2 is mainly used for downsampling.

[0067] Specifically, such as Figure 6As shown, the chestnut location detection model also includes two MP modules (specifically, a first MP module and a second MP module). Different colors represent different input and output channel numbers for the two MP modules. The first MP module has c input channels and 2c output channels; the second MP module has the same number of input and output channels. Each MP module has two branches, which are used for downsampling. The first branch first undergoes Maxpooling, which downsamples the image, followed by a 1×1 convolution to change the number of channels. The second branch first undergoes a 1×1 convolution to adjust the number of channels, followed by a 3×3 convolutional block with a stride of 2, which is used for downsampling. Finally, the results from the first and second branches (specifically, the first and second abstract data sets representing the abstract features of the chestnut in the image) are added together to obtain the final downsampled result (a concatenated and fused abstract data set or abstract data matrix).

[0068] like Figure 7 As shown, the chestnut location detection model also includes an ELAN module. The ELAN module has two branches. The first branch uses a 1×1 convolution to change the number of channels. The second branch first uses a 1×1 convolution module to change the number of channels. Then, it uses four 3×3 convolution modules for feature extraction (specifically, extracting multiple abstract data groups representing abstract chestnut features from the chestnut image, such as a first abstract data group, a second abstract data group, etc., where each abstract data group represents an abstract feature). Figure 7 As shown, the four features are finally superimposed to obtain the final feature extraction result. For example, different operations will result in different abstract data groups, which will be added together or weighted addition to obtain another abstract data group or abstract data matrix.

[0069] In addition, such as Figure 8 As shown, the chestnut position detection model also includes an ELAN-H module. The ELAN-H module is very similar to the ELAN module, except that the number of outputs selected at the second branch differs. The ELAN module selects three outputs for the final summation, while the ELAN-H module selects five outputs for summation. Furthermore, the number of input and output channels in the ELAN-H module differs from that of the ELAN module. In other words, the output of the chestnut position detection model of this invention can be a summation of three output values ​​or a summation of five output values.

[0070] In addition, such as Figure 9As shown, the chestnut location detection model also includes an SPP module. The SPP module's function is to increase the information extraction region, i.e., to enlarge the receptive field, enabling it to extract information from feature maps of different resolutions (e.g., feature maps from other networks or modules), and obtain different receptive fields through max pooling. In the first branch, the four branches after Maxpooling correspond to pooling kernels of 5, 7, 9, and 1, respectively. These four different scales of max pooling provide four different receptive fields, used to distinguish between large and small targets. The SPPC module first divides the features into two parts: one part undergoes conventional processing, and the other part undergoes SPP structure processing. Finally, these two parts are merged, which reduces the computational load by half, resulting in faster speed and improved accuracy.

[0071] It should be noted that the SPP module described above can be a standalone module or embedded in different layers of the network. The above is only provided as an optional example and should not be construed as a limitation of the present invention. Furthermore, the chestnut location detection model of the present invention is universal. Typically, targets with significant differences in size are defined as large, medium, and small targets, such as people and ants in an image. However, chestnuts are generally similar in size, but to more accurately segment chestnuts of various sizes, the size category of the chestnut can be defined, for example, by using the area of ​​the chestnut.

[0072] To achieve efficient identification and localization of chestnut locations, this invention optimizes the loss function of the YOLOv5 algorithm. The optimized loss function can more accurately measure the error in the process of detecting chestnut images by rotating the bounding box, thereby improving the accuracy and robustness of chestnut location detection.

[0073] For the optimization of model parameters, the classification loss value and confidence loss value of each chestnut image sample are calculated using the following expression (1):

[0074]

[0075] Where N represents the number of chestnut image samples, i represents the chestnut sample in the i-th chestnut image sample; y represents the actual category label or actual confidence score of each chestnut position in the chestnut image sample; y i This represents the actual confidence level of the position of the i-th chestnut in the chestnut image sample; This represents the predicted category confidence value obtained by using the chestnut location detection model to calculate the category confidence value for each chestnut in the chestnut image sample. This represents the category prediction value or confidence prediction value obtained by using the chestnut location detection model to calculate the i-th chestnut in the chestnut image sample.

[0076] The positional loss value for each chestnut image sample is calculated using the following expression (2):

[0077]

[0078] Where GIoU represents the positional loss value of each chestnut image sample; A c Let A be the area of ​​the minimum closure region between the predicted bounding box and the ground truth bounding box for each chestnut image sample. c IoU represents the area of ​​the smallest bounding box that contains both the predicted and ground truth boxes. IoU represents the intersection-over-union (IoU) ratio between the smallest bounding box and the ground truth box of each chestnut image sample. IoU is used to characterize the degree of overlap between the predicted and ground truth boxes of each chestnut image sample. Here, I represents the intersection of the predicted and ground truth boxes of each chestnut image sample, and U represents the union of the predicted and ground truth boxes of each chestnut image sample.

[0079] By optimizing the network structure of the chestnut location detection model and further optimizing its loss function, the model parameters can be improved, thereby enhancing the accuracy and robustness of chestnut location detection.

[0080] In another example, a chestnut location detection model is built using a series of region-based convolutional neural network (R-CNN) algorithms, specifically including the following steps: 1) In the Region Proposal Network (RPN) stage, the shape and size of the sliding window are adjusted to adapt to targets with different angles and shapes; 2) In the pooling layer, rotation ROI pooling operation is used to adapt to rotating targets, thereby preserving the feature information of rotating targets; 3) In the output layer, a rotation angle prediction term and a corresponding loss function are added to guide the model to learn the prediction of rotation angle.

[0081] In another example, a chestnut location detection model is built based on regression-based single-stage detection algorithms such as YOLO and SSD. The specific steps include: 1) When presetting anchor boxes, considering different rotation angles to provide more diverse candidate boxes of different sizes and shapes; 2) In the output layer, adding a rotation angle prediction term and a corresponding loss function to guide the model to learn rotation angle prediction; 3) Decoding and post-processing the generated rotation detection boxes, including adjusting the Non-Maximum Suppression (NMS) algorithm to enable it to handle rotation detection boxes with angles. This improvement process increases the model's computational complexity and training difficulty. Furthermore, during model training, optimization techniques such as learning rate adjustment and weight decay are employed to improve model convergence speed and prediction performance.

[0082] In one specific implementation, the weight parameters of the chestnut location detection model are randomly initialized at the beginning of training. If the learning rate of the chestnut location detection model is too large at this time, it may lead to model instability during training. For example, a warm-up training strategy is used to keep the learning rate low for the first few epochs of training. With a low learning rate, the loss function of the chestnut location detection model gradually stabilizes. After the loss function of the chestnut location detection model has stabilized relatively, a pre-set learning rate is then selected for training, resulting in faster convergence and better training performance.

[0083] In another specific implementation, when training the chestnut location detection model, the learning rate can directly control the magnitude of model parameter updates. In the early stages of model training, a larger learning rate is often chosen to allow the model to converge quickly. In the later stages, a smaller learning rate is chosen to allow the model to find the global optimum within a certain parameter space. For example, a cosine annealing learning rate algorithm can be used, controlling the learning rate through a cosine function. The number of training epochs within a cosine cycle is manually set, and the learning rate is reset at the maximum value in each cosine cycle. The cosine annealing learning rate, with the initial learning rate as the maximum learning rate within a cosine cycle, first decreases and then increases within that cycle. During model training, the gradient descent algorithm may get stuck in local minima. In this case, increasing the learning rate helps to "jump out" of the local minimum, allowing the model to find the global optimum. This optimizes model parameters and improves prediction accuracy.

[0084] In another specific implementation, the parameters and intermediate results of the chestnut location detection model are mostly stored and calculated in single-precision floating-point (i.e., float32) data. When the chestnut location detection model is large, reducing the precision of its parameters reduces the amount of video memory required by the graphics card, thus accelerating the model training speed. For example, automatic mixed-precision training can be used, specifically through function interfaces provided by the deep learning framework PyTorch. This automatically adjusts the data type of tensors during model training, optimizing model parameters and improving prediction accuracy.

[0085] In another specific implementation, the resolution of the input chestnut image samples significantly impacts the performance of the chestnut location detection model during training. Higher image resolution indicates richer detail, but this also increases training and inference time. Conversely, lower resolution results in shorter training and faster inference, but for the smallest targets, the images lose more information, leading to lower detection accuracy. Therefore, a multi-scale training strategy is employed. Different input image resolutions (i.e., chestnut image samples with varying resolutions) are used. Within a training cycle, one image resolution is randomly selected and fed into the network structure of the chestnut location detection model for training. This multi-scale training strategy amplifies the scale of small targets and increases the diversity of targets at multiple scales, effectively improving the accuracy of the chestnut location detection model.

[0086] Next, in step S104, the chestnut image to be processed is input into the trained chestnut position detection model to determine the position information, rotation angle and category information of each chestnut in the image to be processed.

[0087] Specifically, the chestnut image to be processed is input into the trained chestnut position detection model, which outputs the minimum bounding rectangle position information of each chestnut in the image, the rotation angle of the axis along the length of each chestnut relative to the horizontal direction of the image, and the size information of each chestnut.

[0088] More specifically, the minimum bounding rectangle position information of each chestnut includes at least two of the following: the coordinates of the four vertices, the coordinates of the center point, the rectangle length (or rectangle height), and the width information (i.e., the rectangle width).

[0089] The rotation angle of the axis along the length of each chestnut relative to the horizontal direction of the image to be processed ranges from 0 degrees to 180 degrees. Category information includes classification by chestnut size or chestnut weight.

[0090] In an optional implementation, determining the cutting position of each chestnut based on its position information, rotation angle, and category information in the determined chestnut image to be processed includes:

[0091] Based on the minimum bounding rectangle position information of each chestnut in the determined chestnut image to be processed, the rotation angle of the axis along the length direction of each chestnut relative to the horizontal direction of the chestnut image to be processed, and the size information of each chestnut, the coordinates of the center point of the minimum bounding rectangle of each chestnut are calculated (c x ,c y) The width w and height h are used to determine the first cutting positioning point, the second cutting positioning point and the cutting length of each chestnut.

[0092] Further calculate the four vertices of the minimum bounding rectangle of each chestnut, determine the two short sides of the minimum bounding rectangle, and use the midpoints of the two short sides as the first cutting positioning point and the second cutting positioning point of each chestnut, and connect the first cutting positioning point and the second cutting positioning point to form a cutting line.

[0093] Specifically, the four vertices (such as vertex 1, vertex 2, vertex 3 and vertex 4) of the minimum bounding rectangle of each chestnut are calculated through the following expressions. Among them, vertex 1 is expressed by the following expression: (c x - w / 2 * cos(θ) - h / 2 * sin(θ), c y - w / 2 * sin(θ) + h / 2 * cos(θ)). Vertex 2 is expressed by the following expression: (c x + w / 2 * cos(θ) - h / 2 * sin(θ), c y + w / 2 * sin(θ) + h / 2 * cos(θ)). Vertex 3: (c x + w / 2 * cos(θ) + h / 2 * sin(θ), c y + w / 2 * sin(θ) - h / 2 * cos(θ)). Vertex 4 is expressed by the following expression: (c x - w / 2 * cos(θ) + h / 2 * sin(θ), c y - w / 2 * sin(θ) - h / 2 * cos(θ)).

[0094] Next, determine the two short sides. If w < h, then the short sides are the lines connecting vertex 1 and vertex 2, and vertex 3 and vertex 4. Otherwise, the short sides are the lines connecting vertex 2 and vertex 3, and vertex 4 and vertex 1.

[0095] Then, calculate the midpoints of the two short sides, the first short side (short side 1) and the second short side (short side 2). The calculation is through the following expressions.

[0096] The first midpoint of the first short side: ((the x coordinate of vertex 1 + the x coordinate of vertex 2) / 2, (the y coordinate of vertex 1 + the y coordinate of vertex 2) / 2).

[0097] The second midpoint of the second short side: ((the x coordinate of vertex 3 + the x coordinate of vertex 4) / 2, (the y coordinate of vertex 3 + the y coordinate of vertex 4) / 2).

[0098] Specifically, the first midpoint (midpoint of short side 1) and the second midpoint (midpoint of short side 2) are used as the first and second cutting positioning points. Specifically, the first cutting positioning point (midpoint of short side 1) and the second cutting positioning point (midpoint of short side 2) of each chestnut are directly connected to form a cutting line.

[0099] Next, cut each chestnut according to the formed cutting lines.

[0100] In one alternative implementation, chestnuts are cut using a laser cutter based on the formed cutting line, a preset cutting shape, and a cutting depth.

[0101] Specifically, the cutting shape is, for example, a straight line, an S-shaped curve, etc. The cutting depth is, for example, a fixed depth, but can also be adjusted adaptively according to the size of the chestnut.

[0102] It should be noted that the above is only an optional example and should not be construed as a limitation of the present invention.

[0103] In a preferred embodiment, a designated visual inspection system is configured, comprising a metal plate with a silver honeycomb structure as the background for photographing chestnuts, a light source (e.g., multiple strip light sources) formed by a specific number of white light strips as the light source to provide a brightness environment for photographing chestnuts, and the relative positional relationship between the camera, chestnuts, and light source, as detailed in [reference needed]. Figure 10 .

[0104] Under the specified visual inspection system, chestnuts are photographed to obtain images of chestnuts to be processed, and the obtained images of chestnuts to be processed are used to determine the position of each chestnut and the cutting line, cutting length, cutting depth and cutting shape of each chestnut.

[0105] In one specific embodiment, the designated visual inspection system includes a light source, a lens, and a camera.

[0106] Regarding the light source, an illumination scheme consisting of eight white light strips, such as a lighting system composed of white LED light sources, can produce greater brightness compared to traditional lighting methods, thus playing a key role in improving the detection and recognition efficiency of target objects. At the same time, white LED light sources exhibit excellent color temperature stability, maintaining consistent light quality even when the power supply voltage fluctuates.

[0107] For the lens, the most suitable focal length, aperture, and resolution were selected based on the specific size of the chestnut. Precise adjustments to the focal length and aperture ensured sufficient light passed through the lens while maintaining appropriate depth of field. After a series of experimental verifications, a lens with 5 megapixels and an 8mm focal length was chosen.

[0108] For the camera, a camera with a 5-megapixel resolution lens was selected. The main factors considered during the selection process were frame rate and dynamic range. This camera has a frame rate of approximately 30fps, which is sufficient for conditions without high-speed detection requirements. This allows for a bright and stable lighting environment, reducing the need for high dynamic range. For example, a 5-megapixel RGB color camera was chosen.

[0109] By adjusting the relative positions of the camera, chestnuts, and light source, significant improvements can be achieved in detection accuracy and performance.

[0110] It should be noted that the above is only an optional example and should not be construed as a limitation of the present invention.

[0111] Compared with existing technologies, this invention establishes a chestnut position detection model based on the YOLOv5 algorithm. Through the optimized network structure, it extracts chestnut feature information more effectively, accurately determining the position, rotation angle, and category information of each chestnut in the chestnut image to be processed, thus significantly improving the detection accuracy of the model. By accurately obtaining the angle information of each chestnut relative to the horizontal direction, it solves the problems of cutting seam deviation and insufficient cutting depth in traditional cutting methods, and improves cutting speed, cutting efficiency, cutting accuracy, and cutting quality while ensuring the consistency of chestnut cuts.

[0112] Furthermore, the rotating frame detection technology employed in this invention can improve the working efficiency and accuracy of cutting equipment, thereby reducing production costs and increasing production benefits; it also reduces errors and waste during the cutting process, contributing to improved resource utilization and sustainable development. In addition, the method of this invention has wide applications. The chestnut position recognition technology based on the rotating frame can be extended to other similar agricultural product processing and cutting tasks. For example, it can provide more accurate recognition and cutting solutions for objects with specific shapes and angles, such as fruits and vegetables. Moreover, the rotating frame detection technology has broad application prospects in the fields of automated processing of rotating targets and machine vision. It can play a significant role in industries, agriculture, transportation, and other fields, improving the level of automation and intelligence.

[0113] The following are system embodiments of the present invention. The method of the first aspect of the present invention is particularly applicable to the chestnut cutting position determination system of the present invention. For details not disclosed in the system embodiments of the present invention, please refer to the method embodiments of the present invention.

[0114] Reference Figure 10 and Figure 11The chestnut cutting position determination system 900 of the present invention is used to execute the chestnut cutting position determination method described in the first aspect of the present invention. The chestnut cutting position determination system 900 includes a data acquisition module 910, a model building module 920, a first determination module 930 and a third determination module 940.

[0115] Specifically, the acquisition module 910 is used to acquire chestnut images, and uses annotation software to annotate the acquired chestnut images with rotation detection boxes and category labels to establish a training dataset. The model building module 920 establishes a chestnut position detection model based on the YOLOv5 algorithm, and trains the chestnut position detection model using the training dataset. The chestnut position detection model is optimized by improving the loss function of the model. The first determination module 930 inputs the chestnut image to be processed into the trained chestnut position detection model to determine the position information, rotation angle, and category information of each chestnut in the image. The second determination module 940 determines the cutting position of each chestnut based on the determined position information, rotation angle, and category information of each chestnut in the image; and specifies a visual detection system, which includes a silver honeycomb structure metal plate as the background for photographing chestnuts, a light source formed by a specific number of white light strips as the light source to provide a brightness environment for photographing chestnuts, and the relative positional relationship between the camera, chestnuts, and light source. Under the specified visual inspection system, chestnuts are photographed to obtain chestnut images to be processed.

[0116] In one optional implementation, the step of using annotation software to annotate the acquired chestnut images with rotation detection boxes includes: determining the minimum bounding rectangle position information of each chestnut in each chestnut image by annotating the acquired chestnut images with rotation detection boxes, and determining the rotation angle of the axis of length of each chestnut relative to the horizontal direction of each chestnut image. A training dataset is then built using the annotated chestnut images.

[0117] A chestnut location detection model is established based on the YOLOv5 algorithm. The model is trained using the training dataset. The model is optimized by improving the calculation of the loss function of the chestnut location detection model.

[0118] The classification loss and confidence loss values ​​for each chestnut image sample are calculated using the following expression (1):

[0119]

[0120] Where N represents the number of chestnut image samples; i represents the number of chestnut samples in the i-th chestnut image sample; y represents the actual confidence level of each chestnut position in the chestnut image sample; y iThis represents the actual confidence level of the position of the i-th chestnut in the chestnut image sample; This refers to the category prediction value or confidence prediction value obtained by using the chestnut location detection model to calculate each chestnut in the chestnut image sample; This represents the category prediction value or confidence prediction value obtained by using the chestnut location detection model to calculate the i-th chestnut in the chestnut image sample.

[0121] The positional loss value for each chestnut image sample is calculated using the following expression (2):

[0122]

[0123] Where GIoU represents the positional loss value of each chestnut image sample; A c Let A be the area of ​​the minimum closure region between the predicted bounding box and the ground truth bounding box for each chestnut image sample. c IoU represents the intersection-union ratio of the predicted and ground truth boxes for each chestnut image sample. IoU is used to characterize the overlap between the predicted and ground truth boxes for each chestnut image sample. Here, I represents the intersection of the predicted and ground truth boxes for each chestnut image sample, and U represents the union of the predicted and ground truth boxes for each chestnut image sample.

[0124] In one optional implementation, annotation software is used to annotate the acquired chestnut images with rotation detection bounding boxes. By annotating the acquired chestnut images with rotation detection bounding boxes, the position information of the minimum bounding rectangle of each chestnut in each chestnut image is determined, and the rotation angle of the axis of length of each chestnut relative to the horizontal direction of each chestnut image is determined.

[0125] Based on the YOLOv5 algorithm, a chestnut location detection model is established, which includes two sub-networks: a backbone network and a detection head network.

[0126] The backbone network is used to perform the first feature extraction on each input chestnut image sample, obtaining feature maps at different scales. The detection head network then fuses the multi-scale feature maps output by the backbone network to further extract implicit feature information. Finally, it performs a convolution transformation on the multi-scale feature maps output by the backbone network to directly output the position, category, and rotation angle of each chestnut in each chestnut image sample. The multi-scale feature maps refer to feature maps of different sizes at multiple levels within the backbone network.

[0127] Specifically, the chestnut image to be processed is input into the trained chestnut position detection model to determine the position information, rotation angle, and category information of each chestnut in the image.

[0128] More specifically, the output includes the minimum bounding rectangle position information of each chestnut in the chestnut image to be processed, the rotation angle of the axis along the length direction of each chestnut relative to the horizontal direction of the chestnut image to be processed, and the size information of each chestnut. The minimum bounding rectangle position information of each chestnut includes at least two of the following: the coordinates of the four vertices, the coordinates of the center point, and the length and width of the rectangle. The rotation angle of the axis along the length direction of each chestnut relative to the horizontal direction of the chestnut image to be processed is between 0 and 180 degrees. The category information includes the classification of chestnut size or chestnut weight.

[0129] In one optional implementation, the step of determining the cutting position of each chestnut is based on the position information, rotation angle, and category information of each chestnut in the determined chestnut image to be processed.

[0130] Based on the minimum bounding rectangle position information of each chestnut in the determined chestnut image to be processed, the rotation angle of the axis along the length direction of each chestnut relative to the horizontal direction of the chestnut image to be processed, and the size information of each chestnut, the coordinates of the center point of the minimum bounding rectangle of each chestnut are calculated (c x ,c y The width w and height h are used to determine the first cutting positioning point, the second cutting positioning point, and the cutting length for each chestnut.

[0131] Further calculate the four vertices of the minimum bounding rectangle of each chestnut, determine the two short sides of the minimum bounding rectangle, and determine the two midpoints of the two short sides as the first cutting positioning point and the second cutting positioning point of each chestnut. Connect the first cutting positioning point and the second cutting positioning point to form a cutting line.

[0132] Cut each chestnut according to the cut lines formed.

[0133] In one optional implementation, a designated visual inspection system is configured, comprising a metal plate with a silver honeycomb structure as the background for photographing chestnuts, a light source formed by a specific number of white light strips to provide a brightness environment for photographing chestnuts, and the relative positional relationship between the camera, chestnuts, and light source. Under the designated visual inspection system, chestnuts are photographed to obtain images of chestnuts to be processed.

[0134] Chestnuts are cut using a laser cutting machine based on the determined cutting line, cutting length, cutting depth, and cutting shape.

[0135] It should be noted that the content of the chestnut cutting position determination method in the first aspect of the present invention is substantially the same as that in the chestnut cutting position determination method in the second aspect of the present invention, therefore, the description of the same parts is omitted. Furthermore, the accompanying drawings are merely illustrative of the processes included in the method according to exemplary embodiments of the present invention, and are not intended to be limiting. It is readily understood that the processes shown in the drawings do not indicate or limit the temporal order of these processes. Additionally, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.

[0136] Compared with existing technologies, this invention establishes a chestnut position detection model based on the YOLOv5 algorithm. Through the optimized network structure, it extracts chestnut feature information more effectively, accurately determining the position, rotation angle, and category information of each chestnut in the chestnut image to be processed, thus significantly improving the detection accuracy of the model. By accurately obtaining the angle information of each chestnut relative to the horizontal direction, it solves the problems of cutting seam deviation and insufficient cutting depth in traditional cutting methods, and improves cutting speed, cutting efficiency, cutting accuracy, and cutting quality while ensuring the consistency of chestnut cuts.

[0137] Furthermore, the rotating frame detection technology employed in this invention can improve the working efficiency and accuracy of cutting equipment, thereby reducing production costs and increasing production benefits; it also reduces errors and waste during the cutting process, contributing to improved resource utilization and sustainable development. In addition, the method of this invention has wide applications. The chestnut position recognition technology based on the rotating frame can be extended to other similar agricultural product processing and cutting tasks. For example, it can provide more accurate recognition and cutting solutions for objects with specific shapes and angles, such as fruits and vegetables. Moreover, the rotating frame detection technology has broad application prospects in the fields of automated processing of rotating targets and machine vision. It can play a significant role in industries, agriculture, transportation, and other fields, improving the level of automation and intelligence.

[0138] It should be noted that the above detailed descriptions are exemplary and intended to provide further explanation of this application. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains.

[0139] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the exemplary embodiments according to this application. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.

[0140] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms can be used interchangeably where appropriate so that the embodiments of this application described herein can be implemented in sequences other than those illustrated or described herein.

[0141] Furthermore, the terms “comprising” and “having”, and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not necessarily limited to those steps or units that are explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to such process, method, product, or apparatus.

[0142] For ease of description, spatial relative terms such as "above," "on top of," "on the upper surface of," "above," etc., are used herein to describe the spatial positional relationship of a device or feature as shown in the figures to other devices or features. It should be understood that spatial relative terms are intended to encompass different orientations in use or operation beyond the orientation of the device as described in the figures. For example, if the device in the figures were inverted, a device described as "above" or "on top of" other devices or structures would subsequently be positioned as "below" or "under" other devices or structures. Thus, the exemplary term "above" can include both "above" and "below." The device may also be positioned in other different ways, such as rotated 90 degrees or in other orientations, and the spatial relative descriptions used herein will be interpreted accordingly.

[0143] In the detailed description above, reference has been made to the accompanying drawings, which form part of this document. In the drawings, similar symbols typically identify similar parts unless the context otherwise indicates otherwise. The illustrated embodiments described in the detailed specification, drawings, and claims are not intended to be limiting. Other embodiments may be used and other changes may be made without departing from the spirit or scope of the subject matter presented herein.

[0144] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method of determining a cutting position of a Chinese chestnut, characterized by, The method comprises the following steps: Collecting chestnut images, using a labeling software to label the collected chestnut images with a rotating detection box and a category, and establishing a training data set; Based on the YOLOv5 algorithm, a chestnut position detection model is established, and the chestnut position detection model is trained using the training data set, wherein the chestnut position detection model is optimized by improving the calculation of the loss function of the chestnut position detection model; Inputting the processed chestnut image into the trained chestnut position detection model to determine the position information, rotation angle and category information of each chestnut in the processed chestnut image; According to the determined position information, rotation angle and category information of each chestnut in the processed chestnut image, the cutting position of each chestnut is determined.

2. The Chinese chestnut cutting position determination method according to claim 1, wherein The method comprises the following steps: The classification loss value and the confidence loss value of each chestnut image sample are calculated using the following expression (1): wherein N represents the number of chestnut image samples; i represents a chestnut sample in the i-th chestnut image sample; y represents the actual confidence of each chestnut position in the chestnut image sample; y i represents the actual confidence of the chestnut position of the i-th chestnut in the chestnut image sample; represents the class confidence prediction value obtained by calculating each chestnut in the chestnut image sample using the chestnut position detection model; represents the class prediction value or confidence prediction value obtained by calculating the i-th chestnut in the chestnut image sample using the chestnut position detection model; The position loss value of each chestnut image sample is calculated using the following expression (2): Wherein, GIoU represents the position loss value of each chestnut image sample; A c represents the minimum closed region area A of the prediction frame and the real frame of each chestnut image sample c , that is, the area of the minimum frame containing the prediction frame and the real frame; IoU represents the intersection over union of the prediction frame and the real frame of each chestnut image sample, which is used to represent the coincidence degree between the prediction frame and the real frame of each chestnut image sample, wherein, I represents the intersection of the prediction frame and the real frame of each chestnut image sample, and U represents the union of the prediction frame and the real frame of each chestnut image sample.

3. The Chinese chestnut cutting position determination method of claim 1, wherein, The method comprises the following steps: By labeling the collected chestnut images with a rotating detection box, the minimum circumscribed rectangle position information of each chestnut in each chestnut image is determined, and the rotation angle of the axis in the length direction of each chestnut relative to the horizontal direction of each chestnut image is determined.

4. The Chinese chestnut cutting location determination method of claim 1, wherein, The method comprises the following steps: A backbone network and a detection head network are established, wherein The backbone network is used to perform a first feature extraction on the input chestnut image samples to obtain feature maps of different scales; the detection head network is used to fuse the multi-scale feature maps output by the backbone network, further extract the hidden feature information, and perform a convolutional transformation operation on the multi-scale feature maps output by the backbone network to directly output the position information, category information and rotation angle of each chestnut in each chestnut image sample.

5. The Chinese chestnut cutting position determining method according to any one of claims 1 to 4, characterized by, The method comprises the following steps: The minimum circumscribed rectangle position information of each chestnut, the rotation angle of the axis in the length direction of each chestnut relative to the horizontal direction of the processed chestnut image, and the size information of each chestnut are output, wherein The minimum circumscribed rectangle position information of each chestnut comprises at least two pieces of information: the coordinate information of the four vertices, the center point coordinate information, and the rectangle length and width information; The rotation angle of the axis in the length direction of each chestnut relative to the horizontal direction of the processed chestnut image is between 0 degrees and 180 degrees; The category information includes the classification of chestnut size or the classification of chestnut weight.

6. The Chinese chestnut cutting position determination method according to claim 5, wherein The method comprises the following steps: According to the determined minimum circumscribed rectangle position information of each chestnut in the to-be-processed chestnut image, the rotation angle of the axis in the length direction of each chestnut relative to the horizontal direction of the to-be-processed chestnut image, and the size information of each chestnut, the center point coordinates (c x ,c y ) of the minimum circumscribed rectangle of each chestnut, the width w and the height h are calculated to determine the first cutting positioning point, the second cutting positioning point and the cutting length of each chestnut.

7. The Chinese chestnut cutting location determination method of claim 6 wherein, Further calculate the four vertices of the minimum bounding rectangle of each chestnut, determine the two short sides of the minimum bounding rectangle, and determine two midpoints of the two short sides as the first cutting positioning point and the second cutting positioning point of each chestnut, and connect the first cutting positioning point and the second cutting positioning point to form a cutting line; According to the cutting line formed, each chestnut is cut.

8. The chestnut cutting position determination method according to any one of claims 1 to 5, wherein a specified visual detection system is configured, the specified visual detection system comprising a metal plate with a silver honeycomb structure as a background for photographing chestnuts, a light source formed by a specific number of white light strips as a light source to provide a brightness environment for photographing chestnuts, and a relative position relationship between the camera, the chestnuts, and the light source is arranged; Under the specified visual detection system, the chestnuts are photographed to obtain the chestnut image to be processed.

9. The chestnut cutting position determination method according to claim 7, wherein according to the determined cutting length, cutting depth, and cutting shape, a laser cutting machine is used to cut the chestnuts. The chestnut cutting position determination system comprises: The acquisition module is configured to acquire a chestnut image, and use a labeling software to perform rotation bounding box labeling and category labeling on the acquired chestnut image, and establish a training data set; 10. A Chinese chestnut cutting position determination system for performing the Chinese chestnut cutting position determination method according to any one of claims 1 to 9, characterized by, The model establishment module is configured to establish a chestnut position detection model based on a YOLOv5 algorithm, and train the chestnut position detection model using the training data set, wherein the chestnut position detection model is optimized by improving the loss function of the chestnut position detection model; The first determination module is configured to input the chestnut image to be processed into the trained chestnut position detection model, and determine position information, a rotation angle, and category information of each chestnut in the chestnut image to be processed; The second determination module is configured to determine the cutting position of each chestnut according to the determined position information, rotation angle, and category information of each chestnut in the chestnut image to be processed; and The specified visual detection system comprises a metal plate with a silver honeycomb structure as a background for photographing chestnuts, a light source formed by a specific number of white light strips as a light source to provide a brightness environment for photographing chestnuts, and a relative position relationship between the camera, the chestnuts, and the light source is arranged; Under the specified visual detection system, the chestnuts are photographed to obtain the chestnut image to be processed. ​ ​