Target detection method and device, electronic equipment, storage medium and product

CN118941918BActive Publication Date: 2026-10-30CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410987867.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-23
Publication Date
2026-10-30
Estimated Expiration
2044-07-23

AI Technical Summary

Technical Problem

[0002]相关目标检测方案中,大多目标检测网络使用梯度下降类参数寻优算法,用于确定目标检测网络的网络参数的最优解,但是该方法存在容易陷入局部最优解的问题,导致目标检测准确率低

Benefits of technology

[0038]综上,本公开提出了一种目标检测方法,该方法包括:确定第一目标检测网络的网络参数;所述第一目标检测网络包括至少一个卷积层和至少一个全连接层,所述第一目标检测网络的网络参数包括每个所述卷积层的卷积层权重及卷积层偏置,及每个所述全连接层的全连接层权重及全连接层偏置;将所述网络参数作为粒子群中的粒子,利用粒子群优化算法,以第一目标检测网络的损失函数的值最小为优化目标,获取所述粒子群中每个粒子的最优解;将每个所述粒子的最优解作为所述第一目标检测网络对应的网络参数,得到第二目标检测网络,利用所述第二目标检测网络进行目标检测。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118941918B_ABST
    Figure CN118941918B_ABST
Patent Text Reader

Abstract

The present disclosure provides a target detection method and device, electronic equipment, storage medium and product. The method comprises: determining network parameters of a first target detection network; the first target detection network comprises at least one convolutional layer and at least one fully connected layer, and the network parameters of the first target detection network comprise convolutional layer weights and convolutional layer biases of each convolutional layer, and fully connected layer weights and fully connected layer biases of each fully connected layer; taking the network parameters as particles in a particle swarm, using a particle swarm optimization algorithm, taking the value of a loss function of the first target detection network as the optimization target, and obtaining the optimal solution of each particle in the particle swarm; taking the optimal solution of each particle as the corresponding network parameters of the first target detection network, obtaining a second target detection network, and using the second target detection network for target detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of target detection technology, and in particular to a target detection method, apparatus, electronic device, storage medium, and product. Background Technology

[0002] In most object detection schemes, gradient descent-like parameter optimization algorithms are used to determine the optimal solution of the network parameters. However, this method is prone to getting trapped in local optima, resulting in low object detection accuracy. Summary of the Invention

[0003] This disclosure provides a target detection method, apparatus, electronic device, storage medium, and product to solve problems in the related art.

[0004] A first aspect of this disclosure provides a target detection method, the method comprising:

[0005] Determine the network parameters of a first target detection network; the first target detection network includes at least one convolutional layer and at least one fully connected layer, and the network parameters of the first target detection network include the convolutional layer weights and convolutional layer biases of each convolutional layer, and the fully connected layer weights and fully connected layer biases of each fully connected layer;

[0006] The network parameters are treated as particles in a particle swarm. Using the particle swarm optimization algorithm, with the goal of minimizing the loss function of the first target detection network, the optimal solution for each particle in the particle swarm is obtained.

[0007] The optimal solution for each particle is used as the network parameter corresponding to the first target detection network to obtain the second target detection network, and the second target detection network is used for target detection.

[0008] In one embodiment, the network parameters are treated as particles in a particle swarm optimization algorithm. The algorithm aims to minimize the loss function of the first target detection network and obtain the optimal solution for each particle in the swarm. This includes:

[0009] Initialize the particle swarm, using the network parameters as particles in the particle swarm; wherein, the particles in the particle swarm correspond one-to-one with the network parameters of the first target detection network;

[0010] Obtain the initial fitness value of each particle, classify particles whose initial fitness value is less than a preset fitness threshold into an advantageous group, and classify particles whose initial fitness value is not less than the preset fitness threshold into an inferior group.

[0011] Each particle in the particle swarm is traversed, and an initial topological neighborhood corresponding to the currently traversed particle is selected from the dominant group, wherein the initial topological neighborhood includes at least one particle.

[0012] Obtain the initial local optimal particle in the initial topological neighborhood corresponding to the currently traversed particle and the initial global optimal particle in the dominant group;

[0013] Based on the initial local optimal particle and the initial global optimal particle, the currently traversed particle is iteratively updated until the iteration termination condition is met, and the optimal solution of the currently traversed particle is obtained.

[0014] In one embodiment, selecting the initial topological neighborhood corresponding to the currently traversed particle from the advantageous group includes:

[0015] A first preset number of target particles are selected from the advantageous group using a uniform random probability method, and these first preset number of target particles are used as the initial topological neighborhood of the corresponding particles.

[0016] In one embodiment, obtaining the initial local optimal particle in the initial topological neighborhood corresponding to the currently traversed particle and the initial global optimal particle in the dominant group includes:

[0017] The first sum is obtained by summing the initial fitness values ​​of all particles in the initial topological neighborhood corresponding to the currently traversed particle.

[0018] Based on the initial fitness value of each particle in the initial topological neighborhood corresponding to the currently traversed particle, the particle with the smallest fitness value in the initial topological neighborhood corresponding to the currently traversed particle is determined as the initial local optimal particle; and based on the initial fitness value and the first sum value of each particle in the initial topological neighborhood corresponding to the currently traversed particle, the initial global optimal particle in the initial topological neighborhood corresponding to the currently traversed particle is determined.

[0019] In one embodiment, determining the initial globally optimal particle in the initial topological neighborhood corresponding to the currently traversed particle, based on the initial fitness value and the first sum value of each particle in the initial topological neighborhood corresponding to the currently traversed particle, includes:

[0020] Based on the initial fitness value and first sum value of each particle in the initial topological neighborhood corresponding to the currently traversed particle, obtain the second preset number of dimensional positions of each particle in the initial topological neighborhood corresponding to the currently traversed particle.

[0021] Obtain the index of each particle in the initial topological neighborhood corresponding to the currently traversed particle;

[0022] The index of each particle in the initial topological neighborhood corresponding to the currently traversed particle is sorted using a random sorting method to obtain the sorting result of all particles in the initial topological neighborhood corresponding to the currently traversed particle.

