Fish Recognition Method and Device Based on Optimized Structure Convolutional Neural Network

By improving the upsampling process of the YOLOvx target recognition model, combining the Tornado, Gray Wolf, and Crowned Porcupine algorithms, and optimizing the convolutional neural network, the problem of low accuracy in recognizing small targets in mixed fish was solved, achieving higher recognition accuracy.

CN120953767BActive Publication Date: 2026-06-02OCEAN UNIV OF CHINA

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
OCEAN UNIV OF CHINA
Filing Date
2025-09-08
Publication Date
2026-06-02

Smart Images

  • Figure CN120953767B_ABST
    Figure CN120953767B_ABST
Patent Text Reader

Abstract

This invention belongs to the field of data recognition technology and provides a method and device for fish recognition based on an optimized convolutional neural network. It utilizes acquired historical fish image data to train an improved YOLOvx target recognition model. The model construction process includes first performing a global optimization using the Tornado algorithm to obtain the initial tornado position, then employing a strategy combining the Tornado algorithm and the Grey Wolf algorithm for local optimization. The global optimization process in the Tornado algorithm is improved by incorporating the fourth defense mechanism of the crested porcupine, resulting in a Tornado combined intelligent algorithm. This algorithm is then used to improve the upsampling process of the YOLOvx target recognition model, resulting in an improved YOLOvx target recognition model. The trained model is then used to recognize the target image to obtain the recognition result of mixed fish. This invention solves the problem of low recognition accuracy in existing technologies and can improve the accuracy of fish recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of data recognition technology, and in particular relates to a method and apparatus for fish recognition based on an optimized convolutional neural network. Background Technology

[0002] The statements in this section are merely background information related to the present invention and do not necessarily constitute prior art.

[0003] The advantages of mixed fish farming are mainly reflected in four aspects: efficient resource utilization, ecological balance, disease control, and improved economic benefits, achieving a win-win situation for both ecology and economy. Currently, more and more fishermen are choosing mixed fish farming, and intelligent fish harvesting has become an important part of intelligent fisheries. One of the key steps in mixed fish harvesting is how to accurately identify individual fish. This involves collecting images of various fish species, preprocessing the images to create an image dataset, and further training the dataset to build a recognition model.

[0004] In the field of identification processing, the current mainstream technology uses deep learning neural networks. Neural networks have flexible and varied structures, and designing improved neural network algorithms for specific identification tasks requires extensive experience. In the process of catching and classifying fish, mixed fish exhibit different characteristics and growth stages, requiring identification based on subtle differences in traits. Existing deep convolutional neural networks, especially for small targets, have low accuracy in this area. Summary of the Invention

[0005] To address at least one of the technical problems mentioned above, this invention provides a fish identification method and apparatus based on an optimized convolutional neural network. Addressing the issue of fishermen catching fish with varying characteristics and growth rates, this invention improves the upsampling process of the convolutional neural network algorithm model, resulting in a better convolutional neural network model and enhancing the accuracy of fish identification.

[0006] To achieve the above objectives, the present invention adopts the following technical solution:

[0007] The first aspect of this invention provides a fish recognition method based on an optimized convolutional neural network, comprising the following steps:

[0008] Acquire image data of mixed fish at different growth stages;

[0009] The improved YOLOvx target recognition model was trained using mixed image data of fish at different growth stages, resulting in the improved YOLOvx target recognition model after training.

[0010] The construction process of the improved YOLOvx target recognition model includes:

[0011] First, the Tornado algorithm is used for global optimization to obtain the initial tornado position. Then, a strategy combining the Tornado algorithm and the Gray Wolf algorithm is adopted for local optimization. The global optimization process in the Tornado algorithm is improved by incorporating the fourth defense mechanism of the porcupine, resulting in the Tornado combined intelligent algorithm. Then, the upsampling process of the YOLOvx target recognition model is improved by using the Tornado combined intelligent algorithm, resulting in the improved YOLOvx target recognition model.

[0012] The improved YOLOvx target recognition model, after training, is used to identify target images to be processed during fish fishing, and accurate identification results of mixed fish are obtained.

[0013] Furthermore, the upsampling process includes:

[0014] We introduce Dysample, an upsampling method based on dynamic point sampling, which reconstructs feature maps by optimizing the sampling process.

[0015] The specific process is as follows:

[0016] Given input feature map , build a The sampling set S. For each coordinate point in the sampling set S. The bilinear interpolation algorithm is used to sample features on the original feature map X. Through this dynamic sampling mechanism, the output has a new dimension. Feature map :

[0017] ;

[0018] Given an upsampling scaling factor and input feature map First, a linear layer is used, with the number of input and output channels being respectively... and Generate offset Then, using the same linear layer, and giving The perturbation is summed between the two linear layers, and after passing through a pixel shuffling operation, the result is determined as the offset. For the original sampling grid Weighting makes the sampling set The proportion is even smaller, and the final sample set S consists of the generated offset O and the original sample grid. Adding them together, we get:

[0019] .

