A fish disease early warning method, a terminal device, and a storage medium
By acquiring underwater images of fish and water quality data, calculating image enhancement gating factors for image enhancement processing, and combining multi-source data for fish disease assessment, the problem of inaccurate fish disease detection in existing technologies has been solved, achieving precise fish disease detection and risk warning.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SOUTHERN BRANCH OF CHINA COMM CONSTR CO LTD
- Filing Date
- 2026-01-21
- Publication Date
- 2026-06-05
AI Technical Summary
Existing fish disease detection methods rely on human experience and judgment, which leads to inaccurate diagnosis and makes it difficult to achieve accurate diagnosis.
By acquiring underwater images and water quality data of the waters where the fish are located, image enhancement gating factors are calculated for image enhancement processing. Multi-source data is combined to assess fish diseases, and machine learning models are used for disease detection and risk prediction.
It enables adaptive, interpretable, and precise fish disease detection based on the current water quality environment, improving the accuracy and reliability of the detection results.
Smart Images

Figure CN122156030A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of data processing technology, and in particular relates to a method, terminal device and storage medium for early warning of fish diseases. Background Technology
[0002] With the continuous expansion of marine ranching, the early detection and accurate diagnosis of fish diseases have become key factors restricting the safety and economic benefits of aquaculture. Current fish disease monitoring mainly relies on manual inspections, using human experience to judge whether fish are at risk of disease. This method, based on human experience, is subject to human factors and is prone to inaccurate disease diagnosis. Summary of the Invention
[0003] This application provides a method, terminal device, and storage medium for early warning of fish diseases, which can solve the problem of inaccurate fish disease diagnosis.
[0004] In a first aspect, embodiments of this application provide a method for early warning of fish diseases, including:
[0005] Acquire underwater images of the waters where the fish is located and water quality data of the waters, wherein the underwater images and water quality data are acquired at the same time, the underwater images are images of the fish in the underwater environment, and the water quality data includes turbidity and chlorophyll concentration; Based on the turbidity and the chlorophyll concentration, an image enhancement gating factor is calculated, wherein the image enhancement gating factor is a coefficient that adjusts the image enhancement intensity; The underwater image is enhanced based on the image enhancement gating factor to obtain the target image. Based on the target image, fish diseases are assessed, and early warning results for fish diseases are obtained.
[0006] In this application, underwater images and water quality data of the water area where the fish is located are first acquired. The water quality data includes turbidity and chlorophyll concentration. An image enhancement gating factor is calculated based on the turbidity and chlorophyll concentration. Then, the underwater image is enhanced based on the image enhancement gating factor to obtain the target image. Finally, fish disease detection is performed based on the target image. This application uses turbidity and chlorophyll concentration to calculate the image enhancement gating factor, enabling adaptive, interpretable, and precise image enhancement based on the current water quality environment during underwater image enhancement processing. This makes the processed underwater image more accurate, and consequently, the final fish disease detection results more accurate.
[0007] Secondly, embodiments of this application provide a fish disease early warning device, comprising: The data acquisition module is used to acquire underwater images of the water area where the fish is located and water quality data of the water area. The underwater images and water quality data are acquired at the same time. The underwater images are images of the fish in the underwater environment. The water quality data includes turbidity and chlorophyll concentration. The parameter calculation module is used to calculate the image enhancement gating factor based on the turbidity and the chlorophyll concentration, wherein the image enhancement gating factor is a coefficient that adjusts the image enhancement intensity; The image enhancement module is used to perform image enhancement processing on the underwater image based on the image enhancement gating factor to obtain the target image; The results output module is used to assess fish diseases based on the target image and obtain early warning results for fish diseases.
[0008] Thirdly, embodiments of this application provide a terminal device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the fish disease early warning method described in any one of the first aspects above.
[0009] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the fish disease early warning method described in any one of the first aspects above.
[0010] Fifthly, embodiments of this application provide a computer program product that, when run on a terminal device, causes the terminal device to execute the fish disease early warning method described in any of the first aspects above. Attached Figure Description
[0011] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0012] Figure 1 This is a flowchart illustrating a fish disease early warning method provided in an embodiment of this application; Figure 2 This is a schematic flowchart of a method for determining image enhancement gating factors according to an embodiment of this application; Figure 3 This is a schematic flowchart of a defogging method provided in an embodiment of this application; Figure 4This is a schematic flowchart of a brightness correction processing method provided in an embodiment of this application; Figure 5 This is a flowchart illustrating a method for predicting fish diseases according to an embodiment of this application; Figure 6 This is a flowchart illustrating a method for predicting fish diseases by combining fish disease knowledge, provided in an embodiment of this application. Figure 7 This is a schematic diagram of the architecture for fish disease early warning provided in one embodiment of this application; Figure 8 This is a schematic diagram of the structure of a fish disease early warning device provided in one embodiment of this application; Figure 9 This is a schematic diagram of the structure of a terminal device provided in an embodiment of this application. Detailed Implementation
[0013] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0014] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0015] References to "one embodiment" or "some embodiments" in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized.
[0016] Currently, fish disease detection generally employs either empirical methods or individual testing methods. Empirical methods rely on human experience, observing water conditions or fish swimming behavior to determine the presence of disease in fish. Individual testing methods assess the overall condition of fish in the water by examining the disease in a single fish.
[0017] The empirical method is heavily influenced by subjective human factors, which can easily lead to inaccurate fish disease detection. Similarly, the individual testing method, because a single fish can only represent the condition of that individual fish, using the condition of a single fish to judge the condition of all fish in the entire body of water will also result in inaccurate fish disease detection.
[0018] Based on this, this application proposes a method for early warning of fish diseases, which uses both underwater images and water quality data to determine fish diseases. Specifically, an image enhancement gating factor is first calculated based on the water quality data. This gating factor is then used to enhance the underwater images, resulting in more accurate and clearer underwater images. These clearer images are then used to assess fish diseases, making the early warning results more accurate.
[0019] Furthermore, after image enhancement processing of the underwater images to obtain the processed underwater images, fish diseases can be assessed together with the processed underwater images and water quality data. Using multi-source data for fish disease assessment makes the early warning results of fish diseases more accurate.
[0020] The following combination Figure 1 The fish disease early warning method of this application embodiment will be described in detail.
[0021] Figure 1 A schematic flowchart of the fish disease early warning method provided in this application is shown, with reference to... Figure 1 The method is described in detail below: S101, acquire underwater images of the water area where the fish is located and water quality data of the water area, wherein the underwater images and water quality data are acquired at the same time, the underwater images are images of the fish in the underwater environment, and the water quality data includes turbidity and chlorophyll concentration.
[0022] In this embodiment, underwater video is captured using a camera device, and underwater images are extracted from the underwater video. The underwater images reflect real-time characteristics of the fish's state, such as their appearance and behavior. The underwater images contain images of fish.
[0023] Water quality data is collected using water quality sensors. This data can include turbidity, chlorophyll concentration, salinity, pH value, dissolved oxygen, etc. The water quality data reflects the objective state of the fish's living environment.
[0024] S102, based on the turbidity and the chlorophyll concentration, calculate the image enhancement gating factor, wherein the image enhancement gating factor is a coefficient that adjusts the image enhancement intensity.
[0025] In one implementation, a gating data table is pre-stored, containing a mapping relationship between turbidity, chlorophyll concentration, and image enhancement gating factors. Based on the turbidity and chlorophyll concentration, the desired image enhancement gating factor is obtained by querying the gating data table.
[0026] In another implementation, such as Figure 2As shown, the method for determining the image enhancement gating factor may also include: S11, the turbidity is normalized to obtain the normalized turbidity.
[0027] In this embodiment, the formula is used The turbidity was normalized, among which... The turbidity is the normalized value. Turbidity The preset minimum turbidity value, This is the preset maximum turbidity value. is the cutoff function, which is used to limit the normalized turbidity to the interval [0, 1].
[0028] S12, the chlorophyll concentration is normalized to obtain the normalized chlorophyll concentration.
[0029] In this embodiment, the formula is used The chlorophyll concentration was normalized, among which, This represents the normalized chlorophyll concentration. Chlorophyll concentration, This is the preset minimum chlorophyll concentration. This is the preset maximum chlorophyll concentration. This is the cutoff function, which is used to restrict the normalized chlorophyll concentration to the interval [0, 1].
[0030] S13, search for the pre-stored first weight of the turbidity and the second weight of the chlorophyll concentration.
[0031] S14, calculate the image enhancement gating factor based on the normalized turbidity, the normalized chlorophyll concentration, the first weight, and the second weight.
[0032] In this embodiment, the normalized turbidity is multiplied by a first weight to obtain a first value; the normalized chlorophyll concentration is multiplied by a second weight to obtain a second value; and the first value is multiplied by the second value to obtain the image enhancement gating factor. A truncation function is used to restrict the image enhancement gating factor to the interval [0, 1]. The first value plus the second value equals 1.
[0033] S103, perform image enhancement processing on the underwater image based on the image enhancement gating factor to obtain the target image.
[0034] In this embodiment, the image enhancement gating factor and the underwater image are input into the image processing model to obtain the target image.
[0035] Image enhancement processing may include at least one of dehazing, contrast enhancement, brightness correction, and sharpening. Additionally, image enhancement processing may also include color correction (also known as white balance).
[0036] S104, Based on the target image, assess the fish disease and obtain the early warning result of the fish disease.
[0037] In this embodiment, feature analysis is performed on the target image to obtain image features. The image features characterize the features of the fish in the target image, and the early warning result of fish diseases is determined based on the image features.
[0038] In this application, underwater images and water quality data of the water area where the fish is located are first acquired. The water quality data includes turbidity and chlorophyll concentration. An image enhancement gating factor is calculated based on the turbidity and chlorophyll concentration. Then, the underwater image is enhanced based on the image enhancement gating factor to obtain the target image. Finally, fish disease detection is performed based on the target image. This application uses turbidity and chlorophyll concentration to calculate the image enhancement gating factor, enabling adaptive, interpretable, and precise image enhancement based on the current water quality environment during underwater image enhancement processing. This makes the processed underwater image more accurate, and consequently, the final fish disease detection results more accurate.
[0039] In one possible implementation, when performing image enhancement processing on an underwater image, the parameters used for image enhancement processing can be corrected first using an image enhancement gating factor, and then the underwater image can be enhanced using the corrected parameters to obtain a target image, where the target image is the underwater image after image enhancement processing.
[0040] Specifically, such as Figure 3 As shown, when image enhancement processing includes dehazing, the process of determining the target image may include: S21, Obtain the image fogging degree of the underwater image.
[0041] In this embodiment, the degree of image fogging refers to a quantitative or qualitative description of the decrease in image clarity, reduced contrast, and color distortion caused by suspended particles (such as fog, haze, and dust).
[0042] The degree of image fogging in underwater images is determined using a dark channel estimation algorithm.
[0043] S22, the image enhancement gating factor and the image fogging degree are input into the defogging parameter determination model to obtain the defogging intensity parameter.
[0044] The defogging parameter determination model includes: ; s is the defogging intensity parameter, This is the preset minimum defogging intensity. This is the preset maximum defogging intensity. These are the weighting coefficients. The degree of fogging in the image. The image enhancement gating factor is defined as x and y, where x and y are preset boundary values. The truncation function is used to limit the defogging intensity parameter to between x and y, for example, x can be 0 and y can be 1.
[0045] S23, perform defogging processing on the underwater image based on the defogging intensity parameter to obtain the target image.
[0046] Specifically, when image enhancement processing includes contrast enhancement processing, the process of determining the target image may include: S31, the image enhancement gating factor is input into the contrast parameter determination model to obtain the contrast intensity parameter.
[0047] The contrast parameter determination model includes: , The contrast intensity parameter is... This is the preset minimum contrast intensity. This is the preset maximum contrast intensity. The image enhancement gating factor.
[0048] S32, perform contrast enhancement processing on the underwater image based on the contrast intensity parameter to obtain the target image.
[0049] In this embodiment, the contrast enhancement process is performed using the Contrast Limited Adaptive Histogram Equalization (CLAHE) method.
[0050] In another approach, before performing steps S31 to S32, the standard deviation of the underwater image brightness is obtained. If the standard deviation of the image brightness is less than a preset threshold, then the above-mentioned steps S31 to S32 are performed; if the standard deviation of the image brightness is greater than or equal to the preset threshold, then the underwater image does not need to be contrast enhanced.
[0051] Specifically, such as Figure 4 As shown, when image enhancement processing includes brightness correction processing, the process of determining the target image may include: S41, perform grayscale processing on the underwater image to obtain the pixel values of multiple pixels in the underwater image.
[0052] In this embodiment, the underwater image is converted to grayscale to obtain a grayscale image. The pixel value of each pixel in the grayscale image is the brightness value of that pixel.
[0053] S42, calculate the average pixel value of the multiple pixels to obtain the average pixel value of the underwater image.
[0054] S43, input the image enhancement gating factor and the average pixel value into the brightness coefficient determination model to obtain the brightness correction parameters.
[0055] The brightness coefficient determination model includes: , The brightness correction parameters are as follows. The average pixel value, The preset adjustment coefficient, The image enhancement gating factor, The preset lower limit of brightness. The preset upper limit of brightness. The truncation function is used to limit the brightness correction parameter between the lower brightness limit and the upper brightness limit.
[0056] S44, perform brightness correction processing on the underwater image based on the brightness correction parameters to obtain the target image.
[0057] Specifically, when image enhancement processing includes sharpening processing, the process of determining the target image may include: S51, the image enhancement gating factor is input into the sharpening coefficient determination model to obtain the sharpening intensity parameter.
[0058] The model for determining the sharpening coefficient includes: , The sharpening intensity parameter is... This is the preset minimum sharpening intensity. This is the preset maximum sharpening intensity. The image enhancement gating factor.
[0059] S52, the underwater image is sharpened based on the sharpening intensity parameter to obtain the target image.
[0060] Specifically, when image enhancement processing includes color correction processing, the process of determining the target image may include: Obtain the average value of the green channel and the average value of the red channel in the underwater image.
[0061] According to the formula Determine the green bias indicator, among which, It is a green-biased indicator; This represents the average value of the green channel. This represents the average value of the red channel. It is a preset positive number that is not zero.
[0062] If the green bias index is greater than the preset green bias threshold and / or the chlorophyll concentration is greater than the preset chlorophyll threshold, then it is determined that color correction processing is required for the underwater image.
[0063] If the green bias index is less than or equal to the preset green bias threshold and the chlorophyll concentration is less than or equal to the preset chlorophyll threshold, then it is determined that no color correction processing is required for the underwater image.
[0064] It should be noted that image enhancement processing includes multiple processes such as dehazing, contrast enhancement, brightness correction, sharpening, and color correction. After performing various image enhancement processes on the underwater image, the target image is obtained.
[0065] For example, if the image enhancement process includes dehazing, contrast enhancement, and brightness correction, the dehazing intensity parameters can be obtained first using steps S21 to S22 described above. Then, the underwater image can be dehazed based on these parameters to obtain a first image. Next, the contrast intensity parameters can be obtained using step S31 described above, and the first image can be contrast-enhanced based on these parameters to obtain a second image. Finally, the brightness correction parameters can be obtained using steps S41 to S44 described above, and the second image can be brightness-corrected based on these parameters to obtain the target image.
[0066] The above describes the image enhancement process. Below, we will introduce the process of identifying fish diseases. Specifically, such as... Figure 5 As shown, the implementation process of step S104 above may include: S1041, The target image is input into the trained first detection model, and the disease assessment of the fish in the target image is performed by the first detection model to obtain the disease detection result of the fish in the target image.
[0067] In this embodiment, the first detection model is a small model, such as a model built based on YOLOv8m.
[0068] Training the first detection model can include a first-stage training and a second-stage training. The first-stage training uses images of diseased fish in water (both above and near the surface) with clear texture and lesion representations as a sample set to train the first detection model, enabling it to acquire basic representation capabilities for fish morphology and lesion appearance features. The second-stage training uses underwater fish images collected in real-world scenes as a sample set to train the first detection model, allowing it to adapt to interference and occlusion in real-world scenes, thus improving its detection capability for images in real-world environments. During the second-stage training, a portion of the image feature extraction layer can be frozen first to train the detection head module. Then, the frozen image feature extraction layer can be thawed and trained again to further enhance the detection capability for small lesion features.
[0069] Disease detection results can include the presence of disease, suspected disease type, confidence interval, and fish species information. Disease detection results can be output in image or text format.
[0070] S1042, the water quality data is input into the trained second detection model, and the water quality data is analyzed by the second detection model to obtain the predicted disease risk of the fish. The first detection model and the second detection model are different models.
[0071] In this embodiment, the second detection model is a small model. For example, the second detection model adopts a machine learning model based on gradient boosting decision tree to model the nonlinear relationship between water quality data and fish disease occurrence.
[0072] In this embodiment, due to the difference in dimensions between different water quality data, in order to eliminate the difference in dimensions between different water body parameters and improve the stability of the training and inference of the second detection model, the water quality data can be normalized before being input into the second detection model. Specifically, a normalization process is adopted. The water quality data were normalized to obtain normalized water quality data; among which, For the normalized data, For the i-th water quality data, Let i be the minimum value of the parameter for the i-th water quality data. The maximum value of the parameter for the i-th water quality data point. This is a truncation function, used to restrict water quality data to between the minimum and maximum values of the parameter.
[0073] In this embodiment, historical water quality data and corresponding fish disease data are used as the training sample set. When training the second detection model, the training sample set is used; during training, a loss function, such as a binary classification loss function, is used to calculate the model loss value, and the parameters in the second detection model are updated based on the model loss value.
[0074] S1043, Based on the disease detection results and the disease risk prediction results, determine the early warning result of fish diseases.
[0075] In one implementation, the disease risk prediction results may include disease probability, key water quality parameters, and disease risk. Key water quality parameters are used to reflect the impact of the current water environment status on the occurrence and detection reliability of diseases. For example, key water quality parameters may include image enhancement gating factors, chlorophyll concentration, etc.
[0076] Disease risk can be determined based on disease probability. Specifically, if the disease probability is greater than the disease threshold, then there is a disease risk; if the disease probability is less than or equal to the disease threshold, then there is no disease risk. The disease threshold can be adjusted as needed to adapt to the disease early warning requirements of different aquaculture scenarios, fish species, or management strategies.
[0077] A comprehensive analysis of disease detection results and disease risk prediction results yields an early warning result for fish diseases. For example, if the disease detection result indicates the presence of disease and the disease probability is greater than a preset value, the early warning result is determined to be the presence of disease. If the disease detection result indicates the absence of disease and the disease probability is less than or equal to the preset value, the early warning result is determined to be the absence of disease. If the disease detection result indicates the absence of disease and / or the disease probability is greater than the preset value, the early warning result is determined to be a high disease rate. If the disease detection result indicates the presence of disease and / or the disease probability is less than or equal to the preset value, the early warning result is determined to be uncertain.
[0078] In this embodiment, the first detection model and the second detection model can be set in the local terminal device.
[0079] In another implementation, such as Figure 6 As shown, the methods for determining the early warning result may also include: S61, retrieve pre-stored fish disease knowledge data.
[0080] In this embodiment, a fish disease knowledge database is pre-created to store fish disease knowledge data. The fish disease knowledge database can be a vector database, such as the Milvus vector database, to meet the requirements of data controllability and stable operation.
[0081] The fish disease knowledge database stores knowledge about fish, including disease knowledge entries, behavioral disease association entries, and environmental disease association entries. Disease knowledge entries can include disease name, typical physical characteristics, development stage, susceptible fish species, and treatment recommendations. Behavioral disease association entries can include descriptions of the association between behaviors such as reduced feeding, abnormal swimming, and aggregation / isolation with disease types. Environmental disease association entries can include the correlation between environmental parameters such as water temperature, dissolved oxygen, turbidity, salinity, and pH and disease risk. Each knowledge object is generated with at least one vector representation upon being added to the database, and its associated metadata fields (such as disease category, fish species, scene tags, and applicable conditions) are retained, thus enabling a combined retrieval capability of "vector similarity retrieval + structured filtering."
[0082] Specifically, the creation process of a fish disease knowledge database may include: knowledge collection and standardization, vectorized encoding, local storage and index construction, and version management and updates.
[0083] Among them, knowledge acquisition and standardization are used to organize knowledge such as fish disease mechanisms, symptom descriptions, behavioral manifestations, environmental factors and treatment experience in a structured manner using software packages.
[0084] Vectorization encoding is used to call encoding models such as text / images to encode the collected and standardized content into vectors, so that semantically similar knowledge is closer together in the vector space.
[0085] Local ingestion and index building are used to write vectors and their metadata to the database and build vector indexes to support fast approximate nearest neighbor retrieval.
[0086] Version management and updates are used to perform incremental writes and maintain consistency of the knowledge base version when knowledge entries are updated or added, so as to adapt to the evolution of knowledge under different sea areas, different aquaculture objects or different seasons.
[0087] In this embodiment, fish disease knowledge data is retrieved from a fish disease knowledge database. Specifically, disease detection results and disease risk prediction results are converted into structured context data. A similarity search is performed between the context data and the data in the fish disease knowledge database to obtain knowledge entries that match the context data; these are denoted as fish disease knowledge data. Knowledge entries that match the context data are those with a similarity greater than a preset threshold. Fish disease knowledge data includes descriptions of disease characteristics, triggering conditions, typical symptoms, and recommended treatment methods.
[0088] S62, the disease detection results, the disease risk prediction results, and the fish disease knowledge data are input into the trained third detection model to obtain the early warning results of fish diseases, wherein the third detection model is a different model from the first detection model and the second detection model.
[0089] In this embodiment, the third detection model is a large model, such as the Qwen3 series of multimodal large models.
[0090] The third detection module can be set in the local terminal device.
[0091] Alternatively, the third detection model can be set up on a cloud server. Local terminal devices send disease detection results and disease risk prediction results to the cloud server. The cloud server then inputs the disease detection results, disease risk prediction results, and fish disease knowledge data into the trained third detection model to obtain early warning results for fish diseases. The third detection model can be used to perform semantic understanding and integration of disease detection results and disease risk prediction results, and combine them with fish disease knowledge data to complete the reasoning for the early warning results.
[0092] In this embodiment, fish disease knowledge data is input into the fish disease judgment and diagnosis generation process to perform factual constraints and knowledge verification on the output of the third detection model, so as to reduce the generation of uncertain reasoning and illusion output, and improve the reliability and verifiability of the diagnosis results.
[0093] The early warning results may include the type of fish disease, current water quality management recommendations, and factors that trigger the fish disease.
[0094] After receiving the early warning results, these results, along with water quality data, can be encoded to generate new knowledge entries, which are then stored in the fish disease knowledge database. These new knowledge entries can include the identified fish disease type; corresponding detection characteristics and environmental condition descriptions; a summary of the diagnostic criteria and treatment recommendations; and optional time, region, or aquaculture scenario identifiers. By vectorizing diagnosed fish disease cases and incrementally writing them into the knowledge base, the static knowledge base can continuously absorb new samples and experiences from real-world application scenarios. This gradually enhances the system's ability to identify similar scenarios during subsequent retrieval and reasoning processes, avoiding repeated erroneous judgments and improving the system's adaptability to different sea areas and aquaculture conditions.
[0095] In this application, the first and second detection models can ensure the real-time performance and stability of fish disease detection; the third detection model can improve the system's comprehensive understanding and decision-making ability in complex fish disease scenarios.
[0096] In one possible implementation, after receiving a warning result regarding fish disease, the warning result is displayed via a display module, and an alarm module issues an alert based on the warning result. The alarm module can also issue different alarms based on the severity level of the warning result.
[0097] In one possible implementation, such as Figure 7As shown, the terminal device in this application may include a data layer, a small model layer, a large model layer, and an application layer.
[0098] The data layer includes a video module, a water quality module, an image enhancement module, and a knowledge base. The small model layer includes a first detection model and a second detection model. The large model layer includes a third detection model. The application layer includes a display module and an alarm module.
[0099] The video module receives underwater images, and the water quality module receives water quality data. A knowledge base stores fish disease information. The video module sends underwater images to the image enhancement module, and the water quality module sends water quality data to the image enhancement module. The image enhancement module performs image enhancement processing on the underwater images based on the water quality data to obtain the target image.
[0100] The image enhancement module sends the target image to the first detection model, and the water quality module sends water quality data to the second detection model.
[0101] The first detection model outputs disease detection results based on the target image. The second detection model outputs disease risk prediction results based on water quality data. The first detection model sends the disease detection results to the third detection model. The second detection model sends the disease risk prediction results to the third detection model.
[0102] The third detection model generates early warning results for fish diseases based on disease detection results, disease risk prediction results, and fish disease knowledge data obtained from the knowledge base. The third detection model sends these early warning results to both the display module and the alarm module. The display module shows the early warning results. The alarm module issues an alarm based on the early warning results.
[0103] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0104] Corresponding to the fish disease early warning method described in the above embodiments, Figure 8 The diagram shows a structural block diagram of the fish disease early warning device provided in the embodiments of this application. For ease of explanation, only the parts related to the embodiments of this application are shown.
[0105] Reference Figure 8 The device 200 may include: a data acquisition module 210, a parameter calculation module 220, an image enhancement module 230, and a result output module 240.
[0106] The data acquisition module 210 is used to acquire underwater images of the water area where the fish is located and water quality data of the water area. The underwater images and water quality data are acquired at the same time. The underwater images are images of the fish in the underwater environment. The water quality data includes turbidity and chlorophyll concentration. The parameter calculation module 220 is used to calculate the image enhancement gating factor based on the turbidity and the chlorophyll concentration, wherein the image enhancement gating factor is a coefficient that adjusts the image enhancement intensity; Image enhancement module 230 is used to perform image enhancement processing on the underwater image based on the image enhancement gating factor to obtain a target image; The result output module 240 is used to assess fish diseases based on the target image and obtain early warning results for fish diseases.
[0107] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.
[0108] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0109] This application also provides a terminal device, see [link to relevant documentation] Figure 9 The terminal device 400 may include: at least one processor 410, a memory 420, and a computer program stored in the memory 420 and executable on the at least one processor 410. When the processor 410 executes the computer program, it implements the steps in any of the above method embodiments, for example... Figure 1 Steps S101 to S104 in the illustrated embodiment. Alternatively, when the processor 410 executes the computer program, it implements the functions of each module / unit in the above-described device embodiments, for example... Figure 8The functions of the data acquisition module 210 to the result output module 240 are shown.
[0110] For example, a computer program may be divided into one or more modules / units, one or more of which are stored in memory 420 and executed by processor 410 to complete this application. The one or more modules / units may be a series of computer program segments capable of performing a specific function, which are used to describe the execution process of the computer program in terminal device 400.
[0111] Those skilled in the art will understand that Figure 9 This is merely an example of a terminal device and does not constitute a limitation on the terminal device. It may include more or fewer components than shown, or combine certain components, or different components, such as input / output devices, network access devices, buses, etc.
[0112] The processor 410 can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.
[0113] The memory 420 can be an internal storage unit of the terminal device or an external storage device, such as a plug-in hard drive, a smart media card (SMC), a secure digital (SD) card, or a flash card. The memory 420 is used to store the computer program and other programs and data required by the terminal device. The memory 420 can also be used to temporarily store data that has been output or will be output.
[0114] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.
[0115] The fish disease early warning method provided in this application embodiment can be applied to terminal devices such as computers, tablets, laptops, netbooks, and personal digital assistants (PDAs). This application embodiment does not impose any restrictions on the specific type of terminal device.
[0116] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0117] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0118] In the embodiments provided in this application, it should be understood that the disclosed terminal devices, apparatuses, and methods can be implemented in other ways. For example, the terminal device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interfaces, apparatuses, or units, and may be electrical, mechanical, or other forms.
[0119] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0120] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0121] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by one or more processors, it can implement the steps of the various method embodiments described above.
[0122] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by one or more processors, it can implement the steps of the various method embodiments described above.
[0123] Similarly, as a computer program product, when the computer program product is run on a terminal device, it enables the terminal device to implement the steps in the above-described method embodiments.
[0124] The computer program includes computer program code, which can be in the form of source code, object code, executable file, or some intermediate form. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium can be appropriately added or removed according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media may not include electrical carrier signals and telecommunication signals.
[0125] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A method for early warning of fish diseases, characterized in that, include: Acquire underwater images of the waters where the fish is located and water quality data of the waters, wherein the underwater images and water quality data are acquired at the same time, the underwater images are images of the fish in the underwater environment, and the water quality data includes turbidity and chlorophyll concentration; Based on the turbidity and the chlorophyll concentration, an image enhancement gating factor is calculated, wherein the image enhancement gating factor is a coefficient that adjusts the image enhancement intensity; The underwater image is enhanced based on the image enhancement gating factor to obtain the target image. Based on the target image, fish diseases are assessed, and early warning results for fish diseases are obtained.
2. The fish disease early warning method as described in claim 1, characterized in that, The calculation of the image enhancement gating factor based on the turbidity and the chlorophyll concentration includes: The turbidity is normalized to obtain the normalized turbidity; The chlorophyll concentration was normalized to obtain the normalized chlorophyll concentration. Find the first weight of the turbidity and the second weight of the chlorophyll concentration that are stored in advance; The image enhancement gating factor is calculated based on the normalized turbidity, the normalized chlorophyll concentration, the first weight, and the second weight.
3. The fish disease early warning method as described in claim 1, characterized in that, The image enhancement process includes dehazing; The step of performing image enhancement processing on the underwater image based on the image enhancement gating factor to obtain the target image includes: Obtain the image fogging degree of the underwater image; The image enhancement gating factor and the image fogging degree are input into the defogging parameter to determine the model, and the defogging intensity parameter is obtained. The underwater image is dehazed based on the dehazing intensity parameter to obtain the target image; The defogging parameter determination model includes: ; s is the defogging intensity parameter, This is the preset minimum defogging intensity. This is the preset maximum defogging intensity. These are the weighting coefficients. The degree of fogging in the image. The image enhancement gating factor is defined as x and y, where x and y are preset boundary values. The truncation function is used to limit the defogging intensity parameter to between x and y.
4. The fish disease early warning method according to any one of claims 1 to 3, characterized in that, The image enhancement process includes contrast enhancement processing; The step of performing image enhancement processing on the underwater image based on the image enhancement gating factor to obtain the target image includes: The image enhancement gating factor is input into the contrast parameter to determine the model, and the contrast intensity parameter is obtained. The underwater image is subjected to contrast enhancement processing based on the contrast intensity parameter to obtain the target image; The contrast parameter determination model includes: , The contrast intensity parameter is... This is the preset minimum contrast intensity. This is the preset maximum contrast intensity. The image enhancement gating factor.
5. The fish disease early warning method as described in claim 4, characterized in that, The image enhancement process includes brightness correction processing; The step of performing image enhancement processing on the underwater image based on the image enhancement gating factor to obtain the target image includes: The underwater image is converted to grayscale to obtain the pixel values of multiple pixels in the underwater image. The average pixel value of the underwater image is obtained by calculating the average pixel value of the multiple pixels. The image enhancement gating factor and the average pixel value are input into the brightness coefficient determination model to obtain the brightness correction parameters; The underwater image is subjected to brightness correction processing based on the brightness correction parameters to obtain the target image; The brightness coefficient determination model includes: , The brightness correction parameters are as follows. The average pixel value, The preset adjustment coefficient, The image enhancement gating factor, The preset lower limit value for brightness. The preset upper limit of brightness. The truncation function is used to limit the brightness correction parameter between the lower brightness limit and the upper brightness limit.
6. The fish disease early warning method as described in claim 5, characterized in that, The image enhancement process includes sharpening; The step of performing image enhancement processing on the underwater image based on the image enhancement gating factor to obtain the target image includes: The image enhancement gating factor is input into the sharpening coefficient to determine the model, and the sharpening intensity parameter is obtained. The underwater image is sharpened based on the sharpening intensity parameter to obtain the target image; The model for determining the sharpening coefficient includes: , The sharpening intensity parameter is... This is the preset minimum sharpening intensity. This is the preset maximum sharpening intensity. The image enhancement gating factor.
7. The fish disease early warning method as described in claim 1, characterized in that, The assessment of fish diseases based on the target image, to obtain early warning results for fish diseases, includes: The target image is input into the trained first detection model, and the disease assessment of the fish in the target image is performed by the first detection model to obtain the disease detection result of the fish in the target image. The water quality data is input into the trained second detection model, and the water quality data is analyzed by the second detection model to obtain the predicted disease risk of the fish. The first detection model and the second detection model are different models. Based on the disease detection results and the disease risk prediction results, the early warning results for fish diseases are determined.
8. The fish disease early warning method as described in claim 7, characterized in that, The determination of early warning results for fish diseases based on the disease detection results and the disease risk prediction results includes: Retrieve pre-stored fish disease knowledge data; The disease detection results, the disease risk prediction results, and the fish disease knowledge data are input into the trained third detection model to obtain the early warning results of fish diseases. The third detection model is different from the first detection model and the second detection model.
9. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the fish disease early warning method as described in any one of claims 1 to 8.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the fish disease early warning method as described in any one of claims 1 to 8.