[0023] According to the order of the particles in the sorting result of all particles in the initial topological neighborhood corresponding to the currently traversed particle, arrange the second preset number of dimensional positions of each particle in the initial topological neighborhood corresponding to the currently traversed particle to obtain the initial global optimal particle in the initial topological neighborhood corresponding to the currently traversed particle.

[0024] In one embodiment, based on the initial local optimal particle and the initial global optimal particle, the currently traversed particle is iteratively updated until the iteration termination condition is met, to obtain the optimal solution for the currently traversed particle, including:

[0025] Based on the initial local optimal particle and the initial global optimal particle, obtain the position of the initial local optimal particle and the position of the initial global optimal particle;

[0026] Obtain the original position and the original velocity of the currently traversed particle;

[0027] The first difference is obtained by subtracting the position of the initial local optimal particle from the original position of the currently traversed particle; and the second difference is obtained by subtracting the position of the initial global optimal particle from the original position of the currently traversed particle.

[0028] The current velocity of the currently traversed particle is obtained by summing the original velocity of the particle and the first difference with the second difference.

[0029] The current velocity of the currently traversed particle is summed with its original position to obtain its current position. This process continues until the iteration termination condition is met, thus obtaining the optimal solution for the currently traversed particle.

[0030] A second aspect of this disclosure provides a target detection apparatus, the apparatus comprising:

[0031] A determining unit is used to determine the network parameters of a first target detection network; the first target detection network includes at least one convolutional layer and at least one fully connected layer, and the network parameters of the first target detection network include the convolutional layer weights and convolutional layer biases of each convolutional layer, and the fully connected layer weights and fully connected layer biases of each fully connected layer;

[0032] The acquisition unit is used to treat the network parameters as particles in a particle swarm, and use the particle swarm optimization algorithm to obtain the optimal solution for each particle in the particle swarm with the goal of minimizing the loss function of the first target detection network.

[0033] The target detection unit is used to take the optimal solution of each particle as the network parameter corresponding to the first target detection network to obtain the second target detection network, and to perform target detection using the second target detection network.

[0034] A third aspect of this disclosure provides an electronic device comprising:

[0035] At least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the methods described in the first aspect of this disclosure.

[0036] A fourth aspect of this disclosure provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause a computer to perform the methods described in the first aspect of this disclosure.

[0037] A fifth aspect of this disclosure provides a computer program product including a computer program that, when executed by a processor, implements the methods described in the first aspect of this disclosure.

[0038] In summary, this disclosure proposes a target detection method, which includes: determining the network parameters of a first target detection network; the first target detection network includes at least one convolutional layer and at least one fully connected layer, the network parameters of the first target detection network including the convolutional layer weights and biases of each convolutional layer, and the fully connected layer weights and biases of each fully connected layer; using the network parameters as particles in a particle swarm optimization algorithm, and using the minimum value of the loss function of the first target detection network as the optimization objective, obtaining the optimal solution for each particle in the particle swarm; using the optimal solution of each particle as the network parameters corresponding to the first target detection network to obtain a second target detection network, and using the second target detection network for target detection.

[0039] According to the scheme provided in this disclosure, by using the network parameters of the first target detection network as particles in a particle swarm, and employing a particle swarm optimization algorithm with the goal of minimizing the loss function of the first target detection network, the optimal solution for each particle in the particle swarm can be obtained. This reduces the risk of getting trapped in local optima during the process of obtaining the optimal solution for each particle. Since the performance of the first target detection network largely depends on its network parameters, by using the optimal solution of each particle as the network parameters corresponding to the first target detection network, a second target detection network is obtained. Using the second target detection network with better network parameters for target detection can improve the accuracy of target detection.

[0040] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0041] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure, and are not intended to unduly limit this disclosure.

[0042] Figure 1 A schematic flowchart of the target detection method provided in the embodiments of this disclosure;

[0043] Figure 2 A flowchart illustrating a method for obtaining the optimal solution of the currently traversed particle, provided in an embodiment of this disclosure;

[0044] Figure 3 A flowchart illustrating the method for generating an initial globally optimal particle as provided in this embodiment of the disclosure;

[0045] Figure 4 A flowchart illustrating a method for obtaining the optimal solution of the currently traversed particle, provided in an embodiment of this disclosure;

[0046] Figure 5 A flowchart illustrating the target detection method provided as an application example of this disclosure;

[0047] Figure 6 This is a schematic diagram of the target detection device provided in an embodiment of the present disclosure;

[0048] Figure 7 This is a schematic diagram of the hardware composition structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation

[0049] Embodiments of this disclosure are described in detail below. Examples of these embodiments are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this disclosure, and should not be construed as limiting this disclosure.

[0050] In most object detection schemes, gradient descent-like parameter optimization algorithms are used to determine the optimal solution of the network parameters. However, this method is prone to getting trapped in local optima, resulting in low object detection accuracy.

[0051] The following is a brief introduction to one approach for target detection in related technologies:

[0052] This solution proposes using Fully Convolutional Networks (FCNs) to classify each pixel in an image, achieving pixel-level vehicle segmentation and accurately labeling the vehicle's location and outline. In the field of vehicle recognition, the application process of a Fully Convolutional Network (FCN) is as follows: First, a labeled vehicle image dataset is prepared, where each pixel is labeled as either a vehicle category (foreground) or a background category (background). These datasets can be manually labeled or use semantic segmentation datasets. Next, the prepared vehicle image dataset is input into the FCN model for training. The FCN progressively extracts image features through multiple convolutional and pooling layers, and outputs a feature map of the same size as the input image through fully convolutional layers. During training, functions such as cross-entropy loss are used to measure the difference between the predicted results and the true labels, and backpropagation is used to update model parameters to improve the model's performance on vehicle recognition tasks. After training, the FCN can be used for semantic segmentation of new vehicle images, classifying each pixel in the image as either a vehicle or background. The segmented image can accurately label the vehicle's location and outline, achieving vehicle localization and recognition.

[0053] The above solution has the following drawbacks:

[0054] Gradient descent algorithms are prone to getting stuck in local optima, which leads to low target detection accuracy based on gradient descent.