[0020] Furthermore, the process of first performing a global optimization using the tornado algorithm to obtain the initial tornado position includes:

[0021] First, the initial population is initialized, generating... A storm, It refers to an individual storm, which can evolve into a thunderstorm or tornado.

[0022] ;

[0023] In this algorithm, the fitness function is denoted as fit, which is conventionally defined in this invention as follows: The smaller the value, the better. The formula is:

[0024] ;

[0025] To determine the number of storms that can develop into thunderstorms or tornadoes, a variable is introduced. , The value of k is , This represents the fitness value of the kth thunderstorm associated with the tornado. This refers to the number of storms that evolve or are assigned to a specific thunderstorm or tornado:

[0026] ;in, The sum of the number of thunderstorms and tornadoes in the previous round is obtained. Afterwards, if If so, let it be 9, and you can specify that there are A thunderstorm and A tornado, causing , ;

[0027] Storms can be explored within the γ range. ,in, Indicates the current distance between the storm and the thunderstorm. It is between 0 and Random numbers between these points follow a uniform distribution or some reasonable distribution. Represents a random number within the range (0.5, 5);

[0028] when At this time, the storm evolves into a thunderstorm, and the process is as follows:

[0029]

[0030] in, and Let represent the next and current position vectors of the storm that evolved into a thunderstorm at iterations t+1 and t, respectively. Let represent the position vector of the i-th thunderstorm at iteration t, and rand is a random number uniformly distributed in the range [0, 1]. Let represent the position vector of the i-th tornado at iteration t.

[0031] All thunderstorms can evolve into tornadoes, the formula is:

[0032] ;

[0033] ;

[0034] ;

[0035] ;

[0036] in, and Let represent the next and current position vectors of the thunderstorms that evolved into tornadoes at iterations t+1 and t, respectively. Let ζ represent the position vector of the tornado at a random index ζ. This represents the location vector of the thunderstorm at a random index; rand is a random value uniformly distributed in the range [0,1], t represents the t-th iteration of the loop, and T represents the total number of iterations. It is a constant value, which is 2.

[0037] Compare the fitness values ​​of storms that can evolve into thunderstorms in the (t+1)th iteration. If the fitness value is better, the storm can be swapped with the thunderstorm; otherwise, the positions remain unchanged. This process applies similarly to the evolution from storm to tornado and from thunderstorm to tornado. This yields the optimal value for this round of evolution. .

[0038] The strategy of combining the Tornado algorithm and the Gray Wolf algorithm for local optimization includes: introducing the Gray Wolf optimization algorithm to calculate α Wolf, β Wolf, and δ Wolf.

[0039] The formula for a gray wolf pack surrounding its prey is:

[0040] ;

[0041] The distance between the prey and the gray wolf. and It is a coefficient vector. Let t be the current position of the prey, and t be the current iteration number. This indicates the current location of the Grey Wolf.

[0042] ;

[0043] in It is the convergence factor. and It is a random number in the range [0,1]. ;

[0044] in, , , These represent the distances between α wolf, β wolf, δ wolf, and other individuals, respectively. , , Represent The current positions of the wolf, beta wolf, and delta wolf. , , It is a random vector. This is the current position of the Grey Wolves;

[0045] The tornado algorithm obtained Replace the position vector of α wolf After performing the calculations, the updated formula is shown below:

[0046] ;

[0047] Compare the α wolf in the gray wolf algorithm with the one using The updated fitness function values ​​of the alpha wolves are used to select the wolf with the smallest fitness function as the current alpha wolf.

[0048] Calculate the fitness function values ​​of α wolf, β wolf, and δ wolf, and take the average value. Mean fitness function of thunderstorm and tornado populations By comparing, we can obtain and with By comparing the values ​​and selecting the smaller ones, the population sizes of thunderstorms and tornadoes are recalculated. The formula for calculating the population size at this time is as follows:

[0049] ;

[0050] Record the α wolf obtained by the gray wolf algorithm and the optimal tornado location obtained by the tornado algorithm. The fitness function values ​​of the two positions are compared, and the position with the smallest fitness function value is selected as the optimal position, denoted as: .

[0051] make This represents the difference in fitness functions between the optimal position at iteration t and iteration t+1, divided by the absolute value of the fitness function at the optimal position at iteration t+1. If, during the optimization process using this algorithm, the optimal position appears consecutively 30 times... When the change in fitness function at the current optimal position is minimal, it indicates that we need to move beyond the local optimization phase and perform a global optimization.

[0052] make The global optimization is performed, and its formula is shown below:

[0053] ;

[0054] in, and These represent the position vectors of the i-th storm at iteration number t+1 and t, respectively. This represents the position vector of the i-th tornado at iteration t; This illustrates the difference between the evolution of a storm into a tornado and the formation of a random storm: Indicates gradient wind speed; The calculation process is as follows:

[0055] ;

[0056] Indicates in A random number within.

