Construction machinery image recognition method and system integrating artificial fish and particle swarm algorithm

By fusion of artificial fish and particle swarm algorithms to optimize the initial anchor box, the traditional algorithm's shortcomings in recognition accuracy and robustness are solved, and the accuracy of engineering machinery image recognition is improved.

CN113901932BActive Publication Date: 2024-11-15SHANDONG UNIV
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202111192127.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-13
Publication Date
2024-11-15
Estimated Expiration
2041-10-13

AI Technical Summary

Technical Problem

The selection of initial anchor frames in traditional engineering machinery image recognition algorithms is prone to fall into local optimal values ​​and is sensitive to noise points and abnormal points, affecting the recognition accuracy.

Method used

Using the fusion artificial fish and particle swarm algorithm, each particle of the particle swarm algorithm is seen as an artificial fish, and the speed of each particle is seen as an artificial fish field range, and adaptively changes the field of foraging behavior of the artificial fish algorithm to optimize the Anchor frame, obtain standard anchor frames, improve recognition accuracy.

Benefits of technology

The local optimal value problem of anchor frame clustering method is effectively avoided, the robustness to noise points is improved, and the accuracy of image recognition of engineering machinery is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113901932B_ABST
    Figure CN113901932B_ABST
Patent Text Reader

Abstract

The present invention belongs to the field of engineering machinery image recognition, and provides an engineering machinery image recognition method and system that integrates artificial fish and particle swarm algorithms. The method includes acquiring an engineering machinery image and initializing an anchor frame of the engineering machinery image; using the integrated particle swarm algorithm and artificial fish swarm algorithm to process the initial anchor frame of the engineering machinery image to obtain a standard anchor frame of the engineering machinery image; each particle of the particle swarm algorithm is regarded as an artificial fish, and the speed of each particle is regarded as the field of view of the artificial fish, and the field of view of the foraging behavior of the artificial fish swarm algorithm is adaptively changed through fitness optimization, and the field of view is the anchor frame; based on the standard anchor frame of the engineering machinery image and the target detection model, the type of engineering machinery in the engineering machinery image is identified.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of engineering machinery image recognition, and in particular relates to an engineering machinery image recognition method and system integrating artificial fish and particle swarm algorithm. Background Art

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

[0003] In recent years, with the surge of new artificial intelligence technologies, the civil engineering industry has ushered in new opportunities and challenges. Traditional engineering management systems can no longer achieve the goals of intelligent, efficient, and closed-loop management. Researchers have begun to try to improve the real-time and accuracy of construction management in complex working conditions by introducing new technologies. Visual sensors have become one of the indispensable sensors for construction machinery due to their low cost, large amount of information, selective perception distance, and high frequency. By extracting visual sensor signals, target detection and identification can be performed on objects in front, such as workers, trucks, excavators, rollers, bulldozers, etc. Accurately identifying specific targets within the sensor's field of view is a prerequisite for the construction machinery controller to receive correct information and make appropriate decisions, and it is also a key link in intelligent construction.

[0004] Common target detection algorithms mainly include traditional target detection algorithms and target detection algorithms based on deep learning. Compared with traditional algorithms, target detection algorithms based on deep learning have made significant breakthroughs in accuracy, speed and robustness due to their big data training mechanism. As an emerging target detection algorithm based on deep learning in recent years, convolutional neural network provides a new target detection idea. Compared with traditional target detection algorithms, the complexity of its network model is relatively low, but its accuracy and real-time performance are greatly affected by the anchor frame size of the sample set. How to detect sample sets for specific targets, such as the accurate selection of anchor frame size for engineering machinery sample sets used in integrated construction, is one of the key factors to improve its detection performance. The inventors found that in traditional target detection algorithms, the selection of initial anchor frames generally adopts K-means clustering, but this method is prone to fall into local optimal values ​​and is sensitive to noise points and outliers, which in turn affects the accuracy of engineering machinery image recognition. Summary of the invention

