Aquatic organism image recognition and counting method, device, equipment and medium
By introducing a deep learning model with multi-scale feature fusion, adaptive pooling, and spatial pyramid pooling techniques, the problems of feature information loss and high false negative rate in the detection of densely distributed small targets are solved, and the rapid and accurate localization and counting of targets in aquatic organism images are achieved.
Patent Information
- Application Number
- CN202510132086.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-06
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2045-02-06
AI Technical Summary
Traditional target detection algorithms suffer from severe loss of feature information, decreased detection accuracy, and high false negative rate when dealing with densely distributed small targets such as clam larvae, making it difficult to achieve accurate identification and counting.
A convolutional neural network employing multi-scale feature fusion, adaptive pooling, and spatial pyramid pooling techniques, combined with a dense detection head, is used to preprocess and postprocess aquatic organism images through a deep learning model. The loss function and hyperparameters are optimized, and an improved non-maximum suppression strategy is used to distinguish adjacent targets.
It enables rapid and accurate localization and counting of targets in densely distributed aquatic organism images, significantly reducing missed detections and false detections, and improving detection accuracy and efficiency.
Smart Images

Figure CN119964155B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image recognition counting, in particular to a water organism image recognition counting method, device, equipment and medium. BACKGROUND
[0002] The clams are usually partially aggregated in the natural environment, and the proportion of a single larva in the microscope image is extremely small, which poses a great challenge to its automatic recognition and counting. The traditional target detection algorithm has the following main problems when dealing with these densely distributed small targets:
[0003] Loss of feature information: In the convolutional neural network, the role of the pooling layer is to reduce the data dimension and the amount of calculation, but it will also cause the feature information of the small target to be weakened layer by layer. Especially for the larva with an extremely small proportion in the image, its feature information may be severely lost after multiple pooling operations, resulting in a decrease in detection accuracy.
[0004] Detection of densely distributed objects: Many current target detection algorithms perform poorly when dealing with densely distributed objects. These algorithms usually rely on the obvious features of a single target, but in the case of densely distributed clam larvae, the distance between the targets is close and the mutual occlusion is serious, making it difficult for the detection algorithm to distinguish and identify each individual target, resulting in a high comprehensive missed detection rate.
[0005] Missed detection problem: Due to the above two reasons, the traditional target detection algorithm often has a high missed detection rate when dealing with densely distributed small targets. Missed detection not only affects the accuracy of recognition, but also brings great inconvenience to subsequent quantity statistics and data analysis. SUMMARY
[0006] The present application provides a water organism image recognition counting method, device, equipment and medium to solve the problems of feature information loss, poor detection of densely distributed objects, and high missed detection rate in related technologies.
[0007] The first aspect of the present application provides a water organism image recognition counting method, comprising the following steps: acquiring a water organism image input by a user, and preprocessing the water organism image; inputting the preprocessed water organism image into a target detection model based on deep learning, and outputting a detection result of a target water organism in the water organism image by the target detection model, wherein the target detection model comprises a feature extraction network introducing a multi-scale feature fusion technology, a convolutional neural network adopting adaptive pooling and spatial pyramid pooling technology, and a dense detection head for densely distributed target detection; post-processing the detection result of the target water organism, and identifying the number of target water organisms and the position of the target water organisms in the water organism image according to the post-processed detection result.
[0008] Optionally, the feature extraction network extracts feature maps at different levels from the aquatic organism image. During the feature extraction process, multi-scale feature fusion technology is used to fuse the feature maps at different levels. The convolutional neural network uses adaptive pooling and spatial pyramid pooling techniques to perform pooling operations on the fused feature maps, completing the prediction of category and location in a single forward propagation. The dense detection head identifies multiple target aquatic organisms in the feature maps after pooling operations and distinguishes adjacent target aquatic organisms among multiple target aquatic organisms by improving the non-maximum suppression strategy.
[0009] Optionally, before inputting the preprocessed aquatic organism images into the deep learning-based target detection model, the method further includes: obtaining a training set, which includes multiple aquatic organism images labeled with target aquatic organisms; expanding the training set through data augmentation techniques; training the target detection model using the expanded training set; and optimizing the loss function and adjusting the hyperparameters during the training process.
[0010] Optionally, data augmentation techniques include at least one operation of rotating, scaling, and translating multiple aquatic organism images labeled with the target aquatic organism.
[0011] Optionally, acquiring the aquatic organism image input by the user includes: receiving the aquatic organism image input by the user using a graphical user interface developed using the PyQt framework.
[0012] Optionally, the graphical user interface can also be used to display the number of target aquatic organisms and their location in the aquatic organism image.
[0013] Optionally, the preprocessing methods include at least one of image resizing, color space conversion, and noise removal.
[0014] A second aspect of this application provides an aquatic organism image recognition and counting device, comprising: an acquisition module for acquiring a user-input aquatic organism image and preprocessing the aquatic organism image; an input module for inputting the preprocessed aquatic organism image into a deep learning-based target detection model, wherein the target detection model outputs the detection results of target aquatic organisms in the aquatic organism image, wherein the target detection model includes a feature extraction network incorporating multi-scale feature fusion technology, a convolutional neural network employing adaptive pooling and spatial pyramid pooling technology, and a dense detection head for densely distributed target detection; and a processing module for post-processing the detection results of target aquatic organisms and identifying the number of target aquatic organisms and their positions in the aquatic organism image based on the post-processed detection results.
[0015] A third aspect of this application provides an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the aquatic organism image recognition and counting method as described in the above embodiments.
[0016] A fourth aspect of this application provides a computer-readable storage medium having a computer program stored thereon, which is executed by a processor to implement the aquatic organism image recognition and counting method as described in the above embodiments.
[0017] Therefore, this application has the following beneficial effects:
[0018] This application embodiment acquires user-input aquatic organism images, preprocesses them, and inputs the preprocessed images into a deep learning-based target detection model. The model outputs the detection results of target aquatic organisms in the images. Post-processing is then applied to these detection results to identify the number and location of target aquatic organisms within the images. This enables rapid statistical analysis and precise localization of the number and growth characteristics of clam larvae in the images, reducing false negatives and false negatives. Therefore, it solves problems such as loss of relevant technical feature information, poor detection of densely distributed objects, and high false negative rates.
[0019] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description
[0020] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein:
[0021] Figure 1 This is a flowchart of an aquatic organism image recognition and counting method provided according to an embodiment of this application;
[0022] Figure 2 This is a flowchart of the YOLO v8 base algorithm according to an embodiment of this application;
[0023] Figure 3 This is a flowchart illustrating the application of an algorithm according to an embodiment of this application;
[0024] Figure 4 This is a diagram showing the test results of clam larvae according to an embodiment of this application;
[0025] Figure 5 This is a comparison chart of the training curves of Mussel-ID and YOLO v8 according to an embodiment of this application;
[0026] Figure 6 This is a graph showing the changing trends of the loss function and performance metrics during the training and validation process of a model according to an embodiment of this application.
[0027] Figure 7 This is an example diagram of an aquatic organism image recognition and counting device provided according to an embodiment of this application;
[0028] Figure 8 This is a schematic diagram of the structure of an electronic device provided according to an embodiment of this application. Detailed Implementation
[0029] The embodiments of this application are described in detail below. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application.
[0030] The following describes an aquatic organism image recognition and counting method, apparatus, device, and medium according to embodiments of this application with reference to the accompanying drawings. Addressing the problems mentioned in the background art, such as loss of relevant technical feature information, poor detection of densely distributed objects, and high false negative rates, this application provides an aquatic organism image recognition and counting method. In this method, an aquatic organism image input by a user is acquired, and the image is preprocessed. The preprocessed image is then input into a deep learning-based target detection model. The model outputs the detection results of target aquatic organisms in the image. The detection results are then post-processed, and the number and location of target aquatic organisms in the image are identified based on the post-processed detection results. This enables rapid statistical analysis and accurate localization of the number and growth characteristics of clam larvae in the image, reducing false negatives and false negatives. Thus, the problems of loss of relevant technical feature information, poor detection of densely distributed objects, and high false negative rates are solved.
[0031] Specifically, Figure 1 This is a flowchart illustrating an aquatic organism image recognition and counting method provided in an embodiment of this application.
[0032] like Figure 1 As shown, the aquatic organism image recognition and counting method includes the following steps:
[0033] In step S101, the aquatic organism image input by the user is acquired and preprocessed.
[0034] The preprocessing methods will be described in detail below and will not be repeated here.
[0035] In this embodiment of the application, obtaining aquatic organism images input by the user includes: receiving aquatic organism images input by the user using a graphical user interface developed using the PyQt framework.
[0036] PyQt is a Python binding library for creating graphical user interfaces. It encapsulates the functionality of the Qt library, which is a cross-platform C++ library widely used for developing desktop applications and touch user interfaces.
[0037] It is understood that, in order to facilitate user operation, this application provides an intuitive and user-friendly graphical user interface developed using the PyQt framework, which can receive aquatic organism images input by the user.
[0038] In this embodiment of the application, the graphical user interface is also used to display the number of target aquatic organisms and the location of the target aquatic organisms in the aquatic organism image.
[0039] It is understood that, through the graphical user interface developed based on the PyQt framework, the embodiments of this application allow users to not only upload images of aquatic organisms to be analyzed, but also to directly view the processed results on the interface. The results show the number of target aquatic organisms and their positions in the aquatic organism images.
[0040] In the embodiments of this application, the preprocessing methods include at least one of image resizing, color space conversion, and noise removal.
[0041] Image resizing involves adjusting the image to a size suitable for the model input; color space conversion involves converting the image to a color space suitable for object detection, such as converting from RGB to grayscale or HSV; and noise removal involves removing noise from the image through filtering and other methods to improve image quality.
[0042] It is understood that the embodiments of this application preprocess the aquatic organism image, including methods such as image size adjustment, color space conversion and noise removal, to adjust the size of the aquatic organism image to a size suitable for the model input, change the color representation of the image, and eliminate unnecessary random points or patches in the image, so as to obtain a preprocessed image that is convenient for analysis.
[0043] In step S102, the preprocessed aquatic organism image is input into a deep learning-based target detection model, and the target detection model outputs the detection results of the target aquatic organism in the aquatic organism image. The target detection model includes a feature extraction network that incorporates multi-scale feature fusion technology, a convolutional neural network that uses adaptive pooling and spatial pyramid pooling technology, and a dense detection head for densely distributed target detection.
[0044] Among them, multi-scale feature fusion technology constructs richer feature representations by combining low-level detail information and high-level semantic information, thereby improving the perception ability of small targets; the feature extraction network is the first layer of the model, which adopts multi-scale feature fusion technology and is responsible for extracting useful feature information from the input image; adaptive pooling and spatial pyramid pooling are two techniques used to process feature maps of convolutional neural networks, which help improve the performance of the model; convolutional neural networks use convolution operations to automatically learn complex patterns in images.
[0045] It is understood that the target detection model in this application embodiment includes a feature extraction network that incorporates multi-scale feature fusion technology, a convolutional neural network that employs adaptive pooling and spatial pyramid pooling technology, and a dense detection head for densely distributed target detection. By inputting the preprocessed aquatic organism image into the deep learning-based target detection model, accurate detection of target aquatic organisms in the aquatic organism image can be achieved.
[0046] In this embodiment, the feature extraction network extracts feature maps at different levels from the aquatic organism image. During the feature extraction process, multi-scale feature fusion technology is used to fuse the feature maps at different levels. The convolutional neural network uses adaptive pooling and spatial pyramid pooling techniques to perform pooling operations on the fused feature maps, completing the prediction of category and location in a single forward propagation. The dense detection head identifies multiple target aquatic organisms in the feature map after pooling operations and distinguishes adjacent target aquatic organisms among multiple target aquatic organisms by improving the non-maximum suppression strategy.
[0047] The improved non-maximum suppression strategy addresses the issue that during target detection, numerous candidate boxes are generated at the same target location, and these candidate boxes may overlap. In this case, non-maximum suppression is used to find the optimal target bounding box and eliminate redundant bounding boxes. Specifically, it includes the following steps:
[0048] a) Sort according to confidence score;
[0049] b) Select the bounding box with the highest confidence level and add it to the final output list, then remove it from the bounding box list;
[0050] c) Calculate the area of all bounding boxes;
[0051] d) Calculate the IoU between the bounding box with the highest confidence and other candidate boxes;
[0052] e) Delete bounding boxes with IoU greater than the threshold;
[0053] f) Repeat the above process until the bounding box list is empty.
[0054] IoU (intersection-over-union) is the intersection of two bounding boxes divided by their union.
[0055] It is understood that when the preprocessed aquatic organism image is input into the deep learning-based target detection model in the embodiments of this application, the feature extraction network first analyzes it, extracts feature maps of different levels, and then uses multi-scale feature fusion technology to fuse the feature maps of different levels. The fused feature map is then input into the convolutional neural network, and optimized through adaptive pooling and spatial pyramid pooling techniques. At the same time, in a single forward propagation, the category and location of each target aquatic organism are predicted. Finally, a dense detection head is used to identify multiple target aquatic organisms, and an improved non-maximum suppression strategy is used to distinguish adjacent target aquatic organisms, providing high-precision and reliable detection results.
[0056] In this embodiment, before inputting the preprocessed aquatic organism images into the deep learning-based target detection model, the method further includes: acquiring a training set, which includes multiple aquatic organism images labeled with target aquatic organisms; expanding the training set through data augmentation techniques; training the target detection model using the expanded training set; and optimizing the loss function and adjusting hyperparameters during the training process. Based on the mapping function relationships in Table 1, this embodiment tests the optimization effects of different functions and ultimately selects the Guass function as the optimal loss function. The selected hyperparameters are shown in Table 2. Table 1 is the table corresponding to the function expressions selected for the optimized loss function, and Table 2 is the training hyperparameter configuration table.
[0057] Table 1
[0058]
[0059] Table 2
[0060]
[0061] Data augmentation techniques refer to the use of data augmentation techniques to expand the original training set in order to improve the generalization ability and robustness of the model. The specific methods will be described in detail below and will not be repeated here.
[0062] It is understood that, before inputting the preprocessed aquatic organism images into the deep learning-based target detection model, this application embodiment first needs to construct a high-quality training set. This training set consists of multiple aquatic organism images labeled with target aquatic organisms. Furthermore, in order to increase the diversity of training data and improve the generalization ability of the model, data augmentation techniques are used to expand the original training set, generating more training samples. Using the expanded training set, the target detection model can be trained more effectively. During the training phase, the loss function is continuously optimized to ensure that the model output is as close as possible to the actual annotation information. At the same time, hyperparameters are adjusted to improve the model's performance, ultimately achieving efficient and accurate identification of target aquatic organisms in aquatic organism images.
[0063] In this application embodiment, the data augmentation technology includes at least one operation of rotating, scaling, and translating multiple aquatic organism images labeled with target aquatic organisms.
[0064] It is understood that the data augmentation technology in this application involves performing various transformations on the image, such as rotation, scaling, and translation, to generate more diverse samples, thereby enabling the model to maintain good performance when faced with images under different conditions.
[0065] In step S103, the detection results of the target aquatic organisms are post-processed, and the number of target aquatic organisms and their positions in the aquatic organism image are identified based on the post-processed detection results.
[0066] Post-processing refers to the process of further improving the initial detection results, such as bounding boxes, class labels, and confidence scores, after the model generates them. The purpose is to remove redundancy, correct errors, and improve the quality of the final output.
[0067] It is understood that after the target detection model outputs the detection results of target aquatic organisms in the aquatic organism image, the embodiments of this application still need to perform post-processing operations to optimize the original detection results. After post-processing, the number of target aquatic organisms in the image can be more accurately identified and counted, and the precise location of each target in the aquatic organism image can be identified.
[0068] The aquatic organism image recognition and counting method proposed in this application acquires aquatic organism images input by the user, preprocesses the aquatic organism images, inputs the preprocessed aquatic organism images into a target detection model based on deep learning, the model outputs the detection results of target aquatic organisms in the aquatic organism images, the detection results of target aquatic organisms are postprocessed, and the number of target aquatic organisms and the position of target aquatic organisms in the aquatic organism images are identified based on the postprocessed detection results. This method can achieve rapid statistics and accurate positioning of the number and growth characteristics of clam larvae in the images, reducing missed detections and false detections.
[0069] The following is a further description of the aquatic organism image recognition and counting method through a specific embodiment.
[0070] The algorithm involved in this embodiment is mainly based on the deep learning-based Mussel-ID model, used for image recognition and counting of Mussel-ID larvae. Mussel-ID is an end-to-end target detection algorithm suitable for handling complex image scenes. Figure 3 As shown, the basic algorithm is as follows:
[0071] 1. Multi-scale feature fusion
[0072] To address the issue that small targets occupy a small portion of an image and their features are easily overlooked, this algorithm introduces a multi-scale feature fusion mechanism based on Mussel-ID. Multi-scale feature fusion ensures that even subtle feature information is fully utilized by preserving and fusing feature maps at different levels within the model, thereby improving the detection capability of small targets.
[0073] 2. Improved pooling operation
[0074] In traditional convolutional neural networks, pooling operations often lead to the loss of feature information for small targets. To address this issue, this algorithm employs adaptive pooling and spatial pyramid pooling (SPPF) techniques in the pooling layer. These techniques adaptively adjust the size of the pooling window or perform pooling operations at different scales to preserve key information about small targets as much as possible, thus enabling the capture of these small targets in subsequent detection processes.
[0075] 3. Detection strategies for densely distributed targets
[0076] Clams typically appear densely distributed in images, posing a challenge to traditional object detection algorithms. To address this issue, the algorithm introduces a dense detection head, increasing the detection layer in the network to improve the model's ability to recognize dense targets. Furthermore, by improving the non-maximum suppression (NMS) strategy, this algorithm can effectively distinguish adjacent clam larvae targets, reducing missed detections and false detections caused by dense distribution.
[0077] 4. Model Training and Optimization
[0078] To improve the accuracy and robustness of the algorithm, this model is trained using a large number of precisely labeled images of clam larvae. Data augmentation techniques (such as rotation, scaling, and translation) are used to expand the training set and enhance the model's generalization ability. Furthermore, during training, the algorithm further improves its detection accuracy by optimizing the loss function and adjusting hyperparameters.
[0079] 5. System Integration
[0080] This embodiment integrates an improved Mussel-ID model with image processing technology to form a complete image recognition and counting system for Mussel larvae. This system can run on multiple operating systems, supports various image formats, and has good scalability. Users can upload images through a graphical user interface and view recognition and counting results in real time. The system automatically saves and exports data, greatly improving the efficiency and accuracy of Mussel monitoring.
[0081] Based on the above algorithm, this embodiment proposes a deep learning-based image recognition and counting method for underwater clam larvae, aiming to solve the problems of feature information loss and high false negative rate when traditional methods identify densely distributed small targets (such as clam larvae). This is achieved by introducing a comprehensive YOLO v8 algorithm (algorithm flowchart see...). Figure 2 Mussel-ID, a detection model for densely distributed targets, employs multi-scale feature fusion, optimized pooling operations, and other techniques. Figure 5 The image shows a comparison of the training curves for Mussel-ID and YOLO v8. Figure 6 The diagram shows the changing trends of the loss function and performance metrics during model training and validation. This embodiment significantly improves the detection accuracy and efficiency of small targets. The method includes the following steps:
[0082] 1. Image Acquisition:
[0083] Images of clam larvae should be acquired using microscopes or other image acquisition tools. These images should include clam larvae distribution scenes from different angles and under different lighting conditions to ensure data diversity.
[0084] The acquired images are transmitted to the system for further processing.
[0085] 2. Image preprocessing:
[0086] The acquired images undergo preprocessing to improve the effectiveness of subsequent object detection. The preprocessing steps include:
[0087] Image resizing: Adjusts the image to a size suitable for the model input.
[0088] Color space conversion: Converting an image to a color space suitable for object detection (e.g., converting from RGB to grayscale or HSV space).
[0089] Noise removal: Removing noise from images through methods such as filtering to improve image quality.
[0090] 3. Feature extraction and multi-scale feature fusion:
[0091] The preprocessed image is input into the Mussel-ID model. The model extracts features from the image through convolutional layers and identifies regions that may contain Mussel larvae.
[0092] During the feature extraction process, a multi-scale feature fusion technique is used to fuse feature maps from different levels to enhance the model's ability to perceive larvae.
[0093] 4. Object detection and adaptive pooling:
[0094] The Mussel-ID model was used for object detection to identify larvae in the image. The model predicts both the object category and location in a single forward pass.
[0095] To preserve the feature information of small targets, adaptive pooling and spatial pyramid pooling (SPPF) techniques are adopted to reduce the loss of feature information of small targets caused by pooling operations.
[0096] 5. Dense Target Detection Strategy and Non-Maximum Suppression (NMS):
[0097] In response to the dense distribution of magma clam larvae, the model effectively distinguishes and identifies adjacent larval targets through dense detection heads and an improved NMS strategy, reducing the occurrence of missed detections and false detections.
[0098] 6. Post-processing of test results:
[0099] Post-processing is performed on the detected larval targets to optimize the recognition results. Post-processing includes operations such as removing overlapping detection boxes and merging adjacent targets to improve the final recognition accuracy.
[0100] 7. Results Display and Storage:
[0101] The identification and counting results are displayed on a graphical user interface, allowing users to visually view each detected swamp clam larva and its location and quantity in the image. Results can be exported as report files in various formats (such as text files, spreadsheets, and image files) for easy data analysis and management.
[0102] 8. System self-learning and optimization:
[0103] The system has a self-learning function, which can optimize the model and improve performance based on the feedback of recognition results, continuously improving the accuracy and efficiency of recognition. As more data accumulates, the system can adaptively update model parameters to meet the recognition needs of different scenarios.
[0104] 9. Extended Applications:
[0105] This method can be extended to the identification and counting of other aquatic organisms or small targets, and can be adapted to different detection tasks by adjusting the model and training dataset.
[0106] The following example uses underwater clam images to illustrate the identification and counting process in this embodiment:
[0107] First, multiple images of the distribution area of the clam larvae were acquired using underwater cameras. In these images, the clam larvae are densely distributed, and each individual larva occupies a relatively small proportion of the image. In some images, the clam larvae may be more difficult to identify due to factors such as ambient lighting.
[0108] 1. Preprocessing Stage. Preprocessing steps include resizing the image to meet Mussel-ID's input requirements, typically to a standard size of 640x640 pixels. Additionally, the image needs to be converted to grayscale or HSV color space to enhance the characteristics of the Mussel larvae. Simultaneously, noise is removed from the image using methods such as median filtering, further improving image quality.
[0109] 2. Detection Stage. After preprocessing, the image is input into the Mussel-ID model for feature extraction and target detection. In the feature extraction stage, multi-scale feature fusion technology is employed to combine low-level detail features with high-level semantic features. The model uses adaptive pooling and spatial pyramid pooling techniques to ensure that key larval features are preserved while reducing data dimensionality. Through an improved non-maximum suppression (NMS) algorithm, the system can effectively distinguish and identify densely distributed Mussel larvae targets in the image, avoiding the missed detections and false detections caused by dense target distribution in traditional methods.
[0110] 3. Detection Completion Stage. The system intuitively displays the recognition results on the graphical user interface, such as... Figure 4 As shown in the image, each identified clam is marked with a bounding box on the interface, and the system outputs the total number of clams in the image. Users can view the specific location of each clam through the interface and export the detection results as a report file.
[0111] Next, the aquatic organism image recognition and counting device according to the embodiments of this application is described with reference to the accompanying drawings.
[0112] Figure 7 This is a block diagram of an aquatic organism image recognition and counting device according to an embodiment of this application.
[0113] like Figure 7 As shown, the aquatic organism image recognition and counting device 10 includes: an acquisition module 201, an input module 202, and a processing module 203.
[0114] The acquisition module 201 is used to acquire aquatic organism images input by the user and preprocess the aquatic organism images; the input module 202 is used to input the preprocessed aquatic organism images into a deep learning-based target detection model, and the target detection model outputs the detection results of target aquatic organisms in the aquatic organism images. The target detection model includes a feature extraction network that incorporates multi-scale feature fusion technology, a convolutional neural network that uses adaptive pooling and spatial pyramid pooling technology, and a dense detection head for densely distributed target detection; the processing module 203 is used to post-process the detection results of target aquatic organisms and identify the number of target aquatic organisms and their positions in the aquatic organism images based on the post-processed detection results.
[0115] In this embodiment, the input module 202 is further configured to: extract feature maps at different levels from the aquatic organism image using a feature extraction network; during the feature extraction process, multi-scale feature fusion technology is used to fuse the feature maps at different levels; the convolutional neural network uses adaptive pooling and spatial pyramid pooling technology to perform pooling operations on the fused feature maps, and completes the prediction of category and location in a single forward propagation; the dense detection head identifies multiple target aquatic organisms in the feature map after pooling operations, and distinguishes adjacent target aquatic organisms among the multiple target aquatic organisms by improving the non-maximum suppression strategy.
[0116] In this embodiment, a training module is also included, wherein the training module is further configured to obtain a training set before inputting the preprocessed aquatic organism images into the deep learning-based target detection model, the training set including multiple aquatic organism images labeled with target aquatic organisms; expand the training set through data augmentation techniques; train the target detection model using the expanded training set; and optimize the loss function and adjust the hyperparameters during the training process.
[0117] In this application embodiment, the data augmentation technology includes at least one operation of rotating, scaling, and translating multiple aquatic organism images labeled with target aquatic organisms.
[0118] In this embodiment of the application, the acquisition module 201 is further configured to: acquire aquatic organism images input by the user, and receive the aquatic organism images input by the user using a graphical user interface developed using the PyQt framework.
[0119] In this embodiment of the application, the graphical user interface is also used to display the number of target aquatic organisms and the location of the target aquatic organisms in the aquatic organism image.
[0120] In the embodiments of this application, the preprocessing methods include at least one of image resizing, color space conversion, and noise removal.
[0121] It should be noted that the foregoing explanation of the embodiment of the aquatic organism image recognition and counting method also applies to the aquatic organism image recognition and counting device of this embodiment, and will not be repeated here.
[0122] The aquatic organism image recognition and counting device proposed in the embodiments of this application acquires aquatic organism images input by the user, preprocesses the aquatic organism images, inputs the preprocessed aquatic organism images into a target detection model based on deep learning, the model outputs the detection results of target aquatic organisms in the aquatic organism images, performs post-processing on the detection results of target aquatic organisms, and identifies the number of target aquatic organisms and the position of target aquatic organisms in the aquatic organism images based on the post-processed detection results. It can achieve rapid statistics and accurate positioning of the number and growth characteristics of clam larvae in the images, reducing missed detections and false detections.
[0123] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device may include:
[0124] The memory 301, the processor 302, and the computer program stored on the memory 301 and capable of running on the processor 302.
[0125] When the processor 302 executes the program, it implements the aquatic organism image recognition and counting method provided in the above embodiments.
[0126] Furthermore, electronic devices also include:
[0127] Communication interface 303 is used for communication between memory 301 and processor 302.
[0128] The memory 301 is used to store computer programs that can run on the processor 302.
[0129] The memory 301 may include high-speed RAM (Random Access Memory) memory, and may also include non-volatile memory, such as at least one disk storage.
[0130] If the memory 301, processor 302, and communication interface 303 are implemented independently, then the communication interface 303, memory 301, and processor 302 can be interconnected via a bus to complete communication between them. The bus can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 7 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0131] Optionally, in a specific implementation, if the memory 301, processor 302, and communication interface 303 are integrated on a single chip, then the memory 301, processor 302, and communication interface 303 can communicate with each other through an internal interface.
[0132] Processor 302 may be a CPU (Central Processing Unit), an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of this application.
[0133] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described aquatic organism image recognition and counting method.
[0134] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0135] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "N" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0136] Any process or method described in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or N executable instructions for implementing custom logic functions or processes, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as should be understood by those skilled in the art to which embodiments of this application pertain.
[0137] It should be understood that various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any of the following techniques known in the art, or a combination thereof: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (FPGAs), field-programmable gate arrays (FPGAs), etc.
[0138] Those skilled in the art will understand that all or part of the steps of the methods implementing the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.
[0139] Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of this application.
Claims
1. A method for image recognition and counting of aquatic organisms, characterized in that, Includes the following steps: Acquire aquatic organism images input by the user, and preprocess the aquatic organism images; The preprocessed aquatic organism image is input into a deep learning-based target detection model, which outputs the detection results of target aquatic organisms in the image. The target detection model includes a feature extraction network incorporating multi-scale feature fusion technology, a convolutional neural network employing adaptive pooling and spatial pyramid pooling techniques, and a densely distributed target detection head. The deep learning-based target detection model is a deep learning-based Mussel-ID model. The feature extraction network extracts feature maps at different levels from the aquatic organism image. During feature extraction, multi-scale feature fusion technology is used to fuse feature maps at different levels. The convolutional neural network uses adaptive pooling and spatial pyramid pooling techniques to perform pooling operations on the fused feature maps, completing category and location prediction in a single forward propagation. The dense detection head identifies multiple target aquatic organisms in the pooled feature map and distinguishes adjacent target aquatic organisms among these multiple target aquatic organisms using an improved non-maximum suppression strategy. The detection results of the target aquatic organisms are post-processed, and the number of target aquatic organisms and their positions in the aquatic organism image are identified based on the post-processed detection results.
2. The aquatic organism image recognition and counting method according to claim 1, characterized in that, Before inputting the preprocessed aquatic organism images into the deep learning-based object detection model, the following steps are also included: Obtain a training set, which includes multiple images of aquatic organisms labeled with the target aquatic organisms; The training set is augmented using data augmentation techniques, and the target detection model is trained using the augmented training set. During the training process, the loss function is optimized and the hyperparameters are adjusted.
3. The aquatic organism image recognition and counting method according to claim 2, characterized in that, The data augmentation technique includes at least one operation: rotation, scaling, and translation of multiple aquatic organism images labeled with the target aquatic organism.
4. The aquatic organism image recognition and counting method according to claim 1, characterized in that, The acquisition of aquatic organism images input by the user includes: A graphical user interface developed using the PyQt framework receives images of aquatic organisms input by the user.
5. The aquatic organism image recognition and counting method according to claim 4, characterized in that, The graphical user interface is also used to display the number of target aquatic organisms and their positions within the aquatic organism image.
6. The aquatic organism image recognition and counting method according to claim 1, characterized in that, Preprocessing methods include at least one of image resizing, color space conversion, and noise removal.
7. A device for recognizing and counting aquatic organisms from images, characterized in that, include: The acquisition module is used to acquire aquatic organism images input by the user and to preprocess the aquatic organism images; An input module is used to input preprocessed aquatic organism images into a deep learning-based target detection model. The target detection model outputs the detection results of target aquatic organisms in the aquatic organism images. The target detection model includes a feature extraction network incorporating multi-scale feature fusion technology, a convolutional neural network employing adaptive pooling and spatial pyramid pooling techniques, and a densely distributed target detection head. The deep learning-based target detection model is a deep learning-based Mussel-ID model. The feature extraction network extracts feature maps at different levels from the aquatic organism images. During feature extraction, multi-scale feature fusion technology is used to fuse feature maps at different levels. The convolutional neural network uses adaptive pooling and spatial pyramid pooling techniques to perform pooling operations on the fused feature maps, completing category and location prediction in a single forward propagation. The dense detection head identifies multiple target aquatic organisms in the pooled feature maps and distinguishes adjacent target aquatic organisms among these multiple target aquatic organisms using an improved non-maximum suppression strategy. The processing module is used to post-process the detection results of the target aquatic organisms, and to identify the number of target aquatic organisms and their positions in the aquatic organism image based on the post-processed detection results.
8. An electronic device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, the processor executing the program to implement the aquatic organism image recognition and counting method according to any one of claims 1-6.
9. A computer-readable storage medium having a computer program or instructions stored thereon, characterized in that, When the computer program or instructions are executed, they implement the aquatic organism image recognition and counting method according to any one of claims 1-6.
Citation Information
Patent Citations
Image front vehicle target identification method based on convolutional neural network
CN115661767A
Shrimp seed counting method and system based on high resolution and target detection
CN115937169A