[0057] Compare the fitness function values ​​of the i storms obtained through global optimization, and select the one with the smallest fitness function as the optimal position, denoted as: The fitness function value at this time is obtained. to The fitness function values ​​are compared, if If the value is smaller, it is considered the new optimal position; otherwise, the process of a storm directly evolving into a tornado in the tornado algorithm is improved using the fourth defense mechanism of the porcupine. The formula for the fourth defense mechanism of the porcupine is as follows:

[0058] ;

[0059] In the formula, This represents the position of the i-th individual after the (t+1)th iteration. Let represent the optimal solution in the t iterations. This represents the position of the i-th individual after t iterations, and also represents the position of the predator. , It is a random number between 0 and 1. The parameter used to control the search direction is defined by the following formula: ;

[0060] It is a vector containing randomly generated values ​​between 0 and 1.

[0061] As a defensive factor, use the formula It means that in the formula Let t represent a random number between 0 and 1, and t be the current iteration number. This represents the maximum number of iterations.

[0062] This represents the average force exerted by the i-th crested porcupine on the predator. Based on the principle of inelastic collisions, the specific formula is:

[0063] ;

[0064] In the formula, Let represent the final velocity of the i-th individual at time t+1, and assign it based on a solution randomly selected from the current population. , It is a randomly selected Crowned Porcupine from the Crowned Porcupine population. Let represent the initial velocity of the i-th individual at time t. , This represents a vector that generates random values ​​between 0 and 1. The mass of the i-th predator at the t-th iteration is represented by the following formula:

[0065] ;

[0066] In the formula This represents the objective function, i.e., the fitness function in this invention. This represents a small value to avoid division by zero.

[0067] At this time, The optimal position obtained by comparison Replace the crowned porcupine algorithm and Perform a calculation as shown in the following formula:

[0068] ;

[0069] Get new and , at this time Assign to Through an improved tornado algorithm, storms can be directly transformed into tornadoes. The specific formula is as follows:

[0070] ;

[0071] At this time fitness function value and The fitness function values ​​are compared. If If the fitness function value at a given location is smaller, this location is taken as the optimal position, and the current global optimization ends; otherwise, [then...]. It is directly regarded as the optimal position.

[0072] The number of times global optimization is recorded is The number of times here is And specify the maximum number of iterations. The optimal position is then substituted into the tornado algorithm for a deeper optimization.

[0073] until The optimization process ends, thus yielding the tornado combination intelligent algorithm.

[0074] During the training of the improved YOLOvx target recognition model using acquired historical fish image data, a higher mAP value is better. The fitness function is defined as follows: The calculation formula is:

[0075] ;

[0076] ;

[0077] ;

[0078] ;

[0079] In the formula, This indicates the number of samples that were correctly detected as positive. FN represents the number of negative samples that were incorrectly detected as positive samples, and k is the number of classes.

[0080] Based on the obtained tornado-integrated intelligent algorithm, with the goal of optimizing the fitness function, the weights in the upsampling process of the neural network structure are adjusted. and Optimization calculations are performed, and the model is trained using a mixed fish image database to obtain an optimized target recognition model.

[0081] A second aspect of the present invention provides a fish recognition device based on an optimized convolutional neural network, comprising:

[0082] The data acquisition module is configured to acquire image data of mixed fish at different growth stages;

[0083] The target recognition model training module is configured to: train an improved YOLOvx target recognition model using mixed image data of fish at different growth stages, to obtain a trained improved YOLOvx target recognition model; wherein, the construction process of the improved YOLOvx target recognition model includes:

[0084] First, the Tornado algorithm is used for global optimization to obtain the initial tornado position. Then, a strategy combining the Tornado algorithm and the Gray Wolf algorithm is adopted for local optimization. The global optimization process in the Tornado algorithm is improved by incorporating the fourth defense mechanism of the porcupine, resulting in the Tornado combined intelligent algorithm. Then, the upsampling process of the YOLOvx target recognition model is improved by using the Tornado combined intelligent algorithm, resulting in the improved YOLOvx target recognition model.

[0085] The target recognition module is configured to: identify target images to be processed during fish fishing based on the improved YOLOvx target recognition model after training, and obtain accurate identification results of mixed fish.

[0086] A third aspect of the present invention provides a computer-readable storage medium.

[0087] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described convolutional neural network-based fish recognition method with optimized structure.

[0088] A fourth aspect of the present invention provides a computer device.

[0089] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the fish recognition method based on an optimized structure of a convolutional neural network as described above.

[0090] Compared with the prior art, the beneficial effects of the present invention are:

[0091] This invention employs a strategy combining the Tornado Algorithm and the Grey Wolf Algorithm to obtain the corresponding number of tornadoes and thunderstorms, achieving a global and local optimization adjustment effect. By combining the fourth defense mechanism of the porcupine, the storm in the Tornado Algorithm is improved globally, resulting in a wider development scope. By comprehensively considering global and local optimization, a combined intelligent Tornado Algorithm is obtained.