[0005] In order to solve the technical problems existing in the above-mentioned background technology, the present invention provides a method and system for engineering machinery image recognition integrating artificial fish and particle swarm algorithm, which can improve the accuracy of engineering machinery image recognition.

[0006] In order to achieve the above object, the present invention adopts the following technical solution:

[0007] A first aspect of the present invention provides a method for recognizing an image of an engineering machinery by integrating an artificial fish and a particle swarm algorithm, which comprises:

[0008] Acquire the construction machinery image and initialize the anchor frame of the construction machinery image;

[0009] The initial anchor frame of the engineering machinery image is processed by using a fused particle swarm algorithm and an artificial fish swarm algorithm to obtain a standard anchor frame of the engineering machinery image; wherein each particle of the particle swarm algorithm is regarded as an artificial fish, and the speed of each particle is regarded as the field of view of the artificial fish, and the field of view of the foraging behavior of the artificial fish swarm algorithm is adaptively changed through fitness optimization, and the field of view is the anchor frame;

[0010] Based on the standard anchor frame and the target detection model of the engineering machinery image, the type of the engineering machinery in the engineering machinery image is identified.

[0011] A second aspect of the present invention provides an engineering machinery image recognition system integrating artificial fish and particle swarm algorithm, comprising:

[0012] An image acquisition and initialization module, which is used to acquire an image of a construction machinery and initialize an anchor frame of the image of the construction machinery;

[0013] A standard anchor frame acquisition module is used to process the initial anchor frame of the engineering machinery image by using a fused particle swarm algorithm and an artificial fish swarm algorithm to obtain a standard anchor frame of the engineering machinery image; wherein each particle of the particle swarm algorithm is regarded as an artificial fish, and the speed of each particle is regarded as the field of view of the artificial fish, and the field of view of the foraging behavior of the artificial fish swarm algorithm is adaptively changed through fitness optimization, and the field of view is the anchor frame;

[0014] The construction machinery image recognition module is used to identify the type of construction machinery in the construction machinery image based on the standard anchor frame and target detection model of the construction machinery image.

[0015] The third aspect of the present invention provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps in the method for recognizing images of engineering machinery integrating artificial fish and particle swarm algorithm as described above are implemented.

[0016] A fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the method for recognizing images of construction machinery integrating the artificial fish and the particle swarm algorithm as described above.

[0017] Compared with the prior art, the present invention has the following beneficial effects:

[0018] The present invention utilizes a fused particle swarm algorithm and an artificial fish swarm algorithm to process the initial anchor frame of the engineering machinery image to obtain a standard anchor frame of the engineering machinery image; wherein each particle of the particle swarm algorithm is regarded as an artificial fish, and the speed of each particle is regarded as the field of view of the artificial fish; the field of view of the foraging behavior of the artificial fish swarm algorithm is adaptively changed through fitness optimization, and the field of view is the anchor frame, which solves the problem that the conventional anchor frame clustering method is prone to fall into the local optimal value and is sensitive to noise points and abnormal points; based on the standard anchor frame and target detection model of the engineering machinery image, the type of engineering machinery in the engineering machinery image is identified, and the accuracy of engineering machinery image recognition is improved.

[0019] Advantages of additional aspects of the present invention will be given in part in the following description, and in part will become obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.

[0021] Figure 1 is a schematic diagram of a system architecture of an exemplary application environment of an engineering machinery image recognition method integrating an artificial fish and a particle swarm algorithm according to an embodiment of the present invention;

[0022] Figure 2 It is a flow chart of a method for recognizing an image of an engineering machinery by integrating an artificial fish algorithm and a particle swarm algorithm according to an embodiment of the present invention;

[0023] Figure 3 It is a schematic diagram of the structure of an engineering machinery image recognition system integrating artificial fish and particle swarm algorithm according to an embodiment of the present invention;

[0024] Figure 4 It is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0025] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.

[0026] It should be noted that the following detailed descriptions are all illustrative and intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.

