A silkworm detection method based on deep learning

Through deep learning technology, YOLOv4 algorithm and feature fusion layer are used to solve the problem of low efficiency of silkworm position and quantity detection under traditional artificial breeding methods, realize the intelligence and automation of silkworm breeding, and improve the breeding rate and survival rate of silkworms. , suitable for mobile and embedded applications.

CN115019162BActive Publication Date: 2024-08-27GUANGXI UNIV FOR NATITIES
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210094757.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-26
Publication Date
2024-08-27
Estimated Expiration
2042-01-26

AI Technical Summary

Technical Problem

The traditional artificial breeding method makes the silkworm breeding process time-consuming and laborious, making it difficult to realize the intelligentization and industrialization of silkworm breeding, and there is a lack of automated detection methods to accurately determine the location and quantity of silkworms.

Method used

A silkworm detection method based on deep learning is used to establish a silkworm detection model through the YOLOv4 algorithm. It combines the backbone feature extraction network, pyramid pooling structure and feature fusion layer to automatically identify the position and number of silkworms, and uses the K-means algorithm to optimize the anchor frame position. and size to achieve lightweight and high accuracy of the silkworm detection model.

Benefits of technology

It improves the accuracy and efficiency of silkworm detection, realizes standardized intelligent automatic feeding of silkworms, improves the breeding rate and survival rate of silkworms, reduces manual refinement processes, and reduces equipment costs. It is suitable for mobile terminals and embedded applications. .

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115019162B
    Figure CN115019162B
Patent Text Reader

Abstract

The present invention relates to the field of breeding technology, and in particular to a method for detecting mulberry silkworms based on deep learning, comprising the following steps: collecting an overall image of reared silkworms in a silkworm farm, and marking the position information and category information of the reared silkworms in the overall image; obtaining a regional image corresponding to the position of each reared silkworm, and marking the corresponding position information and category information in the regional image; modifying the size of the regional image to a uniform pixel to obtain an information image, constructing a silkworm data set with the information image, and dividing the silkworm data set into a training set and a test set; establishing a silkworm detection model based on a YOLOv4 algorithm, inputting the information image of the training set into the silkworm detection model for training to obtain a training model; and inputting the information image of the test set into the training model to identify the location and quantity of reared silkworms. The present invention can automatically detect the location and quantity of reared silkworms, so as to facilitate the subsequent automated breeding.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of breeding technology, and in particular to a silkworm detection method based on deep learning. Background Art

[0002] Silkworms are the larvae of silk moths. Silkworms' various products, such as silk and silkworm sand, are important raw materials for the chemical, pharmaceutical and food industries. Sericulture has very important economic value and practical significance in China, such as Guangxi. However, most of the current sericulture is mainly carried out by private individuals, and the production scale of each silkworm is different. In the process of sericulture, farmers need to take good care of them to ensure the growth of silkworms and the production of cocoons. This traditional production management method restricts the intelligentization and industrialization of sericulture. The standardized industrialization of sericulture can greatly ensure the survival rate of silkworms, the production of cocoons, and improve the economic benefits of silkworms.

[0003] The current artificial breeding of silkworms relies on manpower, which is time-consuming and labor-intensive. A lot of energy needs to be invested in the silkworm breeding process. In the process of silkworm breeding, the location and number of silkworms are generally determined manually in order to feed the silkworms with appropriate amounts of mulberry leaves. This traditional production management method restricts the intelligentization and industrialization of the silkworm breeding industry. Summary of the invention

[0004] In order to solve the above problems, the present invention provides a silkworm detection method based on deep learning, which can automatically detect the location and number of reared silkworms to facilitate the subsequent automated breeding.

[0005] In order to achieve the above object, the technical solution adopted by the present invention is:

[0006] A silkworm detection method based on deep learning comprises the following steps:

[0007] S1, collecting an overall image of the raised silkworms in the silkworm farm, and marking the position information and category information of the raised silkworms in the overall image;

[0008] S2, obtaining a regional image corresponding to each position of the raised silkworms, and marking corresponding position information and category information in the regional image;

[0009] S3, modifying the size of the regional image to a uniform pixel to obtain an information image, constructing a silkworm dataset with the information image, and dividing the silkworm dataset into a training set and a test set;