[0092] This invention uses the Tornado Combination Intelligent Algorithm to optimize the upsampling stage in the neural network for target recognition. By introducing a dynamic point sampling upsampling method and combining it with the traditional static sampling method, the sampling points can be dynamically adjusted according to the input features to obtain an optimized YOLOvx target recognition model, thereby enhancing the model's ability to recognize small targets.

[0093] Advantages of additional aspects of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description

[0094] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.

[0095] Figure 1 This is a schematic diagram of a fish recognition method based on an optimized convolutional neural network according to one embodiment.

[0096] Figure 2 This is a schematic diagram of the intelligent optimization algorithm flow of one embodiment. Detailed Implementation

[0097] The present invention will be further described below with reference to the accompanying drawings and embodiments.

[0098] It should be noted that the following detailed description is illustrative and intended to provide further explanation of the invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.

[0099] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of exemplary embodiments according to the invention. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.

[0100] In underwater fish identification tasks, YOLOvx still has some problems, such as low accuracy in small target identification. To address these issues and improve existing upsampling methods, this invention proposes a dynamic point sampling-based upsampling method, DySample. This method employs a bilinear structure to generate the base offset and dynamic modulation factor in parallel, where the dynamic modulation factor is determined by... Constraints are standardized; secondly, a tornado-based intelligent algorithm is introduced to automatically optimize the mixing ratio of the original sampling grid and dynamic offset. This allows the sampling points to adaptively adjust according to the input features, thereby obtaining a better feature representation capability.

[0101] To address the issue of low accuracy in identifying mixed fish species, particularly small targets, existing methods first employ the Tornado algorithm for global optimization to obtain the initial tornado position. Then, a strategy combining the Tornado and Gray Wolf algorithms is used for local optimization. Furthermore, the global optimization process in the Tornado algorithm is improved by incorporating the fourth defense mechanism of the crested porcupine, resulting in the Tornado Combined Intelligent Algorithm. Finally, the Tornado Combined Intelligent Algorithm is used to improve the upsampling process of the YOLOvx target recognition model, yielding an optimized target recognition model.

[0102] Example 1

[0103] like Figure 1 As shown, this embodiment provides a fish recognition method based on an optimized convolutional neural network, including the following steps:

[0104] Step 1: Obtain image data of mixed fish at different growth stages;

[0105] In this embodiment, the image data of the mixed fish at different growth stages are images of the mixed fish collected in real time, including morphological features such as body size, dorsal fin, and caudal fin.

[0106] Step 2: Train the improved YOLOvx target recognition model based on the acquired historical fish image data to obtain the trained improved YOLOvx target recognition model (i.e., the fish recognition model based on the optimized convolutional neural network).

[0107] The construction process of the improved YOLOvx target recognition model includes:

[0108] Step 2.1: Determine the parameter types and value ranges of the search space of the backbone network of the convolutional neural network and improve the upsampling process;

[0109] Step 2.2: As Figure 2 As shown, the Tornado algorithm is first used for global optimization to obtain the initial tornado position. Then, a strategy combining the Tornado algorithm and the Gray Wolf algorithm is adopted for local optimization. The global optimization process in the Tornado algorithm is improved by combining the fourth defense mechanism of the porcupine, resulting in the Tornado combined intelligent algorithm (i.e., intelligent optimization algorithm). Then, the Tornado combined intelligent algorithm is used to improve the upsampling process of the YOLOvx target recognition model, resulting in the improved YOLOvx target recognition model.

[0110] The research design of the tornado algorithm is as follows:

[0111] First, the initial population is initialized, generating... A storm, It refers to an individual storm, which can evolve into a thunderstorm or tornado. ;

[0112] In this algorithm, the fitness function is denoted as fit, which is conventionally defined in this invention as follows: The smaller the value, the better. The formula is:

[0113] ;

[0114] To determine the number of storms that can develop into thunderstorms or tornadoes, a variable is introduced. , The value of k is , This represents the fitness value of the kth thunderstorm associated with the tornado. This refers to the number of storms that evolve or are assigned to a specific thunderstorm or tornado:

[0115] ;in, The sum of the number of thunderstorms and tornadoes in the previous round is obtained. Afterwards, if If so, let it be 9, and you can specify that there are A thunderstorm and A tornado, causing , By combining the Coriolis force, centrifugal force, and pressure gradient force, the gradient wind speeds that form thunderstorms and tornadoes can be calculated.

[0116] ;

[0117] Where i = 1, 2, ..., It is a size of The storm index of the population, This represents the new velocity vector of the i-th storm. The current velocity vector of the i-th storm is defined, rand represents a uniformly distributed random number in the range [0,1], and η identifies a contraction factor used to simulate the convergence behavior of the storm. and These are the radii of curvature of the storm tracks in the Northern and Southern Hemispheres, respectively. This refers to random numbers created within different ranges. Indicates the Coriolis parameter, and These represent the Coriolis force in the Northern and Southern Hemispheres, respectively.

[0118] ;

[0119] χ represents the acceleration rate of the storm, which has been experimentally verified to be equal to 4.10.

[0120] ;

[0121] ;

