Airborne agricultural implement identification method and device and agricultural carrier
By building an agricultural machinery tool recognition model based on lightweight convolutional neural networks and convolutional feedforward networks, the problems of large number of model parameters and slow response speed in the prior art are solved, efficient and accurate agricultural machinery recognition is achieved, and it is suitable for resource-constrained edge devices.
Patent Information
- Application Number
- CN202510014596.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-06
- Publication Date
- 2025-05-06
AI Technical Summary
The existing deep learning-based agricultural machinery identification methods have the problems of large model parameters and slow response speed, and it is difficult to deploy on edge devices with resource-constrained.
The lightweight convolutional neural network RepViT framework is adopted, combining the convolutional feedforward network CFF module and the lightweight attention mechanism ECA module to build an agricultural machinery recognition model, and train it through transfer learning methods and deploy it on edge devices.
The number of parameters of the model is reduced, the response speed on edge devices is improved, and the accuracy of agricultural machinery recognition is significantly improved.
Smart Images

Figure CN119942199A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of agricultural intelligence informatization, and in particular to the field of airborne agricultural machinery identification. Background Art
[0002] In recent years, artificial intelligence-based agricultural machinery recognition methods have gradually become a research hotspot. Some studies have used deep learning models to identify the working status and category of agricultural machinery, but existing methods generally have problems such as large number of model parameters and slow response speed, making them difficult to deploy on resource-constrained edge devices. Therefore, how to design a lightweight and efficient agricultural machinery recognition model has become a problem that needs to be solved. Summary of the invention
[0003] In order to solve the above technical problems, the present invention discloses an onboard agricultural implement identification method, comprising the following steps:
[0004] Collect images of agricultural machinery working conditions;
[0005] Preprocessing the agricultural machinery working condition images to obtain an agricultural machinery dataset;
[0006] Construct an agricultural machinery recognition model based on the lightweight convolutional neural network RepViT framework, where
[0007] Use the convolutional feedforward network CFF module to build the feature extraction STEM module;
[0008] Use the convolutional feed-forward network CFF module to enhance the downsampling module;
[0009] Use the convolutional feedforward network CFF module and the lightweight attention mechanism ECA module to build the feature extraction block;
[0010] Using a transfer learning method to train the agricultural machinery recognition model to obtain a trained agricultural machinery recognition model;
[0011] The trained agricultural machinery recognition model is deployed to the edge device to perform agricultural machinery recognition.
[0012] In one embodiment of the method of the present invention, the step of constructing a convolutional feedforward network CFF module further comprises:
[0013] The convolutional feed-forward network CFF module is constructed by embedding a gated linear unit.
[0014] In one embodiment of the method of the present invention, the step of constructing the convolutional feed-forward network CFF module by embedding a gated linear unit further comprises:
[0015] Transmitting the first input image data to the first branch and the second branch of the entry control linear unit respectively;
[0016] The first input image data is processed by a first linear mapping, a depth convolution and an activation function in the first branch in sequence to obtain a first branch processing result;
[0017] The first input image data is processed by a second linear mapping in the second branch to obtain a second branch processing result;
[0018] Performing a dot product operation on the first branch processing result and the second branch processing result;
[0019] The result after the dot product operation is fused with the first input image data after a third linear mapping.
[0020] In one embodiment of the method of the present invention, the step of constructing a feature extraction STEM module by using a convolutional feedforward network CFF module further includes:
[0021] The convolutional feedforward network CFF module is used to replace the feedforward network FFN module in the feature extraction STEM module.
[0022] In one embodiment of the method of the present invention, the step of enhancing the downsampling module using a convolutional feed-forward network CFF module further comprises:
[0023] The convolutional feedforward network CFF module is used to replace the feedforward network FFN module in the downsampling module.
[0024] In one embodiment of the method of the present invention, the step of constructing a feature extraction block using a convolutional feedforward network CFF module and a lightweight attention mechanism ECA module further includes:
[0025] Use a convolutional feedforward network CFF module to replace the feedforward network FFN module in the downsampling module;
[0026] A lightweight attention mechanism ECA module is added before the convolutional feedforward network CFF module.
[0027] In one embodiment of the method of the present invention, the step of constructing the lightweight attention mechanism ECA module further includes:
[0028] Perform global average pooling on the second input image data to obtain a vector description;
[0029] Dynamically performing local cross-channel interaction based on channel dimensions according to the vector description;
[0030] Get the weight of each channel;
[0031] The weight of each channel is multiplied by the second input image data channel by channel to obtain a feature map after high-dimensional extraction by the attention mechanism.
[0032] In one embodiment of the method of the present invention, it also includes:
[0033] The redundant feature extraction blocks are deleted.
[0034] The present invention also provides an onboard agricultural implement identification device, which is used to implement any one of the above methods, comprising:
[0035] A collection module, used for collecting images of working conditions of agricultural machinery;
[0036] A data set construction module, used for preprocessing the agricultural machinery working condition images to obtain an agricultural machinery data set;
[0037] The agricultural machinery recognition model building module is used to build an agricultural machinery recognition model based on the lightweight convolutional neural network RepViT framework, which includes:
[0038] A feature extraction STEM building module is used to build a feature extraction STEM module using a convolutional feed-forward network CFF module;
[0039] Downsampling building block for enhancing downsampling modules using convolutional feed-forward network (CFF) modules;
[0040] Feature extraction block building module, used to build feature extraction blocks using convolutional feedforward network CFF module and lightweight attention mechanism ECA module;
[0041] A training module, used for training the agricultural machinery recognition model using a transfer learning method to obtain a trained agricultural machinery recognition model;
[0042] The recognition module is used to deploy the trained agricultural machinery recognition model to the edge device and perform agricultural machinery recognition.
[0043] The present invention also provides an agricultural vehicle, comprising a vehicle body, a chassis connected to the vehicle body, a driving device connected to the chassis, a control unit arranged in the vehicle body, and agricultural machinery connected to the vehicle body, and also comprises an airborne agricultural machinery identification device as described above, wherein the airborne agricultural machinery identification device is connected to the control unit.
[0044] The present invention also provides a storage medium for storing a computer control program, wherein the computer control program is used to execute the steps of any of the aforementioned methods.
[0045] The present invention proposes an airborne agricultural machinery recognition method, device and agricultural vehicle, which construct an agricultural machinery recognition model through a convolutional feedforward network CFF module and a lightweight attention mechanism ECA module, thereby reducing the number of model parameters and improving the response speed of deploying the agricultural machinery recognition model on edge devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 The present invention is a flowchart of an onboard agricultural implement identification method according to an embodiment of the present invention.
[0047] Figure 2 FIG. 4 is a schematic diagram of an agricultural implement recognition model according to an embodiment of the present invention.
[0048] Figure 3 4 is a block diagram of the composition of a convolutional feedforward network CFF module in one embodiment of the present invention.
[0049] Figure 4 This is a schematic diagram of a lightweight attention mechanism ECA module in one embodiment of the present invention.
[0050] Figure 5 The figure is a schematic diagram of an airborne agricultural implement identification device according to an embodiment of the present invention.
[0051] Figure 6 It is a schematic diagram of an agricultural vehicle according to an embodiment of the present invention.
[0052] Figure 7 This is a schematic diagram of collecting working condition images of airborne agricultural machinery in one embodiment of the present invention.
[0053] Figure 8 This is a comparison chart of edge device test results in one embodiment of the present invention.
[0054] Fig. 9 This is a comparison chart of edge device test results in another embodiment of the present invention.
[0055] Wherein, the reference numerals are:
[0056] 2: Feature extraction STEM module
[0057] 20: Convolutional Feedforward Network CFF Module
[0058] 21: Gated Linear Unit
[0059] 3: Feature extraction block
[0060] 30: Lightweight attention mechanism ECA module
[0061] 4: Downsampling module
[0062] 5, 5': Recognition results
[0063] 10: Airborne agricultural machinery identification device
[0064] 11: Collection Module
[0065] 12: Dataset building blocks
[0066] 13: Agricultural machinery recognition model building module
[0067] 131: Feature Extraction STEM Building Blocks
[0068] 132: Downsampling Building Blocks
[0069] 133: Feature extraction block building module
[0070] 14: Training Module
[0071] 15: Identification module
[0072] 20: Display device
[0073] 100: Agricultural Vehicles
[0074] 200: Body
[0075] 300: Chassis
[0076] 400: Drive device
[0077] 500: Control unit
[0078] 600: Agricultural machinery
[0079] S1-S5: Steps
[0080] S31-S33: Steps DETAILED DESCRIPTION
[0081] The technical solution of the present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments to further understand the purpose, solution and beneficial technical effects of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0082] It should be noted that, in this specification, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, article or device. In the absence of further restrictions, the elements defined by the statement "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0083] Certain words are used in the specification and the appended claims to refer to specific components or parts. It should be understood by those skilled in the art that technical users or manufacturers may refer to the same component or part by different nouns or terms. This specification and the appended claims do not distinguish components or parts by differences in names, but by differences in functions.
[0084] In the present invention, the directions or positional relationships indicated by the terms "upper", "lower", "left", "right", "front", "back", "top", "bottom", "inner", "outer", "middle", "vertical", "horizontal", "lateral", "longitudinal" and the like are based on the directions or positional relationships shown in the drawings. These terms are mainly used to better describe the present invention and its embodiments, and are not used to limit the indicated devices, elements or components to have a specific direction, or to be constructed and operated in a specific direction.
[0085] In addition, some of the above terms may be used to express other meanings in addition to indicating orientation or positional relationship. For example, the term "on" may also be used to express a certain dependency or connection relationship in some cases. For those skilled in the art, the specific meanings of these terms in the present invention can be understood according to specific circumstances.
[0086] In addition, the terms "installed", "set", "provided with", "connected", and "connected" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral structure; it can be a mechanical connection, or an electrical connection; it can be a direct connection, or an indirect connection through an intermediate medium, or it can be an internal connection between two devices, elements, or components. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0087] like Figure 1 As shown, in order to solve the above technical problems, the present invention discloses an onboard agricultural machinery identification method, comprising the following steps:
[0088] Step S1: Collect agricultural machinery working condition images; Step S2: Preprocess the agricultural machinery working condition images to obtain an agricultural machinery data set; Step S3: Construct an agricultural machinery recognition model based on a lightweight convolutional neural network RepViT framework, wherein Step S31: Use a convolutional feedforward network CFF module 20 to construct a feature extraction STEM module 2; Step S32: Use a convolutional feedforward network CFF module 20 to enhance a downsampling module 4; Step S33: Use a convolutional feedforward network CFF module 20 and a lightweight attention mechanism ECA module 30 to construct a feature extraction block 3; Step S4: Use a transfer learning method to train the agricultural machinery recognition model to obtain a trained agricultural machinery recognition model; Step S5: Deploy the trained agricultural machinery recognition model to an edge device and perform agricultural machinery recognition.
[0089] like Figure 7 As shown, in one embodiment, in step S1: collecting images of agricultural machinery working conditions, a high-definition vehicle-mounted camera or other high-resolution sensors are used to collect images of working conditions of different agricultural machinery, covering at least six working conditions of "deep plowing", "deep loosening", "seeding", "spraying", "harvesting" and "baling", to obtain a preliminary agricultural machinery dataset. In one embodiment, in step S2: when the agricultural machinery working condition images are preprocessed to obtain the agricultural machinery dataset, the collected agricultural machinery images are preprocessed, and the dataset is expanded using data enhancement techniques (such as geometric transformation, noise addition, color transformation, image cropping, and copy-paste, etc.). Afterwards, the image quality is enhanced by image processing methods (such as contrast enhancement, image denoising, automatic enhancement, etc.) to improve its recognition accuracy in complex environments. The training set and the test set are divided into a ratio of 8:2.
[0090] like Figure 2As shown, in the architecture of the agricultural machinery recognition model in one embodiment of the present invention, a feature extraction STEM module 2, multiple feature extraction blocks 3 (3 in this embodiment), 3 downsampling modules 4 corresponding to fast feature extraction, a pooling layer and a fully connected layer. The feature extraction STEM module 2 includes 2 3×3 depth convolutions and early convolutions of the activation function to increase the number of channels to reduce delays and improve the stability of optimization. After the early convolution, the convolution feedforward network CFF module 20 is connected. In the downsampling module 4, the corresponding feature extraction block 3 undergoes a 3×3 depth convolution with a step size of 2, and a 1×1 depth convolution, and then enters the convolution feedforward network CFF module 20. In the downsampling module, 3×3 DW convolutions and 1×1 convolutions are used for spatial downsampling, while further increasing the number of channels. In one embodiment, the feature extraction block 3 includes 3×3 deep convolution, 1×1 convolution, embedded ECA module and convolution feedforward network CFF module 20. After the 3×3 deep convolution, 1×1 convolution and input feature map of the feature extraction block 3 are fused, they pass through the lightweight attention mechanism ECA module 30 and the convolution feedforward network CFF module 20. Finally, the feature map output by the downsampling module 4 is processed by the global average pooling layer and the fully connected layer to generate the recognition and classification results of agricultural machinery. In one embodiment, the type of agricultural machinery is identified, and the model is allowed to learn the characteristics of different agricultural machinery. After the agricultural machinery is identified, the recognition results are processed in other subsequent links of smart agriculture. For example, after identifying that a tractor is equipped with a seed drill, suitable seeding tasks and their optimal route planning, equipment scheduling, precision agriculture support, and collaborative operations can be automatically generated to achieve automation and efficient operations.
[0091] In one embodiment, the step of constructing the feature extraction STEM module 2 by using the convolutional feed-forward network CFF module 20 further includes:
[0092] The convolutional feedforward network CFF module 20 is used to replace the feedforward network FFN module in the feature extraction STEM module 2.
[0093] In one embodiment, the step of enhancing the downsampling module 4 using the convolutional feed-forward network CFF module 20 further includes:
[0094] The convolutional feedforward network CFF module 20 is used to replace the feedforward network FFN module in the downsampling module 4.
[0095] In one embodiment, the step of constructing the feature extraction block 3 using the convolutional feedforward network CFF module 20 and the lightweight attention mechanism ECA module 30 further includes:
[0096] Use a convolutional feedforward network CFF module 20 to replace the feedforward network FFN module in the downsampling module 4;
[0097] A lightweight attention mechanism ECA module 30 is added before the convolutional feedforward network CFF module 20.
[0098] like Figure 3 As shown, in one embodiment, the step of constructing the convolutional feedforward network CFF module 20 further includes:
[0099] The convolutional feed-forward network CFF module 20 is constructed by embedding a gated linear unit (GLU) 21.
[0100] In one embodiment, the step of constructing the convolutional feed-forward network CFF module 20 by embedding the gated linear unit 21 further includes:
[0101] Transmitting the first input image data to the first branch and the second branch of the door control linear unit 21 respectively;
[0102] The first input image data is processed by a first linear mapping, a depth convolution and an activation function in the first branch in sequence to obtain a first branch processing result;
[0103] The first input image data is processed by a second linear mapping in the second branch to obtain a second branch processing result;
[0104] Performing a dot product operation on the first branch processing result and the second branch processing result;
[0105] The result after the dot product operation is fused with the first input image data after a third linear mapping.
[0106] The original feedforward network FFN structure is usually used as a channel mixer in visual algorithm models. It mainly consists of two linear layers and an intermediate activation function to capture feature information. Each feature processed by the CFF structure is assigned a unique gating signal by its nearest fine-grained feature, which is used to optimize the problem of the global average pooling module being too coarse-grained. This design can not only provide position encoding for the model through deep convolution, but also keep the model at the same depth as GLU and maintain good back propagation. The computational complexity of CFF is 2RHWC 2 +2 / 3RHWCk 2 (H, W, C represent the height, width and number of channels of the input feature map, respectively, the expansion ratio is R, and the convolution kernel size is k×k), the structure is simple and robust, so that the model can remain lightweight. In this embodiment, the convolution feedforward network CFF module 20 can improve the fine-grained feature extraction capability of the model, especially in the farmland environment where the background is complex and the model recognition is difficult, so it can effectively increase the model's extraction of image detail information.
[0107] like Figure 4As shown, in one embodiment, the step of constructing the lightweight attention mechanism ECA module 30 further includes:
[0108] Step: Perform global average pooling (GAP) on the second input image data to obtain a vector description;
[0109] When a feature map (i.e., the second input image data) is input, the lightweight attention mechanism ECA module 30 first obtains a 1*1*C description vector Z through GAP, and GAP compresses the features of the input feature map in the spatial dimension. As shown in Formula 1, H, W, and C represent the height, width, and number of channels of the input feature map, respectively.
[0110]
[0111] Where X c (i, j) represents the eigenvalue of position (i, j) on c channels, z c Represents the description vector obtained after GAP processing.
[0112] Step: dynamically performing local cross-channel interaction based on the channel dimension according to the vector description;
[0113] When local cross-channel interaction occurs, 1D convolution is used to perform local interaction in the channel dimension. The 1D convolution kernel size k is dynamically obtained based on the number of channels C as shown in Formula 2.
[0114]
[0115] Where γ is the global average pooling output coefficient, b is the adaptive convolution kernel bias, and k is the convolution kernel size;
[0116] Steps: Get the weights of each channel;
[0117] The adaptive convolution kernel is embedded in the one-dimensional convolution to obtain the adaptive weight of each channel. A one-dimensional convolution operation with a convolution kernel size of k is performed, and the weight of each channel is obtained through the Sigmoid activation function, as shown in Formula 3.
[0118] S c =Sig(Conv1D(z c )) (3)
[0119] Step: Multiply the weight of each channel by the second input image data channel by channel to obtain a feature map after high-dimensional extraction by the attention mechanism.
[0120] S c With the original feature X c Multiply each channel to obtain the feature map extracted in high dimension through the ECA attention mechanism As shown in formula 4:
[0121]
[0122] In this embodiment, the lightweight attention mechanism ECA module 30 effectively improves the accuracy of the model while avoiding dimensionality reduction, which directly and effectively reduces the overall parameter amount of the model.
[0123] In one embodiment of the method of the present invention, it also includes:
[0124] Delete the redundant feature extraction block 3.
[0125] In a preferred embodiment, keeping three feature extraction blocks 3 is the best, so the redundant feature extraction modules are deleted in the backbone (the original lightweight convolutional neural network RepViT framework uses four feature extraction blocks 3). Through the above implementation, high performance is maintained in the agricultural machinery recognition task while reducing the model delay.
[0126] In one embodiment, step S4: using a transfer learning method to train the agricultural machinery recognition model to obtain a trained agricultural machinery recognition model:
[0127] Transfer learning is a commonly used training strategy. This method pre-trains on a large model dataset, then migrates the backbone feature module to a specific dataset and fine-tunes it, thereby quickly building a new model. In one embodiment, the present invention uses Stanford Cars Datasets as a network pre-training model, and migrates the convolution parameters and weights of the model to the agricultural machinery recognition task. Stanford Cars Datasets is a fine-grained vehicle classification dataset developed by the Artificial Intelligence Laboratory of Stanford University, containing 196 types of car types, 16,158 different types of car pictures, of which 8,144 are training sets and 8,041 are test sets.
[0128] Through the prior knowledge obtained through training, efficient model building can be achieved in similar recognition tasks. Secondly, the parameters of the model are fine-tuned during the transfer training process, and the new task is trained through the established agricultural machinery dataset. Finally, the output of the network is converted into at least 6 types of outputs suitable for the agricultural machinery classification task (six working conditions of "deep plowing", "deep loosening", "seeding", "spraying", "harvesting" and "baling"), so as to achieve accurate prediction of the agricultural machinery recognition task.
[0129] The present invention uses a combination of pre-training and parameter fine-tuning to transfer learning of the model. Pre-training is used to quickly learn and acquire common features, enriching the shallow feature extraction capabilities. On the other hand, Fine-tuning is used to optimize the feature extraction capabilities of small data sets of agricultural machinery, increase model accuracy and generalization capabilities, and provide a basis for the subsequent development of more agricultural machinery recognition categories.
[0130] In one embodiment, step S5: deploying the trained agricultural implement recognition model to an edge device (such as Jetson Nano) and performing agricultural implement recognition.
[0131] Experimental comparison:
[0132] like Figures 8 to 9 As shown, the airborne agricultural machinery recognition model (TMAInet) of the present invention has a significant positive effect in the recognition of agricultural machinery working conditions, especially in terms of recognition accuracy, computational efficiency and practical application capabilities, and has many advantages over traditional technologies. Taking sowing, harvesting and deep tillage agricultural machinery as an example, in the recognition result 5 of the TMAInet model, the probabilities of recognizing sowing, harvesting and deep tillage agricultural machinery are 0.91, 0.88 and 0.87 respectively, while in the recognition result 5' of the RepViT model, the probabilities of recognizing sowing, harvesting and deep tillage agricultural machinery are 0.72, 0.54 and 0.37 respectively. The recognition accuracy of the TMAInet model is significantly higher than that of the RepViT model.
[0133] In summary, first of all, the TMAInet model significantly improves the recognition accuracy. By adopting the pre-training and fine-tuning (Pre-training + Fine-tuning) transfer learning method, the model's recognition accuracy reached 99.13%, the F1 score was 98.53, and the recall rate was 98.78. Compared with the existing RepViT model, TMAInet improved the recognition accuracy, F1 score and recall rate by 1.86%, 3.04% and 1.95% respectively. This significant performance improvement enables the model to more accurately identify the working status of agricultural machinery in practical applications, thereby effectively improving the level of intelligent agricultural management.
[0134] The TMAInet model has high computational efficiency, especially on edge devices. By introducing the convolutional feedforward network CFF module 20 and the lightweight attention mechanism ECA module 30, the model reduces the amount of computation while maintaining efficient recognition performance. After optimization, the model's parameters are compressed to 7.3M, and when deployed on the Jetson Nano edge device, it can achieve a high recognition speed of 73 frames per second, meeting the needs of real-time monitoring in actual field operations. This feature enables TMAInet to run efficiently on low-power, resource-constrained edge devices, solving the problem of excessive computing resource requirements in traditional methods.
[0135] The TMAInet model of the present invention has good mobility and adaptability. By fine-tuning the data of agricultural machinery in different working states, the model can adapt to the complex and changeable field environment and realize accurate identification of different agricultural machinery. Its lightweight design allows the model to be easily deployed on various edge devices and has good portability. Compared with the existing technology, the efficient operation and low latency characteristics of TMAInet on the edge device side provide strong technical support for applications such as intelligent agriculture and unmanned farm management.
[0136] like Figure 5 As shown, the present invention further provides an onboard agricultural implement identification device 10, which is used to implement any of the above methods, including:
[0137] A collection module 11 is used to collect images of working conditions of agricultural machinery;
[0138] A data set construction module 12, used for preprocessing the agricultural machinery working condition image to obtain an agricultural machinery data set;
[0139] The agricultural machinery recognition model building module 13 is used to build an agricultural machinery recognition model based on a lightweight convolutional neural network RepViT framework, which includes:
[0140] A feature extraction STEM construction module 131 is used to construct a feature extraction STEM module 2 using a convolutional feed-forward network CFF module 20;
[0141] A downsampling construction module 132 for enhancing the downsampling module 4 using a convolutional feed-forward network CFF module 20;
[0142] A feature extraction block construction module 133 is used to construct a feature extraction block 3 using a convolutional feedforward network CFF module 20 and a lightweight attention mechanism ECA module 30;
[0143] A training module 14 is used to train the agricultural machinery recognition model using a transfer learning method to obtain a trained agricultural machinery recognition model;
[0144] The recognition module 15 is used to deploy the trained agricultural machinery recognition model to the edge device and perform agricultural machinery recognition.
[0145] like Figure 6 As shown, the present invention also provides an agricultural vehicle 100, including a body 200, a chassis 300 connected to the body 200, a driving device 400 connected to the chassis 300, a control unit 500 arranged in the body 200, and an agricultural implement 600 connected to the body 200, and also includes the aforementioned airborne agricultural implement identification device 10, and the airborne agricultural implement identification device 10 is connected to the control unit 500.
[0146] The present invention also provides a storage medium for storing a computer control program, wherein the computer control program is used to execute the steps of any of the aforementioned methods.
[0147] It should be understood that the storage medium in the embodiment of the present invention may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may 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), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct rambus RAM (DR RAM).
[0148] The present invention proposes an airborne agricultural machinery recognition method, device and agricultural vehicle, which construct an agricultural machinery recognition model through a convolutional feedforward network CFF module and a lightweight attention mechanism ECA module, thereby reducing the number of model parameters, improving the response speed of deploying the agricultural machinery recognition model on edge devices, and improving recognition accuracy.
[0149] In summary, the present invention may have many other embodiments. Without departing from the spirit and essence of the present invention, technicians familiar with the field can evolve various corresponding changes and deformations based on the present invention, but these corresponding changes and deformations should all fall within the scope of protection of the patent applied for the present invention.
Claims
1. A method for identifying an airborne agricultural implement, characterized in that: The following steps are involved: Collect images of agricultural machinery working conditions; Preprocessing the agricultural machinery working condition images to obtain an agricultural machinery dataset; Construct an agricultural machinery recognition model based on the lightweight convolutional neural network RepViT framework, where Use the convolutional feedforward network CFF module to build the feature extraction STEM module; Use the convolutional feed-forward network CFF module to enhance the downsampling module; Use the convolutional feedforward network CFF module and the lightweight attention mechanism ECA module to build the feature extraction block; Using a transfer learning method to train the agricultural machinery recognition model to obtain a trained agricultural machinery recognition model; The trained agricultural machinery recognition model is deployed to the edge device to perform agricultural machinery recognition.
2. The method according to claim 1, characterized in that The step of constructing a convolutional feedforward network CFF module further includes: The convolutional feed-forward network CFF module is constructed by embedding a gated linear unit.
3. The method according to claim 2, characterized in that The step of constructing the convolutional feed-forward network CFF module by embedding a gated linear unit further comprises: Transmitting the first input image data to the first branch and the second branch of the entry control linear unit respectively; The first input image data is processed by a first linear mapping, a depth convolution and an activation function in the first branch in sequence to obtain a first branch processing result; The first input image data is processed by a second linear mapping in the second branch to obtain a second branch processing result; Performing a dot product operation on the first branch processing result and the second branch processing result; The result after the dot product operation is fused with the first input image data after a third linear mapping.
4. The method according to claim 1, 2 or 3, characterized in that: The steps of constructing a feature extraction STEM module by using a convolutional feed-forward network CFF module further include: The convolutional feedforward network CFF module is used to replace the feedforward network FFN module in the feature extraction STEM module.
5. The method according to claim 1, 2 or 3, characterized in that: The step of using a convolutional feed-forward network CFF module to enhance the downsampling module further includes: The convolutional feedforward network CFF module is used to replace the feedforward network FFN module in the downsampling module.
6. The method according to claim 1, 2 or 3, characterized in that: The step of using the convolutional feedforward network CFF module and the lightweight attention mechanism ECA module to construct a feature extraction block further includes: Use a convolutional feedforward network CFF module to replace the feedforward network FFN module in the downsampling module; A lightweight attention mechanism ECA module is added before the convolutional feedforward network CFF module.
7. The method according to claim 6, characterized in that The steps of constructing the lightweight attention mechanism ECA module further include: Perform global average pooling on the second input image data to obtain a vector description; Dynamically performing local cross-channel interaction based on channel dimensions according to the vector description; Get the weight of each channel; The weight of each channel is multiplied by the second input image data channel by channel to obtain a feature map after high-dimensional extraction by the attention mechanism.
8. The method according to any one of claims 1, 2, 3 and 7, characterized in that: Also includes: The redundant feature extraction blocks are deleted.
9. An onboard agricultural implement identification device, used to implement the method according to any one of claims 1 to 8, characterized in that: include: A collection module, used for collecting images of working conditions of agricultural machinery; A data set construction module, used for preprocessing the agricultural machinery working condition images to obtain an agricultural machinery data set; The agricultural machinery recognition model building module is used to build an agricultural machinery recognition model based on the lightweight convolutional neural network RepViT framework, which includes: A feature extraction STEM building module is used to build a feature extraction STEM module using a convolutional feed-forward network CFF module; Downsampling building block for enhancing downsampling modules using convolutional feed-forward network (CFF) modules; Feature extraction block building module, used to build feature extraction blocks using convolutional feedforward network CFF module and lightweight attention mechanism ECA module; A training module, used to train the agricultural machinery recognition model using a transfer learning method to obtain a trained agricultural machinery recognition model; The recognition module is used to deploy the trained agricultural machinery recognition model to the edge device and perform agricultural machinery recognition.
10. An agricultural vehicle, comprising a vehicle body, a chassis connected to the vehicle body, a driving device connected to the chassis, a control unit disposed in the vehicle body, and an agricultural implement connected to the vehicle body, wherein: It also includes the onboard agricultural machinery identification device as claimed in claim 9, wherein the onboard agricultural machinery identification device is connected to the control unit.
11. A storage medium for storing a computer control program, characterized in that: The computer control program is used to execute the steps of the method according to any one of claims 1 to 8.