[0055] To address the shortcomings of related technologies, this disclosure uses the network parameters of a first target detection network as particles in a particle swarm optimization algorithm. The algorithm aims to minimize the loss function of the first target detection network and obtain the optimal solution for each particle in the swarm. This reduces the risk of getting trapped in local optima during the process of obtaining the optimal solution for each particle. Since the performance of the first target detection network largely depends on its network parameters, a second target detection network is obtained by using the optimal solution of each particle as the corresponding network parameters. Using the second target detection network with better network parameters for target detection improves the accuracy of target detection.

[0056] The present disclosure will now be described in further detail with reference to the accompanying drawings and specific embodiments.

[0057] like Figure 1 As shown, Figure 1 This is a flowchart illustrating the target detection method provided in this embodiment of the disclosure. The target detection method provided in this embodiment includes the following steps:

[0058] Step 101: Determine the network parameters of the first target detection network;

[0059] In one embodiment, the first target detection network includes at least one convolutional layer and at least one fully connected layer. The network parameters of the first target detection network include the convolutional layer weights and biases of each convolutional layer, and the fully connected layer weights and biases of each fully connected layer.

[0060] In one embodiment, the number of network parameters of the first target detection network is determined by the structure, number of layers, etc. of the first target detection network.

[0061] In one embodiment, the network parameters of the first target detection network can be determined by initialization parameters.

[0062] In one embodiment, the network parameters of the first target detection network can also be determined by optimizing the initialization parameters through an optimization algorithm.

[0063] Step 102: Treat the network parameters as particles in a particle swarm, and use the particle swarm optimization algorithm to obtain the optimal solution for each particle in the particle swarm with the goal of minimizing the loss function of the first target detection network.

[0064] In one embodiment, each particle in the particle swarm corresponds to a configuration of network parameters.

[0065] In one embodiment, the number of network parameters is the same as the dimension of the particles in the particle swarm.

[0066] In one embodiment, the loss function of the first object detection network can be a cross-entropy loss function, a mean squared error loss function, or a mean absolute error loss function.

[0067] In one embodiment, each particle in the particle swarm may have one or more optimal solutions, and this disclosure does not limit this.

[0068] In one embodiment, by treating the network parameters as particles in a particle swarm, the particle swarm optimization algorithm is used to obtain the optimal solution for each particle in the particle swarm with the goal of minimizing the loss function of the first target detection network, thereby obtaining the locally optimal particle in the particle swarm and ultimately the globally optimal particle in the particle swarm.

[0069] Step 103: The optimal solution of each particle is used as the network parameter corresponding to the first target detection network to obtain the second target detection network, and the second target detection network is used for target detection.

[0070] In one embodiment, the second object detection network refers to a pre-trained second object detection network.

[0071] In one embodiment, since each particle in the particle swarm may have one or more optimal solutions, the optimal solution of each particle is used as the network parameter corresponding to the first target detection network, and the second target detection network may also consist of one or more such networks.

[0072] In one embodiment, a second target detection network is obtained by using the optimal solution of each particle as the network parameters corresponding to the first target detection network. Target detection is performed using the second target detection network. By adopting better network parameters, the accuracy of target detection can be improved.

[0073] In one embodiment, after target detection is performed using the second target detection network, the target detection results can be post-processed to further improve the accuracy of recognition. The post-processing method can be connected component analysis, boundary detection, and filtering, etc.

[0074] In one embodiment, such as Figure 2 As shown, the network parameters are treated as particles in a particle swarm optimization algorithm. The algorithm aims to minimize the loss function of the first target detection network and obtain the optimal solution for each particle in the swarm, including:

[0075] Step 201: Initialize the particle swarm, using the network parameters as particles in the particle swarm; wherein, the particles in the particle swarm correspond one-to-one with the network parameters of the first target detection network.

[0076] In one embodiment, the particle swarm can be initialized by an initialization function, wherein the number of particles in the particle swarm can be preset, and the dimension of the particles in the particle swarm is the same as the number of network parameters.

[0077] In one embodiment, the value of each particle in the particle swarm corresponds one-to-one with the network parameters of the first target detection network.

[0078] Step 202: Obtain the initial fitness value of each particle, classify particles whose initial fitness value is less than a preset fitness threshold into an advantageous group, and classify particles whose initial fitness value is not less than the preset fitness threshold into an inferior group.

[0079] In one embodiment, the initial fitness value of each particle can be obtained from the loss function value of each particle.

[0080] In one embodiment, the fitness value of each particle is used to measure the quality of the particle. Specifically, in a minimization problem, a smaller fitness value indicates a better quality particle, and a larger fitness value indicates a worse quality particle; in a maximization problem, a smaller fitness value indicates a worse quality particle, and a larger fitness value indicates a better quality particle.

[0081] In one embodiment, the preset fitness threshold refers to a critical value that is just enough to distinguish between good and bad particle quality.

[0082] In one embodiment, during particle evolution, the fitness value of each particle changes, and a preset fitness threshold can be adjusted to re-divide the particles.

[0083] In one embodiment, by classifying particles whose initial fitness value is less than a preset fitness threshold into a dominant group and particles whose initial fitness value is not less than the preset fitness threshold into a suboptimal group, the quality information of particles in the entire population can be distinguished. Updating the particles in the dominant group is beneficial for the entire population to move towards the global optimum, while updating the particles in the suboptimal group is beneficial for improving the diversity of the population.

[0084] Step 203: Traverse each particle in the particle swarm and select the initial topological neighborhood corresponding to the currently traversed particle from the dominant group. The initial topological neighborhood includes at least one particle.

[0085] In one embodiment, a particle is determined from the disadvantage group as the currently traversed particle, and each particle in the particle group is traversed to obtain the distance between the currently traversed particle and each particle in the particle group. Particles in all advantageous groups within a preset distance range can be selected as the initial topological neighborhood corresponding to the currently traversed particle.

[0086] In one embodiment, a predetermined number of particles may be determined from the dominant group as the initial topological neighborhood corresponding to the currently traversed particle.

[0087] Step 204: Obtain the initial local optimal particle in the initial topological neighborhood corresponding to the currently traversed particle and the initial global optimal particle in the dominant group.