[0122] In the formula, t and T are the current and maximum number of iterations, respectively.

[0123] ;

[0124] In the formula It is a constant, equal to 100,000. Including the direction change function and the weighted random function, The `rand` directive represents a function that takes values ​​of 1 and -1, used to indicate the change in sign. Random values ​​generated within the range and The values ​​are fixed at 1.0 and 4.0 respectively.

[0125] ;

[0126] in This represents the rotational angular velocity, equal to 0.7292115 E - 04. rand represents a random number generated uniformly in the range [0,1]. A random value representing latitude.

[0127] ;

[0128] ;

[0129] Let be the pressure gradient force (PGF) component of the normal direction of the i-th storm at the t-th iteration.

[0130] ;

[0131] in It is the current position vector of the tornado under the random exponent ζ at the t-th iteration. ζ is the position vector of the storm at the t-th iteration, and ζ is the random exponent of the tornado defined in the equation.

[0132] ;

[0133] Storms can be explored within the γ range. ,in, Indicates the current distance between the storm and the thunderstorm. It is between 0 and Random numbers between these points follow a uniform distribution or some reasonable distribution. This represents a random number within the range (0.5, 5).

[0134] when At this time, the storm evolves into a thunderstorm, and the process is as follows:

[0135] ;

[0136] in, and Let represent the next and current position vectors of the storm that evolved into a thunderstorm at iterations t+1 and t, respectively. Let represent the current position vector of the i-th thunderstorm at iteration t, and rand is a random number uniformly distributed in the range [0,1].

[0137] All thunderstorms can evolve into tornadoes, the formula is:

[0138] ;

[0139] ;

[0140] ;

[0141] ;

[0142] in, and Let represent the next and current position vectors of the thunderstorms that evolved into tornadoes at iterations t+1 and t, respectively. Let ζ represent the position vector of the tornado at a random index ζ. This represents the location vector of the thunderstorm at a random index. Here, rand is a random value uniformly distributed within the range [0,1], t represents the t-th iteration of the loop, and T represents the total number of iterations. It is a constant value, which is 2.

[0143] Compare the fitness values ​​of storms that can evolve into thunderstorms in the (t+1)th iteration. If the fitness value is better, the storm can be swapped with the thunderstorm; otherwise, the positions remain unchanged. This process applies similarly to the evolution from storm to tornado and from thunderstorm to tornado. This yields the optimal value for this round of evolution. .

[0144] The gray wolf optimization algorithm is introduced to calculate the α wolf, β wolf, and δ wolf.

[0145] The formula for a gray wolf pack surrounding its prey is:

[0146] ;

[0147] The distance between the prey and the gray wolf. and It is a coefficient vector. Let t be the current position of the prey, and t be the current iteration number. This indicates the current location of the Grey Wolf.

[0148] ;

[0149] in It is the convergence factor. and It is a random number in the range [0,1].

[0150] ;

[0151] in, , , These represent the distances between α wolf, β wolf, δ wolf, and other individuals, respectively. , , Represent The current positions of the wolf, beta wolf, and delta wolf. , , It is a random vector. This is the current position of the Grey Wolves.

[0152] The tornado algorithm obtained Replace the position vector of α wolf After performing the calculations, the updated formula is shown below:

[0153] ;

[0154] Compare the α wolf in the gray wolf algorithm with the one using The updated fitness function values ​​of the alpha wolves are used to select the wolf with the smallest fitness function as the current alpha wolf.

[0155] Calculate the fitness function values ​​of α wolf, β wolf, and δ wolf, and take the average value. Mean fitness function of thunderstorm and tornado populations By comparing, we can obtain and with By comparing the values ​​and selecting the smaller ones, the population sizes of thunderstorms and tornadoes are recalculated. The formula for calculating the population size at this time is as follows:

[0156] ;

[0157] Record the α wolf obtained by the gray wolf algorithm and the optimal tornado location obtained by the tornado algorithm. The fitness function values ​​of the two positions are compared, and the position with the smallest fitness function value is selected as the optimal position, denoted as: .

[0158] make This represents the difference in fitness functions between the optimal position at iteration t and iteration t+1, divided by the absolute value of the fitness function at the optimal position at iteration t+1. If, during the optimization process using this algorithm, the optimal position appears consecutively 30 times... When the change in fitness function at the current optimal position is minimal, it indicates that we need to move beyond the local optimization phase and perform a global optimization.

[0159] make The global optimization is performed, and its formula is shown below:

[0160] ;

[0161] in, and These represent the position vectors of the i-th storm at iteration number t+1 and t, respectively. This represents the position vector of the i-th tornado at iteration t; This illustrates the difference between the evolution of a storm into a tornado and the formation of a random storm: Indicates gradient wind speed; The calculation process is as follows:

[0162] ;

[0163] Indicates in A random number within.

[0164] Compare the fitness function values ​​of the i storms obtained through global optimization, and select the one with the smallest fitness function as the optimal position, denoted as: The fitness function value at this time is obtained. to The fitness function values ​​are compared, if If the value is smaller, it is considered the new optimal position; otherwise, the process of a storm directly evolving into a tornado in the tornado algorithm is improved using the fourth defense mechanism of the porcupine. The formula for the fourth defense mechanism of the porcupine is as follows:

[0165] ;

[0166] In the formula, This represents the position of the i-th individual after the (t+1)th iteration. Let represent the optimal solution in the t iterations. This represents the position of the i-th individual after t iterations, and also represents the position of the predator. , It is a random number between 0 and 1. The parameter used to control the search direction is defined by the following formula: ;

[0167] It is a vector containing randomly generated values ​​between 0 and 1.

[0168] As a defensive factor, use the formula It means that in the formula Let t represent a random number between 0 and 1, and t be the current iteration number. This represents the maximum number of iterations.

[0169] This represents the average force exerted by the i-th crested porcupine on the predator. Based on the principle of inelastic collisions, the specific formula is:

[0170] ;

[0171] In the formula, Let represent the final velocity of the i-th individual at time t+1, and assign it based on a solution randomly selected from the current population. , It is a randomly selected Crowned Porcupine from the Crowned Porcupine population. Let represent the initial velocity of the i-th individual at time t. , This represents a vector that generates random values ​​between 0 and 1. The mass of the i-th predator at the t-th iteration is represented by the following formula:

[0172] ;

[0173] In the formula This represents the objective function, i.e., the fitness function in this invention. This represents a small value to avoid division by zero.

[0174] At this time, The optimal position obtained by comparison Replace the crowned porcupine algorithm and Perform a calculation as shown in the following formula:

[0175] ;

[0176] Get new and , at this time Assign to Through an improved tornado algorithm, storms can be directly transformed into tornadoes. The specific formula is as follows:

[0177] ;

[0178] At this time fitness function value and The fitness function values ​​are compared. If If the fitness function value at a given location is smaller, this location is taken as the optimal position, and the current global optimization ends; otherwise, [then...]. It is directly regarded as the optimal position.

[0179] The number of times global optimization is recorded is The number of times here is and stipulate The optimal position is then substituted into the tornado algorithm for a deeper optimization.

[0180] until The optimization process ends, thus yielding the tornado combination intelligent algorithm.

[0181] Step 3: Based on the trained target recognition model, the target image to be processed during the fish fishing process is identified to obtain the target recognition result.

[0182] Example 2

[0183] This embodiment provides a method and apparatus for fish recognition based on an optimized convolutional neural network, including:

[0184] The data acquisition module is configured to acquire image data of mixed fish at different growth stages;

[0185] The target recognition model training module is configured to: train an improved YOLOvx target recognition model using mixed image data of fish at different growth stages, to obtain a trained improved YOLOvx target recognition model; wherein, the construction process of the improved YOLOvx target recognition model includes:

[0186] First, the Tornado algorithm is used for global optimization to obtain the initial tornado position. Then, a strategy combining the Tornado algorithm and the Gray Wolf algorithm is adopted for local optimization. The global optimization process in the Tornado algorithm is improved by incorporating the fourth defense mechanism of the porcupine, resulting in the Tornado combined intelligent algorithm. Then, the upsampling process of the YOLOvx target recognition model is improved by using the Tornado combined intelligent algorithm, resulting in the improved YOLOvx target recognition model.

[0187] The target recognition module is configured to: identify target images to be processed during fish fishing based on the improved YOLOvx target recognition model after training, and obtain accurate identification results of mixed fish.

[0188] Example 3

[0189] This embodiment provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps in the above-described convolutional neural network-based fish recognition method with optimized structure.

[0190] Example 4

[0191] This embodiment provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the steps in the above-described convolutional neural network fish recognition method based on optimized structure.

[0192] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of hardware embodiments, software embodiments, or embodiments combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage and optical storage) containing computer-usable program code.

[0193] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0194] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0195] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0196] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.

[0197] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention are permitted.

Claims

1. A fish recognition method based on an optimized convolutional neural network, characterized in that, Includes the following steps: Acquire image data of mixed fish at different growth stages; The improved YOLOvx target recognition model is trained using acquired historical fish image data to obtain the trained improved YOLOvx target recognition model; wherein, the construction process of the improved YOLOvx target recognition model includes: First, the Tornado algorithm is used for global optimization to obtain the initial tornado position. Then, a strategy combining the Tornado algorithm and the Gray Wolf algorithm is adopted for local optimization. The global optimization process in the Tornado algorithm is improved by incorporating the fourth defense mechanism of the porcupine, resulting in the Tornado combined intelligent algorithm. Then, the upsampling process of the YOLOvx target recognition model is improved by using the Tornado combined intelligent algorithm, resulting in the improved YOLOvx target recognition model. The improved YOLOvx target recognition model, after training, is used to identify target images to be processed during fish fishing, and accurate identification results of mixed fish are obtained.

