Schizothorax otolith image automatic species identification technology based on computer vision
Through computer vision technology and the YOLOv8 model, automatic recognition of schizothorax fish otolith images has been achieved, which solves the problem of low efficiency and reliance on professional knowledge of traditional fish species identification, improves recognition accuracy and efficiency, and is suitable for ecosystem management. and biodiversity conservation.
Patent Information
- Application Number
- CN202410506127.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-25
- Publication Date
- 2024-09-06
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional fish species identification methods rely on professional knowledge, are inefficient and cannot meet the needs of rapid and large-scale identification. Moreover, genetic marker methods are complex and expensive in equipment, making it difficult to quickly apply them in the field.
An automatic species identification method based on computer vision for schizothorax otolith images was adopted. The YOLOv8 model was used to combine image processing and deep learning technology to achieve automatic identification through data acquisition, model training and detection and identification steps to enhance identification efficiency and accuracy.
It improves the accuracy and efficiency of fish species identification, reduces dependence on professional knowledge, achieves rapid and automated identification, and is suitable for ecosystem management and biodiversity protection.
Smart Images

Figure CN118608928A
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of schizothorax identification, and in particular to a computer vision-based schizothorax otolith image automatic species identification technology. Background Art
[0002] Schizothorax fishes occupy an important position due to their unique ecological environment and biodiversity. Regional ecosystems are usually highly specific and fragile, among which fish species are not only an important part of biodiversity, but also a key factor in maintaining ecological balance. However, environmental changes and the impact of human activities have made them face severe challenges. Therefore, it has become particularly important to accurately identify and monitor plateau fish species, which is the basis for achieving biodiversity conservation, ecosystem management and sustainable use.
[0003] Traditionally, the identification of fish species has mainly relied on morphological analysis, including observing external features such as body shape, scales, and fin shape. These methods are effective in most cases, but there are some obvious limitations. First, morphological analysis is highly dependent on professional knowledge and requires experienced researchers to identify, which may become a bottleneck when resources are limited. Second, the morphological differences between some species are subtle and difficult to distinguish based on external morphological characteristics alone. In addition, this method cannot meet the needs of rapid and large-scale identification. With the development of technology, genetic markers and molecular biology methods have provided new ways for species identification. By analyzing DNA sequences, these methods can accurately distinguish different species. However, the equipment and experiments required for genetic analysis are relatively complex and expensive, which limits its ability to be quickly applied in the field.
[0004] In recent years, advances in computer vision technology have opened up new possibilities for fish species identification. In particular, otoliths, a calcium carbonate structure formed in fish bodies, have become a favorable biomarker due to their unique morphological characteristics between species. The shape and texture of otoliths vary significantly between species, which allows them to be used to accurately identify fish species. Using computer vision technology to analyze otolith images can achieve rapid and automated identification of schizothorax fish, greatly improving the efficiency and accuracy of identification while reducing dependence on professional knowledge. Therefore, the development of a computer vision-based automatic species identification technology for schizothorax otolith images has important practical significance and application value for protecting biodiversity in plateau areas and promoting sustainable management of ecosystems.
[0005] Therefore, it is an urgent problem for those skilled in the art to propose an automatic species recognition method for schizothorax otolith images based on computer vision to solve the difficulties existing in the prior art. Summary of the invention
[0006] In view of this, the present invention provides a method for automatic species recognition of schizothorax otolith images based on computer vision, which can improve the accuracy of automatic recognition of schizothorax species and enhance the recognition efficiency.
[0007] In order to achieve the above object, the present invention adopts the following technical solution:
[0008] A method for automatic species recognition of schizothorax otolith images based on computer vision comprises the following steps:
[0009] S1, data acquisition step: acquiring otolith image data of schizothorax;
[0010] S2, model training step: training a fish otolith image classification network model of YOLOv8 based on the otolith image data of schizothorax obtained in S1;
[0011] S3, detection and identification step: Based on the trained YOLOv8 fish otolith image classification network model obtained in S2, the otoliths of the schizothorax to be tested are detected to obtain the schizothorax identification result.
[0012] In the above method, optionally, the specific contents in S1 include:
[0013] Use image processing algorithms to automatically identify and remove poor quality images;
[0014] Bilateral filtering was applied to remove noise, histogram equalization was performed to improve image contrast, sharpening was used to enhance image edges, the Canny edge detection algorithm was applied to identify the outline of otoliths, and finally the image was expanded through image adjustment. The labelimg software was used to manually annotate the complete and intact images of otoliths to form an otolith image dataset.
[0015] In the above method, optionally, the network model of fish otolith image classification of YOLOv8 in S2 includes:
[0016] It consists of 4 parts: input end, backbone network, Neck module and output end;
[0017] The above method optionally combines different parts of multiple images through Mosaic data enhancement at the input end; dynamically adjusts the anchor frame according to the shape and size of the otolith of the schizothorax fish by adaptive anchor frame calculation; and optimizes the image quality by adjusting the grayscale filling.
[0018] In the above method, optionally, the backbone network is used to extract information from the image, including Conv, C2f and SPPF structures. The Conv module uses a convolutional layer to extract the basic features of the schizothorax otolith image, C2f is used to adapt to schizothorax otolith images of different scales, and SPPF is used to fuse features of different scales.
[0019] The above method optionally uses a decoupled head structure at the output end to separate the classification and detection processes, and uses the TaskAlignedAssigner method to select positive samples;
[0020] Loss calculation includes classification branch and regression branch. The classification branch uses binary cross entropy loss, and the regression loss uses DFL Loss and CIUO Loss.
[0021] The above method optionally adds a CBAM spatial attention mechanism after each SPPF module, and screens the complex texture and morphological features of the otolith images of schizothorax based on the CBAM spatial attention mechanism.
[0022] In the above method, optionally, the Neck module realizes the effective fusion of different scale features of the otolith image of schizothorax through the PAN-FPN structure.
[0023] It can be seen from the above technical solution that, compared with the prior art, the computer vision-based automatic species recognition method for schizothorax otolith images of the present invention has the following beneficial effects:
[0024] 1. Improve recognition accuracy: Using the deep learning model YOLOv8, the subtle features of the otoliths of schizothorax can be accurately identified; this high-precision automatic recognition method can significantly reduce errors in the manual recognition process, especially when dealing with a large number of samples, and reduce misidentification caused by manual fatigue or subjective judgment differences;
[0025] 2. After integrating the CBAM spatial attention mechanism into each SPPF module: The CBAM spatial attention mechanism can effectively emphasize important spatial regions and suppress irrelevant background information, thereby more accurately capturing the characteristics of the otoliths of schizothorax; by more clearly emphasizing these features, CBAM can help the network model better learn and distinguish the subtle differences between different schizothorax, especially between visually similar species;
[0026] 3. Improve processing speed: Through the automated processing of training models, the time of the recognition process is greatly shortened; traditional manual recognition methods are usually time-consuming and labor-intensive, while the application of computer vision technology can achieve real-time or near-real-time data processing, which is particularly important for research and application scenarios that require rapid processing of large numbers of otolith images;
[0027] 4. Reduce professional dependence: Traditional fish species identification relies on highly specialized knowledge and experience, while once trained, computer vision recognition systems can be operated by non-professionals, which to a certain extent reduces the professional threshold for operation; this allows more non-professionals to participate in the monitoring and research of schizothorax, helping to expand the scope of research and application;
[0028] 5. Enhance data availability and sharing: Automated identification methods can generate standardized and consistent identification results. These data are also easy to store, analyze and share, and can establish databases, which are conducive to remote data analysis and multi-institutional cooperation in biodiversity research and other aspects. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0030] Figure 1 A flow chart of a method for automatic species recognition of schizothorax otolith images based on computer vision provided by the present invention;
[0031] Figure 2 This is a fish otolith diagram provided by the present invention. DETAILED DESCRIPTION
[0032] 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.
[0033] In this application, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. The terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of more restrictions, the elements defined by the sentence "comprise one..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0034] The present invention can be used in many general or special computing device environments or configurations, such as personal computers, server computers, handheld or portable devices, tablet devices, multi-processor devices, distributed computing environments including any of the above devices or devices, etc.
[0035] Reference Figure 1 As shown, the present invention discloses a method for automatic species recognition of otolith images of schizothorax based on computer vision, comprising the following steps:
[0036] S1, data acquisition step: acquiring otolith image data of schizothorax;
[0037] S2, model training step: training a fish otolith image classification network model of YOLOv8 based on the otolith image data of schizothorax obtained in S1;
[0038] S3, detection and identification step: Based on the trained YOLOv8 fish otolith image classification network model obtained in S2, the otoliths of the schizothorax to be tested are detected to obtain the schizothorax identification result.
[0039] Furthermore, the specific contents of S1 include:
[0040] Obtain otolith image data of schizothorax fish and use image processing algorithms to automatically identify and remove images of poor quality;
[0041] Bilateral filtering was applied to remove noise, histogram equalization was performed to improve image contrast, sharpening was used to enhance image edges, the Canny edge detection algorithm was applied to identify the outline of otoliths, and finally the image was expanded through image adjustment. The labelimg software was used to manually annotate the complete and intact images of otoliths to form an otolith image dataset.
[0042] Specifically, the otolith image acquisition standard is as follows: otolith images are taken using a stereo microscope under the same light source, background, and magnification (1.25X); see Figure 2 shown.
[0043] Image processing algorithms were used to automatically identify and remove images of poor quality (e.g., blurred, overexposed, or underexposed images). Bilateral filtering was applied to remove noise, histogram equalization was performed to improve image contrast, sharpening was used to enhance image edges, the Canny edge detection algorithm was applied to identify otolith outlines, and finally image adjustment (rotation, scaling, flipping) was performed to expand the image. Labelimg software was used to manually annotate images of otoliths that were intact. An otolith image dataset was formed. The fish otolith image dataset was divided into a training set and a validation set in a ratio of 8:2.
[0044] Furthermore, the network model of fish otolith image classification of YOLOv8 in S2 includes:
[0045] It consists of 4 parts: input end, backbone network, Neck module and output end;
[0046] Furthermore, in the input, Mosaic data enhancement is used to combine different parts of multiple images; the adaptive anchor frame calculation dynamically adjusts the anchor frame according to the shape and size of the otolith of the schizothorax; and the image quality is optimized by adjusting the grayscale filling.
[0047] Specifically, train a network model for fish otolith image classification based on YOLOv8:
[0048] The YOLOv8 network consists of three parts: input, backbone, neck module and head. Among them, the input, mosaic data enhancement improves the model's adaptability to different arrangements and scaling of schizothorax otoliths in the image by combining different parts of multiple images; the adaptive anchor frame calculation dynamically adjusts the anchor frame according to the shape and size of the otolith to improve the accuracy of positioning; the adaptive grayscale filling takes into account the uneven illumination and contrast problems that may exist in the otolith image, and optimizes the image quality by adjusting the grayscale filling. The image is uniformly processed to a size of 640x640 to ensure the consistency of the network input.
[0049] Furthermore, the backbone network is used to extract information from the image, including Conv, C2f and SPPF structures. The Conv module uses convolutional layers to extract the basic features of the otolith images of schizothorax, C2f is used to adapt to otolith images of schizothorax at different scales, and SPPF is used to fuse features at different scales.
[0050] Specifically, Backbone is mainly used to extract information from images, including Conv, C2f and SPPF structures. The Conv module uses convolutional layers to extract the basic features of otolith images. C2f can obtain richer gradient flow information while ensuring lightweight and adapt to otolith images of different scales. SPPF can fuse features of different scales and enhance the model's ability to capture the details of otolith images.
[0051] Furthermore, at the output end, a decoupled head structure is used to separate the classification and detection processes, and the TaskAlignedAssigner method is used to select positive samples;
[0052] Loss calculation includes classification branch and regression branch. The classification branch uses binary cross entropy loss, and the regression loss uses DFL Loss and CIUO Loss.
[0053] Specifically, at the head output end, a decoupled head structure is adopted to separate the classification and detection processes, and the TaskAlignedAssigner method is used to select positive samples to ensure more accurate matching and learning during the training process. The loss calculation includes two branches, classification and regression. The classification branch uses binary cross entropy loss (BCE Loss), and the regression loss uses DFL Loss and CIUO Loss, which is beneficial to improve the accuracy and robustness of otolith recognition.
[0054] Furthermore, a CBAM spatial attention mechanism is added after each SPPF module, and the complex texture and morphological features of the otolith images of schizothorax are screened based on the CBAM spatial attention mechanism.
[0055] Specifically, a CBAM spatial attention mechanism is added after each SPPF module. Otolith images usually contain complex texture and morphological features, which may be highly non-uniform in spatial distribution. Spatial attention can help the model focus more on these key features and improve recognition accuracy.
[0056] Furthermore, the Neck module realizes the effective fusion of different scale features of the otolith images of schizothorax through the PAN-FPN structure.
[0057] The Neck module realizes the effective fusion of features of different scales through the PAN-FPN structure, and enhances the semantic analysis and positioning capabilities of the model in otolith images.
[0058] Select the YOLOv8m.pt model for pre-training. The parameters are set to epochs=150 and batch=16.
[0059] The training data set is input into the network model for training, and a network model for fish otolith image classification based on YOLOv8 is generated. The model is then evaluated using the test set. The model performance is comprehensively evaluated using multiple indicators such as precision, recall rate, and F1 score to ensure the accuracy and reliability of the recognition results.
[0060] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, 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 creative work.
[0061] Those skilled in the art may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein may be implemented by electronic hardware, computer software, or a combination of both.
[0062] In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present invention.
[0063] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for automatic species recognition of schizothorax otolith images based on computer vision, characterized in that: The following steps are involved: S1, data acquisition step: acquiring otolith image data of schizothorax; S2, model training step: training a fish otolith image classification network model of YOLOv8 based on the otolith image data of schizothorax obtained in S1; S3, detection and identification step: Based on the trained YOLOv8 fish otolith image classification network model obtained in S2, the otoliths of the schizothorax to be tested are detected to obtain the schizothorax identification result.
2. The method for automatic species recognition of schizothorax otolith images based on computer vision according to claim 1, characterized in that: The specific contents of S1 include: Obtain otolith image data of schizothorax fish and use image processing algorithms to automatically identify and remove images of poor quality; Bilateral filtering was applied to remove noise, histogram equalization was performed to improve image contrast, sharpening was used to enhance image edges, the Canny edge detection algorithm was applied to identify the outline of otoliths, and finally the image was expanded through image adjustment. The labelimg software was used to manually annotate the complete and intact images of otoliths to form an otolith image dataset.
3. The method for automatic species recognition of schizothorax otolith images based on computer vision according to claim 2, characterized in that: The network model of fish otolith image classification of YOLOv8 in S2 includes: It consists of four parts: input end, backbone network, Neck module and output end.
4. The method for automatic species identification of schizothorax otolith images based on computer vision according to claim 3, characterized in that: in, Mosaic data enhancement is used at the input to combine different parts of multiple images; adaptive anchor frame calculation dynamically adjusts the anchor frame according to the shape and size of the otoliths of schizothorax; and image quality is optimized by adjusting grayscale filling.
5. The method for automatic species recognition of schizothorax otolith images based on computer vision according to claim 4, characterized in that: The backbone network is used to extract information from the image, which includes Conv, C2f and SPPF structures. The Conv module uses convolutional layers to extract the basic features of the otolith images of schizothorax. C2f is used to adapt to otolith images of schizothorax of different scales. SPPF is used to fuse features of different scales.
6. The method for automatic species recognition of schizothorax otolith images based on computer vision according to claim 5, characterized in that: At the output end, a decoupled head structure is used to separate the classification and detection processes, and the TaskAlignedAssigner method is used to select positive samples; Loss calculation includes classification branch and regression branch. The classification branch uses binary cross entropy loss, and the regression loss uses DFL Loss and CIUO Loss.
7. The method for automatic species recognition of schizothorax otolith images based on computer vision according to claim 6, characterized in that: A CBAM spatial attention mechanism is added after each SPPF module, and the complex texture and morphological features of the otolith images of schizothorax are screened based on the CBAM spatial attention mechanism.
8. The method for automatic species identification of schizothorax otolith images based on computer vision according to claim 7, characterized in that: The Neck module uses the PAN-FPN structure to effectively integrate the different scale features of the otolith images of schizothorax.
Citation Information
Patent Citations
Method for detecting positions of fish target individuals in cultured fish shoal based on improved YOLOv8 model
CN117058232A
Fish identification method, device and equipment and storage medium
CN117218481A
Traffic target identification method based on improved YOLOv8 model
CN117237915A
Intelligent recognition method and device for zebra fish courtship behavior and medium
CN117854114A