[0010] S4, establishing a silkworm detection model based on the YOLOv4 algorithm, and inputting the information image of the training set into the silkworm detection model for training to obtain a training model;

[0011] S5. Input the information image of the test set into the training model to obtain the prediction result of the training model to identify the location and number of reared silkworms.

[0012] Furthermore, in step S4, the silkworm detection model includes a backbone feature extraction network, a pyramid pooling structure and a feature fusion layer.

[0013] The backbone feature extraction network outputs a 16-channel image by convolution of the input 3-channel image, and extracts image features from the 16-channel image through 3×3 and 5×5 depth-separable convolution layers respectively to obtain a feature image;

[0014] The pyramid pooling structure is used for maximum pooling processing of the feature image to obtain a significant feature image;

[0015] The feature fusion layer is used to obtain a detection head by performing feature fusion on the feature image and the significant feature image, combine the anchor frame obtained by the prediction layer of the detection head with the anchor frame obtained by the K-means algorithm, adjust the position of the anchor frame in the actual image and the height and width of the anchor frame, and delete the anchor frame whose prediction score value is lower than the set standard value to obtain a predicted anchor frame, and combine the predicted anchor frames through non-maximum suppression NMS to obtain a prediction result.

[0016] Furthermore, in step S3, the pixels of the information image are 416×416.

[0017] Furthermore, the feature image acquisition step of the backbone feature extraction network is:

[0018] A1. Perform 1×1×16 convolution on the (416,416,3) image with 416×416 pixels and 3 channels to obtain a (416,416,16) image. Perform activation function calculation on the (416,416,16) image after normalizing it by 3×3 convolution to obtain a (208,208,16) image.

[0019] A2. Input the (208, 208, 16) image into 3×3 and 5×5 depthwise separable convolutional layers respectively to extract image features, so as to output feature images with pixels of 13×13, 26×26, and 52×52, and the feature images are respectively 13×13 pixels with 160 channels (13, 13, 160) images, 26×26 pixels with 112 channels (26, 26, 112) images, and 52×52 pixels with 40 channels (52, 52, 40) images;

[0020] The step of obtaining the salient feature image of the pyramid pooling structure is: performing a maximum pooling layer fusion of image features on the (13, 13, 160) image through four different sizes of convolution kernels of 1, 5, 9, and 11, so as to obtain a (13, 13, 160) pooling feature image as the salient feature image;

[0021] The prediction steps of the feature fusion layer are:

[0022] B1. Upsample the (13,13,160) pooled feature image to obtain a (26,26,160) image and a (52,52,160) image, perform feature addition, upsampling, and convolution calculation on the (26,26,160) image and the (52,52,160) image and the (26,26,112) image and the (52,52,40) image in sequence to obtain a (52,52) feature image and a (26,26) feature image, and use the (52,52) feature image with larger pixels as a large-size detection head;

[0023] B2. Downsample the (52,52) feature image and perform convolution calculation and feature fusion with the (26,26) feature image to obtain the (26,26) convolution feature image as a medium-sized detection head;

[0024] B3, performing feature addition and convolution calculation on the feature image after downsampling the (13,13,160) pooling feature image and the (26,26) convolution feature image, so as to obtain the (13,13) feature image as a small-size detection head;

[0025] B4. Combine the anchor frames obtained from the prediction layers of the large-size detection head, the medium-size detection head and the small-size detection head with the anchor frames obtained by the K-means algorithm, adjust the positions of the anchor frames in the actual images and the heights and widths of the anchor frames, and delete the anchor frames whose prediction scores are lower than the set standard values ​​to obtain the predicted anchor frames of the prediction layers of the large-size detection head, the medium-size detection head and the small-size detection head, and combine the predicted anchor frames of the large-size detection head, the medium-size detection head and the small-size detection head through non-maximum suppression (NMS) to obtain the prediction results.

[0026] Furthermore, in step A1, the (416, 416, 16) image is normalized by 3×3 convolution through image convolution normalization, wherein the image convolution normalization formula is:

[0027]

[0028] Where I is the output image size, W is the input image size, F is the convolution kernel size, P is the padding value, and S is the step size;

[0029] The activation function is:

[0030]

[0031] Where x is the function input, β is the adjustment slope constant, and the expression of ReLU6 is min(max(0,x),6).