[0088] In one embodiment, the initial local optimal particle in the initial topological neighborhood corresponding to the currently traversed particle and the initial global optimal particle in the dominant group can be obtained by obtaining the fitness value in the initial topological neighborhood corresponding to the currently traversed particle.

[0089] In one embodiment, there may be one or more initial local optimal particles and initial global optimal particles in the dominant group.

[0090] Step 205: Based on the initial local optimal particle and the initial global optimal particle, iteratively update the currently traversed particle until the iteration termination condition is met, and obtain the optimal solution of the currently traversed particle.

[0091] In one embodiment, the iteration termination condition may be that the number of iterations reaches the preset maximum number of iterations for the particle swarm optimization algorithm.

[0092] In one embodiment, the iteration termination condition can also be finding the optimal solution that satisfies the requirements.

[0093] In one embodiment, based on the initial local optimal particle and the initial global optimal particle, the currently traversed particles are iteratively updated according to the update rules of the particle swarm optimization algorithm, wherein the update rules include position update rules and velocity update rules.

[0094] In one embodiment, selecting the initial topological neighborhood corresponding to the currently traversed particle from the advantageous group includes:

[0095] A first preset number of target particles are selected from the advantageous group using a uniform random probability method, and these first preset number of target particles are used as the initial topological neighborhood of the corresponding particles.

[0096] In one embodiment, a first preset number of target particles are selected from the advantageous group using a uniform random probability method. The first preset number of target particles are used as the initial topological neighborhood of the corresponding particles. The particles in the initial topological neighborhood of the corresponding particles can be completely identical, partially identical, or completely different.

[0097] In one embodiment, the size of the first preset number can be determined as needed. If it is necessary to speed up the convergence speed in the optimization process, a smaller first preset number of target particles should be selected. If it is necessary to improve the search diversity of the population, a larger first preset number of target particles should be selected.

[0098] In one embodiment, obtaining the initial local optimal particle in the initial topological neighborhood corresponding to the currently traversed particle and the initial global optimal particle in the dominant group includes:

[0099] The first sum is obtained by summing the initial fitness values ​​of all particles in the initial topological neighborhood corresponding to the currently traversed particle.

[0100] In one embodiment, the initial fitness value of each particle can be obtained from the loss function value of each particle.

[0101] In one embodiment, the first sum is obtained by summing the reciprocals of the initial fitness values ​​of all particles in the initial topological neighborhood corresponding to the currently traversed particle.

[0102] Based on the initial fitness value of each particle in the initial topological neighborhood corresponding to the currently traversed particle, the particle with the smallest fitness value in the initial topological neighborhood corresponding to the currently traversed particle is determined as the initial local optimal particle; and based on the initial fitness value and the first sum value of each particle in the initial topological neighborhood corresponding to the currently traversed particle, the initial global optimal particle in the initial topological neighborhood corresponding to the currently traversed particle is determined.

[0103] In one embodiment, the initial local optimal particle refers to the particle with the smallest fitness value in the initial topological neighborhood corresponding to the currently traversed particle. The initial global optimal particle usually refers to the particle with the smallest fitness value among all the current initial local optimal particles. However, in order to improve the search diversity of the population, avoid the population from getting stuck in local regions, and be able to jump out when unfortunately stuck in local regions, the initial global optimal particle in this scheme is determined by ensemble learning of each particle in the initial topological neighborhood corresponding to the currently traversed particle.

[0104] In one embodiment, such as Figure 3 As shown, based on the initial fitness value and the first sum value of each particle in the initial topological neighborhood corresponding to the currently traversed particle, the initial globally optimal particle in the initial topological neighborhood corresponding to the currently traversed particle is determined, including:

[0105] Step 301: Based on the initial fitness value and the first sum value of each particle in the initial topological neighborhood corresponding to the currently traversed particle, obtain the second preset number of dimensional positions of each particle in the initial topological neighborhood corresponding to the currently traversed particle.

[0106] In one embodiment, the second preset number is not greater than the dimension of the particles in the particle swarm, that is, the second preset number is not greater than the network parameters of the first target detection network.

[0107] In one embodiment, the mathematical expression for obtaining the second preset number of dimensional positions of each particle in the initial topological neighborhood corresponding to the currently traversed particle is represented by the following formula:

[0108]

[0109] Among them, Num ni f(X) represents the number of dimensional positions that need to be learned in the i-th particle within the initial topological neighborhood corresponding to the currently traversed particle. ni ) represents the fitness value of the i-th particle in the initial topological neighborhood corresponding to the currently traversed particle, and round() means rounding the value in parentheses to an integer, such as the value of round(4.4) is 4 and the value of round(4.7) is 5.

[0110] In one embodiment, f(X) ni The smaller the value, the better. ni The larger the value, the more dimensions the currently traversed particle will learn from higher-quality particles in its initial topological neighborhood.

[0111] Step 302: Obtain the index of each particle in the initial topological neighborhood corresponding to the currently traversed particle;

[0112] In one embodiment, each particle in the initial topological neighborhood corresponding to the currently traversed particle has a unique index, which is usually assigned to each particle during particle swarm initialization.

[0113] In one embodiment, the index of each particle in the initial topological neighborhood corresponding to the currently traversed particle is obtained by acquiring information about each particle in the initial topological neighborhood corresponding to the currently traversed particle.

[0114] Step 303: Use a random sorting method to sort the index of each particle in the initial topological neighborhood corresponding to the currently traversed particle, and obtain the sorting result of all particles in the initial topological neighborhood corresponding to the currently traversed particle.

[0115] In one embodiment, a random sorting method is used to sort the index of each particle in the initial topological neighborhood corresponding to the currently traversed particle. The sorting result of all particles in the initial topological neighborhood corresponding to the currently traversed particle can be ordered or unordered.

[0116] Step 304: Arrange the second preset number of dimensional positions of each particle in the initial topological neighborhood corresponding to the currently traversed particle according to the order of the sorting results of all particles in the initial topological neighborhood corresponding to the currently traversed particle, so as to obtain the initial global optimal particle in the initial topological neighborhood corresponding to the currently traversed particle.

[0117] In one embodiment, the mathematical expression for the initial globally optimal particle in the initial topological neighborhood corresponding to the currently traversed particle is represented by the following formula:

[0118]

[0119] Among them, X ensemble Let represent the initial global optimal particle in the initial topological neighborhood corresponding to the currently traversed particle, and seq[i] represent the i-th element in the sorting result of all particles in the initial topological neighborhood corresponding to the currently traversed particle. There are a total of NS particles in the initial topological neighborhood corresponding to the currently traversed particle.

[0120] In one embodiment, due to Num ni It is obtained by rounding to the nearest integer, X ensemble The total dimension in the particle swarm may be greater or less than the dimension of the particles in the swarm. Therefore, X can be adjusted by increasing the minimum second preset number of dimensions or decreasing the maximum second preset number of dimensions. ensemble Dimensions.

[0121] In one embodiment, such as Figure 4 As shown, based on the initial local optimal particle and the initial global optimal particle, the currently traversed particle is iteratively updated until the iteration termination condition is met, obtaining the optimal solution for the currently traversed particle, including:

[0122] Step 401: Based on the initial local optimal particle and the initial global optimal particle, obtain the position of the initial local optimal particle and the position of the initial global optimal particle;

[0123] In one embodiment, in the particle swarm optimization algorithm, each particle stores its own position and velocity information. Therefore, the position information of the corresponding particle can be directly accessed to obtain the position of the initial local optimal particle and the position of the initial global optimal particle.

[0124] Step 402: Obtain the original position and the original velocity of the currently traversed particle.

[0125] In one embodiment, the currently traversed particle is any one of all particles in the inferior group.

[0126] In one embodiment, the original position and original velocity of the currently traversed particle can be obtained through the position and velocity information of the currently traversed particle.

[0127] Step 403: Subtract the position of the initial local optimal particle from the original position of the currently traversed particle to obtain a first difference value; and subtract the position of the initial global optimal particle from the original position of the currently traversed particle to obtain a second difference value;

[0128] In one embodiment, the first difference is used to indicate the direction of the currently traversed particle in the local search; the second difference is used to indicate the direction of the currently traversed particle in the global search.

[0129] Step 404: Sum the original velocity of the currently traversed particle and the first difference with the second difference to obtain the current velocity of the currently traversed particle;

[0130] In one embodiment, the mathematical expression for the current velocity of the currently traversed particle is represented by the following formula:

[0131] V i =V i +m(X nbest -X i )+nr(X ensemble -X i );

[0132] Among them, X i V represents the original position of the currently traversed particle. i The original velocity of the currently traversed particle is represented by m and n, where m and n are both random real numbers between 0 and 1, r is the weight parameter for the global search, and X is the velocity of the particle. nbest X represents the initial local optimum particle in the initial topological neighborhood corresponding to the currently traversed particle. ensemble This represents the initial global optimal particle in the initial topological neighborhood corresponding to the currently traversed particle.

[0133] In one embodiment, m and n are used to increase the randomness of the particle swarm optimization algorithm.

[0134] In one embodiment, r can be a fixed value. The larger the value of r, the stronger the global search capability of the particle swarm optimization algorithm; the smaller the value of r, the stronger the local search capability of the particle swarm optimization algorithm.

[0135] In one embodiment, r can also be a dynamic value. Specifically, r can be a value that is adaptively adjusted with the number of iterations of the particle swarm optimization algorithm. For example, r can be a value that decreases as the number of iterations increases. In the early stage of iteration, a larger r can enhance the global search capability of the particle swarm optimization algorithm to reduce the situation of getting trapped in local optima. In the later stage of iteration, a smaller r can enhance the local search capability of the particle swarm optimization algorithm to achieve the search for the global optimum near the local optimum.

[0136] Step 405: Sum the current velocity of the currently traversed particle with its original position to obtain the current position of the currently traversed particle, until the iteration termination condition is met, and obtain the optimal solution for the currently traversed particle.

[0137] In one embodiment, the mathematical expression for the current position of the currently traversed particle is represented by the following formula:

[0138] X i =X i +V i ;

[0139] Among them, V i This indicates the current velocity of the currently traversed particle obtained in step 404.

[0140] In one embodiment, after summing the current velocity of the currently traversed particle with its original position to obtain the current position of the currently traversed particle, it is necessary to recalculate the fitness value of each particle to measure the quality of the updated particle.

[0141] In summary, the solution provided in this public disclosure is as follows:

[0142] First, by treating the network parameters of the first target detection network as particles in a particle swarm optimization algorithm, and using the minimum value of the loss function of the first target detection network as the optimization objective, the optimal solution for each particle in the swarm can be obtained. This reduces the risk of getting trapped in local optima during the process of obtaining the optimal solution for each particle. Since the performance of the first target detection network largely depends on its network parameters, a second target detection network is obtained by using the optimal solution of each particle as the corresponding network parameters of the first target detection network. Using the second target detection network with better network parameters for target detection can improve the accuracy of target detection.

[0143] Secondly, by classifying particles whose initial fitness value is less than a preset fitness threshold into a dominant group and particles whose initial fitness value is not less than a preset fitness threshold into a suboptimal group, the superiority and inferiority information of particles in the entire population can be distinguished. Updating particles in the dominant group is beneficial for the entire population to move towards the global optimal solution, while updating particles in the suboptimal group is beneficial for improving the diversity of the population.

[0144] The following application example further illustrates the target detection method provided in this disclosure:

[0145] like Figure 5 As shown, Figure 5 This is a flowchart illustrating the target detection method provided in the application example of this disclosure. The target detection method provided in the application example of this disclosure includes the following steps:

[0146] Step 501: Determine the network parameters of the first target detection network; the first target detection network includes at least one convolutional layer and at least one fully connected layer, and the network parameters of the first target detection network include the convolutional layer weights and convolutional layer biases of each convolutional layer, and the fully connected layer weights and fully connected layer biases of each fully connected layer;

[0147] Step 502: Initialize the particle swarm, using the network parameters as particles in the particle swarm; wherein, the particles in the particle swarm correspond one-to-one with the network parameters of the first target detection network.

[0148] Step 503: Obtain the initial fitness value of each particle, classify particles whose initial fitness value is less than a preset fitness threshold into an advantageous group, and classify particles whose initial fitness value is not less than the preset fitness threshold into an inferior group.

