Fish head and tail detection method and device based on improved YOLOV3 algorithm

By improving the YOLOV3 algorithm and using the improved Darknet-53 network model to detect the heads and tails of freshwater fish, it solves the problems of low manual operation efficiency and difficult quality assurance in the existing technology, and achieves high-precision and fast fish heads and tails. Detection reduces fish waste.

CN115063577BActive Publication Date: 2025-01-24WUHAN POLYTECHNIC UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210861885.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-21
Publication Date
2025-01-24
Estimated Expiration
2042-07-21

AI Technical Summary

Technical Problem

Existing freshwater fish processing companies rely on manual operations in the process of removing fish heads and tails, resulting in low production efficiency and difficult to guarantee product quality, which cannot meet the large demands of modern production.

Method used

The fish head and tail detection method based on the improved YOLOV3 algorithm is used to obtain the fish body image through the camera, and input it into the trained improved Darknet-53 network model to output the detection results of the fish head and fish tail. The improved network model improves detection accuracy by replacing the Relu activation function with the Mish function.

Benefits of technology

It improves the classification accuracy and recall rate of fish heads and tails, reduces the waste of fish bodies, and enables timely and accurate processing on the assembly line, which is suitable for the need to quickly identify fish heads and tails.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115063577B_ABST
    Figure CN115063577B_ABST
Patent Text Reader

Abstract

The present invention provides a method and device for detecting fish head and tail based on an improved YOLOV3 algorithm, the method comprising: obtaining a fish body image to be processed on an assembly line through a camera; inputting the fish body image into a trained improved Darknet‑53 network model, and outputting the detection results of the fish head and the fish tail; wherein the improved Darknet‑53 network model is a model constructed by replacing the Relu activation function with the Mish function based on the Darknet‑53 network, and is obtained after training according to different sample images with fish heads and tails as labels. The method avoids saturation caused by capping by replacing the trained Darknet‑53 network model with the Darknet‑53 activation function, improves the feature extraction accuracy, greatly improves the classification accuracy and the recall rate, has a very high accuracy, and is conducive to timely processing of the assembly line.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image recognition, and in particular to a fish head and tail detection method and device based on an improved YOLOV3 algorithm. Background Art

[0002] Freshwater fish is an extremely important aquatic product. Common freshwater fish include black carp, grass carp and silver carp. Processing technology is one of the main factors affecting the modernization of the aquatic product processing industry. Among them, the process of removing the head and tail of the fish is the primary link in the processing of freshwater fish. This process can separate the head and tail of the fish from the fish body, reduce the waste rate of the fish body, and increase the efficiency of freshwater fish processing.

[0003] Through investigation and research, it is found that the processing and production methods of freshwater fish processing enterprises are labor-intensive, with mechanized processing equipment and a low degree of automation. At the current processing stage, it mainly relies on manual labor, with low processing efficiency, which easily causes secondary pollution of products. "Three removals" are the main links in the pre-processing of freshwater fish. At present, there are many studies on descaling, and there has been some development and research on methods of removing internal organs. However, the technical research on the removal of heads and tails of freshwater fish is still in its infancy, and is usually mainly handled manually.

[0004] However, manual decapitation has low production efficiency and is related to the operator's proficiency. Product quality is difficult to guarantee and cannot meet the large-scale needs of modern production. Decapitation of fish heads and tails is a major process in pre-processing and affects the entire product processing technology. Summary of the invention

[0005] In view of the problems existing in the prior art, the present invention provides a fish head and tail detection method and device based on an improved YOLOV3 algorithm.

[0006] The present invention provides a fish head and tail detection method based on an improved YOLOV3 algorithm, comprising: obtaining a fish body image to be processed on an assembly line through a camera; inputting the fish body image into a trained improved Darknet-53 network model, and outputting detection results of the fish head and the fish tail; wherein the improved Darknet-53 network model is a model constructed by replacing a Relu activation function with a Mish function based on a Darknet-53 network, and is obtained after training according to different sample images with fish heads and tails as labels.

[0007] According to a method for detecting fish heads and tails based on an improved YOLOV3 algorithm according to an embodiment of the present invention, before obtaining the image of the fish body to be processed on the assembly line through a camera, it also includes: obtaining multiple sample images of each fish body, and receiving the labeling results of the sample images for labeling the fish head and tail to obtain multiple training samples; loading pre-trained weights, using the training samples, pre-training the initial Darknet-53 network to generate a pre-trained Darknet-53 network; after replacing the ReLU activation function of the Darknet-53 network with a Mish activation function, retraining the Darknet-53 network based on the training samples to obtain the trained improved Darknet-53 network model.