2. The fish recognition method based on an optimized convolutional neural network as described in claim 1, characterized in that, The image data of the mixed fish at different growth stages includes the body size, dorsal fin and caudal fin morphological features of the mixed fish. By taking more than a set number of pictures of mixed fish and their different growth stages, and extracting the identification targets to be processed from the pictures, classifying and processing them, a mixed fish image database is formed.

3. The fish recognition method based on an optimized convolutional neural network as described in claim 1, characterized in that, The upsampling process includes: introducing an upsampling method based on dynamic point sampling, which reconstructs the feature map by optimizing the sampling process. The specific process is as follows: Given input feature map , build a Given a sample set S, for each coordinate point in the sample set S The bilinear interpolation algorithm is used to sample features on the original feature map X, resulting in an output with new dimensions. Feature map ; Given upsampling scaling factor and input feature map First, a linear layer is used, with the number of input and output channels being respectively... and Generate offset Then, using the same linear layer, and giving The perturbation is summed between the two linear layers, and after passing through a pixel shuffling operation, the result is determined as the offset. For the original sampling grid Weighting makes the sampling set The proportion is even smaller, and the final sample set S consists of the generated offset O and the original sample grid. Adding them together, we get: 。 4. The fish recognition method based on an optimized convolutional neural network as described in claim 1, characterized in that, The process of first performing a global optimization using the tornado algorithm to obtain the initial tornado location includes: First, initializing the initial population and generating... A storm, To represent an individual storm, used to describe its evolution into a thunderstorm or tornado; ; In this algorithm, the fitness function is denoted as fit, and is conventionally defined as follows: The smaller the value, the better. The formula is: ; To determine the number of storms that can develop into thunderstorms or tornadoes, a variable is introduced. , The value of k is , This represents the fitness value of the k-th thunderstorm associated with a tornado. This refers to the number of storms that evolve or are assigned to a specific thunderstorm or tornado: ; in, The sum of the number of thunderstorms and tornadoes in the previous round is obtained. Afterwards, if Let it be 9, specifying that... A thunderstorm and A tornado, causing , ; The storm explores within the γ range. ,in, Indicates the current distance between the storm and the thunderstorm. It is between 0 and Random numbers between these points follow a uniform distribution or some reasonable distribution. This represents a random number within the range (0.5, 5). when At this time, the storm evolves into a thunderstorm, and the process is as follows: ; in, and Let represent the next and current position vectors of the storm that evolved into a thunderstorm at iterations t+1 and t, respectively. Let represent the position vector of the i-th thunderstorm at iteration t, and rand is a random number uniformly distributed in the range [0,1]. This represents the position vector of the i-th tornado at iteration t; All thunderstorms can evolve into tornadoes, the formula is: ; ; ; ; in, and Let represent the next and current position vectors of the thunderstorm that evolved into a tornado at iterations t+1 and t, respectively. Let ζ represent the position vector of the tornado at a random index ζ. This represents the location vector of the thunderstorm at a random index, where rand is a random value uniformly distributed in the range [0,1], t represents the t-th iteration of the loop, and T represents the total number of iterations. It is a constant value, which is 2; Compare the fitness values ​​of storms that can evolve into thunderstorms in the (t+1)th iteration. If the fitness value is better, the storm can be swapped with the thunderstorm; otherwise, the position remains unchanged. This process is similar for the evolution of storms into tornadoes and thunderstorms into tornadoes, thus obtaining the optimal value for this round of evolution.

5. The fish recognition method based on an optimized convolutional neural network as described in claim 4, characterized in that, The strategy of combining the tornado algorithm and the gray wolf algorithm for local optimization includes: based on the obtained thunderstorm and tornado populations, the gray wolf optimization algorithm is introduced to calculate them to obtain α wolf, β wolf, and δ wolf. The formula for a gray wolf pack surrounding its prey is: ; The distance between the prey and the gray wolf. and It is a coefficient vector. Let t be the current position of the prey, and t be the current iteration number. This is the current position of the gray wolf. ; in It is the convergence factor. and It is a random number in the range [0,1]. ; in, , , These represent the distances between α wolf, β wolf, δ wolf, and other individuals, respectively. , , Represent The current positions of the wolf, beta wolf, and delta wolf. , , It is a random vector. This is the current position of the Grey Wolves; This will yield the optimal value of evolution. α wolf's position vector After performing the calculations, the updated formula is shown below: ; Compare the α wolf in the gray wolf algorithm with the one using The updated fitness function value of the alpha wolf is used to select the wolf with the smallest fitness function as the current alpha wolf. Calculate the fitness function values ​​of α wolf, β wolf, and δ wolf, and take the average value. Mean fitness function of thunderstorm and tornado populations By comparing, we can obtain and with By comparing the values ​​and selecting the smaller ones, the population sizes of thunderstorms and tornadoes are recalculated. The formula for calculating the population size at this time is as follows: ; Record the α wolf obtained by the gray wolf algorithm and the optimal tornado location obtained by the tornado algorithm. The fitness function values ​​of the two positions are compared, and the position with the smallest fitness function value is selected as the optimal position. make It represents the difference between the fitness function of the optimal position at iteration t and iteration t+1, divided by the absolute value of the fitness function of the optimal position at iteration t+1. If the number of consecutive occurrences during the optimization process using this algorithm is set to... When the value is less than the set threshold, it indicates that the fitness function of the current optimal position is extremely small, and the local optimization stage is exited.