[0149] Step 504: Traverse each particle in the particle swarm, and use a uniform random probability method to select a first preset number of target particles from the dominant group, and use the first preset number of target particles as the initial topological neighborhood of the corresponding particle, wherein the initial topological neighborhood includes at least one particle.

[0150] Step 505: Obtain the initial local optimal particle in the initial topological neighborhood corresponding to the currently traversed particle and the initial global optimal particle in the dominant group.

[0151] Step 506: Based on the initial local optimal particle and the initial global optimal particle, obtain the position of the initial local optimal particle and the position of the initial global optimal particle;

[0152] In one embodiment, obtaining the initial local optimal particle in the initial topological neighborhood corresponding to the currently traversed particle and the initial global optimal particle in the dominant group includes:

[0153] The first sum is obtained by summing the initial fitness values ​​of all particles in the initial topological neighborhood corresponding to the currently traversed particle.

[0154] Based on the initial fitness value of each particle in the initial topological neighborhood corresponding to the currently traversed particle, the particle with the smallest fitness value in the initial topological neighborhood corresponding to the currently traversed particle is determined as the initial local optimal particle; and based on the initial fitness value and the first sum value of each particle in the initial topological neighborhood corresponding to the currently traversed particle, the initial global optimal particle in the initial topological neighborhood corresponding to the currently traversed particle is determined.

[0155] In one embodiment, determining the initial globally optimal particle in the initial topological neighborhood corresponding to the currently traversed particle, based on the initial fitness value and the first sum value of each particle in the initial topological neighborhood corresponding to the currently traversed particle, includes:

[0156] Based on the initial fitness value and first sum value of each particle in the initial topological neighborhood corresponding to the currently traversed particle, obtain the second preset number of dimensional positions of each particle in the initial topological neighborhood corresponding to the currently traversed particle.

[0157] Obtain the index of each particle in the initial topological neighborhood corresponding to the currently traversed particle;

[0158] The index of each particle in the initial topological neighborhood corresponding to the currently traversed particle is sorted using a random sorting method to obtain the sorting result of all particles in the initial topological neighborhood corresponding to the currently traversed particle.

[0159] According to the order of the particles in the sorting result of all particles in the initial topological neighborhood corresponding to the currently traversed particle, arrange the second preset number of dimensional positions of each particle in the initial topological neighborhood corresponding to the currently traversed particle to obtain the initial global optimal particle in the initial topological neighborhood corresponding to the currently traversed particle.

[0160] Step 507: Obtain the original position and the original velocity of the currently traversed particle.

[0161] Step 508: Subtract the position of the initial local optimal particle from the original position of the currently traversed particle to obtain a first difference value; and subtract the position of the initial global optimal particle from the original position of the currently traversed particle to obtain a second difference value.

[0162] Step 509: Sum the original velocity of the currently traversed particle and the first difference with the second difference to obtain the current velocity of the currently traversed particle;

[0163] Step 510: Sum the current velocity of the currently traversed particle and the original position of the currently traversed particle to obtain the current position of the currently traversed particle, until the iteration termination condition is met, and obtain the optimal solution of the currently traversed particle.

[0164] Step 511: The optimal solution of each particle is used as the network parameter corresponding to the first target detection network to obtain the second target detection network, and the second target detection network is used for target detection.

[0165] To implement the target detection method provided in this disclosure, this disclosure also provides a target detection device, such as... Figure 6 As shown. Figure 6 This is a schematic diagram of the target detection device provided in an embodiment of the present disclosure. The target detection device 600 includes:

[0166] The determining unit 601 is used to determine the network parameters of the first target detection network; the first target detection network includes at least one convolutional layer and at least one fully connected layer, and the network parameters of the first target detection network include the convolutional layer weights and convolutional layer biases of each convolutional layer, and the fully connected layer weights and fully connected layer biases of each fully connected layer;

[0167] The acquisition unit 602 is used to treat the network parameters as particles in a particle swarm, and use the particle swarm optimization algorithm to obtain the optimal solution for each particle in the particle swarm with the goal of minimizing the loss function of the first target detection network.

[0168] The target detection unit 603 is used to take the optimal solution of each particle as the network parameter corresponding to the first target detection network to obtain a second target detection network, and to perform target detection using the second target detection network.

[0169] In one embodiment, the acquisition unit 602 is specifically used for:

[0170] Initialize the particle swarm, using the network parameters as particles in the particle swarm; wherein, the particles in the particle swarm correspond one-to-one with the network parameters of the first target detection network;

[0171] Obtain the initial fitness value of each particle, classify particles whose initial fitness value is less than a preset fitness threshold into an advantageous group, and classify particles whose initial fitness value is not less than the preset fitness threshold into an inferior group.

[0172] Each particle in the particle swarm is traversed, and an initial topological neighborhood corresponding to the currently traversed particle is selected from the dominant group, wherein the initial topological neighborhood includes at least one particle.

[0173] Obtain the initial local optimal particle in the initial topological neighborhood corresponding to the currently traversed particle and the initial global optimal particle in the dominant group;

[0174] Based on the initial local optimal particle and the initial global optimal particle, the currently traversed particle is iteratively updated until the iteration termination condition is met, and the optimal solution of the currently traversed particle is obtained.

[0175] In one embodiment, the acquisition unit 602 is specifically used for:

[0176] A first preset number of target particles are selected from the advantageous group using a uniform random probability method, and these first preset number of target particles are used as the initial topological neighborhood of the corresponding particles.

[0177] In one embodiment, the acquisition unit 602 is specifically used for:

[0178] The first sum is obtained by summing the initial fitness values ​​of all particles in the initial topological neighborhood corresponding to the currently traversed particle.

[0179] Based on the initial fitness value of each particle in the initial topological neighborhood corresponding to the currently traversed particle, the particle with the smallest fitness value in the initial topological neighborhood corresponding to the currently traversed particle is determined as the initial local optimal particle; and based on the initial fitness value and the first sum value of each particle in the initial topological neighborhood corresponding to the currently traversed particle, the initial global optimal particle in the initial topological neighborhood corresponding to the currently traversed particle is determined.