[0032] Furthermore, in step S3, the ratio of the training set to the test set is 8:2.

[0033] Furthermore, in step S4, index files are set for the training set and the test set respectively, so that the silkworm detection model obtains the corresponding information image in the training set or the test set according to the index file; the index file includes the silkworm position information and category information of the information image.

[0034] Furthermore, in step S4, the pre-trained model weights are loaded into the silkworm detection model through the VOC dataset.

[0035] Further, in step S4, the initial learning rate of the silkworm detection model is 0.001, and the number of training rounds is 100.

[0036] The beneficial effects of the present invention are:

[0037] The silkworm detection model is established by the YOLOv4 algorithm, and the 5×5 deep separable convolution layer is integrated to perform feature extraction of 5×5 deep convolution. The feature information extracted by the 5×5 deep convolution is integrated with the information extracted by the 3×3 deep convolution to enrich the extracted feature information and improve the silkworm detection accuracy. At the same time, the silkworm detection model is lightweight, and the size of the silkworm detection model can meet the application of dense silkworm data sets on mobile terminals and embedded terminals while improving its detection accuracy. Moreover, the anchor frame obtained by the prediction layer of the detection head is combined with the anchor frame obtained by the K-means algorithm to enhance the extraction of image features. The present invention detects the location and number of silkworms through deep learning, and cooperates with other related breeding equipment to complete the standardized intelligent automatic feeding and breeding of silkworms, thereby improving the breeding rate and survival rate of silkworms. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 It is a flow chart of a silkworm detection method based on deep learning according to a preferred embodiment of the present invention.

[0039] Figure 2 It is a framework diagram of a silkworm detection model of a silkworm detection method based on deep learning in a preferred embodiment of the present invention.

[0040] Figure 3This is a diagram of the silkworm detection model recognition and classification process of a silkworm detection method based on deep learning in a preferred embodiment of the present invention. DETAILED DESCRIPTION

[0041] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0042] It should be noted that when a component is referred to as being "fixed to" another component, it may be directly on the other component or there may also be a component centered. When a component is considered to be "connected to" another component, it may be directly connected to the other component or there may also be a component centered. When a component is considered to be "set on" another component, it may be directly set on the other component or there may also be a component centered. The terms "vertical", "horizontal", "left", "right" and similar expressions used herein are for illustrative purposes only.

[0043] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more related listed items.

[0044] Please also see Figures 1 to 3 The silkworm detection method based on deep learning in a preferred embodiment of the present invention comprises the following steps:

[0045] S1. Collect an overall image of the silkworms raised in the silkworm farm, and mark the position information and category information of the silkworms raised in the overall image. The category information in this embodiment is the age information of the silkworms raised.

[0046] S2. Obtaining a region image corresponding to each position of rearing silkworms, and marking corresponding position information and category information in the region image.

[0047] S3. Modify the size of the regional image to a uniform pixel to obtain an information image. The pixel of the information image in this embodiment is 416×416. Construct a silkworm dataset with the information image, and divide the silkworm dataset into a training set and a test set. The ratio of the training set to the test set is 8:2.

[0048] S4. A silkworm detection model is established based on the YOLOv4 algorithm, and the information images of the training set are input into the silkworm detection model for training to obtain a training model.

[0049] In step S4, index files are set for the training set and the test set respectively, so that the silkworm detection model obtains the information image in the corresponding training set or test set according to the index file; the index file includes the silkworm position information and category information of the information image.

[0050] Among them, the train.txt file is the index file of the training set images, and the test.txt file is the index file of the test set files. The model will find the corresponding images based on this file during training and testing; the xml file is the image annotation file, which contains the location information and category information of the target in the image.

[0051] In this embodiment, the pre-trained model weights are loaded into the silkworm detection model through the VOC data set to speed up the training of the model and improve the accuracy to a certain extent.

[0052] The initial learning rate of the silkworm detection model in this embodiment is 0.001, and the number of training rounds is 100.

[0053] S5. Input the information image of the test set into the training model to obtain the prediction result of the training model to identify the location and number of the reared silkworms.

[0054] In this embodiment, the silkworm detection model includes a backbone feature extraction network, a pyramid pooling structure and a feature fusion layer.