[0008] According to a fish head and tail detection method based on an improved YOLOV3 algorithm according to an embodiment of the present invention, the pre-training of the initial Darknet-53 network includes: constructing a stochastic gradient descent SGD optimizer for use in the Darknet-53 network training process, and initializing the parameters of the SGD optimizer; based on the training sample and the SGD optimizer, pre-training the Darknet-53 network.

[0009] According to the fish head and tail detection method based on the improved YOLOV3 algorithm according to one embodiment of the present invention, the retraining of the Darknet-53 network based on the training sample includes: retraining the Darknet-53 network based on the training sample and the SGD optimizer.

[0010] According to a fish head and tail detection method based on an improved YOLOV3 algorithm according to an embodiment of the present invention, after obtaining sample images of various freshwater fish bodies, it also includes: preprocessing the sample images through data enhancement; the data enhancement includes rotation, Gaussian noise enhancement and brightness enhancement.

[0011] The present invention also provides a fish head and tail detection device based on an improved YOLOV3 algorithm, comprising: an acquisition module, used to obtain a fish body image to be processed on an assembly line through a camera; a processing module, used to input the fish body image into a trained improved Darknet-53 network model, and output the detection results of the fish head and the fish tail; wherein the improved Darknet-53 network model is a model constructed based on the Darknet-53 network, by replacing the Relu activation function with the Mish function, and is obtained after training based on different sample images with fish heads and tails as labels.

[0012] According to an embodiment of the present invention, a fish head and tail detection device based on an improved YOLOV3 algorithm also includes a training module, which is used to: obtain multiple sample images of each fish body, and receive the labeling results of the sample images for labeling the fish head and tail to obtain multiple training samples; load pre-trained weights, use the training samples to pre-train the initial Darknet-53 network, and generate a pre-trained Darknet-53 network; replace the ReLU activation function of the Darknet-53 network with a Mish activation function, and then retrain the Darknet-53 network based on the training samples to obtain the trained improved Darknet-53 network model.

[0013] The fish head and tail detection method and device based on the improved YOLOV3 algorithm provided by the present invention obtain a detection network model by replacing the Darknet-53 activation function and training. The Mish activation function is boundless, that is, the positive value can reach any height, and theoretically allows a better gradient flow for the slight negative value, rather than a hard zero boundary like in ReLU, so that the detection accuracy can be improved more effectively than the Relu activation function. Therefore, the method avoids the saturation caused by the capping brought by the Relu function, improves the feature extraction accuracy, and greatly improves the classification accuracy and recall rate of the fish head and tail. Accurate detection of the fish head and tail further avoids the waste of the fish body during processing, so that the method is conducive to the timely and accurate processing of the pipeline. In addition, the model can be realized based on the Darknet-53 network, and the overall model capacity is relatively streamlined, which can be applied to the needs of quickly identifying the fish head and tail on the pipeline, and has the advantages of taking into account both fast detection and high-precision detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0015] Figure 1 It is a flow chart of a fish head and tail detection method based on an improved YOLOV3 algorithm provided by the present invention;

[0016] Figure 2 It is a loss function curve diagram before the improved algorithm provided by the present invention;

[0017] Figure 3 This is an actual detection effect diagram before the improved algorithm provided by the present invention;

[0018] Figure 4 is a loss function curve diagram after the improved algorithm provided by the present invention;

[0019] Figure 5 This is a diagram of the actual detection effect after the improved algorithm provided by the present invention;

[0020] Figure 6 It is one of the recall rate curves after the improved algorithm provided by the present invention;

[0021] Figure 7 This is the second recall rate curve diagram after the improved algorithm provided by the present invention;

[0022] Figure 8 This is one of the accuracy curves after the improved algorithm provided by the present invention;

[0023] Fig. 9 This is the second accuracy curve diagram after the improved algorithm provided by the present invention;

[0024] Fig.10 It is a structural schematic diagram of a fish head and tail detection device based on an improved YOLOV3 algorithm provided by the present invention;

[0025] Fig.11 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0026] At present, providing an advanced and intelligent automated head and tail removal processing equipment to improve the automation of processing equipment has become an urgent hope for many aquatic product processing companies. In recent decades, as an emerging detection technology, machine vision has become more and more widely used in industrial and agricultural applications. Due to its high processing efficiency and good production quality, it also has huge development and application space in the aquatic product processing chain, such as fish species identification and weight detection. After realizing the application advantages of machine vision, more and more domestic and foreign scholars have begun to use machine vision to carry out fish directional detection, species identification, etc., but the detection of fish heads and tails is still not perfect.