[0027] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprising" and / or "including" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.

[0028] Figure 1 A schematic diagram of a system architecture of an exemplary application environment of a construction machinery image recognition method integrating an artificial fish algorithm and a particle swarm algorithm according to an embodiment of the present invention is shown.

[0029] like Figure 1 As shown, system architecture 100 may include electronic device 101 and / or electronic device 102, network 103 and server 104. Network 103 is used to provide a medium for communication links between electronic device 101, electronic device 102 and server 104. Network 103 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc. Electronic devices 101 and 102 include but are not limited to desktop computers, portable computers, smart phones, and tablet computers, etc. It should be understood that Figure 1 The number of electronic devices, networks and servers in the embodiment is only for illustration. Any number of electronic devices, networks and servers may be provided as required. For example, the server 104 may be a server cluster composed of multiple servers.

[0030] The engineering machinery image recognition method integrating artificial fish and particle swarm algorithm provided in the embodiment of the present invention is generally executed by the server 104, and accordingly, the engineering machinery image recognition system integrating artificial fish and particle swarm algorithm can be set in the server 104. However, it is easy for those skilled in the art to understand that the engineering machinery image recognition method integrating artificial fish and particle swarm algorithm provided in the embodiment of the present invention can also be executed by the electronic device 101 and the electronic device 102.

[0031] Embodiment 1

[0032] like Figure 2 As shown, this embodiment provides a method for engineering machinery image recognition integrating artificial fish and particle swarm algorithm, which specifically includes the following steps:

[0033] S201: Acquire a construction machinery image and initialize an anchor frame of the construction machinery image.

[0034] In a specific implementation, the engineering machinery images include images of trucks, excavators, road rollers, bulldozers, and the like.

[0035] The anchor frame is a rectangular frame. In this embodiment, the category and position of the standard frame are marked with a rectangular frame.

[0036] S202: Using a fused particle swarm algorithm and artificial fish swarm algorithm to process the initial anchor frame of the engineering machinery image, and obtaining a standard anchor frame of the engineering machinery image; wherein each particle of the particle swarm algorithm is regarded as an artificial fish, and the speed of each particle is regarded as the field of view of the artificial fish, and the field of view of the foraging behavior of the artificial fish swarm algorithm is adaptively changed through fitness optimization, and the field of view is the anchor frame.

[0037] The foraging behavior is realized in a population of m particles. The position of particle i can be expressed as X i =(x i1 ,x i2 ,...x in ), where i = 1, 2, ... m; n is the dimension of the particle, and its velocity V i =(V i1 ,V i2 ,...V in ). Its individual extreme value is P i =(P i1 ,P i2 ,...,P in ), is the optimal position searched by particle i, and the population extreme value is P g =(P g1 ,P g2 ,...,P gn ), is the optimal fitness value position searched by all particles. Each particle X i Try to find a location X with high food concentration (high fitness) within its field of view i0 The formula is:

[0038] x i0 =x i +rands·v i

[0039] Among them, v i is the speed of the particle and the field of view of the artificial fish; rand is a random number between [0,1].

[0040] If the fitness function calculation result is better than the previous step, the particle speed and position are updated as follows:

[0041]

[0042]

[0043] Among them, ω is the weight, k is the current iteration number; c1 and c2 are learning factors, also known as acceleration constants. Usually, c1=c2=2; step is the movement step of the artificial fish, that is, the movement step of the particle; rand is a random number between [0,1]

[0044] If the object is not found after trying a set number of times (e.g. trynumber times), a random action is performed.

[0045] The random behavior realization process is to find the particle with a fitness value greater than X in the entire particle group. i All particles, randomly select one particle X j , and update the particle speed and position with it as the direction. The speed and position update formula is as follows:

[0046]

[0047]

[0048] Among them, ω is the weight, k is the current number of iterations; c1 and c2 are learning factors, also known as acceleration constants. Usually, c1=c2=2; step is the movement step of the artificial fish, that is, the movement step of the particle; rand is a random number between [0,1].