[0055] The backbone feature extraction network outputs a 16-channel image from the input 3-channel image through convolution, and extracts image features from the 16-channel image through 3×3 and 5×5 depth-separable convolutional layers respectively to obtain a feature image.

[0056] The steps for acquiring the feature image of the backbone feature extraction network are:

[0057] A1. Perform 1×1×16 convolution on the (416,416,3) image with 416×416 pixels and 3 channels to obtain a (416,416,16) image. Then, perform activation function calculation on the (416,416,16) image after normalizing it with 3×3 convolution to obtain a (208,208,16) image.

[0058] In A1, the (416, 416, 16) image is normalized by 3×3 convolution through image convolution normalization, where the image convolution normalization formula is:

[0059]

[0060] Where I is the output image size, W is the input image size, F is the convolution kernel size, P is the padding value, and S is the step size;

[0061] The activation function is:

[0062]

[0063] Where x is the function input, β is the adjustment slope constant, and the expression of ReLU6 is min(max(0,x),6).

[0064] The activation function of this embodiment is the h-swish function optimized from the swish function, in which the step size is set to 2, the padding is 1, and the number of output channels is 16. The hswish function can maintain the same accuracy as the swish function and reduce the amount of calculation on the mobile terminal.

[0065] A2. Input the (208,208,16) image into 3×3 and 5×5 depthwise separable convolutional layers respectively for image feature extraction to output feature images with pixels of 13×13, 26×26, and 52×52. The feature images are (13,13,160) images with 13×13 pixels and 160 channels, (26,26,112) images with 26×26 pixels and 112 channels, and (52,52,40) images with 52×52 pixels and 40 channels.

[0066] The depthwise separable convolution of this embodiment can reduce the memory size of the model by reducing the number of model parameters. In addition, a 5×5 depthwise separable convolution layer is added to optimize the model. The multi-scale depthwise separable convolution layer is used to enhance the model's extraction of feature information to compensate for the loss of accuracy.

[0067] The pyramid pooling structure is used for the maximum pooling processing of the feature image to obtain a significant feature image.

[0068] The steps for obtaining the salient feature image of the pyramid pooling structure are as follows: the (13, 13, 160) image is subjected to the maximum pooling layer through four different sizes of convolution kernels of 1, 5, 9, and 11 to fuse the image features, so as to obtain the (13, 13, 160) pooled feature image as the salient feature image, thereby increasing the receptive field and separating the context features.

[0069] The feature fusion layer is used to obtain the detection head by fusing the feature image with the significant feature image, combining the anchor frame obtained by the prediction layer of the detection head with the anchor frame obtained by the K-means algorithm, adjusting the position of the anchor frame in the actual image and the height and width of the anchor frame, and deleting the anchor frame with a prediction score lower than the set standard value to obtain the predicted anchor frame, and combining the predicted anchor frames through non-maximum suppression (NMS) to obtain the prediction result.

[0070] The prediction steps of the feature fusion layer are:

[0071] B1. Upsample the (13,13,160) pooled feature image to obtain (26,26,160) images and (52,52,160) images. Perform feature addition, upsampling, and convolution calculation on the (26,26,160) images and (52,52,160) images and (26,26,112) images and (52,52,40) images in turn to obtain feature images with pixels of (52,52) and (26,26). The (52,52) feature image with larger pixels is used as the large-size detection head.

[0072] B2. Downsample the (52,52) feature image and perform convolution calculation and feature fusion with the (26,26) feature image to obtain the (26,26) convolution feature image as a medium-sized detection head.

[0073] B3. Perform feature addition and convolution calculation on the downsampled (13,13,160) pooled feature image and (26,26) convolutional feature image to obtain the (13,13) feature image as a small-size detection head.

[0074] B4. Combine the anchor frames obtained from the prediction layers of the large-size detection head, the medium-size detection head, and the small-size detection head with the anchor frames obtained by the K-means algorithm, adjust the positions of the anchor frames in the actual images and the height and width of the anchor frames, and delete the anchor frames whose prediction scores are lower than the set standard values ​​to obtain the predicted anchor frames of the prediction layers of the large-size detection head, the medium-size detection head, and the small-size detection head. Combine the predicted anchor frames of the large-size detection head, the medium-size detection head, and the small-size detection head through non-maximum suppression (NMS) to obtain the prediction results. Use the prediction results to identify the position and category of the silkworm according to the position information and category information of the information image.