[0027] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are 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.

[0028] Combine the following Figure 1-Figure 11 The present invention describes a fish head and tail detection method and device based on an improved YOLOV3 algorithm. Figure 1: is a flow chart of a fish head and tail detection method based on an improved YOLOV3 algorithm provided by the present invention, such as Figure 1 As shown, the present invention provides a fish head and tail detection method based on an improved YOLOV3 algorithm, comprising:

[0029] 101. The image of the fish to be processed on the assembly line is obtained through a camera.

[0030] The fish image to be processed on the pipeline is obtained. This may include the steps of performing relevant preprocessing on the fish image, such as processing the image size to 416*416 to adapt to the Darknet-53 network model processing.

[0031] 102. Input the fish body image into the trained improved Darknet-53 network model, and output the detection results of the fish head and the fish tail.

[0032] Among them, the improved Darknet-53 network model is a model constructed based on the Darknet-53 network, in which the Relu function is replaced by the Mish function, and is obtained after training with different sample images with fish heads and tails as labels.

[0033] Specifically, DarkNet-53 borrows the idea of ​​ResNet from the previous ones and uses a large number of residual connections in the network. Therefore, the network structure can be designed to be very deep, and the problem of gradient disappearance during training is alleviated, making the model easier to converge. At the same time, a convolutional layer with a step size of 2 is used instead of a pooling layer to achieve downsampling. Experiments were conducted on ImageNet and found that compared with ResNet-152 and ResNet-101, DarkNet53 has achieved a leading computing speed under the premise of similar classification accuracy.

[0034] However, the present invention takes into account that directly applying the Darknet-53 network model to detect fish heads and tails has low accuracy. The present invention replaces the activation function Relu function (or leaky_Relu function) of the residual block of the Darknet network layer of the backbone network of the Darknet-53 network model with the Mish function to obtain an improved Darknet-53 network model.

[0035] The present invention replaces the original ReLU activation function of the network with the Mish function, because the Mish activation function can improve its detection accuracy more effectively than the Relu activation function, and the Mish activation function is unbounded (i.e., positive values ​​can reach any height) to avoid saturation due to capping. In theory, slight tolerance to negative values ​​allows better gradient flow, rather than a hard zero boundary like in ReLU.

[0036] Optionally, the formula for the Mish activation function is as follows:

[0037] Mish = x*tanh(ln(1+e^(x))

[0038] Here, x refers to the input image.

[0039] After the above improvements are made to the Darknet-53 network model, training is performed based on a large number of sample images with labeled fish heads and tails to obtain the above trained improved Darknet-53 network model. The specific improved Darknet-53 network model is constructed based on the Darknet-53 network model by replacing the Relu function with the Mish function. Specifically, it can be an improved YOLOv3 network model, including an input layer, an improved DarkNet-53 network and three output branches, the three output branches are respectively denoted as y1, y2, and y3. It can also be other network models constructed based on the Darknet-53 network model by replacing the Relu function with the Mish function, such as a network including the first 52 feature extraction layers and a fully connected layer of Darknet-53. The embodiment of the present invention does not specifically limit the form of the improved Darknet-53 network model.

[0040] On the basis of the above, in step 102, the fish body image to be detected obtained in 101, such as a 416×416 fish body image to be detected, is input into the trained improved Darknet-53 network model. After continuous feature extraction, the improved Darknet-53 network model that is finally trained can output the recognition result of the fish body and tail. The specific output result can be the detection box of the fish head and tail.

[0041] The fish head and tail detection method based on the improved YOLOV3 algorithm provided by the present invention obtains a detection network model by replacing the Darknet-53 activation function and training. The Mish activation function is boundless, that is, the positive value can reach any height, and theoretically allows a better gradient flow for the slight negative value, rather than a hard zero boundary like in ReLU, so that the detection accuracy can be improved more effectively than the Relu activation function. Therefore, the method avoids the saturation caused by the capping brought by the Relu function, improves the feature extraction accuracy, and greatly improves the classification accuracy and recall rate of the fish head and tail. Accurate detection of the fish head and tail further avoids the waste of the fish body during processing, so that the method is conducive to the timely and accurate processing of the pipeline. In addition, the model can be realized based on the Darknet-53 network, and the overall model capacity is relatively streamlined, which can be applied to the needs of quickly identifying the fish head and tail on the pipeline, and has the advantages of taking into account both fast detection and high-precision detection.

[0042] In one embodiment, before obtaining the image of the fish body to be processed on the pipeline through the camera, it also includes: obtaining multiple sample images of each fish body, and receiving the labeling results of the sample images for labeling the fish head and tail, to obtain multiple training samples; loading pre-trained weights, using the training samples, pre-training the initial Darknet-53 network to generate a pre-trained Darknet-53 network; after replacing the ReLU activation function of the Darknet-53 network with the Mish activation function, retraining the Darknet-53 network based on the training samples to obtain the trained improved Darknet-53 network model.

[0043] First, training samples are determined. Considering the diversity of detected fish types, the present invention obtains sample images for each type of fish according to the different types of fish to be detected, and obtains multiple sample images for each type of fish. For freshwater fish, sample images of multiple freshwater fish are obtained, and multiple sample images are obtained for each type of freshwater fish. By manually annotating the sample images with fish heads and tails, labeled training samples are obtained.

[0044] In an embodiment of the present invention, the existing Darknet-53 network is pre-trained by training samples. First, pre-trained weights are loaded based on the existing Darknet-53 network. The pre-trained weights can be weights after training of other similar networks, thereby avoiding the problem of multiple training required for random initialization of weights. Secondly, based on the training samples, the Darknet-53 network with pre-trained weights loaded and the activation function is the Relu activation function is preliminarily trained, that is, the pre-training mentioned above. The specific training method can refer to the prior art. This step generates a pre-trained Darknet-53 network.

[0045] Then, after replacing the ReLU activation function of the Darknet-53 network with the Mish activation function, the pre-trained Darknet-53 network is retrained based on the above training samples to obtain the improved Darknet-53 network model after the above training.

[0046] In the embodiment of the present invention, the fully connected layer of the DarkNet-53 network is pre-trained to assign corresponding weights, which is conducive to better feature extraction. Secondly, for the freshwater fish image data set including the sample image, the activation function of the network is modified, and the ReLU activation function is replaced by Mish, which can ensure that there is no saturation area, so there will be no problem of gradient disappearance during the training process. If there is a lower limit, it can ensure a certain regularization effect (regularization effect), which can improve the network classification accuracy.

[0047] The fish head and tail detection method based on the improved YOLOV3 algorithm of the embodiment of the present invention pre-trains the existing Darknet-53 network and utilizes the advantages of the ReLU activation function, which can make the network training speed faster. After meeting the pre-training conditions, the ReLU activation function is replaced with Mish for re-training, which can avoid the problems of slow model convergence and easy gradient explosion, and improve the detection accuracy of the improved Darknet-53 network model to obtain accurate fish head and fish tail detection results.

[0048] In one embodiment, the pre-training of the initial Darknet-53 network includes: constructing an SGD optimizer for the Darknet-53 network training process and initializing the parameters of the SGD optimizer; and pre-training the Darknet-53 network based on the training sample and the SGD optimizer, wherein the parameters include a learning rate, momentum, and a weight decay coefficient.

[0049] In one embodiment, retraining the Darknet-53 network based on the training samples includes: retraining the Darknet-53 network based on the training samples and the SGD optimizer.

[0050] In the embodiment of the present invention, the SGD optimizer is used in the model training process. SGD is an implementation of the gradient descent algorithm. When solving the minimum value of the loss function, the gradient descent method can be used to iterate step by step to obtain the minimized loss function and the optimal model parameter value. The Darknet-53 network is pre-trained and re-trained by the SGD optimizer, which can significantly improve the training speed and reduce memory overhead.

[0051] In one embodiment, after obtaining sample images of various freshwater fish bodies, the method further includes: preprocessing the sample images by data enhancement; the data enhancement includes rotation, Gaussian noise enhancement and brightness enhancement.

[0052] First, various freshwater fish images taken by the camera are selected, and then the images are preprocessed through data enhancement. Data enhancement processing includes rotation, Gaussian noise enhancement, and brightness enhancement. Then, the data-enhanced images are manually annotated to generate a preprocessed freshwater fish image dataset.

[0053] The fish head and tail detection method based on the improved YOLOV3 algorithm in the embodiment of the present invention adopts data enhancement processing. Even when the number of samples is small, sufficient image data sets can be obtained for training, and the diversity of input samples is increased, thereby improving the detection accuracy of the trained model.

[0054] The advantages of the above embodiments of the present invention can be further seen in the accompanying drawings, Figure 2 is a loss function curve diagram before the improved algorithm provided by the present invention, Figure 3 It is an actual detection effect diagram before the improved algorithm provided by the present invention. Both show the loss function curve and actual detection effect without improving the activation function of the Darknet-53 network. Figure 4 is a loss function curve diagram after the improved algorithm provided by the present invention, Figure 5 This is a diagram of the actual detection effect after the improved algorithm provided by the present invention. As shown in the figure, by replacing the Relu activation function with the model constructed by the Mish function, the loss function is significantly reduced in the early stage of iteration and the accuracy is also significantly improved. Figure 6 is one of the recall rate curves after the improved algorithm provided by the present invention. Figure 7 This is the second recall rate curve diagram after the improved algorithm provided by the present invention. Figure 8 This is one of the accuracy curves after the improved algorithm provided by the present invention. Fig. 9 This is the second accuracy curve diagram after the improved algorithm provided by the present invention. Figures 6 to 9 It can be seen that the recall rate and precision rate of the fish head and fish tail change with the change of the Score Threshold parameter.

[0055] The fish head and tail detection device based on the improved YOLOV3 algorithm provided by the present invention is described below. The fish head and tail detection device based on the improved YOLOV3 algorithm described below and the fish head and tail detection method based on the improved YOLOV3 algorithm described above can refer to each other.

[0056] Fig.10 : is a structural schematic diagram of a fish head and tail detection device based on an improved YOLOV3 algorithm provided by the present invention, such as Fig.10 As shown, the fish head and tail detection device based on the improved YOLOV3 algorithm includes: an acquisition module 1001 and a processing module 1002. The acquisition module 1001 is used to obtain the image of the fish body to be processed on the assembly line through a camera; the processing module 1002 is used to input the fish body image into the trained improved Darknet-53 network model, and output the detection results of the fish head and the fish tail; wherein the improved Darknet-53 network model is a model constructed by replacing the Relu activation function with the Mish function based on the Darknet-53 network, and is obtained after training according to different sample images with fish heads and fish tails as labels.

[0057] In one embodiment of the device, it also includes a training module, which is used to: obtain multiple sample images of each fish body, and receive the labeling results of the sample images for labeling the fish head and tail, so as to obtain multiple training samples; load pre-trained weights, and use the training samples to pre-train the initial Darknet-53 network to generate a pre-trained Darknet-53 network; after replacing the ReLU activation function of the Darknet-53 network with the Mish activation function, retrain the Darknet-53 network based on the training samples to obtain the trained improved Darknet-53 network model.

[0058] In one device embodiment, the training module is also used to: construct a stochastic gradient descent SGD optimizer for use in the Darknet-53 network training process, and initialize the parameters of the SGD optimizer; pre-train the Darknet-53 network based on the training samples and the SGD optimizer; wherein the parameters include learning rate, momentum and weight decay coefficient.

[0059] In one device embodiment, the training module is also used to: retrain the Darknet-53 network based on the training samples and the SGD optimizer.

[0060] The device embodiments provided in the embodiments of the present invention are for implementing the above-mentioned method embodiments. For specific processes and detailed contents, please refer to the above-mentioned method embodiments, which will not be repeated here.

[0061] The fish head and tail detection device based on the improved YOLOV3 algorithm provided in the embodiment of the present invention has the same implementation principle and technical effects as the aforementioned fish head and tail detection method embodiment based on the improved YOLOV3 algorithm. For the sake of brief description, for parts not mentioned in the embodiment of the fish head and tail detection device based on the improved YOLOV3 algorithm, reference may be made to the corresponding contents in the aforementioned fish head and tail detection method embodiment based on the improved YOLOV3 algorithm.

[0062] Fig.11 is a schematic diagram of the structure of the electronic device provided by the present invention, such as Fig.11As shown, the electronic device may include: a processor 1101, a communication interface 1102, a memory 1103 and a communication bus 1104, wherein the processor 1101, the communication interface 1102 and the memory 1103 communicate with each other through the communication bus 1104. The processor 1101 may call the logic instructions in the memory 1103 to execute a fish head and fish tail detection method based on an improved YOLOV3 algorithm, the method comprising: obtaining a fish body image to be processed on an assembly line through a camera; inputting the fish body image into a trained improved Darknet-53 network model, and outputting the detection results of the fish head and fish tail; wherein the improved Darknet-53 network model is a model constructed based on the Darknet-53 network by replacing the Relu activation function with the Mish function, and is obtained after training according to different sample images with fish heads and fish tails as labels.

[0063] In addition, the logic instructions in the above-mentioned memory 1103 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0064] On the other hand, the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the fish head and tail detection method based on the improved YOLOV3 algorithm provided by the above methods, and the method includes: obtaining the image of the fish body to be processed on the assembly line through a camera; inputting the fish body image into the trained improved Darknet-53 network model, and outputting the detection results of the fish head and fish tail; wherein the improved Darknet-53 network model is a model constructed based on the Darknet-53 network, replacing the Relu activation function with the Mish function, and is obtained after training with different sample images with fish heads and tails as labels.