[0049] During the optimization process, if the ratio of the fitness difference between the two optimizations to the fitness of the previous optimization is less than a preset threshold, the optimization stops.

[0050] By optimizing the fitness and adaptively changing the field of view of the foraging behavior of the artificial fish swarm algorithm, the fitness value of the improved particle swarm algorithm in the kth step is The ratio of the difference before and after the improved particle swarm algorithm fitness function to the original value is If error(k)<5‰, the field of view of the artificial fish school that reduces foraging behavior is 0.5v i , enhance the local optimization ability. When the above optimization process is performed 15-20 times in a row, the value of error(k) is always less than 5‰. At this time, the algorithm is randomly disturbed to increase the field of view of the artificial fish school in the foraging behavior to 4v i . Calculate the fitness value again. If the fitness value of the tth step is better than the fitness value of the t+1th step, update the position of the particle swarm. Otherwise, do not update the position of the particle swarm.

[0051] If error(k)≥5‰ exists, the field of view of the artificial fish school with foraging behavior is increased to 2v i , enhancing the global optimization capability.

[0052] The fitness is calculated by a fitness function, which is the Euclidean distance from all particles to the nearest cluster center.

[0053] The parameters of particles are calculated by integrating artificial fish and particle swarm algorithm. Each particle represents a clustering method. The target of each particle's action represents the location of the cluster center. The fitness function is the Euclidean distance from all data to the nearest cluster center. The Euclidean distance calculation formula is as follows:

[0054]

[0055] Among them, F i is the sum of the Euclidean distances from the ith data to all cluster centers, N is the total number of clusters, m is the number of data, n is the data dimension, and y jo is the characteristic size of each anchor frame, c ko is the center of the cluster, that is, the optimal position for the particle swarm to find the best result. The particle finds the cluster center that minimizes the fitness function by finding the shortest path from the initial position to the final position, thereby dividing the entire data set into N different clusters.

[0056] S203: Identify the type of the construction machinery in the construction machinery image based on the standard anchor frame and the target detection model of the construction machinery image.

[0057] The image samples in the training data set used for training the target detection model are the initial anchor frames of the engineering machinery image samples processed by the fused particle swarm algorithm and the artificial fish swarm algorithm to obtain the standard anchor frames and clustering standard anchor frames corresponding to the engineering machinery image samples.

[0058] Before training the target detection model, you need to set the width and height of the initial anchor box. During training, the network outputs a predicted box based on the initial anchor box, and then compares it with the characteristic size of the labeled real box, calculates the difference between the two, and then reversely updates the iterative network parameters. Therefore, the choice of the initial anchor box has a great impact on the accuracy and speed of model training. In order to improve the initial value of the anchor box, based on the proposed fusion of artificial fish and particle swarm algorithm, the width and height of the standard box of the data set are clustered and analyzed to obtain the characteristic size of k groups of anchor boxes, and k can take values ​​such as 9, 16, 25... Just enter it in the configuration file of the model before training. The detailed steps are as follows:

[0059] (1) Extract the normalized width and height of the standard frames of all sample images in the training set and put them together, and calculate their standard coordinates.

[0060] (2) Initialize k anchor boxes by randomly selecting k values ​​from all standard boxes as the initial values ​​of the k anchor boxes.

[0061] (3) Calculate the fitness function value of each standard box.

[0062] (4) Classification operation: By comparing the fitness function of each standard box, it is classified into the nearest anchor box according to its value.

[0063] (5) Repeat (3) and (4) until the requirements are met.

[0064] After completing the initialization of the anchor frame feature size of the data set, the convolutional neural network is used to train the engineering machinery training set with improved anchor frame feature size to obtain the target detection model, which is tested using the test set. After meeting the performance requirements, a method and system that can meet the requirements of target detection and recognition of engineering machinery are finally obtained.

[0065] Embodiment 2

