Target detection method and device, electronic equipment, storage medium and product
By using the network parameters of the target detection network as particles in the particle swarm, and using the particle swarm optimization algorithm to update the network parameters, the problem that the gradient descent algorithm is prone to fall into local optimal solutions, and the accuracy of target detection is improved.
Patent Information
- Application Number
- CN202410987867.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-23
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2044-07-23
AI Technical Summary
The gradient descent parameter optimization algorithm commonly used in existing target detection networks is prone to fall into local optimal solutions, resulting in low accuracy of target detection.
The network parameters of the target detection network are used as particles in the particle swarm, and the particle swarm optimization algorithm uses the optimization target to obtain the optimal solution of the particles, and then update the network parameters to improve the detection accuracy.
The particle swarm optimization algorithm reduces the risk of falling into local optimal solutions and improves the accuracy of target detection.
Smart Images

Figure CN118941918A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of target detection, and in particular to a target detection method, device, electronic device, storage medium and product. Background Art
[0002] In related target detection schemes, most target detection networks use gradient descent-type parameter optimization algorithms to determine the optimal solution for the network parameters of the target detection network. However, this method has the problem of easily falling into the local optimal solution, resulting in low target detection accuracy. Summary of the invention
[0003] The present disclosure provides a target detection method, device, electronic device, storage medium and product to solve the problems in the related art.
[0004] A first aspect of the present disclosure provides a target detection method, the method comprising:
[0005] Determine 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 convolutional layer weights and convolutional layer biases of each of the convolutional layers, and fully connected layer weights and fully connected layer biases of each of the fully connected layers;
[0006] The network parameters are used as particles in a particle swarm, and a particle swarm optimization algorithm is used to obtain the optimal solution of each particle in the particle swarm by taking the minimum value of the loss function of the first target detection network as the optimization goal;
[0007] The optimal solution of each particle is used as the network parameter corresponding to the first target detection network to obtain a second target detection network, and the second target detection network is used to perform target detection.
[0008] In one embodiment, the network parameters are used as particles in a particle swarm, and a particle swarm optimization algorithm is used to minimize the value of the loss function of the first target detection network as the optimization goal to obtain the optimal solution of each particle in the particle swarm, including:
[0009] Initializing a particle swarm and using the network parameters as particles in the particle swarm; wherein the particles in the particle swarm correspond one-to-one to the network parameters of the first target detection network;
[0010] Obtaining an initial fitness value of each particle, dividing the particles whose initial fitness value is less than a preset fitness threshold into a dominant group, and dividing the particles whose initial fitness value is not less than the preset fitness threshold into a disadvantaged group;
[0011] Traversing each particle in the particle group, and selecting an initial topological neighborhood corresponding to the currently traversed particle from the dominant group, wherein the initial topological neighborhood includes at least one particle;
[0012] Obtaining an initial local optimal particle in an initial topological neighborhood corresponding to the currently traversed particle and an 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 particles are iteratively updated until an iteration termination condition is met, thereby obtaining an optimal solution for the currently traversed particles.
[0014] In one embodiment, selecting an initial topological neighborhood corresponding to a currently traversed particle from the dominant group includes:
[0015] A first preset number of target particles are screened out from the dominant group using a uniform random probability method, and the first preset number of target particles are used as initial topological neighborhoods of corresponding particles.
[0016] In one embodiment, obtaining an initial local optimal particle in an initial topological neighborhood corresponding to a currently traversed particle and an initial global optimal particle in the dominant group includes:
[0017] Sum the initial fitness values of all particles in the initial topological neighborhood corresponding to the currently traversed particle to obtain a first sum value;
[0018] Based on the initial fitness value of each particle in the initial topological neighborhood corresponding to the currently traversed particle, determine the particle with the smallest fitness value in the initial topological neighborhood corresponding to the currently traversed particle 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, determine the initial global optimal particle in the initial topological neighborhood corresponding to the currently traversed particle.
[0019] In one embodiment, determining an initial global 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 the first sum value of each particle in the initial topological neighborhood corresponding to the currently traversed particle, obtaining a second preset number of dimensional positions of each particle in the initial topological neighborhood corresponding to the currently traversed particle;
[0021] Obtaining the sequence number of each particle in the initial topological neighborhood corresponding to the currently traversed particle;
[0022] Using a random sorting method, the sequence number of each particle in the initial topological neighborhood corresponding to the currently traversed particle is sorted to obtain a sorting result of all particles in the initial topological neighborhood corresponding to the currently traversed particle;
[0023] According to the order of particles in the sorting result of all particles in the initial topological neighborhood corresponding to the currently traversed particle, the second preset number of dimensional positions of each particle in the initial topological neighborhood corresponding to the currently traversed particle are arranged 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, iteratively updating the currently traversed particle until an iteration termination condition is met, and obtaining the optimal solution of the currently traversed particle includes:
[0025] Based on the initial local optimal particle and the initial global optimal particle, obtaining the position of the initial local optimal particle and the position of the initial global optimal particle;
[0026] Obtaining the original position of the currently traversed particle and the original velocity of the currently traversed particle;
[0027] Subtracting the position of the initial local optimal particle from the original position of the currently traversed particle to obtain a first difference; and subtracting the position of the initial global optimal particle from the original position of the currently traversed particle to obtain a second difference;
[0028] Adding the sum of the original speed of the currently traversed particle and the first difference value to the second difference value to obtain the current speed of the currently traversed particle;
[0029] The current speed of the currently traversed particle and the original position of the currently traversed particle are summed to obtain the current position of the currently traversed particle, until the iteration termination condition is met, and the optimal solution of the currently traversed particle is obtained.
[0030] A second aspect of the present disclosure provides a target detection device, the device comprising:
[0031] A determination unit, configured to determine 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 convolutional layer weights and convolutional layer biases of each of the convolutional layers, and fully connected layer weights and fully connected layer biases of each of the fully connected layers;
[0032] An acquisition unit, configured to use the network parameters as particles in a particle swarm, and use a particle swarm optimization algorithm to obtain an optimal solution for each particle in the particle swarm with the minimum value of the loss function of the first target detection network as the optimization goal;
[0033] The target detection unit is used to use 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 use the second target detection network to perform target detection.
[0034] A third aspect of the present disclosure provides an electronic device, including:
[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, and the instructions are executed by the at least one processor so that the at least one processor can execute the method described in the embodiment of the first aspect of the present disclosure.
[0036] The fourth aspect embodiment of the present disclosure proposes a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to execute the method described in the first aspect embodiment of the present disclosure.
[0037] The fifth aspect embodiment of the present disclosure provides a computer program product, including a computer program, which implements the method described in the first aspect embodiment of the present disclosure when executed by a processor.
[0038] In summary, the present disclosure proposes a target detection method, which includes: determining 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 convolutional layer weights and convolutional layer biases of each of the convolutional layers, and fully connected layer weights and fully connected layer biases of each of the fully connected layers; using the network parameters as particles in a particle swarm, using a particle swarm optimization algorithm, and taking the minimum value of the loss function of the first target detection network as the optimization goal, to obtain the optimal solution of each particle in the particle swarm; using the optimal solution of each of the particles as the network parameters corresponding to the first target detection network, obtaining a second target detection network, and using the second target detection network to perform target detection.
[0039] According to the solution provided by the present disclosure, by using the network parameters of the first target detection network as particles in a particle swarm, using a particle swarm optimization algorithm, taking the minimum value of the loss function of the first target detection network as the optimization goal, and obtaining the optimal solution of each particle in the particle swarm, the risk of falling into a local optimal solution in the process of obtaining the optimal solution of the particle can be reduced. Since the performance of the first target detection network depends to a large extent on the network parameters, by using the optimal solution of each particle as the network parameter corresponding to the first target detection network, a second target detection network is obtained, and target detection is performed using the second target detection network with better network parameters, which can improve the accuracy of target detection.
[0040] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.
[0042] Figure 1 A schematic diagram of a target detection method according to an embodiment of the present disclosure;
[0043] Figure 2 A flowchart of a method for obtaining an optimal solution for currently traversed particles provided in an embodiment of the present disclosure;
[0044] Figure 3 A schematic diagram of a process for generating an initial global optimal particle according to an embodiment of the present disclosure;
[0045] Figure 4 A flowchart of a method for obtaining an optimal solution for currently traversed particles provided in an embodiment of the present disclosure;
[0046] Figure 5 A flowchart of a target detection method provided for an application example of the present disclosure;
[0047] Figure 6 A schematic diagram of the structure of a target detection device provided in an embodiment of the present disclosure;
[0048] Figure 7 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0049] Embodiments of the present disclosure are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present disclosure, and should not be construed as limiting the present disclosure.
[0050] In related target detection schemes, most target detection networks use gradient descent-type parameter optimization algorithms to determine the optimal solution for the network parameters of the target detection network. However, this method has the problem of easily falling into the local optimal solution, resulting in low target detection accuracy.
[0051] The following is a brief introduction to a target detection method in related technologies:
[0052] The scheme proposes to use FCN to classify each pixel in the image to achieve pixel-level vehicle segmentation, thereby accurately marking the location and outline of the vehicle. In the field of vehicle recognition, the application process of the Fully Convolutional Network (FCN) is as follows: First, a labeled vehicle image dataset needs to be prepared, in which each pixel is labeled as a vehicle category (foreground) or a background category (background). These datasets can be manually annotated or use a semantic segmentation dataset. Next, the prepared vehicle image dataset is input into the FCN model and the model is trained. FCN gradually extracts the features of the image through multiple convolutional layers and pooling layers, and outputs a feature map of the same size as the input image through the fully convolutional layer. During the training process, functions such as cross entropy loss are used to measure the difference between the predicted results and the true labels, and the model parameters are updated through the back propagation algorithm to improve the performance of the model in the vehicle recognition task. After training, FCN can be used to perform semantic segmentation on new vehicle images, that is, to classify each pixel in the image as a vehicle or background. The segmented image can accurately mark the location and outline of the vehicle, realizing vehicle positioning and recognition.
[0053] The above solution has the following defects:
[0054] The gradient descent algorithm is prone to fall into the local optimal solution, which leads to low accuracy of target detection based on the gradient descent algorithm.
[0055] In order to solve the defects in the related art, the present disclosure uses the network parameters of the first target detection network as particles in a particle swarm, uses a particle swarm optimization algorithm, takes the minimum value of the loss function of the first target detection network as the optimization target, and obtains the optimal solution of each particle in the particle swarm, which can reduce the risk of falling into a local optimal solution in the process of obtaining the optimal solution of the particle. Since the performance of the first target detection network depends to a large extent on the network parameters, the second target detection network is obtained by using the optimal solution of each particle as the network parameter corresponding to the first target detection network, and the target detection is performed using the second target detection network with better network parameters, which can improve the accuracy of target detection.
[0056] The present disclosure is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0057] like Figure 1 As shown, Figure 1 The target detection method provided by the embodiment of the present disclosure comprises the following steps:
[0058] Step 101, determining network parameters of a 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, and the network parameters of the first target detection network include convolutional layer weights and convolutional layer biases of each of the convolutional layers, and fully connected layer weights and fully connected layer biases of each of the fully connected layers.
[0060] In one embodiment, the number of network parameters of the first object detection network is determined by the structure, number of layers, etc. of the first object detection network.
[0061] In one embodiment, the network parameters of the first object detection network may be determined by initialization parameters.
[0062] In one embodiment, the network parameters of the first object detection network may also be determined by optimizing the initialization parameters using an optimization algorithm.
[0063] Step 102, using the network parameters as particles in a particle swarm, using a particle swarm optimization algorithm, taking the minimum value of the loss function of the first target detection network as the optimization goal, and obtaining the optimal solution for each particle in the particle swarm;
[0064] In one embodiment, each particle in the particle swarm corresponds to a configuration of a network parameter.
[0065] In one embodiment, the number of the 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 target detection network may be a cross entropy loss function, a mean square error loss function, or a mean absolute error loss function.
[0067] In one embodiment, each particle in the particle group may have one or more optimal solutions, which is not limited in the present disclosure.
[0068] In one embodiment, by using the network parameters as particles in a particle swarm and utilizing a particle swarm optimization algorithm, the optimal solution of each particle in the particle swarm is obtained with the minimum value of the loss function of the first target detection network as the optimization goal, the local optimal particle in the particle swarm is obtained, and then the global optimal particle in the particle swarm is obtained.
[0069] Step 103: Using 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 using the second target detection network to perform target detection.
[0070] In one embodiment, the second object detection network refers to a 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 be obtained by one or more.
[0072] In one embodiment, the second target detection network is obtained by using the optimal solution of each particle as the network parameter corresponding to the first target detection network, and the target detection is performed using the second target detection network. By adopting more optimal network parameters, the accuracy of target detection can be improved.
[0073] In one embodiment, after performing target detection using the second target detection network, the target detection result may be post-processed to further improve recognition accuracy, and the post-processing method may be connected region analysis, boundary detection, filtering, and the like.
[0074] In one embodiment, if Figure 2 As shown, the network parameters are used as particles in a particle swarm, and a particle swarm optimization algorithm is used to minimize the value of the loss function of the first target detection network as the optimization goal to obtain the optimal solution of each particle in the particle swarm, including:
[0075] Step 201, initializing a particle swarm, and using the network parameters as particles in the particle swarm; wherein the particles in the particle swarm correspond one-to-one to the network parameters of the first target detection network;
[0076] In one embodiment, the particle swarm may be initialized by an initialization function, wherein the number of particles in the particle swarm may be preset, and the dimension of the particles in the particle swarm is the same as the number of the network parameters.
[0077] In one embodiment, the value of each dimension of the particles in the particle swarm corresponds one-to-one to the network parameters of the first object detection network.
[0078] Step 202, obtaining the initial fitness value of each particle, dividing the particles whose initial fitness value is less than a preset fitness threshold into a dominant group, and dividing the particles whose initial fitness value is not less than the preset fitness threshold into a disadvantaged group;
[0079] In one embodiment, the initial fitness value of each particle may be obtained through 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, the smaller the fitness value of a particle, the better the quality of the particle, and the larger the fitness value of a particle, the worse the quality of the particle; in a maximization problem, the smaller the fitness value of a particle, the worse the quality of the particle, and the larger the fitness value of a particle, the better the quality of the particle.
[0081] In one embodiment, the preset fitness threshold refers to a critical value that can just distinguish the quality of particles.
[0082] In one embodiment, during the particle evolution process, the fitness value of each particle changes, and the preset fitness threshold may be adjusted to re-divide the particles.
[0083] In one embodiment, by dividing the particles whose initial fitness values are less than the preset fitness threshold into a dominant group, and dividing the particles whose initial fitness values are not less than the preset fitness threshold into a disadvantaged group, the superiority and inferiority information of the particles in the entire population can be distinguished, and the particles in the dominant group are updated, which is conducive to the entire population moving toward the global optimal solution, and the particles in the disadvantaged group are updated, which is conducive to improving the diversity of the population.
[0084] Step 203, traversing each particle in the particle group, and selecting an initial topological neighborhood corresponding to the currently traversed particle from the dominant group, wherein the initial topological neighborhood includes at least one particle;
[0085] In one embodiment, a particle is determined from the disadvantaged group as the currently traversed particle, each of the particles in the particle group is traversed, and the distance between the currently traversed particle and each of the particles in the particle group is obtained. All particles in the advantaged group within a preset distance range can be selected as the initial topological neighborhood corresponding to the currently traversed particle.
[0086] In one embodiment, a preset number of particles may also be determined from the dominant group as the initial topological neighborhood corresponding to the currently traversed particle.
[0087] Step 204, 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;
[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 particles until the iteration termination condition is met, and the optimal solution of the currently traversed particles is obtained.
[0091] In one embodiment, the iteration termination condition may be that the number of iterations reaches a preset maximum number of iterations of the particle swarm optimization algorithm.
[0092] In one embodiment, the iteration termination condition may also be to find an optimal solution that meets the requirements.
[0093] In one embodiment, based on the initial local optimal particle and the initial global optimal particle, the currently traversed particle is iteratively updated according to an update rule of a particle swarm optimization algorithm, wherein the update rule includes a position update rule and a speed update rule.
[0094] In one embodiment, selecting an initial topological neighborhood corresponding to a currently traversed particle from the dominant group includes:
[0095] A first preset number of target particles are screened out from the dominant group using a uniform random probability method, and the first preset number of target particles are used as initial topological neighborhoods of corresponding particles.
[0096] In one embodiment, a first preset number of target particles are screened out from the dominant group using a uniform random probability method, and 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 the convergence speed in the optimization process needs to be accelerated, a smaller first preset number of target particles should be selected. If the search diversity of the population needs to be improved, a larger first preset number of target particles should be selected.
[0098] In one embodiment, obtaining an initial local optimal particle in an initial topological neighborhood corresponding to a currently traversed particle and an initial global optimal particle in the dominant group includes:
[0099] Sum the initial fitness values of all particles in the initial topological neighborhood corresponding to the currently traversed particle to obtain a first sum value;
[0100] In one embodiment, the initial fitness value of each particle may be obtained through the loss function value of each particle.
[0101] In one embodiment, the reciprocals of the initial fitness values of all particles in the initial topological neighborhood corresponding to the currently traversed particle are summed to obtain a first sum value.
[0102] Based on the initial fitness value of each particle in the initial topological neighborhood corresponding to the currently traversed particle, determine the particle with the smallest fitness value in the initial topological neighborhood corresponding to the currently traversed particle 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, determine the initial global optimal particle in the initial topological neighborhood corresponding to the currently traversed particle.
[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, and the initial global optimal particle usually refers to the particle with the smallest fitness value of all current initial local optimal particles. However, in order to improve the search diversity of the population, avoid the population from being trapped in a local area and be able to jump out when unfortunately trapped in a local area, the initial global optimal particle in this solution is determined by ensemble learning of each particle in the initial topological neighborhood corresponding to the currently traversed particle.
[0104] In one embodiment, if 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, determining the initial global optimal particle in the initial topological neighborhood corresponding to the currently traversed particle includes:
[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 a 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 particles in the particle swarm, that is, the second preset number is not greater than the network parameter 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 expressed as follows:
[0108]
[0109] Among them, Num ni represents the number of dimensional positions that need to be learned in the i-th particle in the initial topological neighborhood corresponding to the currently traversed particle, f(X ni ) represents the fitness value of the ith particle in the initial topological neighborhood corresponding to the currently traversed particle, and round() means rounding the value in the brackets 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 ) is smaller, Num ni The larger the value is, the more the currently traversed particle will learn from the particles with better quality in the initial topological neighborhood corresponding to the currently traversed particle in more dimensions.
[0111] Step 302, obtaining the serial number of each particle in the initial topological neighborhood corresponding to the currently traversed particle;
[0112] In one embodiment, the serial number of each particle in the initial topological neighborhood corresponding to the currently traversed particle is unique, and a unique serial number is usually assigned to each particle during particle swarm initialization.
[0113] In one embodiment, the sequence number of each particle in the initial topological neighborhood corresponding to the currently traversed particle is obtained by obtaining information of each particle in the initial topological neighborhood corresponding to the currently traversed particle.
[0114] Step 303, using a random sorting method to sort the sequence number of each particle in the initial topological neighborhood corresponding to the currently traversed particle, to obtain a sorting result of all particles in the initial topological neighborhood corresponding to the currently traversed particle;
[0115] In one embodiment, the sequence number of each particle in the initial topological neighborhood corresponding to the currently traversed particle is sorted using a random sorting method, and the sorting result of all particles in the initial topological neighborhood corresponding to the currently traversed particle can be ordered or disordered.
[0116] Step 304, according to the order of 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.
[0117] In one embodiment, the mathematical expression of the initial global optimal particle in the initial topological neighborhood corresponding to the currently traversed particle is expressed as follows:
[0118]
[0119] Among them, X ensemble represents the initial global optimal particle in the initial topological neighborhood corresponding to the currently traversed particle, seq[i] represents the i-th element in the sorting result of all particles in the initial topological neighborhood corresponding to the currently traversed particle, and there are a total of NS particles in the initial topological neighborhood corresponding to the currently traversed particle.
[0120] In one embodiment, since Num ni is rounded to the nearest integer, X ensemble The total dimension in may be greater or less than the dimension of the particles in the particle group, so X can be adjusted by increasing the minimum second preset number of dimensions or reducing the maximum second preset number of dimensions. ensemble Dimension.
[0121] In one embodiment, if Figure 4 As shown, based on the initial local optimal particle and the initial global optimal particle, the currently traversed particles are iteratively updated until the iteration termination condition is met, and the optimal solution of the currently traversed particles is obtained, including:
[0122] Step 401, based on the initial local optimal particle and the initial global optimal particle, obtaining 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 information and velocity information, so 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, obtaining the original position of the currently traversed particle and the original speed of the currently traversed particle;
[0125] In one embodiment, the currently traversed particle is any particle of all particles in the disadvantaged group.
[0126] In one embodiment, the original position of the currently traversed particle and the original speed of the currently traversed particle may be acquired through the position information and speed information of the currently traversed particle.
[0127] Step 403, subtracting the position of the initial local optimal particle from the original position of the currently traversed particle to obtain a first difference; and subtracting the position of the initial global optimal particle from the original position of the currently traversed particle to obtain a second difference;
[0128] In one embodiment, the first difference value is used to indicate the advancing direction of the currently traversed particle in the local search; and the second difference value is used to indicate the advancing direction of the currently traversed particle in the global search.
[0129] Step 404, summing the original speed of the currently traversed particle and the first difference value with the second difference value to obtain the current speed of the currently traversed particle;
[0130] In one embodiment, the mathematical expression of the current speed of the currently traversed particle is expressed as follows:
[0131] V i =V i +m(X nbest -X i )+nr(X ensemble -X i );
[0132] Among them, X i Represents the original position of the currently traversed particle, V i represents the original speed of the currently traversed particle, m and n are both random real numbers between 0 and 1, r is the weight parameter of the global search, X nbest represents the initial local optimal particle in the initial topological neighborhood corresponding to the currently traversed particle, X ensemble 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 may be a fixed value. The larger the value of r is, the stronger the global search capability of the particle swarm optimization algorithm is. The smaller the value of r is, the stronger the local search capability of the particle swarm optimization algorithm is.
[0135] In one embodiment, r may also be a dynamic value. Specifically, r may be a value that is adaptively adjusted with the number of iterations of the particle swarm optimization algorithm. For example, r may be a value that decreases with the increase in the number of iterations. In the early stage of the iteration, a larger r may enhance the global search capability of the particle swarm optimization algorithm to reduce the situation of falling into the local optimum. In the later stage of the iteration, a smaller r may enhance the local search capability of the particle swarm optimization algorithm to realize the search for the global optimal solution near the local optimal solution.
[0136] Step 405, summing the current speed 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 obtaining the optimal solution of the currently traversed particle.
[0137] In one embodiment, the mathematical expression of the current position of the currently traversed particle is expressed as follows:
[0138] X i =X i +V i ;
[0139] Among them, V i Indicates the current speed of the currently traversed particle obtained in step 404.
[0140] In one embodiment, after the current position of the currently traversed particle is obtained by summing the current speed of the currently traversed particle and the original position of the currently traversed particle, the fitness value of each particle needs to be recalculated to measure the quality of the updated particle.
[0141] In summary, the solution provided by the present disclosure is:
[0142] First, by using the network parameters of the first target detection network as particles in a particle swarm, using a particle swarm optimization algorithm, and taking the minimum value of the loss function of the first target detection network as the optimization goal, the optimal solution of each particle in the particle swarm is obtained, which can reduce the risk of falling into a local optimal solution in the process of obtaining the optimal solution of the particle. Since the performance of the first target detection network depends to a large extent on the network parameters, the second target detection network is obtained by using the optimal solution of each particle as the network parameter corresponding to the first target detection network, and the target detection is performed using the second target detection network with better network parameters, which can improve the accuracy of target detection.
[0143] Secondly, by dividing the particles whose initial fitness values are less than the preset fitness threshold into a dominant group, and dividing the particles whose initial fitness values are not less than the preset fitness threshold into a disadvantaged group, the superiority and inferiority information of the particles in the entire population can be distinguished, and the particles in the dominant group are updated, which is conducive to the movement of the entire population toward the global optimal solution, and the particles in the disadvantaged group are updated, which is conducive to improving the diversity of the population.
[0144] The target detection method provided by the present disclosure is further described below with an application example:
[0145] like Figure 5 As shown, Figure 5 A flowchart of a target detection method provided for an application example of the present disclosure. The target detection method provided for an application example of the present disclosure comprises the following steps:
[0146] Step 501, determining 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 convolutional layer weights and convolutional layer biases of each of the convolutional layers, and fully connected layer weights and fully connected layer biases of each of the fully connected layers;
[0147] Step 502, initializing a particle swarm, and using the network parameters as particles in the particle swarm; wherein the particles in the particle swarm correspond one-to-one to the network parameters of the first target detection network;
[0148] Step 503, obtaining the initial fitness value of each particle, dividing the particles whose initial fitness value is less than the preset fitness threshold into a dominant group, and dividing the particles whose initial fitness value is not less than the preset fitness threshold into a disadvantaged group;
[0149] Step 504, traversing each particle in the particle group, screening out a first preset number of target particles from the dominant group using a uniform random probability method, and using 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, 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;
[0151] Step 506, based on the initial local optimal particle and the initial global optimal particle, obtaining the position of the initial local optimal particle and the position of the initial global optimal particle;
[0152] In one embodiment, obtaining an initial local optimal particle in an initial topological neighborhood corresponding to a currently traversed particle and an initial global optimal particle in the dominant group includes:
[0153] Sum the initial fitness values of all particles in the initial topological neighborhood corresponding to the currently traversed particle to obtain a first sum value;
[0154] Based on the initial fitness value of each particle in the initial topological neighborhood corresponding to the currently traversed particle, determine the particle with the smallest fitness value in the initial topological neighborhood corresponding to the currently traversed particle 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, determine the initial global optimal particle in the initial topological neighborhood corresponding to the currently traversed particle.
[0155] In one embodiment, determining an initial global 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 the first sum value of each particle in the initial topological neighborhood corresponding to the currently traversed particle, obtaining a second preset number of dimensional positions of each particle in the initial topological neighborhood corresponding to the currently traversed particle;
[0157] Obtaining the sequence number of each particle in the initial topological neighborhood corresponding to the currently traversed particle;
[0158] Using a random sorting method, the sequence number of each particle in the initial topological neighborhood corresponding to the currently traversed particle is sorted to obtain a sorting result of all particles in the initial topological neighborhood corresponding to the currently traversed particle;
[0159] According to the order of particles in the sorting result of all particles in the initial topological neighborhood corresponding to the currently traversed particle, the second preset number of dimensional positions of each particle in the initial topological neighborhood corresponding to the currently traversed particle are arranged to obtain the initial global optimal particle in the initial topological neighborhood corresponding to the currently traversed particle.
[0160] Step 507, obtaining the original position of the currently traversed particle and the original speed of the currently traversed particle;
[0161] Step 508, subtracting the position of the initial local optimal particle from the original position of the currently traversed particle to obtain a first difference; and subtracting the position of the initial global optimal particle from the original position of the currently traversed particle to obtain a second difference;
[0162] Step 509, summing the original speed of the currently traversed particle and the first difference value with the second difference value to obtain the current speed of the currently traversed particle;
[0163] Step 510, summing the current speed 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 the optimal solution of the currently traversed particle is obtained;
[0164] Step 511: Use 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 use the second target detection network to perform target detection.
[0165] In order to implement the target detection method provided by the embodiment of the present disclosure, the embodiment of the present disclosure also provides a target detection device, such as Figure 6 shown. Figure 6 The target detection device 600 is a schematic diagram of the structure of the target detection device provided in the embodiment of the present disclosure, and 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 weight and the convolutional layer bias of each of the convolutional layers, and the fully connected layer weight and the fully connected layer bias of each of the fully connected layers;
[0167] An acquisition unit 602 is used to use the network parameters as particles in a particle swarm, and use a particle swarm optimization algorithm to obtain an optimal solution for each particle in the particle swarm with the minimum value of the loss function of the first target detection network as the optimization goal;
[0168] The target detection unit 603 is used to use the optimal solution of each particle as the network parameter corresponding to the first target detection network, obtain a second target detection network, and use the second target detection network to perform target detection.
[0169] In one embodiment, the acquisition unit 602 is specifically configured to:
[0170] Initializing a particle swarm and using the network parameters as particles in the particle swarm; wherein the particles in the particle swarm correspond one-to-one to the network parameters of the first target detection network;
[0171] Obtaining an initial fitness value of each particle, dividing the particles whose initial fitness value is less than a preset fitness threshold into a dominant group, and dividing the particles whose initial fitness value is not less than the preset fitness threshold into a disadvantaged group;
[0172] Traversing each particle in the particle group, and selecting an initial topological neighborhood corresponding to the currently traversed particle from the dominant group, wherein the initial topological neighborhood includes at least one particle;
[0173] Obtaining an initial local optimal particle in an initial topological neighborhood corresponding to the currently traversed particle and an 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 particles are iteratively updated until an iteration termination condition is met, thereby obtaining an optimal solution for the currently traversed particles.
[0175] In one embodiment, the acquisition unit 602 is specifically configured to:
[0176] A first preset number of target particles are screened out from the dominant group using a uniform random probability method, and the first preset number of target particles are used as initial topological neighborhoods of corresponding particles.
[0177] In one embodiment, the acquisition unit 602 is specifically configured to:
[0178] Sum the initial fitness values of all particles in the initial topological neighborhood corresponding to the currently traversed particle to obtain a first sum value;
[0179] Based on the initial fitness value of each particle in the initial topological neighborhood corresponding to the currently traversed particle, determine the particle with the smallest fitness value in the initial topological neighborhood corresponding to the currently traversed particle 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, determine the initial global optimal particle in the initial topological neighborhood corresponding to the currently traversed particle.
[0180] In one embodiment, the acquisition unit 602 is specifically configured to:
[0181] 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, obtaining a second preset number of dimensional positions of each particle in the initial topological neighborhood corresponding to the currently traversed particle;
[0182] Obtaining the sequence number of each particle in the initial topological neighborhood corresponding to the currently traversed particle;
[0183] Using a random sorting method, the sequence number of each particle in the initial topological neighborhood corresponding to the currently traversed particle is sorted to obtain a sorting result of all particles in the initial topological neighborhood corresponding to the currently traversed particle;
[0184] According to the order of particles in the sorting result of all particles in the initial topological neighborhood corresponding to the currently traversed particle, the second preset number of dimensional positions of each particle in the initial topological neighborhood corresponding to the currently traversed particle are arranged 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 configured to:
[0186] Based on the initial local optimal particle and the initial global optimal particle, obtaining the position of the initial local optimal particle and the position of the initial global optimal particle;
[0187] Obtaining the original position of the currently traversed particle and the original velocity of the currently traversed particle;
[0188] Subtracting the position of the initial local optimal particle from the original position of the currently traversed particle to obtain a first difference; and subtracting the position of the initial global optimal particle from the original position of the currently traversed particle to obtain a second difference;
[0189] Adding the sum of the original speed of the currently traversed particle and the first difference value to the second difference value to obtain the current speed of the currently traversed particle;
[0190] The current speed of the currently traversed particle and the original position of the currently traversed particle are summed to obtain the current position of the currently traversed particle, until the iteration termination condition is met, and the optimal solution of the currently traversed particle is obtained.
[0191] It should be noted that: when the target detection device provided in the above embodiment performs target detection, only the division of the above program modules is used as an example. In actual applications, the above processing can be assigned to different program modules as needed, that is, the internal structure of the target detection device is 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 embodiment and the target detection method embodiment provided in the embodiment of the present disclosure belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0192] Figure 7 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present disclosure is shown in FIG. 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 that can be executed by the at least one processor 702, and the instructions are executed by the at least one processor 702 to implement the steps of the target detection method of the embodiment of the present disclosure.
[0193] Optionally, the electronic device may specifically be a target detection device in an embodiment of the present application, and the electronic device may implement corresponding processes implemented by the target detection device in various methods in the embodiments of the present application, which will not be described in detail here for the sake of brevity.
[0194] It is understood that the electronic device also includes a communication interface 703. The various components in the electronic device are coupled together through a bus system 704. It is understood that the bus system 704 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 704 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, Figure 7 Various buses are labeled as bus system 704 .
[0195] It can be understood that the memory 701 can be a volatile memory or a non-volatile memory, and can also include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM); the magnetic surface memory can be a disk memory or a tape memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and 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), synchronous link dynamic random access memory (SLDRAM, SyncLink Dynamic Random Access Memory), and direct RAM bus random access memory (DRRAM, Direct Rambus Random Access Memory).The memory 701 described in the embodiment of the present invention is intended to include but is not limited to these and any other suitable types of memories.
[0196] The method disclosed in the above embodiment of the present disclosure can be applied to the processor 702, or implemented by the processor 702. The processor 702 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor 702 or an instruction in the form of software. The above processor 702 may be a general-purpose processor, a DSP, or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The processor 702 can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present invention. A general-purpose processor may be a microprocessor or any conventional processor, etc. In combination with the steps of the method disclosed in the embodiment of the present invention, it can be directly embodied as a hardware decoding processor to execute, or it can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium, which is located in the memory 701, and the processor 702 reads the information in the memory 701 and completes the steps of the above method in combination with its hardware.
[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 execute the aforementioned method.
[0198] The present public security embodiment also provides a non-transitory computer-readable storage medium storing computer instructions, and the computer instructions are used to implement the steps of the target detection method of the embodiment of the present invention when executed by a computer.
[0199] Optionally, the computer-readable storage medium can be applied to the target detection device in the embodiments of the present application, and the computer instructions enable the computer to execute the corresponding processes implemented by the target detection device in the various methods of the embodiments of the present application. For the sake of brevity, they are not repeated here.
[0200] The embodiments of the present disclosure also provide a computer program product, including a computer program, which implements the steps of the target detection method provided by the embodiments of the present disclosure when executed by a processor.
[0201] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0202] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0203] In addition, all functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0204] A person of ordinary skill in the art can understand that: all or part of the steps of implementing the above-mentioned method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium, which, when executed, executes the steps of the above-mentioned method embodiment; and the aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, disks or optical disks.
[0205] Alternatively, if the above-mentioned integrated unit of the present invention is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention can be essentially or partly reflected in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods of each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.
[0206] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A target detection method, characterized in that: include: Determining network parameters of a first object 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 a convolutional layer weight and a convolutional layer bias of each of the convolutional layers, and a fully connected layer weight and a fully connected layer bias of each of the fully connected layers; The network parameters are used as particles in a particle swarm, and a particle swarm optimization algorithm is used to obtain the optimal solution of each particle in the particle swarm by taking the minimum value of the loss function of the first target detection network as the optimization goal; The optimal solution of each particle is used as the network parameter corresponding to the first target detection network to obtain a second target detection network, and the second target detection network is used to perform target detection.
2. The method according to claim 1, characterized in that The method of using the network parameters as particles in a particle swarm, using a particle swarm optimization algorithm, and taking the minimum value of the loss function of the first target detection network as the optimization goal to obtain the optimal solution of each particle in the particle swarm includes: Initializing a particle swarm and using the network parameters as particles in the particle swarm; wherein the particles in the particle swarm correspond one-to-one to the network parameters of the first target detection network; Obtaining an initial fitness value of each particle, dividing the particles whose initial fitness value is less than a preset fitness threshold into a dominant group, and dividing the particles whose initial fitness value is not less than the preset fitness threshold into a disadvantaged group; Traversing each particle in the particle group, and selecting an initial topological neighborhood corresponding to the currently traversed particle from the dominant group, wherein the initial topological neighborhood includes at least one particle; Obtaining an initial local optimal particle in an initial topological neighborhood corresponding to the currently traversed particle and an initial global optimal particle in the dominant group; Based on the initial local optimal particle and the initial global optimal particle, the currently traversed particles are iteratively updated until an iteration termination condition is met, thereby obtaining an optimal solution for the currently traversed particles.
3. The method according to claim 2, 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 screened out from the dominant group using a uniform random probability method, and the first preset number of target particles are used as initial topological neighborhoods of corresponding particles.
4. The method according to claim 2, 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: Sum the initial fitness values of all particles in the initial topological neighborhood corresponding to the currently traversed particle to obtain a first sum value; Based on the initial fitness value of each particle in the initial topological neighborhood corresponding to the currently traversed particle, determine the particle with the smallest fitness value in the initial topological neighborhood corresponding to the currently traversed particle 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, determine the initial global optimal particle in the initial topological neighborhood corresponding to the currently traversed particle.
5. The method according to claim 4, characterized in that The step of determining the initial global 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 comprises: 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, obtaining a second preset number of dimensional positions of each particle in the initial topological neighborhood corresponding to the currently traversed particle; Obtaining the sequence number of each particle in the initial topological neighborhood corresponding to the currently traversed particle; Using a random sorting method, the sequence number of each particle in the initial topological neighborhood corresponding to the currently traversed particle is sorted to obtain a sorting result of all particles in the initial topological neighborhood corresponding to the currently traversed particle; According to the order of particles in the sorting result of all particles in the initial topological neighborhood corresponding to the currently traversed particle, the second preset number of dimensional positions of each particle in the initial topological neighborhood corresponding to the currently traversed particle are arranged to obtain the initial global optimal particle in the initial topological neighborhood corresponding to the currently traversed particle.
6. The method according to claim 2, characterized in that The iterative updating of the currently traversed particles based on the initial local optimal particles and the initial global optimal particles until an iteration termination condition is satisfied to obtain the optimal solution of the currently traversed particles includes: Based on the initial local optimal particle and the initial global optimal particle, obtaining the position of the initial local optimal particle and the position of the initial global optimal particle; Obtaining the original position of the currently traversed particle and the original velocity of the currently traversed particle; Subtracting the position of the initial local optimal particle from the original position of the currently traversed particle to obtain a first difference; and subtracting the position of the initial global optimal particle from the original position of the currently traversed particle to obtain a second difference; Adding the sum of the original speed of the currently traversed particle and the first difference value to the second difference value to obtain the current speed of the currently traversed particle; The current speed of the currently traversed particle and the original position of the currently traversed particle are summed to obtain the current position of the currently traversed particle, until the iteration termination condition is met, and the optimal solution of the currently traversed particle is obtained.
7. A target detection device, characterized in that: include: A determination unit, used to determine 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 a convolutional layer weight and a convolutional layer bias of each of the convolutional layers, and a fully connected layer weight and a fully connected layer bias of each of the fully connected layers; An acquisition unit, configured to use the network parameters as particles in a particle swarm, and use a particle swarm optimization algorithm to obtain an optimal solution for each particle in the particle swarm with the minimum value of the loss function of the first target detection network as the optimization goal; The target detection unit is used to use the optimal solution of each particle as the network parameter corresponding to the first target detection network, obtain a second target detection network, and use the second target detection network to perform target detection.
8. 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, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 6.
9. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 6.
10. A computer program product, characterized in that A computer program is included which, when executed by a processor, implements the method according to any one of claims 1 to 6.
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
High-precision visual measurement method, device and system based on bionic algorithm
CN109840889A
Optimization model method based on generative adversarial network and application
CN110097185A