[0065] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the fish head and tail detection method based on the improved YOLOV3 algorithm provided in the above-mentioned embodiments, the method comprising: obtaining an image of a fish body to be processed on an assembly line through a camera; inputting the fish body image into a trained improved Darknet-53 network model, and outputting the detection results of the fish head and fish tail; wherein the improved Darknet-53 network model is a model constructed based on the Darknet-53 network, by replacing the Relu activation function with the Mish function, and is obtained after training with different sample images with fish heads and tails as labels.

[0066] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0067] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0068] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A fish head and tail detection method based on an improved YOLOV3 algorithm, characterized in that: include: The image of the fish to be processed on the production line is obtained through the camera; Input the fish body image into the trained improved Darknet-53 network model, and output the detection results of the fish head and the fish tail; The improved Darknet-53 network model is a model constructed by replacing the Relu activation function with the Mish function based on the Darknet-53 network, and is obtained after training with different sample images with fish heads and tails as labels; Before obtaining the image of the fish body to be processed on the assembly line through the camera, the method further includes: Acquire multiple sample images of each fish body, and receive the labeling results of the fish head and tail labeling of the sample images to obtain multiple training samples; Loading pre-trained weights, using the training samples, pre-training the initial Darknet-53 network to generate a pre-trained Darknet-53 network; After replacing the ReLU activation function of the Darknet-53 network with the Mish activation function, the Darknet-53 network is retrained based on the training samples to obtain the trained improved Darknet-53 network model.