[0066] like Figure 3 As shown, this embodiment provides an engineering machinery image recognition system integrating artificial fish and particle swarm algorithm, which includes:

[0067] An image acquisition and initialization module 301 is used to acquire an image of a construction machinery and initialize an anchor frame of the image of the construction machinery;

[0068] A standard anchor frame acquisition module 302 is used to process the initial anchor frame of the engineering machinery image by using the fused particle swarm algorithm and artificial fish swarm algorithm to obtain the standard anchor frame of the engineering machinery image; wherein each particle of the particle swarm algorithm is regarded as an artificial fish, and the speed of each particle is regarded as the field of view of the artificial fish, and the field of view of the foraging behavior of the artificial fish swarm algorithm is adaptively changed through fitness optimization, and the field of view is the anchor frame;

[0069] The construction machinery image recognition module 303 is used to identify the type of construction machinery in the construction machinery image based on the standard anchor frame and target detection model of the construction machinery image.

[0070] It should be noted here that the various modules in this embodiment correspond one-to-one to the various steps in Example 1, and the specific implementation process is the same, which will not be repeated here.

[0071] Embodiment 3

[0072] This embodiment provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the steps in the method for recognizing images of construction machinery integrating artificial fish and particle swarm algorithm as described above are implemented.

[0073] Reference Figure 4 , a schematic diagram of the structure of the electronic device in this embodiment. It should be noted that, Figure 4 The electronic device 400 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0074] like Figure 4 As shown, electronic device 400 includes a central processing unit (CPU) 401, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 402 or a program loaded from a storage portion 408 into a random access memory (RAM) 403. In RAM 403, various programs and data required for system operation are also stored. Central processing unit 401, ROM 402 and RAM 503 are connected to each other via bus 404. Input / output (I / O) interface 405 is also connected to bus 404.

[0075] The following components are connected to the I / O interface 405: an input section 406 including a keyboard, a mouse, etc.; an output section 407 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 408 including a hard disk, etc.; and a communication section 409 including a network interface card such as a local area network (LAN) card, a modem, etc. The communication section 409 performs communication processing via a network such as the Internet. A drive 410 is also connected to the I / O interface 405 as needed. A removable medium 411, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 410 as needed so that a computer program read therefrom is installed into the storage section 408 as needed.

[0076] Embodiment 4

[0077] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication part 409, and / or installed from a removable medium 411. When the computer program is executed by the central processing unit 401, various functions defined in the device of the present application are executed.

