Modularized fish technology device and method based on machine vision multi-target tracking
Through a modular fish technology device based on machine vision multi-objective tracking, the existing fry count statistics method is solved, and high-precision, fast and automated fry count statistics are achieved, reducing costs and improving equipment flexibility and maintenance convenience.
Patent Information
- Application Number
- CN202411876661.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2025-04-15
AI Technical Summary
The existing fry count statistics methods have problems such as low accuracy, time-consuming and labor-intensive, high cost, single equipment functions, and inconvenient installation and maintenance.
A modular fish technology device based on machine vision multi-objective tracking, including the main track module and the main control box module, uses the camera to capture fish, and achieve high-precision fry counting through image preprocessing and counting methods.
High-precision, fast and automated fry counting is achieved, reducing the cost and accuracy of manual counting, and improving the flexibility and maintenance convenience of equipment.
Smart Images

Figure CN119832491A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of aquaculture, and in particular to a modular fish technology device and method based on machine vision multi-target tracking. Background Art
[0002] At present, there are some counting methods and means based on image recognition on the market, which are even used in the confirmation of the number of aquatic species such as fish fry or shrimp fry. The accurate counting of the number of fish and shrimp fry involves the quality control of the aquaculture process and the economic interests of aquaculture farmers and enterprises, which is of great importance, so an accurate and fair method for counting the number of fish fry is very important.
[0003] The current statistics of aquatic seedlings include the following:
[0004] For precious fish fry, the traditional manual counting method is used. When the fry are hatched, special counting personnel are hired to count the fry one by one in a short period of time, and then the final results are calculated to prevent the fry from hypoxia or severe stress over a long period of time. However, this method requires the employment of a large number of workers, and the wages vary in different regions, ranging from 80 yuan to 200 yuan. The cost is very high and is related to the number of fry, the more the more expensive. In addition to the high cost, the accuracy of manual counting cannot be guaranteed. If there are mistakes in the counting process, it needs to be monitored in real time, which is laborious and subjective.
[0005] For fish fry with lower economic value, sampling and counting are used for statistics. Generally, one pound or half a pound of fish fry are sampled from the middle of the fry to be released for manual counting, and then the result is used as the benchmark value for the final number statistics. This method has obvious defects. First, the sampling and counting process will cause a huge error. It is understood that there will be an error of more than 10%. Second, even if sampling and counting are performed, the process still requires manual counting. It takes more than 20 minutes for a skilled worker to count the number of small fish fry of half a pound, and it is easy to count wrongly if the number is large.
[0006] There are already equipment for counting the number of fish and shrimp seedlings on the market, and some companies will use such equipment for auxiliary counting. However, at this stage, the functions of such equipment are relatively simple, and the calculation accuracy is unstable, and the accuracy decreases significantly in dense scenes. In addition, most of the equipment is large in size, which is inconvenient to install and maintain. It requires professional engineers to operate, which does not meet the requirements of rapid application in the seedling environment and scene requirements.
[0007] Therefore, it is now necessary to propose a modular fish counter device and method to solve the above problems. Summary of the invention
[0008] Aiming at the problems that the existing seedling raising technology has low precision, is time-consuming and labor-intensive, the present invention proposes a modular fish technology device based on machine vision multi-target tracking.
[0009] This modular fish technology device based on machine vision multi-target tracking includes: a main track module and a main control box module arranged on the top side of the main track module. The main track module includes a main box, and a funnel entrance module is installed on the upper surface of the main box. The funnel entrance module is connected to the track module arranged in the main box, and the outlet of the track module extends out of the main box. A light compensation module is installed at the bottom of the track module, and a camera installed on the inner wall of the main box is arranged above the track module. A power supply is arranged at the bottom of the main box.
[0010] In a preferred embodiment of the present invention, the main control box module includes a main control box body, and a detachable touch display screen and a main control box cover are respectively provided on the front and rear sides of the main control box body, a host mounting plate is provided at the bottom of the main control box module, a host processor is provided on the host mounting plate, a radiator mounting plate is fixedly provided on the inner side of the main control box cover, a cooling fan is installed on the radiator mounting plate, a PCB mounting plate is installed on the inner side of the top of the main control box body, a handle is provided on the outside, and a foot base is provided at the bottom of the main control box body.
[0011] In a preferred embodiment of the present invention, removable side doors are respectively provided on the left and right sides of the main box, and track connecting plates and shading plates are respectively provided on the front and rear sides. A removable panel is provided on one side of the top of the main box, and a camera mounting plate is provided on the inner side of the panel. The camera is installed on the camera mounting plate, and an air duct mounting plate is provided on the bottom side of the camera mounting plate, and a fan is installed on the air duct mounting plate.
[0012] Furthermore, the funnel inlet module includes a funnel, the funnel is installed on the top of the main box, a water outlet is provided on one side of the top of the funnel, and the water outlet is connected to the water inlet pipe.
[0013] Furthermore, the track module includes a track PP plate, a front end of which is arranged below the funnel and a rear end of which extends out of the main box.
[0014] Furthermore, the lighting compensation module includes a lighting adapter plate, on which a compensation lamp is mounted.
[0015] In order to solve the above problems, the present invention further provides a high-throughput fry counting method, characterized in that the camera of the modular fish technology device based on machine vision multi-target tracking described in any one of claims 1 to 6 is used to shoot fish, and the image is preprocessed and counted. The counting method includes the following steps:
[0016] S1. Get the detected target information of the current frame and determine whether it is repeated with the previous frame; if it is a repeated frame, skip it directly; if it is a different frame, use the detected target and all targets in the previous frame to estimate the best offset distance, and divide the detected targets of the current frame into high-score and low-score categories according to the confidence level;
[0017] S2. In the first round of association, the high-scoring target is associated with the target of the previous frame to obtain unassociated detection targets, unassociated tracking targets, and associated pairs.
[0018] S3, performing a second round of association between the unassociated tracking target and the low-score target to obtain an associated pair and an unassociated tracking target, and determining whether to retain the target according to the number of times the unassociated tracking target loses association;
[0019] S4, judging all the associated pairs, adding the associated and uncounted targets to the number of fry, otherwise not adding;
[0020] S5. Replace all target information in the previous frame with the detected target of the current frame and the updated tracking target information, and continue to obtain information of subsequent frames.
[0021] Furthermore, suppose that there are m fry involved in the association in the i-1th frame, which are P i-1 ={p j |j=1,...,m}, there are n tails participating in the association in the i-th frame, which are P i ={p k |k=1,...,n,the fry association loss function is:
[0022] cv kj =f(p j , p k )
[0023] where p j , p k are the eigenvalues of the j-th fry in the i-1-th frame and the k-th fry in the i-th frame respectively; then, the loss matrix associated with the fry can be constructed as follows:
[0024]
[0025] In the association process, to obtain the best global association pair, the goal is to obtain the minimum global loss value, and the objective function is:
[0026]
[0027] Since each fish can only be associated once, ij Set the boundary conditions for solving the objective function as follows:
[0028]
[0029] When the difference between the number of target objects detected in the previous frame and the current frame is greater than 5, the two frames are determined to be non-duplicate frames; otherwise, if the difference between the two is less than or equal to 5, the second step is entered to perform correlation analysis on all targets in the previous and next frames; in order to reduce the computational complexity, the Euclidean distance is selected as the loss function to measure the target correlation:
[0030]
[0031] Where (x j ,y j ) represents the position coordinates of the fry in the previous frame, (x k ,y k ) represents the coordinates of the corresponding fry in the current frame; when the previous frame and the current frame are judged to be repeated frames, it means that the positions of the fry detected between the two frames should be consistent; accordingly, if the value of the objective function Z satisfies If the condition is met, the two frames are judged as duplicate frames; otherwise, they are regarded as non-duplicate frames;
[0032] i-1 represents the i-1~i frames, i represents the i~i+1 frames, v represents the moving speed, v x and v y The table shows the movement speed of the fry in the x-axis and y-axis directions, d x and d y They represent the displacement changes of the fry along the x-axis and y-axis between consecutive frames respectively;
[0033] In order to reduce the difference in the position change of the same target along the x-axis between two consecutive frames of images, the offset distance d with set consistency is used as the processing standard, and the fish fry association loss function is modified as follows:
[0034]
[0035] According to the objective function Z, the function Z(d) about the offset distance d is defined as follows:
[0036]
[0037] S d ={t∈Z:t≥0 and d min +s t ×t≤d max}
[0038] where d∈S d , the value range of d is min and d max Between tThe target of the current frame gradually approaches the target of the current frame along the x-axis, which is manifested as the continuous increase of the offset distance d between the two frames. The spatial distance of the same target between different frames decreases accordingly, that is, the objective function Z(d) decreases; when the x-axis coordinates of the same target between the two frames completely overlap, the objective function Z(d) reaches its minimum value; thereafter, if the offset distance d continues to increase, the objective function Z(d) shows an increasing trend; based on this, the offset distance d corresponding to the minimum value of Z(d) can be determined * is the optimal offset distance between two consecutive frames;
[0039] Therefore, the final revised loss function is used in both rounds of target association, which is:
[0040]
[0041] The method used to update the unassociated tracking target that needs to be retained is: assuming that the position of the unassociated tracking target in the previous frame is ut = (x, y), and the updated position is ut′ = (x+d * , y).
[0042] Implementing the embodiments of the present invention has the following beneficial effects:
[0043] The modular fish technology device based on machine vision multi-target tracking of the present invention adopts a modular design, which is convenient for equipment assembly and maintenance; after the present invention separates and plans the strong and weak electricity of the power module, the electrical safety is effectively improved and the waterproofness of the electrical components is improved; the main control module of the present invention is an independent design and is also the main display part, which can be flexibly placed. In order to meet the best viewing angle, it can be placed and adjusted at multiple angles and multiple positions, which is different from the fixed position screen viewing method of current market products.
[0044] The high-throughput fish fry counting method FishCSORT of the present invention avoids the dependence on initial value setting and instead focuses on estimating the actual moving distance of the target between the previous and next frames, effectively dealing with the problems caused by nonlinear motion and frame loss, and can complete counting with only a few frames; in addition, FishCSORT also adjusts and optimizes its loss function in real time to ensure that the correlation accuracy is continuously improved, thereby achieving accurate and stable fish fry tracking and counting in complex dynamic scenes. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0046] Figure 1 This is a schematic diagram of the external structure of a modular fish technology device based on machine vision multi-target tracking;
[0047] Figure 2 This is a schematic diagram of the explosion structure of the main track module;
[0048] Figure 3 This is a schematic diagram of the exploded structure of the main control box module;
[0049] Figure 4 Tracking counting flow chart for FishCSORT;
[0050] Figure 5 It is a flowchart of adaptive image preprocessing;
[0051] Figure 6 It is a schematic diagram of the movement trajectory and spacing between multiple consecutive frames of different fry;
[0052] In the figure: main box 1, side door 2, funnel 3, track connecting plate 4, water outlet 5, panel 6, camera mounting plate 7, air duct mounting plate 8, shading plate 9, light adapter plate 10, radiator mounting plate 11, host mounting plate 12, PCB mounting plate 13, main control box cover 14, main control box body 15, touch display screen 16, magnetic door lock 17, side door lock 18, wheel 19, handle 20, host processor 21, aviation plug-SP13-2 core-13A22, power supply 23, aviation plug-SP17-3 core-10A24, aviation plug-SP21-5 core-30A25, USB connector 26, foot seat 27, nameplate 28, cooling fan 29, switch gasket 30, track pp plate 31, Internet module 32, air gathering port 33, camera 34, button switch 35, compensation lamp 36. DETAILED DESCRIPTION
[0053] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0054] See also Figure 1 The modular fish technology device based on machine vision multi-target tracking includes: a main track module and a main control box module arranged on one side of the top of the main track module.
[0055] See also Figure 2The main track module includes a main box 1, and detachable side doors 2 are respectively provided on the left and right sides of the main box 1, and track connecting plates 4 and shading plates 9 are respectively provided on the front and rear sides. A detachable panel 6 is provided on one side of the top of the main box 1, and a camera mounting plate 7 is provided on the inner side of the panel 6. The camera 34 is installed on the camera mounting plate 7 and is located above the track module. A duct mounting plate 8 is provided on the bottom side of the camera mounting plate 7, and a fan is installed on the duct mounting plate 8.
[0056] A funnel inlet module is installed on the upper surface of the main box 1. Specifically, the funnel inlet module includes a funnel 3. The funnel 3 is installed on the top of the main box 1. A water outlet 5 is provided on one side of the top of the funnel 3. The water outlet 5 is connected to an external water inlet pipe. The funnel inlet module is connected to a track module provided in the main box. The track module includes a track pp plate 31, the front end of which is provided below the funnel 3, and the rear end extends out of the main box 1. A light compensation module is installed at the bottom of the track module. The light compensation module includes a light adapter plate 10, and a compensation light 36 is installed on the light adapter plate 10. A power supply 23 is provided at the bottom of the main box 1.
[0057] See also Figure 3 The main control box module includes a main control box body 15, and a detachable touch display screen 16 and a main control box cover 14 are respectively provided on the front and rear sides of the main control box body 15. A host mounting plate 12 is provided at the bottom of the main control box module, and a host processor 21 is provided on the host mounting plate 12. A radiator mounting plate 11 is fixedly provided on the inner side of the main control box cover 14, and a cooling fan 29 is installed on the radiator mounting plate 11. A PCB mounting plate 13 is installed on the inner side of the top of the main control box body, and a handle 20 is provided on the outer side. A foot seat 27 is provided at the bottom of the main control box body 15.
[0058] The main function of the main control box module is equipment data processing and display. It integrates a processor, a touch screen, various power and data interfaces, and has a heat dissipation function.
[0059] The camera of the camera module is a data input terminal, and its stable data transmission and quality are very important. Therefore, in addition to the data input terminal, this module also has an air duct design. During actual use, it will blow away the water droplets splashed by the fry and clean the dust, ensuring that the camera obtains clean and clear image data, which is conducive to improving accuracy.
[0060] Light compensation module: In a closed environment, the exposure of the camera becomes unstable, so the manual fixed exposure combined with light source compensation will effectively improve the image quality. The light compensation module uses a shadowless lamp with the same area as the track framing area installed under the PP board track for compensation. It forms a reasonable optical system with the camera in combination with reasonable firmware adjustment to obtain high-quality image data.
[0061] The power module uses a step-down circuit to reduce the incoming power supply of 220V to a safe voltage of less than 36V and then supplies it to each module through the aviation plug interface; each electrical module uses weak current power supply as much as possible to improve its safety; the entire step-down circuit is installed in a sealed junction box, which adopts a waterproof design and a reasonable heat dissipation design; the risk of leakage and short circuit caused by water mist intrusion is avoided; the insulation effect of the entire power system is significantly improved, effectively improving electrical safety.
[0062] The track module, the sheet metal structure is the main appearance structure of the equipment, and cooperates with the PP track to form a fixed fishway. By designing the appropriate size, the fry can pass through the limited viewing area in an orderly manner, ensuring that the camera collects a reasonable data set.
[0063] The funnel inlet module and the entrance of the counter equipment are designed to be in the shape of a detachable funnel. First, the funnel can be adjusted and replaced according to actual conditions. For example, if the fry have requirements for stress, it can be replaced with a funnel that can store water. This kind of funnel will reduce the stress on the fry, but the efficiency will be relatively slow. If there are requirements for efficiency, replace the funnel with an open one, and the counting efficiency will be improved. Second, the funnel-shaped entrance allows the fish to be stored in the container first and go down the track in an orderly manner, so as to avoid dense adhesion and improve the counting accuracy.
[0064] See also Figure 4 The present invention also provides a high-throughput fry counting method, which uses the camera of the modular fish technology device based on machine vision multi-target tracking to shoot fish, pre-process the image and count the fish.
[0065] The counting method specifically includes the following steps:
[0066] S1. Get the detected target information of the current frame and determine whether it is repeated with the previous frame; if it is a repeated frame, skip it directly; if it is a different frame, use the detected target and all targets in the previous frame to estimate the best offset distance, and divide the detected targets of the current frame into high-score and low-score categories according to the confidence level;
[0067] S2. In the first round of association, the high-scoring target is associated with the target of the previous frame to obtain unassociated detection targets, unassociated tracking targets, and associated pairs.
[0068] S3, performing a second round of association between the unassociated tracking target and the low-score target to obtain an associated pair and an unassociated tracking target, and determining whether to retain the target according to the number of times the unassociated tracking target loses association;
[0069] S4, judging all the associated pairs, adding the associated and uncounted targets to the number of fry, otherwise not adding;
[0070] S5. Replace all target information in the previous frame with the detected target of the current frame and the updated tracking target information, and continue to obtain information of subsequent frames.
[0071] Image preprocessing: Due to the camera perspective and installation errors, there are dark borders in the original images obtained by the camera. In order to obtain a relatively clean background image, the image is preprocessed, such as Figure 5 As shown. First, perform two median filters and one erosion operation on the first frame of the video stream to remove the noise in the background. Then, a binary image is obtained by threshold segmentation, and the largest connected domain in the binary image is calculated. Since the original image is mainly the counting area and the camera is fixed relative to the counting area, the largest connected domain area is the counting area, and its outer rectangular frame information is saved. In subsequent videos, the image is cropped according to the outer rectangular frame of the largest connected domain obtained in the first frame. It should be noted that when setting the segmentation threshold, the upper and lower edges of the outer rectangular frame should be as close to the track edge as possible in the original image.
[0072] Detection model for densely packed fish fry: In the process of counting fish fry in a multi-target tracking scenario, accurate detection of individual fish fry is the prerequisite for subsequent accurate correlation counting. During large-scale rapid counting, the mutual adhesion and stacking of fish fry, significant changes in shape and size, and visual interference caused by water flow fluctuations are all factors that seriously affect detection accuracy. Traditional image processing technology and detection methods based on conventional machine learning are difficult to cope with such complex interference. Therefore, in order to ensure the accuracy of detection and provide a solid detection accuracy guarantee for the subsequent research and implementation of continuous tracking algorithms, a YOLO fish fry detection model is constructed based on a single target detection model for high-density fish fry scenarios.
[0073] Target association between previous and next frames: Since the video is composed of a series of consecutive frames, there is a temporal relationship between each frame, and the position, posture, and even appearance of the target will change between adjacent frames due to movement. Therefore, correctly associating the target in the previous and next frames is a key step to ensure tracking continuity and stability and avoid target loss or mismatching.
[0074] Assume that there are m fish fry involved in the association in the i-1th frame, which are P i-1 ={p j |j=1,...,m}, there are n tails participating in the association in the i-th frame, which are P i ={p k |k=1,...,n}, the fry association loss function is:
[0075] cv kj =f(p j p k )
[0076] where p j , p k are the eigenvalues of the j-th fry in the i-1-th frame and the k-th fry in the i-th frame respectively; then, the loss matrix associated with the fry can be constructed as follows:
[0077]
[0078] In the association process, to obtain the best global association pair, the goal is to obtain the minimum global loss value, and the objective function is:
[0079]
[0080] Since each fish can only be associated once, ij Set the boundary conditions for solving the objective function as follows:
[0081]
[0082] This association problem is actually an optimal matching problem of n to m, which can be solved by using greedy algorithm, Hungarian algorithm, etc.
[0083] Fry state estimation: Before estimating the fry state, it is necessary to determine whether the previous and next frames are duplicate frames. In the first step, when the difference in the number of target objects detected in the previous frame and the current frame is greater than 5, the two frames are determined to be non-duplicate frames; conversely, if the difference in the number of the two is less than or equal to 5, the second step is to perform correlation analysis on all targets in the previous and next frames; to reduce the computational complexity, the Euclidean distance is used as the loss function to measure the target correlation:
[0084]
[0085] Where (x j ,y j ) represents the position coordinates of fry j in the previous frame, (x k ,y k ) represents the coordinates of the corresponding fry in the current frame; when the previous frame and the current frame are judged to be repeated frames, it means that the positions of the fry detected between the two frames should be consistent; accordingly, if the value of the objective function Z satisfies If the condition is met, the two frames are judged as duplicate frames; otherwise, they are regarded as non-duplicate frames.
[0086] Estimation of the distance the fry moves between two consecutive frames:
[0087] In order to reduce the error caused by the estimated value and deal with the state mutation caused by the nonlinear motion of the fry and the frame rate fluctuation (frame loss, frame duplication), when estimating the target state, more attention is paid to the observation values of the previous and next two frames.
[0088] The morphology of fish fry is prone to change during movement, making it difficult to capture stable features and design associated loss functions. For slower moving targets, the loss matrix can be constructed with the help of methods such as intersection over union to improve tracking accuracy. However, in the fast-moving fish fry scene, the bounding rectangles of the fish fry between two consecutive frames often do not overlap. In addition, the morphology of the fish fry is changeable and the fish fry frequently stick together during high-speed movement, resulting in obvious differences in the bounding rectangles and features of the same fish fry between consecutive frames, which makes it particularly difficult to construct a stable and accurate loss function. Therefore, only the position information of the fish fry is used as the associated feature of the fish fry.
[0089] Analysis of the two-dimensional motion trajectory of the fry between two consecutive frames of images shows that the fry's significant movement is mainly reflected in the x-axis direction. Figure 6 , where i-1 represents the i-1~i frames, i represents the i~i+1 frames, v represents the moving speed, v x and v y The table shows the movement speed of the fry in the x-axis and y-axis directions, d x and d y Respectively represent the displacement changes of the fry along the x-axis and y-axis between consecutive frames; although the displacement distance of the same fry between two adjacent frames fluctuates and is affected by the random frame loss phenomenon, overall, the movement distance of most of the fry along the x-axis in two consecutive frames is relatively consistent.
[0090] In order to reduce the difference in the position change of the same target along the x-axis between two consecutive frames of images, the offset distance d with set consistency is used as the processing standard, and the fish fry association loss function is modified as follows:
[0091]
[0092] According to the objective function Z, the function Z(d) about the offset distance d is defined as follows:
[0093]
[0094] S d ={t∈Z:t≥0 and d min +s t ×t≤d max}
[0095] where d∈S d , the value range of d is min and d max Between tThe target of the current frame gradually approaches the target of the current frame along the x-axis, which is manifested as the continuous increase of the offset distance d between the two frames. The spatial distance of the same target between different frames decreases accordingly, that is, the objective function Z(d) decreases; when the x-axis coordinates of the same target between the two frames completely overlap, the objective function Z(d) reaches its minimum value; thereafter, if the offset distance d continues to increase, the objective function Z(d) shows an increasing trend; based on this, the offset distance d corresponding to the minimum value of Z(d) can be determined * is the optimal offset distance between two consecutive frames;
[0096] When the number of associated targets involved is extremely large, the process of seeking the optimal offset distance will inevitably lead to a significant increase in computing resource consumption. To this end, the present invention adopts an optimization strategy, that is, in solving the optimal offset distance d * When considering m, only the m closest to the exit in the current frame is considered. e The fish fry is associated with all the fish fry n in the previous frame, and the Hungarian algorithm is performed on this subset to determine the optimal offset distance d * .
[0097] Combining the above methods, the final corrected loss function used in both rounds of target association is:
[0098]
[0099] The method used to update the unassociated tracking target that needs to be retained is: assuming that the position of the unassociated tracking target in the previous frame is ut = (x, y), and the updated position is ut′ = (x+d * , y).
[0100] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A modular fish technology device based on machine vision multi-target tracking, characterized in that: include: A main track module and a main control box module arranged on one side of the top of the main track module, the main track module includes a main box, a funnel entrance module is installed on the upper surface of the main box, the funnel entrance module is connected to the track module arranged in the main box, the outlet of the track module extends out of the main box, a light compensation module is installed at the bottom of the track module, a camera installed on the inner wall of the main box is arranged above the track module, and a power supply is arranged at the bottom of the main box.
2. The modular fish technology device based on machine vision multi-target tracking according to claim 1 is characterized in that: The main control box module includes a main control box body, and a detachable touch display screen and a main control box cover are respectively provided on the front and rear sides of the main control box body; a host mounting plate is provided at the bottom of the main control box module, and a host processor is provided on the host mounting plate; a radiator mounting plate is fixedly provided on the inner side of the main control box cover, and a cooling fan is installed on the radiator mounting plate; a PCB mounting plate is installed on the inner side of the top of the main control box body, and a handle is provided on the outer side; a foot base is provided at the bottom of the main control box body.
3. The modular fish technology device based on machine vision multi-target tracking according to claim 1 is characterized in that: The left and right sides of the main box are respectively provided with removable side doors, the front and rear sides are respectively provided with track connecting plates and shading plates, a removable panel is provided on one side of the top of the main box, a camera mounting plate is provided on the inner side of the panel, the camera is mounted on the camera mounting plate, an air duct mounting plate is provided on the bottom side of the camera mounting plate, and a fan is mounted on the air duct mounting plate.
4. The modular fish technology device based on machine vision multi-target tracking according to claim 3 is characterized in that: The funnel inlet module comprises a funnel, and the funnel is installed on the top of the main box. A water outlet is arranged on one side of the top of the funnel, and the water outlet is connected to a water inlet pipe.
5. The modular fish technology device based on machine vision multi-target tracking according to claim 4 is characterized in that: The track module comprises a track PP plate, a front end of which is arranged below the funnel and a rear end of which extends out of the main box.
6. The modular fish technology device based on machine vision multi-target tracking according to claim 5 is characterized in that: The light compensation module comprises a light adapter plate, on which a compensation light is mounted.
7. A high-throughput fry counting method, characterized in that: The camera of the modular fish technology device based on machine vision multi-target tracking described in any one of claims 1 to 6 is used to shoot fish, and the image is preprocessed and counted. The counting method includes the following steps: S1. Get the detected target information of the current frame and determine whether it is repeated with the previous frame; if it is a repeated frame, skip it directly; if it is a different frame, use the detected target and all targets in the previous frame to estimate the best offset distance, and divide the detected targets of the current frame into high-score and low-score categories according to the confidence level; S2. In the first round of association, the high-scoring target is associated with the target of the previous frame to obtain unassociated detection targets, unassociated tracking targets, and associated pairs. S3, performing a second round of association between the unassociated tracking target and the low-score target to obtain an associated pair and an unassociated tracking target, and determining whether to retain the target according to the number of times the unassociated tracking target loses association; S4, judging all the associated pairs, adding the associated and uncounted targets to the number of fry, otherwise not adding; S5. Replace all target information in the previous frame with the detected target of the current frame and the updated tracking target information, and continue to obtain information of subsequent frames.
8. The high-throughput fry counting method according to claim 7, characterized in that: Assume that there are m fish fry involved in the association in the i-1th frame, which are P i-1 ={p j |j=1,...,m}, there are n tails participating in the association in the i-th frame, which are P i ={p k |k=1,...,n}, the fry association loss function is: cv kj =f(p j ,p k ) where p j , p k are the characteristic values of the kth fish fry in the i-1th frame and the kth fish fry in the i-th frame respectively; Then, the loss matrix associated with fry can be constructed as follows: In the association process, to obtain the best global association pair, the goal is to obtain the minimum global loss value, and the objective function is: Since each fish can only be associated once, o ij sets the boundary conditions for solving the objective function as follows: When the difference between the number of target objects detected in the previous frame and the current frame is greater than 5, the two frames are determined to be non-duplicate frames; otherwise, if the difference between the two is less than or equal to 5, the second step is entered to perform correlation analysis on all targets in the previous and next frames; in order to reduce the computational complexity, the Euclidean distance is selected as the loss function to measure the target correlation: Where (x j ,y j ) represents the position coordinates of the fry in the previous frame, (x k ,y k ) represents the coordinates of the corresponding fry in the current frame; when the previous frame and the current frame are judged to be repeated frames, it means that the positions of the fry detected between the two frames should be consistent; accordingly, if the value of the objective function Z satisfies If the condition is met, the two frames are judged as duplicate frames; otherwise, they are regarded as non-duplicate frames; i-1 represents the i-1~i frames, i represents the i~i+1 frames, v represents the moving speed, v x and v y The table shows the movement speed of the fry in the x-axis and y-axis directions, d x and d y They represent the displacement changes of the fry along the x-axis and y-axis between consecutive frames respectively; In order to reduce the difference in the position change of the same target along the x-axis between two consecutive frames of images, the offset distance d with set consistency is used as the processing standard, and the fish fry association loss function is modified as follows: According to the objective function Z, the function Z(d) about the offset distance d is defined as follows: S d ={t∈Z:t≥0 and d min +s t ×t≤d max } where d∈S d , the value range of d is min and d max Between t The target of the current frame gradually approaches the target of the current frame along the x-axis, which is manifested as the continuous increase of the offset distance d between the two frames. The spatial distance of the same target between different frames decreases accordingly, that is, the objective function Z(d) decreases; when the x-axis coordinates of the same target between the two frames completely overlap, the objective function Z(d) reaches its minimum value; After that, if the offset distance d continues to increase, the objective function Z(d) shows an increasing trend; based on this, the offset distance d corresponding to the minimum value of Z(d) can be determined as * is the optimal offset distance between two consecutive frames; Therefore, the final revised loss function is used in both rounds of target association, which is: The method used to update the unassociated tracking target that needs to be retained is: assuming that the position of the unassociated tracking target in the previous frame is ut = (x, y), the updated position is ut = (x + d * , y).