[0075] In this embodiment, the K-means algorithm extracts the rectangular frames of all pictures in the data set, obtains the height and width data of all training data rectangular frames through data processing, randomly selects 9 of these data as cluster centers, and all other rectangular frames are calculated according to the height and width of these 9 cluster centers, based on the value of the intersection and union ratio (iou) between each anchor frame coordinate point and the cluster center coordinate point as the center distance. The cluster center closest to all rectangular frames and the current 9 cluster centers is classified as the corresponding anchor frame, and after classification, the center coordinates of the 9 classified data are updated to the cluster center calculated next time, and the above operation is repeated continuously. Until the 9 cluster centers remain unchanged, 9 anchor frames suitable for dense object images can be obtained, thereby strengthening the extraction of image features by the silkworm detection model.

[0076] In this embodiment, the prediction results are used to calculate the mAP value using the training model to obtain the silkworm recognition accuracy. The detection accuracy is represented by the AP value and the mAP value. The AP value calculation formula is as follows:

[0077]

[0078]

[0079]

[0080] Where TP represents the object candidate box annotated by the real box and correctly recognized by the model; TN represents the non-object candidate box recognized by the model; FP represents the object candidate box annotated by the real box but not detected by the model; FN represents the non-object candidate box not recognized by the model.

[0081] The mAP value is the average of the sum of AP values ​​of different classes. mAP is calculated as:

[0082]

[0083] Where m is the number of categories in the dataset, AP m It represents the detection accuracy of the model for a certain type of recognized object, while mAP represents the overall detection accuracy of the model for a single or multiple types of recognized objects in the dataset.

[0084] This embodiment belongs to single target recognition, the data set is a small-scale data set, and the target environment is complex, the silkworm density is high, and the recognition difficulty is high. In the deep learning-based silkworm detection method of this embodiment, the mAP reaches 67% (complex and dense silkworm detection), which can meet basic recognition requirements.

[0085] The silkworm identification model of this embodiment adds a multi-scale feature fusion method to complete the detection and identification of VOC2007 general objects and dense silkworms. It proves the feasibility of adding convolution kernels of different sizes to extract dense feature information to improve accuracy. The silkworm identification model has little difference in performance accuracy detection speed with YOLOv4 and MobileNetv3-YOLOv4 on the VOC2007 general data set, and has good stability for common object recognition detection. Compared with MobileNetv3-YOLOv4 in dense silkworm recognition, the accuracy is improved by 1.82%, and the model size is reduced by 74% compared with YOLOv4. Compared with MobileNetv3-YOLOv4, the silkworm identification model is more suitable for mobile and embedded terminals in terms of stability and detection performance of dense objects such as silkworms. The silkworm detection and identification method of the silkworm identification model in this embodiment is close to the actual production of silkworm farms. The model can be used for target detection of densely populated adult silkworms in silkworm farms, and cooperate with other related breeding equipment to complete the standardized, intelligent and automatic feeding and breeding of silkworms. It plays a certain role in reducing the manual and refined processes in the silkworm breeding process, reducing the cost of large-scale monitoring equipment, and improving the breeding rate and survival rate of silkworms, and improving the economic benefits of the silkworm industry.

Claims

