Grass fish hemorrhagic disease detection method, system and device based on artificial intelligence
Through image processing and detection models based on artificial intelligence, the problem of low detection accuracy of grass carp bleeding disease is solved, and efficient and low-cost identification of diseased fish is achieved, which is suitable for the rapid diagnosis of grass carp bleeding disease.
Patent Information
- Application Number
- CN202510581003.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-07
- Publication Date
- 2025-08-12
AI Technical Summary
The detection accuracy of grass carp hemorrhage disease in the prior art is not high and there is a lack of effective rapid diagnosis method.
Using artificial intelligence-based detection methods, the grass carp images are acquired through video acquisition equipment, and image segmentation and separation are used for image segmentation and separation, and combined with a pre-trained detection model for diseased fish recognition.
Accurate detection of grass carp bleeding disease has been achieved, with a detection success rate of more than 95%, reducing professional training needs and testing costs, and achieving rapid and convenient diagnosis of diseased fish.
Smart Images

Figure CN120472225A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to an artificial intelligence-based grass carp hemorrhagic disease detection method, system, device and storage medium. Background Art
[0002] Aquaculture plays a vital role in my country's national economy and is one of the country's key agricultural pillars, primarily focusing on freshwater aquaculture. Grass carp and black carp are among the four major freshwater fish species in my country, accounting for over 20% of total freshwater aquaculture production. With the increasing scale and intensification of aquaculture, epidemics have become more frequent, leading to increased mortality in fry, stunted fish growth, and significant economic losses. The overuse of drugs due to inadequate disease control has also led to serious environmental problems. Among them, grass carp hemorrhagic disease, caused by grass carp reovirus, poses a significant threat to both grass carp and black carp. Currently, there is a lack of effective drugs against the grass carp reovirus, the causative agent of hemorrhagic disease in both grass carp and black carp. Prevention is the only option, and rapid diagnostic testing for hemorrhagic disease in both grass carp and black carp is essential. Early warning technologies for grass carp hemorrhagic disease are currently limited. Currently, effective detection methods primarily rely on histomorphometric analysis and immunofluorescence, but these methods offer limited accuracy.
[0003] Currently, no effective solution has been proposed to the problem of low detection accuracy in related technologies. Summary of the Invention
[0004] In this embodiment, a method, system and device for detecting grass carp hemorrhagic disease based on artificial intelligence are provided to solve the problem of low detection accuracy in related technologies.
[0005] In a first aspect, a method for detecting hemorrhagic disease of grass carp based on artificial intelligence is provided in this embodiment. The method comprises:
[0006] receiving video data sent by a video acquisition device; the video data including an image of a grass carp to be detected;
[0007] The collected original image is subjected to threshold segmentation using an image enhancement clustering algorithm to obtain a mask image;
[0008] Perform corrosion and expansion on the mask image to remove small impurities and noise points;
[0009] The mask image is synthesized with the original image to generate a first image; the first image includes a single fish image and an overlapping fish image;
[0010] The overlapping fish images are separated by an improved watershed algorithm to obtain a second image;
[0011] Input the single fish image and the second image into the pre-trained detection model to obtain the recognition result;
[0012] According to the recognition results of the detection model, the images in the video data are used to detect grass carp hemorrhagic disease.
[0013] In some embodiments, performing threshold segmentation on the collected original image using the image enhancement clustering algorithm includes performing threshold segmentation on the collected original image using the following formula:
[0014]
[0015] Among them, x and y are the horizontal and vertical coordinates of the image pixel respectively, and z represents the color grayscale value of the pixel;
[0016] The R and G components are squared, and then the color information of the pixel is converted into the z component in the Euclidean distance calculation formula.
[0017] In some embodiments, separating overlapping fish images using an improved watershed algorithm to obtain a second image includes:
[0018] Grayscale the overlapping fish images to obtain a grayscale image;
[0019] Get the distance gradient map of the grayscale image;
[0020] According to the distance gradient map, the seed points and dividing lines between each fish are obtained;
[0021] A second image is generated according to the seed point and the boundary line.
[0022] In some embodiments, obtaining the distance gradient map of the grayscale image includes: corroding the grayscale image to obtain the distance gradient map of the grayscale image.
[0023] In some embodiments, overlapping fish images are separated by an improved watershed algorithm to obtain a second image, and the method further includes: using the number of pixels of the seed point as a judgment criterion and discarding pseudo seed points whose area value is less than a preset value.
[0024] In some embodiments, a single fish image and a second image are input into a pre-trained detection model to obtain a recognition result, including: inputting a single fish image and a second image into a pre-trained detection model to obtain a marking box; the marking box is used to identify the status of the grass carp.
[0025] In some embodiments, performing grass carp hemorrhagic disease detection on images in the video data according to the recognition result of the detection model includes: performing grass carp hemorrhagic disease detection on the images in the video data according to the marked box.
[0026] In a second aspect, an artificial intelligence-based grass carp hemorrhagic disease detection system is provided in this embodiment, the system comprising: a video acquisition device and a cloud analysis device, the video acquisition device and the cloud analysis device being communicatively connected;
[0027] Video capture equipment, which collects video data from the target location and sends the video data to a cloud analysis device;
[0028] A cloud-based analysis device for executing any of the artificial intelligence-based grass carp hemorrhagic disease detection methods of the first aspect.
[0029] In a third aspect, in this embodiment, a device for detecting hemorrhagic disease of grass carp based on artificial intelligence is provided, the device comprising:
[0030] A receiving module is used to receive video data sent by a video acquisition device; the video data includes an image of a grass carp to be detected;
[0031] The segmentation module is used to perform threshold segmentation on the collected original image using an image enhancement clustering algorithm to obtain a mask image; perform corrosion and expansion on the mask image to remove small impurities and noise points; and synthesize the mask image with the original image to generate a first image; the first image includes a single fish image and an overlapping fish image;
[0032] a separation module, configured to separate the overlapping fish images by using an improved watershed algorithm to obtain a second image;
[0033] The recognition module is used to input the single fish image and the second image into a pre-trained detection model to obtain a recognition result; based on the recognition result of the detection model, the image in the video data is tested for grass carp hemorrhagic disease.
[0034] In a fourth aspect, a computer-readable storage medium is provided in this embodiment, on which a computer program is stored. When the computer program is executed by a processor, the steps of the grass carp hemorrhagic disease detection method based on artificial intelligence of any one of the first aspects are implemented.
[0035] Compared with the related art, the artificial intelligence-based grass carp hemorrhagic disease detection method, system, device and storage medium provided in this embodiment receive video data sent by a video acquisition device; the video data includes an image of the grass carp to be detected; the collected original image is threshold segmented by an image enhancement clustering algorithm to obtain a mask image; the mask image is corroded and expanded to remove small impurities and noise points; the mask image is synthesized with the original image to generate a first image; the first image includes a single fish image and overlapping fish images; the overlapping fish images are separated by an improved watershed algorithm to obtain a second image; the single fish image and the second image are input into a pre-trained detection model to obtain a recognition result; according to the recognition result of the detection model, the image in the video data is detected for grass carp hemorrhagic disease, which solves the problem of low detection accuracy in the related art.
[0036] The details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0038] Figure 1 This is a hardware structure block diagram of a terminal for a method for detecting hemorrhagic disease of grass carp based on artificial intelligence provided in this embodiment;
[0039] Figure 2 This is a flow chart of a method for detecting hemorrhagic disease of grass carp based on artificial intelligence provided in an embodiment of the present application;
[0040] Figure 3 This is a detection flow chart provided in an embodiment of the present application;
[0041] FIG4( a ) is an original image provided in an embodiment of the present application;
[0042] FIG4( b ) is a schematic diagram of a clustering effect provided in an embodiment of the present application;
[0043] FIG4( c ) is another schematic diagram of clustering effect provided in an embodiment of the present application;
[0044] FIG5( a ) is a schematic diagram of overlapping images of multiple fish provided in an embodiment of the present application;
[0045] FIG5( b ) is a distance gradient map provided in an embodiment of the present application;
[0046] FIG5( c ) is a seed point map obtained after corrosion according to an embodiment of the present application;
[0047] FIG5( d ) is a schematic diagram of a segmented image provided in an embodiment of the present application;
[0048] FIG5( e ) is a schematic diagram of a segmented single fish image provided in an embodiment of the present application;
[0049] FIG5( f ) is a schematic diagram of another segmented single fish image provided in an embodiment of the present application;
[0050] Figure 6 This is a schematic diagram of a convolutional neural network module provided in an embodiment of the present application;
[0051] Figure 7 This is a schematic diagram of the structure of a self-attention mechanism provided in an embodiment of the present application;
[0052] FIG8( a ) is a schematic diagram of an original image provided in an embodiment of the present application;
[0053] FIG8( b ) is a schematic diagram of a detection result image provided in an embodiment of the present application;
[0054] Figure 9 This is a schematic diagram of another detection result image provided in an embodiment of the present application. DETAILED DESCRIPTION
[0055] In order to more clearly understand the purpose, technical solutions and advantages of the present application, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments.
[0056] Unless otherwise defined, the technical terms or scientific terms involved in this application should have the general meaning understood by people with ordinary skills in the technical field to which this application belongs. The words "one", "an", "a", "the", "these" and the like in this application do not indicate quantitative restrictions, and they can be singular or plural. The terms "include", "comprise", "have" and any variants thereof involved in this application are intended to cover non-exclusive inclusions; for example, a process, method and system, product or device comprising a series of steps or modules (units) is not limited to the listed steps or modules (units), but may include unlisted steps or modules (units), or may include other steps or modules (units) inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The "plurality" involved in this application refers to two or more. "And / or" describes the relationship between related objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A exists alone, A and B exist simultaneously, and B exists alone. Generally, the character " / " indicates that the related objects are in an "or" relationship. The terms "first," "second," "third," etc. used in this application are only used to distinguish similar objects and do not represent a specific ordering of the objects.
[0057] The method embodiment provided in this embodiment can be executed in a terminal, a computer or a similar computing device. For example, running on a terminal, Figure 1 This is a hardware structure block diagram of a terminal for a method for detecting hemorrhagic disease of grass carp based on artificial intelligence provided by this embodiment. Figure 1 As shown, the terminal may include one or more ( Figure 1 Only one is shown) a processor 102 and a memory 104 for storing data, wherein the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA. The above terminal may also include a transmission device 106 and an input and output device 108 for communication functions. It will be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above terminal. Figure 1 More or fewer components than shown, or with Figure 1 Different configurations shown.
[0058] The memory 104 can be used to store computer programs, such as software programs and modules for application software, such as the computer program corresponding to the artificial intelligence-based grass carp hemorrhagic disease detection method in this embodiment. The processor 102 executes the computer program stored in the memory 104 to perform various functional applications and data processing, thereby implementing the above-mentioned method. The memory 104 may include high-speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories may be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0059] The transmission device 106 is used to receive or send data via a network. The network may include a wireless network provided by the terminal's telecommunications provider. In one embodiment, the transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In another embodiment, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0060] In this embodiment, a method for detecting hemorrhagic disease of grass carp based on artificial intelligence is provided. Figure 2 This is a flow chart of a method for detecting hemorrhagic disease of grass carp based on artificial intelligence provided in an embodiment of the present application, such as Figure 2 As shown, the process includes the following steps:
[0061] Step S210: receiving video data sent by a video acquisition device; the video data includes an image of a grass carp to be detected.
[0062] Step S220 , performing threshold segmentation on the collected original image using an image enhancement clustering algorithm to obtain a mask image.
[0063] The threshold segmentation of the collected original image by the image enhancement clustering algorithm includes performing the threshold segmentation on the collected original image using the following formula:
[0064]
[0065] Among them, x and y are the horizontal and vertical coordinates of the image pixel respectively, and z represents the color grayscale value of the pixel;
[0066] The R and G components are squared, and then the color information of the pixel is converted into the z component in the Euclidean distance calculation formula.
[0067] Step S230: performing corrosion and dilation on the mask image to remove small impurities and noise points.
[0068] Step S240 , synthesizing the mask image with the original image to generate a first image; the first image includes a single fish image and overlapping fish images.
[0069] Step S250 , separating the overlapping fish images by using an improved watershed algorithm to obtain a second image.
[0070] Separating the overlapping fish images using an improved watershed algorithm to obtain a second image includes: grayscaleing the overlapping fish images to obtain a grayscale image; obtaining a distance gradient map of the grayscale image; obtaining seed points and boundary lines between each fish based on the distance gradient map; and generating the second image based on the seed points and boundary lines. Obtaining the distance gradient map of the grayscale image includes: eroding the grayscale image to obtain the distance gradient map of the grayscale image. Separating the overlapping fish images using the improved watershed algorithm to obtain the second image also includes: using the number of pixels in the seed point as a criterion to discard pseudo-seed points whose area values are smaller than a preset value.
[0071] Step S260: input the single fish image and the second image into a pre-trained detection model to obtain a recognition result.
[0072] The method includes inputting the single fish image and the second image into a pre-trained detection model to obtain a recognition result, which includes: inputting the single fish image and the second image into a pre-trained detection model to obtain a marking box; the marking box is used to identify the state of the grass carp.
[0073] Step S270: performing grass carp hemorrhagic disease detection on the images in the video data according to the recognition result of the detection model.
[0074] Based on the recognition results of the detection model, the images in the video data are tested for grass carp hemorrhagic disease. This includes detecting grass carp hemorrhagic disease based on the marked boxes. This detection model is a neural network model. After neural network processing, it distinguishes between diseased and healthy fish, and the results are fed back through color-coded boxes, such as red boxes for diseased fish and green boxes for healthy fish. The colors can be changed.
[0075] Through the above steps, video data sent by a video acquisition device is received; the video data includes an image of a grass carp to be detected; the collected original image is threshold segmented by an image enhancement clustering algorithm to obtain a mask image; the mask image is corroded and expanded to remove small impurities and noise points; the mask image is synthesized with the original image to generate a first image; the first image includes a single fish image and an overlapping fish image; the overlapping fish images are separated by an improved watershed algorithm to obtain a second image; the single fish image and the second image are input into a pre-trained detection model to obtain a recognition result; according to the recognition result of the detection model, the image in the video data is detected for grass carp hemorrhagic disease, thereby achieving accurate detection of grass carp hemorrhagic disease and solving the problem of low detection accuracy existing in related technologies.
[0076] The present embodiment is described and illustrated below through specific examples.
[0077] A grass carp hemorrhagic disease detection system based on artificial intelligence (AI) is disclosed. The system comprises: a video capture device and a cloud-based analysis device, both of which are communicatively connected. The video capture device captures video data from a target location and transmits the video data to the cloud-based analysis device. The cloud-based analysis device is configured to execute the AI-based grass carp hemorrhagic disease detection method described in the embodiments of this application. The portable video capture device can capture and capture data on-site at the farm and transmit the video data to the cloud-based analysis system. The cloud-based analysis system performs data enhancement on the video data, employs a deep learning algorithm to automatically detect diseased fish, such as grass carp hemorrhagic disease, and transmits the analysis results to the user. This enables fast, low-cost, and convenient intelligent diagnosis of diseased fish, requiring no specialized user training. The AI-based grass carp hemorrhagic disease detection method described in the embodiments of this application is based on Internet of Things (IoT) technology and a cloud-based AI detection algorithm. The IoT technology primarily includes video capture and transmission functions, while the cloud-based AI algorithm performs data enhancement and optimization on the captured data, automatically classifying and segmenting fish in the video. The convolutional neural network algorithm incorporates an optimized self-attention mechanism module to focus on the characteristics of both diseased and healthy fish. After the video is transmitted to the cloud platform, the cloud platform can rely on automatic detection algorithms to automatically identify and mark the diseased fish and send them to the user. The video acquisition device can be a portable data acquisition and transmission device with the function of uploading to the cloud server via wifi. It contains a battery and a direction angle control device to collect data from laboratories and fish ponds in farms. There are healthy grass carp, black carp and other freshwater farmed fish in the laboratories and fish ponds in farms, as well as fish suffering from GCHD (grass carp hemorrhagic disease). The collected video data is uploaded to the cloud server in real time for analysis. The cloud server contains modules for receiving data and analyzing video data based on artificial intelligence algorithms. The specific detection flow chart is as follows: Figure 3As shown, data acquisition obtains fish images, i.e., the original images in the aforementioned embodiment, and obtains a background mask image through an improved k-means algorithm and an enhanced watershed algorithm. A single fish image and a dense or overlapping fish image are obtained based on the background mask image and the fish image. The dense or overlapping fish image here is the overlapping fish image in the aforementioned embodiment. Adaptive separation is performed according to the enhanced watershed algorithm to obtain a separated fish image. The separated fish image here is the second image in the aforementioned embodiment. The single fish image and the separated fish image are input into a self-attention-based CNN model to obtain a healthy fish image and a sick fish image, and a detection result is output. In the detection result, healthy fish and sick fish are marked with detection frames of different colors.
[0078] The artificial intelligence algorithm detects the data enhancement algorithm of the GCHD module, and the artificial intelligence video data analysis module extracts the pictures in the video. The background is removed through the image enhancement k-means clustering algorithm to leave the fish part.
[0079] To separate the fish image from the background as completely as possible, the captured image is first thresholded to create a black-and-white mask image. The mask image is then eroded and dilated to remove small impurities and noise. Finally, the mask is combined with the original image to create an image with a pure black background and the fish intact. To achieve the best possible separation, a modified k-means clustering thresholding algorithm is used.
[0080] K-means clustering is an iterative clustering analysis algorithm. Its core idea is to assign data points to the nearest cluster center by calculating the distance between the cluster center and each point. The position of the cluster center is updated through continuous iteration until the optimal cluster solution is found. For image data, each pixel point on the RGB image contains x-coordinate, y-coordinate, R component value, G component value, and B component value. The R, G, and B component values represent the color information of the pixel point. When k-means clustering is applied to the image, the color information of the pixel point needs to be converted into the z component in the Euclidean distance calculation formula. Figure 4(a) is the original image. The k-means clustering algorithm usually uses the Euclidean distance to calculate the distance between the cluster center point and each point, and extends it to apply to three-dimensional image data. Its formula is shown in (1).
[0081]
[0082] In Equation 1, x and y are the horizontal and vertical coordinates of the image pixel, respectively, and z represents the grayscale value of the pixel. Conventional k-means image clustering algorithms usually calculate the average value of the three color components (R, G, B), as shown in formula (2). The clustering effect is shown in Figure 4(b).
[0083] z=(R (x,y) +G (x,y) +B (x,y) ) / 3 (2)
[0084] In Formula 2, R(x,y), G(x,y), and B(x,y) are the grayscale values of the current pixel in the R, G, and B color channels, respectively.
[0085] Due to the limitations of ambient light intensity and the aquarium environment, the conventional k-means image clustering algorithm is difficult to accurately separate the fish image from the aquarium background. Therefore, the conventional k-means image clustering algorithm was improved. Juvenile zebrafish and diseased fish appear yellow-black in vision, so the grayscale values in the R and G components are higher and the grayscale value in the B component is lower. In order to increase the distinction between the fish image and the image background, the k-means image clustering formula was improved. The R and G components were squared, and then the color information of the pixel point was converted into the z component in the Euclidean distance calculation formula. The formula is shown in (3). The clustering effect is shown in Figure 4(c). By comparing Figure 4(b) with Figure 4(c), it can be found that the clustering effect of Figure 4(c) is significantly better than that of Figure 4(b).
[0086]
[0087] Each fish image is segmented and extracted using an enhanced watershed algorithm, and then used in the server's neural network for identification.
[0088] After classifying the single fish image and the overlapping fish image, the improved watershed algorithm is used to automatically separate the overlapping images of multiple fish. First, the overlapping images of multiple fish (as shown in Figure 5(a)) are grayscaled to obtain a grayscale image; secondly, the grayscale image is continuously eroded to obtain its distance gradient map, as shown in Figure 5(b); finally, adaptive separation is performed based on the distance grayscale map to obtain the seed points and dividing lines between each fish, as shown in Figure 5(b). Figure 5(c) and 5(d) The segmented images of a single fish are shown in Figure 5(e) and Figure 5(f). Although the fish are similar in shape and size, their form will deform as they swim, and the conventional watershed algorithm will result in over-segmentation. Therefore, a threshold for seed point area is added to the algorithm. The number of pixels in the seed point is used as the judgment criterion, and pseudo seed points with too small an area value are discarded to avoid over-segmentation. In this algorithm, the minimum threshold for seed points is set to 50 pixels.
[0089] The server artificial intelligence algorithm mainly includes convolutional neural network modules, such as Figure 6 As shown. The structure of the self-attention mechanism is as follows Figure 7 As shown, the input data is first allowed to have dynamic batch sizes and sequence lengths through the inputspec class in Keras. This allows the layer to process input sequences of variable length. Secondly, the attention score is determined by calculating the dot product between the query, key, and value. The output dimension (i.e., embedding dimension) of the query, key, and value projection layer is set to 64. Then, to prevent the score from becoming too large before calculating the softmax, the attention score is scaled. Finally, the attention weight is applied to the corresponding value, generating a weighted sum, thereby aggregating the relevant information in the input according to the importance determined by the attention mechanism. The final output is obtained through the Output Linear Layer.
[0090] The neural network is trained by labeling sick and healthy fish in the images extracted from the video. Once trained, the AI can automatically identify new videos. The recognition results are then transmitted back to the user terminal. The blue frame in Figure 8(a) represents the captured image of a school of fish. After data processing, the image is fed into the neural network, which distinguishes between sick and healthy fish. The results are fed back through frames of different colors, as shown in Figure 8(b). In the diagram, the red frame represents sick fish, and the green frame represents healthy fish. The colors can be changed.
[0091] Traditional biochemical testing methods require highly specialized personnel training and require the fish to be brought ashore for individual testing, which consumes a lot of time, energy, and reagent and consumable costs. This application performs a scanning, panoramic test of the entire group, using IoT technology to reduce the need for specialized personnel training and testing equipment. The test success rate exceeds 95%, and the trained artificial intelligence cloud diagnostic platform can obtain a large amount of data, continuously improving detection accuracy. The constructed digital system connects the data between the testing center and the farm through cloud data, enabling real-time and rapid industrial application.
[0092] In one specific embodiment, fish were injected with GCRV (Grass Carp Reovirus) and then placed in a group of rare goby crucian carp. After 2 days, the IoT real-time detection was performed. The video images of the fish school were transmitted to the cloud and uploaded to the computer for analysis, including data processing and neural network. The detection results were fed back and the cloud webpage section was as follows: Figure 9 As shown, the detection boxes for healthy fish and diseased fish, as well as the confidence levels, are fed back to users through the cloud. After laboratory testing, the detection success rate reached 99%.
[0093] It should be noted that the steps shown in the above process or the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0094] This embodiment also provides an artificial intelligence-based device for detecting hemorrhagic disease in grass carp. This device is used to implement the above-mentioned embodiments and preferred embodiments, and details already described will not be repeated. The terms "module," "unit," "subunit," etc. used below may refer to a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation using hardware, or a combination of software and hardware, is also possible and contemplated.
[0095] The device includes: a receiving module for receiving video data sent by a video acquisition device; the video data includes an image of a grass carp to be detected; a segmentation module for performing threshold segmentation on the collected original image through an image enhancement clustering algorithm to obtain a mask image; performing corrosion and expansion on the mask image to remove small impurities and noise points; synthesizing the mask image with the original image to generate a first image; the first image includes a single fish image and overlapping fish images; a separation module for separating the overlapping fish images through an improved watershed algorithm to obtain a second image; a recognition module for inputting the single fish image and the second image into a pre-trained detection model to obtain a recognition result; and performing grass carp hemorrhagic disease detection on the image in the video data according to the recognition result of the detection model.
[0096] It should be noted that the above modules can be functional modules or program modules, and can be implemented through software or hardware. For modules implemented through hardware, the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.
[0097] This embodiment further provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0098] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0099] Optionally, in this embodiment, the processor may be configured to execute the following steps through a computer program:
[0100] S1, receiving video data sent by a video acquisition device; the video data includes an image of a grass carp to be detected;
[0101] S2, performing threshold segmentation on the collected original image using an image enhancement clustering algorithm to obtain a mask image;
[0102] S3, erosion and dilation of the mask image to remove small impurities and noise points;
[0103] S4, synthesizing the mask image and the original image to generate a first image; the first image includes a single fish image and an overlapping fish image;
[0104] S5, separating the overlapping fish images by using an improved watershed algorithm to obtain a second image;
[0105] S6, inputting the single fish image and the second image into a pre-trained detection model to obtain a recognition result;
[0106] S7, performing grass carp hemorrhagic disease detection on the images in the video data according to the recognition result of the detection model.
[0107] It should be noted that, for specific examples in this embodiment, reference may be made to the examples described in the above embodiments and optional implementation modes, and will not be repeated in this embodiment.
[0108] In addition, in conjunction with the artificial intelligence-based grass carp hemorrhagic disease detection method provided in the above embodiment, this embodiment may also provide a storage medium for implementation. The storage medium stores a computer program; when the computer program is executed by a processor, it implements any of the artificial intelligence-based grass carp hemorrhagic disease detection methods in the above embodiment.
[0109] It should be understood that the specific embodiments described herein are only used to explain this application and are not used to limit it. Based on the embodiments provided in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0110] Obviously, the accompanying drawings are merely examples or embodiments of the present application. A person skilled in the art can also apply the present application to other similar situations based on these drawings without inventive effort. Furthermore, it is understandable that, although the work involved in this development process may be complex and lengthy, certain design, manufacturing, or production changes based on the technical content disclosed in this application are merely routine technical means for a person skilled in the art and should not be considered to constitute a deficiency in the disclosure of the present application.
[0111] The term "embodiment" as used in this application refers to specific features, structures, or characteristics described in conjunction with the embodiment that can be included in at least one embodiment of this application. The appearance of this phrase in various places in the specification does not necessarily mean that the embodiment is the same, nor does it mean that it is mutually exclusive with other embodiments and is independent or optional. It is understood, either explicitly or implicitly, by those skilled in the art that the embodiments described in this application can be combined with other embodiments when there is no conflict.
[0112] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of patent protection. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.
Claims
1. A method for detecting hemorrhagic disease of grass carp based on artificial intelligence, characterized in that: The method comprises: receiving video data sent by a video acquisition device; wherein the video data includes an image of a grass carp to be detected; The collected original image is subjected to threshold segmentation using an image enhancement clustering algorithm to obtain a mask image; Perform corrosion and expansion on the mask image to remove small impurities and noise points; synthesizing the mask image with the original image to generate a first image; the first image includes a single fish image and an overlapping fish image; Separating the overlapping fish images by an improved watershed algorithm to obtain a second image; Inputting the single fish image and the second image into a pre-trained detection model to obtain a recognition result; According to the recognition result of the detection model, the image in the video data is detected for grass carp hemorrhagic disease.
2. The method for detecting hemorrhagic disease of grass carp based on artificial intelligence according to claim 1, characterized in that: The threshold segmentation of the collected original image by using the image enhancement clustering algorithm includes performing the threshold segmentation on the collected original image using the following formula: Among them, x and y are the horizontal and vertical coordinates of the image pixel respectively, and z represents the color grayscale value of the pixel; The R and G components are squared, and then the color information of the pixel is converted into the z component in the Euclidean distance calculation formula.
3. The method for detecting hemorrhagic disease of grass carp based on artificial intelligence according to claim 1, wherein: Separating the overlapping fish images by an improved watershed algorithm to obtain a second image comprises: Gray-scaling the overlapping fish images to obtain a grayscale image; Obtaining a distance gradient map of the grayscale image; According to the distance gradient map, the seed points and dividing lines between the fish are obtained; The second image is generated according to the seed point and the boundary line.
4. The method for detecting hemorrhagic disease of grass carp based on artificial intelligence according to claim 3, wherein: The obtaining of the distance gradient map of the grayscale image includes: corroding the grayscale image to obtain the distance gradient map of the grayscale image.
5. The method for detecting hemorrhagic disease of grass carp based on artificial intelligence according to claim 3, characterized in that: The method of separating the overlapping fish images by an improved watershed algorithm to obtain a second image further includes: using the number of pixels of the seed point as a judgment criterion and discarding pseudo seed points whose area value is smaller than a preset value.
6. The method for detecting hemorrhagic disease of grass carp based on artificial intelligence according to claim 1, characterized in that: The step of inputting the single fish image and the second image into a pre-trained detection model to obtain a recognition result includes: inputting the single fish image and the second image into a pre-trained detection model to obtain a marking box; the marking box is used to identify the status of the grass carp.
7. The method for detecting hemorrhagic disease of grass carp based on artificial intelligence according to claim 6, characterized in that: The performing grass carp hemorrhagic disease detection on the image in the video data according to the recognition result of the detection model includes: performing grass carp hemorrhagic disease detection on the image in the video data according to the marking frame.
8. An artificial intelligence-based grass carp hemorrhagic disease detection system, characterized in that: The system includes: a video acquisition device and a cloud analysis device, wherein the video acquisition device and the cloud analysis device are communicatively connected; The video acquisition device collects video data of the target location and sends the video data to the cloud analysis device; The cloud analysis device is used to execute the artificial intelligence-based grass carp hemorrhagic disease detection method according to any one of claims 1 to 7.
9. An artificial intelligence-based device for detecting hemorrhagic disease of grass carp, characterized in that: The device comprises: A receiving module, configured to receive video data sent by a video acquisition device; the video data including an image of a grass carp to be detected; The segmentation module is used to perform threshold segmentation on the collected original image using an image enhancement clustering algorithm to obtain a mask image; perform corrosion and expansion on the mask image to remove small impurities and noise points; and synthesize the mask image with the original image to generate a first image; the first image includes a single fish image and an overlapping fish image; a separation module, configured to separate the overlapping fish images by using an improved watershed algorithm to obtain a second image; The recognition module is used to input the single fish image and the second image into a pre-trained detection model to obtain a recognition result; and based on the recognition result of the detection model, perform grass carp hemorrhagic disease detection on the image in the video data.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the grass carp hemorrhagic disease detection method based on artificial intelligence according to any one of claims 1 to 7 are implemented.