[0078] The present invention is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products of the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram and the combination of the processes and / or blocks in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0079] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A construction machinery image recognition method integrating artificial fish and particle swarm algorithm, characterized in that: include: Acquire the construction machinery image and initialize the anchor frame of the construction machinery image; The initial anchor frame of the engineering machinery image is processed by using a fused particle swarm algorithm and an artificial fish swarm algorithm to obtain a standard anchor frame of the engineering machinery image; wherein each particle of the particle swarm algorithm is regarded as an artificial fish, and the speed of each particle is regarded as the field of view of the artificial fish, and the field of view of the foraging behavior of the artificial fish swarm algorithm is adaptively changed through fitness optimization, and the field of view is the anchor frame; The foraging behavior is realized in a population of m particles. The position of particle i can be expressed as X i =(x i1 ,x i2 ,...x in ), where i = 1, 2, ... m; n is the dimension of the particle, and its velocity V i =(V i1 ,V i2 ,...V in );its individual extreme value is P i =(P i1 ,P i2 ,...,P in ), is the optimal position searched by particle i, and the population extreme value is P g =(P g1 ,P g2 ,...,P gn ), is the optimal fitness value position searched by all particles; each particle X i Try to find a location X with high food concentration (high fitness) within its field of view i0 The formula is: x i0 =x i +rands·v i Among them, v i is the speed of the particle and the field of view of the artificial fish; rand is a random number between [0,1]; If the fitness function calculation result is better than the previous step, the particle speed and position are updated as follows: Among them, ω is the weight, k is the current iteration number; c1 and c2 are learning factors, also known as acceleration constants, c1=c2=2; step is the movement step length of the artificial fish, that is, the movement step length of the particle; rand is a random number between [0,1]; If it is not found after the set number of attempts, a random action is performed; The random behavior realization process is to find the particle with a fitness value greater than X in the entire particle group. i All particles, randomly select one particle X j , use it as the direction to update the particle speed and position, and the speed and position update formula is as follows: In the optimization process, if the ratio of the fitness difference between the two optimizations to the fitness of the previous optimization is less than the preset threshold, the optimization stops; By optimizing the fitness and adaptively changing the field of view of the foraging behavior of the artificial fish swarm algorithm, the fitness value of the improved particle swarm algorithm in the kth step is The ratio of the difference between the improved particle swarm algorithm fitness function before and after to the original value is If error(k) < 5‰, the field of view of the artificial fish school that reduces foraging behavior is Enhance the local optimization ability; when the above optimization process is performed 15-20 times in a row, the value of error(k) is always less than 5‰. At this time, the algorithm is randomly disturbed to increase the field of view of the artificial fish school in the foraging behavior. Calculate the fitness value again. If the fitness value of the tth step is better than the fitness value of the t+1th step, update the position of the particle swarm. Otherwise, do not update the position of the particle swarm. If error(k)≥5‰, the field of view of the artificial fish school that increases the foraging behavior is Enhance global optimization capabilities; Based on the standard anchor frame and target detection model of the engineering machinery image, identifying the type of engineering machinery in the engineering machinery image; The image samples in the training data set used in the training target detection model are the initial anchor frames of the engineering machinery image samples processed by the fused particle swarm algorithm and the artificial fish swarm algorithm, and the standard anchor frames and clustering standard anchor frames corresponding to the engineering machinery image samples are obtained; The specific process of clustering analysis of the width and height of the standard box of the data set based on the fusion of artificial fish swarm and particle swarm algorithm is as follows: (1) Extract the normalized width and height of the standard frames of all sample images in the training set and put them together, and calculate their standard coordinates; (2) Initialize k anchor boxes by randomly selecting k values ​​from all standard boxes as the initial values ​​of k anchor boxes; (3) Calculate the fitness function value of each standard box; (4) Classification operation: By comparing the fitness function of each standard box, it is classified into the nearest anchor box according to its value; (5) Repeat (3) and (4) until the requirements are met.

2. The method for engineering machinery image recognition integrating artificial fish and particle swarm algorithm as claimed in claim 1, characterized in that: The fitness is calculated by a fitness function.

3. The method for engineering machinery image recognition integrating artificial fish and particle swarm algorithm as claimed in claim 2, characterized in that: The fitness function is the Euclidean distance from all particles to the nearest cluster center.

4. The method for engineering machinery image recognition integrating artificial fish and particle swarm algorithm as claimed in claim 1, characterized in that: During the optimization process, if the ratio of the fitness difference between the two optimizations to the fitness of the previous optimization is less than a preset threshold, the optimization stops.

5. The method for engineering machinery image recognition integrating artificial fish and particle swarm algorithm as claimed in claim 1, characterized in that: The anchor frame is a rectangular frame.