[0180] In one embodiment, the acquisition unit 602 is specifically used for:

[0181] Based on the initial fitness value and first sum value of each particle in the initial topological neighborhood corresponding to the currently traversed particle, obtain the second preset number of dimensional positions of each particle in the initial topological neighborhood corresponding to the currently traversed particle.

[0182] Obtain the index of each particle in the initial topological neighborhood corresponding to the currently traversed particle;

[0183] The index of each particle in the initial topological neighborhood corresponding to the currently traversed particle is sorted using a random sorting method to obtain the sorting result of all particles in the initial topological neighborhood corresponding to the currently traversed particle.

[0184] According to the order of the particles in the sorting result of all particles in the initial topological neighborhood corresponding to the currently traversed particle, arrange the second preset number of dimensional positions of each particle in the initial topological neighborhood corresponding to the currently traversed particle to obtain the initial global optimal particle in the initial topological neighborhood corresponding to the currently traversed particle.

[0185] In one embodiment, the acquisition unit 602 is specifically used for:

[0186] Based on the initial local optimal particle and the initial global optimal particle, obtain the position of the initial local optimal particle and the position of the initial global optimal particle;

[0187] Obtain the original position and the original velocity of the currently traversed particle;

[0188] The first difference is obtained by subtracting the position of the initial local optimal particle from the original position of the currently traversed particle; and the second difference is obtained by subtracting the position of the initial global optimal particle from the original position of the currently traversed particle.

[0189] The current velocity of the currently traversed particle is obtained by summing the original velocity of the particle and the first difference with the second difference.

[0190] The current velocity of the currently traversed particle is summed with its original position to obtain its current position. This process continues until the iteration termination condition is met, thus obtaining the optimal solution for the currently traversed particle.

[0191] It should be noted that the target detection device provided in the above embodiments is only illustrated by the division of the above program modules when performing target detection. In practical applications, the above processing can be assigned to different program modules as needed, that is, the internal structure of the target detection device can be divided into different program modules to complete all or part of the processing described above. In addition, the target detection device provided in the above embodiments and the target detection method embodiments provided in this disclosure belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.

[0192] Figure 7 This is a schematic diagram of the hardware composition structure of the electronic device provided in the embodiments of this disclosure, such as... Figure 7 As shown, the electronic device 700 includes at least one processor 702; and a memory 701 communicatively connected to the at least one processor 702; wherein the memory 701 stores instructions executable by the at least one processor 702, the instructions being executed by the at least one processor 702 to implement the steps of the target detection method of the present disclosure embodiments.

[0193] Optionally, the electronic device may specifically be the target detection device in the embodiments of this application, and the electronic device may implement the corresponding processes implemented by the target detection device in the various methods of the embodiments of this application. For the sake of brevity, it will not be described in detail here.

[0194] It is understood that the electronic device also includes a communication interface 703. Various components in the electronic device are coupled together via a bus system 704. It is understood that the bus system 704 is used to implement communication between these components. In addition to a data bus, the bus system 704 also includes a power bus, a control bus, and a status signal bus. However, for clarity, in... Figure 7 The general designated all buses as Bus System 704.

[0195] It is understood that memory 701 can be volatile memory or non-volatile memory, or both. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), ferromagnetic random access memory (FRAM), flash memory, magnetic surface memory, optical disc, or compact disc read-only memory (CD-ROM); magnetic surface memory can be disk storage or magnetic tape storage. Volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), SyncLink Dynamic Random Access Memory (SLDRAM), and Direct Rambus Random Access Memory (DRRAM).The memory 701 described in the embodiments of the present invention is intended to include, but is not limited to, these and any other suitable types of memory.

[0196] The methods disclosed in the above embodiments can be applied to or implemented by processor 702. Processor 702 may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above methods can be completed by integrated logic circuits in the hardware of processor 702 or by instructions in software form. Processor 702 may be a general-purpose processor, DSP, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Processor 702 can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. A general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the methods disclosed in the embodiments of this invention can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software modules may be located in a storage medium, specifically memory 701. Processor 702 reads information from memory 701 and, in conjunction with its hardware, completes the steps of the aforementioned methods.

[0197] In an exemplary embodiment, the electronic device may be implemented by one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), FPGAs, general-purpose processors, controllers, MCUs, microprocessors, or other electronic components to perform the aforementioned method.

[0198] This public security embodiment also provides a non-transitory computer-readable storage medium storing computer instructions, which are used to cause a computer to execute the steps of the target detection method of this embodiment.

[0199] Optionally, the computer-readable storage medium can be applied to the target detection device in the embodiments of this application, and the computer instructions cause the computer to execute the corresponding processes implemented by the target detection device in the various methods of the embodiments of this application. For the sake of brevity, they will not be described in detail here.

[0200] This disclosure also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the target detection method provided in this embodiment of the invention.

[0201] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed can be through some interfaces, and the indirect coupling or communication connection between devices or units can be electrical, mechanical, or other forms.

[0202] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the units may be selected to achieve the purpose of this embodiment according to actual needs.

[0203] In addition, in the various embodiments of the present invention, each functional unit can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the integrated unit can be implemented in hardware or in the form of hardware plus software functional units.

[0204] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media that can store program code, such as mobile storage devices, ROM, RAM, magnetic disks, or optical disks.

[0205] Alternatively, if the integrated units of this invention are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this invention, or the parts that contribute to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROM, RAM, magnetic disks, or optical disks.