1. A silkworm detection method based on deep learning, characterized in that: The following steps are included: S1, collecting an overall image of the raised silkworms in the silkworm farm, and marking the position information and category information of the raised silkworms in the overall image; S2, obtaining a regional image corresponding to each position of the rearing silkworms, and marking corresponding position information and category information in the regional image; S3, modifying the size of the regional image to a uniform pixel to obtain an information image, constructing a silkworm dataset with the information image, and dividing the silkworm dataset into a training set and a test set; S4, establishing a silkworm detection model based on the YOLOv4 algorithm, and inputting the information image of the training set into the silkworm detection model for training to obtain a training model; S5, inputting the information image of the test set into the training model to obtain the prediction result of the training model to identify the location and number of reared silkworms; The silkworm detection model includes a backbone feature extraction network, a pyramid pooling structure and a feature fusion layer. The backbone feature extraction network outputs a 16-channel image by convolution of the input 3-channel image, and extracts image features from the 16-channel image through 3×3 and 5×5 depth-separable convolution layers respectively to obtain a feature image; The pyramid pooling structure is used for maximum pooling processing of the feature image to obtain a significant feature image; The feature fusion layer is used to obtain a detection head by performing feature fusion on the feature image and the significant feature image, combine the anchor frame obtained by the prediction layer of the detection head with the anchor frame obtained by the K-means algorithm, adjust the position of the anchor frame in the actual image and the height and width of the anchor frame, and delete the anchor frame whose prediction score value is lower than the set standard value to obtain a predicted anchor frame, and combine the predicted anchor frames through non-maximum suppression NMS to obtain a prediction result; In step S3, the pixels of the information image are 416×416; The feature image acquisition steps of the backbone feature extraction network are as follows: A1. Perform 1×1×16 convolution on the (416,416,3) image with 416×416 pixels and 3 channels to obtain a (416,416,16) image. Perform activation function calculation on the (416,416,16) image after normalizing it by 3×3 convolution to obtain a (208,208,16) image. A2. Input the (208, 208, 16) image into 3×3 and 5×5 depthwise separable convolutional layers respectively to extract image features, so as to output feature images with pixels of 13×13, 26×26, and 52×52, and the feature images are respectively 13×13 pixels with 160 channels (13, 13, 160) images, 26×26 pixels with 112 channels (26, 26, 112) images, and 52×52 pixels with 40 channels (52, 52, 40) images; The step of obtaining the salient feature image of the pyramid pooling structure is: performing a maximum pooling layer fusion of image features on the (13, 13, 160) image through four different sizes of convolution kernels of 1, 5, 9, and 11, so as to obtain a (13, 13, 160) pooling feature image as the salient feature image; The prediction steps of the feature fusion layer are: B1. Upsample the (13,13,160) pooled feature image to obtain a (26,26,160) image and a (52,52,160) image, perform feature addition, upsampling, and convolution calculation on the (26,26,160) image and the (52,52,160) image and the (26,26,112) image and the (52,52,40) image in sequence to obtain a (52,52) feature image and a (26,26) feature image, and use the (52,52) feature image with larger pixels as a large-size detection head; B2. Downsample the (52,52) feature image and perform convolution calculation and feature fusion with the (26,26) feature image to obtain the (26,26) convolution feature image as a medium-sized detection head; B3, performing feature addition and convolution calculation on the feature image after downsampling the (13,13,160) pooling feature image and the (26,26) convolution feature image, so as to obtain a (13,13) feature image as a small-size detection head; B4. Combine the anchor frames obtained by the prediction layers of the large-size detection head, the medium-size detection head and the small-size detection head with the anchor frames obtained by the K-means algorithm, adjust the positions of the anchor frames in the actual images and the height and width of the anchor frames, and delete the anchor frames whose prediction scores are lower than the set standard values ​​to obtain the predicted anchor frames of the prediction layers of the large-size detection head, the medium-size detection head and the small-size detection head, and combine the predicted anchor frames of the large-size detection head, the medium-size detection head and the small-size detection head through non-maximum suppression (NMS) to obtain the prediction results; In step A1, the (416, 416, 16) image is normalized by 3×3 convolution through image convolution normalization, wherein the image convolution normalization formula is: Formula (1) In the formula, I Output image size, W To enter the image size, F is the convolution kernel size, P is the fill value, S is the step length; The activation function is: Formula (2) In the formula, For function input, To adjust the slope constant, ReLU The expression of 6 is min ( max(0,x ) , 6).

2. A method for detecting silkworms based on deep learning according to claim 1, characterized in that: In step S3, the ratio of the training set to the test set is 8:

2.

3. The method for detecting silkworms based on deep learning according to claim 1, characterized in that: In step S4, index files are set for the training set and the test set respectively, so that the silkworm detection model obtains the corresponding information image in the training set or the test set according to the index file; the index file includes the silkworm position information and category information of the information image.

4. The method for detecting silkworms based on deep learning according to claim 1, characterized in that: In step S4, the pre-trained model weights are loaded into the silkworm detection model through the VOC dataset.

5. The method for detecting silkworms based on deep learning according to claim 1, characterized in that: In step S4, the initial learning rate of the silkworm detection model is 0.001, and the number of training rounds is 100.