2. The fish head and tail detection method based on the improved YOLOV3 algorithm according to claim 1 is characterized in that: The pre-training of the initial Darknet-53 network includes: Construct a stochastic gradient descent (SGD) optimizer for the Darknet-53 network training process and initialize the parameters of the SGD optimizer; Based on the training samples and the SGD optimizer, the Darknet-53 network is pre-trained.

3. The fish head and tail detection method based on the improved YOLOV3 algorithm according to claim 2 is characterized in that: The retraining of the Darknet-53 network based on the training sample comprises: Based on the training samples and the SGD optimizer, the Darknet-53 network is retrained.

4. The fish head and tail detection method based on the improved YOLOV3 algorithm according to claim 1 is characterized in that: After obtaining sample images of multiple freshwater fish bodies, the method further includes: Preprocessing the sample image by data enhancement; The data enhancement includes rotation, Gaussian noise enhancement and brightness enhancement.

5. A fish head and tail detection device based on an improved YOLOV3 algorithm, characterized in that: include: An acquisition module is used to obtain images of fish bodies to be processed on the production line through a camera; A processing module, used for inputting the fish body image into the trained improved Darknet-53 network model, and outputting the detection results of the fish head and the fish tail; The improved Darknet-53 network model is a model constructed by replacing the Relu activation function with the Mish function based on the Darknet-53 network, and is obtained after training with different sample images with fish heads and tails as labels; Also includes training modules for: Acquire multiple sample images of each fish body, and receive the labeling results of the fish head and tail labeling of the sample images to obtain multiple training samples; Loading pre-trained weights, using the training samples, pre-training the initial Darknet-53 network to generate a pre-trained Darknet-53 network; After replacing the ReLU activation function of the Darknet-53 network with the Mish activation function, the Darknet-53 network is retrained based on the training samples to obtain the trained improved Darknet-53 network model.

6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the fish head and tail detection method based on the improved YOLOV3 algorithm as described in any one of claims 1 to 4 is implemented.

7. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the fish head and tail detection method based on the improved YOLOV3 algorithm as described in any one of claims 1 to 4 is implemented.

8. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the fish head and tail detection method based on the improved YOLOV3 algorithm as described in any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • Polyculture fish school behavior detection method, device and system based on YOLOv3-Lite

    CN112634202A

  • Palmprint region dividing device and palmprint region dividing method thereof, and palmprint region dividing program

    US20020141620A1