6. The fish recognition method based on an optimized convolutional neural network as described in claim 1, characterized in that, The process of improving the global optimization process in the tornado algorithm by incorporating the fourth defense mechanism of the crowned porcupine includes: letting The global optimization is performed, and its formula is shown below: ; in, and These represent the position vectors of the i-th storm at iteration number t+1 and t, respectively. This represents the position vector of the i-th tornado at iteration t; This illustrates the difference between the evolution of a storm into a tornado and the formation of a random storm: Indicates gradient wind speed; The calculation process is as follows: ; Indicates in A random number within; Compare the fitness function values ​​of the i storms obtained through global optimization, and select the one with the smallest fitness function as the optimal position, denoted as: The fitness function value at this point is obtained. to The values ​​of the adaptive function are compared, if If the value is smaller, it is considered the new optimal position; otherwise, the tornado algorithm is improved using the fourth defense mechanism of the crowned porcupine. ; In the formula, This represents the position of the i-th individual after the (t+1)th iteration. Let represent the optimal solution in the t iterations, and let represent the position of the i-th individual after t iterations, which also represents the position of the predator. , It is a random number between 0 and 1. The parameter used to control the search direction is defined by the following formula: ; It is a vector containing a number of randomly generated values ​​between 0 and 1; As a defensive factor, use the formula It means that in the formula Let t represent a random number between 0 and 1, and t be the current iteration number. This represents the maximum number of iterations. This represents the average force exerted by the i-th crested porcupine on the predator. Based on the principle of inelastic collisions, the specific formula is: ; In the formula, Let represent the final velocity of the i-th individual at time t+1, and assign it based on a solution randomly selected from the current population. , It is a randomly selected Crowned Porcupine from the Crowned Porcupine population. Let represent the initial velocity of the i-th individual at time t. , This represents a vector that generates random values ​​between 0 and 1. The mass of the i-th predator at the t-th iteration is represented by the following formula: ; In the formula This represents the objective function, also known as the fitness function. This represents a small value to avoid division by zero. At this time, The optimal position is the one with the smallest fitness function value. Replace the crowned porcupine algorithm and Perform a calculation as shown in the following formula: ; Get new and , at this time Assign to Through an improved tornado algorithm, storms can be directly transformed into tornadoes. The specific formula is as follows: ; At this time The optimal position is the one with the smallest fitness function value. The fitness function values ​​are compared, if If the fitness function value at a given location is smaller, this location is taken as the optimal position, and the current global search ends. Otherwise, the location with the smallest fitness function value is taken as the optimal position. This is directly considered the optimal position; The number of times global optimization is recorded is The number of times here is And specify the maximum number of iterations. By substituting the optimal position into the tornado algorithm for global optimization, a deeper level of optimization is achieved. until The optimization process ends, thus yielding the tornado combination intelligent algorithm.

7. The fish recognition method based on an optimized convolutional neural network as described in claim 1, characterized in that, During the training of the improved YOLOvx target recognition model using acquired historical fish image data, a higher mAP value is better. The fitness function is defined as follows: The calculation formula is: ; ; ; ; In the formula, This indicates the number of samples that were correctly detected as positive. FN represents the number of negative samples that were incorrectly detected as positive samples, and k is the number of classes. Based on the obtained tornado-integrated intelligent algorithm, with the goal of optimizing the fitness function, the weights in the upsampling process of the neural network structure are adjusted. and Optimization calculations are performed, and the model is trained using a mixed fish image database to obtain an optimized target recognition model.

8. A fish recognition device based on an optimized convolutional neural network, characterized in that, include: The data acquisition module is configured to acquire image data of mixed fish at different growth stages; The target recognition model training module is configured to: train an improved YOLOvx target recognition model using mixed image data of fish at different growth stages, to obtain a trained improved YOLOvx target recognition model; wherein, the construction process of the improved YOLOvx target recognition model includes: First, the Tornado algorithm is used for global optimization to obtain the initial tornado position. Then, a strategy combining the Tornado algorithm and the Gray Wolf algorithm is adopted for local optimization. The global optimization process in the Tornado algorithm is improved by incorporating the fourth defense mechanism of the porcupine, resulting in the Tornado combined intelligent algorithm. Then, the upsampling process of the YOLOvx target recognition model is improved by using the Tornado combined intelligent algorithm, resulting in the improved YOLOvx target recognition model. The target recognition module is configured to: identify target images to be processed during fish fishing based on the improved YOLOvx target recognition model after training, and obtain accurate identification results of mixed fish.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the steps in the fish recognition method based on an optimized structure according to any one of claims 1-7.

10. A computer 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 program, it implements the steps in the fish recognition method based on an optimized structure of a convolutional neural network as described in any one of claims 1-7.