Macrobrachium rosenbergii early-stage infection identification method based on motion detection
Through a method based on motion detection, the YOLO-V7 neural network model is used to predict the future movement trajectory of Macrobrachium rosenbergii and generate a climbing trajectory vector diagram, which solves the problem of difficulty in identifying early-stage infected shrimps, achieves efficient early-stage disease identification, and improves Recognition accuracy.
Patent Information
- Application Number
- CN202410393798.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-02
- Publication Date
- 2024-09-03
AI Technical Summary
It is difficult to identify early-stage disease in Macrobrachium rosenbergii with existing technology. Traditional manual observation and image detection methods cannot distinguish early-stage disease-infected shrimp from healthy shrimp because the external characteristics of early-stage disease-infected shrimp have not yet been expressed.
Using a method based on motion detection, we obtain the motion video of Macrobrachium rosenbergii, extract key frame images and mark the positions, use YOLO-V7 neural network model training and optimization to predict the future movement trajectory of the shrimp, and generate a climbing trajectory vector map. The degree of trajectory matching determines health status.
It achieved accurate identification of early-stage diseased Macrobrachium rosenbergii and improved the recognition rate. Compared with the single-target detection method, the recognition rate increased by 95.29%.
Smart Images

Figure CN118587242A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of deep learning technology, and in particular to a method for identifying early disease of Macrobrachium rosenbergii based on motion detection. Background Art
[0002] Macrobrachium rosenbergii not only has tender meat, delicious taste and rich nutrition, but also has high economic value, so it has always been loved by people.
[0003] WSSV is a viral disease that affects crustaceans, especially shrimp. The virus is transmitted through direct contact, water transmission, infection-mediated virus spread, etc., and can easily lead to large-scale infection of shrimp in the same waters. The static appearance of shrimp during the disease is: white spots appear on the body surface, about 1-3 mm in size, showing the iris of the shrimp body. The white spots first appear on the head, chest and tail of the shrimp, and then spread to the entire body surface. The shrimp's exoskeleton may become weak, and the shrimp body has an overall whitish appearance; the dynamic appearance of shrimp during the disease is: the infected shrimp may appear sluggish and listless when swimming, with a loss of appetite, and the shrimp may stop eating, resulting in growth stagnation. The incidence of iris virus infection varies in different stages. The incubation period is the early stage of infection, and the shrimp may not have obvious symptoms; small white spots begin to appear on the shrimp's body surface in the early stage, the shrimp's activity may weaken, and the appetite decreases; when the virus infection enters the acute stage, the shrimp's symptoms will worsen, and the obvious white spots will be more prominent on the shrimp's body surface. The shrimp's behavior is abnormal, and symptoms such as shrimp spasms and death may occur; some infected shrimp may have symptoms such as lighter body color and softer shrimp shells in the later stage. If the iris virus infection is too serious, there is a high probability that large-scale shrimp deaths will occur in shrimp farms.
[0004] At present, most of the quality grading standards for Macrobrachium rosenbergii use human sensory perception to judge the appearance quality of Macrobrachium rosenbergii to achieve product grade classification. Traditional classification of impurities or defective products needs to be eliminated through manual grading. In addition, since the disease characteristics of early diseased shrimp have not yet manifested themselves in external features, the appearance of early diseased shrimp is relatively similar to that of healthy shrimp, making it impossible to identify early diseased shrimp by traditional manual observation and image detection methods. Summary of the invention
[0005] In order to solve the above problems existing in the prior art, the present invention provides a method for identifying early-stage diseased Macrobrachium rosenbergii based on motion detection, which predicts the future motion trajectory of the Macrobrachium rosenbergii to be detected based on its short-term motion behavior, and determines its health status based on the shape characteristics of the future motion trajectory, thereby realizing accurate identification of early-stage diseased Macrobrachium rosenbergii. The technical solutions provided by the present invention are as follows: According to one aspect of an embodiment of the present invention, a method for identifying early disease of Macrobrachium rosenbergii based on motion detection is provided, wherein the method comprises: S10: obtaining a sample of Macrobrachium rosenbergii, wherein the sample of Macrobrachium rosenbergii includes an uninfected Macrobrachium rosenbergii and an infected Macrobrachium rosenbergii; S20: obtaining a motion video of each Macrobrachium rosenbergii in the Macrobrachium rosenbergii sample; for each motion video corresponding to the Macrobrachium rosenbergii, extracting a preset number of key frame images from the motion video through a video editor, and then using a labeling tool to label the position and area of the Macrobrachium rosenbergii in each key frame image; S30: Importing the labeled key frame images into the initialized YOLO-V7 neural network model in chronological order for training, presetting hyperparameters and performing iterative optimization during the training process to obtain a trained Macrobrachium rosenbergii motion prediction neural network model, wherein the Macrobrachium rosenbergii motion prediction neural network model is used to predict the position coordinates of Macrobrachium rosenbergii at subsequent preset continuous time points; S40: acquiring continuous position coordinates corresponding to each Macrobrachium rosenbergii through the Macrobrachium rosenbergii movement prediction neural network model, and for each Macrobrachium rosenbergii, generating and storing a corresponding climbing trajectory vector diagram according to the continuous position coordinates; S50: Input each key frame image corresponding to the Macrobrachium rosenbergii to be detected into the Macrobrachium rosenbergii motion prediction neural network model in chronological order, output the position coordinates of the Macrobrachium rosenbergii to be detected at subsequent preset continuous time points, and generate the corresponding climbing trajectory vector diagram to be detected, and determine the health status of the Macrobrachium rosenbergii to be detected according to the degree of matching between the climbing trajectory vector diagram to be detected and each climbing trajectory vector diagram corresponding to uninfected Macrobrachium rosenbergii and each climbing trajectory vector diagram corresponding to infected Macrobrachium rosenbergii.
[0006] In a preferred embodiment, the method further comprises: The comprehensive features of the trajectory route are extracted according to the climbing trajectory vector diagrams corresponding to the uninfected Macrobrachium rosenbergii, and the first reference route is obtained by fitting; The comprehensive features of the trajectory route are extracted according to the climbing trajectory vector diagrams corresponding to the infected Macrobrachium rosenbergii, and the second reference route is obtained by fitting; At this time, the step of determining the health status of the Macrobrachium rosenbergii to be detected according to the matching degree of the climbing trajectory vector diagram to be detected and each climbing trajectory vector diagram corresponding to the uninfected Macrobrachium rosenbergii and each climbing trajectory vector diagram corresponding to the infected Macrobrachium rosenbergii in S50 includes: The health status of the Macrobrachium rosenbergii to be tested is determined according to the matching degree between the climbing trajectory vector diagram to be tested and the first reference route and the second reference route.
[0007] In a preferred embodiment, the method further comprises: According to the infection degree of the infected Macrobrachium rosenbergii, a preset number of infection levels are divided, and the climbing trajectory vector diagrams corresponding to the Macrobrachium rosenbergii of different infection levels are respectively labeled with the corresponding infection levels; When it is detected that the climbing trajectory vector diagram corresponding to the Macrobrachium rosenbergii to be detected matches the climbing trajectory vector diagram corresponding to the infected Macrobrachium rosenbergii, the label corresponding to the matched climbing trajectory vector diagram is obtained, and the infection level of the Macrobrachium rosenbergii to be detected is determined according to the label.
[0008] In a preferred embodiment, the method further comprises: Perform feature visualization of the target detection results of the YOLO-V7 neural network model based on a heat map; The step of visualizing the features of the target detection results of the YOLO-V7 neural network model based on the heat map includes: Initialize the YOLO-V7 neural network model, calculate the output value with category label and the intermediate output result of the feature map in the backbone module, and then in each round of back-propagation iteration, obtain the gradient of each feature map of the target layer of the Macrobrachium rosenbergii in the key frame image relative to the backbone module by calculation, and retain the effective gradient; Perform global average pooling on the gradient of the target layer, perform dot multiplication on the processed gradient matrix and the output matrix of the target layer to obtain an initialized matrix grayscale image; The pseudo-color image processing algorithm is used to average the gradient image to obtain a scalar, and then the result is put into the original image to add different colors to form a color map corresponding to the weights of different feature areas for visualization.
[0009] In a preferred embodiment, after obtaining a trained neural network model for predicting the movement of Macrobrachium rosenbergii, each key frame image corresponding to each uninfected Macrobrachium rosenbergii and infected Macrobrachium rosenbergii in a test set is input into the neural network model for predicting the movement of Macrobrachium rosenbergii for performance testing, and performance evaluation is performed based on the degree of match between the predicted position coordinates of subsequent preset continuous time points and the actual position coordinates.
[0010] In a preferred embodiment, the labeling tool adopts Labelimg software.
[0011] In a preferred embodiment, the key frame extraction tool adopts Video Annotator software.
[0012] In a preferred embodiment, the Macrobrachium rosenbergii samples include Macrobrachium rosenbergii of different genders, origins, environments, and body sizes.
[0013] Compared with the prior art, the method for identifying early disease of Macrobrachium rosenbergii based on motion detection provided by the present invention has the following advantages: The present invention provides a method for identifying early disease of Macrobrachium rosenbergii based on motion detection, which comprises the following steps: obtaining a Macrobrachium rosenbergii sample; obtaining a motion video of each Macrobrachium rosenbergii in the Macrobrachium rosenbergii sample, extracting a preset number of key frame images from the motion video through a video editor, and then using a labeling tool to label the position and area of the Macrobrachium rosenbergii in each key frame image; importing the labeled key frame images into an initialized YOLO-V7 neural network model in chronological order for training, presetting hyperparameters and performing iterative optimization during the training process to obtain a trained Macrobrachium rosenbergii motion prediction neural network model, wherein the Macrobrachium rosenbergii motion prediction neural network model is used to predict the position coordinates of the Macrobrachium rosenbergii at subsequent preset continuous time points; obtaining the continuous coordinates corresponding to each Macrobrachium rosenbergii through the Macrobrachium rosenbergii motion prediction neural network model Position coordinates, for each Macrobrachium rosenbergii, a corresponding climbing trajectory vector diagram is generated and stored according to the continuous position coordinates; each key frame image corresponding to the Macrobrachium rosenbergii to be detected is input into the Macrobrachium rosenbergii motion prediction neural network model in chronological order, and the position coordinates of the Macrobrachium rosenbergii to be detected at subsequent preset continuous time points are output, and the corresponding climbing trajectory vector diagram to be detected is generated, and the health status of the Macrobrachium rosenbergii to be detected is determined according to the matching degree between the climbing trajectory vector diagram to be detected and the climbing trajectory vector diagrams corresponding to the uninfected Macrobrachium rosenbergii and the climbing trajectory vector diagrams corresponding to the infected Macrobrachium rosenbergii, thereby realizing the prediction of the future motion trajectory of the Macrobrachium rosenbergii according to the short-term motion behavior of the Macrobrachium rosenbergii, and determining its health status according to the shape characteristics of the future motion trajectory, so as to realize the accurate identification of the early infected Macrobrachium rosenbergii. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0015] Figure 1 The present invention is a flowchart showing a method for identifying early disease of Macrobrachium rosenbergii based on motion detection according to an exemplary embodiment of the present invention.
[0016] Figure 2 The figure is a schematic diagram of a shooting scene of a Macrobrachium rosenbergii motion video according to an exemplary embodiment.
[0017] Figure 3 The figure is a schematic diagram showing the actual climbing position change of Macrobrachium rosenbergii according to an exemplary embodiment.
[0018] Figure 4 The figure is a schematic diagram showing the generation of a climbing trajectory vector diagram according to an exemplary embodiment.
[0019] Figure 5 The figure is a climbing trajectory vector diagram corresponding to an uninfected Macrobrachium rosenbergii according to an exemplary embodiment.
[0020] Figure 6 The figure is a climbing trajectory vector diagram corresponding to a diseased Macrobrachium rosenbergii, shown according to an exemplary embodiment.
[0021] Figure 7 It is a schematic diagram of a heat map corresponding to Macrobrachium rosenbergii according to an exemplary embodiment. DETAILED DESCRIPTION
[0022] In order to make the purpose, technical scheme and advantages of the present invention clearer, the present invention is described in detail below in combination with specific embodiments (but not limited to the embodiments) and the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0023] Figure 1 is a method flow chart of a method for identifying early disease of Macrobrachium rosenbergii based on motion detection according to an exemplary embodiment of the present invention. Figure 1 As shown, the method for identifying early disease of Macrobrachium rosenbergii based on movement detection includes: S10: Obtaining Macrobrachium rosenbergii samples, wherein the Macrobrachium rosenbergii samples include uninfected Macrobrachium rosenbergii and infected Macrobrachium rosenbergii.
[0024] In a preferred embodiment, the Macrobrachium rosenbergii samples include Macrobrachium rosenbergii of different genders, origins, environments, and body shapes.
[0025] Using Macrobrachium rosenbergii from different sources as samples can enhance the robustness of the subsequent neural network model.
[0026] S20: Obtain motion videos of each Macrobrachium rosenbergii in the Macrobrachium rosenbergii sample; for each motion video corresponding to the Macrobrachium rosenbergii, extract a preset number of key frame images from the motion video through a video editor, and then use a labeling tool to label the position and area of the Macrobrachium rosenbergii in each key frame image.
[0027] Preferably, the annotation tool adopts Labelimg software.
[0028] The annotation label includes the position and area of the Macrobrachium rosenbergii in the key frame image, wherein the area annotation is surrounded by a rectangular frame.
[0029] Preferably, the key frame extraction tool adopts Video Annotator software.
[0030] Among them, the schematic diagram of the shooting scene of the Macrobrachium rosenbergii movement video can be as follows Figure 2 As shown, in Figure 2 In the figure, 1 is a fish tank, 2 is a temperature sensor, 3 is a pH meter, 4 is a heating rod, 5 is an oxygen pump, 6 is a bracket, and 7 is a camera for filming the movement behavior of Macrobrachium rosenbergii. In order to meet the growth and development needs of cultivated Macrobrachium rosenbergii, the entire ecosystem used to film the movement video of Macrobrachium rosenbergii provides a natural growth environment in terms of temperature and humidity, mineral elements, salt, pH value, dissolved oxygen content, and nutrient supply, so that Macrobrachium rosenbergii can fully simulate the movement behavior in the natural environment in the experiment; in addition, in order to create an ecological environment consistent with nature, the Macrobrachium rosenbergii culture system constructed by the present invention is placed in a laboratory close to natural light, and no specific light source is set to take pictures of the shrimp. Since Macrobrachium rosenbergii is very susceptible to external light source stimulation except blue light and red light, it is easy to cause a blinding effect on its vision, thereby affecting its various physiological indicators and various behaviors. Therefore, the climbing behavior of Macrobrachium rosenbergii is filmed in daytime and night under natural light conditions to achieve real-time capture and detection of the movement behavior of Macrobrachium rosenbergii.
[0031] In a feasible implementation manner, the present invention adopts a DELL server P5820 workstation, whose CPU is an i9-10900 CPU @ 2.40 GHz processor, 64 GB of memory and equipped with a GPU RTX 3090; the size of the fish tank is 60 cm × 30 cm × 33.5 cm, and the other experimental instruments and configurations are shown in Table 1.
[0032]
[0033] Table 1.
[0034] S30: Importing the labeled key frame images into the initialized YOLO-V7 neural network model in chronological order for training, presetting hyperparameters during the training process and performing iterative optimization to obtain a trained Macrobrachium rosenbergii motion prediction neural network model, wherein the Macrobrachium rosenbergii motion prediction neural network model is used to predict the position coordinates of Macrobrachium rosenbergii at subsequent preset continuous time points.
[0035] The deep convolutional neural network YOLO-V7 is an object detection model, which belongs to a type of convolutional neural network CNN (Convolutional Neural Networks). The network structure of YOLO-V7 is divided into two parts: the backbone network and the head network. The backbone network adopts the CSPDarknet53 architecture, which is an efficient convolutional neural network structure that can effectively extract image features. Among them, CSPDarknet53 uses the CSP (Cross Stage Partial Network) module to build the network structure. The module divides the input feature map into two parts, one part is convolved and the number of channels is reduced, and the other part is not processed. Then the two parts of the feature map are spliced and finally residual connection is performed. This structure can effectively improve the representation ability and computational efficiency of the network. YOLO-V7 outputs high-precision detection results through non-maximum suppression algorithm, CSPDarknet53 technology and IoU (Intersection over Union) positive and negative sample allocation technology. For each real box, YOLO-v7 will select a candidate box with the largest IoU value among the candidate boxes as a positive sample, and set its IoU value to the maximum IoU value of the candidate box. At the same time, for each candidate box, if its IoU value is greater than the threshold (the default is 0.5), it is considered a positive sample; if its IoU value is less than the threshold, it is considered a negative sample. This positive and negative sample allocation strategy can effectively improve the detection accuracy of the model.
[0036] Among them, the location coordinates can be output in a txt coordinate data file.
[0037] It should be noted that for each key frame image corresponding to Macrobrachium rosenbergii, the key frame images need to be arranged in sequence according to the extraction time of the original motion video and then input into the YOLO-V7 neural network model for training, so that the YOLO-V7 neural network model can learn based on the real data of the Macrobrachium rosenbergii's previous climbing path, thereby obtaining the real movement behavior patterns of Macrobrachium rosenbergii in different health states, and then predict and infer the position coordinates of its subsequent preset continuous time points.
[0038] In a preferred embodiment, after obtaining a trained neural network model for predicting the movement of Macrobrachium rosenbergii, each key frame image corresponding to each uninfected Macrobrachium rosenbergii and infected Macrobrachium rosenbergii in a test set is input into the neural network model for predicting the movement of Macrobrachium rosenbergii for performance testing, and performance evaluation is performed based on the degree of match between the predicted position coordinates of subsequent preset continuous time points and the actual position coordinates.
[0039] Among them, the schematic diagram of the actual climbing position change of Macrobrachium rosenbergii can be shown as follows Figure 3 As shown, in Figure 3In the study, the actual position of Macrobrachium rosenbergii at consecutive time points kept changing.
[0040] The Macrobrachium rosenbergii movement prediction neural network model predicts the position coordinates of each subsequent preset continuous time point based on the input Macrobrachium rosenbergii position coordinates at the previous continuous time point. When testing with the test set, the predicted position coordinates of the subsequent corresponding time points are matched with the actual coordinates to obtain the prediction accuracy of the Macrobrachium rosenbergii movement prediction neural network model, and whether to continue the optimization training of the model is determined based on whether the accuracy meets the expected indicators.
[0041] The single target detection performance data of the uninfected Macrobrachium rosenbergii images and the infected Macrobrachium rosenbergii images in the training set after model extraction according to an exemplary embodiment of the present invention are shown in Table 2, which includes various values of detection accuracy and detection time.
[0042]
[0043] Table 2.
[0044] As can be seen from Table 2, the Macrobrachium rosenbergii movement prediction neural network model provided by the present invention can identify shrimps with high detection accuracy, accuracy and short time consumption, thereby providing support for subsequent climbing behavior discrimination tests. Among them, the detection accuracy refers to the success rate of the algorithm in detecting shrimps, that is, the ratio of the number of correctly detected shrimps to the actual number of shrimps. The higher the detection accuracy, the more comprehensive the detection ability of the neural network model for Macrobrachium rosenbergii. The single target detection time refers to the time spent on identifying and detecting a single Macrobrachium rosenbergii.
[0045] S40: acquiring continuous position coordinates corresponding to each Macrobrachium rosenbergii through the Macrobrachium rosenbergii movement prediction neural network model, and for each Macrobrachium rosenbergii, generating and storing a corresponding climbing trajectory vector diagram according to the continuous position coordinates.
[0046] In a feasible implementation, the centroid coordinates can be calculated according to the position information of the rectangular box in the continuous position coordinates, and then a corresponding program can be written according to the centroid coordinates to draw a vector diagram to form a climbing trajectory vector diagram of the Macrobrachium rosenbergii.
[0047] At this time, the schematic diagram for generating the climbing trajectory vector diagram provided by the present invention can be as follows: Figure 4 shown.
[0048] In an exemplary embodiment, the climbing trajectory vector diagram corresponding to the uninfected Macrobrachium rosenbergii is drawn as follows: Figure 5 As shown in the figure, the climbing trajectory vector diagram corresponding to the infected Macrobrachium rosenbergii is drawn as follows Figure 6 As shown, compared Figure 5 , Figure 6It can be seen that there are obvious characteristic differences in the movement behavior models of uninfected Macrobrachium rosenbergii and infected Macrobrachium rosenbergii, which are specifically manifested in that uninfected Macrobrachium rosenbergii is active, swims quickly, and has strong mobility; while infected Macrobrachium rosenbergii has weak mobility, swims slowly, and moves in the form of spinning or swimming without direction. By comparing the vector diagrams of uninfected Macrobrachium rosenbergii and infected Macrobrachium rosenbergii, the difference in activity trajectories can be intuitively felt. In the climbing trajectory vector diagram of uninfected Macrobrachium rosenbergii, its movement trajectory is more active, its activity range is larger, and its vector trajectory is more regular; while in the climbing trajectory vector diagram of early Macrobrachium rosenbergii, the climbing trajectory is messy and the vector trajectory is irregular. Obviously, the climbing trajectory vector diagram can be used as a basis for identifying whether Macrobrachium rosenbergii is infected.
[0049] In addition, in order to further determine the universality of the identification method provided by the present invention, the embodiment counted the climbing trajectory diagrams of different uninfected Macrobrachium rosenbergii and different infected Macrobrachium rosenbergii corresponding to 100 motion videos for shape comparison, among which the uninfected Macrobrachium rosenbergii included soft-shell shrimp, adult shrimp and broken-arm shrimp, and the infected Macrobrachium rosenbergii included rainbow virus shrimp, Vibrio parahaemolyticus shrimp and white spot virus shrimp, and the comparison results were shown in Table 3.
[0050]
[0051] Table 3.
[0052] According to Table 3, the number of closed images in the climbing trajectory diagrams corresponding to different types of uninfected shrimps is significantly higher, the number of non-fully closed images is second, and the number of irregular images is less; while the number of irregular images in the climbing trajectory diagrams corresponding to different types of infected shrimps is significantly higher, the number of non-fully closed images is second, and the number of closed images is less. Obviously, the identification rules of the identification method provided by the present invention are also applicable to different types of infected Macrobrachium rosenbergii and uninfected Macrobrachium rosenbergii.
[0053] S50: Input each key frame image corresponding to the Macrobrachium rosenbergii to be detected into the Macrobrachium rosenbergii motion prediction neural network model in chronological order, output the position coordinates of the Macrobrachium rosenbergii to be detected at subsequent preset continuous time points, and generate the corresponding climbing trajectory vector diagram to be detected, and determine the health status of the Macrobrachium rosenbergii to be detected according to the degree of matching between the climbing trajectory vector diagram to be detected and each climbing trajectory vector diagram corresponding to uninfected Macrobrachium rosenbergii and each climbing trajectory vector diagram corresponding to infected Macrobrachium rosenbergii.
[0054] Background technology shows that Macrobrachium rosenbergii has a certain degree of concealment when it is infected in the early stage, resulting in the disease characteristics gradually manifesting in external signs over time. The present invention uses the natural movement behavior of Macrobrachium rosenbergii as a basis, and can identify the disease of Macrobrachium rosenbergii in its early stage.
[0055] In order to further verify the practicability and accuracy of the method for identifying early disease of Macrobrachium rosenbergii provided by the present invention, Figure 2 Under the same experimental environment of the shooting scene shown, the climbing trajectory vector diagram detection method provided by the present invention and the existing single target detection method were used to conduct disease detection experiments on Macrobrachium rosenbergii, and the corresponding experimental data were obtained as shown in Tables 4 and 5.
[0056]
[0057] Table 4.
[0058]
[0059] Table 5.
[0060] By comparing Table 4 and Table 5, it can be found that based on the single target detection results, the average recognition rate obtained by the recognition method using vector drawing is 95.29%, while the average recognition rate obtained by the method of detecting and identifying diseased shrimp is only 28.07%, which is much lower than the recognition method using vector drawing. This is because the algorithm detection cannot distinguish between normal shrimp and stained shrimp. Early diseased shrimp have no difference in appearance, color and texture from normal shrimp. It is impossible to judge whether they are healthy or not only from the shape and color of the static image. The use of vector graphics can distinguish normal shrimp from diseased shrimp through route judgment and motion trajectory.
[0061] In a preferred embodiment, the method further comprises: According to each climbing trajectory vector diagram corresponding to the uninfected Macrobrachium rosenbergii, comprehensive feature extraction of the trajectory route is performed, and a first reference route is obtained by fitting; according to each climbing trajectory vector diagram corresponding to the infected Macrobrachium rosenbergii, comprehensive feature extraction of the trajectory route is performed, and a second reference route is obtained by fitting; at this time, the step of determining the health status of the Macrobrachium rosenbergii to be detected according to the matching degree of the climbing trajectory vector diagram to be detected and each climbing trajectory vector diagram corresponding to the uninfected Macrobrachium rosenbergii and each climbing trajectory vector diagram corresponding to the infected Macrobrachium rosenbergii in S50 includes: The health status of the Macrobrachium rosenbergii to be tested is determined according to the matching degree between the climbing trajectory vector diagram to be tested and the first reference route and the second reference route.
[0062] Since there are often certain differences in the climbing trajectory vector diagrams of Macrobrachium rosenbergii stored in the database, the recognition efficiency of matching the climbing trajectory vector diagram to be tested with the climbing trajectory vector diagrams of each Macrobrachium rosenbergii one by one is relatively low. In order to improve the recognition efficiency, the climbing trajectory vector diagrams corresponding to each health state in the database can be subjected to comprehensive feature extraction and fitted to obtain a reference route. Since there are obvious differences in the climbing trajectory vector diagrams between infected Macrobrachium rosenbergii and uninfected Macrobrachium rosenbergii, there are also obvious feature differences in the fitted first reference route and the second reference route. By directly matching the climbing trajectory vector diagram to be tested with the first reference route and the second reference route, accurate identification of its health state can still be achieved, and it has higher recognition efficiency in the recognition scenario of large quantities of Macrobrachium rosenbergii.
[0063] In a preferred embodiment, the method further comprises: According to the infection degree of the infected Macrobrachium rosenbergii, a preset number of infection levels are divided, and the climbing trajectory vector diagrams corresponding to the Macrobrachium rosenbergii of different infection levels are respectively labeled with the corresponding infection levels; when it is detected that the climbing trajectory vector diagram corresponding to the Macrobrachium rosenbergii to be tested matches the climbing trajectory vector diagram corresponding to the infected Macrobrachium rosenbergii, the label corresponding to the matched climbing trajectory vector diagram is obtained, and the infection level of the Macrobrachium rosenbergii to be tested is determined according to the label.
[0064] Through the above method, the degree of infection of the diseased shrimp can be further determined, and the degree of harm to other shrimps caused by the degree of infection can be used to decide whether to rescue or separate the diseased shrimp.
[0065] In a preferred embodiment, the method further includes: performing feature visualization on the target detection results of the YOLO-V7 neural network model based on a heat map.
[0066] In order to further improve the ability of the improved YOLO-v7 algorithm to accurately track Macrobrachium rosenbergii in complex environments and find out which area of the labeled Macrobrachium rosenbergii can make a greater contribution to the final detection effect, this embodiment performs feature visualization of the results of YOLO-v7 detection based on a heat map, so that after the Macrobrachium image passes through the backbone layer and the head layer in YOLO-v7, it is inferred which feature area of the image makes a greater contribution to the final Macrobrachium rosenbergii detection, and the feature area is identified, located and focused on.
[0067] The step of visualizing the features of the target detection results of the YOLO-V7 neural network model based on the heat map includes: Initialize the YOLO-V7 neural network model, calculate the output value with category label and the intermediate output result of the feature map in the backbone module, and then in each round of back propagation iteration, obtain the gradient of each feature map of the target layer in the key frame image of Macrobrachium rosenbergii in the backbone module by calculation, and retain the effective gradient; perform global average pooling on the gradient of the target layer, perform point multiplication on the processed gradient matrix and the output matrix of the target layer, and obtain an initialized matrix grayscale image; use a pseudo-color image processing algorithm to average the gradient map to obtain a scalar, and then put the result into the original image to add different colors to form a color map corresponding to the weights of different feature areas for visualization.
[0068] The heat map drawing method proposed in the present invention can better distinguish whether the shrimp is blocked or not and whether the shrimp movement trajectory is slow, thereby realizing the auxiliary screening of the effective area of the shrimp movement. For example, the schematic diagram of the heat map provided by the present invention is as follows Figure 7 shown.
[0069] Compared with the prior art, the method for identifying early disease of Macrobrachium rosenbergii based on motion detection provided by the present invention has the following advantages: The present invention provides a method for identifying early disease of Macrobrachium rosenbergii based on motion detection, which comprises the following steps: obtaining a Macrobrachium rosenbergii sample; obtaining a motion video of each Macrobrachium rosenbergii in the Macrobrachium rosenbergii sample, extracting a preset number of key frame images from the motion video through a video editor, and then using a labeling tool to label the position and area of the Macrobrachium rosenbergii in each key frame image; importing the labeled key frame images into an initialized YOLO-V7 neural network model in chronological order for training, presetting hyperparameters and performing iterative optimization during the training process to obtain a trained Macrobrachium rosenbergii motion prediction neural network model, wherein the Macrobrachium rosenbergii motion prediction neural network model is used to predict the position coordinates of the Macrobrachium rosenbergii at subsequent preset continuous time points; obtaining the continuous coordinates corresponding to each Macrobrachium rosenbergii through the Macrobrachium rosenbergii motion prediction neural network model Position coordinates, for each Macrobrachium rosenbergii, a corresponding climbing trajectory vector diagram is generated and stored according to the continuous position coordinates; each key frame image corresponding to the Macrobrachium rosenbergii to be detected is input into the Macrobrachium rosenbergii motion prediction neural network model in chronological order, and the position coordinates of the Macrobrachium rosenbergii to be detected at subsequent preset continuous time points are output, and the corresponding climbing trajectory vector diagram to be detected is generated, and the health status of the Macrobrachium rosenbergii to be detected is determined according to the matching degree between the climbing trajectory vector diagram to be detected and the climbing trajectory vector diagrams corresponding to the uninfected Macrobrachium rosenbergii and the climbing trajectory vector diagrams corresponding to the infected Macrobrachium rosenbergii, thereby realizing the prediction of the future motion trajectory of the Macrobrachium rosenbergii according to the short-term motion behavior of the Macrobrachium rosenbergii, and determining its health status according to the shape characteristics of the future motion trajectory, so as to realize the accurate identification of the early infected Macrobrachium rosenbergii.
[0070] Although the present invention has been described in detail above by means of general description, specific implementation methods and tests, it is obvious to those skilled in the art that modifications or improvements can be made based on the present invention. Therefore, these modifications or improvements made without departing from the spirit of the present invention all fall within the scope of protection claimed by the present invention.
[0071] Those skilled in the art will readily appreciate other embodiments of the present invention after considering the specification and practicing the invention herein. The present invention is intended to cover any variations, uses or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art that are not disclosed by the present invention. It should be understood that the present invention is not limited to the precise structure that has been described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from the scope thereof.
Claims
1. A method for identifying early disease of Macrobrachium rosenbergii based on motion detection, characterized in that: The method comprises: S10: obtaining a sample of Macrobrachium rosenbergii, wherein the sample of Macrobrachium rosenbergii includes an uninfected Macrobrachium rosenbergii and an infected Macrobrachium rosenbergii; S20: obtaining a motion video of each Macrobrachium rosenbergii in the Macrobrachium rosenbergii sample; for each motion video corresponding to the Macrobrachium rosenbergii, extracting a preset number of key frame images from the motion video through a video editor, and then using a labeling tool to label the position and area of the Macrobrachium rosenbergii in each key frame image; S30: Importing the labeled key frame images into the initialized YOLO-V7 neural network model in chronological order for training, presetting hyperparameters and performing iterative optimization during the training process to obtain a trained Macrobrachium rosenbergii motion prediction neural network model, wherein the Macrobrachium rosenbergii motion prediction neural network model is used to predict the position coordinates of Macrobrachium rosenbergii at subsequent preset continuous time points; S40: acquiring continuous position coordinates corresponding to each Macrobrachium rosenbergii through the Macrobrachium rosenbergii movement prediction neural network model, and for each Macrobrachium rosenbergii, generating and storing a corresponding climbing trajectory vector diagram according to the continuous position coordinates; S50: Input each key frame image corresponding to the Macrobrachium rosenbergii to be detected into the Macrobrachium rosenbergii motion prediction neural network model in chronological order, output the position coordinates of the Macrobrachium rosenbergii to be detected at subsequent preset continuous time points, and generate the corresponding climbing trajectory vector diagram to be detected, and determine the health status of the Macrobrachium rosenbergii to be detected according to the degree of matching between the climbing trajectory vector diagram to be detected and each climbing trajectory vector diagram corresponding to uninfected Macrobrachium rosenbergii and each climbing trajectory vector diagram corresponding to infected Macrobrachium rosenbergii.
2. The method according to claim 1, characterized in that The method further comprises: The comprehensive features of the trajectory route are extracted according to the climbing trajectory vector diagrams corresponding to the uninfected Macrobrachium rosenbergii, and the first reference route is obtained by fitting; The comprehensive features of the trajectory route are extracted according to the climbing trajectory vector diagrams corresponding to the infected Macrobrachium rosenbergii, and the second reference route is obtained by fitting; At this time, the step of determining the health status of the Macrobrachium rosenbergii to be detected according to the matching degree of the climbing trajectory vector diagram to be detected and each climbing trajectory vector diagram corresponding to the uninfected Macrobrachium rosenbergii and each climbing trajectory vector diagram corresponding to the infected Macrobrachium rosenbergii in S50 includes: The health status of the Macrobrachium rosenbergii to be tested is determined according to the matching degree between the climbing trajectory vector diagram to be tested and the first reference route and the second reference route.
3. The method according to claim 1, characterized in that The method further comprises: According to the infection degree of the infected Macrobrachium rosenbergii, a preset number of infection levels are divided, and the climbing trajectory vector diagrams corresponding to the Macrobrachium rosenbergii of different infection levels are respectively labeled with the corresponding infection levels; When it is detected that the climbing trajectory vector diagram corresponding to the Macrobrachium rosenbergii to be detected matches the climbing trajectory vector diagram corresponding to the infected Macrobrachium rosenbergii, the label corresponding to the matched climbing trajectory vector diagram is obtained, and the infection level of the Macrobrachium rosenbergii to be detected is determined according to the label.
4. The method according to claim 1, characterized in that: The method further comprises: Perform feature visualization of the target detection results of the YOLO-V7 neural network model based on a heat map; The step of visualizing the features of the target detection results of the YOLO-V7 neural network model based on the heat map includes: Initialize the YOLO-V7 neural network model, calculate the output value with category label and the intermediate output result of the feature map in the backbone module, and then in each round of back-propagation iteration, obtain the gradient of each feature map of the target layer of the Macrobrachium rosenbergii in the key frame image relative to the backbone module by calculation, and retain the effective gradient; Perform global average pooling on the gradient of the target layer, perform dot multiplication on the processed gradient matrix and the output matrix of the target layer to obtain an initialized matrix grayscale image; The pseudo-color image processing algorithm is used to average the gradient image to obtain a scalar, and then the result is put into the original image to add different colors to form a color map corresponding to the weights of different feature areas for visualization.
5. The method according to claim 1, characterized in that: After obtaining the trained neural network model for predicting the movement of Macrobrachium rosenbergii, the key frame images corresponding to each uninfected Macrobrachium rosenbergii and infected Macrobrachium rosenbergii in the test set are input into the neural network model for predicting the movement of Macrobrachium rosenbergii for performance testing, and the performance is evaluated based on the degree of match between the predicted position coordinates of subsequent preset continuous time points and the actual position coordinates.
6. The method according to claim 1, characterized in that The labeling tool adopts Labelimg software.
7. The method according to claim 1, characterized in that The key frame extraction tool uses VideoAnnotator software.
8. The method according to claim 1, characterized in that The Macrobrachium rosenbergii samples include Macrobrachium rosenbergii of different genders, origins, environments, and body sizes.
Citation Information
Cited By
Large-model-based intelligent identification shrimp group living body health monitoring method
CN120808401A