[0206] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A target detection method, characterized in that, include: Determine the network parameters of the first target detection network; The first target detection network includes at least one convolutional layer and at least one fully connected layer. The network parameters of the first target detection network include the convolutional layer weights and biases of each convolutional layer, and the fully connected layer weights and biases of each fully connected layer. The first target detection network is used to perform target detection on the image to be detected. The network parameters are treated as particles in a particle swarm. Using the particle swarm optimization algorithm, with the goal of minimizing the loss function of the first target detection network, the optimal solution for each particle in the particle swarm is obtained. The optimal solution of each particle is used as the network parameter corresponding to the first target detection network to obtain the second target detection network, and the second target detection network is used to perform target detection on the image to be detected. The step of treating the network parameters as particles in a particle swarm and using a particle swarm optimization algorithm to obtain the optimal solution for each particle in the particle swarm with the goal of minimizing the loss function of the first target detection network includes: Initialize the particle swarm, using the network parameters as particles in the particle swarm; wherein, the particles in the particle swarm correspond one-to-one with the network parameters of the first target detection network; Obtain the initial fitness value of each particle, classify particles whose initial fitness value is less than a preset fitness threshold into an advantageous group, and classify particles whose initial fitness value is not less than the preset fitness threshold into an inferior group. Each particle in the particle swarm is traversed, and an initial topological neighborhood corresponding to the currently traversed particle is selected from the dominant group, wherein the initial topological neighborhood includes at least one particle. Obtain the initial local optimal particle in the initial topological neighborhood corresponding to the currently traversed particle and the initial global optimal particle in the dominant group; Based on the initial local optimal particle and the initial global optimal particle, the currently traversed particle is iteratively updated until the iteration termination condition is met, and the optimal solution of the currently traversed particle is obtained.

2. The method according to claim 1, characterized in that, The step of selecting the initial topological neighborhood corresponding to the currently traversed particle from the dominant group includes: A first preset number of target particles are selected from the advantageous group using a uniform random probability method, and these first preset number of target particles are used as the initial topological neighborhood of the corresponding particles.

3. The method according to claim 1, characterized in that, The step of obtaining the initial local optimal particle in the initial topological neighborhood corresponding to the currently traversed particle and the initial global optimal particle in the dominant group includes: The first sum is obtained by summing the initial fitness values ​​of all particles in the initial topological neighborhood corresponding to the currently traversed particle. Based on the initial fitness value of each particle in the initial topological neighborhood corresponding to the currently traversed particle, the particle with the smallest fitness value in the initial topological neighborhood corresponding to the currently traversed particle is determined as the initial local optimal particle; and based on the initial fitness value and the first sum value of each particle in the initial topological neighborhood corresponding to the currently traversed particle, the initial global optimal particle in the initial topological neighborhood corresponding to the currently traversed particle is determined.

4. The method according to claim 3, characterized in that, The process of determining the initial globally optimal particle in the initial topological neighborhood corresponding to the currently traversed particle, based on the initial fitness value and the first sum value of each particle in the initial topological neighborhood corresponding to the currently traversed particle, includes: Based on the initial fitness value and first sum value of each particle in the initial topological neighborhood corresponding to the currently traversed particle, obtain the second preset number of dimensional positions of each particle in the initial topological neighborhood corresponding to the currently traversed particle. Obtain the index of each particle in the initial topological neighborhood corresponding to the currently traversed particle; The index of each particle in the initial topological neighborhood corresponding to the currently traversed particle is sorted using a random sorting method to obtain the sorting result of all particles in the initial topological neighborhood corresponding to the currently traversed particle. According to the order of the particles in the sorting result of all particles in the initial topological neighborhood corresponding to the currently traversed particle, arrange the second preset number of dimensional positions of each particle in the initial topological neighborhood corresponding to the currently traversed particle to obtain the initial global optimal particle in the initial topological neighborhood corresponding to the currently traversed particle.

5. The method according to claim 1, characterized in that, The process of iteratively updating the currently traversed particles based on the initial local optimal particles and the initial global optimal particles until the iteration termination condition is met, to obtain the optimal solution for the currently traversed particles, includes: Based on the initial local optimal particle and the initial global optimal particle, obtain the position of the initial local optimal particle and the position of the initial global optimal particle; Obtain the original position and the original velocity of the currently traversed particle; The first difference is obtained by subtracting the position of the initial local optimal particle from the original position of the currently traversed particle; and the second difference is obtained by subtracting the position of the initial global optimal particle from the original position of the currently traversed particle. The current velocity of the currently traversed particle is obtained by summing the original velocity of the particle and the first difference with the second difference. The current velocity of the currently traversed particle is summed with its original position to obtain its current position. This process continues until the iteration termination condition is met, thus obtaining the optimal solution for the currently traversed particle.

6. A target detection device, characterized in that, include: A determining unit is used to determine the network parameters of the first target detection network; The first target detection network includes at least one convolutional layer and at least one fully connected layer. The network parameters of the first target detection network include the convolutional layer weights and biases of each convolutional layer, and the fully connected layer weights and biases of each fully connected layer. The first target detection network is used to perform target detection on the image to be detected. The acquisition unit is used to treat the network parameters as particles in a particle swarm, and use the particle swarm optimization algorithm to obtain the optimal solution for each particle in the particle swarm with the goal of minimizing the loss function of the first target detection network. The target detection unit is used to take the optimal solution of each particle as the network parameters corresponding to the first target detection network to obtain a second target detection network, and use the second target detection network to perform target detection on the image to be detected; The acquisition unit is specifically used to initialize the particle swarm and use the network parameters as particles in the particle swarm; wherein, the particles in the particle swarm correspond one-to-one with the network parameters of the first target detection network. Obtain the initial fitness value of each particle, classify particles whose initial fitness value is less than a preset fitness threshold into an advantageous group, and classify particles whose initial fitness value is not less than the preset fitness threshold into an inferior group. Each particle in the particle swarm is traversed, and an initial topological neighborhood corresponding to the currently traversed particle is selected from the dominant group, wherein the initial topological neighborhood includes at least one particle. Obtain the initial local optimal particle in the initial topological neighborhood corresponding to the currently traversed particle and the initial global optimal particle in the dominant group; Based on the initial local optimal particle and the initial global optimal particle, the currently traversed particle is iteratively updated until the iteration termination condition is met, and the optimal solution of the currently traversed particle is obtained.

7. An electronic device, characterized in that, include: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1 to 5.

8. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, The computer instructions are used to cause the computer to perform the method according to any one of claims 1 to 5.

9. A computer program product, characterized in that, It includes a computer program that, when executed by a processor, implements the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Data monitoring method and system used for boiling sugar crystallization process

    CN104991984A

  • Chemical fault detection method based on particle swarm optimization and a noise reduction sparse coding machine

    CN109800875A