6. An engineering machinery image recognition system integrating artificial fish and particle swarm algorithm, characterized in that: include: An image acquisition and initialization module, which is used to acquire an image of a construction machinery and initialize an anchor frame of the image of the construction machinery; A standard anchor frame acquisition module is used to process the initial anchor frame of the engineering machinery image by using a fused particle swarm algorithm and an artificial fish swarm algorithm to obtain a standard anchor frame of the engineering machinery image; wherein each particle of the particle swarm algorithm is regarded as an artificial fish, and the speed of each particle is regarded as the field of view of the artificial fish, and the field of view of the foraging behavior of the artificial fish swarm algorithm is adaptively changed through fitness optimization, and the field of view is the anchor frame; The foraging behavior is realized in a population of m particles. The position of particle i can be expressed as X i =(x i1 ,x i2 ,...x in ), where i = 1, 2, ... m; n is the dimension of the particle, and its velocity V i =(V i1 ,V i2 ,...V in );its individual extreme value is P i =(P i1 ,P i2 ,...,P in ), is the optimal position searched by particle i, and the population extreme value is P g =(P g1 ,P g2 ,...,P gn ), is the optimal fitness value position searched by all particles; each particle X i Try to find a location X with high food concentration (high fitness) within its field of view i0 The formula is: x i0 =x i +rands·v i Among them, v i is the speed of the particle and the field of view of the artificial fish; rand is a random number between [0,1]; If the fitness function calculation result is better than the previous step, the particle speed and position are updated as follows: Among them, ω is the weight, k is the current iteration number; c1 and c2 are learning factors, also known as acceleration constants, c1=c2=2; step is the movement step length of the artificial fish, that is, the movement step length of the particle; rand is a random number between [0,1]; If it is not found after the set number of attempts, a random action is performed; The random behavior realization process is to find the particle with a fitness value greater than X in the entire particle group. i All particles, randomly select one particle X j , use it as the direction to update the particle speed and position, and the speed and position update formula is as follows: In the optimization process, if the ratio of the fitness difference between the two optimizations to the fitness of the previous optimization is less than the preset threshold, the optimization stops; By optimizing the fitness and adaptively changing the field of view of the foraging behavior of the artificial fish swarm algorithm, the fitness value of the improved particle swarm algorithm in the kth step is The ratio of the difference before and after the improved particle swarm algorithm fitness function to the original value is If error(k) < 5‰, the field of view of the artificial fish school that reduces foraging behavior is Enhance the local optimization ability; when the above optimization process is performed 15-20 times in a row, the value of error(k) is always less than 5‰. At this time, the algorithm is randomly disturbed to increase the field of view of the artificial fish school in the foraging behavior. Calculate the fitness value again. If the fitness value of the tth step is better than the fitness value of the t+1th step, update the position of the particle swarm. Otherwise, do not update the position of the particle swarm. If error(k)≥5‰, the field of view of the artificial fish school that increases the foraging behavior is Enhance global optimization capabilities; A construction machinery image recognition module, which is used to identify the type of construction machinery in the construction machinery image based on a standard anchor frame and a target detection model of the construction machinery image; The image samples in the training data set used in the training target detection model are the initial anchor frames of the engineering machinery image samples processed by the fused particle swarm algorithm and the artificial fish swarm algorithm, and the standard anchor frames and clustering standard anchor frames corresponding to the engineering machinery image samples are obtained; The specific process of clustering analysis of the width and height of the standard box of the data set based on the fusion of artificial fish swarm and particle swarm algorithm is as follows: (1) Extract the normalized width and height of the standard frames of all sample images in the training set and put them together, and calculate their standard coordinates; (2) Initialize k anchor boxes by randomly selecting k values ​​from all standard boxes as the initial values ​​of k anchor boxes; (3) Calculate the fitness function value of each standard box; (4) Classification operation: By comparing the fitness function of each standard box, it is classified into the nearest anchor box according to its value; (5) Repeat (3) and (4) until the requirements are met.

7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps in the method for recognizing an image of an engineering machinery integrating an artificial fish and a particle swarm algorithm as described in any one of claims 1 to 5 are implemented.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps in the method for recognizing an image of an engineering machinery integrating an artificial fish and a particle swarm algorithm as described in any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Anchor box determination method and device, computer equipment and storage medium

    CN110472588A

  • Remote sensing small target detection method for model lightweight design

    CN112329721A

  • Method, system and equipment for optimizing current operating parameters of integrated energy system

    CN112749462A

  • Aluminum profile surface defect visual detection method based on improved yolov3

    CN112991271A